import{_ as d,a as m}from"./BNavText.vue_vue_type_script_setup_true_lang-CTjx912Y-CSS1XjKO.js";import{_ as f}from"./BBadge.vue_vue_type_script_setup_true_lang-D9DEOOtU-CS7HajdW.js";import{_,d as l,o as e,c as r,h as b,w as a,g as I,F as k,r as v,j as y,a as $,b as g,t as c,e as x,G as R}from"./index-D02r7Zsc.js";import"./useAlignment-Cw-9AVid-Db1FQC5G.js";import"./useDefaults-DESCdb0p-CFLjYrdG.js";import"./BLink.vue_vue_type_script_setup_true_lang-Ct47WhzE-DDPYis_D.js";import"./object-0ALvRU0O-3BORTTD-.js";import"./stringUtils-gJJ6T6UC-g5BZrMym.js";import"./useColorVariantClasses-ZDE19TZw-Cvu7SygP.js";import"./ConditionalWrapper.vue_vue_type_script_lang-IX_NpHH--DrWkD0m2.js";const w={data:function(){return{results:{},tabIndex:0}},computed:{isMultipleSearch:function(){return Object.keys(this.results).length<=1?!1:!isNaN(parseInt(Object.keys(this.results)[0]))},nbResults:function(){return this.results?this.isMultipleSearch&&this.results[this.tabIndex]?parseInt(this.results[this.tabIndex].search.nbResults):Object.keys(this.results).length==1?parseInt(this.results[Object.keys(this.results)[0]].search.nbResults):this.results&&this.results.nbResults?parseInt(this.results.nbResults):0:0}},created:async function(){if(this.results=this.get(`search${this.$route.params.searchId}`),this.isMultipleSearch){for(let s in this.results)if(this.results[s].search.searchId==this.$route.params.searchId){this.tabIndex=s;break}}this.publish("showOverlay",!1),this.results[this.tabIndex]&&this.$route.path==="/searchresultspage"&&this.$router.replace({name:"searchresult",params:{searchId:this.results[this.tabIndex].search.searchId}})}};function C(s,N,S,j,M,n){const u=f,o=m,h=d,p=I("router-view");return e(),l("div",null,[n.isMultipleSearch?(e(),r(h,{key:0,align:"center",fill:"",small:"",tabs:""},{default:a(()=>[(e(!0),l(k,null,v(this.results,(t,i)=>(e(),r(o,{key:i,"active-class":"text-secondary",replace:"",to:{name:"searchresult",params:{searchId:t.search.searchId}},onClick:y(O=>s.tabIndex=i,["prevent"])},{default:a(()=>[$("span",null,c(t.label),1),g(u,{pill:"",variant:"badge",class:"ms-1"},{default:a(()=>[x(c(t.search.nbResults),1)]),_:2},1024)]),_:2},1032,["to","onClick"]))),128))]),_:1})):b("",!0),(e(),r(p,{class:"pt-2",key:s.$route.fullPath},{default:a(({Component:t})=>[(e(),r(R(t),{nbResults:n.nbResults},null,8,["nbResults"]))]),_:1}))])}const z=_(w,[["render",C],["__scopeId","data-v-da9f66f9"]]);export{z as default};
