PageSourceSearch

https://my-account.stwater.co.uk/_next/static/chunks/pages/move-home/new-address-c325d53d214bc4e4.js

js stwater.co.uk collected 2026-09-24 18:07:08 UTC 14,537 bytes, 2 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="12a07678-5e7d-4145-b040-0f5c500ed584",e._sentryDebugIdIdentifier="sentry-dbid-12a07678-5e7d-4145-b040-0f5c500ed584")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8125],{3657:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ServiceablePropertiesLookup"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"postcode"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"allowedBrandCodes"}},type:{kind:"ListType",type:{kind:"NamedType",name:{kind:"Name",value:"BrandChoices"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"serviceableProperties"},arguments:[{kind:"Argument",name:{kind:"Name",value:"postcode"},value:{kind:"Variable",name:{kind:"Name",value:"postcode"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"500"}},{kind:"Argument",name:{kind:"Name",value:"allowedBrandCodes"},value:{kind:"Variable",name:{kind:"Name",value:"allowedBrandCodes"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"edges"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"node"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"propertyId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"address"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"canMoveInOnline"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"readingRequirement"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"supportsLanguagePicker"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:371}};n.loc.source={body:"query ServiceablePropertiesLookup(\n  $postcode: String!\n  $allowedBrandCodes: [BrandChoices]\n) {\n  serviceableProperties(\n    postcode: $postcode\n    first: 500\n    allowedBrandCodes: $allowedBrandCodes\n  ) {\n    edges {\n      node {\n        propertyId\n        address\n        canMoveInOnline\n        readingRequirement\n        supportsLanguagePicker\n      }\n    }\n  }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var t={};function a(e,n){for(var t=0;t<e.definitions.length;t++){var a=e.definitions[t];if(a.name&&a.name.value==n)return a}}n.definitions.forEach(function(e){if(e.name){var n=new Set;!function e(n,t){if("FragmentSpread"===n.kind)t.add(n.name.value);else if("VariableDefinition"===n.kind){var a=n.type;"NamedType"===a.kind&&t.add(a.name.value)}n.selectionSet&&n.selectionSet.selections.forEach(function(n){e(n,t)}),n.variableDefinitions&&n.variableDefinitions.forEach(function(n){e(n,t)}),n.definitions&&n.definitions.forEach(function(n){e(n,t)})}(e,n),t[e.name.value]=n}}),e.exports=n,e.exports.ServiceablePropertiesLookup=function(e,n){var s={kind:e.kind,definitions:[a(e,n)]};e.hasOwnProperty("loc")&&(s.loc=e.loc);var r=t[n]||new Set,i=new Set,d=new Set;for(r.forEach(function(e){d.add(e)});d.size>0;){var o=d;d=new Set,o.forEach(function(e){i.has(e)||(i.add(e),(t[e]||new Set).forEach(function(e){d.add(e)}))})}return i.forEach(function(n){var t=a(e,n);t&&s.definitions.push(t)}),s}(n,"ServiceablePropertiesLookup")},12110:(e,n,t)=>{"use strict";t.d(n,{D7:()=>d,nP:()=>i});var a=t(6029),s=t(55729);let r=(0,s.createContext)({}),i=e=>{let{initialPagesInJourney:n=[],initialMoveOutDate:t,initialMoveInDate:i,initialFinalReading:d,initialNewBillingAddress:o,initialHasNewAddress:l,initialIsResponsibleForBill:u,initialPostcode:c="",onNewAddressSubmissionSpy:v,initialNextResidentDetails:m={knowsNextResident:"",givenName:"",familyName:""}}
1=e,[h,p]=(0,s.useState)(n),[f,g]=(0,s.useState)(t),[k,y]=(0,s.useState)(i),[b,x]=(0,s.useState)(d),[S,w]=(0,s.useState)(o),[j,N]=(0,s.useState)(l),[I,P]=(0,s.useState)(u),[E,D]=(0,s.useState)(!1),[A,C]=(0,s.useState)(c),[F,M]=(0,s.useState)(m);return(0,a.jsx)(r.Provider,{value:{moveOutDate:f,setMoveOutDate:g,moveInDate:k,setMoveInDate:y,finalReading:b,setFinalReading:x,pagesInJourney:h,setPagesInJourney:p,setNewBillingAddress:w,newBillingAddress:S,setPostcode:C,postcode:A,hasNewAddress:j,setHasNewAddress:N,isResponsibleForBill:I,setIsResponsibleForBill:P,onNewAddressSubmission:e=>{w(e.billingAddress),y(e.moveInDate),C(e.postcode),N(e.hasNewAddress),P(e.responsibleForBill),v&&v(e)},nextResidentDetails:F,setNextResidentDetails:M,setSkipFinalRead:D,skipFinalRead:E},children:e.children})},d=()=>{let e=(0,s.useContext)(r);if(void 0===e)throw Error("useHomeMoveContext must be used within a HomeMoveContextProvider");return e}},12357:(e,n,t)=>{"use strict";t.d(n,{i:()=>s});var a=t(61296);let s=e=>{e(a.I.CLOSING),setTimeout(()=>{e(a.I.CLOSED)},700)}},34873:(e,n,t)=>{"use strict";t.d(n,{u:()=>a});let a=(e,n,t=!0)=>e.map((e,a)=>{let s=e.name,r=`Step ${a+1} ${s}`;return{...t&&{title:e.name},"aria-label":a<n?`${r} completed`:r}})},38176:(e,n,t)=>{"use strict";t.d(n,{Is:()=>o,dn:()=>i,eH:()=>d});var a=t(55729),s=t(81278),r=t(48379);let i=({currentStep:e,paths:n,condition:t=!0,redirectIndex:r=0})=>{let{push:i}=(0,s.useRouter)();(0,a.useEffect)(()=>{if(e>0&&t&&n.length){let e=Math.min(r,n.length-1);i(n[e].path)}},[e,t,n,i,r])},d=(e,n)=>!!e&&(e!==r.Wk.No||!!n),o=(e,n)=>{let t=e.findIndex(e=>n===e.path);return -1!==t?t:0}},41966:(e,n,t)=>{"use strict";t.d(n,{G:()=>d});var a=t(84475),s=t(51543),r=t(3657),i=t.n(r);let d=({postcode:e})=>{let n=(0,s.Se)();return(0,a.Gp)({queryKey:["serviceablePropertiesLookup"],query:i(),select:e=>(e.serviceableProperties?.edges??[]).flatMap(e=>e?.node?[{node:e.node}]:[]).sort((e,n)=>e.node.address.localeCompare(n.node.address)),validateFn:e=>Promise.resolve(e),enabled:!1,variables:{postcode:e,allowedBrandCodes:n}})}},48775:(e,n,t)=>{"use strict";t.d(n,{A:()=>C});var a=t(6029),s=t(55729),r=t(81278),i=t(84680),d=t(45329),o=t(34873),l=t(61296),u=t(7911),c=t(54121),v=t(19288),m=t(68056),h=t(11692),p=t(58237),f=t(27208),g=t(85529),k=t(14572),y=t(68433),b=t(12110),x=t(12549),S=t(12357),w=t(38176);let{HOME:j,MOVE_HOME_MOVE_OUT_DATE:N,MOVE_HOME_FINAL_READING:I,MOVE_HOME_NEW_ADDRESS:P,MOVE_HOME_NEXT_RESIDENT:E,MOVE_HOME_REVIEW:D}=t(90120).b,A=[N,I,P,E,D],C=({children:e})=>{let{push:n,asPath:t,query:N}=(0,r.useRouter)();(0,g.y)({featureFlag:x.T.HomeMove,redirectPath:j.path});let{data:P,isSuccess:D}=(0,m.s)(),{data:C,isSuccess:F}=(0,h.c)(),{data:M,isLoading:O,isError:_}=(0,p.u)(),{data:L}=(0,v.a)(),{data:T}=(0,c.P)(),{data:B,isLoading:V,isError:R}=(0,f.F)(),{moveOutDate:$,setPagesInJourney:W,pagesInJourney:q,finalReading:J,setSkipFinalRead:G,skipFinalRead:H}=(0,b.D7)(),X=!!N.skipFinalRead||H,[Y,Z]=(0,s.useState)(l.I.CLOSED),K=(0,k.V)(x.T.MoversDetails);(0,s.useEffect)(()=>{D&&F&&(!P||!C||L||T)&&n(j.path)},[D,F,P,C,n,L,T]),(0,s.useEffect)(()=>{J&&J!==u.y$&&t.includes("new-address")&&Z(l.I.OPEN)},[J,t,Z]),(0,s.useEffect)(()=>{N.skipFinalRead&&!H&&G(!0)},[N.skipFinalRead,H,G]);let z=(0,s.useMemo)(()=>{let e=K?A:A.filter(({path:e})=>e!==E.path);return X&&(e=e.filter(({path:e})=>e!==I.path)),e},[K,X]),Q=(0,w.Is)(q,t);if((0,s.useEffect)(()=>{let e;void 0!==M&&void 0!==B&&JSON.stringify(e=M&&B?z:z.filter(({path:e})=>e!==I.path))!==JSON.stringify(q)&&W(e)},[M,B,W,z,q,1===M]),(0,w.dn)({currentStep:Q,paths:q,condition:!$,redirectIndex:0}),O||V)return(0,a.jsx)(i.aH,{type:"linear",variant:"indeterminate"});if(_||R)return(0,a.jsx)(d.AX,{});if(!q.length)return null;let U=(0,o.u)(q,Q);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.default,{title:q[Q].title}),(0,a.jsxs)(d.xw,{heading:"Moving home",totalSteps:q.length,activeStep:Q+1,stepConfigs:U,children:[(0,a.jsx)(d.OX,{alertStatus:Y,handleAlertClose:()=>(0,S.i)(Z),children:"Your reading has been submitted"}),e]})]})}},85529:(e,n,t)=>{"use strict";t.d(n,{y:()=>i});var a=t(55729),s=t(81278),r=t(14572);let i=({featureFlag:e,redirectPath:n})=>{let{push:t}=(0,s.useRouter)(),i=(0,r.V)(e);(0,a.useEffect)(()=>{i||t(n)},[i,t,n])}},88735:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>M});var a=t(6029),s=t(55729),r=t(81278),i=t(84680),d=t(22328),o=t(37490),l=t
1(62074),u=t(45329),c=t(9724),v=t(39184),m=t(7911),h=t(90338),p=t(70334),f=t(14572),g=t(12110),k=t(48775),y=t(75544),b=t(68063),x=t(46311),S=t(41966);let w="It looks like your address falls outside our service area. Please search for your new billing address below.",j="Search for your address",N=({showMandatoryAddressCopy:e,canMoveInOnline:n,outsideAreaMessage:t=w,autocompleteLabel:r=j})=>{let{values:{postcode:d},setFieldValue:o}=(0,l.j7)(),[c,v]=(0,s.useState)(),m=(0,s.useMemo)(()=>["serviceablePropertiesLookup"],[]),{fetch:h,options:p,reset:f,fetching:g,failed:k}=(0,x.K)(S.G,d,m),[N,P]=(0,s.useState)(!1),E=(0,s.useCallback)(()=>{f(),P(!1),v(void 0),o("address",null).then(()=>{}),o("secondaryAddress",null).then(()=>{})},[f,o]);return(0,s.useEffect)(()=>{p&&0===p.length&&P(!0)},[p]),(0,s.useEffect)(()=>{""===d&&E()},[d,E]),(0,a.jsx)(i.Zp,{children:(0,a.jsxs)(i.BJ,{direction:"vertical",gap:"smMd",children:[(0,a.jsx)(i.o5,{variant:"h2",children:"Find your address"}),e&&(0,a.jsx)(i.o5,{children:"Please provide your future address so we can forward important information, such as bills or credits."}),(0,a.jsx)(b.u,{onChange:E,onSearch:async()=>{E(),await h()},loading:g}),!c&&!g&&(0,a.jsx)(I,{options:p,onMovingOut:async()=>{f(),await o("address",null),v(!0),P(!0)}}),(N||c)&&!g&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.Fc,{severity:"warning",children:(0,a.jsx)(i.o5,{children:t})}),(0,a.jsx)(y.A,{postcode:d,fieldName:"secondaryAddress",label:r})]}),k&&(0,a.jsx)(u.Fc,{severity:"error",children:(0,a.jsx)(i.o5,{children:"An error occurred while searching, please try again."})}),!1===n&&(0,a.jsxs)(u.Fc,{severity:"error",children:["We're unable to complete your move out online because we need a bit more information about your property and household."," Don't worry, our team can help! Please"," ",(0,a.jsx)(i.N_,{href:"https://www.stwater.co.uk/help-and-contact/contact-us/",target:"_blank",children:"contact us"}),", and we'll guide you through the process."]})]})})};function I({options:e,onMovingOut:n}){return e&&0!==e.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.l6,{name:"address",label:"Select an address",values:e,maskPII:!0}),(0,a.jsx)(i.$n,{type:"button",variant:"link",fullWidth:!0,onClick:n,children:"Can't see your address in the list?"})]}):null}var P=t(38122),E=t(12549),D=t(90120);let A=()=>{let{push:e}=(0,r.useRouter)(),{data:n,isLoading:t}=(0,h.O)(),{data:k}=(0,p.A)(),{pagesInJourney:y,moveOutDate:b,moveInDate:x,postcode:S,newBillingAddress:w,hasNewAddress:j,isResponsibleForBill:I,onNewAddressSubmission:D}
1=(0,g.D7)(),[A,M]=(0,s.useState)(j),[O,_]=(0,s.useState)(I),L="true"===A,T=L&&"true"===O,B=(0,m.Tj)(),V=`Please enter a date no more than ${B} days from today`,R=(0,f.V)(E.T.MoversDetails),$=k?.account.properties[0]?.id,W=n?.account?.commsDeliveryPreference===v.y.POSTAL_MAIL;W&&void 0===A&&M("true");let q=(0,P.q)(w)?{address:w??null,secondaryAddress:null}:{address:null,secondaryAddress:w??null};return t?(0,a.jsx)(F,{}):(0,a.jsx)(l.l1,{initialValues:{postcode:S,moveInDate:x??b,userSelectedMoveOut:void 0,...q,occupancyNumber:q?.address?.occupancyNumber||1},validate:e=>{if(L&&!e.address&&(!e.secondaryAddress?.value||!e.secondaryAddress.value.trim()))return{address:"Please select your new address",secondaryAddress:"Please select your new address"};if(L&&$&&e.address?.propertyId===$)return{address:"You cannot select the same address you are moving out from"};if("true"===O&&b){let{moveInDate:n}=e;if(!n)return{moveInDate:"Please enter a valid date"};if((0,d.d)(n,(0,o.f)(new Date,B)))return{moveInDate:V}}},onSubmit:({moveInDate:n,postcode:t,address:a,secondaryAddress:s,occupancyNumber:r})=>{if(n&&b&&"true"===O&&(0,d.d)(b,n))return;let i=a?{...a,occupancyNumber:r}:void 0;D({postcode:L?t:"",billingAddress:L?i??s:void 0,responsibleForBill:L?O:void 0,moveInDate:T?n:void 0,hasNewAddress:A}),R?e(y[y.length-2].path):e(y[y.length-1].path)},children:({values:{address:e,secondaryAddress:n,moveInDate:t}})=>{let[s,r]=[!!e?.label,!!n?.label],o=L&&!(s||r),l=e?.canMoveInOnline,v=void 0===A||o||s&&void 0===O||!1===l,h=!!t&&!!b&&(0,d.d)(b,t);return(0,a.jsx)(u.s2,{children:(0,a.jsx)(u.MG,{children:(0,a.jsxs)(i.BJ,{direction:"vertical",gap:"md",md:{gap:"lg"},children:[!W&&(0,a.jsx)(u.W3,{title:(0,a.jsx)(i.o5,{variant:"h2",children:"Do you know your new address?"}),name:"hasAddress",handleOnRadioChange:M,value:A}),(L||W)&&(0,a.jsx)(N,{showMandatoryAddressCopy:W,canMoveInOnline:l,autocompleteLabel:"Your new address"}),(L||W)&&s&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.W3,{title:(0,a.jsx)(i.o5,{variant:"h2",children:"Will you be responsible for the water bill?"}),name:"responsibleForBill",handleOnRadioChange:_,value:O}),T&&(0,a.jsx)(i.Zp,{children:(0,a.jsxs)(i.BJ,{direction:"vertical",gap:"smMd",children:[(0,a.jsx)(i.o5,{variant:"h2",children:"When do you become responsible for this property?"}),(0,a.jsx)(u.xu,{inputName:"moveInDate",inputLabel:m.sl,mutedText:m.ru,maskPII:!0}),h&&(0,a.jsx)(C,{})]})}),(0,a.jsx)(c.A,{})]}),(0,a.jsx)(u.Jh,{loading:!1,disabled:v,children:"Continue"})]})})})}})},C=()=>(0,a.jsxs)(u.Fc,{severity:"error",children:["It looks like your move dates overlap. Please"," ",(0,a.jsx)(u.LV,{href:"https://www.stwater.co.uk/help-and-contact/contact-us/",target:"_blank",children:"contact us"})," ","if you're responsible for two addresses at the same time, or adjust your dates so there's no overlap."]}),F=()=>(0,a.jsx)(i.mc,{children:(0,a.jsx)(u.MG,{children:(0,a.jsxs)(i.BJ,{direction:"vertical",gap:"md",md:{gap:"lg"},children:[(0,a.jsx)(i.Zp,{children:(0,a.jsxs)(i.BJ,{direction:"vertical",gap:"smMd",children:[(0,a.jsx)(u.WS,{}),(0,a.jsx)(u.xg,{})]})}),(0,a.jsx)(u.O9,{})]})})});A.getLayout=e=>(0,a.jsx)(g.nP,{children:(0,a.jsx)(u.Vc,{pageTitle:D.b.MOVE_HOME_NEW_ADDRESS.title,children:(0,a.jsx)(k.A,{children:e})})});let M=A},91348:(e,n,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/move-home/new-address",function(){return t(88735)}])}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=91348)),_N_E=e.O()}]);
2//# sourceMappingURL=new-address-c325d53d214bc4e4.js.map

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.