1import{j as i,f as t,k as h,F as rt}from"./chunk-client-BT7kKSLE.js";import{r as l,R as Be}from"./chunk-commonConsts-DGkApafH.js";import{u as D,i as U,b5 as me,C as re,v as X,aK as p,aN as St,aO as Q,aB as Et,bj as da,w as ge,ae as ye,b3 as Tt,bk as kt,bl as ua,h as Ct,B as V,bm as it,bn as pa,f as Ae,bo as fa,S as Dt,L as Y,ax as z,aw as Re,bp as ha,q as Pt,T as M,at as ma,bq as ga,br as ya,bs as xa,bt as va,bu as ba,bv as Nt,bw as wa,bx as Sa,by as Ea,bz as Lt,bA as Ta,bB as ka,bC as Ca,bD as ot,bE as nt,H as Da,k as Me,bF as Pa,bG as Na,bH as La,b2 as Ia,c as x,e as Ra,aY as ja,Y as Va,ap as Ma,a3 as Fa,bI as Ba,bJ as Aa,I as ct,g as _a,b9 as O,N as Ua,bc as $a}from"./entry-index-3VM5tbTj.js";import{du as H,hf as ue,d1 as pe,C as _,es as It,Q as je,V as Ve,dy as Oa,dC as lt,iP as za,d_ as Rt,dA as Ha,b6 as Ga,b0 as qa,e5 as Ka,iQ as Wa,bW as $,iR as te,bq as Ya,eE as dt,bX as Fe,iS as Xa,iT as Qa,iU as ut,iV as pt,iW as Ja,iX as Za}from"./chunk-index-Ym0aeYS9.js";import{T as es,H as ts,V as as,I as ss,a as rs,B as is,b as fe,C as F,c as _e,d as os,S as ns,W as cs,e as ls,f as le,g as Ue,U as ds,P as us,h as ps,i as fs,j as hs,k as ms}from"./chunk-PlanUsageBlock-BuAhFW09.js";import{S as gs}from"./chunk-alert-triangle-QPMSg2QN.js";import{M as ys}from"./chunk-index-D8oqLJ58.js";const xs=e=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:12,height:12,viewBox:"0 0 12 12",fill:"none",...e},l.createElement("path",{d:"M5.14635 1.9299L0.911353 8.9999C0.824037 9.15111 0.777837 9.32255 0.777348 9.49716C0.776859 9.67177 0.822099 9.84346 0.908566 9.99516C0.995034 10.1469 1.11972 10.2733 1.27021 10.3618C1.4207 10.4504 1.59175 10.498 1.76635 10.4999H10.2364C10.411 10.498 10.582 10.4504 10.7325 10.3618C10.883 10.2733 11.0077 10.1469 11.0941 9.99516C11.1806 9.84346 11.2258 9.67177 11.2254 9.49716C11.2249 9.32255 11.1787 9.15111 11.0914 8.9999L6.85635 1.9299C6.76722 1.78295 6.64171 1.66146 6.49195 1.57714C6.34219 1.49282 6.17322 1.44852 6.00135 1.44852C5.82949 1.44852 5.66052 1.49282 5.51076 1.57714C5.36099 1.66146 5.23549 1.78295 5.14635 1.9299V1.9299Z",stroke:"currentColor",strokeWidth:.75,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6 4.5V6.5",stroke:"currentColor",strokeWidth:.75,strokeLinecap:"round",strokeLinejoin:"round"}),l.createElement("path",{d:"M6 8.50001H6.005",stroke:"currentColor",strokeWidth:.75,strokeLinecap:"round",strokeLinejoin:"round"})),vs={formErrors:p.shape({email:p.string,password:p.string}).isRequired,responseError:p.string,handleSubmit:p.func.isRequired},bs={responseError:""};function xe(e){const{t:a}=D(),{isReady:s}=U();return i.jsx("div",{className:"content-block profile-block",children:i.jsxs("div",{className:"content-box",children:[i.jsx("div",{className:"content-head",children:i.jsx("div",{className:"head-box",children:i.jsx("strong",{className:"form-title",children:a("profile.verifyEmail")})})}),i.jsx("div",{className:"content-body",children:i.jsx("div",{className:"col-lg-4 col-md-4 col-md-offset-4 col-sm-12",children:i.jsx("form",{className:"form-box form-profile form-vertical",id:"verify-email-captcha-form",children:i.jsxs("div",{className:"row",children:[i.jsx(me,{formErrors:e.formErrors,responseError:e.responseError}),i.jsxs("div",{className:"g-recaptcha",children:[i.jsx(re,{}),i.jsx(X,{enabled:!s})]}),i.jsx("div",{className:"form-holder",style:{padding:0},children:s&&i.jsx("input",{className:"btn btn-default",style:{width:"99%"},type:"submit",value:a("profile.submit"),onClick:e.handleSubmit})})]})})})})]})})}xe.propTypes=vs;xe.defaultProps=bs;xe.displayName="K2sDesktopVerifyEmail";var ws=xe;const Ss={formErrors:p.shape({email:p.string,password:p.string}).isRequired,responseError:p.string,handleSubmit:p.func.isRequired},Es={responseError:""};function ve(e){const{t:a}=D(),{isReady:s}=U();return i.jsx("section",{className:"payment-section",children:i.jsx("div",{className:"card-holder style2",children:i.jsxs("div",{className:"card-cont",children:[i.jsx("div",{className:"title-box",children:i.jsx("h2",{children:a("profile.verifyEmail")})}),i.jsxs("div",{className:"text-box",children:[i.jsx(me,{formErrors:e.formErrors,responseError:e.responseError}),i.jsx(re,{}),i.jsx(X,{enabled:!s}
1)]}),i.jsx("div",{className:"inner-box",children:i.jsx("div",{className:"inner-box_submit",children:s&&i.jsx("button",{className:"btn btn-white",style:{width:"99%"},type:"submit",onClick:e.handleSubmit,children:a("profile.submit")})})})]})})})}ve.propTypes=Ss;ve.defaultProps=Es;ve.displayName="K2sMobileVerifyEmail";var Ts=ve;const ks={isMobile:p.bool.isRequired};function $e(e){const{isMobile:a}=e;return a?i.jsx(Ts,{...e}):i.jsx(ws,{...e})}$e.propTypes=ks;$e.displayName="K2sVerifyEmail";var Cs=St($e);function Ds(e){const a=e;if(a.response){if(a.response.status===400&&a.response.data?.errors?.captcha)return pe.t("errors.captchaValidation");if(a.response.status===408&&a.response.data?.errors?.captcha)return pe.t("errors.captchaExpired");if(a.response.status===404)return"User not found";if(a.response.status===403)return"E-mail does not require confirmation"}return _(e)}const jt=({emailVerify:e,showNotification:a,setBanStatus:s})=>{const{t:o}=D(),{type:n,value:c}=U(),[r,d]=l.useState({}),[b,m]=l.useState(""),[g,T]=l.useState(!1),[E,v]=l.useState(!1);l.useEffect(()=>{ue("VerifyEmail","mount")},[]);const w=()=>{d({}),m("")},L=S=>{a({id:kt,text:()=>t("span",{children:S})})},I=async S=>{if(S&&S.preventDefault(),w(),!c)return d({captcha:o("errors.captchaValidation")}),!1;v(!0);const P=await e({backUrl:`${window.location.origin}/profile/verify-from-mail`,captchaType:n,captchaValue:c});return P instanceof Error?(Tt(P)&&s(),m(Ds(P)),v(!1),!1):(P.status===201&&(L("The confirmation email was created, and it was sent to your email"),T(!0)),v(!1),!0)};return g?t(ye,{to:"/profile"}):t(Cs,{title:"Verify Email",formErrors:r,responseError:b,handleSubmit:I,showNotification:a,isLoading:E})};jt.displayName="VerifyEmail";const Ps=()=>({}),Ns={emailVerify:da,showNotification:H,setBanStatus:Et},Ls=Q(Ps,Ns)(ge()(jt)),Vt=l.createContext(null),J=()=>{const e=l.useContext(Vt);if(!e)throw new Error("useProfileContext must be used within a ProfileProvider");return e};function Is({label:e,value:a,icon:s,buttons:o}){return h(es,{children:[h(ts,{children:[s,h(as,{children:[h(ss,{size:"XS",children:[e," â private"]}),t(rs,{variant:"primary",children:t(ua,{value:a})})]})]}),o&&t(is,{children:o.map((n,c)=>t("div",{children:n},c))})]})}function Rs(){const{t:e}=D(),{socialItems:a,handleUnlinkSocial:s,socialBlockError:o,handleGoogleResponse:n}=J(),c=Ct(),r=a.length>0;return l.useEffect(()=>{o&&c(H({type:It,id:"link-social-error",text:()=>t("span",{children:o})}))},[o]),r?t(fe,{icon:t(it,{}),label:e("profile.googleLink"),value:a[0].socialId,buttons:[t(V,{small:!0,label:e("profile.unlink"),variant:"secondary",onClick:d=>s(d,a[0])})]}):t(fe,{icon:t(it,{}),label:e("profile.googleLink"),value:e("profile.notLinked"),buttons:[t(pa,{onSuccess:n,render:d=>t(V,{small:!0,label:e("profile.link"),variant:"secondary",onClick:()=>d?.onClick()})})]})}function js(){const{t:e}=D(),{accountTypeName:a,email:s,isVerifiedEmail:o}=J(),c=Ae(fa)?Is:fe;return h(Ue,{children:[h(F,{children:[t(_e,{type:"headerBold",children:e("profile.account")}
1),h(os,{children:[o?h(ns,{size:"XS",children:[t(Dt,{}),e("profile.verified")]}):h(cs,{size:"XS",children:[t(xs,{}),e("profile.notVerified")]}),t(ls,{size:"XS",children:a})]})]}),t(le,{}),t(F,{children:t(c,{label:e("profile.email"),value:s,buttons:[!o&&t(Y,{to:"/profile/verifyEmail",children:t(V,{small:!0,label:e("profile.verify")})}),t(Y,{to:"/profile/change-email",children:t(V,{small:!0,label:e("profile.edit"),variant:"secondary"})})]})}),t(le,{}),t(F,{children:t(fe,{label:e("profile.password"),value:"â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢",buttons:[t(Y,{to:"/profile/change-password",children:t(V,{small:!0,label:e("profile.edit"),variant:"secondary"})})]})}),t(le,{}),t(F,{children:t(Rs,{})})]})}function Vs(){const{dailyTrafficTotal:e,dailyTrafficUsed:a,timezone:s,accountTypeName:o,expires:n,isLifetime:c}=J();return t(us,{accountTypeName:o,dailyTrafficTotal:e,dailyTrafficUsed:a,timezone:s,expires:n,isLifetime:c,infoNode:t(ds,{rebillOnly:!0})})}function Ms(){const{t:e}=D(),{storageSpaceTotal:a,storageSpaceUsed:s}=J(),o=a-s,n=o/a*100;return h(Ue,{children:[t(F,{children:t(_e,{type:"headerBold",children:e("profile.fileStorage")})}),t(ps,{progress:n,header:e("profile.availableSpace"),value:`${z(o)}/${z(a)}`})]})}function Fs(){const{t:e}=D(),{changeAndSaveConsent:a,handleUseDirectLinksChange:s,mailingAccepted:o,useDirectLinks:n,hideRecommendedVideo:c,isPremiumAccount:r}=J();return h(Ue,{children:[t(F,{children:t(_e,{type:"headerBold",children:e("profile.settings")})}),t(F,{children:t(Re,{id:"mailing",name:"mailingAccepted",label:e("profile.newsletters"),subTitle:e("profile.promotions"),onChange:a,checked:o||!1})}),r&&t(F,{children:t(Re,{label:e("profile.enableDD"),subTitle:e("profile.dd"),name:"useDirectLinks",id:"useDirectLinks",checked:n||!1,onChange:s})}),t(F,{children:t(Re,{label:e("profile.hideRecommended"),subTitle:e("profile.onlyOnFilePage"),name:"hideRecommendedVideo",id:"hideRecommendedVideo",checked:c||!1,onChange:a})}),t(le,{}),t(Y,{to:"/auth/logout",children:t(V,{variant:"danger",IconLeft:ha,label:e("profile.logout")})})]})}function Bs(){const{open:e}=Pt(),{showBuyMax:a}=J(),{t:s}=D();return a?h(hs,{children:[t(M,{type:"headerBold",children:s("profile.needMore")}),t(V,{label:s("profile.upgradeMax"),onClick:()=>e()}),t(fs,{type:"paragraph",size:"XS",children:s("profile.unlock")})]}):null}function As(){return i.jsxs(ms,{children:[i.jsx(js,{}),i.jsx(Bs,{}),i.jsx(Vs,{}),i.jsx(Ms,{}),i.jsx(Fs,{})]})}var _s=As;function Us({closePopup:e,onConfirm:a}){return t("div",{className:"modal-content",children:h("div",{children:[t("div",{children:h("div",{className:"direct_download_info",children:[t("h3",{children:"Description of option âDirect downloadâ"}),t("br",{}),t("p",{children:"This option affects k2s.cc site visit."}),t("br",{}),t("p",{children:"Disable âDirect Downloadâ (default state) - when clicking a file link on partner`s site, you redirect to the file page on k2s.cc site. It helps you to watch a preview and read additional file information. Premium PRO users can watch video online, enjoy the recommended video and My favorites."}),t("br",{}),t("p",{children:"Enable âDirect Downloadâ - when clicking a file link on partner`s site, you download the file automatically. It saves your time as there is no redirect to the k2s.cc site."}),t("br",{}),h("p",{children:[t("span",{children:"Attention! "}),"When this option is enabled, you canât watch a video and preview online and can`t get additional file information: its name, size, format, virus check status."]}),t("br",{}),t("p",{children:"You always can change the option easily on your profile page on k2s.cc at any time."})]})}),h("div",{className:"modal-footer",style:{padding:"15px 0 0"},children:[t("button",{className:"btn btn-default","data-dismiss":"modal",onClick:e,children:"Cancel"}),t("button",{className:"btn btn-danger btn-ok","data-dismiss":"modal",onClick:()=>{a(),e()},children:"Confirm"})]})]})})}const $s=`${window.location.origin}/change-email`,Mt=({showNotification:e,isUserFetched:a,updateUser:s,saveUser:o,userSavingError:n,accountTypeName:c,user:r,fetchUserStatistic:d,fetchSocial:b,addSocialAccount:m,removeSocialAccount:g,userSettingsUpdate:T,openPaymentPopup:E,sendChangeEmailLetter:v,openPopup:w,closePopup:L,timezone:I,isPremiumAccount:S,isPremiumMaxAccount:P})=>{const{t:R}=D(),[B,k]=l.useState(r.email??""),[u,N]=l.useState(""),[A,G]=l.useState(r.useDirectLinks??!1),[He,Ee]=l.useState(!1),[Ge,Te]=l.useState(!1),[ke,Ot]=l.useState(r.isVerifiedEmail??!1),[zt,q]=l.useState({}),[j,ie]=l.useState({}),[qe,oe]=l.useState(""),[Ht,Gt]=l.useState(!1),{type:Ce,value:De,reset:qt,execute:Kt}=U(),Ke=l.useRef(a),We=l.useRef(r.settings),Ye=l.useRef(r.isVerifiedEmail),ee=l.useCallback(f=>{const y=ot(f.settings,je),C=ot(f.settings,Ve);k(f.email??""),G(f.useDirectLinks??!1),Ot(f.isVerifiedEmail??!1),Ee(nt(y.value)),Te(nt(C.value))},[]),Wt=f=>{const{name:y,type:C}=f.target;if(C==="checkbox"){const{checked:W}=f.target;switch(y){case"useDirectLinks":G(W);break;case"hideRecommendedVideo":Ee(W);break;case"mailingAccepted":Te(W);break}ie(la=>({...la,[y]:W}));return}const Ie=f.target.value.trim();switch(y){case"email":k(Ie);break;case"password":N(Ie);break}ie(W=>({...W,[y]:Ie}))},Yt=()=>{const f={};return!f.email&&!Me(B)&&(f.email=R("formErrors.email.notValid")),q(f),Object.keys(f).length===0},Xt=()=>{try{return Ha(u),!0}catch(f){return q({password:f.message}),!1}},Qt=()=>ke?!0:(q({email:R("formErrors.email.notVerified")}),!1),K=(f,y="settings-success-save")=>
1{e({id:y,text:()=>t("span",{children:f})})},Xe=()=>{e({id:Pa,type:Rt,text:()=>h("span",{children:["If you are using any automatic Download Manager, you can choose Direct Download option in your"," ",t(Y,{to:"/site/profile",children:"profile"}),"."]})})},Pe=()=>{q({}),oe("")},Jt=async()=>{try{await v({password:u,email:B,backUrl:$s,captchaValue:De,captchaType:Ce}),K("To change the email, use the instructions sent to you by old email","change-email"),ie({})}catch(f){q({error:_(f)})}qt()},Zt=async()=>{Qt()&&Xt()&&Kt()},ea=async f=>{if(f&&f.preventDefault(),!Yt())return;const y={};j.useDirectLinks!==void 0&&(y.useDirectLinks=j.useDirectLinks),Pe(),Object.keys(y).length!==0&&await o(y)&&(s(y),K("Settings successfully saved"),y.useDirectLinks&&Xe());const C=[];if(Object.keys(j).includes("hideRecommendedVideo")&&C.push({name:je,value:j.hideRecommendedVideo}),Object.keys(j).includes("mailingAccepted")&&C.push({name:Ve,value:lt(j.mailingAccepted)}),C.length&&T(C),j.email&&j.email.toLowerCase()!==(r.email??"").toLowerCase()){await Zt();return}ie({})},Ne=async f=>{const{checked:y,name:C}=f.target;switch(C){case"useDirectLinks":G(y);break;case"mailingAccepted":Te(y);break;case"hideRecommendedVideo":Ee(y);break}C.includes("useDirectLinks")&&await o({useDirectLinks:y})&&(s({useDirectLinks:y}),K("Settings successfully saved"),y&&Xe()),C.includes("mailingAccepted")&&T([{name:Ve,value:lt(y)}]),C.includes("hideRecommendedVideo")&&T([{name:je,value:y}])},ta=()=>{w(t(Us,{closePopup:L,onConfirm:()=>Ne({target:{type:"checkbox",name:"useDirectLinks",checked:!0}})}),"direct-download-modal")},aa=f=>{if(f.target.checked){f.preventDefault(),ta();return}Ne(f)},Qe=async(f,y)=>{f.preventDefault();const C=await g(y);C instanceof Error?oe(_(C)):K(`The ${y.socialType} account is successfully unlinked`)},sa=async f=>{if(Pe(),f.accessToken){const y=await m({socialType:za,socialToken:f.accessToken,socialId:f.userID});y instanceof Error?oe(_(y)):K("The facebook account is successfully linked")}},Je=async f=>{Pe();let y;if(f.access_token?y=f.access_token:f.getAuthResponse&&(y=f.getAuthResponse().access_token),y){const C=await m({socialToken:y,socialType:Oa});C instanceof Error?oe(_(C)):K("The Google account is successfully linked")}},Ze=()=>{const f={};!f.email&&!Me(r.email??"")?(f.email=R("formErrors.email.notValid"),q(f)):Gt(!0)};l.useEffect(()=>{d(),b(),r.settings.length>0&&ee(r)},[]),l.useEffect(()=>{Ke.current!==a&&a&&ee(r),We.current!==r.settings&&ee(r),Ye.current!==r.isVerifiedEmail&&a&&ee(r),Ke.current=a,We.current=r.settings,Ye.current=r.isVerifiedEmail},[a,r,ee]),l.useEffect(()=>{Ce&&De&&Jt()},[Ce,De]);const{accountType:Le}=r,ra=j.email&&j.email!==r.email,ia=j.useDirectLinks!==void 0&&j.useDirectLinks!==r.useDirectLinks;if(Ht)return t(ye,{to:"/profile/change-password"});const et={formErrors:zt,responseError:n?_(n):""},tt={email:B,useDirectLinks:A,hideRecommendedVideo:He,mailingAccepted:Ge,isVerifiedEmail:ke,password:u,handleInputChange:Wt,handleSaveData:ea,handlePasswordChange:Ze,accountType:Le,isSaveDisabled:!(ra||ia)},at={dailyTrafficUsed:r.dailyTraffic.used,dailyTrafficTotal:r.dailyTraffic.total,storageSpaceUsed:r.storageSpace.used,storageSpaceTotal:r.storageSpace.total},st={socialItems:[...r.socialItems],handleFacebookResponse:sa,handleGoogleResponse:Je,handleUnlinkSocial:Qe,socialBlockError:qe},oa={formProps:{...tt},formErrorsProps:et,totalProps:at,socialProps:st},na=_s,ca={submitBoxProps:{accountType:Le,handlePasswordChange:Ze,openPaymentPopup:E},formProps:tt,formErrorsProps:et,totalProps:at,socialProps:st};return h(Vt.Provider,{value:{email:B,isVerifiedEmail:ke,isLifetime:!!r.isLifetime,accountTypeName:c,dailyTrafficUsed:r.dailyTraffic.used||0,dailyTrafficTotal:r.dailyTraffic.total||0,storageSpaceUsed:r.storageSpace.used||0,storageSpaceTotal:r.storageSpace.total||0,expires:r.expires?new Date(r.expires):null,changeAndSaveConsent:Ne,mailingAccepted:Ge,useDirectLinks:A,handleUseDirectLinksChange:aa,hideRecommendedVideo:He,timezone:I??"",socialItems:r.socialItems,handleUnlinkSocial:Qe,socialBlockError:qe,handleGoogleResponse:Je,isPremiumAccount:S,showBuyMax:!P},children:[t(Da,{children:t("title",{children:"Your account status"})}),t(na,{desktopProps:oa,mobileProps:ca,accountType:Le})]})};Mt.displayName="UserProfile";const Os=e=>({user:{email:e.user.email,isVerifiedEmail:e.user.isVerifiedEmail,useDirectLinks:e.user.useDirectLinks,accountType:e.user.accountType,expires:e.user.expires,isLifetime:e.user.isLifetime,dailyTraffic:e.user.dailyTraffic,storageSpace:e.user.storageSpace,socialItems:e.user.socialItems,settings:e.user.settings,isFetchingSetting:e.user.isFetchingSetting,fetchingSettingName:e.user.fetchingSettingName},isUserFetched:!!e.user.id,userSavingError:e.user.savingError,timezone:String(Ca(e)??""),isPremiumAccount:xa(e),isPremiumMaxAccount:ya(e),accountTypeName:ga(e)}),zs={showNotification:H,updateUser:ka,saveUser:Ta,fetchUserStatistic:Lt,fetchSocial:Ea,addSocialAccount:Sa,removeSocialAccount:wa,sendChangeEmailLetter:Nt,userSettingsUpdate:ba,openPaymentPopup:va},Hs=ma()(Q(Os,zs)(ge()(Mt))),Gs={location:p.oneOfType([p.string,p.object]).isRequired,verifyEmailByCode:p.func.isRequired,emailIsVerifyingByCode:p.bool},qs={emailIsVerifyingByCode:void 0};class Z extends Be.Component{static getResponseError(a){return a.response&&a.response.message?a.response.message:_(a)}
1constructor(a){super(a),ue("VerifyFromMail")}componentDidMount(){const{location:a}=this.props,s=qa.parse(a.search.slice(1));this.sendVerifyCode(s.code),ue("VerifyFromMail","mount")}async sendVerifyCode(a){const{verifyEmailByCode:s,showNotification:o}=this.props,n=await s({code:a}),c={id:La};n instanceof Error?(c.type=Rt,c.text=()=>i.jsx("div",{children:Z.getResponseError(n)})):(c.text=()=>i.jsx("div",{children:"Account activation successful"}),Ka(Wa)),o(c)}render(){const{emailIsVerifyingByCode:a}=this.props;return a||a===void 0?i.jsx(X,{enabled:!0}):i.jsx(ye,{to:"/profile"})}}Z.propTypes=Gs;Z.defaultProps=qs;Z.displayName="VerifyFromMail";const Ks=e=>({emailIsVerifyingByCode:e.user.emailIsVerifyingByCode}),Ws=e=>({verifyEmailByCode:a=>e(Na(a)),showNotification:a=>e(H(a))});var Ys=Ga(Q(Ks,Ws))(Z);const Xs={formErrors:p.shape({email:p.string,password:p.string}).isRequired,responseError:p.string,handleSubmit:p.func.isRequired,title:p.string},Qs={responseError:""};function be(e){const{t:a}=D(),{isReady:s}=U();return i.jsx("div",{className:"content-block profile-block",children:i.jsxs("div",{className:"content-box",children:[i.jsx("div",{className:"content-head",children:i.jsx("div",{className:"head-box",children:i.jsx("strong",{className:"form-title",children:a("profile.changePassword")})})}),i.jsx("div",{className:"content-body",children:i.jsx("div",{className:"col-lg-4 col-md-4 col-md-offset-4 col-sm-12",children:i.jsx("form",{className:"form-box form-profile form-vertical",id:"verify-email-captcha-form",children:i.jsxs("div",{className:"row",children:[i.jsx(me,{formErrors:e.formErrors,responseError:e.responseError}),i.jsxs("div",{className:"g-recaptcha",children:[i.jsx(re,{}),i.jsx(X,{enabled:!s})]}),i.jsx("div",{className:"form-holder",style:{padding:0},children:s&&i.jsx("input",{className:"btn btn-default",style:{width:"99%"},type:"submit",value:a("profile.submit"),onClick:e.handleSubmit})})]})})})})]})})}be.propTypes=Xs;be.defaultProps=Qs;be.displayName="K2sDesktopChangePassword";var Js=be;const Zs={formErrors:p.shape({email:p.string,password:p.string}).isRequired,responseError:p.string,handleSubmit:p.func.isRequired,title:p.string},er={responseError:""};function we(e){const{t:a}=D(),{isReady:s}=U();return i.jsx("section",{className:"payment-section",children:i.jsx("div",{className:"card-holder style2",children:i.jsxs("div",{className:"card-cont",children:[i.jsx("div",{className:"title-box",children:i.jsx("h2",{children:a("profile.changePassword")})}),i.jsxs("div",{className:"text-box",children:[i.jsx(me,{formErrors:e.formErrors,responseError:e.responseError}),i.jsx(re,{}),i.jsx(X,{enabled:!s})]}),i.jsx("div",{className:"inner-box",children:i.jsx("div",{className:"inner-box_submit",children:s&&i.jsx("button",{className:"btn btn-white",style:{width:"99%"},type:"submit",onClick:e.handleSubmit,children:a("profile.submit")})})})]})})})}we.propTypes=Zs;we.defaultProps=er;we.displayName="K2sMobileChangePassword";var tr=we;const ar={isMobile:p.bool.isRequired};function Oe(e){const{isMobile:a}=e;return a?i.jsx(tr,{...e}):i.jsx(Js,{...e})}Oe.propTypes=ar;Oe.displayName="K2sChangePassword";var sr=St(Oe);function rr(e){const a=e;if(a.response){if(a.response.status===400&&a.response.data?.errors?.captcha)return pe.t("errors.captchaValidation");if(a.response.status===408&&a.response.data?.errors?.captcha)return pe.t("errors.captchaExpired");if(a.response.status===404)return"User not found";if(a.response.status===403)return"E-mail does not require confirmation"}return _(e)}const Ft=({email:e,resetPassword:a,showNotification:s,setBanStatus:o})=>{const{t:n}=D(),{type:c,value:r}=U(),[d,b]=l.useState({}),[m,g]=l.useState(""),[T,E]=l.useState(!1),[v,w]=l.useState(!1);l.useEffect(()=>{ue("ChangePassword","mount")},[]);const L=()=>{b({}),g("")},I=P=>{s({id:kt,text:()=>t("span",{children:P})})},S=async P=>{if(P&&P.preventDefault(),L(),!r)return b({captcha:n("errors.captchaValidation")}),!1;try{w(!0),(await a({backUrl:`${window.location.origin}/auth/restore/new-password`,email:e,captchaType:c,captchaValue:r})).status===201&&(I(`${n("restorePassword.codeWillSend")} ${e}`),E(!0))}catch(R){Tt(R)&&o(),g(rr(R))}return w(!1),!0};return e?T?t(ye,{to:"/profile"}):t(sr,{formErrors:d,title:"Change password",responseError:m,handleSubmit:S,isLoading:v}):t(X,{enabled:!0})};Ft.displayName="ChangePassword";const ir=e=>({email:e.user.email}),or={resetPassword:Ia,showNotification:H,setBanStatus:Et},nr=Q(ir,or)(ge()(Ft)),cr=x("div",{target:"ekx383y4"})("display:flex;padding:var(--spacing-16, 16px) var(--spacing-24, 24px);justify-content:center;align-items:center;gap:var(--spacing-16, 16px);width:100%;border-radius:var(--radius-8, 8px);background:var(--Indicators-Notification-Neutral-BG, #F1F3F3);@media (max-width: ",$.tablet,"px){flex-direction:column;gap:0;}"),ft=x("div",{target:"ekx383y3"})("display:flex;align-items:center;gap:16px;flex:1;justify-content:",({align:e})=>e==="right"?"flex-end":"flex-start",";@media (max-width: ",$.tablet,"px){width:100%;justify-content:flex-start;align-items:center;}"),lr=x("div",{target:"ekx383y2"})("width:2px;align-self:stretch;background:var(--Stroke-Neutral-200);margin:0 16px;@media (max-width: ",$.tablet,"px){width:100%;height:2px;align-self:auto;margin:16px 0;}"),ht=x(M,{target:"ekx383y1"})(""),mt=x(M,{target:"ekx383y0"})(""),dr=10*1024*1024*1024,ur=({dailyTrafficTotal:e,dailyTrafficUsed:a,downloadedTotal:s})=>{const{t:o}=D(),n=e-a;return h(rt,{children:[n<dr&&t(ys,{type:"error",header:o("downloadStats.usedToday",{used:z(a),total:z(e)}),message:o("downloadStats.premiumMaxLimit"),icon:t(gs,{})}),h(cr,{children:[h(ft,{align:"right",children:[t(ht,{type:"display",size:"S",variant:"primary",children:z(s)}),t(mt,{size:"S",variant:"secondary",children:o("downloadStats.totalDownloaded")})]}),t(lr,{}),h(ft,{align:"left",children:[h(ht,{type:"display",size:"S",variant:"primary",children:[z(a),"/",z(e)]}),t(mt,{size:"S",variant:"secondary",children:h(rt,{children:[o("downloadStats.trafficLeftTodayFor"),t("br",{}),o("downloadStats.viewingDownloading")]})})]})]})]})},pr={user:p.shape({dailyTraffic:p.shape({total:p.number,used:p.number}),storageSpace:p.shape({total:p.number,used:p.number}),downloadedTotal:p.number}).isRequired};function ze(e){return i.jsx(ur,{dailyTrafficUsed:e.user.dailyTraffic.used,dailyTrafficTotal:e.user.dailyTraffic.total,storageSpaceUsed:e.user.storageSpace.used,storageSpaceTotal:e.user.storageSpace.total,downloadedTotal:e.user.downloadedTotal})}const fr=e=>({user:{dailyTraffic:e.user.dailyTraffic,storageSpace:e.user.storageSpace,downloadedTotal:e.user.downloadedTotal}});ze.propTypes=pr;ze.displayName="UserStatisticTotal";var hr=Q(fr,null)(ze);function mr({text:e,fallbackPath:a}){const s=Ra();return t(V,{label:e,variant:"text",IconLeft:ja,onClick:()=>
1{if(s.length>1){s.goBack();return}s.push(a)}})}function gr(e){const a=l.useRef(e);l.useEffect(()=>{a.current=e},[e]),l.useEffect(()=>{const s=o=>{a.current(o)};return document.addEventListener("click",s),()=>{document.removeEventListener("click",s)}},[])}const de=1e3,yr=1024*1024*1024,he=164,gt=36,xr=24,vr=24,br=7,wr=18,Sr=.68,Er=4,Tr=1,kr=[1,6,15,21],se=[{id:te.guest,nameKey:"downloadStats.free",limit:10,barVerticalScale:2},{id:te.premium,nameKey:"downloadStats.premium",limit:10,showAsUpgradeLine:!1},{id:te.premiumPro,nameKey:"downloadStats.premiumPro",limit:50},{id:te.premiumMax,nameKey:"downloadStats.premiumMax",limit:100},{id:Ya.premiumMaxPrime,nameKey:"downloadStats.premiumMaxPrime",limit:100,showAsUpgradeLine:!1}],Bt=se[se.length-1].limit;function ne(e){return e.limit*(e.barVerticalScale??1)}function ae(e,a){return e-a/Bt*he}function Cr(e,a,s){const o=new Date,n=s.getFullYear(),c=s.getMonth()+1,r=new Date(n,c,0).getDate(),d=new Map(e.map(b=>[b.date,b]));return Array.from({length:r},(b,m)=>{const g=m+1,T=`${n}
1-${String(c).padStart(2,"0")}-${String(g).padStart(2,"0")}`,E=d.get(T);return{day:g,date:new Date(n,c-1,g),value:E?.download_total??0,hasDownload:!!E,isActive:a!==null&&n===a.getFullYear()&&c-1===a.getMonth()&&g===a.getDate(),isToday:n===o.getFullYear()&&c-1===o.getMonth()&&g===o.getDate()}})}function Dr(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Pr({item:e,index:a,slotWidth:s,barWidth:o,chartBottom:n,availableLimit:c,verticalScale:r,t:d}){const b=e.value/yr,m=b>=c,g=Math.min(b,c),T=Math.max(g/Bt,0),v=(e.hasDownload?Math.max(T*he*r,Er):0)+(m?Tr:0);let w="default";return m&&(w="limit"),e.isActive&&(w="active"),e.isToday&&(w="today"),{day:e.day,date:e.date,x:a*s+(s-o)/2,y:n-v,width:o,height:v,variant:w,tooltipY:w==="default"?ae(n,c):n-v,tooltipDate:`${e.day} ${e.date.toLocaleDateString("en-US",{month:"long"}).toLowerCase()}`,tooltipUsage:d("downloadStats.usedTraffic",{used:Dr(b),limit:c})}}function Nr({data:e,slotWidth:a,horizontalScale:s,monthName:o,width:n}){const c=new Set([...kr,e.length]);return e.reduce((r,d,b)=>{if(!c.has(d.day))return r;const m=d.day===1,g=d.day===e.length;let E=(b*a+a/2)*s,v="middle";return m?(E=0,v="start"):g&&(E=n,v="end"),r.push({day:d.day,x:E,text:`${o} ${d.day}`,textAnchor:v}),r},[])}function Lr({downloads:e,width:a,subscription:s,selectedDate:o,selectedMonth:n,t:c}){const r=gt+he+xr,d=gt+he,b=a/de,m=Cr(e,o,n),g=m.length>0?de/m.length:0,T=Math.min(wr,g*Sr),E=m[0]?.date.toLocaleDateString("en-US",{month:"short"}),v=Math.max(se.findIndex(({id:k})=>k===s),0),w=se[v],L=se.slice(v).filter(k=>k.id===w.id||k.showAsUpgradeLine!==!1),I=w.limit,S=w.barVerticalScale??1,P=ae(d,ne(w)),R=L.map(k=>({id:k.id,x1:0,y1:ae(d,ne(k)),x2:de,y2:ae(d,ne(k)),dashed:k.id!==w.id})),B=L.flatMap(k=>{const u=ae(d,ne(k));return[{key:`${k.id}-title`,x:0,y:u-vr,text:c(k.nameKey)},{key:`${k.id}-value`,x:0,y:u-br,text:c("downloadStats.dailyLimit",{limit:k.limit})}]});return{height:r,limit:I,availableLimitY:P,lines:R,limitLabels:B,bars:m.map((k,u)=>Pr({item:k,index:u,slotWidth:g,barWidth:T,chartBottom:d,availableLimit:I,verticalScale:S,t:c})),labels:Nr({data:m,slotWidth:g,horizontalScale:b,monthName:E,width:a})}}const Ir=x("div",{target:"e12bogo88"})("display:flex;padding:var(--spacing-24, 24px);flex-direction:column;border-radius:var(--radius-8, 8px);border:1px solid var(--Stroke-Neutral-100, #D9DFDF);background:var(--Surface-Neutral-1, #FFF);flex:1;@media (max-width: ",$.tablet,"px){border:none;}"),Rr=x("div",{target:"e12bogo87"})("display:flex;justify-content:space-between;flex-wrap:wrap;@media (max-width: ",$.tablet,"px){gap:8px;}"),jr=x("div",{target:"e12bogo86"})({name:"pw7jst",styles:"position:relative;width:100%"}),Vr=x("svg",{target:"e12bogo85"})({name:"u33izr",styles:"display:block;width:100%;height:auto;overflow:visible"}),Mr=e=>e?"var(--Indicators-Accent-1)":"var(--Stroke-Neutral-1000)",Fr=x("line",{shouldForwardProp:e=>e!=="isDashed",target:"e12bogo84"})("stroke:",({isDashed:e})=>Mr(e),";stroke-width:1;stroke-dasharray:",({isDashed:e})=>e?"4 4":"none",";vector-effect:non-scaling-stroke;"),yt=x("text",{shouldForwardProp:e=>e!=="variant",target:"e12bogo83"})("fill:",({variant:e="primary"})=>e==="secondary"?"var(--Typography-Text-2)":"var(--Typography-Text-1, #30343b)",";font-family:var(--typography-font-family-default, Inter);font-size:var(--typography-font-size-100, 12px);font-style:normal;font-weight:var(--typography-font-weight-regular, 400);line-height:var(--typography-line-height-50, 12px);"),Br=e=>{switch(e){case"limit":return"var(--Action-Danger-BG-default, #ff0a3d)";case"active":return"var(--Surface-Accent-500, #0796d2)";case"today":return"var(--Surface-Accent-700, #0092D6)";default:return"var(--Surface-Neutral-100, #dfe3e4)"}},Ar=e=>{switch(e){case"limit":return"var(--Action-Danger-BG-hover, #d90836)";case"active":return"var(--Surface-Accent-600, #057caf)";case"today":return"var(--Surface-Accent-500, #31C0FA)";default:return"var(--Stroke-Neutral-200, #c4c9cc)"}},_r=x("rect",{shouldForwardProp:e=>e!=="variant",target:"e12bogo82"})("cursor:pointer;rx:2px;fill:",({variant:e})=>Br(e),";&:hover{fill:",({variant:e})=>Ar(e),";}"),Ur=x("div",{shouldForwardProp:e=>e!=="tooltipLeft"&&e!=="tooltipTop",target:"e12bogo81"})("position:absolute;top:",({tooltipTop:e})=>e,"px;left:",({tooltipLeft:e})=>e,"px;display:flex;flex-direction:column;align-items:flex-start;gap:var(--spacing-16, 16px);max-width:324px;padding:var(--spacing-8, 8px);color:var(--Typography-Text-on-dark-1, #fff);background:var(--Surface-Total-Black, #000);border:1px solid var(--Stroke-Neutral-500, #748B97);border-radius:var(--radius-8, 8px);pointer-events:none;text-align:left;white-space:nowrap;z-index:1;transform:translate(-50%, calc(-100% - 8px));"),xt=x(M,{target:"e12bogo80"})({name:"7tq2zr",styles:"align-self:stretch;text-align:left"});function vt({tooltip:e}){return h(Ur,{tooltipLeft:e.left,tooltipTop:e.top,children:[t(xt,{type:"labelBold",size:"S",children:e.bar.tooltipDate}),t(xt,{size:"S",children:e.bar.tooltipUsage})]})}const $r=x("div",{target:"eftyzge4"})("display:flex;gap:16px;@media (max-width: ",$.mobile,"px){gap:8px;justify-content:space-between;width:100%;}"),Or=x("div",{target:"eftyzge3"})({name:"13qruez",styles:"gap:16px;color:var(--Typography-Text-1);display:flex;align-items:center"}),bt=x("button",{target:"eftyzge2"})({name:"1uh1ry8",styles:"border:0;padding:0;background:transparent;cursor:pointer;svg{width:16px;height:16px;}&:disabled{cursor:default;opacity:0.3;}"}),zr=x("div",{target:"eftyzge1"})({name:"v0gccb",styles:"min-width:140px;text-align:center"}),Hr=x(V,{target:"eftyzge0"})({name:"3abrc0",styles:"width:auto"});function ce(e){return new Date(e.getFullYear(),e.getMonth(),1)}function Gr({value:e,minDate:a,maxDate:s,changeMonth:o}){const{t:n}=D(),c=ce(e),r=ce(a),d=ce(s),b=c.getTime()>r.getTime(),m=c.getTime()<d.getTime(),g=E=>{const v=new Date(c.getFullYear(),c.getMonth()+E,1);v<r||v>d||o(v)},T=c.toLocaleDateString("en-US",{month:"long",year:"numeric"});return h($r,{children:[h(Or,{children:[t(bt,{onClick:()=>g(-1),disabled:!b,children:t(Va,{})}),t(zr,{children:t(M,{variant:"primary",children:T})}),t(bt,{onClick:()=>g(1),disabled:!m,children:t(Ma,{})})]}),t(Hr,{label:n("downloadStats.thisMonth"),onClick:()=>o(ce(new Date)),variant:"secondary",small:!0})]})}function qr({downloads:e,onClick:a,selectedDate:s,selectedMonth:o,subscription:n,value:c,minDate:r,maxDate:d,changeMonth:b}){const{t:m}=D(),[g,T]=l.useState(0),[E,v]=l.useState(null),[w,L]=l.useState(null),I=l.useRef(null),S=l.useMemo(()=>Lr({downloads:e,width:g,subscription:n,selectedDate:s,selectedMonth:o,t:m}
1),[e,g,n,s,o]);l.useLayoutEffect(()=>{const u=I.current;if(!u)return()=>{};const N=()=>{T(u.getBoundingClientRect().width)};N();const A=new ResizeObserver(N);return A.observe(u),()=>{A.disconnect()}},[]);const P=l.useCallback(u=>{!(u.target instanceof SVGRectElement)&&s!==null&&(L(null),a(null))},[a,s]);gr(P);const R=(u,N)=>{const A=I.current?.getBoundingClientRect(),G=N.currentTarget.getBoundingClientRect();return A?{bar:u,left:G.left-A.left+G.width/2,top:u.tooltipY}:null},B=(u,N)=>{w?.bar.day!==u.day&&v(R(u,N))},k=(u,N)=>{v(null),L(R({...u,tooltipY:S.availableLimitY},N)),a?.(u.date)};return h(Ir,{children:[h(Rr,{children:[t(M,{type:"headerBold",variant:"primary",children:m("downloadStats.trafficUsage")}),t(Gr,{value:c,minDate:r,maxDate:d,changeMonth:b})]}),h(jr,{ref:I,children:[h(Vr,{width:g,height:S.height,role:"img",children:[h("svg",{width:g,height:S.height,viewBox:`0 0 ${de} ${S.height}`,preserveAspectRatio:"none","aria-hidden":!0,children:[S.lines.map(({dashed:u,...N})=>t(Fr,{...N,isDashed:!!u},N.id)),S.bars.map(u=>t(_r,{x:u.x,y:u.y,width:u.width,height:u.height,variant:u.variant,onMouseEnter:N=>B(u,N),onMouseLeave:()=>v(null),onClick:N=>k(u,N),children:t("title",{children:`${u.tooltipDate} 2${u.tooltipUsage}`})},u.day))]}),S.limitLabels.map(u=>t(yt,{x:u.x,y:u.y,children:u.text},u.key)),S.labels.map(u=>t(yt,{x:u.x,y:S.height-6,textAnchor:u.textAnchor,variant:"secondary",children:u.text},u.day))]}),w&&t(vt,{tooltip:w}),E&&E.bar.day!==w?.bar.day&&t(vt,{tooltip:E})]})]})}const Kr=x(Fa,{target:"esioy6a8"})({name:"tw4sx",styles:"display:flex;flex-direction:column;gap:12px"}),Wr=x("div",{target:"esioy6a6"})("display:flex;gap:12px;width:100%;@media (max-width: ",$.tablet,"px){flex-direction:column;}"),Yr=x("div",{target:"esioy6a5"})("display:flex;width:305px;height:309px;padding:var(--spacing-24, 24px);flex-direction:column;justify-content:space-between;gap:var(--spacing-16, 16px);align-items:flex-start;border-radius:var(--radius-8, 8px);background:var(--Surface-Promo-Accent-1000, #042A4D);@media (max-width: ",$.tablet,"px){flex-direction:column;width:100%;}"),Xr=x(M,{target:"esioy6a4"})({name:"1fdf1l1",styles:"color:var(--Typography-Text-on-accent-1, #B0F1FF)"}),Qr=x(M,{target:"esioy6a3"})({name:"xvodgl",styles:"color:var(--Typography-Text-on-accent-2, #B0F1FF)"}),Jr=x("div",{target:"esioy6a2"})({name:"1ps0726",styles:"display:flex;flex-direction:column;gap:var(--spacing-16, 16px);margin-top:auto;width:100%"}),Zr=x(M,{target:"esioy6a1"})({name:"1hcgah8",styles:"color:var(--Typography-Text-on-accent-2, #B0F1FF);display:flex;gap:8px"}),ei=x("div",{target:"esioy6a0"})({name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"});function wt({children:e}){return h(Zr,{type:"paragraph",children:[t(Dt,{}),e]})}function ti({subscription:e,expires:a}){const{t:s}=D(),{open:o}=Pt(),n=Ae(Ba),c=n?s("downloadStats.currentPlan",{plan:dt(e)}):s("downloadStats.upgradeToPremiumMax"),r=n?s("downloadStats.endsOn",{date:Fe(a,"dd.MM.yyyy")}):s("downloadStats.currentPlan",{plan:dt(e)}),d=s(n?"downloadStats.dailyTrafficForDownloading":"downloadStats.increaseTraffic");return h(Yr,{children:[t(Xr,{type:"headerBold",variant:"primary",children:c}),h(ei,{children:[t(wt,{children:d}),t(wt,{children:s("downloadStats.extendedDownloadSpeed")})]}),h(Jr,{children:[!n&&t(V,{label:s("downloadStats.upgrade"),onClick:()=>o()}),t(Qr,{children:r})]})]})}function At({minDate:e,maxDate:a,changeMonth:s,downloads:o,onChange:n,selectedDate:c,selectedMonth:r,subscription:d,expires:b}){const{t:m}=D();return h(Kr,{children:[t(mr,{text:m("downloadStats.downloadingStatistic"),fallbackPath:"/profile"}),t(hr,{}),h(Wr,{children:[t(qr,{downloads:o,subscription:d,selectedDate:c,selectedMonth:r,onClick:n,value:r,minDate:e,maxDate:a,changeMonth:s}),t(ti,{subscription:d,expires:b})]})]})}At.displayName="K2sUserStatistic";const ai={downloads:p.arrayOf(p.shape()).isRequired,subscription:p.string,expires:p.string,fetchUserStatistic:p.func.isRequired,fetchUserDownloadStatistic:p.func.isRequired,downloadStatisticIsFetching:p.bool},si={downloadStatisticIsFetching:!1,subscription:te.free,expires:void 0};
2class Se extends Be.Component{constructor(a){super(a),this.state={date:new Date,minDate:ut(pt(new Date,{months:-4})),maxDate:Qa(),serverTime:Xa(),selectedMonth:new Date},this.changeMonth=this.changeMonth.bind(this),this.onChange=this.onChange.bind(this)}componentDidMount(){this.props.fetchUserStatistic(),this.changeMonth(this.state.date)}onChange(a){this.setState({date:a})}changeMonth(a){this.setState({selectedMonth:a});const s=Fe(ut(a));this.props.fetchUserDownloadStatistic({dateFrom:s,dateTo:Fe(pt(s,{months:1}))})}render(){return i.jsx(At,{changeMonth:this.changeMonth,downloads:this.props.downloads,selectedDate:this.state.date,minDate:this.state.minDate,maxDate:this.state.maxDate,onChange:this.onChange,serverTime:this.state.serverTime,downloadStatisticIsFetching:this.props.downloadStatisticIsFetching,selectedMonth:this.state.selectedMonth,subscription:this.props.subscription,expires:this.props.expires})}}const ri=e=>({downloads:e.user.downloads,subscription:e.user.subscription,downloadStatisticIsFetching:e.user.downloadStatisticIsFetching,expires:e.user.expires}),ii=e=>({fetchUserStatistic:a=>e(Lt()),fetchUserDownloadStatistic:a=>e(Aa(a))});
2Se.propTypes=ai;Se.defaultProps=si;Se.displayName="UserStatistic";var oi=Q(ri,ii)(Se);const ni={password:e=>Ja(e),email:e=>typeof e=="string"&&e.length>0&&Me(e),required:e=>e!=null&&e!=="",truly:e=>!!e};function ci(e){const[a,s]=l.useState({});function o(){const n={};let c=!0;return e.forEach(({field:r,rule:d,errorMessage:b,value:m})=>{let g;if(typeof d=="function")g=d(m);else{const T=ni[d];g=T(m)}g?n[r]=null:(c=!1,n[r]=b)}),s(n),{isValid:c,errors:n}}return{validate:o,errors:a}}const _t=l.createContext(null),li=()=>{const e=l.useContext(_t);if(!e)throw new Error("useChangeEmailContext must be used within a ChangeEmailProvider");return e},di=x("form",{target:"e1hxl1ey4"})({name:"fbfwam",styles:"display:flex;padding:var(--spacing-32, 32px) var(--spacing-48, 48px)!important;flex-direction:column;justify-content:center;align-items:center;border-radius:var(--radius-8, 8px);border:1px solid var(--stroke-neutral-100, #D9DFDF);background:var(--surface-neutral-0, #FFF);max-width:448px;margin:24px auto 0!important"}),ui=x(M,{target:"e1hxl1ey3"})({name:"eezq2y",styles:"padding-bottom:var(--spacing-32, 32px)"}),Ut=x("div",{target:"e1hxl1ey2"})({name:"u9mni6",styles:"display:flex;width:100%;flex-direction:column;align-items:stretch"}),pi=x(Ut,{target:"e1hxl1ey1"})({name:"12z4t68",styles:"padding-bottom:var(--spacing-8, 8px);gap:var(--spacing-16, 16px)"}),fi=x(Ut,{target:"e1hxl1ey0"})({name:"1h4ctwh",styles:"gap:var(--spacing-8, 8px);padding-top:var(--spacing-8, 8px)"});function hi(){const{email:e,setEmail:a,password:s,setPassword:o,onSubmit:n,formErrors:c}=li(),{t:r}=D();return h(di,{onSubmit:n,children:[t(ui,{type:"headerBold",children:r("profile.changeEmail")}),h(pi,{children:[t(ct,{placeholder:r("profile.newEmail"),label:r("profile.newEmail"),value:e,onChange:d=>{a(d.target.value)},error:c.email}),t(ct,{placeholder:r("profile.currentPassword"),label:r("profile.password"),type:"password",value:s,onChange:d=>{o(d.target.value)},error:c.password})]}),t(re,{size:"invisible"}),h(fi,{children:[t(V,{type:"submit",label:r("profile.submit")}),t(Y,{to:"/profile",children:t(V,{variant:"secondary",label:r("profile.cancel")})})]})]})}function mi(){const{sendChangeEmailLetterInProgress:e,sendChangeEmailLetterSuccess:a,sendChangeEmailLetterError:s}=Ae(S=>S.user),{t:o}=_a(),[n,c]=l.useState(""),[r,d]=l.useState(""),b=[{field:"email",rule:"email",errorMessage:o("formErrors.email.notValid"),value:n},{field:"password",rule:"password",errorMessage:Za(),value:r}],m=Ct(),{validate:g,errors:T}=ci(b),{type:E,value:v,execute:w,reset:L}=U();function I(S){S.preventDefault();const{isValid:P}=g();P&&w()}return l.useEffect(()=>{v&&m(Nt({password:r,email:n,captchaValue:v,captchaType:E,backUrl:`${window.location.origin}/change-email`}))},[v]),l.useEffect(()=>{a&&(m(H({id:"change-email",text:()=>t("span",{children:"To change the email, use the instructions sent to you by old email"})})),L())},[a]),l.useEffect(()=>{s&&(m(H({type:It,id:"change-email-error",text:()=>t("span",{children:s})})),L())},[s]),t(_t.Provider,{value:{email:n,password:r,setPassword:d,setEmail:c,loading:e,error:s,onSubmit:I,formErrors:T},children:t(hi,{})})}const gi=ge()(mi);function $t(e){return t(Be.Fragment,{children:h($a,{children:[t(O,{exact:!0,path:e.match.url,component:Hs}),t(O,{exact:!0,path:`${e.match.url}/verifyEmail`,component:Ls,excludedProjects:["pp"]}),t(O,{exact:!0,path:`${e.match.url}/verify-from-mail`,component:Ys}),t(O,{exact:!0,path:`${e.match.url}/change-password`,component:nr,excludedProjects:["pp"]}),t(O,{exact:!0,path:`${e.match.url}/statistic(.html)?`,component:oi}),t(O,{exact:!0,path:`${e.match.url}/change-email`,component:gi}),t(O,{path:"*",component:Ua})]})})}$t.propTypes={match:p.shape({url:p.string}).isRequired};$t.displayName="Profile";export{$t as default}; 3//# sourceMappingURL=/sourcemaps/page-Profile-B1PotjOL.js.map
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.