PageSourceSearch

https://slantapp.ai/assets/ChainExplorer-C8wBNT7U.js

js slantapp.ai collected 2026-10-05 15:05:30 UTC 15,718 bytes, 7 lines download raw bytes

1import{aq as Y,r as h,u as _,q as U,W as S,j as e,B as L,a7 as B,o as G,b_ as P,a8 as J,a4 as X,M as I,d as ee,C as R,aA as c,K as z,a as D,Z as te,aM as q,U as M,a6 as ae,aY as se,aL as re,az as le,O as A,N as ie,aa as de,A as ne,v as oe,w as ce,x as me,I as xe}from"./index-tc5-nNLC.js";import{S as F,a as V,b as E,c as K,d as l}from"./select-Bsa-6vNv.js";import{T as ue,a as he,b as g,c as j}from"./tabs-D2OfY7RH.js";import{C as pe}from"./ChainCreateModal-DzbH-Ue8.js";import{L as b}from"./link-BigN4W0t.js";import{F as ge}from"./filter-DmG6gd0Q.js";import{I as je}from"./image-CUhS0kqX.js";import{G as O}from"./globe-CrY5Q3gB.js";import{C as be}from"./crown-BaX0qJx5.js";import{L as ve}from"./landmark-BkbBMcHc.js";import{U as fe}from"./utensils-DFWiThh_.js";import{P as ye}from"./pin-CfN4v5O6.js";import"./index-C-y5wYFI.js";import"./chevron-down-DOFZ7rzv.js";import"./chevron-up-1gTexUQn.js";import"./zod-Bu1KJ1kD.js";import"./alert-dialog-BhS3-18U.js";import"./form-BdD-KO2h.js";import"./label-MwGx_WS4.js";import"./textarea-DN2rY_yY.js";import"./switch-B37nBmXq.js";import"./radio-group-DyfPIJZB.js";import"./TrackingDisclosure-78Mp8TTf.js";import"./checkbox-DUKovseV.js";import"./alert-DfCdUCbk.js";import"./index-DL2Sqs6c.js";import"./info-yYpYmMbQ.js";import"./ObjectUploader-CHjzmTJQ.js";import"./throttle-BDyZMAVR.js";import"./StopMedia-BwH1jfND.js";import"./stopMedia-Bh_Afahl.js";import"./network-BEQEgBu7.js";import"./external-link-wMXh6D17.js";import"./lock-CWiCoas5.js";import"./git-branch-BtAfSLNp.js";import"./types-BkAQ3Jcx.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Ne=Y("Trees",[["path",{d:"M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z",key:"1l6gj6"}],["path",{d:"M7 16v6",key:"1a82de"}],["path",{d:"M13 19v3",key:"13sx9i"}],["path",{d:"M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5",key:"1sj9kv"}]]),ke={adventure:le,culinary:fe,cultural:ve,nature:Ne,urban:re,budget:P,luxury:be,fan:M,sports:q,commerce:se,music:ae,travel:O,community:M,event:q,activation:te,content:je},we={adventure:"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400",culinary:"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400",cultural:"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400",nature:"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",urban:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",budget:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/30 dark:text-yellow-400",luxury:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400",fan:"bg-cyan-100 text-cyan-700 dark:bg-cyan-900/30 dark:text-cyan-400",sports:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400",commerce:"bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400",music:"bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-400",travel:"bg-sky-100 text-sky-700 dark:bg-sky-900/30 dark:text-sky-400",community:"bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400",event:"bg-rose-100 text-rose-700 dark:bg-rose-900/30 dark:text-rose-400",activation:"bg-fuchsia-100 text-fuchsia-700 dark:bg-fuchsia-900/30 dark:text-fuchsia-400",content:"bg-slate-100 text-slate-700 dark:bg-slate-900/30 dark:text-slate-400"};function Ce({chain:t}){var m,n,f,y,d;const v=(t.thread.theme?ke[t.thread.theme]:null)??b,s=(t.thread.theme?we[t.thread.theme]:null)??"bg-gray-100 text-gray-700",$=a=>a?new Date(a).toLocaleDateString("en-US",{month:"short",day:"numeric"}):"",p=(a,o)=>`${(a==null?void 0:a[0])||""}${(o==null?void 0:o[0])||""}`.toUpperCase()||"?";return e.jsx(G,{href:`/chains/${t.thread.id}`,children:e.jsxs(R,{className:"group cursor-pointer hover:shadow-lg transition-all duration-300 overflow-hidden border-2 hover:border-primary/50","data-testid":`chain-card-${t.thread.id}`,children:[t.thread.coverImageUrl&&e.jsxs("div",{className:"relative h-32 overflow-hidden",children:[e.jsx("img",{src:t.thread.coverImageUrl,alt:t.thread.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"}),e.jsxs("div",{className:"absolute bottom-2 left-2 right-2 flex items-center justify-between",children:[e.jsxs(A,{className:s,children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),t.thread.theme||"General"]}),e.jsxs(A,{variant:"secondary",className:"bg-black/50 text-white",children:[e.jsx(b,{className:"w-3 h-3 mr-1"}),t.thread.nodeCount>0?`${t.thread.nodeCount} ${t.thread.nodeCount===1?"node":"nodes"}`:"New"]})]})]}),e.jsx(z,{className:t.thread.coverImageUrl?"pt-3":"",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(ie,{className:"text-lg line-clamp-1 group-hover:text-primary transition-colors",children:t.thread.title}),t.thread.description&&e.jsx(de,{className:"line-clamp-2 mt-1",children:t.thread.description})]}),!t.thread.coverImageUrl&&e.jsxs(A,{className:s,children:[e.jsx(v,{className:"w-3 h-3 mr-1"}),t.thread.theme||"General"]})]})}),e.jsxs(D,{className:"pt-0",children:[e.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground mb-3",children:[!t.thread.coverImageUrl&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(b,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:t.thread.nodeCount>0?`${t.thread.nodeCount} ${t.thread.nodeCount===1?"node":"nodes"}`:"New"})]}),t.thread.originLocationName&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(I,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"truncate max-w-[100px]",children:t.thread.originLocationName})]}),t.thread.countriesVisited&&t.thread.countriesVisited.length>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(O,{className:"w-3.5 h-3.5"}),e.jsxs("span",{children:[t.thread.countriesVisited.length," countries"]})]}),t.thread.totalDistance&&t.thread.totalDistance>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(ne,{className:"w-3.5 h-3.5"}
6),e.jsxs("span",{children:[t.thread.totalDistance.toLocaleString()," km"]})]})]}),(t.thread.pinEligibleCount??0)>0&&(()=>{const a=t.thread.pinEligibleCount,o=t.thread.pinBookingCount??0,i=a-o,N=i/a,x=N<=.1,k=N<=.25,u=i<=0;return e.jsxs("div",{className:`flex items-center gap-1.5 mb-2 px-2 py-1 rounded-md text-xs font-semibold
7                ${u?"bg-gray-100 text-gray-500 dark:bg-gray-800/40 dark:text-gray-500":x?"bg-red-50 text-red-600 dark:bg-red-950/30 dark:text-red-400":k?"bg-amber-50 text-amber-600 dark:bg-amber-950/30 dark:text-amber-400":"bg-purple-50 text-purple-600 dark:bg-purple-950/20 dark:text-purple-400"}`,"data-testid":`pin-scarcity-${t.thread.id}`,children:[e.jsx(ye,{className:"w-3 h-3 shrink-0"}),u?"Pin slots full":x?`Only ${i} pin slot${i===1?"":"s"} left`:k?`${i} of ${a} pin slots left`:`First ${a} travelers earn pin eligibility`]})})(),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(oe,{className:"w-6 h-6",children:[e.jsx(ce,{src:((m=t.creator)==null?void 0:m.profileImageUrl)||void 0}),e.jsx(me,{className:"text-xs",children:p((n=t.creator)==null?void 0:n.firstName,(f=t.creator)==null?void 0:f.lastName)})]}),e.jsx("span",{className:"text-sm text-muted-foreground","data-testid":`text-creator-name-${t.thread.id}`,children:(y=t.creator)!=null&&y.firstName||(d=t.creator)!=null&&d.lastName?`${t.creator.firstName??""} ${t.creator.lastName??""}`.trim():"Anonymous"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1","data-testid":`text-participant-count-${t.thread.id}`,children:[e.jsx(M,{className:"w-3 h-3"}),t.participantCount??0]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(xe,{className:"w-3 h-3"}),$(t.thread.lastActivityAt)]})]})]})]})]})})}function Se(){return e.jsxs(R,{className:"overflow-hidden",children:[e.jsx(c,{className:"h-32 w-full"}),e.jsxs(z,{children:[e.jsx(c,{className:"h-5 w-3/4"}),e.jsx(c,{className:"h-4 w-full mt-2"})]}),e.jsxs(D,{children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsx(c,{className:"h-4 w-20"}),e.jsx(c,{className:"h-4 w-20"})]}),e.jsxs("div",{className:"flex items-center justify-between mt-4 pt-2 border-t",children:[e.jsx(c,{className:"h-6 w-24"}),e.jsx(c,{className:"h-4 w-16"})]})]})]})}function ot(){const[t,v]=h.useState(""),[s,$]=h.useState("all"),[p,m]=h.useState("active"),[n,f]=h.useState("recent"),[y,d]=h.useState(!1),[,a]=_(),o=h.useCallback(r=>{d(!1),U.invalidateQueries({queryKey:["/api/chains"]}),U.invalidateQueries({queryKey:["/api/chains/discover"]}),a(`/chains/${r}`)},[a]),{data:i,isLoading:N}=S({queryKey:["/api/chains/discover",{status:"active",sortBy:"recent",limit:6}]}),{data:x,isLoading:k}=S({queryKey:["/api/chains/discover",{status:"active",search:t,theme:s!=="all"?s:void 0,sortBy:n}]}),{data:u,isLoading:Q}=S({queryKey:["/api/chains/discover",{status:"completed",search:t,theme:s!=="all"?s:void 0,sortBy:n}]}),{data:T,isLoading:W}=S({queryKey:["/api/chains/discover",{status:"all",search:t,theme:s!=="all"?s:void 0,sortBy:n}]}),Z=r=>{switch(r){case"foryou":return(i==null?void 0:i.chains)||[];case"active":return(x==null?void 0:x.chains)||[];case"completed":return(u==null?void 0:u.chains)||[];case"all":return(T==null?void 0:T.chains)||[];case"nearby":return[];default:return[]}},H=r=>{switch(r){case"foryou":return N;case"active":return k;case"completed":return Q;case"all":return W;case"nearby":return!1;default:return!1}},w=()=>{if(H(p))return e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[1,2,3,4,5,6].map(C=>e.jsx(Se,{},C))});const r=Z(p);return p==="nearby"?e.jsxs("div",{className:"text-center py-16 bg-muted/30 rounded-xl border-2 border-dashed",children:[e.jsx(I,{className:"w-16 h-16 text-muted-foreground/30 mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Nearby Chains"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-md mx-auto",children:"Enable location services to discover journeys starting near you. This feature is coming soon to your area."})]}):r.length===0?e.jsxs("div",{className:"text-center py-16","data-testid":"empty-chains-state",children:[e.jsx(b,{className:"w-16 h-16 text-muted-foreground
7/30 mx-auto mb-4"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"No chains found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:t||s!=="all"?"Try adjusting your filters or search terms.":"Be the first to start a chain and share your adventure!"}),e.jsxs(L,{"data-testid":"start-chain-button",onClick:()=>d(!0),children:[e.jsx(B,{className:"w-4 h-4 mr-2"}),"Start a Chain"]})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:r.map(C=>e.jsx(Ce,{chain:C},C.thread.id))})};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("div",{className:"relative overflow-hidden bg-gradient-to-br from-primary/10 via-background to-secondary/10 py-12 px-4",children:[e.jsx("div",{className:"absolute inset-0 bg-grid-pattern opacity-5"}),e.jsxs("div",{className:"max-w-6xl mx-auto relative",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 mb-4",children:[e.jsx(b,{className:"w-8 h-8 text-primary"}),e.jsx("h1",{className:"text-3xl md:text-4xl font-bold","data-testid":"page-title",children:"Slant Chains"})]}),e.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Connected travel narratives. Accept a challenge, continue the journey, and pass the torch to the next adventurer."})]}),e.jsx("div",{className:"flex justify-center mb-4",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[e.jsxs(L,{onClick:()=>d(!0),"data-testid":"header-start-chain-button",size:"lg",className:"px-8 font-semibold",children:[e.jsx(B,{className:"w-4 h-4 mr-2"}),"Slant It"]}),e.jsx(G,{href:"/credits",children:e.jsxs(L,{variant:"outline",size:"lg",className:"border-primary/40","data-testid":"header-credit-store-link",children:[e.jsx(P,{className:"mr-2 h-4 w-4"}),"Get chain credits"]})})]})}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-4 max-w-3xl mx-auto",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(J,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(X,{placeholder:"Search chains...",value:t,onChange:r=>v(r.target.value),className:"pl-10","data-testid":"search-chains-input"})]}),e.jsxs(F,{value:s,onValueChange:$,children:[e.jsxs(V,{className:"w-full md:w-40","data-testid":"theme-filter",children:[e.jsx(ge,{className:"w-4 h-4 mr-2"}),e.jsx(E,{placeholder:"Theme"})]}),e.jsxs(K,{children:[e.jsx(l,{value:"all",children:"All Themes"}),e.jsx(l,{value:"adventure",children:"Adventure"}),e.jsx(l,{value:"culinary",children:"Culinary"}),e.jsx(l,{value:"cultural",children:"Cultural"}),e.jsx(l,{value:"nature",children:"Nature"}),e.jsx(l,{value:"urban",children:"Urban"}),e.jsx(l,{value:"budget",children:"Budget"}),e.jsx(l,{value:"luxury",children:"Luxury"})]})]}),e.jsxs(F,{value:n,onValueChange:f,children:[e.jsx(V,{className:"w-full md:w-36","data-testid":"sort-filter",children:e.jsx(E,{placeholder:"Sort by"})}),e.jsxs(K,{children:[e.jsx(l,{value:"recent",children:"Most Recent"}),e.jsx(l,{value:"popular",children:"Most Popular"})]})]})]})]})]}),e.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-8",children:[e.jsxs(ue,{defaultValue:"for-you",className:"mb-8",children:[e.jsxs(he,{className:"grid w-full max-w-xl mx-auto grid-cols-5 mb-6",children:[e.jsx(g,{value:"for-you","data-testid":"tab-for-you",children:"For You"}),e.jsx(g,{value:"nearby","data-testid":"tab-nearby",children:"Nearby"}),e.jsx(g,{value:"active","data-testid":"tab-active",onClick:()=>m("active"),children:"Active"}),e.jsx(g,{value:"completed","data-testid":"tab-completed",onClick:()=>m("completed"),children:"Completed"}),e.jsx(g,{value:"all","data-testid":"tab-all",onClick:()=>m("all"),children:"All"})]}),e.jsx(j,{value:"for-you",children:w()}),e.jsx(j,{value:"nearby",children:e.jsxs("div",{className:"text-center py-8 text-muted-foreground","data-testid":"nearby-chains-placeholder",children:[e.jsx(I,{className:"w-12 h-12 mx-auto mb-3 text-muted-foreground/40"}),e.jsx("p",{className:"font-medium",children:"Enable location to see chains near you"}),e.jsx("p",{className:"text-sm mt-1",children:"We'll show you adventures starting in y
7our current city."})]})}),e.jsx(j,{value:"active",children:w()}),e.jsx(j,{value:"completed",children:w()}),e.jsx(j,{value:"all",children:w()})]}),e.jsx("div",{className:"mt-12 text-center",children:e.jsxs("div",{className:"inline-flex items-center gap-4 p-6 rounded-2xl bg-gradient-to-r from-primary/10 to-secondary/10 border-2 border-dashed",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"font-semibold mb-1",children:"Ready to start your own chain?"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Create a challenge from your current location and watch your story travel the world."})]}),e.jsxs(L,{size:"lg","data-testid":"cta-start-chain",onClick:()=>d(!0),children:["Start a Chain",e.jsx(ee,{className:"w-4 h-4 ml-1"})]})]})})]}),e.jsx(pe,{open:y,onOpenChange:d,mode:"create",locationName:"Current Location",onSuccess:o})]})}export{ot 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.