1import{b as x,u as z}from"./BTO3ATUJ.js";import{M as A,D as H,b6 as V,B as q,ax as F,ag as y,b7 as j,G as d}from"./DWVUfIi5.js";const Q=()=>{const w=A(),{chunkSize:O,minThemeSliderItems:g}=w.public.gringotts,{getOfferGroupingOption:I,getSearchResultsByOfferListingIds:u,getSearchResultsPageByGroupingType:S}=H(),{searchResultByOfferListingId:f}=V(),{themeOfferGroupings:B,contentBlocks:G,banners:R,dailyDeal:T,megadeals:L}=x(),{locale:b}=q(),c=z(),m=async(t,a)=>{const s={groupingType:d.THEME,slug:t,page:a,pageSize:21,language:b.value},{results:e}=await S(s);return e},v=async(t,a)=>{const s=new Set(a),e=[];let n=0;for(;s.size;){const i=await m(t,++n);if(!i.length)return e;e.push(...i.filter(({id:r})=>s.delete(r)))}return e},D=()=>G.value.setOnce(c.contentBlocks),k=async(t,a,s)=>{const e=new Set(a.map(({id:r})=>r)),n=[];let i=0;for(;n.length<s;){const r=await m(t,++i);if(!r.length)return n;n.push(...r.filter(({id:o})=>!e.has(o)).slice(0,s-n.length))}return n},P=async()=>{const[t,a]=await Promise.all([c.themeViews(),c.sortableOfferListingItemsByThemeSlug()]),s=j(Array.from(a.entries()),O);for(const e of s)await Promise.all(e.map(async([n,i])=>{const r=await v(n,i.map(({id:o})=>o));for(const o of r)f.value.set(o.id,o)}));return Promise.all(t.map(async({id:e,slug:n})=>{const i=await I(d.THEME,n),r=a.get(n)??[],o=y(r,({sort:l})=>l).map(({id:l})=>f.value.get(l)).filter(l=>!!l);return o.length<g&&o.push(...await k(n,r,g-o.length)),{...i,id:e,results:o}}))},C=()=>B.value.setOnce(P),M=()=>R.value.setOnce(c.banners),h=()=>T.value.setOnce(c.dailyDeal),E=async()=>{const t=await h();if(t){const[a]=await u([t.id]);return a}},p=()=>L.value.setOnce(c.megadeals);return{getContentBlocks:D,getThemeOfferGroupings:C,getLandingPageBanners:M,getDailyDeal:h,getDailyDealItem:E,getMegadeals:p,getMegadealItems:async()=>{const t=F(({id:s})=>s,await p()),a=await u(Array.from(t.keys()));return y(a,({id:s})=>{var e;return(e=t.get(s))==null?void 0:e.sort})}}};export{Q as u};
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.