PageSourceSearch

https://portal.savingprivatemoney.com/_next/static/chunks/4410.5e3cb532cbf4a4ba.js

js savingprivatemoney.com collected 2026-10-06 02:28:19 UTC 13,220 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4410,2100,9268],{70798:function(e,t,n){n.d(t,{r:function(){return a}}),n(83079);var a=(0,n(12119).$)("ca799a56f94ed467c47ddf9be64094ac01c361e5")},92735:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},94942:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]])},17625:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]])},83229:function(e,t,n){n.d(t,{Z:function(){return a}});let a=(0,n(79205).Z)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},41823:function(e,t,n){n.d(t,{Z:function(){return r}});var a=n(57437),l=n(70597);function r(e){let{value:t,onChange:n,className:r=""}=e;return(0,a.jsx)("select",{value:t,onChange:e=>n(e.target.value),className:"rounded-lg border border-white/15 bg-black/30 px-3 py-2 text-sm text-white outline-none focus:border-[#f3c86a] ".concat(r),children:l.Xy.map(e=>(0,a.jsxs)("option",{value:e.value,className:"bg-zinc-900 text-white",children:[e.symbol," ",e.name]},e.code))})}},15678:function(e,t,n){n.d(t,{Z:function(){return x}});var a=n(57437),l=n(81952),r=n(48944),o=n(70798),s=n(95728),i=n(14438),c=n(83229),u=n(17625),d=n(92735),m=n(94942),p=n(11933),h=n(5526);async function f(){let{data:{session:e}}=await h.supabase.auth.getSession();if((null==e?void 0:e.access_token)&&e.refresh_token)try{await fetch("/api/auth/establish-session",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({access_token:e.access_token,refresh_token:e.refresh_token})})}catch(e){}}function x(e){let{calculatorName:t,calculationType:n,inputs:h,results:x,getCsvData:b}=e,{isPro:y,isLoading:v}=(0,l.p)(),{isSandbox:w}=(0,r.of)(),g=()=>!w||(i.A.error(r.ty),!1),N=async()=>{if(!g())return;if(!y){i.A.error("Pro membership required to save calculations");return}await f();let e=(0,p.a$)(),a=await (0,o.r)({name:"".concat(t," - ").concat(new Date().toLocaleDateString("en-GB")),type:n,inputs:h,results:{...x,...e?{_enterpriseOrgSnapshot:{companyName:e.companyName,vatReference:e.vatReference,contactPhone:e.contactPhone,contactEmail:e.contactEmail,embedOnDocuments:e.embedOnDocuments}}:{}}});a.success?i.A.success("Saved to your dashboard"):i.A.error(a.error||"Save failed")},j=async()=>{if(g()){if(!y){i.A.error("Pro membership required to print");return}await f(),await (0,s.m)({action:"print_results",calculatorName:t,metadata:{calculationType:n}}),window.print()}},k=async()=>{if(!g())return;if(!y){i.A.error("Pro membership required to export CSV");return}await f();let e=null==b?void 0:b();if(!e){i.A.error("CSV export not available for this tool");return}let a=(0,p.rs)(e);await (0,s.m)({action:"export_csv",calculatorName:t,metadata:{calculationType:n}});let l=new Blob([a],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),o=document.createElement("a");o.href=r,o.download="".concat(t.replace(/\s+/g,"-"),"-").concat(new Date().toISOString().slice(0,10),".csv"),o.click(),URL.revokeObjectURL(r),i.A.success("CSV downloaded")},S=async()=>{if(g()){if(!y){i.A.error("Pro membership required to download PDF");return}await f(),await (0,s.m)({action:"download_pdf",calculatorName:t,metadata:{calculationType:n}}),window.print(),i.A.success("Use browser Print to save as PDF")}};if(v&&!w)return null;let C=w?"flex items-center gap-2 rounded-lg border border-amber-800/50 bg-amber-950/20 px-4 py-2 text-sm text-amber-200/80 cursor-not-allowed opacity-70":"flex items-center gap-2 rounded-lg border border-white/20 bg-white/5 px-4 py-2 text-sm text-white hover:bg-white/10";return(0,a.jsxs)("div",{className:"mt-4 space-y-2",children:[w?(0,a.jsx)("p",{className:"text-[10px] font-mono uppercase tracking-wider text-amber-400/90",children:"Demo view only — save / print / export locked for non-subscribers"}):null,(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>void N(),disabled:w,className:C,title:w?r.ty:void 0,children:[(0,a.jsx)(c.Z,{className:"h-4 w-4"}),"Save"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>void j(),disabled:w,className:C,title:w?r.ty:void 0,children:[(0,a.jsx)(u.Z,{className:"h-4 w-4"}),"Print"]}),b&&(0,a.jsxs)("button",{type:"button",onClick:()=>void k(),disabled:w,className:C,title:w?r.ty:void 0,children:[(0,a.jsx)(d.Z,{className:"h-4 w-4"}),"Export CSV"]}),(0,a.jsxs)("button",{type:"button",onClick:()=>void S(),disabled:w,className:C,title:w?r.ty:void 0,children:[(0,a.jsx)(m.Z,{className:"h-4 w-4"}),"Download PDF"]})]})]})}},4410:function(e,t,n){n.r(t),n.d(t,{default:function(){return c}});
1var a=n(57437),l=n(2265),r=n(41823),o=n(15678),s=n(63094),i=n(70597);function c(){let[e,t]=(0,l.useState)(1e5),[n,c]=(0,l.useState)(5.5),[u,d]=(0,l.useState)(30),[m,p]=(0,l.useState)("monthly"),[h,f]=(0,l.useState)("GBP"),x=(0,l.useCallback)(e=>{t(e.loanAmount),c(e.annualRate),d(e.loanTermYears),p(e.frequency),f(e.currency)},[]),b=(0,i.iD)(h),y="monthly"===m?12:"weekly"===m?52:26,v=n/100/y,w=u*y,{paymentAmount:g,totalInterest:N,totalRepayment:j}=(0,l.useMemo)(()=>{if(v<=0||w<=0||e<=0)return{paymentAmount:0,totalInterest:0,totalRepayment:0};let t=e*v/(1-Math.pow(1+v,-w)),n=t*w;return{paymentAmount:t,totalInterest:n-e,totalRepayment:n}},[e,n,u,m]);return(0,a.jsxs)("div",{className:"space-y-4 rounded-2xl border border-white/10 bg-black/20 p-5",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h3",{className:"text-xl font-semibold text-[#f5e6c8]",children:"Personal Fixed Loan"}),(0,a.jsx)(r.Z,{value:h,onChange:f})]}),(0,a.jsx)(s.Z,{toolId:"personal-fixed-loan",titlePrefix:"Personal fixed loan",getDraft:()=>({loanAmount:e,annualRate:n,loanTermYears:u,frequency:m,currency:h}),applyDraft:x}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"space-y-1",children:[(0,a.jsxs)("span",{className:"text-xs text-white/70",children:["Loan Amount (",b,")"]}),(0,a.jsx)("input",{type:"number",value:e,onChange:e=>t(Number(e.target.value)),className:"w-full rounded-lg border border-white/15 bg-black/30 px-3 py-2 text-sm text-white outline-none focus:border-[#f3c86a]"})]}),(0,a.jsxs)("label",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-white/70",children:"Annual Interest Rate (%)"}),(0,a.jsx)("input",{type:"number",step:.1,value:n,onChange:e=>c(Number(e.target.value)),className:"w-full rounded-lg border border-white/15 bg-black/30 px-3 py-2 text-sm text-white outline-none focus:border-[#f3c86a]"})]}),(0,a.jsxs)("label",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-white/70",children:"Loan Term (years)"}),(0,a.jsx)("input",{type:"number",value:u,onChange:e=>d(Number(e.target.value)),className:"w-full rounded-lg border border-white/15 bg-black/30 px-3 py-2 text-sm text-white outline-none focus:border-[#f3c86a]"})]}),(0,a.jsxs)("label",{className:"space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-white/70",children:"Payment Frequency"}),(0,a.jsxs)("select",{value:m,onChange:e=>p(e.target.value),className:"w-full rounded-lg border border-white/15 bg-black/30 px-3 py-2 text-sm text-white outline-none focus:border-[#f3c86a]",children:[(0,a.jsx)("option",{value:"monthly",className:"bg-zinc-900",children:"Monthly"}),(0,a.jsx)("option",{value:"weekly",className:"bg-zinc-900",children:"Weekly"}),(0,a.jsx)("option",{value:"fortnightly",className:"bg-zinc-900",children:"Fortnightly"})]})]})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-[#f3c86a]/30 bg-[#f3c86a]/10 p-4",children:[(0,a.jsx)("p",{className:"text-sm text-white/70",children:"Payment per Period"}),(0,a.jsx)("p",{className:"text-2xl font-bold text-[#f5e6c8]",children:(0,i.xG)(g,h)}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-white/60",children:["Total Interest: ",(0,i.xG)(N,h)]}),(0,a.jsxs)("p",{className:"text-sm text-white/60",children:["Total Repayment: ",(0,i.xG)(j,h)]})]}),(0,a.jsx)(o.Z,{calculatorName:"Personal Fixed Loan",calculationType:"Personal Fixed Loan Repayment",inputs:{loanAmount:e,annualRate:n,loanTermYears:u,frequency:m,currency:h},results:{paymentAmount:g,totalInterest:N,totalRepayment:j},getCsvData:()=>["Field,Value","Loan Amount (".concat(b,"),").concat(e),"Annual Rate (%),".concat(n),"Term (years),".concat(u),"Frequency,".concat(m),"Payment per period,".concat(g.toFixed(2)),"Total Interest,".concat(N.toFixed(2)),"Total Repayment,".concat(j.toFixed(2))].join("\n")})]})}},81952:function(e,t,n){n.d(t,{p:function(){return r}});var a=n(2265),l=n(5526);function r(){let[e,t]=(0,a.useState)(!1),[n,r]=(0,a.useState)(!1),[o,s]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{let e=!0;return(async()=>{try{var n;let{data:{session:a}}=await l.supabase.auth.getSession();if(!e)return;if(!(null==a?void 0:null===(n=a.user)||void 0===n?void 0:n.id)){t(!1),r(!1),s(!1);return}let o={};(null==a?void 0:a.access_token)&&(o.Authorization="Bearer ".concat(a.access_token));let i=await fetch("/api/verify-pro-status",{cache:"no-store",credentials:"include",headers:o}),c=await i.json().catch(()=>({}));if(e){let e=!!((null==c?void 0:c.isEnterpriseHub)||(null==c?void 0:c.isAdmin));r(e),t(!!((null==c?void 0:c.isPro)||(null==c?void 0:c.isProByTier)||(null==c?void 0:c.isAdmin)||e))}}catch(n){e&&(t(!1),r(!1))}finally{e&&s(!1)}})(),()=>{e=!1}},[]),{isPro:e,isEnterpriseHub:n,isLoading:o}}},48944:function(e,t,n){n.d(t,{Qy:function(){return r},lw:function(){return i},of:function(){return c},ty:function(){return o}});var a=n(57437),l=n(2265);let r="https://calendar.proton.me/u/0/bookings#WABZqz59rVXSzNzhRqcJLh-XRpY-1Q-2UYwezDEMoLU=",o="Demo view only — save, print, export, and signed PDF downloads are available to Enterprise Hub subscribers.",s=(0,l.createContext)(null);function i(e){let{children:t}=e,[n,r]=(0,l.useState)(!0),[o,i]=(0,l.useState)(!1),[c,u]=(0,l.useState)(null),[d,m]=(0,l.useState)(null),[p,h]=(0,l.useState)(null),f=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/auth/sandbox",{cache:"no-store",credentials:"include"}),t=await e.json().catch(()=>({}));i(!!(null==t?void 0:t.active)),u("string"==typeof(null==t?void 0:t.email)?t.email:null),m("string"==typeof(null==t?void 0:t.fullName)?t.fullName:null),h("string"==typeof(null==t?void 0:t.role)?t.role:null)}catch(e){i(!1),u(null),m(null),h(null)}finally{r(!1)}},[]);(0,l.useEffect)(()=>{f()},[f]);let x=(0,l.useMemo)(()=>({loading:n,isSandbox:o,email:c,fullName:d,role:p,refresh:f}),[n,o,c,d,p,f]);return(0,a.jsx)(s.Provider,{value:x,children:t})}function c(){return(0,l.useContext)(s)||{loading:!1,isSandbox:!1,email:null,fullName:null,role:null,refresh:async()=>void 0}}},70597:function(e,t,n){n.d(t,{Xy:function(){return a},iD:function(){return r},jK:function(){return l},xG:function(){return o}});
1let a=[{code:"GBP",name:"British Pound",symbol:"\xa3",value:"GBP"},{code:"USD",name:"US Dollar",symbol:"$",value:"USD"},{code:"EUR",name:"Euro",symbol:"€",value:"EUR"},{code:"CAD",name:"Canadian Dollar",symbol:"C$",value:"CAD"},{code:"AUD",name:"Australian Dollar",symbol:"A$",value:"AUD"},{code:"JPY",name:"Japanese Yen",symbol:"\xa5",value:"JPY"},{code:"CNY",name:"Chinese Yuan",symbol:"\xa5",value:"CNY"},{code:"INR",name:"Indian Rupee",symbol:"₹",value:"INR"},{code:"CHF",name:"Swiss Franc",symbol:"CHF",value:"CHF"}];function l(e){var t;let n=a.find(t=>t.code===e);return null!==(t=null==n?void 0:n.symbol)&&void 0!==t?t:e}function r(e){var t;let n=a.find(t=>t.code===e);return null!==(t=null==n?void 0:n.name)&&void 0!==t?t:e}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GBP",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-GB";return new Intl.NumberFormat(n,{style:"currency",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}},5526:function(e,t,n){let a;n.r(t),n.d(t,{supabase:function(){return r}});var l=n(13053);let r=null!=a?a:a=(0,l.eI)("https://ztvfzactmyvfgzqibkkv.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inp0dmZ6YWN0bXl2Zmd6cWlia2t2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzIzNjczNjQsImV4cCI6MjA4Nzk0MzM2NH0.Ps8nhejSZqF_ThayTCikpKMVtcHppe6_ZWiXySdHbDU",{global:{headers:{"X-Client-Info":"portal-supabase-browser"}},auth:{flowType:"implicit",autoRefreshToken:!0,detectSessionInUrl:!1,persistSession:!0,storage:window.localStorage}})}}]);

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.