PageSourceSearch

https://app.risksphere.ai/_next/static/chunks/pages/register-f40c9bc29d8e0e72.js

js risksphere.ai collected 2026-10-05 13:08:00 UTC 41,778 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[495],{76276:function(e,i,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/register",function(){return n(82107)}])},37115:function(e,i,n){"use strict";var r=n(85893);n(67294);var l=n(5616);i.Z=e=>{let{containerStyles:i={},isPageSpinner:n=!1}=e;return(0,r.jsx)(l.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"center",...i},children:n?(0,r.jsx)(l.Z,{sx:{width:"48px",height:"48px",border:"3px solid #FFF",borderRadius:"50%",display:"inline-block",position:"relative",boxSizing:"border-box",animation:"rotation 1s linear infinite","&::after":{content:'""',boxSizing:"border-box",position:"absolute",left:0,top:0,background:e=>e.palette.primary.main,width:"16px",height:"16px",transform:"translate(-50%, 50%)",borderRadius:"50%"},"@keyframes rotation":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}}}):(0,r.jsx)(l.Z,{sx:{width:"48px",height:"48px",borderRadius:"50%",display:"inline-block",borderTop:e=>"4px solid ".concat(e.palette.warning.main),borderRight:"4px solid transparent",boxSizing:"border-box",animation:"rotation 1s linear infinite",position:"relative","&::after":{content:'""',boxSizing:"border-box",position:"absolute",left:0,top:0,width:"48px",height:"48px",borderRadius:"50%",borderBottom:e=>"4px solid ".concat(e.palette.primary.main),borderLeft:"4px solid transparent"},"@keyframes rotation":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}}})})}},86155:function(e,i,n){"use strict";var r=n(85893),l=n(31812);i.Z=e=>{let{btnState:i,text:n,...o}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(l.Z,{loading:"loading"===i,disabled:"disabled"===i,...o,children:n})})}},76450:function(e,i,n){"use strict";var r=n(85893);i.Z=e=>{let{height:i=20,width:n=20}=e;return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:i,fill:"currentColor",viewBox:"0 0 16 16",children:(0,r.jsx)("path",{d:"M11.182.008C11.148-.03 9.923.023 8.857 1.18c-1.066 1.156-.902 2.482-.878 2.516s1.52.087 2.475-1.258.762-2.391.728-2.43m3.314 11.733c-.048-.096-2.325-1.234-2.113-3.422s1.675-2.789 1.698-2.854-.597-.79-1.254-1.157a3.7 3.7 0 0 0-1.563-.434c-.108-.003-.483-.095-1.254.116-.508.139-1.653.589-1.968.607-.316.018-1.256-.522-2.267-.665-.647-.125-1.333.131-1.824.328-.49.196-1.422.754-2.074 2.237-.652 1.482-.311 3.83-.067 4.56s.625 1.924 1.273 2.796c.576.984 1.34 1.667 1.659 1.899s1.219.386 1.843.067c.502-.308 1.408-.485 1.766-.472.357.013 1.061.154 1.782.539.571.197 1.111.115 1.652-.105.541-.221 1.324-1.059 2.238-2.758q.52-1.185.473-1.282"})})}},48739:function(e,i,n){"use strict";var r=n(85893);i.Z=e=>{let{height:i=20,width:n=21}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:i,viewBox:"0 0 21 20",fill:"none",children:[(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.35 10.2273C20.35 9.51825 20.2864 8.83643 20.1682 8.18188H10.75V12.0501H16.1318C15.9 13.3001 15.1955 14.3592 14.1364 15.0682V17.5773H17.3682C19.2591 15.8364 20.35 13.2728 20.35 10.2273Z",fill:"#4285F4"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.7498 19.9999C13.4498 19.9999 15.7135 19.1044 17.368 17.5772L14.1362 15.0681C13.2407 15.6681 12.0953 16.0226 10.7498 16.0226C8.14529 16.0226 5.94075 14.2635 5.15439 11.8999H1.81348V14.4908C3.45893 17.759 6.84075 19.9999 10.7498 19.9999Z",fill:"#34A853"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.15455 11.8999C4.95455 11.2999 4.84091 10.659 4.84091 9.99994C4.84091 9.34085 4.95455 8.69994 5.15455 8.09994V5.50903H1.81364C1.13636 6.85903 0.75 8.38631 0.75 9.99994C0.75 11.6136 1.13636 13.1409 1.81364 14.4909L5.15455 11.8999Z",fill:"#FBBC05"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.7498 3.97727C12.218 3.97727 13.5362 4.48182 14.5726 5.47273L17.4407 2.60455C15.7089 0.990909 13.4453 0 10.7498 0C6.84075 0 3.45893 2.24091 1.81348 5.50909L5.15439 8.1C5.94075 5.73636 8.14529 3.97727 10.7498 3.97727Z",fill:"#EA4335"})]})})}},38334:function(e,i,n){"use strict";var r=n(85893);i.Z=e=>{let{height:i=20,width:n=21}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:n,height:i,viewBox:"0 0 21 20",fill:"none",children:[(0,r.jsxs)("g",{clipPath:"url(#clip0_83_18468)",children:[(0,r.jsx)("path",{d:"M11.375 9.375H20.75V0.625C20.75 0.28 20.47 0 20.125 0H11.375V9.375Z",fill:"#4CAF50"}),(0,r.jsx)("path",{d:"M10.125 9.375V0H1.375C1.03 0 0.75 0.28 0.75 0.625V9.375H10.125Z",fill:"#F44336"}),(0,r.jsx)("path",{d:"M10.125 10.625H0.75V19.375C0.75 19.72 1.03 20 1.375 20H10.125V10.625Z",fill:"#2196F3"}),(0,r.jsx)("path",{d:"M11.375 10.625V20H20.125C20.47 20 20.75 19.72 20.75 19.375V10.625H11.375Z",fill:"#FFC107"})]}),(0,r.jsx)("defs",{children:(0,r.jsx)("clipPath",{id:"clip0_83_18468",children:(0,r.jsx)("rect",{width:"20",height:"20",fill:"white",transform:"translate(0.75)"})})})]})})}},56482:function(e,i,n){"use strict";n.d(i,{Z:function(){return u}});var r=n(85893),l=n(5616),o={src:"/_next/static/media/login-background.2c3297a7.jpg",height:1106,width:1202,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wgARCAAHAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAUAQEAAAAAAAAAAAAAAAAAAAAC/9oADAMBAAIQAxAAAAGIEv/EABYQAAMAAAAAAAAAAAAAAAAAAAECIf/aAAgBAQABBQItP//EABURAQEAAAAAAAAAAAAAAAAAAAAB/9oACAEDAQE/Aa//xAAVEQEBAAAAAAAAAAAAAAAAAAAAAf/aAAgBAgEBPwGP/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAGPwJ//8QAFhAAAwAAAAAAAAAAAAAAAAAAAAFB/9oACAEBAAE/IUSf/9oADAMBAAIAAwAAABAH/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAgBAwEBPxA//8QAFhEAAwAAAAAAAAAAAAAAAAAAAAEh/9oACAECAQE/EFh//8QAGBAAAgMAAAAAAAAAAAAAAAAAABEBMVH/2gAIAQEAAT8QlolYf//Z",blurWidth:8,blurHeight:7},t=n(25675),a=n.n(t),s=n(15861),d=n(67294);let c=[{src:"/_next/static/media/slider-(1).807e26d0.png",height:1095,width:1623,blurDataURL:"data:image/png;
1base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAMAAABPT11nAAAARVBMVEUXExo2N0BCNEBfYWaNj45BPEG9wsAvLjYiEREiHChLS1GKioplZWUnIysdHSFJRE3QpVs/ZknG2HNRYkyDrUEWEhq/0m0co8V2AAAADXRSTlOl+6X+/TD++wen+js60dKnTQAAAAlwSFlzAAAhOAAAITgBRZYxYAAAADJJREFUeJwFwYkBgCAMBMFFgfB4QQXtv1RmKOmoQKXwuSRxxdgsmNFzPsezfpK7xrzfDRxPAYt9cd7mAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:5},{src:"/_next/static/media/slider-(2).50e5c1c3.png",height:1101,width:1656,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAMAAABPT11nAAAASFBMVEUlISkvLTEzMD0vJi9obU87SUVFVzohHSM/PkQiHypKSlQwLDc2LTkpJy9MSVMhGyswLTa413U+bUS/zk6wl3zHrnfTiV52XFDqPQ0WAAAADXRSTlPYgWQ7/f391/792kXZ7YUV8QAAAAlwSFlzAAAhOAAAITgBRZYxYAAAADBJREFUeJwFwQcCABAMBLAzq2ht/v9TCVwFEQEonUVaY1jhFKL3yJp0rnFgpOu7Y38e+gG0i+dbuQAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:5},{src:"/_next/static/media/slider-(3).9f83ced2.png",height:1101,width:1482,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAMAAADJ2y/JAAAAMFBMVEUkHiYoJS0mISoyLzhaVFR3cW4yLC8vLzU+OUMaGRwTFRRLSEUpJyRETTegnJckHyYeVrbaAAAACHRSTlPT/c39/v6nzfp+SqwAAAAJcEhZcwAAITgAACE4AUWWMWAAAAAwSURBVHicLcEBEgAQCATAK6Kr8P/fGjN2MfBNaf5Aj3gTcSizMyKh7BYsh4Zt1soLGA0BKsN2gD4AAAAASUVORK5CYII=",blurWidth:8,blurHeight:6}];var u=()=>{let[e,i]=(0,d.useState)(0);return(0,d.useEffect)(()=>{let e=setInterval(()=>{i(e=>(e+1)%c.length)},5e3);return()=>clearInterval(e)},[e]),(0,r.jsxs)(l.Z,{position:"relative",height:"100%",borderRadius:3,overflow:"hidden",width:"100%",children:[(0,r.jsx)(a(),{alt:"background image",src:o,fill:!0,placeholder:"blur"}),(0,r.jsxs)(l.Z,{position:"relative",height:"100%",children:[(0,r.jsx)(s.Z,{textAlign:"center",variant:"h4",pt:8,children:"Manage your risk profile"}),(0,r.jsx)(l.Z,{component:"figure",sx:{position:"absolute",bottom:"-1%",right:0,width:"100%",pl:5,pr:[0,1,2].includes(e)?0:5,img:{height:"auto",width:"100%",objectFit:"cover"}},children:(0,r.jsx)(a(),{src:c[e],alt:"slider 1",objectFit:"cover"})})]})]})}},79557:function(e,i,n){"use strict";var r=n(85893),l=n(5306),o=n(50135),t=n(78647),a=n(14640),s=n(67294),d=n(87536);i.Z=function(e){let{control:i,country:n,disableCountryField:c,companyCountryName:u}=e,p=(0,a.useTranslations)(),[m,A]=(0,s.useState)((0,t.x0)());return(0,s.useEffect)(()=>{A((0,t.x0)())},[u]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(d.Qr,{name:"country",control:i,rules:{required:{value:!0,message:"Country Name is required"},validate:e=>e.hasOwnProperty("label")},render:e=>{let{field:i,fieldState:{error:t}}=e,a="object"==typeof i.value?i.value:n.find(e=>{var n,r;return(null==e?void 0:null===(n=e.label)||void 0===n?void 0:n.toLocaleLowerCase())===(null==i?void 0:null===(r=i.value)||void 0===r?void 0:r.toLocaleLowerCase())});return(0,r.jsx)(l.Z,{...i,options:n||[],getOptionLabel:e=>null==e?void 0:e.label,disabled:c,value:a,fullWidth:!0,disablePortal:!1,sx:{position:"relative"},onChange:(e,n)=>{i.onChange(n)},renderInput:e=>(0,r.jsx)(o.Z,{...e,label:(0,r.jsxs)(r.Fragment,{children:[p("register_corporate_country_name_field_label"),(0,r.jsx)("span",{style:{color:"red"},children:" *"})]}),error:!!t,helperText:null==t?void 0:t.message,placeholder:p("register_corporate_country_name_field_label_placeholder")})})}},m)})}},77662:function(e,i,n){"use strict";var r=n(85893),l=n(67294),o=n(77484),t=n(15861),a=n(5306),s=n(5616),d=n(86886),c=n(50135),u=n(34386),p=n(96618),m=n(14640),A=n(25675),h=n.n(A),v=n(87536);i.Z=function(e){var i;let{register:n,errors:A,control:g,countryCodeProps:x,disabled:y=!1,clearMobileNumber:_=()=>{},selectedCountryCode:f=null}=e,b=(0,m.useTranslations)(),[j,w]=(0,l.useState)(null),C=(0,l.useMemo)(()=>{let e=o.h.find(e=>e.code===j);return null==e?void 0:e.placeholder},[j]);(0,l.useEffect)(()=>{if(f){let e=o.h.find(e=>e.phone===(null==f?void 0:f.replace("+","")));e&&w(e.code)}},[f]);let Z=A.phone;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(d.ZP,{container:!0,spacing:2,children:[(0,r.jsx)(d.ZP,{item:!0,xs:12,lg:4,children:(0,r.jsx)(v.Qr,{name:"country_code",control:g,rules:{required:"Country is required"},render:e=>{let{field:i,fieldState:{error:n}}=e;return(0,r.jsx)(a.Z,{...i,..."function"==typeof x?x(i):{},options:o.h||[],fullWidth:!0,getOptionLabel:e=>"+".concat(e.phone),filterOptions:(e,i)=>{if(e&&e.length>0){let n=i.inputValue.toLowerCase().trim();return e.filter(e=>e.label.toLowerCase().includes(n)||e.phone.toLowerCase().includes(n))}return[]},disableClearable:!0,renderInput:e=>(0,r.jsx)(c.Z,{...e,label:b("register_non_corporate_countryfield_label"),error:!!n,helperText:null==n?void 0:n.message}),renderOption:(e,i,n)=>{let{index:o}=n;return(0,l.createElement)(s.Z,{component:"li",sx:{"& > img":{mr:2,flexShrink:0}},...e,key:o,children:[(0,r.jsx)(h(),{height:20,width:20,src:"/flags/".concat(i.code.toLowerCase(),".png"),alt:"".concat(i.label," Flag")}),"+",i.phone," ",i.code]})},onChange:(e,n)=>{let r=Array.isArray(n)?n[0]:n;i.onChange(r),(null==r?void 0:r.code)&&(w(r.code),_(r.code))},disabled:y})}})}),(0,r.jsxs)(d.ZP,{item:!0,xs:12,lg:8,children:[(0,r.jsx)(c.Z,{fullWidth:!0,label:(0,r.jsxs)(r.Fragment,{children:[b("register_non_corporate_mobilefield_placeholder"),(0,r.jsx)("span",{style:{color:"red"},children:" *"})]}),variant:"outlined",size:"medium",...n("phone",{required:b("register_non_corporate_mobilefield_error"),validate:e=>{var i;return(null===(i=(0,p.S)(String(null!=e?e:""),j))||void 0===i?void 0:i.isValid())||"Invalid phone number format"}}),error:!!Z,helperText:null!==(i=null==Z?void 0:Z.message)&&void 0!==i?i:"",In
1putLabelProps:{shrink:!0},disabled:y||!(null==j?void 0:j.length),sx:{WebkitAppearance:"none","& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0}}}),j?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(u.Z,{title:C,children:(0,r.jsxs)(t.Z,{sx:{fontSize:10,mt:.5,color:"text.secondary"},children:[b("check_phone_format")," "]})})}):(0,r.jsx)(r.Fragment,{})]})]})})}},20651:function(e,i,n){"use strict";var r=n(85893),l=n(13379),o=n(60888),t=n(5616),a=n(11057),s=n(39043),d=n(15861);let c={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"80%",maxWidth:600,bgcolor:"background.paper",border:"2px solid #000",boxShadow:24,borderRadius:2,p:4},u={display:"flex",justifyContent:"space-between"};i.Z=e=>{let{open:i,title:n,subtitle:p,buttonText:m,buttonOnClick:A,supportedDmoanins:h}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(s.Z,{open:i,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:(0,r.jsxs)(t.Z,{sx:{...c,display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,r.jsx)(o.Z,{style:{color:"green",fontSize:40}}),(0,r.jsx)(d.Z,{id:"modal-modal-title",variant:"h6",color:"text.primary",sx:{textAlign:"center",marginTop:2},children:n}),(0,r.jsx)(d.Z,{color:"text.secondary",variant:"body1",sx:{marginBottom:1,textAlign:"center",fontWeight:400,fontSize:"12px"},children:p}),(0,r.jsx)(t.Z,{sx:{...u,justifyContent:"center",marginTop:3},children:h?(0,r.jsx)(a.Z,{onClick:A,variant:"contained",color:"primary",size:"small",endIcon:(0,r.jsx)(l.Z,{style:{fontSize:10}}),children:m}):(0,r.jsx)(a.Z,{onClick:A,variant:"outlined",color:"inherit",size:"small",sx:{color:"text.primary",borderColor:"text.primary"},children:"Close"})})]})})})}},47799:function(e,i,n){"use strict";n.d(i,{V:function(){return s}});var r=n(85893),l=n(22961),o=n(72450),t=n(93946),a=n(87109);let s=function(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Password";return{fullWidth:!0,label:n,size:"medium",type:e?"text":"password",InputProps:{endAdornment:(0,r.jsx)(a.Z,{position:"start",children:(0,r.jsx)(t.Z,{onClick:()=>i(!e),edge:"end",children:e?(0,r.jsx)(l.Z,{}):(0,r.jsx)(o.Z,{})})})}}}},93423:function(e,i,n){"use strict";n.d(i,{D:function(){return r},a:function(){return l}});let r=(e,i)=>e(i,{required:"Email is required",pattern:{value:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/i,message:"Invalid email address"}}),l=(e,i)=>e(i,{required:"Password is required",minLength:{value:8,message:"Password must be at least 8 characters long"}})},82107:function(e,i,n){"use strict";n.r(i),n.d(i,{default:function(){return eA}});var r=n(85893),l=n(5616),o=n(86886),t=n(90629),a=n(67294),s=n(86155),d=n(29369),c=n(37718),u=n(47799),p=n(77484),m=n(23078),A=n(93423),h=n(11057),v=n(67720),g=n(51233),x=n(50135),y=n(15861),_=n(95960),f=n(5559),b=n(14640),j=n(11163),w=n(87536),C=n(45007),Z=n(20651),k=n(5306),T=e=>{let{control:i,companyTypeList:n,disableCompanyTypeField:l,selectedCompanyType:o}=e,t=(0,b.useTranslations)(),a={label:""};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(w.Qr,{name:"company_type",control:i,rules:{required:{value:!0,message:"Company Type is required"},validate:e=>(null==e?void 0:e.id)!==void 0},render:e=>{let{field:i,fieldState:{error:s}}=e,d=i.value||(o?n.find(e=>(null==e?void 0:e.id)===(null==o?void 0:o.id)):a);return(0,r.jsx)(k.Z,{options:[...n,a],getOptionLabel:e=>(null==e?void 0:e.label)||(null==e?void 0:e.name)||"",fullWidth:!0,disablePortal:!1,disabled:l,value:d,onChange:(e,n)=>{n===a?i.onChange(null):i.onChange(n)},renderInput:e=>(0,r.jsx)(x.Z,{...e,label:(0,r.jsxs)(r.Fragment,{children:[t("register_corporate_company_type_field_label"),(0,r.jsx)("span",{style:{color:"red"},children:" *"})]}),error:!!s,helperText:null==s?void 0:s.message,placeholder:t("register_corporate_company_type_field_placeholder")})})}})})},S=e=>{let{control:i,roles:n,company_type:l}=e,o=(0,b.useTranslations)();return(0,r.jsx)(w.Qr,{name:"corporateRoles",control:i,rules:{required:{value:!0,message:"Role is required"},validate:e=>e.hasOwnProperty("role")},render:e=>{let{field:i,fieldState:{error:t}}=e;return(0,r.jsx)(k.Z,{...i,disabled:(null==n?void 0:n.length)===0||!l,options:n||[],getOptionLabel:e=>null==e?void 0:e.name,fullWidth:!0,disablePortal:!1,sx:{position:"relative"},onChange:(e,n)=>i.onChange(n),renderInput:e=>(0,r.jsx)(x.Z,{...e,label:(0,r.jsxs)(r.Fragment,{children:[o("register_non_corporate_role_field_label"),(0,r.jsx)("span",{style:{color:"red"},children:" *"})]}),error:!!t,helperText:null==t?void 0:t.message,placeholder:"Select the Roles from the dropdown"})})}})},F=n(79557),E=n(77662),I=n(17171),L=n(39628),P=n(69368),B=n(87918),R=n(90948);let z=(0,R.ZP)("svg")({});var O=e=>{let{sx:i}=e;return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(z,{sx:i,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,r.jsx)("path",{d:"M6.6665 11.3333L9.33317 14L11.9998 11.3333",stroke:"white",strokeOpacity:"0.56",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M4 3.33333H8.33333C8.59855 3.33333 8.8529 3.43868 9.04044 3.62622C9.22798 3.81376 9.33333 4.06811 9.33333 4.33333V14",stroke:"white",strokeOpacity:"0.56",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})};let M=e=>{let{props:i={},option:n,selected:l,active:o}=e,t=(0,R.ZP)("li")(e=>{let{theme:i}=e;return{color:o?i.palette.text.primary:i.palette.text.disabled,".MuiSvgIcon-root":{fill:o?i.palette.text.primary:i.palette.text.disabled},...!o&&{paddingInline:i.spacing(2),paddingTop:i.spacing(1),paddingBottom:i.spacing(1),cursor:"not-allowed",input:{cursor:"not-allowed"}}}});return(0,r.jsxs)(t,{...i,children:[(0,r.jsx)(P.Z,{icon:V,checkedIcon:N,style:{marginRight:8},checked:l}),null==n?void 0:n.name]})},V=(0,r.jsx)(L.Z,{fontSize:"small"}),N=(0,r.jsx)(I.Z,{fontSize:"small"});var Q=e=>{let{control:i,roles:n,onSwitchAccountType:o,corporateRoleList:t}=e,s=(0,b.useTranslations)();return(0,r.jsx)(w.Qr,{name:"individualRoles",control:i,rules:{required:{value:!0,message:s("register_non_corporate_roles_error")},validate:e=>e.length>0},render:e=>{let{field:i,fieldState:{error:s}}=e;return(0,r.jsx)(k.Z,{...i,value:i.value,fullWidth:!0,multiple:!0,disablePortal:!1,disableCloseOnSelect:!0,sx:{position:"relative"},PopperComponent:e=>(0,r.jsx)(l.Z,{...e}),options:n,getOptionLabel:e=>null==e?void 0:e.name,isOptionEqualToValue:(e,i)=>e.role===i.role,renderTags:(e,i)=>e.map((e,n)=>(0,a.createElement)(B.Z,{...i({index:n}),label:e.name,key:n,variant:"outlined"})),renderOption:(e,i,l)=>{let{selected:a,index:s}=l;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M,{active:!0,selected:a,props:e,option:i}),(null==n?void 0:n.length)-1===s&&t.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(g.Z,{justifyContent:"space-between",alignItems:"center",direction:"row",sx:{paddingInline:3,background:e=>
1e.palette.action.disabledBackground,paddingTop:1,paddingBottom:1},children:[(0,r.jsxs)(y.Z,{variant:"body1",children:["Corporate account roles",(0,r.jsx)(O,{sx:{verticalAlign:"bottom"}})]}),(0,r.jsx)(h.Z,{size:"small",variant:"text",onClick:()=>o("corporate"),children:"Switch to corporate"})]}),t.map((e,i)=>(0,r.jsx)(M,{selected:!1,option:e,active:!1},i))]})]})},renderInput:e=>(0,r.jsx)(x.Z,{...e,label:(0,r.jsxs)(r.Fragment,{children:["Roles",(0,r.jsx)("span",{style:{color:"red"},children:" *"})]}),error:!!s,helperText:null==s?void 0:s.message}),limitTags:2,getLimitTagsText:e=>(0,r.jsx)(B.Z,{label:"+".concat(e," more")}),onChange:(e,n)=>i.onChange(n),noOptionsText:""})}})},D=n(55678);let U=e=>{let i={assoc:"Association",bros:"Brothers",cie:"Compagnie",co:"Company",corp:"Corporation",inc:"Incorporated",ltd:"Limited",pvt:"Private"},n=RegExp("\\b(".concat(Object.keys(i).join("|"),")\\b"),"gi");return e.replace(n,e=>i[e.toLowerCase()])};var W=e=>{let{control:i,companyNameList:n,isCompanyListLoading:l,companyType:o,setValue:t}=e,a=Array.isArray(n)?n:[],s=e=>{if(!e)return;let i=e.trim().toLowerCase();return p.h.find(e=>{var n;return(null===(n=e.label)||void 0===n?void 0:n.trim().toLowerCase())===i})},d=e=>{t("disableCompanyTypeField",!0),t("disableCountryField",!0),t("selectedCompany",e),t("company_display_name",e.company_display_name||"");let i=null==o?void 0:o.find(i=>(null==i?void 0:i.id)===(null==e?void 0:e.company_type_id));i&&t("company_type",i,{shouldValidate:!0});let n=s("string"==typeof e.country?e.country:void 0);n&&t("country",n,{shouldValidate:!0})},c=e=>{let i=(e||"").trim().toLowerCase();if(!i)return!1;let n=a.find(e=>{var n;return(null===(n=e.company_name)||void 0===n?void 0:n.toLowerCase())===i});return n?(t("company_name",n.company_name),d(n),!0):(t("disableCompanyTypeField",!1),t("disableCountryField",!1),!1)};return(0,r.jsx)(w.Qr,{name:"company_name",control:i,rules:{required:{value:!0,message:"Company name is required"}},render:e=>{let{field:i,formState:{errors:n}}=e;return(0,r.jsx)(k.Z,{freeSolo:!0,options:a,loading:l,inputValue:"string"==typeof i.value?i.value:"",onInputChange:(e,n,r)=>{"input"===r?(i.onChange(n),t("disableCompanyTypeField",!1),t("disableCountryField",!1),t("company_display_name",""),t("company_type",{}),t("country",{code:"",label:"",phone:"",placeholder:""})):"clear"===r&&(i.onChange(""),t("disableCompanyTypeField",!1),t("disableCountryField",!1),t("company_display_name",""),t("company_type",{}),t("country",{code:"",label:"",phone:"",placeholder:""}))},onChange:(e,n,r)=>{"selectOption"===r&&n&&"string"!=typeof n&&(i.onChange(n.company_name),d(n))},getOptionLabel:e=>"string"==typeof e?e:e.company_name,isOptionEqualToValue:(e,i)=>e.company_name===i.company_name,renderInput:e=>{var l;return(0,r.jsx)(x.Z,{...e,label:(0,r.jsxs)(r.Fragment,{children:["Company Name ",(0,r.jsx)("span",{style:{color:"red"},children:" *"})]}),variant:"outlined",InputProps:{...e.InputProps,endAdornment:e.InputProps.endAdornment},error:!!n.company_name,helperText:null===(l=n.company_name)||void 0===l?void 0:l.message,onBlur:e=>{let n=U(e.target.value||"");i.onChange(n),c(n)},inputProps:{...e.inputProps,autoComplete:"new-password",name:"fake-company-name","data-lpignore":"true"}})}})}})},H=n(29061),q=n(12754),J=n(50480),Y=n(29584);let G=[{role:"admin",name:"Admin"}];var K=e=>{var i,n,t,k,I,L,B;let{accountType:R,defaultData:z,onSwitchAccountType:O,providerData:M}=e,V=(0,b.useTranslations)(),N=(0,j.useRouter)(),U=(0,C.I0)(),K=(0,a.useRef)(null),X=null===(i=N.query)||void 0===i?void 0:i.email,$=(null===(n=N.query)||void 0===n?void 0:n.fromInvite)==="true",[ee,ei]=(0,a.useState)("idle"),[en,er]=(0,a.useState)(!1),[el,eo]=(0,a.useState)(!1),[et,ea]=(0,a.useState)(!0),[es,ed]=(0,a.useState)(!1),[ec,eu]=(0,a.useState)([]),[ep,em]=(0,a.useState)(!1),[eA,eh]=(0,a.useState)(!1),[ev,eg]=(0,a.useState)(!1),{register:ex,handleSubmit:ey,control:e_,watch:ef,setValue:eb,reset:ej,formState:{errors:ew}}=(0,w.cI)({defaultValues:{disableCompanyTypeField:!0,disableCountryField:!0,email:$?X:""}}),eC=ef("password"),eZ=ef("company_type"),ek=ef("company_name"),eT=ef("email"),eS=ef("phone"),eF=ef("disableCompanyTypeField"),eE=ef("disableCountryField"),eI=ef("country"),eL=ef("selectedCountry"),eP=ef("selectedCompany"),eB=e=>(null!=e?e:"").toLowerCase().replace(/[_\s-]+/g," ").trim(),eR=(0,a.useMemo)(()=>{var e;return null==z?void 0:null===(e=z.company_type)||void 0===e?void 0:e.find(e=>(null==e?void 0:e.id)==="individual_account"||"string"==typeof(null==e?void 0:e.type)&&"individual account"===eB(null==e?void 0:e.type))},[z]),ez=(0,a.useMemo)(()=>{var e;return null==z?void 0:null===(e=z.company_type)||void 0===e?void 0:e.filter(e=>(null==e?void 0:e.type)!="individual_account")},[null==z?void 0:z.company_type]),eO=(0,a.useMemo)(()=>{var e,i;let n=null==z?void 0:null===(e=z.role)||void 0===e?void 0:e.find(e=>"individual"===e.accountType);return(null==n?void 0:null===(i=n.categories)||void 0===i?void 0:i.filter(e=>e.is_for_individual))||[]},[null==z?void 0:z.role]),eM=(0,a.useMemo)(()=>{var e;let i=null==z?void 0:null===(e=z.role)||void 0===e?void 0:e.find(e=>"corporate"===e.accountType);return(null==i?void 0:i.categories)||[]},[null==z?void 0:z.role]),eV="individual"===R&&(null==eR?void 0:eR.is_applicable_for_trial)?"Start your ".concat(eR.trial_period_days,"-day free trial"):"corporate"===R&&(null==eZ?void 0:eZ.is_applicable_for_trial)?"Start your ".concat(null==eZ?void 0:eZ.tri
1al_period_days,"-day free trial"):"Register";(0,a.useEffect)(()=>{var e;(null==eI?void 0:null===(e=eI.phone)||void 0===e?void 0:e.length)>0&&eb("country_code","+".concat(eI.phone))},[eI]),(0,a.useEffect)(()=>{ej(),eh(!1),eg(!1)},[R]),(0,a.useEffect)(()=>{if(M&&void 0!=M){var e,i,n;$||eb("email",(null===(n=M.user)||void 0===n?void 0:n.email)||""),eb("displayName",(null===(e=M.user)||void 0===e?void 0:e.displayName)||""),eb("name",(null==M?void 0:null===(i=M._tokenResponse)||void 0===i?void 0:i.fullName)||"")}},[M,$]),(0,a.useEffect)(()=>{let e=async()=>{try{var e;em(!0);let i=await H.Z.get("".concat(q.v3,"?name=").concat(ek)),n=(null==i?void 0:null===(e=i.data)||void 0===e?void 0:e.result)||[];eu(n)}catch(e){(0,m.f)(e,"Failed to fetch accounts")}finally{em(!1)}};return K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{ek&&"string"==typeof ek&&e()},500),()=>{K.current&&clearTimeout(K.current)}},[ek]);let eN=()=>ed(!0),eQ=async()=>{ed(!1),await (0,_.w7)(d.I8),U((0,c.A3)(null)),N.replace("/login")},eD=async e=>{var i,n,r,l,o,t,a,s,u,p,A,h,v,g,x,y,f,b,j,w,C,Z;try{let m={...e,accountType:R,isIndividual:"individual"===R};ei("loading");let Z=M||await (0,_.Xb)(d.I8,e.email,e.password),k={...m,roles:"corporate"===R?e.corporateRoles:e.individualRoles,company_id:"string"!=typeof eP?null==eP?void 0:eP.id:null,company_name:"string"!=typeof(null==e?void 0:e.company_name)?null==e?void 0:null===(i=e.company_name)||void 0===i?void 0:i.company_name:null==e?void 0:e.company_name,company_type_id:null==e?void 0:null===(n=e.company_type)||void 0===n?void 0:n.id,company_type_name:null==e?void 0:null===(r=e.company_type)||void 0===r?void 0:r.name,company_type:null==e?void 0:null===(l=e.company_type)||void 0===l?void 0:l.type,uId:null==Z?void 0:null===(o=Z.user)||void 0===o?void 0:o.uid,country:"individual"===R?null==e?void 0:null===(t=e.country_code)||void 0===t?void 0:t.label:null==eI?void 0:eI.label,country_code:"+".concat("individual"===R?null==e?void 0:null===(a=e.country_code)||void 0===a?void 0:a.phone:null==eI?void 0:eI.phone),is_email_password:!M,trial_period_days:"individual"===R?null==eR?void 0:eR.trial_period_days:null==eZ?void 0:eZ.trial_period_days,is_applicable_for_trial:"individual"===R?null==eR?void 0:eR.is_applicable_for_trial:null==eZ?void 0:eZ.is_applicable_for_trial,authData:{displayName:null==Z?void 0:null===(s=Z.user)||void 0===s?void 0:s.displayName,email:null==Z?void 0:null===(u=Z.user)||void 0===u?void 0:u.email,isEmailVerified:null==Z?void 0:null===(p=Z.user)||void 0===p?void 0:p.emailVerified,isAnonymous:null==Z?void 0:null===(A=Z.user)||void 0===A?void 0:A.isAnonymous,metadata:null==Z?void 0:null===(h=Z.user)||void 0===h?void 0:h.metadata,phoneNumber:null==Z?void 0:null===(v=Z.user)||void 0===v?void 0:v.phoneNumber,photoURL:null==Z?void 0:null===(g=Z.user)||void 0===g?void 0:g.photoURL,providerData:null==Z?void 0:null===(x=Z.user)||void 0===x?void 0:x.providerData,refreshToken:null==Z?void 0:null===(y=Z.user)||void 0===y?void 0:y.refreshToken,tenantId:null==Z?void 0:null===(f=Z.user)||void 0===f?void 0:f.tenantId,uId:null==Z?void 0:null===(b=Z.user)||void 0===b?void 0:b.uid}};await H.Z.post("".concat(q.gt),{data:k}),M||await H.Z.get("".concat(q.Lc,"?type=email_verification&email=").concat(encodeURIComponent((null==Z?void 0:null===(C=Z.user)||void 0===C?void 0:C.email)||""))),D.Am.success("Account created successfully"),ei("disabled"),M&&(0,Y.uq)(),M||eN(),await (0,_.w7)(d.I8),U((0,c.A3)(null));let T=null==e?void 0:null===(w=e.email)||void 0===w?void 0:null===(j=w.split("@"))||void 0===j?void 0:j[1];(null==T?void 0:T.includes("gmail.com"))?ea(!0):T.includes("outlook.com")?ea(!0):ea(!1),M&&N.replace("/login")}catch(e){(null==e?void 0:e.code)==="auth/email-already-in-use"||(null==e?void 0:null===(Z=e.message)||void 0===Z?void 0:Z.includes("EMAIL_EXISTS"))?D.Am.error("Email already exists"):(0,m.f)(e,"Failed to create account"),ei("idle")}},eU=async()=>{eQ();let e=eT.split("@")[1];"gmail.com"===e?window.open("https://mail.google.com/","_blank"):"outlook.com"===e&&window.open("https://outlook.live.com/","_blank")},eW=null==z?void 0:null===(k=z.config)||void 0===k?void 0:null===(t=k[0])||void 0===t?void 0:t.company_verification_by_admin,eH=(e,i)=>{e.stopPropagation(),e.preventDefault(),window.open(i,"_blank")};return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(l.Z,{sx:{".MuiAutocomplete-popper > div":{},pb:5},children:(0,r.jsxs)(l.Z,{marginTop:4,children:[(0,r.jsxs)("form",{onSubmit:ey(eD),autoComplete:"off",children:[(0,r.jsxs)(g.Z,{marginTop:4,marginBottom:1,direction:"column",gap:"20px",children:["corporate"===R&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(W,{control:e_,companyNameList:ec,setValue:eb,companyType:null==z?void 0:z.company_type,isCompanyListLoading:ep,reset:ej}),(0,r.jsx)(F.Z,{control:e_,country:p.h,companyCountryName:eI,selectedCountry:eL,disableCountryField:eE}),ez&&(0,r.jsx)(T,{control:e_,companyTypeList:ez,disableCompanyTypeField:eF,selectedCompanyType:eZ}),(0,r.jsx)(x.Z,{fullWidth:!0,label:(0,r.jsxs)(r.Fragment,{children:[V("register_corporate_company_displayname_field_label"),(0,r.jsx)("span",{style:{color:"red"},children:" *"})]}),placeholder:V("register_corporate_comapny_displayname_field_placeholder"),variant:"outlined",size:"medium",disabled:eF,...ex("company_display_name",{required:V("This field is required"),pattern:{value:/^[a-zA-Z0-9_\-\/\s]+$/,message:V("register_individual_alphanumericerror")}}),InputLabelProps:{shrink:!0},error:!!ew.company_display_name,helperText:(null===(I=ew.company_display_name)||void 0===I?void 0:I.message)||""}),(0,r.jsx)(v.Z,{textAlign:"left",sx:{marginBottom:1},children:(0,r.jsx)(y.Z,{variant:"subtitle1",children:V("register_corporate_user&roles_field_label")})}),(0,r.jsx)(S,{roles:Array.isArray(ec)&&-1!==ec.findIndex(e=>(null==e?void 0:e.company_name)===("string"==typeof ek?ek:null==ek?void 0:ek.company_name))?null==z?void 0:null===(B=z.company_type)||void 0===B?void 0:null===(L=B.find(e=>(null==e?void 0:e.type)===(null==eZ?void 0:eZ.type)))||void 0===L?void 0:L.roles:G,control:e_,company_type:eZ})]}),"individual"===R&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.Z,{fullWidth:!0,label:(0,r.jsxs)(r.Fragment,{children:[V("register_non_corporate_namefield_label"),(0,r.jsx)("span",{style:{color:"red"},children:" *"})]}),placeholder:V("register_non_corporate_namefield_placeholder"),variant:"outlined",size:"medium",...ex("name",{required:V("register_non_corporate_namefield_error"),pattern:{value:/^[a-zA-Z0-9_\-\/\s]+$/,message:V("register_individual_alphanumericerror")}}),error:!!ew.name,helperText:ew.name?ew.name.message:"",InputLabelProps:{shrink:!0}}),(0,r.jsx)(x.Z,{fullWidth:!0,label:V("register_non_corporate_displayname_field_label"),placeholder:V("register_non_corporate_displayname_field_placeholder"),variant:"outlined",size:"medium",InputLabelProps:{shrink:!0},...ex("displayName",{pattern:{value:/^[a-zA-Z0-9_\-\/\s]+$/,message:V("register_individual_alphanumericerror")}}),error:!!ew.displayName,helperText:ew.displayName?ew.displayName.message:""})]}),"corporate"===R&&(0,r.jsx)(x.Z,{fullWidth:!0,label:(0,r.jsxs)(r.Fragment,{children:[V("register_corporate_name_field_label"),(0,r.jsx)("span",{style:{color:"red"},children:" *"})]}),placeholder:V("register_corporate_name_field_placeholder"),variant:"outlined",size:"medium",...ex("name",{required:"Name is required"}),error:!!ew.name,helperText:ew.name?ew.name.message:"",InputLabelProps:{shrink:!0}}),(0,r.jsx)(x.Z,{fullWidth:!0,label:(0,r.jsxs)(r.Fragment,{children:[V("register_non_corporate_emailfield_label"),(0,r.jsx)("span",{style:{color:"red"},children:" *"})]}),placeholder:V("register_non_corporate_emailfield_placeholder"),variant:"outlined",size:"medium",InputLabelProps:{shrink:!0},...(0,A.D)(ex,"email"),error:!!ew.email,helperText:ew.email?ew.email.message:"",disabled:$}),(0,r.jsx)(E.Z,{selectedCountryCode:null==eI?void 0:eI.phone,register:ex,errors:e
1w,control:e_,clearMobileNumber:e=>{eb("phone",new f.R(e).input(eS||""))},countryCodeProps:e=>({value:"object"==typeof(null==e?void 0:e.value)?e.value:p.h.find(e=>{var i;return e.phone===(null==eI?void 0:null===(i=eI.phone.replace("+",""))||void 0===i?void 0:i.trim())})})},null==eI?void 0:eI.phone),!("individual"===R&&M)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(x.Z,{...(0,u.V)(en,er),...(0,A.a)(ex,"password"),error:!!ew.password,helperText:ew.password?ew.password.message:"",label:(0,r.jsxs)(r.Fragment,{children:[V("register_non_corporate_passwordfield_label"),(0,r.jsx)("span",{style:{color:"red"},children:" *"})]})}),(0,r.jsx)(x.Z,{...(0,u.V)(el,eo,"Confirm Password"),...ex("confirmPassword",{required:V("register_corporate_confirm_password_field_error"),validate:e=>e===eC||V("register_corporate_password_doesnotmatch_error")}),error:!!ew.confirmPassword,helperText:ew.confirmPassword?ew.confirmPassword.message:"",label:(0,r.jsxs)(r.Fragment,{children:[V("register_non_corporate_confirmpassword_field_label"),(0,r.jsx)("span",{style:{color:"red"},children:" *"})]})})]}),(0,r.jsx)(o.ZP,{container:!0,spacing:2,children:(0,r.jsx)(o.ZP,{item:!0,xs:12,sm:6})})]}),"corporate"!=R&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.Z,{textAlign:"left",sx:{marginBottom:3},children:(0,r.jsx)(y.Z,{variant:"subtitle1",children:V("register_non_corporate_role_field_label")})}),(0,r.jsx)(Q,{roles:eO,corporateRoleList:eM,accountType:R,control:e_,onSwitchAccountType:O})]}),(0,r.jsxs)(l.Z,{sx:{display:"flex",flexDirection:"column",mt:1,ml:1},children:[(0,r.jsx)(J.Z,{control:(0,r.jsx)(P.Z,{checked:eA,onChange:e=>eh(e.target.checked)}),label:(0,r.jsxs)(y.Z,{sx:{color:"white"},children:["I accept the"," ",(0,r.jsx)(y.Z,{component:"span",sx:{color:"primary.main",cursor:"pointer"},onClick:e=>eH(e,"https://www.risksphere.ai/terms-and-conditions/"),children:"Terms & conditions"})]})}),(0,r.jsx)(J.Z,{control:(0,r.jsx)(P.Z,{checked:ev,onChange:e=>eg(e.target.checked)}),label:(0,r.jsxs)(y.Z,{sx:{color:"white"},children:["I accept the"," ",(0,r.jsx)(y.Z,{component:"span",sx:{color:"primary.main",cursor:"pointer"},onClick:e=>eH(e,"https://www.risksphere.ai/privacy-policy/"),children:"Privacy Policy"})]})})]}),(0,r.jsxs)(g.Z,{marginTop:4,direction:{xs:"column",sm:"row"},gap:2,justifyContent:"space-between",children:[(0,r.jsx)(h.Z,{size:"large",variant:"outlined",color:"inherit",onClick:()=>{N.replace("/login")},children:V("register_non_corporate_back_to_login_btn")}),(0,r.jsx)(s.Z,{text:eV,btnState:ee,sx:{width:{xs:"100%",sm:"initial"}},variant:"contained",type:"submit",size:"large",disabled:"disabled"===ee||!eA||!ev})]})]}),(0,r.jsx)(Z.Z,{supportedDmoanins:et,buttonOnClick:eU,buttonText:V("register_non_corporate_open_mailbox_btn"),open:es,title:V("register_non_corporate_inbox_activation_titile"),handleSuccessOpen:eN,handleSuccessClose:eQ,subtitle:eW?V("register_corporate_registraion_request_description"):V("register_non_corporate_inbox_activation_description")})]})})})},X=n(48739),$=n(38334),ee=n(76450),ei=n(64666),en=n(37645),er=n(6514),el=n(31425),eo=n(36872),et=n(79717);let ea={textTransform:"none",border:"1px solid rgba(255, 255, 255, 0.12)",padding:{xs:"8px 12px",sm:"12px 16px"},fontWeight:400,minHeight:{xs:"40px",sm:"48px"}},es=()=>{let e=console.error,i=console.warn;return console.error=function(){for(var i=arguments.length,n=Array(i),r=0;r<i;r++)n[r]=arguments[r];let l=String(n[0]||"");l.includes("Cross-Origin-Opener-Policy")||l.includes("popup-closed")||e.apply(console,n)},console.warn=function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];let l=String(n[0]||"");l.includes("Cross-Origin-Opener-Policy")||l.includes("popup-closed")||i.apply(console,n)},()=>{console.error=e,console.warn=i}};var ed=e=>{let{accountType:i,onChangeAccountType:n,onAddProviderData:o}=e,t=(0,b.useTranslations)(),[s,c]=(0,a.useState)({isOpen:!1,email:"",existingMethods:[],pendingCredential:null,newProviderName:"",isLinking:!1}),u=async(e,i)=>{var n,r,l;try{let i=es(),r=await (0,d.nw)(),l=await (0,_.rh)(r,e);i();
1let t=l.user,a=await t.getIdToken(),s={user:t,_tokenResponse:{fullName:null!==(n=t.displayName)&&void 0!==n?n:""},idToken:a};o(s),await (0,_.w7)(r)}catch(n){if((null==n?void 0:n.code)==="auth/account-exists-with-different-credential"){let e=(null==n?void 0:null===(r=n.customData)||void 0===r?void 0:r.email)||"";try{let r=await (0,_.Nr)(d.I8,e),o=null===(l=n.customData)||void 0===l?void 0:l._tokenResponse,t=o?{accessToken:o.oauthAccessToken||"",idToken:o.oauthIdToken||"",providerId:"Apple"===i?"apple.com":"Google"===i?"google.com":"microsoft.com",signInMethod:"oauth"}:null;c({isOpen:!0,email:e,existingMethods:r,pendingCredential:t,newProviderName:i,isLinking:!1}),D.Am.info("Account already exists. Please sign in with ".concat(r[0]," to link your accounts."))}catch(e){console.error("Error fetching sign-in methods:",e),D.Am.error("Error checking existing account. Please try again.")}return}if((null==n?void 0:n.code)==="auth/popup-closed-by-user"||(null==n?void 0:n.code)==="auth/cancelled-popup-request")return;let e="object"==typeof n&&n&&"message"in n?String(n.message):"Error signing in with ".concat(i);D.Am.error(e)}finally{await (0,d.r9)().catch(()=>{})}},p=async()=>{if(!d.I8.currentUser||!s.pendingCredential){D.Am.error("Session expired. Please try again."),c({...s,isOpen:!1});return}try{var e;c({...s,isLinking:!0}),await (0,_.ZJ)(d.I8.currentUser,s.pendingCredential);let i=d.I8.currentUser,n=await i.getIdToken(),r={user:i,_tokenResponse:{fullName:null!==(e=i.displayName)&&void 0!==e?e:""},idToken:n};o(r),D.Am.success("".concat(s.newProviderName," account linked successfully!")),c({...s,isOpen:!1,isLinking:!1})}catch(e){console.error("Error linking account:",e),D.Am.error("Failed to link account. Please try again."),c({...s,isLinking:!1})}},m=()=>{c({...s,isOpen:!1})},A=t("register_non_corporate_create_user_account_title"),x=t("register_corporate_create_corporate_act_title");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(l.Z,{pt:{xs:2,sm:5},children:[(0,r.jsx)(y.Z,{sx:{fontSize:e=>({xs:e.typography.h5.fontSize,sm:e.typography.h4.fontSize})},children:"individual"===i?A:x}),(0,r.jsxs)(et.Z,{row:!0,"aria-label":"accountType",name:"accountType",value:i,onChange:e=>n(e.target.value),children:[(0,r.jsx)(J.Z,{value:"individual",control:(0,r.jsx)(eo.Z,{}),label:t("register_non_corporate_radio_Individual")}),(0,r.jsx)(J.Z,{value:"corporate",control:(0,r.jsx)(eo.Z,{}),label:t("register_non_corporate_radio_Corporate")})]}),"individual"===i&&(0,r.jsxs)(g.Z,{marginTop:2,marginBottom:{xs:2,sm:4},direction:"row",gap:{xs:1.5,sm:2},children:[(0,r.jsx)(h.Z,{onClick:()=>u(d.Vv,"Google"),fullWidth:!0,color:"inherit",sx:ea,variant:"outlined",startIcon:(0,r.jsx)(X.Z,{})}),(0,r.jsx)(h.Z,{onClick:()=>u(d.eW,"Apple"),fullWidth:!0,color:"inherit",sx:ea,variant:"outlined",startIcon:(0,r.jsx)(ee.Z,{})}),(0,r.jsx)(h.Z,{onClick:()=>u(d.O6,"Microsoft"),fullWidth:!0,color:"inherit",sx:ea,variant:"outlined",startIcon:(0,r.jsx)($.Z,{})})]})]}),"individual"===i&&(0,r.jsx)(v.Z,{sx:{my:{xs:2,sm:3}},children:t("register_non_corporate_register_manually")}),(0,r.jsxs)(ei.Z,{open:s.isOpen,onClose:m,maxWidth:"sm",fullWidth:!0,children:[(0,r.jsx)(en.Z,{children:"Link Your Accounts"}),(0,r.jsxs)(er.Z,{children:[(0,r.jsxs)(y.Z,{variant:"body2",sx:{mt:2,mb:3},children:["An account with email ",(0,r.jsx)("strong",{children:s.email})," already exists. To continue, please sign in with ",(0,r.jsx)("strong",{children:s.existingMethods[0]})," to link your ",s.newProviderName," account to your existing profile."]}),(0,r.jsxs)(y.Z,{variant:"caption",color:"textSecondary",children:["This allows you to sign in with either ",s.existingMethods[0]," or ",s.newProviderName," in the future."]})]}),(0,r.jsxs)(el.Z,{children:[(0,r.jsx)(h.Z,{onClick:m,disabled:s.isLinking,children:"Cancel"}),(0,r.jsx)(h.Z,{onClick:p,variant:"contained",color:"primary",disabled:s.isLinking,children:s.isLinking?"Linking...":"Sign in with ".concat(s.existingMethods[0])})]})]})]})},ec=n(56482),eu=n(37115),ep=()=>{let[e,i]=(0,a.useState)(void 0),[n,s]=(0,a.useState)("individual"),[d,c]=(0,a.useState)(null),[u,p]=(0,a.useState)(!1);(0,a.useEffect)(()=>{var e;let n=(0,Y.sE)();(null==n?void 0:null===(e=n.user)||void 0===e?void 0:e.email)&&i(n)},[]),(0,a.useEffect)(()=>{(async()=>{try{p(!0);let i=await H.Z.get(q.v3);if(null==i?void 0:i.data){var e;let n=null==i?void 0:null===(e=i.data)||void 0===e?void 0:e.data;c(n)}}catch(e){(0,m.f)(e,"Failed to fetch default data")}finally{p(!1)}})()},[]);let A=e=>{s(e)};return(0,r.jsx)(l.Z,{sx:{height:"100vh",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.jsx)(o.ZP,{container:!0,alignItems:"stretch",justifyContent:"center",sx:{width:{xs:"100%",sm:"95%",md:"90%"},maxWidth:{xl:"80%"}},children:(0,r.jsx)(t.Z,{sx:{width:"100%",display:"flex",maxHeight:{xs:"100vh",md:"90vh"}},children:(0,r.jsxs)(o.ZP,{container:!0,width:"100%",children:[(0,r.jsx)(o.ZP,{item:!0,xs:12,md:5,lg:6,sx:{width:"100%",position:{md:"sticky"},top:0,height:{md:"90vh"},display:{xs:"none",md:"flex"},alignItems:"center"},children:(0,r.jsx)(ec.Z,{})}),(0,r.jsx)(o.ZP,{item:!0,xs:12,md:7,lg:6,sx:{maxHeight:{xs:"100vh",md:"90vh"},overflow:"auto","&::-webkit-scrollbar":{width:"8px",backgroundColor:e=>
1e.palette.action.disabledBackground},"&::-webkit-scrollbar-thumb":{backgroundColor:e=>e.palette.action.selected,borderRadius:"4px"}},children:(0,r.jsx)(l.Z,{padding:{xs:2,sm:3},children:u?(0,r.jsx)(eu.Z,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ed,{accountType:n,onChangeAccountType:A,onAddProviderData:e=>{i(e),(null==e?void 0:e.user)&&(0,Y.dt)(e.user)}}),(0,r.jsx)(K,{defaultData:d,accountType:n,onSwitchAccountType:A,providerData:e})]})})})]})})})})},em=n(88310),eA=()=>(0,r.jsx)(em.Z,{showSidebar:!1,secured:!1,children:(0,r.jsx)(ep,{})})}},function(e){e.O(0,[589,4514,1935,2395,121,858,7566,135,7918,6886,5644,5306,3911,7536,2956,8015,8310,7484,2888,9774,179],function(){return e(e.s=76276)}),_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.