1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3b92dcee-58c5-417c-895f-0832e3d4a87c",e._sentryDebugIdIdentifier="sentry-dbid-3b92dcee-58c5-417c-895f-0832e3d4a87c")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3808],{11420:(e,t,a)=>{a.r(t),a.d(t,{CalculateurKwhEuros:()=>k});var l=a(54568),s=a(28653),r=a(79502),n=a(7620),i=a(24792),d=a(97013),c=a(6845),o=a(5239),m=a(92779),u=a(8049),x=a(38584),h=a(23951);let p="Il y a eu un probl\xe8me lors du calcul",b="J'\xe9conomise en ligne gratuitement",g=/^(https?:\/\/|\/(?!\/))/i;function f(e){let{id:t,label:a,value:s,onChange:r,placeholder:n,suffix:i,min:d=0,step:c=1}=e;return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(u.Label,{htmlFor:t,className:"!text-stone-700 font-medium text-sm",children:a}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(m.Input,{id:t,type:"number",inputMode:"decimal",min:d,step:c,value:s,onChange:e=>r(e.target.value),placeholder:n,className:"h-12 border-stone-200 pr-16 text-base dark:border-stone-200 dark:bg-white dark:text-stone-800"}),(0,l.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-4 flex items-center font-medium text-sm text-stone-500",children:i})]})]})}function v(e){let{description:t,uploadDate:a}=e,s=!!(null==a?void 0:a.trim());return t||s?(0,l.jsxs)("p",{className:"mt-0 text-sm text-stone-500 italic",children:[t,s&&(0,l.jsxs)(l.Fragment,{children:[t?" ":"",a,"."]})]}):null}function j(e){let{message:t}=e;return(0,l.jsxs)(d.Alert,{variant:"danger",role:"alert","aria-live":"assertive",className:"fade-in slide-in-from-top-5 [&>svg]:!top-1/2 [&>svg]:!-translate-y-1/2 animate-in duration-300",children:[(0,l.jsx)(s.default,{className:"h-4 w-4"}),(0,l.jsx)(d.AlertDescription,{children:t})]})}function N(e){let{kwh:t,euros:a,ref:s}=e;return(0,l.jsxs)("output",{ref:s,"aria-live":"polite",className:"fade-in slide-in-from-top-2 block animate-in scroll-mt-4 rounded-lg border border-stone-200 bg-stone-50 p-6 text-center duration-300",children:[(0,l.jsxs)("p",{className:"mt-0 mb-1 text-sm text-stone-500",children:["La conversion d'une consommation de ",t.toLocaleString("fr-FR",{maximumFractionDigits:0})," kWh est de"]}),(0,l.jsxs)("p",{className:"!my-0 font-medium text-4xl text-primary-600 dark:text-primary-600",children:[a.toLocaleString("fr-FR",{minimumFractionDigits:2,maximumFractionDigits:2})," â¬"]})]})}function y(e){let{phoneNumber:t,wcbLabel:a,linkUrl:s,linkLabel:r,helpSubtitle:n}=e,d=!!t||!!a,c="string"==typeof s&&g.test(s.trim());return d||c?(0,l.jsx)(o.Card,{className:"border border-stone-200 shadow-none dark:border-stone-200 dark:bg-white",children:(0,l.jsxs)(o.CardContent,{className:"space-y-4 p-6 text-center",children:[(0,l.jsx)("h3",{className:"!my-0 font-bold text-lg text-stone-900",children:"Besoin d'aide personnalis\xe9e ?"}),(0,l.jsx)("p",{className:"!my-0 text-black text-sm",children:null!=n?n:"Trouvez le tarif le plus \xe9conomique pour vos besoins sp\xe9cifiques"}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[d&&(0,l.jsx)(i.CallToAction,{variant:"secondary",width:"full",mobileWidth:"full",className:"!w-full",callModeAttributes:t?{href:"tel:".concat(t.replace(/\s/g,"")),value:t,icon:"phone"}:void 0,appModeAttributes:{value:null!=a?a:"\xcatre rappel\xe9 gratuitement",isCallback:!0,href:"#",icon:"wcb"}}),c&&s&&(0,l.jsx)(i.CallToAction,{variant:"secondaryInverse",width:"full",mobileWidth:"full",className:"!w-full",callModeAttributes:{href:s,value:null!=r?r:b},appModeAttributes:{href:s,value:null!=r?r:b}})]})]})}):null}function w(e){let{kwhPrice:t,uploadDate:a,description:s,phoneNumber:i,wcbLabel:d,linkUrl:m,linkLabel:u,helpSubtitle:x}=e,[b,g]=(0,n.useState)(""),[w,k]=(0,n.useState)(null),[C,S]=(0,n.useState)(null),T=(0,n.useRef)(null),A=(0,h.useTracking)();return(0,n.useEffect)(()=>{null!==w&&!C&&T.current&&T.current.scrollIntoView({behavior:"smooth",block:"start"})},[w,C]),(0,l.jsx)("div",{className:"p-4",children:(0,l.jsxs)("div",{className:"mx-auto max-w-xl space-y-6",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,l.jsx)("div",{className:"rounded-lg bg-primary-100 p-3 dark:bg-primary-100",children:(0,l.jsx)(r.default,{className:"h-6 w-6 text-primary-600 dark:text-primary-600"})}),(0,l.jsx)("h2",{className:"!my-0 font-bold text-2xl text-stone-900",children:"Convertisseur de kWh en euros"})]}),(0,l.jsx)(o.Card,{className:"border border-stone-200 shadow-none dark:border-stone-200 dark:bg-white",children:(0,l.jsxs)(o.CardContent,{className:"space-y-4 p-6",children:[(0,l.jsx)("p",{className:"!my-0 text-sm text-stone-600",children:"Calculez le co\xfbt de votre consommation \xe9lectrique"}),(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),(()=>{if(A({event:"click",eventCategory:"engagement",eventType:"interaction",eventWording:"Convertir"}),!("number"==typeof t&&Number.isFinite(t)&&t>0)){S(p),k(null);return}let e=Number(b);if(!Number.isFinite(e)||e<=0){S(p),k(null);return}k({kwh:e,euros:e*t}),S(null)})()},className:"space-y-4",children:[(0,l.jsx)(f,{id:"annual-kwh",label:"Consommation annuelle totale",value:b,onChange:g,placeholder:"Ex. 4500",suffix:"kWh",step:1}),(0,l.jsx)(v,{description:s,uploadDate:a}),(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)(c.Button,{type:"submit",disabled:!(()=>{let e=Number(b);return""!==b.trim()&&Number.isFinite(e)&&e>0})(),className:"border border-primary-500 bg-primary-500 px-8 text-white hover:border-primary-600 hover:bg-primary-600 focus:ring-primary-500 dark:border-primary-500 dark:bg-primary-500 dark:text-white dark:hover:border-primary-600 dark:hover:bg-primary-600 dark:hover:text-white",size:"lg",children:"Convertir"})})]}),C&&(0,l.jsx)(j,{message:C}),null!==w&&!C&&(0,l.jsx)(N,{kwh:w.kwh,euros:w.euros,ref:T})]})}),null!==w&&!C&&(0,l.jsx)(y,{phoneNumber:i,wcbLabel:d,linkUrl:m,linkLabel:u,helpSubtitle:x})]})})}function k(){let{kwhPrice:e,uploadDate:t,description:a,phoneNumber:s,wcbLabel:r,linkUrl:n,linkLabel:i,helpSubtitle:d}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.jsx)(x.TrackingProvider,{slice:{eventComponent:"ppn-calculator-kwh-euros",eventPosition:"content"},children:(0,l.jsx)(w,{kwhPrice:e,uploadDate:t,description:a,phoneNumber:s,wcbLabel:r,linkUrl:n,linkLabel:i,helpSubtitle:d})})}},23662:(e,t,a)=>{a.r(t),a.d(t,{CalculateurKwhM2Euros:()=>y});var l=a(54568),s=a(28653),r=a(30866),n=a(79502),i=a(7620),d=a(24792),c=a(97013),o=a(6845),m=a(5239),u=a(92779),x=a(8049),h=a(38584),p=a(23951);let b="Il y a eu un probl\xe8me lors du calcul",g="\xcatre rappel\xe9 gratuitement",f="J'\xe9c
1onomise en ligne gratuitement";function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return e.toLocaleString("fr-FR",{minimumFractionDigits:t,maximumFractionDigits:t})}let j=e=>{let{id:t,label:a,value:s,onChange:r,placeholder:n,suffix:i,min:d=0,step:c=1}=e;return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(x.Label,{htmlFor:t,className:"!text-stone-700 font-medium text-sm",children:a}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(u.Input,{id:t,type:"number",inputMode:"decimal",min:d,step:c,value:s,onChange:e=>r(e.target.value),placeholder:n,className:"h-12 border-stone-200 pr-16 text-base dark:border-stone-200 dark:bg-white dark:text-stone-800"}),(0,l.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-4 flex items-center font-medium text-sm text-stone-500",children:i})]})]})};function N(e){let t,{kwhPrice:a,uploadDate:u,description:x,phoneNumber:h,wcbLabel:N,linkUrl:y,linkLabel:w}=e,[k,C]=(0,i.useState)(""),[S,T]=(0,i.useState)(""),[A,F]=(0,i.useState)(null),[z,M]=(0,i.useState)(!1),[W,I]=(0,i.useState)(null),D=(0,i.useRef)(null),P=(0,p.useTracking)();(0,i.useEffect)(()=>{null!==A&&!W&&D.current&&D.current.scrollIntoView({behavior:"smooth",block:"start"})},[A,W]);let V=()=>{I(b),F(null),M(!1)};return(0,l.jsx)("div",{className:"p-4",children:(0,l.jsxs)("div",{className:"mx-auto max-w-xl space-y-6",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,l.jsx)("div",{className:"rounded-lg bg-primary-100 p-3 dark:bg-primary-100",children:(0,l.jsx)(n.default,{className:"h-6 w-6 text-primary-600 dark:text-primary-600"})}),(0,l.jsx)("h2",{className:"!my-0 font-bold text-2xl text-stone-900",children:"Convertisseur de kWh par m\xb2 en euro"})]}),(0,l.jsx)(m.Card,{className:"border border-stone-200 shadow-none dark:border-stone-200 dark:bg-white",children:(0,l.jsxs)(m.CardContent,{className:"space-y-4 p-6",children:[(0,l.jsx)("p",{className:"!my-0 text-sm text-stone-600",children:"Calculez le co\xfbt de votre consommation \xe9lectrique par m\xe8tre carr\xe9"}),(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),(()=>{if(P({event:"click",eventCategory:"engagement",eventType:"interaction",eventWording:"Convertir"}),!("number"==typeof a&&Number.isFinite(a)&&a>0))return V();let e=Number(k),t=Number(S);if(!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0)return V();F({eurosPerM2:e*a/t,totalEuros:e*a,kwhPerM2:e/t}),M(!1),I(null)})()},className:"space-y-4",children:[(0,l.jsx)(j,{id:"annual-kwh",label:"Consommation annuelle totale",value:k,onChange:C,placeholder:"Ex. 4500",suffix:"kWh",step:1}),(0,l.jsx)(j,{id:"surface",label:"Surface habitable en m2",value:S,onChange:T,placeholder:"Ex. 60",suffix:"m\xb2",step:1}),(()=>x||u?(0,l.jsxs)("p",{className:"mt-0 text-sm text-stone-500 italic",children:[x,u&&"string"==typeof u&&""!==u.trim()&&!Number.isNaN(new Date(u).getTime())&&(0,l.jsxs)(l.Fragment,{children:[x?" ":"","v\xe9rifi\xe9 le ",function(e){let t=new Date(e),a=String(t.getDate()).padStart(2,"0"),l=String(t.getMonth()+1).padStart(2,"0");return"".concat(a,"/").concat(l,"/").concat(t.getFullYear())}(u),"."]})]}):null)(),(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)(o.Button,{type:"submit",disabled:!(()=>{let e=Number(k),t=Number(S);return""!==k.trim()&&""!==S.trim()&&Number.isFinite(e)&&e>0&&Number.isFinite(t)&&t>0})(),className:"border border-primary-500 bg-primary-500 px-8 text-white hover:border-primary-600 hover:bg-primary-600 focus:ring-primary-500 dark:border-primary-500 dark:bg-primary-500 dark:text-white dark:hover:border-primary-600 dark:hover:bg-primary-600 dark:hover:text-white",size:"lg",children:"Convertir"})})]}),W&&(0,l.jsxs)(c.Alert,{variant:"danger",role:"alert","aria-live":"assertive",className:"fade-in slide-in-from-top-5 [&>svg]:!top-1/2 [&>svg]:!-translate-y-1/2 animate-in duration-300",children:[(0,l.jsx)(s.default,{className:"h-4 w-4"}),(0,l.jsx)(c.AlertDescription,{children:b})]}),null!==A&&!W&&(t=A,(0,l.jsxs)("output",{ref:D,"aria-live":"polite",className:"fade-in slide-in-from-top-2 block animate-in scroll-mt-4 rounded-lg border border-stone-200 bg-stone-50 p-6 text-center duration-300",children:[(0,l.jsx)("p",{className:"mt-0 mb-1 text-sm text-stone-500",children:"Co\xfbt par m\xb2"}),(0,l.jsxs)("p",{className:"mt-0 mb-1 font-medium text-4xl text-primary-600 dark:text-primary-600",children:[v(t.eurosPerM2)," ⬠/ m\xb2"]}),(0,l.jsxs)("button",{type:"button",onClick:()=>M(e=>!e),"aria-expanded":z,className:"mt-2 flex w-full items-center justify-center gap-1 text-sm text-stone-500 hover:text-stone-700",children:[(0,l.jsx)(r.default,{className:"h-4 w-4"}),"D\xe9tails des calculs"]}),z&&(0,l.jsxs)("div",{className:"fade-in slide-in-from-top-1 mt-3 animate-in space-y-1 text-sm text-stone-500 duration-200",children:[(0,l.jsxs)("p",{className:"!my-0",children:["Co\xfbt annuel total : ",v(t.totalEuros)," â¬"]}),(0,l.jsxs)("p",{className:"!my-0",children:["Consommation par m\xb2 : ",t.kwhPerM2.toLocaleStr
1ing("fr-FR",{maximumFractionDigits:0})," kWh/m\xb2/an"]})]})]}))]})}),null!==A&&!W&&(()=>{var e;let t=!!h||!!N,a=!!y;return t||a?(0,l.jsx)(m.Card,{className:"border border-stone-200 shadow-none dark:border-stone-200 dark:bg-white",children:(0,l.jsxs)(m.CardContent,{className:"space-y-4 p-6 text-center",children:[(0,l.jsx)("h3",{className:"!my-0 font-bold text-lg text-stone-900",children:"Besoin d'aide personnalis\xe9e ?"}),(0,l.jsx)("p",{className:"!my-0 text-black text-sm",children:"Trouvez le tarif le plus \xe9conomique pour vos besoins sp\xe9cifiques"}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[t&&(0,l.jsx)(d.CallToAction,{variant:"secondary",width:"full",mobileWidth:"full",className:"!w-full",callModeAttributes:{href:h?"tel:".concat(h.replace(/\s/g,"")):"#",value:null!=(e=null!=h?h:N)?e:g,icon:"phone"},appModeAttributes:{value:null!=N?N:g,isCallback:!0,href:"#",icon:"wcb"}}),a&&y&&(0,l.jsx)(d.CallToAction,{variant:"secondaryInverse",width:"full",mobileWidth:"full",className:"!w-full",callModeAttributes:{href:y,value:null!=w?w:f},appModeAttributes:{href:y,value:null!=w?w:f}})]})]})}):null})()]})})}function y(){let{kwhPrice:e,uploadDate:t,description:a,phoneNumber:s,wcbLabel:r,linkUrl:n,linkLabel:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.jsx)(h.TrackingProvider,{slice:{eventComponent:"ppn-calculator-kwh-m2-euros",eventPosition:"content"},children:(0,l.jsx)(N,{kwhPrice:e,uploadDate:t,description:a,phoneNumber:s,wcbLabel:r,linkUrl:n,linkLabel:i})})}},38269:(e,t,a)=>{a.r(t),a.d(t,{CalculatorM3Kwh:()=>w});var l=a(54568),s=a(28653),r=a(30866),n=a(79502),i=a(7620),d=a(24792),c=a(97013),o=a(6845),m=a(5239),u=a(92779),x=a(8049),h=a(38584),p=a(23951);let b="Il y a eu un probl\xe8me lors du calcul",g="\xcatre rappel\xe9 gratuitement",f="J'\xe9conomise en ligne gratuitement";function v(e){return"number"==typeof e&&Number.isFinite(e)&&e>0}function j(e){return e.toLocaleString("fr-FR",{maximumFractionDigits:2})}let N=e=>{let{id:t,label:a,value:s,onChange:r,placeholder:n,suffix:i,min:d=0,step:c=1}=e;return(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)(x.Label,{htmlFor:t,className:"!text-stone-700 font-medium text-sm",children:a}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(u.Input,{id:t,type:"number",inputMode:"decimal",min:d,step:c,value:s,onChange:e=>r(e.target.value),placeholder:n,className:"h-12 border-stone-200 pr-16 text-base dark:border-stone-200 dark:bg-white dark:text-stone-800"}),(0,l.jsx)("span",{className:"pointer-events-none absolute inset-y-0 right-4 flex items-center font-medium text-sm text-stone-500",children:i})]})]})};function y(e){let t,{averageConversionCoefficient:a,kwhPrice:u,uploadDate:x,description:h,helpSubtitle:y,phoneNumber:w,wcbLabel:k,linkUrl:C,linkLabel:S}=e,[T,A]=(0,i.useState)(""),[F,z]=(0,i.useState)(null),[M,W]=(0,i.useState)(!1),[I,D]=(0,i.useState)(null),P=(0,i.useRef)(null),V=(0,p.useTracking)();(0,i.useEffect)(()=>{null!==F&&!I&&P.current&&P.current.scrollIntoView({behavior:"smooth",block:"start"})},[F,I]);let L=()=>{D(b),z(null),W(!1)};return(0,l.jsx)("div",{className:"p-4",children:(0,l.jsxs)("div",{className:"mx-auto max-w-xl space-y-6",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,l.jsx)("div",{className:"rounded-lg bg-primary-100 p-3 dark:bg-primary-100",children:(0,l.jsx)(n.default,{className:"h-6 w-6 text-primary-600 dark:text-primary-600"})}),(0,l.jsx)("h2",{className:"!my-0 font-bold text-2xl text-stone-900",children:"Convertisseur de m\xb3 en kWh"})]}),(0,l.jsx)(m.Card,{className:"border border-stone-200 shadow-none dark:border-stone-200 dark:bg-white",children:(0,l.jsxs)(m.CardContent,{className:"space-y-4 p-6",children:[(0,l.jsx)("p",{className:"!my-0 text-sm text-stone-600",children:"Convertissez le volume de votre compteur gaz en \xe9nergie facturable"}),(0,l.jsxs)("form",{onSubmit:e=>{e.preventDefault(),(()=>{if(V({event:"click",eventCategory:"engagement",eventType:"interaction",eventWording:"Convertir"}),!v(a))return L();let e=Number(T);
1if(!Number.isFinite(e)||e<=0)return L();z(function(e,t,a){let l=e*t;return{volume:e,coefficient:t,kwh:l,cost:v(a)?l*a:void 0}}(e,a,u)),W(!1),D(null)})()},className:"space-y-4",children:[(0,l.jsx)(N,{id:"m3-volume",label:"Entrez votre volume en m\xe8tres cubes",value:T,onChange:A,placeholder:"Ex. 100",suffix:"m\xb3",step:1}),(()=>h||x?(0,l.jsxs)("p",{className:"mt-0 text-sm text-stone-500 italic",children:[h,x&&"string"==typeof x&&""!==x.trim()&&!Number.isNaN(new Date(x).getTime())&&(0,l.jsxs)(l.Fragment,{children:[h?" ":"","v\xe9rifi\xe9 le ",function(e){let t=new Date(e),a=String(t.getDate()).padStart(2,"0"),l=String(t.getMonth()+1).padStart(2,"0");return"".concat(a,"/").concat(l,"/").concat(t.getFullYear())}(x),"."]})]}):null)(),(0,l.jsx)("div",{className:"flex justify-center",children:(0,l.jsx)(o.Button,{type:"submit",disabled:!(()=>{let e=Number(T);return""!==T.trim()&&Number.isFinite(e)&&e>0})(),className:"border border-primary-500 bg-primary-500 px-8 text-white hover:border-primary-600 hover:bg-primary-600 focus:ring-primary-500 dark:border-primary-500 dark:bg-primary-500 dark:text-white dark:hover:border-primary-600 dark:hover:bg-primary-600 dark:hover:text-white",size:"lg",children:"Convertir"})})]}),I&&(0,l.jsxs)(c.Alert,{variant:"danger",role:"alert","aria-live":"assertive",className:"fade-in slide-in-from-top-5 [&>svg]:!top-1/2 [&>svg]:!-translate-y-1/2 animate-in duration-300",children:[(0,l.jsx)(s.default,{className:"h-4 w-4"}),(0,l.jsx)(c.AlertDescription,{children:b})]}),null!==F&&!I&&(t=F,(0,l.jsxs)("output",{ref:P,"aria-live":"polite",className:"fade-in slide-in-from-top-2 block animate-in scroll-mt-4 rounded-lg border border-stone-200 bg-stone-50 p-6 text-center duration-300",children:[(0,l.jsxs)("p",{className:"mt-0 mb-1 text-sm text-stone-500",children:["La consommation pour un volume de ",j(t.volume)," m\xb3 est d'environ"]}),(0,l.jsxs)("p",{className:"!my-0 font-medium text-4xl text-primary-600 dark:text-primary-600",children:[t.kwh.toLocaleString("fr-FR",{maximumFractionDigits:0})," kWh"]}),(0,l.jsxs)("button",{type:"button",onClick:()=>W(e=>!e),"aria-expanded":M,className:"mt-3 flex w-full items-center justify-center gap-1 text-sm text-stone-500 hover:text-stone-700",children:[(0,l.jsx)(r.default,{className:"h-4 w-4"}),"D\xe9tails des calculs"]}),M&&(0,l.jsxs)("div",{className:"fade-in slide-in-from-top-1 mt-3 animate-in space-y-1 text-sm text-stone-500 duration-200",children:[void 0!==t.cost&&(0,l.jsxs)("p",{className:"!my-0",children:["Co\xfbt annuel total : ",function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return e.toLocaleString("fr-FR",{minimumFractionDigits:t,maximumFractionDigits:t})}(t.cost)," â¬"]}),(0,l.jsxs)("p",{className:"!my-0",children:["Consommation par m\xb3 : ",j(t.coefficient)," kWh/m\xb3/an"]})]})]}))]})}),null!==F&&!I&&(()=>{var e;let t=!!w||!!k,a=!!C;return t||a?(0,l.jsx)(m.Card,{className:"border border-stone-200 shadow-none dark:border-stone-200 dark:bg-white",children:(0,l.jsxs)(m.CardContent,{className:"space-y-4 p-6 text-center",children:[(0,l.jsx)("h3",{className:"!my-0 font-bold text-lg text-stone-900",children:"Besoin d'aide personnalis\xe9e ?"}),(0,l.jsx)("p",{className:"!my-0 text-black text-sm",children:null!=y?y:"Trouvez le tarif le plus \xe9conomique pour vos besoins sp\xe9cifiques"}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[t&&(0,l.jsx)(d.CallToAction,{variant:"secondary",width:"full",mobileWidth:"full",className:"!w-full",callModeAttributes:{href:w?"tel:".concat(w.replace(/\s/g,"")):"#",value:null!=(e=null!=w?w:k)?e:g,icon:"phone"},appModeAttributes:{value:null!=k?k:g,isCallback:!0,href:"#",icon:"wcb"}}),a&&C&&(0,l.jsx)(d.CallToAction,{variant:"secondaryInverse",width:"full",mobileWidth:"full",className:"!w-full",callModeAttributes:{href:C,value:null!=S?S:f},appModeAttributes:{href:C,value:null!=S?S:f}})]})]})}):null})()]})})}function w(){let{averageConversionCoefficient:e,kwhPrice:t,uploadDate:a,description:s,helpSubtitle:r,phoneNumber:n,wcbLabel:i,linkUrl:d,linkLabel:c}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.jsx)(h.TrackingProvider,{slice:{eventComponent:"ppn-calculator-m3-kwh",eventPosition:"content"},children:(0,l.jsx)(y,{averageConversionCoefficient:e,kwhPrice:t,uploadDate:a,description:s,helpSubtitle:r,phoneNumber:n,wcbLabel:i,linkUrl:d,linkLabel:c})})}},54373:(e,t,a)=>{a.r(t),a.d(t,{CalculatorPotencia:()=>z});var l=a(54568),s=a(29768),r=a(52137),n=a(75097),i=a(77186),d=a(41169),c=a(43002),o=a(74624),m=a(70930),u=a(79502),x=a(6438),h=a(58997),p=a(45234),b=a(84990),g=a(56178),f=a(7620),v=a(24792),j=a(6845),N=a(5239),y=a(8049),w=a(32673),k=a(38584);let C=["1,15 kW","2,3 kW","3,45 kW","4,6 kW","5,75 kW","6,9 kW","8,05 kW","9,2 kW","10,35 kW","11,5 kW","13,8 kW","15,0 kW"],S=[{value:"small",label:"Piso peque\xf1o (< 60m\xb2)",power:3.45},{value:"medium",label:"Piso mediano (60-90m\xb2)",power:4.6},{value:"large",label:"Piso grande (90-120m\xb2)",power:5.75},{value:"house",label:"Casa (> 120m\xb2)",power:6.9}],T=[{value:"low",label:"Bajo - Solo por las tardes/noches",multiplier:.8},{value:"medium",label:"Medio - Ma\xf1anas y tardes",multiplier:1},{value:"high",label:"Alto - Todo el d\xeda en casa",multiplier:1.2}],A=[{id:"fridge",label:"Nevera",power:.3,icon:s.default},{id:"microwave",label:"Microondas",power:1.1,icon:r.default},{id:"washingMachine",label:"Lavadora",power:1.5,icon:n.default},{id:"dishwasher",label:"Lavavajillas",power:1.5,icon:n.default},{id:"oven",label:"Horno",power:1.1,icon:i.default},{id:"ac",label:"Aire Acondicionado",power:2.2,icon:s.default},{id:"tv",label:"Televisi\xf3n",power:.2,icon:d.default}
1],F=[{id:1,title:"Tama\xf1o de la vivienda",icon:c.default},{id:2,title:"Patr\xf3n de uso",icon:o.default},{id:3,title:"Electrodom\xe9sticos",icon:m.default},{id:4,title:"Informaci\xf3n adicional",icon:u.default}];function z(e){let{phoneNumber:t}=e,[a,s]=(0,f.useState)(1),[r,n]=(0,f.useState)(""),[i,d]=(0,f.useState)(""),[z,M]=(0,f.useState)([]),[W,I]=(0,f.useState)(""),[D,P]=(0,f.useState)(!1),V=()=>{let e=S.find(e=>e.value===r),t=T.find(e=>e.value===i);if(!e||!t)return null;let a=e.power,l=(a*=t.multiplier)+.7*z.reduce((e,t)=>{let a=A.find(e=>e.id===t);return e+((null==a?void 0:a.power)||0)},0),s=C.map(e=>Number.parseFloat(e.replace(",","."))).reduce((e,t)=>Math.abs(t-l)<Math.abs(e-l)?t:e);return"".concat(s.toString().replace(".",",")," kW")},L=V(),E=(()=>{if(!W)return null;let e=Number.parseFloat(W.replace(",",".")),t=V();if(!t)return null;let a=e-Number.parseFloat(t.replace(",","."));return a>0?{savings:Math.round(35*a),difference:a.toFixed(2).replace(".",",")}:null})();return(0,l.jsx)(k.TrackingProvider,{slice:{eventComponent:"ppn-calculator-potencia"},children:(0,l.jsx)("div",{className:"bg-slate-100 px-4 py-12",children:(0,l.jsxs)("div",{className:"mx-auto max-w-4xl space-y-8",children:[(0,l.jsx)("div",{className:"space-y-6 text-center",children:(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("h2",{className:"mt-0 mb-0 flex flex-col items-center justify-center gap-3 font-bold text-2xl text-stone-800 sm:flex-row md:text-3xl",style:{fontFamily:"var(--font-heading)"},children:[(0,l.jsx)(u.default,{className:"h-10 w-10 text-teal-600"}),"Calculadora de Potencia Contratada"]}),(0,l.jsx)("p",{className:"mx-auto text-lg text-stone-600",children:"Descubre cu\xe1nto puedes ahorrar optimizando tu contrato el\xe9ctrico."})]})}),D?(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-2",children:[L&&(0,l.jsxs)(N.Card,{className:"justify-center border-0 bg-teal-50 shadow-lg dark:border-teal-200 dark:bg-teal-50",children:[(0,l.jsxs)(N.CardHeader,{className:"pb-4 text-center",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center justify-center gap-2",children:[(0,l.jsx)(h.default,{className:"h-6 w-6 text-teal-600"}),(0,l.jsx)("span",{className:"font-semibold text-stone-800 text-xl",children:"Tu Potencia Recomendada"})]}),(0,l.jsx)("div",{className:"mb-2 font-bold text-5xl text-teal-600",children:L}),(0,l.jsx)("p",{className:"text-lg text-stone-600",children:"Potencia \xf3ptima para tu hogar"})]}),(0,l.jsxs)(N.CardContent,{className:"space-y-6",children:[(0,l.jsx)("p",{className:"text-center text-stone-600 dar
1k:text-stone-600",children:"Basado en tu perfil de consumo y electrodom\xe9sticos seleccionados."}),E&&(0,l.jsxs)("div",{className:"rounded-lg border border-primary-200 bg-primary-100 p-4 dark:border-primary-200 dark:bg-primary-100",children:[(0,l.jsxs)("p",{className:"my-0 text-center font-bold text-lg text-primary-700",children:["\xa1Podr\xedas ahorrar hasta ",E.savings,"⬠al a\xf1o!"]}),(0,l.jsxs)("p",{className:"my-0 mt-1 text-center text-primary-600 text-sm",children:["Reduciendo ",E.difference," kW de tu potencia contratada."]})]}),(0,l.jsxs)(j.Button,{onClick:()=>{s(1),n(""),d(""),M([]),I(""),P(!1)},variant:"outline",className:"mt-4 w-full border-secondary-500 bg-secondary-500 text-white hover:border-secondary-600 hover:bg-secondary-600 focus:ring-secondary-500 dark:border-secondary-500 dark:bg-secondary-500 dark:text-white dark:hover:border-secondary-600 dark:hover:bg-secondary-600",children:[(0,l.jsx)(p.default,{className:"mr-2 h-4 w-4"}),"Calcular de Nuevo"]})]})]}),(0,l.jsxs)(N.Card,{className:"border-0 shadow-lg dark:bg-white",children:[(0,l.jsxs)(N.CardHeader,{className:"text-center",children:[(0,l.jsx)(N.CardTitle,{className:"mt-0 font-bold text-stone-800 text-xl",children:"\xbfNecesitas ayuda personalizada?"}),(0,l.jsxs)(N.CardDescription,{className:"text-stone-600",children:["Encuentra la"," ",(0,l.jsx)("span",{className:"font-semibold",children:"tarifa m\xe1s econ\xf3mica"})," ","para tus necesidades espec\xedficas"]})]}),(0,l.jsxs)(N.CardContent,{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,l.jsx)(v.CallToAction,{radius:"round",className:"w-full sm:w-full md:w-full",callModeAttributes:{href:"tel:".concat(null!=t?t:"900123456"),value:null!=t?t:"900 123 456",icon:"phone"},displayMode:"call",variant:"secondary"}),(0,l.jsx)(v.CallToAction,{className:"w-full border-teal-500 bg-transparent text-teal-600 hover:bg-teal-50 sm:w-full md:w-full dark:hover:bg-teal-950/20",variant:"secondaryInverse",appModeAttributes:{value:"Llamar a un experto",isCallback:!0,href:"#",icon:"wcb"}})]}),(0,l.jsxs)("div",{className:"space-y-4 border-gray-200 border-t pt-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-full bg-teal-100 p-1 dark:bg-teal-100",children:(0,l.jsx)(x.default,{className:"h-4 w-4 text-teal-600"})}),(0,l.jsx)("span",{className:"text-sm text-stone-800",children:"Consulta sin compromiso"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-full bg-teal-100 p-1 dark:bg-teal-100",children:(0,l.jsx)(b.default,{className:"h-4 w-4 text-teal-600"})}),(0,l.jsx)("span",{className:"text-sm text-stone-800",children:"Expertos en tarifas el\xe9ctricas"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-full bg-teal-100 p-1 dark:bg-teal-100",children:(0,l.jsx)(g.default,{className:"h-4 w-4 text-teal-600"})}),(0,l.jsx)("span",{className:"text-sm text-stone-800",children:"Te ayudamos a cambiar de compa\xf1\xeda"})]})]})]})]})]})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"flex items-center justify-center",children:(0,l.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,l.jsx)("div",{className:"flex items-center sm:hidden md:space-x-4",children:(()=>{let e=a-1,t=e+1,r=[F[e]];return t<F.length&&r.push(F[t]),r.map((e,t)=>{if(!e)return null;let n=e.icon,i=a===e.id,d=a>e.id,c=a>=e.id||d;return(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("button",{type:"button",onClick:()=>c&&s(e.id),disabled:!c,className:"flex h-12 w-12 items-center justify-center rounded-full border-2 transition-all duration-200 ".concat(d?"border-teal-500 bg-teal-500 text-white hover:bg-teal-600":i?"border-teal-500 bg-teal-50 text-teal-600 dark:bg-teal-50":"cursor-not-allowed border-gray-300 text-gray-400"," ").concat(c&&!i?"hover:border-teal-400":""),children:d?(0,l.jsx)(x.default,{className:"h-5 w-5"}):(0,l.jsx)(n,{className:"h-5 w-5"})}),t<r.length-1&&(0,l.jsx)("div",{className:"mx-2 h-1 w-16 rounded-full transition-colors duration-200 ".concat(d?"bg-teal-500":"bg-gray-300")})]},e.id)})})()}),(0,l.jsx)("div",{className:"hidden items-center sm:flex",children:F.map((e,t)=>{let r=e.icon,n=a===e.id,i=a>e.id,d=a>=e.id||i;return(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("button",{type:"button",onClick:()=>d&&s(e.id),disabled:!d,className:"flex h-12 w-12 items-center justify-center rounded-full border-2 transition-all duration-200 ".concat(i?"border-teal-500 bg-teal-500 text-white hover:bg-teal-600":n?"border-teal-500 bg-teal-50 text-teal-600 dar
1k:bg-teal-50":"cursor-not-allowed border-gray-300 text-gray-400"," ").concat(d&&!n?"hover:border-teal-400":""),children:i?(0,l.jsx)(x.default,{className:"h-5 w-5"}):(0,l.jsx)(r,{className:"h-5 w-5"})}),t<F.length-1&&(0,l.jsx)("div",{className:"mx-2 h-1 w-16 rounded-full transition-colors duration-200 ".concat(i?"bg-teal-500":"bg-gray-300")})]},e.id)})})]})}),(0,l.jsx)(N.Card,{className:"mx-auto border-0 shadow-lg dark:bg-white",children:(0,l.jsxs)(N.CardContent,{className:"p-4 md:p-8",children:[(()=>{switch(a){case 1:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(c.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Tama\xf1o de la vivienda"})]}),(0,l.jsxs)(w.Select,{value:r,onValueChange:e=>{n(e),setTimeout(()=>{s(2)},300)},children:[(0,l.jsx)(w.SelectTrigger,{className:"[&>span]:!line-clamp-none h-12 w-full text-left text-sm leading-tight md:leading-normal dark:text-stone-800",children:(0,l.jsx)(w.SelectValue,{placeholder:"Selecciona el tama\xf1o de tu vivienda"})}),(0,l.jsx)(w.SelectContent,{children:S.map(e=>(0,l.jsx)(w.SelectItem,{value:e.value,className:"py-3 text-base",children:e.label},e.value))})]})]});case 2:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(o.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Patr\xf3n de uso"})]}),(0,l.jsxs)(w.Select,{value:i,onValueChange:e=>{d(e),setTimeout(()=>{s(3)},300)},children:[(0,l.jsx)(w.SelectTrigger,{className:"[&>span]:!line-clamp-none h-12 w-full text-left text-sm leading-tight md:leading-normal dark:text-stone-800",children:(0,l.jsx)(w.SelectValue,{placeholder:"\xbfCu\xe1ndo usas m\xe1s electricidad?"})}),(0,l.jsx)(w.SelectContent,{children:T.map(e=>(0,l.jsx)(w.SelectItem,{value:e.value,className:"py-3 text-base",children:e.label},e.value))})]})]});case 3:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(m.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Electrodom\xe9sticos"})]}),(0,l.jsx)("p",{className:"mb-6 text-stone-600",children:"Selecciona los electrodom\xe9sticos de alto consumo que tienes:"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:A.map(e=>{let t=e.icon,a=z.includes(e.id);return(0,l.jsx)(N.Card,{className:"cursor-pointer transition-all duration-200 hover:shadow-md dark:bg-white ".concat(a?"border-teal-500 bg-teal-50 shadow-sm dark:bg-teal-50":"border-gray-200 hover:border-teal-300"),onClick:()=>{a?M(z.filter(t=>t!==e.id)):M([...z,e.id])},children:(0,l.jsx)(N.CardContent,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg p-2 ".concat(a?"bg-teal-500 text-white":"bg-gray-100 text-gray-600"),children:(0,l.jsx)(t,{className:"h-5 w-5"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"my-0 font-medium text-stone-800 leading-none",children:e.label}),(0,l.jsxs)("p",{className:"my-0 text-sm text-stone-600",children:[e.power," kW"]})]})]}),a&&(0,l.jsx)("div",{className:"rounded-full bg-teal-500 p-1 text-white",children:(0,l.jsx)(x.default,{className:"h-4 w-4"})})]})})},e.id)})})]});case 4:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(u.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Informaci\xf3n adicional (opcional)"})]}),(0,l.jsx)("p",{className:"mb-6 text-stone-600",children:"Introduce tu potencia actual para descubrir si podr\xedas ahorrar dinero."}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)(y.Label,{htmlFor:"current-power",className:"font-medium text-base text-stone-800 dark:text-stone-800",children:"Potencia actual contratada"}),(0,l.jsxs)(w.Select,{value:W,onValueChange:I,children:[(0,l.jsx)(w.SelectTrigger,{id:"current-power",className:"[&>span]:!line-clamp-none h-12 w-full text-left text-sm leading-tight md:leading-normal dark:text-stone-800",children:(0,l.jsx)(w.SelectValue,{placeholder:"Selecciona tu potencia actual"})}),(0,l.jsx)(w.SelectContent,{children:C.map(e=>(0,l.jsx)(w.SelectItem,{value:e,className:"py-3 text-base",children:e},e))})]})]})]});default:return null}})(),(0,l.jsxs)("div",{className:"mt-8 flex justify-between border-gray-200 border-t pt-6",children:[(0,l.jsx)(j.Button,{variant:"outline",onClick:()=>{s(Math.max(1,a-1))},disabled:1===a,className:"bg-transparent px-6 py-2 dark:text-stone-800",children:"Anterior"}),(0,l.jsx)(j.Button,{onClick:()=>{4===a?P(!0):(s(Math.min(4,a+1)),3===a&&setTimeout(()=>{let e=Array.from(document.querySelectorAll("h2")).find(e=>{var t;return null==(t=e.textContent)?void 0:t.includes("Calculadora de Potencia Contratada")});e&&e.scrollIntoView({behavior:"smooth",block:"start"})},100))},disabled:!(()=>{switch(a){case 1:return""!==r;case 2:return""!==i;case 3:case 4:return!0;default:return!1}})(),className:"border-secondary-500 bg-secondary-500 px-6 py-2 text-white hover:border-secondary-600 hover:bg-secondary-600 focus:ring-secondary-500 dark:border-secondary-500 dark:bg-secondary-500 dark:text-white dark:hover:border-secondary-600 dark:hover:bg-secondary-600",children:4===a?"Finalizar":"Siguiente"})]})]})})]})]})})})}},78038:(e,t,a)=>{a.r(t),a.d(t,{CalculateurDePuissance:()=>I});var l=a(54568),s=a(29768),r=a(52137),n=a(75097),i=a(77186),d=a(41169),c=a(43002),o=a(74624),m=a(70930),u=a(79502),x=a(6438),h=a(58997),p=a(45234),b=a(84990),g=a(56178),f=a(7620),v=a(24792),j=a(6845),N=a(5239),y=a(8049),w=a(32673),k=a(38584),C=a(40212),S=a(23951);let T=["3 kVA","6 kVA","9 kVA","12 kVA","15 kVA","18 kVA","24 kVA","36 kVA"],A=[{value:"small",label:"Appartement petit (< 60 m\xb2)",power:6},{value:"medium",label:"Appartement moyen (60-90 m\xb2)",power:9},{value:"large",label:"Grand appartement (90-120 m\xb2)",power:12},{value:"house",label:"Maison (> 120 m\xb2)",power:15}],F=[{value:"low",label:"Seulement le soir/la nuit",multiplier:.8}
1,{value:"medium",label:"Matin et apr\xe8s-midi",multiplier:1},{value:"high",label:"Toute la journ\xe9e \xe0 la maison",multiplier:1.2}],z=[{id:"fridge",label:"R\xe9frig\xe9rateur",power:.3,icon:s.default},{id:"microwave",label:"Micro-ondes",power:1.1,icon:r.default},{id:"washingMachine",label:"Lave-linge",power:1.5,icon:n.default},{id:"dishwasher",label:"Lave-vaisselle",power:1.5,icon:n.default},{id:"oven",label:"Four",power:1.1,icon:i.default},{id:"ac",label:"Climatisation",power:2.2,icon:s.default},{id:"tv",label:"T\xe9l\xe9vision",power:.2,icon:d.default}],M=[{id:1,title:"Taille du logement",icon:c.default},{id:2,title:"Vos habitudes d'usage",icon:o.default},{id:3,title:"Appareils \xe9lectrom\xe9nagers",icon:m.default},{id:4,title:"Informations compl\xe9mentaires",icon:u.default}];function W(e){let{phoneNumber:t}=e,[a,s]=(0,f.useState)(1),[r,n]=(0,f.useState)(""),[i,d]=(0,f.useState)(""),[k,W]=(0,f.useState)([]),[I,D]=(0,f.useState)(""),[P,V]=(0,f.useState)(!1),L=(0,S.useTracking)(),E=(0,C.useImpression)(),B=e=>L({event:"form",eventCategory:"engagement",eventType:"interaction",...e}),R=(e,t)=>{var a,l;return B({eventWording:null!=(l=null==(a=M[e-1])?void 0:a.title)?l:"",eventStep:e,eventFormType:t})},q=function(e,t){let a=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return l=>{t(l),R(e,"select"),a&&setTimeout(()=>s(e+1),300)}},H=()=>{let e=A.find(e=>e.value===r),t=F.find(e=>e.value===i);if(!e||!t)return null;let a=e.power,l=(a*=t.multiplier)+.7*k.reduce((e,t)=>{let a=z.find(e=>e.id===t);return e+((null==a?void 0:a.power)||0)},0),s=T.map(e=>Number.parseFloat(e.replace(" kVA",""))).reduce((e,t)=>Math.abs(t-l)<Math.abs(e-l)?t:e);return"".concat(s," kVA")},_=H(),U=(()=>{if(!I)return null;let e=Number.parseFloat(I.replace(" kVA","")),t=H();if(!t)return null;let a=e-Number.parseFloat(t.replace(" kVA",""));return a>0?{savings:Math.round(35*a),difference:a.toFixed(1)}:null})();return(0,l.jsx)("div",{className:"bg-slate-100 px-4 py-12",children:(0,l.jsxs)("div",{className:"mx-auto max-w-4xl space-y-8",children:[(0,l.jsx)("div",{ref:E,className:"space-y-6 text-center",children:(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("h2",{className:"mt-0 mb-0 flex flex-col items-center justify-center gap-3 font-bold text-2xl text-stone-800 sm:flex-row md:text-3xl",style:{fontFamily:"var(--font-heading)"},children:[(0,l.jsx)(u.default,{className:"h-10 w-10 text-teal-600"}),"Calculateur de puissance souscrite"]}),(0,l.jsx)("p",{className:"mx-auto text-lg text-stone-600",children:"D\xe9couvrez combien vous pouvez \xe9conomiser en optimisant votre contrat d'\xe9lectricit\xe9."})]})}),P?(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-2",children:[_&&(0,l.jsxs)(N.Card,{className:"justify-center border-0 bg-teal-50 shadow-lg dark:border-teal-200 dark:bg-teal-50",children:[(0,l.jsxs)(N.CardHeader,{className:"pb-4 text-center",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center justify-center gap-2",children:[(0,l.jsx)(h.default,{className:"h-6 w-6 text-teal-600"}),(0,l.jsx)("span",{className:"font-semibold text-stone-800 text-xl",children:"Votre puissance recommand\xe9e"})]}),(0,l.jsx)("div",{className:"mb-2 font-bold text-5xl text-teal-600",children:_}),(0,l.jsx)("p",{className:"text-lg text-stone-600",children:"Puissance optimale pour votre logement"})]}),(0,l.jsxs)(N.CardContent,{className:"space-y-6",children:[(0,l.jsx)("p",{className:"text-center text-stone-600 dar
1k:text-stone-600",children:"Bas\xe9 sur votre profil de consommation et les appareils s\xe9lectionn\xe9s."}),U&&(0,l.jsxs)("div",{className:"rounded-lg border border-primary-200 bg-primary-100 p-4 dark:border-primary-200 dark:bg-primary-100",children:[(0,l.jsxs)("p",{className:"my-0 text-center font-bold text-lg text-primary-700",children:["Vous pourriez \xe9conomiser jusqu'\xe0 ",U.savings,"⬠par an !"]}),(0,l.jsxs)("p",{className:"my-0 mt-1 text-center text-primary-600 text-sm",children:["En r\xe9duisant de ",U.difference," kVA votre puissance souscrite."]})]}),(0,l.jsxs)(j.Button,{onClick:()=>{B({eventWording:"Recalculer",eventStep:0}),s(1),n(""),d(""),W([]),D(""),V(!1)},variant:"outline",className:"mt-4 w-full border-secondary-500 bg-secondary-500 text-white hover:border-secondary-600 hover:bg-secondary-600 focus:ring-secondary-500 dark:border-secondary-500 dark:bg-secondary-500 dark:text-white dark:hover:border-secondary-600 dark:hover:bg-secondary-600",children:[(0,l.jsx)(p.default,{className:"mr-2 h-4 w-4"}),"Recalculer"]})]})]}),(0,l.jsxs)(N.Card,{className:"border-0 shadow-lg dark:bg-white",children:[(0,l.jsxs)(N.CardHeader,{className:"text-center",children:[(0,l.jsx)(N.CardTitle,{className:"mt-0 font-bold text-stone-800 text-xl",children:"Besoin d'un accompagnement personnalis\xe9 ?"}),(0,l.jsxs)(N.CardDescription,{className:"text-stone-600",children:["Trouvez le"," ",(0,l.jsx)("span",{className:"font-semibold",children:"tarif le plus \xe9conomique"})," ","selon votre usage."]})]}),(0,l.jsxs)(N.CardContent,{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,l.jsx)(v.CallToAction,{radius:"round",className:"w-full sm:w-full md:w-full",callModeAttributes:{href:"tel:".concat(null!=t?t:"0970730830"),value:null!=t?t:"09 70 73 08 30",icon:"phone"},displayMode:"call",variant:"secondary"}),(0,l.jsx)(v.CallToAction,{className:"w-full border-teal-500 bg-transparent text-teal-600 hover:bg-teal-50 sm:w-full md:w-full dark:hover:bg-teal-950/20",variant:"secondaryInverse",appModeAttributes:{value:"Parler avec un expert",isCallback:!0,href:"#",icon:"wcb"}})]}),(0,l.jsxs)("div",{className:"space-y-4 border-gray-200 border-t pt-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-full bg-teal-100 p-1 dark:bg-teal-100",children:(0,l.jsx)(x.default,{className:"h-4 w-4 text-teal-600"})}),(0,l.jsx)("span",{className:"text-sm text-stone-800",children:"Consultation sans engagement"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-full bg-teal-100 p-1 dark:bg-teal-100",children:(0,l.jsx)(b.default,{className:"h-4 w-4 text-teal-600"})}),(0,l.jsx)("span",{className:"text-sm text-stone-800",children:"Experts en tarifs d'\xe9lectricit\xe9"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-full bg-teal-100 p-1 dark:bg-teal-100",children:(0,l.jsx)(g.default,{className:"h-4 w-4 text-teal-600"})}),(0,l.jsx)("span",{className:"text-sm text-stone-800",children:"Nous vous aidons \xe0 changer de fournisseur"})]})]})]})]})]})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"flex items-center justify-center",children:(0,l.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,l.jsx)("div",{className:"flex items-center sm:hidden md:space-x-4",children:(()=>{let e=a-1,t=e+1,r=[M[e]];return t<M.length&&r.push(M[t]),r.map((e,t)=>{if(!e)return null;let n=e.icon,i=a===e.id,d=a>e.id,c=a>=e.id||d;return(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("button",{type:"button",onClick:()=>c&&s(e.id),disabled:!c,className:"flex h-12 w-12 items-center justify-center rounded-full border-2 transition-all duration-200 ".concat(d?"border-teal-500 bg-teal-500 text-white hover:bg-teal-600":i?"border-teal-500 bg-teal-50 text-teal-600 dark:bg-teal-50":"cursor-not-allowed border-gray-300 text-gray-400"," ").concat(c&&!i?"hover:border-teal-400":""),children:d?(0,l.jsx)(x.default,{className:"h-5 w-5"}):(0,l.jsx)(n,{className:"h-5 w-5"})}),t<r.length-1&&(0,l.jsx)("div",{className:"mx-2 h-1 w-16 rounded-full transition-colors duration-200 ".concat(d?"bg-teal-500":"bg-gray-300")})]},e.id)})})()}),(0,l.jsx)("div",{className:"hidden items-center sm:flex",children:M.map((e,t)=>{let r=e.icon,n=a===e.id,i=a>e.id,d=a>=e.id||i;return(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("button",{type:"button",onClick:()=>d&&s(e.id),disabled:!d,className:"flex h-12 w-12 items-center justify-center rounded-full border-2 transition-all duration-200 ".concat(i?"border-teal-500 bg-teal-500 text-white hover:bg-teal-600":n?"border-teal-500 bg-teal-50 text-teal-600 dar
1k:bg-teal-50":"cursor-not-allowed border-gray-300 text-gray-400"," ").concat(d&&!n?"hover:border-teal-400":""),children:i?(0,l.jsx)(x.default,{className:"h-5 w-5"}):(0,l.jsx)(r,{className:"h-5 w-5"})}),t<M.length-1&&(0,l.jsx)("div",{className:"mx-2 h-1 w-16 rounded-full transition-colors duration-200 ".concat(i?"bg-teal-500":"bg-gray-300")})]},e.id)})})]})}),(0,l.jsx)(N.Card,{className:"mx-auto border-0 shadow-lg dark:bg-white",children:(0,l.jsxs)(N.CardContent,{className:"p-4 md:p-8",children:[(()=>{switch(a){case 1:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(c.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Taille du logement"})]}),(0,l.jsxs)(w.Select,{value:r,onValueChange:q(1,n),children:[(0,l.jsx)(w.SelectTrigger,{className:"[&>span]:!line-clamp-none h-12 w-full text-left text-sm leading-tight md:leading-normal dark:text-stone-800",children:(0,l.jsx)(w.SelectValue,{placeholder:"S\xe9lectionnez la taille de votre logement"})}),(0,l.jsx)(w.SelectContent,{children:A.map(e=>(0,l.jsx)(w.SelectItem,{value:e.value,className:"py-3 text-base",children:e.label},e.value))})]})]});case 2:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(o.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Vos habitudes d'usage"})]}),(0,l.jsxs)(w.Select,{value:i,onValueChange:q(2,d),children:[(0,l.jsx)(w.SelectTrigger,{className:"[&>span]:!line-clamp-none h-12 w-full text-left text-sm leading-tight md:leading-normal dark:text-stone-800",children:(0,l.jsx)(w.SelectValue,{placeholder:"Quand utilisez-vous le plus d'\xe9lectricit\xe9 ?"})}),(0,l.jsx)(w.SelectContent,{children:F.map(e=>(0,l.jsx)(w.SelectItem,{value:e.value,className:"py-3 text-base",children:e.label},e.value))})]})]});case 3:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(m.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Appareils \xe9lectrom\xe9nagers"})]}),(0,l.jsx)("p",{className:"mb-6 text-stone-600",children:"S\xe9lectionnez les appareils \xe0 forte consommation que vous poss\xe9dez :"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:z.map(e=>{let t=e.icon,a=k.includes(e.id);return(0,l.jsx)(N.Card,{className:"cursor-pointer transition-all duration-200 hover:shadow-md dark:bg-white ".concat(a?"border-teal-500 bg-teal-50 shadow-sm dark:bg-teal-50":"border-gray-200 hover:border-teal-300"),onClick:()=>{a?W(k.filter(t=>t!==e.id)):W([...k,e.id])},children:(0,l.jsx)(N.CardContent,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg p-2 ".concat(a?"bg-teal-500 text-white":"bg-gray-100 text-gray-600"),children:(0,l.jsx)(t,{className:"h-5 w-5"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"my-0 font-medium text-stone-800 leading-none",children:e.label}),(0,l.jsxs)("p",{className:"my-0 text-sm text-stone-600",children:[e.power," kW"]})]})]}),a&&(0,l.jsx)("div",{className:"rounded-full bg-teal-500 p-1 text-white",children:(0,l.jsx)(x.default,{className:"h-4 w-4"})})]})})},e.id)})})]});case 4:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(u.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Informations compl\xe9mentaires (optionnel)"})]}),(0,l.jsx)("p",{className:"mb-6 text-stone-600",children:"Saisissez votre puissance actuelle pour d\xe9couvrir si vous pouvez \xe9conomiser de l'argent."}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)(y.Label,{htmlFor:"current-power",className:"font-medium text-base text-stone-800 dark:text-stone-800",children:"Puissance actuellement souscrite"}),(0,l.jsxs)(w.Select,{value:I,onValueChange:q(4,D,!1),children:[(0,l.jsx)(w.SelectTrigger,{id:"current-power",className:"[&>span]:!line-clamp-none h-12 w-full text-left text-sm leading-tight md:leading-normal dark:text-stone-800",children:(0,l.jsx)(w.SelectValue,{placeholder:"S\xe9lectionnez votre puissance actuelle"})}),(0,l.jsx)(w.SelectContent,{children:T.map(e=>(0,l.jsx)(w.SelectItem,{value:e,className:"py-3 text-base",children:e},e))})]})]})]});default:return null}})(),(0,l.jsxs)("div",{className:"mt-8 flex justify-between border-gray-200 border-t pt-6",children:[(0,l.jsx)(j.Button,{variant:"outline",onClick:()=>{s(Math.max(1,a-1))},disabled:1===a,className:"bg-transparent px-6 py-2 dark:text-stone-800",children:"Pr\xe9c\xe9dent"}),(0,l.jsx)(j.Button,{onClick:()=>
1{if(3===a){R(3,"multiselect"),s(4),setTimeout(()=>{let e=Array.from(document.querySelectorAll("h2")).find(e=>{var t;return null==(t=e.textContent)?void 0:t.includes("Calculateur de puissance souscrite")});null==e||e.scrollIntoView({behavior:"smooth",block:"start"})},100);return}if(4===a){B({eventWording:"Finaliser",eventStep:5}),V(!0);return}s(Math.min(4,a+1))},disabled:!(()=>{switch(a){case 1:return""!==r;case 2:return""!==i;case 3:case 4:return!0;default:return!1}})(),className:"border-secondary-500 bg-secondary-500 px-6 py-2 text-white hover:border-secondary-600 hover:bg-secondary-600 focus:ring-secondary-500 dark:border-secondary-500 dark:bg-secondary-500 dark:text-white dark:hover:border-secondary-600 dark:hover:bg-secondary-600",children:4===a?"Finaliser":"Suivant"})]})]})})]})]})})}function I(e){let{phoneNumber:t}=e;return(0,l.jsx)(k.TrackingProvider,{slice:{eventComponent:"ppn-calculateur-puissance"},children:(0,l.jsx)(W,{phoneNumber:t})})}},95482:(e,t,a)=>{a.r(t),a.d(t,{CalcolatorePotenza:()=>D});var l=a(54568),s=a(29768),r=a(52137),n=a(75097),i=a(77186),d=a(41169),c=a(43002),o=a(74624),m=a(70930),u=a(79502),x=a(6438),h=a(58997),p=a(45234),b=a(84990),g=a(56178),f=a(7620),v=a(24792),j=a(6845),N=a(5239),y=a(8049),w=a(32673),k=a(38584),C=a(23951);let S=["3 kW","3,5 kW","4 kW","4,5 kW","5 kW","5,5 kW","6 kW","7 kW","8 kW","9 kW","10 kW"],T=[{value:"small",label:"Appartamento piccolo (< 60 m\xb2)",power:3.45},{value:"medium",label:"Appartamento medio (60-90 m\xb2)",power:4.6},{value:"large",label:"Appartamento grande (90-120 m\xb2)",power:5.75},{value:"house",label:"Casa (> 120 m\xb2)",power:6.9}],A=[{value:"low",label:"Basso - Solo la sera/notte",multiplier:.8},{value:"medium",label:"Medio - Mattina e pomeriggio",multiplier:1},{value:"high",label:"Alto - Tutto il giorno a casa",multiplier:1.2}],F=[{id:"fridge",label:"Frigorifero",power:.3,icon:s.default},{id:"microwave",label:"Microonde",power:1.1,icon:r.default},{id:"washingMachine",label:"Lavatrice",power:1.5,icon:n.default},{id:"dishwasher",label:"Lavastoviglie",power:1.5,icon:n.default},{id:"oven",label:"Forno",power:1.1,icon:i.default},{id:"ac",label:"Climatizzatore",power:2.2,icon:s.default},{id:"tv",label:"Televisione",power:.2,icon:d.default}],z=[{id:1,title:"Dimensione dell'abitazione",icon:c.default},{id:2,title:"Abitudini di consumo",icon:o.default},{id:3,title:"Elettrodomestici",icon:m.default},{id:4,title:"Informazioni aggiuntive",icon:u.default}];function M(e){return Number.isInteger(e)?"".concat(e," kW"):"".concat(e.toString().replace(".",",")," kW")}function W(e){return Number.parseFloat(e.replace(",",".").replace(" kW",""))}function I(e){let{phoneNumber:t}=e,a=(0,C.useTracking)(),[s,r]=(0,f.useState)(1),[n,i]=(0,f.useState)(""),[d,k]=(0,f.useState)(""),[I,D]=(0,f.useState)([]),[P,V]=(0,f.useState)(""),[L,E]=(0,f.useState)(!1),B=()=>{var e;let t=T.find(e=>e.value===n),a=A.find(e=>e.value===d);if(!t||!a)return null;let l=t.power;return l*=a.multiplier,M((e=l+.7*I.reduce((e,t)=>{let a=F.find(e=>e.id===t);return e+((null==a?void 0:a.power)||0)},0))<=3?3:e>10?10:e<=6?Math.ceil(2*e)/2:Math.ceil(e))},R=B(),q=(()=>{if(!P)return null;let e=W(P),t=B();if(!t)return null;let a=W(t);if(a>e)return{type:"upgrade",difference:M(a-e)};if(a<e){let t=e-a,l=Math.round(35*t);return{type:"downgrade",difference:M(t),savings:l}}return{type:"optimal"}})();return(0,l.jsx)("div",{className:"bg-slate-100 px-4 py-12",children:(0,l.jsxs)("div",{className:"mx-auto max-w-4xl space-y-8",children:[(0,l.jsx)("div",{className:"space-y-6 text-center",children:(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("h2",{className:"mt-0 mb-0 flex flex-col items-center justify-center gap-3 font-bold text-2xl text-stone-800 sm:flex-row md:text-3xl",style:{fontFamily:"var(--font-heading)"},children:[(0,l.jsx)(u.default,{className:"h-10 w-10 text-teal-600"}),"Calcolatore di Potenza Impegnata"]}),(0,l.jsx)("p",{className:"mx-auto text-lg text-stone-600",children:"Scopri quanto puoi risparmiare ottimizzando il tuo contratto di energia elettrica."})]})}),L?(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-2",children:[R&&(0,l.jsxs)(N.Card,{className:"justify-center border-0 bg-teal-50 shadow-lg dark:border-teal-200 dark:bg-teal-50",children:[(0,l.jsxs)(N.CardHeader,{className:"pb-4 text-center",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center justify-center gap-2",children:[(0,l.jsx)(h.default,{className:"h-6 w-6 text-teal-600"}),(0,l.jsx)("span",{className:"font-semibold text-stone-800 text-xl",children:"La tua potenza consigliata"})]}),(0,l.jsx)("div",{className:"mb-2 font-bold text-5xl text-teal-600",children:R}),(0,l.jsx)("p",{className:"text-lg text-stone-600",children:"Potenza ottimale per la tua abitazione"})]}),(0,l.jsxs)(N.CardContent,{className:"space-y-6",children:[(0,l.jsx)("p",{className:"text-center text-stone-600 dar
1k:text-stone-600",children:"Basato sul tuo profilo di consumo e sugli elettrodomestici selezionati."}),(null==q?void 0:q.type)==="downgrade"&&(0,l.jsxs)("div",{className:"rounded-lg border border-primary-200 bg-primary-100 p-4 dark:border-primary-200 dark:bg-primary-100",children:[(0,l.jsxs)("p",{className:"my-0 text-center font-bold text-lg text-primary-700",children:["Potresti risparmiare fino a ",q.savings,"⬠all'anno!"]}),(0,l.jsxs)("p",{className:"my-0 mt-1 text-center text-primary-600 text-sm",children:["Riducendo di ",q.difference," la tua potenza impegnata."]})]}),(null==q?void 0:q.type)==="upgrade"&&(0,l.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-200 dark:bg-amber-50",children:[(0,l.jsx)("p",{className:"my-0 text-center font-bold text-amber-700 text-lg",children:"Ti consigliamo di aumentare la potenza"}),(0,l.jsxs)("p",{className:"my-0 mt-1 text-center text-amber-600 text-sm",children:["La tua potenza attuale potrebbe non essere sufficiente. Ti suggeriamo un aumento di"," ",q.difference,"."]})]}),(null==q?void 0:q.type)==="optimal"&&(0,l.jsxs)("div",{className:"rounded-lg border border-teal-200 bg-teal-100 p-4 dark:border-teal-200 dark:bg-teal-100",children:[(0,l.jsx)("p",{className:"my-0 text-center font-bold text-lg text-teal-700",children:"La tua potenza attuale \xe8 ottimale!"}),(0,l.jsx)("p",{className:"my-0 mt-1 text-center text-sm text-teal-600",children:"Il tuo contratto attuale \xe8 gi\xe0 adatto alle tue esigenze."})]}),(0,l.jsxs)(j.Button,{onClick:()=>{a({event:"form",eventCategory:"engagement",eventType:"interaction",eventWording:"Ricalcola"}),r(1),i(""),k(""),D([]),V(""),E(!1)},variant:"outline",className:"mt-4 w-full border-secondary-500 bg-secondary-500 text-white hover:border-secondary-600 hover:bg-secondary-600 focus:ring-secondary-500 dark:border-secondary-500 dark:bg-secondary-500 dark:text-white dark:hover:border-secondary-600 dark:hover:bg-secondary-600",children:[(0,l.jsx)(p.default,{className:"mr-2 h-4 w-4"}),"Ricalcola"]})]})]}),(0,l.jsxs)(N.Card,{className:"border-0 shadow-lg dark:bg-white",children:[(0,l.jsxs)(N.CardHeader,{className:"text-center",children:[(0,l.jsx)(N.CardTitle,{className:"mt-0 font-bold text-stone-800 text-xl",children:"Hai bisogno di assistenza personalizzata?"}),(0,l.jsxs)(N.CardDescription,{className:"text-stone-600",children:["Trova la"," ",(0,l.jsx)("span",{className:"font-semibold",children:"tariffa pi\xf9 conveniente"})," ","per le tue esigenze specifiche."]})]}),(0,l.jsxs)(N.CardContent,{className:"space-y-6",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,l.jsx)(v.CallToAction,{radius:"round",className:"w-full sm:w-full md:w-full",callModeAttributes:{href:"tel:".concat(null!=t?t:"0697631601"),value:null!=t?t:"06 9763 1601",icon:"phone"},displayMode:"call",variant:"secondary"}),(0,l.jsx)(v.CallToAction,{className:"w-full border-teal-500 bg-transparent text-teal-600 hover:bg-teal-50 sm:w-full md:w-full dark:hover:bg-teal-950/20",variant:"secondaryInverse",appModeAttributes:{value:"Parla con un esperto",isCallback:!0,href:"#",icon:"wcb"}})]}),(0,l.jsxs)("div",{className:"space-y-4 border-gray-200 border-t pt-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-full bg-teal-100 p-1 dark:bg-teal-100",children:(0,l.jsx)(x.default,{className:"h-4 w-4 text-teal-600"})}),(0,l.jsx)("span",{className:"text-sm text-stone-800",children:"Consulenza senza impegno"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-full bg-teal-100 p-1 dark:bg-teal-100",children:(0,l.jsx)(b.default,{className:"h-4 w-4 text-teal-600"})}),(0,l.jsx)("span",{className:"text-sm text-stone-800",children:"Esperti in tariffe elettriche"})]}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-full bg-teal-100 p-1 dark:bg-teal-100",children:(0,l.jsx)(g.default,{className:"h-4 w-4 text-teal-600"})}),(0,l.jsx)("span",{className:"text-sm text-stone-800",children:"Ti aiutiamo a cambiare fornitore"})]})]})]})]})]})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"flex items-center justify-center",children:(0,l.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,l.jsx)("div",{className:"flex items-center sm:hidden md:space-x-4",children:(()=>{let e=s-1,t=e+1,a=[z[e]];return t<z.length&&a.push(z[t]),a.map((e,t)=>{if(!e)return null;let n=e.icon,i=s===e.id,d=s>e.id,c=s>=e.id||d;return(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("button",{type:"button",onClick:()=>c&&r(e.id),disabled:!c,className:"flex h-12 w-12 items-center justify-center rounded-full border-2 transition-all duration-200 ".concat(d?"border-teal-500 bg-teal-500 text-white hover:bg-teal-600":i?"border-teal-500 bg-teal-50 text-teal-600 dar
1k:bg-teal-50":"cursor-not-allowed border-gray-300 text-gray-400"," ").concat(c&&!i?"hover:border-teal-400":""),children:d?(0,l.jsx)(x.default,{className:"h-5 w-5"}):(0,l.jsx)(n,{className:"h-5 w-5"})}),t<a.length-1&&(0,l.jsx)("div",{className:"mx-2 h-1 w-16 rounded-full transition-colors duration-200 ".concat(d?"bg-teal-500":"bg-gray-300")})]},e.id)})})()}),(0,l.jsx)("div",{className:"hidden items-center sm:flex",children:z.map((e,t)=>{let a=e.icon,n=s===e.id,i=s>e.id,d=s>=e.id||i;return(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsx)("button",{type:"button",onClick:()=>d&&r(e.id),disabled:!d,className:"flex h-12 w-12 items-center justify-center rounded-full border-2 transition-all duration-200 ".concat(i?"border-teal-500 bg-teal-500 text-white hover:bg-teal-600":n?"border-teal-500 bg-teal-50 text-teal-600 dark:bg-teal-50":"cursor-not-allowed border-gray-300 text-gray-400"," ").concat(d&&!n?"hover:border-teal-400":""),children:i?(0,l.jsx)(x.default,{className:"h-5 w-5"}):(0,l.jsx)(a,{className:"h-5 w-5"})}),t<z.length-1&&(0,l.jsx)("div",{className:"mx-2 h-1 w-16 rounded-full transition-colors duration-200 ".concat(i?"bg-teal-500":"bg-gray-300")})]},e.id)})})]})}),(0,l.jsx)(N.Card,{className:"mx-auto border-0 shadow-lg dark:bg-white",children:(0,l.jsxs)(N.CardContent,{className:"p-4 md:p-8",children:[(()=>{switch(s){case 1:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(c.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Dimensione dell'abitazione"})]}),(0,l.jsxs)(w.Select,{value:n,onValueChange:e=>{i(e),a({event:"form",eventCategory:"engagement",eventType:"interaction",eventWording:"Dimensione dell'abitazione"}),setTimeout(()=>{r(2)},300)},children:[(0,l.jsx)(w.SelectTrigger,{className:"[&>span]:!line-clamp-none h-12 w-full text-left text-sm leading-tight md:leading-normal dark:text-stone-800",children:(0,l.jsx)(w.SelectValue,{placeholder:"Seleziona la dimensione della tua abitazione"})}),(0,l.jsx)(w.SelectContent,{children:T.map(e=>(0,l.jsx)(w.SelectItem,{value:e.value,className:"py-3 text-base",children:e.label},e.value))})]})]});case 2:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(o.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Abitudini di consumo"})]}),(0,l.jsxs)(w.Select,{value:d,onValueChange:e=>{k(e),a({event:"form",eventCategory:"engagement",eventType:"interaction",eventWording:"Abitudini di consumo"}),setTimeout(()=>{r(3)},300)},children:[(0,l.jsx)(w.SelectTrigger,{className:"[&>span]:!line-clamp-none h-12 w-full text-left text-sm leading-tight md:leading-normal dark:text-stone-800",children:(0,l.jsx)(w.SelectValue,{placeholder:"Quando consumi pi\xf9 elettricit\xe0?"})}),(0,l.jsx)(w.SelectContent,{children:A.map(e=>(0,l.jsx)(w.SelectItem,{value:e.value,className:"py-3 text-base",children:e.label},e.value))})]})]});case 3:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(m.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Elettrodomestici"})]}),(0,l.jsx)("p",{className:"mb-6 text-stone-600",children:"Seleziona gli elettrodomestici ad alto consumo che possiedi:"}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:F.map(e=>{let t=e.icon,a=I.includes(e.id);return(0,l.jsx)(N.Card,{className:"cursor-pointer transition-all duration-200 hover:shadow-md dark:bg-white ".concat(a?"border-teal-500 bg-teal-50 shadow-sm dark:bg-teal-50":"border-gray-200 hover:border-teal-300"),onClick:()=>{a?D(I.filter(t=>t!==e.id)):D([...I,e.id])},children:(0,l.jsx)(N.CardContent,{className:"p-4",children:(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg p-2 ".concat(a?"bg-teal-500 text-white":"bg-gray-100 text-gray-600"),children:(0,l.jsx)(t,{className:"h-5 w-5"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"my-0 font-medium text-stone-800 leading-none",children:e.label}),(0,l.jsxs)("p",{className:"my-0 text-sm text-stone-600",children:[e.power," kW"]})]})]}),a&&(0,l.jsx)("div",{className:"rounded-full bg-teal-500 p-1 text-white",children:(0,l.jsx)(x.default,{className:"h-4 w-4"})})]})})},e.id)})})]});case 4:return(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,l.jsx)("div",{className:"rounded-lg bg-teal-100 p-2 dark:bg-teal-100",children:(0,l.jsx)(u.default,{className:"h-6 w-6 text-teal-600"})}),(0,l.jsx)("h2",{className:"my-0 font-semibold text-lg text-stone-800 md:text-xl",children:"Informazioni aggiuntive (facoltativo)"})]}),(0,l.jsx)("p",{className:"mb-6 text-stone-600",children:"Inserisci la tua potenza attuale per scoprire se puoi risparmiare."}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)(y.Label,{htmlFor:"current-power",className:"font-medium text-base text-stone-800 dark:text-stone-800",children:"Potenza attualmente sottoscritta"}),(0,l.jsxs)(w.Select,{value:P,onValueChange:V,children:[(0,l.jsx)(w.SelectTrigger,{id:"current-power",className:"[&>span]:!line-clamp-none h-12 w-full text-left text-sm leading-tight md:leading-normal dark:text-stone-800",children:(0,l.jsx)(w.SelectValue,{placeholder:"Seleziona la tua potenza attuale"})}),(0,l.jsx)(w.SelectContent,{children:S.map(e=>(0,l.jsx)(w.SelectItem,{value:e,className:"py-3 text-base",children:e},e))})]})]})]});default:return null}})(),(0,l.jsxs)("div",{className:"mt-8 flex justify-between border-gray-200 border-t pt-6",children:[(0,l.jsx)(j.Button,{variant:"outline",onClick:()=>{r(Math.max(1,s-1))},disabled:1===s,className:"bg-transparent px-6 py-2 dark:text-stone-800",children:"Precedente"}),(0,l.jsx)(j.Button,{onClick:()=>{var e,t;a({event:"form",eventCategory:"engagement",eventType:"interaction",eventWording:null!=(t=null==(e=z[s-1])?void 0:e.title)?t:""}),4===s?E(!0):(r(Math.min(4,s+1)),3===s&&setTimeout(()=>{let e=Array.from(document.querySelectorAll("h2")).find(e=>{var t;return null==(t=e.textContent)?void 0:t.includes("Calcolatore di Potenza Impegnata")});e&&e.scrollIntoView({behavior:"smooth",block:"start"})},100))},disabled:!(()=>{switch(s){case 1:return""!==n;case 2:return""!==d;case 3:case 4:return!0;default:return!1}})(),className:"border-secondary-500 bg-secondary-500 px-6 py-2 text-white hover:border-secondary-600 hover:bg-secondary-600 focus:ring-secondary-500 dark:border-secondary-500 dark:bg-secondary-500 dark:text-white dark:hover:border-secondary-600 dark:hover:bg-secondary-600",children:4===s?"Calcola":"Avanti"})]})]})})]})]})})}function D(e){let{phoneNumber:t}=e;return(0,l.jsx)(k.TrackingProvider,{slice:{eventComponent:"ppn-calcolatore-potenza"},children:(0,l.jsx)(I,{phoneNumber:t})})}}}]);
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.