1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5801],{5801:function(e,t,a){a.r(t),a.d(t,{default:function(){return C}});var r=a(57437),s=a(2265),n=a(33245),l=a(73618),i=a(70525),c=a(3085),o=a(78867),d=a(69076),m=a(69064),x=a(79820),u=a(12381),f=a(40279),p=a(75060),h=a(15291),g=a(69174),j=a(33056),b=a(83607),v=a(8215),N=a(20407),y=a(78155),w=a(53250);let k=[{code:"USD",symbol:"$",name:"US Dollar",locale:"en-US"},{code:"SGD",symbol:"S$",name:"Singapore Dollar",locale:"en-SG"},{code:"INR",symbol:"â¹",name:"Indian Rupee",locale:"en-IN"},{code:"EUR",symbol:"â¬",name:"Euro",locale:"de-DE"},{code:"GBP",symbol:"\xa3",name:"British Pound",locale:"en-GB"},{code:"JPY",symbol:"\xa5",name:"Japanese Yen",locale:"ja-JP"},{code:"AUD",symbol:"A$",name:"Australian Dollar",locale:"en-AU"},{code:"CAD",symbol:"C$",name:"Canadian Dollar",locale:"en-CA"}],R={savings:{name:"Savings Account",rate:3},fd:{name:"Fixed Deposit",rate:6},stocks:{name:"Stock Market Average",rate:12},"real-estate":{name:"Real Estate Average",rate:8}};function C(e){let{tool:t}=e,[a,C]=(0,s.useState)(k[0]),[I,P]=(0,s.useState)(""),[F,z]=(0,s.useState)(""),[O,A]=(0,s.useState)(""),[S,_]=(0,s.useState)(""),[Z,D]=(0,s.useState)(!1),[G,E]=(0,s.useState)(null),[Y,M]=(0,s.use
1State)("fd"),B=e=>new Intl.NumberFormat(a.locale,{style:"currency",currency:a.code,minimumFractionDigits:0,maximumFractionDigits:0}).format(e),T=e=>{switch(e){case"stock":P("100000"),z("145000"),A("1000"),_("2");break;case"real-estate":P("5000000"),z("6500000"),A("100000"),_("5");break;case"loss":P("500000"),z("400000"),A("10000"),_("1")}m.Am.success("Example loaded")},U=(0,s.useMemo)(()=>G?[{name:"Initial Investment",value:parseFloat(I.replace(/,/g,""))||0,color:"#3b82f6"},{name:"Additional Costs",value:parseFloat((O||"0").replace(/,/g,""))||0,color:"#f59e0b"},{name:G.netProfit>=0?"Net Profit":"Loss",value:Math.abs(G.netProfit),color:G.netProfit>=0?"#10b981":"#ef4444"}].filter(e=>e.value>0):[],[G,I,O]);return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)(x.Zb,{className:"p-6",children:[(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)(p._,{htmlFor:"currency",children:"Currency"}),(0,r.jsxs)(h.Ph,{value:a.code,onValueChange:e=>{let t=k.find(t=>t.code===e);t&&C(t)},children:[(0,r.jsx)(h.i4,{id:"currency",children:(0,r.jsx)(h.ki,{})}),(0,r.jsx)(h.Bw,{children:k.map(e=>(0,r.jsxs)(h.Ql,{value:e.code,children:[e.symbol," ",e.name]},e.code))})]})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)(p._,{htmlFor:"initial",className:"flex items-center gap-2",children:["Initial Investment ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"relative mt-1",children:[(0,r.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",children:a.symbol}),(0,r.jsx)(f.I,{id:"initial",type:"text",inputMode:"decimal",value:I,onChange:e=>P(e.target.value),placeholder:"100,000",className:"pl-8"})]}),(0,r.jsx)("p",{className:"text-xs text-slate-500 mt-1",children:"Original amount invested"})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)(p._,{htmlFor:"final",className:"flex items-center gap-2",children:["Final Value ",(0,r.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,r.jsxs)("div",{className:"relative mt-1",children:[(0,r.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",children:a.symbol}),(0,r.jsx)(f.I,{id:"final",type:"text",inputMode:"decimal",value:F,onChange:e=>z(e.target.value),placeholder:"150,000",className:"pl-8"})]}),(0,r.jsx)("p",{className:"text-xs text-slate-500 mt-1",children:"Current or ending value"})]}),(0,r.jsxs)("button",{onClick:()=>D(!Z),className:"text-sm text-blue-600 hover:text-blue-700 flex items-center gap-1",children:[(0,r.jsx)(n.Z,{className:"w-4 h-4"}),Z?"Hide":"Show"," Advanced Options"]}),Z&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(p._,{htmlFor:"costs",children:"Additional Investment Costs"}),(0,r.jsxs)("div",{className:"relative mt-1",children:[(0,r.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500",children:a.symbol}),(0,r.jsx)(f.I,{id:"costs",type:"text",inputMode:"decimal",value:O,onChange:e=>A(e.target.value),placeholder:"0",className:"pl-8"})]}),(0,r.jsx)("p",{className:"text-xs text-slate-500 mt-1",children:"Fees, taxes, or other costs"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(p._,{htmlFor:"period",children:"Investment Period (Years)"}),(0,r.jsx)(f.I,{id:"period",type:"text",inputMode:"decimal",value:S,onChange:e=>_(e.target.value),placeholder:"0"}),(0,r.jsx)("p",{className:"text-xs text-slate-500 mt-1",children:"For annualized ROI calculation"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(p._,{htmlFor:"benchmark",children:"Compare with"}),(0,r.jsxs)(h.Ph,{value:Y,onValueChange:e=>M(e),children:[(0,r.jsx)(h.i4,{id:"benchmark",children:(0,r.jsx)(h.ki,{})}),(0,r.jsx)(h.Bw,{children:Object.entries(R).map(e=>{let[t,a]=e;return(0,r.jsxs)(h.Ql,{value:t,children:[a.name," (",a.rate,"%)"]},t)})})]})]})]}),(0,r.jsxs)(u.z,{onClick:()=>{let e,t,a,r;if(!I||!F){m.Am.error("Please enter all required fields");return}let s=parseFloat(I.replace(/,/g,"")),n=parseFloat(F.replace(/,/g,"")),l=parseFloat((O||"0").replace(/,/g,""))||0,i=parseFloat((S||"0").replace(/,/g,""))||0;if(isNaN(s)||s<=0){m.Am.error("Please enter a valid initial investment amount");return}if(isNaN(n)||n<0){m.Am.error("Please enter a valid final value");return}let c=s+l,o=n-c,d=o/c*100;i>0&&(e=(Math.pow(n/c,1/i)-1)*100),d>=50?(t="Excellent ROI",a="text-green-600",r="bg-green-50"):d>=20?(t="Good ROI",a="text-green-500",r="bg-green-50"):d>=10?(t="Moderate ROI",a="text-yellow-600",r="bg-yellow-50"):d>=0?(t="Low ROI",a="text-orange-500",r="bg-orange-50"):(t="Loss",a="text-red-600",r="bg-red-50"),E({roiPercentage:parseFloat(d.toFixed(2)),totalGain:n-s,netProfit:o,category:t,color:a,bgColor:r,annualizedROI:e?parseFloat(e.toFixed(2)):void 0}),m.Am.success("ROI calculated successfully!")},className:"w-full",size:"lg",children:[(0,r.jsx)(l.Z,{className:"w-5 h-5 mr-2"}),"Calculate ROI"]})]}),(0,r.jsxs)("div",{className:"mt-4 pt-4 border-t border-slate-200 dark:border-slate-700",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 mb-2",children:"Try Examples:"}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,r.jsx)(u.z,{variant:"outline",size:"sm",onClick:()=>T("stock"),children:"Stock Investment"}),(0,r.jsx)(u.z,{variant:"outline",size:"sm",onClick:()=>T("real-estate"),children:"Real Estate"}),(0,r.jsx)(u.z,{variant:"outline",size:"sm",onClick:()=>T("loss"),children:"Loss Example"})]})]})]}),G&&(0,r.jsx)(x.Zb,{className:"p-6 ".concat(G.bgColor," border-l-4 ").concat(G.roiPercentage>=0?"border-l-green-500":"border-l-red-500"," animate-fade-in"),children:(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 mb-2",children:[G.roiPercentage>=0?(0,r.jsx)(i.Z,{className:"w-8 h-8 ".concat(G.color)}):(0,r.jsx)(c.Z,{className:"w-8 h-8 text-red-600"}),(0,r.jsxs)("h3",{className:"text-5xl md:text-6xl font-bold ".concat(G.color),children:[G.roiPercentage>=0?"+":"",G.roiPercentage,"%"]})]}),(0,r.jsx)(g.C,{className:"text-lg px-4 py-1",children:G.category})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,r.jsxs)("div",{className:"text-center p-4 bg-white dark:bg-slate-800 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-slate-600 dar
1k:text-slate-400 mb-1",children:"Total Gain"}),(0,r.jsxs)("p",{className:"text-2xl font-bold ".concat(G.totalGain>=0?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:[G.totalGain>=0?"+":"",B(G.totalGain)]})]}),(0,r.jsxs)("div",{className:"text-center p-4 bg-white dark:bg-slate-800 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-slate-600 dark:text-slate-400 mb-1",children:"Net Profit"}),(0,r.jsxs)("p",{className:"text-2xl font-bold ".concat(G.netProfit>=0?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:[G.netProfit>=0?"+":"",B(G.netProfit)]})]}),(0,r.jsxs)("div",{className:"text-center p-4 bg-white dark:bg-slate-800 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-slate-600 dark:text-slate-400 mb-1",children:"Final Value"}),(0,r.jsx)("p",{className:"text-2xl font-bold text-blue-600 dark:text-blue-400",children:B(parseFloat(F.replace(/,/g,"")))})]})]}),G.annualizedROI&&(0,r.jsxs)("div",{className:"text-center p-4 bg-white dark:bg-slate-800 rounded-lg",children:[(0,r.jsx)("p",{className:"text-sm text-slate-600 dark:text-slate-400 mb-1",children:"Annualized ROI"}),(0,r.jsxs)("p",{className:"text-3xl font-bold ".concat(G.annualizedROI>=0?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"),children:[G.annualizedROI>=0?"+":"",G.annualizedROI,"% per year"]})]}),(0,r.jsxs)("div",{className:"bg-white dark:bg-slate-800 rounded-lg p-4",children:[(0,r.jsx)("h4",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 mb-4 text-center",children:"Investment Breakdown"}),(0,r.jsx)(j.h,{width:"100%",height:250,children:(0,r.jsxs)(b.u,{children:[(0,r.jsx)(v.b,{data:U,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,labelLine:!1,label:e=>{let{name:t,percent:a}=e;return"".concat(t,": ").concat((100*(a||0)).toFixed(0),"%")},children:U.map((e,t)=>(0,r.jsx)(N.b,{fill:e.color},"cell-".concat(t)))}),(0,r.jsx)(y.u,{formatter:e=>B(e)}),(0,r.jsx)(w.D,{})]})})]}),(0,r.jsx)("div",{className:"bg-white dark:bg-slate-800 rounded-lg p-4",children:(0,r.jsx)("p",{className:"text-sm text-slate-700 dark:text-slate-300",children:(()=>{if(!G)return"";let e=R[Y],t=G.annualizedROI?G.annualizedROI>e.rate?"outperforming ".concat(e.name," (").concat(e.rate,"%) by ").concat((G.annualizedROI-e.rate).toFixed(2),"%"):"underperforming ".concat(e.name," (").concat(e.rate,"%) by ").concat((e.rate-G.annualizedROI).toFixed(2),"%"):"";return G.roiPercentage>=50?"Outstanding! Your investment generated a ".concat(G.roiPercentage,"% return, which is considered excellent. ").concat(t):G.roiPercentage>=20?"Great performance! Your investment achieved a ".concat(G.roiPercentage,"% return, which is above average. ").concat(t):G.roiPercentage>=10?"Your investment generated a ".concat(G.roiPercentage,"% return, which is moderate. ").concat(t):G.roiPercentage>=0?"Your investment had a ".concat(G.roiPercentage,"% return, which is relatively low. ").
1concat(t):"Your investment resulted in a ".concat(Math.abs(G.roiPercentage),"% loss. Consider reviewing your investment strategy.")})()})}),(0,r.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,r.jsxs)(u.z,{variant:"outline",onClick:()=>{if(!G)return;let e="ROI Calculation Results:\nââââââââââââââââââââ\nROI: ".concat(G.roiPercentage>=0?"+":"").concat(G.roiPercentage,"%\nCategory: ").concat(G.category,"\nTotal Gain: ").concat(B(G.totalGain),"\nNet Profit: ").concat(B(G.netProfit)).concat(G.annualizedROI?"\nAnnualized ROI: ".concat(G.annualizedROI.toFixed(2),"%"):"","\nââââââââââââââââââââ\nCalculated using 100Plus Tools");navigator.clipboard.writeText(e),m.Am.success("Results copied to clipboard!")},children:[(0,r.jsx)(o.Z,{className:"w-4 h-4 mr-2"}),"Copy Results"]}),(0,r.jsxs)(u.z,{variant:"outline",onClick:()=>{P(""),z(""),A(""),_(""),E(null),m.Am.success("Calculator reset")},children:[(0,r.jsx)(d.Z,{className:"w-4 h-4 mr-2"}),"Reset"]})]})]})})]})}},69174:function(e,t,a){a.d(t,{C:function(){return i}});var r=a(57437);a(2265);var s=a(90535),n=a(93448);let l=(0,s.j)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function i(e){let{className:t,variant:a,...s}=e;return(0,r.jsx)("div",{className:(0,n.cn)(l({variant:a}),t),...s})}},79820:function(e,t,a){a.d(t,{Ol:function(){return i},SZ:function(){return o},Zb:function(){return l},aY:function(){return d},ll:function(){return c}});var r=a(57437),s=a(2265),n=a(93448);let l=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",a),...s})});l.displayName="Card";let i=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("flex flex-col space-y-1.5 p-6",a),...s})});i.displayName="CardHeader";let c=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("text-2xl font-semibold leading-none tracking-tight",a),...s})});c.displayName="CardTitle";let o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("text-sm text-muted-foreground",a),...s})});o.displayName="CardDescription";let d=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("p-6 pt-0",a),...s})});d.displayName="CardContent",s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)("div",{ref:t,className:(0,n.cn)("flex items-center p-6 pt-0",a),...s})}).displayName="CardFooter"},75060:function(e,t,a){a.d(t,{_:function(){return o}});var r=a(57437),s=a(2265),n=a(370),l=a(90535),i=a(93448);let c=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),o=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.f,{ref:t,className:(0,i.cn)(c(),a),...s})});o.displayName=n.f.displayName},15291:function(e,t,a){a.d(t,{Bw:function(){return h},DI:function(){return m},Ph:function(){return d},Ql:function(){return j},i4:function(){return u},ki:function(){return x},n5:function(){return g}});var r=a(57437),s=a(2265),n=a(7637),l=a(40875),i=a(22135),c=a(30401),o=a(93448);let d=n.fC,m=n.ZA,x=n.B4,u=s.forwardRef((e,t)=>{let{className:a,children:s,...i}=e;return(0,r.jsxs)(n.xz,{ref:t,className:(0,o.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...i,children:[s,(0,r.jsx)(n.JO,{asChild:!0,children:(0,r.jsx)(l.Z,{className:"h-4 w-4 opacity-50"})})]})});u.displayName=n.xz.displayName;let f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.u_,{ref:t,className:(0,o.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,r.jsx)(i.Z,{className:"h-4 w-4"})})});f.displayName=n.u_.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.$G,{ref:t,className:(0,o.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,r.jsx)(l.Z,{className:"h-4 w-4"})})});p.displayName=n.$G.displayName;let h=s.forwardRef((e,t)=>{let{className:a,children:s,position:l="popper",...i}=e;return(0,r.jsx)(n.h_,{children:(0,r.jsxs)(n.VY,{ref:t,className:(0,o.cn)("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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 origin-[--radix-select-content-transform-origin]","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:l,...i,children:[(0,r.jsx)(f,{}),(0,r.jsx)(n.l_,{className:(0,o.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),(0,r.jsx)(p,{})]})})});h.displayName=n.VY.displayName;let g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.__,{ref:t,className:(0,o.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...s})});g.displayName=n.__.displayName;let j=s.forwardRef((e,t)=>{let{className:a,children:s,...l}=e;return(0,r.jsxs)(n.ck,{ref:t,className:(0,o.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...l,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(n.wU,{children:(0,r.jsx)(c.Z,{className:"h-4 w-4"})})}),(0,r.jsx)(n.eT,{children:s})]})});j.displayName=n.ck.displayName,s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.Z0,{ref:t,className:(0,o.cn)("-mx-1 my-1 h-px bg-muted",a),...s})}).displayName=n.Z0.displayName}}]);
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.