PageSourceSearch

https://tcebaby.com.my/_next/static/chunks/9470-c136110cc2d49eda.js

js tcebaby.com.my collected 2026-09-24 10:23:26 UTC 15,618 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="22f9e502-288c-488a-b4f4-e32380655797",e._sentryDebugIdIdentifier="sentry-dbid-22f9e502-288c-488a-b4f4-e32380655797")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9470],{74670:function(e,a,s){var r=s(85893),t=s(90675);let l=e=>(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)(t.Z,{...e})});a.Z=l},39913:function(e,a,s){var r=s(85893),t=s(85724);let l=e=>{let{label:a,options:s,value:l,className:n,onChange:o,fullWidth:i=!1,disabled:d=!1,placeholder:u,hasError:c,errorMessage:m}=e,h="".concat(n,"  ").concat(i?" w-full":"");return(0,r.jsx)(t.m,{label:a,labelHidden:!a,className:h,value:l,onChange:e=>o(e.target.value),inputStyles:d?{backgroundColor:"#EEE"}:{backgroundColor:"#FFF"},disabled:d,placeholder:u,hasError:c,errorMessage:m,children:s.map(e=>(0,r.jsx)("option",{value:e.value,disabled:e.disabled,children:e.label},e.value))})};a.Z=l},62714:function(e,a,s){var r=s(85893),t=s(70210);let l=e=>(0,r.jsx)(t.n,{variation:"quiet",...e});a.Z=l},50240:function(e,a,s){s.d(a,{Eg:function(){return l},O$:function(){return r},vf:function(){return t}});let r=[{id:0,label:"Malaysia",value:"malaysia"},{id:1,label:"Singapore",value:"singapore"}],t=[{id:0,label:"Singapore",value:"singapore"}],l=[{id:0,label:"Johor",value:"johor"},{id:1,label:"Kedah",value:"kedah"},{id:2,label:"Kelantan",value:"kelantan"},{id:3,label:"Melaka",value:"melaka"},{id:4,label:"Negeri Sembilan",value:"negeriSembilan"},{id:5,label:"Pahang",value:"pahang"},{id:6,label:"Penang",value:"penang"},{id:7,label:"Perak",value:"perak"},{id:8,label:"Perlis",value:"perlis"},{id:9,label:"Sabah",value:"sabah"},{id:10,label:"Sarawak",value:"sarawak"},{id:11,label:"Selangor",value:"selangor"},{id:12,label:"Terengganu",value:"terangganu"},{id:13,label:"W.P. Kuala Lumpur",value:"kualaLumpur"},{id:14,label:"W.P. Labuan",value:"labuan"},{id:15,label:"W.P. Putrajaya",value:"putrajaya"}]},69470:function(e,a,s){s.d(a,{W:function(){return Z}});var r=s(85893),t=s(67294),l=s(87536),n=s(56312),o=s(1604),i=s(97719),d=s(76370),u=s(66573),c=s(62714),m=s(74670),h=s(11871),g=s(39913),b=s(98420),x=s(50240),f=s(39802),p=s(36408),v=s(89532),y=s(85459),j=s(77879),N=s(11048),w=s(86310),S=s(41664),P=s.n(S),C=s(56989);let k=o.z.object({phoneNumber:o.z.coerce.string({message:"Please enter a valid phone number"}).min(8,"Phone number must be at least 8 characters").refine(e=>{try{if(!(0,j.y)(e))return!1;let a=(0,N.h)(e);return a.isValid()}catch(e){return!1}},{message:"Please enter a valid phone number format"})}),E=o.z.object({displayName:o.z.string().min(3,"Display name must be at least 3 characters").max(50,"Display name must be less than 50 characters"),password:o.z.string().min(8,"Password must be at least 8 characters").regex(/[0-9]/,"Password must contain at least 1 number").regex(/[a-z]/,"Password must contain at least 1 lowercase letter"),email:o.z.string().email("Please enter a valid email address"),confirmPassword:o.z.string(),country:o.z.string().min(1,"Please select a country"),state:o.z.string().min(1,"Please select a state")}).refine(e=>e.password===e.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]}),M=[{key:"phone",label:"Phone Number"},{key:"otp",label:"Verification"},{key:"form",label:"Profile"}],I=(0,t.createContext)({step:"phone",phoneNumber:"",hash:"",setStep:()=>{},setPhoneNumber:()=>{},setHash:()=>{}}),O=e=>{let{children:a}=e,[s,l]=(0,t.useState)("phone"),[n,o]=(0,t.useState)(""),[i,d]=(0,t.useState)("");return(0,r.jsx)(I.Provider,{value:{step:s,setStep:l,phoneNumber:n,hash:i,setPhoneNumber:o,setHash:d},children:a})},A=()=>{let e=(0,t.useContext)(I);if(!e)throw Error("useSignupContext must be used within a SignupProvider");return e},L=e=>e.replace(/[^\d+]/g,""),T=e=>{let{defaultCountryCallingCode:a,defaultNationalNumber:s}=e,o=(0,f.$)(),{setStep:d,setPhoneNumber:c,setHash:m}=A(),[g,b]=(0,t.useState)(null!=a?a:"+60"),[x,p]=(0,t.useState)(null!=s?s:""),v=(0,l.cI)({mode:"onChange",resolver:(0,n.F)(k),defaultValues:{phoneNumber:""}});(0,t.useEffect)(()=>
1{if(a&&s){b(a),p(s);let e="".concat(a).concat(s);v.setValue("phoneNumber",L(e))}},[a,s,v]);let y=i.SX.users.auth.initateOtp.useMutation({onSuccess:e=>{o.showAlert("OTP sent to ".concat(v.getValues("phoneNumber")),"success"),m(null==e?void 0:e.hash),d("otp"),c(v.getValues("phoneNumber").toString())},onError:e=>{"User already exists"===e.message?v.setError("phoneNumber",{message:"Phone number already in use"}):v.setError("phoneNumber",{message:e.message})}}),j=e=>{b(e.target.value);let a=x;x.startsWith("0")&&"+60"===e.target.value&&p(a=x.substring(1));let s="".concat(e.target.value).concat(a);v.setValue("phoneNumber",L(s))},N=e=>{let a="".concat(g).concat(e.target.value),s=e.target.value;e.target.value.startsWith("0")&&"+60"===g&&(a=g+(s=e.target.value.substring(1))),p(s),v.setValue("phoneNumber",L(a))},w=v.handleSubmit(e=>{e.phoneNumber&&y.mutate({triggerType:"SIGNUP",phoneNumber:e.phoneNumber.toString()})});return(0,r.jsxs)("form",{onSubmit:w,className:"space-y-4",children:[(0,r.jsx)(l.Qr,{name:"phoneNumber",control:v.control,render:()=>{var e;return(0,r.jsx)(u.g,{label:"PHONE NUMBER",defaultDialCode:g,value:x,placeholder:"e.g. 123456789",onDialCodeChange:j,onChange:N,hasError:!!v.formState.errors.phoneNumber,errorMessage:null===(e=v.formState.errors.phoneNumber)||void 0===e?void 0:e.message})}}),(0,r.jsx)(h.default,{label:"Send Verification Code",fullWidth:!0,color:"yellow",isRounded:!1,size:"large",onClick:w,disabled:!v.watch("phoneNumber"),isLoading:y.isPending})]})},z=()=>{let e=(0,f.$)(),{setStep:a,phoneNumber:s,setHash:l,hash:n}=A(),[o,u]=(0,t.useState)(""),[c,m]=(0,t.useState)(30),[g,b]=(0,t.useState)(!0),x=i.SX.users.auth.resendOtp.useMutation({onSuccess:a=>{e.showAlert("OTP sent to your phone","success"),m(90),b(!0),l(null==a?void 0:a.hash)},onError:a=>{e.showAlert(a.message,"error")}}),v=i.SX.users.auth.verifyOtp.useMutation({onSuccess:s=>{e.showAlert("OTP verified","success"),l(s.hash),a("form")},onError:a=>{u(""),e.showAlert(a.message,"error")}});(0,t.useEffect)(()=>{if(c>0){let e=setInterval(()=>{m(e=>e-1)},1e3);return()=>clearInterval(e)}b(!1)},[c]);let y=e=>{u(e),6===e.length&&v.mutate({otp:e,hash:n})},j=()=>{x.mutate({phoneNumber:s})},N=()=>{a("phone")};return(0,t.useEffect)(()=>{s||a("phone")},[s]),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsxs)("h4",{className:"text-base text-left md:text-xl",children:["Enter the 6-digit code sent to your phone (",s,")"]}),(0,r.jsx)("button",{onClick:N,className:"text-sm text-gray-500 underline cursor-pointer",children:"Change Number"})]}),(0,r.jsx)("div",{className:"flex justify-center",children:(0,r.jsx)(d.Zn,{maxLength:6,value:o,onChange:e=>y(e),containerClassName:"gap-4",className:"w-14 h-14 text-2xl font-bold text-center",children:(0,r.jsx)(d.hf,{children:Array.from({length:6},(e,a)=>(0,r.jsx)(d.cY,{index:a},a))})})}),(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsxs)("p",{className:"text-gray-500",children:["Resend code in ",c," seconds"]}),(0,r.jsx)("button",{onClick:j,disabled:g||x.isPending,className:(0,p.cn)("text-sm text-gray-500 cursor-default",g&&"opacity-50",0===c&&"underline cursor-pointer"),children:"Resend Code"})]}),(0,r.jsx)(h.default,{label:"Submit Code",fullWidth:!0,color:"yellow",isRounded:!1,size:"large",onClick:()=>y(o),disabled:6!==o.length||v.isPending,isLoading:v.isPending})]})},R=e=>{let{defaultCountryCallingCode:a,defaultNationalNumber:s,onSignUpSuccess:o,email:d,affiliate:u}=e,{hydrateUser:p}=(0,t.useContext)(b.S),j=(0,f.$)(),{step:N,hash:S,setStep:k}=A(),[I,O]=(0,t.useState)(""),[L,R]=(0,t.useState)(""),{control:Z,handleSubmit:V,watch:W,setValue:D,setError:_,formState:{errors:Q}}=(0,l.cI)({resolver:(0,n.F)(E),defaultValues:{displayName:"",password:"",confirmPassword:"",country:"malaysia",email:null!=d?d:"",state:""}}),F=i.SX.users.auth.signupUser.useMutation({onSuccess:async e=>{await (0,v.GS)(e).then(async()=>{await p(),(0,y.wk)(),(0,w.f)({event:"complete_signup"}),o&&o()})},onError:e=>{j.showAlert(e.message,"error"),e.message.toLowerCase().includes("email")&&e.message.toLowerCase().includes("exist")&&_("email",{message:e.message})}}),U=e=>{let a="string"==typeof u?u.trim():"";F.mutate({displayName:e.displayName,country:e.country,state:e.state,password:e.password,email:e.email,otp:S,...a?{affiliate:a}:{}})},Y=W("country"),$="singapore"===Y?x.vf:x.Eg,X=M.findIndex(e=>e.key===N);return(0,t.useEffect)(()=>{Y&&D("state","")},[Y]),(0,t.useEffect)(()=>{S||k("phone")},[S]),(0,r.jsxs)("div",{className:"mt-8 bg-white",children:[(0,r.jsx)("div",{className:"flex gap-6 justify-center mb-8 md:hidden",children:M.map((e,a)=>(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsx)("div",{className:"\n                flex items-center justify-center w-8 h-8 border rounded-full\n                ".concat(a<=X?"border-black bg-black text-white":"border-gray-300 text-gray-400","\n              "),children:(0,r.jsx)("span",{className:"text-sm",children:a+1})}),(0,r.jsx)("span",{className:"text-sm mt-1 ".concat(a<=X?"text-black":"text-gray-400"),children:e.label})]},e.key))}),(0,r.jsx)("ol",{className:"hidden items-center mb-12 space-x-8 w-full md:flex",children:M.map((e,a)=>(0,r.jsxs)("li",{className:"flex items-center space-x-2.5 ".concat(a<=X?"text-black":"text-gray-400"),children:[(0,r.jsx)("span",{className:"\n                  flex items-center justify-center w-8 h-8 border-2 rounded-full shrink-0\n                  transition-all duration-300\n                  ".concat(a<X?"border-black bg-black text-white":a===X?"border-black text-black":"border-gray-400","\n                "),children:a<X?(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):(0,r.jsx)("span",{className:"text-sm font-medium",children:a+1})}),(0,r.jsxs)("span",{children:[(0,r.jsx)("h3",{className:"font-medium leading-tight",children:e.label}),(0,r.jsxs)("p",{className:"text-sm",children:[0===a&&"Enter your phone number",1===a&&"Verify with OTP code",2===a&&"Complete your details"]}
1)]}),a<M.length-1&&(0,r.jsx)("div",{className:"\n                    flex-1 h-[2px] ml-4\n                    ".concat(a<X?"bg-black":"bg-gray-200","\n                  ")})]},e.key))}),(0,r.jsxs)("h2",{className:"mb-6 text-2xl font-extrabold text-center md:text-3xl md:text-left",children:["phone"===N&&"Enter your phone number","otp"===N&&"Verify your phone","form"===N&&"Complete your profile"]}),I&&(0,r.jsx)("div",{className:"p-4 mb-4 bg-red-50 rounded-md border border-red-200",children:(0,r.jsx)("div",{className:"text-red-700",children:I})}),L&&(0,r.jsx)("div",{className:"p-4 mb-4 bg-green-50 rounded-md border border-green-200",children:(0,r.jsx)("div",{className:"text-green-700",children:L})}),"phone"===N&&(0,r.jsx)(T,{defaultNationalNumber:s,defaultCountryCallingCode:a}),"otp"===N&&(0,r.jsx)(z,{}),"form"===N&&(0,r.jsxs)("form",{onSubmit:V(U),className:"space-y-4",children:[(0,r.jsx)(l.Qr,{name:"displayName",control:Z,render:e=>{var a;let{field:s}=e;return(0,r.jsx)(c.Z,{label:"DISPLAY NAME",placeholder:"e.g. John",...s,hasError:!!Q.displayName,errorMessage:null===(a=Q.displayName)||void 0===a?void 0:a.message})}}),(0,r.jsx)(l.Qr,{name:"email",control:Z,render:e=>{var a,s,t,l;let{field:n}=e;return(0,r.jsxs)("div",{children:[(0,r.jsx)(c.Z,{label:"EMAIL",placeholder:"e.g. [email protected]",...n,hasError:!!Q.email,errorMessage:null===(a=Q.email)||void 0===a?void 0:a.message}),(null===(s=Q.email)||void 0===s?void 0:s.message)&&(null===(t=Q.email)||void 0===t?void 0:t.message.toLowerCase().includes("email"))&&(null===(l=Q.email)||void 0===l?void 0:l.message.toLowerCase().includes("exist"))&&(0,r.jsx)("div",{className:"p-4 mt-3 rounded-lg border bg-baby-yellow-900/10 border-baby-yellow-900",children:(0,r.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)(C.Z,{className:"w-5 h-5"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h4",{className:"mb-1 text-sm font-medium",children:"Account Already Exists"}),(0,r.jsx)("p",{className:"mb-3 text-sm text-gray-700",children:"This email is already registered. Would you like to sign in instead?"}),(0,r.jsx)(P(),{href:"/sign-in",children:(0,r.jsx)(h.default,{label:"Sign In to Your Account",isRounded:!1,size:"small",color:"yellow",className:"w-full"})})]})]})})]})}}),(0,r.jsx)(l.Qr,{name:"password",control:Z,render:e=>{var a;let{field:s}=e;return(0,r.jsx)(m.Z,{label:"PASSWORD",...s,hasError:!!Q.password,errorMessage:null===(a=Q.password)||void 0===a?void 0:a.message})}}),(0,r.jsx)(l.Qr,{name:"confirmPassword",control:Z,render:e=>{var a;let{field:s}=e;return(0,r.jsx)(m.Z,{label:"CONFIRM PASSWORD",...s,hasError:!!Q.confirmPassword,errorMessage:null===(a=Q.confirmPassword)||void 0===a?void 0:a.message})}}),(0,r.jsx)(l.Qr,{name:"country",control:Z,render:e=>{var a;let{field:s}=e;return(0,r.jsx)(g.Z,{label:"COUNTRY",options:x.O$,value:s.value,onChange:s.onChange,hasError:!!Q.country,errorMessage:null===(a=Q.country)||void 0===a?void 0:a.message})}}),(0,r.jsx)(l.Qr,{name:"state",control:Z,render:e=>{var a;let{field:s}=e;return(0,r.jsx)(g.Z,{label:"STATE",options:$,value:s.value,onChange:s.onChange,placeholder:"Select State",hasError:!!Q.state,errorMessage:null===(a=Q.state)||void 0===a?void 0:a.message})}}),(0,r.jsx)(h.default,{label:"Create Account",fullWidth:!0,color:"yellow",isRounded:!1,size:"large",onClick:V(U),disabled:F.isPending,isLoading:F.isPending})]})]})},Z=e=>{let{defaultCountryCallingCode:a,defaultNationalNumber:s,onSignUpSuccess:t,email:l,affiliate:n}=e;return(0,r.jsx)(O,{children:(0,r.jsx)(R,{defaultCountryCallingCode:a,defaultNationalNumber:s,onSignUpSuccess:t,email:l,affiliate:n})})}},76370:function(e,a,s){s.d(a,{Zn:function(){return i},cY:function(){return u},hf:function(){return d}});var r=s(85893),t=s(67294),l=s(28058),n=s(55780),o=s(36408);let i=t.forwardRef((e,a)=>{let{className:s,containerClassName:t,...n}=e;return(0,r.jsx)(l.uZ,{ref:a,containerClassName:(0,o.cn)("flex items-center gap-2 has-[:disabled]:opacity-50",t),className:(0,o.cn)("disabled:cursor-not-allowed",s),...n})});i.displayName="InputOTP";let d=t.forwardRef((e,a)=>{let{className:s,...t}=e;return(0,r.jsx)("div",{ref:a,className:(0,o.cn)("flex items-center",s
1),...t})});d.displayName="InputOTPGroup";let u=t.forwardRef((e,a)=>{let{index:s,className:n,...i}=e,d=t.useContext(l.VM),{char:u,hasFakeCaret:c,isActive:m}=d.slots[s];return(0,r.jsxs)("div",{ref:a,className:(0,o.cn)("relative flex h-12 w-12 md:h-16 md:w-16 items-center justify-center border-y border-r border-gray-400 text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",m&&"z-10 ring-2 ring-ring ring-offset-background",n),...i,children:[(0,r.jsx)("div",{className:"text-xl",children:u}),c&&(0,r.jsx)("div",{className:"flex absolute inset-0 justify-center items-center pointer-events-none",children:(0,r.jsx)("div",{className:"w-px h-4 duration-1000 animate-caret-blink bg-foreground"})})]})});u.displayName="InputOTPSlot";let c=t.forwardRef((e,a)=>{let{...s}=e;return(0,r.jsx)("div",{ref:a,role:"separator",...s,children:(0,r.jsx)(n.Z,{})})});c.displayName="InputOTPSeparator"}}]);

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.