PageSourceSearch

https://renthunter.nl/_next/static/chunks/4790-701f74462e3ae822.js

js renthunter.nl collected 2026-10-08 03:04:03 UTC 13,367 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4790],{20656:(e,t,a)=>{a.d(t,{A:()=>d});var s=a(67867),l=a(11470),i=a(12844),r=a(95155),n=a(12115),c=a(95604);let d=e=>{var{loading:t,children:a,disabled:d}=e,o=(0,i._)(e,["loading","children","disabled"]);let[m,x]=(0,n.useState)({width:0,height:0}),h=(0,n.useRef)(null);(0,n.useEffect)(()=>{h.current&&!t&&x({width:h.current.offsetWidth,height:h.current.offsetHeight})},[a,t]);let u=(0,c.useTranslations)();return(0,r.jsx)("button",(0,l._)((0,s._)({type:"button"},o),{disabled:t||d,ref:h,style:{display:"flex",alignItems:"center",justifyContent:"center",opacity:d||t?.7:1,cursor:d||t?"not-allowed":"pointer",minWidth:t&&m.width?"".concat(m.width,"px"):"auto",minHeight:t&&m.height?"".concat(m.height,"px"):"auto"},children:t?(0,r.jsx)("div",{className:"flex items-center justify-center",children:(0,r.jsx)("div",{className:"border-l-lightBg! text-primary-medium inline-block h-4 w-4 animate-spin rounded-full border-[0.1em]",role:"status",children:(0,r.jsx)("span",{className:"hidden",children:u("loading")})})}):a}))}},24790:(e,t,a)=>{a.d(t,{A:()=>I});var s=a(67867),l=a(11470),i=a(95155),r=a(12115),n=a(95604),c=a(91480),d=a(2996),o=a(89679),m=a(66874),x=a(11064),h=a(50705),u=a(94908),p=a(11140),y=a(85989),b=a(35596),g=a(15957),f=a(8595),v=a(18527),j=a(26615),N=a(36204),_=a(33173),k=a(20656),T=a(46660),w=a(103),S=a(59076),C=a(87531),A=a(81756),K=a(25170),D=a(78235),E=a(85167),P=a(77303);let B=[{id:"Gas & Electricity",labelKey:"gasElectricity",icon:c.A},{id:"TV & Internet",labelKey:"tvInternet",icon:d.A},{id:"Mobile (sim)",labelKey:"mobile",icon:o.A},{id:"Water",labelKey:"water",icon:m.A},{id:"Insurances",labelKey:"insurances",icon:x.A},{id:"Dutch bankaccount",labelKey:"bankAccount",icon:h.A},{id:"(International) Moving",labelKey:"moving",icon:u.A},{id:"City Heating",labelKey:"cityHeating",icon:p.A}],M=[{id:"Solar Panel",labelKey:"solarPanel",icon:y.A},{id:"Heat Pump",labelKey:"heatPump",icon:b.A},{id:"Car Lease",labelKey:"carLease",icon:g.A},{id:"Home Security",labelKey:"homeSecurity",icon:f.A}],O=["Gas & Electricity","Water","TV & Internet"],G=[{value:"Mr",labelKey:"mr"}
1,{value:"Mrs",labelKey:"mrs"}],I=e=>{let{onClose:t}=e,a=(0,n.useTranslations)("home2.utilityDirect.form"),{user:c}=(0,w.Jd)(),[d,o]=(0,r.useState)(1),[m,x]=(0,r.useState)(!1),[h,u]=(0,r.useState)(!1),p=(0,r.useMemo)(()=>(null==c?void 0:c.saved_searches)?c.saved_searches.find(e=>e.is_activated&&!e.deleted_at)||c.saved_searches[0]:null,[null==c?void 0:c.saved_searches]),y=e=>e?e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):"",b=e=>{if(!e)return"";let t=new Date(e);return isNaN(t.getTime())?"":t.toISOString().split("T")[0]},[g,f]=(0,r.useState)({selectedServices:O,city:y(null==p?void 0:p.municipality),desiredStartDate:(()=>{let e=new Date;return e.setMonth(e.getMonth()+1),b(e)})(),salutation:"Mr",firstName:(null==c?void 0:c.firstname)||"",lastName:(null==c?void 0:c.lastname)||"",email:(null==c?void 0:c.email)||"",phone:(null==c?void 0:c.whatsapp_phone)||(null==c?void 0:c.phone_number)||"",dateOfBirth:b(null==c?void 0:c.date_of_birth),consentGiven:!1});(0,r.useEffect)(()=>{c&&f(e=>(0,l._)((0,s._)({},e),{firstName:e.firstName||c.firstname||"",lastName:e.lastName||c.lastname||"",email:e.email||c.email||"",phone:e.phone||c.whatsapp_phone||c.phone_number||"",dateOfBirth:e.dateOfBirth||b(c.date_of_birth)}))},[c]),(0,r.useEffect)(()=>{(null==p?void 0:p.municipality)&&f(e=>(0,l._)((0,s._)({},e),{city:e.city||y(p.municipality)}))},[p]);let I=g.selectedServices.length>0,H=""!==g.city.trim(),L=g.phone&&!(0,S.r)(g.phone),z=""!==g.firstName.trim()&&""!==g.lastName.trim()&&""!==g.email.trim()&&""!==g.phone.trim()&&!L&&g.consentGiven,R=async()=>{if(z){x(!0);try{let e={email:g.email.trim().toLowerCase(),phone:g.phone.trim(),firstname:g.firstName.trim(),lastname:g.lastName.trim(),salutation:g.salutation,date_of_birth:g.dateOfBirth||null,city:g.city.trim(),desired_start_date:g.desiredStartDate||null,selected_services:g.selectedServices,consent_given:g.consentGiven};await A.A.post("/utility-direct-lead",e),D.j.logEvent(E.R.utility_direct_form_submitted,void 0,{services_count:g.selectedServices.length,services:g.selectedServices.join(",")}),u(!0)}catch(e){(0,K.F)(e,{operation:"submitUtilityDirectLead"}),P.Ay.error((null==e?void 0:e.message)||a("errorSubmitting"))}finally{x(!1)}}},W=e=>{g.selectedServices.includes(e)?f((0,l._)((0,s._)({},g),{selectedServices:g.selectedServices.filter(t=>t!==e)})):f((0,l._)((0,s._)({},g),{selectedServices:[...g.selectedServices,e]}))};return h?(0,i.jsxs)("div",{className:"flex min-h-[400px] flex-col items-center justify-center p-8 text-center",children:[(0,i.jsx)("div",{className:"bg-green/10 mb-6 flex h-20 w-20 items-center justify-center rounded-full",children:(0,i.jsx)(v.A,{className:"text-green h-10 w-10"})}),(0,i.jsx)("h2",{className:"text-primary mb-3 text-2xl font-bold",children:a("successTitle")}),(0,i.jsx)("p",{className:"text-gray-darkText mb-6 max-w-sm",children:a("successDescription")}),(0,i.jsx)("button",{type:"button",onClick:t,className:"btn btn-primary px-8 py-3",children:a("close")})]}):(0,i.jsxs)("div",{className:"text-primary flex h-full flex-col bg-white",children:[(0,i.jsxs)("div",{className:"border-gray-lightText/20 flex items-center justify-between border-b px-6 py-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h2",{className:"text-primary text-lg font-bold",children:a("title")}),(0,i.jsxs)("p",{className:"text-gray-lightText text-sm",children:[a("step")," ",d," ",a("of")," 3"]})]}),(0,i.jsx)("button",{type:"button",onClick:t,className:"text-gray-lightText hover:text-primary p-1 transition-colors","aria-label":"Close",children:(0,i.jsx)(j.A,{size:24})})]}),(0,i.jsx)("div",{className:"flex gap-2 px-6 py-3",children:[1,2,3].map(e=>(0,i.jsx)("div",{className:(0,C.cn)("h-1.5 flex-1 rounded-full transition-colors",e<=d?"bg-secondary":"bg-gray-lightText/20")},e))}),(0,i.jsxs)("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:[1===d&&(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,i.jsxs)("div",{children:[(0,i.jsxs)("h3",{className:"text-primary mb-2 text-xl font-bold",children:[a("step1TitlePart1")," ",(0,i.jsx)("span",{className:"text-secondary",children:a("step1TitleAccent")})]}),(0,i.jsx)("p",{className:"text-gray-lightText text-sm",children:a("step1Description")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-gray-darkText mb-3 block text-sm font-medium",children:a("selectServices")}),(0,i.jsx)("div",{className:"grid grid-cols-2 gap-2 lg:grid-cols-4",children:B.map(e=>{let t=e.icon,s=g.selectedServices.includes(e.id);return(0,i.jsxs)("button",{type:"button",onClick:()=>W(e.id),className:(0,C.cn)("flex flex-col items-center justify-center rounded-lg border px-2 py-3 transition-all",s?"border-secondary bg-secondary/5":"border-gray-lightText/20 hover:border-primary/20"),children:[(0,i.jsx)(t,{className:(0,C.cn)("mb-1.5 h-5 w-5",s?"text-secondary":"text-gray-lightText")}),(0,i.jsx)("span",{className:(0,C.cn)("text-center text-sm font-medium leading-tight",s?"text-primary":"text-gray-darkText"),children:a("services.".concat(e.labelKey))})]},e.id)})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-gray-lightText mb-3 block text-sm",children:a("extraServices")}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:M.map(e=>{let t=e.icon,s=g.selectedServices.includes(e.id);return(0,i.jsxs)("button",{type:"button",onClick:()=>W(e.id),className:(0,C.cn)("flex items-center gap-2 rounded-full border px-4 py-2 text-sm transition-all",s?"border-secondary bg-secondary/5 text-primary":"border-gray-lightText/30 text-gray-darkText hover:border-primary/30"),children:[(0,i.jsx)(t,{className:(0,C.cn)("h-4 w-4",s?"text-secondary":"text-gray-lightText")}),a("services.".concat(e.labelKey))]},e.id)})})]})]}),2===d&&(0,i.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"text-primary mb-1 text-base font-semibold",children:a("step2Title")}),(0,i.jsx)("p",{className:"text-gray-lightText text-sm",children:a("step2Description")})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("label",{className:"text-gray-darkText mb-2 block text-sm font-medium",children:[a("city")," *"]}),(0,i.jsx)("input",{type:"text",value:g.city,onChange:e=>f((0,l._)((0,s._)({},g),{city:e.target.value})),placeholder:a("cityPlaceholder"),className:"w-full"})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-gray-darkText mb-2 block text-sm font-medium",children:a("desiredStartDate")}
1),(0,i.jsx)("input",{type:"date",value:g.desiredStartDate,onChange:e=>f((0,l._)((0,s._)({},g),{desiredStartDate:e.target.value})),className:"w-full"})]})]}),3===d&&(0,i.jsxs)("form",{className:"flex flex-col gap-5",onSubmit:e=>{e.preventDefault(),R()},children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"text-primary mb-1 text-base font-semibold",children:a("step3Title")}),(0,i.jsx)("p",{className:"text-gray-lightText text-sm",children:a("step3Description")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-gray-darkText mb-2 block text-sm font-medium",children:a("salutation")}),(0,i.jsx)("div",{className:"flex gap-4",children:G.map(e=>(0,i.jsxs)("label",{className:(0,C.cn)("flex cursor-pointer items-center gap-2 rounded-lg border px-4 py-2 transition-colors",g.salutation===e.value?"border-secondary bg-secondary/5":"border-gray-lightText/30 hover:border-primary/30"),children:[(0,i.jsx)("input",{type:"radio",name:"salutation",value:e.value,checked:g.salutation===e.value,onChange:e=>f((0,l._)((0,s._)({},g),{salutation:e.target.value})),className:"text-secondary h-4 w-4"}),(0,i.jsx)("span",{className:"text-primary text-sm",children:a("salutations.".concat(e.labelKey))})]},e.value))})]}),(0,i.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,i.jsxs)("div",{children:[(0,i.jsxs)("label",{className:"text-gray-darkText mb-2 block text-sm font-medium",children:[a("firstName")," *"]}),(0,i.jsx)("input",{name:"given-name",autoComplete:"given-name",type:"text",value:g.firstName,onChange:e=>f((0,l._)((0,s._)({},g),{firstName:e.target.value})),placeholder:a("firstNamePlaceholder"),className:"w-full"})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("label",{className:"text-gray-darkText mb-2 block text-sm font-medium",children:[a("lastName")," *"]}),(0,i.jsx)("input",{name:"family-name",autoComplete:"family-name",type:"text",value:g.lastName,onChange:e=>f((0,l._)((0,s._)({},g),{lastName:e.target.value})),placeholder:a("lastNamePlaceholder"),className:"w-full"})]})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("label",{className:"text-gray-darkText mb-2 block text-sm font-medium",children:[a("email")," *"]}),(0,i.jsx)("input",{id:"utility-email",name:"email",autoComplete:"email",type:"email",value:g.email,onChange:e=>f((0,l._)((0,s._)({},g),{email:e.target.value})),placeholder:a("emailPlaceholder"),className:"w-full"})]}),(0,i.jsxs)("div",{children:[(0,i.jsxs)("label",{className:"text-gray-darkText mb-2 block text-sm font-medium",children:[a("phone")," *"]}),(0,i.jsx)(T.A,{phone:g.phone,onChange:e=>f((0,l._)((0,s._)({},g),{phone:e}))}),L&&(0,i.jsx)("span",{className:"mt-1 text-xs text-red-600",children:a("invalidPhone")})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:"text-gray-darkText mb-2 block text-sm font-medium",children:a("dateOfBirth")}),(0,i.jsx)("input",{type:"date",value:g.dateOfBirth,onChange:e=>f((0,l._)((0,s._)({},g),{dateOfBirth:e.target.value})),className:"w-full"})]}),(0,i.jsx)("div",{className:"mt-2",children:(0,i.jsxs)("label",{className:"flex cursor-pointer gap-3",children:[(0,i.jsx)("input",{type:"checkbox",checked:g.consentGiven,onChange:e=>f((0,l._)((0,s._)({},g),{consentGiven:e.target.checked})),className:"text-secondary mt-1 h-4 w-4 shrink-0 rounded"}),(0,i.jsx)("span",{className:"text-gray-darkText text-sm leading-relaxed",children:a("consentText")})]})})]})]}),(0,i.jsxs)("div",{className:"border-gray-lightText/20 flex items-center justify-between border-t px-6 py-4",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>{d>1?o(d-1):t()},className:"text-gray-lightText hover:text-primary flex items-center gap-2 text-sm font-medium transition-colors",children:[(0,i.jsx)(N.A,{size:18}),1===d?a("cancel"):a("back")]}),d<3?(0,i.jsxs)("button",{type:"button",onClick:()=>{d<3&&(o(d+1),D.j.logEvent("".concat(E.R.utility_direct_form_step_).concat(d+1)))},disabled:1===d&&!I||2===d&&!H,className:(0,C.cn)("bg-secondary hover:bg-secondary/90 flex items-center gap-2 rounded-lg px-6 py-2.5 text-sm font-semibold text-white transition-all",(1===d&&!I||2===d&&!H)&&"cursor-not-allowed opacity-50"),children:[a("next"),(0,i.jsx)(_.A,{size:18})]}):(0,i.jsx)(k.A,{onClick:R,disabled:!z,loading:m,className:(0,C.cn)("bg-secondary hover:bg-secondary/90 flex items-center gap-2 rounded-lg px-6 py-2.5 text-sm font-semibold text-white transition-all",!z&&"cursor-not-allowed opacity-50"),children:a("submit")})]})]})}},46660:(e,t,a)=>{a.d(t,{A:()=>i});var s=a(95155),l=a(81602);a(30594);let i=e=>{let{phone:t,onChange:a}=e;return(0,s.jsx)(l.LR,{defaultCountry:"nl",preferredCountries:["nl","it","de","fr","es","us","be","gr","ro","hu","uk","pt","pl","in","bg","cy","tr","ie","lt","lv","sk","fi","au","za","lu","se","si","ch","ae","at"],value:t,onChange:a})}}}]);

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.