@abi-software/flatmapvuer 1.7.5-beta.2 → 1.7.5-beta.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
|
@@ -100496,7 +100496,7 @@ const LGt = _Gt("main", {
|
|
|
100496
100496
|
mounted: function() {
|
|
100497
100497
|
this.openMapRef = dQ(this.$refs.openMapRef), this.backgroundIconRef = dQ(this.$refs.backgroundIconRef), this.tooltipWait.length = this.hoverVisibilities.length, this.flatmapQueries = Oo(new a4t()), this.flatmapQueries.initialise(this.flatmapAPI), this.state ? this.setStateRequired && this.setState(this.state) : this.renderAtMounted && this.createFlatmap(), p4t();
|
|
100498
100498
|
}
|
|
100499
|
-
}, La = (t) => (mM("data-v-
|
|
100499
|
+
}, La = (t) => (mM("data-v-c00ccb2d"), t = t(), gM(), t), SGt = {
|
|
100500
100500
|
class: "flatmap-container",
|
|
100501
100501
|
ref: "flatmapContainer",
|
|
100502
100502
|
"element-loading-text": "Loading...",
|
|
@@ -101212,7 +101212,7 @@ function KGt(t, e, r, n, i, o) {
|
|
|
101212
101212
|
[ct, t.loading]
|
|
101213
101213
|
]);
|
|
101214
101214
|
}
|
|
101215
|
-
const DY = /* @__PURE__ */ sg(MGt, [["render", KGt], ["__scopeId", "data-v-
|
|
101215
|
+
const DY = /* @__PURE__ */ sg(MGt, [["render", KGt], ["__scopeId", "data-v-c00ccb2d"]]);
|
|
101216
101216
|
function YGt(t) {
|
|
101217
101217
|
return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) {
|
|
101218
101218
|
var n = t.get(e);
|
package/dist/flatmapvuer.umd.cjs
CHANGED
|
@@ -1725,4 +1725,4 @@ DECKGL_FILTER_COLOR(fragColor, geometry);
|
|
|
1725
1725
|
state: () => new MyClass()
|
|
1726
1726
|
Found in store "${W.$id}".`),b&&o&&r.hydrate&&r.hydrate(W.$state,b),d=!0,f=!0,W}function tjt(t,e,r){let n,i;const o=typeof e=="function";n=t,i=o?r:e;function a(s,u){const d=_.hasInjectionContext();if(s=(process.env.NODE_ENV==="test"&&Eh&&Eh._testing?null:s)||(d?_.inject(XFt,null):null),s&&Ly(s),process.env.NODE_ENV!=="production"&&!Eh)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
1727
1727
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
1728
|
-
This will fail in production.`);s=Eh,s._s.has(n)||(o?oH(n,e,i,s):Dq(n,i,s),process.env.NODE_ENV!=="production"&&(a._pinia=s));const f=s._s.get(n);if(process.env.NODE_ENV!=="production"&&u){const T="__hot:"+n,Q=o?oH(T,e,i,s,!0):Dq(T,Ka({},i),s,!0);u._hotUpdate(Q),delete s.state.value[T],s._s.delete(T)}if(process.env.NODE_ENV!=="production"&&rH){const T=_.getCurrentInstance();if(T&&T.proxy&&!u){const Q=T.proxy,y="_pStores"in Q?Q._pStores:Q._pStores={};y[n]=f}}return f}return a.$id=n,a}function ejt(t,e){return Array.isArray(e)?e.reduce((r,n)=>(r[n]=function(){return t(this.$pinia)[n]},r),{}):Object.keys(e).reduce((r,n)=>(r[n]=function(){const i=t(this.$pinia),o=e[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const rjt=tjt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),njt="cannot be found on the map.",ijt=t=>{let e={lng:0,lat:0},r;return t.type==="Polygon"?t.coordinates.length&&(r=t.coordinates[0]):r=t.coordinates,r&&(t.type!=="Point"?(r.map(n=>{e.lng+=parseFloat(n[0]),e.lat+=parseFloat(n[1])}),e.lng=e.lng/r.length,e.lat=e.lat/r.length):(e.lng+=parseFloat(r[0]),e.lat+=parseFloat(r[1]))),e},Bq=(t,e)=>{const r=[];let n=t.organs?t.organs:t.ftus;const i=n?n.filter((o,a)=>n.findIndex(s=>s.label===o.label)===a):void 0;return i&&i.forEach(o=>{const a={label:o.label,models:o.models,key:`${e}.${o.label}`},s=Bq(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},ojt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},ajt={name:"FlatmapVuer",components:{Button:AO,Col:i8,Loading:wat,Radio:$O,Icon:Y2,RadioGroup:WO,Row:n8,Select:Wd,Dialog:zot,MapSvgIcon:oC.MapSvgIcon,MapSvgSpriteColor:oC.MapSvgSpriteColor,Tooltip:n_.Tooltip,TreeControls:n_.TreeControls,SelectionsGroup:ik,SvgLegends:ok,ElIconWarningFilled:QA,ElIconArrowDown:x_,ElIconArrowLeft:pA,DrawToolbar:n_.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(t){let e=_.inject("$annotator");return e||(e=_.markRaw(new ZFt(`${t.flatmapAPI}annotator`)),_.provide("$annotator",e)),{annotator:e}},methods:{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(t){if(this.mapImp)if(t){const e=Number(t);let r={feature:{}};if(e){const n=this.mapImp.featureProperties(e);r.feature=n}else{const n=this.existDrawnFeatures.find(i=>i.id===t.replace(" ",""));r.feature.feature=n}this.checkAndCreatePopups(r)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(t,e){if(!this.isValidDrawnCreated){if(this.manualAbortedOnClose(),this.doubleClickedFeature=!1,this.changeAnnotationDrawMode({mode:"simple_select"}),t==="mode")this.activeDrawMode=e;else if(t==="tool"){if(this.cancelDrawnFeature(),e){const r=e.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${r}`})}this.activeDrawTool=e}}},annotationDrawModeEvent:function(t){this.activeDrawMode==="Edit"?this.doubleClickedFeature&&(t.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:t.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1):this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[t.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const t=Object.values(this.connectionEntry),e={type:"connectivity",source:t[0],target:t[t.length-1],intermediates:t.filter((r,n)=>n!==0&&n!==t.length-1)};this.annotationEntry.body=e}},changeAnnotationDrawMode:function(t){this.mapImp&&this.mapImp.changeAnnotationDrawMode(t)},clearAnnotationFeature:function(){this.mapImp&&this.existDrawnFeatures.length>0&&this.mapImp.clearAnnotationFeature()},modifyAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&(this.mapImp.rollbackAnnotationEvent(this.annotationEntry),this.annotationEntry={})},commitAnnotationEvent:function(t){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&t&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),t.body.comment==="Position Updated"?this.annotationEntry.positionUpdated=!1:this.annotationEntry.type==="deleted"&&(this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEntry={}),this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(t=void 0,e=void 0){let r=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,t,e);return"resource"in r&&(r=r.itemIds),r},setFeatureAnnotated:async function(){if(this.mapImp){const t=await this.fetchAnnotatedItemIds();for(const e of t)this.mapImp.setFeatureAnnotated(e)}},fetchDrawnFeatures:async function(t,e){const r=await this.fetchAnnotatedItemIds(t,e);let n=await this.annotator.drawnFeatures(this.userToken,this.serverURL,r);return"resource"in n&&(n=n.features),n},addAnnotationFeature:async function(){if(this.mapImp){this.featureAnnotationSubmitted||(this.clearAnnotationFeature(),this.loading=!0);const t=this.annotationFrom==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",e=this.annotationFrom==="Anyone"?void 0:this.annotationFrom==="Me",r=await this.fetchDrawnFeatures(t,e);if(this.existDrawnFeatures=r,this.loading=!1,!this.featureAnnotationSubmitted)for(const n of r)this.mapImp.addAnnotationFeature(n)}},showAnnotator:function(t){this.mapImp&&(this.mapImp.showAnnotator(t),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setAnnotationFrom:function(t){this.annotationFrom=t,this.mapImp&&(this.manualAbortedOnClose(),this.addAnnotationFeature())},setFlightPath3D:function(t){this.flightPath3DRadio=t,this.mapImp&&this.mapImp.enableFlightPaths(t)},viewLatestMap:function(){let t=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(t="PATO:0000384");const e={entry:this.entry,biologicalSex:t,viewport:this.mapImp.getState()};this.$emit("view-latest-map",e)},backgroundChangeCallback:function(t){this.currentBackground=t,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(t){if(this.systems.length=0,t&&t.length>0){const e={label:"All",key:"All",children:[]};t.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=Bq(r,n.key);i.length>0&&(n.children=i),e.children.push(n)}),this.systems.push(e)}},processTaxon:function(t,e){this.taxonConnectivity.length=0,uv(this.mapImp,t).then(r=>{r.length&&r.forEach(n=>{let i=!0;e&&(i=e.checkAll?!0:e.checked.includes(n.taxon)),this.taxonConnectivity.push({...n,enabled:i}),this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(n.taxon,i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(t){this.colourRadio=t,this.mapImp&&this.mapImp.setPaint({colour:t,outline:this.outlinesRadio})},setOutlines:function(t){this.outlinesRadio=t,this.mapImp&&this.mapImp.setPaint({colour:this.colourRadio,outline:t})},setInitMapState:function(){if(this.mapImp){const t=this.mapImp._map,e=this.mapImp.options.bounds,r=[[e[0],e[1]],[e[2],e[3]]];t.setMaxBounds(null),this.initMapState=_.markRaw({initBounds:r})}},resetView:function(){if(this.mapImp){const t=this.mapImp._map,{initBounds:e}=this.initMapState;t.resetNorthPitch({animate:!1}),e&&t.fitBounds(e,{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(t){this.$emit("pathway-selection-changed",t)},sckanSelected:function(t){this.mapImp&&this.mapImp.enableSckanPath(t.key,t.value)},checkAllSCKAN:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableSckanPath(e,t.value))},highlightConnectedPaths:async function(t){var e,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(t)].map(d=>this.mapImp.featureProperties(d)),o=await this.flatmapQueries.queryForConnectivityNew(this.mapImp,t),a=(r=(e=o==null?void 0:o.ids)==null?void 0:e.dendrites)==null?void 0:r.flat().flat(),s=[],u=!1;i.forEach(d=>{this.mapImp.nodePathModels(d.featureId).forEach(f=>{u=!0,this.mapImp.pathModelNodes(f).forEach(Q=>{let y=this.mapImp.featureProperties([Q]);if(a.includes(y.models)){u=!1;return}}),u&&s.push(f)})}),this.mapImp.zoomToFeatures(s,{noZoomIn:!0})}},resetMapFilter:function(){const t=this.mapFilters.alert;let e;t.with?t.without||(e={HAS:"alert"}):t.without?e={NOT:{HAS:"alert"}}:e={AND:[{NOT:{HAS:"alert"}},{HAS:"alert"}]},e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter()},alertMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e;t.key==="alert"?e={HAS:"alert"}:t.key==="withoutAlert"&&(e={NOT:{HAS:"alert"}}),this.mapImp.setVisibilityFilter(e)}else this.resetMapFilter()},alertSelected:function(t){this.mapImp&&(t.key==="alert"?t.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:t.key==="withoutAlert"&&(t.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(t){this.mapImp&&(t.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(t){this.mapImp&&this.mapImp.enableSystem(t.key,t.value)},checkAllSystems:function(t){this.mapImp&&this.systems[0].children.forEach(e=>this.mapImp.enableSystem(e.label,t))},ftuSelected:function(t){this.searchAndShowResult(t,!0)},layersSelected:function(t){this.mapImp&&this.mapImp.enableLayer(t.key,t.value)},checkAllLayers:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableLayer(e,t.value))},taxonsSelected:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.key,t.value)},taxonMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){clearTimeout(this.taxonLeaveDelay);let e=this.mapImp.taxonFeatureIds(t.key);this.mapImp.enableConnectivityByTaxonIds(t.key,t.value),this.mapImp.zoomToGeoJSONFeatures(e,{noZoomIn:!0})}else this.taxonLeaveDelay=setTimeout(()=>{this.mapImp.unselectGeoJSONFeatures(),t.selections.forEach(e=>{let r=t.checked.includes(e.taxon);this.mapImp.enableConnectivityByTaxonIds(e.taxon,r)})},1e3)},checkAllTaxons:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.keys,t.value)},pathwaysSelected:function(t){this.mapImp&&this.mapImp.enablePath(t.key,t.value)},checkAllPathways:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enablePath(e,t.value))},enablePanZoomEvents:function(t){this.mapImp.enablePanZoomEvents(t)},annotationEventCallback:function(t,e){if(e.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent(),this.annotationEntry={};else if(e.type==="modeChanged")e.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0),this.annotationSidebar&&e.feature.mode==="simple_select"&&this.activeDrawMode==="Deleted"&&this.annotationEventCallback({},{type:"aborted"});else if(e.type==="selectionChanged"){if(this.selectedDrawnFeature=e.feature.features.length===0?void 0:e.feature.features[0],t.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool)if(this.connectionEntry={},this.selectedDrawnFeature){const r=this.existDrawnFeatures.find(n=>n.id===this.selectedDrawnFeature.id);r&&r.connection&&(this.connectionEntry=r.connection),this.annotationDrawModeEvent(t)}else this.annotationSidebar&&this.previousEditEvent.type==="updated"&&(this.annotationEntry={...this.previousEditEvent,resourceId:this.serverURL},this.annotationEventCallback({},{type:"aborted"})),this.previousEditEvent={}}else{if(e.type==="created"||e.type==="updated"){e.type==="updated"&&e.feature.action&&(e.positionUpdated=e.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(e.feature);t.feature.feature=r}e.type==="created"?this.drawnCreatedEvent=t:this.checkAndCreatePopups(t)}e.type==="updated"&&(this.previousEditEvent=e),e.type==="deleted"?this.previousDeletedEvent=e:this.previousDeletedEvent={}},eventCallback:function(){return(t,e,...r)=>{if(t==="annotation"){const n={feature:e,userData:r,eventType:t};this.annotationEventCallback(n,e)}else if(t!=="pan-zoom"){const n=e.label,i=[e.models],o=this.entry,a=this.biologicalSex;let s;e.taxons&&(typeof e.taxons!="object"?s=JSON.parse(e.taxons):s=e.taxons);const u={dataset:e.dataset,biologicalSex:a,taxonomy:o,resource:i,label:n,feature:e,userData:r,eventType:t,provenanceTaxonomy:s};if(t==="click"){if(this.setConnectivityDataSource(this.viewingMode,e),this.featuresAlert=e.alert,this.statesTracking.activeClick=!0,this.statesTracking.activeTerm=e==null?void 0:e.models,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([e.models]);else if(this.currentActive=e.models?e.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const d=e.featureId||this.existDrawnFeatures.find(f=>f.id===e.id);if(this.activeDrawTool==="LineString"&&d){const f=e.featureId?e.featureId:e.id,T=e.label?e.label:`Feature ${e.id}`;this.connectionEntry[` ${f}`]=Object.assign({label:T},Object.fromEntries(Object.entries(e).filter(([Q])=>["featureId","models"].includes(Q)).map(([Q,y])=>[Q==="featureId"?"id":Q,y])))}}}else t==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=e.models?e.models:"");e&&e.type!=="marker"&&t==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(u),this.$emit("resource-selected",u)}else this.$emit("pan-zoom-callback",e)}},setConnectivityDataSource:function(t,e){this.connectivityDataSource=e.source,(t==="Neuron Connection"||t==="Annotation")&&(this.connectivityDataSource=e.featureId)},changeViewingMode:function(t){t&&(this.viewingMode=t),this.manualAbortedOnClose()},removeActiveTooltips:function(){this.mapImp&&this.mapImp.removePopup(),this.$el.querySelectorAll(".flatmap-tooltip-popup").forEach(e=>e.remove())},createTooltipForConnectivity:function(t,e){const r=document.createElement("div");r.classList.add("flatmap-feature-label"),t.forEach((n,i)=>{const{label:o}=n;if(r.append(ak(o)),i+1<t.length){const a=document.createElement("hr");r.appendChild(a)}}),this.mapImp.showPopup(e,r,{className:"custom-popup flatmap-tooltip-popup",positionAtLastClick:!1,preserveSelection:!0})},showConnectivityTooltips:function(t){const{connectivityInfo:e,data:r}=t,n=[],i=[],o=[],a=[],s=[];if(r.length?r.forEach(u=>{o.push({id:u.id,label:u.label})}):this.removeActiveTooltips(),e&&e.featureId&&n.push(...e.featureId),this.mapImp){if(o.forEach((f,T)=>{const{id:Q,label:y}=f,b=this.mapImp.search(Q);if(b!=null&&b.results.length){const w=b==null?void 0:b.results[0].featureId;a.push({featureId:w,id:Q,label:y})}else s.push(f)}),a.length){let f=a[0].featureId;this.mapImp.annotations.forEach(T=>{const Q=T["anatomical-nodes"];if(Q){const y=Q.join("");a.every(w=>y.indexOf(w.id)!==-1)&&(f=T.featureId,i.push(f))}}),this.createTooltipForConnectivity(a,f)}else s.push(...o),this.removeActiveTooltips();s.length&&this.emitConnectivityGraphError(s);const d=[...this.mapImp.modelFeatureIdList(n),...i];this.mapImp.selectGeoJSONFeatures(d)}},showConnectivitiesByReference:function(t){this.searchConnectivitiesByReference(t).then(e=>{this.mapImp.selectFeatures(e)})},searchConnectivitiesByReference:async function(t){const e=sessionStorage.getItem("flatmap-knowledge");let r=[];return e?r=await Fat(t):r=await jat(this.mapImp,t,this.flatmapQueries),r},emitConnectivityGraphError:function(t){this.$emit("connectivity-graph-error",{data:{errorData:t,errorMessage:njt}})},checkAndCreatePopups:async function(t){if(this.viewingMode==="Annotation")t.feature?(this.annotationSidebar&&this.previousDeletedEvent.type==="deleted"&&(this.annotationEntry={...this.previousDeletedEvent,resourceId:this.serverURL},this.annotationEventCallback({},{type:"aborted"})),this.annotationEntry={...t.feature,resourceId:this.serverURL},t.feature.featureId&&t.feature.models?this.displayTooltip(t.feature.models):t.feature.feature&&(this.activeDrawTool||this.activeDrawMode||this.isValidDrawnCreated?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=t.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(t.feature.feature.id,ijt(t.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let e=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp,t);zat(this.mapImp,this.flatmapQueries),(e&&e[0]||t.feature.hyperlinks&&t.feature.hyperlinks.length>0)&&(this.resourceForTooltip=t.resource[0],t.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(t))}},popUpCssHacks:function(){const t=document.querySelector(".flatmap-tooltip-popup"),e=document.querySelector(".maplibregl-popup-close-button");t&&(t.style.display="none"),e.style.display="block",this.$refs.tooltip.$el.style.display="flex",e.onclick=()=>{this.$emit("connectivity-info-close"),t&&(t.style.display="block")}},closeTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.$el.style.display="none"),document.querySelectorAll(".maplibregl-popup").forEach(t=>{t.style.display="none"})},createTooltipFromNeuronCuration:async function(t){this.tooltipEntry=await this.flatmapQueries.createTooltipData(this.mapImp,t),this.displayTooltip(t.resource[0])},showPopup:function(t,e,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(t,e,n))},showMarkerPopup:function(t,e,r){this.mapImp&&this.mapImp.showMarkerPopup(t,e,r)},closeMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(t.classList.add("enlarge"),t.classList.remove("shrink")):(t.classList.add("shrink"),t.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");t&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),t.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(t){const e=this.hoverVisibilities.length,r=e-1,n=this.hoverVisibilities[this.helpModeActiveIndex];if(n){const i=n==null?void 0:n.refs,o=n==null?void 0:n.ref,a=this.$refs[i||o];if(a){const{parentElement:s,nextElementSibling:u}=a.$el,d=f=>f&&(f.classList.contains("pathway-container")||f.classList.contains("pathway-location"));(d(s)||d(u))&&(this.requiresDrawer?this.drawerOpen=!0:this.helpModeActiveIndex+=1)}else this.helpModeActiveIndex+=1}t||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=r),t&&this.helpModeActiveIndex>=r&&this.$emit("help-mode-last-item",!0),t&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(i=>{i.value=!0})):t&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.closeFlatmapHelpPopup())},showTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!0,this.$emit("shown-tooltip")},e))},hideTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!1},e))},displayTooltip:function(t,e=void 0){var i;let r,n={className:"flatmapvuer-popover"};e?(r=t,n.annotationFeatureGeometry=e):(r=this.mapImp.modelFeatureIds(t)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&(this.featuresAlert&&(this.tooltipEntry.featuresAlert=this.featuresAlert),(i=this.mapImp.provenance)!=null&&i.connectivity&&(this.tooltipEntry["knowledge-source"]=dv(this.mapImp)),this.$emit("connectivity-info-open",this.tooltipEntry)),this.annotationSidebar&&this.viewingMode==="Annotation"&&this.$emit("annotation-open",{annotationEntry:this.annotationEntry,commitCallback:this.commitAnnotationEvent}),!this.disableUI&&(this.viewingMode==="Annotation"&&!this.annotationSidebar||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar&&this.hasTooltipEntry())&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:t,destinations:e,origins:r,provenanceTaxonomy:n,provenanceTaxonomyLabel:i}=this.tooltipEntry;return!!(t!=null&&t.length||e!=null&&e.length||r!=null&&r.length||n!=null&&n.length||i!=null&&i.length)},moveMap:function(t,e={}){if(this.mapImp){const{offsetX:r=0,offsetY:n=0,zoom:i=4}=e,o=this.mapImp._map,a=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(t,{noZoomIn:!0}),this.showPathwaysDrawer(!1),a!=null&&a.length&&setTimeout(()=>{o.fitBounds(a,{offset:[r,n],zoom:i,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let t=this.mapImp.modelFeatureIds("UBERON:0000948");t&&t.length>0&&(this.mapImp.showPopup(t[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(t=>{t.click()})},getLabels:function(){let t=[];if(this.mapImp){let e=this.mapImp.annotations;for(let r of e.values())r.label&&t.push(r.label);return Array.from(new Set(t))}},getVisibilityState:function(t){if(["alertSelection","pathwaysSelection","taxonSelection"].forEach(r=>{let n=this.$refs[r];n&&(t[r]=n.getState())}),this.$refs.treeControls){const r=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();t.systemsSelection=r.filter(n=>!n.includes("."))}},setVisibilityState:function(t){["alertSelection","pathwaysSelection","taxonSelection"].forEach(r=>{const n=t[r];if(n){const i=this.$refs[r];i&&i.setState(n)}}),"systemsSelection"in t&&this.$refs.treeControls&&(this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t.systemsSelection),this.systems[0].children.forEach(r=>{this.mapImp.enableSystem(r.key,t.systemsSelection.includes(r.key))}))},getState:function(){if(this.mapImp){let t={entry:this.entry,viewport:this.mapImp.getState()};const e=this.mapImp.getIdentifier();return this.biologicalSex?t.biologicalSex=this.biologicalSex:e&&e.biologicalSex&&(t.biologicalSex=e.biologicalSex),e&&e.uuid&&(t.uuid=e.uuid),t.viewingMode=this.viewingMode,t.searchTerm=this.statesTracking.activeTerm,t.flightPath3D=this.flightPath3DRadio,t.colour=this.colourRadio,t.outlinesRadio=this.outlinesRadio,t.background=this.currentBackground,this.getVisibilityState(t),t}},setState:function(t){t&&(this.mapImp&&t.entry&&this.entry==t.entry&&(!t.biologicalSex||t.biologicalSex===this.biologicalSex)?this.restoreMapState(t):this.createFlatmap(t),this.setStateRequired=!1)},restoreMapState:function(t){if(t){if(t.viewport&&this.mapImp.setState(t.viewport),t.viewingMode&&this.changeViewingMode(t.viewingMode),"flightPath3D"in t&&this.setFlightPath3D(t.flightPath3D),"colour"in t&&this.setColour(t.colour),"outlines"in t&&this.setOutlines(t.outlines),t.background&&this.backgroundChangeCallback(t.background),t.searchTerm){const e=t.searchTerm;if(this.searchAndShowResult(e,!0),t.viewingMode==="Neuron Connection")this.highlightConnectedPaths([e]);else{const r=this.mapImp.modelFeatureIds(e);if(r.length>0){const n=this.mapImp.featureProperties(r[0]);this.searchAndShowResult(e,!0);const i={resource:[n.source],feature:n,label:n.label,provenanceTaxonomy:n.taxons};this.checkAndCreatePopups(i)}}}this.setVisibilityState(t)}},setFlightPathInfo:function(t){(t===1.6||t>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(t){if(!this.mapImp&&!this.loading){this.loading=!0;let e=!1;this.displayMinimap&&(e={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),t?(t.uuid?r={uuid:t.uuid}:t.entry&&(r.taxon=t.entry),t.biologicalSex?r.biologicalSex=t.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManagerRef.loadMap(r,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:e}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o);const a=this._stateToBeSet?this._stateToBeSet:t;this.onFlatmapReady(a),this.$nextTick(()=>this.restoreMapState(a))})}else t&&(this._stateToBeSet={...t},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const t=this.$refs.display;if(t){const e=getComputedStyle(t),r=parseInt(e.paddingTop)+parseInt(e.paddingBottom),n=t.clientHeight-r;this.pathwaysMaxHeight=n-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&(this.mapImp.resize(),this.showMinimap(this.displayMinimap),this.mapImp._minimap&&this.mapImp._minimap._miniMap.resize())}catch{console.error("Map resize error")}},onFlatmapReady:function(t){var e;this.sensor=_.markRaw(new qat(this.$refs.display,this.mapResize)),((e=this.mapImp.options)==null?void 0:e.style)==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.mapImp.taxonIdentifiers,t?t.taxonSelection:void 0),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.mapResize(),this.handleMapClick(),this.setInitMapState(),this.$emit("ready",this)},handleMapClick:function(){const t=this.mapImp._map;t&&t.on("click",e=>{this.statesTracking.activeClick?this.statesTracking.activeClick=!1:this.statesTracking.activeTerm="",this.connectivityDataSource||this.$emit("connectivity-info-close"),this.connectivityDataSource=""})},showMinimap:function(t){this.mapImp&&this.mapImp.showMinimap(t)},showPathwaysDrawer:function(t){this.drawerOpen=t},searchAndShowResult:function(t,e){if(this.mapImp){if(t===void 0||t==="")return this.mapImp.clearSearchResults(),this.statesTracking.activeTerm="",!0;{const r=this.mapImp.search(t);if(r&&r.results&&r.results.length>0){if(this.statesTracking.activeTerm=t,this.mapImp.showSearchResults(r),e&&r.results){let n,i;for(let o=0;o<r.results.length&&!(n!=null&&n.label);o++)i=r.results[o].featureId,n=this.mapImp.annotation(i);n!=null&&n.label&&this.mapImp.showPopup(i,ak(n.label),{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(t){return this.mapImp?this.mapImp.search(t):[]}},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}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{sensor:null,mapManagerRef:void 0,flatmapQueries:void 0,annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],initMapState:_.markRaw({}),sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:_.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:Wat,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:Dat,tooltipEntry:ojt(),connectivityDataSource:"",connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,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"]},annotationFrom:"Anyone",annotatedSource:["Anyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,userInformation: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:_.markRaw({alert:{with:!0,without:!0}}),statesTracking:_.markRaw({activeClick:!1,activeTerm:""}),taxonLeaveDelay:void 0}},computed:{...ejt(rjt,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0},requiresDrawer:function(){var t,e,r;if(this.loading)return this.drawerOpen=!1,!1;if(this.isFC){if(((t=this.systems)==null?void 0:t.length)>0||this.containsAlert&&this.alertOptions||((e=this.pathways)==null?void 0:e.length)>0||((r=this.taxonConnectivity)==null?void 0:r.length)>0)return this.drawerOpen=!0,!0}else return this.drawerOpen=!0,!0;return this.drawerOpen=!1,!0},modeDescription:function(){let t=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.userInformation?t[1]:t[0]:t}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(t,e){t!==e&&this.setHelpMode(t)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},state:{handler:function(t,e){t!==e&&(this.mapManagerRef?this.setState(t):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(t){t==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&e.canUpdate&&(this.showAnnotator(!0),this.userInformation=e,this.setFeatureAnnotated(),this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(t){t&&this.closeTooltip()},activeDrawTool:function(t){let e=[],r={x:null,y:null};const n=this.$el.querySelector(".maplibregl-canvas"),i=()=>{n.removeEventListener("keydown",o),n.removeEventListener("click",a)},o=s=>{if(!["Escape","Enter"].includes(s.key))return;const u=t==="Point"&&e.length===1||t==="LineString"&&e.length>=2||t==="Polygon"&&e.length>=3;(s.key==="Escape"||s.key==="Enter"&&!u)&&(this.activeDrawTool=void 0),i()},a=s=>{const u=n.getBoundingClientRect(),d=s.clientX-u.left,f=s.clientY-u.top;if(Math.sqrt((d-r.x)**2+(f-r.y)**2)<8){this.isValidDrawnCreated||(this.activeDrawTool=void 0),i();return}r={x:d,y:f},e.push(r)};t&&(i(),n.addEventListener("keydown",o),n.addEventListener("click",a))}},created:function(){this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=_.markRaw(new YS(this.flatmapAPI)),this.$emit("mapmanager-loaded",this.mapManagerRef))},mounted:function(){this.openMapRef=_.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=_.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.flatmapQueries=_.markRaw(new Bat),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap(),$at()}},A2=t=>(_.pushScopeId("data-v-c63b1b67"),t=t(),_.popScopeId(),t),sjt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},ljt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},cjt={style:{height:"100%",width:"100%"},ref:"display"},ujt={class:"beta-popovers"},hjt=A2(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),djt=A2(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),pjt=A2(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),fjt=A2(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Tjt=A2(()=>_.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),Qjt={key:2,class:"warning-text"},mjt=A2(()=>_.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),gjt=A2(()=>_.createElementVNode("b",null,"Connectivity References",-1)),yjt=A2(()=>_.createElementVNode("p",null," Connectivity references have been improved and available in various formats. ",-1)),_jt=A2(()=>_.createElementVNode("b",null,"Improved state storing",-1)),vjt=A2(()=>_.createElementVNode("p",null," Current selection and visibility filters are now stored when creating a permalink. ",-1)),bjt={class:"bottom-right-control"},Ljt=A2(()=>_.createElementVNode("div",null,[_.createTextVNode(" Fit to "),_.createElementVNode("br"),_.createTextVNode(" window ")],-1)),wjt=["innerHTML"],xjt=["innerHTML"],Ejt={style:{"margin-bottom":"2px"}},Mjt={key:0,class:"viewing-mode-title"},Sjt=["onClick"],Hjt=["onClick"];function Cjt(t,e,r,n,i,o){const a=_.resolveComponent("map-svg-sprite-color"),s=QA,u=Y2,d=Zd,f=x_,T=_.resolveComponent("DrawToolbar"),Q=_.resolveComponent("map-svg-icon"),y=ok,b=_.resolveComponent("tree-controls"),w=ik,M=pA,E=AO,O=n8,I=i8,N=ov,F=Wd,G=$O,W=WO,rt=_.resolveComponent("Tooltip"),nt=ek,ut=sv;return _.withDirectives((_.openBlock(),_.createElementBlock("div",sjt,[_.createVNode(a),_.createElementVNode("div",ljt,[_.createElementVNode("div",cjt,null,512),_.withDirectives(_.createElementVNode("div",ujt,[_.createElementVNode("div",null,[_.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[7].value,ref:"warningPopover"},{reference:_.withCtx(()=>[_.createElementVNode("div",{class:"warning-icon",onMouseover:e[7]||(e[7]=it=>o.showTooltip(7)),onMouseout:e[8]||(e[8]=it=>o.hideTooltip(7))},[r.displayWarning||r.isLegacy?(_.openBlock(),_.createBlock(u,{key:0},{default:_.withCtx(()=>[_.createVNode(s)]),_:1})):_.createCommentVNode("",!0),r.isLegacy?(_.openBlock(),_.createElementBlock(_.Fragment,{key:1},[Tjt,_.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...it)=>o.viewLatestMap&&o.viewLatestMap(...it))}," Click here for the latest map ")],64)):r.displayWarning?(_.openBlock(),_.createElementBlock("span",Qjt,"Beta")):_.createCommentVNode("",!0)],32)]),default:_.withCtx(()=>[r.isLegacy?(_.openBlock(),_.createElementBlock("p",{key:0,onMouseover:e[0]||(e[0]=it=>o.showTooltip(7)),onMouseout:e[1]||(e[1]=it=>o.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):t.isFC?(_.openBlock(),_.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=it=>o.showTooltip(7)),onMouseout:e[3]||(e[3]=it=>o.hideTooltip(7))},[_.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),hjt,_.createTextVNode(" models available in "),djt,_.createTextVNode(". ")],32)):(_.openBlock(),_.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=it=>o.showTooltip(7)),onMouseout:e[5]||(e[5]=it=>o.hideTooltip(7))},[_.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),pjt,_.createTextVNode(" models available in "),fjt,_.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(_.openBlock(),_.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:_.withCtx(()=>[r.displayLatestChanges?(_.openBlock(),_.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:e[9]||(e[9]=it=>o.showTooltip(8)),onMouseout:e[10]||(e[10]=it=>o.hideTooltip(8))},[_.createVNode(u,null,{default:_.withCtx(()=>[_.createVNode(s)]),_:1}),mjt],32)):_.createCommentVNode("",!0)]),default:_.withCtx(()=>[gjt,yjt,_jt,vjt]),_:1},8,["visible"])):_.createCommentVNode("",!0)],512),[[_.vShow,!r.disableUI]]),_.withDirectives(_.createVNode(u,{class:_.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:_.withCtx(()=>[_.createVNode(f)]),_:1},8,["class","onClick"]),[[_.vShow,t.minimapResizeShow]]),t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI?(_.openBlock(),_.createBlock(T,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:t.toolbarOptions,activeDrawTool:t.activeDrawTool,activeDrawMode:t.activeDrawMode,newlyDrawnEntry:t.drawnCreatedEvent,connectionEntry:t.connectionEntry,hoverVisibilities:t.hoverVisibilities,onClickToolbar:o.toolbarEvent,onFeatureTooltip:o.connectedFeatureTooltip,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):_.createCommentVNode("",!0),_.withDirectives(_.createElementVNode("div",bjt,[_.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:_.withCtx(()=>[_.createElementVNode("div",{class:"icon-button-container",onClick:e[11]||(e[11]=it=>o.zoomIn()),onMouseover:e[12]||(e[12]=it=>o.showTooltip(1)),onMouseout:e[13]||(e[13]=it=>o.hideTooltip(1))},[_.createVNode(Q,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),_.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:_.withCtx(()=>[_.createElementVNode("div",{class:"icon-button-container",onClick:e[14]||(e[14]=it=>o.zoomOut()),onMouseover:e[15]||(e[15]=it=>o.showTooltip(2)),onMouseout:e[16]||(e[16]=it=>o.hideTooltip(2))},[_.createVNode(Q,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),_.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:_.withCtx(()=>[_.createElementVNode("div",{class:"icon-button-container",onClick:e[17]||(e[17]=it=>o.resetView()),onMouseover:e[18]||(e[18]=it=>o.showTooltip(3)),onMouseout:e[19]||(e[19]=it=>o.hideTooltip(3))},[_.createVNode(Q,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:_.withCtx(()=>[Ljt]),_:1},8,["visible"])],512),[[_.vShow,!r.disableUI]]),_.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:t.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",{class:_.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.withDirectives((_.openBlock(),_.createElementBlock("div",{class:_.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:_.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?_.createCommentVNode("",!0):(_.openBlock(),_.createBlock(y,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(_.openBlock(),_.createBlock(d,{key:1,content:"Location of the featured dataset",placement:"right",teleported:!0,trigger:"manual",width:"max-content",offset:-10,"popper-class":"flatmap-popper flatmap-teleport-popper",visible:t.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",{class:"yellow-star-legend",innerHTML:t.yellowstar,onMouseover:e[20]||(e[20]=it=>o.showTooltip(9)),onMouseout:e[21]||(e[21]=it=>o.hideTooltip(9))},null,40,wjt),[[nt,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):_.createCommentVNode("",!0),_.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:t.hoverVisibilities[0].value,ref:"markerPopover"},{reference:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,xjt),[[_.vShow,t.hoverVisibilities[0].value],[nt,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(_.openBlock(),_.createBlock(b,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:t.systems,active:t.currentActive,hover:t.currentHover,onCheckChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):_.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(_.openBlock(),_.createBlock(w,{title:"Alert",labelKey:"label",identifierKey:"key",selections:t.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):_.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(_.openBlock(),_.createBlock(w,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:t.pathways,onChanged:o.pathwaysSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):_.createCommentVNode("",!0),t.taxonConnectivity&&t.taxonConnectivity.length>0?(_.openBlock(),_.createBlock(w,{title:"Studied in",labelKey:"label",identifierKey:"taxon",helpMessage:"Evidence exists that this set of neuron populations have been studied in the given species.",selections:t.taxonConnectivity,onChanged:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):_.createCommentVNode("",!0)],6)),[[nt,void 0,"checkBoxPopover"]]),_.createElementVNode("div",{onClick:e[22]||(e[22]=(...it)=>o.toggleDrawer&&o.toggleDrawer(...it)),class:_.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.createVNode(u,null,{default:_.withCtx(()=>[_.createVNode(M)]),_:1})],2)],2),[[_.vShow,!r.disableUI&&o.requiresDrawer]])]),_:1},8,["visible"]),t.openMapRef?(_.openBlock(),_.createBlock(d,{key:1,ref:"open-map-popover","virtual-ref":t.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(r.openMapOptions,it=>(_.openBlock(),_.createBlock(O,{key:it.key},{default:_.withCtx(()=>[_.createVNode(E,{type:"primary",plain:"",onClick:yt=>t.$emit("open-map",it.key)},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(it.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):_.createCommentVNode("",!0),_.createVNode(d,{ref:"backgroundPopover","virtual-ref":t.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:_.withCtx(()=>[_.createElementVNode("div",null,[_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Viewing Mode")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createElementVNode("div",Ejt,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.viewingModes,(it,yt,kt)=>(_.openBlock(),_.createElementBlock(_.Fragment,{key:yt},[yt===t.viewingMode?(_.openBlock(),_.createElementBlock("span",Mjt,[_.createElementVNode("b",null,_.toDisplayString(yt),1)])):(_.openBlock(),_.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Wt=>o.changeViewingMode(yt)},_.toDisplayString(yt),9,Sjt))],64))),128))]),_.createVNode(O,{class:"viewing-mode-description"},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(o.modeDescription),1)]),_:1})]),_:1}),t.viewingMode==="Annotation"&&t.userInformation?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Annotations From")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(F,{teleported:!1,modelValue:t.annotationFrom,"onUpdate:modelValue":e[23]||(e[23]=it=>t.annotationFrom=it),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setAnnotationFrom},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.annotatedSource,it=>(_.openBlock(),_.createBlock(N,{key:it,label:it,value:it},{default:_.withCtx(()=>[_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(I,{span:12},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(it),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:1,class:"backgroundSpacer"})):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:2,class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Flight path display")]),_:1})):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:3,class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(W,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[24]||(e[24]=it=>t.flightPath3DRadio=it),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:_.withCtx(()=>[_.createVNode(G,{value:!1},{default:_.withCtx(()=>[_.createTextVNode("2D")]),_:1}),_.createVNode(G,{value:!0},{default:_.withCtx(()=>[_.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):_.createCommentVNode("",!0),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Organs display")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(W,{modelValue:t.colourRadio,"onUpdate:modelValue":e[25]||(e[25]=it=>t.colourRadio=it),class:"flatmap-radio",onChange:o.setColour},{default:_.withCtx(()=>[_.createVNode(G,{value:!0},{default:_.withCtx(()=>[_.createTextVNode("Colour")]),_:1}),_.createVNode(G,{value:!1},{default:_.withCtx(()=>[_.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Outlines display")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(W,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[26]||(e[26]=it=>t.outlinesRadio=it),class:"flatmap-radio",onChange:o.setOutlines},{default:_.withCtx(()=>[_.createVNode(G,{value:!0},{default:_.withCtx(()=>[_.createTextVNode("Show")]),_:1}),_.createVNode(G,{value:!1},{default:_.withCtx(()=>[_.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Change background")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.availableBackground,it=>(_.openBlock(),_.createElementBlock("div",{key:it,class:_.normalizeClass(["backgroundChoice",it,it==t.currentBackground?"active":""]),onClick:yt=>o.backgroundChangeCallback(it)},null,10,Hjt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),_.withDirectives(_.createElementVNode("div",{class:_.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(d,{visible:t.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:_.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(_.openBlock(),_.createElementBlock("div",{key:0,ref:"openMapRef",class:"icon-button-container",onMouseover:e[27]||(e[27]=it=>o.showTooltip(4)),onMouseout:e[28]||(e[28]=it=>o.hideTooltip(4))},[_.createVNode(Q,{icon:"openMap",class:"icon-button open-map-button"})],544)):_.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(d,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:_.withCtx(()=>[_.createElementVNode("div",{ref:"backgroundIconRef",class:"icon-button-container",onMouseover:e[29]||(e[29]=it=>o.showTooltip(5)),onMouseout:e[30]||(e[30]=it=>o.hideTooltip(5))},[_.createVNode(Q,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})],2),[[_.vShow,!r.disableUI]]),t.tooltipDisplay?(_.openBlock(),_.createBlock(rt,{key:2,ref:"tooltip",class:"tooltip",annotationEntry:t.annotationEntry,tooltipEntry:t.tooltipEntry,annotationDisplay:t.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"])):_.createCommentVNode("",!0)])])),[[ut,t.loading]])}const aH=Kd(ajt,[["render",Cjt],["__scopeId","data-v-c63b1b67"]]);function Ajt(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(i){i(r)}),(n=t.get("*"))&&n.slice().map(function(i){i(e,r)})}}}const Fq=new Ajt,jq={"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"},Ojt={name:"MultiFlatmapVuer",components:{Col:i8,Row:n8,Option:ov,Select:Wd,Popover:Zd,FlatmapVuer:aH},created:function(){this.loadMapManager()},mounted:function(){this.initialise(),Fq.on("onActionClick",t=>{this.resourceSelected(t)}),Fq.on("open-pubmed-url",t=>{this.$emit("open-pubmed-url",t)})},methods:{initialise:function(){return new Promise(t=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(e=>e.json()).then(e=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&e.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=this.availableSpecies[n];else for(let o=0;o<e.length;o++)if(this.availableSpecies[n].taxo===e[o].taxon)if(this.availableSpecies[n].biologicalSex){if(e[o].biologicalSex&&e[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=this.availableSpecies[n];break}}else{this.speciesList[n]=this.availableSpecies[n];break}});let r=this.initial;if(this.state){const n=this.state.state;(!n||!n.uuid&&!n.entry)&&this.state.species?r=this.state.species:r=void 0}r&&(r&&this.speciesList[r]!==void 0?this.activeSpecies=r:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this.initialised=!0,t(),this.resolveList.forEach(n=>{n()})})):this.initialised?t():this.resolveList.push(t)})},loadMapManager:function(){this.mapManagerRef||(this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=_.markRaw(new YS(this.flatmapAPI)),this.$emit("mapmanager-loaded",this.mapManagerRef)))},resourceSelected:function(t){this.$emit("resource-selected",t)},FlatmapReady:function(t){this.$emit("ready",t)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(t){this.$emit("pan-zoom-callback",t)},onAnnotationClose:function(){this.$emit("annotation-close")},onAnnotationOpen:function(t){this.$emit("annotation-open",t)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(t){this.$emit("connectivity-info-open",t)},onConnectivityGraphError:function(t){this.$emit("connectivity-graph-error",t)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},showPopup:function(t,e,r){this.getCurrentFlatmap().showPopup(t,e,r)},showMarkerPopup:function(t,e,r){this.getCurrentFlatmap().showMarkerPopup(t,e,r)},setSpecies:function(t,e,r){if(this.$refs&&t in this.$refs)this.activeSpecies=t,this.$refs[this.activeSpecies][0].createFlatmap(e),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(t,e,n)})}},viewLatestMap:function(t){const e=Object.keys(this.speciesList);for(let r=0;r<e.length;r++){const n=this.speciesList[e[r]];if(!n.isLegacy&&n.taxo===t.entry&&n.biologicalSex===t.biologicalSex){this.setSpecies(e[r],t,0);return}}},createLegacyEntry:function(t,e,r){if(r&&e){let n="Legacy";return t.species&&(t.species.slice(0,6)==="Legacy"?n=t.species:n=n+` ${t.species}`),this.speciesList[n]={taxo:e,isLegacy:!0,displayWarning:!0},{species:n,state:{entry:e,uuid:r,viewport:t.state.viewport,searchTerm:t.state.searchTerm}}}},updateState:function(t){return new Promise(e=>{if(t&&t.state){const r=t.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n={taxon:r.entry};r.biologicalSex&&(n.biologicalSex=r.biologicalSex),this.mapManagerRef.findMap_(n).then(i=>{if(i.uuid!==r.uuid)return this.createLegacyEntry(t,r.entry,r.uuid)}).then(i=>{e(i||t)}).catch(()=>{e(t)})})}else if(r.entry){const n=r.entry in jq?jq[r.entry]:void 0,i=this.createLegacyEntry(t,r.entry,n);e(i||t)}}e(t)})},getState:function(){let t={species:this.activeSpecies,state:void 0},e=this.getCurrentFlatmap();return t.state=e.getState(),t},setState:function(t){t&&(this.loadMapManager(),this.updateState(t).then(e=>{this.initialise().then(()=>{e.species&&e.species!==this.activeSpecies?this.setSpecies(e.species,e.state,5):e.state&&this.getCurrentFlatmap().setState(e.state)})}))},activateTooltipByIndex:function(t){return t===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(t){t&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(t){this.getCurrentFlatmap().changeViewingMode(t)}},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}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:_.markRaw([]),initialised:!1,mapManagerRef:void 0}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},kjt=t=>(_.pushScopeId("data-v-8c396bf6"),t=t(),_.popScopeId(),t),Ijt={class:"multi-container",ref:"multiContainer"},Pjt={key:0,style:{position:"absolute","z-index":"100"}},Vjt=kjt(()=>_.createElementVNode("div",{class:"species-display-text"},"Species",-1)),Rjt={class:"select-box-icon"};function Njt(t,e,r,n,i,o){const a=ov,s=Wd,u=Zd,d=aH;return _.openBlock(),_.createElementBlock("div",Ijt,[r.disableUI?_.createCommentVNode("",!0):(_.openBlock(),_.createElementBlock("div",Pjt,[Vjt,_.createVNode(u,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:o.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:_.withCtx(()=>[_.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:t.activeSpecies,"onUpdate:modelValue":e[0]||(e[0]=f=>t.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.speciesList,(f,T)=>(_.openBlock(),_.createBlock(a,{key:T,label:T,value:T},{default:_.withCtx(()=>[_.createElementVNode("span",Rjt,[_.createElementVNode("i",{class:_.normalizeClass(f.iconClass)},null,2)]),_.createTextVNode(" "+_.toDisplayString(T),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.speciesList,(f,T)=>_.withDirectives((_.openBlock(),_.createBlock(d,{key:T,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:T,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,annotationSidebar:r.annotationSidebar,onAnnotationOpen:o.onAnnotationOpen,onAnnotationClose:o.onAnnotationClose,connectivityInfoSidebar:r.connectivityInfoSidebar,onConnectivityInfoOpen:o.onConnectivityInfoOpen,onConnectivityInfoClose:o.onConnectivityInfoClose,onConnectivityGraphError:o.onConnectivityGraphError,onOpenMap:e[1]||(e[1]=Q=>t.$emit("open-map",Q)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:t.activeSpecies==T&&r.helpMode,helpModeActiveItem:r.helpModeActiveItem,helpModeDialog:r.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:o.onHelpModeLastItem,onShownTooltip:o.onTooltipShown,onShownMapTooltip:o.onMapTooltipShown,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},mapManager:t.mapManagerRef,flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","annotationSidebar","onAnnotationOpen","onAnnotationClose","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityGraphError","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","mapManager","flatmapAPI","sparcAPI"])),[[_.vShow,t.activeSpecies==T]])),128))],512)}const Djt=Kd(Ojt,[["render",Njt],["__scopeId","data-v-8c396bf6"]]);d1.FlatmapVuer=aH,d1.MultiFlatmapVuer=Djt,Object.defineProperty(d1,Symbol.toStringTag,{value:"Module"})});
|
|
1728
|
+
This will fail in production.`);s=Eh,s._s.has(n)||(o?oH(n,e,i,s):Dq(n,i,s),process.env.NODE_ENV!=="production"&&(a._pinia=s));const f=s._s.get(n);if(process.env.NODE_ENV!=="production"&&u){const T="__hot:"+n,Q=o?oH(T,e,i,s,!0):Dq(T,Ka({},i),s,!0);u._hotUpdate(Q),delete s.state.value[T],s._s.delete(T)}if(process.env.NODE_ENV!=="production"&&rH){const T=_.getCurrentInstance();if(T&&T.proxy&&!u){const Q=T.proxy,y="_pStores"in Q?Q._pStores:Q._pStores={};y[n]=f}}return f}return a.$id=n,a}function ejt(t,e){return Array.isArray(e)?e.reduce((r,n)=>(r[n]=function(){return t(this.$pinia)[n]},r),{}):Object.keys(e).reduce((r,n)=>(r[n]=function(){const i=t(this.$pinia),o=e[n];return typeof o=="function"?o.call(this,i):i[o]},r),{})}const rjt=tjt("main",{state:()=>({userProfile:{token:""}}),getters:{userToken(t){return t.userProfile.token}},actions:{setUserToken(t){this.userProfile.token=t}}}),njt="cannot be found on the map.",ijt=t=>{let e={lng:0,lat:0},r;return t.type==="Polygon"?t.coordinates.length&&(r=t.coordinates[0]):r=t.coordinates,r&&(t.type!=="Point"?(r.map(n=>{e.lng+=parseFloat(n[0]),e.lat+=parseFloat(n[1])}),e.lng=e.lng/r.length,e.lat=e.lat/r.length):(e.lng+=parseFloat(r[0]),e.lat+=parseFloat(r[1]))),e},Bq=(t,e)=>{const r=[];let n=t.organs?t.organs:t.ftus;const i=n?n.filter((o,a)=>n.findIndex(s=>s.label===o.label)===a):void 0;return i&&i.forEach(o=>{const a={label:o.label,models:o.models,key:`${e}.${o.label}`},s=Bq(o,a.key);s.length>0&&(a.children=s),r.push(a)}),r},ojt=function(){return{destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0}},ajt={name:"FlatmapVuer",components:{Button:AO,Col:i8,Loading:wat,Radio:$O,Icon:Y2,RadioGroup:WO,Row:n8,Select:Wd,Dialog:zot,MapSvgIcon:oC.MapSvgIcon,MapSvgSpriteColor:oC.MapSvgSpriteColor,Tooltip:n_.Tooltip,TreeControls:n_.TreeControls,SelectionsGroup:ik,SvgLegends:ok,ElIconWarningFilled:QA,ElIconArrowDown:x_,ElIconArrowLeft:pA,DrawToolbar:n_.DrawToolbar},beforeCreate:function(){this.setStateRequired=!1},setup(t){let e=_.inject("$annotator");return e||(e=_.markRaw(new ZFt(`${t.flatmapAPI}annotator`)),_.provide("$annotator",e)),{annotator:e}},methods:{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(t){if(this.mapImp)if(t){const e=Number(t);let r={feature:{}};if(e){const n=this.mapImp.featureProperties(e);r.feature=n}else{const n=this.existDrawnFeatures.find(i=>i.id===t.replace(" ",""));r.feature.feature=n}this.checkAndCreatePopups(r)}else this.closeTooltip()},confirmDrawnFeature:function(){this.isValidDrawnCreated&&(this.checkAndCreatePopups(this.drawnCreatedEvent),Object.keys(this.connectionEntry).length>0&&(this.annotationEntry.feature.connection=this.connectionEntry),this.initialiseDrawing())},toolbarEvent:function(t,e){if(!this.isValidDrawnCreated){if(this.manualAbortedOnClose(),this.doubleClickedFeature=!1,this.changeAnnotationDrawMode({mode:"simple_select"}),t==="mode")this.activeDrawMode=e;else if(t==="tool"){if(this.cancelDrawnFeature(),e){const r=e.replace(/[A-Z]/g,n=>`_${n.toLowerCase()}`);this.changeAnnotationDrawMode({mode:`draw${r}`})}this.activeDrawTool=e}}},annotationDrawModeEvent:function(t){this.activeDrawMode==="Edit"?this.doubleClickedFeature&&(t.feature.feature.geometry.type!=="Point"&&(this.changeAnnotationDrawMode({mode:"direct_select",options:{featureId:t.feature.feature.id}}),this.modifyAnnotationFeature()),this.doubleClickedFeature=!1):this.activeDrawMode==="Delete"&&(this.changeAnnotationDrawMode({mode:"simple_select",options:{featureIds:[t.feature.feature.id]}}),this.modifyAnnotationFeature())},createConnectivityBody:function(){if(Object.keys(this.connectionEntry).length>0){const t=Object.values(this.connectionEntry),e={type:"connectivity",source:t[0],target:t[t.length-1],intermediates:t.filter((r,n)=>n!==0&&n!==t.length-1)};this.annotationEntry.body=e}},changeAnnotationDrawMode:function(t){this.mapImp&&this.mapImp.changeAnnotationDrawMode(t)},clearAnnotationFeature:function(){this.mapImp&&this.existDrawnFeatures.length>0&&this.mapImp.clearAnnotationFeature()},modifyAnnotationFeature:function(){this.mapImp&&this.mapImp.removeAnnotationFeature()},rollbackAnnotationEvent:function(){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&(this.mapImp.rollbackAnnotationEvent(this.annotationEntry),this.annotationEntry={})},commitAnnotationEvent:function(t){this.mapImp&&["created","updated","deleted"].includes(this.annotationEntry.type)&&t&&(this.featureAnnotationSubmitted=!0,this.mapImp.commitAnnotationEvent(this.annotationEntry),t.body.comment==="Position Updated"?this.annotationEntry.positionUpdated=!1:this.annotationEntry.type==="deleted"&&(this.annotationSidebar&&this.$emit("annotation-close"),this.closeTooltip(),this.annotationEntry={}),this.addAnnotationFeature())},fetchAnnotatedItemIds:async function(t=void 0,e=void 0){let r=await this.annotator.annotatedItemIds(this.userToken,this.serverURL,t,e);return"resource"in r&&(r=r.itemIds),r},setFeatureAnnotated:async function(){if(this.mapImp){const t=await this.fetchAnnotatedItemIds();for(const e of t)this.mapImp.setFeatureAnnotated(e)}},fetchDrawnFeatures:async function(t,e){const r=await this.fetchAnnotatedItemIds(t,e);let n=await this.annotator.drawnFeatures(this.userToken,this.serverURL,r);return"resource"in n&&(n=n.features),n},addAnnotationFeature:async function(){if(this.mapImp){this.featureAnnotationSubmitted||(this.clearAnnotationFeature(),this.loading=!0);const t=this.annotationFrom==="Anyone"?void 0:this.userInformation.orcid?this.userInformation.orcid:"0000-0000-0000-0000",e=this.annotationFrom==="Anyone"?void 0:this.annotationFrom==="Me",r=await this.fetchDrawnFeatures(t,e);if(this.existDrawnFeatures=r,this.loading=!1,!this.featureAnnotationSubmitted)for(const n of r)this.mapImp.addAnnotationFeature(n)}},showAnnotator:function(t){this.mapImp&&(this.mapImp.showAnnotator(t),this.$el.querySelector(".maplibregl-ctrl-group").style.display="none")},setAnnotationFrom:function(t){this.annotationFrom=t,this.mapImp&&(this.manualAbortedOnClose(),this.addAnnotationFeature())},setFlightPath3D:function(t){this.flightPath3DRadio=t,this.mapImp&&this.mapImp.enableFlightPaths(t)},viewLatestMap:function(){let t=this.biologicalSex?this.biologicalSex:void 0;this.entry==="NCBITaxon:9606"&&(t="PATO:0000384");const e={entry:this.entry,biologicalSex:t,viewport:this.mapImp.getState()};this.$emit("view-latest-map",e)},backgroundChangeCallback:function(t){this.currentBackground=t,this.mapImp&&this.mapImp.setBackgroundColour(this.currentBackground,1)},processSystems:function(t){if(this.systems.length=0,t&&t.length>0){const e={label:"All",key:"All",children:[]};t.forEach(r=>{const n={colour:r.colour,enabled:r.enabled,label:r.id,key:r.id},i=Bq(r,n.key);i.length>0&&(n.children=i),e.children.push(n)}),this.systems.push(e)}},processTaxon:function(t,e){this.taxonConnectivity.length=0,uv(this.mapImp,t).then(r=>{r.length&&r.forEach(n=>{let i=!0;e&&(i=e.checkAll?!0:e.checked.includes(n.taxon)),this.taxonConnectivity.push({...n,enabled:i}),this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(n.taxon,i)})})},toggleDrawer:function(){this.drawerOpen=!this.drawerOpen},setColour:function(t){this.colourRadio=t,this.mapImp&&this.mapImp.setPaint({colour:t,outline:this.outlinesRadio})},setOutlines:function(t){this.outlinesRadio=t,this.mapImp&&this.mapImp.setPaint({colour:this.colourRadio,outline:t})},setInitMapState:function(){if(this.mapImp){const t=this.mapImp._map,e=this.mapImp.options.bounds,r=[[e[0],e[1]],[e[2],e[3]]];t.setMaxBounds(null),this.initMapState=_.markRaw({initBounds:r})}},resetView:function(){if(this.mapImp){const t=this.mapImp._map,{initBounds:e}=this.initMapState;t.resetNorthPitch({animate:!1}),e&&t.fitBounds(e,{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(t){this.$emit("pathway-selection-changed",t)},sckanSelected:function(t){this.mapImp&&this.mapImp.enableSckanPath(t.key,t.value)},checkAllSCKAN:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableSckanPath(e,t.value))},highlightConnectedPaths:async function(t){var e,r;if(this.mapImp){let i=[...this.mapImp.pathModelNodes(t)].map(d=>this.mapImp.featureProperties(d)),o=await this.flatmapQueries.queryForConnectivityNew(this.mapImp,t),a=(r=(e=o==null?void 0:o.ids)==null?void 0:e.dendrites)==null?void 0:r.flat().flat(),s=[],u=!1;i.forEach(d=>{this.mapImp.nodePathModels(d.featureId).forEach(f=>{u=!0,this.mapImp.pathModelNodes(f).forEach(Q=>{let y=this.mapImp.featureProperties([Q]);if(a.includes(y.models)){u=!1;return}}),u&&s.push(f)})}),this.mapImp.zoomToFeatures(s,{noZoomIn:!0})}},resetMapFilter:function(){const t=this.mapFilters.alert;let e;t.with?t.without||(e={HAS:"alert"}):t.without?e={NOT:{HAS:"alert"}}:e={AND:[{NOT:{HAS:"alert"}},{HAS:"alert"}]},e?this.mapImp.setVisibilityFilter(e):this.mapImp.clearVisibilityFilter()},alertMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){let e;t.key==="alert"?e={HAS:"alert"}:t.key==="withoutAlert"&&(e={NOT:{HAS:"alert"}}),this.mapImp.setVisibilityFilter(e)}else this.resetMapFilter()},alertSelected:function(t){this.mapImp&&(t.key==="alert"?t.value?this.mapFilters.alert.with=!0:this.mapFilters.alert.with=!1:t.key==="withoutAlert"&&(t.value?this.mapFilters.alert.without=!0:this.mapFilters.alert.without=!1),this.resetMapFilter())},checkAllAlerts:function(t){this.mapImp&&(t.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(t){this.mapImp&&this.mapImp.enableSystem(t.key,t.value)},checkAllSystems:function(t){this.mapImp&&this.systems[0].children.forEach(e=>this.mapImp.enableSystem(e.label,t))},ftuSelected:function(t){this.searchAndShowResult(t,!0)},layersSelected:function(t){this.mapImp&&this.mapImp.enableLayer(t.key,t.value)},checkAllLayers:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enableLayer(e,t.value))},taxonsSelected:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.key,t.value)},taxonMouseEnterEmitted:function(t){if(this.mapImp)if(t.value){clearTimeout(this.taxonLeaveDelay);let e=this.mapImp.taxonFeatureIds(t.key);this.mapImp.enableConnectivityByTaxonIds(t.key,t.value),this.mapImp.zoomToGeoJSONFeatures(e,{noZoomIn:!0})}else this.taxonLeaveDelay=setTimeout(()=>{this.mapImp.unselectGeoJSONFeatures(),t.selections.forEach(e=>{let r=t.checked.includes(e.taxon);this.mapImp.enableConnectivityByTaxonIds(e.taxon,r)})},1e3)},checkAllTaxons:function(t){this.mapImp&&this.mapImp.enableConnectivityByTaxonIds(t.keys,t.value)},pathwaysSelected:function(t){this.mapImp&&this.mapImp.enablePath(t.key,t.value)},checkAllPathways:function(t){this.mapImp&&t.keys.forEach(e=>this.mapImp.enablePath(e,t.value))},enablePanZoomEvents:function(t){this.mapImp.enablePanZoomEvents(t)},annotationEventCallback:function(t,e){if(e.type==="aborted")this.featureAnnotationSubmitted?this.featureAnnotationSubmitted=!1:this.rollbackAnnotationEvent(),this.annotationEntry={};else if(e.type==="modeChanged")e.feature.mode==="direct_select"&&(this.doubleClickedFeature=!0),this.annotationSidebar&&e.feature.mode==="simple_select"&&this.activeDrawMode==="Deleted"&&this.annotationEventCallback({},{type:"aborted"});else if(e.type==="selectionChanged"){if(this.selectedDrawnFeature=e.feature.features.length===0?void 0:e.feature.features[0],t.feature.feature=this.selectedDrawnFeature,!this.activeDrawTool)if(this.connectionEntry={},this.selectedDrawnFeature){const r=this.existDrawnFeatures.find(n=>n.id===this.selectedDrawnFeature.id);r&&r.connection&&(this.connectionEntry=r.connection),this.annotationDrawModeEvent(t)}else this.annotationSidebar&&this.previousEditEvent.type==="updated"&&(this.annotationEntry={...this.previousEditEvent,resourceId:this.serverURL},this.annotationEventCallback({},{type:"aborted"})),this.previousEditEvent={}}else{if(e.type==="created"||e.type==="updated"){e.type==="updated"&&e.feature.action&&(e.positionUpdated=e.feature.action==="move");const r=this.mapImp.refreshAnnotationFeatureGeometry(e.feature);t.feature.feature=r}e.type==="created"?this.drawnCreatedEvent=t:this.checkAndCreatePopups(t)}e.type==="updated"&&(this.previousEditEvent=e),e.type==="deleted"?this.previousDeletedEvent=e:this.previousDeletedEvent={}},eventCallback:function(){return(t,e,...r)=>{if(t==="annotation"){const n={feature:e,userData:r,eventType:t};this.annotationEventCallback(n,e)}else if(t!=="pan-zoom"){const n=e.label,i=[e.models],o=this.entry,a=this.biologicalSex;let s;e.taxons&&(typeof e.taxons!="object"?s=JSON.parse(e.taxons):s=e.taxons);const u={dataset:e.dataset,biologicalSex:a,taxonomy:o,resource:i,label:n,feature:e,userData:r,eventType:t,provenanceTaxonomy:s};if(t==="click"){if(this.setConnectivityDataSource(this.viewingMode,e),this.featuresAlert=e.alert,this.statesTracking.activeClick=!0,this.statesTracking.activeTerm=e==null?void 0:e.models,this.viewingMode==="Neuron Connection")this.highlightConnectedPaths([e.models]);else if(this.currentActive=e.models?e.models:"",this.activeDrawTool&&!this.isValidDrawnCreated){const d=e.featureId||this.existDrawnFeatures.find(f=>f.id===e.id);if(this.activeDrawTool==="LineString"&&d){const f=e.featureId?e.featureId:e.id,T=e.label?e.label:`Feature ${e.id}`;this.connectionEntry[` ${f}`]=Object.assign({label:T},Object.fromEntries(Object.entries(e).filter(([Q])=>["featureId","models"].includes(Q)).map(([Q,y])=>[Q==="featureId"?"id":Q,y])))}}}else t==="mouseenter"&&this.viewingMode!=="Neuron Connection"&&(this.currentHover=e.models?e.models:"");e&&e.type!=="marker"&&t==="click"&&this.viewingMode!=="Neuron Connection"&&!this.activeDrawTool&&this.checkAndCreatePopups(u),this.$emit("resource-selected",u)}else this.$emit("pan-zoom-callback",e)}},setConnectivityDataSource:function(t,e){this.connectivityDataSource=e.source,(t==="Neuron Connection"||t==="Annotation")&&(this.connectivityDataSource=e.featureId)},changeViewingMode:function(t){t&&(this.viewingMode=t),this.manualAbortedOnClose()},removeActiveTooltips:function(){this.mapImp&&this.mapImp.removePopup(),this.$el.querySelectorAll(".flatmap-tooltip-popup").forEach(e=>e.remove())},createTooltipForConnectivity:function(t,e){const r=document.createElement("div");r.classList.add("flatmap-feature-label"),t.forEach((n,i)=>{const{label:o}=n;if(r.append(ak(o)),i+1<t.length){const a=document.createElement("hr");r.appendChild(a)}}),this.mapImp.showPopup(e,r,{className:"custom-popup flatmap-tooltip-popup",positionAtLastClick:!1,preserveSelection:!0})},showConnectivityTooltips:function(t){const{connectivityInfo:e,data:r}=t,n=[],i=[],o=[],a=[],s=[];if(r.length?r.forEach(u=>{o.push({id:u.id,label:u.label})}):this.removeActiveTooltips(),e&&e.featureId&&n.push(...e.featureId),this.mapImp){if(o.forEach((f,T)=>{const{id:Q,label:y}=f,b=this.mapImp.search(Q);if(b!=null&&b.results.length){const w=b==null?void 0:b.results[0].featureId;a.push({featureId:w,id:Q,label:y})}else s.push(f)}),a.length){let f=a[0].featureId;this.mapImp.annotations.forEach(T=>{const Q=T["anatomical-nodes"];if(Q){const y=Q.join("");a.every(w=>y.indexOf(w.id)!==-1)&&(f=T.featureId,i.push(f))}}),this.createTooltipForConnectivity(a,f)}else s.push(...o),this.removeActiveTooltips();s.length&&this.emitConnectivityGraphError(s);const d=[...this.mapImp.modelFeatureIdList(n),...i];this.mapImp.selectGeoJSONFeatures(d)}},showConnectivitiesByReference:function(t){this.searchConnectivitiesByReference(t).then(e=>{this.mapImp.selectFeatures(e)})},searchConnectivitiesByReference:async function(t){const e=sessionStorage.getItem("flatmap-knowledge");let r=[];return e?r=await Fat(t):r=await jat(this.mapImp,t,this.flatmapQueries),r},emitConnectivityGraphError:function(t){this.$emit("connectivity-graph-error",{data:{errorData:t,errorMessage:njt}})},checkAndCreatePopups:async function(t){if(this.viewingMode==="Annotation")t.feature?(this.annotationSidebar&&this.previousDeletedEvent.type==="deleted"&&(this.annotationEntry={...this.previousDeletedEvent,resourceId:this.serverURL},this.annotationEventCallback({},{type:"aborted"})),this.annotationEntry={...t.feature,resourceId:this.serverURL},t.feature.featureId&&t.feature.models?this.displayTooltip(t.feature.models):t.feature.feature&&(this.activeDrawTool||this.activeDrawMode||this.isValidDrawnCreated?(this.featureAnnotationSubmitted=!1,this.annotationEntry.featureId=t.feature.feature.id,this.activeDrawTool&&this.createConnectivityBody(),this.displayTooltip(t.feature.feature.id,ijt(t.feature.feature.geometry))):this.rollbackAnnotationEvent())):this.annotation={};else{let e=await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp,t);zat(this.mapImp,this.flatmapQueries),(e&&e[0]||t.feature.hyperlinks&&t.feature.hyperlinks.length>0)&&(this.resourceForTooltip=t.resource[0],t.resourceForTooltip=this.resourceForTooltip,this.createTooltipFromNeuronCuration(t))}},popUpCssHacks:function(){const t=document.querySelector(".flatmap-tooltip-popup"),e=document.querySelector(".maplibregl-popup-close-button");t&&(t.style.display="none"),e.style.display="block",this.$refs.tooltip.$el.style.display="flex",e.onclick=()=>{this.$emit("connectivity-info-close"),t&&(t.style.display="block")}},closeTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.$el.style.display="none"),document.querySelectorAll(".maplibregl-popup").forEach(t=>{t.style.display="none"})},createTooltipFromNeuronCuration:async function(t){this.tooltipEntry=await this.flatmapQueries.createTooltipData(this.mapImp,t),this.displayTooltip(t.resource[0])},showPopup:function(t,e,r){let n=r;this.mapImp&&(n?n.className||(n.className="custom-popup"):n={className:"custom-popup",positionAtLastClick:!0},this.mapImp.showPopup(t,e,n))},showMarkerPopup:function(t,e,r){this.mapImp&&this.mapImp.showMarkerPopup(t,e,r)},closeMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");this.minimapSmall?(t.classList.add("enlarge"),t.classList.remove("shrink")):(t.classList.add("shrink"),t.classList.remove("enlarge")),this.minimapSmall=!this.minimapSmall},addResizeButtonToMinimap:function(){let t=this.$refs.flatmapContainer.querySelector(".maplibregl-ctrl-minimap");t&&(this.$refs.minimapResize&&this.$refs.minimapResize.$el.parentNode&&this.$refs.minimapResize.$el.parentNode.removeChild(this.$refs.minimapResize.$el),t.appendChild(this.$refs.minimapResize.$el),this.minimapResizeShow=!0)},setHelpMode:function(t){const e=this.hoverVisibilities.length,r=e-1,n=this.hoverVisibilities[this.helpModeActiveIndex];if(n){const i=n==null?void 0:n.refs,o=n==null?void 0:n.ref,a=this.$refs[i||o];if(a){const{parentElement:s,nextElementSibling:u}=a.$el,d=f=>f&&(f.classList.contains("pathway-container")||f.classList.contains("pathway-location"));(d(s)||d(u))&&(this.requiresDrawer?this.drawerOpen=!0:this.helpModeActiveIndex+=1)}else this.helpModeActiveIndex+=1}t||(this.helpModeActiveIndex=this.helpModeInitialIndex),this.viewingMode!=="Annotation"&&this.helpModeActiveIndex>9&&(this.helpModeActiveIndex=r),t&&this.helpModeActiveIndex>=r&&this.$emit("help-mode-last-item",!0),t&&!this.helpModeDialog?(this.inHelp=!0,this.hoverVisibilities.forEach(i=>{i.value=!0})):t&&this.helpModeDialog&&e>this.helpModeActiveIndex?this.helpModeActiveIndex>-1?(this.closeFlatmapHelpPopup(),setTimeout(()=>{this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.showTooltip(this.helpModeActiveIndex,200)},300)):this.helpModeActiveIndex===-1&&this.openFlatmapHelpPopup():(this.inHelp=!1,this.hoverVisibilities.forEach(i=>{i.value=!1}),this.closeFlatmapHelpPopup())},showTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!0,this.$emit("shown-tooltip")},e))},hideTooltip:function(t,e=500){this.inHelp||(clearTimeout(this.tooltipWait[t]),this.tooltipWait[t]=setTimeout(()=>{this.hoverVisibilities[t].value=!1},e))},displayTooltip:function(t,e=void 0){var i;let r,n={className:"flatmapvuer-popover"};e?(r=t,n.annotationFeatureGeometry=e):(r=this.mapImp.modelFeatureIds(t)[0],this.activeDrawTool||(n.positionAtLastClick=!0)),this.connectivityInfoSidebar&&this.hasTooltipEntry()&&this.viewingMode!=="Annotation"&&(this.featuresAlert&&(this.tooltipEntry.featuresAlert=this.featuresAlert),(i=this.mapImp.provenance)!=null&&i.connectivity&&(this.tooltipEntry["knowledge-source"]=dv(this.mapImp)),this.$emit("connectivity-info-open",this.tooltipEntry)),this.annotationSidebar&&this.viewingMode==="Annotation"&&this.$emit("annotation-open",{annotationEntry:this.annotationEntry,commitCallback:this.commitAnnotationEvent}),!this.disableUI&&(this.viewingMode==="Annotation"&&!this.annotationSidebar||this.viewingMode==="Exploration"&&!this.connectivityInfoSidebar&&this.hasTooltipEntry())&&(this.tooltipDisplay=!0,this.$nextTick(()=>{this.mapImp.showPopup(r,this.$refs.tooltip.$el,n),this.popUpCssHacks()}))},hasTooltipEntry:function(){const{components:t,destinations:e,origins:r,provenanceTaxonomy:n,provenanceTaxonomyLabel:i}=this.tooltipEntry;return!!(t!=null&&t.length||e!=null&&e.length||r!=null&&r.length||n!=null&&n.length||i!=null&&i.length)},moveMap:function(t,e={}){if(this.mapImp){const{offsetX:r=0,offsetY:n=0,zoom:i=4}=e,o=this.mapImp._map,a=this.mapImp._bounds.toArray();this.mapImp.zoomToFeatures(t,{noZoomIn:!0}),this.showPathwaysDrawer(!1),a!=null&&a.length&&setTimeout(()=>{o.fitBounds(a,{offset:[r,n],zoom:i,animate:!0})})}},openFlatmapHelpPopup:function(){if(this.mapImp){let t=this.mapImp.modelFeatureIds("UBERON:0000948");t&&t.length>0&&(this.mapImp.showPopup(t[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(t=>{t.click()})},getLabels:function(){let t=[];if(this.mapImp){let e=this.mapImp.annotations;for(let r of e.values())r.label&&t.push(r.label);return Array.from(new Set(t))}},getVisibilityState:function(t){if(["alertSelection","pathwaysSelection","taxonSelection"].forEach(r=>{let n=this.$refs[r];n&&(t[r]=n.getState())}),this.$refs.treeControls){const r=this.$refs.treeControls.$refs.regionTree.getCheckedKeys();t.systemsSelection=r.filter(n=>!n.includes("."))}},setVisibilityState:function(t){["alertSelection","pathwaysSelection","taxonSelection"].forEach(r=>{const n=t[r];if(n){const i=this.$refs[r];i&&i.setState(n)}}),"systemsSelection"in t&&this.$refs.treeControls&&(this.$refs.treeControls.$refs.regionTree.setCheckedKeys(t.systemsSelection),this.systems[0].children.forEach(r=>{this.mapImp.enableSystem(r.key,t.systemsSelection.includes(r.key))}))},getState:function(){if(this.mapImp){let t={entry:this.entry,viewport:this.mapImp.getState()};const e=this.mapImp.getIdentifier();return this.biologicalSex?t.biologicalSex=this.biologicalSex:e&&e.biologicalSex&&(t.biologicalSex=e.biologicalSex),e&&e.uuid&&(t.uuid=e.uuid),t.viewingMode=this.viewingMode,t.searchTerm=this.statesTracking.activeTerm,t.flightPath3D=this.flightPath3DRadio,t.colour=this.colourRadio,t.outlinesRadio=this.outlinesRadio,t.background=this.currentBackground,this.getVisibilityState(t),t}},setState:function(t){t&&(this.mapImp&&t.entry&&this.entry==t.entry&&(!t.biologicalSex||t.biologicalSex===this.biologicalSex)?this.restoreMapState(t):this.createFlatmap(t),this.setStateRequired=!1)},restoreMapState:function(t){if(t){if(t.viewport&&this.mapImp.setState(t.viewport),t.viewingMode&&this.changeViewingMode(t.viewingMode),"flightPath3D"in t&&this.setFlightPath3D(t.flightPath3D),"colour"in t&&this.setColour(t.colour),"outlines"in t&&this.setOutlines(t.outlines),t.background&&this.backgroundChangeCallback(t.background),t.searchTerm){const e=t.searchTerm;if(this.searchAndShowResult(e,!0),t.viewingMode==="Neuron Connection")this.highlightConnectedPaths([e]);else{const r=this.mapImp.modelFeatureIds(e);if(r.length>0){const n=this.mapImp.featureProperties(r[0]);this.searchAndShowResult(e,!0);const i={resource:[n.source],feature:n,label:n.label,provenanceTaxonomy:n.taxons};this.checkAndCreatePopups(i)}}}this.setVisibilityState(t)}},setFlightPathInfo:function(t){(t===1.6||t>1.6)&&(this.displayFlightPathOption=!0,this.setFlightPath3D(!1))},createFlatmap:function(t){if(!this.mapImp&&!this.loading){this.loading=!0;let e=!1;this.displayMinimap&&(e={position:"top-right"});let r={taxon:this.entry};this.uuid&&(r.uuid=this.uuid),t?(t.uuid?r={uuid:t.uuid}:t.entry&&(r.taxon=t.entry),t.biologicalSex?r.biologicalSex=t.biologicalSex:r.taxon==="NCBITaxon:9606"&&(r.biologicalSex="PATO:0000384")):this.biologicalSex&&(r.biologicalSex=this.biologicalSex),this.mapManagerRef.loadMap(r,this.$refs.display,this.eventCallback(),{minZoom:this.minZoom,tooltips:this.tooltips,minimap:e}).then(i=>{this.mapImp=i,this.serverURL=this.mapImp.makeServerUrl("").slice(0,-1);let o=this.mapImp.details.version;this.setFlightPathInfo(o);const a=this._stateToBeSet?this._stateToBeSet:t;this.onFlatmapReady(a),this.$nextTick(()=>this.restoreMapState(a))})}else t&&(this._stateToBeSet={...t},this.mapImp&&!this.loading&&this.restoreMapState(this._stateToBeSet))},computePathControlsMaximumHeight(){const t=this.$refs.display;if(t){const e=getComputedStyle(t),r=parseInt(e.paddingTop)+parseInt(e.paddingBottom),n=t.clientHeight-r;this.pathwaysMaxHeight=n-170}},mapResize:function(){try{this.computePathControlsMaximumHeight(),this.mapImp&&(this.mapImp.resize(),this.showMinimap(this.displayMinimap),this.mapImp._minimap&&this.mapImp._minimap._miniMap.resize())}catch{console.error("Map resize error")}},onFlatmapReady:function(t){var e;this.sensor=_.markRaw(new qat(this.$refs.display,this.mapResize)),((e=this.mapImp.options)==null?void 0:e.style)==="functional"&&(this.isFC=!0),this.mapImp.setBackgroundOpacity(1),this.backgroundChangeCallback(this.currentBackground),this.pathways=this.mapImp.pathTypes(),this.processSystems(this.mapImp.getSystems()),this.processTaxon(this.mapImp.taxonIdentifiers,t?t.taxonSelection:void 0),this.containsAlert="alert"in this.mapImp.featureFilterRanges(),this.addResizeButtonToMinimap(),this.loading=!1,this.computePathControlsMaximumHeight(),this.mapResize(),this.handleMapClick(),this.setInitMapState(),this.$emit("ready",this)},handleMapClick:function(){const t=this.mapImp._map;t&&t.on("click",e=>{this.statesTracking.activeClick?this.statesTracking.activeClick=!1:this.statesTracking.activeTerm="",this.connectivityDataSource||this.$emit("connectivity-info-close"),this.connectivityDataSource=""})},showMinimap:function(t){this.mapImp&&this.mapImp.showMinimap(t)},showPathwaysDrawer:function(t){this.drawerOpen=t},searchAndShowResult:function(t,e){if(this.mapImp){if(t===void 0||t==="")return this.mapImp.clearSearchResults(),this.statesTracking.activeTerm="",!0;{const r=this.mapImp.search(t);if(r&&r.results&&r.results.length>0){if(this.statesTracking.activeTerm=t,this.mapImp.showSearchResults(r),e&&r.results){let n,i;for(let o=0;o<r.results.length&&!(n!=null&&n.label);o++)i=r.results[o].featureId,n=this.mapImp.annotation(i);n!=null&&n.label&&this.mapImp.showPopup(i,ak(n.label),{className:"custom-popup",positionAtLastClick:!1,preserveSelection:!0})}return!0}else this.mapImp.clearSearchResults()}}return!1},searchSuggestions:function(t){return this.mapImp?this.mapImp.search(t):[]}},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}},provide(){return{flatmapAPI:this.flatmapAPI,sparcAPI:this.sparcAPI,getFeaturesAlert:()=>this.featuresAlert,userApiKey:this.userToken}},data:function(){return{sensor:null,mapManagerRef:void 0,flatmapQueries:void 0,annotationEntry:{},tooltipDisplay:!1,serverURL:void 0,layers:[],pathways:[],initMapState:_.markRaw({}),sckanDisplay:[{label:"Display Path with SCKAN",key:"VALID"}],systems:[],taxonConnectivity:[],pathwaysMaxHeight:1e3,tooltipWait:_.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:Wat,isFC:!1,inHelp:!1,currentBackground:"white",availableBackground:["white","lightskyblue","black"],loading:!1,flatmapMarker:Dat,tooltipEntry:ojt(),connectivityDataSource:"",connectivityTooltipVisible:!1,drawerOpen:!1,featuresAlert:void 0,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"]},annotationFrom:"Anyone",annotatedSource:["Anyone","Me","Others"],openMapRef:void 0,backgroundIconRef:void 0,toolbarOptions:["Edit","Delete","Point","LineString","Polygon","Connection"],annotator:void 0,userInformation: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:_.markRaw({alert:{with:!0,without:!0}}),statesTracking:_.markRaw({activeClick:!1,activeTerm:""}),taxonLeaveDelay:void 0}},computed:{...ejt(rjt,["userToken"]),isValidDrawnCreated:function(){return Object.keys(this.drawnCreatedEvent).length>0},requiresDrawer:function(){var t,e,r;if(this.loading)return this.drawerOpen=!1,!1;if(this.isFC){if(((t=this.systems)==null?void 0:t.length)>0||this.containsAlert&&this.alertOptions||((e=this.pathways)==null?void 0:e.length)>0||((r=this.taxonConnectivity)==null?void 0:r.length)>0)return this.drawerOpen=!0,!0}else return this.drawerOpen=!0,!0;return this.drawerOpen=!1,!0},modeDescription:function(){let t=this.viewingModes[this.viewingMode];return this.viewingMode==="Annotation"?this.userInformation?t[1]:t[0]:t}},watch:{entry:function(){this.state||this.createFlatmap()},helpMode:function(t,e){t!==e&&this.setHelpMode(t)},helpModeActiveItem:function(){this.helpMode&&(this.helpModeActiveIndex+=1,this.setHelpMode(this.helpMode))},state:{handler:function(t,e){t!==e&&(this.mapManagerRef?this.setState(t):this.setStateRequired=!0)},immediate:!0,deep:!0},viewingMode:function(t){t==="Annotation"?(this.loading=!0,this.annotator.authenticate(this.userToken).then(e=>{e.name&&e.email&&e.canUpdate&&(this.showAnnotator(!0),this.userInformation=e,this.setFeatureAnnotated(),this.addAnnotationFeature()),this.loading=!1})):this.showAnnotator(!1)},disableUI:function(t){t&&this.closeTooltip()},activeDrawTool:function(t){let e=[],r={x:null,y:null};const n=this.$el.querySelector(".maplibregl-canvas"),i=()=>{n.removeEventListener("keydown",o),n.removeEventListener("click",a)},o=s=>{if(!["Escape","Enter"].includes(s.key))return;const u=t==="Point"&&e.length===1||t==="LineString"&&e.length>=2||t==="Polygon"&&e.length>=3;(s.key==="Escape"||s.key==="Enter"&&!u)&&(this.activeDrawTool=void 0),i()},a=s=>{const u=n.getBoundingClientRect(),d=s.clientX-u.left,f=s.clientY-u.top;if(Math.sqrt((d-r.x)**2+(f-r.y)**2)<8){this.isValidDrawnCreated||(this.activeDrawTool=void 0),i();return}r={x:d,y:f},e.push(r)};t&&(i(),n.addEventListener("keydown",o),n.addEventListener("click",a))}},created:function(){this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=_.markRaw(new YS(this.flatmapAPI)),this.$emit("mapmanager-loaded",this.mapManagerRef))},mounted:function(){this.openMapRef=_.shallowRef(this.$refs.openMapRef),this.backgroundIconRef=_.shallowRef(this.$refs.backgroundIconRef),this.tooltipWait.length=this.hoverVisibilities.length,this.flatmapQueries=_.markRaw(new Bat),this.flatmapQueries.initialise(this.flatmapAPI),this.state?this.setStateRequired&&this.setState(this.state):this.renderAtMounted&&this.createFlatmap(),$at()}},A2=t=>(_.pushScopeId("data-v-c00ccb2d"),t=t(),_.popScopeId(),t),sjt={class:"flatmap-container",ref:"flatmapContainer","element-loading-text":"Loading...","element-loading-background":"rgba(0, 0, 0, 0.3)"},ljt={style:{height:"100%",width:"100%",position:"relative","overflow-y":"none"}},cjt={style:{height:"100%",width:"100%"},ref:"display"},ujt={class:"beta-popovers"},hjt=A2(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),djt=A2(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),pjt=A2(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/1ZUKXU2YmLcn2reCyXjlew",target:"_blank"}," ApiNATOMY ",-1)),fjt=A2(()=>_.createElementVNode("a",{href:"https://sparc.science/resources/6eg3VpJbwQR4B84CjrvmyD",target:"_blank"}," SCKAN ",-1)),Tjt=A2(()=>_.createElementVNode("span",{class:"warning-text"},"Legacy Map",-1)),Qjt={key:2,class:"warning-text"},mjt=A2(()=>_.createElementVNode("span",{class:"warning-text"},"What's new?",-1)),gjt=A2(()=>_.createElementVNode("b",null,"Connectivity References",-1)),yjt=A2(()=>_.createElementVNode("p",null," Connectivity references have been improved and available in various formats. ",-1)),_jt=A2(()=>_.createElementVNode("b",null,"Improved state storing",-1)),vjt=A2(()=>_.createElementVNode("p",null," Current selection and visibility filters are now stored when creating a permalink. ",-1)),bjt={class:"bottom-right-control"},Ljt=A2(()=>_.createElementVNode("div",null,[_.createTextVNode(" Fit to "),_.createElementVNode("br"),_.createTextVNode(" window ")],-1)),wjt=["innerHTML"],xjt=["innerHTML"],Ejt={style:{"margin-bottom":"2px"}},Mjt={key:0,class:"viewing-mode-title"},Sjt=["onClick"],Hjt=["onClick"];function Cjt(t,e,r,n,i,o){const a=_.resolveComponent("map-svg-sprite-color"),s=QA,u=Y2,d=Zd,f=x_,T=_.resolveComponent("DrawToolbar"),Q=_.resolveComponent("map-svg-icon"),y=ok,b=_.resolveComponent("tree-controls"),w=ik,M=pA,E=AO,O=n8,I=i8,N=ov,F=Wd,G=$O,W=WO,rt=_.resolveComponent("Tooltip"),nt=ek,ut=sv;return _.withDirectives((_.openBlock(),_.createElementBlock("div",sjt,[_.createVNode(a),_.createElementVNode("div",ljt,[_.createElementVNode("div",cjt,null,512),_.withDirectives(_.createElementVNode("div",ujt,[_.createElementVNode("div",null,[_.createVNode(d,{placement:"right","popper-class":"warning-popper flatmap-popper",teleported:!1,visible:t.hoverVisibilities[7].value,ref:"warningPopover"},{reference:_.withCtx(()=>[_.createElementVNode("div",{class:"warning-icon",onMouseover:e[7]||(e[7]=it=>o.showTooltip(7)),onMouseout:e[8]||(e[8]=it=>o.hideTooltip(7))},[r.displayWarning||r.isLegacy?(_.openBlock(),_.createBlock(u,{key:0},{default:_.withCtx(()=>[_.createVNode(s)]),_:1})):_.createCommentVNode("",!0),r.isLegacy?(_.openBlock(),_.createElementBlock(_.Fragment,{key:1},[Tjt,_.createElementVNode("div",{class:"latest-map-text",onClick:e[6]||(e[6]=(...it)=>o.viewLatestMap&&o.viewLatestMap(...it))}," Click here for the latest map ")],64)):r.displayWarning?(_.openBlock(),_.createElementBlock("span",Qjt,"Beta")):_.createCommentVNode("",!0)],32)]),default:_.withCtx(()=>[r.isLegacy?(_.openBlock(),_.createElementBlock("p",{key:0,onMouseover:e[0]||(e[0]=it=>o.showTooltip(7)),onMouseout:e[1]||(e[1]=it=>o.hideTooltip(7))}," This is a legacy map, you may view the latest map instead. ",32)):t.isFC?(_.openBlock(),_.createElementBlock("p",{key:1,onMouseover:e[2]||(e[2]=it=>o.showTooltip(7)),onMouseout:e[3]||(e[3]=it=>o.hideTooltip(7))},[_.createTextVNode(" This map displays the connectivity of individual neurons. Specifically, those which align with (parts of) the neuron populations from the "),hjt,_.createTextVNode(" models available in "),djt,_.createTextVNode(". ")],32)):(_.openBlock(),_.createElementBlock("p",{key:2,onMouseover:e[4]||(e[4]=it=>o.showTooltip(7)),onMouseout:e[5]||(e[5]=it=>o.hideTooltip(7))},[_.createTextVNode(" This map displays the connectivity of neuron populations. Specifically, those from the primarily rat-based "),pjt,_.createTextVNode(" models available in "),fjt,_.createTextVNode(". New connectivity and species specificity will be added as the SPARC program progresses. ")],32))]),_:1},8,["visible"])]),r.displayLatestChanges?(_.openBlock(),_.createBlock(d,{key:0,placement:"right",teleported:!1,trigger:"manual","popper-class":"warning-popper flatmap-popper",visible:t.hoverVisibilities[8].value,ref:"whatsNewPopover"},{reference:_.withCtx(()=>[r.displayLatestChanges?(_.openBlock(),_.createElementBlock("div",{key:0,class:"latest-changesicon",onMouseover:e[9]||(e[9]=it=>o.showTooltip(8)),onMouseout:e[10]||(e[10]=it=>o.hideTooltip(8))},[_.createVNode(u,null,{default:_.withCtx(()=>[_.createVNode(s)]),_:1}),mjt],32)):_.createCommentVNode("",!0)]),default:_.withCtx(()=>[gjt,yjt,_jt,vjt]),_:1},8,["visible"])):_.createCommentVNode("",!0)],512),[[_.vShow,!r.disableUI]]),_.withDirectives(_.createVNode(u,{class:_.normalizeClass(["minimap-resize",{enlarge:t.minimapSmall,shrink:!t.minimapSmall}]),ref:"minimapResize",onClick:o.closeMinimap},{default:_.withCtx(()=>[_.createVNode(f)]),_:1},8,["class","onClick"]),[[_.vShow,t.minimapResizeShow]]),t.viewingMode==="Annotation"&&t.userInformation&&!r.disableUI?(_.openBlock(),_.createBlock(T,{key:0,mapCanvas:{containerHTML:this.$el,class:".maplibregl-canvas"},toolbarOptions:t.toolbarOptions,activeDrawTool:t.activeDrawTool,activeDrawMode:t.activeDrawMode,newlyDrawnEntry:t.drawnCreatedEvent,connectionEntry:t.connectionEntry,hoverVisibilities:t.hoverVisibilities,onClickToolbar:o.toolbarEvent,onFeatureTooltip:o.connectedFeatureTooltip,onConfirmDrawn:o.confirmDrawnFeature,onCancelDrawn:o.cancelDrawnFeature,onShowTooltip:o.showTooltip,onHideTooltip:o.hideTooltip,ref:"toolbarPopover"},null,8,["mapCanvas","toolbarOptions","activeDrawTool","activeDrawMode","newlyDrawnEntry","connectionEntry","hoverVisibilities","onClickToolbar","onFeatureTooltip","onConfirmDrawn","onCancelDrawn","onShowTooltip","onHideTooltip"])):_.createCommentVNode("",!0),_.withDirectives(_.createElementVNode("div",bjt,[_.createVNode(d,{content:"Zoom in",placement:"left",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[1].value,ref:"zoomInPopover"},{reference:_.withCtx(()=>[_.createElementVNode("div",{class:"icon-button-container",onClick:e[11]||(e[11]=it=>o.zoomIn()),onMouseover:e[12]||(e[12]=it=>o.showTooltip(1)),onMouseout:e[13]||(e[13]=it=>o.hideTooltip(1))},[_.createVNode(Q,{class:"icon-button zoomIn",icon:"zoomIn"})],32)]),_:1},8,["visible"]),_.createVNode(d,{content:"Zoom out",placement:"top-end",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[2].value,ref:"zoomOutPopover"},{reference:_.withCtx(()=>[_.createElementVNode("div",{class:"icon-button-container",onClick:e[14]||(e[14]=it=>o.zoomOut()),onMouseover:e[15]||(e[15]=it=>o.showTooltip(2)),onMouseout:e[16]||(e[16]=it=>o.hideTooltip(2))},[_.createVNode(Q,{class:"icon-button zoomOut",icon:"zoomOut"})],32)]),_:1},8,["visible"]),_.createVNode(d,{content:"Reset",placement:"top",teleported:!1,trigger:"manual",width:"70","popper-class":"flatmap-popper",visible:t.hoverVisibilities[3].value,ref:"zoomFitPopover"},{reference:_.withCtx(()=>[_.createElementVNode("div",{class:"icon-button-container",onClick:e[17]||(e[17]=it=>o.resetView()),onMouseover:e[18]||(e[18]=it=>o.showTooltip(3)),onMouseout:e[19]||(e[19]=it=>o.hideTooltip(3))},[_.createVNode(Q,{class:"icon-button fitWindow",icon:"fitWindow"})],32)]),default:_.withCtx(()=>[Ljt]),_:1},8,["visible"])],512),[[_.vShow,!r.disableUI]]),_.createVNode(d,{content:"Change pathway visibility",placement:"right",teleported:!1,trigger:"manual",offset:-18,"popper-class":"flatmap-popper",visible:t.hoverVisibilities[6].value,ref:"checkBoxPopover"},{reference:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",{class:_.normalizeClass(["pathway-location",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.withDirectives((_.openBlock(),_.createElementBlock("div",{class:_.normalizeClass(["pathway-container",{open:t.drawerOpen,close:!t.drawerOpen}]),style:_.normalizeStyle({"max-height":t.pathwaysMaxHeight+"px"})},[t.isFC?_.createCommentVNode("",!0):(_.openBlock(),_.createBlock(y,{key:0,class:"svg-legends-container"})),r.showStarInLegend?(_.openBlock(),_.createBlock(d,{key:1,content:"Location of the featured dataset",placement:"right",teleported:!0,trigger:"manual",width:"max-content",offset:-10,"popper-class":"flatmap-popper flatmap-teleport-popper",visible:t.hoverVisibilities[9].value,ref:"featuredMarkerPopover"},{reference:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",{class:"yellow-star-legend",innerHTML:t.yellowstar,onMouseover:e[20]||(e[20]=it=>o.showTooltip(9)),onMouseout:e[21]||(e[21]=it=>o.hideTooltip(9))},null,40,wjt),[[nt,void 0,"featuredMarkerPopover"]])]),_:1},8,["visible"])):_.createCommentVNode("",!0),_.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:t.hoverVisibilities[0].value,ref:"markerPopover"},{reference:_.withCtx(()=>[_.withDirectives(_.createElementVNode("div",{class:"flatmap-marker-help",innerHTML:t.flatmapMarker},null,8,xjt),[[_.vShow,t.hoverVisibilities[0].value],[nt,void 0,"markerPopover"]])]),_:1},8,["visible"]),t.isFC&&t.systems&&t.systems.length>0?(_.openBlock(),_.createBlock(b,{key:2,class:"treeControls",mapType:"flatmap",title:"Systems",treeData:t.systems,active:t.currentActive,hover:t.currentHover,onCheckChanged:o.systemSelected,onCheckAll:o.checkAllSystems,onChangeActive:o.ftuSelected,ref:"treeControls"},null,8,["treeData","active","hover","onCheckChanged","onCheckAll","onChangeActive"])):_.createCommentVNode("",!0),t.containsAlert&&t.alertOptions?(_.openBlock(),_.createBlock(w,{title:"Alert",labelKey:"label",identifierKey:"key",selections:t.alertOptions,onChanged:o.alertSelected,onCheckboxMouseEnter:o.alertMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllAlerts,ref:"alertSelection",key:"alertSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):_.createCommentVNode("",!0),t.pathways&&t.pathways.length>0?(_.openBlock(),_.createBlock(w,{title:"Pathways",labelKey:"label",identifierKey:"type",colourStyle:"line",selections:t.pathways,onChanged:o.pathwaysSelected,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllPathways,ref:"pathwaysSelection",key:"pathwaysSelection"},null,8,["selections","onChanged","onSelectionsDataChanged","onCheckAll"])):_.createCommentVNode("",!0),t.taxonConnectivity&&t.taxonConnectivity.length>0?(_.openBlock(),_.createBlock(w,{title:"Studied in",labelKey:"label",identifierKey:"taxon",helpMessage:"Evidence exists that this set of neuron populations have been studied in the given species.",selections:t.taxonConnectivity,onChanged:o.taxonsSelected,onCheckboxMouseEnter:o.taxonMouseEnterEmitted,onSelectionsDataChanged:o.onSelectionsDataChanged,onCheckAll:o.checkAllTaxons,ref:"taxonSelection",key:"taxonSelection"},null,8,["selections","onChanged","onCheckboxMouseEnter","onSelectionsDataChanged","onCheckAll"])):_.createCommentVNode("",!0)],6)),[[nt,void 0,"checkBoxPopover"]]),_.createElementVNode("div",{onClick:e[22]||(e[22]=(...it)=>o.toggleDrawer&&o.toggleDrawer(...it)),class:_.normalizeClass(["drawer-button",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.createVNode(u,null,{default:_.withCtx(()=>[_.createVNode(M)]),_:1})],2)],2),[[_.vShow,!r.disableUI&&o.requiresDrawer]])]),_:1},8,["visible"]),t.openMapRef?(_.openBlock(),_.createBlock(d,{key:1,ref:"open-map-popover","virtual-ref":t.openMapRef,placement:"top-start",width:"136",teleported:!1,trigger:"click","popper-class":"open-map-popper non-selectable","virtual-triggering":""},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(r.openMapOptions,it=>(_.openBlock(),_.createBlock(O,{key:it.key},{default:_.withCtx(()=>[_.createVNode(E,{type:"primary",plain:"",onClick:yt=>t.$emit("open-map",it.key)},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(it.display),1)]),_:2},1032,["onClick"])]),_:2},1024))),128))]),_:1},8,["virtual-ref"])):_.createCommentVNode("",!0),_.createVNode(d,{ref:"backgroundPopover","virtual-ref":t.backgroundIconRef,placement:"top-start",width:"320",teleported:!1,trigger:"click","popper-class":"background-popper h-auto","virtual-triggering":""},{default:_.withCtx(()=>[_.createElementVNode("div",null,[_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Viewing Mode")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createElementVNode("div",Ejt,[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.viewingModes,(it,yt,kt)=>(_.openBlock(),_.createElementBlock(_.Fragment,{key:yt},[yt===t.viewingMode?(_.openBlock(),_.createElementBlock("span",Mjt,[_.createElementVNode("b",null,_.toDisplayString(yt),1)])):(_.openBlock(),_.createElementBlock("span",{key:1,class:"viewing-mode-unselected",onClick:Wt=>o.changeViewingMode(yt)},_.toDisplayString(yt),9,Sjt))],64))),128))]),_.createVNode(O,{class:"viewing-mode-description"},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(o.modeDescription),1)]),_:1})]),_:1}),t.viewingMode==="Annotation"&&t.userInformation?(_.openBlock(),_.createElementBlock(_.Fragment,{key:0},[_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Annotations From")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(F,{teleported:!1,modelValue:t.annotationFrom,"onUpdate:modelValue":e[23]||(e[23]=it=>t.annotationFrom=it),placeholder:"Select",class:"select-box","popper-class":"flatmap_dropdown",onChange:o.setAnnotationFrom},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.annotatedSource,it=>(_.openBlock(),_.createBlock(N,{key:it,label:it,value:it},{default:_.withCtx(()=>[_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(I,{span:12},{default:_.withCtx(()=>[_.createTextVNode(_.toDisplayString(it),1)]),_:2},1024)]),_:2},1024)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1})],64)):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:1,class:"backgroundSpacer"})):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:2,class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Flight path display")]),_:1})):_.createCommentVNode("",!0),t.displayFlightPathOption?(_.openBlock(),_.createBlock(O,{key:3,class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(W,{modelValue:t.flightPath3DRadio,"onUpdate:modelValue":e[24]||(e[24]=it=>t.flightPath3DRadio=it),class:"flatmap-radio",onChange:o.setFlightPath3D},{default:_.withCtx(()=>[_.createVNode(G,{value:!1},{default:_.withCtx(()=>[_.createTextVNode("2D")]),_:1}),_.createVNode(G,{value:!0},{default:_.withCtx(()=>[_.createTextVNode("3D")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1})):_.createCommentVNode("",!0),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Organs display")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(W,{modelValue:t.colourRadio,"onUpdate:modelValue":e[25]||(e[25]=it=>t.colourRadio=it),class:"flatmap-radio",onChange:o.setColour},{default:_.withCtx(()=>[_.createVNode(G,{value:!0},{default:_.withCtx(()=>[_.createTextVNode("Colour")]),_:1}),_.createVNode(G,{value:!1},{default:_.withCtx(()=>[_.createTextVNode("Greyscale")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Outlines display")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[_.createVNode(W,{modelValue:t.outlinesRadio,"onUpdate:modelValue":e[26]||(e[26]=it=>t.outlinesRadio=it),class:"flatmap-radio",onChange:o.setOutlines},{default:_.withCtx(()=>[_.createVNode(G,{value:!0},{default:_.withCtx(()=>[_.createTextVNode("Show")]),_:1}),_.createVNode(G,{value:!1},{default:_.withCtx(()=>[_.createTextVNode("Hide")]),_:1})]),_:1},8,["modelValue","onChange"])]),_:1}),_.createVNode(O,{class:"backgroundSpacer"}),_.createVNode(O,{class:"backgroundText"},{default:_.withCtx(()=>[_.createTextVNode("Change background")]),_:1}),_.createVNode(O,{class:"backgroundControl"},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.availableBackground,it=>(_.openBlock(),_.createElementBlock("div",{key:it,class:_.normalizeClass(["backgroundChoice",it,it==t.currentBackground?"active":""]),onClick:yt=>o.backgroundChangeCallback(it)},null,10,Hjt))),128))]),_:1})])]),_:1},8,["virtual-ref"]),_.withDirectives(_.createElementVNode("div",{class:_.normalizeClass(["settings-group",{open:t.drawerOpen,close:!t.drawerOpen}])},[_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(d,{visible:t.hoverVisibilities[4].value,content:"Open new map",placement:"right",teleported:!1,"popper-class":"flatmap-popper",ref:"openMapPopover"},{reference:_.withCtx(()=>[r.enableOpenMapUI&&r.openMapOptions.length>0?(_.openBlock(),_.createElementBlock("div",{key:0,ref:"openMapRef",class:"icon-button-container",onMouseover:e[27]||(e[27]=it=>o.showTooltip(4)),onMouseout:e[28]||(e[28]=it=>o.hideTooltip(4))},[_.createVNode(Q,{icon:"openMap",class:"icon-button open-map-button"})],544)):_.createCommentVNode("",!0)]),_:1},8,["visible"])]),_:1}),_.createVNode(O,null,{default:_.withCtx(()=>[_.createVNode(d,{content:"Change settings",placement:"right",visible:t.hoverVisibilities[5].value,teleported:!1,trigger:"manual","popper-class":"flatmap-popper",ref:"settingsPopover"},{reference:_.withCtx(()=>[_.createElementVNode("div",{ref:"backgroundIconRef",class:"icon-button-container",onMouseover:e[29]||(e[29]=it=>o.showTooltip(5)),onMouseout:e[30]||(e[30]=it=>o.hideTooltip(5))},[_.createVNode(Q,{icon:"changeBckgd",class:"icon-button"})],544)]),_:1},8,["visible"])]),_:1})],2),[[_.vShow,!r.disableUI]]),t.tooltipDisplay?(_.openBlock(),_.createBlock(rt,{key:2,ref:"tooltip",class:"tooltip",annotationEntry:t.annotationEntry,tooltipEntry:t.tooltipEntry,annotationDisplay:t.viewingMode==="Annotation",onAnnotation:o.commitAnnotationEvent},null,8,["annotationEntry","tooltipEntry","annotationDisplay","onAnnotation"])):_.createCommentVNode("",!0)])])),[[ut,t.loading]])}const aH=Kd(ajt,[["render",Cjt],["__scopeId","data-v-c00ccb2d"]]);function Ajt(t){return{all:t=t||new Map,on:function(e,r){var n=t.get(e);n?n.push(r):t.set(e,[r])},off:function(e,r){var n=t.get(e);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(e,[]))},emit:function(e,r){var n=t.get(e);n&&n.slice().map(function(i){i(r)}),(n=t.get("*"))&&n.slice().map(function(i){i(e,r)})}}}const Fq=new Ajt,jq={"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"},Ojt={name:"MultiFlatmapVuer",components:{Col:i8,Row:n8,Option:ov,Select:Wd,Popover:Zd,FlatmapVuer:aH},created:function(){this.loadMapManager()},mounted:function(){this.initialise(),Fq.on("onActionClick",t=>{this.resourceSelected(t)}),Fq.on("open-pubmed-url",t=>{this.$emit("open-pubmed-url",t)})},methods:{initialise:function(){return new Promise(t=>{this.requireInitialisation?(this.requireInitialisation=!1,fetch(this.flatmapAPI).then(e=>e.json()).then(e=>{Object.keys(this.availableSpecies).forEach(n=>{const i=this.availableSpecies[n].uuid;if(i&&e.map(o=>o.uuid).indexOf(i)>0)this.speciesList[n]=this.availableSpecies[n];else for(let o=0;o<e.length;o++)if(this.availableSpecies[n].taxo===e[o].taxon)if(this.availableSpecies[n].biologicalSex){if(e[o].biologicalSex&&e[o].biologicalSex===this.availableSpecies[n].biologicalSex){this.speciesList[n]=this.availableSpecies[n];break}}else{this.speciesList[n]=this.availableSpecies[n];break}});let r=this.initial;if(this.state){const n=this.state.state;(!n||!n.uuid&&!n.entry)&&this.state.species?r=this.state.species:r=void 0}r&&(r&&this.speciesList[r]!==void 0?this.activeSpecies=r:this.activeSpecies=Object.keys(this.speciesList)[0],this.setSpecies(this.activeSpecies,this.state?this.state.state:void 0,5)),this.initialised=!0,t(),this.resolveList.forEach(n=>{n()})})):this.initialised?t():this.resolveList.push(t)})},loadMapManager:function(){this.mapManagerRef||(this.mapManager?this.mapManagerRef=this.mapManager:(this.mapManagerRef=_.markRaw(new YS(this.flatmapAPI)),this.$emit("mapmanager-loaded",this.mapManagerRef)))},resourceSelected:function(t){this.$emit("resource-selected",t)},FlatmapReady:function(t){this.$emit("ready",t)},getCurrentFlatmap:function(){return this.$refs[this.activeSpecies][0]},panZoomCallback:function(t){this.$emit("pan-zoom-callback",t)},onAnnotationClose:function(){this.$emit("annotation-close")},onAnnotationOpen:function(t){this.$emit("annotation-open",t)},onConnectivityInfoClose:function(){this.$emit("connectivity-info-close")},onConnectivityInfoOpen:function(t){this.$emit("connectivity-info-open",t)},onConnectivityGraphError:function(t){this.$emit("connectivity-graph-error",t)},onSelectionsDataChanged:function(t){this.$emit("pathway-selection-changed",t)},showPopup:function(t,e,r){this.getCurrentFlatmap().showPopup(t,e,r)},showMarkerPopup:function(t,e,r){this.getCurrentFlatmap().showMarkerPopup(t,e,r)},setSpecies:function(t,e,r){if(this.$refs&&t in this.$refs)this.activeSpecies=t,this.$refs[this.activeSpecies][0].createFlatmap(e),this.$emit("flatmapChanged",this.activeSpecies);else if(r){const n=r-1;n>=0&&this.$nextTick(()=>{this.setSpecies(t,e,n)})}},viewLatestMap:function(t){const e=Object.keys(this.speciesList);for(let r=0;r<e.length;r++){const n=this.speciesList[e[r]];if(!n.isLegacy&&n.taxo===t.entry&&n.biologicalSex===t.biologicalSex){this.setSpecies(e[r],t,0);return}}},createLegacyEntry:function(t,e,r){if(r&&e){let n="Legacy";return t.species&&(t.species.slice(0,6)==="Legacy"?n=t.species:n=n+` ${t.species}`),this.speciesList[n]={taxo:e,isLegacy:!0,displayWarning:!0},{species:n,state:{entry:e,uuid:r,viewport:t.state.viewport,searchTerm:t.state.searchTerm}}}},updateState:function(t){return new Promise(e=>{if(t&&t.state){const r=t.state;if(r.uuid){if(r.entry)return new Promise(()=>{const n={taxon:r.entry};r.biologicalSex&&(n.biologicalSex=r.biologicalSex),this.mapManagerRef.findMap_(n).then(i=>{if(i.uuid!==r.uuid)return this.createLegacyEntry(t,r.entry,r.uuid)}).then(i=>{e(i||t)}).catch(()=>{e(t)})})}else if(r.entry){const n=r.entry in jq?jq[r.entry]:void 0,i=this.createLegacyEntry(t,r.entry,n);e(i||t)}}e(t)})},getState:function(){let t={species:this.activeSpecies,state:void 0},e=this.getCurrentFlatmap();return t.state=e.getState(),t},setState:function(t){t&&(this.loadMapManager(),this.updateState(t).then(e=>{this.initialise().then(()=>{e.species&&e.species!==this.activeSpecies?this.setSpecies(e.species,e.state,5):e.state&&this.getCurrentFlatmap().setState(e.state)})}))},activateTooltipByIndex:function(t){return t===this.helpModeActiveItem&&this.helpMode},onHelpModeLastItem:function(t){t&&this.$emit("help-mode-last-item",!0)},onTooltipShown:function(){this.$emit("shown-tooltip")},onMapTooltipShown:function(){this.$emit("shown-map-tooltip")},changeViewingMode:function(t){this.getCurrentFlatmap().changeViewingMode(t)}},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}},data:function(){return{activeSpecies:void 0,speciesList:{},requireInitialisation:!0,resolveList:_.markRaw([]),initialised:!1,mapManagerRef:void 0}},watch:{state:{handler:function(t){this.setState(t)},immediate:!0,deep:!0}}},kjt=t=>(_.pushScopeId("data-v-8c396bf6"),t=t(),_.popScopeId(),t),Ijt={class:"multi-container",ref:"multiContainer"},Pjt={key:0,style:{position:"absolute","z-index":"100"}},Vjt=kjt(()=>_.createElementVNode("div",{class:"species-display-text"},"Species",-1)),Rjt={class:"select-box-icon"};function Njt(t,e,r,n,i,o){const a=ov,s=Wd,u=Zd,d=aH;return _.openBlock(),_.createElementBlock("div",Ijt,[r.disableUI?_.createCommentVNode("",!0):(_.openBlock(),_.createElementBlock("div",Pjt,[Vjt,_.createVNode(u,{content:"Select a species",placement:"right",trigger:"manual","popper-class":"flatmap-popper flatmap-teleport-popper right-popper",width:"max-content",visible:o.activateTooltipByIndex(0),teleported:!1,ref:"selectPopover"},{reference:_.withCtx(()=>[_.createVNode(s,{id:"flatmap-select",teleported:!1,modelValue:t.activeSpecies,"onUpdate:modelValue":e[0]||(e[0]=f=>t.activeSpecies=f),placeholder:"Select",class:"select-box","popper-class":"flatmap-dropdown",onChange:o.setSpecies},{default:_.withCtx(()=>[(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.speciesList,(f,T)=>(_.openBlock(),_.createBlock(a,{key:T,label:T,value:T},{default:_.withCtx(()=>[_.createElementVNode("span",Rjt,[_.createElementVNode("i",{class:_.normalizeClass(f.iconClass)},null,2)]),_.createTextVNode(" "+_.toDisplayString(T),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1},8,["visible"])])),(_.openBlock(!0),_.createElementBlock(_.Fragment,null,_.renderList(t.speciesList,(f,T)=>_.withDirectives((_.openBlock(),_.createBlock(d,{key:T,entry:f.taxo,uuid:f.uuid,biologicalSex:f.biologicalSex,displayWarning:f.displayWarning,displayLatestChanges:f.displayLatestChanges,isLegacy:f.isLegacy,ref_for:!0,ref:T,enableOpenMapUI:r.enableOpenMapUI,openMapOptions:r.openMapOptions,disableUI:r.disableUI,onViewLatestMap:o.viewLatestMap,onResourceSelected:o.resourceSelected,onReady:o.FlatmapReady,onPanZoomCallback:o.panZoomCallback,annotationSidebar:r.annotationSidebar,onAnnotationOpen:o.onAnnotationOpen,onAnnotationClose:o.onAnnotationClose,connectivityInfoSidebar:r.connectivityInfoSidebar,onConnectivityInfoOpen:o.onConnectivityInfoOpen,onConnectivityInfoClose:o.onConnectivityInfoClose,onConnectivityGraphError:o.onConnectivityGraphError,onOpenMap:e[1]||(e[1]=Q=>t.$emit("open-map",Q)),onPathwaySelectionChanged:o.onSelectionsDataChanged,minZoom:r.minZoom,helpMode:t.activeSpecies==T&&r.helpMode,helpModeActiveItem:r.helpModeActiveItem,helpModeDialog:r.helpModeDialog,helpModeInitialIndex:-2,onHelpModeLastItem:o.onHelpModeLastItem,onShownTooltip:o.onTooltipShown,onShownMapTooltip:o.onMapTooltipShown,renderAtMounted:r.renderAtMounted,displayMinimap:r.displayMinimap,showStarInLegend:r.showStarInLegend,style:{height:"100%"},mapManager:t.mapManagerRef,flatmapAPI:r.flatmapAPI,sparcAPI:r.sparcAPI},null,8,["entry","uuid","biologicalSex","displayWarning","displayLatestChanges","isLegacy","enableOpenMapUI","openMapOptions","disableUI","onViewLatestMap","onResourceSelected","onReady","onPanZoomCallback","annotationSidebar","onAnnotationOpen","onAnnotationClose","connectivityInfoSidebar","onConnectivityInfoOpen","onConnectivityInfoClose","onConnectivityGraphError","onPathwaySelectionChanged","minZoom","helpMode","helpModeActiveItem","helpModeDialog","onHelpModeLastItem","onShownTooltip","onShownMapTooltip","renderAtMounted","displayMinimap","showStarInLegend","mapManager","flatmapAPI","sparcAPI"])),[[_.vShow,t.activeSpecies==T]])),128))],512)}const Djt=Kd(Ojt,[["render",Njt],["__scopeId","data-v-8c396bf6"]]);d1.FlatmapVuer=aH,d1.MultiFlatmapVuer=Djt,Object.defineProperty(d1,Symbol.toStringTag,{value:"Module"})});
|