PageSourceSearch

https://cardanofeed.com/assets/Projects-Df61WBv9.js

js cardanofeed.com collected 2026-10-04 01:46:28 UTC 30,000 bytes, 2 lines download raw bytes

1import{r as o,j as e,a as b,b as Ye,u as J,e as Je}from"./vendor-query-BEIJVMdj.js";import{a8 as U,ag as et,ai as tt,a7 as H,aa as w,aj as je,a6 as rt,ad as we,a9 as st,ap as at,aq as ot,ar as nt,f as q,O as I,n as C,ay as xe,az as pe,aA as he,z as Ne,T as ye,P as it,aZ as lt,a_ as Ce,aU as ct,a$ as dt,b0 as mt,j as ut,k as xt,u as ge,L as fe,H as pt,x as ht,B as F,S as ee,a as te,b as re,d as se,e as S,m as gt,I as ft,X as ae,y as vt,E as bt,V as jt}from"./index-k-dLgr5f.js";import{L as O,b as wt}from"./vendor-react-B5CYxRoX.js";import{D as Nt,a as yt,b as Ct,c as Pt}from"./dialog-C0fvNp9A.js";import{P as St}from"./ProjectForm-Q-Dtp7mn.js";import{G as ne}from"./globe-DkM-M5n-.js";import{P as _t}from"./plus-BcJu95cq.js";import{B as Tt}from"./bookmark-ByVDU6rL.js";import{P as kt}from"./pencil-BQIJQjyr.js";import{T as Et}from"./trash-2-C8ssCHb5.js";import"./vendor-firebase-DGyKCgmH.js";import"./vendor-datefns-CwLhcdpR.js";import"./vendor-carousel-CFO2eJHO.js";import"./label-B0zYWyxm.js";import"./switch-vcmF2Omp.js";import"./RichTextEditor-Dql79zT-.js";import"./index-Dh4i1-J3.js";import"./textarea-nTNnurWm.js";import"./image-LgnEeXns.js";import"./circle-check-CG2RY6h0.js";import"./shield-alert-BfvgDwzp.js";import"./info-U6iejFDc.js";import"./save-C-i20vMp.js";var oe,W="HoverCard",[Pe]=we(W,[je]),K=je(),[Rt,le]=Pe(W),Se=t=>{const{__scopeHoverCard:a,children:l,open:n,defaultOpen:s,onOpenChange:i,openDelay:m=700,closeDelay:d=300}=t,c=K(a),u=o.useRef(0),x=o.useRef(0),h=o.useRef(!1),f=o.useRef(!1),[T,p]=U({prop:n,defaultProp:s??!1,onChange:i,caller:W}),P=o.useCallback(()=>{clearTimeout(x.current),u.current=window.setTimeout(()=>p(!0),m)},[m,p]),v=o.useCallback(()=>{clearTimeout(u.current),!h.current&&!f.current&&(x.current=window.setTimeout(()=>p(!1),d))},[d,p]),L=o.useCallback(()=>p(!1),[p]);return o.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(x.current)},[]),e.jsx(Rt,{scope:a,open:T,onOpenChange:p,onOpen:P,onClose:v,onDismiss:L,hasSelectionRef:h,isPointerDownOnContentRef:f,children:e.jsx(et,{...c,children:l})})};Se.displayName=W;var _e="HoverCardTrigger",Te=o.forwardRef((t,a)=>{const{__scopeHoverCard:l,...n}=t,s=le(_e,l),i=K(l);return e.jsx(tt,{asChild:!0,...i,children:e.jsx(H.a,{"data-state":s.open?"open":"closed",...n,ref:a,onPointerEnter:w(t.onPointerEnter,V(s.onOpen)),onPointerLeave:w(t.onPointerLeave,V(s.onClose)),onFocus:w(t.onFocus,s.onOpen),onBlur:w(t.onBlur,s.onClose),onTouchStart:w(t.onTouchStart,m=>m.preventDefault())})})});Te.displayName=_e;var Ft="HoverCardPortal",[fr,Ot]=Pe(Ft,{forceMount:void 0}),z="HoverCardContent",ke=o.forwardRef((t,a)=>{const l=Ot(z,t.__scopeHoverCard),{forceMount:n=l.forceMount,...s}=t,i=le(z,t.__scopeHoverCard);return e.jsx(rt,{present:n||i.open,children:e.jsx(At,{"data-state":i.open?"open":"closed",...s,onPointerEnter:w(t.onPointerEnter,V(i.onOpen)),onPointerLeave:w(t.onPointerLeave,V(i.onClose)),ref:a})})});ke.displayName=z;var At=o.forwardRef((t,a)=>{const{__scopeHoverCard:l,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:m,...d}=t,c=le(z,l),u=K(l),x=o.useRef(null),h=st(a,x),[f,T]=o.useState(!1);return o.useEffect(()=>{if(f){const p=document.body;return oe=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=oe,p.style.webkitUserSelect=oe}}},[f]),o.useEffect(()=>{if(x.current){const p=()=>{T(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())==null?void 0:v.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),o.useEffect(()=>{x.current&&It(x.current).forEach(P=>P.setAttribute("tabindex","-1"))}),e.jsx(at,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:m,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:w(i,p=>{p.preventDefault()}),onDismiss:c.onDismiss,children:e.jsx(ot,{...u,...d,onPointerDown:w(d.onPointerDown,p=>{p.currentTarget.contains(p.target)&&T(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:h,style:{...d.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Dt="HoverCardArrow",Gt=o.forwardRef((t,a)=>{const{__scopeHoverCard:l,...n}=t,s=K(l);return e.jsx(nt,{...s,...n,ref:a})});Gt.displayName=Dt;function V(t){return a=>a.pointerType==="touch"?void 0:t()}function It(t){const a=[],l=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;l.nextNode();)a.push(l.currentNode);return a}var Lt=Se,$t=Te,Ee=ke;const Mt=Lt,Ht=$t,Re=o.forwardRef(({className:t,align:a="center",sideOffset:l=4,...n},s)=>e.jsx(Ee,{ref:s,align:a,sideOffset:l,className:q("z-50 w-64 roun
1ded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));Re.displayName=Ee.displayName;const ve={DeFi:"from-blue-500/10 via-blue-500/5 to-transparent border-blue-500/20",NFT:"from-purple-500/10 via-purple-500/5 to-transparent border-purple-500/20",Wallets:"from-emerald-500/10 via-emerald-500/5 to-transparent border-emerald-500/20",DEX:"from-cyan-500/10 via-cyan-500/5 to-transparent border-cyan-500/20",Launchpads:"from-amber-500/10 via-amber-500/5 to-transparent border-amber-500/20",Gaming:"from-rose-500/10 via-rose-500/5 to-transparent border-rose-500/20",Infrastructure:"from-slate-500/10 via-slate-500/5 to-transparent border-slate-500/20",Tools:"from-indigo-500/10 via-indigo-500/5 to-transparent border-indigo-500/20",Education:"from-orange-500/10 via-orange-500/5 to-transparent border-orange-500/20",Social:"from-pink-500/10 via-pink-500/5 to-transparent border-pink-500/20",AI:"from-fuchsia-500/10 via-fuchsia-500/5 to-transparent border-fuchsia-500/20",Oracles:"from-yellow-500/10 via-yellow-500/5 to-transparent border-yellow-500/20",default:"from-primary/10 via-primary/5 to-transparent border-primary/20"},Fe=o.memo(({project:t})=>e.jsxs(Mt,{openDelay:200,children:[e.jsx(Ht,{asChild:!0,children:e.jsx(O,{to:`/projects/${t.slug}`,className:"relative group transition-transform duration-300 hover:scale-110 active:scale-95",children:e.jsxs("div",{className:"relative p-0.5",children:[e.jsxs(xe,{className:"h-12 w-12 border border-border shadow-sm group-hover:border-primary/50 transition-colors bg-white dark:bg-muted/30 p-1",children:[e.jsx(pe,{src:t.logo_url||"",alt:t.name,className:"object-contain",loading:"lazy"}),e.jsx(he,{className:"bg-muted text-[10px] font-bold text-muted-foreground/50",children:t.name.substring(0,2).toUpperCase()})]}),e.jsxs("div",{className:"absolute -top-0.5 -right-0.5 flex items-center justify-center",children:[e.jsx("span",{className:`h-2.5 w-2.5 rounded-full border-2 border-card ${t.is_live?"bg-emerald-500 shadow-[0_0_8px_rgba(16,185,129,0.5)]":"bg-destructive shadow-[0_0_8px_rgba(239,68,68,0.5)]"}`}),t.is_live&&e.jsx("span",{className:"absolute h-2.5 w-2.5 rounded-full bg-emerald-500 animate-ping opacity-75"})]})]})})}),e.jsx(Re,{side:"top",className:"w-80 bg-background/95 backdrop-blur-xl border border-border/50 shadow-2xl p-5 animate-in fade-in zoom-in duration-200",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs(xe,{className:"h-14 w-14 border border-border/50 shadow-inner bg-white dark:bg-muted/30 p-1.5",children:[e.jsx(pe,{src:t.logo_url||"",alt:t.name,className:"object-contain"}),e.jsx(he,{children:t.name.substring(0,2).toUpperCase()})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-1.5 mb-1",children:e.jsx("h4",{className:"font-display font-bold text-base truncate",children:t.name})}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.ticker&&e.jsxs(C,{variant:"outline",className:"text-[10px] h-4 font-mono",children:["$",t.ticker]}),e.jsx(C,{className:`text-[9px] h-4 uppercase font-bold ${t.is_live?"bg-emerald-500/10 text-emerald-500 hover:bg-emerald-500/20 border-emerald-500/20":"bg-destructive/10 text-destructive hover:bg-destructive/20 border-destructive/20"}`,children:t.is_live?"Online":"Offline"}),e.jsxs("div",{className:"flex items-center gap-1 text-[9px] font-bold text-muted-foreground/70 ml-1",children:[e.jsx(Ne,{className:"h-2.5 w-2.5"}),t.views||0]})]})]})]}),t.excerpt&&e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed line-clamp-3 italic",children:['"',t.excerpt,'"']}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[e.jsxs("div",{className:"flex gap-3",children:[t.website&&e.jsx(ne,{className:"h-4 w-4 text-muted-foreground hover:text-primary transition-colors"}),t.twitter&&e.jsx(ye,{className:"h-4 w-4 text-muted-foreground hover:text-sky-400 transition-colors"})]}),e.jsxs(O,{to:`/projects/${t.slug}`,className:"text-[10px] font-bold text-primary flex items-center gap-1 hover:gap-2 transition-all",children:["View Details ",e.jsx(it,{className:"h-3 w-3"})]})]})]})})]}));Fe.displayName="ProjectIcon";const Oe=o.memo(({group:t,columnCount:a,getGradient:l})=>{const n=o.useMemo(()=>
1{if(a===1)return{col:"col-span-1",row:"row-span-1",padding:"p-6",title:"text-xl"};const s=t.projects.length,i=["DeFi","Wallets","DEX","Infrastructure","Marketplaces"].includes(t.name);return i&&s>=12||s>=20?{col:"md:col-span-2",row:"md:row-span-2",padding:"p-8",title:"text-3xl"}:s>=8||i?{col:"md:col-span-2",row:"md:row-span-1",padding:"p-7",title:"text-2xl"}:s>=4?{col:"md:col-span-1",row:"md:row-span-2",padding:"p-6",title:"text-xl"}:{col:"md:col-span-1",row:"md:row-span-1",padding:"p-5",title:"text-lg"}},[t.projects.length,t.name,a]);return e.jsxs("div",{className:`flex flex-col bg-card border rounded-3xl shadow-sm transition-all hover:shadow-xl hover:-translate-y-1 bg-gradient-to-br ${l(t.name)} animate-in fade-in zoom-in duration-500 border-white/10 group
2        ${n.col} ${n.row} ${n.padding}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h3",{className:`font-display font-black text-foreground tracking-tight group-hover:text-primary transition-colors ${n.title}`,children:t.name}),e.jsx(C,{variant:"secondary",className:"bg-background/40 backdrop-blur-md border-white/10 text-[10px] font-black uppercase tracking-widest shrink-0",children:(t.projects||[]).length})]}),e.jsx("div",{className:"flex flex-wrap gap-3 items-start content-start flex-1",children:(t.projects||[]).map(s=>e.jsx(Fe,{project:s},s.id))})]})});Oe.displayName="CategoryBox";const zt=({projects:t})=>{const[a,l]=o.useState(0),[n,s]=o.useState(3);o.useEffect(()=>{const c=()=>{const u=window.innerWidth;u<768?s(1):u<1024?s(2):u<1440?s(3):u<1920?s(4):s(5)};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[]);const i=o.useMemo(()=>{const c={};return t.forEach(u=>{var h;const x=((h=u.project_categories)==null?void 0:h.name)||"Other";c[x]||(c[x]=[]),c[x].push(u)}),Object.keys(c).map(u=>({name:u,projects:c[u].sort((x,h)=>x.is_live&&!h.is_live?-1:!x.is_live&&h.is_live?1:x.name.localeCompare(h.name))})).sort((u,x)=>{const h=["DeFi","Wallets","DEX","Infrastructure"].includes(u.name),f=["DeFi","Wallets","DEX","Infrastructure"].includes(x.name);return h&&!f?-1:!h&&f?1:x.projects.length-u.projects.length})},[t]),m=i.length;o.useEffect(()=>{if(a<m){const c=requestAnimationFrame(()=>{l(u=>Math.min(u+3,m))});return()=>cancelAnimationFrame(c)}},[a,m]);const d=c=>ve[c]||ve.default;return e.jsxs("div",{className:"space-y-10 py-6",children:[e.jsx("div",{className:"grid gap-6 grid-flow-dense auto-rows-[minmax(180px,auto)]",style:{gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`},children:i.map((c,u)=>u>=a?e.jsx("div",{className:"h-60 bg-muted/10 rounded-3xl border border-dashed border-border/50 animate-pulse"},`${c.name}-placeholder`):e.jsx(Oe,{group:c,columnCount:n,getGradient:d},c.name))}),m===0&&e.jsxs("div",{className:"text-center py-24 bg-card border border-dashed border-border rounded-3xl shadow-inner",children:[e.jsx(I,{className:"h-16 w-16 text-muted-foreground/10 mx-auto mb-6"}),e.jsx("p",{className:"text-muted-foreground font-medium",children:"No projects found to display on the map."})]})]})};var Ae="Toggle",ce=o.forwardRef((t,a)=>
2{const{pressed:l,defaultPressed:n,onPressedChange:s,...i}=t,[m,d]=U({prop:l,onChange:s,defaultProp:n??!1,caller:Ae});return e.jsx(H.button,{type:"button","aria-pressed":m,"data-state":m?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:a,onClick:w(t.onClick,()=>{t.disabled||d(!m)})})});ce.displayName=Ae;var De=ce,_="ToggleGroup",[Ge]=we(_,[Ce]),Ie=Ce(),de=b.forwardRef((t,a)=>{const{type:l,...n}=t;if(l==="single"){const s=n;return e.jsx(Vt,{...s,ref:a})}if(l==="multiple"){const s=n;return e.jsx(Bt,{...s,ref:a})}throw new Error(`Missing prop \`type\` expected on \`${_}\``)});de.displayName=_;var[Le,$e]=Ge(_),Vt=b.forwardRef((t,a)=>{const{value:l,defaultValue:n,onValueChange:s=()=>{},...i}=t,[m,d]=U({prop:l,defaultProp:n??"",onChange:s,caller:_});return e.jsx(Le,{scope:t.__scopeToggleGroup,type:"single",value:b.useMemo(()=>m?[m]:[],[m]),onItemActivate:d,onItemDeactivate:b.useCallback(()=>d(""),[d]),children:e.jsx(Me,{...i,ref:a})})}),Bt=b.forwardRef((t,a)=>{const{value:l,defaultValue:n,onValueChange:s=()=>{},...i}=t,[m,d]=U({prop:l,defaultProp:n??[],onChange:s,caller:_}),c=b.useCallback(x=>d((h=[])=>[...h,x]),[d]),u=b.useCallback(x=>d((h=[])=>h.filter(f=>f!==x)),[d]);return e.jsx(Le,{scope:t.__scopeToggleGroup,type:"multiple",value:m,onItemActivate:c,onItemDeactivate:u,children:e.jsx(Me,{...i,ref:a})})});de.displayName=_;var[Ut,qt]=Ge(_),Me=b.forwardRef((t,a)=>{const{__scopeToggleGroup:l,disabled:n=!1,rovingFocus:s=!0,orientation:i,dir:m,loop:d=!0,...c}=t,u=Ie(l),x=ct(m),h={role:"group",dir:x,...c};return e.jsx(Ut,{scope:l,rovingFocus:s,disabled:n,children:s?e.jsx(dt,{asChild:!0,...u,orientation:i,dir:x,loop:d,children:e.jsx(H.div,{...h,ref:a})}):e.jsx(H.div,{...h,ref:a})})}),B="ToggleGroupItem",He=b.forwardRef((t,a)=>{const l=$e(B,t.__scopeToggleGroup),n=qt(B,t.__scopeToggleGroup),s=Ie(t.__scopeToggleGroup),i=l.value.includes(t.value),m=n.disabled||t.disabled,d={...t,pressed:i,disabled:m},c=b.useRef(null);return n.rovingFocus?e.jsx(lt,{asChild:!0,...s,focusable:!m,active:i,ref:c,children:e.jsx(be,{...d,ref:a})}):e.jsx(be,{...d,ref:a})});He.displayName=B;var be=b.forwardRef((t,a)=>{const{__scopeToggleGroup:l,value:n,...s}=t,i=$e(B,l),m={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},d=i.type==="single"?m:void 0;
2return e.jsx(ce,{...d,...s,ref:a,onPressedChange:c=>{c?i.onItemActivate(n):i.onItemDeactivate(n)}})}),ze=de,Ve=He;const Be=mt("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),Wt=o.forwardRef(({className:t,variant:a,size:l,...n},s)=>e.jsx(De,{ref:s,className:q(Be({variant:a,size:l,className:t})),...n}));Wt.displayName=De.displayName;const Ue=o.createContext({size:"default",variant:"default"}),qe=o.forwardRef(({className:t,variant:a,size:l,children:n,...s},i)=>e.jsx(ze,{ref:i,className:q("flex items-center justify-center gap-1",t),...s,children:e.jsx(Ue.Provider,{value:{variant:a,size:l},children:n})}));qe.displayName=ze.displayName;const ie=o.forwardRef(({className:t,children:a,variant:l,size:n,...s},i)=>{const m=o.useContext(Ue);return e.jsx(Ve,{ref:i,className:q(Be({variant:m.variant||l,size:m.size||n}),t),...s,children:a})});ie.displayName=Ve.displayName;const G=100,vr=()=>{var ue;const{user:t,isAdmin:a,isLoading:l,getIdToken:n}=ut(),s=Ye(),[i,m]=wt(),[d,c]=o.useState(i.get("lang")),[u,x]=o.useState(""),{data:h}=xt();o.useEffect(()=>{h&&(document.title=`Projects | ${h.site_name}`)},[h]),o.useEffect(()=>{const r=i.get("lang");r!==d&&c(r)},[i,d]);const f=r=>{c(r);const g=new URLSearchParams(i);r?g.set("lang",r):g.delete("lang"),m(g)},{data:T}=J({queryKey:["language-counts-projects"],queryFn:async()=>{try{const r=await fetch("/api/stats/languages");if(!r.ok)throw new Error("Failed to fetch language stats");const g=await r.json();return(Array.isArray(g)?g:[]).map(R=>({code:R.language,count:parseInt(String(R.count))}))}catch{return[]}}}),[p,P]=o.useState(1),[v,L]=o.useState("all"),[N,Q]=o.useState("all"),[j,A]=o.useState(i.get("category")||"all"),[$,We]=o.useState("newest"),[k,Ke]=o.useState("grid"),[Qe,M]=o.useState(!1),[X,me]=o.useState(null);o.useEffect(()=>{const r=i.get("lang");r!==d&&c(r);const g=i.get("category");g&&g!==j?A(g):!g&&j!=="all"&&A("all")},[i,d,j]),o.useEffect(()=>{P(1)},[u,v,N,j,$]);const{data:E}=J({queryKey:["project-categories"],queryFn:async()=>{const r=await fetch("/api/project-categories");if(!r.ok)throw new Error("Failed to fetch project categories");return r.json()}}),{data:y,isLoading:Xe}=J({queryKey:["public-projects-list",u,v,N,j,$,d,p,k],queryFn:async()=>{const r=new URLSearchParams({sortBy:$,verified:String(v==="verified"),promoted:String(v==="promoted"),isLive:N==="live"?"true":N==="offline"?"false":"all",category:j,limit:k==="map"?"5000":String(G),offset:k==="map"?"0":String((p-1)*G)});u&&r.set("search",u),d&&r.set("lang",d);const g=await fetch(`/api/projects?${r.toString()}`);if(!g.ok)throw new Error("Failed to fetch projects");return g.json()}}),Ze=Je({mutationFn:async r=>{const g=await(t==null?void 0:t.getIdToken());if(!(await fetch(`/api/projects/${r}`,{method:"DELETE",headers:{Authorization:`Bearer ${g}`}})).ok)throw new Error("Failed to delete project")},onSuccess:()=>{ge.success("Project deleted"),s.invalidateQueries({queryKey:["admin-projects"]})},onError:r=>ge.error(r.message)});if(l)return e.jsx("div",{className:"flex min-h-screen items-center justify-center",children:e.jsx(fe,{className:"h-8 w-8 animate-spin text-primary"})});const D=(y==null?void 0:y.total)||0,Z=(y==null?void 0:y.data)||[];return e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx(pt,{languages:(T||[]).map(r=>r.code),selectedLanguage:d,onLanguageChange:f,searchQuery:u,onSearchChange:x}),e.jsxs("main",{className:"flex-1 container mx-auto px-4 pt-4 pb-8",children:[e.jsx("div",{className:"flex justify-center mb-8",children:e.jsx(ht,{type:"superBanner"})}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6 mb-2",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-4xl font-display font-bold text-foreground mb-3 flex items-center gap-3",children:[e.jsx(I,{className:"h-10 w-10 text-primary"}),"Projects"]}),e.jsx("p",{className:"text-muted-foreground text-lg max-w-2xl",children:"Explore the vibrant ecosystem of projects building on Cardano. From DeFi protocols to NFT collections and developer tools."})]}),e.jsxs(F,{className:"gap-2",onClick:()=>{me(null),M(!0)},children:[e.jsx(_t,{className:"h-4 w-4"}),"Add Project"]})]}),e.jsx(Nt,{open:Qe,onOpenChange:M,children:e.jsxs(yt,{className:"max-w-4xl max-h-[90vh] p-0 flex flex-col",children:[e.jsx("div",{className:"p-6 pb-0",children:e.jsx(Ct,{children:e.jsx(Pt,{children:X?`Edit Project: ${X.name}`:"Create New Project"})})}),e.jsx(St,{project:X,onClose:()=>M(!1)})]})}),e.jsxs("div",{className:"pt-0 pb-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:gap-4 mb-6 p-2 md:p-3 bg-card border border-border rounded-lg shadow-sm",children:[e.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:e.jsxs(qe,{type:"single",value:k,onValueChange:r=>r&&Ke(r),className:"border border-border p-1 bg-background/50 rounded-md h-10 w-full",children:[e.jsxs(ie,{value:"grid",className:"flex-1 text-[10px] sm:text-xs px-2 sm:px-3 h-8 flex items-center justify-center gap-1.5 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[e.jsx(I,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden xs:inline",children:"Grid"}),e.jsx("span",{className:"hidden sm:inline",children:"View"})]}),e.jsxs(ie,{value:"map",className:"flex-1 text-[10px] sm:text-xs px-2 sm:px-3 h-8 flex items-center justify-center gap-1.5 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:[e.jsx(ne,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden xs:inline",children:"Map"}),e.jsx("span",{className:"hidden sm:inline",children:"Ecosystem"})]})]})}),e.jsx("div",{className:"w-[120px] sm:w-[160px] order-2 sm:order-none",children:e.jsxs(ee,{value:$,onValueChange:r=>We(r),children:[e.jsx(te,{className:"h-10 text-[10px] sm:text-xs px-2",children:e.jsx(re,{placeholder:"Sort by"})}),e.jsxs(se,{children:[e.jsx(S,{value:"name_asc",className:"text-xs",children:"Name (A-Z)"}),e.jsx(S,{value:"newest",className:"text-xs",children:"Newest First"}),e.jsx(S,{value:"views",className:"text-xs",children:"Most Viewed"})]})]})}),e.jsx("div",{className:"w-[calc(50%-4px)] sm:w-[180px] order-3 sm:order-none",children:e.jsxs(ee,{value:j,onValueChange:r=>{A(r);const g=new URLSearchParams(i);r!=="all"?g.set("category",r):g.delete("category"),m(g)},children:[e.jsx(te,{className:"h-10 text-[10px] sm:text-xs px-2",children:e.jsx(re,{placeholder:"Categories"})}),e.jsxs(se,{children:[e.jsx(S,{value:"all",children:"All Categories"}),E==null?void 0:E.map(r=>
2e.jsx(S,{value:r.id,className:"text-xs",children:r.name},r.id))]})]})}),e.jsx("div",{className:"w-[calc(50%-4px)] sm:w-[150px] order-4 sm:order-none",children:e.jsxs(ee,{value:N,onValueChange:r=>Q(r),children:[e.jsx(te,{className:"h-10 text-[10px] sm:text-xs px-2",children:e.jsx(re,{placeholder:"Status"})}),e.jsxs(se,{children:[e.jsx(S,{value:"all",className:"text-xs",children:"All Status"}),e.jsx(S,{value:"live",className:"text-xs",children:"Live Only"}),e.jsx(S,{value:"offline",className:"text-xs",children:"Offline Only"})]})]})})]}),e.jsxs("div",{className:"mb-6 relative group",children:[e.jsx(gt,{className:"absolute left-4 top-1/2 -translate-y-1/2 h-5 w-5 text-muted-foreground group-focus-within:text-primary transition-colors"}),e.jsx(ft,{placeholder:"Search projects by name, ticker or description...",value:u,onChange:r=>x(r.target.value),className:"pl-12 h-12 bg-card border-border/50 shadow-sm text-base focus-visible:ring-primary/20"})]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-end justify-between mb-6 px-1 gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2 overflow-x-auto pb-2 md:pb-0 no-scrollbar",children:[e.jsx("span",{className:"text-xs font-medium text-muted-foreground whitespace-nowrap",children:"Showing:"}),e.jsxs(C,{variant:"secondary",className:"text-[10px] h-5 bg-primary/10 text-primary border-primary/20",children:[D," project",D!==1?"s":""]}),(j!=="all"||v!=="all"||N!=="all")&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-3 w-[1px] bg-border mx-1"}),e.jsx("span",{className:"text-xs font-medium text-muted-foreground whitespace-nowrap",children:"Filters:"}),j!=="all"&&e.jsxs(C,{variant:"outline",className:"text-[10px] h-5 gap-1 pr-1 cursor-pointer hover:bg-destructive/10 hover:text-destructive hover:border-destructive/20 transition-colors",onClick:()=>A("all"),children:[((ue=E==null?void 0:E.find(r=>r.id===j))==null?void 0:ue.name)||"Category",e.jsx(ae,{className:"h-2.5 w-2.5"})]}),v!=="all"&&e.jsxs(C,{variant:"outline",className:"text-[10px] h-5 gap-1 pr-1 cursor-pointer hover:bg-destructive/10 hover:text-destructive hover:border-destructive/20 transition-colors",onClick:()=>L("all"),children:[v.charAt(0).toUpperCase()+v.slice(1),e.jsx(ae,{className:"h-2.5 w-2.5"})]}),N!=="all"&&e.jsxs(C,{variant:"outline",className:"text-[10px] h-5 gap-1 pr-1 cursor-pointer hover:bg-destructive/10 hover:text-destructive hover:border-destructive/20 transition-colors",onClick:()=>Q("all"),children:[N.charAt(0).toUpperCase()+N.slice(1),e.jsx(ae,{className:"h-2.5 w-2.5"})]}),e.jsx(F,{variant:"ghost",size:"sm",className:"h-5 px-2 text-[10px] text-muted-foreground hover:text-destructive",onClick:()=>{A("all"),L("all"),Q("all")},children:"Clear all"})]})]}),e.jsxs("div",{className:"text-xs text-muted-foreground/60 italic text-left md:text-right whitespace-nowrap overflow-hidden text-ellipsis shrink-0",children:[e.jsx("span",{className:"font-bold text-foreground/50 not-italic uppercase text-[10px] tracking-wider",children:"Status Methodology:"})," Official website check every 24h. Online, Slow or Offline."]})]}),Xe?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx(fe,{className:"h-10 w-10 animate-spin text-primary"})}):k==="map"?e.jsx(zt,{projects:(y==null?void 0:y.data)||[]}):Z&&Z.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:Z.map(r=>{var g,R;return e.jsxs("div",{className:"bg-card border border-border rounded-xl p-5 hover:shadow-md transition-all group overflow-hidden relative",children:[e.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-1.5",title:r.is_live?"Projeto Online":`Problema detectado: ${r.status_error||"Offline"}`,children:[e.jsx("span",{className:`h-2 w-2 rounded-full ${r.is_live?"bg-emerald-500 animate-pulse shadow-[0_0_8px_rgba(16,185,129,0.5)]":"bg-destructive shadow-[0_0_8px_rgba(239,68,68,0.5)]"}`}),e.jsx("span",{className:"text-[9px] font-bold uppercase tracking-tight text-muted-foreground/70",children:r.is_live?"Live":(g=r.status_error)!=null&&g.includes("Timeout")?"Slow":"Offline"}),e.jsx("div",{className:"h-2 w-[1px] bg-border mx-0.5"}),e.jsxs("div",{className:"flex items-center gap-1 text-[9px] font-bold text-muted-foreground
2/70",children:[e.jsx(Ne,{className:"h-2.5 w-2.5"}),r.views||0]})]}),e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx(O,{to:`/projects/${r.slug}`,className:"w-14 h-14 rounded-lg bg-muted flex items-center justify-center overflow-hidden shrink-0 border border-border hover:border-primary/50 transition-colors",children:r.logo_url?e.jsx("img",{src:vt(r.logo_url,100,100,"cover"),alt:r.name,className:"w-full h-full object-cover transition-transform group-hover:scale-110"}):e.jsx(I,{className:"h-6 w-6 text-muted-foreground/40"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-1.5 mb-0.5 mt-1",children:e.jsx(O,{to:`/projects/${r.slug}`,className:"font-bold text-foreground truncate hover:text-primary transition-colors block",children:r.name})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.ticker&&e.jsx(C,{variant:"secondary",className:"font-mono text-[10px] h-4",children:r.ticker}),((R=r.project_categories)==null?void 0:R.name)&&e.jsxs(C,{variant:"outline",className:"text-[10px] h-4 gap-1 font-normal bg-primary/5",children:[e.jsx(Tt,{className:"h-2.5 w-2.5 text-primary"}),r.project_categories.name]})]})]})]}),e.jsx(O,{to:`/projects/${r.slug}`,children:e.jsx("p",{className:"text-xs text-muted-foreground mt-4 line-clamp-2 min-h-[2.5rem] hover:text-foreground transition-colors cursor-pointer",children:r.excerpt||"No description provided."})}),e.jsxs("div",{className:"flex items-center gap-2 mt-4 pt-4 border-t border-border",children:[e.jsxs("div",{className:"flex-1 flex gap-2.5",children:[r.website&&e.jsx("a",{href:r.website,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-primary transition-colors",title:"Site Oficial",children:e.jsx(ne,{className:"h-4 w-4"})}),r.twitter&&e.jsx("a",{href:r.twitter,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-sky-500 transition-colors",title:"Twitter",children:e.jsx(ye,{className:"h-4 w-4"})}),e.jsx(O,{to:`/projects/${r.slug}`,className:"text-muted-foreground hover:text-primary transition-colors ml-auto",title:"Ver Detalhes",children:e.jsx(bt,{className:"h-4 w-4"})})]}),a&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Y=>{Y.preventDefault(),me(r),M(!0)},children:e.jsx(kt,{className:"h-4 w-4"})}),e.jsx(F,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:Y=>{Y.preventDefault(),Ze.mutate(r.id)},children:e.jsx(Et,{className:"h-4 w-4"})})]})]})]},r.id)})}):e.jsxs("div",{className:"text-center py-20 bg-card border border-dashed border-border rounded-xl",children:[e.jsx(I,{className:"h-12 w-12 text-muted-foreground/20 mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No projects found matching your criteria."})]}),k!=="map"&&D>G&&e.jsxs("div",{className:"flex items-center justify-center gap-2 mt-8",children:[e.jsx(F,{variant:"outline",size:"sm",disabled:p===1,onClick:()=>P(r=>r-1),children:"Previous"}),e.jsxs("span",{className:"text-sm font-medium px-4",children:["Page ",p," of ",Math.
2ceil(D/G)]}),e.jsx(F,{variant:"outline",size:"sm",disabled:p===Math.ceil(D/G),onClick:()=>P(r=>r+1),children:"Next"})]})]})]}),e.jsx(jt,{})]})};export{vr 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.