@abi-software/map-side-bar 2.5.3-beta.7 → 2.5.3-beta.8
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/map-side-bar.js
CHANGED
|
@@ -47545,7 +47545,7 @@ const Xfe = {
|
|
|
47545
47545
|
},
|
|
47546
47546
|
// Sort by saved and updated
|
|
47547
47547
|
sortSearchHistory(e, t) {
|
|
47548
|
-
return e.saved !== t.saved ? t.saved - e.saved : e.updated !== t.updated ?
|
|
47548
|
+
return e.saved !== t.saved ? t.saved - e.saved : e.updated !== t.updated ? t.updated - e.updated : 0;
|
|
47549
47549
|
},
|
|
47550
47550
|
formatFilters(e) {
|
|
47551
47551
|
return e.facet2 && (e.facet = e.facet2, delete e.facet2), e;
|
|
@@ -47566,7 +47566,7 @@ const Xfe = {
|
|
|
47566
47566
|
id: NC(),
|
|
47567
47567
|
updated: (/* @__PURE__ */ new Date()).getTime()
|
|
47568
47568
|
};
|
|
47569
|
-
this.searchHistory.push(a), this.trimSearchHistory(), localStorage.setItem(
|
|
47569
|
+
this.searchHistory.push(a), this.searchHistory = this.searchHistory.sort(this.sortSearchHistory), this.trimSearchHistory(), localStorage.setItem(
|
|
47570
47570
|
"sparc.science-sidebar-search-history",
|
|
47571
47571
|
JSON.stringify(this.searchHistory)
|
|
47572
47572
|
);
|
|
@@ -47628,7 +47628,7 @@ const Xfe = {
|
|
|
47628
47628
|
this.searchHistory.splice(t, 1), this.savedSearchHistory = this.searchHistory.filter((n) => n.saved), this.updateSearchHistory();
|
|
47629
47629
|
}
|
|
47630
47630
|
}
|
|
47631
|
-
}, Nh = (e) => (Aa("data-v-
|
|
47631
|
+
}, Nh = (e) => (Aa("data-v-694b96a6"), e = e(), Ia(), e), Yfe = {
|
|
47632
47632
|
key: 0,
|
|
47633
47633
|
class: "history-container"
|
|
47634
47634
|
}, Zfe = {
|
|
@@ -47807,7 +47807,7 @@ function hhe(e, t, n, r, o, a) {
|
|
|
47807
47807
|
})
|
|
47808
47808
|
])) : te("", !0);
|
|
47809
47809
|
}
|
|
47810
|
-
const L8 = /* @__PURE__ */ Ro(Xfe, [["render", hhe], ["__scopeId", "data-v-
|
|
47810
|
+
const L8 = /* @__PURE__ */ Ro(Xfe, [["render", hhe], ["__scopeId", "data-v-694b96a6"]]), R8 = (e, t) => {
|
|
47811
47811
|
const n = e.__vccOpts || e;
|
|
47812
47812
|
for (const [r, o] of t)
|
|
47813
47813
|
n[r] = o;
|
|
@@ -50445,14 +50445,13 @@ function Ghe(e, t, n, r, o, a) {
|
|
|
50445
50445
|
type: "primary",
|
|
50446
50446
|
class: "button",
|
|
50447
50447
|
onClick: a.searchEvent,
|
|
50448
|
-
size: "large"
|
|
50449
|
-
disabled: !e.searchInput.trim()
|
|
50448
|
+
size: "large"
|
|
50450
50449
|
}, {
|
|
50451
50450
|
default: q(() => [
|
|
50452
50451
|
We(" Search ")
|
|
50453
50452
|
]),
|
|
50454
50453
|
_: 1
|
|
50455
|
-
}, 8, ["onClick"
|
|
50454
|
+
}, 8, ["onClick"])
|
|
50456
50455
|
])
|
|
50457
50456
|
]),
|
|
50458
50457
|
default: q(() => [
|
|
@@ -50502,7 +50501,7 @@ function Ghe(e, t, n, r, o, a) {
|
|
|
50502
50501
|
_: 1
|
|
50503
50502
|
}, 8, ["body-style"]);
|
|
50504
50503
|
}
|
|
50505
|
-
const xT = /* @__PURE__ */ Ro(Uhe, [["render", Ghe], ["__scopeId", "data-v-
|
|
50504
|
+
const xT = /* @__PURE__ */ Ro(Uhe, [["render", Ghe], ["__scopeId", "data-v-d3c8c59e"]]), Xhe = {
|
|
50506
50505
|
name: "AnnotationTool",
|
|
50507
50506
|
components: {
|
|
50508
50507
|
AnnotationPopup: pae,
|
|
@@ -507,7 +507,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
|
507
507
|
`,t+=`<a href="${this.dataLocation}">${this.dataLocation}</a>`,e.push(`<div>${t}</div>`)}if(this.version){let t="<div><strong>Dataset version:</strong></div>";t+=`
|
|
508
508
|
`,t+=`${this.version}`,e.push(`<div>${t}</div>`)}this.copyContent=e.join(`
|
|
509
509
|
|
|
510
|
-
<br>`)}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},Rue=e=>(r.pushScopeId("data-v-541a51e6"),e=e(),r.popScopeId(),e),Lue={class:"dataset-card-container",ref:"container"},Mue={class:"dataset-card",ref:"card"},zue=Rue(()=>r.createElementVNode("div",{class:"seperator-path"},null,-1)),jue={class:"card"},Hue={class:"card-left"},Uue={class:"card-right"},que={class:"details"},Kue={class:"details"},Wue={key:0,class:"details loading-icon"},Gue={class:"badges-container"},Xue={class:"float-button-container"};function Yue(e,t,n,o,a,i){const s=LC,l=Sn,c=B2,d=r.resolveComponent("CopyToClipboard"),u=lu;return r.openBlock(),r.createElementBlock("div",Lue,[r.createElementVNode("div",Mue,[zue,r.withDirectives((r.openBlock(),r.createElementBlock("div",jue,[r.createElementVNode("span",Hue,[!e.loading&&e.discoverId?(r.openBlock(),r.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:n.entry,envVars:n.envVars,label:i.label,datasetThumbnail:e.thumbnail,"dataset-biolucida":e.biolucidaData,category:e.currentCategory,onCardClicked:i.galleryClicked,onDatalinkClicked:i.galleryDatalinkClicked},null,8,["datasetId","datasetVersion","entry","envVars","label","datasetThumbnail","dataset-biolucida","category","onCardClicked","onDatalinkClicked"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Uue,[r.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...f)=>i.cardClicked&&i.cardClicked(...f))},r.toDisplayString(n.entry.name),1),r.createElementVNode("div",que,r.toDisplayString(i.contributors)+" "+r.toDisplayString(n.entry.publishDate?`(${i.publishYear})`:""),1),r.createElementVNode("div",Kue,r.toDisplayString(i.samples),1),n.entry.detailsReady?r.createCommentVNode("",!0):r.withDirectives((r.openBlock(),r.createElementBlock("div",Wue,null,512)),[[u,!n.entry.detailsReady]]),r.createElementVNode("div",null,[n.entry.simulation?(r.openBlock(),r.createBlock(l,{key:0,onClick:i.openRepository,size:"small",class:"button",icon:a.ElIconView},{default:r.withCtx(()=>[r.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Gue,[r.createVNode(c,{entry:n.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:i.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])]),r.createElementVNode("div",Xue,[r.createVNode(d,{content:e.copyContent},null,8,["content"])])])])),[[u,e.loading]])],512)],512)}const y4=jr(Vue,[["render",Yue],["__scopeId","data-v-541a51e6"]]),v4=12;function b4(){const e=new Uint8Array(16);window.crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}const Zue={name:"SearchHistory",components:{Tag:ls,Select:ou},data(){return{searchHistory:[],savedSearchHistory:[]}},mounted:function(){this.getSearchHistory(),Wt.on("search-changed",e=>{this.setSearchHistory(e)}),this.updateSearchHistory(),this.savedSearchHistory=this.searchHistory.filter(e=>e.saved)},methods:{getSearchHistory(){localStorage.getItem("sparc.science-sidebar-search-history")?this.searchHistory=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history")):this.searchHistory=[]},clearSearchHistory(){localStorage.removeItem("sparc.science-sidebar-search-history"),this.searchHistory=[]},sortFilters(e,t){return e.facetPropPath.localeCompare(t.facetPropPath)},sortSearchHistory(e,t){return e.saved!==t.saved?t.saved-e.saved:e.updated!==t.updated?e.updated-t.updated:0},formatFilters(e){return e.facet2&&(e.facet=e.facet2,delete e.facet2),e},addSearchToHistory(e=[],t=""){if(t=t.trim(),!this.searchHistory.some(o=>{let a=o.filters,i=e;a.forEach(c=>this.formatFilters(c)),i.forEach(c=>this.formatFilters(c)),a=a.sort(this.sortFilters),i=i.sort(this.sortFilters);const s=JSON.stringify(a),l=JSON.stringify(i);return o.search===t&&s===l})){const{label:o,longLabel:a}=this.searchHistoryItemLabel(t,e),i={filters:e,search:t,saved:!1,label:o,longLabel:a,id:b4(),updated:new Date().getTime()};this.searchHistory.push(i),this.trimSearchHistory(),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(this.searchHistory))}},removeDuplicateSearchHistory:function(){const e=[],t=[];this.searchHistory.forEach(n=>{const o=`${n.search}-${JSON.stringify(n.filters)}`,a=e.find(i=>i.key===o);a?n.saved?t.push(a.id):t.push(n.id):e.push({id:n.id,key:o})}),t.length&&(this.searchHistory=this.searchHistory.filter(n=>!t.includes(n.id)))},trimSearchHistory:function(){if(this.searchHistory.length>v4){const e=this.searchHistory.filter(o=>o.saved),t=this.searchHistory.filter(o=>!o.saved),n=this.searchHistory.length-v4;this.searchHistory=[...e,...t.slice(n)]}},updateSearchHistory:function(){this.searchHistory.forEach(e=>{if(e.id||(e.id=b4()),!e.label){const{label:t,longLabel:n}=this.searchHistoryItemLabel(e.search,e.filters);e.label=t,e.longLabel=n}e.filters.forEach(t=>this.formatFilters(t)),e.filters=e.filters.sort(this.sortFilters),e.saved||(e.saved=!1),e.updated||(e.updated=new Date().getTime())}),this.searchHistory=this.searchHistory.sort(this.sortSearchHistory),this.removeDuplicateSearchHistory(),this.trimSearchHistory(),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(this.searchHistory))},search:function(e){this.$emit("search",e)},searchHistoryItemLabel:function(e,t){let n=e?`"${e.trim()}"`:"",o="",a=[],i=[];return t&&(a=t.filter(s=>s.facet!=="Show all"),i=a.map(s=>s.facet2||s.facet)),n&&a.length&&(o+=n,o+=`, ${i.join(", ")}`,n+=` (+${a.length})`),!n&&a.length&&(n=a[0].facet,a.length>1&&(o+=`${i.join(", ")}`,n+=` (+${a.length-1})`)),n?n.length>15&&!o&&(o=n):n="Unknown search",{label:n,longLabel:o}},toggleSavedSearch:function(e){this.searchHistory.forEach(t=>{t.id===e.id&&(t.saved=!t.saved)}),this.savedSearchHistory=this.searchHistory.filter(t=>t.saved),this.updateSearchHistory()},removeFromSavedSearch:function(e){const t=this.searchHistory.findIndex(n=>n.id===e.id);this.searchHistory.splice(t,1),this.savedSearchHistory=this.searchHistory.filter(n=>n.saved),this.updateSearchHistory()}}},Fp=e=>(r.pushScopeId("data-v-6e490b5f"),e=e(),r.popScopeId(),e),Jue={key:0,class:"history-container"},Que={key:0,class:"saved-search-history"},efe={key:1},tfe=[Fp(()=>r.createElementVNode("span",{class:"empty-saved-search"},"No Saved Searches",-1))],nfe={class:"el-dropdown-select"},rfe=["onClick"],ofe=["onClick"],afe={key:0,viewBox:"0 0 24 24"},ife=[Fp(()=>r.createElementVNode("path",{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"},null,-1))],sfe={key:1,viewBox:"0 0 24 24"},lfe=[Fp(()=>r.createElementVNode("path",{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"},null,-1))],cfe={key:0},dfe={key:1},ufe={key:2},ffe=Fp(()=>r.createElementVNode("span",null," Remove from search history. ",-1));function pfe(e,t,n,o,a,i){const s=au,l=ls,c=Sl,d=mt,u=Sn,f=vh,h=C9,m=k9,p=x9;return a.searchHistory.length?(r.openBlock(),r.createElementBlock("div",Jue,[a.savedSearchHistory.length?(r.openBlock(),r.createElementBlock("div",Que,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.savedSearchHistory,(g,v)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:g.id},[v<2?(r.openBlock(),r.createBlock(l,{class:"search-tag",key:v,onClick:y=>i.search(g),size:"large"},{default:r.withCtx(()=>[g.longLabel?(r.openBlock(),r.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(g.label),1)]),default:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(g.longLabel),1)]),_:2},1024)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(g.label),1)],64))]),_:2},1032,["onClick"])):r.createCommentVNode("",!0)],64))),128))])):(r.openBlock(),r.createElementBlock("div",efe,tfe)),r.createVNode(p,{trigger:"click","hide-on-click":!1},{dropdown:r.withCtx(()=>[r.createVNode(m,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.searchHistory,g=>(r.openBlock(),r.createBlock(h,{key:g.id},{default:r.withCtx(()=>[r.createElementVNode("div",null,[g.longLabel?(r.openBlock(),r.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createElementVNode("span",{class:"dropdown-clickable-item",onClick:v=>i.search(g)},r.toDisplayString(g.label),9,rfe)]),default:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(g.longLabel),1)]),_:2},1024)):(r.openBlock(),r.createElementBlock("span",{key:1,class:"dropdown-clickable-item",onClick:v=>i.search(g)},r.toDisplayString(g.label),9,ofe))]),r.createElementVNode("div",null,[r.createVNode(s,{width:"auto",trigger:"hover",teleported:!0,"show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createVNode(u,{circle:"",text:"",size:"small",onClick:v=>i.toggleSavedSearch(g),disabled:a.savedSearchHistory.length>1&&!g.saved},{default:r.withCtx(()=>[r.createVNode(d,{color:"#8300BF"},{default:r.withCtx(()=>[g.saved?(r.openBlock(),r.createElementBlock("svg",afe,ife)):(r.openBlock(),r.createElementBlock("svg",sfe,lfe))]),_:2},1024)]),_:2},1032,["onClick","disabled"])]),default:r.withCtx(()=>[a.savedSearchHistory.length>1&&!g.saved?(r.openBlock(),r.createElementBlock("span",cfe," Please unsave one before adding another. ")):g.saved?(r.openBlock(),r.createElementBlock("span",dfe," Remove from saved searches. ")):(r.openBlock(),r.createElementBlock("span",ufe," Add up to two saved searches. "))]),_:2},1024),r.createVNode(s,{width:"auto",trigger:"hover",teleported:!0,"show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createVNode(u,{circle:"",text:"",size:"small",onClick:v=>i.removeFromSavedSearch(g)},{default:r.withCtx(()=>[r.createVNode(d,{color:"#8300BF"},{default:r.withCtx(()=>[r.createVNode(f)]),_:1})]),_:2},1032,["onClick"])]),default:r.withCtx(()=>[ffe]),_:2},1024)])]),_:2},1024))),128))]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("span",nfe,[r.createTextVNode(" Search history "),r.createVNode(d,{class:"el-icon--right"},{default:r.withCtx(()=>[r.createVNode(c)]),_:1})])]),_:1})])):r.createCommentVNode("",!0)}const w4=jr(Zue,[["render",pfe],["__scopeId","data-v-6e490b5f"]]),x4=(e,t)=>{const n=e.__vccOpts||e;for(const[o,a]of t)n[o]=a;return n},hfe=["xlink:href"],mfe={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{class:r.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[r.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,hfe)],2))}},gfe=x4(mfe,[["__scopeId","data-v-e172d5ff"]]),C4=`<?xml version="1.0" encoding="UTF-8"?>
|
|
510
|
+
<br>`)}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},Rue=e=>(r.pushScopeId("data-v-541a51e6"),e=e(),r.popScopeId(),e),Lue={class:"dataset-card-container",ref:"container"},Mue={class:"dataset-card",ref:"card"},zue=Rue(()=>r.createElementVNode("div",{class:"seperator-path"},null,-1)),jue={class:"card"},Hue={class:"card-left"},Uue={class:"card-right"},que={class:"details"},Kue={class:"details"},Wue={key:0,class:"details loading-icon"},Gue={class:"badges-container"},Xue={class:"float-button-container"};function Yue(e,t,n,o,a,i){const s=LC,l=Sn,c=B2,d=r.resolveComponent("CopyToClipboard"),u=lu;return r.openBlock(),r.createElementBlock("div",Lue,[r.createElementVNode("div",Mue,[zue,r.withDirectives((r.openBlock(),r.createElementBlock("div",jue,[r.createElementVNode("span",Hue,[!e.loading&&e.discoverId?(r.openBlock(),r.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:n.entry,envVars:n.envVars,label:i.label,datasetThumbnail:e.thumbnail,"dataset-biolucida":e.biolucidaData,category:e.currentCategory,onCardClicked:i.galleryClicked,onDatalinkClicked:i.galleryDatalinkClicked},null,8,["datasetId","datasetVersion","entry","envVars","label","datasetThumbnail","dataset-biolucida","category","onCardClicked","onDatalinkClicked"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Uue,[r.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...f)=>i.cardClicked&&i.cardClicked(...f))},r.toDisplayString(n.entry.name),1),r.createElementVNode("div",que,r.toDisplayString(i.contributors)+" "+r.toDisplayString(n.entry.publishDate?`(${i.publishYear})`:""),1),r.createElementVNode("div",Kue,r.toDisplayString(i.samples),1),n.entry.detailsReady?r.createCommentVNode("",!0):r.withDirectives((r.openBlock(),r.createElementBlock("div",Wue,null,512)),[[u,!n.entry.detailsReady]]),r.createElementVNode("div",null,[n.entry.simulation?(r.openBlock(),r.createBlock(l,{key:0,onClick:i.openRepository,size:"small",class:"button",icon:a.ElIconView},{default:r.withCtx(()=>[r.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",Gue,[r.createVNode(c,{entry:n.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:i.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])]),r.createElementVNode("div",Xue,[r.createVNode(d,{content:e.copyContent},null,8,["content"])])])])),[[u,e.loading]])],512)],512)}const y4=jr(Vue,[["render",Yue],["__scopeId","data-v-541a51e6"]]),v4=12;function b4(){const e=new Uint8Array(16);window.crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}const Zue={name:"SearchHistory",components:{Tag:ls,Select:ou},data(){return{searchHistory:[],savedSearchHistory:[]}},mounted:function(){this.getSearchHistory(),Wt.on("search-changed",e=>{this.setSearchHistory(e)}),this.updateSearchHistory(),this.savedSearchHistory=this.searchHistory.filter(e=>e.saved)},methods:{getSearchHistory(){localStorage.getItem("sparc.science-sidebar-search-history")?this.searchHistory=JSON.parse(localStorage.getItem("sparc.science-sidebar-search-history")):this.searchHistory=[]},clearSearchHistory(){localStorage.removeItem("sparc.science-sidebar-search-history"),this.searchHistory=[]},sortFilters(e,t){return e.facetPropPath.localeCompare(t.facetPropPath)},sortSearchHistory(e,t){return e.saved!==t.saved?t.saved-e.saved:e.updated!==t.updated?t.updated-e.updated:0},formatFilters(e){return e.facet2&&(e.facet=e.facet2,delete e.facet2),e},addSearchToHistory(e=[],t=""){if(t=t.trim(),!this.searchHistory.some(o=>{let a=o.filters,i=e;a.forEach(c=>this.formatFilters(c)),i.forEach(c=>this.formatFilters(c)),a=a.sort(this.sortFilters),i=i.sort(this.sortFilters);const s=JSON.stringify(a),l=JSON.stringify(i);return o.search===t&&s===l})){const{label:o,longLabel:a}=this.searchHistoryItemLabel(t,e),i={filters:e,search:t,saved:!1,label:o,longLabel:a,id:b4(),updated:new Date().getTime()};this.searchHistory.push(i),this.searchHistory=this.searchHistory.sort(this.sortSearchHistory),this.trimSearchHistory(),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(this.searchHistory))}},removeDuplicateSearchHistory:function(){const e=[],t=[];this.searchHistory.forEach(n=>{const o=`${n.search}-${JSON.stringify(n.filters)}`,a=e.find(i=>i.key===o);a?n.saved?t.push(a.id):t.push(n.id):e.push({id:n.id,key:o})}),t.length&&(this.searchHistory=this.searchHistory.filter(n=>!t.includes(n.id)))},trimSearchHistory:function(){if(this.searchHistory.length>v4){const e=this.searchHistory.filter(o=>o.saved),t=this.searchHistory.filter(o=>!o.saved),n=this.searchHistory.length-v4;this.searchHistory=[...e,...t.slice(n)]}},updateSearchHistory:function(){this.searchHistory.forEach(e=>{if(e.id||(e.id=b4()),!e.label){const{label:t,longLabel:n}=this.searchHistoryItemLabel(e.search,e.filters);e.label=t,e.longLabel=n}e.filters.forEach(t=>this.formatFilters(t)),e.filters=e.filters.sort(this.sortFilters),e.saved||(e.saved=!1),e.updated||(e.updated=new Date().getTime())}),this.searchHistory=this.searchHistory.sort(this.sortSearchHistory),this.removeDuplicateSearchHistory(),this.trimSearchHistory(),localStorage.setItem("sparc.science-sidebar-search-history",JSON.stringify(this.searchHistory))},search:function(e){this.$emit("search",e)},searchHistoryItemLabel:function(e,t){let n=e?`"${e.trim()}"`:"",o="",a=[],i=[];return t&&(a=t.filter(s=>s.facet!=="Show all"),i=a.map(s=>s.facet2||s.facet)),n&&a.length&&(o+=n,o+=`, ${i.join(", ")}`,n+=` (+${a.length})`),!n&&a.length&&(n=a[0].facet,a.length>1&&(o+=`${i.join(", ")}`,n+=` (+${a.length-1})`)),n?n.length>15&&!o&&(o=n):n="Unknown search",{label:n,longLabel:o}},toggleSavedSearch:function(e){this.searchHistory.forEach(t=>{t.id===e.id&&(t.saved=!t.saved)}),this.savedSearchHistory=this.searchHistory.filter(t=>t.saved),this.updateSearchHistory()},removeFromSavedSearch:function(e){const t=this.searchHistory.findIndex(n=>n.id===e.id);this.searchHistory.splice(t,1),this.savedSearchHistory=this.searchHistory.filter(n=>n.saved),this.updateSearchHistory()}}},Fp=e=>(r.pushScopeId("data-v-694b96a6"),e=e(),r.popScopeId(),e),Jue={key:0,class:"history-container"},Que={key:0,class:"saved-search-history"},efe={key:1},tfe=[Fp(()=>r.createElementVNode("span",{class:"empty-saved-search"},"No Saved Searches",-1))],nfe={class:"el-dropdown-select"},rfe=["onClick"],ofe=["onClick"],afe={key:0,viewBox:"0 0 24 24"},ife=[Fp(()=>r.createElementVNode("path",{d:"m12 21.35-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z"},null,-1))],sfe={key:1,viewBox:"0 0 24 24"},lfe=[Fp(()=>r.createElementVNode("path",{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3m-4.4 15.55-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05"},null,-1))],cfe={key:0},dfe={key:1},ufe={key:2},ffe=Fp(()=>r.createElementVNode("span",null," Remove from search history. ",-1));function pfe(e,t,n,o,a,i){const s=au,l=ls,c=Sl,d=mt,u=Sn,f=vh,h=C9,m=k9,p=x9;return a.searchHistory.length?(r.openBlock(),r.createElementBlock("div",Jue,[a.savedSearchHistory.length?(r.openBlock(),r.createElementBlock("div",Que,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.savedSearchHistory,(g,v)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:g.id},[v<2?(r.openBlock(),r.createBlock(l,{class:"search-tag",key:v,onClick:y=>i.search(g),size:"large"},{default:r.withCtx(()=>[g.longLabel?(r.openBlock(),r.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(g.label),1)]),default:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(g.longLabel),1)]),_:2},1024)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(g.label),1)],64))]),_:2},1032,["onClick"])):r.createCommentVNode("",!0)],64))),128))])):(r.openBlock(),r.createElementBlock("div",efe,tfe)),r.createVNode(p,{trigger:"click","hide-on-click":!1},{dropdown:r.withCtx(()=>[r.createVNode(m,null,{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.searchHistory,g=>(r.openBlock(),r.createBlock(h,{key:g.id},{default:r.withCtx(()=>[r.createElementVNode("div",null,[g.longLabel?(r.openBlock(),r.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createElementVNode("span",{class:"dropdown-clickable-item",onClick:v=>i.search(g)},r.toDisplayString(g.label),9,rfe)]),default:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(g.longLabel),1)]),_:2},1024)):(r.openBlock(),r.createElementBlock("span",{key:1,class:"dropdown-clickable-item",onClick:v=>i.search(g)},r.toDisplayString(g.label),9,ofe))]),r.createElementVNode("div",null,[r.createVNode(s,{width:"auto",trigger:"hover",teleported:!0,"show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createVNode(u,{circle:"",text:"",size:"small",onClick:v=>i.toggleSavedSearch(g),disabled:a.savedSearchHistory.length>1&&!g.saved},{default:r.withCtx(()=>[r.createVNode(d,{color:"#8300BF"},{default:r.withCtx(()=>[g.saved?(r.openBlock(),r.createElementBlock("svg",afe,ife)):(r.openBlock(),r.createElementBlock("svg",sfe,lfe))]),_:2},1024)]),_:2},1032,["onClick","disabled"])]),default:r.withCtx(()=>[a.savedSearchHistory.length>1&&!g.saved?(r.openBlock(),r.createElementBlock("span",cfe," Please unsave one before adding another. ")):g.saved?(r.openBlock(),r.createElementBlock("span",dfe," Remove from saved searches. ")):(r.openBlock(),r.createElementBlock("span",ufe," Add up to two saved searches. "))]),_:2},1024),r.createVNode(s,{width:"auto",trigger:"hover",teleported:!0,"show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:r.withCtx(()=>[r.createVNode(u,{circle:"",text:"",size:"small",onClick:v=>i.removeFromSavedSearch(g)},{default:r.withCtx(()=>[r.createVNode(d,{color:"#8300BF"},{default:r.withCtx(()=>[r.createVNode(f)]),_:1})]),_:2},1032,["onClick"])]),default:r.withCtx(()=>[ffe]),_:2},1024)])]),_:2},1024))),128))]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("span",nfe,[r.createTextVNode(" Search history "),r.createVNode(d,{class:"el-icon--right"},{default:r.withCtx(()=>[r.createVNode(c)]),_:1})])]),_:1})])):r.createCommentVNode("",!0)}const w4=jr(Zue,[["render",pfe],["__scopeId","data-v-694b96a6"]]),x4=(e,t)=>{const n=e.__vccOpts||e;for(const[o,a]of t)n[o]=a;return n},hfe=["xlink:href"],mfe={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{class:r.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[r.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,hfe)],2))}},gfe=x4(mfe,[["__scopeId","data-v-e172d5ff"]]),C4=`<?xml version="1.0" encoding="UTF-8"?>
|
|
511
511
|
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
512
512
|
<title>2horpanel</title>
|
|
513
513
|
<g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
@@ -918,7 +918,7 @@ Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|
|
918
918
|
</g>
|
|
919
919
|
</svg>`,tB=(e,t,n,o)=>{const a=["title","desc","defs","style"],i=["width","height"],s=o||[];let l=document.createElement("div");l.innerHTML=e,a.map(d=>{const u=l.querySelector(d);u&&u.remove()}),i.map(d=>{l.querySelector("svg").removeAttribute(d)}),o&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},nB=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,n)=>"".replace.apply(t,n),e).trim(),yfe=!0,vfe=!0,bfe=["fill"],Oy=Object.assign({"/assets/icons/2horpanel.svg":C4,"/assets/icons/2vertpanel.svg":k4,"/assets/icons/3panel.svg":E4,"/assets/icons/4panel.svg":S4,"/assets/icons/5panel.svg":_4,"/assets/icons/6panel.svg":B4,"/assets/icons/6panelVertical.svg":T4,"/assets/icons/changeBckgd.svg":N4,"/assets/icons/close-no-bk.svg":O4,"/assets/icons/close.svg":P4,"/assets/icons/closeFullScreen.svg":$4,"/assets/icons/comment.svg":F4,"/assets/icons/connection.svg":I4,"/assets/icons/dock.svg":A4,"/assets/icons/drawLine.svg":D4,"/assets/icons/drawPoint.svg":V4,"/assets/icons/drawPolygon.svg":R4,"/assets/icons/drawTrash.svg":L4,"/assets/icons/fitWindow.svg":M4,"/assets/icons/fullScreen.svg":z4,"/assets/icons/help.svg":j4,"/assets/icons/magnifyingGlass.svg":H4,"/assets/icons/noun-filter.svg":U4,"/assets/icons/openMap.svg":q4,"/assets/icons/pause.svg":K4,"/assets/icons/permalink.svg":W4,"/assets/icons/play.svg":G4,"/assets/icons/resetZoom.svg":X4,"/assets/icons/singlepanel.svg":Y4,"/assets/icons/tooltips.svg":Z4,"/assets/icons/undock.svg":J4,"/assets/icons/zoomIn.svg":Q4,"/assets/icons/zoomOut.svg":eB});Object.keys(Oy).map(e=>{const t=tB(Oy[e],yfe,vfe,bfe),n=e.replace(/^.+\/(\w+).svg$/,"$1");return nB(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}).join(`
|
|
920
920
|
`);const Py=Object.assign({"/assets/icons/2horpanel.svg":C4,"/assets/icons/2vertpanel.svg":k4,"/assets/icons/3panel.svg":E4,"/assets/icons/4panel.svg":S4,"/assets/icons/5panel.svg":_4,"/assets/icons/6panel.svg":B4,"/assets/icons/6panelVertical.svg":T4,"/assets/icons/changeBckgd.svg":N4,"/assets/icons/close-no-bk.svg":O4,"/assets/icons/close.svg":P4,"/assets/icons/closeFullScreen.svg":$4,"/assets/icons/comment.svg":F4,"/assets/icons/connection.svg":I4,"/assets/icons/dock.svg":A4,"/assets/icons/drawLine.svg":D4,"/assets/icons/drawPoint.svg":V4,"/assets/icons/drawPolygon.svg":R4,"/assets/icons/drawTrash.svg":L4,"/assets/icons/fitWindow.svg":M4,"/assets/icons/fullScreen.svg":z4,"/assets/icons/help.svg":j4,"/assets/icons/magnifyingGlass.svg":H4,"/assets/icons/noun-filter.svg":U4,"/assets/icons/openMap.svg":q4,"/assets/icons/pause.svg":K4,"/assets/icons/permalink.svg":W4,"/assets/icons/play.svg":G4,"/assets/icons/resetZoom.svg":X4,"/assets/icons/singlepanel.svg":Y4,"/assets/icons/tooltips.svg":Z4,"/assets/icons/undock.svg":J4,"/assets/icons/zoomIn.svg":Q4,"/assets/icons/zoomOut.svg":eB}),wfe=Object.keys(Py).map(e=>{const t=tB(Py[e]),n=e.replace(/^.+\/(\w+).svg$/,"$1");return nB(t).replace("<svg",`<symbol id="${n}"`).replace("svg>","symbol>")}),xfe={name:"MapSvgSpriteColor",svgContext:Py,svgSprite:wfe.join(`
|
|
921
|
-
`)},Cfe=["innerHTML"];function kfe(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,Cfe)}const Efe=x4(xfe,[["render",kfe]]);var rB={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(n,o){e.exports=o()})(XI,function(){function n(I,R,z){return R in I?Object.defineProperty(I,R,{value:z,enumerable:!0,configurable:!0,writable:!0}):I[R]=z,I}function o(I,R){var z=Object.keys(I);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(I);R&&(H=H.filter(function(J){return Object.getOwnPropertyDescriptor(I,J).enumerable})),z.push.apply(z,H)}return z}function a(I){for(var R=1;R<arguments.length;R++){var z=arguments[R]!=null?arguments[R]:{};R%2?o(Object(z),!0).forEach(function(H){n(I,H,z[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(z)):o(Object(z)).forEach(function(H){Object.defineProperty(I,H,Object.getOwnPropertyDescriptor(z,H))})}return I}function i(I,R){if(I==null)return{};var z,H,J=function(Te,me){if(Te==null)return{};var Ce,Fe,Oe={},Xe=Object.keys(Te);for(Fe=0;Fe<Xe.length;Fe++)Ce=Xe[Fe],me.indexOf(Ce)>=0||(Oe[Ce]=Te[Ce]);return Oe}(I,R);if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(I);for(H=0;H<ve.length;H++)z=ve[H],R.indexOf(z)>=0||Object.prototype.propertyIsEnumerable.call(I,z)&&(J[z]=I[z])}return J}function s(I,R){return function(z){if(Array.isArray(z))return z}(I)||function(z,H){if(Symbol.iterator in Object(z)||Object.prototype.toString.call(z)==="[object Arguments]"){var J=[],ve=!0,Te=!1,me=void 0;try{for(var Ce,Fe=z[Symbol.iterator]();!(ve=(Ce=Fe.next()).done)&&(J.push(Ce.value),!H||J.length!==H);ve=!0);}catch(Oe){Te=!0,me=Oe}finally{try{ve||Fe.return==null||Fe.return()}finally{if(Te)throw me}}return J}}(I,R)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(I){return function(R){if(Array.isArray(R)){for(var z=0,H=new Array(R.length);z<R.length;z++)H[z]=R[z];return H}}(I)||function(R){if(Symbol.iterator in Object(R)||Object.prototype.toString.call(R)==="[object Arguments]")return Array.from(R)}(I)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(I){var R,z="algoliasearch-client-js-".concat(I.key),H=function(){return R===void 0&&(R=I.localStorage||window.localStorage),R},J=function(){return JSON.parse(H().getItem(z)||"{}")},ve=function(me){H().setItem(z,JSON.stringify(me))},Te=function(){var me=I.timeToLive?1e3*I.timeToLive:null,Ce=J(),Fe=Object.fromEntries(Object.entries(Ce).filter(function(Xe){return s(Xe,2)[1].timestamp!==void 0}));if(ve(Fe),me){var Oe=Object.fromEntries(Object.entries(Fe).filter(function(Xe){var We=s(Xe,2)[1],rt=new Date().getTime();return!(We.timestamp+me<rt)}));ve(Oe)}};return{get:function(me,Ce){var Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){Te();var Oe=JSON.stringify(me);return J()[Oe]}).then(function(Oe){return Promise.all([Oe?Oe.value:Ce(),Oe!==void 0])}).then(function(Oe){var Xe=s(Oe,2),We=Xe[0],rt=Xe[1];return Promise.all([We,rt||Fe.miss(We)])}).then(function(Oe){return s(Oe,1)[0]})},set:function(me,Ce){return Promise.resolve().then(function(){var Fe=J();return Fe[JSON.stringify(me)]={timestamp:new Date().getTime(),value:Ce},H().setItem(z,JSON.stringify(Fe)),Ce})},delete:function(me){return Promise.resolve().then(function(){var Ce=J();delete Ce[JSON.stringify(me)],H().setItem(z,JSON.stringify(Ce))})},clear:function(){return Promise.resolve().then(function(){H().removeItem(z)})}}}function d(I){var R=l(I.caches),z=R.shift();return z===void 0?{get:function(H,J){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Te=J();return Te.then(function(me){return Promise.all([me,ve.miss(me)])}).then(function(me){return s(me,1)[0]})},set:function(H,J){return Promise.resolve(J)},delete:function(H){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(H,J){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return z.get(H,J,ve).catch(function(){return d({caches:R}).get(H,J,ve)})},set:function(H,J){return z.set(H,J).catch(function(){return d({caches:R}).set(H,J)})},delete:function(H){return z.delete(H).catch(function(){return d({caches:R}).delete(H)})},clear:function(){return z.clear().catch(function(){return d({caches:R}).clear()})}}}function u(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},R={};return{get:function(z,H){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ve=JSON.stringify(z);if(ve in R)return Promise.resolve(I.serializable?JSON.parse(R[ve]):R[ve]);var Te=H(),me=J&&J.miss||function(){return Promise.resolve()};return Te.then(function(Ce){return me(Ce)}).then(function(){return Te})},set:function(z,H){return R[JSON.stringify(z)]=I.serializable?JSON.stringify(H):H,Promise.resolve(H)},delete:function(z){return delete R[JSON.stringify(z)],Promise.resolve()},clear:function(){return R={},Promise.resolve()}}}function f(I,R,z){var H={"x-algolia-api-key":z,"x-algolia-application-id":R};return{headers:function(){return I===y.WithinHeaders?H:{}},queryParameters:function(){return I===y.WithinQueryParameters?H:{}}}}function h(I){var R=0;return I(function z(){return R++,new Promise(function(H){setTimeout(function(){H(I(z))},Math.min(100*R,1e3))})})}function m(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(z,H){return Promise.resolve()};return Object.assign(I,{wait:function(z){return m(I.then(function(H){return Promise.all([R(H,z),H])}).then(function(H){return H[1]}))}})}function p(I){for(var R=I.length-1;R>0;R--){var z=Math.floor(Math.random()*(R+1)),H=I[R];I[R]=I[z],I[z]=H}return I}function g(I,R){return R&&Object.keys(R).forEach(function(z){I[z]=R[z](I)}),I}function v(I){for(var R=arguments.length,z=new Array(R>1?R-1:0),H=1;H<R;H++)z[H-1]=arguments[H];var J=0;return I.replace(/%s/g,function(){return encodeURIComponent(z[J++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function b(I,R){var z=I||{},H=z.data||{};return Object.keys(z).forEach(function(J){["timeout","headers","queryParameters","data","cacheable"].indexOf(J)===-1&&(H[J]=z[J])}),{data:Object.entries(H).length>0?H:void 0,timeout:z.timeout||R,headers:z.headers||{},queryParameters:z.queryParameters||{},cacheable:z.cacheable}}var x={Read:1,Write:2,Any:3},w=1,k=2,C=3;function E(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w;return a(a({},I),{},{status:R,lastUpdate:Date.now()})}function S(I){return typeof I=="string"?{protocol:"https",url:I,accept:x.Any}:{protocol:I.protocol||"https",url:I.url,accept:I.accept||x.Any}}var _="DELETE",O="GET",T="POST",N="PUT";function F(I,R){return Promise.all(R.map(function(z){return I.get(z,function(){return Promise.resolve(E(z))})})).then(function(z){var H=z.filter(function(Te){return function(me){return me.status===w||Date.now()-me.lastUpdate>12e4}(Te)}),J=z.filter(function(Te){return function(me){return me.status===C&&Date.now()-me.lastUpdate<=12e4}(Te)}),ve=[].concat(l(H),l(J));return{getTimeout:function(Te,me){return(J.length===0&&Te===0?1:J.length+3+Te)*me},statelessHosts:ve.length>0?ve.map(function(Te){return S(Te)}):R}})}function $(I,R,z,H){var J=[],ve=function(We,rt){if(!(We.method===O||We.data===void 0&&rt.data===void 0)){var et=Array.isArray(We.data)?We.data:a(a({},We.data),rt.data);return JSON.stringify(et)}}(z,H),Te=function(We,rt){var et=a(a({},We.headers),rt.headers),Et={};return Object.keys(et).forEach(function(It){var or=et[It];Et[It.toLowerCase()]=or}),Et}(I,H),me=z.method,Ce=z.method!==O?{}:a(a({},z.data),H.data),Fe=a(a(a({"x-algolia-agent":I.userAgent.value},I.queryParameters),Ce),H.queryParameters),Oe=0,Xe=function We(rt,et){var Et=rt.pop();if(Et===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:M(J)};var It={data:ve,headers:Te,method:me,url:A(Et,z.path,Fe),connectTimeout:et(Oe,I.timeouts.connect),responseTimeout:et(Oe,H.timeout)},or=function(ar){var Vn={request:It,response:ar,host:Et,triesLeft:rt.length};return J.push(Vn),Vn},gd={onSuccess:function(ar){return function(Vn){try{return JSON.parse(Vn.content)}catch(Gi){throw function(Ha,pl){return{name:"DeserializationError",message:Ha,response:pl}}(Gi.message,Vn)}}(ar)},onRetry:function(ar){var Vn=or(ar);return ar.isTimedOut&&Oe++,Promise.all([I.logger.info("Retryable failure",W(Vn)),I.hostsCache.set(Et,E(Et,ar.isTimedOut?C:k))]).then(function(){return We(rt,et)})},onFail:function(ar){throw or(ar),function(Vn,Gi){var Ha=Vn.content,pl=Vn.status,yd=Ha;try{yd=JSON.parse(Ha).message}catch{}return function(Mp,Ry,lhe){return{name:"ApiError",message:Mp,status:Ry,transporterStackTrace:lhe}}(yd,pl,Gi)}(ar,M(J))}};return I.requester.send(It).then(function(ar){return function(Vn,Gi){return function(Ha){var pl=Ha.status;return Ha.isTimedOut||function(yd){var Mp=yd.isTimedOut,Ry=yd.status;return!Mp&&~~Ry==0}(Ha)||~~(pl/100)!=2&&~~(pl/100)!=4}(Vn)?Gi.onRetry(Vn):~~(Vn.status/100)==2?Gi.onSuccess(Vn):Gi.onFail(Vn)}(ar,gd)})};return F(I.hostsCache,R).then(function(We){return Xe(l(We.statelessHosts).reverse(),We.getTimeout)})}function V(I){var R=I.hostsCache,z=I.logger,H=I.requester,J=I.requestsCache,ve=I.responsesCache,Te=I.timeouts,me=I.userAgent,Ce=I.hosts,Fe=I.queryParameters,Oe={hostsCache:R,logger:z,requester:H,requestsCache:J,responsesCache:ve,timeouts:Te,userAgent:me,headers:I.headers,queryParameters:Fe,hosts:Ce.map(function(Xe){return S(Xe)}),read:function(Xe,We){var rt=b(We,Oe.timeouts.read),et=function(){return $(Oe,Oe.hosts.filter(function(It){return(It.accept&x.Read)!=0}),Xe,rt)};if((rt.cacheable!==void 0?rt.cacheable:Xe.cacheable)!==!0)return et();var Et={request:Xe,mappedRequestOptions:rt,transporter:{queryParameters:Oe.queryParameters,headers:Oe.headers}};return Oe.responsesCache.get(Et,function(){return Oe.requestsCache.get(Et,function(){return Oe.requestsCache.set(Et,et()).then(function(It){return Promise.all([Oe.requestsCache.delete(Et),It])},function(It){return Promise.all([Oe.requestsCache.delete(Et),Promise.reject(It)])}).then(function(It){var or=s(It,2);return or[0],or[1]})})},{miss:function(It){return Oe.responsesCache.set(Et,It)}})},write:function(Xe,We){return $(Oe,Oe.hosts.filter(function(rt){return(rt.accept&x.Write)!=0}),Xe,b(We,Oe.timeouts.write))}};return Oe}function P(I){var R={value:"Algolia for JavaScript (".concat(I,")"),add:function(z){var H="; ".concat(z.segment).concat(z.version!==void 0?" (".concat(z.version,")"):"");return R.value.indexOf(H)===-1&&(R.value="".concat(R.value).concat(H)),R}};return R}function A(I,R,z){var H=D(z),J="".concat(I.protocol,"://").concat(I.url,"/").concat(R.charAt(0)==="/"?R.substr(1):R);return H.length&&(J+="?".concat(H)),J}function D(I){return Object.keys(I).map(function(R){return v("%s=%s",R,(z=I[R],Object.prototype.toString.call(z)==="[object Object]"||Object.prototype.toString.call(z)==="[object Array]"?JSON.stringify(I[R]):I[R]));var z}).join("&")}function M(I){return I.map(function(R){return W(R)})}function W(I){var R=I.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},I),{},{request:a(a({},I.request),{},{headers:a(a({},I.request.headers),R)})})}var q=function(I){return function(R,z){return I.transporter.write({method:T,path:"2/abtests",data:R},z)}},G=function(I){return function(R,z){return I.transporter.write({method:_,path:v("2/abtests/%s",R)},z)}},te=function(I){return function(R,z){return I.transporter.read({method:O,path:v("2/abtests/%s",R)},z)}},le=function(I){return function(R){return I.transporter.read({method:O,path:"2/abtests"},R)}},de=function(I){return function(R,z){return I.transporter.write({method:T,path:v("2/abtests/%s/stop",R)},z)}},ne=function(I){return function(R){return I.transporter.read({method:O,path:"1/strategies/personalization"},R)}},oe=function(I){return function(R,z){return I.transporter.write({method:T,path:"1/strategies/personalization",data:R},z)}};function U(I){return function R(z){return I.request(z).then(function(H){if(I.batch!==void 0&&I.batch(H.hits),!I.shouldStop(H))return H.cursor?R({cursor:H.cursor}):R({page:(z.page||0)+1})})}({})}var K=function(I){return function(R,z){var H=z||{},J=H.queryParameters,ve=i(H,["queryParameters"]),Te=a({acl:R},J!==void 0?{queryParameters:J}:{});return m(I.transporter.write({method:T,path:"1/keys",data:Te},ve),function(me,Ce){return h(function(Fe){return Se(I)(me.key,Ce).catch(function(Oe){if(Oe.status!==404)throw Oe;return Fe()})})})}},Z=function(I){return function(R,z,H){var J=b(H);return J.queryParameters["X-Algolia-User-ID"]=R,I.transporter.write({method:T,path:"1/clusters/mapping",data:{cluster:z}},J)}},ue=function(I){return function(R,z,H){return I.transporter.write({method:T,path:"1/clusters/mapping/batch",data:{users:R,cluster:z}},H)}},be=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},z),function(H,J){return Ot(I)(H.taskID,J)})}},Be=function(I){return function(R,z,H){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",R),data:{operation:"copy",destination:z}},H),function(J,ve){return Q(I)(R,{methods:{waitTask:en}}).waitTask(J.taskID,ve)})}},pe=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Rules]}))}},xe=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Settings]}))}},ge=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Synonyms]}))}},ke=function(I){return function(R,z){return R.method===O?I.transporter.read(R,z):I.transporter.write(R,z)}},Ne=function(I){return function(R,z){return m(I.transporter.write({method:_,path:v("1/keys/%s",R)},z),function(H,J){return h(function(ve){return Se(I)(R,J).then(ve).catch(function(Te){if(Te.status!==404)throw Te})})})}},Ae=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"deleteEntry",body:{objectID:ve}}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!1,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},Se=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/keys/%s",R)},z)}},Re=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/task/%s",R.toString())},z)}},Ve=function(I){return function(R){return I.transporter.read({method:O,path:"/1/dictionaries/*/settings"},R)}},je=function(I){return function(R){return I.transporter.read({method:O,path:"1/logs"},R)}},B=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters/mapping/top"},R)}},L=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/clusters/mapping/%s",R)},z)}},Y=function(I){return function(R){var z=R||{},H=z.retrieveMappings,J=i(z,["retrieveMappings"]);return H===!0&&(J.getClusters=!0),I.transporter.read({method:O,path:"1/clusters/mapping/pending"},J)}},Q=function(I){return function(R){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H={transporter:I.transporter,appId:I.appId,indexName:R};return g(H,z.methods)}},ee=function(I){return function(R){return I.transporter.read({method:O,path:"1/keys"},R)}},he=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters"},R)}},ae=function(I){return function(R){return I.transporter.read({method:O,path:"1/indexes"},R)}},ye=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters/mapping"},R)}},Ie=function(I){return function(R,z,H){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",R),data:{operation:"move",destination:z}},H),function(J,ve){return Q(I)(R,{methods:{waitTask:en}}).waitTask(J.taskID,ve)})}},De=function(I){return function(R,z){return m(I.transporter.write({method:T,path:"1/indexes/*/batch",data:{requests:R}},z),function(H,J){return Promise.all(Object.keys(H.taskID).map(function(ve){return Q(I)(ve,{methods:{waitTask:en}}).waitTask(H.taskID[ve],J)}))})}},X=function(I){return function(R,z){return I.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:R}},z)}},fe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{params:D(J.params||{})})});return I.transporter.read({method:T,path:"1/indexes/*/queries",data:{requests:H},cacheable:!0},z)}},ie=function(I){return function(R,z){return Promise.all(R.map(function(H){var J=H.params,ve=J.facetName,Te=J.facetQuery,me=i(J,["facetName","facetQuery"]);return Q(I)(H.indexName,{methods:{searchForFacetValues:pB}}).searchForFacetValues(ve,Te,a(a({},z),me))}))}},we=function(I){return function(R,z){var H=b(z);return H.queryParameters["X-Algolia-User-ID"]=R,I.transporter.write({method:_,path:"1/clusters/mapping"},H)}},nt=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"addEntry",body:ve}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!0,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},Qe=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/keys/%s/restore",R)},z),function(H,J){return h(function(ve){return Se(I)(R,J).catch(function(Te){if(Te.status!==404)throw Te;return ve()})})})}},ct=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"addEntry",body:ve}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!1,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},pt=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("/1/dictionaries/%s/search",R),data:{query:z},cacheable:!0},H)}},bt=function(I){return function(R,z){return I.transporter.read({method:T,path:"1/clusters/mapping/search",data:{query:R}},z)}},Yt=function(I){return function(R,z){return m(I.transporter.write({method:N,path:"/1/dictionaries/*/settings",data:R},z),function(H,J){return Ot(I)(H.taskID,J)})}},Nt=function(I){return function(R,z){var H=Object.assign({},z),J=z||{},ve=J.queryParameters,Te=i(J,["queryParameters"]),me=ve?{queryParameters:ve}:{},Ce=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(I.transporter.write({method:N,path:v("1/keys/%s",R),data:me},Te),function(Fe,Oe){return h(function(Xe){return Se(I)(R,Oe).then(function(We){return function(rt){return Object.keys(H).filter(function(et){return Ce.indexOf(et)!==-1}).every(function(et){if(Array.isArray(rt[et])&&Array.isArray(H[et])){var Et=rt[et];return Et.length===H[et].length&&Et.every(function(It,or){return It===H[et][or]})}return rt[et]===H[et]})}(We)?Promise.resolve():Xe()})})})}},Ot=function(I){return function(R,z){return h(function(H){return Re(I)(R,z).then(function(J){return J.status!=="published"?H():void 0})})}},Zt=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/indexes/%s/batch",I.indexName),data:{requests:R}},z),function(H,J){return en(I)(H.taskID,J)})}},Jt=function(I){return function(R){return U(a(a({shouldStop:function(z){return z.cursor===void 0}},R),{},{request:function(z){return I.transporter.read({method:T,path:v("1/indexes/%s/browse",I.indexName),data:z},R)}}))}},Mt=function(I){return function(R){var z=a({hitsPerPage:1e3},R);return U(a(a({shouldStop:function(H){return H.hits.length<z.hitsPerPage}},z),{},{request:function(H){return hB(I)("",a(a({},z),H)).then(function(J){return a(a({},J),{},{hits:J.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},In=function(I){return function(R){var z=a({hitsPerPage:1e3},R);return U(a(a({shouldStop:function(H){return H.hits.length<z.hitsPerPage}},z),{},{request:function(H){return mB(I)("",a(a({},z),H)).then(function(J){return a(a({},J),{},{hits:J.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},Cn=function(I){return function(R,z,H){var J=H||{},ve=J.batchSize,Te=i(J,["batchSize"]),me={taskIDs:[],objectIDs:[]};return m(function Ce(){var Fe,Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Xe=[];for(Fe=Oe;Fe<R.length&&(Xe.push(R[Fe]),Xe.length!==(ve||1e3));Fe++);return Xe.length===0?Promise.resolve(me):Zt(I)(Xe.map(function(We){return{action:z,body:We}}),Te).then(function(We){return me.objectIDs=me.objectIDs.concat(We.objectIDs),me.taskIDs.push(We.taskID),Fe++,Ce(Fe)})}(),function(Ce,Fe){return Promise.all(Ce.taskIDs.map(function(Oe){return en(I)(Oe,Fe)}))})}},kn=function(I){return function(R){return m(I.transporter.write({method:T,path:v("1/indexes/%s/clear",I.indexName)},R),function(z,H){return en(I)(z.taskID,H)})}},wt=function(I){return function(R){var z=R||{},H=z.forwardToReplicas,J=b(i(z,["forwardToReplicas"]));return H&&(J.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/rules/clear",I.indexName)},J),function(ve,Te){return en(I)(ve.taskID,Te)})}},Pt=function(I){return function(R){var z=R||{},H=z.forwardToReplicas,J=b(i(z,["forwardToReplicas"]));return H&&(J.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/synonyms/clear",I.indexName)},J),function(ve,Te){return en(I)(ve.taskID,Te)})}},Rt=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/indexes/%s/deleteByQuery",I.indexName),data:R},z),function(H,J){return en(I)(H.taskID,J)})}},An=function(I){return function(R){return m(I.transporter.write({method:_,path:v("1/indexes/%s",I.indexName)},R),function(z,H){return en(I)(z.taskID,H)})}},So=function(I){return function(R,z){return m(j(I)([R],z).then(function(H){return{taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},j=function(I){return function(R,z){var H=R.map(function(J){return{objectID:J}});return Cn(I)(H,fl.DeleteObject,z)}},re=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:_,path:v("1/indexes/%s/rules/%s",I.indexName,R)},ve),function(Te,me){return en(I)(Te.taskID,me)})}},_e=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:_,path:v("1/indexes/%s/synonyms/%s",I.indexName,R)},ve),function(Te,me){return en(I)(Te.taskID,me)})}},Le=function(I){return function(R){return Ki(I)(R).then(function(){return!0}).catch(function(z){if(z.status!==404)throw z;return!1})}},zt=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("1/answers/%s/prediction",I.indexName),data:{query:R,queryLanguages:z},cacheable:!0},H)}},En=function(I){return function(R,z){var H=z||{},J=H.query,ve=H.paginate,Te=i(H,["query","paginate"]),me=0;return function Ce(){return fB(I)(J||"",a(a({},Te),{},{page:me})).then(function(Fe){for(var Oe=0,Xe=Object.entries(Fe.hits);Oe<Xe.length;Oe++){var We=s(Xe[Oe],2),rt=We[0],et=We[1];if(R(et))return{object:et,position:parseInt(rt,10),page:me}}if(me++,ve===!1||me>=Fe.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Ce()})}()}},Dn=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/%s",I.indexName,R)},z)}},Qt=function(){return function(I,R){for(var z=0,H=Object.entries(I.hits);z<H.length;z++){var J=s(H[z],2),ve=J[0];if(J[1].objectID===R)return parseInt(ve,10)}return-1}},$t=function(I){return function(R,z){var H=z||{},J=H.attributesToRetrieve,ve=i(H,["attributesToRetrieve"]),Te=R.map(function(me){return a({indexName:I.indexName,objectID:me},J?{attributesToRetrieve:J}:{})});return I.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:Te}},ve)}},_o=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/rules/%s",I.indexName,R)},z)}},Ki=function(I){return function(R){return I.transporter.read({method:O,path:v("1/indexes/%s/settings",I.indexName),data:{getVersion:2}},R)}},Ap=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/synonyms/%s",I.indexName,R)},z)}},Dp=function(I){return function(R,z){return m(Vp(I)([R],z).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},Vp=function(I){return function(R,z){var H=z||{},J=H.createIfNotExists,ve=i(H,["createIfNotExists"]),Te=J?fl.PartialUpdateObject:fl.PartialUpdateObjectNoCreate;return Cn(I)(R,Te,ve)}},gr=function(I){return function(R,z){var H=z||{},J=H.safe,ve=H.autoGenerateObjectIDIfNotExist,Te=H.batchSize,me=i(H,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Ce=function(et,Et,It,or){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",et),data:{operation:It,destination:Et}},or),function(gd,ar){return en(I)(gd.taskID,ar)})},Fe=Math.random().toString(36).substring(7),Oe="".concat(I.indexName,"_tmp_").concat(Fe),Xe=jn({appId:I.appId,transporter:I.transporter,indexName:Oe}),We=[],rt=Ce(I.indexName,Oe,"copy",a(a({},me),{},{scope:["settings","synonyms","rules"]}));return We.push(rt),m((J?rt.wait(me):rt).then(function(){var et=Xe(R,a(a({},me),{},{autoGenerateObjectIDIfNotExist:ve,batchSize:Te}));return We.push(et),J?et.wait(me):et}).then(function(){var et=Ce(Oe,I.indexName,"move",me);return We.push(et),J?et.wait(me):et}).then(function(){return Promise.all(We)}).then(function(et){var Et=s(et,3),It=Et[0],or=Et[1],gd=Et[2];return{objectIDs:or.objectIDs,taskIDs:[It.taskID].concat(l(or.taskIDs),[gd.taskID])}}),function(et,Et){return Promise.all(We.map(function(It){return It.wait(Et)}))})}},md=function(I){return function(R,z){return Ay(I)(R,a(a({},z),{},{clearExistingRules:!0}))}},Rp=function(I){return function(R,z){return Dy(I)(R,a(a({},z),{},{clearExistingSynonyms:!0}))}},Wi=function(I){return function(R,z){return m(jn(I)([R],z).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},jn=function(I){return function(R,z){var H=z||{},J=H.autoGenerateObjectIDIfNotExist,ve=i(H,["autoGenerateObjectIDIfNotExist"]),Te=J?fl.AddObject:fl.UpdateObject;if(Te===fl.UpdateObject){var me=!0,Ce=!1,Fe=void 0;try{for(var Oe,Xe=R[Symbol.iterator]();!(me=(Oe=Xe.next()).done);me=!0)if(Oe.value.objectID===void 0)return m(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(We){Ce=!0,Fe=We}finally{try{me||Xe.return==null||Xe.return()}finally{if(Ce)throw Fe}}}return Cn(I)(R,Te,ve)}},Iy=function(I){return function(R,z){return Ay(I)([R],z)}},Ay=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=H.clearExistingRules,Te=b(i(H,["forwardToReplicas","clearExistingRules"]));return J&&(Te.queryParameters.forwardToReplicas=1),ve&&(Te.queryParameters.clearExistingRules=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/rules/batch",I.indexName),data:R},Te),function(me,Ce){return en(I)(me.taskID,Ce)})}},Zpe=function(I){return function(R,z){return Dy(I)([R],z)}},Dy=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=H.clearExistingSynonyms,Te=H.replaceExistingSynonyms,me=b(i(H,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return J&&(me.queryParameters.forwardToReplicas=1),(Te||ve)&&(me.queryParameters.replaceExistingSynonyms=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/synonyms/batch",I.indexName),data:R},me),function(Ce,Fe){return en(I)(Ce.taskID,Fe)})}},fB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/query",I.indexName),data:{query:R},cacheable:!0},z)}},pB=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("1/indexes/%s/facets/%s/query",I.indexName,R),data:{facetQuery:z},cacheable:!0},H)}},hB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/rules/search",I.indexName),data:{query:R}},z)}},mB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/synonyms/search",I.indexName),data:{query:R}},z)}},Jpe=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:N,path:v("1/indexes/%s/settings",I.indexName),data:R},ve),function(Te,me){return en(I)(Te.taskID,me)})}},en=function(I){return function(R,z){return h(function(H){return function(J){return function(ve,Te){return J.transporter.read({method:O,path:v("1/indexes/%s/task/%s",J.indexName,ve.toString())},Te)}}(I)(R,z).then(function(J){return J.status!=="published"?H():void 0})})}},fl={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},Vy={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},Qpe=1,ehe=2,the=3,Lp=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},nhe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{fallbackParameters:{},model:"bought-together"})}),z)}},rhe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{model:"related-products"})}),z)}},ohe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"trending-facets",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},ahe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"trending-items",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},ihe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{model:"looking-similar"})}),z)}},she=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"recommended-for-you",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}};function gB(I,R,z){var H,J={appId:I,apiKey:R,timeouts:{connect:1,read:2,write:30},requester:{send:function(me){return new Promise(function(Ce){var Fe=new XMLHttpRequest;Fe.open(me.method,me.url,!0),Object.keys(me.headers).forEach(function(rt){return Fe.setRequestHeader(rt,me.headers[rt])});var Oe,Xe=function(rt,et){return setTimeout(function(){Fe.abort(),Ce({status:0,content:et,isTimedOut:!0})},1e3*rt)},We=Xe(me.connectTimeout,"Connection timeout");Fe.onreadystatechange=function(){Fe.readyState>Fe.OPENED&&Oe===void 0&&(clearTimeout(We),Oe=Xe(me.responseTimeout,"Socket timeout"))},Fe.onerror=function(){Fe.status===0&&(clearTimeout(We),clearTimeout(Oe),Ce({content:Fe.responseText||"Network request failed",status:Fe.status,isTimedOut:!1}))},Fe.onload=function(){clearTimeout(We),clearTimeout(Oe),Ce({content:Fe.responseText,status:Fe.status,isTimedOut:!1})},Fe.send(me.data)})}},logger:(H=the,{debug:function(me,Ce){return Qpe>=H&&console.debug(me,Ce),Promise.resolve()},info:function(me,Ce){return ehe>=H&&console.info(me,Ce),Promise.resolve()},error:function(me,Ce){return console.error(me,Ce),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(I)}),u()]}),userAgent:P("4.23.2").add({segment:"Browser"})},ve=a(a({},J),z),Te=function(){return function(me){return function(Ce){var Fe=Ce.region||"us",Oe=f(y.WithinHeaders,Ce.appId,Ce.apiKey),Xe=V(a(a({hosts:[{url:"personalization.".concat(Fe,".algolia.com")}]},Ce),{},{headers:a(a(a({},Oe.headers()),{"content-type":"application/json"}),Ce.headers),queryParameters:a(a({},Oe.queryParameters()),Ce.queryParameters)}));return g({appId:Ce.appId,transporter:Xe},Ce.methods)}(a(a(a({},J),me),{},{methods:{getPersonalizationStrategy:ne,setPersonalizationStrategy:oe}}))}};return function(me){var Ce=me.appId,Fe=f(me.authMode!==void 0?me.authMode:y.WithinHeaders,Ce,me.apiKey),Oe=V(a(a({hosts:[{url:"".concat(Ce,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(Ce,".algolia.net"),accept:x.Write}].concat(p([{url:"".concat(Ce,"-1.algolianet.com")},{url:"".concat(Ce,"-2.algolianet.com")},{url:"".concat(Ce,"-3.algolianet.com")}]))},me),{},{headers:a(a(a({},Fe.headers()),{"content-type":"application/x-www-form-urlencoded"}),me.headers),queryParameters:a(a({},Fe.queryParameters()),me.queryParameters)}));return g({transporter:Oe,appId:Ce,addAlgoliaAgent:function(Xe,We){Oe.userAgent.add({segment:Xe,version:We})},clearCache:function(){return Promise.all([Oe.requestsCache.clear(),Oe.responsesCache.clear()]).then(function(){})}},me.methods)}(a(a({},ve),{},{methods:{search:fe,searchForFacetValues:ie,multipleBatch:De,multipleGetObjects:X,multipleQueries:fe,copyIndex:Be,copySettings:xe,copySynonyms:ge,copyRules:pe,moveIndex:Ie,listIndices:ae,getLogs:je,listClusters:he,multipleSearchForFacetValues:ie,getApiKey:Se,addApiKey:K,listApiKeys:ee,updateApiKey:Nt,deleteApiKey:Ne,restoreApiKey:Qe,assignUserID:Z,assignUserIDs:ue,getUserID:L,searchUserIDs:bt,listUserIDs:ye,getTopUserIDs:B,removeUserID:we,hasPendingMappings:Y,clearDictionaryEntries:be,deleteDictionaryEntries:Ae,getDictionarySettings:Ve,getAppTask:Re,replaceDictionaryEntries:nt,saveDictionaryEntries:ct,searchDictionaryEntries:pt,setDictionarySettings:Yt,waitAppTask:Ot,customRequest:ke,initIndex:function(me){return function(Ce){return Q(me)(Ce,{methods:{batch:Zt,delete:An,findAnswers:zt,getObject:Dn,getObjects:$t,saveObject:Wi,saveObjects:jn,search:fB,searchForFacetValues:pB,waitTask:en,setSettings:Jpe,getSettings:Ki,partialUpdateObject:Dp,partialUpdateObjects:Vp,deleteObject:So,deleteObjects:j,deleteBy:Rt,clearObjects:kn,browseObjects:Jt,getObjectPosition:Qt,findObject:En,exists:Le,saveSynonym:Zpe,saveSynonyms:Dy,getSynonym:Ap,searchSynonyms:mB,browseSynonyms:In,deleteSynonym:_e,clearSynonyms:Pt,replaceAllObjects:gr,replaceAllSynonyms:Rp,searchRules:hB,getRule:_o,deleteRule:re,saveRule:Iy,saveRules:Ay,replaceAllRules:md,browseRules:Mt,clearRules:wt}})}},initAnalytics:function(){return function(me){return function(Ce){var Fe=Ce.region||"us",Oe=f(y.WithinHeaders,Ce.appId,Ce.apiKey),Xe=V(a(a({hosts:[{url:"analytics.".concat(Fe,".algolia.com")}]},Ce),{},{headers:a(a(a({},Oe.headers()),{"content-type":"application/json"}),Ce.headers),queryParameters:a(a({},Oe.queryParameters()),Ce.queryParameters)}));return g({appId:Ce.appId,transporter:Xe},Ce.methods)}(a(a(a({},J),me),{},{methods:{addABTest:q,getABTest:te,getABTests:le,stopABTest:de,deleteABTest:G}}))}},initPersonalization:Te,initRecommendation:function(){return function(me){return ve.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),Te()(me)}},getRecommendations:Lp,getFrequentlyBoughtTogether:nhe,getLookingSimilar:ihe,getRecommendedForYou:she,getRelatedProducts:rhe,getTrendingFacets:ohe,getTrendingItems:ahe}}))}return gB.version="4.23.2",gB})})(rB);var Sfe=rB.exports;const _fe=YI(Sfe);class oB{constructor(t,n,o="https://api.pennsieve.io"){this.client=_fe(t,n),this.PENNSIEVE_API_LOCATION=o,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const n=t.map(s=>s.facetPropPath),o=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:n.concat(o)}).then(s=>(n.map(l=>{const c=t.find(m=>m.facetPropPath==l);var d=[];const u=s.facets;if(u===void 0)return;const f=u[l]==null?{}:u[l],h=c&&u[c.facetSubpropPath]?Object.keys(u[c.facetSubpropPath]):[];Object.keys(f).map(m=>{const p=h.reduce((v,y)=>{const b=y.split(".");return b.length!==2||m===b[0]&&v.push({label:b[1],id:i++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),v},[]);let g={label:m,id:i++,facetPropPath:l};p.length>0&&(g.children=p),d.push(g)}),d.length>0&&a.push({label:c?c.label:"",id:i++,children:d,key:l})}),a))}_discoverAllDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{fetch(`${n}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{o(a.map(i=>i.doi))})})}_expandDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{let a=t.map(i=>this._discoverAllDois(i,n));Promise.all(a).then(i=>{o(i.flat())})})}_processResultsForCards(t){let n=[],o={};for(let a of t)o={...a},o={anatomy:a.anatomy?a.anatomy.organ.map(i=>i.curie):void 0,doi:a.item.curie.split(":")[1],name:a.item.name,description:a.item.description,updated:a.pennsieve?a.pennsieve.updatedAt:void 0,publishDate:a.pennsieve?a.pennsieve.publishDate:void 0,datasetId:a.objectID,detailsReady:!1},n.push(o);return n}_processAnatomy(t){let n=[],o=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&n.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(n.push(l.curie),o.push(l.name))})}),i=[...new Set(n)],a=[...new Set(o)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,n="",o=10,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,n="",o=999999,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t){return t.map(o=>({id:o.objectID,terms:o.anatomy?o.anatomy.organ.map(a=>a.curie):[]}))}processResultsForScaffold(t){let n={};return t.forEach(o=>{o.anatomy&&o.anatomy.organ&&o.anatomy.organ.forEach(a=>{a.name&&(n[a.name]?n[a.name]++:n[a.name]=1)})}),n}}const $y=[{label:"Data Type",id:"item.types",facetPropPath:"item.types.name",facetSubpropPath:"item.types.subcategory.name"},{label:"Anatomical Structure",id:"anatomy.organ.category",facetPropPath:"anatomy.organ.category.name",facetSubpropPath:"anatomy.organ.subcategory.name",facetFilterPath:"anatomy.organ.name"},{label:"Species",id:"organisms.primary.species",facetPropPath:"organisms.primary.species.name",facetSubpropPath:"organisms.primary.species.subcategory.name"},{label:"Experimental Approach",id:"item.modalities",facetPropPath:"item.modalities.keyword",facetSubpropPath:"item.modalities.subcategory.name"},{label:"Sex",id:"attributes.subject.sex",facetPropPath:"attributes.subject.sex.value",facetSubpropPath:"attributes.subject.sex.subcategory.name"},{label:"Age Categories",id:"attributes.subject.ageCategory",facetPropPath:"attributes.subject.ageCategory.value",facetSubpropPath:"attributes.subject.ageCategory.subcategory.name"}];function aB(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=Bfe(e),n="NOT item.published.status:embargo";return n=`(${n}) AND `,$y.map(a=>a.facetPropPath).map(a=>{let i=t.filter(c=>c.facetPropPath==a),s="",l="";i.map(c=>{let d=c.facetSubPropPath?c.facetSubPropPath:a;c.AND?l+=`AND "${d}":"${c.label}"`:s+=`"${d}":"${c.label}" OR `}),!(s==""&&l=="")&&(s=`(${s.substring(0,s.lastIndexOf(" OR "))})`,n+=`${s+l} AND `,n=n.split("()AND ").join(""))}),n.substring(0,n.lastIndexOf(" AND "))}function Bfe(e){return e.filter(t=>t.label!=="Show all")}const Ip=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Fy=function(e){const t=e.toLowerCase();return Qu[t]?Ip(Qu[t]):Ip(t)},Tfe={name:"SearchFilters",components:{MapSvgIcon:gfe,MapSvgSpriteColor:Efe,Option:em,Select:ou,Popover:au,Cascader:e2},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{algoliaClient:void 0,cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFilters:!0,showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],props:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[]}},setup(){const e=r.markRaw({}),t=r.markRaw({term:new Set,facet:new Set,facet2:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`}},methods:{createCascaderItemValue:function(e,t=void 0,n=void 0){let o=e;return t&&(o=`${e}>${t}`),t&&n&&(o=`${e}>${t}>${n}`),!t&&n&&console.warn(`Warning: ${n} provided without its parent, this will not be shown in the cascader`),o},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets($y).then(t=>{this.facets=t,Wt.emit("available-facets",t),this.options=t,this.options.forEach((n,o)=>{this.options[o].total=this.countTotalFacet(n),this.options[o].label=Fy(n.label),this.options[o].value=this.createCascaderItemValue(n.key,void 0),this.options[o].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[o].children.forEach((a,i)=>{this.options[o].children[i].label=Fy(a.label),this.options[o].children[i].value=this.createCascaderItemValue(n.label,a.label),this.options[o].children[i].children&&this.options[o].children[i].children.length>0&&this.options[o].children[i].children.forEach((s,l)=>{this.options[o].children[i].children[l].label=Fy(s.label),this.options[o].children[i].children[l].value=this.createCascaderItemValue(n.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(n=>{const o=n[0],a=n[1],i=this.options.filter(l=>l.label==o)[0],s=i.key;for(let l=0;l<i.children.length;l++){const c=i.children[l],d=c.label,u=c.value;if(Array.isArray(a))if(a.length===0&&d.toLowerCase()==="show all"){t.push([s,u]);break}else d!==e&&a.includes(d)&&t.push([s,u]);else Object.entries(a).map(f=>{const h=f[0],m=f[1];h===d&&c.children.map(p=>{const g=p.label,v=p.value;g!==e&&m.includes(g)&&t.push([s,v])})})}}),this.cascadeEvent(t)},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.options.map(t=>{this.correctnessCheck.term.add(t.label),t.children.map(n=>{this.correctnessCheck.facet.add(n.label),t.label==="Anatomical structure"&&n.label!=="Show all"&&n.children.map(o=>{this.correctnessCheck.facet2.add(o.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:n,facet2:o,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(n)&&(o?this.correctnessCheck.facet2.has(o)&&(a in this.cascaderTags?n in this.cascaderTags[a]?this.cascaderTags[a][n].push(o):this.cascaderTags[a][n]=[o]:(this.cascaderTags[a]={},this.cascaderTags[a][n]=[o])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(n):n.toLowerCase()!=="show all"?this.cascaderTags[a]=[n]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const n=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...n]}),this.presentTags=[...new Set(this.presentTags)],this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((n,o)=>(n=typeof n=="number"?n:n.children.length,n+o.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(n=>{const o=n[0];o in t?t[o]+=1:t[o]=1}),this.options.map(n=>{const o=n.key,a=n.children.filter(s=>s.label==="Show all")[0].value,i=n.total;t[o]===i&&(e=e.filter(s=>s[0]!==n.key),delete t[o]),o in t||e.unshift([o,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let i=0;this.__expandItem__.length>1&&(i=1);const s=t.filter(c=>c[i]==this.__expandItem__[i]),l=t.filter(c=>c[i]!==this.__expandItem__[i]);t=[...s,...l]}let n=t.filter(i=>i!==void 0).map(i=>{let{hString:s,bString:l}=this.findHierarachyStringAndBooleanString(i),{facet:c,facet2:d,term:u}=this.getFacetsFromHierarchyString(s);return{facetPropPath:i[0],facet:c,facet2:d,term:u,AND:l}}),o=t.filter(i=>i!==void 0).map(i=>{let s,l=i[0].includes("duplicate")?i[0].split("duplicate")[0]:i[0],{hString:c,bString:d}=this.findHierarachyStringAndBooleanString(i),{facet:u,facet2:f,term:h}=this.getFacetsFromHierarchyString(c);return f&&(u=f,s="anatomy.organ.name"),{facetPropPath:l,facet:u,term:h,AND:d,facetSubPropPath:s}});o.filter(i=>i.facet!=="Show all").length||(o=[]),this.$emit("loading",!0),this.$emit("filterResults",o),this.setCascader(n),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,n;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],n=e.length==4?e[3]:void 0):(t=e[1],n=e[2]):(t=e[1],n=void 0),{hString:t,bString:n}},getFacetsFromHierarchyString(e){let t,n,o,a=e.split(">");return a.length==3?(o=a[2],t=a[1],n=a[0]):(t=a[1],n=a[0]),{facet:t,facet2:o,term:n}},showAllEventModifier:function(e){if(e.map(n=>n?n[1].toLowerCase().includes("show all"):!1).includes(!0)){let n=[],o={};for(const a in e)o[e[a][0]]===void 0&&(o[e[a][0]]=[]),o[e[a][0]].push(e[a]);for(const a in o){let i;for(let s=o[a].length-1;s>=0;s--)if(o[a][s][1].toLowerCase().includes("show all")){i=o[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&o[a].length>0?n.push(...o[a]):n.push(i):n.push(...o[a])}return n.sort((a,i)=>this.__expandItem__?a[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?a[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.cssMods()},numberShownChanged:function(e){this.$emit("numberPerPage",parseInt(e))},updatePreviousShowAllChecked:function(e){for(const t in this.previousShowAllChecked)this.previousShowAllChecked[t]=!1;e.forEach(t=>{t[1].toLowerCase().includes("show all")&&(this.previousShowAllChecked[t[0]]=!0)})},setCascader:function(e){if(this.cascaderIsReady&&e&&e.length!=0){const t=n=>{let o=[n.facetPropPath,this.createCascaderItemValue(Ip(n.term),n.facet)];return n.facet2&&o.push(this.createCascaderItemValue(Ip(n.term),n.facet,n.facet2)),o};this.cascadeSelected=e.map(n=>t(n)),this.cascadeSelectedWithBoolean=e.map(n=>{let o=t(n);return o.push(n.AND),o}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t)return this.cascadeSelected.filter(n=>n.term!=t.term),this.cascadeSelected.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2)]),this.cascadeSelectedWithBoolean.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2),t.AND]),!0}},initiateSearch:function(){this.cascadeEvent(this.cascadeSelectedWithBoolean)},checkShowAllBoxes:function(){this.setCascader(this.options.map(e=>({facetPropPath:e.value,term:e.label,facet:"Show all"})))},makeCascadeLabelsClickable:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-node__label").forEach(e=>{e.onclick=function(){const t=this.previousElementSibling;t&&(t.parentElement.attributes["aria-owns"]||this.previousElementSibling.click())}})})},cssMods:function(){this.makeCascadeLabelsClickable(),this.removeTopLevelCascaderCheckboxes()},removeTopLevelCascaderCheckboxes:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-menu__list")[0].querySelectorAll(".el-checkbox__input").forEach(t=>t.style.display="none")})},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2)return e;for(const t of this.options)if(t.value===e.facetPropPath)for(const n of t.children){if(n.label===e.facet)return e;if(n.children&&n.children.length>0){for(const o of n.children)if(o.label===e.facet)return e.facet2=o.label,e.facet=n.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(n=>{const o=this.validateAndConvertFilterToHierarchical(n);o&&t.push(o)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=r.markRaw(new oB(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},Nfe=e=>(r.pushScopeId("data-v-5ba40cae"),e=e(),r.popScopeId(),e),Ofe={class:"filters"},Pfe={key:0,class:"cascader-tag"},$fe={class:"el-tags-container"},Ffe={class:"el-tags-container"},Ife={class:"search-filters transition-box"},Afe={key:0,class:"filter-default-value"},Dfe=Nfe(()=>r.createElementVNode("div",null,[r.createElementVNode("strong",null,"Within categories:"),r.createTextVNode(" OR "),r.createElementVNode("br"),r.createTextVNode(" example: 'heart' OR 'colon' "),r.createElementVNode("br"),r.createElementVNode("br"),r.createElementVNode("strong",null,"Between categories:"),r.createTextVNode(" AND "),r.createElementVNode("br"),r.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),Vfe={class:"dataset-shown"},Rfe={class:"dataset-results-feedback"};function Lfe(e,t,n,o,a,i){const s=r.resolveComponent("MapSvgSpriteColor"),l=ls,c=au,d=e2,u=r.resolveComponent("MapSvgIcon"),f=em,h=ou,m=lu;return r.openBlock(),r.createElementBlock("div",Ofe,[r.createVNode(s),e.presentTags.length>0?(r.openBlock(),r.createElementBlock("div",Pfe,[r.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=p=>i.cascadeTagClose(e.presentTags[0]))},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(r.openBlock(),r.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:r.withCtx(()=>[r.createElementVNode("div",$fe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.presentTags.slice(1),(p,g)=>(r.openBlock(),r.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:v=>i.cascadeTagClose(p)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(p),1)]),_:2},1032,["onClose"]))),128))])]),reference:r.withCtx(()=>[r.createElementVNode("div",Ffe,[e.presentTags.length>1?(r.openBlock(),r.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:r.withCtx(()=>[r.createTextVNode(" +"+r.toDisplayString(e.presentTags.length-1),1)]),_:1})):r.createCommentVNode("",!0)])]),_:1})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"el-zoom-in-top"},{default:r.withCtx(()=>[r.withDirectives((r.openBlock(),r.createElementBlock("span",Ife,[r.createVNode(d,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=p=>e.cascadeSelected=p),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=p=>i.cascadeEvent(p)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(r.openBlock(),r.createElementBlock("div",Afe,"Filters")):r.createCommentVNode("",!0),r.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:r.withCtx(()=>[r.createVNode(u,{icon:"help",class:"help"})]),default:r.withCtx(()=>[Dfe]),_:1})])),[[r.vShow,e.showFilters],[m,!e.cascaderIsReady]])]),_:1}),r.createElementVNode("div",Vfe,[r.createElementVNode("span",Rfe,r.toDisplayString(i.numberOfResultsText),1),r.createVNode(h,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=p=>e.numberShown=p),placeholder:"10",onChange:t[4]||(t[4]=p=>i.numberShownChanged(p))},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.numberDatasetsShown,p=>(r.openBlock(),r.createBlock(f,{key:p,label:p,value:p},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const iB=jr(Tfe,[["render",Lfe],["__scopeId","data-v-5ba40cae"]]);var Mfe=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},zfe={filters:[],searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const jfe={components:{SearchFilters:iB,DatasetCard:y4,SearchHistory:w4,Button:Sn,Card:Lb,Drawer:Xh,Icon:mt,Input:Wd,Pagination:k2},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>zfe},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,algoliaClient:void 0,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter}}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t="",n={withSearch:!0}){this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady?(this.filter=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(n.withSearch&&this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&n.withSearch&&this.searchAlgolia(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilter(e)&&this.$refs.filtersRef.initiateSearch()):Array.isArray(this.filter)?this.filter.push(e):this.filter=[e]},cascaderReady:function(){this.cascaderIsReady=!0,this.openSearch(this.filter,this.searchInput)},clearSearchClicked:function(){this.searchInput="",this.searchAndFilterUpdate()},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.searchInput=this.searchInput.trim(),this.searchAndFilterUpdate())},filterUpdate:function(e){this.filters=[...e],this.searchAndFilterUpdate(),this.$emit("search-changed",{value:e,type:"filter-update"})},transformFiltersBeforeSearch:function(e){return e.map(t=>(t.facet2&&(t.facet=t.facet2,delete t.facet2),t))},searchAndFilterUpdate:function(){var t;this.resetPageNavigation();const e=this.transformFiltersBeforeSearch(this.filters);this.searchAlgolia(e,this.searchInput),this.$refs.searchHistory.selectValue="Search history",(this.filters.length||(t=this.searchInput)!=null&&t.trim())&&this.$refs.searchHistory.addSearchToHistory(this.filters,this.searchInput)},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(aB(e),t).then(n=>{Wt.emit("anatomy-in-datasets",n.forFlatmap),Wt.emit("number-of-datasets-for-anatomies",n.forScaffold)}),this.algoliaClient.search(aB(e),t,this.numberPerPage,this.page).then(n=>{this.numberOfHits=n.total,this.discoverIds=n.discoverIds,this._dois=n.dois,this.results=n.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const o=this._abortController.signal;this.perItemSearch(o,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,this.pageChange(1)},pageChange:function(e){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filters,this.searchInput,this.numberPerPage,this.page)},handleMissingData:function(e){let t=this.results.findIndex(n=>n.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const o=this._dois.shift();o&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[o]},e).then(a=>{a.numberOfHits===0?this.handleMissingData(o):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.name!=="AbortError"&&(this.handleMissingData(o),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let n=this.results.findIndex(o=>t.doi?t.doi.includes(o.doi):!1);Object.assign(this.results[n],t),Object.assign(this.results[n],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(o=>o.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(o=>o.species?o.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[n]=this.results[n]})},createfilterParams:function(e){let t=new URLSearchParams;for(const n in e)Array.isArray(e[n])?e[n].forEach(o=>{t.append(n,o)}):t.append(n,e[n]);return t.toString()},callSciCrunch:function(e,t={},n){return new Promise((o,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:n}).then(Mfe).then(s=>s.json()).then(s=>o(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets($y)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.searchAndFilterUpdate(),this.openSearch([...e.filters],e.search,{withSearch:!1})}},mounted:function(){this.algoliaClient=r.markRaw(new oB(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.openSearch(this.filter,this.searchInput)},created:function(){this.searchEndpoint="dataset_info/using_multiple_dois/"}},Hfe={class:"header"},Ufe={class:"content scrollbar",ref:"content"},qfe={key:0,class:"error-feedback"};function Kfe(e,t,n,o,a,i){const s=Wd,l=Sn,c=iB,d=w4,u=y4,f=k2,h=Lb,m=lu;return r.openBlock(),r.createBlock(h,{"body-style":e.bodyStyle,class:"content-card"},{header:r.withCtx(()=>[r.createElementVNode("div",Hfe,[r.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=p=>e.searchInput=p),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),r.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large",disabled:!e.searchInput.trim()},{default:r.withCtx(()=>[r.createTextVNode(" Search ")]),_:1},8,["onClick","disabled"])])]),default:r.withCtx(()=>[r.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:n.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),r.createVNode(d,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),r.withDirectives((r.openBlock(),r.createElementBlock("div",Ufe,[e.results.length===0&&!e.loadingCards?(r.openBlock(),r.createElementBlock("div",qfe," No results found - Please change your search / filter criteria. ")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.results,p=>(r.openBlock(),r.createElementBlock("div",{key:p.doi,class:"step-item"},[r.createVNode(u,{class:"dataset-card",entry:p,envVars:n.envVars,onMouseenter:g=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=g=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),r.createVNode(f,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=p=>e.page=p),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:i.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[m,e.loadingCards]])]),_:1},8,["body-style"])}const sB=jr(jfe,[["render",Kfe],["__scopeId","data-v-17fdcafc"]]),Wfe={name:"AnnotationTool",components:{AnnotationPopup:gre,Button:Sn,CreateTooltipContent:xre,Col:r2,ElIconDelete:vh,Icon:mt,Row:n2},props:{annotationEntry:{type:Object},createData:{type:Object,default:{}}},data:function(){return{ElIconDelete:r.shallowRef(vh)}}},Gfe={class:"annotation-tool scrollbar"},Xfe={key:1,class:"delete-container"};function Yfe(e,t,n,o,a,i){const s=r.resolveComponent("CreateTooltipContent"),l=r.resolveComponent("annotation-popup"),c=r2,d=Sn,u=n2;return r.openBlock(),r.createElementBlock("div",Gfe,[r.withDirectives(r.createVNode(s,{createData:n.createData,onConfirmCreate:t[0]||(t[0]=f=>e.$emit("confirm-create",f)),onCancelCreate:t[1]||(t[1]=f=>e.$emit("cancel-create")),class:"create-tooltip-content"},null,8,["createData"]),[[r.vShow,n.createData&&n.createData.toBeConfirmed]]),n.annotationEntry&&(!n.createData||!n.createData.toBeConfirmed)?(r.openBlock(),r.createBlock(l,{key:0,class:"annotation-popup",annotationEntry:n.annotationEntry,onAnnotation:t[2]||(t[2]=f=>e.$emit("annotation",f))},null,8,["annotationEntry"])):r.createCommentVNode("",!0),n.createData&&n.createData.toBeDeleted?(r.openBlock(),r.createElementBlock("div",Xfe,[r.createVNode(u,null,{default:r.withCtx(()=>[r.createVNode(c,{offset:1,span:6},{default:r.withCtx(()=>[r.createTextVNode("Delete this feature?")]),_:1}),r.createVNode(c,{offset:1,span:3},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",icon:e.ElIconDelete,onClick:t[3]||(t[3]=f=>e.$emit("confirm-delete"))},{default:r.withCtx(()=>[r.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),r.createVNode(c,{offset:1,span:2},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",onClick:t[4]||(t[4]=f=>e.$emit("cancel-create"))},{default:r.withCtx(()=>[r.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):r.createCommentVNode("",!0)])}const lB=jr(Wfe,[["render",Yfe],["__scopeId","data-v-de83d649"]]),Zfe={name:"ExternalResourceCard",components:{Button:Sn},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:r.shallowRef(bP)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){Wt.emit("open-pubmed-url",e),window.open(e,"_blank")}}},Jfe={class:"resource-container"};function Qfe(e,t,n,o,a,i){const s=Sn;return r.openBlock(),r.createElementBlock("div",Jfe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.resources,l=>(r.openBlock(),r.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(r.openBlock(),r.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>i.openUrl(l.url)},{default:r.withCtx(()=>[r.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):r.createCommentVNode("",!0)]))),128))])}const cB=jr(Zfe,[["render",Qfe],["__scopeId","data-v-e726c314"]]),epe=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),hd=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},tpe=3e3,npe={name:"ConnectivityInfo",components:{Button:Sn,Container:vD,Icon:mt,ElIconArrowUp:tP,ElIconArrowDown:Sl,ElIconWarning:gv,ExternalResourceCard:cB,CopyToClipboard:I_,ConnectivityGraph:Tue},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},envVars:{type:Object,default:()=>{}},availableAnatomyFacets:{type:Array,default:()=>[]}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,activeView:"listView",facetList:[],showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}],connectivityError:null,timeoutID:void 0}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{updatedCopyContent:function(){return this.getUpdateCopyContent()},resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return epe(e)},capitalise:function(e){return hd(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name.toLowerCase())})},shouldShowExploreButton:function(e){for(let t=0;t<e.length;t++)if(this.facetList.includes(e[t].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(e){e.forEach(t=>{t.children?this.convertFacetsToList(t.children):this.facetList.push(t.label.toLowerCase())})},openDendrites:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name.toLowerCase())})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e},showConnectivity:function(e){const t=e.featureId||[];this.$emit("show-connectivity",t)},switchConnectivityView:function(e){if(this.activeView=e,e==="graphView"){const t=this.$refs.connectivityGraphRef;t&&t.$el&&t.$el.scrollIntoView({behavior:"smooth"})}},onTapNode:function(e){const t=e.map(n=>n.label).join(", ");this.toggleConnectivityTooltip(t,{show:!0})},getUpdateCopyContent:function(){var n,o,a,i,s;if(!this.entry)return"";const e=[];if(this.entry.title?e.push(`<div><strong>${hd(this.entry.title)}</strong></div>`):e.push(`<div><strong>${this.entry.featureId}</strong></div>`),(n=this.entry.provenanceTaxonomyLabel)!=null&&n.length&&e.push(`<div>${this.provSpeciesDescription}</div>`),(o=this.resources)!=null&&o.length){const l=[];this.resources.forEach(c=>{let d="";c.id==="pubmed"&&(d+="<div><strong>PubMed URL:</strong></div>",d+=`
|
|
921
|
+
`)},Cfe=["innerHTML"];function kfe(e,t,n,o,a,i){return r.openBlock(),r.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,Cfe)}const Efe=x4(xfe,[["render",kfe]]);var rB={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(n,o){e.exports=o()})(XI,function(){function n(I,R,z){return R in I?Object.defineProperty(I,R,{value:z,enumerable:!0,configurable:!0,writable:!0}):I[R]=z,I}function o(I,R){var z=Object.keys(I);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(I);R&&(H=H.filter(function(J){return Object.getOwnPropertyDescriptor(I,J).enumerable})),z.push.apply(z,H)}return z}function a(I){for(var R=1;R<arguments.length;R++){var z=arguments[R]!=null?arguments[R]:{};R%2?o(Object(z),!0).forEach(function(H){n(I,H,z[H])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(z)):o(Object(z)).forEach(function(H){Object.defineProperty(I,H,Object.getOwnPropertyDescriptor(z,H))})}return I}function i(I,R){if(I==null)return{};var z,H,J=function(Te,me){if(Te==null)return{};var Ce,Fe,Oe={},Xe=Object.keys(Te);for(Fe=0;Fe<Xe.length;Fe++)Ce=Xe[Fe],me.indexOf(Ce)>=0||(Oe[Ce]=Te[Ce]);return Oe}(I,R);if(Object.getOwnPropertySymbols){var ve=Object.getOwnPropertySymbols(I);for(H=0;H<ve.length;H++)z=ve[H],R.indexOf(z)>=0||Object.prototype.propertyIsEnumerable.call(I,z)&&(J[z]=I[z])}return J}function s(I,R){return function(z){if(Array.isArray(z))return z}(I)||function(z,H){if(Symbol.iterator in Object(z)||Object.prototype.toString.call(z)==="[object Arguments]"){var J=[],ve=!0,Te=!1,me=void 0;try{for(var Ce,Fe=z[Symbol.iterator]();!(ve=(Ce=Fe.next()).done)&&(J.push(Ce.value),!H||J.length!==H);ve=!0);}catch(Oe){Te=!0,me=Oe}finally{try{ve||Fe.return==null||Fe.return()}finally{if(Te)throw me}}return J}}(I,R)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(I){return function(R){if(Array.isArray(R)){for(var z=0,H=new Array(R.length);z<R.length;z++)H[z]=R[z];return H}}(I)||function(R){if(Symbol.iterator in Object(R)||Object.prototype.toString.call(R)==="[object Arguments]")return Array.from(R)}(I)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(I){var R,z="algoliasearch-client-js-".concat(I.key),H=function(){return R===void 0&&(R=I.localStorage||window.localStorage),R},J=function(){return JSON.parse(H().getItem(z)||"{}")},ve=function(me){H().setItem(z,JSON.stringify(me))},Te=function(){var me=I.timeToLive?1e3*I.timeToLive:null,Ce=J(),Fe=Object.fromEntries(Object.entries(Ce).filter(function(Xe){return s(Xe,2)[1].timestamp!==void 0}));if(ve(Fe),me){var Oe=Object.fromEntries(Object.entries(Fe).filter(function(Xe){var We=s(Xe,2)[1],rt=new Date().getTime();return!(We.timestamp+me<rt)}));ve(Oe)}};return{get:function(me,Ce){var Fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){Te();var Oe=JSON.stringify(me);return J()[Oe]}).then(function(Oe){return Promise.all([Oe?Oe.value:Ce(),Oe!==void 0])}).then(function(Oe){var Xe=s(Oe,2),We=Xe[0],rt=Xe[1];return Promise.all([We,rt||Fe.miss(We)])}).then(function(Oe){return s(Oe,1)[0]})},set:function(me,Ce){return Promise.resolve().then(function(){var Fe=J();return Fe[JSON.stringify(me)]={timestamp:new Date().getTime(),value:Ce},H().setItem(z,JSON.stringify(Fe)),Ce})},delete:function(me){return Promise.resolve().then(function(){var Ce=J();delete Ce[JSON.stringify(me)],H().setItem(z,JSON.stringify(Ce))})},clear:function(){return Promise.resolve().then(function(){H().removeItem(z)})}}}function d(I){var R=l(I.caches),z=R.shift();return z===void 0?{get:function(H,J){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},Te=J();return Te.then(function(me){return Promise.all([me,ve.miss(me)])}).then(function(me){return s(me,1)[0]})},set:function(H,J){return Promise.resolve(J)},delete:function(H){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(H,J){var ve=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return z.get(H,J,ve).catch(function(){return d({caches:R}).get(H,J,ve)})},set:function(H,J){return z.set(H,J).catch(function(){return d({caches:R}).set(H,J)})},delete:function(H){return z.delete(H).catch(function(){return d({caches:R}).delete(H)})},clear:function(){return z.clear().catch(function(){return d({caches:R}).clear()})}}}function u(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},R={};return{get:function(z,H){var J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},ve=JSON.stringify(z);if(ve in R)return Promise.resolve(I.serializable?JSON.parse(R[ve]):R[ve]);var Te=H(),me=J&&J.miss||function(){return Promise.resolve()};return Te.then(function(Ce){return me(Ce)}).then(function(){return Te})},set:function(z,H){return R[JSON.stringify(z)]=I.serializable?JSON.stringify(H):H,Promise.resolve(H)},delete:function(z){return delete R[JSON.stringify(z)],Promise.resolve()},clear:function(){return R={},Promise.resolve()}}}function f(I,R,z){var H={"x-algolia-api-key":z,"x-algolia-application-id":R};return{headers:function(){return I===y.WithinHeaders?H:{}},queryParameters:function(){return I===y.WithinQueryParameters?H:{}}}}function h(I){var R=0;return I(function z(){return R++,new Promise(function(H){setTimeout(function(){H(I(z))},Math.min(100*R,1e3))})})}function m(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(z,H){return Promise.resolve()};return Object.assign(I,{wait:function(z){return m(I.then(function(H){return Promise.all([R(H,z),H])}).then(function(H){return H[1]}))}})}function p(I){for(var R=I.length-1;R>0;R--){var z=Math.floor(Math.random()*(R+1)),H=I[R];I[R]=I[z],I[z]=H}return I}function g(I,R){return R&&Object.keys(R).forEach(function(z){I[z]=R[z](I)}),I}function v(I){for(var R=arguments.length,z=new Array(R>1?R-1:0),H=1;H<R;H++)z[H-1]=arguments[H];var J=0;return I.replace(/%s/g,function(){return encodeURIComponent(z[J++])})}var y={WithinQueryParameters:0,WithinHeaders:1};function b(I,R){var z=I||{},H=z.data||{};return Object.keys(z).forEach(function(J){["timeout","headers","queryParameters","data","cacheable"].indexOf(J)===-1&&(H[J]=z[J])}),{data:Object.entries(H).length>0?H:void 0,timeout:z.timeout||R,headers:z.headers||{},queryParameters:z.queryParameters||{},cacheable:z.cacheable}}var x={Read:1,Write:2,Any:3},w=1,k=2,C=3;function E(I){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:w;return a(a({},I),{},{status:R,lastUpdate:Date.now()})}function S(I){return typeof I=="string"?{protocol:"https",url:I,accept:x.Any}:{protocol:I.protocol||"https",url:I.url,accept:I.accept||x.Any}}var _="DELETE",O="GET",T="POST",N="PUT";function F(I,R){return Promise.all(R.map(function(z){return I.get(z,function(){return Promise.resolve(E(z))})})).then(function(z){var H=z.filter(function(Te){return function(me){return me.status===w||Date.now()-me.lastUpdate>12e4}(Te)}),J=z.filter(function(Te){return function(me){return me.status===C&&Date.now()-me.lastUpdate<=12e4}(Te)}),ve=[].concat(l(H),l(J));return{getTimeout:function(Te,me){return(J.length===0&&Te===0?1:J.length+3+Te)*me},statelessHosts:ve.length>0?ve.map(function(Te){return S(Te)}):R}})}function $(I,R,z,H){var J=[],ve=function(We,rt){if(!(We.method===O||We.data===void 0&&rt.data===void 0)){var et=Array.isArray(We.data)?We.data:a(a({},We.data),rt.data);return JSON.stringify(et)}}(z,H),Te=function(We,rt){var et=a(a({},We.headers),rt.headers),Et={};return Object.keys(et).forEach(function(It){var or=et[It];Et[It.toLowerCase()]=or}),Et}(I,H),me=z.method,Ce=z.method!==O?{}:a(a({},z.data),H.data),Fe=a(a(a({"x-algolia-agent":I.userAgent.value},I.queryParameters),Ce),H.queryParameters),Oe=0,Xe=function We(rt,et){var Et=rt.pop();if(Et===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:M(J)};var It={data:ve,headers:Te,method:me,url:A(Et,z.path,Fe),connectTimeout:et(Oe,I.timeouts.connect),responseTimeout:et(Oe,H.timeout)},or=function(ar){var Vn={request:It,response:ar,host:Et,triesLeft:rt.length};return J.push(Vn),Vn},gd={onSuccess:function(ar){return function(Vn){try{return JSON.parse(Vn.content)}catch(Gi){throw function(Ha,pl){return{name:"DeserializationError",message:Ha,response:pl}}(Gi.message,Vn)}}(ar)},onRetry:function(ar){var Vn=or(ar);return ar.isTimedOut&&Oe++,Promise.all([I.logger.info("Retryable failure",W(Vn)),I.hostsCache.set(Et,E(Et,ar.isTimedOut?C:k))]).then(function(){return We(rt,et)})},onFail:function(ar){throw or(ar),function(Vn,Gi){var Ha=Vn.content,pl=Vn.status,yd=Ha;try{yd=JSON.parse(Ha).message}catch{}return function(Mp,Ry,lhe){return{name:"ApiError",message:Mp,status:Ry,transporterStackTrace:lhe}}(yd,pl,Gi)}(ar,M(J))}};return I.requester.send(It).then(function(ar){return function(Vn,Gi){return function(Ha){var pl=Ha.status;return Ha.isTimedOut||function(yd){var Mp=yd.isTimedOut,Ry=yd.status;return!Mp&&~~Ry==0}(Ha)||~~(pl/100)!=2&&~~(pl/100)!=4}(Vn)?Gi.onRetry(Vn):~~(Vn.status/100)==2?Gi.onSuccess(Vn):Gi.onFail(Vn)}(ar,gd)})};return F(I.hostsCache,R).then(function(We){return Xe(l(We.statelessHosts).reverse(),We.getTimeout)})}function V(I){var R=I.hostsCache,z=I.logger,H=I.requester,J=I.requestsCache,ve=I.responsesCache,Te=I.timeouts,me=I.userAgent,Ce=I.hosts,Fe=I.queryParameters,Oe={hostsCache:R,logger:z,requester:H,requestsCache:J,responsesCache:ve,timeouts:Te,userAgent:me,headers:I.headers,queryParameters:Fe,hosts:Ce.map(function(Xe){return S(Xe)}),read:function(Xe,We){var rt=b(We,Oe.timeouts.read),et=function(){return $(Oe,Oe.hosts.filter(function(It){return(It.accept&x.Read)!=0}),Xe,rt)};if((rt.cacheable!==void 0?rt.cacheable:Xe.cacheable)!==!0)return et();var Et={request:Xe,mappedRequestOptions:rt,transporter:{queryParameters:Oe.queryParameters,headers:Oe.headers}};return Oe.responsesCache.get(Et,function(){return Oe.requestsCache.get(Et,function(){return Oe.requestsCache.set(Et,et()).then(function(It){return Promise.all([Oe.requestsCache.delete(Et),It])},function(It){return Promise.all([Oe.requestsCache.delete(Et),Promise.reject(It)])}).then(function(It){var or=s(It,2);return or[0],or[1]})})},{miss:function(It){return Oe.responsesCache.set(Et,It)}})},write:function(Xe,We){return $(Oe,Oe.hosts.filter(function(rt){return(rt.accept&x.Write)!=0}),Xe,b(We,Oe.timeouts.write))}};return Oe}function P(I){var R={value:"Algolia for JavaScript (".concat(I,")"),add:function(z){var H="; ".concat(z.segment).concat(z.version!==void 0?" (".concat(z.version,")"):"");return R.value.indexOf(H)===-1&&(R.value="".concat(R.value).concat(H)),R}};return R}function A(I,R,z){var H=D(z),J="".concat(I.protocol,"://").concat(I.url,"/").concat(R.charAt(0)==="/"?R.substr(1):R);return H.length&&(J+="?".concat(H)),J}function D(I){return Object.keys(I).map(function(R){return v("%s=%s",R,(z=I[R],Object.prototype.toString.call(z)==="[object Object]"||Object.prototype.toString.call(z)==="[object Array]"?JSON.stringify(I[R]):I[R]));var z}).join("&")}function M(I){return I.map(function(R){return W(R)})}function W(I){var R=I.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},I),{},{request:a(a({},I.request),{},{headers:a(a({},I.request.headers),R)})})}var q=function(I){return function(R,z){return I.transporter.write({method:T,path:"2/abtests",data:R},z)}},G=function(I){return function(R,z){return I.transporter.write({method:_,path:v("2/abtests/%s",R)},z)}},te=function(I){return function(R,z){return I.transporter.read({method:O,path:v("2/abtests/%s",R)},z)}},le=function(I){return function(R){return I.transporter.read({method:O,path:"2/abtests"},R)}},de=function(I){return function(R,z){return I.transporter.write({method:T,path:v("2/abtests/%s/stop",R)},z)}},ne=function(I){return function(R){return I.transporter.read({method:O,path:"1/strategies/personalization"},R)}},oe=function(I){return function(R,z){return I.transporter.write({method:T,path:"1/strategies/personalization",data:R},z)}};function U(I){return function R(z){return I.request(z).then(function(H){if(I.batch!==void 0&&I.batch(H.hits),!I.shouldStop(H))return H.cursor?R({cursor:H.cursor}):R({page:(z.page||0)+1})})}({})}var K=function(I){return function(R,z){var H=z||{},J=H.queryParameters,ve=i(H,["queryParameters"]),Te=a({acl:R},J!==void 0?{queryParameters:J}:{});return m(I.transporter.write({method:T,path:"1/keys",data:Te},ve),function(me,Ce){return h(function(Fe){return Se(I)(me.key,Ce).catch(function(Oe){if(Oe.status!==404)throw Oe;return Fe()})})})}},Z=function(I){return function(R,z,H){var J=b(H);return J.queryParameters["X-Algolia-User-ID"]=R,I.transporter.write({method:T,path:"1/clusters/mapping",data:{cluster:z}},J)}},ue=function(I){return function(R,z,H){return I.transporter.write({method:T,path:"1/clusters/mapping/batch",data:{users:R,cluster:z}},H)}},be=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},z),function(H,J){return Ot(I)(H.taskID,J)})}},Be=function(I){return function(R,z,H){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",R),data:{operation:"copy",destination:z}},H),function(J,ve){return Q(I)(R,{methods:{waitTask:en}}).waitTask(J.taskID,ve)})}},pe=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Rules]}))}},xe=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Settings]}))}},ge=function(I){return function(R,z,H){return Be(I)(R,z,a(a({},H),{},{scope:[Vy.Synonyms]}))}},ke=function(I){return function(R,z){return R.method===O?I.transporter.read(R,z):I.transporter.write(R,z)}},Ne=function(I){return function(R,z){return m(I.transporter.write({method:_,path:v("1/keys/%s",R)},z),function(H,J){return h(function(ve){return Se(I)(R,J).then(ve).catch(function(Te){if(Te.status!==404)throw Te})})})}},Ae=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"deleteEntry",body:{objectID:ve}}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!1,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},Se=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/keys/%s",R)},z)}},Re=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/task/%s",R.toString())},z)}},Ve=function(I){return function(R){return I.transporter.read({method:O,path:"/1/dictionaries/*/settings"},R)}},je=function(I){return function(R){return I.transporter.read({method:O,path:"1/logs"},R)}},B=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters/mapping/top"},R)}},L=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/clusters/mapping/%s",R)},z)}},Y=function(I){return function(R){var z=R||{},H=z.retrieveMappings,J=i(z,["retrieveMappings"]);return H===!0&&(J.getClusters=!0),I.transporter.read({method:O,path:"1/clusters/mapping/pending"},J)}},Q=function(I){return function(R){var z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},H={transporter:I.transporter,appId:I.appId,indexName:R};return g(H,z.methods)}},ee=function(I){return function(R){return I.transporter.read({method:O,path:"1/keys"},R)}},he=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters"},R)}},ae=function(I){return function(R){return I.transporter.read({method:O,path:"1/indexes"},R)}},ye=function(I){return function(R){return I.transporter.read({method:O,path:"1/clusters/mapping"},R)}},Ie=function(I){return function(R,z,H){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",R),data:{operation:"move",destination:z}},H),function(J,ve){return Q(I)(R,{methods:{waitTask:en}}).waitTask(J.taskID,ve)})}},De=function(I){return function(R,z){return m(I.transporter.write({method:T,path:"1/indexes/*/batch",data:{requests:R}},z),function(H,J){return Promise.all(Object.keys(H.taskID).map(function(ve){return Q(I)(ve,{methods:{waitTask:en}}).waitTask(H.taskID[ve],J)}))})}},X=function(I){return function(R,z){return I.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:R}},z)}},fe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{params:D(J.params||{})})});return I.transporter.read({method:T,path:"1/indexes/*/queries",data:{requests:H},cacheable:!0},z)}},ie=function(I){return function(R,z){return Promise.all(R.map(function(H){var J=H.params,ve=J.facetName,Te=J.facetQuery,me=i(J,["facetName","facetQuery"]);return Q(I)(H.indexName,{methods:{searchForFacetValues:pB}}).searchForFacetValues(ve,Te,a(a({},z),me))}))}},we=function(I){return function(R,z){var H=b(z);return H.queryParameters["X-Algolia-User-ID"]=R,I.transporter.write({method:_,path:"1/clusters/mapping"},H)}},nt=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"addEntry",body:ve}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!0,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},Qe=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/keys/%s/restore",R)},z),function(H,J){return h(function(ve){return Se(I)(R,J).catch(function(Te){if(Te.status!==404)throw Te;return ve()})})})}},ct=function(I){return function(R,z,H){var J=z.map(function(ve){return{action:"addEntry",body:ve}});return m(I.transporter.write({method:T,path:v("/1/dictionaries/%s/batch",R),data:{clearExistingDictionaryEntries:!1,requests:J}},H),function(ve,Te){return Ot(I)(ve.taskID,Te)})}},pt=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("/1/dictionaries/%s/search",R),data:{query:z},cacheable:!0},H)}},bt=function(I){return function(R,z){return I.transporter.read({method:T,path:"1/clusters/mapping/search",data:{query:R}},z)}},Yt=function(I){return function(R,z){return m(I.transporter.write({method:N,path:"/1/dictionaries/*/settings",data:R},z),function(H,J){return Ot(I)(H.taskID,J)})}},Nt=function(I){return function(R,z){var H=Object.assign({},z),J=z||{},ve=J.queryParameters,Te=i(J,["queryParameters"]),me=ve?{queryParameters:ve}:{},Ce=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(I.transporter.write({method:N,path:v("1/keys/%s",R),data:me},Te),function(Fe,Oe){return h(function(Xe){return Se(I)(R,Oe).then(function(We){return function(rt){return Object.keys(H).filter(function(et){return Ce.indexOf(et)!==-1}).every(function(et){if(Array.isArray(rt[et])&&Array.isArray(H[et])){var Et=rt[et];return Et.length===H[et].length&&Et.every(function(It,or){return It===H[et][or]})}return rt[et]===H[et]})}(We)?Promise.resolve():Xe()})})})}},Ot=function(I){return function(R,z){return h(function(H){return Re(I)(R,z).then(function(J){return J.status!=="published"?H():void 0})})}},Zt=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/indexes/%s/batch",I.indexName),data:{requests:R}},z),function(H,J){return en(I)(H.taskID,J)})}},Jt=function(I){return function(R){return U(a(a({shouldStop:function(z){return z.cursor===void 0}},R),{},{request:function(z){return I.transporter.read({method:T,path:v("1/indexes/%s/browse",I.indexName),data:z},R)}}))}},Mt=function(I){return function(R){var z=a({hitsPerPage:1e3},R);return U(a(a({shouldStop:function(H){return H.hits.length<z.hitsPerPage}},z),{},{request:function(H){return hB(I)("",a(a({},z),H)).then(function(J){return a(a({},J),{},{hits:J.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},In=function(I){return function(R){var z=a({hitsPerPage:1e3},R);return U(a(a({shouldStop:function(H){return H.hits.length<z.hitsPerPage}},z),{},{request:function(H){return mB(I)("",a(a({},z),H)).then(function(J){return a(a({},J),{},{hits:J.hits.map(function(ve){return delete ve._highlightResult,ve})})})}}))}},Cn=function(I){return function(R,z,H){var J=H||{},ve=J.batchSize,Te=i(J,["batchSize"]),me={taskIDs:[],objectIDs:[]};return m(function Ce(){var Fe,Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Xe=[];for(Fe=Oe;Fe<R.length&&(Xe.push(R[Fe]),Xe.length!==(ve||1e3));Fe++);return Xe.length===0?Promise.resolve(me):Zt(I)(Xe.map(function(We){return{action:z,body:We}}),Te).then(function(We){return me.objectIDs=me.objectIDs.concat(We.objectIDs),me.taskIDs.push(We.taskID),Fe++,Ce(Fe)})}(),function(Ce,Fe){return Promise.all(Ce.taskIDs.map(function(Oe){return en(I)(Oe,Fe)}))})}},kn=function(I){return function(R){return m(I.transporter.write({method:T,path:v("1/indexes/%s/clear",I.indexName)},R),function(z,H){return en(I)(z.taskID,H)})}},wt=function(I){return function(R){var z=R||{},H=z.forwardToReplicas,J=b(i(z,["forwardToReplicas"]));return H&&(J.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/rules/clear",I.indexName)},J),function(ve,Te){return en(I)(ve.taskID,Te)})}},Pt=function(I){return function(R){var z=R||{},H=z.forwardToReplicas,J=b(i(z,["forwardToReplicas"]));return H&&(J.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/synonyms/clear",I.indexName)},J),function(ve,Te){return en(I)(ve.taskID,Te)})}},Rt=function(I){return function(R,z){return m(I.transporter.write({method:T,path:v("1/indexes/%s/deleteByQuery",I.indexName),data:R},z),function(H,J){return en(I)(H.taskID,J)})}},An=function(I){return function(R){return m(I.transporter.write({method:_,path:v("1/indexes/%s",I.indexName)},R),function(z,H){return en(I)(z.taskID,H)})}},So=function(I){return function(R,z){return m(j(I)([R],z).then(function(H){return{taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},j=function(I){return function(R,z){var H=R.map(function(J){return{objectID:J}});return Cn(I)(H,fl.DeleteObject,z)}},re=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:_,path:v("1/indexes/%s/rules/%s",I.indexName,R)},ve),function(Te,me){return en(I)(Te.taskID,me)})}},_e=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:_,path:v("1/indexes/%s/synonyms/%s",I.indexName,R)},ve),function(Te,me){return en(I)(Te.taskID,me)})}},Le=function(I){return function(R){return Ki(I)(R).then(function(){return!0}).catch(function(z){if(z.status!==404)throw z;return!1})}},zt=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("1/answers/%s/prediction",I.indexName),data:{query:R,queryLanguages:z},cacheable:!0},H)}},En=function(I){return function(R,z){var H=z||{},J=H.query,ve=H.paginate,Te=i(H,["query","paginate"]),me=0;return function Ce(){return fB(I)(J||"",a(a({},Te),{},{page:me})).then(function(Fe){for(var Oe=0,Xe=Object.entries(Fe.hits);Oe<Xe.length;Oe++){var We=s(Xe[Oe],2),rt=We[0],et=We[1];if(R(et))return{object:et,position:parseInt(rt,10),page:me}}if(me++,ve===!1||me>=Fe.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return Ce()})}()}},Dn=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/%s",I.indexName,R)},z)}},Qt=function(){return function(I,R){for(var z=0,H=Object.entries(I.hits);z<H.length;z++){var J=s(H[z],2),ve=J[0];if(J[1].objectID===R)return parseInt(ve,10)}return-1}},$t=function(I){return function(R,z){var H=z||{},J=H.attributesToRetrieve,ve=i(H,["attributesToRetrieve"]),Te=R.map(function(me){return a({indexName:I.indexName,objectID:me},J?{attributesToRetrieve:J}:{})});return I.transporter.read({method:T,path:"1/indexes/*/objects",data:{requests:Te}},ve)}},_o=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/rules/%s",I.indexName,R)},z)}},Ki=function(I){return function(R){return I.transporter.read({method:O,path:v("1/indexes/%s/settings",I.indexName),data:{getVersion:2}},R)}},Ap=function(I){return function(R,z){return I.transporter.read({method:O,path:v("1/indexes/%s/synonyms/%s",I.indexName,R)},z)}},Dp=function(I){return function(R,z){return m(Vp(I)([R],z).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},Vp=function(I){return function(R,z){var H=z||{},J=H.createIfNotExists,ve=i(H,["createIfNotExists"]),Te=J?fl.PartialUpdateObject:fl.PartialUpdateObjectNoCreate;return Cn(I)(R,Te,ve)}},gr=function(I){return function(R,z){var H=z||{},J=H.safe,ve=H.autoGenerateObjectIDIfNotExist,Te=H.batchSize,me=i(H,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),Ce=function(et,Et,It,or){return m(I.transporter.write({method:T,path:v("1/indexes/%s/operation",et),data:{operation:It,destination:Et}},or),function(gd,ar){return en(I)(gd.taskID,ar)})},Fe=Math.random().toString(36).substring(7),Oe="".concat(I.indexName,"_tmp_").concat(Fe),Xe=jn({appId:I.appId,transporter:I.transporter,indexName:Oe}),We=[],rt=Ce(I.indexName,Oe,"copy",a(a({},me),{},{scope:["settings","synonyms","rules"]}));return We.push(rt),m((J?rt.wait(me):rt).then(function(){var et=Xe(R,a(a({},me),{},{autoGenerateObjectIDIfNotExist:ve,batchSize:Te}));return We.push(et),J?et.wait(me):et}).then(function(){var et=Ce(Oe,I.indexName,"move",me);return We.push(et),J?et.wait(me):et}).then(function(){return Promise.all(We)}).then(function(et){var Et=s(et,3),It=Et[0],or=Et[1],gd=Et[2];return{objectIDs:or.objectIDs,taskIDs:[It.taskID].concat(l(or.taskIDs),[gd.taskID])}}),function(et,Et){return Promise.all(We.map(function(It){return It.wait(Et)}))})}},md=function(I){return function(R,z){return Ay(I)(R,a(a({},z),{},{clearExistingRules:!0}))}},Rp=function(I){return function(R,z){return Dy(I)(R,a(a({},z),{},{clearExistingSynonyms:!0}))}},Wi=function(I){return function(R,z){return m(jn(I)([R],z).then(function(H){return{objectID:H.objectIDs[0],taskID:H.taskIDs[0]}}),function(H,J){return en(I)(H.taskID,J)})}},jn=function(I){return function(R,z){var H=z||{},J=H.autoGenerateObjectIDIfNotExist,ve=i(H,["autoGenerateObjectIDIfNotExist"]),Te=J?fl.AddObject:fl.UpdateObject;if(Te===fl.UpdateObject){var me=!0,Ce=!1,Fe=void 0;try{for(var Oe,Xe=R[Symbol.iterator]();!(me=(Oe=Xe.next()).done);me=!0)if(Oe.value.objectID===void 0)return m(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(We){Ce=!0,Fe=We}finally{try{me||Xe.return==null||Xe.return()}finally{if(Ce)throw Fe}}}return Cn(I)(R,Te,ve)}},Iy=function(I){return function(R,z){return Ay(I)([R],z)}},Ay=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=H.clearExistingRules,Te=b(i(H,["forwardToReplicas","clearExistingRules"]));return J&&(Te.queryParameters.forwardToReplicas=1),ve&&(Te.queryParameters.clearExistingRules=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/rules/batch",I.indexName),data:R},Te),function(me,Ce){return en(I)(me.taskID,Ce)})}},Zpe=function(I){return function(R,z){return Dy(I)([R],z)}},Dy=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=H.clearExistingSynonyms,Te=H.replaceExistingSynonyms,me=b(i(H,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return J&&(me.queryParameters.forwardToReplicas=1),(Te||ve)&&(me.queryParameters.replaceExistingSynonyms=1),m(I.transporter.write({method:T,path:v("1/indexes/%s/synonyms/batch",I.indexName),data:R},me),function(Ce,Fe){return en(I)(Ce.taskID,Fe)})}},fB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/query",I.indexName),data:{query:R},cacheable:!0},z)}},pB=function(I){return function(R,z,H){return I.transporter.read({method:T,path:v("1/indexes/%s/facets/%s/query",I.indexName,R),data:{facetQuery:z},cacheable:!0},H)}},hB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/rules/search",I.indexName),data:{query:R}},z)}},mB=function(I){return function(R,z){return I.transporter.read({method:T,path:v("1/indexes/%s/synonyms/search",I.indexName),data:{query:R}},z)}},Jpe=function(I){return function(R,z){var H=z||{},J=H.forwardToReplicas,ve=b(i(H,["forwardToReplicas"]));return J&&(ve.queryParameters.forwardToReplicas=1),m(I.transporter.write({method:N,path:v("1/indexes/%s/settings",I.indexName),data:R},ve),function(Te,me){return en(I)(Te.taskID,me)})}},en=function(I){return function(R,z){return h(function(H){return function(J){return function(ve,Te){return J.transporter.read({method:O,path:v("1/indexes/%s/task/%s",J.indexName,ve.toString())},Te)}}(I)(R,z).then(function(J){return J.status!=="published"?H():void 0})})}},fl={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},Vy={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},Qpe=1,ehe=2,the=3,Lp=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},nhe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{fallbackParameters:{},model:"bought-together"})}),z)}},rhe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{model:"related-products"})}),z)}},ohe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"trending-facets",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},ahe=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"trending-items",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}},ihe=function(I){return function(R,z){return Lp(I)(R.map(function(H){return a(a({},H),{},{model:"looking-similar"})}),z)}},she=function(I){return function(R,z){var H=R.map(function(J){return a(a({},J),{},{model:"recommended-for-you",threshold:J.threshold||0})});return I.transporter.read({method:T,path:"1/indexes/*/recommendations",data:{requests:H},cacheable:!0},z)}};function gB(I,R,z){var H,J={appId:I,apiKey:R,timeouts:{connect:1,read:2,write:30},requester:{send:function(me){return new Promise(function(Ce){var Fe=new XMLHttpRequest;Fe.open(me.method,me.url,!0),Object.keys(me.headers).forEach(function(rt){return Fe.setRequestHeader(rt,me.headers[rt])});var Oe,Xe=function(rt,et){return setTimeout(function(){Fe.abort(),Ce({status:0,content:et,isTimedOut:!0})},1e3*rt)},We=Xe(me.connectTimeout,"Connection timeout");Fe.onreadystatechange=function(){Fe.readyState>Fe.OPENED&&Oe===void 0&&(clearTimeout(We),Oe=Xe(me.responseTimeout,"Socket timeout"))},Fe.onerror=function(){Fe.status===0&&(clearTimeout(We),clearTimeout(Oe),Ce({content:Fe.responseText||"Network request failed",status:Fe.status,isTimedOut:!1}))},Fe.onload=function(){clearTimeout(We),clearTimeout(Oe),Ce({content:Fe.responseText,status:Fe.status,isTimedOut:!1})},Fe.send(me.data)})}},logger:(H=the,{debug:function(me,Ce){return Qpe>=H&&console.debug(me,Ce),Promise.resolve()},info:function(me,Ce){return ehe>=H&&console.info(me,Ce),Promise.resolve()},error:function(me,Ce){return console.error(me,Ce),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(I)}),u()]}),userAgent:P("4.23.2").add({segment:"Browser"})},ve=a(a({},J),z),Te=function(){return function(me){return function(Ce){var Fe=Ce.region||"us",Oe=f(y.WithinHeaders,Ce.appId,Ce.apiKey),Xe=V(a(a({hosts:[{url:"personalization.".concat(Fe,".algolia.com")}]},Ce),{},{headers:a(a(a({},Oe.headers()),{"content-type":"application/json"}),Ce.headers),queryParameters:a(a({},Oe.queryParameters()),Ce.queryParameters)}));return g({appId:Ce.appId,transporter:Xe},Ce.methods)}(a(a(a({},J),me),{},{methods:{getPersonalizationStrategy:ne,setPersonalizationStrategy:oe}}))}};return function(me){var Ce=me.appId,Fe=f(me.authMode!==void 0?me.authMode:y.WithinHeaders,Ce,me.apiKey),Oe=V(a(a({hosts:[{url:"".concat(Ce,"-dsn.algolia.net"),accept:x.Read},{url:"".concat(Ce,".algolia.net"),accept:x.Write}].concat(p([{url:"".concat(Ce,"-1.algolianet.com")},{url:"".concat(Ce,"-2.algolianet.com")},{url:"".concat(Ce,"-3.algolianet.com")}]))},me),{},{headers:a(a(a({},Fe.headers()),{"content-type":"application/x-www-form-urlencoded"}),me.headers),queryParameters:a(a({},Fe.queryParameters()),me.queryParameters)}));return g({transporter:Oe,appId:Ce,addAlgoliaAgent:function(Xe,We){Oe.userAgent.add({segment:Xe,version:We})},clearCache:function(){return Promise.all([Oe.requestsCache.clear(),Oe.responsesCache.clear()]).then(function(){})}},me.methods)}(a(a({},ve),{},{methods:{search:fe,searchForFacetValues:ie,multipleBatch:De,multipleGetObjects:X,multipleQueries:fe,copyIndex:Be,copySettings:xe,copySynonyms:ge,copyRules:pe,moveIndex:Ie,listIndices:ae,getLogs:je,listClusters:he,multipleSearchForFacetValues:ie,getApiKey:Se,addApiKey:K,listApiKeys:ee,updateApiKey:Nt,deleteApiKey:Ne,restoreApiKey:Qe,assignUserID:Z,assignUserIDs:ue,getUserID:L,searchUserIDs:bt,listUserIDs:ye,getTopUserIDs:B,removeUserID:we,hasPendingMappings:Y,clearDictionaryEntries:be,deleteDictionaryEntries:Ae,getDictionarySettings:Ve,getAppTask:Re,replaceDictionaryEntries:nt,saveDictionaryEntries:ct,searchDictionaryEntries:pt,setDictionarySettings:Yt,waitAppTask:Ot,customRequest:ke,initIndex:function(me){return function(Ce){return Q(me)(Ce,{methods:{batch:Zt,delete:An,findAnswers:zt,getObject:Dn,getObjects:$t,saveObject:Wi,saveObjects:jn,search:fB,searchForFacetValues:pB,waitTask:en,setSettings:Jpe,getSettings:Ki,partialUpdateObject:Dp,partialUpdateObjects:Vp,deleteObject:So,deleteObjects:j,deleteBy:Rt,clearObjects:kn,browseObjects:Jt,getObjectPosition:Qt,findObject:En,exists:Le,saveSynonym:Zpe,saveSynonyms:Dy,getSynonym:Ap,searchSynonyms:mB,browseSynonyms:In,deleteSynonym:_e,clearSynonyms:Pt,replaceAllObjects:gr,replaceAllSynonyms:Rp,searchRules:hB,getRule:_o,deleteRule:re,saveRule:Iy,saveRules:Ay,replaceAllRules:md,browseRules:Mt,clearRules:wt}})}},initAnalytics:function(){return function(me){return function(Ce){var Fe=Ce.region||"us",Oe=f(y.WithinHeaders,Ce.appId,Ce.apiKey),Xe=V(a(a({hosts:[{url:"analytics.".concat(Fe,".algolia.com")}]},Ce),{},{headers:a(a(a({},Oe.headers()),{"content-type":"application/json"}),Ce.headers),queryParameters:a(a({},Oe.queryParameters()),Ce.queryParameters)}));return g({appId:Ce.appId,transporter:Xe},Ce.methods)}(a(a(a({},J),me),{},{methods:{addABTest:q,getABTest:te,getABTests:le,stopABTest:de,deleteABTest:G}}))}},initPersonalization:Te,initRecommendation:function(){return function(me){return ve.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),Te()(me)}},getRecommendations:Lp,getFrequentlyBoughtTogether:nhe,getLookingSimilar:ihe,getRecommendedForYou:she,getRelatedProducts:rhe,getTrendingFacets:ohe,getTrendingItems:ahe}}))}return gB.version="4.23.2",gB})})(rB);var Sfe=rB.exports;const _fe=YI(Sfe);class oB{constructor(t,n,o="https://api.pennsieve.io"){this.client=_fe(t,n),this.PENNSIEVE_API_LOCATION=o,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const n=t.map(s=>s.facetPropPath),o=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:n.concat(o)}).then(s=>(n.map(l=>{const c=t.find(m=>m.facetPropPath==l);var d=[];const u=s.facets;if(u===void 0)return;const f=u[l]==null?{}:u[l],h=c&&u[c.facetSubpropPath]?Object.keys(u[c.facetSubpropPath]):[];Object.keys(f).map(m=>{const p=h.reduce((v,y)=>{const b=y.split(".");return b.length!==2||m===b[0]&&v.push({label:b[1],id:i++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),v},[]);let g={label:m,id:i++,facetPropPath:l};p.length>0&&(g.children=p),d.push(g)}),d.length>0&&a.push({label:c?c.label:"",id:i++,children:d,key:l})}),a))}_discoverAllDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{fetch(`${n}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{o(a.map(i=>i.doi))})})}_expandDois(t,n="https://api.pennsieve.io"){return new Promise(o=>{let a=t.map(i=>this._discoverAllDois(i,n));Promise.all(a).then(i=>{o(i.flat())})})}_processResultsForCards(t){let n=[],o={};for(let a of t)o={...a},o={anatomy:a.anatomy?a.anatomy.organ.map(i=>i.curie):void 0,doi:a.item.curie.split(":")[1],name:a.item.name,description:a.item.description,updated:a.pennsieve?a.pennsieve.updatedAt:void 0,publishDate:a.pennsieve?a.pennsieve.publishDate:void 0,datasetId:a.objectID,detailsReady:!1},n.push(o);return n}_processAnatomy(t){let n=[],o=[],a=[],i=[];return t.forEach(s=>{s.item&&s.item.keywords&&s.item.keywords.forEach(l=>{let c=l.keyword.toUpperCase();(c.includes("UBERON")||c.includes("ILX"))&&n.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(n.push(l.curie),o.push(l.name))})}),i=[...new Set(n)],a=[...new Set(o)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,n="",o=10,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]}).then(s=>{let l={items:this._processResultsForCards(s.hits),total:s.nbHits,discoverIds:s.hits.map(c=>c.pennsieve?c.pennsieve.identifier:c.objectID),dois:s.hits.map(c=>c.item.curie.split(":")[1])};i(l)})})}anatomyInSearch(t,n="",o=999999,a=1){return new Promise(i=>{this.index.search(n,{facets:["*"],hitsPerPage:o,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}processResultsForFlatmap(t){return t.map(o=>({id:o.objectID,terms:o.anatomy?o.anatomy.organ.map(a=>a.curie):[]}))}processResultsForScaffold(t){let n={};return t.forEach(o=>{o.anatomy&&o.anatomy.organ&&o.anatomy.organ.forEach(a=>{a.name&&(n[a.name]?n[a.name]++:n[a.name]=1)})}),n}}const $y=[{label:"Data Type",id:"item.types",facetPropPath:"item.types.name",facetSubpropPath:"item.types.subcategory.name"},{label:"Anatomical Structure",id:"anatomy.organ.category",facetPropPath:"anatomy.organ.category.name",facetSubpropPath:"anatomy.organ.subcategory.name",facetFilterPath:"anatomy.organ.name"},{label:"Species",id:"organisms.primary.species",facetPropPath:"organisms.primary.species.name",facetSubpropPath:"organisms.primary.species.subcategory.name"},{label:"Experimental Approach",id:"item.modalities",facetPropPath:"item.modalities.keyword",facetSubpropPath:"item.modalities.subcategory.name"},{label:"Sex",id:"attributes.subject.sex",facetPropPath:"attributes.subject.sex.value",facetSubpropPath:"attributes.subject.sex.subcategory.name"},{label:"Age Categories",id:"attributes.subject.ageCategory",facetPropPath:"attributes.subject.ageCategory.value",facetSubpropPath:"attributes.subject.ageCategory.subcategory.name"}];function aB(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=Bfe(e),n="NOT item.published.status:embargo";return n=`(${n}) AND `,$y.map(a=>a.facetPropPath).map(a=>{let i=t.filter(c=>c.facetPropPath==a),s="",l="";i.map(c=>{let d=c.facetSubPropPath?c.facetSubPropPath:a;c.AND?l+=`AND "${d}":"${c.label}"`:s+=`"${d}":"${c.label}" OR `}),!(s==""&&l=="")&&(s=`(${s.substring(0,s.lastIndexOf(" OR "))})`,n+=`${s+l} AND `,n=n.split("()AND ").join(""))}),n.substring(0,n.lastIndexOf(" AND "))}function Bfe(e){return e.filter(t=>t.label!=="Show all")}const Ip=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Fy=function(e){const t=e.toLowerCase();return Qu[t]?Ip(Qu[t]):Ip(t)},Tfe={name:"SearchFilters",components:{MapSvgIcon:gfe,MapSvgSpriteColor:Efe,Option:em,Select:ou,Popover:au,Cascader:e2},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{algoliaClient:void 0,cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFilters:!0,showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],props:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[]}},setup(){const e=r.markRaw({}),t=r.markRaw({term:new Set,facet:new Set,facet2:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`}},methods:{createCascaderItemValue:function(e,t=void 0,n=void 0){let o=e;return t&&(o=`${e}>${t}`),t&&n&&(o=`${e}>${t}>${n}`),!t&&n&&console.warn(`Warning: ${n} provided without its parent, this will not be shown in the cascader`),o},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets($y).then(t=>{this.facets=t,Wt.emit("available-facets",t),this.options=t,this.options.forEach((n,o)=>{this.options[o].total=this.countTotalFacet(n),this.options[o].label=Fy(n.label),this.options[o].value=this.createCascaderItemValue(n.key,void 0),this.options[o].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[o].children.forEach((a,i)=>{this.options[o].children[i].label=Fy(a.label),this.options[o].children[i].value=this.createCascaderItemValue(n.label,a.label),this.options[o].children[i].children&&this.options[o].children[i].children.length>0&&this.options[o].children[i].children.forEach((s,l)=>{this.options[o].children[i].children[l].label=Fy(s.label),this.options[o].children[i].children[l].value=this.createCascaderItemValue(n.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(n=>{const o=n[0],a=n[1],i=this.options.filter(l=>l.label==o)[0],s=i.key;for(let l=0;l<i.children.length;l++){const c=i.children[l],d=c.label,u=c.value;if(Array.isArray(a))if(a.length===0&&d.toLowerCase()==="show all"){t.push([s,u]);break}else d!==e&&a.includes(d)&&t.push([s,u]);else Object.entries(a).map(f=>{const h=f[0],m=f[1];h===d&&c.children.map(p=>{const g=p.label,v=p.value;g!==e&&m.includes(g)&&t.push([s,v])})})}}),this.cascadeEvent(t)},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.options.map(t=>{this.correctnessCheck.term.add(t.label),t.children.map(n=>{this.correctnessCheck.facet.add(n.label),t.label==="Anatomical structure"&&n.label!=="Show all"&&n.children.map(o=>{this.correctnessCheck.facet2.add(o.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:n,facet2:o,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(n)&&(o?this.correctnessCheck.facet2.has(o)&&(a in this.cascaderTags?n in this.cascaderTags[a]?this.cascaderTags[a][n].push(o):this.cascaderTags[a][n]=[o]:(this.cascaderTags[a]={},this.cascaderTags[a][n]=[o])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(n):n.toLowerCase()!=="show all"?this.cascaderTags[a]=[n]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const n=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...n]}),this.presentTags=[...new Set(this.presentTags)],this.presentTags.length>0?this.showFiltersText=!1:this.showFiltersText=!0},countTotalFacet:function(e){return["anatomy.organ.category.name"].includes(e.key)?e.children.reduce((n,o)=>(n=typeof n=="number"?n:n.children.length,n+o.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(n=>{const o=n[0];o in t?t[o]+=1:t[o]=1}),this.options.map(n=>{const o=n.key,a=n.children.filter(s=>s.label==="Show all")[0].value,i=n.total;t[o]===i&&(e=e.filter(s=>s[0]!==n.key),delete t[o]),o in t||e.unshift([o,a])}),e},cascadeEvent:function(e){let t=[...e];if(t){if(t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t),this.__expandItem__){let i=0;this.__expandItem__.length>1&&(i=1);const s=t.filter(c=>c[i]==this.__expandItem__[i]),l=t.filter(c=>c[i]!==this.__expandItem__[i]);t=[...s,...l]}let n=t.filter(i=>i!==void 0).map(i=>{let{hString:s,bString:l}=this.findHierarachyStringAndBooleanString(i),{facet:c,facet2:d,term:u}=this.getFacetsFromHierarchyString(s);return{facetPropPath:i[0],facet:c,facet2:d,term:u,AND:l}}),o=t.filter(i=>i!==void 0).map(i=>{let s,l=i[0].includes("duplicate")?i[0].split("duplicate")[0]:i[0],{hString:c,bString:d}=this.findHierarachyStringAndBooleanString(i),{facet:u,facet2:f,term:h}=this.getFacetsFromHierarchyString(c);return f&&(u=f,s="anatomy.organ.name"),{facetPropPath:l,facet:u,term:h,AND:d,facetSubPropPath:s}});o.filter(i=>i.facet!=="Show all").length||(o=[]),this.$emit("loading",!0),this.$emit("filterResults",o),this.setCascader(n),this.cssMods()}},findHierarachyStringAndBooleanString(e){let t,n;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],n=e.length==4?e[3]:void 0):(t=e[1],n=e[2]):(t=e[1],n=void 0),{hString:t,bString:n}},getFacetsFromHierarchyString(e){let t,n,o,a=e.split(">");return a.length==3?(o=a[2],t=a[1],n=a[0]):(t=a[1],n=a[0]),{facet:t,facet2:o,term:n}},showAllEventModifier:function(e){if(e.map(n=>n?n[1].toLowerCase().includes("show all"):!1).includes(!0)){let n=[],o={};for(const a in e)o[e[a][0]]===void 0&&(o[e[a][0]]=[]),o[e[a][0]].push(e[a]);for(const a in o){let i;for(let s=o[a].length-1;s>=0;s--)if(o[a][s][1].toLowerCase().includes("show all")){i=o[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&o[a].length>0?n.push(...o[a]):n.push(i):n.push(...o[a])}return n.sort((a,i)=>this.__expandItem__?a[0]==this.__expandItem__?i[0]==this.__expandItem__?0:-1:i[0]==this.__expandItem__?a[0]==this.__expandItem__?0:1:0:0)}return e},cascadeExpandChange:function(e){this.__expandItem__=e,this.cssMods()},numberShownChanged:function(e){this.$emit("numberPerPage",parseInt(e))},updatePreviousShowAllChecked:function(e){for(const t in this.previousShowAllChecked)this.previousShowAllChecked[t]=!1;e.forEach(t=>{t[1].toLowerCase().includes("show all")&&(this.previousShowAllChecked[t[0]]=!0)})},setCascader:function(e){if(this.cascaderIsReady&&e&&e.length!=0){const t=n=>{let o=[n.facetPropPath,this.createCascaderItemValue(Ip(n.term),n.facet)];return n.facet2&&o.push(this.createCascaderItemValue(Ip(n.term),n.facet,n.facet2)),o};this.cascadeSelected=e.map(n=>t(n)),this.cascadeSelectedWithBoolean=e.map(n=>{let o=t(n);return o.push(n.AND),o}),this.updatePreviousShowAllChecked(this.cascadeSelected)}this.tagsChangedCallback(e)},addFilter:function(e){if(this.cascaderIsReady&&e){let t=this.validateAndConvertFilterToHierarchical(e);if(t)return this.cascadeSelected.filter(n=>n.term!=t.term),this.cascadeSelected.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2)]),this.cascadeSelectedWithBoolean.push([t.facetPropPath,this.createCascaderItemValue(t.term,t.facet),this.createCascaderItemValue(t.term,t.facet,t.facet2),t.AND]),!0}},initiateSearch:function(){this.cascadeEvent(this.cascadeSelectedWithBoolean)},checkShowAllBoxes:function(){this.setCascader(this.options.map(e=>({facetPropPath:e.value,term:e.label,facet:"Show all"})))},makeCascadeLabelsClickable:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-node__label").forEach(e=>{e.onclick=function(){const t=this.previousElementSibling;t&&(t.parentElement.attributes["aria-owns"]||this.previousElementSibling.click())}})})},cssMods:function(){this.makeCascadeLabelsClickable(),this.removeTopLevelCascaderCheckboxes()},removeTopLevelCascaderCheckboxes:function(){this.$nextTick(()=>{document.querySelectorAll(".sidebar-cascader-popper .el-cascader-menu__list")[0].querySelectorAll(".el-checkbox__input").forEach(t=>t.style.display="none")})},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2)return e;for(const t of this.options)if(t.value===e.facetPropPath)for(const n of t.children){if(n.label===e.facet)return e;if(n.children&&n.children.length>0){for(const o of n.children)if(o.label===e.facet)return e.facet2=o.label,e.facet=n.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(n=>{const o=this.validateAndConvertFilterToHierarchical(n);o&&t.push(o)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=r.markRaw(new oB(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},Nfe=e=>(r.pushScopeId("data-v-5ba40cae"),e=e(),r.popScopeId(),e),Ofe={class:"filters"},Pfe={key:0,class:"cascader-tag"},$fe={class:"el-tags-container"},Ffe={class:"el-tags-container"},Ife={class:"search-filters transition-box"},Afe={key:0,class:"filter-default-value"},Dfe=Nfe(()=>r.createElementVNode("div",null,[r.createElementVNode("strong",null,"Within categories:"),r.createTextVNode(" OR "),r.createElementVNode("br"),r.createTextVNode(" example: 'heart' OR 'colon' "),r.createElementVNode("br"),r.createElementVNode("br"),r.createElementVNode("strong",null,"Between categories:"),r.createTextVNode(" AND "),r.createElementVNode("br"),r.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),Vfe={class:"dataset-shown"},Rfe={class:"dataset-results-feedback"};function Lfe(e,t,n,o,a,i){const s=r.resolveComponent("MapSvgSpriteColor"),l=ls,c=au,d=e2,u=r.resolveComponent("MapSvgIcon"),f=em,h=ou,m=lu;return r.openBlock(),r.createElementBlock("div",Ofe,[r.createVNode(s),e.presentTags.length>0?(r.openBlock(),r.createElementBlock("div",Pfe,[r.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=p=>i.cascadeTagClose(e.presentTags[0]))},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(r.openBlock(),r.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover"},{default:r.withCtx(()=>[r.createElementVNode("div",$fe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.presentTags.slice(1),(p,g)=>(r.openBlock(),r.createBlock(l,{key:g,class:"ml-2",type:"info",closable:"",onClose:v=>i.cascadeTagClose(p)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(p),1)]),_:2},1032,["onClose"]))),128))])]),reference:r.withCtx(()=>[r.createElementVNode("div",Ffe,[e.presentTags.length>1?(r.openBlock(),r.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:r.withCtx(()=>[r.createTextVNode(" +"+r.toDisplayString(e.presentTags.length-1),1)]),_:1})):r.createCommentVNode("",!0)])]),_:1})):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"el-zoom-in-top"},{default:r.withCtx(()=>[r.withDirectives((r.openBlock(),r.createElementBlock("span",Ife,[r.createVNode(d,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=p=>e.cascadeSelected=p),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=p=>i.cascadeEvent(p)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(r.openBlock(),r.createElementBlock("div",Afe,"Filters")):r.createCommentVNode("",!0),r.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","append-to-body":!1,"popper-class":"popover"},{reference:r.withCtx(()=>[r.createVNode(u,{icon:"help",class:"help"})]),default:r.withCtx(()=>[Dfe]),_:1})])),[[r.vShow,e.showFilters],[m,!e.cascaderIsReady]])]),_:1}),r.createElementVNode("div",Vfe,[r.createElementVNode("span",Rfe,r.toDisplayString(i.numberOfResultsText),1),r.createVNode(h,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=p=>e.numberShown=p),placeholder:"10",onChange:t[4]||(t[4]=p=>i.numberShownChanged(p))},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.numberDatasetsShown,p=>(r.openBlock(),r.createBlock(f,{key:p,label:p,value:p},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const iB=jr(Tfe,[["render",Lfe],["__scopeId","data-v-5ba40cae"]]);var Mfe=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},zfe={filters:[],searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const jfe={components:{SearchFilters:iB,DatasetCard:y4,SearchHistory:w4,Button:Sn,Card:Lb,Drawer:Xh,Icon:mt,Input:Wd,Pagination:k2},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>zfe},envVars:{type:Object,default:()=>{}}},data:function(){return{...this.entry,algoliaClient:void 0,bodyStyle:{flex:"1 1 auto","flex-flow":"column",display:"flex"},cascaderIsReady:!1}},computed:{filterEntry:function(){return{numberOfHits:this.numberOfHits,filterFacets:this.filter}}},methods:{hoverChanged:function(e){this.$emit("hover-changed",e)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t="",n={withSearch:!0}){this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady?(this.filter=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(n.withSearch&&this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&n.withSearch&&this.searchAlgolia(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilter(e)&&this.$refs.filtersRef.initiateSearch()):Array.isArray(this.filter)?this.filter.push(e):this.filter=[e]},cascaderReady:function(){this.cascaderIsReady=!0,this.openSearch(this.filter,this.searchInput)},clearSearchClicked:function(){this.searchInput="",this.searchAndFilterUpdate()},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.searchInput=this.searchInput.trim(),this.searchAndFilterUpdate())},filterUpdate:function(e){this.filters=[...e],this.searchAndFilterUpdate(),this.$emit("search-changed",{value:e,type:"filter-update"})},transformFiltersBeforeSearch:function(e){return e.map(t=>(t.facet2&&(t.facet=t.facet2,delete t.facet2),t))},searchAndFilterUpdate:function(){var t;this.resetPageNavigation();const e=this.transformFiltersBeforeSearch(this.filters);this.searchAlgolia(e,this.searchInput),this.$refs.searchHistory.selectValue="Search history",(this.filters.length||(t=this.searchInput)!=null&&t.trim())&&this.$refs.searchHistory.addSearchToHistory(this.filters,this.searchInput)},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch(aB(e),t).then(n=>{Wt.emit("anatomy-in-datasets",n.forFlatmap),Wt.emit("number-of-datasets-for-anatomies",n.forScaffold)}),this.algoliaClient.search(aB(e),t,this.numberPerPage,this.page).then(n=>{this.numberOfHits=n.total,this.discoverIds=n.discoverIds,this._dois=n.dois,this.results=n.items,this.loadingCards=!1,this.scrollToTop(),this.$emit("search-changed",{value:this.searchInput,type:"query-update"}),this._abortController&&this._abortController.abort(),this._abortController=new AbortController;const o=this._abortController.signal;this.perItemSearch(o,{count:0})})},filtersLoading:function(e){this.loadingCards=e},numberPerPageUpdate:function(e){this.numberPerPage=e,this.pageChange(1)},pageChange:function(e){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filters,this.searchInput,this.numberPerPage,this.page)},handleMissingData:function(e){let t=this.results.findIndex(n=>n.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const o=this._dois.shift();o&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[o]},e).then(a=>{a.numberOfHits===0?this.handleMissingData(o):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.name!=="AbortError"&&(this.handleMissingData(o),t.count--,this.perItemSearch(e,t))}),this.perItemSearch(e,t))}},scrollToTop:function(){this.$refs.content&&this.$refs.content.scroll({top:0,behavior:"smooth"})},resetPageNavigation:function(){this.start=0,this.page=1},resultsProcessing:function(e){this.lastSearch=this.searchInput,e.results.length!==0&&e.results.forEach(t=>{let n=this.results.findIndex(o=>t.doi?t.doi.includes(o.doi):!1);Object.assign(this.results[n],t),Object.assign(this.results[n],{numberSamples:t.sampleSize?parseInt(t.sampleSize):0,numberSubjects:t.subjectSize?parseInt(t.subjectSize):0,updated:(t.updated&&t.updated.length)>0?t.updated[0].timestamp.split("T")[0]:"",url:t.uri[0],datasetId:t.dataset_identifier,datasetRevision:t.dataset_revision,datasetVersion:t.dataset_version,organs:t.organs&&t.organs.length>0?[...new Set(t.organs.map(o=>o.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(o=>o.species?o.species.name:null))]:void 0,scaffolds:t["abi-scaffold-metadata-file"],thumbnails:t["abi-thumbnail"]?t["abi-thumbnail"]:t["abi-scaffold-thumbnail"],scaffoldViews:t["abi-scaffold-view-file"],videos:t.video,plots:t["abi-plot"],images:t["common-images"],contextualInformation:t["abi-contextual-information"].length>0?t["abi-contextual-information"]:void 0,segmentation:t["mbf-segmentation"],simulation:t["abi-simulation-file"],additionalLinks:t.additionalLinks,detailsReady:!0}),this.results[n]=this.results[n]})},createfilterParams:function(e){let t=new URLSearchParams;for(const n in e)Array.isArray(e[n])?e[n].forEach(o=>{t.append(n,o)}):t.append(n,e[n]);return t.toString()},callSciCrunch:function(e,t={},n){return new Promise((o,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:n}).then(Mfe).then(s=>s.json()).then(s=>o(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets($y)},searchHistorySearch:function(e){this.searchInput=e.search,this.filters=e.filters,this.searchAndFilterUpdate(),this.openSearch([...e.filters],e.search,{withSearch:!1})}},mounted:function(){this.algoliaClient=r.markRaw(new oB(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.openSearch(this.filter,this.searchInput)},created:function(){this.searchEndpoint="dataset_info/using_multiple_dois/"}},Hfe={class:"header"},Ufe={class:"content scrollbar",ref:"content"},qfe={key:0,class:"error-feedback"};function Kfe(e,t,n,o,a,i){const s=Wd,l=Sn,c=iB,d=w4,u=y4,f=k2,h=Lb,m=lu;return r.openBlock(),r.createBlock(h,{"body-style":e.bodyStyle,class:"content-card"},{header:r.withCtx(()=>[r.createElementVNode("div",Hfe,[r.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=p=>e.searchInput=p),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),r.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:r.withCtx(()=>[r.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:r.withCtx(()=>[r.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:n.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),r.createVNode(d,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),r.withDirectives((r.openBlock(),r.createElementBlock("div",Ufe,[e.results.length===0&&!e.loadingCards?(r.openBlock(),r.createElementBlock("div",qfe," No results found - Please change your search / filter criteria. ")):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.results,p=>(r.openBlock(),r.createElementBlock("div",{key:p.doi,class:"step-item"},[r.createVNode(u,{class:"dataset-card",entry:p,envVars:n.envVars,onMouseenter:g=>i.hoverChanged(p),onMouseleave:t[1]||(t[1]=g=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),r.createVNode(f,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=p=>e.page=p),"hide-on-single-page":"",large:"",layout:"prev, pager, next","page-size":e.numberPerPage,total:e.numberOfHits,onCurrentChange:i.pageChange},null,8,["current-page","page-size","total","onCurrentChange"])])),[[m,e.loadingCards]])]),_:1},8,["body-style"])}const sB=jr(jfe,[["render",Kfe],["__scopeId","data-v-d3c8c59e"]]),Wfe={name:"AnnotationTool",components:{AnnotationPopup:gre,Button:Sn,CreateTooltipContent:xre,Col:r2,ElIconDelete:vh,Icon:mt,Row:n2},props:{annotationEntry:{type:Object},createData:{type:Object,default:{}}},data:function(){return{ElIconDelete:r.shallowRef(vh)}}},Gfe={class:"annotation-tool scrollbar"},Xfe={key:1,class:"delete-container"};function Yfe(e,t,n,o,a,i){const s=r.resolveComponent("CreateTooltipContent"),l=r.resolveComponent("annotation-popup"),c=r2,d=Sn,u=n2;return r.openBlock(),r.createElementBlock("div",Gfe,[r.withDirectives(r.createVNode(s,{createData:n.createData,onConfirmCreate:t[0]||(t[0]=f=>e.$emit("confirm-create",f)),onCancelCreate:t[1]||(t[1]=f=>e.$emit("cancel-create")),class:"create-tooltip-content"},null,8,["createData"]),[[r.vShow,n.createData&&n.createData.toBeConfirmed]]),n.annotationEntry&&(!n.createData||!n.createData.toBeConfirmed)?(r.openBlock(),r.createBlock(l,{key:0,class:"annotation-popup",annotationEntry:n.annotationEntry,onAnnotation:t[2]||(t[2]=f=>e.$emit("annotation",f))},null,8,["annotationEntry"])):r.createCommentVNode("",!0),n.createData&&n.createData.toBeDeleted?(r.openBlock(),r.createElementBlock("div",Xfe,[r.createVNode(u,null,{default:r.withCtx(()=>[r.createVNode(c,{offset:1,span:6},{default:r.withCtx(()=>[r.createTextVNode("Delete this feature?")]),_:1}),r.createVNode(c,{offset:1,span:3},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",icon:e.ElIconDelete,onClick:t[3]||(t[3]=f=>e.$emit("confirm-delete"))},{default:r.withCtx(()=>[r.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),r.createVNode(c,{offset:1,span:2},{default:r.withCtx(()=>[r.createVNode(d,{class:"delete-button",onClick:t[4]||(t[4]=f=>e.$emit("cancel-create"))},{default:r.withCtx(()=>[r.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):r.createCommentVNode("",!0)])}const lB=jr(Wfe,[["render",Yfe],["__scopeId","data-v-de83d649"]]),Zfe={name:"ExternalResourceCard",components:{Button:Sn},props:{resources:{type:Array,default:()=>[]}},data:function(){return{pubmeds:[],pubmedIds:[],ElIconNotebook:r.shallowRef(bP)}},methods:{capitalise:function(e){return e.charAt(0).toUpperCase()+e.slice(1)},openUrl:function(e){Wt.emit("open-pubmed-url",e),window.open(e,"_blank")}}},Jfe={class:"resource-container"};function Qfe(e,t,n,o,a,i){const s=Sn;return r.openBlock(),r.createElementBlock("div",Jfe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.resources,l=>(r.openBlock(),r.createElementBlock("div",{key:l.id,class:"resource"},[l.id==="pubmed"?(r.openBlock(),r.createBlock(s,{key:0,class:"button",id:"open-pubmed-button",icon:e.ElIconNotebook,onClick:c=>i.openUrl(l.url)},{default:r.withCtx(()=>[r.createTextVNode(" Open publications in PubMed ")]),_:2},1032,["icon","onClick"])):r.createCommentVNode("",!0)]))),128))])}const cB=jr(Zfe,[["render",Qfe],["__scopeId","data-v-e726c314"]]),epe=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),hd=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},tpe=3e3,npe={name:"ConnectivityInfo",components:{Button:Sn,Container:vD,Icon:mt,ElIconArrowUp:tP,ElIconArrowDown:Sl,ElIconWarning:gv,ExternalResourceCard:cB,CopyToClipboard:I_,ConnectivityGraph:Tue},props:{entry:{type:Object,default:()=>({destinations:[],origins:[],components:[],destinationsWithDatasets:[],originsWithDatasets:[],componentsWithDatasets:[],resource:void 0,featuresAlert:void 0})},envVars:{type:Object,default:()=>{}},availableAnatomyFacets:{type:Array,default:()=>[]}},data:function(){return{controller:void 0,activeSpecies:void 0,pubmedSearchUrl:"",loading:!1,activeView:"listView",facetList:[],showToolip:!1,showDetails:!1,originDescriptions:{motor:"is the location of the initial cell body of the circuit",sensory:"is the location of the initial cell body in the PNS circuit"},componentsWithDatasets:[],uberons:[{id:void 0,name:void 0}],connectivityError:null,timeoutID:void 0}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{updatedCopyContent:function(){return this.getUpdateCopyContent()},resources:function(){let e=[];return this.entry&&this.entry.hyperlinks&&(e=this.entry.hyperlinks),e},originDescription:function(){return this.entry&&this.entry.title&&this.entry.title.toLowerCase().includes("motor")?this.originDescriptions.motor:this.originDescriptions.sensory},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e}},methods:{titleCase:function(e){return epe(e)},capitalise:function(e){return hd(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.destinationsWithDatasets.map(e=>e.name.toLowerCase())})},shouldShowExploreButton:function(e){for(let t=0;t<e.length;t++)if(this.facetList.includes(e[t].name.toLowerCase()))return!0;return!1},convertFacetsToList:function(e){e.forEach(t=>{t.children?this.convertFacetsToList(t.children):this.facetList.push(t.label.toLowerCase())})},openDendrites:function(){Wt.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.originsWithDatasets.map(e=>e.name.toLowerCase())})},pubmedSearchUrlUpdate:function(e){this.pubmedSearchUrl=e},showConnectivity:function(e){const t=e.featureId||[];this.$emit("show-connectivity",t)},switchConnectivityView:function(e){if(this.activeView=e,e==="graphView"){const t=this.$refs.connectivityGraphRef;t&&t.$el&&t.$el.scrollIntoView({behavior:"smooth"})}},onTapNode:function(e){const t=e.map(n=>n.label).join(", ");this.toggleConnectivityTooltip(t,{show:!0})},getUpdateCopyContent:function(){var n,o,a,i,s;if(!this.entry)return"";const e=[];if(this.entry.title?e.push(`<div><strong>${hd(this.entry.title)}</strong></div>`):e.push(`<div><strong>${this.entry.featureId}</strong></div>`),(n=this.entry.provenanceTaxonomyLabel)!=null&&n.length&&e.push(`<div>${this.provSpeciesDescription}</div>`),(o=this.resources)!=null&&o.length){const l=[];this.resources.forEach(c=>{let d="";c.id==="pubmed"&&(d+="<div><strong>PubMed URL:</strong></div>",d+=`
|
|
922
922
|
`,d+=`<div><a href="${c.url}">${c.url}</a></div>`),l.push(d)}),e.push(l.join(`
|
|
923
923
|
|
|
924
924
|
<br>`))}this.entry.paths&&e.push(`<div>${this.entry.paths}</div>`);function t(l,c,d=[]){let u=`<div><strong>${l}</strong></div>`;const f=[];c.forEach(m=>{let p=[];m.split(",").forEach(g=>{const v=d.find(y=>y.name===g.trim());v?p.push(`${hd(g)} (${v.id})`):p.push(`${hd(g)}`)}),f.push(p.join(","))});const h=f.map(m=>`<li>${m}</li>`).join(`
|