PageSourceSearch

https://okian.ai/_next/static/chunks/6496.4736079d3d2ddfb0.js

js okian.ai collected 2026-10-05 12:21:12 UTC 31,939 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e29cd948-d8d4-4e17-9b86-211928f62724",e._sentryDebugIdIdentifier="sentry-dbid-e29cd948-d8d4-4e17-9b86-211928f62724")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6496],{20924:(e,t,r)=>{r.d(t,{Wk:()=>n,ld:()=>a});let a="اُکیان",n=e=>"kalame.chat"===e},25607:(e,t,r)=>{r.d(t,{JW:()=>i,Po:()=>s,kg:()=>l});let a=/^\d{11}$/,n=/^09[0-9]{9}$/,s="شماره موبایل باید ۱۱ رقم و فقط عدد باشد.",o="شماره موبایل به درستی وارد نشده است.";function l(e){return a.test(e)?n.test(e)?null:o:s}function i(e){return 0===e.length?null:"0"!==e[0]||e.length>=2&&"9"!==e[1]?o:e.length>=11?l(e):null}},76496:(e,t,r)=>{r.r(t),r.d(t,{default:()=>ey});var a=r(95155),n=r(12115),s=r(33210),o=r(21628),l=r(18310),i=r(39449),d=r(81898),c=r(78919),u=r(18424),p=r(97693),h=r(9651),m=r(43426),f=r(54415),x=r(2375),b=r(37048),g=r(98500),y=r.n(g),v=r(66088),w=r(6296),j=r(37550);function N(e){let{phone:t,onPhoneChange:r,onPhoneBlur:o,referralCode:l,onReferralCodeChange:i,referralError:d,onSubmit:c,validationError:u,isSubmitDisabled:p,isLoading:h}=e,[m,f]=(0,n.useState)(!!(l||d)),x=(0,n.useRef)(!1),b=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(d){var e;f(!0),null==(e=b.current)||e.focus();return}!x.current&&l&&f(!0)},[l,d]),(0,a.jsxs)("form",{onSubmit:c,className:"space-y-6","data-sentry-component":"PhoneStep","data-sentry-source-file":"PhoneStep.tsx",children:[(0,a.jsx)("p",{className:"text-center text-sm text-secondary",children:"لطفا شماره موبایل خود را وارد کنید"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("input",{type:"tel",inputMode:"numeric",autoComplete:"tel-national",maxLength:11,dir:"rtl",value:t,onChange:e=>r((0,j.l)(e.target.value).replace(/\D/g,"")),placeholder:"شماره موبایل",className:"w-full rounded-lg border bg-primary px-4 py-3 text-right text-base font-normal text-foreground outline-none transition-colors placeholder:text-placeholder touch-manipulation ".concat(u?"border-2 border-error focus:border-error":"border-2 border-border focus:border-brand"),"aria-invalid":!!u,onBlur:o,"aria-describedby":u?"phone-validation-error":void 0}),u?(0,a.jsx)("p",{id:"phone-validation-error",className:"mt-1.5 text-right text-sm text-error-primary",children:u}):null,(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>f(e=>{let t=!e;return x.current=!t,t}),"aria-expanded":m,"aria-controls":"referral-code-field",className:"inline-flex items-center gap-1 text-sm text-quaternary transition-colors hover:text-tertiary",children:[(0,a.jsx)("span",{children:"کد دعوت (اختیاری)"}),(0,a.jsx)(v.A,{className:"size-4 transition-transform ".concat(m?"rotate-180":""),"aria-hidden":"true","data-sentry-element":"ChevronDown","data-sentry-source-file":"PhoneStep.tsx"})]}),m?(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{ref:b,id:"referral-code-field",type:"text",inputMode:"text",autoComplete:"off",autoCapitalize:"characters",spellCheck:!1,dir:"rtl",value:l,onChange:e=>i(e.target.value),placeholder:"کد دعوت  خود را وارد کنید",className:"w-full rounded-lg border bg-primary py-2.5 text-right text-sm font-normal text-foreground outline-none transition-colors placeholder:text-placeholder ".concat(l?"pe-10 ps-4":"px-4"," ").concat(d?"border-2 border-error focus:border-error":"border-2 border-border focus:border-brand"),"aria-invalid":!!d,"aria-describedby":d?"referral-code-error":void 0}),l?(0,a.jsx)("button",{type:"button",onClick:()=>i(""),className:"absolute inset-y-0 left-3 my-auto text-muted-foreground transition-colors hover:text-foreground","aria-label":"پاک کردن کد دعوت",children:(0,a.jsx)(s.A,{className:"size-4","aria-hidden":"true"})}):null]}),d?(0,a.jsx)("p",{id:"referral-code-error",className:"mt-1.5 text-right text-sm text-error-primary",children:d}):null]}):null]})]}),(0,a.jsx)("button",{type:"submit",disabled:p,className:"flex w-full items-center justify-center rounded-lg bg-brand-solid py-2.5 text-base font-bold text-white transition-colors disabled:cursor-pointer disabled:opacity-100",children:h?(0,a.jsx)(w.A,{className:"size-5 animate-spin"}):"ورود به اُکیان"}),(0,a.jsxs)("p",{className:"text-center text-xs text-tertiary",children:["با ورود یا ثبت‌نام در اُکیان،"," ",(0,a.jsx)(y(),{href:"/terms",className:"text-brand-secondary","data-sentry-element":"Link","data-sentry-source-file":"PhoneStep.tsx",children:"قوانین و شرایط استفاده"})," ","را می‌پذیرید."]})]})}var C=r(78340);let k=(0,C.A)("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),S=(0,C.A)("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);
1var A=r(15411),E=r(7915),D=r(12073),T=r(21711),L=r(25607),P=r(9905);function z(e){let{phone:t,code:r,onCodeChange:s,onSubmit:o,onResend:l,onSwitchToPassword:i,validationError:d,isSubmitDisabled:c,isSubmitting:u,isResending:p,resendLabel:h,canUsePassword:m}=e,f=(0,n.useRef)(0);return(0,n.useEffect)(()=>{let e=(0,P.sH)(r),t=f.current<P.L0;f.current=e.length,t&&(0,P.tJ)(e)&&!d&&!u&&!p&&o()},[r,u,p,o,d]),(0,a.jsxs)("form",{onSubmit:o,className:"space-y-6","data-sentry-component":"OtpStep","data-sentry-source-file":"AuthSteps.tsx",children:[(0,a.jsxs)("p",{className:"text-center text-sm text-secondary",children:["کد ارسال شده به شماره"," ",(0,a.jsx)("span",{className:"text-brand-secondary",dir:"ltr",children:(0,T.FI)(t)})," ","رو وارد کنید"]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(D.I,{value:r,onChange:s,disabled:u||p,hasError:!!d,focusKey:t,"data-sentry-element":"OtpInput","data-sentry-source-file":"AuthSteps.tsx"}),d?(0,a.jsx)("p",{className:"mt-1.5 text-right text-sm text-error-primary",children:d}):null]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("button",{type:"submit",disabled:c,className:"flex flex-1 items-center justify-center rounded-md bg-brand-solid px-4 py-2.5 text-base font-bold text-white transition-colors",children:u?(0,a.jsx)(w.A,{className:"size-5 animate-spin"}):"تایید"}),(0,a.jsx)("button",{type:"button",onClick:l,disabled:!!h||u||p,className:"flex flex-1 items-center justify-center rounded-md border border-border bg-background px-4 py-2.5 text-sm font-semibold text-secondary transition-colors disabled:cursor-pointer disabled:opacity-100",children:p?(0,a.jsx)(w.A,{className:"size-5 animate-spin"}):h||"ارسال مجدد کد"})]}),m?(0,a.jsxs)("button",{type:"button",onClick:i,className:"mx-auto flex items-center gap-2 text-sm transition-colors text-tertiary hover:text-foreground",children:[(0,a.jsx)(k,{className:"size-4 text-[var(--fg-quaternary)]"}),(0,a.jsx)("span",{children:"ورود با رمز"})]}):null]})}function R(e){let{phone:t,password:r,onPhoneChange:n,onPhoneBlur:s,onPasswordChange:o,onSubmit:l,onSwitchToOtp:i,validationError:d,isSubmitDisabled:c,isSubmitting:u}=e,p=(0,L.JW)(t),h=d&&!p?d:"";return(0,a.jsxs)("form",{onSubmit:l,className:"space-y-6","data-sentry-component":"PasswordStep","data-sentry-source-file":"AuthSteps.tsx",children:[(0,a.jsx)("p",{className:"text-center text-sm text-secondary",children:"رمز عبور خود را وارد کنید"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("input",{type:"tel",inputMode:"numeric",autoComplete:"tel-national",maxLength:11,dir:"rtl",value:t,onChange:e=>n((0,j.l)(e.target.value).replace(/\D/g,"")),onBlur:s,placeholder:"شماره موبایل",className:"w-full rounded-lg border bg-primary px-4 py-3 text-right text-base font-normal text-foreground outline-none transition-colors placeholder:text-placeholder touch-manipulation ".concat(p?"border-2 border-error focus:border-error":"border-2 border-border focus:border-brand"),"aria-invalid":!!p,"aria-describedby":p?"password-step-phone-error":void 0}),p?(0,a.jsx)("p",{id:"password-step-phone-error",className:"mt-1.5 text-right text-sm text-error-primary",children:p}):null]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(_,{value:r,onChange:o,hasError:!!h,"data-sentry-element":"PasswordField","data-sentry-source-file":"AuthSteps.tsx"}),h?(0,a.jsx)("p",{className:"mt-1.5 text-right text-sm text-error-primary",children:h}):null]}),(0,a.jsx)("button",{type:"submit",disabled:c,className:"flex w-full items-center justify-center rounded-lg bg-brand-solid py-2.5 text-base font-bold text-white transition-colors disabled:cursor-pointer disabled:opacity-100",children:u?(0,a.jsx)(w.A,{className:"size-5 animate-spin"}):"ورود به اُکیان"}),(0,a.jsxs)("button",{type:"button",onClick:i,className:"mx-auto flex items-center gap-2 text-sm text-secondary transition-colors hover:text-foreground",children:[(0,a.jsx)(S,{className:"size-4","data-sentry-element":"Smartphone","data-sentry-source-file":"AuthSteps.tsx"}),(0,a.jsx)("span",{children:"ورود با رمز یکبار مصرف"})]})]})}function _(e){let{value:t,onChange:r,hasError:s}
1=e,[o,l]=(0,n.useState)(!1);return(0,a.jsxs)("div",{className:"relative","data-sentry-component":"PasswordField","data-sentry-source-file":"AuthSteps.tsx",children:[(0,a.jsx)("input",{type:o?"text":"password",value:t,onChange:e=>r(e.target.value),placeholder:"رمز عبور",autoComplete:"current-password",className:"w-full rounded-lg border bg-primary px-4 py-3 pe-12 text-right text-base font-normal text-foreground outline-none transition-colors placeholder:text-placeholder touch-manipulation ".concat(s?"border-2 border-error focus:border-error":"border-2 border-border focus:border-brand")}),(0,a.jsx)("button",{type:"button",onClick:()=>l(e=>!e),className:"absolute inset-y-0 left-3 my-auto text-muted-foreground transition-colors hover:text-foreground","aria-label":o?"مخفی کردن رمز عبور":"نمایش رمز عبور",children:o?(0,a.jsx)(A.A,{className:"size-5","aria-hidden":"true"}):(0,a.jsx)(E.A,{className:"size-5","aria-hidden":"true"})})]})}var I=r(47650),U=r(73321),O=r(1945),M=r(65314),F=r(94458),W=r(54921),B=r(99251),J=r(93305);async function X(e){var t,r,a,n;let s=await (0,W.signIn)("credentials",{phone:e.phone,password:null!=(t=e.password)?t:"",accessToken:e.accessToken,refreshToken:null!=(r=e.refreshToken)?r:"",userId:e.userId,username:null!=(a=e.username)?a:"",expireAt:null!=e.expireAt?String(e.expireAt):"",userType:null!=(n=e.userType)?n:"free",credit:null!=e.credit?String(e.credit):"",redirect:!1});if(!(null==s?void 0:s.ok))return!1;let o=(0,B.MU)();if((0,B.QQ)(),O.default.dismiss(B.p7),!o)try{let e=(0,J.getQueryClient)();e.resumePausedMutations(),e.invalidateQueries({refetchType:"active"})}catch(e){}return!0}function Z(e){return!e||"object"!=typeof e||Array.isArray(e)?null:e}function H(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(let e of t)if("string"==typeof e&&e.length>0)return e}r(2901).o.baseApi;var Q=r(17372),V=r(45834),q=r(45912),G=r(62800),K=r(84354),$=r(30560),Y=r(9432);function ee(e){let t=(0,Y.mO)();return t?{...e,trackingData:t}:e}var et=r(44353);let er=new Set(["INVALID_CODE","SELF_REFERRAL_NOT_ALLOWED","ALREADY_REFERRED","NOT_NEW_USER"]);function ea(e){return"string"==typeof e.message&&e.message?e.message:"string"==typeof e.error&&e.error?e.error:""}let en={phone:"",verificationCode:"",password:"",referralCode:""};var es=r(5772);function eo(e){let{src:t,alt:r,priority:n=!1,eager:s=!1,loadState:o="loading",onLoad:l,onError:i}=e,d="loaded"===o,c="error"===o;return(0,a.jsxs)(a.Fragment,{children:[d||c?null:(0,a.jsx)("div",{className:"absolute inset-0 animate-pulse bg-gradient-to-br from-brand-solid/25 via-muted to-foreground/10","aria-hidden":!0}),c?(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-muted via-muted-foreground/15 to-muted","aria-hidden":!0}):(0,a.jsx)(es.default,{src:t,alt:r,fill:!0,unoptimized:!0,priority:n,loading:n||s?"eager":"lazy",sizes:"(min-width: 768px) 50vw, 0px",onLoad:l,onError:i,className:"object-cover transition-opacity duration-500 ".concat(d?"opacity-100":"opacity-0")})]})}function el(e){let{slides:t,onClose:r,closeDisabled:o=!1}=e,[l,i]=(0,n.useState)(0),[d,c]=(0,n.useState)({}),u=t.length,p=t[l],h=(0,n.useCallback)(e=>{0!==u&&i((e+u)%u)},[u]),m=(0,n.useCallback)((e,t)=>{c(r=>r[e]===t?r:{...r,[e]:t})},[]);return((0,n.useEffect)(()=>{c(e=>{let r={...e},a=!1;return t.forEach((e,t)=>{r[t]||(r[t]="loading",a=!0)}),a?r:e})},[t]),(0,n.useEffect)(()=>{if(u<=1)return;let e=d[l];if("loaded"!==e&&"error"!==e)return;let t=window.setTimeout(()=>{i(e=>{for(let t=1;t<=u;t+=1){let r=(e+t)%u,a=d[r];if("loaded"===a||"error"===a)return r}return e})},6e3);return()=>window.clearTimeout(t)},[u,l,d]),p)?(0,a.jsxs)("div",{className:"relative hidden min-h-[520px] overflow-hidden md:flex md:w-1/2 md:flex-col",dir:"rtl","data-sentry-component":"LoginCarousel","data-sentry-source-file":"LoginCarousel.tsx",children:[t.map((e,t)=>{var r;return(0,a.jsx)("div",{className:"absolute inset-0 transition-opacity duration-700 ".concat(t===l?"opacity-100":"pointer-events-none opacity-0"),"aria-hidden":t!==l,children:(0,a.jsx)(eo,{src:e.imagePath,alt:e.title,priority:0===t,eager:!0,loadState:null!=(r=d[t])?r:"loading",onLoad:()=>m(t,"loaded"),onError:()=>m(t,"error")})},e.id)}),(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/20 to-black/10"}),(0,a.jsx)("button",{type:"button",onClick:r,disabled:o,className:"absolute left-4 top-4 z-10 rounded-lg p-1.5 text-white/80 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-50","aria-label":"بستن",children:(0,a.jsx)(s.A,{className:"size-5","data-sentry-element":"X","data-sentry-source-file":"LoginCarousel.tsx"})}),(0,a.jsxs)("div",{className:"relative z-10 mt-auto flex flex-col gap-6 p-8 pb-6 text-white",children:[(0,a.jsxs)("div",{className:"space-y-2 text-right",dir:"rtl",children:[(0,a.jsx)("h3",{className:"text-2xl font-bold leading-tight",children:p.title}),(0,a.jsx)("p",{className:"text-sm leading-7 text-white/85",children:p.description})]}),u>1?(0,a.jsx)("div",{className:"flex w-full items-center gap-1.5",role:"tablist","aria-label":"اسلایدهای معرفی",children:t.map((e,t)=>(0,a.jsx)("button",{type:"button",role:"tab",onClick:()=>h(t),"aria-label":"اسلاید ".concat(t+1),"aria-selected":t===l,className:"relative h-0.5 flex-1 overflow-hidden bg-white/30",children:t===l?(0,a.jsx)("span",{"aria-hidden":!0,
1className:"absolute inset-y-0 right-0 w-full origin-right bg-white animate-carousel-progress",style:{animationDuration:"".concat(6e3,"ms")}},l):null},e.id))}):null]})]}):null}function ei(e){let{onClose:t,closeDisabled:r=!1}=e;return(0,a.jsxs)("div",{className:"relative hidden min-h-[520px] overflow-hidden bg-muted md:flex md:w-1/2 md:flex-col","aria-hidden":"true",dir:"rtl","data-sentry-component":"LoginCarouselSkeleton","data-sentry-source-file":"LoginCarouselSkeleton.tsx",children:[(0,a.jsx)("div",{className:"absolute inset-0 animate-pulse bg-gradient-to-br from-brand-solid/30 via-muted to-foreground/10"}),t?(0,a.jsx)("button",{type:"button",onClick:t,disabled:r,className:"absolute left-4 top-4 z-10 rounded-lg p-1.5 text-white/80 transition-colors hover:bg-white/10 hover:text-white disabled:cursor-not-allowed disabled:opacity-50","aria-label":"بستن",children:(0,a.jsx)(s.A,{className:"size-5"})}):null,(0,a.jsxs)("div",{className:"relative z-10 mt-auto space-y-6 p-8 pb-6",dir:"rtl",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("div",{className:"h-7 w-2/3 rounded-lg bg-white/20"}),(0,a.jsx)("div",{className:"h-4 w-full rounded-lg bg-white/15"}),(0,a.jsx)("div",{className:"h-4 w-4/5 rounded-lg bg-white/15"})]}),(0,a.jsxs)("div",{className:"flex w-full items-center gap-1.5",children:[(0,a.jsx)("div",{className:"relative h-0.5 flex-1 overflow-hidden bg-white/25",children:(0,a.jsx)("div",{className:"absolute inset-y-0 right-0 w-2/3 origin-right bg-white/50"})}),(0,a.jsx)("div",{className:"h-0.5 flex-1 bg-white/25"}),(0,a.jsx)("div",{className:"h-0.5 flex-1 bg-white/25"}),(0,a.jsx)("div",{className:"h-0.5 flex-1 bg-white/25"})]})]})]})}var ed=r(88254),ec=r(14946);async function eu(){let e=await fetch("/api/auth/page-slides",{method:"GET",credentials:"same-origin",cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok)throw Error("page-slides failed with status ".concat(e.status));return Array.isArray(null==t?void 0:t.data)?t.data:[]}var ep=r(10617),eh=r(66668),em=r(22673);let ef={duration:.28,ease:[.32,.72,0,1]},ex={type:"spring",damping:28,stiffness:340,mass:.85},eb={duration:.38,ease:[.32,.72,0,1]},eg={duration:.22,ease:[.32,.72,0,1]};function ey(){let e=(0,h.A)(e=>e.isOpen),t=(0,m.a8)(),r=(0,n.useRef)(null),g=(0,p.W)(),y=function(){let[e,t]=(0,n.useState)("phone"),[r,a]=(0,n.useState)(en),[s,o]=(0,n.useState)(""),[l,i]=(0,n.useState)(""),[d,c]=(0,n.useState)(!1),[u,p]=(0,n.useState)(!1),[m,f]=(0,n.useState)(!1),[x,b]=(0,n.useState)(null),g=(0,h.A)(e=>e.callbackUrl),y=(0,h.A)(e=>e.isOpen),v=(0,h.A)(e=>e.close),w=(0,U.useRouter)(),{trackLogin:N,trackSignUp:C}=(0,M.u)(),{isAnyMiniApp:k}=(0,et.V9)(),S=(0,n.useRef)(!1),A=(0,n.useRef)(!1),E=(0,n.useRef)(null),D=(0,n.useRef)(r.phone);D.current=r.phone;let T=d||u,z=(0,n.useCallback)(()=>{D.current&&(0,K.ZX)(D.current)},[]),{timeLeft:R}=(0,G.MB)({enabled:"otp"===e,expiresAt:x,onExpire:z}),_=(0,n.useCallback)(e=>e.expiresAt<=Date.now()?((0,K.ZX)(e.phone),!1):(D.current=e.phone,o(""),t("password"===e.mode?"password":"otp"),f(e.isExistingUser),b(e.expiresAt),a(t=>({...t,phone:e.phone,verificationCode:"",password:""})),!0),[]);(0,n.useEffect)(()=>{let e=(0,K.iW)();e&&_(e)},[_]),(0,n.useEffect)(()=>{(0,Y.Cb)({url:window.location.href,referrer:document.referrer||""})},[]),(0,n.useEffect)(()=>{if(!y)return;i("");let e=(0,V.Lr)(window.location.pathname),t=(0,V.wb)((0,q.C)()),r=e||((0,V.yF)(t)?t:"");a(e=>e.referralCode===r?e:{...e,referralCode:r})},[y]);let W=(0,n.useCallback)(()=>{t("phone"),a(en),o(""),i(""),c(!1),p(!1),f(!1),b(null),S.current=!1,A.current=!1,E.current=null},[]),B=(0,n.useCallback)(async e=>{(0,$.gv)();let t=e?O.default.success(e):void 0;(0,K.ZX)(r.phone),(0,Y.HM)(),v(),W(),setTimeout(()=>{t&&O.default.dismiss(t),g&&w.push(g)},800)},[g,v,r.phone,W,w]),J=(0,n.useCallback)(async e=>{var t;let r=function(e){let t=Z(e);if(!t)return null;let r=Z(t.data),a=H(t.accessToken,t.access_token,null==r?void 0:r.accessToken,null==r?void 0:r.access_token);if(!a)return null;let n=H(t.refreshToken,t.refresh_token,null==r?void 0:r.refreshToken,null==r?void 0:r.refresh_token),s=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(let e of t){let t=Z(e);if(t&&(null!=t.ID||null!=t.id||"string"==typeof t.username||null!=t.expireAt||"string"==typeof t.user_type||null!=t.credit))return t}}(t.needUserData,t.user,null==r?void 0:r.needUserData,null==r?void 0:r.user),o="boolean"==typeof t.isNewUser?t.isNewUser:"boolean"==typeof(null==r?void 0:r.isNewUser)?r.isNewUser:void 0,l=H(t.message,null==r?void 0:r.message);return{accessToken:a,...n?{refreshToken:n}:{},...s?{needUserData:s}:{},...void 0!==o?{isNewUser:o}:{},...l?{message:l}:{}}}(e.data),a=null!=r?r:e.data,n=function(e){var t,r,a,n;let s=e.needUserData,o=null!=(t=null==s?void 0:s.ID)?t:null==s?void 0:s.id;if(null!=o&&String(o).length>0)return String(o);try{let t=e.accessToken.split(".")[1];if(!t)return null;let s=JSON.parse(atob(t.replace(/-/g,"+").replace(/_/g,"/"))),o=null!=(n=null!=(a=null!=(r=s.sub)?r:s.id)?a:s.userId)?n:s.user_id;return null!=o?String(o):null}catch(e){return null}}(a);if(!a.accessToken||!n)return o("خطا در دریافت اطلاعات کاربر."),!1;if(!a.refreshToken)return o("خطا در دریافت توکن تازه‌سازی."),!1;let s=a.needUserData,l=null!=(t=e.isNewUser)?t:null==r?void 0:r.isNewUser;
1return((0,Q.ct)(l),await X({phone:e.phone,password:e.password,accessToken:a.accessToken,refreshToken:a.refreshToken,userId:n,username:null==s?void 0:s.username,expireAt:null==s?void 0:s.expireAt,userType:null==s?void 0:s.user_type,credit:null==s?void 0:s.credit}))?(e.referralAttachedToLogin&&(0,q.z5)(),l?(C(n),e.referralAttachedToLogin||(0,Q.ah)()):N(n),await B(k?void 0:l?"ثبت‌نام و ورود با موفقیت انجام شد.":"شما با موفقیت وارد شدید."),e.referralAttachedToLogin&&!1!==l&&O.default.success("کد دعوت اعمال شد."),!0):(o("ورود با خطا مواجه شد."),!1)},[B,k,N,C]),es=(0,n.useCallback)(async(e,r)=>{let n=(null==r?void 0:r.resend)?p:c,s=()=>{n(!0),o(""),(null==r?void 0:r.showOtpStepImmediately)&&(t("otp"),b(null))};(null==r?void 0:r.showOtpStepImmediately)?(0,I.flushSync)(s):s();try{var l;let r=!!(null==(l=(await F.FH.post("/api/auth/send-verification-code",ee({mobile:e}))).data)?void 0:l.IsExistUser),n=(0,G.D0)();f(r),t("otp"),b(n),a(t=>({...t,phone:e,verificationCode:""})),(0,K.uo)({phone:e,mode:"otp",isExistingUser:r,expiresAt:n}),D.current=e}catch(e){e instanceof F.hD&&o(String(e.message))}finally{n(!1)}},[]),eo=(0,n.useCallback)(e=>{A.current=!0,a(t=>({...t,referralCode:e})),i("")},[]),el=(0,n.useCallback)(e=>{var t;a(t=>({...t,phone:e})),o(null!=(t=(0,L.JW)(e))?t:"")},[]),ei=(0,n.useCallback)(()=>{var e;let t=r.phone;if(!t)return;let a=(0,L.JW)(t);return a?void o(a):t.length<11?void o(L.Po):void o(null!=(e=(0,L.kg)(t))?e:"")},[r.phone]),ed=(0,n.useCallback)(e=>{a(t=>({...t,verificationCode:e})),o("")},[]),ec=(0,n.useCallback)(async e=>{null==e||e.preventDefault();let t=(0,j.l)(r.phone).replace(/\D/g,""),a=(0,L.kg)(t);if(o(null!=a?a:""),a)return;let n=r.referralCode.trim();if(n){c(!0);try{let e=await (0,Q.XE)(n);if(!e.ok)return void i(e.message);i(""),(0,q.Zf)(e.code)}catch(e){i("لطفاً بعداً تلاش کنید.");return}finally{c(!1)}}else A.current&&((0,q.z5)(),i(""));let s=(0,K.jj)(t);s&&_(s)||await es(t)},[r.phone,r.referralCode,es,_]),eu=(0,n.useCallback)(async e=>{if(null==e||e.preventDefault(),S.current)return;let a=(0,P.sH)(r.verificationCode);if(!(0,P.tJ)(a))return void o("کد وارد شده نامعتبر است.");S.current=!0,c(!0),o("");try{let e=r.referralCode.trim(),t=!m&&e?e:void 0,n=await F.FH.post("/api/auth/login-or-register",ee({mobile:r.phone,code:a,platform:"web",...t?{referralCode:t}:{}}));await J({phone:r.phone,data:n,isNewUser:n.isNewUser,referralAttachedToLogin:!!t})}catch(e){if(e instanceof F.hD){let r=function(e){let t=e.data,r=t&&"object"==typeof t&&!Array.isArray(t)?t:null,a=(null==r?void 0:r.data)&&"object"==typeof r.data&&!Array.isArray(r.data)?r.data:null,n="string"==typeof(null==r?void 0:r.code)&&r.code||"string"==typeof(null==a?void 0:a.code)&&a.code||"",s=r&&ea(r)||a&&ea(a)||e.message;return er.has(n)||s.includes("کد دعوت")?s:null}(e);if(r){i(r),o(""),t("phone");return}o(String(e.message))}}finally{c(!1),S.current=!1}},[J,r.phone,r.referralCode,r.verificationCode,m]),ep=(0,n.useCallback)(async e=>{if(null==e||e.preventDefault(),!r.phone||!r.password)return void o("رمز عبور یا شماره اشتباه است.");c(!0),o("");try{let e=await F.FH.post("/api/auth/login",ee({phone:r.phone,password:r.password,platform:"web"}));if(e.message&&!e.accessToken)return void o(e.message);await J({phone:r.phone,password:r.password,data:e,isNewUser:!1})}catch(e){e instanceof F.hD&&o("رمز عبور یا شماره اشتباه است.")}finally{c(!1)}},[J,r.password,r.phone]),eh=(0,n.useCallback)(async()=>{R>0||!r.phone||u||await es(r.phone,{resend:!0})},[r.phone,es,u,R]),em=(0,n.useCallback)(()=>{o(""),t("phone"),a(e=>({...e,verificationCode:"",password:""}))},[]),ef=(0,n.useCallback)(()=>{m&&(o(""),t("password"),a(e=>({...e,password:"",verificationCode:""})),E.current=r.phone,(0,K.uo)({phone:r.phone,mode:"password",isExistingUser:m,expiresAt:null!=x?x:void 0}))},[r.phone,m,x]),ex=(0,n.useCallback)(async()=>{let e=r.phone,n=(0,L.kg)(e);if(n)return void o(n);let s=E.current,l=null!==s&&e!==s;if(o(""),a(e=>({...e,password:"",verificationCode:""})),l){s&&(0,K.ZX)(s),E.current=e,await es(e,{resend:!0,showOtpStepImmediately:!0});return}t("otp"),E.current=e;let i=(0,K.jj)(e);if(i&&i.expiresAt>Date.now()){b(i.expiresAt),(0,K.uo)({phone:e,mode:"otp",isExistingUser:m,expiresAt:i.expiresAt});return}b(null),(0,K.ZX)(e)},[r.phone,es,m]),eb=(0,n.useCallback)(()=>{T||(v(),W())},[v,T,W]),eg=T||11!==r.phone.length||!!(0,L.kg)(r.phone)||!!l,ey=d||u||!(0,P.tJ)(r.verificationCode)||!!s,ev=d||!r.password.trim()||11!==r.phone.length||!!(0,L.kg)(r.phone)||!!(0,L.JW)(r.phone);return{step:e,formData:r,setFormData:a,validationError:s,referralError:l,isLoading:T,isSubmitting:d,isResending:u,isExistingUser:m,isPhoneSubmitDisabled:eg,isOtpSubmitDisabled:ey,isPasswordSubmitDisabled:ev,resendLabel:(0,n.useMemo)(()=>
1{if(R<=0)return null;let e=Math.floor(R/60),t=R%60;return"".concat(String(e).padStart(2,"0"),":").concat(String(t).padStart(2,"0"))},[R]),handleClose:eb,handlePhoneChange:el,handlePhoneBlur:ei,handleReferralCodeChange:eo,handleOtpCodeChange:ed,handlePhoneSubmit:ec,handleOtpSubmit:eu,handlePasswordSubmit:ep,handleResendCode:eh,handleEditPhone:em,switchToPassword:ef,switchToOtp:ex,resetFlow:W}}(),{handleClose:v,isLoading:w}=y,C=(0,x.al)(),k=(0,l.I)(),S=(0,b.C)(e&&C),[A,E]=(0,n.useState)(!1),{data:D=[],isPending:T,isError:_}=(0,ed._)(ec.l.auth.pageSlides(),eu,{enabled:e,staleTime:3e5,networkMode:"always"}),W=D.length>0,B=!W&&(T||_),J=W||B;if((0,n.useEffect)(()=>{E(!0)},[]),(0,n.useEffect)(()=>{if(!e){r.current=null;return}if(null===r.current){r.current=t;return}if(t!==r.current){if(w)return;if((0,f.fC)((0,f.RV)(r.current),f.fp.invite)&&(0,f.Mp)(t)){r.current=t;return}v(),r.current=null}},[e,t,v,w]),!A)return null;let es=k?{opacity:0}:C?{y:"100%",opacity:.92}:{opacity:0,scale:.9,y:28},eo=k?{opacity:0}:C?{y:"100%",opacity:.92}:{opacity:0,scale:.96,y:18},ey=k?{duration:.15}:C?eb:ex;return(0,a.jsx)(i.N,{"data-sentry-element":"AnimatePresence","data-sentry-component":"LoginModal","data-sentry-source-file":"LoginModal.tsx",children:e?(0,a.jsx)(c.A,{forwardProps:!0,enabled:!0,removeScrollBar:!1,noRelative:!0,children:(0,a.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-end md:items-center md:justify-center",children:[(0,a.jsx)(d.P.div,{"aria-hidden":"true",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:ef,className:"absolute inset-0",children:(0,a.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-[2px] [transform:translateZ(0)]"})}),(0,a.jsxs)(d.P.div,{role:"dialog","aria-modal":"true","aria-labelledby":"login-modal-title",initial:es,animate:k?{opacity:1}:{y:0,opacity:1,scale:1},exit:eo,transition:ey,transformTemplate:em.M,style:C&&S>0?{marginBottom:S}:void 0,className:"relative z-[101] flex w-full max-w-none flex-col overflow-hidden rounded-t-3xl bg-background shadow-2xl md:max-h-[90vh] md:flex-row md:rounded-3xl max-h-[90dvh] ".concat(J?"md:max-w-4xl":"md:max-w-md"),dir:"ltr",onClick:e=>e.stopPropagation(),children:[B?(0,a.jsx)(ei,{onClose:y.handleClose,closeDisabled:y.isLoading}):null,W?(0,a.jsx)(el,{slides:D,onClose:y.handleClose,closeDisabled:y.isLoading}):null,(0,a.jsxs)("div",{className:"relative flex w-full min-h-0 flex-col overflow-y-auto overscroll-contain px-6 pb-8 pt-5 md:rounded-e-3xl md:px-16 ".concat(J?"md:w-1/2 justify-center":""),dir:"rtl",children:[J?(0,a.jsx)("button",{type:"button",onClick:y.handleClose,disabled:y.isLoading,className:"absolute left-4 top-4 roun
1ded-lg p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50 md:hidden","aria-label":"بستن",children:(0,a.jsx)(s.A,{className:"size-5"})}):(0,a.jsx)("button",{type:"button",onClick:y.handleClose,disabled:y.isLoading,className:"absolute left-4 top-4 rounded-lg p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50 md:left-4","aria-label":"بستن",children:(0,a.jsx)(s.A,{className:"size-5"})}),"otp"===y.step?(0,a.jsxs)("button",{type:"button",onClick:y.handleEditPhone,disabled:y.isLoading,className:"absolute right-4 top-4 flex items-center gap-1 text-sm text-tertiary transition-colors disabled:cursor-pointer disabled:opacity-100",children:[(0,a.jsx)(o.A,{className:"size-4 text-[var(--fg-quaternary)]","aria-hidden":"true"}),(0,a.jsx)("span",{children:"ویرایش شماره"})]}):null,(0,a.jsxs)(d.P.div,{initial:!k&&{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.08,...eg},className:"mb-3 flex flex-col items-center gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)(u.A,{className:"w-10"}),(0,a.jsx)(eh.A,{className:"w-20"})]}),(0,a.jsx)("div",{className:"space-y-1 text-center",children:(0,a.jsxs)("h2",{id:"login-modal-title",className:"text-xl font-semibold text-foreground",children:["پلتفرم هوش مصنوعی ",g.brandName]})})]}),(0,a.jsxs)(ep.y,{step:y.step,reduceMotion:k,children:["phone"===y.step?(0,a.jsx)(N,{phone:y.formData.phone,onPhoneChange:y.handlePhoneChange,onPhoneBlur:y.handlePhoneBlur,referralCode:y.formData.referralCode,onReferralCodeChange:y.handleReferralCodeChange,referralError:y.referralError,onSubmit:y.handlePhoneSubmit,validationError:y.validationError,isSubmitDisabled:y.isPhoneSubmitDisabled,isLoading:y.isLoading}):null,"otp"===y.step?(0,a.jsx)(z,{phone:y.formData.phone,code:y.formData.verificationCode,onCodeChange:y.handleOtpCodeChange,onSubmit:y.handleOtpSubmit,onResend:y.handleResendCode,onSwitchToPassword:y.switchToPassword,validationError:y.validationError,isSubmitDisabled:y.isOtpSubmitDisabled,isSubmitting:y.isSubmitting,isResending:y.isResending,resendLabel:y.resendLabel,canUsePassword:y.isExistingUser}):null,"password"===y.step?(0,a.jsx)(R,{phone:y.formData.phone,password:y.formData.password,onPhoneChange:y.handlePhoneChange,onPhoneBlur:y.handlePhoneBlur,onPasswordChange:e=>y.setFormData(t=>({...t,password:e})),onSubmit:y.handlePasswordSubmit,onSwitchToOtp:y.switchToOtp,validationError:y.validationError,isSubmitDisabled:y.isPasswordSubmitDisabled,isSubmitting:y.isSubmitting}):null]})]})]})]})},"login-modal"):null})}},97693:(e,t,r)=>{r.d(t,{W:()=>n});var a=r(20924);function n(){var e;return e=window.location.hostname.replace(/^www\./,""),(0,a.Wk)(e)?{brandName:"کلمه",logo:"/kalame-logo.png",favicon:"/favicon.ico",sidebarLogo:"/okian-sidebar-logo.svg",appleTouchIcon:"/kalame-logo.png",siteName:"هوش مصنوعی کلمه",description:"با هوش مصنوعی کلمه به صورت رایگان با قوی‌ترین مدل (ChatGPT) به فارسی چت کنید، عکس تولید کنید و از یک دستیار هوشمند فارسی‌زبان بهره ببرید و هر روز اعتبار رایگان دریافت کنید!",title:"هوش مصنوعی کلمه: چت جی پی تی ۵ رایگان، ChatGPT-5 فارسی و دستیار هوش مصنوعی ایرانی",shortName:"کلمه"}:{brandName:"اُکیان",logo:"/okian-logo.svg",favicon:"/okian-favicon.ico",sidebarLogo:"/okian-logo.svg",appleTouchIcon:"/okian-logo.svg",siteName:"اُکیان هوش مصنوعی",description:"با اُکیان هوش مصنوعی قدرت هوش مصنوعی پیشرفته را تجربه کنید. با مدل‌های پیشرفته چت کنید، تصاویر تولید کنید و از دستیار هوشمند بهره ببرید.",title:"اُکیان | چت فارسی با هوش مصنوعی، ساخت تصویر و تولید محتوا",shortName:"اُکیان"}}}}]);

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.