1import{_ as v}from"./Djn93nbf.js";import{_ as b,a as m,w as h,P as o,u as x,m as R,y as $,l as w,ay as P,az as A,k as C,p as k,aA as L,A as i,aB as N,o as l,s as q,c as I,b as g,q as T,e as p,t as f}from"./Bv6rD22K.js";import{_ as B}from"./BKVVQxuU.js";import{_ as E}from"./BwOs6Znr.js";import{_ as H}from"./D9n9N6J4.js";import{S as D}from"./QHpKS67c.js";import{c as M}from"./ZNiQiSmP.js";import"./COtxoU-H.js";import"./ChFH_etC.js";import"./DJ6jjTd3.js";import"./KjFEp5XW.js";import"./NdmdrM1v.js";import"./DhxosPtj.js";import"./B7hmZjMN.js";import"./CXJsqkHJ.js";import"./DIPFThub.js";import"./B2INmLdn.js";import"./C7yT8Dih.js";import"./CeJCG0WW.js";import"./CCxC4gXk.js";import"./z4ZVdS0n.js";const U={setup(){const e=P(),{$hostname:d}=A(),n=C(),r=N(0),a=20,t=i(()=>{const s=e.params.pageNumber||e.query.page;return s?Number(s):1}),u=i(()=>Math.ceil(r.value/a)),c=i(()=>{const s=`page ${t.value} of ${u.value}`;return`${(n.site.defaultMeta["metadesc-recipe"]||"").replace("%%term_title%%","Recipes")} ${s}`});return k({title:"Recipes Archive",link:i(()=>!n.siteHasFeature("Recipes")||t.value>1?[{rel:"canonical"}]:[]),meta:i(()=>{const s=[{name:"description",content:c.value},{property:"og:description",content:c.value},{property:"twitter:description",content:c.value}];return(!n.siteHasFeature("Recipes")||t.value>1)&&s.push({name:"robots",content:"noindex"}),s})}),L([M("Recipes",i(()=>r.value),e.path,d,n.site.settings.condition_name)]),{totalCount:r,perPage:a,currentPage:t}},data(){return{posts:[],dataLayer:{},sidebarAdSections:w.sidebarAdSections,term:(this._.provides[o]||this.$route).query.term||""}},computed:{...R($,["userIsLoggedIn","userIsUnverified"]),pageTitle(){return(this._.provides[o]||this.$route).meta.title?`Recipes: ${(this._.provides[o]||this.$route).meta.title}`:"Recipes"},searchPlaceholder(){return`Discover and share ${this.$site.settings.condition_name}-friendly recipes`}},watch:{posts(e){e&&this.onLoad()}},methods:{handleSearch(e){this.term!==e&&this.$router.push({name:(this._.provides[o]||this.$route).name,query:{...(this._.provides[o]||this.$route).query,term:e,page:1}})},tryToAddNewRecipe(e){this.userIsLoggedIn&&!this.userIsUnverified&&this.$snowplow.trackButtonEvent({data:{type:"add recipe",text:e.target.textContent.trim(),classes:e.target.classList,id:e.target.id}}),this.$router.push({path:"/recipes/new"})},onLoad(){x().updateGlobalContext({page:{type:"Collection",id:`recipes-${this.currentPage}`},search:{type:"Content Collection",query:this.posts.map(e=>e.id)}}),this.$emit("loaded",this.dataLayer)}},apollo:{search:{query:D,variables(){return{page:this.currentPage,query:this.term||"*",index:"POST",searchSort:"DATE",postTypes:["recipe"],limit:this.perPage,tagSlug:(this._.provides[o]||this.$route).meta.tag}},result({data:e}){if(e){if(!e.search||!e.search.searchResults)return;this.dataLayer=e.search.dataLayer,this.totalCount=e.search.total,this.posts=e.search.searchResults}}}}},F={class:"recipes-index__header","data-test-id":"recipes-index-header"},V={class:"page-heading page-heading--ugc-index","data-test-id":"recipes-index-page-heading"},O={class:"align-center"},z={class:"recipes-index__cta"},G={key:1,class:"collection-page"};function Q(e,d,n,r,a,t){const u=v,c=q,s=B,_=E,y=H;return l(),m(y,{name:"sidebar",class:"recipes-index","show-leaderboard-ad":!e.$apollo.loading},{hero:h(()=>[p("div",F,[p("h1",V,f(e.$decodeHtml(t.pageTitle)),1),p("p",O,f(e.$site.settings.recipes_index_cta),1),p("div",z,[p("button",{id:"submit-recipe-button",type:"button",class:"recipes-index__cta-button button",onClick:d[0]||(d[0]=(...S)=>t.tryToAddNewRecipe&&t.tryToAddNewRecipe(...S))}," Submit your recipe "),g(u,{class:"recipes-index__search",placeholder:t.searchPlaceholder,"aria-placeholder":t.searchPlaceholder,term:a.term,onSearch:t.handleSearch},null,8,["placeholder","aria-placeholder","term","onSearch"])])])]),"sidebar-ads":h(()=>[e.$apollo.loading?T("",!0):(l(),m(_,{key:0,sections:a.sidebarAdSections},null,8,["sections"]))]),default:h(()=>[e.$apollo.loading?(l(),m(c,{key:0})):(l(),I("div",G,[g(s,{items:a.posts,"current-page":r.currentPage,"per-page":r.perPage,"total-count":r.totalCount}
1,null,8,["items","current-page","per-page","total-count"])]))]),_:1},8,["show-leaderboard-ad"])}const he=b(U,[["render",Q],["__scopeId","data-v-f46876ae"]]);export{he as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.