PageSourceSearch

https://web-assets.myfitnesspal.com/web-main/_next/static/chunks/p…/create/demographic-1-761c0ad505978c26.js

js myfitnesspal.com collected 2026-09-24 08:24:47 UTC 14,429 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7432],{14617:(e,t,o)=>{"use strict";o.d(t,{A:()=>y});var r=o(41695),n=o(44841),i=o(50079),a=o(18911),s=o(67867),l=o(25706),c=o(68985),d=o(52127),u=o(83923),p=o(41999);function x(e){return(0,p.Ay)("PrivateSwitchBase",e)}(0,u.A)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);var h=o(13920),m=o(64255);let A=(0,s.Ay)(d.A,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>"start"===e&&"small"!==t.size,style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>"end"===e&&"small"!==t.size,style:{marginRight:-12}}]}),g=(0,s.Ay)("input",{name:"MuiSwitchBase",shouldForwardProp:a.A})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),y=r.forwardRef(function(e,t){let{autoFocus:o,checked:r,checkedIcon:a,defaultChecked:s,disabled:d,disableFocusRipple:u=!1,edge:p=!1,icon:y,id:f,name:j,onBlur:b,onChange:v,onFocus:C,readOnly:S,required:w=!1,tabIndex:z,type:_,value:k,slots:P={},slotProps:F={},...B}=e,{nativeButton:D,...L}=B,[T,M]=(0,l.A)({controlled:r,default:!!s,name:"SwitchBase",state:"checked"}),E=(0,c.A)(),R=d;E&&void 0===R&&(R=E.disabled);let Q="checkbox"===_||"radio"===_,G={...e,checked:T,disabled:R,disableFocusRipple:u,edge:p},O=(e=>{let{classes:t,checked:o,disabled:r,edge:a}=e,s={root:["root",o&&"checked",r&&"disabled",a&&`edge${(0,i.A)(a)}`],input:["input"]};return(0,n.A)(s,x,t)})(G),q={slots:P,slotProps:F},[I,W]=(0,h.A)("root",{ref:t,elementType:A,className:O.root,shouldForwardComponentProp:!0,externalForwardedProps:{...q,component:"span",...L},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),C&&C(t),E&&E.onFocus&&E.onFocus(t)},onBlur:t=>{e.onBlur?.(t),b&&b(t),E&&E.onBlur&&E.onBlur(t)}}),ownerState:G,additionalProps:{centerRipple:!0,focusRipple:!u,role:void 0,tabIndex:null,internalDisabledThemeFocusVisible:!0}}),[N,V]=(0,h.A)("input",{elementType:g,className:O.input,externalForwardedProps:q,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented||S)return;let t=e.target.checked;M(t),v&&v(e,t)})(t)}}),ownerState:G,additionalProps:{autoFocus:o,checked:r,defaultChecked:s,disabled:R,id:Q?f:void 0,name:j,readOnly:S,required:w,tabIndex:z,type:_,..."checkbox"===_&&void 0===k?{}:{value:k}}});return(0,m.jsxs)(I,{...W,children:[(0,m.jsx)(N,{...V}),T?a:y]})})},15158:(e,t,o)=>{"use strict";o.d(t,{A:()=>x});var r=o(41695),n=o(3638),i=o(44841),a=o(90110),s=o(67867),l=o(47652),c=o(73576),d=o(44575),u=o(64255);let p=(0,s.Ay)(a.A,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),x=r.forwardRef(function(e,t){let o=(0,l.b)({props:e,name:"MuiDialogTitle"}),{className:a,id:s,...x}=o,h=(e=>{let{classes:t}=e;return(0,i.A)({root:["root"]},c.t,t)})(o),{titleId:m=s}=r.useContext(d.A);return(0,u.jsx)(p,{component:"h2",className:(0,n.A)(h.root,a),ownerState:o,ref:t,variant:"h6",id:s??m,...x})})},35240:(e,t,o)=>{"use strict";o.d(t,{A:()=>f});var r=o(64255),n=o(41695),i=o(1179),a=o(90110),s=o(71375),l=o(9243),c=o(68559),d=o(92420),u=o(77856),p=o(85751);let x={display:"inline-flex",alignItems:"center",bgcolor:"common.neutrals.white",borderStyle:"none",pl:0,cursor:"pointer",my:2},h={textAlign:"right",mr:2},m={display:"inline",ml:2},A={px:4,py:3},g={textDecoration:"none","&:hover":{cursor:"pointer",textDecoration:"underline"}},y={maxWidth:{xs:"80vw",md:650}};function f({page:e,destination:t}){let o=(0,c.Vb)(),{locale:j}=(0,l.useRouter)(),b=(0,d.jN)(j),[v,C]=(0,n.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.A,{component:"button",type:"button",onClick:e=>{C(!0)},sx:x,children:[(0,r.jsx)(s.A,{color:"primary",fontSize:"small"}),(0,r.jsx)(a.A,{color:"primary",sx:m,id:"tooltip",children:o("accountCreateSexQuestionTooltipTitle")})]}),(0,r.jsx)(p.A,{open:v,onClose:()=>C(!1),title:o("accountCreateSexQuestionTooltipTitle"),sx:y,children:(0,r.jsxs)(i.A,{sx:A,children:[(0,r.jsx)(a.A,{variant:"Body/Regular/SM",component:"p",color:"textSecondary",children:o("accountCreateSexQuestionTooltipContent")}),(0,r.jsx)(i.A,{sx:h,children:(0,r.jsx)(u.A,{href:`https://support.myfitnesspal.com/hc/${b}/articles/360059617352`,sx:g,target:"_blank",children:(0,r.jsx)(a.A,{variant:"Button/Caps/MD",color:"primary",children:o("learnMoreCapitalized")})})})]})})]})}},46606:(e,t,o)=>{"use strict";o.d(t,{A:()=>x});var r=o(64255),n=o(55714),i=o(1179),a=o(90110),s=o(68559),l=o(3952);let c={display:"flex",justifyContent:"center",zIndex:2,position:{sm:"sticky"},bottom:0,left:{xs:0,sm:"unset"},bgcolor:"common.neutrals.white",py:{xs:4,sm:0},width:{xs:"100%",sm:"auto"},mt:{xs:16,sm:0}},d={maxWidth:{xs:"100%",sm:181},mr:{xs:1,sm:4},width:{xs:"100%"},height:{sm:56}},u={position:{xs:"fixed",sm:"unset"},bottom:{xs:0,sm:"unset"},bgcolor:{xs:"white",sm:"unset"},py:{xs:2,sm:"unset"},width:{xs:"calc(100% - 32px)"},maxWidth:{xs:"none",sm:181}},p={py:{sm:3},height:{sm:56}},x=function({backUrl:e,loadingStatus:t,nextButtonDisplayFinish:o,disabled:x=!1}){let h=(0,s.Vb)(),m=(0,n.A)(e=>e.breakpoints.only("xs"));return(0,r.jsxs)(i.A,{component:"nav",sx:c,children:[!m&&(0,r.jsx)(l.A,{fullWidth:!0,sx:d,variant:"outlined",href:e,children:(0,r.jsx)(a.A,{variant:"Button/Caps/LG",children:h("back")})}),(0,r.jsx)(i.A,{sx:u,children:(0,r.jsx)(l.A,{type:"submit",fullWidth:!0,loading:t,disabled:t||x,sx:p,children:(0,r.jsx)(a.A,{variant:"Button/Caps/LG",children:h(o?"finish":"next")})})})]})}},48248:(e,t,o)=>{"use strict";o.r(t),o.d(t,{default:()=>O});var r=o(64255),n=o(41695),i=o(10039),a=o(9243),s=o(45709),l=o(38678),c=o(2727),d=o(1179),u=o(26081),p=o(90110),x=o(28096),h=o(3744),m=o(87531),A=o(92444),g=o(15158),y=o(67274),f=o(37097),j=o(11171),b=o(12984),v=o(99790),C=o(18741),S=o(13879),w=o(42869),z=o(86692),_=o(67230),k=o(68559),P=o(86577),F=o(27034),B=o(36741),D=o(90999),L=o(87373),T=o(29568),M=o(3952),E=o(46606),R=o(35240);let Q={form:{h1:{fontSize:{sm:20},fontWeight:700},px:{sm:5}},titleContainer:{mb:3},radioGroup:{flexDirection:"row"},radioLabel:{mr:8},inputContainer:{mt:3,minHeight:64},ageGateDialog:{textAlign:"center"},ageGateDialogTitle:{mb:2},ageGateDialogButton:{my:6,mx:"auto",py:3,px:12},questionsSubtext:{textAlign:"center",mb:3},gridPadding:{pb:{sm:4}}};function G(){let e=(0,k.Vb)(),t=(0,w.jE)(),o=(0,a.useRouter)(),{locale:T}=o,{data:G}=(0,F.Pj)(_.M_),{data:O,setData:q}=(0,F.Pj)(_.ZC),I=B.F.find(e=>
1e.code===G.userCountry),[W,N]=(0,n.useState)(O.country_id||I.id),V=(0,n.useMemo)(()=>z.Ik().shape({sex:z.Yj().oneOf(["F","M"]).default(""),birthday:z.Ik().required().test({name:"isDateValid",test:e=>e.isValid}).default(null),country_id:z.Yj().required(),zipcode:254===W?z.Yj().required().matches(/[0-9]{5}/).length(5).default(""):z.Yj().notRequired().default("")}),[W]),H=V.getDefault(),[K,Y]=(0,n.useState)(O.sex||H.sex),[U,$]=(0,n.useState)(O.birthday||H.birthday),[X,Z]=(0,n.useState)(O.zipcode||H.zipcode),[J,ee]=(0,n.useState)({}),[et,eo]=(0,n.useState)(!1),[er,en]=(0,n.useState)({sex:!1,birthday:!1,zipcode:!1}),[ei,ea]=(0,n.useState)(!1),es=(0,n.useMemo)(()=>B.F.sort((t,o)=>e(t.localizationKey)>e(o.localizationKey)?1:-1),[e]);t.prefetchQuery({queryKey:["consent-status",I.code,o.locale],queryFn:()=>(0,L.rp)({isoCode:I.code,locale:o.locale}),staleTime:1/0}),(0,n.useEffect)(function(){O.isActivityLevelPageComplete||o.push("/account/create/welcome")},[O.isActivityLevelPageComplete,o]);let el=254===W,ec=(0,P.L)(i.c9.now().toLocaleParts(i.c9.DATE_SHORT));function ed(e,r,n){if("birthday"===e&&(r=eu(r)),"country_id"===e){let e=B.F.find(e=>e.id===r);if(t.prefetchQuery({queryKey:["consent-status",e.code,o.locale],queryFn:()=>(0,L.rp)({isoCode:e.code,locale:o.locale}),staleTime:1/0}),254!==r){if(J.zipcode){let e=Object.assign({},J);delete e.zipcode,ee(e)}Z("")}}n(r),er[e]&&ep(e,r)}function eu(e){return"string"==typeof e?i.c9.fromFormat(e,ec):e}let ep=(e,t)=>{V.validateAt(e,{[e]:t},{context:{zipcode:X,birthday:U}}).then(()=>{let t=Object.assign({},J);delete t[e],ee(t)}).catch(t=>{ee({...Object.assign(J,{[e]:t.errors})})})};return(0,r.jsxs)(d.A,{component:"form",onSubmit:function(e){e.preventDefault(),ea(!0),en({sex:!0,zipcode:el,birthday:!0}),V.validate({sex:K,birthday:U,country_id:W,zipcode:X},{context:{sex:K,birthday:U,country_id:W,zipcode:X},abortEarly:!1}).then(()=>{if(i.c9.now().diff(U,"years").toObject().years<=18)eo(!0);else{for(let[e,t]of Object.entries({sex:K,birthday:U,country_id:W,zipcode:X,isDemographic1Complete:!0}))q(e,t);(0,D.dU)([D.YM],"cta_tapped_onboarding",{action:"demographic_1_completed",screen_name:"demographic_1",destination:"demographic_2"}),o.push("/account/create/demographic-2")}}).catch(e=>{let t={};for(let o of e.inner)t[o.path]?t[o.path].push(...o.errors):t[o.path]=o.errors;ee({...Object.assign(J,t)}),ea(!1)})},sx:Q.form,children:[(0,r.jsxs)(u.A,{container:!0,direction:"column",spacing:8,sx:Q.gridPadding,children:[(0,r.jsxs)(u.A,{children:[(0,r.jsx)(d.A,{sx:Q.titleContainer,children:(0,r.jsx)(p.A,{variant:"h4",component:"h1",children:e("accountCreateSexQuestion")})}),(0,r.jsxs)(x.A,{sx:Q.radioGroup,name:"sex",value:K,onChange:e=>ed(e.target.name,e.target.value,Y),children:[(0,r.jsx)(h.A,{sx:Q.radioLabel,value:"M",control:(0,r.jsx)(m.A,{sx:Q.maleRadioButton}),label:e("male")}),(0,r.jsx)(h.A,{sx:Q.radioLabel,value:"F",control:(0,r.jsx)(m.A,{}),label:e("female")})]}),J.sex&&(0,r.jsx)(p.A,{color:"error",component:"p",variant:"para2",children:e("accountCreateSexQuestionError")}),(0,r.jsx)(R.A,{page:"demographic_1",destination:"demographic_2"})]}),(0,r.jsxs)(u.A,{children:[(0,r.jsx)(p.A,{variant:"h4",component:"h1",children:e("accountCreateBirthdayQuestion")}),(0,r.jsx)(u.A,{container:!0,spacing:2,children:(0,r.jsxs)(u.A,{size:6,sx:Q.inputContainer,children:[(0,r.jsx)(s.$,{dateAdapter:c.O,adapterLocale:T,children:(0,r.jsx)(l.l,{format:ec,label:ec.toLowerCase(),value:U,disableFuture:!0,onChange:e=>ed("birthday",e,$),slotProps:{textField:{id:e("birthdayAria")}}})}),J.birthday&&(0,r.jsx)(p.A,{color:"error",component:"p",variant:"para2",children:e("accountCreateBirthdayQuestionError",{date:ec.toLowerCase()})})]})}),(0,r.jsxs)(A.A,{open:et,sx:Q.ageGateDialog,children:[(0,r.jsx)(g.A,{sx:Q.ageGateDialogTitle,children:(0,r.jsx)(p.A,{color:"primary",component:"p",variant:"h3",children:e("whoops")})}),(0,r.jsx)(y.A,{children:(0,r.jsx)(p.A,{variant:"para1",color:"textSecondary",children:e("accountCreateUnderageError")})}),(0,r.jsx)(f.A,{children:(0,r.jsx)(M.A,{href:"/account/create/welcome",variant:"contained",color:"primary",size:"large",sx:Q.ageGateDialogButton,children:(0,r.jsx)(p.A,{variant:"button1",children:e("gotIt")})})})]})]}),(0,r.jsxs)(u.A,{children:[(0,r.jsx)(p.A,{variant:"h4",component:"h1",children:e("accountCreateLocationQuestion")}),(0,r.jsxs)(u.A,{container:!0,spacing:2,children:[(0,r.jsx)(u.A,{size:6,sx:Q.inputContainer,children:(0,r.jsxs)(j.A,{variant:"outlined",fullWidth:!0,children:[(0,r.jsx)(b.A,{id:"country-selector-label",children:e("country")}),(0,r.jsx)(v.A,{value:W,onChange:e=>ed("country_id",e.target.value,N),label:e("country"),labelId:"country-selector-label",children:es.map(t=>(0,r.jsx)(C.A,{value:t.id,children:e(t.localizationKey)},t.id))})]})}),(0,r.jsxs)(u.A,{size:6,sx:Q.inputContainer,children:[el&&(0,r.jsx)(S.A,{name:"zipcode",id:"zipcode",fullWidth:!0,label:e("zipCode"),variant:"outlined",onChange:e=>ed("zipcode",e.target.value,Z),value:X,onBlur:e=>{var t,o;return t=e.target.name,o=e.target.value,void("birthday"===t&&(o=eu(o)),en({...er,[t]:!0}),ep(t,o))},error:!!J.zipcode,slotProps:{htmlInput:{inputMode:"numeric"}}}),J.zipcode&&(0,r.jsx)(p.A,{color:"error",component:"p",variant:"para2",children:e("accountCreateZipCodeQuestionError")})]})]})]}),(0,r.jsx)(u.A,{children:(0,r.jsx)(p.A,{sx:Q.questionsSubtext,variant:"body2",color:"textSecondary",children:e("accountCreateDemographic1QuestionsSubtext")})})]}),(0,r.jsx)(E.A,{backUrl:"/account/create/activity-level",loadingStatus:ei})]})}G.Layout=T.A;let O=G},71375:(e,t,o)=>{"use strict";o.d(t,{A:()=>i});var r=o(27930),n=o(64255);let i=(0,r.A)((0,n.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59
1-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help")},81828:(e,t,o)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/create/demographic-1",function(){return o(48248)}])},85751:(e,t,o)=>{"use strict";o.d(t,{A:()=>d});var r=o(64255),n=o(32125),i=o(91488),a=o(1179),s=o(26081),l=o(90110),c=o(33932);let d=({sx:e,children:t,open:o,onClose:d,dataTestId:u,title:p,centered:x=!1,noClose:h,backdropBlur:m=!1})=>{let A={container:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",bgcolor:"common.neutrals.inverse",boxShadow:"0px 0px 35px 5px rgb(0 0 0 / 25%);",position:"relative","&:focus":{outline:"none"},maxWidth:"80vw"},header:{display:"flex",alignItems:"center",bgcolor:"common.brand.primary",color:"common.neutrals.white",fontSize:24,p:5},closeContainer:{display:"flex",justifyContent:"flex-end",flexWrap:"wrap"},close:{cursor:"pointer",fontSize:28,m:2*!p,justifyContent:"flex-end"},titleContainer:{display:"flex",justifyContent:x?"center":"flex-start"},backdrop:{backdropFilter:"blur(4px)",backgroundColor:"rgba(0, 0, 0, 0.5)"}};return(0,r.jsx)(n.A,{"data-testid":u,open:o,onClose:d,slotProps:{backdrop:m?{sx:A.backdrop}:void 0},children:(0,r.jsx)(i.A,{in:o,timeout:{enter:500,exit:100},children:(0,r.jsxs)(a.A,{sx:[A.container,...Array.isArray(e)?e:[e]],children:[p?(0,r.jsxs)(s.A,{sx:A.header,container:!0,children:[x&&(0,r.jsx)(s.A,{size:{xs:1}}),(0,r.jsx)(s.A,{size:{xs:10},sx:A.titleContainer,children:(0,r.jsx)(l.A,{variant:"Heading/Semibold/LG",children:p})}),(0,r.jsx)(s.A,{size:{xs:x?1:2},sx:A.closeContainer,children:(0,r.jsx)(c.A,{sx:A.close,onClick:d})})]}):!h&&(0,r.jsx)(a.A,{sx:A.closeContainer,children:(0,r.jsx)(c.A,{sx:A.close,onClick:d})}),t]})})})}},86577:(e,t,o)=>{"use strict";o.d(t,{L:()=>r});let r=e=>{let t={day:"dd",month:"MM",year:"yyyy"},o="";
1for(let r of e)"literal"===r.type?o+=r.value:r.type in t&&(o+=t[r.type]);return o}}},e=>{e.O(0,[7124,3849,3879,6692,9584,5839,290,2373,7312,4979,9704,9568,636,6593,8792],()=>e(e.s=81828)),_N_E=e.O()}]);
2//# sourceMappingURL=demographic-1-761c0ad505978c26.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.