"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4897],{94897:(e,s,t)=>{t.d(s,{A:()=>A});var l=t(95155),r=t(12115),a=t(65229),n=t(27937),i=t(37397),o=t(8198),d=t(17181),x=t(5917),c=t(75426),m=t(20908),h=t(48314),b=t(51834),p=t(3998),u=t(62381),f=t(6490),g=t(90296),j=t(27519),w=t(26154),v=t(52987);function N(e){let{isOpen:s,onClose:t,onSelect:a,loading:n}=e,[i,o]=(0,r.useState)(null);if(!s)return null;let d=i?f.R6.find(e=>e.id===i):null,x=i?(0,f.wc)(i):[];return(0,l.jsx)("div",{className:"fixed inset-0 z-[100] flex items-end sm:items-center justify-center transition-all duration-500 ease-out animate-in fade-in-0 p-0 sm:p-4 dir-rtl text-right",children:(0,l.jsxs)("div",{className:"w-full max-w-3xl bg-slate-900/70 backdrop-blur-xl border border-slate-700/60 rounded-t-3xl sm:rounded-3xl p-4 sm:p-6 pb-[calc(5.5rem+env(safe-area-inset-bottom,0px))] sm:pb-6 shadow-2xl text-white max-h-[85vh] sm:max-h-[90vh] overflow-y-auto no-scrollbar [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden transition-all duration-500 ease-out animate-in slide-in-from-bottom-full sm:slide-in-from-bottom-8 sm:zoom-in-95",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between border-b border-slate-800 pb-3 sm:pb-4 mb-4 sm:mb-5",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3",children:[i&&(0,l.jsx)("button",{onClick:()=>o(null),"aria-label":"بازگشت به انتخاب دسته",className:"p-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-amber-400 transition-all flex items-center justify-center shrink-0",children:(0,l.jsx)(v.A,{className:"w-5 h-5"})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-base sm:text-xl font-bold text-amber-400",children:i?"کدوم یکی دقیقاً خودِ تویی؟ ".concat(null==d?void 0:d.icon):"فکر می‌کنی چه آرکی‌تایپ و سبک بازی‌ای داری؟ \uD83D\uDD2E"}),(0,l.jsx)("p",{className:"text-[11px] sm:text-xs text-white mt-0.5",children:i?"از بین کاراکترهای ".concat(null==d?void 0:d.title,"، اونی که بیشتر شبیهته رو انتخاب کن!"):"دسته اصلی سبک بازی خودت رو انتخاب کن تا کاراکترت رو پیدا کنیم!"})]})]}),(0,l.jsx)("button",{onClick:()=>{o(null),t()},className:"p-2 rounded-full bg-slate-800 hover:bg-slate-700 text-slate-400 hover:text-white transition-colors shrink-0",children:"✕"})]}),i?(0,l.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:x.map(e=>(0,l.jsxs)("div",{onClick:()=>!n&&a(e.id),className:"group relative p-3 sm:p-3.5 rounded-2xl border border-slate-700/70 bg-slate-800/80 hover:bg-slate-800 hover:border-amber-500/60 cursor-pointer transition-all duration-300 hover:scale-[1.02] flex items-center gap-3 shadow-md",children:[(0,l.jsx)("img",{src:e.imageUrl,alt:e.title,className:"w-14 h-14 sm:w-16 sm:h-16 rounded-xl object-cover border border-slate-700 shadow-md group-hover:scale-105 transition-transform shrink-0"}),(0,l.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("h4",{className:"font-bold text-xs sm:text-sm text-white group-hover:text-amber-400 transition-colors",children:e.title}),(0,l.jsx)("span",{className:"text-[9px] sm:text-[10px] text-slate-400 font-mono",children:e.englishTitle})]}),(0,l.jsx)("span",{className:"text-[10px] sm:text-[11px] text-amber-400/90 block mb-0.5 sm:mb-1 font-medium",children:e.subtitle}),(0,l.jsx)("p",{className:"text-[10px] text-slate-300 line-clamp-2 leading-relaxed mb-1.5",children:e.description}),(0,l.jsx)("div",{className:"flex items-center gap-1 flex-wrap",children:e.traits.map((e,s)=>(0,l.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-slate-900/80 text-slate-300 border border-slate-700/50",children:["• ",e]},s))})]})]},e.id))}):(0,l.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4",children:f.R6.map(e=>(0,l.jsxs)("div",{onClick:()=>o(e.id),className:"group p-4 sm:p-5 rounded-2xl border ".concat(e.borderColor," bg-gradient-to-br ").concat(e.bgGradient," cursor-pointer transition-all duration-300 hover:scale-[1.02] shadow-lg flex flex-col justify-between"),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2.5 sm:mb-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,l.jsx)("span",{className:"text-2xl sm:text-3xl",children:e.icon}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"font-bold text-sm sm:text-base text-white group-hover:text-amber-400 transition-colors",children:e.title}),(0,l.jsx)("span",{className:"text-[9px] sm:text-[10px] text-slate-400 tracking-wider uppercase font-semibold",children:e.englishTitle})]})]}),(0,l.jsx)("span",{className:"text-[11px] sm:text-xs px-2 sm:px-2.5 py-1 rounded-full bg-slate-800/90 text-amber-400 border border-slate-700",children:"۵ کاراکتر باحال ←"})]}),(0,l.jsx)("p",{className:"text-[11px] sm:text-xs text-slate-300 leading-relaxed",children:e.description})]},e.id))})]})})}var y=t(15050),k=t(81703);function C(e){let{isOpen:s,onClose:t,referralCode:u,onSelectedSuccess:v,initialArchetype:N,introTitle:y,resultButtonText:C}=e,[A,D]=(0,r.useState)(!1),{step:O,currentQuestion:S,activeDuel:Q,quizResult:E,progress:R,isFreshQuiz:T,feedbackSubmitted:W,celebrating:I,copiedLink:L,startQuiz:H,selectOption:F,chooseShowdownOption:U,submitFeedback:_,shareChallenge:B,resetQuiz:z,resetToInitial:G}=(0,g.D)({initialReferralCode:u,initialArchetype:N,onRequireLogin:()=>{D(!0)}}),M=(0,r.useRef)(!1);(0,r.useEffect)(()=>{s&&!M.current&&G(),M.current=s},[s,G]);let P=()=>{let e=(null==E?void 0:E.winnerArchetype)||N;e&&v&&v(e),G(),t()};(0,r.useEffect)(()=>{if(!s)return;let e=e=>{if("Q1"===O||"Q2"===O||"Q3"===O||"Q4"===O||"Q5"===O){let s=parseInt(e.key,10);if(s>=1&&(null==S?void 0:S.options)&&s<=S.options.length){let e=S.options[s-1];e&&F(S.id,e.id)}}else"SHOWDOWN"===O&&Q&&("1"===e.key&&U(Q.archetypeA),"2"===e.key&&U(Q.archetypeB))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s,O,S,Q,F,U]);let $=(null==E?void 0:E.winnerArchetype)?f.aK[E.winnerArchetype]:null,q=(null==E?void 0:E.category)?f.R6.find(e=>e.id===E.category):null;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(b.lG,{open:s,onOpenChange:e=>!e&&P(),children:(0,l.jsxs)(b.Cf,{className:"flex flex-col w-[calc(100%-2rem)] sm:w-full sm:max-w-2xl min-w-0 max-w-full bg-slate-900/90 backdrop-blur-2xl border border-slate-700/60 rounded-3xl p-4 sm:p-7 shadow-2xl text-white max-h-[90vh] overflow-y-auto overflow-x-hidden no-scrollbar [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden dir-rtl",showCloseButton:!1,children:[(0,l.jsx)(w.A,{active:I}),(0,l.jsxs)("div",{className:"w-full min-w-0 flex items-center justify-between border-b border-slate-800 pb-3 mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[(0,l.jsx)("span",{className:"text-xl shrink-0",children:"\uD83D\uDD2E"}),(0,l.jsx)("div",{className:"min-w-0 flex-1",children:(0,l.jsxs)("h3",{className:"text-sm sm:text-base font-bold text-amber-400 truncate",children:["INTRO"===O&&(y||"کشف آرکی‌تایپ اعضا"),("Q1"===O||"Q2"===O)&&"سنجش شاخه کلان ذهنی",("Q3"===O||"Q4"===O||"Q5"===O)&&"سنجش تخصصی ".concat((null==q?void 0:q.title)||"سبک بازی"),"SHOWDOWN"===O&&"دوئل سرنوشت‌ساز حل تساوی ⚔️","RESULT"===O&&"کارت کاراکتر کشف‌شده شما ✨"]})})]}),(0,l.jsx)("button",{onClick:P,"aria-label":"بستن",className:"p-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-400 hover:text-white transition-colors shrink-0 mr-2",children:(0,l.jsx)(a.A,{className:"w-5 h-5"})})]}),"INTRO"!==O&&"RESULT"!==O&&(0,l.jsxs)("div",{className:"w-full min-w-0 mb-5 space-y-1.5",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between text-[11px] sm:text-xs text-slate-400 font-medium",children:[(0,l.jsx)("span",{children:"SHOWDOWN"===O?"دوئل نهایی":"سوال ".concat(R.current," از ").concat(R.total)}),(0,l.jsx)("span",{children:"SHOWDOWN"===O?"۱۰۰٪":"".concat(R.percentage,"٪")})]}),(0,l.jsx)("div",{className:"w-full h-2 rounded-full bg-slate-800 overflow-hidden",children:(0,l.jsx)("div",{className:"h-full bg-gradient-to-r from-amber-500 to-orange-500 rounded-full transition-all duration-500 ease-out",style:{width:"".concat("SHOWDOWN"===O?100:R.percentage,"%")}})})]}),"INTRO"===O&&(0,l.jsx)(j.F,{referralCode:u,onStart:H,onClose:P}),("Q1"===O||"Q2"===O||"Q3"===O||"Q4"===O||"Q5"===O)&&S&&(0,l.jsxs)("div",{className:"w-full min-w-0 space-y-4 animate-in fade-in-0 slide-in-from-bottom-3 duration-300",children:[(0,l.jsxs)("div",{className:"space-y-1 text-right",children:[(0,l.jsx)("span",{className:"text-[11px] sm:text-xs text-amber-400 font-semibold px-2.5 py-0.5 rounded-full bg-amber-500/10 border border-amber-500/20 inline-block mb-1",children:S.subtitle||"مرحله ".concat(R.current)}),(0,l.jsx)("h2",{className:"text-base sm:text-lg md:text-xl font-bold text-white leading-snug",children:S.title})]}),(0,l.jsx)("div",{className:"grid grid-cols-1 gap-2.5 pt-2 w-full min-w-0",children:S.options.map((e,s)=>(0,l.jsxs)("button",{onClick:()=>F(S.id,e.id),className:"group relative w-full min-w-0 p-3.5 sm:p-4 rounded-2xl bg-slate-800/80 hover:bg-slate-800 border border-slate-700/70 hover:border-amber-500/60 transition-all duration-200 hover:scale-[1.01] text-right flex items-center justify-between shadow-md",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[(0,l.jsx)("span",{className:"w-6 h-6 sm:w-7 sm:h-7 rounded-lg bg-slate-900/90 border border-slate-700 text-slate-400 group-hover:text-amber-400 group-hover:border-amber-500/40 text-xs font-mono font-bold flex items-center justify-center shrink-0",children:s+1}),(0,l.jsx)("p",{className:"text-xs sm:text-sm text-slate-200 group-hover:text-white leading-relaxed break-words",children:e.text})]}),(0,l.jsx)(n.A,{className:"w-4 h-4 text-slate-500 group-hover:text-amber-400 transition-colors shrink-0 mr-2"})]},e.id))})]}),"SHOWDOWN"===O&&Q&&(0,l.jsxs)("div",{className:"w-full min-w-0 space-y-5 animate-in fade-in-0 zoom-in-95 duration-300 text-center",children:[(0,l.jsxs)("div",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-red-500/15 border border-red-500/30 text-red-400 text-xs font-bold",children:[(0,l.jsx)(i.A,{className:"w-4 h-4 text-red-400 shrink-0"}),(0,l.jsx)("span",{children:"دوئل حل تساوی امتیازات"})]}),(0,l.jsxs)("div",{className:"space-y-1 text-right",children:[(0,l.jsx)("h2",{className:"text-base sm:text-lg font-bold text-white",children:Q.scenario}),(0,l.jsx)("p",{className:"text-xs text-slate-300",children:"امتیازات دو کاراکتر برابر شد! برای تعیین قطعی کارت نهایی، گزینه‌ای که بیشتر به روحیاتت نزدیکه رو انتخاب کن:"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 pt-2 w-full min-w-0",children:[(0,l.jsxs)("button",{onClick:()=>U(Q.archetypeA),className:"group min-w-0 p-4 rounded-2xl bg-gradient-to-br from-slate-800 to-slate-900 border border-slate-700 hover:border-amber-500/80 hover:scale-[1.02] transition-all text-right space-y-2 shadow-lg",children:[(0,l.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded bg-amber-500/20 text-amber-300 font-bold",children:"گزینه ۱"}),(0,l.jsx)("p",{className:"text-xs sm:text-sm text-slate-200 group-hover:text-white leading-relaxed font-medium",children:Q.optionA})]}),(0,l.jsxs)("button",{onClick:()=>U(Q.archetypeB),className:"group min-w-0 p-4 rounded-2xl bg-gradient-to-br from-slate-800 to-slate-900 border border-slate-700 hover:border-amber-500/80 hover:scale-[1.02] transition-all text-right space-y-2 shadow-lg",children:[(0,l.jsx)("span",{className:"text-[10px] px-2 py-0.5 rounded bg-amber-500/20 text-amber-300 font-bold",children:"گزینه ۲"}),(0,l.jsx)("p",{className:"text-xs sm:text-sm text-slate-200 group-hover:text-white leading-relaxed font-medium",children:Q.optionB})]})]})]}),"RESULT"===O&&$&&E&&(0,l.jsxs)("div",{className:"w-full min-w-0 space-y-5 animate-in fade-in-0 zoom-in-95 duration-400",children:[(0,l.jsx)("div",{className:"w-full min-w-0 p-4 sm:p-5 rounded-3xl bg-gradient-to-br from-slate-800/90 via-slate-900 to-slate-950 border border-amber-500/40 shadow-2xl relative overflow-hidden",children:(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row items-center sm:items-start gap-4 text-center sm:text-right",children:[(0,l.jsx)("img",{src:$.imageUrl,alt:$.title,className:"w-24 h-24 sm:w-28 sm:h-28 rounded-2xl object-cover border-2 border-amber-400/60 shadow-xl shrink-0"}),(0,l.jsxs)("div",{className:"space-y-1.5 flex-1 min-w-0 w-full",children:[(0,l.jsxs)("div",{className:"flex items-center justify-center sm:justify-between flex-wrap gap-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("h2",{className:"text-lg sm:text-xl font-black text-amber-400",children:$.title}),(0,l.jsxs)("span",{className:"text-xs font-mono text-slate-400 uppercase",children:["(",$.englishTitle,")"]})]}),(0,l.jsxs)("span",{className:"px-2.5 py-0.5 rounded-full bg-amber-500/20 text-amber-300 border border-amber-500/30 text-xs font-bold flex items-center gap-1 shrink-0",children:[(0,l.jsx)(o.A,{className:"w-3.5 h-3.5 text-amber-400"}),(0,l.jsxs)("span",{children:["تطابق ",E.matchPercentage,"٪"]})]})]}),(0,l.jsx)("p",{className:"text-xs text-amber-300/90 font-medium",children:$.subtitle}),(0,l.jsx)("p",{className:"text-xs text-slate-300 leading-relaxed line-clamp-3",children:$.description}),(0,l.jsx)("div",{className:"flex items-center justify-center sm:justify-start gap-1.5 flex-wrap pt-1",children:$.traits.map((e,s)=>(0,l.jsxs)("span",{className:"text-[10px] px-2 py-0.5 rounded-lg bg-slate-800 text-slate-300 border border-slate-700/60",children:["• ",e]},s))})]})]})}),(0,l.jsxs)("div",{className:"w-full min-w-0 p-3.5 sm:p-4 rounded-2xl bg-slate-800/60 border border-slate-700/60 space-y-3",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 text-xs sm:text-sm font-bold text-white",children:[(0,l.jsx)(d.A,{className:"w-4 h-4 text-amber-400 shrink-0"}),(0,l.jsx)("span",{children:"دوستانت رو به چالش بکش!"})]}),(0,l.jsx)("span",{className:"text-[10px] text-slate-400",children:"لینک اختصاصی چالش"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 w-full min-w-0",children:[(0,l.jsxs)(p.$,{onClick:()=>B(u||void 0),className:"w-full h-10 bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-slate-950 font-bold rounded-xl text-xs flex items-center justify-center gap-2 shadow-md",children:[(0,l.jsx)(d.A,{className:"w-4 h-4"}),(0,l.jsx)("span",{children:"ارسال چالش به دوستان \uD83D\uDE80"})]}),(0,l.jsx)(p.$,{onClick:()=>B(u||void 0),className:"w-full h-10 bg-slate-800/90 hover:bg-slate-700/90 text-slate-100 hover:text-white border border-slate-700 hover:border-slate-600 font-medium rounded-xl text-xs flex items-center justify-center gap-2 transition-all shadow-sm",children:L?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(x.A,{className:"w-4 h-4 text-emerald-400"}),(0,l.jsx)("span",{className:"text-emerald-400 font-bold",children:"لینک کپی شد!"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.A,{className:"w-4 h-4 text-slate-300"}),(0,l.jsx)("span",{className:"text-slate-100",children:"کپی لینک مستقیم"})]})})]})]}),T&&!W&&(0,l.jsxs)("div",{className:"w-full min-w-0 p-3.5 sm:p-4 rounded-2xl bg-slate-800/40 border border-slate-700/40 text-center space-y-2.5 animate-in fade-in-0 duration-300",children:[(0,l.jsxs)("div",{className:"flex items-center justify-center gap-1.5 text-xs text-slate-300 font-medium",children:[(0,l.jsx)(m.A,{className:"w-4 h-4 text-amber-400 shrink-0"}),(0,l.jsx)("span",{children:"آیا این نتیجه با سبک واقعی شما تطابق دارد؟"})]}),(0,l.jsxs)("div",{className:"flex items-center justify-center gap-2 flex-wrap",children:[(0,l.jsx)("button",{onClick:()=>_("EXACT"),className:"px-3 py-1.5 rounded-xl bg-emerald-950/60 hover:bg-emerald-900 border border-emerald-500/40 text-emerald-300 text-xs font-medium transition-all hover:scale-105",children:"\uD83C\uDFAF دقیقاً خودمم!"}),(0,l.jsx)("button",{onClick:()=>_("PARTIAL"),className:"px-3 py-1.5 rounded-xl bg-sky-950/60 hover:bg-sky-900 border border-sky-500/40 text-sky-300 text-xs font-medium transition-all hover:scale-105",children:"\uD83D\uDC4D تا حدی"}),(0,l.jsx)("button",{onClick:()=>_("MISMATCH"),className:"px-3 py-1.5 rounded-xl bg-rose-950/60 hover:bg-rose-900 border border-rose-500/40 text-rose-300 text-xs font-medium transition-all hover:scale-105",children:"❌ اشتباهه"})]})]}),(0,l.jsxs)("div",{className:"w-full min-w-0 flex items-center justify-between pt-1",children:[(0,l.jsxs)("button",{onClick:z,className:"text-xs text-slate-400 hover:text-amber-400 transition-colors flex items-center gap-1",children:[(0,l.jsx)(h.A,{className:"w-3.5 h-3.5"}),(0,l.jsx)("span",{children:"آزمون مجدد"})]}),(0,l.jsx)(p.$,{onClick:P,className:"px-6 h-10 rounded-xl font-bold text-xs shadow-md transition-all active:scale-95 flex items-center gap-1.5 ".concat(v?"bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-slate-950 shadow-amber-500/20":"bg-slate-800 hover:bg-slate-700 text-white"),children:(0,l.jsx)("span",{children:C||(v?"ثبت و ادامه مسیر \uD83D\uDE80":"بستن و بازگشت")})})]})]})]})}),(0,l.jsx)(k.G,{isOpen:A,onClose:()=>D(!1),title:"ورود به حساب کاربری",description:"برای ثبت رسمی کاراکتر بر روی پروفایل و ذخیره امتیازات، لطفاً وارد حساب خود شوید."})]})}function A(e){return u.P.ENABLE_DYNAMIC_QUIZ?(0,l.jsx)(y.a,{onReset:e.onClose,children:(0,l.jsx)(C,{...e})}):(0,l.jsx)(N,{isOpen:e.isOpen,onClose:e.onClose,onSelect:s=>{e.onSelectedSuccess&&e.onSelectedSuccess(s)},loading:!1})}}}]);