PageSourceSearch

https://aiplans.org/assets/GuidesFeed-dmfyGzNn.js

js aiplans.org collected 2026-10-08 11:09:57 UTC 4,183 bytes, 1 lines download raw bytes

1import{_ as E,u as V,s as z,E as M,x as R,c9 as j,h as A,z as u,o as l,c as i,a as s,d as g,j as c,k,F as I,r as U,n as W,B as $,l as n,e as q,t as x,b as S}from"./index-D8GvWgwI.js";const H={class:"flex relative main-container pt-4"},J={class:"flex-grow-1 content-area"},K={key:0,class:"w-full flex mt-8 justify-content-center"},Q={key:1,class:"flex flex-column"},X={class:"flex flex-column align-items-center mb-4"},Y={key:0,class:"text-center p-4 surface-200 border-round"},Z={key:1,class:"flex flex-column"},ee={class:"flex"},te={class:"flex-grow-1"},se={class:"text-lg font-bold mb-2"},ae={key:0,class:"text-xs ml-2"},oe={class:"text-sm mb-2"},re={key:0,class:"text-xs text-500"},le={__name:"GuidesFeed",setup(ie){const C=V(),T=z(),B=M(),D=R(),d=n([]),f=n(!0),h=n([]),{isMobile:G}=j(),b=n("strengths"),m=n("community"),p=n([]),y=n([]),F=async()=>{try{const[t]=await Promise.all([T.pb.collection("guides").getList(1,500,{filter:"PartOfPaidCourse = false",expand:"tags",sort:"-created"}),L()]);d.value=((t==null?void 0:t.items)||[]).filter(Boolean).map(e=>{var a,o;return{...e,tagName:((o=(a=e.expand)==null?void 0:a.tags)==null?void 0:o.name)||null,created:e.created||new Date().toISOString(),review_score:e.review_score||0}}),f.value=!1}catch(t){console.error("Error loading data:",t),d.value=[],f.value=!1}},L=async()=>{try{const t=await B.fetchTags();h.value=(t||[]).map(e=>e==null?void 0:e.name).filter(Boolean)}catch(t){console.error("Error fetching tags:",t),D.add({severity:"error",summary:"Couldn't load tags",detail:"Tag list failed to load. Try refreshing.",life:5e3}),h.value=[]}},w=q(()=>(d.value||[]).filter(e=>!!e).filter(e=>{const a=!!(e!=null&&e.verified);if(m.value==="official"&&!a||m.value==="community"&&a)return!1;const o=(e==null?void 0:e.tagName)||null;return!(p.value.length&&!p.value.includes(o)||y.value.includes(o))}).sort((e,a)=>{const o=new Date((e==null?void 0:e.created)||0),v=new Date((a==null?void 0:a.created)||0),_=(e==null?void 0:e.review_score)||0,r=(a==null?void 0:a.review_score)||0;switch(b.value){case"dateSubmitted":return v-o;case"strengths":return r-_;default:return 0}})),N=()=>{p.value=[],y.value=[],b.value="strengths",m.value="official"},O=t=>{C.push({name:"guide_from_search",params:{id:t}})},P=(t,e)=>(t==null?void 0:t.length)>e?t.substring(0,e)+"...":t||"";return A(F),(t,e)=>{const a=u("ProgressSpinner"),o=u("Button"),v=u("RouterLink"),_=u("Card");return l(),i("div",{class:W(["guides-feed__wrapper",$(G)?"guides-feed__wrapper--mobile":""])},[s("div",H,[s("div",J,[e[4]||(e[4]=s("h1",{class:"text-2xl font-bold mb-4 m-0"},[s("i",{class:"pi pi-book",style:{"font-size":"20px","margin-right":"10px"}}),g("Guides")],-1)),e[5]||(e[5]=s("p",{class:"mb-4"},"Learn how to do Alignment Research",-1)),f.value?(l(),i("div",K,[c(a,{style:{width:"10rem",height:"10rem"},strokeWidth:"4",animationDuration:"1s","aria-label":"Loading Guides"})])):(l(),i("div",Q,[s("span",X,[c(v,{class:"w-full",to:"/submit_guide"},{default:k(()=>[c(o,{label:"Submit A Guide",class:"w-full custom-button"})]),_:1})]),w.value.length===0?(l(),i("div",Y,[e[0]||(e[0]=s("i",{class:"pi pi-info-circle text-3xl text-500 mb-3"},null,-1)),e[1]||(e[1]=s("p",null,"No guides match your current filters.",-1)),c(o,{label:"Clear Filters",onClick:N,class:"mt-2 custom-button",outlined:""})])):(l(),i("div",Z,[(l(!0),i(I,null,U(w.value,r=>(l(),i("div",{key:r.id,class:"w-full mb-4"},[c(_,{class:"guide-card cursor-pointer",onClick:ne=>O(r.id)},{content:k(()=>[s("div",ee,[s("div",te,[s("h3",se,[g(x(r.title)+" ",1),r.verified?(l(),i("span",ae,[...e[2]||(e[2]=[s("i",{class:"pi pi-verified"},null,-1),g(" Official ",-1)])])):S("",!0)]),s("p",oe,x(P(r.description,100)),1),r.attribution?(l(),i("p",re,"By "+x(r.attribution),1)):S("",!0)]),e[3]||(e[3]=s("div",{class:"ml-3 guide-image-container"},[s("div",{class:"guide-image guide-image-default"},[s("div",{class:"guide-image-content"},[s("i",{class:"pi pi-lightbulb"}),s("span",{class:"guide-image-text"},"Learn")])])],-1))])]),_:2},1032,["onClick"])]))),128))]))]))]),e[6]||(e[6]=s("div",{class:"sidebar border-left-1 surface-section"},null,-1))])],2)}}},ue=E(le,[["__scopeId","data-v-bb5ccf85"]]);export{ue 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.