@abi-software/map-side-bar 2.14.6 → 2.14.7

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.
@@ -20154,12 +20154,14 @@ const {
20154
20154
  }
20155
20155
  },
20156
20156
  created: function() {
20157
- this.getBanner();
20157
+ this.entry.detailsReady && this.getBanner();
20158
20158
  },
20159
20159
  watch: {
20160
- // currently not using card overflow
20161
- "entry.description": function() {
20162
- this.getBanner();
20160
+ "entry.detailsReady": {
20161
+ immediate: !0,
20162
+ handler: function(e) {
20163
+ e === !0 && this.getBanner();
20164
+ }
20163
20165
  }
20164
20166
  }
20165
20167
  }, i4 = {
@@ -20227,7 +20229,7 @@ function m4(e, t, n, r, o, a) {
20227
20229
  ], 512)
20228
20230
  ], 512);
20229
20231
  }
20230
- const Ty = /* @__PURE__ */ Ln(s4, [["render", m4], ["__scopeId", "data-v-0c8eda6f"]]), ah = 12;
20232
+ const Ty = /* @__PURE__ */ Ln(s4, [["render", m4], ["__scopeId", "data-v-2dbb90f2"]]), ah = 12;
20231
20233
  function sh() {
20232
20234
  const e = new Uint8Array(16);
20233
20235
  window.crypto.getRandomValues(e), e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128;
@@ -23452,7 +23454,7 @@ const l6 = {
23452
23454
  flatmaps: t["abi-flatmap-file"],
23453
23455
  additionalLinks: t.additionalLinks,
23454
23456
  detailsReady: !0
23455
- }), this.results[n] = this.results[n];
23457
+ });
23456
23458
  });
23457
23459
  },
23458
23460
  createfilterParams: function(e) {
@@ -23646,7 +23648,7 @@ function f6(e, t, n, r, o, a) {
23646
23648
  _: 1
23647
23649
  }, 8, ["body-style"]);
23648
23650
  }
23649
- const f0 = /* @__PURE__ */ Ln(l6, [["render", f6], ["__scopeId", "data-v-f40f1349"]]), p6 = (e) => e.replace(/\w\S*/g, (t) => t.charAt(0).toUpperCase() + t.substr(1).toLowerCase()), Ir = function(e) {
23651
+ const f0 = /* @__PURE__ */ Ln(l6, [["render", f6], ["__scopeId", "data-v-477651e8"]]), p6 = (e) => e.replace(/\w\S*/g, (t) => t.charAt(0).toUpperCase() + t.substr(1).toLowerCase()), Ir = function(e) {
23650
23652
  return e ? e.charAt(0).toUpperCase() + e.slice(1) : "";
23651
23653
  }, h6 = {
23652
23654
  name: "ConnectivityInfo",
@@ -53,7 +53,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,curr
53
53
  `,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+=`
54
54
  `,t+=`${this.version}`,e.push(`<div>${t}</div>`)}this.copyContent=e.join(`
55
55
 
56
- <br>`)}},created:function(){this.getBanner()},watch:{"entry.description":function(){this.getBanner()}}},FP={class:"dataset-card-container",ref:"container"},RP={class:"dataset-card",ref:"card"},PP={class:"card"},$P={class:"card-left"},LP={class:"card-right"},VP={class:"details"},DP={class:"details"},MP={key:0,class:"details loading-icon"},jP={class:"badges-container"},zP={class:"float-button-container"};function HP(e,t,o,r,a,i){const s=ug,l=ht,c=Vp,d=n.resolveComponent("CopyToClipboard"),u=Xo;return n.openBlock(),n.createElementBlock("div",FP,[n.createElementVNode("div",RP,[t[2]||(t[2]=n.createElementVNode("div",{class:"seperator-path"},null,-1)),n.withDirectives((n.openBlock(),n.createElementBlock("div",PP,[n.createElementVNode("span",$P,[!e.loading&&e.discoverId?(n.openBlock(),n.createBlock(s,{key:0,items:e.items,category:e.currentCategory,onCardClicked:i.galleryClicked,onDatalinkClicked:i.galleryDatalinkClicked},null,8,["items","category","onCardClicked","onDatalinkClicked"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",LP,[n.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...f)=>i.cardClicked&&i.cardClicked(...f))},n.toDisplayString(o.entry.name),1),n.createElementVNode("div",VP,n.toDisplayString(i.contributors)+" "+n.toDisplayString(o.entry.publishDate?`(${i.publishYear})`:""),1),n.createElementVNode("div",DP,n.toDisplayString(i.samples),1),o.entry.detailsReady?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createElementBlock("div",MP,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(()=>t[1]||(t[1]=[n.createTextVNode("View repository")])),_:1},8,["onClick","icon"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",jP,[n.createVNode(c,{items:e.items,onCategoryChanged:i.categoryChanged},null,8,["items","onCategoryChanged"])]),n.createElementVNode("div",zP,[n.createVNode(d,{content:e.copyContent},null,8,["content"])])])])),[[u,e.loading]])],512)],512)}const Wg=Jt(AP,[["render",HP],["__scopeId","data-v-0c8eda6f"]]),Gg=12;function Jg(){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 UP={name:"SearchHistory",components:{Tag:wo,Select:ii},props:{localStorageKey:{type:String,default:""}},data(){return{searchHistory:[],savedSearchHistory:[]}},mounted:function(){this.getSearchHistory(),me.on("search-changed",e=>{this.setSearchHistory(e)}),this.updateSearchHistory(),this.savedSearchHistory=this.searchHistory.filter(e=>e.saved)},methods:{getSearchHistory(){localStorage.getItem(this.localStorageKey)?this.searchHistory=JSON.parse(localStorage.getItem(this.localStorageKey)):this.searchHistory=[]},clearSearchHistory(){localStorage.removeItem(this.localStorageKey),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},addSearchToHistory(e=[],t=""){if(t=t.trim(),!this.searchHistory.some(r=>{let a=r.filters,i=e;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);if(r||a){const i={filters:e,search:t,saved:!1,label:r,longLabel:a,id:Jg(),updated:new Date().getTime()};this.searchHistory.push(i),this.searchHistory=this.searchHistory.sort(this.sortSearchHistory),this.trimSearchHistory(),localStorage.setItem(this.localStorageKey,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>Gg){const e=this.searchHistory.filter(r=>r.saved),t=this.searchHistory.filter(r=>!r.saved),o=Gg-this.searchHistory.length;this.searchHistory=[...e,...t.slice(0,o)]}},updateSearchHistory:function(){this.searchHistory.forEach(e=>{if(e.id||(e.id=Jg()),!e.label){const{label:t,longLabel:o}=this.searchHistoryItemLabel(e.search,e.filters);e.label=t,e.longLabel=o}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(this.localStorageKey,JSON.stringify(this.searchHistory))},getParentComponentName:function(){var r,a;const e=((r=this.localStorageKey)==null?void 0:r.indexOf("connectivity"))!==-1,t=((a=this.localStorageKey)==null?void 0:a.indexOf("dataset"))!==-1;return e?"connectivity":t?"dataset":""},search:function(e){this.$emit("search",e);const t=this.getParentComponentName();me.emit("trackEvent",{event_name:"portal_maps_search_history_click",category:e.longLabel||e.label,location:`map_sidebar_${t}`})},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.tagLabel||s.facet)),o&&a.length&&(r+=o,r+=`, ${i.join(", ")}`,o+=` (+${a.length})`),!o&&a.length&&(o=a[0].tagLabel||a[0].facet,a.length>1&&(r+=`${i.join(", ")}`,o+=` (+${a.length-1})`)),o?o.length>15&&!r&&(r=o):o="",{label:o,longLabel:r}},toggleSavedSearch:function(e){this.searchHistory.forEach(r=>{r.id===e.id&&(r.saved=!r.saved)}),this.savedSearchHistory=this.searchHistory.filter(r=>r.saved),this.updateSearchHistory();const t=e.saved?"portal_maps_search_history_saved":"portal_maps_search_history_unsaved",o=this.getParentComponentName();me.emit("trackEvent",{event_name:t,category:e.longLabel||e.label,location:`map_sidebar_${o}`})},removeFromSavedSearch:function(e){const t=this.searchHistory.findIndex(r=>r.id===e.id);this.searchHistory.splice(t,1),this.savedSearchHistory=this.searchHistory.filter(r=>r.saved),this.updateSearchHistory();const o=this.getParentComponentName();me.emit("trackEvent",{event_name:"portal_maps_search_history_removed",category:e.longLabel||e.label,location:`map_sidebar_${o}`})}}},qP={key:0,class:"history-container"},KP={key:0,class:"saved-search-history"},WP={key:1},GP={class:"el-dropdown-select"},JP=["onClick"],YP=["onClick"],ZP={key:0,viewBox:"0 0 24 24"},XP={key:1,viewBox:"0 0 24 24"},QP={key:0},e$={key:1},t$={key:2};function n$(e,t,o,r,a,i){const s=Zo,l=wo,c=ae.ArrowDown,d=Te,u=ht,f=ae.Delete,g=T_,m=O_,h=__;return a.searchHistory.length?(n.openBlock(),n.createElementBlock("div",qP,[a.savedSearchHistory.length?(n.openBlock(),n.createElementBlock("div",KP,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.savedSearchHistory,(p,y)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:p.id},[y<2?(n.openBlock(),n.createBlock(l,{class:"search-tag",key:y,onClick:b=>i.search(p),size:"large"},{default:n.withCtx(()=>[p.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(p.label),1)]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(p.longLabel),1)]),_:2},1024)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(p.label),1)],64))]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],64))),128))])):(n.openBlock(),n.createElementBlock("div",WP,t[0]||(t[0]=[n.createElementVNode("span",{class:"empty-saved-search"},"No Saved Searches",-1)]))),n.createVNode(h,{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,p=>(n.openBlock(),n.createBlock(g,{key:p.id},{default:n.withCtx(()=>[n.createElementVNode("div",null,[p.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:y=>i.search(p)},n.toDisplayString(p.label),9,JP)]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(p.longLabel),1)]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",{key:1,class:"dropdown-clickable-item",onClick:y=>i.search(p)},n.toDisplayString(p.label),9,YP))]),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:y=>i.toggleSavedSearch(p),disabled:a.savedSearchHistory.length>1&&!p.saved},{default:n.withCtx(()=>[n.createVNode(d,{color:"#8300BF"},{default:n.withCtx(()=>[p.saved?(n.openBlock(),n.createElementBlock("svg",ZP,t[2]||(t[2]=[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)]))):(n.openBlock(),n.createElementBlock("svg",XP,t[3]||(t[3]=[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)])))]),_:2},1024)]),_:2},1032,["onClick","disabled"])]),default:n.withCtx(()=>[a.savedSearchHistory.length>1&&!p.saved?(n.openBlock(),n.createElementBlock("span",QP," Limit 2: Please remove a saved search before adding another. ")):p.saved?(n.openBlock(),n.createElementBlock("span",e$," Remove from saved searches. ")):(n.openBlock(),n.createElementBlock("span",t$," 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:y=>i.removeFromSavedSearch(p)},{default:n.withCtx(()=>[n.createVNode(d,{color:"#8300BF"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),_:2},1032,["onClick"])]),default:n.withCtx(()=>[t[4]||(t[4]=n.createElementVNode("span",null," Remove from search history. ",-1))]),_:2},1024)])]),_:2},1024))),128))]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",GP,[t[1]||(t[1]=n.createTextVNode(" Search history ")),n.createVNode(d,{class:"el-icon--right"},{default:n.withCtx(()=>[n.createVNode(c)]),_:1})])]),_:1})])):n.createCommentVNode("",!0)}const os=Jt(UP,[["render",n$],["__scopeId","data-v-e1b89e20"]]),Yg=(e,t)=>{const o=e.__vccOpts||e;for(const[r,a]of t)o[r]=a;return o},o$=["xlink:href"],r$={__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,o$)],2))}},Lc=Yg(r$,[["__scopeId","data-v-e172d5ff"]]),Zg=`<?xml version="1.0" encoding="UTF-8"?>
56
+ <br>`)}},created:function(){this.entry.detailsReady&&this.getBanner()},watch:{"entry.detailsReady":{immediate:!0,handler:function(e){e===!0&&this.getBanner()}}}},FP={class:"dataset-card-container",ref:"container"},RP={class:"dataset-card",ref:"card"},PP={class:"card"},$P={class:"card-left"},LP={class:"card-right"},VP={class:"details"},DP={class:"details"},MP={key:0,class:"details loading-icon"},jP={class:"badges-container"},zP={class:"float-button-container"};function HP(e,t,o,r,a,i){const s=ug,l=ht,c=Vp,d=n.resolveComponent("CopyToClipboard"),u=Xo;return n.openBlock(),n.createElementBlock("div",FP,[n.createElementVNode("div",RP,[t[2]||(t[2]=n.createElementVNode("div",{class:"seperator-path"},null,-1)),n.withDirectives((n.openBlock(),n.createElementBlock("div",PP,[n.createElementVNode("span",$P,[!e.loading&&e.discoverId?(n.openBlock(),n.createBlock(s,{key:0,items:e.items,category:e.currentCategory,onCardClicked:i.galleryClicked,onDatalinkClicked:i.galleryDatalinkClicked},null,8,["items","category","onCardClicked","onDatalinkClicked"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",LP,[n.createElementVNode("div",{class:"title",onClick:t[0]||(t[0]=(...f)=>i.cardClicked&&i.cardClicked(...f))},n.toDisplayString(o.entry.name),1),n.createElementVNode("div",VP,n.toDisplayString(i.contributors)+" "+n.toDisplayString(o.entry.publishDate?`(${i.publishYear})`:""),1),n.createElementVNode("div",DP,n.toDisplayString(i.samples),1),o.entry.detailsReady?n.createCommentVNode("",!0):n.withDirectives((n.openBlock(),n.createElementBlock("div",MP,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(()=>t[1]||(t[1]=[n.createTextVNode("View repository")])),_:1},8,["onClick","icon"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",jP,[n.createVNode(c,{items:e.items,onCategoryChanged:i.categoryChanged},null,8,["items","onCategoryChanged"])]),n.createElementVNode("div",zP,[n.createVNode(d,{content:e.copyContent},null,8,["content"])])])])),[[u,e.loading]])],512)],512)}const Wg=Jt(AP,[["render",HP],["__scopeId","data-v-2dbb90f2"]]),Gg=12;function Jg(){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 UP={name:"SearchHistory",components:{Tag:wo,Select:ii},props:{localStorageKey:{type:String,default:""}},data(){return{searchHistory:[],savedSearchHistory:[]}},mounted:function(){this.getSearchHistory(),me.on("search-changed",e=>{this.setSearchHistory(e)}),this.updateSearchHistory(),this.savedSearchHistory=this.searchHistory.filter(e=>e.saved)},methods:{getSearchHistory(){localStorage.getItem(this.localStorageKey)?this.searchHistory=JSON.parse(localStorage.getItem(this.localStorageKey)):this.searchHistory=[]},clearSearchHistory(){localStorage.removeItem(this.localStorageKey),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},addSearchToHistory(e=[],t=""){if(t=t.trim(),!this.searchHistory.some(r=>{let a=r.filters,i=e;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);if(r||a){const i={filters:e,search:t,saved:!1,label:r,longLabel:a,id:Jg(),updated:new Date().getTime()};this.searchHistory.push(i),this.searchHistory=this.searchHistory.sort(this.sortSearchHistory),this.trimSearchHistory(),localStorage.setItem(this.localStorageKey,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>Gg){const e=this.searchHistory.filter(r=>r.saved),t=this.searchHistory.filter(r=>!r.saved),o=Gg-this.searchHistory.length;this.searchHistory=[...e,...t.slice(0,o)]}},updateSearchHistory:function(){this.searchHistory.forEach(e=>{if(e.id||(e.id=Jg()),!e.label){const{label:t,longLabel:o}=this.searchHistoryItemLabel(e.search,e.filters);e.label=t,e.longLabel=o}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(this.localStorageKey,JSON.stringify(this.searchHistory))},getParentComponentName:function(){var r,a;const e=((r=this.localStorageKey)==null?void 0:r.indexOf("connectivity"))!==-1,t=((a=this.localStorageKey)==null?void 0:a.indexOf("dataset"))!==-1;return e?"connectivity":t?"dataset":""},search:function(e){this.$emit("search",e);const t=this.getParentComponentName();me.emit("trackEvent",{event_name:"portal_maps_search_history_click",category:e.longLabel||e.label,location:`map_sidebar_${t}`})},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.tagLabel||s.facet)),o&&a.length&&(r+=o,r+=`, ${i.join(", ")}`,o+=` (+${a.length})`),!o&&a.length&&(o=a[0].tagLabel||a[0].facet,a.length>1&&(r+=`${i.join(", ")}`,o+=` (+${a.length-1})`)),o?o.length>15&&!r&&(r=o):o="",{label:o,longLabel:r}},toggleSavedSearch:function(e){this.searchHistory.forEach(r=>{r.id===e.id&&(r.saved=!r.saved)}),this.savedSearchHistory=this.searchHistory.filter(r=>r.saved),this.updateSearchHistory();const t=e.saved?"portal_maps_search_history_saved":"portal_maps_search_history_unsaved",o=this.getParentComponentName();me.emit("trackEvent",{event_name:t,category:e.longLabel||e.label,location:`map_sidebar_${o}`})},removeFromSavedSearch:function(e){const t=this.searchHistory.findIndex(r=>r.id===e.id);this.searchHistory.splice(t,1),this.savedSearchHistory=this.searchHistory.filter(r=>r.saved),this.updateSearchHistory();const o=this.getParentComponentName();me.emit("trackEvent",{event_name:"portal_maps_search_history_removed",category:e.longLabel||e.label,location:`map_sidebar_${o}`})}}},qP={key:0,class:"history-container"},KP={key:0,class:"saved-search-history"},WP={key:1},GP={class:"el-dropdown-select"},JP=["onClick"],YP=["onClick"],ZP={key:0,viewBox:"0 0 24 24"},XP={key:1,viewBox:"0 0 24 24"},QP={key:0},e$={key:1},t$={key:2};function n$(e,t,o,r,a,i){const s=Zo,l=wo,c=ae.ArrowDown,d=Te,u=ht,f=ae.Delete,g=T_,m=O_,h=__;return a.searchHistory.length?(n.openBlock(),n.createElementBlock("div",qP,[a.savedSearchHistory.length?(n.openBlock(),n.createElementBlock("div",KP,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.savedSearchHistory,(p,y)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:p.id},[y<2?(n.openBlock(),n.createBlock(l,{class:"search-tag",key:y,onClick:b=>i.search(p),size:"large"},{default:n.withCtx(()=>[p.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(p.label),1)]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(p.longLabel),1)]),_:2},1024)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(p.label),1)],64))]),_:2},1032,["onClick"])):n.createCommentVNode("",!0)],64))),128))])):(n.openBlock(),n.createElementBlock("div",WP,t[0]||(t[0]=[n.createElementVNode("span",{class:"empty-saved-search"},"No Saved Searches",-1)]))),n.createVNode(h,{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,p=>(n.openBlock(),n.createBlock(g,{key:p.id},{default:n.withCtx(()=>[n.createElementVNode("div",null,[p.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:y=>i.search(p)},n.toDisplayString(p.label),9,JP)]),default:n.withCtx(()=>[n.createTextVNode(" "+n.toDisplayString(p.longLabel),1)]),_:2},1024)):(n.openBlock(),n.createElementBlock("span",{key:1,class:"dropdown-clickable-item",onClick:y=>i.search(p)},n.toDisplayString(p.label),9,YP))]),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:y=>i.toggleSavedSearch(p),disabled:a.savedSearchHistory.length>1&&!p.saved},{default:n.withCtx(()=>[n.createVNode(d,{color:"#8300BF"},{default:n.withCtx(()=>[p.saved?(n.openBlock(),n.createElementBlock("svg",ZP,t[2]||(t[2]=[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)]))):(n.openBlock(),n.createElementBlock("svg",XP,t[3]||(t[3]=[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)])))]),_:2},1024)]),_:2},1032,["onClick","disabled"])]),default:n.withCtx(()=>[a.savedSearchHistory.length>1&&!p.saved?(n.openBlock(),n.createElementBlock("span",QP," Limit 2: Please remove a saved search before adding another. ")):p.saved?(n.openBlock(),n.createElementBlock("span",e$," Remove from saved searches. ")):(n.openBlock(),n.createElementBlock("span",t$," 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:y=>i.removeFromSavedSearch(p)},{default:n.withCtx(()=>[n.createVNode(d,{color:"#8300BF"},{default:n.withCtx(()=>[n.createVNode(f)]),_:1})]),_:2},1032,["onClick"])]),default:n.withCtx(()=>[t[4]||(t[4]=n.createElementVNode("span",null," Remove from search history. ",-1))]),_:2},1024)])]),_:2},1024))),128))]),_:1})]),default:n.withCtx(()=>[n.createElementVNode("span",GP,[t[1]||(t[1]=n.createTextVNode(" Search history ")),n.createVNode(d,{class:"el-icon--right"},{default:n.withCtx(()=>[n.createVNode(c)]),_:1})])]),_:1})])):n.createCommentVNode("",!0)}const os=Jt(UP,[["render",n$],["__scopeId","data-v-e1b89e20"]]),Yg=(e,t)=>{const o=e.__vccOpts||e;for(const[r,a]of t)o[r]=a;return o},o$=["xlink:href"],r$={__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,o$)],2))}},Lc=Yg(r$,[["__scopeId","data-v-e172d5ff"]]),Zg=`<?xml version="1.0" encoding="UTF-8"?>
57
57
  <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">
58
58
  <title>2horpanel</title>
59
59
  <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@@ -464,7 +464,7 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:r,curr
464
464
  </g>
465
465
  </svg>`,By=(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},Iy=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(),a$=!0,i$=!0,s$=["fill"],Ay=Object.assign({"/assets/icons/2horpanel.svg":Zg,"/assets/icons/2vertpanel.svg":Xg,"/assets/icons/3panel.svg":Qg,"/assets/icons/4panel.svg":ey,"/assets/icons/5panel.svg":ty,"/assets/icons/6panel.svg":ny,"/assets/icons/6panelVertical.svg":oy,"/assets/icons/changeBckgd.svg":ry,"/assets/icons/close-no-bk.svg":ay,"/assets/icons/close.svg":iy,"/assets/icons/closeFullScreen.svg":sy,"/assets/icons/comment.svg":ly,"/assets/icons/connection.svg":cy,"/assets/icons/dock.svg":dy,"/assets/icons/drawLine.svg":uy,"/assets/icons/drawPoint.svg":fy,"/assets/icons/drawPolygon.svg":py,"/assets/icons/drawTrash.svg":hy,"/assets/icons/fitWindow.svg":my,"/assets/icons/fullScreen.svg":gy,"/assets/icons/help.svg":yy,"/assets/icons/magnifyingGlass.svg":by,"/assets/icons/noun-filter.svg":wy,"/assets/icons/openMap.svg":Cy,"/assets/icons/pause.svg":ky,"/assets/icons/permalink.svg":vy,"/assets/icons/play.svg":Sy,"/assets/icons/resetZoom.svg":Ey,"/assets/icons/singlepanel.svg":xy,"/assets/icons/tooltips.svg":_y,"/assets/icons/undock.svg":Ty,"/assets/icons/zoomIn.svg":Oy,"/assets/icons/zoomOut.svg":Ny});Object.keys(Ay).map(e=>{const t=By(Ay[e],a$,i$,s$),o=e.replace(/^.+\/(\w+).svg$/,"$1");return Iy(t).replace("<svg",`<symbol id="${o}"`).replace("svg>","symbol>")}).join(`
466
466
  `);const Vc=Object.assign({"/assets/icons/2horpanel.svg":Zg,"/assets/icons/2vertpanel.svg":Xg,"/assets/icons/3panel.svg":Qg,"/assets/icons/4panel.svg":ey,"/assets/icons/5panel.svg":ty,"/assets/icons/6panel.svg":ny,"/assets/icons/6panelVertical.svg":oy,"/assets/icons/changeBckgd.svg":ry,"/assets/icons/close-no-bk.svg":ay,"/assets/icons/close.svg":iy,"/assets/icons/closeFullScreen.svg":sy,"/assets/icons/comment.svg":ly,"/assets/icons/connection.svg":cy,"/assets/icons/dock.svg":dy,"/assets/icons/drawLine.svg":uy,"/assets/icons/drawPoint.svg":fy,"/assets/icons/drawPolygon.svg":py,"/assets/icons/drawTrash.svg":hy,"/assets/icons/fitWindow.svg":my,"/assets/icons/fullScreen.svg":gy,"/assets/icons/help.svg":yy,"/assets/icons/magnifyingGlass.svg":by,"/assets/icons/noun-filter.svg":wy,"/assets/icons/openMap.svg":Cy,"/assets/icons/pause.svg":ky,"/assets/icons/permalink.svg":vy,"/assets/icons/play.svg":Sy,"/assets/icons/resetZoom.svg":Ey,"/assets/icons/singlepanel.svg":xy,"/assets/icons/tooltips.svg":_y,"/assets/icons/undock.svg":Ty,"/assets/icons/zoomIn.svg":Oy,"/assets/icons/zoomOut.svg":Ny}),l$=Object.keys(Vc).map(e=>{const t=By(Vc[e]),o=e.replace(/^.+\/(\w+).svg$/,"$1");return Iy(t).replace("<svg",`<symbol id="${o}"`).replace("svg>","symbol>")}),c$={name:"MapSvgSpriteColor",svgContext:Vc,svgSprite:l$.join(`
467
- `)},d$=["innerHTML"];function u$(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,d$)}const Dc=Yg(c$,[["render",u$]]);var Fy={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()})(tE,function(){function o(w,k,S){return k in w?Object.defineProperty(w,k,{value:S,enumerable:!0,configurable:!0,writable:!0}):w[k]=S,w}function r(w,k){var S=Object.keys(w);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(w);k&&(T=T.filter(function(F){return Object.getOwnPropertyDescriptor(w,F).enumerable})),S.push.apply(S,T)}return S}function a(w){for(var k=1;k<arguments.length;k++){var S=arguments[k]!=null?arguments[k]:{};k%2?r(Object(S),!0).forEach(function(T){o(w,T,S[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(S)):r(Object(S)).forEach(function(T){Object.defineProperty(w,T,Object.getOwnPropertyDescriptor(S,T))})}return w}function i(w,k){if(w==null)return{};var S,T,F=function(G,U){if(G==null)return{};var W,te,Z={},pe=Object.keys(G);for(te=0;te<pe.length;te++)W=pe[te],U.indexOf(W)>=0||(Z[W]=G[W]);return Z}(w,k);if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(w);for(T=0;T<K.length;T++)S=K[T],k.indexOf(S)>=0||Object.prototype.propertyIsEnumerable.call(w,S)&&(F[S]=w[S])}return F}function s(w,k){return function(S){if(Array.isArray(S))return S}(w)||function(S,T){if(Symbol.iterator in Object(S)||Object.prototype.toString.call(S)==="[object Arguments]"){var F=[],K=!0,G=!1,U=void 0;try{for(var W,te=S[Symbol.iterator]();!(K=(W=te.next()).done)&&(F.push(W.value),!T||F.length!==T);K=!0);}catch(Z){G=!0,U=Z}finally{try{K||te.return==null||te.return()}finally{if(G)throw U}}return F}}(w,k)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(w){return function(k){if(Array.isArray(k)){for(var S=0,T=new Array(k.length);S<k.length;S++)T[S]=k[S];return T}}(w)||function(k){if(Symbol.iterator in Object(k)||Object.prototype.toString.call(k)==="[object Arguments]")return Array.from(k)}(w)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(w){var k,S="algoliasearch-client-js-".concat(w.key),T=function(){return k===void 0&&(k=w.localStorage||window.localStorage),k},F=function(){return JSON.parse(T().getItem(S)||"{}")},K=function(U){T().setItem(S,JSON.stringify(U))},G=function(){var U=w.timeToLive?1e3*w.timeToLive:null,W=F(),te=Object.fromEntries(Object.entries(W).filter(function(pe){return s(pe,2)[1].timestamp!==void 0}));if(K(te),U){var Z=Object.fromEntries(Object.entries(te).filter(function(pe){var fe=s(pe,2)[1],Ee=new Date().getTime();return!(fe.timestamp+U<Ee)}));K(Z)}};return{get:function(U,W){var te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){G();var Z=JSON.stringify(U);return F()[Z]}).then(function(Z){return Promise.all([Z?Z.value:W(),Z!==void 0])}).then(function(Z){var pe=s(Z,2),fe=pe[0],Ee=pe[1];return Promise.all([fe,Ee||te.miss(fe)])}).then(function(Z){return s(Z,1)[0]})},set:function(U,W){return Promise.resolve().then(function(){var te=F();return te[JSON.stringify(U)]={timestamp:new Date().getTime(),value:W},T().setItem(S,JSON.stringify(te)),W})},delete:function(U){return Promise.resolve().then(function(){var W=F();delete W[JSON.stringify(U)],T().setItem(S,JSON.stringify(W))})},clear:function(){return Promise.resolve().then(function(){T().removeItem(S)})}}}function d(w){var k=l(w.caches),S=k.shift();return S===void 0?{get:function(T,F){var K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},G=F();return G.then(function(U){return Promise.all([U,K.miss(U)])}).then(function(U){return s(U,1)[0]})},set:function(T,F){return Promise.resolve(F)},delete:function(T){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(T,F){var K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return S.get(T,F,K).catch(function(){return d({caches:k}).get(T,F,K)})},set:function(T,F){return S.set(T,F).catch(function(){return d({caches:k}).set(T,F)})},delete:function(T){return S.delete(T).catch(function(){return d({caches:k}).delete(T)})},clear:function(){return S.clear().catch(function(){return d({caches:k}).clear()})}}}function u(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},k={};return{get:function(S,T){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},K=JSON.stringify(S);if(K in k)return Promise.resolve(w.serializable?JSON.parse(k[K]):k[K]);var G=T(),U=F&&F.miss||function(){return Promise.resolve()};return G.then(function(W){return U(W)}).then(function(){return G})},set:function(S,T){return k[JSON.stringify(S)]=w.serializable?JSON.stringify(T):T,Promise.resolve(T)},delete:function(S){return delete k[JSON.stringify(S)],Promise.resolve()},clear:function(){return k={},Promise.resolve()}}}function f(w,k,S){var T={"x-algolia-api-key":S,"x-algolia-application-id":k};return{headers:function(){return w===b.WithinHeaders?T:{}},queryParameters:function(){return w===b.WithinQueryParameters?T:{}}}}function g(w){var k=0;return w(function S(){return k++,new Promise(function(T){setTimeout(function(){T(w(S))},Math.min(100*k,1e3))})})}function m(w){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(S,T){return Promise.resolve()};return Object.assign(w,{wait:function(S){return m(w.then(function(T){return Promise.all([k(T,S),T])}).then(function(T){return T[1]}))}})}function h(w){for(var k=w.length-1;k>0;k--){var S=Math.floor(Math.random()*(k+1)),T=w[k];w[k]=w[S],w[S]=T}return w}function p(w,k){return k&&Object.keys(k).forEach(function(S){w[S]=k[S](w)}),w}function y(w){for(var k=arguments.length,S=new Array(k>1?k-1:0),T=1;T<k;T++)S[T-1]=arguments[T];var F=0;return w.replace(/%s/g,function(){return encodeURIComponent(S[F++])})}var b={WithinQueryParameters:0,WithinHeaders:1};function v(w,k){var S=w||{},T=S.data||{};return Object.keys(S).forEach(function(F){["timeout","headers","queryParameters","data","cacheable"].indexOf(F)===-1&&(T[F]=S[F])}),{data:Object.entries(T).length>0?T:void 0,timeout:S.timeout||k,headers:S.headers||{},queryParameters:S.queryParameters||{},cacheable:S.cacheable}}var O={Read:1,Write:2,Any:3},C=1,E=2,x=3;function _(w){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:C;return a(a({},w),{},{status:k,lastUpdate:Date.now()})}function N(w){return typeof w=="string"?{protocol:"https",url:w,accept:O.Any}:{protocol:w.protocol||"https",url:w.url,accept:w.accept||O.Any}}var A="DELETE",R="GET",P="POST",$="PUT";function z(w,k){return Promise.all(k.map(function(S){return w.get(S,function(){return Promise.resolve(_(S))})})).then(function(S){var T=S.filter(function(G){return function(U){return U.status===C||Date.now()-U.lastUpdate>12e4}(G)}),F=S.filter(function(G){return function(U){return U.status===x&&Date.now()-U.lastUpdate<=12e4}(G)}),K=[].concat(l(T),l(F));return{getTimeout:function(G,U){return(F.length===0&&G===0?1:F.length+3+G)*U},statelessHosts:K.length>0?K.map(function(G){return N(G)}):k}})}function M(w,k,S,T){var F=[],K=function(fe,Ee){if(!(fe.method===R||fe.data===void 0&&Ee.data===void 0)){var be=Array.isArray(fe.data)?fe.data:a(a({},fe.data),Ee.data);return JSON.stringify(be)}}(S,T),G=function(fe,Ee){var be=a(a({},fe.headers),Ee.headers),Pe={};return Object.keys(be).forEach(function(je){var Bt=be[je];Pe[je.toLowerCase()]=Bt}),Pe}(w,T),U=S.method,W=S.method!==R?{}:a(a({},S.data),T.data),te=a(a(a({"x-algolia-agent":w.userAgent.value},w.queryParameters),W),T.queryParameters),Z=0,pe=function fe(Ee,be){var Pe=Ee.pop();if(Pe===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:ee(F)};var je={data:K,headers:G,method:U,url:D(Pe,S.path,te),connectTimeout:be(Z,w.timeouts.connect),responseTimeout:be(Z,T.timeout)},Bt=function(It){var ft={request:je,response:It,host:Pe,triesLeft:Ee.length};return F.push(ft),ft},Sa={onSuccess:function(It){return function(ft){try{return JSON.parse(ft.content)}catch($o){throw function(co,br){return{name:"DeserializationError",message:co,response:br}}($o.message,ft)}}(It)},onRetry:function(It){var ft=Bt(It);return It.isTimedOut&&Z++,Promise.all([w.logger.info("Retryable failure",se(ft)),w.hostsCache.set(Pe,_(Pe,It.isTimedOut?x:E))]).then(function(){return fe(Ee,be)})},onFail:function(It){throw Bt(It),function(ft,$o){var co=ft.content,br=ft.status,Ea=co;try{Ea=JSON.parse(co).message}catch{}return function(cs,ed,sV){return{name:"ApiError",message:cs,status:ed,transporterStackTrace:sV}}(Ea,br,$o)}(It,ee(F))}};return w.requester.send(je).then(function(It){return function(ft,$o){return function(co){var br=co.status;return co.isTimedOut||function(Ea){var cs=Ea.isTimedOut,ed=Ea.status;return!cs&&~~ed==0}(co)||~~(br/100)!=2&&~~(br/100)!=4}(ft)?$o.onRetry(ft):~~(ft.status/100)==2?$o.onSuccess(ft):$o.onFail(ft)}(It,Sa)})};return z(w.hostsCache,k).then(function(fe){return pe(l(fe.statelessHosts).reverse(),fe.getTimeout)})}function H(w){var k=w.hostsCache,S=w.logger,T=w.requester,F=w.requestsCache,K=w.responsesCache,G=w.timeouts,U=w.userAgent,W=w.hosts,te=w.queryParameters,Z={hostsCache:k,logger:S,requester:T,requestsCache:F,responsesCache:K,timeouts:G,userAgent:U,headers:w.headers,queryParameters:te,hosts:W.map(function(pe){return N(pe)}),read:function(pe,fe){var Ee=v(fe,Z.timeouts.read),be=function(){return M(Z,Z.hosts.filter(function(je){return(je.accept&O.Read)!=0}),pe,Ee)};if((Ee.cacheable!==void 0?Ee.cacheable:pe.cacheable)!==!0)return be();var Pe={request:pe,mappedRequestOptions:Ee,transporter:{queryParameters:Z.queryParameters,headers:Z.headers}};return Z.responsesCache.get(Pe,function(){return Z.requestsCache.get(Pe,function(){return Z.requestsCache.set(Pe,be()).then(function(je){return Promise.all([Z.requestsCache.delete(Pe),je])},function(je){return Promise.all([Z.requestsCache.delete(Pe),Promise.reject(je)])}).then(function(je){var Bt=s(je,2);return Bt[0],Bt[1]})})},{miss:function(je){return Z.responsesCache.set(Pe,je)}})},write:function(pe,fe){return M(Z,Z.hosts.filter(function(Ee){return(Ee.accept&O.Write)!=0}),pe,v(fe,Z.timeouts.write))}};return Z}function I(w){var k={value:"Algolia for JavaScript (".concat(w,")"),add:function(S){var T="; ".concat(S.segment).concat(S.version!==void 0?" (".concat(S.version,")"):"");return k.value.indexOf(T)===-1&&(k.value="".concat(k.value).concat(T)),k}};return k}function D(w,k,S){var T=oe(S),F="".concat(w.protocol,"://").concat(w.url,"/").concat(k.charAt(0)==="/"?k.substr(1):k);return T.length&&(F+="?".concat(T)),F}function oe(w){return Object.keys(w).map(function(k){return y("%s=%s",k,(S=w[k],Object.prototype.toString.call(S)==="[object Object]"||Object.prototype.toString.call(S)==="[object Array]"?JSON.stringify(w[k]):w[k]));var S}).join("&")}function ee(w){return w.map(function(k){return se(k)})}function se(w){var k=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),k)})})}var ue=function(w){return function(k,S){return w.transporter.write({method:P,path:"2/abtests",data:k},S)}},Oe=function(w){return function(k,S){return w.transporter.write({method:A,path:y("2/abtests/%s",k)},S)}},ge=function(w){return function(k,S){return w.transporter.read({method:R,path:y("2/abtests/%s",k)},S)}},Ce=function(w){return function(k){return w.transporter.read({method:R,path:"2/abtests"},k)}},de=function(w){return function(k,S){return w.transporter.write({method:P,path:y("2/abtests/%s/stop",k)},S)}},Se=function(w){return function(k){return w.transporter.read({method:R,path:"1/strategies/personalization"},k)}},ve=function(w){return function(k,S){return w.transporter.write({method:P,path:"1/strategies/personalization",data:k},S)}};function ce(w){return function k(S){return w.request(S).then(function(T){if(w.batch!==void 0&&w.batch(T.hits),!w.shouldStop(T))return T.cursor?k({cursor:T.cursor}):k({page:(S.page||0)+1})})}({})}var Qe=function(w){return function(k,S){var T=S||{},F=T.queryParameters,K=i(T,["queryParameters"]),G=a({acl:k},F!==void 0?{queryParameters:F}:{});return m(w.transporter.write({method:P,path:"1/keys",data:G},K),function(U,W){return g(function(te){return Ne(w)(U.key,W).catch(function(Z){if(Z.status!==404)throw Z;return te()})})})}},We=function(w){return function(k,S,T){var F=v(T);return F.queryParameters["X-Algolia-User-ID"]=k,w.transporter.write({method:P,path:"1/clusters/mapping",data:{cluster:S}},F)}},Ve=function(w){return function(k,S,T){return w.transporter.write({method:P,path:"1/clusters/mapping/batch",data:{users:k,cluster:S}},T)}},Fe=function(w){return function(k,S){return m(w.transporter.write({method:P,path:y("/1/dictionaries/%s/batch",k),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},S),function(T,F){return so(w)(T.taskID,F)})}},De=function(w){return function(k,S,T){return m(w.transporter.write({method:P,path:y("1/indexes/%s/operation",k),data:{operation:"copy",destination:S}},T),function(F,K){return Me(w)(k,{methods:{waitTask:Ze}}).waitTask(F.taskID,K)})}},Ye=function(w){return function(k,S,T){return De(w)(k,S,a(a({},T),{},{scope:[Qc.Rules]}))}},Tt=function(w){return function(k,S,T){return De(w)(k,S,a(a({},T),{},{scope:[Qc.Settings]}))}},et=function(w){return function(k,S,T){return De(w)(k,S,a(a({},T),{},{scope:[Qc.Synonyms]}))}},Ot=function(w){return function(k,S){return k.method===R?w.transporter.read(k,S):w.transporter.write(k,S)}},ut=function(w){return function(k,S){return m(w.transporter.write({method:A,path:y("1/keys/%s",k)},S),function(T,F){return g(function(K){return Ne(w)(k,F).then(K).catch(function(G){if(G.status!==404)throw G})})})}},nn=function(w){return function(k,S,T){var F=S.map(function(K){return{action:"deleteEntry",body:{objectID:K}}});return m(w.transporter.write({method:P,path:y("/1/dictionaries/%s/batch",k),data:{clearExistingDictionaryEntries:!1,requests:F}},T),function(K,G){return so(w)(K.taskID,G)})}},Ne=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/keys/%s",k)},S)}},nt=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/task/%s",k.toString())},S)}},yt=function(w){return function(k){return w.transporter.read({method:R,path:"/1/dictionaries/*/settings"},k)}},Dt=function(w){return function(k){return w.transporter.read({method:R,path:"1/logs"},k)}},ot=function(w){return function(k){return w.transporter.read({method:R,path:"1/clusters/mapping/top"},k)}},q=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/clusters/mapping/%s",k)},S)}},we=function(w){return function(k){var S=k||{},T=S.retrieveMappings,F=i(S,["retrieveMappings"]);return T===!0&&(F.getClusters=!0),w.transporter.read({method:R,path:"1/clusters/mapping/pending"},F)}},Me=function(w){return function(k){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T={transporter:w.transporter,appId:w.appId,indexName:k};return p(T,S.methods)}},bt=function(w){return function(k){return w.transporter.read({method:R,path:"1/keys"},k)}},Mt=function(w){return function(k){return w.transporter.read({method:R,path:"1/clusters"},k)}},hr=function(w){return function(k){return w.transporter.read({method:R,path:"1/indexes"},k)}},wa=function(w){return function(k){return w.transporter.read({method:R,path:"1/clusters/mapping"},k)}},Ro=function(w){return function(k,S,T){return m(w.transporter.write({method:P,path:y("1/indexes/%s/operation",k),data:{operation:"move",destination:S}},T),function(F,K){return Me(w)(k,{methods:{waitTask:Ze}}).waitTask(F.taskID,K)})}},Po=function(w){return function(k,S){return m(w.transporter.write({method:P,path:"1/indexes/*/batch",data:{requests:k}},S),function(T,F){return Promise.all(Object.keys(T.taskID).map(function(K){return Me(w)(K,{methods:{waitTask:Ze}}).waitTask(T.taskID[K],F)}))})}},j=function(w){return function(k,S){return w.transporter.read({method:P,path:"1/indexes/*/objects",data:{requests:k}},S)}},X=function(w){return function(k,S){var T=k.map(function(F){return a(a({},F),{},{params:oe(F.params||{})})});return w.transporter.read({method:P,path:"1/indexes/*/queries",data:{requests:T},cacheable:!0},S)}},Q=function(w){return function(k,S){return Promise.all(k.map(function(T){var F=T.params,K=F.facetName,G=F.facetQuery,U=i(F,["facetName","facetQuery"]);return Me(w)(T.indexName,{methods:{searchForFacetValues:Gy}}).searchForFacetValues(K,G,a(a({},S),U))}))}},Be=function(w){return function(k,S){var T=v(S);return T.queryParameters["X-Algolia-User-ID"]=k,w.transporter.write({method:A,path:"1/clusters/mapping"},T)}},jt=function(w){return function(k,S,T){var F=S.map(function(K){return{action:"addEntry",body:K}});return m(w.transporter.write({method:P,path:y("/1/dictionaries/%s/batch",k),data:{clearExistingDictionaryEntries:!0,requests:F}},T),function(K,G){return so(w)(K.taskID,G)})}},Nt=function(w){return function(k,S){return m(w.transporter.write({method:P,path:y("1/keys/%s/restore",k)},S),function(T,F){return g(function(K){return Ne(w)(k,F).catch(function(G){if(G.status!==404)throw G;return K()})})})}},zt=function(w){return function(k,S,T){var F=S.map(function(K){return{action:"addEntry",body:K}});return m(w.transporter.write({method:P,path:y("/1/dictionaries/%s/batch",k),data:{clearExistingDictionaryEntries:!1,requests:F}},T),function(K,G){return so(w)(K.taskID,G)})}},mr=function(w){return function(k,S,T){return w.transporter.read({method:P,path:y("/1/dictionaries/%s/search",k),data:{query:S},cacheable:!0},T)}},as=function(w){return function(k,S){return w.transporter.read({method:P,path:"1/clusters/mapping/search",data:{query:k}},S)}},jc=function(w){return function(k,S){return m(w.transporter.write({method:$,path:"/1/dictionaries/*/settings",data:k},S),function(T,F){return so(w)(T.taskID,F)})}},zc=function(w){return function(k,S){var T=Object.assign({},S),F=S||{},K=F.queryParameters,G=i(F,["queryParameters"]),U=K?{queryParameters:K}:{},W=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(w.transporter.write({method:$,path:y("1/keys/%s",k),data:U},G),function(te,Z){return g(function(pe){return Ne(w)(k,Z).then(function(fe){return function(Ee){return Object.keys(T).filter(function(be){return W.indexOf(be)!==-1}).every(function(be){if(Array.isArray(Ee[be])&&Array.isArray(T[be])){var Pe=Ee[be];return Pe.length===T[be].length&&Pe.every(function(je,Bt){return je===T[be][Bt]})}return Ee[be]===T[be]})}(fe)?Promise.resolve():pe()})})})}},so=function(w){return function(k,S){return g(function(T){return nt(w)(k,S).then(function(F){return F.status!=="published"?T():void 0})})}},Ca=function(w){return function(k,S){return m(w.transporter.write({method:P,path:y("1/indexes/%s/batch",w.indexName),data:{requests:k}},S),function(T,F){return Ze(w)(T.taskID,F)})}},Hc=function(w){return function(k){return ce(a(a({shouldStop:function(S){return S.cursor===void 0}},k),{},{request:function(S){return w.transporter.read({method:P,path:y("1/indexes/%s/browse",w.indexName),data:S},k)}}))}},ka=function(w){return function(k){var S=a({hitsPerPage:1e3},k);return ce(a(a({shouldStop:function(T){return T.hits.length<S.hitsPerPage}},S),{},{request:function(T){return Jy(w)("",a(a({},S),T)).then(function(F){return a(a({},F),{},{hits:F.hits.map(function(K){return delete K._highlightResult,K})})})}}))}},Uc=function(w){return function(k){var S=a({hitsPerPage:1e3},k);return ce(a(a({shouldStop:function(T){return T.hits.length<S.hitsPerPage}},S),{},{request:function(T){return Yy(w)("",a(a({},S),T)).then(function(F){return a(a({},F),{},{hits:F.hits.map(function(K){return delete K._highlightResult,K})})})}}))}},va=function(w){return function(k,S,T){var F=T||{},K=F.batchSize,G=i(F,["batchSize"]),U={taskIDs:[],objectIDs:[]};return m(function W(){var te,Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,pe=[];for(te=Z;te<k.length&&(pe.push(k[te]),pe.length!==(K||1e3));te++);return pe.length===0?Promise.resolve(U):Ca(w)(pe.map(function(fe){return{action:S,body:fe}}),G).then(function(fe){return U.objectIDs=U.objectIDs.concat(fe.objectIDs),U.taskIDs.push(fe.taskID),te++,W(te)})}(),function(W,te){return Promise.all(W.taskIDs.map(function(Z){return Ze(w)(Z,te)}))})}},qc=function(w){return function(k){return m(w.transporter.write({method:P,path:y("1/indexes/%s/clear",w.indexName)},k),function(S,T){return Ze(w)(S.taskID,T)})}},is=function(w){return function(k){var S=k||{},T=S.forwardToReplicas,F=v(i(S,["forwardToReplicas"]));return T&&(F.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:P,path:y("1/indexes/%s/rules/clear",w.indexName)},F),function(K,G){return Ze(w)(K.taskID,G)})}},Kc=function(w){return function(k){var S=k||{},T=S.forwardToReplicas,F=v(i(S,["forwardToReplicas"]));return T&&(F.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:P,path:y("1/indexes/%s/synonyms/clear",w.indexName)},F),function(K,G){return Ze(w)(K.taskID,G)})}},Wc=function(w){return function(k,S){return m(w.transporter.write({method:P,path:y("1/indexes/%s/deleteByQuery",w.indexName),data:k},S),function(T,F){return Ze(w)(T.taskID,F)})}},Gc=function(w){return function(k){return m(w.transporter.write({method:A,path:y("1/indexes/%s",w.indexName)},k),function(S,T){return Ze(w)(S.taskID,T)})}},Jc=function(w){return function(k,S){return m(V(w)([k],S).then(function(T){return{taskID:T.taskIDs[0]}}),function(T,F){return Ze(w)(T.taskID,F)})}},V=function(w){return function(k,S){var T=k.map(function(F){return{objectID:F}});return va(w)(T,yr.DeleteObject,S)}},J=function(w){return function(k,S){var T=S||{},F=T.forwardToReplicas,K=v(i(T,["forwardToReplicas"]));return F&&(K.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:y("1/indexes/%s/rules/%s",w.indexName,k)},K),function(G,U){return Ze(w)(G.taskID,U)})}},ye=function(w){return function(k,S){var T=S||{},F=T.forwardToReplicas,K=v(i(T,["forwardToReplicas"]));return F&&(K.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:y("1/indexes/%s/synonyms/%s",w.indexName,k)},K),function(G,U){return Ze(w)(G.taskID,U)})}},Ie=function(w){return function(k){return qy(w)(k).then(function(){return!0}).catch(function(S){if(S.status!==404)throw S;return!1})}},On=function(w){return function(k,S,T){return w.transporter.read({method:P,path:y("1/answers/%s/prediction",w.indexName),data:{query:k,queryLanguages:S},cacheable:!0},T)}},lo=function(w){return function(k,S){var T=S||{},F=T.query,K=T.paginate,G=i(T,["query","paginate"]),U=0;return function W(){return Wy(w)(F||"",a(a({},G),{},{page:U})).then(function(te){for(var Z=0,pe=Object.entries(te.hits);Z<pe.length;Z++){var fe=s(pe[Z],2),Ee=fe[0],be=fe[1];if(k(be))return{object:be,position:parseInt(Ee,10),page:U}}if(U++,K===!1||U>=te.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return W()})}()}},gr=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/indexes/%s/%s",w.indexName,k)},S)}},Un=function(){return function(w,k){for(var S=0,T=Object.entries(w.hits);S<T.length;S++){var F=s(T[S],2),K=F[0];if(F[1].objectID===k)return parseInt(K,10)}return-1}},on=function(w){return function(k,S){var T=S||{},F=T.attributesToRetrieve,K=i(T,["attributesToRetrieve"]),G=k.map(function(U){return a({indexName:w.indexName,objectID:U},F?{attributesToRetrieve:F}:{})});return w.transporter.read({method:P,path:"1/indexes/*/objects",data:{requests:G}},K)}},ss=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/indexes/%s/rules/%s",w.indexName,k)},S)}},qy=function(w){return function(k){return w.transporter.read({method:R,path:y("1/indexes/%s/settings",w.indexName),data:{getVersion:2}},k)}},HL=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/indexes/%s/synonyms/%s",w.indexName,k)},S)}},UL=function(w){return function(k,S){return m(Ky(w)([k],S).then(function(T){return{objectID:T.objectIDs[0],taskID:T.taskIDs[0]}}),function(T,F){return Ze(w)(T.taskID,F)})}},Ky=function(w){return function(k,S){var T=S||{},F=T.createIfNotExists,K=i(T,["createIfNotExists"]),G=F?yr.PartialUpdateObject:yr.PartialUpdateObjectNoCreate;return va(w)(k,G,K)}},qL=function(w){return function(k,S){var T=S||{},F=T.safe,K=T.autoGenerateObjectIDIfNotExist,G=T.batchSize,U=i(T,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),W=function(be,Pe,je,Bt){return m(w.transporter.write({method:P,path:y("1/indexes/%s/operation",be),data:{operation:je,destination:Pe}},Bt),function(Sa,It){return Ze(w)(Sa.taskID,It)})},te=Math.random().toString(36).substring(7),Z="".concat(w.indexName,"_tmp_").concat(te),pe=Yc({appId:w.appId,transporter:w.transporter,indexName:Z}),fe=[],Ee=W(w.indexName,Z,"copy",a(a({},U),{},{scope:["settings","synonyms","rules"]}));return fe.push(Ee),m((F?Ee.wait(U):Ee).then(function(){var be=pe(k,a(a({},U),{},{autoGenerateObjectIDIfNotExist:K,batchSize:G}));return fe.push(be),F?be.wait(U):be}).then(function(){var be=W(Z,w.indexName,"move",U);return fe.push(be),F?be.wait(U):be}).then(function(){return Promise.all(fe)}).then(function(be){var Pe=s(be,3),je=Pe[0],Bt=Pe[1],Sa=Pe[2];return{objectIDs:Bt.objectIDs,taskIDs:[je.taskID].concat(l(Bt.taskIDs),[Sa.taskID])}}),function(be,Pe){return Promise.all(fe.map(function(je){return je.wait(Pe)}))})}},KL=function(w){return function(k,S){return Zc(w)(k,a(a({},S),{},{clearExistingRules:!0}))}},WL=function(w){return function(k,S){return Xc(w)(k,a(a({},S),{},{clearExistingSynonyms:!0}))}},GL=function(w){return function(k,S){return m(Yc(w)([k],S).then(function(T){return{objectID:T.objectIDs[0],taskID:T.taskIDs[0]}}),function(T,F){return Ze(w)(T.taskID,F)})}},Yc=function(w){return function(k,S){var T=S||{},F=T.autoGenerateObjectIDIfNotExist,K=i(T,["autoGenerateObjectIDIfNotExist"]),G=F?yr.AddObject:yr.UpdateObject;if(G===yr.UpdateObject){var U=!0,W=!1,te=void 0;try{for(var Z,pe=k[Symbol.iterator]();!(U=(Z=pe.next()).done);U=!0)if(Z.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(fe){W=!0,te=fe}finally{try{U||pe.return==null||pe.return()}finally{if(W)throw te}}}return va(w)(k,G,K)}},JL=function(w){return function(k,S){return Zc(w)([k],S)}},Zc=function(w){return function(k,S){var T=S||{},F=T.forwardToReplicas,K=T.clearExistingRules,G=v(i(T,["forwardToReplicas","clearExistingRules"]));return F&&(G.queryParameters.forwardToReplicas=1),K&&(G.queryParameters.clearExistingRules=1),m(w.transporter.write({method:P,path:y("1/indexes/%s/rules/batch",w.indexName),data:k},G),function(U,W){return Ze(w)(U.taskID,W)})}},YL=function(w){return function(k,S){return Xc(w)([k],S)}},Xc=function(w){return function(k,S){var T=S||{},F=T.forwardToReplicas,K=T.clearExistingSynonyms,G=T.replaceExistingSynonyms,U=v(i(T,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return F&&(U.queryParameters.forwardToReplicas=1),(G||K)&&(U.queryParameters.replaceExistingSynonyms=1),m(w.transporter.write({method:P,path:y("1/indexes/%s/synonyms/batch",w.indexName),data:k},U),function(W,te){return Ze(w)(W.taskID,te)})}},Wy=function(w){return function(k,S){return w.transporter.read({method:P,path:y("1/indexes/%s/query",w.indexName),data:{query:k},cacheable:!0},S)}},Gy=function(w){return function(k,S,T){return w.transporter.read({method:P,path:y("1/indexes/%s/facets/%s/query",w.indexName,k),data:{facetQuery:S},cacheable:!0},T)}},Jy=function(w){return function(k,S){return w.transporter.read({method:P,path:y("1/indexes/%s/rules/search",w.indexName),data:{query:k}},S)}},Yy=function(w){return function(k,S){return w.transporter.read({method:P,path:y("1/indexes/%s/synonyms/search",w.indexName),data:{query:k}},S)}},ZL=function(w){return function(k,S){var T=S||{},F=T.forwardToReplicas,K=v(i(T,["forwardToReplicas"]));return F&&(K.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:$,path:y("1/indexes/%s/settings",w.indexName),data:k},K),function(G,U){return Ze(w)(G.taskID,U)})}},Ze=function(w){return function(k,S){return g(function(T){return function(F){return function(K,G){return F.transporter.read({method:R,path:y("1/indexes/%s/task/%s",F.indexName,K.toString())},G)}}(w)(k,S).then(function(F){return F.status!=="published"?T():void 0})})}},yr={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject"},Qc={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},XL=1,QL=2,eV=3,ls=function(w){return function(k,S){var T=k.map(function(F){return a(a({},F),{},{threshold:F.threshold||0})});return w.transporter.read({method:P,path:"1/indexes/*/recommendations",data:{requests:T},cacheable:!0},S)}},tV=function(w){return function(k,S){return ls(w)(k.map(function(T){return a(a({},T),{},{fallbackParameters:{},model:"bought-together"})}),S)}},nV=function(w){return function(k,S){return ls(w)(k.map(function(T){return a(a({},T),{},{model:"related-products"})}),S)}},oV=function(w){return function(k,S){var T=k.map(function(F){return a(a({},F),{},{model:"trending-facets",threshold:F.threshold||0})});return w.transporter.read({method:P,path:"1/indexes/*/recommendations",data:{requests:T},cacheable:!0},S)}},rV=function(w){return function(k,S){var T=k.map(function(F){return a(a({},F),{},{model:"trending-items",threshold:F.threshold||0})});return w.transporter.read({method:P,path:"1/indexes/*/recommendations",data:{requests:T},cacheable:!0},S)}},aV=function(w){return function(k,S){return ls(w)(k.map(function(T){return a(a({},T),{},{model:"looking-similar"})}),S)}},iV=function(w){return function(k,S){var T=k.map(function(F){return a(a({},F),{},{model:"recommended-for-you",threshold:F.threshold||0})});return w.transporter.read({method:P,path:"1/indexes/*/recommendations",data:{requests:T},cacheable:!0},S)}};function Zy(w,k,S){var T,F={appId:w,apiKey:k,timeouts:{connect:1,read:2,write:30},requester:{send:function(U){return new Promise(function(W){var te=new XMLHttpRequest;te.open(U.method,U.url,!0),Object.keys(U.headers).forEach(function(Ee){return te.setRequestHeader(Ee,U.headers[Ee])});var Z,pe=function(Ee,be){return setTimeout(function(){te.abort(),W({status:0,content:be,isTimedOut:!0})},1e3*Ee)},fe=pe(U.connectTimeout,"Connection timeout");te.onreadystatechange=function(){te.readyState>te.OPENED&&Z===void 0&&(clearTimeout(fe),Z=pe(U.responseTimeout,"Socket timeout"))},te.onerror=function(){te.status===0&&(clearTimeout(fe),clearTimeout(Z),W({content:te.responseText||"Network request failed",status:te.status,isTimedOut:!1}))},te.onload=function(){clearTimeout(fe),clearTimeout(Z),W({content:te.responseText,status:te.status,isTimedOut:!1})},te.send(U.data)})}},logger:(T=eV,{debug:function(U,W){return XL>=T&&console.debug(U,W),Promise.resolve()},info:function(U,W){return QL>=T&&console.info(U,W),Promise.resolve()},error:function(U,W){return console.error(U,W),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"})},K=a(a({},F),S),G=function(){return function(U){return function(W){var te=W.region||"us",Z=f(b.WithinHeaders,W.appId,W.apiKey),pe=H(a(a({hosts:[{url:"personalization.".concat(te,".algolia.com")}]},W),{},{headers:a(a(a({},Z.headers()),{"content-type":"application/json"}),W.headers),queryParameters:a(a({},Z.queryParameters()),W.queryParameters)}));return p({appId:W.appId,transporter:pe},W.methods)}(a(a(a({},F),U),{},{methods:{getPersonalizationStrategy:Se,setPersonalizationStrategy:ve}}))}};return function(U){var W=U.appId,te=f(U.authMode!==void 0?U.authMode:b.WithinHeaders,W,U.apiKey),Z=H(a(a({hosts:[{url:"".concat(W,"-dsn.algolia.net"),accept:O.Read},{url:"".concat(W,".algolia.net"),accept:O.Write}].concat(h([{url:"".concat(W,"-1.algolianet.com")},{url:"".concat(W,"-2.algolianet.com")},{url:"".concat(W,"-3.algolianet.com")}]))},U),{},{headers:a(a(a({},te.headers()),{"content-type":"application/x-www-form-urlencoded"}),U.headers),queryParameters:a(a({},te.queryParameters()),U.queryParameters)}));return p({transporter:Z,appId:W,addAlgoliaAgent:function(pe,fe){Z.userAgent.add({segment:pe,version:fe})},clearCache:function(){return Promise.all([Z.requestsCache.clear(),Z.responsesCache.clear()]).then(function(){})}},U.methods)}(a(a({},K),{},{methods:{search:X,searchForFacetValues:Q,multipleBatch:Po,multipleGetObjects:j,multipleQueries:X,copyIndex:De,copySettings:Tt,copySynonyms:et,copyRules:Ye,moveIndex:Ro,listIndices:hr,getLogs:Dt,listClusters:Mt,multipleSearchForFacetValues:Q,getApiKey:Ne,addApiKey:Qe,listApiKeys:bt,updateApiKey:zc,deleteApiKey:ut,restoreApiKey:Nt,assignUserID:We,assignUserIDs:Ve,getUserID:q,searchUserIDs:as,listUserIDs:wa,getTopUserIDs:ot,removeUserID:Be,hasPendingMappings:we,clearDictionaryEntries:Fe,deleteDictionaryEntries:nn,getDictionarySettings:yt,getAppTask:nt,replaceDictionaryEntries:jt,saveDictionaryEntries:zt,searchDictionaryEntries:mr,setDictionarySettings:jc,waitAppTask:so,customRequest:Ot,initIndex:function(U){return function(W){return Me(U)(W,{methods:{batch:Ca,delete:Gc,findAnswers:On,getObject:gr,getObjects:on,saveObject:GL,saveObjects:Yc,search:Wy,searchForFacetValues:Gy,waitTask:Ze,setSettings:ZL,getSettings:qy,partialUpdateObject:UL,partialUpdateObjects:Ky,deleteObject:Jc,deleteObjects:V,deleteBy:Wc,clearObjects:qc,browseObjects:Hc,getObjectPosition:Un,findObject:lo,exists:Ie,saveSynonym:YL,saveSynonyms:Xc,getSynonym:HL,searchSynonyms:Yy,browseSynonyms:Uc,deleteSynonym:ye,clearSynonyms:Kc,replaceAllObjects:qL,replaceAllSynonyms:WL,searchRules:Jy,getRule:ss,deleteRule:J,saveRule:JL,saveRules:Zc,replaceAllRules:KL,browseRules:ka,clearRules:is}})}},initAnalytics:function(){return function(U){return function(W){var te=W.region||"us",Z=f(b.WithinHeaders,W.appId,W.apiKey),pe=H(a(a({hosts:[{url:"analytics.".concat(te,".algolia.com")}]},W),{},{headers:a(a(a({},Z.headers()),{"content-type":"application/json"}),W.headers),queryParameters:a(a({},Z.queryParameters()),W.queryParameters)}));return p({appId:W.appId,transporter:pe},W.methods)}(a(a(a({},F),U),{},{methods:{addABTest:ue,getABTest:ge,getABTests:Ce,stopABTest:de,deleteABTest:Oe}}))}},initPersonalization:G,initRecommendation:function(){return function(U){return K.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),G()(U)}},getRecommendations:ls,getFrequentlyBoughtTogether:tV,getLookingSimilar:aV,getRecommendedForYou:iV,getRelatedProducts:nV,getTrendingFacets:oV,getTrendingItems:rV}}))}return Zy.version="4.23.2",Zy})})(Fy);var f$=Fy.exports;const p$=nE(f$),Ry=(e,t)=>{const o={};return e.forEach(r=>{const a=r.split(".");if(a.length!==t)return;const i=r.substring(0,r.lastIndexOf(".")),s=a[a.length-1];Object.keys(o).includes(i)?o[i].push(s):o[i]=[s]}),o};class Py{constructor(t,o,r="https://api.pennsieve.io"){this.client=p$(t,o),this.PENNSIEVE_API_LOCATION=r}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const o=t.map(i=>i.facetPropPath),r=t.map(i=>i.facetSubpropPath),a=t.map(i=>i.facetSubsubpropPath).filter(i=>i!==void 0);return this.index.search("",{sortFacetValuesBy:"alpha",facets:o.concat(r).concat(a)}).then(i=>{let s=[],l=0;return o.map(c=>{const d=t.find(b=>b.facetPropPath==c);var u=[];const f=i.facets;if(f===void 0)return;const g=f[c]==null?{}:f[c],m=d&&f[d.facetSubpropPath]?Object.keys(f[d.facetSubpropPath]):[],h=d&&d.facetSubsubpropPath&&f[d.facetSubsubpropPath]?Object.keys(f[d.facetSubsubpropPath]):[],p=Ry(m,2),y=Ry(h,3);Object.keys(g).map(b=>{const v=[];Object.keys(p).includes(b)&&p[b].forEach(C=>{const E=`${b}.${C}`,x=[];Object.keys(y).includes(E)&&(y[E].forEach(_=>{x.push({label:_,id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})}),E==="nerves and ganglia.dorsal root ganglion"&&x.push({label:"Non specific",id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})),v.push({label:C,id:l++,facetPropPath:`${d?d.facetSubpropPath:void 0}`,children:x.length?x:void 0})});let O={label:b,id:l++,facetPropPath:c};v.length>0&&(O.children=v),u.push(O)}),u.length>0&&s.push({label:d?d.label:"",id:l++,children:u,key:c})}),s})}_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){const o={};t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.curie&&(o[a.curie]=a.name)}),localStorage.setItem("available-name-curie-mapping",JSON.stringify(o))})}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,o="",r=10,a=1){const i=o.replaceAll('"',"").split(",");let s="";const l=[];i&&(i.length===1&&!o.includes(" ")?s=o:i.forEach(d=>{l.push(d.trim()),s+=`"${d.trim()}" `})),s=s.trim();const c={advancedSyntax:!0,advancedSyntaxFeatures:["exactPhrase"],queryType:"prefixAll",facets:["*"],hitsPerPage:r,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]};return l.length>1&&(c.optionalWords=l),new Promise(d=>{this.index.search(s,c).then(u=>{let f={items:this._processResultsForCards(u.hits),total:u.nbHits,discoverIds:u.hits.map(g=>g.pennsieve?g.pennsieve.identifier:g.objectID),dois:u.hits.map(g=>g.item.curie.split(":")[1])};d(f)})})}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","anatomy.organ.subsubcategory.name"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.facets,s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}setLocalStorageForTermMapping(){return new Promise(t=>{this.index.search("",{facets:["*"],hitsPerPage:999999,page:0,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(o=>{this._processAnatomy(o.hits)})})}processResultsForFlatmap(t,o){const r=this.filterAvailableAnatomies(t);return o.map(i=>({id:i.objectID,terms:i.anatomy?i.anatomy.organ.map(l=>{if(r.includes(l.name.toLowerCase()))return l.curie}).filter(Boolean):[]}))}filterAvailableAnatomies(t){const o=t["anatomy.organ.name"],r=t["anatomy.organ.category.name"],a=t["anatomy.organ.subcategory.name"],i=t["anatomy.organ.subsubcategory.name"],s=o?Object.keys(o):[],l=r?Object.keys(r):[],c=a?Object.keys(a):[],d=i?Object.keys(i):[],u=[];return l.forEach(f=>{const g=f.toLowerCase();s.forEach(m=>{const h=m.toLowerCase(),p=`${g}.${h}`;c.some(b=>{const v=b.toLowerCase();return v===p?!0:d.find(O=>`${v}.${h}`===O)})&&u.push(h)})}),u}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 Mc=[{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",facetSubsubpropPath:"anatomy.organ.subsubcategory.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:"Consortia",id:"supportingAwards.consortium",facetPropPath:"supportingAwards.consortium.name",facetSubpropPath:"supportingAwards.consortium.subcategory.name"}];function $y(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>{a.label=a.facet3?a.facet3:a.facet2?a.facet2:a.facet});let t=Ly(e);t.forEach(a=>{a.facet3&&a.facet3==="Non specific"&&(a.label=a.facet2)});let o="NOT item.published.status:embargo";return o=`(${o}) AND `,Mc.map(a=>[a.facetPropPath,a.facetFilterPath]).map(([a,i])=>{let s=t.filter(d=>d.facetPropPath==a),l="",c="";s.map(d=>{let u=d.facetSubPropPath?d.facetSubPropPath:i||a;d.AND?c+=`AND "${u}":"${d.label}"`:l+=`"${u}":"${d.label}" OR `}),!(l==""&&c=="")&&(l=`(${l.substring(0,l.lastIndexOf(" OR "))})`,o+=`${l+c} AND `,o=o.split("()AND ").join(""))}),o.substring(0,o.lastIndexOf(" AND "))}function Ly(e){return e.filter(t=>t.label!=="Show all")}const ba=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Vy=function(e){const t=e.toLowerCase();return qi[t]?ba(qi[t]):e===e.toUpperCase()?e:ba(t)},h$={name:"SearchFilters",components:{MapSvgIcon:Lc,MapSvgSpriteColor:Dc,Option:Cl,Select:ii,Popover:Zo,Cascader:up},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{algoliaClient:void 0,cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],filterTimeout:null,numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],cascaderProps:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[],searchInputs:{}}},setup(){const e=n.markRaw({}),t=n.markRaw({term:new Set,facet:new Set,facet2:new Set,facet3:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`},showFilters:function(){return this.entry.showFilters}},watch:{entry:{deep:!0,immediate:!0,handler:function(e,t){JSON.stringify(e==null?void 0:e.options)!==JSON.stringify(t==null?void 0:t.options)&&(this.options=[],this.filters=[],this.cascaderIsReady=!1,this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.options.length&&(this.checkShowAllBoxes(),this.cssMods(),this.$emit("cascaderReady"))}))}}},methods:{createCascaderItemValue:function(e){let t;if(e!=null&&e.length){t=e[0];for(let o=1;e.length>o;o++)t=`${t}>${e[o]}`;t.includes("undefined")&&console.warn("Warning: One or more of the facets is undefined, this will not be shown in the cascader")}return t},createChildrenCascaderValue:function(e,t,o){if(e!=null&&e.length)for(let r=0;r<e.length;r++){const a=e[r];if(e[r].facetPropPath!=="supportingAwards.consortium.name"&&(e[r].label=Vy(a.label)),a.key&&t.key.includes("flatmap.connectivity.source.")){const i=a.key,s=t.key,l=i.replace(`${s}.`,"");e[r].value=this.createCascaderItemValue([t.label,l])}else{const i=o.slice();i.push(a.label),e[r].value=this.createCascaderItemValue(i),this.createChildrenCascaderValue(a.children,t,i)}}},getNodeKey:function(e){return e?e.split(">")[1]:""},isFlatmapConnectionsNode:function(e){return e.pathValues[0].includes("flatmap.connectivity.source")&&e.isLeaf},isFlatmapConnectionsFilterNode:function(e){return e.pathValues[0].includes("flatmap.connectivity.source")&&e.pathLabels.includes("Filters")&&e.isDisabled&&e.isLeaf},processOptions:function(){const e=JSON.parse(JSON.stringify(this.options));e.forEach((t,o)=>{e[o].total=this.countTotalFacet(t),e[o].label=Vy(t.label),e[o].value=this.createCascaderItemValue([t.key]),e[o].children.find(r=>r.label==="Show all")||e[o].children.unshift({value:this.createCascaderItemValue(["Show all"]),label:"Show all"}),t.key.includes("flatmap.connectivity.source")&&e[o].children.unshift({value:this.createCascaderItemValue(["ConnectivityFilters"]),label:"Filters",disabled:!0}),this.createChildrenCascaderValue(e[o].children,t,[t.label])}),Object.assign(this.options,e)},populateCascader:function(){return this.entry.options?new Promise(e=>{this.facets=this.entry.options,this.options=this.entry.options,this.processOptions(),e()}):new Promise(e=>{this.algoliaClient.getAlgoliaFacets(Mc).then(t=>{this.facets=t,me.emit("available-facets",t),this.options=t,this.processOptions()}).finally(()=>{e()})})},isConnectivityTag:function(e){return/^[A-Za-z]:/.test(e)},getConnectivityTag:function(e){const t=e.indexOf(":");return t!==-1?e.substring(t+1):e},modifyCascaderTagStyle:function(e){return this.isConnectivityTag(e)?"connectivity-tag":""},flattenToEvents:function(e,t,o,r=void 0){const a=[];for(const[i,s]of Object.entries(t)){const l=o.find(c=>c.label===i);if(Object.entries(s).length){const c=l.key||r,d=this.flattenToEvents(e,s,l.children,c);a.push(...d)}else i!==e&&a.push([r,l.value])}return a},cascadeTagClose:function(e){const t=this.isConnectivityTag(e)?this.getConnectivityTag(e):e,o=this.flattenToEvents(t,this.cascaderTags,this.options);this.cascadeEvent(o)},flattenToTags:function(e){const t=[];for(const[o,r]of Object.entries(e))if(Object.entries(r).length){const a=this.flattenToTags(r);t.push(...a)}else o!=="Show all"&&t.push(o);return t},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.correctnessCheck.facet3&&this.options.map(t=>{var o;this.correctnessCheck.term.add(t.label),(o=t.children)==null||o.map(r=>{var a;this.correctnessCheck.facet.add(r.label),(a=r.children)==null||a.map(i=>{var s;this.correctnessCheck.facet2.add(i.label),(s=i.children)==null||s.map(l=>{this.correctnessCheck.facet3.add(l.label)})})})}),this.cascaderTags={},this.cascaderTagsClone={},this.presentTags=[],e.map(t=>{const{facet:o,facet2:r,facet3:a,term:i,tagLabel:s,facetPropPath:l}=t;let c=o,d="";l&&l.includes("flatmap.connectivity.source.")&&s&&(c=s,d=i.charAt(0)),i&&this.correctnessCheck.term.has(i)&&(i in this.cascaderTags||(this.cascaderTags[i]={},this.cascaderTagsClone[i]={}),c&&this.correctnessCheck.facet.has(c)&&(c in this.cascaderTags[i]||(this.cascaderTags[i][c]={},d?this.cascaderTagsClone[i][d+":"+c]={}:this.cascaderTagsClone[i][c]={}),r&&this.correctnessCheck.facet2.has(r)&&(r in this.cascaderTags[i][c]||(this.cascaderTags[i][c][r]={},this.cascaderTagsClone[i][c][r]={}),a&&this.correctnessCheck.facet3.has(a)&&(a in this.cascaderTags[i][c][r]||(this.cascaderTags[i][c][r][a]={},this.cascaderTagsClone[i][c][r][a]={})))))}),this.presentTags=[...this.presentTags,...this.flattenToTags(this.cascaderTagsClone)],this.presentTags=[...new Set(this.presentTags)].sort(),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){t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t);const o=this.$refs.cascader,a=(o==null?void 0:o.getCheckedNodes(!0)).filter(l=>l.checked&&l.label!=="Show all");if(this.__expandItem__){let l=0;this.__expandItem__.length>1&&(l=1);const c=t.filter(u=>u[l]==this.__expandItem__[l]),d=t.filter(u=>u[l]!==this.__expandItem__[l]);t=[...c,...d]}let i=t.filter(l=>l!==void 0).map(l=>{let{hString:c,bString:d}=this.findHierarachyStringAndBooleanString(l),{facet:u,facet2:f,facet3:g,term:m}=this.getFacetsFromHierarchyString(c);const h=a.find(y=>l.join()===y.pathValues.join()),p=h?h.label:void 0;return{facetPropPath:l[0],facet:u,facet2:f,facet3:g,term:m,AND:d,tagLabel:p}}),s=t.filter(l=>l!==void 0).map(l=>{let c=l[0].includes("duplicate")?l[0].split("duplicate")[0]:l[0],{hString:d,bString:u}=this.findHierarachyStringAndBooleanString(l),{facet:f,facet2:g,facet3:m,term:h}=this.getFacetsFromHierarchyString(d);m?m==="Non specific"?f=g:f=m:g&&(f=g);const p=a.find(b=>l.join()===b.pathValues.join()),y=p?p.label:void 0;return{facetPropPath:c,facet:f,term:h,AND:u,tagLabel:y}});this.filterTimeout&&clearTimeout(this.filterTimeout),this.$emit("loading",!0),this.setCascader(i),this.filterTimeout=setTimeout(()=>{this.$emit("filterResults",s),this.cssMods()},600)}},findHierarachyStringAndBooleanString(e){let t,o;const r=e.length;return r>=3?e[r-1]&&(typeof e[r-1]=="string"||e[r-1]instanceof String)&&e[r-1].split(">").length>2?t=e[r-1]:t=e[r-2]:t=e[1],r>=3&&typeof e[r-1]=="boolean"&&(o=e[r-1]),{hString:t,bString:o}},getFacetsFromHierarchyString(e){let t=e.split(">");return{term:t[0],facet:t[1],facet2:t[2],facet3:t[3]}},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.__expandItem__&&this.updateListFilters(this.__expandItem__[0]),this.updateListStyleOrder(),this.cssMods()},updateListStyleOrder:function(){this.$nextTick(()=>{const e=this.$refs.cascader,t=e==null?void 0:e.contentRef;if(t){const o=t.querySelectorAll(".el-cascader-menu__list");o&&o.forEach(r=>{r.querySelector(".sidebar-cascader-search")?r.classList.add("cascader-menu-with-search"):r.classList.remove("cascader-menu-with-search")})}})},searchInputChange:function(e,t){e.preventDefault();const{target:o}=e;if(o){const r=o.value,a=t.pathValues[0];this.searchInputs[a]=r,this.updateListFilters(a)}},searchInputFocusToggle:function(e,t){const{target:o}=e;if(!o)return;const r=o.closest(".el-input__wrapper");t===!0?r.classList.add("is-focus"):r.classList.remove("is-focus")},updateListFilters:function(e){const t=this.searchInputs[e]||"";this.$nextTick(()=>{const o=this.$refs["searchInput_"+e];if(!o)return;o.closest(".el-cascader-menu__list").querySelectorAll(".el-cascader-node").forEach((a,i)=>{i>1&&(a.querySelector(".el-cascader-node__label").textContent.toLowerCase().includes(t.toLowerCase())?a.classList.remove("hide"):a.classList.add("hide"))}),t&&o.focus()})},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([ba(o.term),o.facet])];return o.facet2&&(r.push(this.createCascaderItemValue([ba(o.term),o.facet,o.facet2])),o.facet3&&r.push(this.createCascaderItemValue([ba(o.term),o.facet,o.facet2,o.facet3]))),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&&t.length)return t.forEach(o=>{this.cascadeSelected.filter(a=>a.term!=o.term);const r=[o.facetPropPath,this.createCascaderItemValue([o.term,o.facet]),this.createCascaderItemValue([o.term,o.facet,o.facet2])];o.facet3&&r.push(this.createCascaderItemValue([o.term,o.facet,o.facet2,o.facet3])),this.cascadeSelected.push([...r]),this.cascadeSelectedWithBoolean.push([...r,o.AND])}),!0}},addFilters:function(e){let t=!1;return this.cascaderIsReady&&e.forEach(o=>{t=t||this.addFilter(o)}),t},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()},flattenToFilters:function(e,t,o=!1){let r=[];if(t){const a=e.facet.toLowerCase();let i=!1;for(const s of t){const l=e.facetPropPath.includes("flatmap.connectivity.source.")&&s.key,c=l?s.key.replace(`${e.facetPropPath}.`,"").toLowerCase()===a:s.label.toLowerCase()===a;if(s.children&&s.children.length){const d=c||o,u=this.flattenToFilters(e,s.children,d);r.push(...u)}else if(s.facetPropPath||s.key){const[d,u,f,g]=s.value.split(">");g==="Non specific"&&(i=!0);const m={term:d,facet:u,facetPropPath:e.facetPropPath,...f&&{facet2:f},...g&&{facet3:g}};"AND"in e&&(m.AND=e.AND),(o||c)&&(l?r.push(e):r.push(m))}}o&&i&&(r=r.filter(s=>!s.facet3||s.facet3==="Non specific"))}return r},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2||e.facet3)return[e];{const t=this.options.find(o=>o.label===e.term);if(t)return this.flattenToFilters(e,t.children)}}},getHierarchicalValidatedFilters:function(e){const t=[],o=[],r=[];if(e){if(!this.cascaderIsReady)return{result:e,notFound:r};e.forEach(a=>{const i=this.validateAndConvertFilterToHierarchical(a);i&&i.length?i.forEach(s=>{t.push(s),o.push(s.term)}):this.options.find(l=>l.key===a.facetPropPath)&&r.push(a)}),this.options.forEach(a=>{o.includes(a.label)||t.push({facet:"Show all",facetPropPath:a.key,label:"Show all",term:a.label})})}return{result:t,notFound:r}},hasLineStyles:function(e){return"colour"in e&&e.colourStyle==="line"},getLineStyles:function(e){return"colour"in e&&e.colourStyle==="line"?"dashed"in e&&e.dashed===!0?{background:`repeating-linear-gradient(90deg,${e.colour},${e.colour} 6px,transparent 0,transparent 9px)`}:{background:e.colour}:{display:"None"}},getBackgroundStyles:function(e){return"colour"in e&&e.colourStyle==="background"?{background:e.colour}:{}}},mounted:function(){this.entry.options||(this.algoliaClient=n.markRaw(new Py(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.algoliaClient.setLocalStorageForTermMapping()),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},m$={class:"filters"},g$={key:0},y$={key:0,class:"cascader-tag"},b$={class:"el-tags-container"},w$={class:"el-tags-container"},C$={class:"search-filters transition-box"},k$={key:0},v$={class:"sidebar-cascader-search el-input"},S$={class:"el-input__wrapper"},E$=["value","onInput"],x$={key:1},_$={key:0,class:"sr-only"},T$={key:0,class:"filter-default-value"},O$={class:"dataset-shown"},N$={class:"dataset-results-feedback"};function B$(e,t,o,r,a,i){const s=n.resolveComponent("MapSvgSpriteColor"),l=wo,c=Zo,d=hl,u=pl,f=up,g=n.resolveComponent("MapSvgIcon"),m=Cl,h=ii,p=Xo;return n.openBlock(),n.createElementBlock("div",m$,[n.createVNode(s),i.showFilters&&e.options.length>0?(n.openBlock(),n.createElementBlock("div",g$,[e.presentTags.length>0?(n.openBlock(),n.createElementBlock("div",y$,[n.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=y=>i.cascadeTagClose(e.presentTags[0]))},{default:n.withCtx(()=>[n.createElementVNode("span",{class:n.normalizeClass(["tag-text",i.modifyCascaderTagStyle(e.presentTags[0])])},n.toDisplayString(e.presentTags[0]),3)]),_:1}),e.presentTags.length>1?(n.openBlock(),n.createBlock(c,{key:0,placement:"bottom-start",width:250,trigger:"hover","popper-class":"cascade-tags-popover"},{default:n.withCtx(()=>[n.createElementVNode("div",b$,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.presentTags.slice(1),(y,b)=>(n.openBlock(),n.createBlock(l,{key:b,class:n.normalizeClass(["ml-2",i.modifyCascaderTagStyle(y)]),type:"info",closable:"",onClose:v=>i.cascadeTagClose(y)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y),1)]),_:2},1032,["class","onClose"]))),128))])]),reference:n.withCtx(()=>[n.createElementVNode("div",w$,[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",C$,[n.createVNode(f,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[3]||(t[3]=y=>e.cascadeSelected=y),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.cascaderProps,onChange:t[4]||(t[4]=y=>i.cascadeEvent(y)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},{default:n.withCtx(({node:y,data:b})=>[i.isFlatmapConnectionsFilterNode(y)?(n.openBlock(),n.createElementBlock("div",k$,[n.createElementVNode("div",v$,[n.createElementVNode("div",S$,[n.createElementVNode("input",{class:"el-input__inner",ref:"searchInput_"+y.pathValues[0],value:e.searchInputs[y.pathValues[0]],onInput:v=>i.searchInputChange(v,y),onFocus:t[1]||(t[1]=v=>i.searchInputFocusToggle(v,!0)),onBlur:t[2]||(t[2]=v=>i.searchInputFocusToggle(v,!1)),style:{width:"100%"},autocomplete:"off",placeholder:"Search"},null,40,E$)])])])):(n.openBlock(),n.createElementBlock("div",x$,[n.createVNode(u,null,{default:n.withCtx(()=>[i.hasLineStyles(b)?(n.openBlock(),n.createBlock(d,{key:0,span:4},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"path-visual",style:n.normalizeStyle(i.getLineStyles(b))},null,4)]),_:2},1024)):n.createCommentVNode("",!0),n.createVNode(d,{span:20},{default:n.withCtx(()=>[i.isFlatmapConnectionsNode(y)?(n.openBlock(),n.createElementBlock("span",_$,n.toDisplayString(i.getNodeKey(y.value)),1)):n.createCommentVNode("",!0),n.createElementVNode("div",{style:n.normalizeStyle(i.getBackgroundStyles(b))},n.toDisplayString(b.label),5)]),_:2},1024)]),_:2},1024)]))]),_:1},8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(n.openBlock(),n.createElementBlock("div",T$,"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(g,{icon:"help",class:"help"})]),default:n.withCtx(()=>[n.createElementVNode("div",null,[t[7]||(t[7]=n.createElementVNode("strong",null,"Within categories:",-1)),t[8]||(t[8]=n.createTextVNode(" OR ")),t[9]||(t[9]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" example: "+n.toDisplayString(o.entry.helper.within)+" ",1),t[10]||(t[10]=n.createElementVNode("br",null,null,-1)),t[11]||(t[11]=n.createElementVNode("br",null,null,-1)),t[12]||(t[12]=n.createElementVNode("strong",null,"Between categories:",-1)),t[13]||(t[13]=n.createTextVNode(" AND ")),t[14]||(t[14]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" example: "+n.toDisplayString(o.entry.helper.between),1)])]),_:1})])),[[p,!e.cascaderIsReady]])]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",O$,[n.createElementVNode("span",N$,n.toDisplayString(i.numberOfResultsText),1),n.createVNode(h,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[5]||(t[5]=y=>e.numberShown=y),placeholder:"10",onChange:t[6]||(t[6]=y=>i.numberShownChanged(y))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.numberDatasetsShown,y=>(n.openBlock(),n.createBlock(m,{key:y,label:y,value:y},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const rs=Jt(h$,[["render",B$],["__scopeId","data-v-5ccdbcd9"]]);var I$=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},A$={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const F$={components:{SearchFilters:rs,DatasetCard:Wg,SearchHistory:os,Button:ht,Card:ni,Drawer:ml,Icon:Te,Input:Ko,Pagination:si,MapSvgIcon:Lc,MapSvgSpriteColor:Dc},name:"DatasetExplorer",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>A$},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,showFilters:!0,helper:{within:"'heart' OR 'colon'",between:"'rat' AND 'lung'"}}}},methods:{hoverChanged:function(e){const t=e?{...e,tabType:"dataset"}:{tabType:"dataset"};this.$emit("hover-changed",t)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t=""){if(this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady){const o=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),r=o.notFound?o.notFound.filter(a=>a.facet.toLowerCase()!=="show all"):[];this.filter=o.result,r.forEach(a=>{Lp({message:`${a.facet} cannot be found in ${a.term}!`,appendTo:this.$el,showClose:!0,offset:113})}),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter),this.searchHistoryUpdate(this.filter,t))}else this.filter=e,(!e||e.length==0)&&(this.searchAlgolia(this.filter,t),this.searchHistoryUpdate(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilters(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()},onResetClick:function(){this.openSearch([],""),this.$emit("search-changed",{value:this.searchInput,tabType:"dataset",type:"reset-update"}),me.emit("trackEvent",{event_name:"portal_maps_action_filter",category:"reset",location:"map_sidebar_dataset"})},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.searchInput=this.searchInput.trim(),this.searchAndFilterUpdate())},filterUpdate:function(e){this.filter=[...e],this.searchAndFilterUpdate(),this.$emit("search-changed",{value:e,tabType:"dataset",type:"filter-update"})},searchAndFilterUpdate:function(){this.resetPageNavigation(),this.searchAlgolia(this.filter,this.searchInput),this.searchHistoryUpdate(this.filter,this.searchInput)},searchHistoryUpdate:function(e,t){this.$refs.searchHistory.selectValue="Search history",(e.length||t!=null&&t.trim())&&this.$refs.searchHistory.addSearchToHistory(e,t)},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch($y(e),t).then(o=>{me.emit("anatomy-in-datasets",o.forFlatmap),me.emit("number-of-datasets-for-anatomies",o.forScaffold)}),this.algoliaClient.search($y(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,tabType:"dataset",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,me.emit("trackEvent",{event_name:"portal_maps_dataset_perPage",category:e+"",location:"map_sidebar_dataset"});const t=this.page===1;this.pageChange(1,t)},pageChange:function(e,t=!1){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filter,this.searchInput,this.numberPerPage,this.page),t||me.emit("trackEvent",{event_name:"portal_maps_dataset_pagination",category:`page_${this.page}`,location:"map_sidebar_dataset"})},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,simulation:t["abi-simulation-omex-file"]?t["abi-simulation-omex-file"]:t["abi-simulation-file"],flatmaps:t["abi-flatmap-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(I$).then(s=>s.json()).then(s=>r(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(Mc)},searchHistorySearch:function(e){this.searchInput=e.search,this.filter=e.filters,this.openSearch([...e.filters],e.search)},getSearch:function(){return this.searchInput},getFilters:function(){return this.filter.some(t=>t.facet.toLowerCase()!=="show all")?this.filter:[]}},mounted:function(){this.algoliaClient=n.markRaw(new Py(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/"}},R$={class:"header"},P$={class:"content scrollbar",ref:"content"},$$={key:0,class:"error-feedback"};function L$(e,t,o,r,a,i){const s=Ko,l=n.resolveComponent("MapSvgIcon"),c=Zo,d=ht,u=rs,f=os,g=Wg,m=si,h=ni,p=Xo;return n.openBlock(),n.createBlock(h,{"body-style":e.bodyStyle,class:"content-card"},{header:n.withCtx(()=>[n.createElementVNode("div",R$,[n.createElementVNode("div",{class:n.normalizeClass(["search-input-container",{"is-focus":e.searchInput}])},[n.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=y=>e.searchInput=y),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),n.createVNode(c,{width:"350",trigger:"hover","popper-class":"filter-help-popover"},{reference:n.withCtx(()=>[n.createVNode(l,{icon:"help",class:"help"})]),default:n.withCtx(()=>[t[3]||(t[3]=n.createElementVNode("div",null,[n.createElementVNode("strong",null,"Search rules:"),n.createElementVNode("ul",null,[n.createElementVNode("li",null,[n.createElementVNode("strong",null,"Multiple Terms:"),n.createTextVNode(" Separate terms with a comma ("),n.createElementVNode("code",null,","),n.createTextVNode('). This will find datasets that match any of the terms (an "OR" search). ')]),n.createElementVNode("li",null,[n.createElementVNode("strong",null,"Exact Phrase:"),n.createTextVNode(" Terms within a comma block will be matched as an exact phrase. ")])]),n.createElementVNode("br"),n.createElementVNode("strong",null,"Examples:"),n.createElementVNode("ul",null,[n.createElementVNode("li",null,[n.createElementVNode("strong",null,"To find by exact phrase:"),n.createTextVNode(" Searching for "),n.createElementVNode("code",null,"vagus nerve"),n.createTextVNode(" will find any dataset containing "),n.createElementVNode("code",null,'"vagus nerve"'),n.createTextVNode(". ")]),n.createElementVNode("li",null,[n.createElementVNode("strong",null,"To find by multiple terms:"),n.createTextVNode(" Searching for "),n.createElementVNode("code",null,"nerve, vagus"),n.createTextVNode(" will find data that contains either "),n.createElementVNode("code",null,"nerve"),n.createTextVNode(" OR "),n.createElementVNode("code",null,"vagus"),n.createTextVNode(". ")])])],-1))]),_:1})],2),n.createVNode(d,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:n.withCtx(()=>t[4]||(t[4]=[n.createTextVNode(" Search ")])),_:1},8,["onClick"]),n.createVNode(d,{link:"",class:"el-button-link",onClick:i.onResetClick,size:"large"},{default:n.withCtx(()=>t[5]||(t[5]=[n.createTextVNode(" Reset ")])),_:1},8,["onClick"])])]),default:n.withCtx(()=>[n.createVNode(u,{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(f,{ref:"searchHistory",localStorageKey:"sparc.science-dataset-search-history",onSearch:i.searchHistorySearch},null,8,["onSearch"]),n.withDirectives((n.openBlock(),n.createElementBlock("div",P$,[e.results.length===0&&!e.loadingCards?(n.openBlock(),n.createElementBlock("div",$$," No results found - Please change your search / filter criteria. ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.results,y=>(n.openBlock(),n.createElementBlock("div",{key:y.doi,class:"step-item"},[n.createVNode(g,{class:"dataset-card",entry:y,envVars:o.envVars,onMouseenter:b=>i.hoverChanged(y),onMouseleave:t[1]||(t[1]=b=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),n.createVNode(m,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=y=>e.page=y),"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"])])),[[p,e.loadingCards]])]),_:1},8,["body-style"])}const Dy=Jt(F$,[["render",L$],["__scopeId","data-v-f40f1349"]]),V$=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),io=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},D$={name:"ConnectivityInfo",components:{Button:ht,Container:Sx,Icon:Te,ElIconWarning:ae.Warning,ElIconLocation:ae.Location,ElIconSearch:ae.Search,ElIconArrowDown:ae.ArrowDown,ElIconArrowUp:ae.ArrowUp,ExternalResourceCard:qn.ExternalResourceCard,CopyToClipboard:qn.CopyToClipboard,ConnectivityGraph:qn.ConnectivityGraph,ConnectivityList:qn.ConnectivityList,ConnectivityReconciliationList:qn.ConnectivityReconciliationList},props:{connectivityEntry:{type:Array,default:[]},entryData:{type:Object,default:()=>({})},entryId:{type:String,default:""},envVars:{type:Object,default:()=>{}},availableAnatomyFacets:{type:Array,default:()=>[]},withCloseButton:{type:Boolean,default:!1},showLongLabel:{type:Boolean,default:!1}},data:function(){return{updatedCopyContent:"",activeView:"listView",connectivityLoading:!1,connectivitySource:"map",noMapConnectivity:!1,connectivityError:{},graphViewLoaded:!1,connectivityFromMap:null,isTitleExpanded:!1,showTitleToggle:!1}},computed:{entry:function(){return this.connectivityEntry.find(e=>e.featureId[0]===this.entryId)},displayTitle:function(){var e,t,o;return this.showLongLabel?((e=this.entryData)==null?void 0:e["long-label"])||((t=this.entry)==null?void 0:t["long-label"])||"":((o=this.entry)==null?void 0:o.title)||""},hasProvenanceTaxonomyLabel:function(){return this.entry.provenanceTaxonomyLabel&&this.entry.provenanceTaxonomyLabel.length>0},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e},connectivityKey:function(){return this.entry.featureId[0]+this.entry.connectivitySource},origins:function(){return this.entry.origins},components:function(){return this.entry.components},destinations:function(){return this.entry.destinations},originsWithDatasets:function(){return this.entry.originsWithDatasets},componentsWithDatasets:function(){return this.entry.componentsWithDatasets},destinationsWithDatasets:function(){return this.entry.destinationsWithDatasets},hasSingleConnectivityList:function(){return this.entry.hasSingleConnectivityList},destinationsCombinations:function(){return this.entry.destinationsCombinations||[]},originsCombinations:function(){return this.entry.originsCombinations||[]},componentsCombinations:function(){return this.entry.componentsCombinations||[]},resources:function(){return this.entry.hyperlinks||[]},sckanVersion:function(){return this.entry.knowledgeSource},flatmapApi:function(){return this.envVars.FLATMAPAPI_LOCATION}},watch:{entry:{deep:!0,immediate:!0,handler:function(e,t){e&&e!==t&&(this.connectivityLoading=!0,this.activeView=localStorage.getItem("connectivity-active-view")||this.activeView,this.activeView==="graphView"&&(this.graphViewLoaded=!0),this.connectivitySource=this.entry.connectivitySource,this.noMapConnectivity=this.entry.noMapConnectivity,this.updateGraphConnectivity(),this.connectivityLoading=!1,(!t||(e==null?void 0:e.featureId[0])!==(t==null?void 0:t.featureId[0]))&&this.$emit("loaded"),this.isTitleExpanded=!1,this.updateTitleToggleVisibility())}},displayTitle:function(){this.isTitleExpanded=!1,this.updateTitleToggleVisibility()}},methods:{titleCase:function(e){return V$(e)},capitalise:function(e){return io(e)},toggleTitleExpansion:function(){this.isTitleExpanded=!this.isTitleExpanded,this.isTitleExpanded||this.$nextTick(()=>{this.updateTitleToggleVisibility()})},updateTitleToggleVisibility:function(){this.$nextTick(()=>{const e=this.$refs.titleElement;if(!e){this.showTitleToggle=!1;return}const t=this.isTitleExpanded;t&&e.classList.add("title--clamped");const o=e.scrollHeight>e.clientHeight+1;this.showTitleToggle=o,t&&e.classList.remove("title--clamped"),o||(this.isTitleExpanded=!1)})},showConnectivity:function(){const e=this.entry.featureId||[];this.$emit("show-connectivity",e),me.emit("trackEvent",{event_name:"portal_maps_show_connectivity_on_map",category:this.entry.id||"",location:"map_sidebar_connectivity"})},onCopied:function(){me.emit("trackEvent",{event_name:"portal_maps_connectivity_copy",category:this.entry.id||"",location:"map_sidebar_connectivity"})},switchConnectivityView:function(e){this.activeView=e,localStorage.setItem("connectivity-active-view",this.activeView),e==="graphView"&&!this.graphViewLoaded&&this.$nextTick(()=>{this.graphViewLoaded=!0}),me.emit("trackEvent",{event_name:"portal_maps_connectivity_switch_view",category:e,location:"map_sidebar_connectivity"})},openGraphInViewer:function(){const e={entry:this.entry.featureId[0],mapServer:this.flatmapApi,sckanVersion:this.sckanVersion,connectivityFromMap:this.connectivityFromMap,connectivityError:this.connectivityError,origins:this.origins,components:this.components,destinations:this.destinations,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,destinationsWithDatasets:this.destinationsWithDatasets,hasSingleConnectivityList:this.hasSingleConnectivityList,originsCombinations:this.originsCombinations,componentsCombinations:this.componentsCombinations,destinationsCombinations:this.destinationsCombinations,allWithDatasets:[...this.componentsWithDatasets,...this.destinationsWithDatasets,...this.originsWithDatasets],connectivityInfo:this.entry};me.emit("show-connectivity-graph",e)},onTapNode:function(e){const t=e.map(o=>o.label).join(", ");this.onConnectivityHovered(t)},onShowReferenceConnectivities:function(e){this.$emit("show-reference-connectivities",e)},onReferencesLoaded:function(e){this.updatedCopyContent=this.getUpdateCopyContent(e)},getUpdateCopyContent:function(e){var f,g,m,h,p,y,b,v,O,C,E,x;if(!this.entry)return"";const t=[],o=((f=this.entry)==null?void 0:f.title)||"",r=((g=this.entryData)==null?void 0:g["long-label"])||((m=this.entry)==null?void 0:m["long-label"])||"";let a=this.entry.featureId;const i=[],s=io(r||o);s&&i.push(`<div><strong>${s}</strong></div>`),a!=null&&a.length&&(typeof a=="object"?i.push(`<div><strong>Id:</strong> ${a[0]}</div>`):i.push(`<div><strong>Id:</strong> ${a}</div>`)),t.push(`<div>${i.join(`
467
+ `)},d$=["innerHTML"];function u$(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,d$)}const Dc=Yg(c$,[["render",u$]]);var Fy={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()})(tE,function(){function o(w,k,S){return k in w?Object.defineProperty(w,k,{value:S,enumerable:!0,configurable:!0,writable:!0}):w[k]=S,w}function r(w,k){var S=Object.keys(w);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(w);k&&(T=T.filter(function(F){return Object.getOwnPropertyDescriptor(w,F).enumerable})),S.push.apply(S,T)}return S}function a(w){for(var k=1;k<arguments.length;k++){var S=arguments[k]!=null?arguments[k]:{};k%2?r(Object(S),!0).forEach(function(T){o(w,T,S[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(S)):r(Object(S)).forEach(function(T){Object.defineProperty(w,T,Object.getOwnPropertyDescriptor(S,T))})}return w}function i(w,k){if(w==null)return{};var S,T,F=function(G,U){if(G==null)return{};var W,te,Z={},pe=Object.keys(G);for(te=0;te<pe.length;te++)W=pe[te],U.indexOf(W)>=0||(Z[W]=G[W]);return Z}(w,k);if(Object.getOwnPropertySymbols){var K=Object.getOwnPropertySymbols(w);for(T=0;T<K.length;T++)S=K[T],k.indexOf(S)>=0||Object.prototype.propertyIsEnumerable.call(w,S)&&(F[S]=w[S])}return F}function s(w,k){return function(S){if(Array.isArray(S))return S}(w)||function(S,T){if(Symbol.iterator in Object(S)||Object.prototype.toString.call(S)==="[object Arguments]"){var F=[],K=!0,G=!1,U=void 0;try{for(var W,te=S[Symbol.iterator]();!(K=(W=te.next()).done)&&(F.push(W.value),!T||F.length!==T);K=!0);}catch(Z){G=!0,U=Z}finally{try{K||te.return==null||te.return()}finally{if(G)throw U}}return F}}(w,k)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function l(w){return function(k){if(Array.isArray(k)){for(var S=0,T=new Array(k.length);S<k.length;S++)T[S]=k[S];return T}}(w)||function(k){if(Symbol.iterator in Object(k)||Object.prototype.toString.call(k)==="[object Arguments]")return Array.from(k)}(w)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function c(w){var k,S="algoliasearch-client-js-".concat(w.key),T=function(){return k===void 0&&(k=w.localStorage||window.localStorage),k},F=function(){return JSON.parse(T().getItem(S)||"{}")},K=function(U){T().setItem(S,JSON.stringify(U))},G=function(){var U=w.timeToLive?1e3*w.timeToLive:null,W=F(),te=Object.fromEntries(Object.entries(W).filter(function(pe){return s(pe,2)[1].timestamp!==void 0}));if(K(te),U){var Z=Object.fromEntries(Object.entries(te).filter(function(pe){var fe=s(pe,2)[1],Ee=new Date().getTime();return!(fe.timestamp+U<Ee)}));K(Z)}};return{get:function(U,W){var te=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){G();var Z=JSON.stringify(U);return F()[Z]}).then(function(Z){return Promise.all([Z?Z.value:W(),Z!==void 0])}).then(function(Z){var pe=s(Z,2),fe=pe[0],Ee=pe[1];return Promise.all([fe,Ee||te.miss(fe)])}).then(function(Z){return s(Z,1)[0]})},set:function(U,W){return Promise.resolve().then(function(){var te=F();return te[JSON.stringify(U)]={timestamp:new Date().getTime(),value:W},T().setItem(S,JSON.stringify(te)),W})},delete:function(U){return Promise.resolve().then(function(){var W=F();delete W[JSON.stringify(U)],T().setItem(S,JSON.stringify(W))})},clear:function(){return Promise.resolve().then(function(){T().removeItem(S)})}}}function d(w){var k=l(w.caches),S=k.shift();return S===void 0?{get:function(T,F){var K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},G=F();return G.then(function(U){return Promise.all([U,K.miss(U)])}).then(function(U){return s(U,1)[0]})},set:function(T,F){return Promise.resolve(F)},delete:function(T){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(T,F){var K=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return S.get(T,F,K).catch(function(){return d({caches:k}).get(T,F,K)})},set:function(T,F){return S.set(T,F).catch(function(){return d({caches:k}).set(T,F)})},delete:function(T){return S.delete(T).catch(function(){return d({caches:k}).delete(T)})},clear:function(){return S.clear().catch(function(){return d({caches:k}).clear()})}}}function u(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},k={};return{get:function(S,T){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},K=JSON.stringify(S);if(K in k)return Promise.resolve(w.serializable?JSON.parse(k[K]):k[K]);var G=T(),U=F&&F.miss||function(){return Promise.resolve()};return G.then(function(W){return U(W)}).then(function(){return G})},set:function(S,T){return k[JSON.stringify(S)]=w.serializable?JSON.stringify(T):T,Promise.resolve(T)},delete:function(S){return delete k[JSON.stringify(S)],Promise.resolve()},clear:function(){return k={},Promise.resolve()}}}function f(w,k,S){var T={"x-algolia-api-key":S,"x-algolia-application-id":k};return{headers:function(){return w===b.WithinHeaders?T:{}},queryParameters:function(){return w===b.WithinQueryParameters?T:{}}}}function g(w){var k=0;return w(function S(){return k++,new Promise(function(T){setTimeout(function(){T(w(S))},Math.min(100*k,1e3))})})}function m(w){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(S,T){return Promise.resolve()};return Object.assign(w,{wait:function(S){return m(w.then(function(T){return Promise.all([k(T,S),T])}).then(function(T){return T[1]}))}})}function h(w){for(var k=w.length-1;k>0;k--){var S=Math.floor(Math.random()*(k+1)),T=w[k];w[k]=w[S],w[S]=T}return w}function p(w,k){return k&&Object.keys(k).forEach(function(S){w[S]=k[S](w)}),w}function y(w){for(var k=arguments.length,S=new Array(k>1?k-1:0),T=1;T<k;T++)S[T-1]=arguments[T];var F=0;return w.replace(/%s/g,function(){return encodeURIComponent(S[F++])})}var b={WithinQueryParameters:0,WithinHeaders:1};function v(w,k){var S=w||{},T=S.data||{};return Object.keys(S).forEach(function(F){["timeout","headers","queryParameters","data","cacheable"].indexOf(F)===-1&&(T[F]=S[F])}),{data:Object.entries(T).length>0?T:void 0,timeout:S.timeout||k,headers:S.headers||{},queryParameters:S.queryParameters||{},cacheable:S.cacheable}}var O={Read:1,Write:2,Any:3},C=1,E=2,x=3;function _(w){var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:C;return a(a({},w),{},{status:k,lastUpdate:Date.now()})}function N(w){return typeof w=="string"?{protocol:"https",url:w,accept:O.Any}:{protocol:w.protocol||"https",url:w.url,accept:w.accept||O.Any}}var A="DELETE",R="GET",P="POST",$="PUT";function z(w,k){return Promise.all(k.map(function(S){return w.get(S,function(){return Promise.resolve(_(S))})})).then(function(S){var T=S.filter(function(G){return function(U){return U.status===C||Date.now()-U.lastUpdate>12e4}(G)}),F=S.filter(function(G){return function(U){return U.status===x&&Date.now()-U.lastUpdate<=12e4}(G)}),K=[].concat(l(T),l(F));return{getTimeout:function(G,U){return(F.length===0&&G===0?1:F.length+3+G)*U},statelessHosts:K.length>0?K.map(function(G){return N(G)}):k}})}function M(w,k,S,T){var F=[],K=function(fe,Ee){if(!(fe.method===R||fe.data===void 0&&Ee.data===void 0)){var be=Array.isArray(fe.data)?fe.data:a(a({},fe.data),Ee.data);return JSON.stringify(be)}}(S,T),G=function(fe,Ee){var be=a(a({},fe.headers),Ee.headers),Pe={};return Object.keys(be).forEach(function(je){var Bt=be[je];Pe[je.toLowerCase()]=Bt}),Pe}(w,T),U=S.method,W=S.method!==R?{}:a(a({},S.data),T.data),te=a(a(a({"x-algolia-agent":w.userAgent.value},w.queryParameters),W),T.queryParameters),Z=0,pe=function fe(Ee,be){var Pe=Ee.pop();if(Pe===void 0)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:ee(F)};var je={data:K,headers:G,method:U,url:D(Pe,S.path,te),connectTimeout:be(Z,w.timeouts.connect),responseTimeout:be(Z,T.timeout)},Bt=function(It){var ft={request:je,response:It,host:Pe,triesLeft:Ee.length};return F.push(ft),ft},Sa={onSuccess:function(It){return function(ft){try{return JSON.parse(ft.content)}catch($o){throw function(co,br){return{name:"DeserializationError",message:co,response:br}}($o.message,ft)}}(It)},onRetry:function(It){var ft=Bt(It);return It.isTimedOut&&Z++,Promise.all([w.logger.info("Retryable failure",se(ft)),w.hostsCache.set(Pe,_(Pe,It.isTimedOut?x:E))]).then(function(){return fe(Ee,be)})},onFail:function(It){throw Bt(It),function(ft,$o){var co=ft.content,br=ft.status,Ea=co;try{Ea=JSON.parse(co).message}catch{}return function(cs,ed,sV){return{name:"ApiError",message:cs,status:ed,transporterStackTrace:sV}}(Ea,br,$o)}(It,ee(F))}};return w.requester.send(je).then(function(It){return function(ft,$o){return function(co){var br=co.status;return co.isTimedOut||function(Ea){var cs=Ea.isTimedOut,ed=Ea.status;return!cs&&~~ed==0}(co)||~~(br/100)!=2&&~~(br/100)!=4}(ft)?$o.onRetry(ft):~~(ft.status/100)==2?$o.onSuccess(ft):$o.onFail(ft)}(It,Sa)})};return z(w.hostsCache,k).then(function(fe){return pe(l(fe.statelessHosts).reverse(),fe.getTimeout)})}function H(w){var k=w.hostsCache,S=w.logger,T=w.requester,F=w.requestsCache,K=w.responsesCache,G=w.timeouts,U=w.userAgent,W=w.hosts,te=w.queryParameters,Z={hostsCache:k,logger:S,requester:T,requestsCache:F,responsesCache:K,timeouts:G,userAgent:U,headers:w.headers,queryParameters:te,hosts:W.map(function(pe){return N(pe)}),read:function(pe,fe){var Ee=v(fe,Z.timeouts.read),be=function(){return M(Z,Z.hosts.filter(function(je){return(je.accept&O.Read)!=0}),pe,Ee)};if((Ee.cacheable!==void 0?Ee.cacheable:pe.cacheable)!==!0)return be();var Pe={request:pe,mappedRequestOptions:Ee,transporter:{queryParameters:Z.queryParameters,headers:Z.headers}};return Z.responsesCache.get(Pe,function(){return Z.requestsCache.get(Pe,function(){return Z.requestsCache.set(Pe,be()).then(function(je){return Promise.all([Z.requestsCache.delete(Pe),je])},function(je){return Promise.all([Z.requestsCache.delete(Pe),Promise.reject(je)])}).then(function(je){var Bt=s(je,2);return Bt[0],Bt[1]})})},{miss:function(je){return Z.responsesCache.set(Pe,je)}})},write:function(pe,fe){return M(Z,Z.hosts.filter(function(Ee){return(Ee.accept&O.Write)!=0}),pe,v(fe,Z.timeouts.write))}};return Z}function I(w){var k={value:"Algolia for JavaScript (".concat(w,")"),add:function(S){var T="; ".concat(S.segment).concat(S.version!==void 0?" (".concat(S.version,")"):"");return k.value.indexOf(T)===-1&&(k.value="".concat(k.value).concat(T)),k}};return k}function D(w,k,S){var T=oe(S),F="".concat(w.protocol,"://").concat(w.url,"/").concat(k.charAt(0)==="/"?k.substr(1):k);return T.length&&(F+="?".concat(T)),F}function oe(w){return Object.keys(w).map(function(k){return y("%s=%s",k,(S=w[k],Object.prototype.toString.call(S)==="[object Object]"||Object.prototype.toString.call(S)==="[object Array]"?JSON.stringify(w[k]):w[k]));var S}).join("&")}function ee(w){return w.map(function(k){return se(k)})}function se(w){var k=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),k)})})}var ue=function(w){return function(k,S){return w.transporter.write({method:P,path:"2/abtests",data:k},S)}},Oe=function(w){return function(k,S){return w.transporter.write({method:A,path:y("2/abtests/%s",k)},S)}},ge=function(w){return function(k,S){return w.transporter.read({method:R,path:y("2/abtests/%s",k)},S)}},Ce=function(w){return function(k){return w.transporter.read({method:R,path:"2/abtests"},k)}},de=function(w){return function(k,S){return w.transporter.write({method:P,path:y("2/abtests/%s/stop",k)},S)}},Se=function(w){return function(k){return w.transporter.read({method:R,path:"1/strategies/personalization"},k)}},ve=function(w){return function(k,S){return w.transporter.write({method:P,path:"1/strategies/personalization",data:k},S)}};function ce(w){return function k(S){return w.request(S).then(function(T){if(w.batch!==void 0&&w.batch(T.hits),!w.shouldStop(T))return T.cursor?k({cursor:T.cursor}):k({page:(S.page||0)+1})})}({})}var Qe=function(w){return function(k,S){var T=S||{},F=T.queryParameters,K=i(T,["queryParameters"]),G=a({acl:k},F!==void 0?{queryParameters:F}:{});return m(w.transporter.write({method:P,path:"1/keys",data:G},K),function(U,W){return g(function(te){return Ne(w)(U.key,W).catch(function(Z){if(Z.status!==404)throw Z;return te()})})})}},We=function(w){return function(k,S,T){var F=v(T);return F.queryParameters["X-Algolia-User-ID"]=k,w.transporter.write({method:P,path:"1/clusters/mapping",data:{cluster:S}},F)}},Ve=function(w){return function(k,S,T){return w.transporter.write({method:P,path:"1/clusters/mapping/batch",data:{users:k,cluster:S}},T)}},Fe=function(w){return function(k,S){return m(w.transporter.write({method:P,path:y("/1/dictionaries/%s/batch",k),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},S),function(T,F){return so(w)(T.taskID,F)})}},De=function(w){return function(k,S,T){return m(w.transporter.write({method:P,path:y("1/indexes/%s/operation",k),data:{operation:"copy",destination:S}},T),function(F,K){return Me(w)(k,{methods:{waitTask:Ze}}).waitTask(F.taskID,K)})}},Ye=function(w){return function(k,S,T){return De(w)(k,S,a(a({},T),{},{scope:[Qc.Rules]}))}},Tt=function(w){return function(k,S,T){return De(w)(k,S,a(a({},T),{},{scope:[Qc.Settings]}))}},et=function(w){return function(k,S,T){return De(w)(k,S,a(a({},T),{},{scope:[Qc.Synonyms]}))}},Ot=function(w){return function(k,S){return k.method===R?w.transporter.read(k,S):w.transporter.write(k,S)}},ut=function(w){return function(k,S){return m(w.transporter.write({method:A,path:y("1/keys/%s",k)},S),function(T,F){return g(function(K){return Ne(w)(k,F).then(K).catch(function(G){if(G.status!==404)throw G})})})}},nn=function(w){return function(k,S,T){var F=S.map(function(K){return{action:"deleteEntry",body:{objectID:K}}});return m(w.transporter.write({method:P,path:y("/1/dictionaries/%s/batch",k),data:{clearExistingDictionaryEntries:!1,requests:F}},T),function(K,G){return so(w)(K.taskID,G)})}},Ne=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/keys/%s",k)},S)}},nt=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/task/%s",k.toString())},S)}},yt=function(w){return function(k){return w.transporter.read({method:R,path:"/1/dictionaries/*/settings"},k)}},Dt=function(w){return function(k){return w.transporter.read({method:R,path:"1/logs"},k)}},ot=function(w){return function(k){return w.transporter.read({method:R,path:"1/clusters/mapping/top"},k)}},q=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/clusters/mapping/%s",k)},S)}},we=function(w){return function(k){var S=k||{},T=S.retrieveMappings,F=i(S,["retrieveMappings"]);return T===!0&&(F.getClusters=!0),w.transporter.read({method:R,path:"1/clusters/mapping/pending"},F)}},Me=function(w){return function(k){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T={transporter:w.transporter,appId:w.appId,indexName:k};return p(T,S.methods)}},bt=function(w){return function(k){return w.transporter.read({method:R,path:"1/keys"},k)}},Mt=function(w){return function(k){return w.transporter.read({method:R,path:"1/clusters"},k)}},hr=function(w){return function(k){return w.transporter.read({method:R,path:"1/indexes"},k)}},wa=function(w){return function(k){return w.transporter.read({method:R,path:"1/clusters/mapping"},k)}},Ro=function(w){return function(k,S,T){return m(w.transporter.write({method:P,path:y("1/indexes/%s/operation",k),data:{operation:"move",destination:S}},T),function(F,K){return Me(w)(k,{methods:{waitTask:Ze}}).waitTask(F.taskID,K)})}},Po=function(w){return function(k,S){return m(w.transporter.write({method:P,path:"1/indexes/*/batch",data:{requests:k}},S),function(T,F){return Promise.all(Object.keys(T.taskID).map(function(K){return Me(w)(K,{methods:{waitTask:Ze}}).waitTask(T.taskID[K],F)}))})}},j=function(w){return function(k,S){return w.transporter.read({method:P,path:"1/indexes/*/objects",data:{requests:k}},S)}},X=function(w){return function(k,S){var T=k.map(function(F){return a(a({},F),{},{params:oe(F.params||{})})});return w.transporter.read({method:P,path:"1/indexes/*/queries",data:{requests:T},cacheable:!0},S)}},Q=function(w){return function(k,S){return Promise.all(k.map(function(T){var F=T.params,K=F.facetName,G=F.facetQuery,U=i(F,["facetName","facetQuery"]);return Me(w)(T.indexName,{methods:{searchForFacetValues:Gy}}).searchForFacetValues(K,G,a(a({},S),U))}))}},Be=function(w){return function(k,S){var T=v(S);return T.queryParameters["X-Algolia-User-ID"]=k,w.transporter.write({method:A,path:"1/clusters/mapping"},T)}},jt=function(w){return function(k,S,T){var F=S.map(function(K){return{action:"addEntry",body:K}});return m(w.transporter.write({method:P,path:y("/1/dictionaries/%s/batch",k),data:{clearExistingDictionaryEntries:!0,requests:F}},T),function(K,G){return so(w)(K.taskID,G)})}},Nt=function(w){return function(k,S){return m(w.transporter.write({method:P,path:y("1/keys/%s/restore",k)},S),function(T,F){return g(function(K){return Ne(w)(k,F).catch(function(G){if(G.status!==404)throw G;return K()})})})}},zt=function(w){return function(k,S,T){var F=S.map(function(K){return{action:"addEntry",body:K}});return m(w.transporter.write({method:P,path:y("/1/dictionaries/%s/batch",k),data:{clearExistingDictionaryEntries:!1,requests:F}},T),function(K,G){return so(w)(K.taskID,G)})}},mr=function(w){return function(k,S,T){return w.transporter.read({method:P,path:y("/1/dictionaries/%s/search",k),data:{query:S},cacheable:!0},T)}},as=function(w){return function(k,S){return w.transporter.read({method:P,path:"1/clusters/mapping/search",data:{query:k}},S)}},jc=function(w){return function(k,S){return m(w.transporter.write({method:$,path:"/1/dictionaries/*/settings",data:k},S),function(T,F){return so(w)(T.taskID,F)})}},zc=function(w){return function(k,S){var T=Object.assign({},S),F=S||{},K=F.queryParameters,G=i(F,["queryParameters"]),U=K?{queryParameters:K}:{},W=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return m(w.transporter.write({method:$,path:y("1/keys/%s",k),data:U},G),function(te,Z){return g(function(pe){return Ne(w)(k,Z).then(function(fe){return function(Ee){return Object.keys(T).filter(function(be){return W.indexOf(be)!==-1}).every(function(be){if(Array.isArray(Ee[be])&&Array.isArray(T[be])){var Pe=Ee[be];return Pe.length===T[be].length&&Pe.every(function(je,Bt){return je===T[be][Bt]})}return Ee[be]===T[be]})}(fe)?Promise.resolve():pe()})})})}},so=function(w){return function(k,S){return g(function(T){return nt(w)(k,S).then(function(F){return F.status!=="published"?T():void 0})})}},Ca=function(w){return function(k,S){return m(w.transporter.write({method:P,path:y("1/indexes/%s/batch",w.indexName),data:{requests:k}},S),function(T,F){return Ze(w)(T.taskID,F)})}},Hc=function(w){return function(k){return ce(a(a({shouldStop:function(S){return S.cursor===void 0}},k),{},{request:function(S){return w.transporter.read({method:P,path:y("1/indexes/%s/browse",w.indexName),data:S},k)}}))}},ka=function(w){return function(k){var S=a({hitsPerPage:1e3},k);return ce(a(a({shouldStop:function(T){return T.hits.length<S.hitsPerPage}},S),{},{request:function(T){return Jy(w)("",a(a({},S),T)).then(function(F){return a(a({},F),{},{hits:F.hits.map(function(K){return delete K._highlightResult,K})})})}}))}},Uc=function(w){return function(k){var S=a({hitsPerPage:1e3},k);return ce(a(a({shouldStop:function(T){return T.hits.length<S.hitsPerPage}},S),{},{request:function(T){return Yy(w)("",a(a({},S),T)).then(function(F){return a(a({},F),{},{hits:F.hits.map(function(K){return delete K._highlightResult,K})})})}}))}},va=function(w){return function(k,S,T){var F=T||{},K=F.batchSize,G=i(F,["batchSize"]),U={taskIDs:[],objectIDs:[]};return m(function W(){var te,Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,pe=[];for(te=Z;te<k.length&&(pe.push(k[te]),pe.length!==(K||1e3));te++);return pe.length===0?Promise.resolve(U):Ca(w)(pe.map(function(fe){return{action:S,body:fe}}),G).then(function(fe){return U.objectIDs=U.objectIDs.concat(fe.objectIDs),U.taskIDs.push(fe.taskID),te++,W(te)})}(),function(W,te){return Promise.all(W.taskIDs.map(function(Z){return Ze(w)(Z,te)}))})}},qc=function(w){return function(k){return m(w.transporter.write({method:P,path:y("1/indexes/%s/clear",w.indexName)},k),function(S,T){return Ze(w)(S.taskID,T)})}},is=function(w){return function(k){var S=k||{},T=S.forwardToReplicas,F=v(i(S,["forwardToReplicas"]));return T&&(F.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:P,path:y("1/indexes/%s/rules/clear",w.indexName)},F),function(K,G){return Ze(w)(K.taskID,G)})}},Kc=function(w){return function(k){var S=k||{},T=S.forwardToReplicas,F=v(i(S,["forwardToReplicas"]));return T&&(F.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:P,path:y("1/indexes/%s/synonyms/clear",w.indexName)},F),function(K,G){return Ze(w)(K.taskID,G)})}},Wc=function(w){return function(k,S){return m(w.transporter.write({method:P,path:y("1/indexes/%s/deleteByQuery",w.indexName),data:k},S),function(T,F){return Ze(w)(T.taskID,F)})}},Gc=function(w){return function(k){return m(w.transporter.write({method:A,path:y("1/indexes/%s",w.indexName)},k),function(S,T){return Ze(w)(S.taskID,T)})}},Jc=function(w){return function(k,S){return m(V(w)([k],S).then(function(T){return{taskID:T.taskIDs[0]}}),function(T,F){return Ze(w)(T.taskID,F)})}},V=function(w){return function(k,S){var T=k.map(function(F){return{objectID:F}});return va(w)(T,yr.DeleteObject,S)}},J=function(w){return function(k,S){var T=S||{},F=T.forwardToReplicas,K=v(i(T,["forwardToReplicas"]));return F&&(K.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:y("1/indexes/%s/rules/%s",w.indexName,k)},K),function(G,U){return Ze(w)(G.taskID,U)})}},ye=function(w){return function(k,S){var T=S||{},F=T.forwardToReplicas,K=v(i(T,["forwardToReplicas"]));return F&&(K.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:A,path:y("1/indexes/%s/synonyms/%s",w.indexName,k)},K),function(G,U){return Ze(w)(G.taskID,U)})}},Ie=function(w){return function(k){return qy(w)(k).then(function(){return!0}).catch(function(S){if(S.status!==404)throw S;return!1})}},On=function(w){return function(k,S,T){return w.transporter.read({method:P,path:y("1/answers/%s/prediction",w.indexName),data:{query:k,queryLanguages:S},cacheable:!0},T)}},lo=function(w){return function(k,S){var T=S||{},F=T.query,K=T.paginate,G=i(T,["query","paginate"]),U=0;return function W(){return Wy(w)(F||"",a(a({},G),{},{page:U})).then(function(te){for(var Z=0,pe=Object.entries(te.hits);Z<pe.length;Z++){var fe=s(pe[Z],2),Ee=fe[0],be=fe[1];if(k(be))return{object:be,position:parseInt(Ee,10),page:U}}if(U++,K===!1||U>=te.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return W()})}()}},gr=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/indexes/%s/%s",w.indexName,k)},S)}},Un=function(){return function(w,k){for(var S=0,T=Object.entries(w.hits);S<T.length;S++){var F=s(T[S],2),K=F[0];if(F[1].objectID===k)return parseInt(K,10)}return-1}},on=function(w){return function(k,S){var T=S||{},F=T.attributesToRetrieve,K=i(T,["attributesToRetrieve"]),G=k.map(function(U){return a({indexName:w.indexName,objectID:U},F?{attributesToRetrieve:F}:{})});return w.transporter.read({method:P,path:"1/indexes/*/objects",data:{requests:G}},K)}},ss=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/indexes/%s/rules/%s",w.indexName,k)},S)}},qy=function(w){return function(k){return w.transporter.read({method:R,path:y("1/indexes/%s/settings",w.indexName),data:{getVersion:2}},k)}},HL=function(w){return function(k,S){return w.transporter.read({method:R,path:y("1/indexes/%s/synonyms/%s",w.indexName,k)},S)}},UL=function(w){return function(k,S){return m(Ky(w)([k],S).then(function(T){return{objectID:T.objectIDs[0],taskID:T.taskIDs[0]}}),function(T,F){return Ze(w)(T.taskID,F)})}},Ky=function(w){return function(k,S){var T=S||{},F=T.createIfNotExists,K=i(T,["createIfNotExists"]),G=F?yr.PartialUpdateObject:yr.PartialUpdateObjectNoCreate;return va(w)(k,G,K)}},qL=function(w){return function(k,S){var T=S||{},F=T.safe,K=T.autoGenerateObjectIDIfNotExist,G=T.batchSize,U=i(T,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),W=function(be,Pe,je,Bt){return m(w.transporter.write({method:P,path:y("1/indexes/%s/operation",be),data:{operation:je,destination:Pe}},Bt),function(Sa,It){return Ze(w)(Sa.taskID,It)})},te=Math.random().toString(36).substring(7),Z="".concat(w.indexName,"_tmp_").concat(te),pe=Yc({appId:w.appId,transporter:w.transporter,indexName:Z}),fe=[],Ee=W(w.indexName,Z,"copy",a(a({},U),{},{scope:["settings","synonyms","rules"]}));return fe.push(Ee),m((F?Ee.wait(U):Ee).then(function(){var be=pe(k,a(a({},U),{},{autoGenerateObjectIDIfNotExist:K,batchSize:G}));return fe.push(be),F?be.wait(U):be}).then(function(){var be=W(Z,w.indexName,"move",U);return fe.push(be),F?be.wait(U):be}).then(function(){return Promise.all(fe)}).then(function(be){var Pe=s(be,3),je=Pe[0],Bt=Pe[1],Sa=Pe[2];return{objectIDs:Bt.objectIDs,taskIDs:[je.taskID].concat(l(Bt.taskIDs),[Sa.taskID])}}),function(be,Pe){return Promise.all(fe.map(function(je){return je.wait(Pe)}))})}},KL=function(w){return function(k,S){return Zc(w)(k,a(a({},S),{},{clearExistingRules:!0}))}},WL=function(w){return function(k,S){return Xc(w)(k,a(a({},S),{},{clearExistingSynonyms:!0}))}},GL=function(w){return function(k,S){return m(Yc(w)([k],S).then(function(T){return{objectID:T.objectIDs[0],taskID:T.taskIDs[0]}}),function(T,F){return Ze(w)(T.taskID,F)})}},Yc=function(w){return function(k,S){var T=S||{},F=T.autoGenerateObjectIDIfNotExist,K=i(T,["autoGenerateObjectIDIfNotExist"]),G=F?yr.AddObject:yr.UpdateObject;if(G===yr.UpdateObject){var U=!0,W=!1,te=void 0;try{for(var Z,pe=k[Symbol.iterator]();!(U=(Z=pe.next()).done);U=!0)if(Z.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(fe){W=!0,te=fe}finally{try{U||pe.return==null||pe.return()}finally{if(W)throw te}}}return va(w)(k,G,K)}},JL=function(w){return function(k,S){return Zc(w)([k],S)}},Zc=function(w){return function(k,S){var T=S||{},F=T.forwardToReplicas,K=T.clearExistingRules,G=v(i(T,["forwardToReplicas","clearExistingRules"]));return F&&(G.queryParameters.forwardToReplicas=1),K&&(G.queryParameters.clearExistingRules=1),m(w.transporter.write({method:P,path:y("1/indexes/%s/rules/batch",w.indexName),data:k},G),function(U,W){return Ze(w)(U.taskID,W)})}},YL=function(w){return function(k,S){return Xc(w)([k],S)}},Xc=function(w){return function(k,S){var T=S||{},F=T.forwardToReplicas,K=T.clearExistingSynonyms,G=T.replaceExistingSynonyms,U=v(i(T,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return F&&(U.queryParameters.forwardToReplicas=1),(G||K)&&(U.queryParameters.replaceExistingSynonyms=1),m(w.transporter.write({method:P,path:y("1/indexes/%s/synonyms/batch",w.indexName),data:k},U),function(W,te){return Ze(w)(W.taskID,te)})}},Wy=function(w){return function(k,S){return w.transporter.read({method:P,path:y("1/indexes/%s/query",w.indexName),data:{query:k},cacheable:!0},S)}},Gy=function(w){return function(k,S,T){return w.transporter.read({method:P,path:y("1/indexes/%s/facets/%s/query",w.indexName,k),data:{facetQuery:S},cacheable:!0},T)}},Jy=function(w){return function(k,S){return w.transporter.read({method:P,path:y("1/indexes/%s/rules/search",w.indexName),data:{query:k}},S)}},Yy=function(w){return function(k,S){return w.transporter.read({method:P,path:y("1/indexes/%s/synonyms/search",w.indexName),data:{query:k}},S)}},ZL=function(w){return function(k,S){var T=S||{},F=T.forwardToReplicas,K=v(i(T,["forwardToReplicas"]));return F&&(K.queryParameters.forwardToReplicas=1),m(w.transporter.write({method:$,path:y("1/indexes/%s/settings",w.indexName),data:k},K),function(G,U){return Ze(w)(G.taskID,U)})}},Ze=function(w){return function(k,S){return g(function(T){return function(F){return function(K,G){return F.transporter.read({method:R,path:y("1/indexes/%s/task/%s",F.indexName,K.toString())},G)}}(w)(k,S).then(function(F){return F.status!=="published"?T():void 0})})}},yr={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject"},Qc={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},XL=1,QL=2,eV=3,ls=function(w){return function(k,S){var T=k.map(function(F){return a(a({},F),{},{threshold:F.threshold||0})});return w.transporter.read({method:P,path:"1/indexes/*/recommendations",data:{requests:T},cacheable:!0},S)}},tV=function(w){return function(k,S){return ls(w)(k.map(function(T){return a(a({},T),{},{fallbackParameters:{},model:"bought-together"})}),S)}},nV=function(w){return function(k,S){return ls(w)(k.map(function(T){return a(a({},T),{},{model:"related-products"})}),S)}},oV=function(w){return function(k,S){var T=k.map(function(F){return a(a({},F),{},{model:"trending-facets",threshold:F.threshold||0})});return w.transporter.read({method:P,path:"1/indexes/*/recommendations",data:{requests:T},cacheable:!0},S)}},rV=function(w){return function(k,S){var T=k.map(function(F){return a(a({},F),{},{model:"trending-items",threshold:F.threshold||0})});return w.transporter.read({method:P,path:"1/indexes/*/recommendations",data:{requests:T},cacheable:!0},S)}},aV=function(w){return function(k,S){return ls(w)(k.map(function(T){return a(a({},T),{},{model:"looking-similar"})}),S)}},iV=function(w){return function(k,S){var T=k.map(function(F){return a(a({},F),{},{model:"recommended-for-you",threshold:F.threshold||0})});return w.transporter.read({method:P,path:"1/indexes/*/recommendations",data:{requests:T},cacheable:!0},S)}};function Zy(w,k,S){var T,F={appId:w,apiKey:k,timeouts:{connect:1,read:2,write:30},requester:{send:function(U){return new Promise(function(W){var te=new XMLHttpRequest;te.open(U.method,U.url,!0),Object.keys(U.headers).forEach(function(Ee){return te.setRequestHeader(Ee,U.headers[Ee])});var Z,pe=function(Ee,be){return setTimeout(function(){te.abort(),W({status:0,content:be,isTimedOut:!0})},1e3*Ee)},fe=pe(U.connectTimeout,"Connection timeout");te.onreadystatechange=function(){te.readyState>te.OPENED&&Z===void 0&&(clearTimeout(fe),Z=pe(U.responseTimeout,"Socket timeout"))},te.onerror=function(){te.status===0&&(clearTimeout(fe),clearTimeout(Z),W({content:te.responseText||"Network request failed",status:te.status,isTimedOut:!1}))},te.onload=function(){clearTimeout(fe),clearTimeout(Z),W({content:te.responseText,status:te.status,isTimedOut:!1})},te.send(U.data)})}},logger:(T=eV,{debug:function(U,W){return XL>=T&&console.debug(U,W),Promise.resolve()},info:function(U,W){return QL>=T&&console.info(U,W),Promise.resolve()},error:function(U,W){return console.error(U,W),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"})},K=a(a({},F),S),G=function(){return function(U){return function(W){var te=W.region||"us",Z=f(b.WithinHeaders,W.appId,W.apiKey),pe=H(a(a({hosts:[{url:"personalization.".concat(te,".algolia.com")}]},W),{},{headers:a(a(a({},Z.headers()),{"content-type":"application/json"}),W.headers),queryParameters:a(a({},Z.queryParameters()),W.queryParameters)}));return p({appId:W.appId,transporter:pe},W.methods)}(a(a(a({},F),U),{},{methods:{getPersonalizationStrategy:Se,setPersonalizationStrategy:ve}}))}};return function(U){var W=U.appId,te=f(U.authMode!==void 0?U.authMode:b.WithinHeaders,W,U.apiKey),Z=H(a(a({hosts:[{url:"".concat(W,"-dsn.algolia.net"),accept:O.Read},{url:"".concat(W,".algolia.net"),accept:O.Write}].concat(h([{url:"".concat(W,"-1.algolianet.com")},{url:"".concat(W,"-2.algolianet.com")},{url:"".concat(W,"-3.algolianet.com")}]))},U),{},{headers:a(a(a({},te.headers()),{"content-type":"application/x-www-form-urlencoded"}),U.headers),queryParameters:a(a({},te.queryParameters()),U.queryParameters)}));return p({transporter:Z,appId:W,addAlgoliaAgent:function(pe,fe){Z.userAgent.add({segment:pe,version:fe})},clearCache:function(){return Promise.all([Z.requestsCache.clear(),Z.responsesCache.clear()]).then(function(){})}},U.methods)}(a(a({},K),{},{methods:{search:X,searchForFacetValues:Q,multipleBatch:Po,multipleGetObjects:j,multipleQueries:X,copyIndex:De,copySettings:Tt,copySynonyms:et,copyRules:Ye,moveIndex:Ro,listIndices:hr,getLogs:Dt,listClusters:Mt,multipleSearchForFacetValues:Q,getApiKey:Ne,addApiKey:Qe,listApiKeys:bt,updateApiKey:zc,deleteApiKey:ut,restoreApiKey:Nt,assignUserID:We,assignUserIDs:Ve,getUserID:q,searchUserIDs:as,listUserIDs:wa,getTopUserIDs:ot,removeUserID:Be,hasPendingMappings:we,clearDictionaryEntries:Fe,deleteDictionaryEntries:nn,getDictionarySettings:yt,getAppTask:nt,replaceDictionaryEntries:jt,saveDictionaryEntries:zt,searchDictionaryEntries:mr,setDictionarySettings:jc,waitAppTask:so,customRequest:Ot,initIndex:function(U){return function(W){return Me(U)(W,{methods:{batch:Ca,delete:Gc,findAnswers:On,getObject:gr,getObjects:on,saveObject:GL,saveObjects:Yc,search:Wy,searchForFacetValues:Gy,waitTask:Ze,setSettings:ZL,getSettings:qy,partialUpdateObject:UL,partialUpdateObjects:Ky,deleteObject:Jc,deleteObjects:V,deleteBy:Wc,clearObjects:qc,browseObjects:Hc,getObjectPosition:Un,findObject:lo,exists:Ie,saveSynonym:YL,saveSynonyms:Xc,getSynonym:HL,searchSynonyms:Yy,browseSynonyms:Uc,deleteSynonym:ye,clearSynonyms:Kc,replaceAllObjects:qL,replaceAllSynonyms:WL,searchRules:Jy,getRule:ss,deleteRule:J,saveRule:JL,saveRules:Zc,replaceAllRules:KL,browseRules:ka,clearRules:is}})}},initAnalytics:function(){return function(U){return function(W){var te=W.region||"us",Z=f(b.WithinHeaders,W.appId,W.apiKey),pe=H(a(a({hosts:[{url:"analytics.".concat(te,".algolia.com")}]},W),{},{headers:a(a(a({},Z.headers()),{"content-type":"application/json"}),W.headers),queryParameters:a(a({},Z.queryParameters()),W.queryParameters)}));return p({appId:W.appId,transporter:pe},W.methods)}(a(a(a({},F),U),{},{methods:{addABTest:ue,getABTest:ge,getABTests:Ce,stopABTest:de,deleteABTest:Oe}}))}},initPersonalization:G,initRecommendation:function(){return function(U){return K.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),G()(U)}},getRecommendations:ls,getFrequentlyBoughtTogether:tV,getLookingSimilar:aV,getRecommendedForYou:iV,getRelatedProducts:nV,getTrendingFacets:oV,getTrendingItems:rV}}))}return Zy.version="4.23.2",Zy})})(Fy);var f$=Fy.exports;const p$=nE(f$),Ry=(e,t)=>{const o={};return e.forEach(r=>{const a=r.split(".");if(a.length!==t)return;const i=r.substring(0,r.lastIndexOf(".")),s=a[a.length-1];Object.keys(o).includes(i)?o[i].push(s):o[i]=[s]}),o};class Py{constructor(t,o,r="https://api.pennsieve.io"){this.client=p$(t,o),this.PENNSIEVE_API_LOCATION=r}initIndex(t){this.index=this.client.initIndex(t)}getAlgoliaFacets(t){const o=t.map(i=>i.facetPropPath),r=t.map(i=>i.facetSubpropPath),a=t.map(i=>i.facetSubsubpropPath).filter(i=>i!==void 0);return this.index.search("",{sortFacetValuesBy:"alpha",facets:o.concat(r).concat(a)}).then(i=>{let s=[],l=0;return o.map(c=>{const d=t.find(b=>b.facetPropPath==c);var u=[];const f=i.facets;if(f===void 0)return;const g=f[c]==null?{}:f[c],m=d&&f[d.facetSubpropPath]?Object.keys(f[d.facetSubpropPath]):[],h=d&&d.facetSubsubpropPath&&f[d.facetSubsubpropPath]?Object.keys(f[d.facetSubsubpropPath]):[],p=Ry(m,2),y=Ry(h,3);Object.keys(g).map(b=>{const v=[];Object.keys(p).includes(b)&&p[b].forEach(C=>{const E=`${b}.${C}`,x=[];Object.keys(y).includes(E)&&(y[E].forEach(_=>{x.push({label:_,id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})}),E==="nerves and ganglia.dorsal root ganglion"&&x.push({label:"Non specific",id:l++,facetPropPath:`${d?d.facetSubsubpropPath:void 0}`})),v.push({label:C,id:l++,facetPropPath:`${d?d.facetSubpropPath:void 0}`,children:x.length?x:void 0})});let O={label:b,id:l++,facetPropPath:c};v.length>0&&(O.children=v),u.push(O)}),u.length>0&&s.push({label:d?d.label:"",id:l++,children:u,key:c})}),s})}_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){const o={};t.forEach(r=>{r.anatomy&&r.anatomy.organ&&r.anatomy.organ.forEach(a=>{a.curie&&(o[a.curie]=a.name)}),localStorage.setItem("available-name-curie-mapping",JSON.stringify(o))})}_processUberonURL(t){return t.split("/").pop().replace("_",":")}search(t,o="",r=10,a=1){const i=o.replaceAll('"',"").split(",");let s="";const l=[];i&&(i.length===1&&!o.includes(" ")?s=o:i.forEach(d=>{l.push(d.trim()),s+=`"${d.trim()}" `})),s=s.trim();const c={advancedSyntax:!0,advancedSyntaxFeatures:["exactPhrase"],queryType:"prefixAll",facets:["*"],hitsPerPage:r,page:a-1,filters:t,attributesToHighlight:[],attributesToRetrieve:["pennsieve.publishDate","pennsieve.updatedAt","item.curie","item.name","item.description","objectID","anatomy.organ.curie"]};return l.length>1&&(c.optionalWords=l),new Promise(d=>{this.index.search(s,c).then(u=>{let f={items:this._processResultsForCards(u.hits),total:u.nbHits,discoverIds:u.hits.map(g=>g.pennsieve?g.pennsieve.identifier:g.objectID),dois:u.hits.map(g=>g.item.curie.split(":")[1])};d(f)})})}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","anatomy.organ.subsubcategory.name"]}).then(s=>{i({forFlatmap:this.processResultsForFlatmap(s.facets,s.hits),forScaffold:this.processResultsForScaffold(s.hits)})})})}setLocalStorageForTermMapping(){return new Promise(t=>{this.index.search("",{facets:["*"],hitsPerPage:999999,page:0,attributesToHighlight:[],attributesToRetrieve:["objectID","item.keywords.keyword","anatomy.organ.name","anatomy.organ.curie"]}).then(o=>{this._processAnatomy(o.hits)})})}processResultsForFlatmap(t,o){const r=this.filterAvailableAnatomies(t);return o.map(i=>({id:i.objectID,terms:i.anatomy?i.anatomy.organ.map(l=>{if(r.includes(l.name.toLowerCase()))return l.curie}).filter(Boolean):[]}))}filterAvailableAnatomies(t){const o=t["anatomy.organ.name"],r=t["anatomy.organ.category.name"],a=t["anatomy.organ.subcategory.name"],i=t["anatomy.organ.subsubcategory.name"],s=o?Object.keys(o):[],l=r?Object.keys(r):[],c=a?Object.keys(a):[],d=i?Object.keys(i):[],u=[];return l.forEach(f=>{const g=f.toLowerCase();s.forEach(m=>{const h=m.toLowerCase(),p=`${g}.${h}`;c.some(b=>{const v=b.toLowerCase();return v===p?!0:d.find(O=>`${v}.${h}`===O)})&&u.push(h)})}),u}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 Mc=[{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",facetSubsubpropPath:"anatomy.organ.subsubcategory.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:"Consortia",id:"supportingAwards.consortium",facetPropPath:"supportingAwards.consortium.name",facetSubpropPath:"supportingAwards.consortium.subcategory.name"}];function $y(e=void 0){if(e===void 0)return"NOT item.published.status:embargo";e.forEach(a=>{a.label=a.facet3?a.facet3:a.facet2?a.facet2:a.facet});let t=Ly(e);t.forEach(a=>{a.facet3&&a.facet3==="Non specific"&&(a.label=a.facet2)});let o="NOT item.published.status:embargo";return o=`(${o}) AND `,Mc.map(a=>[a.facetPropPath,a.facetFilterPath]).map(([a,i])=>{let s=t.filter(d=>d.facetPropPath==a),l="",c="";s.map(d=>{let u=d.facetSubPropPath?d.facetSubPropPath:i||a;d.AND?c+=`AND "${u}":"${d.label}"`:l+=`"${u}":"${d.label}" OR `}),!(l==""&&c=="")&&(l=`(${l.substring(0,l.lastIndexOf(" OR "))})`,o+=`${l+c} AND `,o=o.split("()AND ").join(""))}),o.substring(0,o.lastIndexOf(" AND "))}function Ly(e){return e.filter(t=>t.label!=="Show all")}const ba=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},Vy=function(e){const t=e.toLowerCase();return qi[t]?ba(qi[t]):e===e.toUpperCase()?e:ba(t)},h$={name:"SearchFilters",components:{MapSvgIcon:Lc,MapSvgSpriteColor:Dc,Option:Cl,Select:ii,Popover:Zo,Cascader:up},props:{entry:Object,envVars:{type:Object,default:()=>{}}},data:function(){return{algoliaClient:void 0,cascaderIsReady:!1,previousShowAllChecked:{species:!1,gender:!1,organ:!1,datasets:!1},showFiltersText:!0,cascadeSelected:[],cascadeSelectedWithBoolean:[],filterTimeout:null,numberShown:10,filters:[],facets:["Species","Gender","Organ","Datasets"],numberDatasetsShown:["10","20","50"],cascaderProps:{multiple:!0},options:[{value:"Species",label:"Species",children:[{}]}],presentTags:[],searchInputs:{}}},setup(){const e=n.markRaw({}),t=n.markRaw({term:new Set,facet:new Set,facet2:new Set,facet3:new Set});return{cascaderTags:e,correctnessCheck:t}},computed:{numberOfResultsText:function(){return`${this.entry.numberOfHits} results | Showing`},showFilters:function(){return this.entry.showFilters}},watch:{entry:{deep:!0,immediate:!0,handler:function(e,t){JSON.stringify(e==null?void 0:e.options)!==JSON.stringify(t==null?void 0:t.options)&&(this.options=[],this.filters=[],this.cascaderIsReady=!1,this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.options.length&&(this.checkShowAllBoxes(),this.cssMods(),this.$emit("cascaderReady"))}))}}},methods:{createCascaderItemValue:function(e){let t;if(e!=null&&e.length){t=e[0];for(let o=1;e.length>o;o++)t=`${t}>${e[o]}`;t.includes("undefined")&&console.warn("Warning: One or more of the facets is undefined, this will not be shown in the cascader")}return t},createChildrenCascaderValue:function(e,t,o){if(e!=null&&e.length)for(let r=0;r<e.length;r++){const a=e[r];if(e[r].facetPropPath!=="supportingAwards.consortium.name"&&(e[r].label=Vy(a.label)),a.key&&t.key.includes("flatmap.connectivity.source.")){const i=a.key,s=t.key,l=i.replace(`${s}.`,"");e[r].value=this.createCascaderItemValue([t.label,l])}else{const i=o.slice();i.push(a.label),e[r].value=this.createCascaderItemValue(i),this.createChildrenCascaderValue(a.children,t,i)}}},getNodeKey:function(e){return e?e.split(">")[1]:""},isFlatmapConnectionsNode:function(e){return e.pathValues[0].includes("flatmap.connectivity.source")&&e.isLeaf},isFlatmapConnectionsFilterNode:function(e){return e.pathValues[0].includes("flatmap.connectivity.source")&&e.pathLabels.includes("Filters")&&e.isDisabled&&e.isLeaf},processOptions:function(){const e=JSON.parse(JSON.stringify(this.options));e.forEach((t,o)=>{e[o].total=this.countTotalFacet(t),e[o].label=Vy(t.label),e[o].value=this.createCascaderItemValue([t.key]),e[o].children.find(r=>r.label==="Show all")||e[o].children.unshift({value:this.createCascaderItemValue(["Show all"]),label:"Show all"}),t.key.includes("flatmap.connectivity.source")&&e[o].children.unshift({value:this.createCascaderItemValue(["ConnectivityFilters"]),label:"Filters",disabled:!0}),this.createChildrenCascaderValue(e[o].children,t,[t.label])}),Object.assign(this.options,e)},populateCascader:function(){return this.entry.options?new Promise(e=>{this.facets=this.entry.options,this.options=this.entry.options,this.processOptions(),e()}):new Promise(e=>{this.algoliaClient.getAlgoliaFacets(Mc).then(t=>{this.facets=t,me.emit("available-facets",t),this.options=t,this.processOptions()}).finally(()=>{e()})})},isConnectivityTag:function(e){return/^[A-Za-z]:/.test(e)},getConnectivityTag:function(e){const t=e.indexOf(":");return t!==-1?e.substring(t+1):e},modifyCascaderTagStyle:function(e){return this.isConnectivityTag(e)?"connectivity-tag":""},flattenToEvents:function(e,t,o,r=void 0){const a=[];for(const[i,s]of Object.entries(t)){const l=o.find(c=>c.label===i);if(Object.entries(s).length){const c=l.key||r,d=this.flattenToEvents(e,s,l.children,c);a.push(...d)}else i!==e&&a.push([r,l.value])}return a},cascadeTagClose:function(e){const t=this.isConnectivityTag(e)?this.getConnectivityTag(e):e,o=this.flattenToEvents(t,this.cascaderTags,this.options);this.cascadeEvent(o)},flattenToTags:function(e){const t=[];for(const[o,r]of Object.entries(e))if(Object.entries(r).length){const a=this.flattenToTags(r);t.push(...a)}else o!=="Show all"&&t.push(o);return t},tagsChangedCallback:function(e){this.correctnessCheck.term&&this.correctnessCheck.facet&&this.correctnessCheck.facet2&&this.correctnessCheck.facet3&&this.options.map(t=>{var o;this.correctnessCheck.term.add(t.label),(o=t.children)==null||o.map(r=>{var a;this.correctnessCheck.facet.add(r.label),(a=r.children)==null||a.map(i=>{var s;this.correctnessCheck.facet2.add(i.label),(s=i.children)==null||s.map(l=>{this.correctnessCheck.facet3.add(l.label)})})})}),this.cascaderTags={},this.cascaderTagsClone={},this.presentTags=[],e.map(t=>{const{facet:o,facet2:r,facet3:a,term:i,tagLabel:s,facetPropPath:l}=t;let c=o,d="";l&&l.includes("flatmap.connectivity.source.")&&s&&(c=s,d=i.charAt(0)),i&&this.correctnessCheck.term.has(i)&&(i in this.cascaderTags||(this.cascaderTags[i]={},this.cascaderTagsClone[i]={}),c&&this.correctnessCheck.facet.has(c)&&(c in this.cascaderTags[i]||(this.cascaderTags[i][c]={},d?this.cascaderTagsClone[i][d+":"+c]={}:this.cascaderTagsClone[i][c]={}),r&&this.correctnessCheck.facet2.has(r)&&(r in this.cascaderTags[i][c]||(this.cascaderTags[i][c][r]={},this.cascaderTagsClone[i][c][r]={}),a&&this.correctnessCheck.facet3.has(a)&&(a in this.cascaderTags[i][c][r]||(this.cascaderTags[i][c][r][a]={},this.cascaderTagsClone[i][c][r][a]={})))))}),this.presentTags=[...this.presentTags,...this.flattenToTags(this.cascaderTagsClone)],this.presentTags=[...new Set(this.presentTags)].sort(),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){t=this.showAllEventModifier(t),t=this.showAllEventModifierForAutoCheckAll(t);const o=this.$refs.cascader,a=(o==null?void 0:o.getCheckedNodes(!0)).filter(l=>l.checked&&l.label!=="Show all");if(this.__expandItem__){let l=0;this.__expandItem__.length>1&&(l=1);const c=t.filter(u=>u[l]==this.__expandItem__[l]),d=t.filter(u=>u[l]!==this.__expandItem__[l]);t=[...c,...d]}let i=t.filter(l=>l!==void 0).map(l=>{let{hString:c,bString:d}=this.findHierarachyStringAndBooleanString(l),{facet:u,facet2:f,facet3:g,term:m}=this.getFacetsFromHierarchyString(c);const h=a.find(y=>l.join()===y.pathValues.join()),p=h?h.label:void 0;return{facetPropPath:l[0],facet:u,facet2:f,facet3:g,term:m,AND:d,tagLabel:p}}),s=t.filter(l=>l!==void 0).map(l=>{let c=l[0].includes("duplicate")?l[0].split("duplicate")[0]:l[0],{hString:d,bString:u}=this.findHierarachyStringAndBooleanString(l),{facet:f,facet2:g,facet3:m,term:h}=this.getFacetsFromHierarchyString(d);m?m==="Non specific"?f=g:f=m:g&&(f=g);const p=a.find(b=>l.join()===b.pathValues.join()),y=p?p.label:void 0;return{facetPropPath:c,facet:f,term:h,AND:u,tagLabel:y}});this.filterTimeout&&clearTimeout(this.filterTimeout),this.$emit("loading",!0),this.setCascader(i),this.filterTimeout=setTimeout(()=>{this.$emit("filterResults",s),this.cssMods()},600)}},findHierarachyStringAndBooleanString(e){let t,o;const r=e.length;return r>=3?e[r-1]&&(typeof e[r-1]=="string"||e[r-1]instanceof String)&&e[r-1].split(">").length>2?t=e[r-1]:t=e[r-2]:t=e[1],r>=3&&typeof e[r-1]=="boolean"&&(o=e[r-1]),{hString:t,bString:o}},getFacetsFromHierarchyString(e){let t=e.split(">");return{term:t[0],facet:t[1],facet2:t[2],facet3:t[3]}},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.__expandItem__&&this.updateListFilters(this.__expandItem__[0]),this.updateListStyleOrder(),this.cssMods()},updateListStyleOrder:function(){this.$nextTick(()=>{const e=this.$refs.cascader,t=e==null?void 0:e.contentRef;if(t){const o=t.querySelectorAll(".el-cascader-menu__list");o&&o.forEach(r=>{r.querySelector(".sidebar-cascader-search")?r.classList.add("cascader-menu-with-search"):r.classList.remove("cascader-menu-with-search")})}})},searchInputChange:function(e,t){e.preventDefault();const{target:o}=e;if(o){const r=o.value,a=t.pathValues[0];this.searchInputs[a]=r,this.updateListFilters(a)}},searchInputFocusToggle:function(e,t){const{target:o}=e;if(!o)return;const r=o.closest(".el-input__wrapper");t===!0?r.classList.add("is-focus"):r.classList.remove("is-focus")},updateListFilters:function(e){const t=this.searchInputs[e]||"";this.$nextTick(()=>{const o=this.$refs["searchInput_"+e];if(!o)return;o.closest(".el-cascader-menu__list").querySelectorAll(".el-cascader-node").forEach((a,i)=>{i>1&&(a.querySelector(".el-cascader-node__label").textContent.toLowerCase().includes(t.toLowerCase())?a.classList.remove("hide"):a.classList.add("hide"))}),t&&o.focus()})},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([ba(o.term),o.facet])];return o.facet2&&(r.push(this.createCascaderItemValue([ba(o.term),o.facet,o.facet2])),o.facet3&&r.push(this.createCascaderItemValue([ba(o.term),o.facet,o.facet2,o.facet3]))),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&&t.length)return t.forEach(o=>{this.cascadeSelected.filter(a=>a.term!=o.term);const r=[o.facetPropPath,this.createCascaderItemValue([o.term,o.facet]),this.createCascaderItemValue([o.term,o.facet,o.facet2])];o.facet3&&r.push(this.createCascaderItemValue([o.term,o.facet,o.facet2,o.facet3])),this.cascadeSelected.push([...r]),this.cascadeSelectedWithBoolean.push([...r,o.AND])}),!0}},addFilters:function(e){let t=!1;return this.cascaderIsReady&&e.forEach(o=>{t=t||this.addFilter(o)}),t},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()},flattenToFilters:function(e,t,o=!1){let r=[];if(t){const a=e.facet.toLowerCase();let i=!1;for(const s of t){const l=e.facetPropPath.includes("flatmap.connectivity.source.")&&s.key,c=l?s.key.replace(`${e.facetPropPath}.`,"").toLowerCase()===a:s.label.toLowerCase()===a;if(s.children&&s.children.length){const d=c||o,u=this.flattenToFilters(e,s.children,d);r.push(...u)}else if(s.facetPropPath||s.key){const[d,u,f,g]=s.value.split(">");g==="Non specific"&&(i=!0);const m={term:d,facet:u,facetPropPath:e.facetPropPath,...f&&{facet2:f},...g&&{facet3:g}};"AND"in e&&(m.AND=e.AND),(o||c)&&(l?r.push(e):r.push(m))}}o&&i&&(r=r.filter(s=>!s.facet3||s.facet3==="Non specific"))}return r},validateAndConvertFilterToHierarchical:function(e){if(e&&e.facet&&e.term){if(e.facet2||e.facet3)return[e];{const t=this.options.find(o=>o.label===e.term);if(t)return this.flattenToFilters(e,t.children)}}},getHierarchicalValidatedFilters:function(e){const t=[],o=[],r=[];if(e){if(!this.cascaderIsReady)return{result:e,notFound:r};e.forEach(a=>{const i=this.validateAndConvertFilterToHierarchical(a);i&&i.length?i.forEach(s=>{t.push(s),o.push(s.term)}):this.options.find(l=>l.key===a.facetPropPath)&&r.push(a)}),this.options.forEach(a=>{o.includes(a.label)||t.push({facet:"Show all",facetPropPath:a.key,label:"Show all",term:a.label})})}return{result:t,notFound:r}},hasLineStyles:function(e){return"colour"in e&&e.colourStyle==="line"},getLineStyles:function(e){return"colour"in e&&e.colourStyle==="line"?"dashed"in e&&e.dashed===!0?{background:`repeating-linear-gradient(90deg,${e.colour},${e.colour} 6px,transparent 0,transparent 9px)`}:{background:e.colour}:{display:"None"}},getBackgroundStyles:function(e){return"colour"in e&&e.colourStyle==="background"?{background:e.colour}:{}}},mounted:function(){this.entry.options||(this.algoliaClient=n.markRaw(new Py(this.envVars.ALGOLIA_ID,this.envVars.ALGOLIA_KEY,this.envVars.PENNSIEVE_API_LOCATION)),this.algoliaClient.initIndex(this.envVars.ALGOLIA_INDEX),this.algoliaClient.setLocalStorageForTermMapping()),this.populateCascader().then(()=>{this.cascaderIsReady=!0,this.checkShowAllBoxes(),this.setCascader(this.entry.filterFacets),this.cssMods(),this.$emit("cascaderReady")})}},m$={class:"filters"},g$={key:0},y$={key:0,class:"cascader-tag"},b$={class:"el-tags-container"},w$={class:"el-tags-container"},C$={class:"search-filters transition-box"},k$={key:0},v$={class:"sidebar-cascader-search el-input"},S$={class:"el-input__wrapper"},E$=["value","onInput"],x$={key:1},_$={key:0,class:"sr-only"},T$={key:0,class:"filter-default-value"},O$={class:"dataset-shown"},N$={class:"dataset-results-feedback"};function B$(e,t,o,r,a,i){const s=n.resolveComponent("MapSvgSpriteColor"),l=wo,c=Zo,d=hl,u=pl,f=up,g=n.resolveComponent("MapSvgIcon"),m=Cl,h=ii,p=Xo;return n.openBlock(),n.createElementBlock("div",m$,[n.createVNode(s),i.showFilters&&e.options.length>0?(n.openBlock(),n.createElementBlock("div",g$,[e.presentTags.length>0?(n.openBlock(),n.createElementBlock("div",y$,[n.createVNode(l,{class:"ml-2",type:"info",closable:"",onClose:t[0]||(t[0]=y=>i.cascadeTagClose(e.presentTags[0]))},{default:n.withCtx(()=>[n.createElementVNode("span",{class:n.normalizeClass(["tag-text",i.modifyCascaderTagStyle(e.presentTags[0])])},n.toDisplayString(e.presentTags[0]),3)]),_:1}),e.presentTags.length>1?(n.openBlock(),n.createBlock(c,{key:0,placement:"bottom-start",width:250,trigger:"hover","popper-class":"cascade-tags-popover"},{default:n.withCtx(()=>[n.createElementVNode("div",b$,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.presentTags.slice(1),(y,b)=>(n.openBlock(),n.createBlock(l,{key:b,class:n.normalizeClass(["ml-2",i.modifyCascaderTagStyle(y)]),type:"info",closable:"",onClose:v=>i.cascadeTagClose(y)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(y),1)]),_:2},1032,["class","onClose"]))),128))])]),reference:n.withCtx(()=>[n.createElementVNode("div",w$,[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",C$,[n.createVNode(f,{class:"cascader",ref:"cascader",modelValue:e.cascadeSelected,"onUpdate:modelValue":t[3]||(t[3]=y=>e.cascadeSelected=y),size:"large",placeholder:" ","collapse-tags":!0,"collapse-tags-tooltip":"",options:e.options,props:e.cascaderProps,onChange:t[4]||(t[4]=y=>i.cascadeEvent(y)),onExpandChange:i.cascadeExpandChange,"show-all-levels":!0,"popper-class":"sidebar-cascader-popper"},{default:n.withCtx(({node:y,data:b})=>[i.isFlatmapConnectionsFilterNode(y)?(n.openBlock(),n.createElementBlock("div",k$,[n.createElementVNode("div",v$,[n.createElementVNode("div",S$,[n.createElementVNode("input",{class:"el-input__inner",ref:"searchInput_"+y.pathValues[0],value:e.searchInputs[y.pathValues[0]],onInput:v=>i.searchInputChange(v,y),onFocus:t[1]||(t[1]=v=>i.searchInputFocusToggle(v,!0)),onBlur:t[2]||(t[2]=v=>i.searchInputFocusToggle(v,!1)),style:{width:"100%"},autocomplete:"off",placeholder:"Search"},null,40,E$)])])])):(n.openBlock(),n.createElementBlock("div",x$,[n.createVNode(u,null,{default:n.withCtx(()=>[i.hasLineStyles(b)?(n.openBlock(),n.createBlock(d,{key:0,span:4},{default:n.withCtx(()=>[n.createElementVNode("div",{class:"path-visual",style:n.normalizeStyle(i.getLineStyles(b))},null,4)]),_:2},1024)):n.createCommentVNode("",!0),n.createVNode(d,{span:20},{default:n.withCtx(()=>[i.isFlatmapConnectionsNode(y)?(n.openBlock(),n.createElementBlock("span",_$,n.toDisplayString(i.getNodeKey(y.value)),1)):n.createCommentVNode("",!0),n.createElementVNode("div",{style:n.normalizeStyle(i.getBackgroundStyles(b))},n.toDisplayString(b.label),5)]),_:2},1024)]),_:2},1024)]))]),_:1},8,["modelValue","options","props","onExpandChange"]),e.showFiltersText?(n.openBlock(),n.createElementBlock("div",T$,"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(g,{icon:"help",class:"help"})]),default:n.withCtx(()=>[n.createElementVNode("div",null,[t[7]||(t[7]=n.createElementVNode("strong",null,"Within categories:",-1)),t[8]||(t[8]=n.createTextVNode(" OR ")),t[9]||(t[9]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" example: "+n.toDisplayString(o.entry.helper.within)+" ",1),t[10]||(t[10]=n.createElementVNode("br",null,null,-1)),t[11]||(t[11]=n.createElementVNode("br",null,null,-1)),t[12]||(t[12]=n.createElementVNode("strong",null,"Between categories:",-1)),t[13]||(t[13]=n.createTextVNode(" AND ")),t[14]||(t[14]=n.createElementVNode("br",null,null,-1)),n.createTextVNode(" example: "+n.toDisplayString(o.entry.helper.between),1)])]),_:1})])),[[p,!e.cascaderIsReady]])]),_:1})])):n.createCommentVNode("",!0),n.createElementVNode("div",O$,[n.createElementVNode("span",N$,n.toDisplayString(i.numberOfResultsText),1),n.createVNode(h,{class:"number-shown-select",modelValue:e.numberShown,"onUpdate:modelValue":t[5]||(t[5]=y=>e.numberShown=y),placeholder:"10",onChange:t[6]||(t[6]=y=>i.numberShownChanged(y))},{default:n.withCtx(()=>[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.numberDatasetsShown,y=>(n.openBlock(),n.createBlock(m,{key:y,label:y,value:y},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])}const rs=Jt(h$,[["render",B$],["__scopeId","data-v-5ccdbcd9"]]);var I$=async function(e){if(!e.ok){let t=await e.json();throw t?new Error(t.message):new Error(e)}return e},A$={searchInput:"",lastSearch:"",results:[],numberOfHits:0,filter:[],loadingCards:!1,numberPerPage:10,page:1,pageModel:1,start:0,hasSearched:!1,contextCardEnabled:!1};const F$={components:{SearchFilters:rs,DatasetCard:Wg,SearchHistory:os,Button:ht,Card:ni,Drawer:ml,Icon:Te,Input:Ko,Pagination:si,MapSvgIcon:Lc,MapSvgSpriteColor:Dc},name:"DatasetExplorer",props:{visible:{type:Boolean,default:!1},isDrawer:{type:Boolean,default:!0},entry:{type:Object,default:()=>A$},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,showFilters:!0,helper:{within:"'heart' OR 'colon'",between:"'rat' AND 'lung'"}}}},methods:{hoverChanged:function(e){const t=e?{...e,tabType:"dataset"}:{tabType:"dataset"};this.$emit("hover-changed",t)},resetSearch:function(){this.numberOfHits=0,this.discoverIds=[],this._dois=[],this.results=[],this.loadingCards=!1},openSearch:function(e,t=""){if(this.searchInput=t,this.resetPageNavigation(),this.cascaderIsReady){const o=this.$refs.filtersRef.getHierarchicalValidatedFilters(e),r=o.notFound?o.notFound.filter(a=>a.facet.toLowerCase()!=="show all"):[];this.filter=o.result,r.forEach(a=>{Lp({message:`${a.facet} cannot be found in ${a.term}!`,appendTo:this.$el,showClose:!0,offset:113})}),e&&e.length>0&&this.filter&&this.filter.length===0?(this.$refs.filtersRef.checkShowAllBoxes(),this.resetSearch()):this.filter&&(this.searchAlgolia(this.filter,t),this.$refs.filtersRef.setCascader(this.filter),this.searchHistoryUpdate(this.filter,t))}else this.filter=e,(!e||e.length==0)&&(this.searchAlgolia(this.filter,t),this.searchHistoryUpdate(this.filter,t))},addFilter:function(e){this.cascaderIsReady?(this.resetPageNavigation(),e&&this.$refs.filtersRef.addFilters(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()},onResetClick:function(){this.openSearch([],""),this.$emit("search-changed",{value:this.searchInput,tabType:"dataset",type:"reset-update"}),me.emit("trackEvent",{event_name:"portal_maps_action_filter",category:"reset",location:"map_sidebar_dataset"})},searchEvent:function(e=!1){(e.keyCode===13||e instanceof MouseEvent)&&(this.searchInput=this.searchInput.trim(),this.searchAndFilterUpdate())},filterUpdate:function(e){this.filter=[...e],this.searchAndFilterUpdate(),this.$emit("search-changed",{value:e,tabType:"dataset",type:"filter-update"})},searchAndFilterUpdate:function(){this.resetPageNavigation(),this.searchAlgolia(this.filter,this.searchInput),this.searchHistoryUpdate(this.filter,this.searchInput)},searchHistoryUpdate:function(e,t){this.$refs.searchHistory.selectValue="Search history",(e.length||t!=null&&t.trim())&&this.$refs.searchHistory.addSearchToHistory(e,t)},searchAlgolia(e,t=""){this.loadingCards=!0,this.algoliaClient.anatomyInSearch($y(e),t).then(o=>{me.emit("anatomy-in-datasets",o.forFlatmap),me.emit("number-of-datasets-for-anatomies",o.forScaffold)}),this.algoliaClient.search($y(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,tabType:"dataset",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,me.emit("trackEvent",{event_name:"portal_maps_dataset_perPage",category:e+"",location:"map_sidebar_dataset"});const t=this.page===1;this.pageChange(1,t)},pageChange:function(e,t=!1){this.start=(e-1)*this.numberPerPage,this.page=e,this.searchAlgolia(this.filter,this.searchInput,this.numberPerPage,this.page),t||me.emit("trackEvent",{event_name:"portal_maps_dataset_pagination",category:`page_${this.page}`,location:"map_sidebar_dataset"})},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,simulation:t["abi-simulation-omex-file"]?t["abi-simulation-omex-file"]:t["abi-simulation-file"],flatmaps:t["abi-flatmap-file"],additionalLinks:t.additionalLinks,detailsReady:!0})})},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(I$).then(s=>s.json()).then(s=>r(s)).catch(s=>a(s))})},getAlgoliaFacets:async function(){return await this.algoliaClient.getAlgoliaFacets(Mc)},searchHistorySearch:function(e){this.searchInput=e.search,this.filter=e.filters,this.openSearch([...e.filters],e.search)},getSearch:function(){return this.searchInput},getFilters:function(){return this.filter.some(t=>t.facet.toLowerCase()!=="show all")?this.filter:[]}},mounted:function(){this.algoliaClient=n.markRaw(new Py(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/"}},R$={class:"header"},P$={class:"content scrollbar",ref:"content"},$$={key:0,class:"error-feedback"};function L$(e,t,o,r,a,i){const s=Ko,l=n.resolveComponent("MapSvgIcon"),c=Zo,d=ht,u=rs,f=os,g=Wg,m=si,h=ni,p=Xo;return n.openBlock(),n.createBlock(h,{"body-style":e.bodyStyle,class:"content-card"},{header:n.withCtx(()=>[n.createElementVNode("div",R$,[n.createElementVNode("div",{class:n.normalizeClass(["search-input-container",{"is-focus":e.searchInput}])},[n.createVNode(s,{class:"search-input",placeholder:"Search",modelValue:e.searchInput,"onUpdate:modelValue":t[0]||(t[0]=y=>e.searchInput=y),onKeyup:i.searchEvent,clearable:"",onClear:i.clearSearchClicked},null,8,["modelValue","onKeyup","onClear"]),n.createVNode(c,{width:"350",trigger:"hover","popper-class":"filter-help-popover"},{reference:n.withCtx(()=>[n.createVNode(l,{icon:"help",class:"help"})]),default:n.withCtx(()=>[t[3]||(t[3]=n.createElementVNode("div",null,[n.createElementVNode("strong",null,"Search rules:"),n.createElementVNode("ul",null,[n.createElementVNode("li",null,[n.createElementVNode("strong",null,"Multiple Terms:"),n.createTextVNode(" Separate terms with a comma ("),n.createElementVNode("code",null,","),n.createTextVNode('). This will find datasets that match any of the terms (an "OR" search). ')]),n.createElementVNode("li",null,[n.createElementVNode("strong",null,"Exact Phrase:"),n.createTextVNode(" Terms within a comma block will be matched as an exact phrase. ")])]),n.createElementVNode("br"),n.createElementVNode("strong",null,"Examples:"),n.createElementVNode("ul",null,[n.createElementVNode("li",null,[n.createElementVNode("strong",null,"To find by exact phrase:"),n.createTextVNode(" Searching for "),n.createElementVNode("code",null,"vagus nerve"),n.createTextVNode(" will find any dataset containing "),n.createElementVNode("code",null,'"vagus nerve"'),n.createTextVNode(". ")]),n.createElementVNode("li",null,[n.createElementVNode("strong",null,"To find by multiple terms:"),n.createTextVNode(" Searching for "),n.createElementVNode("code",null,"nerve, vagus"),n.createTextVNode(" will find data that contains either "),n.createElementVNode("code",null,"nerve"),n.createTextVNode(" OR "),n.createElementVNode("code",null,"vagus"),n.createTextVNode(". ")])])],-1))]),_:1})],2),n.createVNode(d,{type:"primary",class:"button",onClick:i.searchEvent,size:"large"},{default:n.withCtx(()=>t[4]||(t[4]=[n.createTextVNode(" Search ")])),_:1},8,["onClick"]),n.createVNode(d,{link:"",class:"el-button-link",onClick:i.onResetClick,size:"large"},{default:n.withCtx(()=>t[5]||(t[5]=[n.createTextVNode(" Reset ")])),_:1},8,["onClick"])])]),default:n.withCtx(()=>[n.createVNode(u,{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(f,{ref:"searchHistory",localStorageKey:"sparc.science-dataset-search-history",onSearch:i.searchHistorySearch},null,8,["onSearch"]),n.withDirectives((n.openBlock(),n.createElementBlock("div",P$,[e.results.length===0&&!e.loadingCards?(n.openBlock(),n.createElementBlock("div",$$," No results found - Please change your search / filter criteria. ")):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.results,y=>(n.openBlock(),n.createElementBlock("div",{key:y.doi,class:"step-item"},[n.createVNode(g,{class:"dataset-card",entry:y,envVars:o.envVars,onMouseenter:b=>i.hoverChanged(y),onMouseleave:t[1]||(t[1]=b=>i.hoverChanged(void 0))},null,8,["entry","envVars","onMouseenter"])]))),128)),n.createVNode(m,{class:"pagination","current-page":e.page,"onUpdate:currentPage":t[2]||(t[2]=y=>e.page=y),"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"])])),[[p,e.loadingCards]])]),_:1},8,["body-style"])}const Dy=Jt(F$,[["render",L$],["__scopeId","data-v-477651e8"]]),V$=e=>e.replace(/\w\S*/g,t=>t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()),io=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""},D$={name:"ConnectivityInfo",components:{Button:ht,Container:Sx,Icon:Te,ElIconWarning:ae.Warning,ElIconLocation:ae.Location,ElIconSearch:ae.Search,ElIconArrowDown:ae.ArrowDown,ElIconArrowUp:ae.ArrowUp,ExternalResourceCard:qn.ExternalResourceCard,CopyToClipboard:qn.CopyToClipboard,ConnectivityGraph:qn.ConnectivityGraph,ConnectivityList:qn.ConnectivityList,ConnectivityReconciliationList:qn.ConnectivityReconciliationList},props:{connectivityEntry:{type:Array,default:[]},entryData:{type:Object,default:()=>({})},entryId:{type:String,default:""},envVars:{type:Object,default:()=>{}},availableAnatomyFacets:{type:Array,default:()=>[]},withCloseButton:{type:Boolean,default:!1},showLongLabel:{type:Boolean,default:!1}},data:function(){return{updatedCopyContent:"",activeView:"listView",connectivityLoading:!1,connectivitySource:"map",noMapConnectivity:!1,connectivityError:{},graphViewLoaded:!1,connectivityFromMap:null,isTitleExpanded:!1,showTitleToggle:!1}},computed:{entry:function(){return this.connectivityEntry.find(e=>e.featureId[0]===this.entryId)},displayTitle:function(){var e,t,o;return this.showLongLabel?((e=this.entryData)==null?void 0:e["long-label"])||((t=this.entry)==null?void 0:t["long-label"])||"":((o=this.entry)==null?void 0:o.title)||""},hasProvenanceTaxonomyLabel:function(){return this.entry.provenanceTaxonomyLabel&&this.entry.provenanceTaxonomyLabel.length>0},provSpeciesDescription:function(){let e="Studied in";return this.entry.provenanceTaxonomyLabel.forEach(t=>{e+=` ${t},`}),e=e.slice(0,-1),e+=" species",e},connectivityKey:function(){return this.entry.featureId[0]+this.entry.connectivitySource},origins:function(){return this.entry.origins},components:function(){return this.entry.components},destinations:function(){return this.entry.destinations},originsWithDatasets:function(){return this.entry.originsWithDatasets},componentsWithDatasets:function(){return this.entry.componentsWithDatasets},destinationsWithDatasets:function(){return this.entry.destinationsWithDatasets},hasSingleConnectivityList:function(){return this.entry.hasSingleConnectivityList},destinationsCombinations:function(){return this.entry.destinationsCombinations||[]},originsCombinations:function(){return this.entry.originsCombinations||[]},componentsCombinations:function(){return this.entry.componentsCombinations||[]},resources:function(){return this.entry.hyperlinks||[]},sckanVersion:function(){return this.entry.knowledgeSource},flatmapApi:function(){return this.envVars.FLATMAPAPI_LOCATION}},watch:{entry:{deep:!0,immediate:!0,handler:function(e,t){e&&e!==t&&(this.connectivityLoading=!0,this.activeView=localStorage.getItem("connectivity-active-view")||this.activeView,this.activeView==="graphView"&&(this.graphViewLoaded=!0),this.connectivitySource=this.entry.connectivitySource,this.noMapConnectivity=this.entry.noMapConnectivity,this.updateGraphConnectivity(),this.connectivityLoading=!1,(!t||(e==null?void 0:e.featureId[0])!==(t==null?void 0:t.featureId[0]))&&this.$emit("loaded"),this.isTitleExpanded=!1,this.updateTitleToggleVisibility())}},displayTitle:function(){this.isTitleExpanded=!1,this.updateTitleToggleVisibility()}},methods:{titleCase:function(e){return V$(e)},capitalise:function(e){return io(e)},toggleTitleExpansion:function(){this.isTitleExpanded=!this.isTitleExpanded,this.isTitleExpanded||this.$nextTick(()=>{this.updateTitleToggleVisibility()})},updateTitleToggleVisibility:function(){this.$nextTick(()=>{const e=this.$refs.titleElement;if(!e){this.showTitleToggle=!1;return}const t=this.isTitleExpanded;t&&e.classList.add("title--clamped");const o=e.scrollHeight>e.clientHeight+1;this.showTitleToggle=o,t&&e.classList.remove("title--clamped"),o||(this.isTitleExpanded=!1)})},showConnectivity:function(){const e=this.entry.featureId||[];this.$emit("show-connectivity",e),me.emit("trackEvent",{event_name:"portal_maps_show_connectivity_on_map",category:this.entry.id||"",location:"map_sidebar_connectivity"})},onCopied:function(){me.emit("trackEvent",{event_name:"portal_maps_connectivity_copy",category:this.entry.id||"",location:"map_sidebar_connectivity"})},switchConnectivityView:function(e){this.activeView=e,localStorage.setItem("connectivity-active-view",this.activeView),e==="graphView"&&!this.graphViewLoaded&&this.$nextTick(()=>{this.graphViewLoaded=!0}),me.emit("trackEvent",{event_name:"portal_maps_connectivity_switch_view",category:e,location:"map_sidebar_connectivity"})},openGraphInViewer:function(){const e={entry:this.entry.featureId[0],mapServer:this.flatmapApi,sckanVersion:this.sckanVersion,connectivityFromMap:this.connectivityFromMap,connectivityError:this.connectivityError,origins:this.origins,components:this.components,destinations:this.destinations,originsWithDatasets:this.originsWithDatasets,componentsWithDatasets:this.componentsWithDatasets,destinationsWithDatasets:this.destinationsWithDatasets,hasSingleConnectivityList:this.hasSingleConnectivityList,originsCombinations:this.originsCombinations,componentsCombinations:this.componentsCombinations,destinationsCombinations:this.destinationsCombinations,allWithDatasets:[...this.componentsWithDatasets,...this.destinationsWithDatasets,...this.originsWithDatasets],connectivityInfo:this.entry};me.emit("show-connectivity-graph",e)},onTapNode:function(e){const t=e.map(o=>o.label).join(", ");this.onConnectivityHovered(t)},onShowReferenceConnectivities:function(e){this.$emit("show-reference-connectivities",e)},onReferencesLoaded:function(e){this.updatedCopyContent=this.getUpdateCopyContent(e)},getUpdateCopyContent:function(e){var f,g,m,h,p,y,b,v,O,C,E,x;if(!this.entry)return"";const t=[],o=((f=this.entry)==null?void 0:f.title)||"",r=((g=this.entryData)==null?void 0:g["long-label"])||((m=this.entry)==null?void 0:m["long-label"])||"";let a=this.entry.featureId;const i=[],s=io(r||o);s&&i.push(`<div><strong>${s}</strong></div>`),a!=null&&a.length&&(typeof a=="object"?i.push(`<div><strong>Id:</strong> ${a[0]}</div>`):i.push(`<div><strong>Id:</strong> ${a}</div>`)),t.push(`<div>${i.join(`
468
468
  `)}</div>`),(h=this.entry.provenanceTaxonomyLabel)!=null&&h.length&&t.push(`<div>${this.provSpeciesDescription}</div>`),this.entry.paths&&t.push(`<div>${this.entry.paths}</div>`);let l=!1,c=!1;function d(_,N,A=[]){let R=`<div><strong>${_}</strong></div>`;const P=[];N.forEach(z=>{let M=[];z.split(",").forEach(H=>{const I=A.find(D=>D.name===H.trim());I?M.push(`${io(H)} (${I.id})`):M.push(`${io(H)}`)}),P.push(M.join(","))});const $=P.map(z=>`<li>${z}</li>`).join(`
469
469
  `);return R+=`
470
470
  `,R+=`<ul>${$}</ul>`,R}function u(_,N=[]){let A=`<div><strong>${_}</strong></div>`;const R=[...N].sort((M,H)=>{const I=((M==null?void 0:M.sckanLabel)||(M==null?void 0:M.mapLabel)||"").toLowerCase(),D=((H==null?void 0:H.sckanLabel)||(H==null?void 0:H.mapLabel)||"").toLowerCase();return I.localeCompare(D)}),P=M=>{if(!(M!=null&&M.length))return null;const H=M[0];return typeof H=="string"?H:(H==null?void 0:H[0])||null},z=R.map(M=>{var ge;if((M==null?void 0:M.sckanId)&&(M==null?void 0:M.mapId)&&JSON.stringify(M.sckanId)===JSON.stringify(M.mapId)){const Ce=P(M.mapId),de=io(M.sckanLabel||M.mapLabel||"-");return Ce?`${de} (${Ce})`:de}const I=M!=null&&M.sckanLabel?io(M.sckanLabel):"-",D=P(M.sckanId),oe=D?`${I} (${D})`:I;if(!((ge=M==null?void 0:M.mapId)!=null&&ge.length)||!(M!=null&&M.mapLabel))return l=!0,`<s>${oe}</s> (unavailable on <strong>Map</strong>) *`;const se=io(M.mapLabel),ue=P(M.mapId),Oe=ue?`${se} (${ue})`:se;return c=!0,`<s>${oe}</s> (<strong>Map:</strong> ${Oe}) **`}).map(M=>`<li>${M}</li>`).join(`