PageSourceSearch

https://1adisplay.com/assets/useCategoryBlogPosts-CR_qeppe.js

js 1adisplay.com collected 2026-10-04 11:06:10 UTC 3,488 bytes, 1 lines download raw bytes

1import{u as s}from"./vendor-query-Bj-7OnbJ.js";import{E as t}from"./index-CafQFu0N.js";import{b as a}from"./format-16WGXwq5.js";const e=["banner-stands","flags","tablecloths","custom-inflatables","pop-up-tents","umbrellas","trade-show-displays","digital-signage"],n={"banner-stands":"Banner Stands",flags:"Flags",tablecloths:"Tablecloths","custom-inflatables":"Custom Inflatables","pop-up-tents":"Pop-Up Tents",umbrellas:"Umbrellas","trade-show-displays":"Trade Show Displays","digital-signage":"Digital Signage"},i={"pop-up-tents":["tablecloths","flags","banner-stands","umbrellas"],tablecloths:["pop-up-tents","banner-stands","trade-show-displays"],flags:["banner-stands","pop-up-tents","custom-inflatables"],"banner-stands":["tablecloths","flags","trade-show-displays","digital-signage"],"custom-inflatables":["flags","banner-stands","digital-signage"],umbrellas:["pop-up-tents","tablecloths"],"trade-show-displays":["banner-stands","tablecloths","digital-signage"],"digital-signage":["banner-stands","trade-show-displays","custom-inflatables"]},l={"banners-flags":["flags","banner-stands"],"display-stands":["banner-stands"],"canopy-tents":["pop-up-tents"],"table-covers":["tablecloths"],"digital-signage":["digital-signage"],"inflatable-advertising":["custom-inflatables"],"trade-shows-events":["trade-show-displays","banner-stands","tablecloths"],"marketing-tips":[]},o={flags:["banners-flags","trade-shows-events"],"banner-stands":["display-stands","banners-flags","trade-shows-events"],"pop-up-tents":["canopy-tents","trade-shows-events"],tablecloths:["table-covers","trade-shows-events"],"digital-signage":["digital-signage"],"custom-inflatables":["inflatable-advertising"],"trade-show-displays":["trade-shows-events"],umbrellas:[]},r=["flags","pop-up-tents","banner-stands","tablecloths"];function d(s){return!!s&&e.includes(s)}async function g(s,e,n=[]){if(0===s.length||e<=0)return[];const{data:i,error:l}=await t.from("blog_categories").select("id, slug").in("slug",s).eq("is_active",!0);if(l)throw l;if(!(null==i?void 0:i.length))return[];const{data:o,error:r}=await t.from("blog_post_categories").select("post_id, category_id").in("category_id",i.map(s=>s.id));if(r)throw r;if(!(null==o?void 0:o.length))return[];const d=new Set(n),g=[...new Set(o.map(s=>s.post_id))].filter(s=>!d.has(s)),p=await a.listByIds(g),u=new Map(i.map(s=>[s.id,s.slug])),c=new Map;for(const t of o){const a=s.indexOf(u.get(t.category_id)??""),e=c.get(t.post_id);a>=0&&(void 0===e||a<e)&&c.set(t.post_id,a)}return p.map((s,t)=>({p:s,i:t})).sort((s,t)=>(c.get(s.p.id)??99)-(c.get(t.p.id)??99)||s.i-t.i).map(s=>s.p).slice(0,e)}function p(t,a=6){return s({queryKey:["category-blog-posts",t,a],queryFn:async()=>{if(!t)return null;const s=d(t)?o[t]:[],e=s.length?[...s,"marketing-tips"]:["marketing-tips"],n=await g(e,a);return n.length>0?n:null},enabled:!!t,staleTime:3e5})}function u(t,e=3){const n=((null==t?void 0:t.categories)??[]).map(s=>
1s.slug).filter(Boolean);return s({queryKey:["topic-related-posts",null==t?void 0:t.id,n.join(","),e],queryFn:async()=>{if(!t)return[];const s=await g(n,e,[t.id]);if(s.length<e&&!n.includes("marketing-tips")){const a=await g(["marketing-tips"],e-s.length,[t.id,...s.map(s=>s.id)]);s.push(...a)}if(s.length<e){const n=await a.listRecentForScoring(e+5),i=new Set([t.id,...s.map(s=>s.id)]);s.push(...n.filter(s=>!i.has(s.id)).slice(0,e-s.length))}return s},enabled:!!(null==t?void 0:t.id),staleTime:3e5})}export{l as B,n as C,r as H,u as a,i as b,d as i,p 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.