PageSourceSearch

https://canyon.eu/_nuxt/BHFsZ-i6.js

js canyon.eu collected 2026-10-02 15:18:31 UTC 2,543 bytes, 2 lines download raw bytes

1import{n as N,h as a,b as C,g as q,A as j,u as k,J as D,s as h,a as $,r as G}from"./woluVcg9.js";import{u as H}from"./3RSlX5Xr.js";function I(e,t){const{$api:s}=N(),g=a(()=>C(e));return{fetch:async()=>{const{data:n}=await s.categoryService.getCategory(g.value,t);if(!n)throw new Error("404 error");const c=t.limit>0?Math.ceil(Number(n?.products_meta_count)/t.limit):1;return{category:n,pagesCount:c}}}}function M(){return{getCategoryAggs:t=>{const s=g=>g.buckets;return[...t.aggs?.filter(s)??[],...t.features?.filter(s)??[]]}}}function O(e){const t=a(()=>C(e)),{getCategoryAggs:s}=M(),g=a(()=>t.value&&s(t.value)),r=a(()=>t.value&&t.value.contents?.find(u=>u.type==="catalog-head")?.data),n=a(()=>t.value&&t.value.contents?.filter(u=>u.type!=="catalog-head")),c=a(()=>t.value&&t.value.products);return{categoryAggs:g,categoryHeader:r,categoryContent:n,categoryProducts:c}}const T=30,V=["category","subcategory","subsubcategory","subsubsubcategory"],m=e=>typeof e=="string"?e:void 0,v=e=>m(e)?.split(",").map(Number),z=e=>Number(m(e.page))||void 0;function Y(){const e=q(),t=j(),{locale:s}=k(),{categories:g}=D(),r=V.map(o=>e.params[o]).filter(o=>typeof o=="string"&&!!o);if(!r.length)throw h({statusCode:404,fatal:!0});const n=a(()=>r.reduce((o,i,l)=>{if(l&&!o[l-1])return o;const f=(l?o[l-1].children:g.value)?.find(E=>E.slug===i);return f?[...o,f]:o},[])),c=a(()=>n.value[r.length-1]);if(!c.value)throw h({statusCode:404,fatal:!0});$(()=>({title:c.value?.seo?.page_title,meta:[{name:"description",key:"description",content:c.value?.seo?.description},{property:"og:title",key:"og:title",content:c.value?.seo?.og_title}]}));const u=G({page:z(e.query),category_id:v(e.query.categories),filters:v(e.query.features),includes:["variations"],"order[external_cf_published_at]":"desc","order[popular]":"desc",limit:T,lang:s.value}),{fetch:b}=I(r[r.length-1],u),{data:d,pending:A,refresh:_}=H(`product-category-${r.join("-")}-${s.value}`,()=>b(),{default:()=>({category:void 0,pagesCount:0})}),y=a(()=>d.value.category),P=a(()=>d.value.pagesCount),{categoryProducts:S}=O(y),p=o=>y.value?.contents?.find(i=>i.type===o),w=a(()=>p("tips-section")),R=a(()=>p("category-cards-section"));return{chain:n,categoryData:y,products:S,totalPages:P,loadingProducts:A,tipsSection:w,categoryCardsSection:R,handleChange:async({categories:o,features:i,page:l})=>{t.push({query:{categories:o?.length?o.join(","):void 0,features:i?.length?i.join(","):void 0,page:l}}),u.page=l,u.category_id=o,u.filters=i,await _()}}}export{Y as u};
2//# sourceMappingURL=BHFsZ-i6.js.map

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.