@abi-software/flatmapvuer 1.11.1 → 1.11.3
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
CHANGED
|
@@ -2,7 +2,7 @@ import { Loading as Ts, CircleCheck as Dl, CircleClose as As, Close as si, Arrow
|
|
|
2
2
|
import { getCurrentScope as Nl, onScopeDispose as _s, unref as v, getCurrentInstance as ge, onMounted as pe, nextTick as ce, ref as _, readonly as Ls, watch as W, warn as Bl, watchEffect as xs, onBeforeUnmount as Be, inject as q, computed as b, isRef as lt, shallowRef as ho, onBeforeMount as Vl, provide as fe, defineComponent as B, openBlock as S, createElementBlock as x, mergeProps as Nt, renderSlot as H, toRef as Je, onUnmounted as zl, createBlock as V, Transition as Bn, withCtx as k, withDirectives as ie, createElementVNode as R, normalizeClass as P, normalizeStyle as se, vShow as Ee, Fragment as he, createVNode as L, reactive as ut, onActivated as Hl, onUpdated as jl, resolveDynamicComponent as Re, createCommentVNode as z, cloneVNode as Kl, Text as Fs, Comment as Ul, Teleport as Wl, onDeactivated as ql, toDisplayString as ne, useSlots as Eo, toRaw as vo, withModifiers as le, vModelCheckbox as mo, createTextVNode as Z, toRefs as un, vModelRadio as Rs, h as Yt, createSlots as $s, resolveComponent as Fe, resolveDirective as Gl, toHandlerKey as Jl, renderList as Ye, withKeys as Cn, vModelText as Yl, createApp as Zl, createStaticVNode as Ql, markRaw as Ge } from "vue";
|
|
3
3
|
import { MapSvgIcon as Xl, MapSvgSpriteColor as eu } from "@abi-software/svg-sprite";
|
|
4
4
|
import { Tooltip as tu, TreeControls as nu, DrawToolbar as ou, fetchLabels as iu, getFlatmapFilterOptions as au } from "@abi-software/map-utilities";
|
|
5
|
-
import * as Ds from "https://cdn.jsdelivr.net/npm/@abi-software/flatmap-viewer@4.
|
|
5
|
+
import * as Ds from "https://cdn.jsdelivr.net/npm/@abi-software/flatmap-viewer@4.3.0/+esm";
|
|
6
6
|
import { AnnotationService as su } from "@abi-software/sparc-annotation";
|
|
7
7
|
import { defineStore as ru, mapState as lu } from "pinia";
|
|
8
8
|
const it = (e, t, { checkForDefaultPrevented: n = !0 } = {}) => (i) => {
|
|
@@ -10328,14 +10328,7 @@ const Ii = new Sb(), Cb = "cannot be found on the map.", Eb = (e) => {
|
|
|
10328
10328
|
},
|
|
10329
10329
|
requiresDrawer: function() {
|
|
10330
10330
|
var e, t, n, o;
|
|
10331
|
-
|
|
10332
|
-
return this.drawerOpen = !1, !1;
|
|
10333
|
-
if (this.isFC) {
|
|
10334
|
-
if (((e = this.systems) == null ? void 0 : e.length) > 0 || this.containsAlert && this.alertOptions || ((t = this.pathways) == null ? void 0 : t.length) > 0 || ((n = this.taxonConnectivity) == null ? void 0 : n.length) > 0 || ((o = this.legendEntry) == null ? void 0 : o.length) > 0)
|
|
10335
|
-
return this.drawerOpen = !0, !0;
|
|
10336
|
-
} else
|
|
10337
|
-
return this.drawerOpen = !0, !0;
|
|
10338
|
-
return this.drawerOpen = !1, !1;
|
|
10331
|
+
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 || ((n = this.taxonConnectivity) == null ? void 0 : n.length) > 0 || ((o = this.legendEntry) == null ? void 0 : o.length) > 0 ? (this.drawerOpen = !0, !0) : (this.drawerOpen = !1, !1);
|
|
10339
10332
|
},
|
|
10340
10333
|
modeDescription: function() {
|
|
10341
10334
|
let e = this.viewingModes[this.viewingMode];
|
|
@@ -11125,7 +11118,7 @@ function $b(e, t, n, o, i, a) {
|
|
|
11125
11118
|
[j, e.loading]
|
|
11126
11119
|
]);
|
|
11127
11120
|
}
|
|
11128
|
-
const yl = /* @__PURE__ */ Wn(Ib, [["render", $b], ["__scopeId", "data-v-
|
|
11121
|
+
const yl = /* @__PURE__ */ Wn(Ib, [["render", $b], ["__scopeId", "data-v-6afc0531"]]), ks = {
|
|
11129
11122
|
"NCBITaxon:10114": "01fedbf9-d783-509c-a10c-827941ab13da",
|
|
11130
11123
|
"NCBITaxon:9823": "a336ac04-24db-561f-a25f-1c994fe17410",
|
|
11131
11124
|
"NCBITaxon:9606": "42ed6323-f645-5fbe-bada-9581819cf689",
|
|
@@ -11810,7 +11803,7 @@ function zb(e, t, n, o, i, a) {
|
|
|
11810
11803
|
])), 128))
|
|
11811
11804
|
], 512);
|
|
11812
11805
|
}
|
|
11813
|
-
const Gb = /* @__PURE__ */ Wn(Db, [["render", zb], ["__scopeId", "data-v-
|
|
11806
|
+
const Gb = /* @__PURE__ */ Wn(Db, [["render", zb], ["__scopeId", "data-v-d3d2df18"]]);
|
|
11814
11807
|
export {
|
|
11815
11808
|
yl as FlatmapVuer,
|
|
11816
11809
|
Gb as MultiFlatmapVuer
|
package/dist/flatmapvuer.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(H,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("@element-plus/icons-vue"),require("vue"),require("@abi-software/svg-sprite"),require("@abi-software/map-utilities"),require("https://cdn.jsdelivr.net/npm/@abi-software/flatmap-viewer@4.
|
|
1
|
+
(function(H,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("@element-plus/icons-vue"),require("vue"),require("@abi-software/svg-sprite"),require("@abi-software/map-utilities"),require("https://cdn.jsdelivr.net/npm/@abi-software/flatmap-viewer@4.3.0/+esm"),require("@abi-software/sparc-annotation"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","@element-plus/icons-vue","vue","@abi-software/svg-sprite","@abi-software/map-utilities","https://cdn.jsdelivr.net/npm/@abi-software/flatmap-viewer@4.3.0/+esm","@abi-software/sparc-annotation","pinia"],K):(H=typeof globalThis<"u"?globalThis:H||self,K(H.FlatmapVuer={},H["@element-plus/icons-vue"],H.Vue,H["@abi-software/svg-sprite"],H["@abi-software/map-utilities"],H.flatmap,H["@abi-software/sparc-annotation"],H.pinia))})(this,function(H,K,n,mi,Pt,ks,Es,gi){"use strict";function Is(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const yi=Is(ks),Ae=(e,t,{checkForDefaultPrevented:o=!0}={})=>a=>{const r=e==null?void 0:e(a);if(o===!1||!r)return t==null?void 0:t(a)};var bi;const U=typeof window<"u",Ts=e=>typeof e=="string",wi=()=>{},to=U&&((bi=window==null?void 0:window.navigator)==null?void 0:bi.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function no(e){return typeof e=="function"?e():n.unref(e)}function As(e){return e}function _t(e){return n.getCurrentScope()?(n.onScopeDispose(e),!0):!1}function Os(e,t=!0){n.getCurrentInstance()?n.onMounted(e):t?e():n.nextTick(e)}function Ci(e,t,o={}){const{immediate:i=!0}=o,a=n.ref(!1);let r=null;function s(){r&&(clearTimeout(r),r=null)}function l(){a.value=!1,s()}function c(...d){s(),a.value=!0,r=setTimeout(()=>{a.value=!1,r=null,e(...d)},no(t))}return i&&(a.value=!0,U&&c()),_t(l),{isPending:n.readonly(a),start:c,stop:l}}function Oe(e){var t;const o=no(e);return(t=o==null?void 0:o.$el)!=null?t:o}const un=U?window:void 0;function he(...e){let t,o,i,a;if(Ts(e[0])||Array.isArray(e[0])?([o,i,a]=e,t=un):[t,o,i,a]=e,!t)return wi;Array.isArray(o)||(o=[o]),Array.isArray(i)||(i=[i]);const r=[],s=()=>{r.forEach(f=>f()),r.length=0},l=(f,u,p,g)=>(f.addEventListener(u,p,g),()=>f.removeEventListener(u,p,g)),c=n.watch(()=>[Oe(t),no(a)],([f,u])=>{s(),f&&r.push(...o.flatMap(p=>i.map(g=>l(f,p,g,u))))},{immediate:!0,flush:"post"}),d=()=>{c(),s()};return _t(d),d}let vi=!1;function Ms(e,t,o={}){const{window:i=un,ignore:a=[],capture:r=!0,detectIframe:s=!1}=o;if(!i)return;to&&!vi&&(vi=!0,Array.from(i.document.body.children).forEach(p=>p.addEventListener("click",wi)));let l=!0;const c=p=>a.some(g=>{if(typeof g=="string")return Array.from(i.document.querySelectorAll(g)).some(h=>h===p.target||p.composedPath().includes(h));{const h=Oe(g);return h&&(p.target===h||p.composedPath().includes(h))}}),f=[he(i,"click",p=>{const g=Oe(e);if(!(!g||g===p.target||p.composedPath().includes(g))){if(p.detail===0&&(l=!c(p)),!l){l=!0;return}t(p)}},{passive:!0,capture:r}),he(i,"pointerdown",p=>{const g=Oe(e);g&&(l=!p.composedPath().includes(g)&&!c(p))},{passive:!0}),s&&he(i,"blur",p=>{var g;const h=Oe(e);((g=i.document.activeElement)==null?void 0:g.tagName)==="IFRAME"&&!(h!=null&&h.contains(i.document.activeElement))&&t(p)})].filter(Boolean);return()=>f.forEach(p=>p())}function Si(e,t=!1){const o=n.ref(),i=()=>o.value=!!e();return i(),Os(i,t),o}const ki=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ei="__vueuse_ssr_handlers__";ki[Ei]=ki[Ei]||{};var Ii=Object.getOwnPropertySymbols,xs=Object.prototype.hasOwnProperty,Bs=Object.prototype.propertyIsEnumerable,Ns=(e,t)=>{var o={};for(var i in e)xs.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Ii)for(var i of Ii(e))t.indexOf(i)<0&&Bs.call(e,i)&&(o[i]=e[i]);return o};function Re(e,t,o={}){const i=o,{window:a=un}=i,r=Ns(i,["window"]);let s;const l=Si(()=>a&&"ResizeObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},d=n.watch(()=>Oe(e),u=>{c(),l.value&&a&&u&&(s=new ResizeObserver(t),s.observe(u,r))},{immediate:!0,flush:"post"}),f=()=>{c(),d()};return _t(f),{isSupported:l,stop:f}}var Ti=Object.getOwnPropertySymbols,Ps=Object.prototype.hasOwnProperty,_s=Object.prototype.propertyIsEnumerable,Ls=(e,t)=>{var o={};for(var i in e)Ps.call(e,i)&&t.indexOf(i)<0&&(o[i]=e[i]);if(e!=null&&Ti)for(var i of Ti(e))t.indexOf(i)<0&&_s.call(e,i)&&(o[i]=e[i]);return o};function Vs(e,t,o={}){const i=o,{window:a=un}=i,r=Ls(i,["window"]);let s;const l=Si(()=>a&&"MutationObserver"in a),c=()=>{s&&(s.disconnect(),s=void 0)},d=n.watch(()=>Oe(e),u=>{c(),l.value&&a&&u&&(s=new MutationObserver(t),s.observe(u,r))},{immediate:!0}),f=()=>{c(),d()};return _t(f),{isSupported:l,stop:f}}var Ai;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Ai||(Ai={}));var Rs=Object.defineProperty,Oi=Object.getOwnPropertySymbols,Fs=Object.prototype.hasOwnProperty,Ds=Object.prototype.propertyIsEnumerable,Mi=(e,t,o)=>t in e?Rs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,$s=(e,t)=>{for(var o in t||(t={}))Fs.call(t,o)&&Mi(e,o,t[o]);if(Oi)for(var o of Oi(t))Ds.call(t,o)&&Mi(e,o,t[o]);return e};$s({linear:As},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});/**
|
|
2
2
|
* @vue/shared v3.5.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
@@ -21,4 +21,4 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:i,curr
|
|
|
21
21
|
where source="${si(e)}" and
|
|
22
22
|
knowledge like "%${t}%" order by source desc`;return(await o.queryKnowledge(a)).map(c=>JSON.parse(c)).map(c=>c.id)}function si(e){return Cy(e.provenance)}function Cy(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 vy(e,t){const o=si(e),i=`select knowledge from knowledge
|
|
23
23
|
where source="${o}"
|
|
24
|
-
order by source desc`;us();const a=sessionStorage.getItem("flatmap-knowledge"),r=sessionStorage.getItem("flatmap-knowledge-source");if(!a||r!==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),Sy(),l}return JSON.parse(a)}function Sy(){const o=new Date().getTime()+864e5;sessionStorage.setItem("flatmap-knowledge-expiry",o)}function ky(){["flatmap-knowledge","flatmap-knowledge-expiry","flatmap-knowledge-source"].forEach(t=>{sessionStorage.removeItem(t)})}function us(){const e=sessionStorage.getItem("flatmap-knowledge-expiry");new Date().getTime()>e&&ky()}const li=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),Ey='<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 ps={exports:{}};(function(e,t){(function(o,i){e.exports=i()})(typeof window<"u"?window:pm,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)},a=o.cancelAnimationFrame||o.mozCancelAnimationFrame||o.webkitCancelAnimationFrame||function(f){o.clearTimeout(f)};function r(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(w){m.push(w)};var y,b;this.call=function(w){for(y=0,b=m.length;y<b;y++)m[y].call(this,w)},this.remove=function(w){var T=[];for(y=0,b=m.length;y<b;y++)m[y]!==w&&T.push(m[y]);m=T},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%"},w={position:"absolute",left:"0px",top:"0px",transition:"0s"};l(m.resizeSensor,b);var T=document.createElement("div");T.className="resize-sensor-expand",l(T,b);var k=document.createElement("div");l(k,w),T.appendChild(k);var v=document.createElement("div");v.className="resize-sensor-shrink",l(v,b);var E=document.createElement("div");l(E,w),l(E,{width:"200%",height:"200%"}),v.appendChild(E),m.resizeSensor.appendChild(T),m.resizeSensor.appendChild(v),m.appendChild(m.resizeSensor);var I=window.getComputedStyle(m),M=I?I.getPropertyValue("position"):null;M!=="absolute"&&M!=="relative"&&M!=="fixed"&&M!=="sticky"&&(m.style.position="relative");var x=!1,B=0,S=s(m),P=0,L=0,q=!0;p=0;var F=function(){var Z=m.offsetWidth,ce=m.offsetHeight;k.style.width=Z+10+"px",k.style.height=ce+10+"px",T.scrollLeft=Z+10,T.scrollTop=ce+10,v.scrollLeft=Z+10,v.scrollTop=ce+10},O=function(){if(q){var Z=m.offsetWidth===0&&m.offsetHeight===0;if(Z){p||(p=i(function(){p=0,O()}));return}else q=!1}F()};m.resizeSensor.resetSensor=O;var $=function(){B=0,x&&(P=S.width,L=S.height,m.resizedAttached&&m.resizedAttached.call(S))},pe=function(){S=s(m),x=S.width!==P||S.height!==L,x&&!B&&(B=i($)),O()},Y=function(Z,ce,Ee){Z.attachEvent?Z.attachEvent("on"+ce,Ee):Z.addEventListener(ce,Ee)};Y(T,"scroll",pe),Y(v,"scroll",pe),p=i(function(){p=0,O()})}}r(f,function(m){h(m,u)}),this.detach=function(m){p||(a(p),p=0),c.detach(f,m)},this.reset=function(){f.resizeSensor.resetSensor()}};if(c.reset=function(f){r(f,function(u){u.resizeSensor.resetSensor()})},c.detach=function(f,u){r(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})})(ps);var Iy=ps.exports;const Ty=hm(Iy),Ay=gi.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}});function Oy(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(a){a(o)}),(i=e.get("*"))&&i.slice().map(function(a){a(t,o)})}}}const ci=new Oy,My="cannot be found on the map.",xy=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},hs=(e,t)=>{const o=[];let i=e.organs?e.organs:e.ftus;const a=i?i.filter((r,s)=>i.findIndex(l=>l.label===r.label)===s):void 0;return a&&a.forEach(r=>{const s={label:r.label,models:r.models,key:`${t}.${r.label}`},l=hs(r,s.key);l.length>0&&(s.children=l),o.push(s)}),o},By={name:"FlatmapVuer",components:{Button:Fr,Col:en,Loading:Jg,Radio:Xr,Icon:ke,RadioGroup:es,Row:Xt,Select:Hn,Dialog:hg,MapSvgIcon:mi.MapSvgIcon,MapSvgSpriteColor:mi.MapSvgSpriteColor,Tooltip:Pt.Tooltip,TreeControls:Pt.TreeControls,SelectionsGroup:fs,SvgLegends:my,ElIconWarningFilled:K.WarningFilled,ElIconArrowDown:K.ArrowDown,ElIconArrowLeft:K.ArrowLeft,DrawToolbar:Pt.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(e){let t=n.inject("$annotator");return t||(t=n.markRaw(new Es.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&&(e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter())},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(a=>a.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()},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},a=hs(o,i.key);a.length>0&&(i.children=a),t.children.push(i)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,ai(this.mapImp,e).then(o=>{o.length&&o.forEach(i=>{let a=!0;t&&(a=t.checkAll?!0:t.checked.includes(i.taxon)),this.taxonConnectivity.push({...i,enabled:a}),this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(i.taxon,a)})})},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,a,r,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=(a=p==null?void 0:p.ids)==null?void 0:a.dendrites.flat(1/0),h=(r=p==null?void 0:p.ids)==null?void 0:r.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 a=e.key==="alert"?{HAS:"alert"}:{NOT:{HAS:"alert"}};t={OR:[i,{AND:[o,a]}]}}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={}},eventCallback:function(){return(e,t,...o)=>{if(e==="annotation"){const i={feature:t,userData:o,eventType:e};this.annotationEventCallback(i,t)}else if(e!=="pan-zoom"){const i=t.label,a=[t.models],r=this.entry,s=this.biologicalSex,l=t.alert;let c;t.taxons&&(typeof t.taxons!="object"?c=JSON.parse(t.taxons):c=t.taxons);let d=[{dataset:t.dataset,biologicalSex:s,taxonomy:r,resource:a,label:i,feature:t,userData:o,eventType:e,provenanceTaxonomy:c,alert:l}];if(e==="click"){const f=Object.keys(t).includes("id");if(!f){d=[];const p=t.mapUUID,g=new Set;for(let[h,m]of Object.entries(t))if(h!=="mapUUID"){const y=m.id,b=m.label,w=[m.models];let T;if(m.taxons&&(typeof m.taxons!="object"?T=JSON.parse(m.taxons):T=m.taxons),g.has(y))continue;g.add(y),d.push({dataset:m.dataset,biologicalSex:s,taxonomy:r,resource:w,label:b,feature:m,userData:o,eventType:e,provenanceTaxonomy:T,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])))}}}}else e==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=t.models?t.models:"");t&&t.type!=="marker"&&e==="click"&&!this.activeDrawTool&&this.checkAndCreatePopups(d),this.$emit("resource-selected",d)}else this.$emit("pan-zoom-callback",t)}},setConnectivityDataSource:function(e,t){this.connectivityDataSource=t.source,(e==="Neuron Connection"||e==="Annotation")&&(this.connectivityDataSource=t.featureId)},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,a)=>{const{label:r}=i;if(o.append(li(r)),a+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=[],a=[],r=[],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;r.push({featureId:h,...p})}else s.push(p)}),r.length){let p=r[0].featureId;this.mapImp.annotations.forEach(g=>{const h=g["anatomical-nodes"];if(h){const m=h.join("");r.every(b=>m.indexOf(b.id)!==-1)&&(p=g.featureId,a.push(p))}}),this.createTooltipForConnectivity(r,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),...a];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 by(e):o=await wy(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:My}})},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(a=>a.feature).map(a=>a.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(a=>{var r;this.annotationEntry.push({...a,resourceId:this.serverURL,featureId:a.featureId?a.featureId:(r=a.feature)==null?void 0:r.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,xy(i[0].feature.geometry))):this.rollbackAnnotationEvent();else{const a=this.annotationEntry.filter(r=>r.featureId&&r.models).map(r=>r.models);a.length>0&&this.displayTooltip(a)}else this.annotation={}}else if(this.viewingMode==="Neuron Connection"&&t){const i=e.map(r=>r.resource[0]);if(i.find(r=>!r.startsWith("ilxtr:"))){const r=Array.isArray(i)?[...i]:[i];r.length===1&&r.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=r;const p=l==null?void 0:l.models;c!=null&&c.length&&(f=c.find(v=>JSON.parse(v)[0]===d)),f?u=JSON.parse(f):p&&(u=[p,[]]);const g=u.flat(1/0),h=[...new Set(g)],y=(await Pt.fetchLabels(this.flatmapAPI,h)).reduce((v,E)=>{const I=E[0],M=JSON.parse(E[1]);return M.source===this.mapImp.knowledgeSource&&v.push({id:I,label:M.label}),v},[]),b=[];for(let v=0;v<h.length;v++){const E=y.find(I=>I.id===h[v]);E&&b.push(E.label)}const w=li(b.join(", ")),T={facet:JSON.stringify(u),facetPropPath:`flatmap.connectivity.source.${this.connectionType.toLowerCase()}`,tagLabel:w,term:this.connectionType};this.connectivityFilters.some(v=>v.facet===T.facet&&v.facetPropPath===T.facetPropPath)||this.connectivityFilters.push(T),this.$emit("neuron-connection-feature-click",{filters:this.connectivityFilters,search:""})}else{const r=i.join();this.connectionType.toLowerCase()==="all"&&this.$emit("neuron-connection-feature-click",{filters:[],search:r})}}else{vy(this.mapImp,this.flatmapQueries);let i=[];if(this.tooltipEntry=e.filter(a=>a.resource[0]in this.mapImp.pathways.paths).map(a=>({title:a.label,featureId:a.resource,ready:!1})),this.tooltipEntry.length){this.$emit("connectivity-info-open",this.tooltipEntry);for(let r=0;r<e.length;r++)i.push(await this.getKnowledgeTooltip(e[r]));this.tooltipEntry=await Promise.all(i);const a=this.tooltipEntry.map(r=>r.featureId[0]);a.length>0&&this.displayTooltip(a)}}},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=si(this.mapImp),o.mapId=this.mapImp.provenance.id,o.mapuuid=this.mapImp.provenance.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,r=i==null?void 0:i.ref,s=this.$refs[a||r];if(s){const{parentElement:l,nextElementSibling:c}=s.$el,d=f=>f&&(f.classList.contains("pathway-container")||f.classList.contains("pathway-location"));(d(l)||d(c))&&(this.requiresDrawer?this.drawerOpen=!0:this.helpModeActiveIndex+=1)}else this.helpModeActiveIndex+=1}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;else{const a=Array.isArray(e)?e[0]:e;a&&(o=this.mapImp.modelFeatureIds(a)[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:a=4}=t,r=this.mapImp.map,s=this.mapImp.bounds.toArray();this.mapImp.zoomToFeatures(e,{noZoomIn:!0}),this.showPathwaysDrawer(!1),s!=null&&s.length&&setTimeout(()=>{r.fitBounds(s,{offset:[o,i],zoom:a,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 a=this.$refs[o];a&&a.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;let t=!1;this.displayMinimap&&(t={position:"top-right"});let o={taxon:this.entry};this.uuid&&(o.uuid=this.uuid),e?(e.uuid?o={uuid:e.uuid}:e.entry&&(o.taxon=e.entry),e.biologicalSex?o.biologicalSex=e.biologicalSex:o.taxon==="NCBITaxon:9606"&&(o.biologicalSex="PATO:0000384")):this.biologicalSex&&(o.biologicalSex=this.biologicalSex),this.mapManagerRef.loadMap(o,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:t,container:this.$refs.display}).then(a=>{this.mapImp=a,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let r=this.mapImp.details.version;this.setFlightPathInfo(r);const s=this._stateToBeSet?this._stateToBeSet:e;this.onFlatmapReady(s),this.$nextTick(()=>this.restoreMapState(s))})}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(),this.showMinimap(this.displayMinimap))}catch{console.error("Map resize error")}},getFilterSources:function(){const e=["kind","taxons"];let t=new Set,o=new Set,i=new Map;for(const r of this.mapImp.annotations.values())if(r.source){"alert"in r?t.add(r.source):o.add(r.source);for(const[s,l]of Object.entries(r))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(`${r.source}`)};Array.isArray(l)?l.forEach(d):d(l)}}let a={alert:{with:[...t],without:[...o]}};for(const[r,s]of i.entries()){a[r]={};for(const[l,c]of s.entries())a[r][l]=[...c.values()]}return a},getFilterOptions:async function(e,t){const o=t||this.getFlatmapKnowledge(),i=this.pathways;return await Pt.getFlatmapFilterOptions(this.flatmapAPI,e,o,i)},onFlatmapReady:function(e){var t;this.sensor=n.markRaw(new Ty(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.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.mapResize(),this.handleMapClick(),this.setInitMapState(),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=""})},showMinimap:function(e){this.mapImp&&this.mapImp.showMinimap(e)},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 a=this.mapImp.search(e);if((i=a==null?void 0:a.results)!=null&&i.length){if(this.mapImp.showSearchResults(a),t){let r;for(let s=0;s<a.results.length;s++){r=a.results[s].featureId;const l=this.mapImp.annotation(r);if(r&&(l!=null&&l.label))break}if(r){const s=this.mapImp.featureProperties(r),l={resource:[s.models],feature:s,label:s.label,provenanceTaxonomy:s.taxons,alert:s.alert};this.checkAndCreatePopups([l],o),this.mapImp.showPopup(r,li(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){ci.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},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:[]}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,userApiKey:this.userToken}},data:function(){return{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:Ey,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:gy,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:[]}},computed:{...gi.mapState(Ay,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0},requiresDrawer:function(){var e,t,o,i;if(this.loading)return this.drawerOpen=!1,!1;if(this.isFC){if(((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)return this.drawerOpen=!0,!0}else return this.drawerOpen=!0,!0;return 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]}},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))},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"),a=()=>{i.removeEventListener("keydown",r),i.removeEventListener("click",s)},r=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),a()},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),a();return}o={x:d,y:f},t.push(o)};e&&(a(),i.addEventListener("keydown",r),i.addEventListener("click",s))}},created:function(){this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=n.markRaw(new yi.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 yy),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap(),us()}},Ny={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},Py={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},_y={style:{height:"100%",width:"100%"},ref:"display"},Ly={class:"beta-popovers"},Vy={key:2,class:"warning-text"},Ry={class:"bottom-right-control"},Fy=["innerHTML"],Dy={style:{"margin-bottom":"2px"}},$y={key:0,class:"viewing-mode-title"},zy=["onClick"],jy=["onClick"];function Hy(e,t,o,i,a,r){const s=n.resolveComponent("map-svg-sprite-color"),l=K.WarningFilled,c=ke,d=Kn,f=K.ArrowDown,u=n.resolveComponent("DrawToolbar"),p=n.resolveComponent("map-svg-icon"),g=dy,h=n.resolveComponent("tree-controls"),m=fs,y=K.ArrowLeft,b=Fr,w=Xt,T=en,k=ti,v=Hn,E=Xr,I=es,M=n.resolveComponent("Tooltip"),x=ls,B=oi;return n.withDirectives((n.openBlock(),n.createElementBlock("div",Ny,[n.createVNode(s),n.createElementVNode("div",Py,[n.createElementVNode("div",_y,null,512),n.withDirectives(n.createElementVNode("div",Ly,[n.createElementVNode("div",null,[n.createVNode(d,{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]=S=>r.showTooltip(7)),onMouseout:t[8]||(t[8]=S=>r.hideTooltip(7))},[o.displayWarning||o.isLegacy?(n.openBlock(),n.createBlock(c,{key:0},{default:n.withCtx(()=>[n.createVNode(l)]),_:1})):n.createCommentVNode("",!0),o.isLegacy?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[t[33]||(t[33]=n.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),n.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...S)=>r.viewLatestMap&&r.viewLatestMap(...S))}," Click here for the latest map ")],64)):o.displayWarning?(n.openBlock(),n.createElementBlock("span",Vy,"Beta")):n.createCommentVNode("",!0)],32)]),default:n.withCtx(()=>[o.isLegacy?(n.openBlock(),n.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=S=>r.showTooltip(7)),onMouseout:t[1]||(t[1]=S=>r.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]=S=>r.showTooltip(7)),onMouseout:t[3]||(t[3]=S=>r.hideTooltip(7))},t[31]||(t[31]=[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]=S=>r.showTooltip(7)),onMouseout:t[5]||(t[5]=S=>r.hideTooltip(7))},t[32]||(t[32]=[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"])]),o.displayLatestChanges?(n.openBlock(),n.createBlock(d,{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]=S=>r.showTooltip(8)),onMouseout:t[10]||(t[10]=S=>r.hideTooltip(8))},[n.createVNode(c,null,{default:n.withCtx(()=>[n.createVNode(l)]),_:1}),t[34]||(t[34]=n.createElementVNode("span",{class:"warning-text"},"What's new?",-1))],32)):n.createCommentVNode("",!0)]),default:n.withCtx(()=>t[35]||(t[35]=[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(c,{class:n.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:r.closeMinimap},{default:n.withCtx(()=>[n.createVNode(f)]),_:1},8,["class","onClick"]),[[n.vShow,e.minimapResizeShow]]),e.viewingMode==="Annotation"&&(e.authorisedUser||e.offlineAnnotationEnabled)&&!o.disableUI?(n.openBlock(),n.createBlock(u,{key:0,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:r.toolbarEvent,onFeatureTooltip:r.connectedFeatureTooltip,onConfirmDrawn:r.confirmDrawnFeature,onCancelDrawn:r.cancelDrawnFeature,onShowTooltip:r.showTooltip,onHideTooltip:r.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",Ry,[n.createVNode(d,{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]=S=>r.zoomIn()),onMouseover:t[12]||(t[12]=S=>r.showTooltip(1)),onMouseout:t[13]||(t[13]=S=>r.hideTooltip(1))},[n.createVNode(p,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),n.createVNode(d,{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]=S=>r.zoomOut()),onMouseover:t[15]||(t[15]=S=>r.showTooltip(2)),onMouseout:t[16]||(t[16]=S=>r.hideTooltip(2))},[n.createVNode(p,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),n.createVNode(d,{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]=S=>r.resetView()),onMouseover:t[18]||(t[18]=S=>r.showTooltip(3)),onMouseout:t[19]||(t[19]=S=>r.hideTooltip(3))},[n.createVNode(p,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:n.withCtx(()=>[t[36]||(t[36]=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(d,{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"})},[n.createVNode(d,{content:"Location of the featured dataset",placement:"bottom",teleported:!0,trigger:"manual",width:"max-content",offset:-10,"popper-class":"flatmap-popper flatmap-teleport-popper",visible:e.hoverVisibilities[9].value&&o.showStarInLegend,ref:"featuredMarkerPopover"},{reference:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("div",{onMouseover:t[20]||(t[20]=S=>r.showTooltip(9)),onMouseout:t[21]||(t[21]=S=>r.hideTooltip(9))},[r.legendEntry.length?(n.openBlock(),n.createBlock(g,{key:0,identifierKey:"prompt",colourKey:"colour",styleKey:"style",legends:r.legendEntry,showStarInLegend:!0,class:"svg-legends-container"},null,8,["legends"])):n.createCommentVNode("",!0)],32)),[[x,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"]),n.createVNode(d,{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,Fy),[[n.vShow,e.hoverVisibilities[0].value],[x,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(n.openBlock(),n.createBlock(h,{key:0,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:e.systems,active:e.currentActive,hover:e.currentHover,onCheckChanged:r.systemSelected,onCheckAll:r.checkAllSystems,onChangeActive:r.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):n.createCommentVNode("",!0),e.containsAlert&&e.alertOptions&&o.showPathwayFilter?(n.openBlock(),n.createBlock(m,{title:"Alert",labelKey:"label",identifierKey:"key",selections:e.alertOptions,onChanged:r.alertSelected,onCheckboxMouseEnter:r.alertMouseEnterEmitted,onSelectionsDataChanged:r.onSelectionsDataChanged,onCheckAll:r.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(m,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,showAsLegend:!o.showPathwayFilter,onChanged:r.pathwaysSelected,onSelectionsDataChanged:r.onSelectionsDataChanged,onCheckAll:r.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(m,{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:r.taxonsSelected,onCheckboxMouseEnter:r.taxonMouseEnterEmitted,onSelectionsDataChanged:r.onSelectionsDataChanged,onCheckAll:r.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):n.createCommentVNode("",!0)],6)),[[x,void 0,"checkBoxPopover"]]),n.createElementVNode("div",{onClick:t[22]||(t[22]=(...S)=>r.toggleDrawer&&r.toggleDrawer(...S)),class:n.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[n.createVNode(c,null,{default:n.withCtx(()=>[n.createVNode(y)]),_:1})],2)],2),[[n.vShow,!o.disableUI&&r.requiresDrawer]])]),_:1},8,["visible"]),e.openMapRef?(n.openBlock(),n.createBlock(d,{key:1,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,S=>(n.openBlock(),n.createBlock(w,{key:S.key},{default:n.withCtx(()=>[n.createVNode(b,{type:"primary",plain:"",onClick:P=>e.$emit("open-map",S.key)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(S.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):n.createCommentVNode("",!0),n.createVNode(d,{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(w,{class:"backgroundText"},{default:n.withCtx(()=>t[37]||(t[37]=[n.createTextVNode("Viewing Mode")])),_:1}),n.createVNode(w,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createElementVNode("div",Dy,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.viewingModes,(S,P,L)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:P},[P===e.viewingMode?(n.openBlock(),n.createElementBlock("span",$y,[n.createElementVNode("b",null,n.toDisplayString(P),1)])):(n.openBlock(),n.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:q=>r.changeViewingMode(P)},n.toDisplayString(P),9,zy))],64))),128))]),n.createVNode(w,{class:"viewing-mode-description"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(r.modeDescription),1)]),_:1}),e.viewingMode==="Annotation"&&e.offlineAnnotationEnabled?(n.openBlock(),n.createBlock(w,{key:0,class:"viewing-mode-description"},{default:n.withCtx(()=>t[38]||(t[38]=[n.createTextVNode(" (Anonymous annotate) ")])),_:1})):n.createCommentVNode("",!0)]),_:1}),e.viewingMode==="Annotation"&&e.authorisedUser?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createVNode(w,{class:"backgroundText"},{default:n.withCtx(()=>t[39]||(t[39]=[n.createTextVNode("Annotations From")])),_:1}),n.createVNode(w,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(v,{teleported:!1,modelValue:e.annotationFrom,"onUpdate:modelValue":t[23]||(t[23]=S=>e.annotationFrom=S),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:r.setAnnotationFrom},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.annotatedSource,S=>(n.openBlock(),n.createBlock(k,{key:S,label:S,value:S},{default:n.withCtx(()=>[n.createVNode(w,null,{default:n.withCtx(()=>[n.createVNode(T,{span:12},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(S),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(w,{key:1,class:"backgroundSpacer"})):n.createCommentVNode("",!0),e.displayFlightPathOption?(n.openBlock(),n.createBlock(w,{key:2,class:"backgroundText"},{default:n.withCtx(()=>t[40]||(t[40]=[n.createTextVNode("Flight path display")])),_:1})):n.createCommentVNode("",!0),e.displayFlightPathOption?(n.openBlock(),n.createBlock(w,{key:3,class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(I,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[24]||(t[24]=S=>e.flightPath3DRadio=S),class:"flatmap-radio",onChange:r.setFlightPath3D},{default:n.withCtx(()=>[n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[41]||(t[41]=[n.createTextVNode("2D")])),_:1}),n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[42]||(t[42]=[n.createTextVNode("3D")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(w,{class:"backgroundSpacer"}),n.createVNode(w,{class:"backgroundText"},{default:n.withCtx(()=>t[43]||(t[43]=[n.createTextVNode("Organs display")])),_:1}),n.createVNode(w,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(I,{modelValue:e.colourRadio,"onUpdate:modelValue":t[25]||(t[25]=S=>e.colourRadio=S),class:"flatmap-radio",onChange:r.setColour},{default:n.withCtx(()=>[n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[44]||(t[44]=[n.createTextVNode("Colour")])),_:1}),n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[45]||(t[45]=[n.createTextVNode("Greyscale")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),n.createVNode(w,{class:"backgroundSpacer"}),n.createVNode(w,{class:"backgroundText"},{default:n.withCtx(()=>t[46]||(t[46]=[n.createTextVNode("Outlines display")])),_:1}),n.createVNode(w,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(I,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[26]||(t[26]=S=>e.outlinesRadio=S),class:"flatmap-radio",onChange:r.setOutlines},{default:n.withCtx(()=>[n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[47]||(t[47]=[n.createTextVNode("Show")])),_:1}),n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[48]||(t[48]=[n.createTextVNode("Hide")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),n.createVNode(w,{class:"backgroundSpacer"}),n.createVNode(w,{class:"backgroundText"},{default:n.withCtx(()=>t[49]||(t[49]=[n.createTextVNode("Change background")])),_:1}),n.createVNode(w,{class:"backgroundControl"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.availableBackground,S=>(n.openBlock(),n.createElementBlock("div",{key:S,class:n.normalizeClass(["backgroundChoice",S,S==e.currentBackground?"active":""]),onClick:P=>r.backgroundChangeCallback(S)},null,10,jy))),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(w,{key:0},{default:n.withCtx(()=>[n.createVNode(d,{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[27]||(t[27]=S=>r.showTooltip(4)),onMouseout:t[28]||(t[28]=S=>r.hideTooltip(4))},[n.createVNode(p,{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(w,{key:1},{default:n.withCtx(()=>[n.createVNode(d,{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[29]||(t[29]=S=>r.showTooltip(5)),onMouseout:t[30]||(t[30]=S=>r.hideTooltip(5))},[n.createVNode(p,{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:2,ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,tooltipEntry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation",onAnnotation:r.commitAnnotationEvent,onOnActionClick:r.onActionClick},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation","onOnActionClick"])):n.createCommentVNode("",!0)])])),[[B,e.loading]])}const di=tn(By,[["render",Hy],["__scopeId","data-v-a3c7afab"]]),ms={"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"},Ky={name:"MultiFlatmapVuer",components:{Col:en,Row:Xt,Option:ti,Select:Hn,Popover:Kn,FlatmapVuer:di},created:function(){this.loadMapManager()},mounted:function(){this.initialise(),ci.on("onActionClick",e=>{this.resourceSelected(e)}),ci.on("open-pubmed-url",e=>{this.$emit("open-pubmed-url",e)})},methods:{initialise:function(){return new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{Object.keys(this.availableSpecies).forEach(i=>{const a=this.availableSpecies[i].uuid;if(a&&t.map(r=>r.uuid).indexOf(a)>0)this.speciesList[i]=this.availableSpecies[i];else for(let r=0;r<t.length;r++)if(this.availableSpecies[i].taxo===t[r].taxon)if(this.availableSpecies[i].biologicalSex){if(t[r].biologicalSex&&t[r].biologicalSex===this.availableSpecies[i].biologicalSex){this.speciesList[i]=this.availableSpecies[i];break}}else{this.speciesList[i]=this.availableSpecies[i];break}});let o=this.initial;if(this.state){const i=this.state.state;(!i||!i.uuid&&!i.entry)&&this.state.species?o=this.state.species:o=void 0}o&&(o&&this.speciesList[o]!==void 0?this.activeSpecies=o: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(i=>{i()})})):this.initialised?e():this.resolveList.push(e)})},loadMapManager:function(){this.mapManagerRef||(this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=n.markRaw(new yi.MapViewer(this.flatmapAPI,{container:void 0})),this.$emit("mapmanager-loaded",this.mapManagerRef)))},resourceSelected:function(e){this.$emit("resource-selected",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(a=>{if(a.uuid!==o.uuid)return this.createLegacyEntry(e,o.entry,o.uuid)}).then(a=>{t(a||e)}).catch(()=>{t(e)})})}else if(o.entry){const i=o.entry in ms?ms[o.entry]:void 0,a=this.createLegacyEntry(e,o.entry,i);t(a||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},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:[]}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:n.markRaw([]),initialised:!1,mapManagerRef:void 0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},Uy={class:"multi-container",ref:"multiContainer"},Wy={key:0,style:{position:"absolute","z-index":"100"}},qy={class:"select-box-icon"};function Gy(e,t,o,i,a,r){const s=ti,l=Hn,c=Kn,d=di;return n.openBlock(),n.createElementBlock("div",Uy,[o.disableUI?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Wy,[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:r.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]=f=>e.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:r.setSpecies},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.speciesList,(f,u)=>(n.openBlock(),n.createBlock(s,{key:u,label:u,value:u},{default:n.withCtx(()=>[n.createElementVNode("span",qy,[n.createElementVNode("i",{class:n.normalizeClass(f.iconClass)},null,2)]),n.createTextVNode(" "+n.toDisplayString(u),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,(f,u)=>n.withDirectives((n.openBlock(),n.createBlock(d,{key:u,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:u,enableOpenMapUI:o.enableOpenMapUI,openMapOptions:o.openMapOptions,disableUI:o.disableUI,onViewLatestMap:r.viewLatestMap,onResourceSelected:r.resourceSelected,onReady:r.FlatmapReady,onPanZoomCallback:r.panZoomCallback,annotationSidebar:o.annotationSidebar,onAnnotationOpen:r.onAnnotationOpen,onAnnotationClose:r.onAnnotationClose,onUpdateOfflineAnnotationEnabled:r.updateOfflineAnnotationEnabled,connectivityInfoSidebar:o.connectivityInfoSidebar,onConnectivityInfoOpen:r.onConnectivityInfoOpen,onConnectivityInfoClose:r.onConnectivityInfoClose,onConnectivityError:r.onConnectivityError,onNeuronConnectionFeatureClick:r.onNeuronConnectionFeatureClick,onOpenMap:t[1]||(t[1]=p=>e.$emit("open-map",p)),onPathwaySelectionChanged:r.onSelectionsDataChanged,minZoom:o.minZoom,helpMode:e.activeSpecies==u&&o.helpMode,helpModeActiveItem:o.helpModeActiveItem,helpModeDialog:o.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:r.onHelpModeLastItem,onShownTooltip:r.onTooltipShown,onShownMapTooltip:r.onMapTooltipShown,renderAtMounted:o.renderAtMounted,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","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","annotationSidebar","onAnnotationOpen","onAnnotationClose","onUpdateOfflineAnnotationEnabled","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityError","onNeuronConnectionFeatureClick","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","mapManager","flatmapAPI","sparcAPI","showLocalSettings","showOpenMapButton","showPathwayFilter","externalLegends"])),[[n.vShow,e.activeSpecies==u]])),128))],512)}const Jy=tn(Ky,[["render",Gy],["__scopeId","data-v-f44289b1"]]);H.FlatmapVuer=di,H.MultiFlatmapVuer=Jy,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|
|
24
|
+
order by source desc`;us();const a=sessionStorage.getItem("flatmap-knowledge"),r=sessionStorage.getItem("flatmap-knowledge-source");if(!a||r!==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),Sy(),l}return JSON.parse(a)}function Sy(){const o=new Date().getTime()+864e5;sessionStorage.setItem("flatmap-knowledge-expiry",o)}function ky(){["flatmap-knowledge","flatmap-knowledge-expiry","flatmap-knowledge-source"].forEach(t=>{sessionStorage.removeItem(t)})}function us(){const e=sessionStorage.getItem("flatmap-knowledge-expiry");new Date().getTime()>e&&ky()}const li=e=>e&&e.charAt(0).toUpperCase()+e.slice(1),Ey='<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 ps={exports:{}};(function(e,t){(function(o,i){e.exports=i()})(typeof window<"u"?window:pm,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)},a=o.cancelAnimationFrame||o.mozCancelAnimationFrame||o.webkitCancelAnimationFrame||function(f){o.clearTimeout(f)};function r(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(w){m.push(w)};var y,b;this.call=function(w){for(y=0,b=m.length;y<b;y++)m[y].call(this,w)},this.remove=function(w){var T=[];for(y=0,b=m.length;y<b;y++)m[y]!==w&&T.push(m[y]);m=T},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%"},w={position:"absolute",left:"0px",top:"0px",transition:"0s"};l(m.resizeSensor,b);var T=document.createElement("div");T.className="resize-sensor-expand",l(T,b);var k=document.createElement("div");l(k,w),T.appendChild(k);var v=document.createElement("div");v.className="resize-sensor-shrink",l(v,b);var E=document.createElement("div");l(E,w),l(E,{width:"200%",height:"200%"}),v.appendChild(E),m.resizeSensor.appendChild(T),m.resizeSensor.appendChild(v),m.appendChild(m.resizeSensor);var I=window.getComputedStyle(m),M=I?I.getPropertyValue("position"):null;M!=="absolute"&&M!=="relative"&&M!=="fixed"&&M!=="sticky"&&(m.style.position="relative");var x=!1,B=0,S=s(m),P=0,L=0,q=!0;p=0;var F=function(){var Z=m.offsetWidth,ce=m.offsetHeight;k.style.width=Z+10+"px",k.style.height=ce+10+"px",T.scrollLeft=Z+10,T.scrollTop=ce+10,v.scrollLeft=Z+10,v.scrollTop=ce+10},O=function(){if(q){var Z=m.offsetWidth===0&&m.offsetHeight===0;if(Z){p||(p=i(function(){p=0,O()}));return}else q=!1}F()};m.resizeSensor.resetSensor=O;var $=function(){B=0,x&&(P=S.width,L=S.height,m.resizedAttached&&m.resizedAttached.call(S))},pe=function(){S=s(m),x=S.width!==P||S.height!==L,x&&!B&&(B=i($)),O()},Y=function(Z,ce,Ee){Z.attachEvent?Z.attachEvent("on"+ce,Ee):Z.addEventListener(ce,Ee)};Y(T,"scroll",pe),Y(v,"scroll",pe),p=i(function(){p=0,O()})}}r(f,function(m){h(m,u)}),this.detach=function(m){p||(a(p),p=0),c.detach(f,m)},this.reset=function(){f.resizeSensor.resetSensor()}};if(c.reset=function(f){r(f,function(u){u.resizeSensor.resetSensor()})},c.detach=function(f,u){r(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})})(ps);var Iy=ps.exports;const Ty=hm(Iy),Ay=gi.defineStore("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(e){return e.userProfile.token}},actions:{setUserToken(e){this.userProfile.token=e}}});function Oy(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(a){a(o)}),(i=e.get("*"))&&i.slice().map(function(a){a(t,o)})}}}const ci=new Oy,My="cannot be found on the map.",xy=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},hs=(e,t)=>{const o=[];let i=e.organs?e.organs:e.ftus;const a=i?i.filter((r,s)=>i.findIndex(l=>l.label===r.label)===s):void 0;return a&&a.forEach(r=>{const s={label:r.label,models:r.models,key:`${t}.${r.label}`},l=hs(r,s.key);l.length>0&&(s.children=l),o.push(s)}),o},By={name:"FlatmapVuer",components:{Button:Fr,Col:en,Loading:Jg,Radio:Xr,Icon:ke,RadioGroup:es,Row:Xt,Select:Hn,Dialog:hg,MapSvgIcon:mi.MapSvgIcon,MapSvgSpriteColor:mi.MapSvgSpriteColor,Tooltip:Pt.Tooltip,TreeControls:Pt.TreeControls,SelectionsGroup:fs,SvgLegends:my,ElIconWarningFilled:K.WarningFilled,ElIconArrowDown:K.ArrowDown,ElIconArrowLeft:K.ArrowLeft,DrawToolbar:Pt.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(e){let t=n.inject("$annotator");return t||(t=n.markRaw(new Es.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&&(e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter())},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(a=>a.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()},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},a=hs(o,i.key);a.length>0&&(i.children=a),t.children.push(i)}),this.systems.push(t)}},processTaxon:function(e,t){this.taxonConnectivity.length=0,ai(this.mapImp,e).then(o=>{o.length&&o.forEach(i=>{let a=!0;t&&(a=t.checkAll?!0:t.checked.includes(i.taxon)),this.taxonConnectivity.push({...i,enabled:a}),this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(i.taxon,a)})})},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,a,r,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=(a=p==null?void 0:p.ids)==null?void 0:a.dendrites.flat(1/0),h=(r=p==null?void 0:p.ids)==null?void 0:r.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 a=e.key==="alert"?{HAS:"alert"}:{NOT:{HAS:"alert"}};t={OR:[i,{AND:[o,a]}]}}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={}},eventCallback:function(){return(e,t,...o)=>{if(e==="annotation"){const i={feature:t,userData:o,eventType:e};this.annotationEventCallback(i,t)}else if(e!=="pan-zoom"){const i=t.label,a=[t.models],r=this.entry,s=this.biologicalSex,l=t.alert;let c;t.taxons&&(typeof t.taxons!="object"?c=JSON.parse(t.taxons):c=t.taxons);let d=[{dataset:t.dataset,biologicalSex:s,taxonomy:r,resource:a,label:i,feature:t,userData:o,eventType:e,provenanceTaxonomy:c,alert:l}];if(e==="click"){const f=Object.keys(t).includes("id");if(!f){d=[];const p=t.mapUUID,g=new Set;for(let[h,m]of Object.entries(t))if(h!=="mapUUID"){const y=m.id,b=m.label,w=[m.models];let T;if(m.taxons&&(typeof m.taxons!="object"?T=JSON.parse(m.taxons):T=m.taxons),g.has(y))continue;g.add(y),d.push({dataset:m.dataset,biologicalSex:s,taxonomy:r,resource:w,label:b,feature:m,userData:o,eventType:e,provenanceTaxonomy:T,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])))}}}}else e==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=t.models?t.models:"");t&&t.type!=="marker"&&e==="click"&&!this.activeDrawTool&&this.checkAndCreatePopups(d),this.$emit("resource-selected",d)}else this.$emit("pan-zoom-callback",t)}},setConnectivityDataSource:function(e,t){this.connectivityDataSource=t.source,(e==="Neuron Connection"||e==="Annotation")&&(this.connectivityDataSource=t.featureId)},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,a)=>{const{label:r}=i;if(o.append(li(r)),a+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=[],a=[],r=[],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;r.push({featureId:h,...p})}else s.push(p)}),r.length){let p=r[0].featureId;this.mapImp.annotations.forEach(g=>{const h=g["anatomical-nodes"];if(h){const m=h.join("");r.every(b=>m.indexOf(b.id)!==-1)&&(p=g.featureId,a.push(p))}}),this.createTooltipForConnectivity(r,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),...a];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 by(e):o=await wy(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:My}})},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(a=>a.feature).map(a=>a.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(a=>{var r;this.annotationEntry.push({...a,resourceId:this.serverURL,featureId:a.featureId?a.featureId:(r=a.feature)==null?void 0:r.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,xy(i[0].feature.geometry))):this.rollbackAnnotationEvent();else{const a=this.annotationEntry.filter(r=>r.featureId&&r.models).map(r=>r.models);a.length>0&&this.displayTooltip(a)}else this.annotation={}}else if(this.viewingMode==="Neuron Connection"&&t){const i=e.map(r=>r.resource[0]);if(i.find(r=>!r.startsWith("ilxtr:"))){const r=Array.isArray(i)?[...i]:[i];r.length===1&&r.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=r;const p=l==null?void 0:l.models;c!=null&&c.length&&(f=c.find(v=>JSON.parse(v)[0]===d)),f?u=JSON.parse(f):p&&(u=[p,[]]);const g=u.flat(1/0),h=[...new Set(g)],y=(await Pt.fetchLabels(this.flatmapAPI,h)).reduce((v,E)=>{const I=E[0],M=JSON.parse(E[1]);return M.source===this.mapImp.knowledgeSource&&v.push({id:I,label:M.label}),v},[]),b=[];for(let v=0;v<h.length;v++){const E=y.find(I=>I.id===h[v]);E&&b.push(E.label)}const w=li(b.join(", ")),T={facet:JSON.stringify(u),facetPropPath:`flatmap.connectivity.source.${this.connectionType.toLowerCase()}`,tagLabel:w,term:this.connectionType};this.connectivityFilters.some(v=>v.facet===T.facet&&v.facetPropPath===T.facetPropPath)||this.connectivityFilters.push(T),this.$emit("neuron-connection-feature-click",{filters:this.connectivityFilters,search:""})}else{const r=i.join();this.connectionType.toLowerCase()==="all"&&this.$emit("neuron-connection-feature-click",{filters:[],search:r})}}else{vy(this.mapImp,this.flatmapQueries);let i=[];if(this.tooltipEntry=e.filter(a=>a.resource[0]in this.mapImp.pathways.paths).map(a=>({title:a.label,featureId:a.resource,ready:!1})),this.tooltipEntry.length){this.$emit("connectivity-info-open",this.tooltipEntry);for(let r=0;r<e.length;r++)i.push(await this.getKnowledgeTooltip(e[r]));this.tooltipEntry=await Promise.all(i);const a=this.tooltipEntry.map(r=>r.featureId[0]);a.length>0&&this.displayTooltip(a)}}},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=si(this.mapImp),o.mapId=this.mapImp.provenance.id,o.mapuuid=this.mapImp.provenance.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,r=i==null?void 0:i.ref,s=this.$refs[a||r];if(s){const{parentElement:l,nextElementSibling:c}=s.$el,d=f=>f&&(f.classList.contains("pathway-container")||f.classList.contains("pathway-location"));(d(l)||d(c))&&(this.requiresDrawer?this.drawerOpen=!0:this.helpModeActiveIndex+=1)}else this.helpModeActiveIndex+=1}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;else{const a=Array.isArray(e)?e[0]:e;a&&(o=this.mapImp.modelFeatureIds(a)[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:a=4}=t,r=this.mapImp.map,s=this.mapImp.bounds.toArray();this.mapImp.zoomToFeatures(e,{noZoomIn:!0}),this.showPathwaysDrawer(!1),s!=null&&s.length&&setTimeout(()=>{r.fitBounds(s,{offset:[o,i],zoom:a,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 a=this.$refs[o];a&&a.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;let t=!1;this.displayMinimap&&(t={position:"top-right"});let o={taxon:this.entry};this.uuid&&(o.uuid=this.uuid),e?(e.uuid?o={uuid:e.uuid}:e.entry&&(o.taxon=e.entry),e.biologicalSex?o.biologicalSex=e.biologicalSex:o.taxon==="NCBITaxon:9606"&&(o.biologicalSex="PATO:0000384")):this.biologicalSex&&(o.biologicalSex=this.biologicalSex),this.mapManagerRef.loadMap(o,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:t,container:this.$refs.display}).then(a=>{this.mapImp=a,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let r=this.mapImp.details.version;this.setFlightPathInfo(r);const s=this._stateToBeSet?this._stateToBeSet:e;this.onFlatmapReady(s),this.$nextTick(()=>this.restoreMapState(s))})}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(),this.showMinimap(this.displayMinimap))}catch{console.error("Map resize error")}},getFilterSources:function(){const e=["kind","taxons"];let t=new Set,o=new Set,i=new Map;for(const r of this.mapImp.annotations.values())if(r.source){"alert"in r?t.add(r.source):o.add(r.source);for(const[s,l]of Object.entries(r))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(`${r.source}`)};Array.isArray(l)?l.forEach(d):d(l)}}let a={alert:{with:[...t],without:[...o]}};for(const[r,s]of i.entries()){a[r]={};for(const[l,c]of s.entries())a[r][l]=[...c.values()]}return a},getFilterOptions:async function(e,t){const o=t||this.getFlatmapKnowledge(),i=this.pathways;return await Pt.getFlatmapFilterOptions(this.flatmapAPI,e,o,i)},onFlatmapReady:function(e){var t;this.sensor=n.markRaw(new Ty(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.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.mapResize(),this.handleMapClick(),this.setInitMapState(),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=""})},showMinimap:function(e){this.mapImp&&this.mapImp.showMinimap(e)},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 a=this.mapImp.search(e);if((i=a==null?void 0:a.results)!=null&&i.length){if(this.mapImp.showSearchResults(a),t){let r;for(let s=0;s<a.results.length;s++){r=a.results[s].featureId;const l=this.mapImp.annotation(r);if(r&&(l!=null&&l.label))break}if(r){const s=this.mapImp.featureProperties(r),l={resource:[s.models],feature:s,label:s.label,provenanceTaxonomy:s.taxons,alert:s.alert};this.checkAndCreatePopups([l],o),this.mapImp.showPopup(r,li(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){ci.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},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:[]}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,userApiKey:this.userToken}},data:function(){return{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:Ey,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:gy,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:[]}},computed:{...gi.mapState(Ay,["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]}},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))},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"),a=()=>{i.removeEventListener("keydown",r),i.removeEventListener("click",s)},r=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),a()},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),a();return}o={x:d,y:f},t.push(o)};e&&(a(),i.addEventListener("keydown",r),i.addEventListener("click",s))}},created:function(){this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=n.markRaw(new yi.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 yy),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap(),us()}},Ny={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},Py={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},_y={style:{height:"100%",width:"100%"},ref:"display"},Ly={class:"beta-popovers"},Vy={key:2,class:"warning-text"},Ry={class:"bottom-right-control"},Fy=["innerHTML"],Dy={style:{"margin-bottom":"2px"}},$y={key:0,class:"viewing-mode-title"},zy=["onClick"],jy=["onClick"];function Hy(e,t,o,i,a,r){const s=n.resolveComponent("map-svg-sprite-color"),l=K.WarningFilled,c=ke,d=Kn,f=K.ArrowDown,u=n.resolveComponent("DrawToolbar"),p=n.resolveComponent("map-svg-icon"),g=dy,h=n.resolveComponent("tree-controls"),m=fs,y=K.ArrowLeft,b=Fr,w=Xt,T=en,k=ti,v=Hn,E=Xr,I=es,M=n.resolveComponent("Tooltip"),x=ls,B=oi;return n.withDirectives((n.openBlock(),n.createElementBlock("div",Ny,[n.createVNode(s),n.createElementVNode("div",Py,[n.createElementVNode("div",_y,null,512),n.withDirectives(n.createElementVNode("div",Ly,[n.createElementVNode("div",null,[n.createVNode(d,{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]=S=>r.showTooltip(7)),onMouseout:t[8]||(t[8]=S=>r.hideTooltip(7))},[o.displayWarning||o.isLegacy?(n.openBlock(),n.createBlock(c,{key:0},{default:n.withCtx(()=>[n.createVNode(l)]),_:1})):n.createCommentVNode("",!0),o.isLegacy?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[t[33]||(t[33]=n.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),n.createElementVNode("div",{class:"latest-map-text",onClick:t[6]||(t[6]=(...S)=>r.viewLatestMap&&r.viewLatestMap(...S))}," Click here for the latest map ")],64)):o.displayWarning?(n.openBlock(),n.createElementBlock("span",Vy,"Beta")):n.createCommentVNode("",!0)],32)]),default:n.withCtx(()=>[o.isLegacy?(n.openBlock(),n.createElementBlock("p",{key:0,onMouseover:t[0]||(t[0]=S=>r.showTooltip(7)),onMouseout:t[1]||(t[1]=S=>r.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]=S=>r.showTooltip(7)),onMouseout:t[3]||(t[3]=S=>r.hideTooltip(7))},t[31]||(t[31]=[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]=S=>r.showTooltip(7)),onMouseout:t[5]||(t[5]=S=>r.hideTooltip(7))},t[32]||(t[32]=[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"])]),o.displayLatestChanges?(n.openBlock(),n.createBlock(d,{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]=S=>r.showTooltip(8)),onMouseout:t[10]||(t[10]=S=>r.hideTooltip(8))},[n.createVNode(c,null,{default:n.withCtx(()=>[n.createVNode(l)]),_:1}),t[34]||(t[34]=n.createElementVNode("span",{class:"warning-text"},"What's new?",-1))],32)):n.createCommentVNode("",!0)]),default:n.withCtx(()=>t[35]||(t[35]=[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(c,{class:n.normalizeClass(["minimap-resize",{enlarge:e.minimapSmall,shrink:!e.minimapSmall}]),ref:"minimapResize",onClick:r.closeMinimap},{default:n.withCtx(()=>[n.createVNode(f)]),_:1},8,["class","onClick"]),[[n.vShow,e.minimapResizeShow]]),e.viewingMode==="Annotation"&&(e.authorisedUser||e.offlineAnnotationEnabled)&&!o.disableUI?(n.openBlock(),n.createBlock(u,{key:0,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:r.toolbarEvent,onFeatureTooltip:r.connectedFeatureTooltip,onConfirmDrawn:r.confirmDrawnFeature,onCancelDrawn:r.cancelDrawnFeature,onShowTooltip:r.showTooltip,onHideTooltip:r.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",Ry,[n.createVNode(d,{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]=S=>r.zoomIn()),onMouseover:t[12]||(t[12]=S=>r.showTooltip(1)),onMouseout:t[13]||(t[13]=S=>r.hideTooltip(1))},[n.createVNode(p,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),n.createVNode(d,{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]=S=>r.zoomOut()),onMouseover:t[15]||(t[15]=S=>r.showTooltip(2)),onMouseout:t[16]||(t[16]=S=>r.hideTooltip(2))},[n.createVNode(p,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),n.createVNode(d,{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]=S=>r.resetView()),onMouseover:t[18]||(t[18]=S=>r.showTooltip(3)),onMouseout:t[19]||(t[19]=S=>r.hideTooltip(3))},[n.createVNode(p,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:n.withCtx(()=>[t[36]||(t[36]=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(d,{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"})},[n.createVNode(d,{content:"Location of the featured dataset",placement:"bottom",teleported:!0,trigger:"manual",width:"max-content",offset:-10,"popper-class":"flatmap-popper flatmap-teleport-popper",visible:e.hoverVisibilities[9].value&&o.showStarInLegend,ref:"featuredMarkerPopover"},{reference:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("div",{onMouseover:t[20]||(t[20]=S=>r.showTooltip(9)),onMouseout:t[21]||(t[21]=S=>r.hideTooltip(9))},[r.legendEntry.length?(n.openBlock(),n.createBlock(g,{key:0,identifierKey:"prompt",colourKey:"colour",styleKey:"style",legends:r.legendEntry,showStarInLegend:!0,class:"svg-legends-container"},null,8,["legends"])):n.createCommentVNode("",!0)],32)),[[x,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"]),n.createVNode(d,{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,Fy),[[n.vShow,e.hoverVisibilities[0].value],[x,void 0,"markerPopover"]])]),_:1},8,["visible"]),e.isFC&&e.systems&&e.systems.length>0?(n.openBlock(),n.createBlock(h,{key:0,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:e.systems,active:e.currentActive,hover:e.currentHover,onCheckChanged:r.systemSelected,onCheckAll:r.checkAllSystems,onChangeActive:r.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):n.createCommentVNode("",!0),e.containsAlert&&e.alertOptions&&o.showPathwayFilter?(n.openBlock(),n.createBlock(m,{title:"Alert",labelKey:"label",identifierKey:"key",selections:e.alertOptions,onChanged:r.alertSelected,onCheckboxMouseEnter:r.alertMouseEnterEmitted,onSelectionsDataChanged:r.onSelectionsDataChanged,onCheckAll:r.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(m,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:e.pathways,showAsLegend:!o.showPathwayFilter,onChanged:r.pathwaysSelected,onSelectionsDataChanged:r.onSelectionsDataChanged,onCheckAll:r.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(m,{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:r.taxonsSelected,onCheckboxMouseEnter:r.taxonMouseEnterEmitted,onSelectionsDataChanged:r.onSelectionsDataChanged,onCheckAll:r.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):n.createCommentVNode("",!0)],6)),[[x,void 0,"checkBoxPopover"]]),n.createElementVNode("div",{onClick:t[22]||(t[22]=(...S)=>r.toggleDrawer&&r.toggleDrawer(...S)),class:n.normalizeClass(["drawer-button",{open:e.drawerOpen,close:!e.drawerOpen}])},[n.createVNode(c,null,{default:n.withCtx(()=>[n.createVNode(y)]),_:1})],2)],2),[[n.vShow,!o.disableUI&&r.requiresDrawer]])]),_:1},8,["visible"]),e.openMapRef?(n.openBlock(),n.createBlock(d,{key:1,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,S=>(n.openBlock(),n.createBlock(w,{key:S.key},{default:n.withCtx(()=>[n.createVNode(b,{type:"primary",plain:"",onClick:P=>e.$emit("open-map",S.key)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(S.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):n.createCommentVNode("",!0),n.createVNode(d,{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(w,{class:"backgroundText"},{default:n.withCtx(()=>t[37]||(t[37]=[n.createTextVNode("Viewing Mode")])),_:1}),n.createVNode(w,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createElementVNode("div",Dy,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.viewingModes,(S,P,L)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:P},[P===e.viewingMode?(n.openBlock(),n.createElementBlock("span",$y,[n.createElementVNode("b",null,n.toDisplayString(P),1)])):(n.openBlock(),n.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:q=>r.changeViewingMode(P)},n.toDisplayString(P),9,zy))],64))),128))]),n.createVNode(w,{class:"viewing-mode-description"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(r.modeDescription),1)]),_:1}),e.viewingMode==="Annotation"&&e.offlineAnnotationEnabled?(n.openBlock(),n.createBlock(w,{key:0,class:"viewing-mode-description"},{default:n.withCtx(()=>t[38]||(t[38]=[n.createTextVNode(" (Anonymous annotate) ")])),_:1})):n.createCommentVNode("",!0)]),_:1}),e.viewingMode==="Annotation"&&e.authorisedUser?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createVNode(w,{class:"backgroundText"},{default:n.withCtx(()=>t[39]||(t[39]=[n.createTextVNode("Annotations From")])),_:1}),n.createVNode(w,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(v,{teleported:!1,modelValue:e.annotationFrom,"onUpdate:modelValue":t[23]||(t[23]=S=>e.annotationFrom=S),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:r.setAnnotationFrom},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.annotatedSource,S=>(n.openBlock(),n.createBlock(k,{key:S,label:S,value:S},{default:n.withCtx(()=>[n.createVNode(w,null,{default:n.withCtx(()=>[n.createVNode(T,{span:12},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(S),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(w,{key:1,class:"backgroundSpacer"})):n.createCommentVNode("",!0),e.displayFlightPathOption?(n.openBlock(),n.createBlock(w,{key:2,class:"backgroundText"},{default:n.withCtx(()=>t[40]||(t[40]=[n.createTextVNode("Flight path display")])),_:1})):n.createCommentVNode("",!0),e.displayFlightPathOption?(n.openBlock(),n.createBlock(w,{key:3,class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(I,{modelValue:e.flightPath3DRadio,"onUpdate:modelValue":t[24]||(t[24]=S=>e.flightPath3DRadio=S),class:"flatmap-radio",onChange:r.setFlightPath3D},{default:n.withCtx(()=>[n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[41]||(t[41]=[n.createTextVNode("2D")])),_:1}),n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[42]||(t[42]=[n.createTextVNode("3D")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):n.createCommentVNode("",!0),n.createVNode(w,{class:"backgroundSpacer"}),n.createVNode(w,{class:"backgroundText"},{default:n.withCtx(()=>t[43]||(t[43]=[n.createTextVNode("Organs display")])),_:1}),n.createVNode(w,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(I,{modelValue:e.colourRadio,"onUpdate:modelValue":t[25]||(t[25]=S=>e.colourRadio=S),class:"flatmap-radio",onChange:r.setColour},{default:n.withCtx(()=>[n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[44]||(t[44]=[n.createTextVNode("Colour")])),_:1}),n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[45]||(t[45]=[n.createTextVNode("Greyscale")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),n.createVNode(w,{class:"backgroundSpacer"}),n.createVNode(w,{class:"backgroundText"},{default:n.withCtx(()=>t[46]||(t[46]=[n.createTextVNode("Outlines display")])),_:1}),n.createVNode(w,{class:"backgroundControl"},{default:n.withCtx(()=>[n.createVNode(I,{modelValue:e.outlinesRadio,"onUpdate:modelValue":t[26]||(t[26]=S=>e.outlinesRadio=S),class:"flatmap-radio",onChange:r.setOutlines},{default:n.withCtx(()=>[n.createVNode(E,{value:!0},{default:n.withCtx(()=>t[47]||(t[47]=[n.createTextVNode("Show")])),_:1}),n.createVNode(E,{value:!1},{default:n.withCtx(()=>t[48]||(t[48]=[n.createTextVNode("Hide")])),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),n.createVNode(w,{class:"backgroundSpacer"}),n.createVNode(w,{class:"backgroundText"},{default:n.withCtx(()=>t[49]||(t[49]=[n.createTextVNode("Change background")])),_:1}),n.createVNode(w,{class:"backgroundControl"},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.availableBackground,S=>(n.openBlock(),n.createElementBlock("div",{key:S,class:n.normalizeClass(["backgroundChoice",S,S==e.currentBackground?"active":""]),onClick:P=>r.backgroundChangeCallback(S)},null,10,jy))),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(w,{key:0},{default:n.withCtx(()=>[n.createVNode(d,{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[27]||(t[27]=S=>r.showTooltip(4)),onMouseout:t[28]||(t[28]=S=>r.hideTooltip(4))},[n.createVNode(p,{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(w,{key:1},{default:n.withCtx(()=>[n.createVNode(d,{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[29]||(t[29]=S=>r.showTooltip(5)),onMouseout:t[30]||(t[30]=S=>r.hideTooltip(5))},[n.createVNode(p,{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:2,ref:"tooltip",class:"tooltip",annotationEntry:e.annotationEntry,tooltipEntry:e.tooltipEntry,annotationDisplay:e.viewingMode==="Annotation",onAnnotation:r.commitAnnotationEvent,onOnActionClick:r.onActionClick},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation","onOnActionClick"])):n.createCommentVNode("",!0)])])),[[B,e.loading]])}const di=tn(By,[["render",Hy],["__scopeId","data-v-6afc0531"]]),ms={"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"},Ky={name:"MultiFlatmapVuer",components:{Col:en,Row:Xt,Option:ti,Select:Hn,Popover:Kn,FlatmapVuer:di},created:function(){this.loadMapManager()},mounted:function(){this.initialise(),ci.on("onActionClick",e=>{this.resourceSelected(e)}),ci.on("open-pubmed-url",e=>{this.$emit("open-pubmed-url",e)})},methods:{initialise:function(){return new Promise(e=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(t=>t.json()).then(t=>{Object.keys(this.availableSpecies).forEach(i=>{const a=this.availableSpecies[i].uuid;if(a&&t.map(r=>r.uuid).indexOf(a)>0)this.speciesList[i]=this.availableSpecies[i];else for(let r=0;r<t.length;r++)if(this.availableSpecies[i].taxo===t[r].taxon)if(this.availableSpecies[i].biologicalSex){if(t[r].biologicalSex&&t[r].biologicalSex===this.availableSpecies[i].biologicalSex){this.speciesList[i]=this.availableSpecies[i];break}}else{this.speciesList[i]=this.availableSpecies[i];break}});let o=this.initial;if(this.state){const i=this.state.state;(!i||!i.uuid&&!i.entry)&&this.state.species?o=this.state.species:o=void 0}o&&(o&&this.speciesList[o]!==void 0?this.activeSpecies=o: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(i=>{i()})})):this.initialised?e():this.resolveList.push(e)})},loadMapManager:function(){this.mapManagerRef||(this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=n.markRaw(new yi.MapViewer(this.flatmapAPI,{container:void 0})),this.$emit("mapmanager-loaded",this.mapManagerRef)))},resourceSelected:function(e){this.$emit("resource-selected",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(a=>{if(a.uuid!==o.uuid)return this.createLegacyEntry(e,o.entry,o.uuid)}).then(a=>{t(a||e)}).catch(()=>{t(e)})})}else if(o.entry){const i=o.entry in ms?ms[o.entry]:void 0,a=this.createLegacyEntry(e,o.entry,i);t(a||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},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:[]}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:n.markRaw([]),initialised:!1,mapManagerRef:void 0}},watch:{state:{handler:function(e){this.setState(e)},immediate:!0,deep:!0}}},Uy={class:"multi-container",ref:"multiContainer"},Wy={key:0,style:{position:"absolute","z-index":"100"}},qy={class:"select-box-icon"};function Gy(e,t,o,i,a,r){const s=ti,l=Hn,c=Kn,d=di;return n.openBlock(),n.createElementBlock("div",Uy,[o.disableUI?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",Wy,[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:r.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]=f=>e.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:r.setSpecies},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.speciesList,(f,u)=>(n.openBlock(),n.createBlock(s,{key:u,label:u,value:u},{default:n.withCtx(()=>[n.createElementVNode("span",qy,[n.createElementVNode("i",{class:n.normalizeClass(f.iconClass)},null,2)]),n.createTextVNode(" "+n.toDisplayString(u),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,(f,u)=>n.withDirectives((n.openBlock(),n.createBlock(d,{key:u,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:u,enableOpenMapUI:o.enableOpenMapUI,openMapOptions:o.openMapOptions,disableUI:o.disableUI,onViewLatestMap:r.viewLatestMap,onResourceSelected:r.resourceSelected,onReady:r.FlatmapReady,onPanZoomCallback:r.panZoomCallback,annotationSidebar:o.annotationSidebar,onAnnotationOpen:r.onAnnotationOpen,onAnnotationClose:r.onAnnotationClose,onUpdateOfflineAnnotationEnabled:r.updateOfflineAnnotationEnabled,connectivityInfoSidebar:o.connectivityInfoSidebar,onConnectivityInfoOpen:r.onConnectivityInfoOpen,onConnectivityInfoClose:r.onConnectivityInfoClose,onConnectivityError:r.onConnectivityError,onNeuronConnectionFeatureClick:r.onNeuronConnectionFeatureClick,onOpenMap:t[1]||(t[1]=p=>e.$emit("open-map",p)),onPathwaySelectionChanged:r.onSelectionsDataChanged,minZoom:o.minZoom,helpMode:e.activeSpecies==u&&o.helpMode,helpModeActiveItem:o.helpModeActiveItem,helpModeDialog:o.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:r.onHelpModeLastItem,onShownTooltip:r.onTooltipShown,onShownMapTooltip:r.onMapTooltipShown,renderAtMounted:o.renderAtMounted,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","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","annotationSidebar","onAnnotationOpen","onAnnotationClose","onUpdateOfflineAnnotationEnabled","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityError","onNeuronConnectionFeatureClick","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","mapManager","flatmapAPI","sparcAPI","showLocalSettings","showOpenMapButton","showPathwayFilter","externalLegends"])),[[n.vShow,e.activeSpecies==u]])),128))],512)}const Jy=tn(Ky,[["render",Gy],["__scopeId","data-v-d3d2df18"]]);H.FlatmapVuer=di,H.MultiFlatmapVuer=Jy,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|