PageSourceSearch

https://autodukan.com/static/js/4439.727e37d0.chunk.js

js autodukan.com collected 2026-10-04 14:20:00 UTC 11,580 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkautodukan_ui=self.webpackChunkautodukan_ui||[]).push([[4439],{44439(e,t,n){n.r(t),n.d(t,{default:()=>H});var r=n(5544),a=n(9950),o=n(16491),i=n(80045),s=n(27051),c=n(57528),l=n(44414),u=n(59254),d=n(8145);const f=["value","length","autoFocus","onChange","TextFieldsProps","onComplete","validateChar","className","onBlur"],p=["onPaste","onFocus","onKeyDown","className","placeholder","onBlur"];var g;const m={TextFieldStyled:(0,u.Ay)(d.A)(g||(g=(0,c.A)(["\n  input {\n    text-align: center;\n  }\n"])))},h=e=>(0,l.jsx)(m.TextFieldStyled,(0,s.A)({},e)),v="ArrowLeft",y="ArrowRight",A="Backspace",x="Home",b="End";function w(e){return e.join("")}function _(e,t){return[...e,t]}function k(e){const t=a.useRef((()=>{throw new Error("Cannot call an event handler while rendering.")}));return a.useInsertionEffect((()=>{t.current=e})),a.useCallback((function(){for(var e,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return null===(e=t.current)||void 0===e?void 0:e.call(t,...r)}),[])}const C=()=>!0,N=a.forwardRef(((e,t)=>{const{value:n="",length:r=4,autoFocus:c=!1,onChange:u,TextFieldsProps:d,onComplete:g,validateChar:m=C,className:N,onBlur:S}=e,I=(0,i.A)(e,f),j=a.useRef(n),R=k(g),F=k((e=>({isCompleted:e.length>=r,finalValue:e.slice(0,r)}))),D=d||{},{onPaste:B,onFocus:P,onKeyDown:T,className:E,placeholder:M,onBlur:z}=D,V=(0,i.A)(D,p);a.useEffect((()=>{const{isCompleted:e,finalValue:t}=F(j.current);e&&R(t)}),[r,R,F]);const O=function(e,t){return e<=0?[]:Array.from({length:e},t)}(r,((e,t)=>({character:n[t]||"",inputRef:a.createRef()}))),H=e=>O.findIndex((t=>{let{inputRef:n}=t;return n.current===e})),L=()=>O.map((e=>{let{character:t}=e;return t})),K=(e,t)=>{const n=function(e,t,n){return e.map(((e,r)=>t===r?n:e))}(L(),e,t);return w(n)},W=e=>{var t;null===(t=O[e])||void 0===t||null===(t=t.inputRef.current)||void 0===t||t.select()},U=e=>{e+1!==r&&(O[e+1].character?W(e+1):(e=>{var t;null===(t=O[e])||void 0===t||null===(t=t.inputRef.current)||void 0===t||t.focus()})(e+1))},Z=(e,t)=>"function"!=typeof m||m(e,t),q=e=>{const t=e.target.value[0]||"";let n=t;const r=H(e.target);n&&!Z(n,r)&&(n="");const a=K(r,n);null===u||void 0===u||u(a);const{isCompleted:o,finalValue:i}=F(a);o&&null!==g&&void 0!==g&&g(i),""!==n?a.length-1<r?W(a.length):U(r):""===t&&a.length<=r&&W(r-1)},J=e=>{e.preventDefault(),e.target.select(),null===P||void 0===P||P(e)},G=e=>{const t=e.target,n=t.selectionStart,r=t.selectionEnd,a=H(t),o=0===n&&0===r;if(t.value===e.key)e.preventDefault(),U(a);else if(A===e.key)if(t.value){if(o){e.preventDefault();const t=K(a,"");null!==u&&void 0!==u&&u(t),t.length<=a&&W(a-1)}}else e.preventDefault(),W(a-1);else v===e.key?(e.preventDefault(),W(a-1)):y===e.key?(e.preventDefault(),W(a+1)):x===e.key?(e.preventDefault(),W(0)):b===e.key&&(e.preventDefault(),W(O.length-1));null===T||void 0===T||T(e)},X=e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),n=e.target,a=O.findIndex((e=>{let{character:t,inputRef:r}=e;return""===t||r.current===n})),o=function(e,t,n){return e.reduce(((e,t,r)=>{const{characters:a,restArrayMerged:o}=e;if(r<n)return{restArrayMerged:o,characters:_(a,t)};const[i,...s]=o;return{restArrayMerged:s,characters:_(a,i||"")}}),{restArrayMerged:t,characters:[]}).characters}(L(),function(e){return e.split("")}(t),a).map(((e,t)=>Z(e,t)?e:"")),i=w(o);null===u||void 0===u||u(i);const{isCompleted:s,finalValue:c}=F(i);s?(null!==g&&void 0!==g&&g(c),W(r-1)):W(i.length),null===B||void 0===B||B(e)},Y=e=>{if(null!==z&&void 0!==z&&z(e),!O.some((t=>{let{inputRef:n}=t;return n.current===e.relatedTarget}))){const{isCompleted:e,finalValue:t}=F(n);null===S||void 0===S||S(t,e)}};return(0,l.jsx)(o.A,(0,s.A)((0,s.A)({display:"flex",gap:"20px",alignItems:"center",ref:t,className:"MuiOtpInput-Box ".concat(N||"")},I),{},{children:O.map(((e,t)=>{let{character:n,inputRef:r}=e;return(0,l.jsx)(h,(0,s.A)({autoFocus:!!c&&0===t,autoComplete:"one-time-code",value:n,inputRef:r,className:"MuiOtpInput-TextField MuiOtpInput-TextField-".concat(t+1," ").concat(E||""),onPaste:X,onFocus:J,onChange:q,onKeyDown:G,onBlur:Y,placeholder:"function"==typeof M?M(t):M},V),t)}))}))}));var S=n(28429),I=n(69706),j=n(35887),R=n(46639),F=n(55158),D=n(62962),B=n(97631),P=n(23615);var T=n(36089),E=n(16086),M=n(28095),z=n(71286);n(37716);const V={height:50,borderRadius:"12px",textTransform:"none",fontFamily:"'Barlow', sans-serif",fontSize:16,fontWeight:700,backgroundColor:"#FF6633",boxShadow:"0 8px 18px rgba(255,102,51,0.28)","&:hover":{backgroundColor:"#E45525"},"&.Mui-disabled":{backgroundColor:"#E5E7EB",color:"#94A3B8",boxShadow:"none"}},O=(e,t)=>{if(!e)return"";let n="";try{t&&(n=function(){return(0,B.A)(P.Ko,arguments)}(t.toUpperCase()))}catch(a){n=""}const r=e.length>5?"".concat(e.slice(0,e.length-5)," ").concat(e.slice(-5)):e;return n?"+".concat(n," ").concat(r):r},H=()=>{const e=(0,S.Zp)(),t=(0,a.useState)(""),n=(0,r.A)(t,2),i=n[0],s=n[1],c=(0,a.useState)(30),u=(0,r.A)(c,2),d=u[0],f=u[1],p=(0,a.useState)(!1),g=(0,r.A)(p,2),m=g[0],h=g[1],v=(0,a.useRef)(null),y=(0,a.useState)(!1),A=(0,r.A)(y,2),x=A[0],b=A[1],w=localStorage.getItem("mobile_number"),_=localStorage.getItem("country_code"),k=(0,a.useRef)(),C=O(w,_);(0,a.useEffect)((()=>{const e=setInterval((()=>{f((e=>e>0?e-1:0))}),1e3);return()=>clearInterval(e)}),[]);const B=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;if(!(!t||t.length<6||m)){h(!0),b(!0);try{const n=await(0,I.bH)(t);200===n.code?(localStorage.setItem("token",n.token),localStorage.setItem("new_customer",n.data.is_new_customer),localStorage.setItem("customer_id",n.data.id),localStorage.setItem("name",n.data.name),1===n.is_new_customer?e("/register"):(localStorage.setItem("is_login",!0),e("/")),v.current&&v.current.blur(),j.Ay.success(null===n||void 0===n?void 0:n.msg,{position:"bottom-center"})):(j.Ay.error(n.msg),s(""))}catch(n){j.Ay.error("Could not verify OTP. Please try again."),console.log(n)}finally{b(!1),h(!1)}}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(F.A,{sx:{color:"#fff",zIndex:e
1=>e.zIndex.drawer+1},open:x,children:(0,l.jsx)(R.A,{color:"inherit"})}),(0,l.jsx)(o.A,{component:"section",className:"auth",children:(0,l.jsxs)(o.A,{className:"auth__card",children:[(0,l.jsx)("img",{src:z,alt:"AutoDukan",className:"auth__logo"}),(0,l.jsx)(o.A,{className:"auth__icon",children:(0,l.jsx)(E.A,{})}),(0,l.jsx)("h1",{className:"auth__title",children:"Verify your number"}),(0,l.jsx)("p",{className:"auth__subtitle",children:"Enter the 6-digit code we just sent to your mobile number."}),C&&(0,l.jsxs)("div",{className:"auth__sentto",children:[(0,l.jsxs)("span",{children:["Sent to ",(0,l.jsx)("strong",{children:C})]}),(0,l.jsxs)("button",{type:"button",className:"auth__edit",onClick:()=>e("/login"),children:[(0,l.jsx)(T.A,{sx:{fontSize:15}})," Edit"]})]}),(0,l.jsx)(N,{length:6,value:i,onChange:e=>{s(e)},onComplete:B,autoFocus:!0,className:"auth__otp",validateChar:e=>/\d/.test(e),TextFieldsProps:{type:"tel",inputProps:{inputMode:"numeric",pattern:"[0-9]*","aria-label":"One-time password digit"}}}),(0,l.jsx)(M.A,{fullWidth:!0,variant:"contained",loading:m,disabled:i.length<6,onClick:()=>B(),sx:V,children:"Verify & Continue"}),(0,l.jsx)("div",{className:"auth__divider",children:"or"}),(0,l.jsxs)("p",{className:"auth__resend",children:["Didn't receive the code?"," ",(0,l.jsx)("button",{type:"button",className:"auth__resend-btn",onClick:async()=>{try{if(s(""),d>0)return;f(30),b(!0);const t=await k.current.executeAsync();k.current.reset();const n=await(0,I.pH)(w,_,{captcha_token:t,client_type:"web"});var e;if(200===n.code)localStorage.setItem("mobile_number",w),localStorage.setItem("user_id",null===n||void 0===n||null===(e=n.data)||void 0===e?void 0:e.id),v.current&&v.current.blur(),b(!1),j.Ay.success(null===n||void 0===n?void 0:n.msg,{position:"bottom-center"});else j.Ay.error(n.msg,{position:"bottom-center"}),b(!1)}catch(t){j.Ay.error("An error occurred during resend OTP. Please try again after some time."),b(!1),console.log(t)}},disabled:d>0,children:d>0?"Resend in ".concat(d,"s"):"Resend OTP"})]})]})}),(0,l.jsx)(D.A,{ref:k,sitekey:"6LeLW2crAAAAAE6hZ5RTDfcmIBSqD2nRrZuBv3eH",size:"invisible",hl:"en"})]})}},69706(e,t,n){n.d(t,{TU:()=>l,bH:()=>c,pH:()=>s});var r=n(27051),a=n(88304),o=n(21659);const i="https://autodukan.com/gms",s=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const s=await(0,o.kM)(),c=await a.A.post("".concat(i,"/api/customer/get-login-otp"),(0,r.A)({mobile_number:e,country:t,device_token:s},n));return localStorage.setItem("mobile_number",e),c.data}catch(s){return console.log(s),s.response.data}},c=async e=>{try{return(await a.A.post("".concat(i,"/api/customer/verify-otp"),{otp:e,mobile_number:localStorage.getItem("mobile_number"),firebase_token:(0,o.sz)()})).data}catch(n){var t;return null===n||void 0===n||null===(t=n.response)||void 0===t?void 0:t.data}},l=async e=>{try{return(await(0,a.A)({method:"POST",url:"".concat(i,"/api/customer/register"),data:e})).data}catch(n){var t;return null===n||void 0===n||null===(t=n.response)||void 0===t?void 0:t.data}}},21659(e,t,n){n.d(t,{Vv:()=>d,kM:()=>u,sz:()=>l});var r=n(9558),a=n(89325);const o="BL544Kp73L1nh75qaAeS_bIyJpFgmaloYmrzBxGV3gOoPeiU2UuDvgv4XoGZyTbBcnJpUaHzSrXtkxJZbUEoN0I",i="device_token",s=async()=>{if(!("serviceWorker"in navigator))return null;try{await navigator.serviceWorker.register((()=>{const e=new URLSearchParams({apiKey:a.CN.apiKey||"",authDomain:a.CN.authDomain||"",projectId:a.CN.projectId||"",storageBucket:a.CN.storageBucket||"",messagingSenderId:a.CN.messagingSenderId||"",appId:a.CN.appId||""});return"".concat("","/firebase-messaging-sw.js?").concat(e.toString())})());return await navigator.serviceWorker.ready}catch(e){return console.error("Failed to register messaging service worker:",e),null}},c=async()=>{if("undefined"===typeof Notification)return"unsupported";if("default"!==Notification.permission)return Notification.permission;try{return await new Promise(((e,t)=>{const n=Notification.requestPermission(e);n&&"function"===typeof n.then&&n.then(e,t)}))}catch(e){return console.warn("Notification permission request failed:",e),"needs-gesture"}},l=()=>localStorage.getItem(i)||"",u=async()=>
1{if("undefined"===typeof Notification)return"";const e=await c();if("granted"!==e)return console.warn("Notification permission state: ".concat(e)),"";const t=await s();if(!t)return console.error("Could not activate Service Worker registration."),"";const n=await(0,a.gw)();if(!n)return"";try{const e=await(0,r.gf)(n,{vapidKey:o,serviceWorkerRegistration:t});return e&&localStorage.setItem(i,e),e||""}catch(l){return console.error("Failed to get FCM device token:",l),""}},d=async()=>{if("undefined"===typeof Notification)return"unsupported";if("denied"===Notification.permission)return"denied";if("granted"===Notification.permission)return l()||await u(),"granted";const e=await c();return"granted"===e&&await u(),e}},36089(e,t,n){var r=n(24994);t.A=void 0;var a=r(n(79526)),o=n(44414),i=(0,a.default)((0,o.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z"}),"EditOutlined");t.A=i},16086(e,t,n){var r=n(24994);t.A=void 0;var a=r(n(79526)),o=n(44414),i=(0,a.default)((0,o.jsx)("path",{d:"M12 18H6l-4 4V4c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2v7h-2V4H4v12h8v2zm11-3.66-1.41-1.41-4.24 4.24-2.12-2.12-1.41 1.41L17.34 20 23 14.34z"}),"MarkChatReadOutlined");t.A=i},37716(){}}]);

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.