@abi-software/map-side-bar 2.6.3-beta.1 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/map-side-bar.js
CHANGED
|
@@ -19909,7 +19909,7 @@ const u9 = {
|
|
|
19909
19909
|
this.searchHistory.splice(t, 1), this.savedSearchHistory = this.searchHistory.filter((n) => n.saved), this.updateSearchHistory();
|
|
19910
19910
|
}
|
|
19911
19911
|
}
|
|
19912
|
-
}, qi = (e) => (lo("data-v-
|
|
19912
|
+
}, qi = (e) => (lo("data-v-667b56a8"), e = e(), co(), e), d9 = {
|
|
19913
19913
|
key: 0,
|
|
19914
19914
|
class: "history-container"
|
|
19915
19915
|
}, f9 = {
|
|
@@ -20086,7 +20086,7 @@ function I9(e, t, n, r, o, a) {
|
|
|
20086
20086
|
})
|
|
20087
20087
|
])) : W("", !0);
|
|
20088
20088
|
}
|
|
20089
|
-
const bm = /* @__PURE__ */ er(u9, [["render", I9], ["__scopeId", "data-v-
|
|
20089
|
+
const bm = /* @__PURE__ */ er(u9, [["render", I9], ["__scopeId", "data-v-667b56a8"]]), wm = (e, t) => {
|
|
20090
20090
|
const n = e.__vccOpts || e;
|
|
20091
20091
|
for (const [r, o] of t)
|
|
20092
20092
|
n[r] = o;
|
|
@@ -22331,10 +22331,10 @@ const ri = function(e) {
|
|
|
22331
22331
|
this.envVars.ALGOLIA_KEY,
|
|
22332
22332
|
this.envVars.PENNSIEVE_API_LOCATION
|
|
22333
22333
|
)), this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX), this.populateCascader().then(() => {
|
|
22334
|
-
this.cascaderIsReady = !0, this.checkShowAllBoxes(), this.setCascader(this.entry.filterFacets), this.cssMods(), this.$emit("cascaderReady")
|
|
22334
|
+
this.cascaderIsReady = !0, this.checkShowAllBoxes(), this.setCascader(this.entry.filterFacets), this.cssMods(), this.$emit("cascaderReady");
|
|
22335
22335
|
});
|
|
22336
22336
|
}
|
|
22337
|
-
}, K9 = (e) => (lo("data-v-
|
|
22337
|
+
}, K9 = (e) => (lo("data-v-4088113a"), e = e(), co(), e), W9 = { class: "filters" }, G9 = {
|
|
22338
22338
|
key: 0,
|
|
22339
22339
|
class: "cascader-tag"
|
|
22340
22340
|
}, J9 = { class: "el-tags-container" }, Z9 = { class: "el-tags-container" }, Y9 = { class: "search-filters transition-box" }, X9 = {
|
|
@@ -22473,7 +22473,7 @@ function nL(e, t, n, r, o, a) {
|
|
|
22473
22473
|
])
|
|
22474
22474
|
]);
|
|
22475
22475
|
}
|
|
22476
|
-
const oy = /* @__PURE__ */ er(q9, [["render", nL], ["__scopeId", "data-v-
|
|
22476
|
+
const oy = /* @__PURE__ */ er(q9, [["render", nL], ["__scopeId", "data-v-4088113a"]]);
|
|
22477
22477
|
var rL = async function(e) {
|
|
22478
22478
|
if (!e.ok) {
|
|
22479
22479
|
let t = await e.json();
|
|
@@ -50,7 +50,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,curr
|
|
|
50
50
|
`,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+=`
|
|
51
51
|
`,t+=`${this.version}`,e.push(`<div>${t}</div>`)}this.copyContent=e.join(`
|
|
52
52
|
|
|
53
|
-
<br>`)}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},ZA=e=>(n.pushScopeId("data-v-541a51e6"),e=e(),n.popScopeId(),e),YA={class:"dataset-card-container",ref:"container"},XA={class:"dataset-card",ref:"card"},QA=ZA(()=>n.createElementVNode("div",{class:"seperator-path"},null,-1)),eF={class:"card"},tF={class:"card-left"},nF={class:"card-right"},oF={class:"details"},rF={class:"details"},aF={key:0,class:"details loading-icon"},iF={class:"badges-container"},sF={class:"float-button-container"};function lF(e,t,o,r,a,i){const s=t0,l=ht,c=Hp,d=n.resolveComponent("CopyToClipboard"),u=oi;return n.openBlock(),n.createElementBlock("div",YA,[n.createElementVNode("div",XA,[QA,n.withDirectives((n.openBlock(),n.createElementBlock("div",eF,[n.createElementVNode("span",tF,[!e.loading&&e.discoverId?(n.openBlock(),n.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:o.entry,envVars:o.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"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",nF,[n.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...p)=>i.cardClicked&&i.cardClicked(...p))},n.toDisplayString(o.entry.name),1),n.createElementVNode("div",oF,n.toDisplayString(i.contributors)+" "+n.toDisplayString(o.entry.publishDate?`(${i.publishYear})`:""),1),n.createElementVNode("div",rF,n.toDisplayString(i.samples),1),o.entry.detailsReady?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createElementBlock("div",aF,null,512)),[[u,!o.entry.detailsReady]]),n.createElementVNode("div",null,[o.entry.simulation?(n.openBlock(),n.createBlock(l,{key:0,onClick:i.openRepository,size:"small",class:"button",icon:a.ElIconView},{default:n.withCtx(()=>[n.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",iF,[n.createVNode(c,{entry:o.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:i.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])]),n.createElementVNode("div",sF,[n.createVNode(d,{content:e.copyContent},null,8,["content"])])])])),[[u,e.loading]])],512)],512)}const o0=bn(JA,[["render",lF],["__scopeId","data-v-541a51e6"]]),r0=12;function a0(){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(o=>o.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 cF={name:"SearchHistory",components:{Tag:Uo,Select:Qa},data(){return{searchHistory:[],savedSearchHistory:[]}},mounted:function(){this.getSearchHistory(),Ge.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(r=>{let a=r.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 r.search===t&&s===l})){const{label:r,longLabel:a}=this.searchHistoryItemLabel(t,e),i={filters:e,search:t,saved:!1,label:r,longLabel:a,id:a0(),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(o=>{const r=`${o.search}-${JSON.stringify(o.filters)}`,a=e.find(i=>i.key===r);a?o.saved?t.push(a.id):t.push(o.id):e.push({id:o.id,key:r})}),t.length&&(this.searchHistory=this.searchHistory.filter(o=>!t.includes(o.id)))},trimSearchHistory:function(){if(this.searchHistory.length>r0){const e=this.searchHistory.filter(r=>r.saved),t=this.searchHistory.filter(r=>!r.saved),o=r0-this.searchHistory.length;this.searchHistory=[...e,...t.slice(0,o)]}},updateSearchHistory:function(){this.searchHistory.forEach(e=>{if(e.id||(e.id=a0()),!e.label){const{label:t,longLabel:o}=this.searchHistoryItemLabel(e.search,e.filters);e.label=t,e.longLabel=o}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 o=e?`"${e.trim()}"`:"",r="",a=[],i=[];return t&&(a=t.filter(s=>s.facet!=="Show all"),i=a.map(s=>s.facet2||s.facet)),o&&a.length&&(r+=o,r+=`, ${i.join(", ")}`,o+=` (+${a.length})`),!o&&a.length&&(o=a[0].facet,a.length>1&&(r+=`${i.join(", ")}`,o+=` (+${a.length-1})`)),o?o.length>15&&!r&&(r=o):o="Unknown search",{label:o,longLabel:r}},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(o=>o.id===e.id);this.searchHistory.splice(t,1),this.savedSearchHistory=this.searchHistory.filter(o=>o.saved),this.updateSearchHistory()}}},Ji=e=>(n.pushScopeId("data-v-96b7c9f3"),e=e(),n.popScopeId(),e),dF={key:0,class:"history-container"},uF={key:0,class:"saved-search-history"},fF={key:1},pF=[Ji(()=>n.createElementVNode("span",{class:"empty-saved-search"},"No Saved Searches",-1))],hF={class:"el-dropdown-select"},mF=["onClick"],gF=["onClick"],yF={key:0,viewBox:"0 0 24 24"},bF=[Ji(()=>n.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))],wF={key:1,viewBox:"0 0 24 24"},CF=[Ji(()=>n.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))],kF={key:0},vF={key:1},SF={key:2},EF=Ji(()=>n.createElementVNode("span",null," Remove from search history. ",-1));function _F(e,t,o,r,a,i){const s=ei,l=Uo,c=Cr,d=Se,u=ht,p=Fs,y=s3,m=l3,f=i3;return a.searchHistory.length?(n.openBlock(),n.createElementBlock("div",dF,[a.savedSearchHistory.length?(n.openBlock(),n.createElementBlock("div",uF,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.savedSearchHistory,(h,g)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:h.id},[g<2?(n.openBlock(),n.createBlock(l,{class:"search-tag",key:g,onClick:b=>i.search(h),size:"large"},{default:n.withCtx(()=>[h.longLabel?(n.openBlock(),n.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.label),1)]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(h.longLabel),1)]),_:2},1024)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(h.label),1)],64))]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],64))),128))])):(n.openBlock(),n.createElementBlock("div",fF,pF)),n.createVNode(f,{trigger:"click","hide-on-click":!1},{dropdown:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.searchHistory,h=>(n.openBlock(),n.createBlock(y,{key:h.id},{default:n.withCtx(()=>[n.createElementVNode("div",null,[h.longLabel?(n.openBlock(),n.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:n.withCtx(()=>[n.createElementVNode("span",{class:"dropdown-clickable-item",onClick:g=>i.search(h)},n.toDisplayString(h.label),9,mF)]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(h.longLabel),1)]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",{key:1,class:"dropdown-clickable-item",onClick:g=>i.search(h)},n.toDisplayString(h.label),9,gF))]),n.createElementVNode("div",null,[n.createVNode(s,{width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:n.withCtx(()=>[n.createVNode(u,{circle:"",text:"",size:"small",onClick:g=>i.toggleSavedSearch(h),disabled:a.savedSearchHistory.length>1&&!h.saved},{default:n.withCtx(()=>[n.createVNode(d,{color:"#8300BF"},{default:n.withCtx(()=>[h.saved?(n.openBlock(),n.createElementBlock("svg",yF,bF)):(n.openBlock(),n.createElementBlock("svg",wF,CF))]),_:2},1024)]),_:2},1032,["onClick","disabled"])]),default:n.withCtx(()=>[a.savedSearchHistory.length>1&&!h.saved?(n.openBlock(),n.createElementBlock("span",kF," Limit 2: Please remove a saved search before adding another. ")):h.saved?(n.openBlock(),n.createElementBlock("span",vF," Remove from saved searches. ")):(n.openBlock(),n.createElementBlock("span",SF," Add up to two saved searches. "))]),_:2},1024),n.createVNode(s,{width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:n.withCtx(()=>[n.createVNode(u,{circle:"",text:"",size:"small",onClick:g=>i.removeFromSavedSearch(h)},{default:n.withCtx(()=>[n.createVNode(d,{color:"#8300BF"},{default:n.withCtx(()=>[n.createVNode(p)]),_:1})]),_:2},1032,["onClick"])]),default:n.withCtx(()=>[EF]),_:2},1024)])]),_:2},1024))),128))]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",hF,[n.createTextVNode(" Search history "),n.createVNode(d,{class:"el-icon--right"},{default:n.withCtx(()=>[n.createVNode(c)]),_:1})])]),_:1})])):n.createCommentVNode("",!0)}const i0=bn(cF,[["render",_F],["__scopeId","data-v-96b7c9f3"]]),s0=(e,t)=>{const o=e.__vccOpts||e;for(const[r,a]of t)o[r]=a;return o},xF=["xlink:href"],TF={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("svg",{class:n.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[n.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,xF)],2))}},OF=s0(TF,[["__scopeId","data-v-e172d5ff"]]),l0=`<?xml version="1.0" encoding="UTF-8"?>
|
|
53
|
+
<br>`)}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},ZA=e=>(n.pushScopeId("data-v-541a51e6"),e=e(),n.popScopeId(),e),YA={class:"dataset-card-container",ref:"container"},XA={class:"dataset-card",ref:"card"},QA=ZA(()=>n.createElementVNode("div",{class:"seperator-path"},null,-1)),eF={class:"card"},tF={class:"card-left"},nF={class:"card-right"},oF={class:"details"},rF={class:"details"},aF={key:0,class:"details loading-icon"},iF={class:"badges-container"},sF={class:"float-button-container"};function lF(e,t,o,r,a,i){const s=t0,l=ht,c=Hp,d=n.resolveComponent("CopyToClipboard"),u=oi;return n.openBlock(),n.createElementBlock("div",YA,[n.createElementVNode("div",XA,[QA,n.withDirectives((n.openBlock(),n.createElementBlock("div",eF,[n.createElementVNode("span",tF,[!e.loading&&e.discoverId?(n.openBlock(),n.createBlock(s,{key:0,datasetId:e.discoverId,datasetVersion:e.version,entry:o.entry,envVars:o.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"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",nF,[n.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...p)=>i.cardClicked&&i.cardClicked(...p))},n.toDisplayString(o.entry.name),1),n.createElementVNode("div",oF,n.toDisplayString(i.contributors)+" "+n.toDisplayString(o.entry.publishDate?`(${i.publishYear})`:""),1),n.createElementVNode("div",rF,n.toDisplayString(i.samples),1),o.entry.detailsReady?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createElementBlock("div",aF,null,512)),[[u,!o.entry.detailsReady]]),n.createElementVNode("div",null,[o.entry.simulation?(n.openBlock(),n.createBlock(l,{key:0,onClick:i.openRepository,size:"small",class:"button",icon:a.ElIconView},{default:n.withCtx(()=>[n.createTextVNode("View repository")]),_:1},8,["onClick","icon"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",iF,[n.createVNode(c,{entry:o.entry,"dataset-biolucida":e.biolucidaData,onCategoryChanged:i.categoryChanged},null,8,["entry","dataset-biolucida","onCategoryChanged"])]),n.createElementVNode("div",sF,[n.createVNode(d,{content:e.copyContent},null,8,["content"])])])])),[[u,e.loading]])],512)],512)}const o0=bn(JA,[["render",lF],["__scopeId","data-v-541a51e6"]]),r0=12;function a0(){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(o=>o.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 cF={name:"SearchHistory",components:{Tag:Uo,Select:Qa},data(){return{searchHistory:[],savedSearchHistory:[]}},mounted:function(){this.getSearchHistory(),Ge.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(r=>{let a=r.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 r.search===t&&s===l})){const{label:r,longLabel:a}=this.searchHistoryItemLabel(t,e),i={filters:e,search:t,saved:!1,label:r,longLabel:a,id:a0(),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(o=>{const r=`${o.search}-${JSON.stringify(o.filters)}`,a=e.find(i=>i.key===r);a?o.saved?t.push(a.id):t.push(o.id):e.push({id:o.id,key:r})}),t.length&&(this.searchHistory=this.searchHistory.filter(o=>!t.includes(o.id)))},trimSearchHistory:function(){if(this.searchHistory.length>r0){const e=this.searchHistory.filter(r=>r.saved),t=this.searchHistory.filter(r=>!r.saved),o=r0-this.searchHistory.length;this.searchHistory=[...e,...t.slice(0,o)]}},updateSearchHistory:function(){this.searchHistory.forEach(e=>{if(e.id||(e.id=a0()),!e.label){const{label:t,longLabel:o}=this.searchHistoryItemLabel(e.search,e.filters);e.label=t,e.longLabel=o}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 o=e?`"${e.trim()}"`:"",r="",a=[],i=[];return t&&(a=t.filter(s=>s.facet!=="Show all"),i=a.map(s=>s.facet2||s.facet)),o&&a.length&&(r+=o,r+=`, ${i.join(", ")}`,o+=` (+${a.length})`),!o&&a.length&&(o=a[0].facet,a.length>1&&(r+=`${i.join(", ")}`,o+=` (+${a.length-1})`)),o?o.length>15&&!r&&(r=o):o="Unknown search",{label:o,longLabel:r}},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(o=>o.id===e.id);this.searchHistory.splice(t,1),this.savedSearchHistory=this.searchHistory.filter(o=>o.saved),this.updateSearchHistory()}}},Ji=e=>(n.pushScopeId("data-v-667b56a8"),e=e(),n.popScopeId(),e),dF={key:0,class:"history-container"},uF={key:0,class:"saved-search-history"},fF={key:1},pF=[Ji(()=>n.createElementVNode("span",{class:"empty-saved-search"},"No Saved Searches",-1))],hF={class:"el-dropdown-select"},mF=["onClick"],gF=["onClick"],yF={key:0,viewBox:"0 0 24 24"},bF=[Ji(()=>n.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))],wF={key:1,viewBox:"0 0 24 24"},CF=[Ji(()=>n.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))],kF={key:0},vF={key:1},SF={key:2},EF=Ji(()=>n.createElementVNode("span",null," Remove from search history. ",-1));function _F(e,t,o,r,a,i){const s=ei,l=Uo,c=Cr,d=Se,u=ht,p=Fs,y=s3,m=l3,f=i3;return a.searchHistory.length?(n.openBlock(),n.createElementBlock("div",dF,[a.savedSearchHistory.length?(n.openBlock(),n.createElementBlock("div",uF,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.savedSearchHistory,(h,g)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:h.id},[g<2?(n.openBlock(),n.createBlock(l,{class:"search-tag",key:g,onClick:b=>i.search(h),size:"large"},{default:n.withCtx(()=>[h.longLabel?(n.openBlock(),n.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(h.label),1)]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(h.longLabel),1)]),_:2},1024)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(h.label),1)],64))]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],64))),128))])):(n.openBlock(),n.createElementBlock("div",fF,pF)),n.createVNode(f,{trigger:"click","hide-on-click":!1},{dropdown:n.withCtx(()=>[n.createVNode(m,null,{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.searchHistory,h=>(n.openBlock(),n.createBlock(y,{key:h.id},{default:n.withCtx(()=>[n.createElementVNode("div",null,[h.longLabel?(n.openBlock(),n.createBlock(s,{key:0,width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:n.withCtx(()=>[n.createElementVNode("span",{class:"dropdown-clickable-item",onClick:g=>i.search(h)},n.toDisplayString(h.label),9,mF)]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(h.longLabel),1)]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",{key:1,class:"dropdown-clickable-item",onClick:g=>i.search(h)},n.toDisplayString(h.label),9,gF))]),n.createElementVNode("div",null,[n.createVNode(s,{width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:n.withCtx(()=>[n.createVNode(u,{circle:"",text:"",size:"small",onClick:g=>i.toggleSavedSearch(h),disabled:a.savedSearchHistory.length>1&&!h.saved},{default:n.withCtx(()=>[n.createVNode(d,{color:"#8300BF"},{default:n.withCtx(()=>[h.saved?(n.openBlock(),n.createElementBlock("svg",yF,bF)):(n.openBlock(),n.createElementBlock("svg",wF,CF))]),_:2},1024)]),_:2},1032,["onClick","disabled"])]),default:n.withCtx(()=>[a.savedSearchHistory.length>1&&!h.saved?(n.openBlock(),n.createElementBlock("span",kF," Limit 2: Please remove a saved search before adding another. ")):h.saved?(n.openBlock(),n.createElementBlock("span",vF," Remove from saved searches. ")):(n.openBlock(),n.createElementBlock("span",SF," Add up to two saved searches. "))]),_:2},1024),n.createVNode(s,{width:"auto",trigger:"hover","show-after":200,persistent:!1,"popper-class":"popover-dropdown"},{reference:n.withCtx(()=>[n.createVNode(u,{circle:"",text:"",size:"small",onClick:g=>i.removeFromSavedSearch(h)},{default:n.withCtx(()=>[n.createVNode(d,{color:"#8300BF"},{default:n.withCtx(()=>[n.createVNode(p)]),_:1})]),_:2},1032,["onClick"])]),default:n.withCtx(()=>[EF]),_:2},1024)])]),_:2},1024))),128))]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",hF,[n.createTextVNode(" Search history "),n.createVNode(d,{class:"el-icon--right"},{default:n.withCtx(()=>[n.createVNode(c)]),_:1})])]),_:1})])):n.createCommentVNode("",!0)}const i0=bn(cF,[["render",_F],["__scopeId","data-v-667b56a8"]]),s0=(e,t)=>{const o=e.__vccOpts||e;for(const[r,a]of t)o[r]=a;return o},xF=["xlink:href"],TF={__name:"SvgIcon",props:{icon:{type:String,required:!0},spin:{type:Boolean,default:!1}},setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("svg",{class:n.normalizeClass(["map-icon",{"map-icon-spin":e.spin}])},[n.createElementVNode("use",{"xlink:href":`#${e.icon}`},null,8,xF)],2))}},OF=s0(TF,[["__scopeId","data-v-e172d5ff"]]),l0=`<?xml version="1.0" encoding="UTF-8"?>
|
|
54
54
|
<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">
|
|
55
55
|
<title>2horpanel</title>
|
|
56
56
|
<g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
@@ -461,7 +461,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,curr
|
|
|
461
461
|
</g>
|
|
462
462
|
</svg>`,z0=(e,t,o,r)=>{const a=["title","desc","defs","style"],i=["width","height"],s=r||[];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)}),r&&s.map(d=>{Object.values(l.querySelectorAll(`[${d}]`)).map(u=>{u.removeAttribute(d)})});const c=l.innerHTML;return l=null,c},j0=e=>[[/<\?xml[\s\S]*?>/gi,""],[/<!doctype[\s\S]*?>/gi,""],[/<!--.*-->/gi,""],[/\<([A-Za-z]+)([^\>]*)\/\>/g,"<$1$2></$1>"],[/\s+/g," "],[/\> \</g,"><"]].reduce((t,o)=>"".replace.apply(t,o),e).trim(),BF=!0,NF=!0,IF=["fill"],$c=Object.assign({"/assets/icons/2horpanel.svg":l0,"/assets/icons/2vertpanel.svg":c0,"/assets/icons/3panel.svg":d0,"/assets/icons/4panel.svg":u0,"/assets/icons/5panel.svg":f0,"/assets/icons/6panel.svg":p0,"/assets/icons/6panelVertical.svg":h0,"/assets/icons/changeBckgd.svg":m0,"/assets/icons/close-no-bk.svg":g0,"/assets/icons/close.svg":y0,"/assets/icons/closeFullScreen.svg":b0,"/assets/icons/comment.svg":w0,"/assets/icons/connection.svg":C0,"/assets/icons/dock.svg":k0,"/assets/icons/drawLine.svg":v0,"/assets/icons/drawPoint.svg":S0,"/assets/icons/drawPolygon.svg":E0,"/assets/icons/drawTrash.svg":_0,"/assets/icons/fitWindow.svg":x0,"/assets/icons/fullScreen.svg":T0,"/assets/icons/help.svg":O0,"/assets/icons/magnifyingGlass.svg":B0,"/assets/icons/noun-filter.svg":N0,"/assets/icons/openMap.svg":I0,"/assets/icons/pause.svg":A0,"/assets/icons/permalink.svg":F0,"/assets/icons/play.svg":P0,"/assets/icons/resetZoom.svg":R0,"/assets/icons/singlepanel.svg":$0,"/assets/icons/tooltips.svg":L0,"/assets/icons/undock.svg":V0,"/assets/icons/zoomIn.svg":D0,"/assets/icons/zoomOut.svg":M0});Object.keys($c).map(e=>{const t=z0($c[e],BF,NF,IF),o=e.replace(/^.+\/(\w+).svg$/,"$1");return j0(t).replace("<svg",`<symbol id="${o}"`).replace("svg>","symbol>")}).join(`
|
|
463
463
|
`);const Lc=Object.assign({"/assets/icons/2horpanel.svg":l0,"/assets/icons/2vertpanel.svg":c0,"/assets/icons/3panel.svg":d0,"/assets/icons/4panel.svg":u0,"/assets/icons/5panel.svg":f0,"/assets/icons/6panel.svg":p0,"/assets/icons/6panelVertical.svg":h0,"/assets/icons/changeBckgd.svg":m0,"/assets/icons/close-no-bk.svg":g0,"/assets/icons/close.svg":y0,"/assets/icons/closeFullScreen.svg":b0,"/assets/icons/comment.svg":w0,"/assets/icons/connection.svg":C0,"/assets/icons/dock.svg":k0,"/assets/icons/drawLine.svg":v0,"/assets/icons/drawPoint.svg":S0,"/assets/icons/drawPolygon.svg":E0,"/assets/icons/drawTrash.svg":_0,"/assets/icons/fitWindow.svg":x0,"/assets/icons/fullScreen.svg":T0,"/assets/icons/help.svg":O0,"/assets/icons/magnifyingGlass.svg":B0,"/assets/icons/noun-filter.svg":N0,"/assets/icons/openMap.svg":I0,"/assets/icons/pause.svg":A0,"/assets/icons/permalink.svg":F0,"/assets/icons/play.svg":P0,"/assets/icons/resetZoom.svg":R0,"/assets/icons/singlepanel.svg":$0,"/assets/icons/tooltips.svg":L0,"/assets/icons/undock.svg":V0,"/assets/icons/zoomIn.svg":D0,"/assets/icons/zoomOut.svg":M0}),AF=Object.keys(Lc).map(e=>{const t=z0(Lc[e]),o=e.replace(/^.+\/(\w+).svg$/,"$1");return j0(t).replace("<svg",`<symbol id="${o}"`).replace("svg>","symbol>")}),FF={name:"MapSvgSpriteColor",svgContext:Lc,svgSprite:AF.join(`
|
|
464
|
-
`)},PF=["innerHTML"];function RF(e,t,o,r,a,i){return n.openBlock(),n.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,PF)}const $F=s0(FF,[["render",RF]]);var H0={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(o,r){e.exports=r()})(PE,function(){function o(w,C,k){return C in w?Object.defineProperty(w,C,{value:k,enumerable:!0,configurable:!0,writable:!0}):w[C]=k,w}function r(w,C){var k=Object.keys(w);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(w);C&&(x=x.filter(function(N){return Object.getOwnPropertyDescriptor(w,N).enumerable})),k.push.apply(k,x)}return k}function a(w){for(var C=1;C<arguments.length;C++){var k=arguments[C]!=null?arguments[C]:{};C%2?r(Object(k),!0).forEach(function(x){o(w,x,k[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(k)):r(Object(k)).forEach(function(x){Object.defineProperty(w,x,Object.getOwnPropertyDescriptor(k,x))})}return w}function i(w,C){if(w==null)return{};var k,x,N=function(W,z){if(W==null)return{};var K,ee,J={},se=Object.keys(W);for(ee=0;ee<se.length;ee++)K=se[ee],z.indexOf(K)>=0||(J[K]=W[K]);return J}(w,C);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(w);for(x=0;x<U.length;x++)k=U[x],C.indexOf(k)>=0||Object.prototype.propertyIsEnumerable.call(w,k)&&(N[k]=w[k])}return N}function s(w,C){return function(k){if(Array.isArray(k))return k}(w)||function(k,x){if(Symbol.iterator in Object(k)||Object.prototype.toString.call(k)==="[object Arguments]"){var N=[],U=!0,W=!1,z=void 0;try{for(var K,ee=k[Symbol.iterator]();!(U=(K=ee.next()).done)&&(N.push(K.value),!x||N.length!==x);U=!0);}catch(J){W=!0,z=J}finally{try{U||ee.return==null||ee.return()}finally{if(W)throw z}}return N}}(w,C)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(w){return function(C){if(Array.isArray(C)){for(var k=0,x=new Array(C.length);k<C.length;k++)x[k]=C[k];return x}}(w)||function(C){if(Symbol.iterator in Object(C)||Object.prototype.toString.call(C)==="[object Arguments]")return Array.from(C)}(w)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(w){var C,k="algoliasearch-client-js-".concat(w.key),x=function(){return C===void 0&&(C=w.localStorage||window.localStorage),C},N=function(){return JSON.parse(x().getItem(k)||"{}")},U=function(z){x().setItem(k,JSON.stringify(z))},W=function(){var z=w.timeToLive?1e3*w.timeToLive:null,K=N(),ee=Object.fromEntries(Object.entries(K).filter(function(se){return s(se,2)[1].timestamp!==void 0}));if(U(ee),z){var J=Object.fromEntries(Object.entries(ee).filter(function(se){var ie=s(se,2)[1],ge=new Date().getTime();return!(ie.timestamp+z<ge)}));U(J)}};return{get:function(z,K){var ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){W();var J=JSON.stringify(z);return N()[J]}).then(function(J){return Promise.all([J?J.value:K(),J!==void 0])}).then(function(J){var se=s(J,2),ie=se[0],ge=se[1];return Promise.all([ie,ge||ee.miss(ie)])}).then(function(J){return s(J,1)[0]})},set:function(z,K){return Promise.resolve().then(function(){var ee=N();return ee[JSON.stringify(z)]={timestamp:new Date().getTime(),value:K},x().setItem(k,JSON.stringify(ee)),K})},delete:function(z){return Promise.resolve().then(function(){var K=N();delete K[JSON.stringify(z)],x().setItem(k,JSON.stringify(K))})},clear:function(){return Promise.resolve().then(function(){x().removeItem(k)})}}}function d(w){var C=l(w.caches),k=C.shift();return k===void 0?{get:function(x,N){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},W=N();return W.then(function(z){return Promise.all([z,U.miss(z)])}).then(function(z){return s(z,1)[0]})},set:function(x,N){return Promise.resolve(N)},delete:function(x){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(x,N){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return k.get(x,N,U).catch(function(){return d({caches:C}).get(x,N,U)})},set:function(x,N){return k.set(x,N).catch(function(){return d({caches:C}).set(x,N)})},delete:function(x){return k.delete(x).catch(function(){return d({caches:C}).delete(x)})},clear:function(){return k.clear().catch(function(){return d({caches:C}).clear()})}}}function u(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},C={};return{get:function(k,x){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},U=JSON.stringify(k);if(U in C)return Promise.resolve(w.serializable?JSON.parse(C[U]):C[U]);var W=x(),z=N&&N.miss||function(){return Promise.resolve()};return W.then(function(K){return z(K)}).then(function(){return W})},set:function(k,x){return C[JSON.stringify(k)]=w.serializable?JSON.stringify(x):x,Promise.resolve(x)},delete:function(k){return delete C[JSON.stringify(k)],Promise.resolve()},clear:function(){return C={},Promise.resolve()}}}function p(w,C,k){var x={"x-algolia-api-key":k,"x-algolia-application-id":C};return{headers:function(){return w===b.WithinHeaders?x:{}},queryParameters:function(){return w===b.WithinQueryParameters?x:{}}}}function y(w){var C=0;return w(function k(){return C++,new Promise(function(x){setTimeout(function(){x(w(k))},Math.min(100*C,1e3))})})}function m(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(k,x){return Promise.resolve()};return Object.assign(w,{wait:function(k){return m(w.then(function(x){return Promise.all([C(x,k),x])}).then(function(x){return x[1]}))}})}function f(w){for(var C=w.length-1;C>0;C--){var k=Math.floor(Math.random()*(C+1)),x=w[C];w[C]=w[k],w[k]=x}return w}function h(w,C){return C&&Object.keys(C).forEach(function(k){w[k]=C[k](w)}),w}function g(w){for(var C=arguments.length,k=new Array(C>1?C-1:0),x=1;x<C;x++)k[x-1]=arguments[x];var N=0;return w.replace(/%s/g,function(){return encodeURIComponent(k[N++])})}var b={WithinQueryParameters:0,WithinHeaders:1};function v(w,C){var k=w||{},x=k.data||{};return Object.keys(k).forEach(function(N){["timeout","headers","queryParameters","data","cacheable"].indexOf(N)===-1&&(x[N]=k[N])}),{data:Object.entries(x).length>0?x:void 0,timeout:k.timeout||C,headers:k.headers||{},queryParameters:k.queryParameters||{},cacheable:k.cacheable}}var T={Read:1,Write:2,Any:3},S=1,E=2,_=3;function O(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S;return a(a({},w),{},{status:C,lastUpdate:Date.now()})}function B(w){return typeof w=="string"?{protocol:"https",url:w,accept:T.Any}:{protocol:w.protocol||"https",url:w.url,accept:w.accept||T.Any}}var A="DELETE",V="GET",F="POST",L="PUT";function j(w,C){return Promise.all(C.map(function(k){return w.get(k,function(){return Promise.resolve(O(k))})})).then(function(k){var x=k.filter(function(W){return function(z){return z.status===S||Date.now()-z.lastUpdate>12e4}(W)}),N=k.filter(function(W){return function(z){return z.status===_&&Date.now()-z.lastUpdate<=12e4}(W)}),U=[].concat(l(x),l(N));return{getTimeout:function(W,z){return(N.length===0&&W===0?1:N.length+3+W)*z},statelessHosts:U.length>0?U.map(function(W){return B(W)}):C}})}function Q(w,C,k,x){var N=[],U=function(ie,ge){if(!(ie.method===V||ie.data===void 0&&ge.data===void 0)){var ue=Array.isArray(ie.data)?ie.data:a(a({},ie.data),ge.data);return JSON.stringify(ue)}}(k,x),W=function(ie,ge){var ue=a(a({},ie.headers),ge.headers),xe={};return Object.keys(ue).forEach(function(Pe){var Et=ue[Pe];xe[Pe.toLowerCase()]=Et}),xe}(w,x),z=k.method,K=k.method!==V?{}:a(a({},k.data),x.data),ee=a(a(a({"x-algolia-agent":w.userAgent.value},w.queryParameters),K),x.queryParameters),J=0,se=function ie(ge,ue){var xe=ge.pop();if(xe===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:oe(N)};var Pe={data:U,headers:W,method:z,url:D(xe,k.path,ee),connectTimeout:ue(J,w.timeouts.connect),responseTimeout:ue(J,x.timeout)},Et=function(_t){var at={request:Pe,response:_t,host:xe,triesLeft:ge.length};return N.push(at),at},ua={onSuccess:function(_t){return function(at){try{return JSON.parse(at.content)}catch(Bo){throw function(eo,lr){return{name:"DeserializationError",message:eo,response:lr}}(Bo.message,at)}}(_t)},onRetry:function(_t){var at=Et(_t);return _t.isTimedOut&&J++,Promise.all([w.logger.info("Retryable failure",he(at)),w.hostsCache.set(xe,O(xe,_t.isTimedOut?_:E))]).then(function(){return ie(ge,ue)})},onFail:function(_t){throw Et(_t),function(at,Bo){var eo=at.content,lr=at.status,fa=eo;try{fa=JSON.parse(eo).message}catch{}return function(ts,Qc,_R){return{name:"ApiError",message:ts,status:Qc,transporterStackTrace:_R}}(fa,lr,Bo)}(_t,oe(N))}};return w.requester.send(Pe).then(function(_t){return function(at,Bo){return function(eo){var lr=eo.status;return eo.isTimedOut||function(fa){var ts=fa.isTimedOut,Qc=fa.status;return!ts&&~~Qc==0}(eo)||~~(lr/100)!=2&&~~(lr/100)!=4}(at)?Bo.onRetry(at):~~(at.status/100)==2?Bo.onSuccess(at):Bo.onFail(at)}(_t,ua)})};return j(w.hostsCache,C).then(function(ie){return se(l(ie.statelessHosts).reverse(),ie.getTimeout)})}function q(w){var C=w.hostsCache,k=w.logger,x=w.requester,N=w.requestsCache,U=w.responsesCache,W=w.timeouts,z=w.userAgent,K=w.hosts,ee=w.queryParameters,J={hostsCache:C,logger:k,requester:x,requestsCache:N,responsesCache:U,timeouts:W,userAgent:z,headers:w.headers,queryParameters:ee,hosts:K.map(function(se){return B(se)}),read:function(se,ie){var ge=v(ie,J.timeouts.read),ue=function(){return Q(J,J.hosts.filter(function(Pe){return(Pe.accept&T.Read)!=0}),se,ge)};if((ge.cacheable!==void 0?ge.cacheable:se.cacheable)!==!0)return ue();var xe={request:se,mappedRequestOptions:ge,transporter:{queryParameters:J.queryParameters,headers:J.headers}};return J.responsesCache.get(xe,function(){return J.requestsCache.get(xe,function(){return J.requestsCache.set(xe,ue()).then(function(Pe){return Promise.all([J.requestsCache.delete(xe),Pe])},function(Pe){return Promise.all([J.requestsCache.delete(xe),Promise.reject(Pe)])}).then(function(Pe){var Et=s(Pe,2);return Et[0],Et[1]})})},{miss:function(Pe){return J.responsesCache.set(xe,Pe)}})},write:function(se,ie){return Q(J,J.hosts.filter(function(ge){return(ge.accept&T.Write)!=0}),se,v(ie,J.timeouts.write))}};return J}function I(w){var C={value:"Algolia for JavaScript (".concat(w,")"),add:function(k){var x="; ".concat(k.segment).concat(k.version!==void 0?" (".concat(k.version,")"):"");return C.value.indexOf(x)===-1&&(C.value="".concat(C.value).concat(x)),C}};return C}function D(w,C,k){var x=ne(k),N="".concat(w.protocol,"://").concat(w.url,"/").concat(C.charAt(0)==="/"?C.substr(1):C);return x.length&&(N+="?".concat(x)),N}function ne(w){return Object.keys(w).map(function(C){return g("%s=%s",C,(k=w[C],Object.prototype.toString.call(k)==="[object Object]"||Object.prototype.toString.call(k)==="[object Array]"?JSON.stringify(w[C]):w[C]));var k}).join("&")}function oe(w){return w.map(function(C){return he(C)})}function he(w){var C=w.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},w),{},{request:a(a({},w.request),{},{headers:a(a({},w.request.headers),C)})})}var me=function(w){return function(C,k){return w.transporter.write({method:F,path:"2/abtests",data:C},k)}},Be=function(w){return function(C,k){return w.transporter.write({method:A,path:g("2/abtests/%s",C)},k)}},qe=function(w){return function(C,k){return w.transporter.read({method:V,path:g("2/abtests/%s",C)},k)}},Ie=function(w){return function(C){return w.transporter.read({method:V,path:"2/abtests"},C)}},ye=function(w){return function(C,k){return w.transporter.write({method:F,path:g("2/abtests/%s/stop",C)},k)}},we=function(w){return function(C){return w.transporter.read({method:V,path:"1/strategies/personalization"},C)}},Ne=function(w){return function(C,k){return w.transporter.write({method:F,path:"1/strategies/personalization",data:C},k)}};function $e(w){return function C(k){return w.request(k).then(function(x){if(w.batch!==void 0&&w.batch(x.hits),!w.shouldStop(x))return x.cursor?C({cursor:x.cursor}):C({page:(k.page||0)+1})})}({})}var Jt=function(w){return function(C,k){var x=k||{},N=x.queryParameters,U=i(x,["queryParameters"]),W=a({acl:C},N!==void 0?{queryParameters:N}:{});return m(w.transporter.write({method:F,path:"1/keys",data:W},U),function(z,K){return y(function(ee){return Ce(w)(z.key,K).catch(function(J){if(J.status!==404)throw J;return ee()})})})}},ot=function(w){return function(C,k,x){var N=v(x);return N.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:F,path:"1/clusters/mapping",data:{cluster:k}},N)}},Ye=function(w){return function(C,k,x){return w.transporter.write({method:F,path:"1/clusters/mapping/batch",data:{users:C,cluster:k}},x)}},Ae=function(w){return function(C,k){return m(w.transporter.write({method:F,path:g("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},k),function(x,N){return Xn(w)(x.taskID,N)})}},Ve=function(w){return function(C,k,x){return m(w.transporter.write({method:F,path:g("1/indexes/%s/operation",C),data:{operation:"copy",destination:k}},x),function(N,U){return Fe(w)(C,{methods:{waitTask:Ke}}).waitTask(N.taskID,U)})}},Ct=function(w){return function(C,k,x){return Ve(w)(C,k,a(a({},x),{},{scope:[Xc.Rules]}))}},kt=function(w){return function(C,k,x){return Ve(w)(C,k,a(a({},x),{},{scope:[Xc.Settings]}))}},Je=function(w){return function(C,k,x){return Ve(w)(C,k,a(a({},x),{},{scope:[Xc.Synonyms]}))}},vt=function(w){return function(C,k){return C.method===V?w.transporter.read(C,k):w.transporter.write(C,k)}},rt=function(w){return function(C,k){return m(w.transporter.write({method:A,path:g("1/keys/%s",C)},k),function(x,N){return y(function(U){return Ce(w)(C,N).then(U).catch(function(W){if(W.status!==404)throw W})})})}},Zt=function(w){return function(C,k,x){var N=k.map(function(U){return{action:"deleteEntry",body:{objectID:U}}});return m(w.transporter.write({method:F,path:g("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},x),function(U,W){return Xn(w)(U.taskID,W)})}},Ce=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/keys/%s",C)},k)}},Xe=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/task/%s",C.toString())},k)}},lt=function(w){return function(C){return w.transporter.read({method:V,path:"/1/dictionaries/*/settings"},C)}},Ft=function(w){return function(C){return w.transporter.read({method:V,path:"1/logs"},C)}},Qe=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters/mapping/top"},C)}},H=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/clusters/mapping/%s",C)},k)}},fe=function(w){return function(C){var k=C||{},x=k.retrieveMappings,N=i(k,["retrieveMappings"]);return x===!0&&(N.getClusters=!0),w.transporter.read({method:V,path:"1/clusters/mapping/pending"},N)}},Fe=function(w){return function(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x={transporter:w.transporter,appId:w.appId,indexName:C};return h(x,k.methods)}},ct=function(w){return function(C){return w.transporter.read({method:V,path:"1/keys"},C)}},Pt=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters"},C)}},rr=function(w){return function(C){return w.transporter.read({method:V,path:"1/indexes"},C)}},sa=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters/mapping"},C)}},To=function(w){return function(C,k,x){return m(w.transporter.write({method:F,path:g("1/indexes/%s/operation",C),data:{operation:"move",destination:k}},x),function(N,U){return Fe(w)(C,{methods:{waitTask:Ke}}).waitTask(N.taskID,U)})}},Oo=function(w){return function(C,k){return m(w.transporter.write({method:F,path:"1/indexes/*/batch",data:{requests:C}},k),function(x,N){return Promise.all(Object.keys(x.taskID).map(function(U){return Fe(w)(U,{methods:{waitTask:Ke}}).waitTask(x.taskID[U],N)}))})}},M=function(w){return function(C,k){return w.transporter.read({method:F,path:"1/indexes/*/objects",data:{requests:C}},k)}},Z=function(w){return function(C,k){var x=C.map(function(N){return a(a({},N),{},{params:ne(N.params||{})})});return w.transporter.read({method:F,path:"1/indexes/*/queries",data:{requests:x},cacheable:!0},k)}},Y=function(w){return function(C,k){return Promise.all(C.map(function(x){var N=x.params,U=N.facetName,W=N.facetQuery,z=i(N,["facetName","facetQuery"]);return Fe(w)(x.indexName,{methods:{searchForFacetValues:ey}}).searchForFacetValues(U,W,a(a({},k),z))}))}},ke=function(w){return function(C,k){var x=v(k);return x.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:A,path:"1/clusters/mapping"},x)}},Rt=function(w){return function(C,k,x){var N=k.map(function(U){return{action:"addEntry",body:U}});return m(w.transporter.write({method:F,path:g("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:N}},x),function(U,W){return Xn(w)(U.taskID,W)})}},St=function(w){return function(C,k){return m(w.transporter.write({method:F,path:g("1/keys/%s/restore",C)},k),function(x,N){return y(function(U){return Ce(w)(C,N).catch(function(W){if(W.status!==404)throw W;return U()})})})}},$t=function(w){return function(C,k,x){var N=k.map(function(U){return{action:"addEntry",body:U}});return m(w.transporter.write({method:F,path:g("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},x),function(U,W){return Xn(w)(U.taskID,W)})}},ar=function(w){return function(C,k,x){return w.transporter.read({method:F,path:g("/1/dictionaries/%s/search",C),data:{query:k},cacheable:!0},x)}},Yi=function(w){return function(C,k){return w.transporter.read({method:F,path:"1/clusters/mapping/search",data:{query:C}},k)}},Mc=function(w){return function(C,k){return m(w.transporter.write({method:L,path:"/1/dictionaries/*/settings",data:C},k),function(x,N){return Xn(w)(x.taskID,N)})}},zc=function(w){return function(C,k){var x=Object.assign({},k),N=k||{},U=N.queryParameters,W=i(N,["queryParameters"]),z=U?{queryParameters:U}:{},K=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(w.transporter.write({method:L,path:g("1/keys/%s",C),data:z},W),function(ee,J){return y(function(se){return Ce(w)(C,J).then(function(ie){return function(ge){return Object.keys(x).filter(function(ue){return K.indexOf(ue)!==-1}).every(function(ue){if(Array.isArray(ge[ue])&&Array.isArray(x[ue])){var xe=ge[ue];return xe.length===x[ue].length&&xe.every(function(Pe,Et){return Pe===x[ue][Et]})}return ge[ue]===x[ue]})}(ie)?Promise.resolve():se()})})})}},Xn=function(w){return function(C,k){return y(function(x){return Xe(w)(C,k).then(function(N){return N.status!=="published"?x():void 0})})}},la=function(w){return function(C,k){return m(w.transporter.write({method:F,path:g("1/indexes/%s/batch",w.indexName),data:{requests:C}},k),function(x,N){return Ke(w)(x.taskID,N)})}},jc=function(w){return function(C){return $e(a(a({shouldStop:function(k){return k.cursor===void 0}},C),{},{request:function(k){return w.transporter.read({method:F,path:g("1/indexes/%s/browse",w.indexName),data:k},C)}}))}},ca=function(w){return function(C){var k=a({hitsPerPage:1e3},C);return $e(a(a({shouldStop:function(x){return x.hits.length<k.hitsPerPage}},k),{},{request:function(x){return ty(w)("",a(a({},k),x)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(U){return delete U._highlightResult,U})})})}}))}},Hc=function(w){return function(C){var k=a({hitsPerPage:1e3},C);return $e(a(a({shouldStop:function(x){return x.hits.length<k.hitsPerPage}},k),{},{request:function(x){return ny(w)("",a(a({},k),x)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(U){return delete U._highlightResult,U})})})}}))}},da=function(w){return function(C,k,x){var N=x||{},U=N.batchSize,W=i(N,["batchSize"]),z={taskIDs:[],objectIDs:[]};return m(function K(){var ee,J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,se=[];for(ee=J;ee<C.length&&(se.push(C[ee]),se.length!==(U||1e3));ee++);return se.length===0?Promise.resolve(z):la(w)(se.map(function(ie){return{action:k,body:ie}}),W).then(function(ie){return z.objectIDs=z.objectIDs.concat(ie.objectIDs),z.taskIDs.push(ie.taskID),ee++,K(ee)})}(),function(K,ee){return Promise.all(K.taskIDs.map(function(J){return Ke(w)(J,ee)}))})}},Uc=function(w){return function(C){return m(w.transporter.write({method:F,path:g("1/indexes/%s/clear",w.indexName)},C),function(k,x){return Ke(w)(k.taskID,x)})}},Xi=function(w){return function(C){var k=C||{},x=k.forwardToReplicas,N=v(i(k,["forwardToReplicas"]));return x&&(N.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:F,path:g("1/indexes/%s/rules/clear",w.indexName)},N),function(U,W){return Ke(w)(U.taskID,W)})}},qc=function(w){return function(C){var k=C||{},x=k.forwardToReplicas,N=v(i(k,["forwardToReplicas"]));return x&&(N.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:F,path:g("1/indexes/%s/synonyms/clear",w.indexName)},N),function(U,W){return Ke(w)(U.taskID,W)})}},Kc=function(w){return function(C,k){return m(w.transporter.write({method:F,path:g("1/indexes/%s/deleteByQuery",w.indexName),data:C},k),function(x,N){return Ke(w)(x.taskID,N)})}},Wc=function(w){return function(C){return m(w.transporter.write({method:A,path:g("1/indexes/%s",w.indexName)},C),function(k,x){return Ke(w)(k.taskID,x)})}},Gc=function(w){return function(C,k){return m(P(w)([C],k).then(function(x){return{taskID:x.taskIDs[0]}}),function(x,N){return Ke(w)(x.taskID,N)})}},P=function(w){return function(C,k){var x=C.map(function(N){return{objectID:N}});return da(w)(x,sr.DeleteObject,k)}},G=function(w){return function(C,k){var x=k||{},N=x.forwardToReplicas,U=v(i(x,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:g("1/indexes/%s/rules/%s",w.indexName,C)},U),function(W,z){return Ke(w)(W.taskID,z)})}},de=function(w){return function(C,k){var x=k||{},N=x.forwardToReplicas,U=v(i(x,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:g("1/indexes/%s/synonyms/%s",w.indexName,C)},U),function(W,z){return Ke(w)(W.taskID,z)})}},Ee=function(w){return function(C){return Y0(w)(C).then(function(){return!0}).catch(function(k){if(k.status!==404)throw k;return!1})}},kn=function(w){return function(C,k,x){return w.transporter.read({method:F,path:g("1/answers/%s/prediction",w.indexName),data:{query:C,queryLanguages:k},cacheable:!0},x)}},Qn=function(w){return function(C,k){var x=k||{},N=x.query,U=x.paginate,W=i(x,["query","paginate"]),z=0;return function K(){return Q0(w)(N||"",a(a({},W),{},{page:z})).then(function(ee){for(var J=0,se=Object.entries(ee.hits);J<se.length;J++){var ie=s(se[J],2),ge=ie[0],ue=ie[1];if(C(ue))return{object:ue,position:parseInt(ge,10),page:z}}if(z++,U===!1||z>=ee.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return K()})}()}},ir=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/indexes/%s/%s",w.indexName,C)},k)}},Rn=function(){return function(w,C){for(var k=0,x=Object.entries(w.hits);k<x.length;k++){var N=s(x[k],2),U=N[0];if(N[1].objectID===C)return parseInt(U,10)}return-1}},Yt=function(w){return function(C,k){var x=k||{},N=x.attributesToRetrieve,U=i(x,["attributesToRetrieve"]),W=C.map(function(z){return a({indexName:w.indexName,objectID:z},N?{attributesToRetrieve:N}:{})});return w.transporter.read({method:F,path:"1/indexes/*/objects",data:{requests:W}},U)}},Qi=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/indexes/%s/rules/%s",w.indexName,C)},k)}},Y0=function(w){return function(C){return w.transporter.read({method:V,path:g("1/indexes/%s/settings",w.indexName),data:{getVersion:2}},C)}},sR=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/indexes/%s/synonyms/%s",w.indexName,C)},k)}},lR=function(w){return function(C,k){return m(X0(w)([C],k).then(function(x){return{objectID:x.objectIDs[0],taskID:x.taskIDs[0]}}),function(x,N){return Ke(w)(x.taskID,N)})}},X0=function(w){return function(C,k){var x=k||{},N=x.createIfNotExists,U=i(x,["createIfNotExists"]),W=N?sr.PartialUpdateObject:sr.PartialUpdateObjectNoCreate;return da(w)(C,W,U)}},cR=function(w){return function(C,k){var x=k||{},N=x.safe,U=x.autoGenerateObjectIDIfNotExist,W=x.batchSize,z=i(x,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),K=function(ue,xe,Pe,Et){return m(w.transporter.write({method:F,path:g("1/indexes/%s/operation",ue),data:{operation:Pe,destination:xe}},Et),function(ua,_t){return Ke(w)(ua.taskID,_t)})},ee=Math.random().toString(36).substring(7),J="".concat(w.indexName,"_tmp_").concat(ee),se=Jc({appId:w.appId,transporter:w.transporter,indexName:J}),ie=[],ge=K(w.indexName,J,"copy",a(a({},z),{},{scope:["settings","synonyms","rules"]}));return ie.push(ge),m((N?ge.wait(z):ge).then(function(){var ue=se(C,a(a({},z),{},{autoGenerateObjectIDIfNotExist:U,batchSize:W}));return ie.push(ue),N?ue.wait(z):ue}).then(function(){var ue=K(J,w.indexName,"move",z);return ie.push(ue),N?ue.wait(z):ue}).then(function(){return Promise.all(ie)}).then(function(ue){var xe=s(ue,3),Pe=xe[0],Et=xe[1],ua=xe[2];return{objectIDs:Et.objectIDs,taskIDs:[Pe.taskID].concat(l(Et.taskIDs),[ua.taskID])}}),function(ue,xe){return Promise.all(ie.map(function(Pe){return Pe.wait(xe)}))})}},dR=function(w){return function(C,k){return Zc(w)(C,a(a({},k),{},{clearExistingRules:!0}))}},uR=function(w){return function(C,k){return Yc(w)(C,a(a({},k),{},{clearExistingSynonyms:!0}))}},fR=function(w){return function(C,k){return m(Jc(w)([C],k).then(function(x){return{objectID:x.objectIDs[0],taskID:x.taskIDs[0]}}),function(x,N){return Ke(w)(x.taskID,N)})}},Jc=function(w){return function(C,k){var x=k||{},N=x.autoGenerateObjectIDIfNotExist,U=i(x,["autoGenerateObjectIDIfNotExist"]),W=N?sr.AddObject:sr.UpdateObject;if(W===sr.UpdateObject){var z=!0,K=!1,ee=void 0;try{for(var J,se=C[Symbol.iterator]();!(z=(J=se.next()).done);z=!0)if(J.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(ie){K=!0,ee=ie}finally{try{z||se.return==null||se.return()}finally{if(K)throw ee}}}return da(w)(C,W,U)}},pR=function(w){return function(C,k){return Zc(w)([C],k)}},Zc=function(w){return function(C,k){var x=k||{},N=x.forwardToReplicas,U=x.clearExistingRules,W=v(i(x,["forwardToReplicas","clearExistingRules"]));return N&&(W.queryParameters.forwardToReplicas=1),U&&(W.queryParameters.clearExistingRules=1),m(w.transporter.write({method:F,path:g("1/indexes/%s/rules/batch",w.indexName),data:C},W),function(z,K){return Ke(w)(z.taskID,K)})}},hR=function(w){return function(C,k){return Yc(w)([C],k)}},Yc=function(w){return function(C,k){var x=k||{},N=x.forwardToReplicas,U=x.clearExistingSynonyms,W=x.replaceExistingSynonyms,z=v(i(x,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return N&&(z.queryParameters.forwardToReplicas=1),(W||U)&&(z.queryParameters.replaceExistingSynonyms=1),m(w.transporter.write({method:F,path:g("1/indexes/%s/synonyms/batch",w.indexName),data:C},z),function(K,ee){return Ke(w)(K.taskID,ee)})}},Q0=function(w){return function(C,k){return w.transporter.read({method:F,path:g("1/indexes/%s/query",w.indexName),data:{query:C},cacheable:!0},k)}},ey=function(w){return function(C,k,x){return w.transporter.read({method:F,path:g("1/indexes/%s/facets/%s/query",w.indexName,C),data:{facetQuery:k},cacheable:!0},x)}},ty=function(w){return function(C,k){return w.transporter.read({method:F,path:g("1/indexes/%s/rules/search",w.indexName),data:{query:C}},k)}},ny=function(w){return function(C,k){return w.transporter.read({method:F,path:g("1/indexes/%s/synonyms/search",w.indexName),data:{query:C}},k)}},mR=function(w){return function(C,k){var x=k||{},N=x.forwardToReplicas,U=v(i(x,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:L,path:g("1/indexes/%s/settings",w.indexName),data:C},U),function(W,z){return Ke(w)(W.taskID,z)})}},Ke=function(w){return function(C,k){return y(function(x){return function(N){return function(U,W){return N.transporter.read({method:V,path:g("1/indexes/%s/task/%s",N.indexName,U.toString())},W)}}(w)(C,k).then(function(N){return N.status!=="published"?x():void 0})})}},sr={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},Xc={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},gR=1,yR=2,bR=3,es=function(w){return function(C,k){var x=C.map(function(N){return a(a({},N),{},{threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:x},cacheable:!0},k)}},wR=function(w){return function(C,k){return es(w)(C.map(function(x){return a(a({},x),{},{fallbackParameters:{},model:"bought-together"})}),k)}},CR=function(w){return function(C,k){return es(w)(C.map(function(x){return a(a({},x),{},{model:"related-products"})}),k)}},kR=function(w){return function(C,k){var x=C.map(function(N){return a(a({},N),{},{model:"trending-facets",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:x},cacheable:!0},k)}},vR=function(w){return function(C,k){var x=C.map(function(N){return a(a({},N),{},{model:"trending-items",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:x},cacheable:!0},k)}},SR=function(w){return function(C,k){return es(w)(C.map(function(x){return a(a({},x),{},{model:"looking-similar"})}),k)}},ER=function(w){return function(C,k){var x=C.map(function(N){return a(a({},N),{},{model:"recommended-for-you",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:x},cacheable:!0},k)}};function oy(w,C,k){var x,N={appId:w,apiKey:C,timeouts:{connect:1,read:2,write:30},requester:{send:function(z){return new Promise(function(K){var ee=new XMLHttpRequest;ee.open(z.method,z.url,!0),Object.keys(z.headers).forEach(function(ge){return ee.setRequestHeader(ge,z.headers[ge])});var J,se=function(ge,ue){return setTimeout(function(){ee.abort(),K({status:0,content:ue,isTimedOut:!0})},1e3*ge)},ie=se(z.connectTimeout,"Connection timeout");ee.onreadystatechange=function(){ee.readyState>ee.OPENED&&J===void 0&&(clearTimeout(ie),J=se(z.responseTimeout,"Socket timeout"))},ee.onerror=function(){ee.status===0&&(clearTimeout(ie),clearTimeout(J),K({content:ee.responseText||"Network request failed",status:ee.status,isTimedOut:!1}))},ee.onload=function(){clearTimeout(ie),clearTimeout(J),K({content:ee.responseText,status:ee.status,isTimedOut:!1})},ee.send(z.data)})}},logger:(x=bR,{debug:function(z,K){return gR>=x&&console.debug(z,K),Promise.resolve()},info:function(z,K){return yR>=x&&console.info(z,K),Promise.resolve()},error:function(z,K){return console.error(z,K),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(w)}),u()]}),userAgent:I("4.23.2").add({segment:"Browser"})},U=a(a({},N),k),W=function(){return function(z){return function(K){var ee=K.region||"us",J=p(b.WithinHeaders,K.appId,K.apiKey),se=q(a(a({hosts:[{url:"personalization.".concat(ee,".algolia.com")}]},K),{},{headers:a(a(a({},J.headers()),{"content-type":"application/json"}),K.headers),queryParameters:a(a({},J.queryParameters()),K.queryParameters)}));return h({appId:K.appId,transporter:se},K.methods)}(a(a(a({},N),z),{},{methods:{getPersonalizationStrategy:we,setPersonalizationStrategy:Ne}}))}};return function(z){var K=z.appId,ee=p(z.authMode!==void 0?z.authMode:b.WithinHeaders,K,z.apiKey),J=q(a(a({hosts:[{url:"".concat(K,"-dsn.algolia.net"),accept:T.Read},{url:"".concat(K,".algolia.net"),accept:T.Write}].concat(f([{url:"".concat(K,"-1.algolianet.com")},{url:"".concat(K,"-2.algolianet.com")},{url:"".concat(K,"-3.algolianet.com")}]))},z),{},{headers:a(a(a({},ee.headers()),{"content-type":"application/x-www-form-urlencoded"}),z.headers),queryParameters:a(a({},ee.queryParameters()),z.queryParameters)}));return h({transporter:J,appId:K,addAlgoliaAgent:function(se,ie){J.userAgent.add({segment:se,version:ie})},clearCache:function(){return Promise.all([J.requestsCache.clear(),J.responsesCache.clear()]).then(function(){})}},z.methods)}(a(a({},U),{},{methods:{search:Z,searchForFacetValues:Y,multipleBatch:Oo,multipleGetObjects:M,multipleQueries:Z,copyIndex:Ve,copySettings:kt,copySynonyms:Je,copyRules:Ct,moveIndex:To,listIndices:rr,getLogs:Ft,listClusters:Pt,multipleSearchForFacetValues:Y,getApiKey:Ce,addApiKey:Jt,listApiKeys:ct,updateApiKey:zc,deleteApiKey:rt,restoreApiKey:St,assignUserID:ot,assignUserIDs:Ye,getUserID:H,searchUserIDs:Yi,listUserIDs:sa,getTopUserIDs:Qe,removeUserID:ke,hasPendingMappings:fe,clearDictionaryEntries:Ae,deleteDictionaryEntries:Zt,getDictionarySettings:lt,getAppTask:Xe,replaceDictionaryEntries:Rt,saveDictionaryEntries:$t,searchDictionaryEntries:ar,setDictionarySettings:Mc,waitAppTask:Xn,customRequest:vt,initIndex:function(z){return function(K){return Fe(z)(K,{methods:{batch:la,delete:Wc,findAnswers:kn,getObject:ir,getObjects:Yt,saveObject:fR,saveObjects:Jc,search:Q0,searchForFacetValues:ey,waitTask:Ke,setSettings:mR,getSettings:Y0,partialUpdateObject:lR,partialUpdateObjects:X0,deleteObject:Gc,deleteObjects:P,deleteBy:Kc,clearObjects:Uc,browseObjects:jc,getObjectPosition:Rn,findObject:Qn,exists:Ee,saveSynonym:hR,saveSynonyms:Yc,getSynonym:sR,searchSynonyms:ny,browseSynonyms:Hc,deleteSynonym:de,clearSynonyms:qc,replaceAllObjects:cR,replaceAllSynonyms:uR,searchRules:ty,getRule:Qi,deleteRule:G,saveRule:pR,saveRules:Zc,replaceAllRules:dR,browseRules:ca,clearRules:Xi}})}},initAnalytics:function(){return function(z){return function(K){var ee=K.region||"us",J=p(b.WithinHeaders,K.appId,K.apiKey),se=q(a(a({hosts:[{url:"analytics.".concat(ee,".algolia.com")}]},K),{},{headers:a(a(a({},J.headers()),{"content-type":"application/json"}),K.headers),queryParameters:a(a({},J.queryParameters()),K.queryParameters)}));return h({appId:K.appId,transporter:se},K.methods)}(a(a(a({},N),z),{},{methods:{addABTest:me,getABTest:qe,getABTests:Ie,stopABTest:ye,deleteABTest:Be}}))}},initPersonalization:W,initRecommendation:function(){return function(z){return U.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),W()(z)}},getRecommendations:es,getFrequentlyBoughtTogether:wR,getLookingSimilar:SR,getRecommendedForYou:ER,getRelatedProducts:CR,getTrendingFacets:kR,getTrendingItems:vR}}))}return oy.version="4.23.2",oy})})(H0);var LF=H0.exports;const VF=RE(LF);class U0{constructor(t,o,r="https://api.pennsieve.io"){this.client=VF(t,o),this.PENNSIEVE_API_LOCATION=r,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const o=t.map(s=>s.facetPropPath),r=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:o.concat(r)}).then(s=>(o.map(l=>{const c=t.find(m=>m.facetPropPath==l);var d=[];const u=s.facets;if(u===void 0)return;const p=u[l]==null?{}:u[l],y=c&&u[c.facetSubpropPath]?Object.keys(u[c.facetSubpropPath]):[];Object.keys(p).map(m=>{const f=y.reduce((g,b)=>{const v=b.split(".");return v.length!==2||m===v[0]&&g.push({label:v[1],id:i++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),g},[]);let h={label:m,id:i++,facetPropPath:l};f.length>0&&(h.children=f),d.push(h)}),d.length>0&&a.push({label:c?c.label:"",id:i++,children:d,key:l})}),a))}_discoverAllDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{fetch(`${o}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{r(a.map(i=>i.doi))})})}_expandDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{let a=t.map(i=>this._discoverAllDois(i,o));Promise.all(a).then(i=>{r(i.flat())})})}_processResultsForCards(t){let o=[],r={};for(let a of t)r={...a},r={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},o.push(r);return o}_processAnatomy(t){let o=[],r=[],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"))&&o.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(o.push(l.curie),r.push(l.name))})}),i=[...new Set(o)],a=[...new Set(r)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,o="",r=10,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,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,o="",r=999999,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,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(r=>({id:r.objectID,terms:r.anatomy?r.anatomy.organ.map(a=>a.curie):[]}))}processResultsForScaffold(t){let o={};return t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.name&&(o[a.name]?o[a.name]++:o[a.name]=1)})}),o}}const Vc=[{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"},{label:"Funding Program",id:"pennsieve.organization",facetPropPath:"pennsieve.organization.name",facetSubpropPath:"pennsieve.organization.subcategory.name"}];function q0(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=DF(e),o="NOT item.published.status:embargo";return o=`(${o}) AND `,Vc.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 "))})`,o+=`${s+l} AND `,o=o.split("()AND ").join(""))}),o.substring(0,o.lastIndexOf(" AND "))}function DF(e){return e.filter(t=>t.label!=="Show all")}const Zi=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Dc=function(e){const t=e.toLowerCase();return Gi[t]?Zi(Gi[t]):Zi(t)},MF={name:"SearchFilters",components:{MapSvgIcon:OF,MapSvgSpriteColor:$F,Option:ml,Select:Qa,Popover:ei,Cascader:gp},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:[],filterTimeout:null,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=n.markRaw({}),t=n.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,o=void 0){let r=e;return t&&(r=`${e}>${t}`),t&&o&&(r=`${e}>${t}>${o}`),!t&&o&&console.warn(`Warning: ${o} provided without its parent, this will not be shown in the cascader`),r},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(Vc).then(t=>{this.facets=t,Ge.emit("available-facets",t),this.options=t,this.options.forEach((o,r)=>{this.options[r].total=this.countTotalFacet(o),this.options[r].label=Dc(o.label),this.options[r].value=this.createCascaderItemValue(o.key,void 0),this.options[r].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[r].children.forEach((a,i)=>{this.options[r].children[i].facetPropPath!=="pennsieve.organization.name"&&(this.options[r].children[i].label=Dc(a.label)),this.options[r].children[i].value=this.createCascaderItemValue(o.label,a.label),this.options[r].children[i].children&&this.options[r].children[i].children.length>0&&this.options[r].children[i].children.forEach((s,l)=>{this.options[r].children[i].children[l].label=Dc(s.label),this.options[r].children[i].children[l].value=this.createCascaderItemValue(o.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(o=>{const r=o[0],a=o[1],i=this.options.filter(l=>l.label==r)[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(p=>{const y=p[0],m=p[1];y===d&&c.children.map(f=>{const h=f.label,g=f.value;h!==e&&m.includes(h)&&t.push([s,g])})})}}),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(o=>{this.correctnessCheck.facet.add(o.label),t.label==="Anatomical structure"&&o.label!=="Show all"&&o.children.map(r=>{this.correctnessCheck.facet2.add(r.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:o,facet2:r,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(o)&&(r?this.correctnessCheck.facet2.has(r)&&(a in this.cascaderTags?o in this.cascaderTags[a]?this.cascaderTags[a][o].push(r):this.cascaderTags[a][o]=[r]:(this.cascaderTags[a]={},this.cascaderTags[a][o]=[r])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(o):o.toLowerCase()!=="show all"?this.cascaderTags[a]=[o]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const o=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...o]}),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((o,r)=>(o=typeof o=="number"?o:o.children.length,o+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(o=>{const r=o[0];r in t?t[r]+=1:t[r]=1}),this.options.map(o=>{const r=o.key,a=o.children.filter(s=>s.label==="Show all")[0].value,i=o.total;t[r]===i&&(e=e.filter(s=>s[0]!==o.key),delete t[r]),r in t||e.unshift([r,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 o=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}}),r=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:p,term:y}=this.getFacetsFromHierarchyString(c);return p&&(u=p,s="anatomy.organ.name"),{facetPropPath:l,facet:u,term:y,AND:d,facetSubPropPath:s}});r.filter(i=>i.facet!=="Show all").length||(r=[]),this.filterTimeout&&clearTimeout(this.filterTimeout),this.$emit("loading",!0),this.setCascader(o),this.filterTimeout=setTimeout(()=>{this.$emit("filterResults",r),this.cssMods()},600)}},findHierarachyStringAndBooleanString(e){let t,o;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],o=e.length==4?e[3]:void 0):(t=e[1],o=e[2]):(t=e[1],o=void 0),{hString:t,bString:o}},getFacetsFromHierarchyString(e){let t,o,r,a=e.split(">");return a.length==3?(r=a[2],t=a[1],o=a[0]):(t=a[1],o=a[0]),{facet:t,facet2:r,term:o}},showAllEventModifier:function(e){if(e.map(o=>o?o[1].toLowerCase().includes("show all"):!1).includes(!0)){let o=[],r={};for(const a in e)r[e[a][0]]===void 0&&(r[e[a][0]]=[]),r[e[a][0]].push(e[a]);for(const a in r){let i;for(let s=r[a].length-1;s>=0;s--)if(r[a][s][1].toLowerCase().includes("show all")){i=r[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&r[a].length>0?o.push(...r[a]):o.push(i):o.push(...r[a])}return o.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=o=>{let r=[o.facetPropPath,this.createCascaderItemValue(Zi(o.term),o.facet)];return o.facet2&&r.push(this.createCascaderItemValue(Zi(o.term),o.facet,o.facet2)),r};this.cascadeSelected=e.map(o=>t(o)),this.cascadeSelectedWithBoolean=e.map(o=>{let r=t(o);return r.push(o.AND),r}),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(o=>o.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){var t,o;if(e&&e.facet&&e.term){const r=e.facet.toLowerCase();if(e.facet2)return e;for(const a of this.options)if(a.value===e.facetPropPath)for(const i of a.children){if(((t=i.label)==null?void 0:t.toLowerCase())===r)return e.facet=i.label,e;if(i.children&&i.children.length>0){for(const s of i.children)if(((o=s.label)==null?void 0:o.toLowerCase())===r)return e.facet2=s.label,e.facet=i.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(o=>{const r=this.validateAndConvertFilterToHierarchical(o);r&&t.push(r)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=n.markRaw(new U0(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"),this.replaceCascader()})}},zF=e=>(n.pushScopeId("data-v-80f91d96"),e=e(),n.popScopeId(),e),jF={class:"filters"},HF={key:0,class:"cascader-tag"},UF={class:"el-tags-container"},qF={class:"el-tags-container"},KF={class:"search-filters transition-box"},WF={key:0,class:"filter-default-value"},GF=zF(()=>n.createElementVNode("div",null,[n.createElementVNode("strong",null,"Within categories:"),n.createTextVNode(" OR "),n.createElementVNode("br"),n.createTextVNode(" example: 'heart' OR 'colon' "),n.createElementVNode("br"),n.createElementVNode("br"),n.createElementVNode("strong",null,"Between categories:"),n.createTextVNode(" AND "),n.createElementVNode("br"),n.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),JF={class:"dataset-shown"},ZF={class:"dataset-results-feedback"};function YF(e,t,o,r,a,i){const s=n.resolveComponent("MapSvgSpriteColor"),l=Uo,c=ei,d=gp,u=n.resolveComponent("MapSvgIcon"),p=ml,y=Qa,m=oi;return n.openBlock(),n.createElementBlock("div",jF,[n.createVNode(s),e.presentTags.length>0?(n.openBlock(),n.createElementBlock("div",HF,[n.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=f=>i.cascadeTagClose(e.presentTags[0]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(n.openBlock(),n.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover","popper-class":"cascade-tags-popover"},{default:n.withCtx(()=>[n.createElementVNode("div",UF,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.presentTags.slice(1),(f,h)=>(n.openBlock(),n.createBlock(l,{key:h,class:"ml-2",type:"info",closable:"",onClose:g=>i.cascadeTagClose(f)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(f),1)]),_:2},1032,["onClose"]))),128))])]),reference:n.withCtx(()=>[n.createElementVNode("div",qF,[e.presentTags.length>1?(n.openBlock(),n.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:n.withCtx(()=>[n.createTextVNode(" +"+n.toDisplayString(e.presentTags.length-1),1)]),_:1})):n.createCommentVNode("",!0)])]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createVNode(n.Transition,{name:"el-zoom-in-top"},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("span",KF,[n.createVNode(d,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=f=>e.cascadeSelected=f),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=f=>i.cascadeEvent(f)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(n.openBlock(),n.createElementBlock("div",WF,"Filters")):n.createCommentVNode("",!0),n.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","popper-class":"filter-help-popover"},{reference:n.withCtx(()=>[n.createVNode(u,{icon:"help",class:"help"})]),default:n.withCtx(()=>[GF]),_:1})])),[[n.vShow,e.showFilters],[m,!e.cascaderIsReady]])]),_:1}),n.createElementVNode("div",JF,[n.createElementVNode("span",ZF,n.toDisplayString(i.numberOfResultsText),1),n.createVNode(y,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=f=>e.numberShown=f),placeholder:"10",onChange:t[4]||(t[4]=f=>i.numberShownChanged(f))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.numberDatasetsShown,f=>(n.openBlock(),n.createBlock(p,{key:f,label:f,value:f},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const K0=bn(MF,[["render",YF],["__scopeId","data-v-80f91d96"]]);var XF=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},QF={filters:[],searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const eP={components:{SearchFilters:K0,DatasetCard:o0,SearchHistory:i0,Button:ht,Card:tp,Drawer:dl,Icon:Se,Input:ja,Pagination:Dp},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>QF},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="",o={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&&(o.withSearch&&this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&o.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(q0(e),t).then(o=>{Ge.emit("anatomy-in-datasets",o.forFlatmap),Ge.emit("number-of-datasets-for-anatomies",o.forScaffold)}),this.algoliaClient.search(q0(e),t,this.numberPerPage,this.page).then(o=>{this.numberOfHits=o.total,this.discoverIds=o.discoverIds,this._dois=o.dois,this.results=o.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 r=this._abortController.signal;this.perItemSearch(r,{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(o=>o.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const r=this._dois.shift();r&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[r]},e).then(a=>{a.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.name!=="AbortError"&&(this.handleMissingData(r),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 o=this.results.findIndex(r=>t.doi?t.doi.includes(r.doi):!1);Object.assign(this.results[o],t),Object.assign(this.results[o],{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(r=>r.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(r=>r.species?r.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[o]=this.results[o]})},createfilterParams:function(e){let t=new URLSearchParams;for(const o in e)Array.isArray(e[o])?e[o].forEach(r=>{t.append(o,r)}):t.append(o,e[o]);return t.toString()},callSciCrunch:function(e,t={},o){return new Promise((r,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:o}).then(XF).then(s=>s.json()).then(s=>r(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(Vc)},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=n.markRaw(new U0(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/"}},tP={class:"header"},nP={class:"content scrollbar",ref:"content"},oP={key:0,class:"error-feedback"};function rP(e,t,o,r,a,i){const s=ja,l=ht,c=K0,d=i0,u=o0,p=Dp,y=tp,m=oi;return n.openBlock(),n.createBlock(y,{"body-style":e.bodyStyle,class:"content-card"},{header:n.withCtx(()=>[n.createElementVNode("div",tP,[n.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=f=>e.searchInput=f),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),n.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:n.withCtx(()=>[n.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:n.withCtx(()=>[n.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:o.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),n.createVNode(d,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),n.withDirectives((n.openBlock(),n.createElementBlock("div",nP,[e.results.length===0&&!e.loadingCards?(n.openBlock(),n.createElementBlock("div",oP," No results found - Please change your search / filter criteria. ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.results,f=>(n.openBlock(),n.createElementBlock("div",{key:f.doi,class:"step-item"},[n.createVNode(u,{class:"dataset-card",entry:f,envVars:o.envVars,onMouseenter:h=>i.hoverChanged(f),onMouseleave:t[1]||(t[1]=h=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),n.createVNode(p,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=f=>e.page=f),"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 W0=bn(eP,[["render",rP],["__scopeId","data-v-d3c8c59e"]]),aP={name:"AnnotationTool",components:{AnnotationPopup:No.AnnotationPopup,Button:ht,CreateTooltipContent:No.CreateTooltipContent,Col:wp,ElIconDelete:Fs,Icon:Se,Row:bp},props:{annotationEntry:{type:Object},createData:{type:Object,default:{}}},data:function(){return{ElIconDelete:n.shallowRef(Fs)}}},iP={class:"annotation-tool scrollbar"},sP={key:1,class:"delete-container"};function lP(e,t,o,r,a,i){const s=n.resolveComponent("CreateTooltipContent"),l=n.resolveComponent("annotation-popup"),c=wp,d=ht,u=bp;return n.openBlock(),n.createElementBlock("div",iP,[n.withDirectives(n.createVNode(s,{createData:o.createData,onConfirmCreate:t[0]||(t[0]=p=>e.$emit("confirm-create",p)),onCancelCreate:t[1]||(t[1]=p=>e.$emit("cancel-create")),class:"create-tooltip-content"},null,8,["createData"]),[[n.vShow,o.createData&&o.createData.toBeConfirmed]]),o.annotationEntry&&(!o.createData||!o.createData.toBeConfirmed)?(n.openBlock(),n.createBlock(l,{key:0,class:"annotation-popup",annotationEntry:o.annotationEntry,onAnnotation:t[2]||(t[2]=p=>e.$emit("annotation",p))},null,8,["annotationEntry"])):n.createCommentVNode("",!0),o.createData&&o.createData.toBeDeleted?(n.openBlock(),n.createElementBlock("div",sP,[n.createVNode(u,null,{default:n.withCtx(()=>[n.createVNode(c,{offset:1,span:6},{default:n.withCtx(()=>[n.createTextVNode("Delete this feature?")]),_:1}),n.createVNode(c,{offset:1,span:3},{default:n.withCtx(()=>[n.createVNode(d,{class:"delete-button",icon:e.ElIconDelete,onClick:t[3]||(t[3]=p=>e.$emit("confirm-delete"))},{default:n.withCtx(()=>[n.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),n.createVNode(c,{offset:1,span:2},{default:n.withCtx(()=>[n.createVNode(d,{class:"delete-button",onClick:t[4]||(t[4]=p=>e.$emit("cancel-create"))},{default:n.withCtx(()=>[n.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):n.createCommentVNode("",!0)])}const G0=bn(aP,[["render",lP],["__scopeId","data-v-de83d649"]]),cP=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),ia=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},dP=3e3,uP={name:"ConnectivityInfo",components:{Button:ht,Container:ox,Icon:Se,ElIconArrowUp:jC,ElIconArrowDown:Cr,ElIconWarning:Iu,ExternalResourceCard:No.ExternalResourceCard,CopyToClipboard:No.CopyToClipboard,ConnectivityGraph:No.ConnectivityGraph},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,graphViewLoaded:!1,updatedCopyContent:""}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{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 cP(e)},capitalise:function(e){return ia(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Ge.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){Ge.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(){Ge.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){this.activeView=e,e==="graphView"&&!this.graphViewLoaded&&this.$nextTick(()=>{this.graphViewLoaded=!0})},onTapNode:function(e){const t=e.map(o=>o.label).join(", ");this.toggleConnectivityTooltip(t,{show:!0})},onReferencesLoaded:function(e){this.updatedCopyContent=this.getUpdateCopyContent(e)},getUpdateCopyContent:function(e){var r,a,i,s;if(!this.entry)return"";const t=[];this.entry.title?t.push(`<div><strong>${ia(this.entry.title)}</strong></div>`):t.push(`<div><strong>${this.entry.featureId}</strong></div>`),(r=this.entry.provenanceTaxonomyLabel)!=null&&r.length&&t.push(`<div>${this.provSpeciesDescription}</div>`),this.entry.paths&&t.push(`<div>${this.entry.paths}</div>`);function o(l,c,d=[]){let u=`<div><strong>${l}</strong></div>`;const p=[];c.forEach(m=>{let f=[];m.split(",").forEach(h=>{const g=d.find(b=>b.name===h.trim());g?f.push(`${ia(h)} (${g.id})`):f.push(`${ia(h)}`)}),p.push(f.join(","))});const y=p.map(m=>`<li>${m}</li>`).join(`
|
|
464
|
+
`)},PF=["innerHTML"];function RF(e,t,o,r,a,i){return n.openBlock(),n.createElementBlock("svg",{width:"0",height:"0",style:{display:"none"},innerHTML:e.$options.svgSprite},null,8,PF)}const $F=s0(FF,[["render",RF]]);var H0={exports:{}};/*! algoliasearch.umd.js | 4.23.2 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */(function(e,t){(function(o,r){e.exports=r()})(PE,function(){function o(w,C,k){return C in w?Object.defineProperty(w,C,{value:k,enumerable:!0,configurable:!0,writable:!0}):w[C]=k,w}function r(w,C){var k=Object.keys(w);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(w);C&&(x=x.filter(function(N){return Object.getOwnPropertyDescriptor(w,N).enumerable})),k.push.apply(k,x)}return k}function a(w){for(var C=1;C<arguments.length;C++){var k=arguments[C]!=null?arguments[C]:{};C%2?r(Object(k),!0).forEach(function(x){o(w,x,k[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(k)):r(Object(k)).forEach(function(x){Object.defineProperty(w,x,Object.getOwnPropertyDescriptor(k,x))})}return w}function i(w,C){if(w==null)return{};var k,x,N=function(W,z){if(W==null)return{};var K,ee,J={},se=Object.keys(W);for(ee=0;ee<se.length;ee++)K=se[ee],z.indexOf(K)>=0||(J[K]=W[K]);return J}(w,C);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(w);for(x=0;x<U.length;x++)k=U[x],C.indexOf(k)>=0||Object.prototype.propertyIsEnumerable.call(w,k)&&(N[k]=w[k])}return N}function s(w,C){return function(k){if(Array.isArray(k))return k}(w)||function(k,x){if(Symbol.iterator in Object(k)||Object.prototype.toString.call(k)==="[object Arguments]"){var N=[],U=!0,W=!1,z=void 0;try{for(var K,ee=k[Symbol.iterator]();!(U=(K=ee.next()).done)&&(N.push(K.value),!x||N.length!==x);U=!0);}catch(J){W=!0,z=J}finally{try{U||ee.return==null||ee.return()}finally{if(W)throw z}}return N}}(w,C)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(w){return function(C){if(Array.isArray(C)){for(var k=0,x=new Array(C.length);k<C.length;k++)x[k]=C[k];return x}}(w)||function(C){if(Symbol.iterator in Object(C)||Object.prototype.toString.call(C)==="[object Arguments]")return Array.from(C)}(w)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(w){var C,k="algoliasearch-client-js-".concat(w.key),x=function(){return C===void 0&&(C=w.localStorage||window.localStorage),C},N=function(){return JSON.parse(x().getItem(k)||"{}")},U=function(z){x().setItem(k,JSON.stringify(z))},W=function(){var z=w.timeToLive?1e3*w.timeToLive:null,K=N(),ee=Object.fromEntries(Object.entries(K).filter(function(se){return s(se,2)[1].timestamp!==void 0}));if(U(ee),z){var J=Object.fromEntries(Object.entries(ee).filter(function(se){var ie=s(se,2)[1],ge=new Date().getTime();return!(ie.timestamp+z<ge)}));U(J)}};return{get:function(z,K){var ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){W();var J=JSON.stringify(z);return N()[J]}).then(function(J){return Promise.all([J?J.value:K(),J!==void 0])}).then(function(J){var se=s(J,2),ie=se[0],ge=se[1];return Promise.all([ie,ge||ee.miss(ie)])}).then(function(J){return s(J,1)[0]})},set:function(z,K){return Promise.resolve().then(function(){var ee=N();return ee[JSON.stringify(z)]={timestamp:new Date().getTime(),value:K},x().setItem(k,JSON.stringify(ee)),K})},delete:function(z){return Promise.resolve().then(function(){var K=N();delete K[JSON.stringify(z)],x().setItem(k,JSON.stringify(K))})},clear:function(){return Promise.resolve().then(function(){x().removeItem(k)})}}}function d(w){var C=l(w.caches),k=C.shift();return k===void 0?{get:function(x,N){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},W=N();return W.then(function(z){return Promise.all([z,U.miss(z)])}).then(function(z){return s(z,1)[0]})},set:function(x,N){return Promise.resolve(N)},delete:function(x){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(x,N){var U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return k.get(x,N,U).catch(function(){return d({caches:C}).get(x,N,U)})},set:function(x,N){return k.set(x,N).catch(function(){return d({caches:C}).set(x,N)})},delete:function(x){return k.delete(x).catch(function(){return d({caches:C}).delete(x)})},clear:function(){return k.clear().catch(function(){return d({caches:C}).clear()})}}}function u(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},C={};return{get:function(k,x){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},U=JSON.stringify(k);if(U in C)return Promise.resolve(w.serializable?JSON.parse(C[U]):C[U]);var W=x(),z=N&&N.miss||function(){return Promise.resolve()};return W.then(function(K){return z(K)}).then(function(){return W})},set:function(k,x){return C[JSON.stringify(k)]=w.serializable?JSON.stringify(x):x,Promise.resolve(x)},delete:function(k){return delete C[JSON.stringify(k)],Promise.resolve()},clear:function(){return C={},Promise.resolve()}}}function p(w,C,k){var x={"x-algolia-api-key":k,"x-algolia-application-id":C};return{headers:function(){return w===b.WithinHeaders?x:{}},queryParameters:function(){return w===b.WithinQueryParameters?x:{}}}}function y(w){var C=0;return w(function k(){return C++,new Promise(function(x){setTimeout(function(){x(w(k))},Math.min(100*C,1e3))})})}function m(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(k,x){return Promise.resolve()};return Object.assign(w,{wait:function(k){return m(w.then(function(x){return Promise.all([C(x,k),x])}).then(function(x){return x[1]}))}})}function f(w){for(var C=w.length-1;C>0;C--){var k=Math.floor(Math.random()*(C+1)),x=w[C];w[C]=w[k],w[k]=x}return w}function h(w,C){return C&&Object.keys(C).forEach(function(k){w[k]=C[k](w)}),w}function g(w){for(var C=arguments.length,k=new Array(C>1?C-1:0),x=1;x<C;x++)k[x-1]=arguments[x];var N=0;return w.replace(/%s/g,function(){return encodeURIComponent(k[N++])})}var b={WithinQueryParameters:0,WithinHeaders:1};function v(w,C){var k=w||{},x=k.data||{};return Object.keys(k).forEach(function(N){["timeout","headers","queryParameters","data","cacheable"].indexOf(N)===-1&&(x[N]=k[N])}),{data:Object.entries(x).length>0?x:void 0,timeout:k.timeout||C,headers:k.headers||{},queryParameters:k.queryParameters||{},cacheable:k.cacheable}}var T={Read:1,Write:2,Any:3},S=1,E=2,_=3;function O(w){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S;return a(a({},w),{},{status:C,lastUpdate:Date.now()})}function B(w){return typeof w=="string"?{protocol:"https",url:w,accept:T.Any}:{protocol:w.protocol||"https",url:w.url,accept:w.accept||T.Any}}var A="DELETE",V="GET",F="POST",L="PUT";function j(w,C){return Promise.all(C.map(function(k){return w.get(k,function(){return Promise.resolve(O(k))})})).then(function(k){var x=k.filter(function(W){return function(z){return z.status===S||Date.now()-z.lastUpdate>12e4}(W)}),N=k.filter(function(W){return function(z){return z.status===_&&Date.now()-z.lastUpdate<=12e4}(W)}),U=[].concat(l(x),l(N));return{getTimeout:function(W,z){return(N.length===0&&W===0?1:N.length+3+W)*z},statelessHosts:U.length>0?U.map(function(W){return B(W)}):C}})}function Q(w,C,k,x){var N=[],U=function(ie,ge){if(!(ie.method===V||ie.data===void 0&&ge.data===void 0)){var ue=Array.isArray(ie.data)?ie.data:a(a({},ie.data),ge.data);return JSON.stringify(ue)}}(k,x),W=function(ie,ge){var ue=a(a({},ie.headers),ge.headers),xe={};return Object.keys(ue).forEach(function(Pe){var Et=ue[Pe];xe[Pe.toLowerCase()]=Et}),xe}(w,x),z=k.method,K=k.method!==V?{}:a(a({},k.data),x.data),ee=a(a(a({"x-algolia-agent":w.userAgent.value},w.queryParameters),K),x.queryParameters),J=0,se=function ie(ge,ue){var xe=ge.pop();if(xe===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:oe(N)};var Pe={data:U,headers:W,method:z,url:D(xe,k.path,ee),connectTimeout:ue(J,w.timeouts.connect),responseTimeout:ue(J,x.timeout)},Et=function(_t){var at={request:Pe,response:_t,host:xe,triesLeft:ge.length};return N.push(at),at},ua={onSuccess:function(_t){return function(at){try{return JSON.parse(at.content)}catch(Bo){throw function(eo,lr){return{name:"DeserializationError",message:eo,response:lr}}(Bo.message,at)}}(_t)},onRetry:function(_t){var at=Et(_t);return _t.isTimedOut&&J++,Promise.all([w.logger.info("Retryable failure",he(at)),w.hostsCache.set(xe,O(xe,_t.isTimedOut?_:E))]).then(function(){return ie(ge,ue)})},onFail:function(_t){throw Et(_t),function(at,Bo){var eo=at.content,lr=at.status,fa=eo;try{fa=JSON.parse(eo).message}catch{}return function(ts,Qc,_R){return{name:"ApiError",message:ts,status:Qc,transporterStackTrace:_R}}(fa,lr,Bo)}(_t,oe(N))}};return w.requester.send(Pe).then(function(_t){return function(at,Bo){return function(eo){var lr=eo.status;return eo.isTimedOut||function(fa){var ts=fa.isTimedOut,Qc=fa.status;return!ts&&~~Qc==0}(eo)||~~(lr/100)!=2&&~~(lr/100)!=4}(at)?Bo.onRetry(at):~~(at.status/100)==2?Bo.onSuccess(at):Bo.onFail(at)}(_t,ua)})};return j(w.hostsCache,C).then(function(ie){return se(l(ie.statelessHosts).reverse(),ie.getTimeout)})}function q(w){var C=w.hostsCache,k=w.logger,x=w.requester,N=w.requestsCache,U=w.responsesCache,W=w.timeouts,z=w.userAgent,K=w.hosts,ee=w.queryParameters,J={hostsCache:C,logger:k,requester:x,requestsCache:N,responsesCache:U,timeouts:W,userAgent:z,headers:w.headers,queryParameters:ee,hosts:K.map(function(se){return B(se)}),read:function(se,ie){var ge=v(ie,J.timeouts.read),ue=function(){return Q(J,J.hosts.filter(function(Pe){return(Pe.accept&T.Read)!=0}),se,ge)};if((ge.cacheable!==void 0?ge.cacheable:se.cacheable)!==!0)return ue();var xe={request:se,mappedRequestOptions:ge,transporter:{queryParameters:J.queryParameters,headers:J.headers}};return J.responsesCache.get(xe,function(){return J.requestsCache.get(xe,function(){return J.requestsCache.set(xe,ue()).then(function(Pe){return Promise.all([J.requestsCache.delete(xe),Pe])},function(Pe){return Promise.all([J.requestsCache.delete(xe),Promise.reject(Pe)])}).then(function(Pe){var Et=s(Pe,2);return Et[0],Et[1]})})},{miss:function(Pe){return J.responsesCache.set(xe,Pe)}})},write:function(se,ie){return Q(J,J.hosts.filter(function(ge){return(ge.accept&T.Write)!=0}),se,v(ie,J.timeouts.write))}};return J}function I(w){var C={value:"Algolia for JavaScript (".concat(w,")"),add:function(k){var x="; ".concat(k.segment).concat(k.version!==void 0?" (".concat(k.version,")"):"");return C.value.indexOf(x)===-1&&(C.value="".concat(C.value).concat(x)),C}};return C}function D(w,C,k){var x=ne(k),N="".concat(w.protocol,"://").concat(w.url,"/").concat(C.charAt(0)==="/"?C.substr(1):C);return x.length&&(N+="?".concat(x)),N}function ne(w){return Object.keys(w).map(function(C){return g("%s=%s",C,(k=w[C],Object.prototype.toString.call(k)==="[object Object]"||Object.prototype.toString.call(k)==="[object Array]"?JSON.stringify(w[C]):w[C]));var k}).join("&")}function oe(w){return w.map(function(C){return he(C)})}function he(w){var C=w.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return a(a({},w),{},{request:a(a({},w.request),{},{headers:a(a({},w.request.headers),C)})})}var me=function(w){return function(C,k){return w.transporter.write({method:F,path:"2/abtests",data:C},k)}},Be=function(w){return function(C,k){return w.transporter.write({method:A,path:g("2/abtests/%s",C)},k)}},qe=function(w){return function(C,k){return w.transporter.read({method:V,path:g("2/abtests/%s",C)},k)}},Ie=function(w){return function(C){return w.transporter.read({method:V,path:"2/abtests"},C)}},ye=function(w){return function(C,k){return w.transporter.write({method:F,path:g("2/abtests/%s/stop",C)},k)}},we=function(w){return function(C){return w.transporter.read({method:V,path:"1/strategies/personalization"},C)}},Ne=function(w){return function(C,k){return w.transporter.write({method:F,path:"1/strategies/personalization",data:C},k)}};function $e(w){return function C(k){return w.request(k).then(function(x){if(w.batch!==void 0&&w.batch(x.hits),!w.shouldStop(x))return x.cursor?C({cursor:x.cursor}):C({page:(k.page||0)+1})})}({})}var Jt=function(w){return function(C,k){var x=k||{},N=x.queryParameters,U=i(x,["queryParameters"]),W=a({acl:C},N!==void 0?{queryParameters:N}:{});return m(w.transporter.write({method:F,path:"1/keys",data:W},U),function(z,K){return y(function(ee){return Ce(w)(z.key,K).catch(function(J){if(J.status!==404)throw J;return ee()})})})}},ot=function(w){return function(C,k,x){var N=v(x);return N.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:F,path:"1/clusters/mapping",data:{cluster:k}},N)}},Ye=function(w){return function(C,k,x){return w.transporter.write({method:F,path:"1/clusters/mapping/batch",data:{users:C,cluster:k}},x)}},Ae=function(w){return function(C,k){return m(w.transporter.write({method:F,path:g("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},k),function(x,N){return Xn(w)(x.taskID,N)})}},Ve=function(w){return function(C,k,x){return m(w.transporter.write({method:F,path:g("1/indexes/%s/operation",C),data:{operation:"copy",destination:k}},x),function(N,U){return Fe(w)(C,{methods:{waitTask:Ke}}).waitTask(N.taskID,U)})}},Ct=function(w){return function(C,k,x){return Ve(w)(C,k,a(a({},x),{},{scope:[Xc.Rules]}))}},kt=function(w){return function(C,k,x){return Ve(w)(C,k,a(a({},x),{},{scope:[Xc.Settings]}))}},Je=function(w){return function(C,k,x){return Ve(w)(C,k,a(a({},x),{},{scope:[Xc.Synonyms]}))}},vt=function(w){return function(C,k){return C.method===V?w.transporter.read(C,k):w.transporter.write(C,k)}},rt=function(w){return function(C,k){return m(w.transporter.write({method:A,path:g("1/keys/%s",C)},k),function(x,N){return y(function(U){return Ce(w)(C,N).then(U).catch(function(W){if(W.status!==404)throw W})})})}},Zt=function(w){return function(C,k,x){var N=k.map(function(U){return{action:"deleteEntry",body:{objectID:U}}});return m(w.transporter.write({method:F,path:g("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},x),function(U,W){return Xn(w)(U.taskID,W)})}},Ce=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/keys/%s",C)},k)}},Xe=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/task/%s",C.toString())},k)}},lt=function(w){return function(C){return w.transporter.read({method:V,path:"/1/dictionaries/*/settings"},C)}},Ft=function(w){return function(C){return w.transporter.read({method:V,path:"1/logs"},C)}},Qe=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters/mapping/top"},C)}},H=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/clusters/mapping/%s",C)},k)}},fe=function(w){return function(C){var k=C||{},x=k.retrieveMappings,N=i(k,["retrieveMappings"]);return x===!0&&(N.getClusters=!0),w.transporter.read({method:V,path:"1/clusters/mapping/pending"},N)}},Fe=function(w){return function(C){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x={transporter:w.transporter,appId:w.appId,indexName:C};return h(x,k.methods)}},ct=function(w){return function(C){return w.transporter.read({method:V,path:"1/keys"},C)}},Pt=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters"},C)}},rr=function(w){return function(C){return w.transporter.read({method:V,path:"1/indexes"},C)}},sa=function(w){return function(C){return w.transporter.read({method:V,path:"1/clusters/mapping"},C)}},To=function(w){return function(C,k,x){return m(w.transporter.write({method:F,path:g("1/indexes/%s/operation",C),data:{operation:"move",destination:k}},x),function(N,U){return Fe(w)(C,{methods:{waitTask:Ke}}).waitTask(N.taskID,U)})}},Oo=function(w){return function(C,k){return m(w.transporter.write({method:F,path:"1/indexes/*/batch",data:{requests:C}},k),function(x,N){return Promise.all(Object.keys(x.taskID).map(function(U){return Fe(w)(U,{methods:{waitTask:Ke}}).waitTask(x.taskID[U],N)}))})}},M=function(w){return function(C,k){return w.transporter.read({method:F,path:"1/indexes/*/objects",data:{requests:C}},k)}},Z=function(w){return function(C,k){var x=C.map(function(N){return a(a({},N),{},{params:ne(N.params||{})})});return w.transporter.read({method:F,path:"1/indexes/*/queries",data:{requests:x},cacheable:!0},k)}},Y=function(w){return function(C,k){return Promise.all(C.map(function(x){var N=x.params,U=N.facetName,W=N.facetQuery,z=i(N,["facetName","facetQuery"]);return Fe(w)(x.indexName,{methods:{searchForFacetValues:ey}}).searchForFacetValues(U,W,a(a({},k),z))}))}},ke=function(w){return function(C,k){var x=v(k);return x.queryParameters["X-Algolia-User-ID"]=C,w.transporter.write({method:A,path:"1/clusters/mapping"},x)}},Rt=function(w){return function(C,k,x){var N=k.map(function(U){return{action:"addEntry",body:U}});return m(w.transporter.write({method:F,path:g("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!0,requests:N}},x),function(U,W){return Xn(w)(U.taskID,W)})}},St=function(w){return function(C,k){return m(w.transporter.write({method:F,path:g("1/keys/%s/restore",C)},k),function(x,N){return y(function(U){return Ce(w)(C,N).catch(function(W){if(W.status!==404)throw W;return U()})})})}},$t=function(w){return function(C,k,x){var N=k.map(function(U){return{action:"addEntry",body:U}});return m(w.transporter.write({method:F,path:g("/1/dictionaries/%s/batch",C),data:{clearExistingDictionaryEntries:!1,requests:N}},x),function(U,W){return Xn(w)(U.taskID,W)})}},ar=function(w){return function(C,k,x){return w.transporter.read({method:F,path:g("/1/dictionaries/%s/search",C),data:{query:k},cacheable:!0},x)}},Yi=function(w){return function(C,k){return w.transporter.read({method:F,path:"1/clusters/mapping/search",data:{query:C}},k)}},Mc=function(w){return function(C,k){return m(w.transporter.write({method:L,path:"/1/dictionaries/*/settings",data:C},k),function(x,N){return Xn(w)(x.taskID,N)})}},zc=function(w){return function(C,k){var x=Object.assign({},k),N=k||{},U=N.queryParameters,W=i(N,["queryParameters"]),z=U?{queryParameters:U}:{},K=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(w.transporter.write({method:L,path:g("1/keys/%s",C),data:z},W),function(ee,J){return y(function(se){return Ce(w)(C,J).then(function(ie){return function(ge){return Object.keys(x).filter(function(ue){return K.indexOf(ue)!==-1}).every(function(ue){if(Array.isArray(ge[ue])&&Array.isArray(x[ue])){var xe=ge[ue];return xe.length===x[ue].length&&xe.every(function(Pe,Et){return Pe===x[ue][Et]})}return ge[ue]===x[ue]})}(ie)?Promise.resolve():se()})})})}},Xn=function(w){return function(C,k){return y(function(x){return Xe(w)(C,k).then(function(N){return N.status!=="published"?x():void 0})})}},la=function(w){return function(C,k){return m(w.transporter.write({method:F,path:g("1/indexes/%s/batch",w.indexName),data:{requests:C}},k),function(x,N){return Ke(w)(x.taskID,N)})}},jc=function(w){return function(C){return $e(a(a({shouldStop:function(k){return k.cursor===void 0}},C),{},{request:function(k){return w.transporter.read({method:F,path:g("1/indexes/%s/browse",w.indexName),data:k},C)}}))}},ca=function(w){return function(C){var k=a({hitsPerPage:1e3},C);return $e(a(a({shouldStop:function(x){return x.hits.length<k.hitsPerPage}},k),{},{request:function(x){return ty(w)("",a(a({},k),x)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(U){return delete U._highlightResult,U})})})}}))}},Hc=function(w){return function(C){var k=a({hitsPerPage:1e3},C);return $e(a(a({shouldStop:function(x){return x.hits.length<k.hitsPerPage}},k),{},{request:function(x){return ny(w)("",a(a({},k),x)).then(function(N){return a(a({},N),{},{hits:N.hits.map(function(U){return delete U._highlightResult,U})})})}}))}},da=function(w){return function(C,k,x){var N=x||{},U=N.batchSize,W=i(N,["batchSize"]),z={taskIDs:[],objectIDs:[]};return m(function K(){var ee,J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,se=[];for(ee=J;ee<C.length&&(se.push(C[ee]),se.length!==(U||1e3));ee++);return se.length===0?Promise.resolve(z):la(w)(se.map(function(ie){return{action:k,body:ie}}),W).then(function(ie){return z.objectIDs=z.objectIDs.concat(ie.objectIDs),z.taskIDs.push(ie.taskID),ee++,K(ee)})}(),function(K,ee){return Promise.all(K.taskIDs.map(function(J){return Ke(w)(J,ee)}))})}},Uc=function(w){return function(C){return m(w.transporter.write({method:F,path:g("1/indexes/%s/clear",w.indexName)},C),function(k,x){return Ke(w)(k.taskID,x)})}},Xi=function(w){return function(C){var k=C||{},x=k.forwardToReplicas,N=v(i(k,["forwardToReplicas"]));return x&&(N.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:F,path:g("1/indexes/%s/rules/clear",w.indexName)},N),function(U,W){return Ke(w)(U.taskID,W)})}},qc=function(w){return function(C){var k=C||{},x=k.forwardToReplicas,N=v(i(k,["forwardToReplicas"]));return x&&(N.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:F,path:g("1/indexes/%s/synonyms/clear",w.indexName)},N),function(U,W){return Ke(w)(U.taskID,W)})}},Kc=function(w){return function(C,k){return m(w.transporter.write({method:F,path:g("1/indexes/%s/deleteByQuery",w.indexName),data:C},k),function(x,N){return Ke(w)(x.taskID,N)})}},Wc=function(w){return function(C){return m(w.transporter.write({method:A,path:g("1/indexes/%s",w.indexName)},C),function(k,x){return Ke(w)(k.taskID,x)})}},Gc=function(w){return function(C,k){return m(P(w)([C],k).then(function(x){return{taskID:x.taskIDs[0]}}),function(x,N){return Ke(w)(x.taskID,N)})}},P=function(w){return function(C,k){var x=C.map(function(N){return{objectID:N}});return da(w)(x,sr.DeleteObject,k)}},G=function(w){return function(C,k){var x=k||{},N=x.forwardToReplicas,U=v(i(x,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:g("1/indexes/%s/rules/%s",w.indexName,C)},U),function(W,z){return Ke(w)(W.taskID,z)})}},de=function(w){return function(C,k){var x=k||{},N=x.forwardToReplicas,U=v(i(x,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:g("1/indexes/%s/synonyms/%s",w.indexName,C)},U),function(W,z){return Ke(w)(W.taskID,z)})}},Ee=function(w){return function(C){return Y0(w)(C).then(function(){return!0}).catch(function(k){if(k.status!==404)throw k;return!1})}},kn=function(w){return function(C,k,x){return w.transporter.read({method:F,path:g("1/answers/%s/prediction",w.indexName),data:{query:C,queryLanguages:k},cacheable:!0},x)}},Qn=function(w){return function(C,k){var x=k||{},N=x.query,U=x.paginate,W=i(x,["query","paginate"]),z=0;return function K(){return Q0(w)(N||"",a(a({},W),{},{page:z})).then(function(ee){for(var J=0,se=Object.entries(ee.hits);J<se.length;J++){var ie=s(se[J],2),ge=ie[0],ue=ie[1];if(C(ue))return{object:ue,position:parseInt(ge,10),page:z}}if(z++,U===!1||z>=ee.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return K()})}()}},ir=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/indexes/%s/%s",w.indexName,C)},k)}},Rn=function(){return function(w,C){for(var k=0,x=Object.entries(w.hits);k<x.length;k++){var N=s(x[k],2),U=N[0];if(N[1].objectID===C)return parseInt(U,10)}return-1}},Yt=function(w){return function(C,k){var x=k||{},N=x.attributesToRetrieve,U=i(x,["attributesToRetrieve"]),W=C.map(function(z){return a({indexName:w.indexName,objectID:z},N?{attributesToRetrieve:N}:{})});return w.transporter.read({method:F,path:"1/indexes/*/objects",data:{requests:W}},U)}},Qi=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/indexes/%s/rules/%s",w.indexName,C)},k)}},Y0=function(w){return function(C){return w.transporter.read({method:V,path:g("1/indexes/%s/settings",w.indexName),data:{getVersion:2}},C)}},sR=function(w){return function(C,k){return w.transporter.read({method:V,path:g("1/indexes/%s/synonyms/%s",w.indexName,C)},k)}},lR=function(w){return function(C,k){return m(X0(w)([C],k).then(function(x){return{objectID:x.objectIDs[0],taskID:x.taskIDs[0]}}),function(x,N){return Ke(w)(x.taskID,N)})}},X0=function(w){return function(C,k){var x=k||{},N=x.createIfNotExists,U=i(x,["createIfNotExists"]),W=N?sr.PartialUpdateObject:sr.PartialUpdateObjectNoCreate;return da(w)(C,W,U)}},cR=function(w){return function(C,k){var x=k||{},N=x.safe,U=x.autoGenerateObjectIDIfNotExist,W=x.batchSize,z=i(x,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),K=function(ue,xe,Pe,Et){return m(w.transporter.write({method:F,path:g("1/indexes/%s/operation",ue),data:{operation:Pe,destination:xe}},Et),function(ua,_t){return Ke(w)(ua.taskID,_t)})},ee=Math.random().toString(36).substring(7),J="".concat(w.indexName,"_tmp_").concat(ee),se=Jc({appId:w.appId,transporter:w.transporter,indexName:J}),ie=[],ge=K(w.indexName,J,"copy",a(a({},z),{},{scope:["settings","synonyms","rules"]}));return ie.push(ge),m((N?ge.wait(z):ge).then(function(){var ue=se(C,a(a({},z),{},{autoGenerateObjectIDIfNotExist:U,batchSize:W}));return ie.push(ue),N?ue.wait(z):ue}).then(function(){var ue=K(J,w.indexName,"move",z);return ie.push(ue),N?ue.wait(z):ue}).then(function(){return Promise.all(ie)}).then(function(ue){var xe=s(ue,3),Pe=xe[0],Et=xe[1],ua=xe[2];return{objectIDs:Et.objectIDs,taskIDs:[Pe.taskID].concat(l(Et.taskIDs),[ua.taskID])}}),function(ue,xe){return Promise.all(ie.map(function(Pe){return Pe.wait(xe)}))})}},dR=function(w){return function(C,k){return Zc(w)(C,a(a({},k),{},{clearExistingRules:!0}))}},uR=function(w){return function(C,k){return Yc(w)(C,a(a({},k),{},{clearExistingSynonyms:!0}))}},fR=function(w){return function(C,k){return m(Jc(w)([C],k).then(function(x){return{objectID:x.objectIDs[0],taskID:x.taskIDs[0]}}),function(x,N){return Ke(w)(x.taskID,N)})}},Jc=function(w){return function(C,k){var x=k||{},N=x.autoGenerateObjectIDIfNotExist,U=i(x,["autoGenerateObjectIDIfNotExist"]),W=N?sr.AddObject:sr.UpdateObject;if(W===sr.UpdateObject){var z=!0,K=!1,ee=void 0;try{for(var J,se=C[Symbol.iterator]();!(z=(J=se.next()).done);z=!0)if(J.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(ie){K=!0,ee=ie}finally{try{z||se.return==null||se.return()}finally{if(K)throw ee}}}return da(w)(C,W,U)}},pR=function(w){return function(C,k){return Zc(w)([C],k)}},Zc=function(w){return function(C,k){var x=k||{},N=x.forwardToReplicas,U=x.clearExistingRules,W=v(i(x,["forwardToReplicas","clearExistingRules"]));return N&&(W.queryParameters.forwardToReplicas=1),U&&(W.queryParameters.clearExistingRules=1),m(w.transporter.write({method:F,path:g("1/indexes/%s/rules/batch",w.indexName),data:C},W),function(z,K){return Ke(w)(z.taskID,K)})}},hR=function(w){return function(C,k){return Yc(w)([C],k)}},Yc=function(w){return function(C,k){var x=k||{},N=x.forwardToReplicas,U=x.clearExistingSynonyms,W=x.replaceExistingSynonyms,z=v(i(x,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return N&&(z.queryParameters.forwardToReplicas=1),(W||U)&&(z.queryParameters.replaceExistingSynonyms=1),m(w.transporter.write({method:F,path:g("1/indexes/%s/synonyms/batch",w.indexName),data:C},z),function(K,ee){return Ke(w)(K.taskID,ee)})}},Q0=function(w){return function(C,k){return w.transporter.read({method:F,path:g("1/indexes/%s/query",w.indexName),data:{query:C},cacheable:!0},k)}},ey=function(w){return function(C,k,x){return w.transporter.read({method:F,path:g("1/indexes/%s/facets/%s/query",w.indexName,C),data:{facetQuery:k},cacheable:!0},x)}},ty=function(w){return function(C,k){return w.transporter.read({method:F,path:g("1/indexes/%s/rules/search",w.indexName),data:{query:C}},k)}},ny=function(w){return function(C,k){return w.transporter.read({method:F,path:g("1/indexes/%s/synonyms/search",w.indexName),data:{query:C}},k)}},mR=function(w){return function(C,k){var x=k||{},N=x.forwardToReplicas,U=v(i(x,["forwardToReplicas"]));return N&&(U.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:L,path:g("1/indexes/%s/settings",w.indexName),data:C},U),function(W,z){return Ke(w)(W.taskID,z)})}},Ke=function(w){return function(C,k){return y(function(x){return function(N){return function(U,W){return N.transporter.read({method:V,path:g("1/indexes/%s/task/%s",N.indexName,U.toString())},W)}}(w)(C,k).then(function(N){return N.status!=="published"?x():void 0})})}},sr={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},Xc={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},gR=1,yR=2,bR=3,es=function(w){return function(C,k){var x=C.map(function(N){return a(a({},N),{},{threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:x},cacheable:!0},k)}},wR=function(w){return function(C,k){return es(w)(C.map(function(x){return a(a({},x),{},{fallbackParameters:{},model:"bought-together"})}),k)}},CR=function(w){return function(C,k){return es(w)(C.map(function(x){return a(a({},x),{},{model:"related-products"})}),k)}},kR=function(w){return function(C,k){var x=C.map(function(N){return a(a({},N),{},{model:"trending-facets",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:x},cacheable:!0},k)}},vR=function(w){return function(C,k){var x=C.map(function(N){return a(a({},N),{},{model:"trending-items",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:x},cacheable:!0},k)}},SR=function(w){return function(C,k){return es(w)(C.map(function(x){return a(a({},x),{},{model:"looking-similar"})}),k)}},ER=function(w){return function(C,k){var x=C.map(function(N){return a(a({},N),{},{model:"recommended-for-you",threshold:N.threshold||0})});return w.transporter.read({method:F,path:"1/indexes/*/recommendations",data:{requests:x},cacheable:!0},k)}};function oy(w,C,k){var x,N={appId:w,apiKey:C,timeouts:{connect:1,read:2,write:30},requester:{send:function(z){return new Promise(function(K){var ee=new XMLHttpRequest;ee.open(z.method,z.url,!0),Object.keys(z.headers).forEach(function(ge){return ee.setRequestHeader(ge,z.headers[ge])});var J,se=function(ge,ue){return setTimeout(function(){ee.abort(),K({status:0,content:ue,isTimedOut:!0})},1e3*ge)},ie=se(z.connectTimeout,"Connection timeout");ee.onreadystatechange=function(){ee.readyState>ee.OPENED&&J===void 0&&(clearTimeout(ie),J=se(z.responseTimeout,"Socket timeout"))},ee.onerror=function(){ee.status===0&&(clearTimeout(ie),clearTimeout(J),K({content:ee.responseText||"Network request failed",status:ee.status,isTimedOut:!1}))},ee.onload=function(){clearTimeout(ie),clearTimeout(J),K({content:ee.responseText,status:ee.status,isTimedOut:!1})},ee.send(z.data)})}},logger:(x=bR,{debug:function(z,K){return gR>=x&&console.debug(z,K),Promise.resolve()},info:function(z,K){return yR>=x&&console.info(z,K),Promise.resolve()},error:function(z,K){return console.error(z,K),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:d({caches:[c({key:"".concat("4.23.2","-").concat(w)}),u()]}),userAgent:I("4.23.2").add({segment:"Browser"})},U=a(a({},N),k),W=function(){return function(z){return function(K){var ee=K.region||"us",J=p(b.WithinHeaders,K.appId,K.apiKey),se=q(a(a({hosts:[{url:"personalization.".concat(ee,".algolia.com")}]},K),{},{headers:a(a(a({},J.headers()),{"content-type":"application/json"}),K.headers),queryParameters:a(a({},J.queryParameters()),K.queryParameters)}));return h({appId:K.appId,transporter:se},K.methods)}(a(a(a({},N),z),{},{methods:{getPersonalizationStrategy:we,setPersonalizationStrategy:Ne}}))}};return function(z){var K=z.appId,ee=p(z.authMode!==void 0?z.authMode:b.WithinHeaders,K,z.apiKey),J=q(a(a({hosts:[{url:"".concat(K,"-dsn.algolia.net"),accept:T.Read},{url:"".concat(K,".algolia.net"),accept:T.Write}].concat(f([{url:"".concat(K,"-1.algolianet.com")},{url:"".concat(K,"-2.algolianet.com")},{url:"".concat(K,"-3.algolianet.com")}]))},z),{},{headers:a(a(a({},ee.headers()),{"content-type":"application/x-www-form-urlencoded"}),z.headers),queryParameters:a(a({},ee.queryParameters()),z.queryParameters)}));return h({transporter:J,appId:K,addAlgoliaAgent:function(se,ie){J.userAgent.add({segment:se,version:ie})},clearCache:function(){return Promise.all([J.requestsCache.clear(),J.responsesCache.clear()]).then(function(){})}},z.methods)}(a(a({},U),{},{methods:{search:Z,searchForFacetValues:Y,multipleBatch:Oo,multipleGetObjects:M,multipleQueries:Z,copyIndex:Ve,copySettings:kt,copySynonyms:Je,copyRules:Ct,moveIndex:To,listIndices:rr,getLogs:Ft,listClusters:Pt,multipleSearchForFacetValues:Y,getApiKey:Ce,addApiKey:Jt,listApiKeys:ct,updateApiKey:zc,deleteApiKey:rt,restoreApiKey:St,assignUserID:ot,assignUserIDs:Ye,getUserID:H,searchUserIDs:Yi,listUserIDs:sa,getTopUserIDs:Qe,removeUserID:ke,hasPendingMappings:fe,clearDictionaryEntries:Ae,deleteDictionaryEntries:Zt,getDictionarySettings:lt,getAppTask:Xe,replaceDictionaryEntries:Rt,saveDictionaryEntries:$t,searchDictionaryEntries:ar,setDictionarySettings:Mc,waitAppTask:Xn,customRequest:vt,initIndex:function(z){return function(K){return Fe(z)(K,{methods:{batch:la,delete:Wc,findAnswers:kn,getObject:ir,getObjects:Yt,saveObject:fR,saveObjects:Jc,search:Q0,searchForFacetValues:ey,waitTask:Ke,setSettings:mR,getSettings:Y0,partialUpdateObject:lR,partialUpdateObjects:X0,deleteObject:Gc,deleteObjects:P,deleteBy:Kc,clearObjects:Uc,browseObjects:jc,getObjectPosition:Rn,findObject:Qn,exists:Ee,saveSynonym:hR,saveSynonyms:Yc,getSynonym:sR,searchSynonyms:ny,browseSynonyms:Hc,deleteSynonym:de,clearSynonyms:qc,replaceAllObjects:cR,replaceAllSynonyms:uR,searchRules:ty,getRule:Qi,deleteRule:G,saveRule:pR,saveRules:Zc,replaceAllRules:dR,browseRules:ca,clearRules:Xi}})}},initAnalytics:function(){return function(z){return function(K){var ee=K.region||"us",J=p(b.WithinHeaders,K.appId,K.apiKey),se=q(a(a({hosts:[{url:"analytics.".concat(ee,".algolia.com")}]},K),{},{headers:a(a(a({},J.headers()),{"content-type":"application/json"}),K.headers),queryParameters:a(a({},J.queryParameters()),K.queryParameters)}));return h({appId:K.appId,transporter:se},K.methods)}(a(a(a({},N),z),{},{methods:{addABTest:me,getABTest:qe,getABTests:Ie,stopABTest:ye,deleteABTest:Be}}))}},initPersonalization:W,initRecommendation:function(){return function(z){return U.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),W()(z)}},getRecommendations:es,getFrequentlyBoughtTogether:wR,getLookingSimilar:SR,getRecommendedForYou:ER,getRelatedProducts:CR,getTrendingFacets:kR,getTrendingItems:vR}}))}return oy.version="4.23.2",oy})})(H0);var LF=H0.exports;const VF=RE(LF);class U0{constructor(t,o,r="https://api.pennsieve.io"){this.client=VF(t,o),this.PENNSIEVE_API_LOCATION=r,this.anatomyFacetLabels=[]}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const o=t.map(s=>s.facetPropPath),r=t.map(s=>s.facetSubpropPath);let a=[],i=0;return this.index.search("",{sortFacetValuesBy:"alpha",facets:o.concat(r)}).then(s=>(o.map(l=>{const c=t.find(m=>m.facetPropPath==l);var d=[];const u=s.facets;if(u===void 0)return;const p=u[l]==null?{}:u[l],y=c&&u[c.facetSubpropPath]?Object.keys(u[c.facetSubpropPath]):[];Object.keys(p).map(m=>{const f=y.reduce((g,b)=>{const v=b.split(".");return v.length!==2||m===v[0]&&g.push({label:v[1],id:i++,facetPropPath:`${c?c.facetSubpropPath:void 0}`}),g},[]);let h={label:m,id:i++,facetPropPath:l};f.length>0&&(h.children=f),d.push(h)}),d.length>0&&a.push({label:c?c.label:"",id:i++,children:d,key:l})}),a))}_discoverAllDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{fetch(`${o}/discover/datasets/${t}/versions`).then(a=>a.json()).then(a=>{r(a.map(i=>i.doi))})})}_expandDois(t,o="https://api.pennsieve.io"){return new Promise(r=>{let a=t.map(i=>this._discoverAllDois(i,o));Promise.all(a).then(i=>{r(i.flat())})})}_processResultsForCards(t){let o=[],r={};for(let a of t)r={...a},r={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},o.push(r);return o}_processAnatomy(t){let o=[],r=[],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"))&&o.push(this._processUberonURL(c))}),s.anatomy&&s.anatomy.organ&&s.anatomy.organ.forEach(l=>{l.curie&&(o.push(l.curie),r.push(l.name))})}),i=[...new Set(o)],a=[...new Set(r)],this.anatomyFacetLabels=a,i}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,o="",r=10,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,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,o="",r=999999,a=1){return new Promise(i=>{this.index.search(o,{facets:["*"],hitsPerPage:r,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(r=>({id:r.objectID,terms:r.anatomy?r.anatomy.organ.map(a=>a.curie):[]}))}processResultsForScaffold(t){let o={};return t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.name&&(o[a.name]?o[a.name]++:o[a.name]=1)})}),o}}const Vc=[{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"},{label:"Funding Program",id:"pennsieve.organization",facetPropPath:"pennsieve.organization.name",facetSubpropPath:"pennsieve.organization.subcategory.name"}];function q0(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>a.label=a.facet);let t=DF(e),o="NOT item.published.status:embargo";return o=`(${o}) AND `,Vc.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 "))})`,o+=`${s+l} AND `,o=o.split("()AND ").join(""))}),o.substring(0,o.lastIndexOf(" AND "))}function DF(e){return e.filter(t=>t.label!=="Show all")}const Zi=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Dc=function(e){const t=e.toLowerCase();return Gi[t]?Zi(Gi[t]):Zi(t)},MF={name:"SearchFilters",components:{MapSvgIcon:OF,MapSvgSpriteColor:$F,Option:ml,Select:Qa,Popover:ei,Cascader:gp},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:[],filterTimeout:null,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=n.markRaw({}),t=n.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,o=void 0){let r=e;return t&&(r=`${e}>${t}`),t&&o&&(r=`${e}>${t}>${o}`),!t&&o&&console.warn(`Warning: ${o} provided without its parent, this will not be shown in the cascader`),r},populateCascader:function(){return new Promise(e=>{this.algoliaClient.getAlgoliaFacets(Vc).then(t=>{this.facets=t,Ge.emit("available-facets",t),this.options=t,this.options.forEach((o,r)=>{this.options[r].total=this.countTotalFacet(o),this.options[r].label=Dc(o.label),this.options[r].value=this.createCascaderItemValue(o.key,void 0),this.options[r].children.unshift({value:this.createCascaderItemValue("Show all"),label:"Show all"}),this.options[r].children.forEach((a,i)=>{this.options[r].children[i].facetPropPath!=="pennsieve.organization.name"&&(this.options[r].children[i].label=Dc(a.label)),this.options[r].children[i].value=this.createCascaderItemValue(o.label,a.label),this.options[r].children[i].children&&this.options[r].children[i].children.length>0&&this.options[r].children[i].children.forEach((s,l)=>{this.options[r].children[i].children[l].label=Dc(s.label),this.options[r].children[i].children[l].value=this.createCascaderItemValue(o.label,a.label,s.label)})})})}).finally(()=>{e()})})},cascadeTagClose:function(e){let t=[];Object.entries(this.cascaderTags).map(o=>{const r=o[0],a=o[1],i=this.options.filter(l=>l.label==r)[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(p=>{const y=p[0],m=p[1];y===d&&c.children.map(f=>{const h=f.label,g=f.value;h!==e&&m.includes(h)&&t.push([s,g])})})}}),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(o=>{this.correctnessCheck.facet.add(o.label),t.label==="Anatomical structure"&&o.label!=="Show all"&&o.children.map(r=>{this.correctnessCheck.facet2.add(r.label)})})}),this.cascaderTags={},this.presentTags=[],e.map(t=>{const{facet:o,facet2:r,term:a}=t;this.correctnessCheck.term.has(a)&&this.correctnessCheck.facet.has(o)&&(r?this.correctnessCheck.facet2.has(r)&&(a in this.cascaderTags?o in this.cascaderTags[a]?this.cascaderTags[a][o].push(r):this.cascaderTags[a][o]=[r]:(this.cascaderTags[a]={},this.cascaderTags[a][o]=[r])):a in this.cascaderTags&&a!=="Anatomical structure"?this.cascaderTags[a].push(o):o.toLowerCase()!=="show all"?this.cascaderTags[a]=[o]:this.cascaderTags[a]=[])}),Object.values(this.cascaderTags).map(t=>{const o=Array.isArray(t)?t:Object.values(t).flat(1);this.presentTags=[...this.presentTags,...o]}),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((o,r)=>(o=typeof o=="number"?o:o.children.length,o+r.children.length)):e.children.length},showAllEventModifierForAutoCheckAll:function(e){const t={};return e.map(o=>{const r=o[0];r in t?t[r]+=1:t[r]=1}),this.options.map(o=>{const r=o.key,a=o.children.filter(s=>s.label==="Show all")[0].value,i=o.total;t[r]===i&&(e=e.filter(s=>s[0]!==o.key),delete t[r]),r in t||e.unshift([r,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 o=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}}),r=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:p,term:y}=this.getFacetsFromHierarchyString(c);return p&&(u=p,s="anatomy.organ.name"),{facetPropPath:l,facet:u,term:y,AND:d,facetSubPropPath:s}});r.filter(i=>i.facet!=="Show all").length||(r=[]),this.filterTimeout&&clearTimeout(this.filterTimeout),this.$emit("loading",!0),this.setCascader(o),this.filterTimeout=setTimeout(()=>{this.$emit("filterResults",r),this.cssMods()},600)}},findHierarachyStringAndBooleanString(e){let t,o;return e.length>=3?e[2]&&(typeof e[2]=="string"||e[2]instanceof String)&&e[2].split(">").length>2?(t=e[2],o=e.length==4?e[3]:void 0):(t=e[1],o=e[2]):(t=e[1],o=void 0),{hString:t,bString:o}},getFacetsFromHierarchyString(e){let t,o,r,a=e.split(">");return a.length==3?(r=a[2],t=a[1],o=a[0]):(t=a[1],o=a[0]),{facet:t,facet2:r,term:o}},showAllEventModifier:function(e){if(e.map(o=>o?o[1].toLowerCase().includes("show all"):!1).includes(!0)){let o=[],r={};for(const a in e)r[e[a][0]]===void 0&&(r[e[a][0]]=[]),r[e[a][0]].push(e[a]);for(const a in r){let i;for(let s=r[a].length-1;s>=0;s--)if(r[a][s][1].toLowerCase().includes("show all")){i=r[a].splice(s,1)[0];break}i?this.previousShowAllChecked[a]&&r[a].length>0?o.push(...r[a]):o.push(i):o.push(...r[a])}return o.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=o=>{let r=[o.facetPropPath,this.createCascaderItemValue(Zi(o.term),o.facet)];return o.facet2&&r.push(this.createCascaderItemValue(Zi(o.term),o.facet,o.facet2)),r};this.cascadeSelected=e.map(o=>t(o)),this.cascadeSelectedWithBoolean=e.map(o=>{let r=t(o);return r.push(o.AND),r}),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(o=>o.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){var t,o;if(e&&e.facet&&e.term){const r=e.facet.toLowerCase();if(e.facet2)return e;for(const a of this.options)if(a.value===e.facetPropPath)for(const i of a.children){if(((t=i.label)==null?void 0:t.toLowerCase())===r)return e.facet=i.label,e;if(i.children&&i.children.length>0){for(const s of i.children)if(((o=s.label)==null?void 0:o.toLowerCase())===r)return e.facet2=s.label,e.facet=i.label,e}}}return!1},getHierarchicalValidatedFilters:function(e){if(e)if(this.cascaderIsReady){const t=[];return e.forEach(o=>{const r=this.validateAndConvertFilterToHierarchical(o);r&&t.push(r)}),t}else return e;return[]}},mounted:function(){this.algoliaClient=n.markRaw(new U0(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")})}},zF=e=>(n.pushScopeId("data-v-4088113a"),e=e(),n.popScopeId(),e),jF={class:"filters"},HF={key:0,class:"cascader-tag"},UF={class:"el-tags-container"},qF={class:"el-tags-container"},KF={class:"search-filters transition-box"},WF={key:0,class:"filter-default-value"},GF=zF(()=>n.createElementVNode("div",null,[n.createElementVNode("strong",null,"Within categories:"),n.createTextVNode(" OR "),n.createElementVNode("br"),n.createTextVNode(" example: 'heart' OR 'colon' "),n.createElementVNode("br"),n.createElementVNode("br"),n.createElementVNode("strong",null,"Between categories:"),n.createTextVNode(" AND "),n.createElementVNode("br"),n.createTextVNode(" example: 'rat' AND 'lung' ")],-1)),JF={class:"dataset-shown"},ZF={class:"dataset-results-feedback"};function YF(e,t,o,r,a,i){const s=n.resolveComponent("MapSvgSpriteColor"),l=Uo,c=ei,d=gp,u=n.resolveComponent("MapSvgIcon"),p=ml,y=Qa,m=oi;return n.openBlock(),n.createElementBlock("div",jF,[n.createVNode(s),e.presentTags.length>0?(n.openBlock(),n.createElementBlock("div",HF,[n.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=f=>i.cascadeTagClose(e.presentTags[0]))},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.presentTags[0]),1)]),_:1}),e.presentTags.length>1?(n.openBlock(),n.createBlock(c,{key:0,placement:"bottom-start",width:200,trigger:"hover","popper-class":"cascade-tags-popover"},{default:n.withCtx(()=>[n.createElementVNode("div",UF,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.presentTags.slice(1),(f,h)=>(n.openBlock(),n.createBlock(l,{key:h,class:"ml-2",type:"info",closable:"",onClose:g=>i.cascadeTagClose(f)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(f),1)]),_:2},1032,["onClose"]))),128))])]),reference:n.withCtx(()=>[n.createElementVNode("div",qF,[e.presentTags.length>1?(n.openBlock(),n.createBlock(l,{key:0,class:"ml-2",type:"info"},{default:n.withCtx(()=>[n.createTextVNode(" +"+n.toDisplayString(e.presentTags.length-1),1)]),_:1})):n.createCommentVNode("",!0)])]),_:1})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createVNode(n.Transition,{name:"el-zoom-in-top"},{default:n.withCtx(()=>[n.withDirectives((n.openBlock(),n.createElementBlock("span",KF,[n.createVNode(d,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[1]||(t[1]=f=>e.cascadeSelected=f),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.props,onChange:t[2]||(t[2]=f=>i.cascadeEvent(f)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},null,8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(n.openBlock(),n.createElementBlock("div",WF,"Filters")):n.createCommentVNode("",!0),n.createVNode(c,{title:"How do filters work?",width:"250",trigger:"hover","popper-class":"filter-help-popover"},{reference:n.withCtx(()=>[n.createVNode(u,{icon:"help",class:"help"})]),default:n.withCtx(()=>[GF]),_:1})])),[[n.vShow,e.showFilters],[m,!e.cascaderIsReady]])]),_:1}),n.createElementVNode("div",JF,[n.createElementVNode("span",ZF,n.toDisplayString(i.numberOfResultsText),1),n.createVNode(y,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[3]||(t[3]=f=>e.numberShown=f),placeholder:"10",onChange:t[4]||(t[4]=f=>i.numberShownChanged(f))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.numberDatasetsShown,f=>(n.openBlock(),n.createBlock(p,{key:f,label:f,value:f},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const K0=bn(MF,[["render",YF],["__scopeId","data-v-4088113a"]]);var XF=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},QF={filters:[],searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const eP={components:{SearchFilters:K0,DatasetCard:o0,SearchHistory:i0,Button:ht,Card:tp,Drawer:dl,Icon:Se,Input:ja,Pagination:Dp},name:"SideBarContent",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>QF},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="",o={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&&(o.withSearch&&this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter))):(this.filter=e,(!e||e.length==0)&&o.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(q0(e),t).then(o=>{Ge.emit("anatomy-in-datasets",o.forFlatmap),Ge.emit("number-of-datasets-for-anatomies",o.forScaffold)}),this.algoliaClient.search(q0(e),t,this.numberPerPage,this.page).then(o=>{this.numberOfHits=o.total,this.discoverIds=o.discoverIds,this._dois=o.dois,this.results=o.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 r=this._abortController.signal;this.perItemSearch(r,{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(o=>o.doi===e);this.results[t]&&(this.results[t].detailsReady=!0)},perItemSearch:function(e,t){if(10>t.count){const r=this._dois.shift();r&&(t.count++,this.callSciCrunch(this.envVars.API_LOCATION,{dois:[r]},e).then(a=>{a.numberOfHits===0?this.handleMissingData(r):this.resultsProcessing(a),this.$refs.content.style["overflow-y"]="scroll",t.count--,this.perItemSearch(e,t)}).catch(a=>{a.name!=="AbortError"&&(this.handleMissingData(r),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 o=this.results.findIndex(r=>t.doi?t.doi.includes(r.doi):!1);Object.assign(this.results[o],t),Object.assign(this.results[o],{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(r=>r.name))]:void 0,species:t.organisms&&t.organisms[0].species?[...new Set(t.organisms.map(r=>r.species?r.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[o]=this.results[o]})},createfilterParams:function(e){let t=new URLSearchParams;for(const o in e)Array.isArray(e[o])?e[o].forEach(r=>{t.append(o,r)}):t.append(o,e[o]);return t.toString()},callSciCrunch:function(e,t={},o){return new Promise((r,a)=>{let i=this.envVars.API_LOCATION+this.searchEndpoint+"?"+this.createfilterParams(t);fetch(i,{signal:o}).then(XF).then(s=>s.json()).then(s=>r(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(Vc)},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=n.markRaw(new U0(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/"}},tP={class:"header"},nP={class:"content scrollbar",ref:"content"},oP={key:0,class:"error-feedback"};function rP(e,t,o,r,a,i){const s=ja,l=ht,c=K0,d=i0,u=o0,p=Dp,y=tp,m=oi;return n.openBlock(),n.createBlock(y,{"body-style":e.bodyStyle,class:"content-card"},{header:n.withCtx(()=>[n.createElementVNode("div",tP,[n.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=f=>e.searchInput=f),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),n.createVNode(l,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:n.withCtx(()=>[n.createTextVNode(" Search ")]),_:1},8,["onClick"])])]),default:n.withCtx(()=>[n.createVNode(c,{class:"filters",ref:"filtersRef",entry:i.filterEntry,envVars:o.envVars,onFilterResults:i.filterUpdate,onNumberPerPage:i.numberPerPageUpdate,onLoading:i.filtersLoading,onCascaderReady:i.cascaderReady},null,8,["entry","envVars","onFilterResults","onNumberPerPage","onLoading","onCascaderReady"]),n.createVNode(d,{ref:"searchHistory",onSearch:i.searchHistorySearch},null,8,["onSearch"]),n.withDirectives((n.openBlock(),n.createElementBlock("div",nP,[e.results.length===0&&!e.loadingCards?(n.openBlock(),n.createElementBlock("div",oP," No results found - Please change your search / filter criteria. ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.results,f=>(n.openBlock(),n.createElementBlock("div",{key:f.doi,class:"step-item"},[n.createVNode(u,{class:"dataset-card",entry:f,envVars:o.envVars,onMouseenter:h=>i.hoverChanged(f),onMouseleave:t[1]||(t[1]=h=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),n.createVNode(p,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=f=>e.page=f),"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 W0=bn(eP,[["render",rP],["__scopeId","data-v-d3c8c59e"]]),aP={name:"AnnotationTool",components:{AnnotationPopup:No.AnnotationPopup,Button:ht,CreateTooltipContent:No.CreateTooltipContent,Col:wp,ElIconDelete:Fs,Icon:Se,Row:bp},props:{annotationEntry:{type:Object},createData:{type:Object,default:{}}},data:function(){return{ElIconDelete:n.shallowRef(Fs)}}},iP={class:"annotation-tool scrollbar"},sP={key:1,class:"delete-container"};function lP(e,t,o,r,a,i){const s=n.resolveComponent("CreateTooltipContent"),l=n.resolveComponent("annotation-popup"),c=wp,d=ht,u=bp;return n.openBlock(),n.createElementBlock("div",iP,[n.withDirectives(n.createVNode(s,{createData:o.createData,onConfirmCreate:t[0]||(t[0]=p=>e.$emit("confirm-create",p)),onCancelCreate:t[1]||(t[1]=p=>e.$emit("cancel-create")),class:"create-tooltip-content"},null,8,["createData"]),[[n.vShow,o.createData&&o.createData.toBeConfirmed]]),o.annotationEntry&&(!o.createData||!o.createData.toBeConfirmed)?(n.openBlock(),n.createBlock(l,{key:0,class:"annotation-popup",annotationEntry:o.annotationEntry,onAnnotation:t[2]||(t[2]=p=>e.$emit("annotation",p))},null,8,["annotationEntry"])):n.createCommentVNode("",!0),o.createData&&o.createData.toBeDeleted?(n.openBlock(),n.createElementBlock("div",sP,[n.createVNode(u,null,{default:n.withCtx(()=>[n.createVNode(c,{offset:1,span:6},{default:n.withCtx(()=>[n.createTextVNode("Delete this feature?")]),_:1}),n.createVNode(c,{offset:1,span:3},{default:n.withCtx(()=>[n.createVNode(d,{class:"delete-button",icon:e.ElIconDelete,onClick:t[3]||(t[3]=p=>e.$emit("confirm-delete"))},{default:n.withCtx(()=>[n.createTextVNode(" Delete ")]),_:1},8,["icon"])]),_:1}),n.createVNode(c,{offset:1,span:2},{default:n.withCtx(()=>[n.createVNode(d,{class:"delete-button",onClick:t[4]||(t[4]=p=>e.$emit("cancel-create"))},{default:n.withCtx(()=>[n.createTextVNode(" Dismiss ")]),_:1})]),_:1})]),_:1})])):n.createCommentVNode("",!0)])}const G0=bn(aP,[["render",lP],["__scopeId","data-v-de83d649"]]),cP=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),ia=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},dP=3e3,uP={name:"ConnectivityInfo",components:{Button:ht,Container:ox,Icon:Se,ElIconArrowUp:jC,ElIconArrowDown:Cr,ElIconWarning:Iu,ExternalResourceCard:No.ExternalResourceCard,CopyToClipboard:No.CopyToClipboard,ConnectivityGraph:No.ConnectivityGraph},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,graphViewLoaded:!1,updatedCopyContent:""}},watch:{availableAnatomyFacets:{handler:function(e){this.convertFacetsToList(e)},immediate:!0,deep:!0}},computed:{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 cP(e)},capitalise:function(e){return ia(e)},openUrl:function(e){window.open(e,"_blank")},openAll:function(){Ge.emit("onConnectivityActionClick",{type:"Facets",labels:this.entry.componentsWithDatasets.map(e=>e.name.toLowerCase())})},openAxons:function(){Ge.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(){Ge.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){this.activeView=e,e==="graphView"&&!this.graphViewLoaded&&this.$nextTick(()=>{this.graphViewLoaded=!0})},onTapNode:function(e){const t=e.map(o=>o.label).join(", ");this.toggleConnectivityTooltip(t,{show:!0})},onReferencesLoaded:function(e){this.updatedCopyContent=this.getUpdateCopyContent(e)},getUpdateCopyContent:function(e){var r,a,i,s;if(!this.entry)return"";const t=[];this.entry.title?t.push(`<div><strong>${ia(this.entry.title)}</strong></div>`):t.push(`<div><strong>${this.entry.featureId}</strong></div>`),(r=this.entry.provenanceTaxonomyLabel)!=null&&r.length&&t.push(`<div>${this.provSpeciesDescription}</div>`),this.entry.paths&&t.push(`<div>${this.entry.paths}</div>`);function o(l,c,d=[]){let u=`<div><strong>${l}</strong></div>`;const p=[];c.forEach(m=>{let f=[];m.split(",").forEach(h=>{const g=d.find(b=>b.name===h.trim());g?f.push(`${ia(h)} (${g.id})`):f.push(`${ia(h)}`)}),p.push(f.join(","))});const y=p.map(m=>`<li>${m}</li>`).join(`
|
|
465
465
|
`);return u+=`
|
|
466
466
|
`,u+=`<ul>${y}</ul>`,u}if((a=this.entry.origins)!=null&&a.length){const l="Origin",c=this.entry.origins,d=this.entry.originsWithDatasets,u=o(l,c,d);t.push(u)}if((i=this.entry.components)!=null&&i.length){const l="Components",c=this.entry.components,d=this.entry.componentsWithDatasets,u=o(l,c,d);t.push(u)}if((s=this.entry.destinations)!=null&&s.length){const l="Destination",c=this.entry.destinations,d=this.entry.destinationsWithDatasets,u=o(l,c,d);t.push(u)}if(e){let l="<div><strong>References</strong></div>";l+=`
|
|
467
467
|
`;const c=e.list.map(d=>`<li>${d}</li>`).join(`
|