PageSourceSearch

https://comparea.ch/_next/static/chunks/pages/hypotheque/calcul-9f7e20db04cf93a0.js

js comparea.ch collected 2026-10-08 05:17:25 UTC 10,145 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6895],{11282:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/hypotheque/calcul",function(){return t(49959)}])},49959:function(e,a,t){"use strict";t.r(a),t.d(a,{__N_SSG:function(){return y},default:function(){return calcul}});var l=t(85893),r=t(64901),n=t(43818),s=t(5321),c=t(67294),_=t(23179),u=t.n(_);let h=c.createContext({prixDachat:"",setPrixDachat:()=>{},fondsPropres:"",setFondsPropres:()=>{},revenuAnnuels:"",setRevenuAnnuels:()=>{}}),HypoCalculateurProvider=e=>{let{children:a}=e,[t,r]=c.useState("850000"),[n,s]=c.useState("200000"),[_,u]=c.useState("150000");return(0,l.jsx)(h.Provider,{value:{prixDachat:t,setPrixDachat:r,fondsPropres:n,setFondsPropres:s,revenuAnnuels:_,setRevenuAnnuels:u},children:a})},useHypoCalculateur=()=>c.useContext(h);var i=t(68839),d=t(97283),p=t(88198),o=t(21587),hypoCalculateurData=()=>{let[e,a]=(0,c.useState)(5),{prixDachat:t,fondsPropres:n,revenuAnnuels:s}=useHypoCalculateur(),_=(0,c.useMemo)(()=>parseInt(t)-parseInt(n),[t,n]),h=(0,c.useMemo)(()=>_*(e/100),[_,e]),x=(0,c.useMemo)(()=>parseInt(t)/15/15,[t]),m=(0,c.useMemo)(()=>.01*parseInt(t),[t]),g=(0,c.useMemo)(()=>{let e=(h+x+m)/parseInt(s)*100;return e>100?100:e<0?0:e},[h,x,m,s]),y=(0,c.useMemo)(()=>{let e=parseInt(n)/parseInt(t)*100,a=100-e;return e<0&&(e=0),e>100&&(e=100),a<0&&(a=0),a>100&&(a=100),[e.toFixed(2),a.toFixed(2)]},[n,t]);(0,c.useMemo)(()=>((h+x+m)/12).toFixed(0),[h,x,m]);let[v,j]=(0,c.useState)(!1),{t:C}=(0,r.$G)("calculateur");return(0,l.jsxs)("div",{className:u().data_wrapper,children:[(0,l.jsxs)("div",{className:u().chart_wrapper,children:[(0,l.jsxs)("div",{className:u().chart_legend,children:[(0,l.jsxs)("div",{className:u().chart_legend_percent+" "+u().blue,children:[(0,l.jsx)("span",{className:u().chart_legend_percent_value,children:y[0]}),(0,l.jsx)("span",{className:u().chart_legend_percent_unit,children:"%"})]}),(0,l.jsx)("div",{className:u().chart_legend_text,children:(0,l.jsx)("span",{className:u().chart_legend_text_value,children:C("hypotheque.right.fonds.label")})})]}),(0,l.jsx)("div",{className:u().chart_svg,children:(0,l.jsxs)("svg",{version:"1.1",children:[(0,l.jsx)("circle",{cx:"90",cy:"90",r:"90"}),(0,l.jsx)("circle",{cx:"90",cy:"90",r:"90",style:{"--value":y[0]}}),(0,l.jsx)("circle",{cx:"90",cy:"90",r:"90",style:{"--value":y[1]}})]})}),(0,l.jsxs)("div",{className:u().chart_legend,children:[(0,l.jsxs)("div",{className:u().chart_legend_percent+" "+u().green,children:[(0,l.jsx)("span",{className:u().chart_legend_percent_value,children:y[1]}),(0,l.jsx)("span",{className:u().chart_legend_percent_unit,children:"%"})]}),(0,l.jsx)("div",{className:u().chart_legend_text,children:(0,l.jsx)("span",{className:u().chart_legend_text_value,children:C("hypotheque.right.hypotheque.label")})})]})]}),(0,l.jsxs)("div",{className:u().mobile_chart_wrapper,children:[(0,l.jsxs)("div",{className:u().mobile_chart_legend,children:[(0,l.jsxs)("div",{className:u().chart_legend_percent+" "+u().blue,children:[(0,l.jsx)("span",{className:u().chart_legend_percent_value,children:y[0]}),(0,l.jsx)("span",{className:u().chart_legend_percent_unit,children:"%"})]}),(0,l.jsx)("div",{className:u().chart_legend_text,children:(0,l.jsx)("span",{className:u().chart_legend_text_value,children:C("hypotheque.right.fonds.label")})})]}),(0,l.jsxs)("div",{className:u().mobile_chart_legend,children:[(0,l.jsxs)("div",{className:u().chart_legend_percent+" "+u().green,children:[(0,l.jsx)("span",{className:u().chart_legend_percent_value,children:y[1]}),(0,l.jsx)("span",{className:u().chart_legend_percent_unit,children:"%"})]}),(0,l.jsx)("div",{className:u().chart_legend_text,children:(0,l.jsx)("span",{className:u().chart_legend_text_value,children:C("hypotheque.right.hypotheque.label")})})]})]}),(0,l.jsxs)("div",{className:u().endettement_box,children:[(0,l.jsxs)("div",{className:u().endettement_text,children:[(0,l.jsx)("strong",{children:C("hypotheque.right.hypotheque_required.label")}),(0,l.jsx)("span",{className:u().endettement_value,children:(0,i.d)(_,"de-CH","CHF",0,0)})]}),(0,l.jsxs)("div",{className:u().endettement_text,children:[(0,l.jsx)("strong",{children:C("hypotheque.right.endettement.label")}),(0,l.jsxs)("span",{className:u().endettement_value,children:[g.toFixed(2),"%"]})]}),(0,l.jsxs)("div",{className:u().endettement_bar,children:[(0,l.jsx)("div",{className:u().gradiant}),(0,l.jsx)("div",{className:u().value,style:{right:"".concat(g,"%")}})]}),(0,l.jsxs)("div",{className:u().endettement_feedback+" "+(g>33||20>parseInt(y[0])?u().warn:""),children:[g>33||20>parseInt(y[0])?(0,l.jsx)(d.Z,{size:30}):(0,l.jsx)(p.Z,{size:30}),(0,l.jsx)("span",{children:C(g>33||20>parseInt(y[0])?"hypotheque.right.nok":"hypotheque.right.ok")})]})]}),(0,l.jsx)("div",{className:u().frais_box,children:(0,l.jsxs)("div",{className:u().warning_wrapper,children:[20>parseInt(y[0])&&g<33&&(0,l.jsxs)(o.bZ,{variant:"danger",noTitle:!0,children:[(0,l.jsx)(o.Cd,{children:C("hypotheque.right.error1.title")}),(0,l.jsx)(o.X,{dangerouslySetInnerHTML:{__html:C("hypotheque.right.error1.description")}})]}),g>33&&(0,l.jsxs)(o.bZ,{variant:"danger",noTitle:!0,children:[(0,l.jsx)(o.Cd,{children:C("hypotheque.right.error2.title")}),(0,l.jsx)(o.X,{children:C("hypotheque.right.error2.description")})]})]})})]})},x=t(33001),hypoCalculateurSettings=()=>{let{prixDachat:e,setPrixDachat:a,fondsPropres:t,setFondsPropres:n,revenuAnnuels:s,setRevenuAnnuels:c}=useHypoCalculateur(),{t:_}=(0,r.$G)("calculateur");return(0,l.jsxs)("div",{className:u().settings_wrapper,children:[(0,l.jsxs)("div",{className:u().settings_box,children:[(0,l.jsx)(x.ZP,{value:(0,i.d)(parseInt(e)||0,"de-CH","CHF",0,0).replace("CHF",""),"aria-label":_("hypotheque.left.inputs.montant.aria_label"),name:"prixdachat",id:"prixdachat",autoComplete:"prixdachat",placeholder:_("hypotheque.left.inputs.montant.placeholder"),label:_("hypotheque.left.inputs.montant.label"),insideText:"CHF",tooltip:_("hypotheque.left.inputs.montant.tooltip"),onChange:e=>a(e.currentTarget.value.replaceAll("’",""))}),(0,l.jsx)("input",{type:"range",min:"20000",max:"5000000",value:parseInt(e)||0,onChange:e=>a(parseInt(e.target.value)+""),className:"slider accent-secondary "+u().slider})]}),(0,l.jsxs)("div",{className:u().settings_box,children:[(0,l.jsx)(x.ZP,{value:(0,i.d)(parseInt(t)||0,"de-CH","CHF",0,0).replace("CHF",""),"aria-label":_("hypotheque.left.inputs.fonds.aria_label"),name:"fondspropres",id:"fondspropres",autoComplete:"fondspropres",placeholder:_("hypotheque.left.inputs.fonds.placeholder"),label:_("hypotheque.left.inputs.fonds.label"),tooltip:_("hypotheque.left.inputs.fonds.tooltip"),insideText:"CHF",onChange:e=>n(e.target.value.replaceAll("’",""))}),(0,l.jsx)("input",{type:"range",min:"50000",max:"1000000",className:"slider accent-secondary "+u().slider,value:parseInt(t)||0,onChange:e=>
1n(parseInt(e.target.value)+"")})]}),(0,l.jsxs)("div",{className:u().settings_box,children:[(0,l.jsx)(x.ZP,{value:(0,i.d)(parseInt(s)||0,"de-CH","CHF",0,0).replace("CHF",""),"aria-label":_("hypotheque.left.inputs.revenu.aria_label"),name:"revenuannuel",id:"revenuannuel",autoComplete:"revenuannuel",placeholder:_("hypotheque.left.inputs.revenu.placeholder"),label:_("hypotheque.left.inputs.revenu.label"),tooltip:_("hypotheque.left.inputs.revenu.tooltip"),insideText:"CHF",onChange:e=>c(e.target.value.replaceAll("’",""))}),(0,l.jsx)("input",{type:"range",min:"0",max:"1000000",className:"slider accent-secondary "+u().slider,value:parseInt(s)||0,onChange:e=>c(parseInt(e.target.value)+"")})]})]})},m=t(98388),hypoCalculateur=e=>{let{className:a=""}=e;return(0,l.jsx)("div",{className:(0,m.m6)("mx-auto max-w-[1000px] rounded-xl border border-[#88889422] bg-white px-[24px] py-[20px] shadow-md md:py-[60px]",a),children:(0,l.jsx)(HypoCalculateurProvider,{children:(0,l.jsxs)("div",{className:u().container,children:[(0,l.jsx)(hypoCalculateurSettings,{}),(0,l.jsx)(hypoCalculateurData,{})]})})})},g=t(26410),y=!0,calcul=()=>{let{t:e}=(0,r.$G)("pages/hypotheque/calcul");return(0,l.jsx)(g.Z,{breadcrumbItems:[{icon:(0,l.jsx)(n.Z,{}),link:"/"},{text:e("breadcrumb0"),link:"/hypotheque"},{text:e("breadcrumb"),link:"/hypotheque/calcul"}],title:e("heroTitle"),t:e,agentKey:"valery_chantepy",articleDate:"31.01.2024",components:{linktoCar:(0,l.jsx)(s.z7,{href:"/3eme-pilier"})},children:(0,l.jsx)(hypoCalculateur,{className:"mt-10 md:mb-20 md:mt-0"})})}},23179:function(e){e.exports={settings_wrapper:"hypoCalculateur_settings_wrapper__1aqrt",settings_box:"hypoCalculateur_settings_box__GKxsT",slider:"hypoCalculateur_slider__O3r4G",data_wrapper:"hypoCalculateur_data_wrapper__PrsOX",chart_wrapper:"hypoCalculateur_chart_wrapper__tUhMi",chart_legend:"hypoCalculateur_chart_legend__uiGMk",chart_legend_percent:"hypoCalculateur_chart_legend_percent__r_WKa",green:"hypoCalculateur_green__T7OBI",blue:"hypoCalculateur_blue__zbZYt",chart_legend_percent_value:"hypoCalculateur_chart_legend_percent_value__h_Dg4",chart_legend_percent_unit:"hypoCalculateur_chart_legend_percent_unit__Hy8JI",chart_legend_text:"hypoCalculateur_chart_legend_text__nRCX_",chart_legend_text_value:"hypoCalculateur_chart_legend_text_value___U_8i",mobile_chart_wrapper:"hypoCalculateur_mobile_chart_wrapper__t41SE",mobile_chart_legend:"hypoCalculateur_mobile_chart_legend___CG4N",endettement_box:"hypoCalculateur_endettement_box__5TKIA",endettement_text:"hypoCalculateur_endettement_text__20cET",endettement_bar:"hypoCalculateur_endettement_bar__YzDwB",gradiant:"hypoCalculateur_gradiant__bAZjJ",value:"hypoCalculateur_value__5Gh0Z",endettement_feedback:"hypoCalculateur_endettement_feedback__2i6cU",warn:"hypoCalculateur_warn__93tFd",frais_box:"hypoCalculateur_frais_box__DUMQq",warning_wrapper:"hypoCalculateur_warning_wrapper__K88GD",frais_box_frais:"hypoCalculateur_frais_box_frais__1I79_",table:"hypoCalculateur_table__vzjBa",table_row:"hypoCalculateur_table_row__hM86A",table_cell:"hypoCalculateur_table_cell__OkFPJ",chart_svg:"hypoCalculateur_chart_svg__tTYkl",container:"hypoCalculateur_container__TbbCu"}}},function(e){e.O(0,[6375,7962,7398,1587,2661,3261,9774,2888,179],function(){return e(e.s=11282)}),_N_E=e.O()}]);

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.