"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[996],{81293:function(e,o,t){t.d(o,{Z:function(){return d}});var n=t(45213),r=t(79956),i=t(50791),l=t(17405),a=t(6494);let s=e=>{let{className:o}=e;return(0,n.jsxs)("svg",{className:o,width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 26.9167C8.41861 26.9167 3.08333 21.5814 3.08333 15C3.08333 8.41861 8.41861 3.08333 15 3.08333C21.5814 3.08333 26.9167 8.41861 26.9167 15C26.9167 21.5814 21.5814 26.9167 15 26.9167ZM0.25 15C0.25 23.1462 6.8538 29.75 15 29.75C23.1462 29.75 29.75 23.1462 29.75 15C29.75 6.8538 23.1462 0.25 15 0.25C6.8538 0.25 0.25 6.8538 0.25 15Z",fill:"#EF5350"}),(0,n.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.0002 16.4167C15.7826 16.4167 16.4169 15.7824 16.4169 15L16.4169 10C16.4169 9.21762 15.7826 8.58335 15.0002 8.58335C14.2178 8.58335 13.5835 9.21762 13.5835 10L13.5835 15C13.5835 15.7824 14.2178 16.4167 15.0002 16.4167Z",fill:"#EF5350"}),(0,n.jsx)("path",{d:"M16.6667 20C16.6667 19.0795 15.9205 18.3334 15 18.3334C14.0796 18.3334 13.3334 19.0795 13.3334 20C13.3334 20.9205 14.0796 21.6667 15 21.6667C15.9205 21.6667 16.6667 20.9205 16.6667 20Z",fill:"#EF5350"})]})},c=(0,r.forwardRef)(function(e,o){let{onCloseCleanUp:t}=e,[c,d]=(0,r.useState)(!1),[u,p]=(0,r.useState)(""),[m,h]=(0,r.useState)("info"),[v,b]=(0,r.useState)(1e4),[f,x]=(0,r.useState)({vertical:"top",horizontal:"center"});(0,r.useImperativeHandle)(o,()=>({showOhaiStandardSnackbar(e,o){p(e),(null==o?void 0:o.severity)?(h(o.severity),"error"===o.severity?x({vertical:"bottom",horizontal:"center"}):x({vertical:"top",horizontal:"center"})):x({vertical:"top",horizontal:"center"}),(null==o?void 0:o.duration)&&b(o.duration),(null==o?void 0:o.anchorOrigin)&&x(o.anchorOrigin),d(!0)},severity:()=>m,hide(){d(!1)}}));let g=()=>{d(!1),t&&t()};return(0,n.jsx)(l.Z,{anchorOrigin:f,open:c,onClose:g,message:u,autoHideDuration:"error"===m?15e3:1e4,className:"error"===m&&"bottom"===f.vertical?"desktop:bottom-[75px] bottom-[20px]":"",children:(0,n.jsxs)(a.Z,{severity:m,sx:"error"===m?{width:"100%",marginTop:"0"}:{width:"100%",marginTop:"74px"},className:"leading-5 ".concat("error"==m?"bg-[#323846] text-white":"bg-[#71FF90] text-black","  align-middle text-[16px] pr-12"),icon:"error"===m?(0,n.jsx)(s,{className:"w-[28px] h-[28px]"}):(0,n.jsx)("img",{src:"/images/task/success.svg",alt:"check mark",className:"w-[24px] h-[24px] mt-0"}),children:["error"===m&&(0,n.jsx)(i.Z,{className:"absolute right-[6px]",onClick:g}),(0,n.jsx)("span",{className:"align-middle inline-block",children:u})]})})});var d=c},20996:function(e,o,t){t.d(o,{ZP:function(){return S},ul:function(){return y}});var n=t(50851),r=t(45213),i=t(79894),l=t.n(i),a=t(86677),s=t(79956),c=t(80059),d=t(41993),u=t(27289),p=t(28491),m=t(88039),h=t(57510),v=t(41701),b=t(28827),f=t(68554),x=t(81293),g=t(85779);function w(){let e=(0,n._)(["\n  mutation SendLoginSmsMessage($input: SendLoginSmsMessageInput!) {\n    sendLoginSmsMessage(input: $input)\n  }\n"]);return w=function(){return e},e}function _(e){var o,t,n,i;return(0,r.jsx)("div",{className:" ".concat((null==e?void 0:null===(o=e.errors)||void 0===o?void 0:null===(t=o.mobile_phone)||void 0===t?void 0:t.message)&&(null==e?void 0:null===(n=e.errors)||void 0===n?void 0:null===(i=n.mobile_phone)||void 0===i?void 0:i.message)!==""?"my-12 desktop:my-8":"my-4","  px-1 desktop:px-3"),children:(0,r.jsx)(f.Z,{className:"w-[150px] bg-[#FF6433] rounded-[50px] text-[15px] text-brand-black-1 font-bold !px-0 focus:bg-[#FE4112] focus:border-2 focus:border-solid focus:border-opacity-60  active:bg-[#BD2B06]",...e,children:"Try for free"})})}function y(){let e=(0,a.useRouter)(),o=e.query.error,t=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(o){var e;null===(e=t.current)||void 0===e||e.showOhaiStandardSnackbar(o,{severity:"error",duration:1e4,anchorOrigin:{vertical:"top",horizontal:"center"}})}},[o]),(0,r.jsx)(x.Z,{ref:t})}function C(e){let{initial_phone_number:o,invitation_code:t,onFail:n,onSuccess:i,userAcquisition:l,ButtonComponent:a}=e,[c,b]=(0,s.useState)(!1),f=new h.m,x=(0,g.G)(),[w]=(0,v.Kb1)(),{control:_,handleSubmit:y,formState:{errors:C},setError:E}=(0,m.cI)({resolver:(0,d.F)(p.loginSchema),defaultValues:{mobile_phone:null!=o?o:""}}),S=async e=>{if(b(!0),t){let o=await f.isValidInvitation(t,e.mobile_phone);o.success&&o.data?i({mobile_phone:e.mobile_phone}):o.errorCode==p.ServiceErrorCode.HOUSEHOLD_MAX_REACHED?n({reason:"HOUSEHOLD_MAX_REACHED",mobile_phone:e.mobile_phone}):E("mobile_phone",{type:"custom",message:o.error||"An error occurred when validating the invitation. Please try again later or contact us."})}b(!1)},j=e=>{let o=e.replace(/\D/g,"");return 10===o.length?o.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3"):o.slice(0,10).replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")},k=async e=>{if(b(!0),x)i({mobile_phone:e.mobile_phone});else{b(!0);let o=await w({variables:{input:{mobilePhone:e.mobile_phone,utmSource:null==l?void 0:l.utm_source,utmMedium:null==l?void 0:l.utm_medium,utmCampaign:null==l?void 0:l.utm_campaign}}});if(null==o?void 0:o.errors){let e=null==o?void 0:o.errors[0].message;E("mobile_phone",{type:"custom",message:e||"An unknown error occurred. Please try again later or contact us."})}else n({reason:"IN_APP_BROWSER",mobile_phone:e.mobile_phone})}b(!1)},R=t&&(null==t?void 0:t.length)>0?S:k;return(0,r.jsxs)("form",{onSubmit:y(R),children:[(0,r.jsx)("div",{className:"relative mt-5 tablet:mt-8 min-h-[67px] w-[270px] phone:w-[100%] left-[0] desktop:left-[-12px]  desktop:mx-[20px]",onClick:()=>{var e;null===(e=document.getElementById("mobile_phone"))||void 0===e||e.focus()},children:(0,r.jsx)(m.Qr,{name:"mobile_phone",control:_,defaultValue:"",render:e=>{var o,t,n;let{field:{name:i,value:l,onChange:a}}=e;return(0,r.jsx)(u.Z,{variant:"standard",className:" h-[68px] w-full py-[16px] pl-[22px] pr-[121px] rounded-[8px] bg-[#1F242E] ".concat((null===(o=C.mobile_phone)||void 0===o?void 0:o.message)&&"border-[#1F242E]"," hover:border-[#B4B9C4] border-2   focus:border-[#B4B9C4] focus:border-2 focus:outline-none border-solid text-[#E0E3E9]"),id:"mobile_phone",type:"text",name:i,error:!!(null===(t=C.mobile_phone)||void 0===t?void 0:t.message),helperText:null===(n=C.mobile_phone)||void 0===n?void 0:n.message,value:j(l),onChange:a,inputProps:{inputMode:"numeric"},placeholder:"Enter mobile number",onFocus:()=>{E("mobile_phone",{type:"custom",message:""})},sx:{border:"1px solid transparent","&:focus:not(:placeholder-shown), &:focus-within":{border:"2px solid white"},"&:focus-visible":{outline:"none"},"& .MuiInput-underline:before":{borderBottom:"none !important"},"& .MuiInput-underline:after":{borderBottom:"none !important"}},FormHelperTextProps:{style:{color:"#EF5350",margin:"0",padding:"1px",paddingLeft:"10px",borderRadius:"5px",zIndex:100,position:"absolute",top:"70px",left:"10px"}}})}})}),(0,r.jsx)(a,{type:"submit",onClick:y(R),isLoading:c,disabled:c,errors:C,children:"Try for free"})]})}function E(){return(0,r.jsxs)("div",{className:"my-8 text-brand-light-3 px-4 text-[14px] max-w-[560px]",children:["By tapping 'Try for Free', you agree to our"," ",(0,r.jsx)(l(),{href:"/terms-of-service",className:"visited:text-white text-white font-bold",children:"Terms of Service"}),". Learn how we process your data in our"," ",(0,r.jsx)(l(),{href:"/privacy-policy",className:"visited:text-white text-white font-bold",children:"Privacy Policy"})," ","and"," ",(0,r.jsx)(l(),{href:"/cookie-policy",className:"visited:text-white text-white font-bold",children:"Cookies Policy"}),". You will receive SMS Notifications from us and can opt out any time."]})}function S(e){let{utm_campaign:o,ButtonComponent:t,LegalComponent:n,initial_phone_number:i}=e,l=(0,a.useRouter)(),{userAcquisition:s}=(0,b.Z)(),{invitation_code:c,returnTo:d}=l.query,u=e=>{let{reason:o,mobile_phone:t}=e;"IN_APP_BROWSER"===o?l.push({pathname:"/insecure-browser-login-message",query:{...l.query,mobile_phone:t}}):"HOUSEHOLD_MAX_REACHED"===o&&l.push("/households/household-limit")},p=e=>{let{mobile_phone:o}=e;l.push(m({mobile_phone:o,invitation_code:c,returnTo:d}))},m=e=>{let{mobile_phone:t,invitation_code:n,returnTo:r}=e,i="/api/auth/login?prompt=login&login_hint=".concat(encodeURIComponent(t));return"".concat(i).concat(s?"&utm_source=".concat(null==s?void 0:s.utm_source,"&utm_medium=").concat(null==s?void 0:s.utm_medium,"&utm_campaign=").concat(null==s?void 0:s.utm_campaign):o?"&utm_campaign=".concat(o):"").concat("&landingPageTest=true").concat(n?"&invitation_code=".concat(encodeURIComponent(n),"&returnTo=").concat(encodeURIComponent("/user/add-user-information?invitation_code=".concat(encodeURIComponent(n)))):r?"&returnTo=".concat(encodeURIComponent(r)):void 0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C,{onFail:u,onSuccess:p,initial_phone_number:null==i?void 0:i.replace("+1",""),invitation_code:c,userAcquisition:s,ButtonComponent:null!=t?t:_}),n?(0,r.jsx)(n,{}):(0,r.jsx)(E,{})]})}(0,c.Ps)(w())},85779:function(e,o,t){t.d(o,{G:function(){return r},Y:function(){return i}});var n=t(88830);let r=()=>{let e=!1,o=window.navigator,t=o.userAgent.toLowerCase(),n=o.standalone,r=/safari/.test(t),i=/iphone|ipod|ipad/.test(t);if(i)e=!n&&!r;else if(/android/.test(t)){let o=t.indexOf("android"),n=t.slice(o+8,o+11),r=parseFloat(n);e=r>=10?/(wv)/.test(t):t.includes("Version/")}return console.log(e?"Detected browser is a webview":"Detected browser is not a webview"),!e},i=async function(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contact.vcf";try{let t=await (0,n.Z)({url:e,method:"GET",responseType:"blob"}),r=new Blob([t.data],{type:"text/vcard"}),i=window.URL.createObjectURL(r),l=document.createElement("a");if(l.href=i,l.download=o,document.body.appendChild(l),l.click(),document.body.removeChild(l),window.URL.revokeObjectURL(i),navigator.userAgent.match(/iPhone|iPad|iPod/i))window.location.href=i;else if(navigator.userAgent.match(/Android/i)){let e=document.createElement("a");e.href="intent:".concat(i,"#Intent;action=android.intent.action.VIEW;type=text/vcard;end"),document.body.appendChild(e),e.click(),document.body.removeChild(e)}}catch(e){console.error("Download failed:",e)}}}}]);