1import{j as e}from"./vendor-query-C4QtGD8R.js";import{r as l}from"./vendor-web3-mi09CyaI.js";import{c as P,i as S}from"./index-ygc0PZs_.js";import{m as L}from"./vendor-motion-DKYw7S3A.js";import"./vendor-charts-DZJdoORE.js";import"./vendor-ui-BBZYHNnl.js";import"./vendor-supabase-DauP3j-J.js";import"./vendor-react-C2ZpyAAy.js";/** 2 * @license lucide-react v0.462.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 V=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"}]]),b=[{symbol:"BTC",price:65e3},{symbol:"ETH",price:3200},{symbol:"SOL",price:150},{symbol:"BNB",price:580}],W=()=>{const[i,j]=l.useState(0),[d,v]=l.useState("100"),[a,N]=l.useState(12),{format:m}=S(),s=l.useMemo(()=>{const r=parseFloat(d)||0,t=b[i],o=r*a;let n=0;const h=[];for(let c=0;c<a;c++){const $=1+(Math.sin(c*.8)*.15+Math.cos(c*1.3)*.1),g=t.price*$;h.push(g),n+=r/g}const w=o/n,f=n*t.price,y=f-o,C=o>0?y/o*100:0;return{totalInvested:o,totalCoins:n,avgPrice:w,currentValue:f,pnl:y,roi:C,prices:h}},[i,d,a]),p=40,x=180,u=Math.min(...s.prices,1),k=Math.max(...s.prices,1)-u||1,M=s.prices.map((r,t)=>`${t===0?"M":"L"} ${t/(s.prices.length-1)*x} ${p-(r-u)/k*(p-4)-2}`).join(" ");return e.jsxs(L.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},className:"rounded-2xl border border-border bg-card p-5 shadow-card space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"w-5 h-5 text-primary"}),e.jsx("h3",{className:"font-semibold text-foreground text-sm",children:"DCA Simulator"})]}),e.jsx("div",{className:"flex gap-1.5",children:b.map((r,t)=>e.jsx("button",{onClick:()=>j(t),className:`px-2.5 py-1 rounded-lg text-[10px] font-bold transition-all border ${t===i?"border-primary/40 bg-primary/10 text-primary":"border-border/30 text-muted-foreground hover:border-primary/20"}`,children:r.symbol},r.symbol))}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Monthly ($)"}),e.jsx("input",{type:"number",value:d,onChange:r=>v(r.target.value),min:1,className:"w-full mt-1 px-3 py-2 rounded-lg bg-secondary/50 border border-border/40 text-sm font-mono text-foreground focus:outline-none focus:border-primary/40"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:"Duration"}),e.jsx("select",{value:a,onChange:r=>N(Number(r.target.value)),className:"w-full mt-1 px-3 py-2 rounded-lg bg-secondary/50 border border-border/40 text-sm text-foreground focus:outline-none focus:border-primary/40",children:[6,12,24,36,48,60].map(r=>e.jsx("option",{value:r,children:r<12?`${r}mo`:`${r/12}yr`},r))})]})]}),e.jsx("svg",{width:x,height:p,className:"w-full",children:e.jsx("path",{d:M,fill:"none",stroke:"hsl(var(--primary))",strokeWidth:"1.5",strokeLinecap:"round"})}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 pt-2 border-t border-border/30 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Invested"}),e.jsx("span",{className:"font-mono text-foreground",children:m(s.totalInvested)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Value"}),e.jsx("span",{className:"font-mono text-foreground",children:m(s.currentValue)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Avg Price"}),e.jsxs("span",{className:"font-mono text-foreground",children:["$",s.avgPrice.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"P&L"}),e.jsxs("span",{className:`font-mono font-bold ${s.pnl>=0?"text-[hsl(var(--success))]":"text-destructive"}`,children:[s.pnl>=0?"+":"",m(s.pnl)," (",s.roi.toFixed(1),"%)"]})]})]})]})};export{W as default}; 7//# sourceMappingURL=DCASimulator-D42Pu2iX.js.map
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.