1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9603],{13882:function(e,t,a){"use strict";function n(e,t){if(t.length<e)throw TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}a.d(t,{Z:function(){return n}})},83946:function(e,t,a){"use strict";function n(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}a.d(t,{Z:function(){return n}})},36948:function(e,t,a){"use strict";a.d(t,{qk:function(){return r},vh:function(){return l},yJ:function(){return n}});var n=6e4,l=36e5,r=1e3},23855:function(e,t,a){"use strict";a.d(t,{Z:function(){return i}});var n=a(36948),l=a(13882),r=a(83946);function i(e,t){(0,l.Z)(1,arguments);var a,i,f,g=(0,r.Z)(null!==(a=null==t?void 0:t.additionalDigits)&&void 0!==a?a:2);if(2!==g&&1!==g&&0!==g)throw RangeError("additionalDigits must be 0, 1 or 2");if(!("string"==typeof e||"[object String]"===Object.prototype.toString.call(e)))return new Date(NaN);var v=function(e){var t,a={},n=e.split(o.dateTimeDelimiter);if(n.length>2)return a;
1if(/:/.test(n[0])?t=n[0]:(a.date=n[0],t=n[1],o.timeZoneDelimiter.test(a.date)&&(a.date=e.split(o.timeZoneDelimiter)[0],t=e.substr(a.date.length,e.length))),t){var l=o.timezone.exec(t);l?(a.time=t.replace(l[1],""),a.timezone=l[1]):a.time=t}return a}(e);if(v.date){var y=function(e,t){var a=RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(a);if(!n)return{year:NaN,restDateString:""};var l=n[1]?parseInt(n[1]):null,r=n[2]?parseInt(n[2]):null;return{year:null===r?l:100*r,restDateString:e.slice((n[1]||n[2]).length)}}(v.date,g);i=function(e,t){if(null===t)return new Date(NaN);var a,n,l=e.match(s);if(!l)return new Date(NaN);var r=!!l[4],i=_(l[1]),o=_(l[2])-1,u=_(l[3]),d=_(l[4]),p=_(l[5])-1;if(r)return d>=1&&d<=53&&p>=0&&p<=6?((a=new Date(0)).setUTCFullYear(t,0,4),n=a.getUTCDay()||7,a.setUTCDate(a.getUTCDate()+((d-1)*7+p+1-n)),a):new Date(NaN);var f=new Date(0);return o>=0&&o<=11&&u>=1&&u<=(c[o]||(m(t)?29:28))&&i>=1&&i<=(m(t)?366:365)?(f.setUTCFullYear(t,o,Math.max(i,u)),f):new Date(NaN)}(y.restDateString,y.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var h=i.getTime(),D=0;if(v.time&&isNaN(D=function(e){var t=e.match(u);if(!t)return NaN;var a=p(t[1]),l=p(t[2]),r=p(t[3]);return(24===a?0===l&&0===r:r>=0&&r<60&&l>=0&&l<60&&a>=0&&a<25)?a*n.vh+l*n.yJ+1e3*r:NaN}(v.time)))return new Date(NaN);if(v.timezone){if(isNaN(f=function(e){if("Z"===e)return 0;var t=e.match(d);if(!t)return 0;var a="+"===t[1]?-1:1,l=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return r>=0&&r<=59?a*(l*n.vh+r*n.yJ):NaN}(v.timezone)))return new Date(NaN)}else{var b=new Date(h+D),S=new Date(0);return S.setFullYear(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()),S.setHours(b.getUTCHours(),b.getUTCMinutes(),b.getUTCSeconds(),b.getUTCMilliseconds()),S}return new Date(h+D+f)}var o={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},s=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,u=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,d=/^([+-])(\d{2})(?::?(\d{2}))?$/;function _(e){return e?parseInt(e):1}function p(e){return e&&parseFloat(e.replace(",","."))||0}var c=[31,null,31,30,31,30,31,31,30,31,30,31];function m(e){return e%400==0||e%4==0&&e%100!=0}},21817:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/foundation/selling-a-house",function(){return a(41482)}])},41482:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return C}});var n=a(37340),l=a(85893),r=a(67294),i=a(81988),o=a(86262),s=a(7817),u=a(93003),d=a(18029),_=a(26997),p=a(15421),c=a(51974),m=a(23581);let f=[{text:"Sale Assumptions",label:"Estimated Sale Price (From Assets Section)",slug:"estimated_home_sale_price_in_todays_dollars",ask_for_partner:!1,showDecimal:!1,placeholder:"0",type:"display"},{label:"Cost of Sale As % of Sale Price",slug:"cost_of_home_sale_as_percent_of_sale_price",ask_for_partner:!1,type:"percent"},{label:"Target Sale Date",slug:"home_target_sale_date",ask_for_partner:!1,type:"date"}],g=[{text:"Sale Assumptions",label:"Estimated Sale Price (From Assets Section)",slug:"estimated_cottage_or_vacation_property_sale_price_in_todays_dollars",ask_for_partner:!1,showDecimal:!1,placeholder:"0",type:"display"},{label:"Cost of Sale As % of Sale Price",slug:"cost_of_cottage_or_vacation_property_sale_as_percent_of_sale_price",ask_for_partner:!1,type:"percent"},{label:"Target Sale Date",slug:"cottage_or_vacation_property_target_sale_date",ask_for_partner:!1,type:"date"}],v=[{text:"Sale Assumptions",label:"Estimated Sale Price (From Assets Section)",slug:"estimated_rental_property_sale_price_in_todays_dollars",ask_for_partner:!1,showDecimal:!1,placeholder:"0",type:"display"},{label:"Cost of Sale As % of Sale Price",slug:"cost_of_rental_property_sale_as_percent_of_sale_price",ask_for_partner:!1,type:"percent"},{label:"Target Sale Date",slug:"rental_property_target_sale_date",ask_for_partner:!1,type:"date"}];function y(){let e=(0,n._)(["\n mutation ($Values: GenericScalar!) {\n saveSellingAHouseData(values: $Values) {\n family {\n sellingAHouseData\n }\n }\n }\n"]);return y=function(){return e},e}let h=(0,_.Ps)(y());var D=e=>{var t,a,n,r,i,o,d,_,y,D,b,S,N,x,w,T,k;let{state:Z}=(0,u.ZP)(),{meState:A,setMeState:C}=(0,s.Z)(),j=(null==e?void 0:null===(a=e.family)||void 0===a?void 0:null===(t=a.sharedProfileData)||void 0===t?void 0:t.financial_profile__home_owner)===!1&&(null==e?void 0:null===(r=e.family)||void 0===r?void 0:null===(n=r.sharedProfileData)||void 0===n?void 0:n.financial_profile__future_home_purchase)===!0?null==e?void 0:null===(o=e.family)||void 0===o?void 0:null===(i=o.sharedData)||void 0===i?void 0:i.down_payment_goal_and_mortgage_payments__estimated_purchase_price:null==e?void 0:null===(_=e.family)||void 0===_?void 0:null===(d=_.assetsData)||void 0===d?void 0:d.real_assets__estimate_of_home_value,P={boxContextInitialValues:{primaryStatus:Z.home_sale_assumptions.primary_status,secondaryStatus:Z.home_sale_assumptions.secondary_status},title:"Home Sale Assumptions",totalSuffix:"",total:j},M={boxContextInitialValues:{primaryStatus:Z.cottage_vacation_property_sale_assumptions.primary_status,secondaryStatus:Z.cottage_vacation_property_sale_assumptions.secondary_status},isVisible:e.family.sharedProfileData.financial_profile__cottage_or_vacation_property,title:"Cottage/Vac. Prop. Sale Assumptions",totalSuffix:"",total:null==e?void 0:null===(D=e.family)||void 0===D?void 0:null===(y=D.assetsData)||void 0===y?void 0:y.real_assets__estimate_of_vacation_property_value},U=parseInt(null==A?void 0:null===(N=A.me)||void 0===N?void 0:null===(S=N.family)||void 0===S?void 0:null===(b=S.sharedProfileData)||void 0===b?void 0:b.financial_profile__number_of_rental_properties),H=[];for(let t=1;t<=U;t++){let a="";switch(t){case 1:a="1";break;case 2:a="2";break;case 3:a="3";break;case 4:a="4";break;case 5:a="5"}let n="sale_assumptions_rental_property_no_".concat(a);H.push({boxContextInitialValues:{primaryStatus:Z[n].primary_status,secondaryStatus:Z[n].secondary_status},title:"Rental Property Sale Assumptions Number ".concat(a),total:null==e?void 0:null===(T=e.family)||void 0===T?void 0:T.assetsData["real_assets__estimated_value_of_rental_property_no_".concat(a)],totalSuffix:"",cardSlug:n,displayData:null==e?void 0:null===(k=e.family)||void 0===k?void 0:k.assetsData["real_assets__estimated_value_of_rental_property_no_".concat(a)]})}return(0,l.jsxs)(m.Z,{page:"selling_a_house",family:e.family,children:[(0,l.jsx)(c.Z,{familyType:e.type,card:P,children:(0,l.jsx)(p.Z,{helpText:{label:"Make an assumption for the future sale of your home."},displayData:j,data:Z.home_sale_assumptions,type:e.type,formName:"home_sale_assumptions",questionData:f,mutation:h,mutationName:"saveSellingAHouseData",fieldName:"sellingAHouseData",enableReinitialize:!0,additionalValidation:e=>{let t={};return e.home_target_sale_date&&""!==e.home_target_sale_date&&null===e.home_target_sale_date.match(/^(^\d\d\d\d-\d\d-\d\d)/)&&(t.home_target_sale_date="Date must be in YYYY-MM-DD format"),t}})}),(0,l.jsx)(c.Z,{familyType:e.type,card:M,children:(0,l.jsx)(p.Z,{helpText:{label:"Make an assumption for the future sale of your home."},displayData:null==e?void 0:null===(w=e.family)||void 0===w?void 0:null===(x=w.assetsData)||void 0===x?void 0:x.real_assets__estimate_of_vacation_property_value,data:Z.cottage_vacation_property_sale_assumptions,type:e.type,formName:"cottage_vacation_property_sale_assumptions",questionData:g,mutation:h,mutationName:"saveSellingAHouseData",fieldName:"sellingAHouseData",enableReinitialize:!0,additionalValidation:e=>{let t={};return e.cottage_or_vacation_property_target_sale_date&&""!==e.cottage_or_vacation_property_target_sale_date&&null===e.cottage_or_vacation_property_target_sale_date.match(/^(^\d\d\d\d-\d\d-\d\d)/)&&(t.cottage_or_vacation_property_target_sale_date="Date must be in YYYY-MM-DD format"),t}})}),(0,l.jsx)("div",{children:H.map(t=>(0,l.jsx)("div",{className:"".concat("sale_assumptions_rental_property_no_1"===t.cardSlug?"":"my-4"),children:(0,l.jsx)(c.Z,{familyType:e.type,card:t,children:(0,l.jsx)(p.Z,{displayData:null==t?void 0:t.displayData,helpText:t.helpText,data:Z[t.cardSlug],type:e.type,formName:t.cardSlug,questionData:v,mutation:h,mutationName:"saveSellingAHouseData",fieldName:"sellingAHouseData",enableReinitialize:!0})},t.cardSlug)}))})]})},b=a(92432),S=a(51042),N=a(31704),x=a(66759),w=a(82502);function T(){let e=(0,n._)(["\n query {\n me {\n id\n ok\n message\n status\n family {\n sellingAHouseData\n simpleModeMapping\n sharedData\n ...CommonFamilyFields\n assetsData\n }\n }\n isPlannerUser\n }\n ","\n"]);return T=function(){return e},e}function k(){let e=(0,n._)(["\n mutation ($Section: String, $Data: Boolean!) {\n saveSimpleModeMappingData(section: $Section, data: $Data) {\n ok\n status\n message\n }\n }\n"]);return k=function(){return e},e}let Z=(0,_.Ps)(T(),N.Z),A=(0,_.Ps)(k());var C=(0,S.Z)(()=>{var e,t,a,n,_,p;let{setMeState:c,meState:m}=(0,s.Z)(),[f]=(0,b.aM)({query:Z}),{data:g,fetching:v,error:y}=f,[,h]=(0,b.Db)(A);if((0,r.useEffect)(()=>{v||c(g)},[g]),v)return(0,l.jsx)(x.Z,{});if((!(null==g?void 0:null===(e=g.me)||void 0===e?void 0:e.ok)||y)&&(null==g?void 0:null===(t=g.me)||void 0===t?void 0:t.message)!=="Not logged in!"){let e=(null==g?void 0:null===(p=g.me)||void 0===p?void 0:p.message)||"Something went wrong loading user data";return(0,l.jsx)(o.Z,{title:"Whoops!",message:"Something went wrong loading user data",errorInfo:{message:e,details:y},tryAgain:!0})}if(!v&&(null==m?void 0:m.isPlannerUser))return(0,l.jsx)(o.Z,{title:"Whoops!",message:"You're logged in as a planner trying to access the client section",showSignout:!0,errorCode:403});if(!v&&!(null==m?void 0:null===(a=m.me)||void 0===a?void 0:a.family))return(0,l.jsx)(o.Z,{title:"Whoops!",message:"Something went wrong loading user data",tryAgain:!0});
1let S=g.me.family;if(!S)return"Not logged in!"!==g.me.message?(0,l.jsx)(o.Z,{title:"Whoops!",message:"Looks like there is no family assigned to you"}):null;let N=S.familyType,T=(0,d.Nt)(S.sellingAHouseData);return(0,l.jsxs)(i.Z,{title:"Selling A House",children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-oldGray-800 leading-none px-5 lg:px-8 pt-5 mt-15 tracking-normal lg:hidden",children:"Selling A House"}),(0,l.jsxs)("div",{className:"flex flex-row justify-start pt-5 px-4",children:[(0,l.jsx)("button",{onClick:()=>{h({Section:"selling_a_house",Data:!0},{additionalTypenames:["UserType"]})},className:"px-4 py-2 font-bold cursor-pointer border rounded-l border-brand hover:bg-brand-dark hover:text-white ".concat((null==S?void 0:null===(n=S.simpleModeMapping)||void 0===n?void 0:n.selling_a_house)===!0?"bg-brand text-white":"text-brand"),type:"button",children:"Simple"},"simple"),(0,l.jsx)("button",{onClick:()=>{h({Section:"selling_a_house",Data:!1},{additionalTypenames:["UserType"]})},className:"border-l-0 px-4 py-2 font-bold cursor-pointer border rounded-r border-brand hover:bg-brand-dark hover:text-white ".concat((null==S?void 0:null===(_=S.simpleModeMapping)||void 0===_?void 0:_.selling_a_house)===!1?"bg-brand text-white":"text-brand"),type:"button",children:"Detailed"},"detailed")]}),(0,l.jsx)(w.Z,{helpLink:{mode:"BEACON",articleID:"6193b3b964e42a671b637660"},positionStyle:"absolute top-0 right-0 mt-4"}),(0,l.jsx)(u.ZP.Provider,{initialValues:T,children:(0,l.jsx)(D,{type:N,family:S})})]})})}},function(e){e.O(0,[1664,1736,1368,7333,2175,5161,1876,9720,1953,6458,355,1974,3581,9774,2888,179],function(){return e(e.s=21817)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.