PageSourceSearch

https://21rates.com/assets/sats-balance-card-BA_96fMf.js

js 21rates.com collected 2026-10-05 08:12:47 UTC 10,018 bytes, 16 lines download raw bytes

1import{e as p,r as c,p as M,s as h,j as e,x as f,E as j,b5 as V,$ as r,g as W,ae as R,af as I}from"./index-vaiBTE8b.js";import{P as x}from"./progress-BatE82QK.js";import{R as _,a as E,b as $}from"./index-CLqz_nTk.js";import{a as b}from"./index-NBAiDsKm.js";import{L as N}from"./loader-circle-CIVLUUr8.js";import{S as U}from"./sparkles-Dn0Tk7zp.js";import{P as G}from"./party-popper-By2HgPNx.js";import{L as O}from"./lock-D1xr_j5W.js";import{B as H}from"./book-open-BeK5-aqz.js";import{A as q}from"./arrow-up-right-DdNy0tls.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 z=p("ArrowDownLeft",[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]]);/**
7 * @license lucide-react v0.453.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const F=p("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/**
12 * @license lucide-react v0.453.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const K=p("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),D=_,J=E,Q=$,le=50;function de({user:l}){const[g,v]=c.useState(!1),[n,u]=c.useState(!1),[k,o]=c.useState(0);M();const{data:a,isLoading:P}=h({queryKey:["/api/user/sats-balance"],enabled:!!l,refetchInterval:3e4});c.useEffect(()=>{if(a!=null&&a.welcomeBonusJustGranted){o(0),u(!0);const t=setTimeout(()=>{const T=a.balance/30;let m=0;const w=setInterval(()=>{m+=T,m>=a.balance?(o(a.balance),clearInterval(w)):o(Math.floor(m))},1500/30);return()=>clearInterval(w)},800),i=setTimeout(()=>{u(!1)},5e3);return()=>{clearTimeout(t),clearTimeout(i)}}else(a==null?void 0:a.balance)!==void 0&&o(a.balance)},[a==null?void 0:a.welcomeBonusJustGranted,a==null?void 0:a.balance]);const{data:d,isLoading:C}=h({queryKey:["/api/user/sats-transactions"],enabled:!!l}),{data:s}=h({queryKey:["/api/user/engagement-gates"],enabled:!!l,staleTime:6e4}),A=(a==null?void 0:a.balance)||0,S=n?k:A,y=(d==null?void 0:d.transactions)||[],B=t=>t==="credit"?e.jsx(z,{className:"h-4 w-4 text-green-600"}):e.jsx(q,{className:"h-4 w-4 text-orange-600"}),L=t=>t?new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"";return P?e.jsx(f,{className:"border-0 shadow-lg",style:{background:"linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #6b2c91 100%)"},children:e.jsx(j,{className:"p-6 flex items-center justify-center min-h-[200px]",children:e.jsx(N,{className:"h-8 w-8 animate-spin text-orange-400"})})}):e.jsx(f,{className:"border-0 shadow-lg overflow-hidden relative",style:{background:"linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #6b2c91 100%)"},"data-testid":"card-sats-balance","data-sats-balance":"true",children:e.jsxs(j,{className:"p-6 flex flex-col h-full min-h-[240px]",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 bg-orange-500/20 rounded-lg",children:e.jsx(b,{className:"w-6 h-6 text-orange-400"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-lg font-bold text-white uppercase tracking-wider",children:"Sats Balance"}),e.jsx("p",{className:"text-xs text-orange-300/60 uppercase tracking-wide",children:"Your Bitcoin Earnings"})]})]}),e.jsx(b,{className:"h-16 w-16 text-orange-500/30 absolute top-4 right-4"})]}),e.jsx(V,{children:n&&e.jsxs(e.Fragment,{children:[e.jsx(r.div,{className:"absolute inset-0 pointer-events-none overflow-hidden",initial:{opacity:0}
16,animate:{opacity:1},exit:{opacity:0},children:[...Array(8)].map((t,i)=>e.jsx(r.div,{className:"absolute",initial:{x:`${40+Math.random()*20}%`,y:`${40+Math.random()*20}%`,scale:0,opacity:0},animate:{x:`${10+Math.random()*80}%`,y:`${-20+Math.random()*40}%`,scale:[0,1.5,.8,1],opacity:[0,1,1,0],rotate:[0,180,360]},transition:{duration:2,delay:.3+i*.1,ease:"easeOut"},children:e.jsx(U,{className:"h-6 w-6 text-yellow-300"})},i))}),e.jsxs(r.div,{className:"absolute top-2 left-1/2 -translate-x-1/2 bg-white text-orange-600 px-3 py-1 rounded-full shadow-lg font-semibold text-xs flex items-center gap-1 whitespace-nowrap z-10",initial:{opacity:0,y:20,scale:.8},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10},transition:{delay:.5,duration:.5,type:"spring"},children:[e.jsx(G,{className:"h-3 w-3"}),"Welcome bonus!"]})]})}),e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center py-4",children:[e.jsx(r.div,{className:"text-6xl sm:text-7xl font-bold tracking-tight",style:{background:"linear-gradient(135deg, #ff8c00 0%, #ff6b00 25%, #ffa500 50%, #ffb347 75%, #ff8c00 100%)",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text"},"data-testid":"text-sats-balance",animate:n?{scale:[1,1.2,1]}:{},transition:{duration:.6,delay:1.8},children:S.toLocaleString()}),e.jsx("div",{className:"text-xl mt-2 font-bold text-orange-300 uppercase tracking-widest",style:{textShadow:"0 2px 8px rgba(0,0,0,0.5)"},children:"SATS"}),n&&e.jsx(r.div,{className:"text-sm text-white/80 mt-2",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:2.5,duration:.5},children:"Here are 10 sats to get you started!"})]}),s&&!s.gates.allUnlocked&&e.jsxs("div",{className:"mb-3 bg-white/8 border border-white/15 rounded-lg px-3 py-2.5 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-white/80 uppercase tracking-wide",children:[e.jsx(O,{className:"h-3 w-3 text-orange-300/80"}),"Withdrawal Progress"]}),e.jsxs("div",{className:"space-y-2",children:[!s.gates.accountAgeUnlocked&&e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-white/70",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"h-3 w-3"}),"Account age"]}),e.jsxs("span",{className:"font-medium text-white/90",children:[s.progress.accountAgeDays,"/",s.thresholds.minAccountAgeDays," days"]})]}),e.jsx(x,{value:Math.min(100,s.progress.accountAgeDays/s.thresholds.minAccountAgeDays*100),className:"h-1 bg-white/20 [&>div]:bg-orange-400"})]}),!s.gates.pagesUnlocked&&e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-white/70",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(K,{className:"h-3 w-3"}),"Pages visited"]}),e.jsxs("span",{className:"font-medium text-white/90",children:[s.progress.pagesVisited,"/",s.thresholds.minPages]})]}),e.jsx(x,{value:Math.min(100,s.progress.pagesVisited/s.thresholds.minPages*100),className:"h-1 bg-white/20 [&>div]:bg-orange-400"}),e.jsxs("p",{className:"text-[10px] text-white/50",children:[s.thresholds.minPages-s.progress.pagesVisited," more page",s.thresholds.minPages-s.progress.pagesVisited===1?"":"s"," to go"]})]}),!s.gates.productPagesUnlocked&&e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs text-white/70",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(H,{className:"h-3 w-3"}),"Product pages"]}),e.jsxs("span",{className:"font-medium text-white/90",children:[s.progress.productPagesVisited,"/",s.thresholds.minProductPages]})]}),e.jsx(x,{value:Math.min(100,s.progress.productPagesVisited/s.thresholds.minProductPages*100),className:"h-1 bg-white/20 [&>div]:bg-orange-400"}),e.jsxs("p",{className:"text-[10px] text-white/50",children:[s.thresholds.minProductPages-s.progress.productPagesVisited," more product page",s.thresholds.minProductPages-s.progress.productPagesVisited===1?"":"s"," to go"]})]})]})]}),e.jsxs(D,{open:g,onOpenChange:v,className:"mt-auto",children:[e.jsx(J,{asChild:!0,children:e.jsxs(W,{variant:"ghost",size:"sm",className:"w-full text-white/90 hover:text-white hover:bg-white/10 border border-white/30 rounded-lg","data-testid":"button-toggle-history",children:[e.jsx("span",{children:"All Transactions"}),g?e.jsx(R,{className:"h-4 w-4 ml-2"}):e.jsx(I,{className:"h-4 w-4 ml-2"})]})}),e.jsx(Q,{className:"mt-3",children:e.jsx("div",{className:"bg-white/10 backdrop-blur rounded-lg p-3 max-h-60 overflow-y-auto",children:C?e.jsx("div",{className:"flex justify-center py-2",children:e.jsx(N,{className:"h-4 w-4 animate-spin text-white"})}):y.length===0?e.jsx("div",{className:"text-center text-white/70 text-sm py-2",children:"No transactions yet"}):e.jsx("div",{className:"space-y-2",children:y.map(t=>e.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-white/10","data-testid":`transaction-${t.id}`,children:[e.jsxs("div",{className:"flex items-center gap-2",children:[B(t.type),e.jsxs("div",{children:[e.jsxs("div",{className:"text-sm font-medium text-white",children:[t.type==="credit"?"+":"-",t.amount.toLocaleStr
16ing()," sats"]}),e.jsx("div",{className:"text-xs text-white/70",children:t.source==="giveaway_win"?"Giveaway Win":t.source==="withdrawal"?"Withdrawal":t.source==="welcome_bonus"?"Welcome Bonus":t.source==="refund"?"Refund":t.source==="newsletter_bonus"?"Newsletter Bonus":t.source==="daily_checkin"?"Daily Check-In":t.source==="nostr_follow_bonus"?"NOSTR Follow Bonus":t.source})]})]}),e.jsx("div",{className:"text-xs text-white/60",children:L(t.createdAt)})]},t.id))})})})]})]})})}export{F as C,K as L,le as R,de as S};

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.