PageSourceSearch

https://www.biklo.ro/_next/static/chunks/7769-mv1d35lj.js

js biklo.ro collected 2026-10-10 01:33:03 UTC 31,366 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7769],{71106:function(e,t,l){var a=l(85893),i=l(67294),n=l(48741),s=l(22897),o=l(91358),r=l(80877),d=l(20676);t.Z=e=>{let{label:t,regenerateLabel:l,maxLength:c,value:u="",onConfirm:m,onRegenerateCode:f,...x}=e,[h,p]=(0,i.useState)(Array(c).fill("")),[v,b]=(0,i.useState)(600),[g,_]=(0,i.useState)(!1),[w,j]=(0,i.useState)(!1),y=(0,i.useRef)(Array(c).fill(null)),N=(e,t)=>{if(p(l=>{let a=[...l];return a[e]=t,a}),e<c-1&&y.current&&y.current[e+1]){var l;null===(l=y.current[e+1])||void 0===l||l.focus()}},k=()=>{let e=h.join("");e.length!==c||h.includes("")?(0,r.$3)((0,d.t)("notifications.invalid_code"),2e3):null==m||m(e)},C=e=>{if(e>0&&(!h[e]||0===h[e].length)&&y.current&&y.current[e-1]){var t;null===(t=y.current[e-1])||void 0===t||t.focus()}p(t=>{let l=[...t];return l[e]="",l})},S=e=>{p(e.clipboardData.getData("text/plain").split("").slice(0,c))};return(0,i.useEffect)(()=>{p(e=>u.split("").map((t,l)=>t||e[l]||"").slice(0,c))},[u,c]),(0,i.useEffect)(()=>{let e=setInterval(()=>{b(e=>Math.max(0,e-1))},1e3);return()=>clearInterval(e)},[]),(0,i.useEffect)(()=>{0===v&&(0,r.$3)((0,d.t)("notifications.code_expired"),2e3)},[v]),(0,a.jsxs)("div",{className:"flex flex-col",children:[t&&!g&&(0,a.jsx)("p",{className:"mb-2",children:t}),g&&(0,a.jsx)("p",{className:"mb-2",children:l}),(0,a.jsxs)("div",{className:"text-center font-semibold my-2",children:[(0,d.t)("global.code_expires_on"),": ","".concat(String(Math.floor(v/60)).padStart(2,"0"),":").concat(String(v%60).padStart(2,"0"))]}),0!==v?(0,a.jsx)("div",{className:"flex flex-row space-between gap-1 mb-2",children:Array.from({length:c}).map((e,t)=>(0,a.jsx)(n.Y,{ref:e=>{y.current[t]=e},value:h[t],maxLength:1,onChange:e=>{N(t,e.target.value)},onKeyDown:e=>{"Backspace"===e.key&&C(t)},onPaste:S,classNames:{input:"text-center font-bold"},...x},t))}):null,0!==v?(0,a.jsx)(s.A,{color:"primary",variant:"solid",className:"mt-2 font-semibold",onPress:k,onClick:k,children:(0,d.t)("global.confirm_2")}):(0,a.jsx)(o.Z,{color:"warning",variant:"solid",className:"mt-2 font-semibold",isLoading:w,disabled:w,onClick:()=>{if(w||!f)return;j(!0);let e=setTimeout(()=>j(!1),6e3);f(()=>{clearTimeout(e),_(!0),p(Array(c).fill("")),b(600),j(!1)})},children:(0,d.t)("global.regenerate")})]})}},40440:function(e,t,l){var a=l(14974);l(67294);var i=l(45007);t.Z=e=>{let{classNames:t}=e;return(0,i.v9)(e=>(0,a.S)().CurrentUser(e)),null}},20009:function(e,t,l){l.d(t,{Z:function(){return ee}});var a=l(85893),i=l(96633),n=l(85883),s=l(65564),o=l(29726),r=l(54912),d=l(50020),c=l(3125),u=l(67294),m=l(33614),f=l(19591),x=l(99094),h=l(41811),p=l(91802),v=l(14974),b=l(16847),g=l(47824),_=l(4483),w=l(45007),j=()=>{let e=(0,w.v9)(e=>(0,v.S)().CurrentUser(e)),t=null==e?void 0:e.id,[l,i]=(0,u.useState)(!1),n=(0,u.useRef)(null),s=(t,l)=>{i(!0);let a=new FormData;a.append("photo",l),(0,f.b)("/api/user/photo?userId=".concat(t),{method:"POST",body:a}).then(e=>e.json()).then(async()=>{(null==n?void 0:n.current)&&(n.current.value="");let t=await (0,x.GM)();h.y.dispatch((0,p.lx)({current_user:{...e,photo_url:t.user.user.photo_url,photo:t.user.user.photo}})),i(!1)}).catch(e=>{console.error("Error uploading photo",e),i(!1)})},o=t=>{i(!0),(0,f.b)("/api/user/photo?userId=".concat(t),{method:"DELETE"}).then(e=>e.json()).then(async()=>{let t=await (0,x.GM)();h.y.dispatch((0,p.lx)({current_user:{...e,photo_url:t.user.user.photo_url,photo:t.user.user.photo}})),i(!1)}).catch(e=>{console.error("Error deleting photo",e),i(!1)})};return(0,a.jsx)("div",{className:"flex flex-1 justify-center",children:(0,a.jsx)("div",{className:"w-28 h-28 rounded-full overflow-hidden relative group self-center",children:(0,a.jsxs)(_.X,{isLoaded:!l,className:"rounded-full w-full h-full",children:[(0,a.jsx)(m.Z,{name:null==e?void 0:e.name,photo:null==e?void 0:e.photo,sizeClassName:"w-full h-full",textClassName:"text-3xl",rounded:"none"}),(0,a.jsx)("div",{className:"bg-dirtbike-main/20 absolute top-0 left-0 right-0 bottom-0 opacity-0 group-hover:opacity-100 transition-all duration-200"}),(0,a.jsx)("input",{ref:n,type:"file",accept:"image/*",className:"hidden",onChange:e=>{let l=e.target.files[0];l&&s(t,l)}}),(0,a.jsxs)("div",{className:"tools absolute bottom-3 flex-row flex gap-1 left-1/2 -translate-x-1/2",children:[(0,a.jsx)("div",{className:"p-1 bg-white-50 rounded-sm hover:bg-dirtbike-200 cursor-pointer",onClick:()=>{o(t)},children:(0,a.jsx)(b.Z,{className:"w-4 h-4 text-black-luxury"})}),(0,a.jsx)("div",{className:"p-1 bg-white-50 rounded-sm hover:bg-dirtbike-200 cursor-pointer",onClick:()=>{var e;null==n||null===(e=n.current)||void 0===e||e.click()},children:(0,a.jsx)(g.Z,{className:"w-4 h-4 text-black-luxury"})})]})]})})})},y=l(80877),N=l(92509),k=l(14717),C=l(26795),S=l(21055),O=l(30018),T=l(48741),R=l(22897),$=l(67957),Z=l(87351),A=l(85374),P=l(87740),q=l(86597),E=l(71106),D=l(10629),F=l(61826),J=l(86940),L=l(206
176),V=()=>{var e,t,l;let i=(0,w.v9)(e=>(0,v.S)().CurrentUser(e)),[n,s]=(0,u.useState)(null==i?void 0:null===(e=i.gender_id)||void 0===e?void 0:e.toString()),o=(0,u.useRef)(null),r=(0,u.useRef)(null),d=(0,u.useRef)(null),[c,m]=(0,u.useState)((null==i?void 0:i.phone_hidden)==="1"),[b,g]=(0,u.useState)(null==i?void 0:i.phone),[_,j]=(0,u.useState)(""),[V,I]=(0,u.useState)(""),G=(0,v.S)().CountryCode(),M=async e=>{(0,y.vc)((0,L.t)("global.loading"));let t={token:null==i?void 0:i.phone_token,newPhone:b},l=await (0,f.b)("/api/user/generatecodephone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await l.json();return l.ok?(I(a.phone_token),(0,y.H7)(),K(),e&&e(),!0):((0,y.$3)((0,L.t)("notifications.verification_code_error"),2e3),!1)},U=async e=>{if(e.preventDefault(),(null==r?void 0:r.current)&&r.current.value!==(null==i?void 0:i.email)){var t;(0,y.vc)((0,L.t)("global.loading"));let e={token:void 0,newEmail:null==r?void 0:null===(t=r.current)||void 0===t?void 0:t.value},l=await (0,f.b)("/api/user/generatecode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),a=await l.json();l.ok&&(null==a?void 0:a.email_token)?(j(a.email_token),(0,y.H7)(),z()):(0,y.$3)((0,L.t)("notifications.verification_code_error"),2e3);return}if(b!==(null==i?void 0:i.phone)){if((0,J.a$)(b)){await M();return}(0,y.$3)((0,L.t)("notifications.phone_number_must_be_valid"),2e3);return}eo(null==i?void 0:i.id)},{isOpen:W,onOpen:z,onOpenChange:Y,onClose:B}=(0,$.q)(),{isOpen:H,onOpen:K,onOpenChange:X,onClose:Q}=(0,$.q)(),[ee,et]=(0,D.d)(""),[el,ea]=(0,D.d)(""),ei=async e=>{var t;(0,y.vc)((0,L.t)("global.loading"));let l={token:void 0,newEmail:null==r?void 0:null===(t=r.current)||void 0===t?void 0:t.value};(await (0,f.b)("/api/user/generatecode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})).ok&&((0,y.H7)(),(0,y.OV)((0,L.t)("notifications.code_regenerated_successfully"),2e3),e())},en=async e=>{if(!_||!e)return(0,y.$3)((0,L.t)("notifications.code_entered_is_incorrect"),2e3),!1;{(0,y.vc)((0,L.t)("global.loading"));let t=await (0,f.b)("/api/user/confirmcode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:_,digitCode:e})}),l=await t.json();return!!t.ok&&!0===l.success||((0,y.$3)((0,L.t)("notifications.code_entered_is_incorrect"),2e3),!1)}},es=async e=>{if(!V||!e)return(0,y.$3)((0,L.t)("notifications.phone_verification_token_missing"),2e3),!1;{(0,y.vc)((0,L.t)("global.loading"));let t=await (0,f.b)("/api/user/confirmcodephone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:V,digitCode:e})}),l=await t.json();return t.ok&&!0===l.success?((0,y.OV)((0,L.t)("notifications.phone_verified_success"),2e3),!0):((0,y.$3)((0,L.t)("notifications.phone_verification_token_missing"),2e3),!1)}},eo=async e=>{if(o.current&&r.current&&d.current&&b){if(o.current.value&&r.current.value&&b){(0,y.vc)((0,L.t)("notifications.updating_information"));let _=await (0,f.b)("/api/user/details?userId=".concat(e),{method:"PUT",body:JSON.stringify({gender_id:n,name:o.current.value,email:r.current.value,username:d.current.value,phone:b,phone_hidden:c?"1":"0"})}),w=await _.json();if(w&&_.ok){let e=await (0,x.GM)();h.y.dispatch((0,p.lx)({current_user:{...i,...e.user.user}})),(0,y.OV)((0,L.t)("notifications.data_updated_successfully"),2e3),setTimeout(()=>{window.location.reload()},2e3)}else{var t,l,a,s,u,m,v,g;(null==w?void 0:w.code)==="reserved_name"?(0,y.$3)((0,L.t)("global.reserved_name_error"),5e3):(null==w?void 0:w.success)===!1&&(null==w?void 0:null===(t=w.data)||void 0===t?void 0:t.phone)&&(null==w?void 0:null===(a=w.data)||void 0===a?void 0:null===(l=a.phone)||void 0===l?void 0:l.length)>0?(0,y.$3)(null==w?void 0:null===(v=w.data)||void 0===v?void 0:v.phone[0],4e3):(null==w?void 0:w.success)===!1&&(null==w?void 0:null===(s=w.data)||void 0===s?void 0:s.username)&&(null==w?void 0:null===(m=w.data)||void 0===m?void 0:null===(u=m.username)||void 0===u?void 0:u.length)>0?(0,y.$3)(null==w?void 0:null===(g=w.data)||void 0===g?void 0:g.username[0],4e3):(0,y.$3)((0,L.t)("notifications.error_updating_data"),4e3),B(),Q()}}else(0,y.$3)((0,L.t)("notifications.error_updating_data"),4e3),B(),Q()}else(0,y.$3)((0,L.t)("notifications.error_updating_data"),4e3),B(),Q()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("form",{onSubmit:U,children:[(0,a.jsxs)("div",{className:"flex flex-col md:flex-row items-center",children:[(0,a.jsx)("div",{className:"label text-left md:text-right pr-5 w-full md:w-1/4 self-start md:self-auto font-semibold",children:(0,L.t)("global.gender")}),(0,a.jsx)("div",{className:"",children:(0,a.jsx)(S.X,{orientation:"horizontal",onValueChange:s,value:n,children:null==i?void 0:null===(l=i.account)||void 0===l?void 0:null===(t=l.genders)||void 0===t?void 0:t.map(e=>(0,a.jsx)(O.J,{value:e.id.toString(),children:e.name},e.id))})})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row items-center",children:[(0,a.jsx)("div",{className:"label text-left md:text-right pr-5 w-full md:w-1/4 self-start md:self-auto font-semibold after:content-['*'] after:text-danger after:ml-0.5",children:(0,L.t)("global.name")}),(0,a.jsx)("div",{className:"w-full md:w-2/4",children:(0,a.jsx)(T.Y,{type:"text",placeholder:(0,L.t)("label.your_name_2"),required:!0,isRequired:!0,variant:"flat",className:"my-2 flex-col md:flex-row justify-start",defaultValue:null==i?void 0:i.name,ref:o,startContent:(0,a.jsx)("div",{className:"pointer-events-none flex items-center",children:(0,a.jsx)(N.Z,{className:"w-6 h-6 text-black-400"})}),classNames:{input:"bg-white-50/0 text-black-luxury dark:text-white-50 w-full",inputWrapper:"rounded-md shadow-none bg-white-50 h-10",mainWrapper:"w-auto flex-1 w-full",description:"dark:text-white-200",label:"md:w-1/6 md:text-right w-full my-2 md:my-0 font-semibold"}})})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row items-center",children:[(0,a.jsx)("div",{className:"label text-left md:text-right pr-5 w-full md:w-1/4 self-start md:self-auto font-semibold after:content-['*'] after:text-danger after:ml-0.5",children:(0,L.t)("global.email")}),(0,a.jsx)("div",{className:"w-full md:w-2/4",children:(null==i?void 0:i.provider)==="google"||(null==i?void 0:i.provider)==="facebook"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"text-black-luxury font-semibold text-base",children:null==i?void 0:i.email}),(0,a.jsxs)("div",{className:"text-red-500 font-semibold",children:[(0,L.t)("global.email_change_restriction")," ",null==i?void 0:i.provider,"."]}),(0,a.jsx)("input",{type:"hidden",name:"email",value:null==i?void 0:i.email,ref:r})]}):(0,a.jsx)(T.Y,{type:"email",placeholder:(0,L.t)("global.your_email"),required:!0,isRequired:!0,variant:"flat",className:"my-2 flex-col md:flex-row justify-start",defaultValue:null==i?void 0:i.email,ref:r,startContent:(0,a.jsx)("div",{className:"pointer-events-none flex items-center",children:(0,a.jsx)(k.Z,{className:"w-6 h-6 text-black-400"})}),readOnly:(null==i?void 0:i.provider)==="google"||(null==i?void 0:i.provider)==="facebook",isReadOnly:(null==i?void 0:i.provider)==="google"||(null==i?void 0:i.provider)==="facebook",classNames:{input:"bg-white-50/0 text-black-luxury dark:text-white-50 w-full",inputWrapper:"rounded-md shadow-none bg-white-50 h-10",mainWrapper:"w-auto flex-1 w-full",description:"dark:text-white-200",label:"md:w-1/6 md:text-right w-full my-2 md:my-0 font-semibold"}})})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row items-center",children:[(0,a.jsx)("div",{className:"label text-left md:text-right pr-5 w-full md:w-1/4 self-start md:self-auto font-semibold",children:(0,L.t)("global.username")}),(0,a.jsx)("div",{className:"w-full md:w-2/4",children:(0,a.jsx)(T.Y,{type:"text",placeholder:(0,L.t)("label.your_username"),variant:"flat",className:"my-2 flex-col md:flex-row justify-start",defaultValue:null==i?void 0:i.username,ref:d,startContent:(0,a.jsx)("div",{className:"pointer-events-none flex items-center",children:(0,a.jsx)(C.Z,{className:"w-6 h-6  text-black-400"})}),description:"Nu sunt permise caractere speciale sau spatii. (adaugă doar litere și/sau cifre)",classNames:{input:"bg-white-50/0 text-black-luxury dark:text-white-50 w-full",inputWrapper:"rounded-md shadow-none bg-white-50 h-10",mainWrapper:"w-auto flex-1 w-full",description:"dark:text-white-200",label:"md:w-1/6 md:text-right w-full my-2 md:my-0 font-semibold"}})})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row items-center mb-2",children:[(0,a.jsx)("div",{className:"label text-left md:text-right pr-5 w-full md:w-1/4 self-start md:self-auto font-semibold after:content-['*'] after:text-danger after:ml-0.5",children:(0,L.t)("global.phone")}),(0,a.jsx)("div",{className:"w-full md:w-2/4",children:(0,a.jsx)("div",{className:"py-2 px-3 rounded-small bg-white-50 h-10 flex flex-col justify-center",children:(0,a.jsx)(F.ZP,{international:!0,countryCallingCodeEditable:!1,defaultCountry:G||"RO",value:b,onChange:g,className:"bg-white-50 dark:bg-black-luxury text-small flex flex-row",required:!0})})})]}),(0,a.jsx)("div",{children:(0,a.jsx)(R.A,{type:"submit",color:"primary",className:"mx-auto md:ml-[25%] mt-2",children:(0,L.t)("global.update")})})]}),(0,a.jsx)(Z.R,{isDismissable:!1,hideCloseButton:!0,isOpen:W,onOpenChange:Y,children:(0,a.jsx)(A.A,{children:e=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(P.k,{className:"flex flex-col gap-1",children:(0,L.t)("global.confirm_email_change")}),(0,a.jsx)(q.I,{children:(0,a.jsx)(E.Z,{maxLength:6,label:(0,L.t)("label.email_verification_code"),regenerateLabel:"Ți-am trimis pe noul email solicitat un NOU COD format din 6 cifre (verifică și SPAM), te rugăm să \xeel introduci !",onConfirm:async e=>{et(e,async e=>{await en(e)&&(b!==(null==i?void 0:i.phone)?M():eo(null==i?void 0:i.id))})},onRegenerateCode:e=>{ei(e)}})})]})})}),(0,a.jsx)(Z.R,{isDismissable:!1,hideCloseButton:!0,isOpen:H,onOpenChange:X,children:(0,a.jsx)(A.A,{children:e=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(P.k,{className:"flex flex-col gap-1",children:(0,L.t)("global.confirm_p
1hone_change")}),(0,a.jsx)(q.I,{children:(0,a.jsx)(E.Z,{maxLength:6,label:(0,L.t)("label.sms_verification_code"),regenerateLabel:"Ți-am trimis un SMS pe noul număr de telefon solicitat un NOU COD format din 6 cifre, te rugăm să \xeel introduci !",onConfirm:async e=>{ea(e,async e=>{await es(e)&&eo(null==i?void 0:i.id)})},onRegenerateCode:e=>{M(e)}})})]})})})]})};let I=()=>Intl.supportedValuesOf("timeZone");var G=l(15141),M=l(34925),U=l(8125),W=l(96476),z=l(96180),Y=l(1463),B=()=>{let e=(0,w.v9)(e=>(0,v.S)().CurrentUser(e)),[t,l]=(0,u.useState)(),i=(0,u.useRef)(null),n=(0,u.useRef)(null),s=(0,u.useRef)(null),r=(0,u.useRef)(null),[d,c]=(0,u.useState)((null==e?void 0:e.accept_marketing_offers)==="1");I();let[m,b]=(0,u.useState)(!1),{isOpen:g,onOpen:_,onOpenChange:j}=(0,$.q)(),{isOpen:N,onOpen:k,onOpenChange:C,onClose:S}=(0,$.q)(),[O,F]=(0,D.d)(""),J=async t=>{(0,y.vc)((0,L.t)("global.loading"));let l={token:null==e?void 0:e.email_token};(await (0,f.b)("/api/user/generatecode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)})).ok&&((0,y.H7)(),(0,y.OV)((0,L.t)("notifications.code_regenerated_successfully"),2e3),t())},V=async t=>{if(null==e||!e.email_token||!t)return(0,y.$3)((0,L.t)("notifications.code_entered_is_incorrect"),2e3),!1;{(0,y.vc)((0,L.t)("global.loading"));let l={token:null==e?void 0:e.email_token,digitCode:t},a=await (0,f.b)("/api/user/confirmcode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}),i=await a.json();return!!a.ok&&!0===i.success||((0,y.$3)((0,L.t)("notifications.code_entered_is_incorrect"),2e3),!1)}},B=async t=>{if(t.preventDefault(),(null==e?void 0:e.provider)==="google"||(null==e?void 0:e.provider)==="facebook")H(null==e?void 0:e.id);else if(i.current&&n.current){if(i.current.value===n.current.value){(0,y.vc)((0,L.t)("global.loading"));let t={token:null==e?void 0:e.email_token},l=await (0,f.b)("/api/user/generatecode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});await l.json(),l.ok?((0,y.H7)(),_()):(0,y.$3)((0,L.t)("notifications.verification_code_error"),2e3);return}(0,y.$3)((0,L.t)("notifications.passwords_do_not_match"),2e3)}else(0,y.$3)((0,L.t)("notifications.please_complete_all_fields"),2e3)},H=async l=>{if(i.current&&n.current||(null==e?void 0:e.provider)==="google"||(null==e?void 0:e.provider)==="facebook"){var a,s,o,r;if((null==i?void 0:null===(a=i.current)||void 0===a?void 0:a.value)===(null==n?void 0:null===(s=n.current)||void 0===s?void 0:s.value)||(null==e?void 0:e.provider)==="google"||(null==e?void 0:e.provider)==="facebook"){(0,y.vc)((0,L.t)("notifications.updating_information"));let a=await (0,f.b)("/api/user/access?userId=".concat(l),{method:"POST",body:JSON.stringify({...(null==e?void 0:e.provider)!=="google"&&(null==e?void 0:e.provider)!=="facebook"?{password:null==i?void 0:null===(o=i.current)||void 0===o?void 0:o.value,password_confirmation:null==n?void 0:null===(r=n.current)||void 0===r?void 0:r.value}:{},accept_marketing_offers:d?"1":"0",time_zone:t})});if(a&&a.ok){let t=await (0,x.GM)();h.y.dispatch((0,p.lx)({current_user:{...e,...t.user.user}})),(0,y.OV)((0,L.t)("notifications.data_updated_successfully_reload"),2e3),setTimeout(()=>{window.location.reload()},2e3)}}else(0,y.$3)((0,L.t)("notifications.passwords_do_not_match"),4e3)}else(0,y.$3)((0,L.t)("notifications.please_complete_all_fields"),4e3)},K=async()=>{var t,l,a;if(!(null==r?void 0:null===(t=r.current)||void 0===t?void 0:t.checked)){(0,y.$3)((0,L.t)("notifications.agree_to_terms_required"),3e3);return}b(!0),(0,y.vc)((0,L.t)("notifications.loading"));let i=(null==s?void 0:null===(l=s.current)||void 0===l?void 0:l.value)?null==s?void 0:null===(a=s.current)||void 0===a?void 0:a.value:"No feedback provided.",n={message:"\nStimate Admin,\nVă rog să procedați la ștergerea contului meu \xeenregistrat cu adresa de email ".concat(e.email,".\nAm \xeențeles că această acțiune este definitivă și că toate datele asociate contului meu vor fi șterse.\nAștept confirmarea finalizării procesului de ștergere \xeen termenul menționat de 1-3 zile lucrătoare.\nVă mulțumesc,\n").concat(e.name,"\n			"),feedback:i};(await (0,f.b)("/api/user/requestdeleteaccount",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok?((0,y.H7)(),(0,y.OV)((0,L.t)("notifications.request_submitted_successfully"),3e3),window.location.href="/"):(b(!1),(0,y.$3)((0,L.t)("notifications.request_failed_try_again"),3e3))};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("form",{onSubmit:B,children:[(null==e?void 0:e.provider)==="google"||(null==e?void 0:e.provider)==="facebook"?(0,a.jsxs)("div",{className:"flex flex-col md:flex-row items-center",children:[(0,a.jsxs)("div",{className:"label text-left md:text-right pr-5 w-full md:w-1/4 self-start md:self-auto font-semibold",children:[(0,L.t)("global.password"),":"]}),(0,a.jsx)("div",{className:"w-full md:w-2/4",children:(0,a.jsxs)("div",{className:"text-red-500 font-semibold",children:[(0,L.t)("global.account_connected_with")," ",null==e?void 0:e.provider," ",(0,L.t)("global.password_change_restriction"),"."]})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-col md:flex-row items-center",children:[(0,a.jsxs)("div",{className:"label text-left md:text-right pr-5 w-full md:w-1/4 self-start md:self-auto font-semibold",children:[(0,L.t)("global.new_password"),":"]}),(0,a.jsx)("div",{className:"w-full md:w-2/4",children:(0,a.jsx)(T.Y,{type:"password",placeholder:(0,L.t)("label.your_new_password"),required:!0,ref:i,isRequired:!0,variant:"flat",className:"my-2 flex-col md:flex-row justify-start",startContent:(0,a.jsx)("div",{className:"pointer-events-none flex items-center",children:(0,a.jsx)(o.Z,{className:"w-6 h-6 text-black-400"})}),classNames:{input:"bg-white-50/0 text-black-luxury dark:text-white-50 w-full",inputWrapper:"rounded-md shadow-none bg-white-50 h-10",mainWrapper:"w-auto flex-1 w-full",description:"dark:text-white-200",label:"md:w-1/6 md:text-right w-full my-2 md:my-0 font-semibold"}})})]}),(0,a.jsxs)("div",{className:"flex flex-col md:flex-row items-center",children:[(0,a.jsxs)("div",{className:"label text-left md:text-right pr-5 w-full md:w-1/4 self-start md:self-auto font-semibold",children:[(0,L.t)("global.confirm_password"),":"]}),(0,a.jsx)("div",{className:"w-full md:w-2/4",children:(0,a.jsx)(T.Y,{type:"password",placeholder:(0,L.t)("label.confirm_your_new_password"),required:!0,isRequired:!0,ref:n,variant:"flat",className:"my-2 flex-col md:flex-row justify-start",startContent:(0,a.jsx)("div",{className:"pointer-events-none flex items-center",children:(0,a.jsx)(o.Z,{className:"w-6 h-6 text-black-400"})}),classNames:{input:"bg-white-50/0 text-black-luxury dark:text-white-50 w-full",inputWrapper:"rounded-md shadow-none bg-white-50 h-10",mainWrapper:"w-auto flex-1 w-full",description:"dark:text-white-200",label:"md:w-1/6 md:text-right w-full my-2 md:my-0 font-semibold"}})})]})]}),(0,a.jsx)("div",{children:(0,a.jsx)(R.A,{type:"submit",color:"primary",className:"mx-auto md:ml-[25%] mt-2",children:(0,L.t)("global.update")})})]}),(0,a.jsx)(G.j,{orientation:"horizontal",className:"dark:bg-white/50 my-2"}),(0,a.jsxs)("div",{className:"py-4 px-4 md:px-2 text-center",children:[(0,a.jsx)("p",{className:"font-semibold text-small my-1",children:(0,L.t)("global.delete_account_prompt")}),(0,a.jsxs)("p",{className:"font-semibold text-small my-1",children:[(0,L.t)("global.start_account_deleti
1on")," ",(0,a.jsx)("br",{})]}),(0,a.jsxs)("p",{className:"text-xs font-medium italic my-1",children:["* ",(0,L.t)("global.based_on")," ",(0,a.jsx)(Y.F,{href:"/page/termeni-si-conditii",target:"_blank",className:"text-dirtbike-main",children:(0,L.t)("global.terms_and_conditions")})," ",(0,L.t)("global.account_deletion_info")]}),(0,a.jsx)(R.A,{color:"danger",className:"mt-2 font-semibold",onClick:()=>{k()},children:(0,L.t)("global.delete_account_button")})]}),(0,a.jsx)(Z.R,{size:"md",backdrop:"blur",isOpen:N,onClose:S,children:(0,a.jsx)(A.A,{children:e=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(P.k,{className:"flex flex-col gap-1",children:(0,L.t)("global.delete_account_modal_title")}),(0,a.jsxs)(q.I,{children:[(0,a.jsx)("h5",{className:"text-base text-center font-semibold",children:(0,L.t)("global.want_to_leave_sorry")}),(0,a.jsx)("p",{className:"text-small text-center font-medium",children:(0,L.t)("global.request_leave_information")}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 my-2",children:[(0,a.jsx)(M.Y,{placeholder:(0,L.t)("label.reason_for_leaving"),className:"w-full",ref:s,variant:"bordered"}),(0,a.jsx)(U.K,{ref:r,children:(0,a.jsxs)("p",{className:"text-xs",children:[(0,L.t)("global.i_read_and_i_agree")," ",(0,a.jsx)(Y.F,{className:"text-dirtbike-main",href:"/page/termeni-si-conditii",target:"_blank",children:(0,L.t)("global.terms_and_conditions_2")})," ",(0,L.t)("global.dirtbike_platform"),"."]})})]})]}),(0,a.jsxs)(W.R,{children:[(0,a.jsx)(R.A,{color:"danger",variant:"light",onClick:e,children:(0,L.t)("global.decline")}),(0,a.jsx)(R.A,{className:"".concat(m?"cursor-not-allowed pointer-events-none":""),color:"primary",onClick:()=>{K()},isDisabled:m,disabled:m,children:m?(0,a.jsx)(z.c,{className:"ml-2",size:"sm",color:"white"}):(0,L.t)("global.send_request")})]})]})})}),(0,a.jsx)(Z.R,{isDismissable:!1,hideCloseButton:!0,isOpen:g,onOpenChange:j,children:(0,a.jsx)(A.A,{children:t=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(P.k,{className:"flex flex-col gap-1",children:(0,L.t)("global.confirm_password_change")}),(0,a.jsx)(q.I,{children:(0,a.jsx)(E.Z,{maxLength:6,label:(0,L.t)("label.email_verification_code_2"),regenerateLabel:"Ți-am trimis pe email un NOU COD format din 6 cifre (verifică și SPAM), te rugăm să \xeel introduci !",onConfirm:async t=>{F(t,async t=>{await V(t)&&H(null==e?void 0:e.id)})},onRegenerateCode:e=>{J(e)}})})]})})}),(0,a.jsx)(Z.R,{isDismissable:!1,hideCloseButton:!0,isOpen:g,onOpenChange:j,children:(0,a.jsx)(A.A,{children:t=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(P.k,{className:"flex flex-col gap-1",children:(0,L.t)("global.confirm_password_change")}),(0,a.jsx)(q.I,{children:(0,a.jsx)(E.Z,{maxLength:6,label:(0,L.t)("label.email_verification_code_2"),regenerateLabel:"Ți-am trimis pe email un NOU COD format din 6 cifre (verifică și SPAM), te rugăm să \xeel introduci !",onConfirm:async t=>{F(t,async t=>{await V(t)&&H(null==e?void 0:e.id)})},onRegenerateCode:e=>{J(e)}})})]})})})]})},H=l(5152);let K=l.n(H)()(()=>Promise.all([l.e(539),l.e(6036)]).then(l.bind(l,96036)),{loadableGenerated:{webpack:()=>[96036]},ssr:!1});var X=()=>{var e,t,l,i,n;let s=(0,w.v9)(e=>(0,v.S)().CurrentUser(e)),[o,r]=(0,u.useState)([]),[d,c]=(0,u.useState)(!1),[m,x]=(0,u.useState)(null);(0,u.useEffect)(()=>{(0,f.b)("/api/user/notification-preferences",{method:"GET"}).then(e=>e.json()).then(e=>{e&&e.success&&r(e.categories||[])}).catch(()=>{}).finally(()=>c(!0))},[]);let h=async e=>{let t=o.map(t=>t.key!==e||t.locked?t:{...t,enabled:!t.enabled});r(t),x(e);let l=e=>{let l=t.find(t=>t.key===e);return!l||l.enabled},a={};t.forEach(e=>{e.locked||(a[e.key]=e.enabled)}),a.saved_searches=l("saved_searches"),a.saved_posts=l("saved_posts"),a.marketing=l("marketing");try{await (0,f.b)("/api/user/notification-preferences",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch(e){}finally{x(null)}};return(0,a.jsxs)("div",{className:"md:px-9",children:[(0,a.jsx)(K,{}),(0,a.jsx)("h3",{className:"mt-6 text-dirtbike-main font-bold",children:"Email notifications"}
1),(0,a.jsx)("p",{className:"text-xs text-text-gray mb-3",children:"Choose which emails you want to receive."}),d?o.map(e=>(0,a.jsxs)("label",{htmlFor:"email-cat-".concat(e.key),className:"flex items-start gap-3 border-1 border-gray rounded-md bg-white-50 p-4 mb-2 ".concat(e.locked?"opacity-80 cursor-not-allowed":"cursor-pointer"),children:[(0,a.jsx)("input",{id:"email-cat-".concat(e.key),type:"checkbox",checked:e.enabled,disabled:e.locked||m===e.key,onChange:()=>h(e.key),className:"mt-1 w-[18px] h-[18px] accent-[#04A9B5]"}),(0,a.jsxs)("span",{children:[(0,a.jsxs)("span",{className:"font-semibold block text-sm",children:[e.label,e.locked?(0,a.jsx)("span",{className:"text-xs text-gray font-normal",children:" \xb7 Always on"}):null]}),(0,a.jsx)("span",{className:"text-xs text-text-gray",children:e.description})]})]},e.key)):null,s&&(null==s?void 0:null===(e=s.account)||void 0===e?void 0:e.user_devices)&&(null==s?void 0:null===(l=s.account)||void 0===l?void 0:null===(t=l.user_devices)||void 0===t?void 0:t.length)>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h3",{className:"mt-5 text-dirtbike-main font-bold",children:(0,L.t)("global.devices_associated_with_notifications")}),(0,a.jsx)("div",{className:"flex flex-row gap-2 flex-wrap",children:null==s?void 0:null===(n=s.account)||void 0===n?void 0:null===(i=n.user_devices)||void 0===i?void 0:i.map(e=>(0,a.jsxs)("div",{className:"flex flex-col max-w-[200px] border-1 border-gray rounded-md shadow-cart bg-white-50 p-4",children:[(0,a.jsxs)("div",{className:"font-medium text-xs",children:[(0,a.jsxs)("span",{className:"text-dirtbike-main font-semibold",children:[(0,L.t)("global.device_type"),":"]})," ",e.platform]}),(0,a.jsxs)("div",{className:"font-medium text-xs",children:[(0,a.jsxs)("span",{className:"text-dirtbike-main font-semibold",children:[(0,L.t)("global.user_agent"),":"]})," ",e.user_agent]})]},e.id))})]}):null]})},Q=l(55426),ee=e=>{var t;let{showCompanyData:l,showAccountSettings:u}=e,m=(0,w.v9)(e=>(0,v.S)().CurrentUser(e)),f=(null==m?void 0:m.is_company)==="1"&&(null==m?void 0:null===(t=m.company)||void 0===t?void 0:t.id)&&(null==m?void 0:m.company_id),x=(()=>{if(f){let e=(0,J.L)(null==m?void 0:m.company_financial_data),t=null==e?void 0:e.find(e=>!0===e.is_default_address);return!(!t||["address_city_id","address_country_id","address_county_id","address_postal_code","address_street","business_name","iban_account_currency","iban","fiscal_code","company_reg_no","name"].some(e=>!t[e]||""===t[e]))}})();return(0,a.jsxs)(a.Fragment,{children:[f&&!x?(0,a.jsx)("div",{className:"font-semibold text-xs lg:text-base py-1 px-2 mx-2 lg:mx-0 border-orange-500 border-2 rounded-md mb-2",children:(0,L.t)("global.complete_your_company_profile_hit")}):null,(0,a.jsxs)(d.d,{showDivider:!1,className:"p-2 flex flex-col gap-1 w-full rounded-md bg-faded",variant:"shadow",itemClasses:{base:"py-0 w-full",title:"font-normal text-medium",trigger:"px-2 py-0 data-[hover=true]:bg-default-100 rounded-md h-14 flex items-center",indicator:"text-medium",content:"text-small px-2"},defaultExpandedKeys:f?["0","2"]:["1","2"],selectionMode:"multiple",children:[f&&!1!==l?(0,a.jsx)(c.G,{"aria-label":(0,L.t)("global.my_company"),startContent:(0,a.jsx)(i.Z,{className:"w-6 h-6 text-dirtbike-main"}),subtitle:(0,L.t)("global.edit_my_company"),title:(0,L.t)("global.my_company"),classNames:{title:"font-semibold text-base"},children:(0,a.jsx)(Q.Z,{})},"0"):null,f||!1===u?null:(0,a.jsx)(c.G,{"aria-label":(0,L.t)("global.profile_image"),startContent:(0,a.jsx)(n.Z,{className:"w-6 h-6 text-primary"}),subtitle:(0,L.t)("label.edit_image_profile"),title:(0,L.t)("global.profile_image"),classNames:{title:"font-semibold text-base"},children:(0,a.jsx)(j,{})},"1"),!1!==u?(0,a.jsx)(c.G,{"aria-label":(0,L.t)("global.account_settings"),classNames:{subtitle:"text-warning",title:"font-semibold text-base"},startContent:(0,a.jsx)(s.Z,{className:"text-warning w-6 h-6"}),subtitle:(0,L.t)("label.edit_your_account_settings"),title:(0,L.t)("global.account_settings"),children:(0,a.jsx)(V,{})},"2"):null,!1!==u?(0,a.jsx)(c.G,{"aria-label":(0,L.t)("global.access_manager"),classNames:{subtitle:"text-danger",title:"font-semibold text-base"},startContent:(0,a.jsx)(o.Z,{className:"text-danger w-6 h-6"}),subtitle:(0,L.t)("label.change_password_account"),title:(0,L.t)("global.access_manager"),children:(0,a.jsx)(B,{})},"4"):null,!1!==u?(0,a.jsx)(c.G,{"aria-label":(0,L.t)("global.notification_manager"),classNames:{subtitle:"text-bondi-blue-600",title:"font-semibold text-base"},startContent:(0,a.jsx)(r.Z,{className:"text-bondi-blue-600 w-6 h-6"}),subtitle:(0,L.t)("label.change_devices_for_notifications"),title:(0,L.t)("global.notification_manager"),children:(0,a.jsx)(X,{})},"5"):null]})]})}}}]);

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.