(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,575822,e=>{"use strict";let s=(0,e.i(475254).default)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);e.s(["Coins",()=>s],575822)},594013,956477,492161,190894,350627,879002,114642,950232,e=>{"use strict";var s=e.i(843476),a=e.i(271645),t=e.i(167881),i=e.i(475254);let n=(0,i.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),r=(0,i.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);var l=e.i(363178),o=e.i(647163);function d({className:e}){let{setTheme:i,theme:d}=(0,l.useTheme)(),[c,h]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{h(!0)},[]),c)?"light"===d?(0,s.jsx)(t.Button,{variant:"ghost",size:"icon",onClick:()=>i("dark"),className:(0,o.cn)(e),children:(0,s.jsx)(n,{})}):(0,s.jsx)(t.Button,{variant:"ghost",size:"icon",onClick:()=>i("light"),className:(0,o.cn)(e),children:(0,s.jsx)(r,{})}):null}e.s(["default",()=>d],594013);let c=(0,i.default)("menu",[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]]);e.s(["default",()=>c],956477),e.s(["Menu",()=>c],492161);var h=e.i(555436),x=e.i(694689),u=e.i(950216),m=e.i(253363),g=e.i(948148);function p({data:e,isLoading:t=!1,selectedToken:i,onSelect:n,className:r}){let[l,d]=a.default.useState(""),[c,p]=a.default.useState(!1),{getPricePrecision:j}=(0,m.useTokenPrecision)(),f=a.default.useMemo(()=>{let s=e?.data||[];if(!Array.isArray(s)||!l.trim())return[];let a=l.toLowerCase().trim();return s.filter(e=>{let s=(e.trading_pairs||"").toLowerCase(),t=(e.base_currency||"").toLowerCase(),i=(e.quote_currency||"").toLowerCase();return s.includes(a)||t.includes(a)||i.includes(a)||`${t}/${i}`.includes(a)}).slice(0,10)},[e,l]),v=(0,g.useTranslations)();return(0,s.jsxs)("div",{className:(0,o.cn)("relative ",r),children:[(0,s.jsxs)(x.InputGroup,{"data-disabled":t,children:[(0,s.jsx)(x.InputGroupAddon,{align:"inline-start",children:(0,s.jsx)(h.Search,{className:"text-gray1",strokeWidth:"1",size:"16"})}),(0,s.jsx)(x.InputGroupInput,{type:"text",placeholder:t?v("common.loading"):i||v("common.search_trading_pairs"),className:"!text-xs",value:l,onChange:e=>{d(e.target.value)},onFocus:()=>p(!0),onBlur:()=>setTimeout(()=>p(!1),200),disabled:t}),t&&(0,s.jsx)(x.InputGroupAddon,{align:"inline-end",children:(0,s.jsx)(u.Spinner,{})})]}),c&&l.trim()&&f.length>0&&(0,s.jsx)("div",{className:"absolute top-full left-0 right-0 mt-1 bg-background/20 backdrop-blur-lg border border-input rounded-md shadow-lg max-h-80 overflow-y-auto z-50",children:f.map(e=>{let a=parseFloat(e.price_change_percent_24h)>=0;return(0,s.jsx)("div",{onClick:()=>n(e.trading_pairs),className:"p-3 hover:bg-gray3/10 cursor-pointer border-b border-input last:border-0 transition-colors",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("div",{className:"font-medium text-xs text-foreground",children:e.trading_pairs.replace("_","/")}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground mt-0.5",children:[e.base_currency," / ",e.quote_currency]})]}),(0,s.jsxs)("div",{className:"text-right ml-4",children:[(0,s.jsxs)("div",{className:"font-medium text-xs text-foreground",children:["$",Number(e.last_price).toFixed(j(e.trading_pairs))]}),(0,s.jsxs)("div",{className:`text-xs mt-0.5 ${a?"text-green":"text-red"}`,children:[a?"+":"",parseFloat(e.price_change_percent_24h).toFixed(2),"%"]})]})]})},e.trading_pairs)})}),c&&l.trim()&&0===f.length&&!t&&(0,s.jsx)("div",{className:"absolute top-full left-0 right-0 mt-1 bg-background border border-input rounded-md shadow-lg p-4 z-50",children:(0,s.jsx)("div",{className:"text-sm text-gray1 text-center",children:v("common.no_trading_pairs_found")})})]})}e.s(["default",()=>p],190894);var j=e.i(456904),f=e.i(463415),v=e.i(63270),y=e.i(994179),N=e.i(257765),b=e.i(373264),k=e.i(252754);let w=(0,i.default)("receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);e.s(["Receipt",()=>w],350627);var C=e.i(284614);let _=(0,i.default)("user-plus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);e.s(["UserPlus",()=>_],879002);var S=e.i(239616);let T=(0,i.default)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);var B=e.i(443005),M=e.i(467842);e.s(["default",0,function({className:e}){let{data:a}=(0,B.GetUser)(),{logout:i}=(0,M.useAuth)(),n=(0,j.useRouter)(),r=(0,g.useTranslations)(),l=(e=>{if(!e||!e.includes("@"))return"***@***.***";let[s,a]=e.split("@");return s.length<=2?`${s[0]}***@${a}`:`${s.slice(0,2)}***@${a}`})(a?.data?.email||a?.data?.preferred_username||a?.data?.username||""),d=a?.data?.sub||a?.data?.kyc_reference_id||a?.data?.id||"",c=a?.data?.kyc_status==="VERIFIED"||a?.data?.kyc_status==="verified";return(0,s.jsxs)(f.DropdownMenu,{children:[(0,s.jsx)(f.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(t.Button,{variant:"ghost",size:"icon",className:(0,o.cn)(e),children:(0,s.jsx)(C.User,{className:"h-4 w-4"})})}),(0,s.jsxs)(f.DropdownMenuContent,{align:"end",className:"w-80 p-0 bg-background/20 backdrop-blur-lg",children:[(0,s.jsx)("div",{className:"p-4 border-b",children:(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,s.jsx)(v.Avatar,{className:"h-12 w-12",children:(0,s.jsx)(v.AvatarFallback,{className:"bg-primary text-primary-foreground",children:(0,s.jsx)(C.User,{className:"h-6 w-6"})})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:l}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,s.jsxs)("span",{className:"text-xs text-gray1",children:["UID: ",d]}),(0,s.jsx)(N.CopyButton,{text:d,successMessage:"UID copied!",errorMessage:"Failed to copy",size:"sm"})]}),c&&(0,s.jsx)(y.Badge,{className:"bg-green text-foreground text-xs mt-2 w-fit",children:r("common.verified")})]})]})}),(0,s.jsxs)("div",{className:"p-2",children:[(0,s.jsx)(t.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm",asChild:!0,children:(0,s.jsxs)(j.Link,{href:"/dashboard",children:[(0,s.jsx)(b.LayoutGrid,{className:"h-4 w-4"}),r("navigation.dashboard")]})}),(0,s.jsx)(t.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm",asChild:!0,children:(0,s.jsxs)(j.Link,{href:"/dashboard/assets",children:[(0,s.jsx)(k.Wallet,{className:"h-4 w-4"}),r("navigation.assets")]})}),(0,s.jsx)(t.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm",asChild:!0,children:(0,s.jsxs)(j.Link,{href:"/dashboard/orders",children:[(0,s.jsx)(w,{className:"h-4 w-4"}),r("navigation.orders")]})}),(0,s.jsx)(t.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm",asChild:!0,children:(0,s.jsxs)(j.Link,{href:"/dashboard/account-info",children:[(0,s.jsx)(C.User,{className:"h-4 w-4"}),r("navigation.account")]})}),(0,s.jsx)(t.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm",asChild:!0,children:(0,s.jsxs)(j.Link,{href:"/dashboard/referral",children:[(0,s.jsx)(_,{className:"h-4 w-4"}),r("navigation.referral")]})}),(0,s.jsx)(t.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm",asChild:!0,children:(0,s.jsxs)(j.Link,{href:"/dashboard/settings",children:[(0,s.jsx)(S.Settings,{className:"h-4 w-4"}),r("navigation.settings")]})})]}),(0,s.jsx)(f.DropdownMenuSeparator,{}),(0,s.jsx)("div",{className:"p-2",children:(0,s.jsxs)(t.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm text-red hover:text-red hover:bg-red/10",onClick:()=>{i(),n.push("/")},children:[(0,s.jsx)(T,{className:"h-4 w-4"}),r("navigation.logout")]})})]})]})}],114642);let L=(0,i.default)("hand-coins",[["path",{d:"M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17",key:"geh8rc"}],["path",{d:"m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"1fto5m"}],["path",{d:"m2 16 6 6",key:"1pfhp9"}],["circle",{cx:"16",cy:"9",r:"2.9",key:"1n0dlu"}],["circle",{cx:"6",cy:"5",r:"3",key:"151irh"}]]);e.s(["HandCoins",()=>L],950232)},77705,e=>{"use strict";let s=(0,e.i(475254).default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["EyeOff",()=>s],77705)},111188,114683,e=>{"use strict";var s=e.i(843476),a=e.i(657688),t=e.i(271645),i=e.i(167881),n=e.i(594013),r=e.i(456904),l=e.i(440160),o=e.i(531278),d=e.i(492161),c=e.i(37727),h=e.i(190894),x=e.i(467842),u=e.i(114642),m=e.i(463415),g=e.i(373264),p=e.i(252754),j=e.i(575822),f=e.i(178583),v=e.i(950232),y=e.i(286536),N=e.i(77705),b=e.i(809723),k=e.i(952510),w=e.i(253363),C=e.i(959879),_=e.i(62870),S=e.i(647163),T=e.i(948148);let B=function(){let{isInternational:e}=(0,C.useGlobal)(),[a,n]=(0,t.useState)(!0),[l,o]=(0,t.useState)("INR");(0,t.useEffect)(()=>{o(e?"USDT":"INR")},[e]);let{data:d,isLoading:c}=(0,b.GetFundingSummary)(),{data:h,isLoading:x}=(0,b.GetSpotSummary)(),{data:u,isLoading:B}=(0,b.GetCopaySummary)(),{data:M,isLoading:L}=(0,k.GetBTC_USDT)(),{data:A,isLoading:D}=(0,k.GetSpotTickerByPair)("USDT_INR"),{getQuantityPrecision:I}=(0,w.useTokenPrecision)(),z=(0,T.useTranslations)(),F=(0,t.useMemo)(()=>{try{let e="number"==typeof d?.total_usdt?d.total_usdt:0,s="number"==typeof h?.total_usdt?h.total_usdt:0,a="number"==typeof u?.total_usdt?u.total_usdt:0,t=e+s+a;return isNaN(t)||!isFinite(t)?0:t}catch(e){return 0}},[d?.total_usdt,h?.total_usdt,u?.total_usdt]),G=(0,t.useMemo)(()=>{if("BTC"===l){let e=M?.data?.last_price;return e&&"number"==typeof e&&e>0?(F/e).toFixed(I("BTC_USDT")):"0"}if("INR"!==l)return F.toFixed(6);{let e=A?.data?.last_price;return e&&"number"==typeof e&&e>0?(F*e).toFixed(2):"0.00"}},[F,l,M?.data?.last_price,A?.data?.last_price,I]),U=()=>{if("BTC"===l)return`~ $${F.toFixed(2)}`;{if("INR"===l)return`~ ${F.toFixed(6)} USDT`;let e=M?.data?.last_price;return e&&"number"==typeof e&&e>0?`~ ${(F/e).toFixed(I("BTC_USDT"))} BTC`:null}},R=c||x||B||"BTC"===l&&L||"INR"===l&&D;return(0,s.jsxs)(m.DropdownMenu,{children:[(0,s.jsx)(m.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(i.Button,{variant:"ghost",size:"icon",children:(0,s.jsx)(p.Wallet,{className:"h-4 w-4"})})}),(0,s.jsxs)(m.DropdownMenuContent,{align:"end",className:(0,S.cn)("w-80 p-4 bg-background/20 backdrop-blur-lg z-[100]","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2"),children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsxs)("h3",{className:"text-sm text-gray1",children:[z("navigation.assets")," ",z("navigation.overview")]}),(0,s.jsx)(i.Button,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>n(!a),children:a?(0,s.jsx)(y.Eye,{className:"h-4 w-4"}):(0,s.jsx)(N.EyeOff,{className:"h-4 w-4"})})]}),a?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsx)("div",{className:"text-2xl font-bold text-foreground",children:R?z("common.loading"):G}),(0,s.jsxs)(_.Select,{value:l,onValueChange:o,children:[(0,s.jsx)(_.SelectTrigger,{className:"h-7 w-16 text-xs",children:(0,s.jsx)(_.SelectValue,{})}),(0,s.jsxs)(_.SelectContent,{className:"z-[100]",children:[!e&&(0,s.jsx)(_.SelectItem,{value:"INR",children:"INR"}),(0,s.jsx)(_.SelectItem,{value:"USDT",children:"USDT"}),(0,s.jsx)(_.SelectItem,{value:"BTC",children:"BTC"})]})]})]}),U()&&(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:U()})]}):(0,s.jsx)("div",{className:"text-2xl font-bold text-foreground",children:"••••••••"}),(0,s.jsxs)("div",{className:"flex gap-2 pt-2",children:[(0,s.jsx)(i.Button,{variant:"secondary",className:"flex-1 text-sm",asChild:!0,children:(0,s.jsx)(r.Link,{href:"/transaction/deposit",children:z("common.deposit")})}),(0,s.jsx)(i.Button,{variant:"secondary",className:"flex-1 text-sm",asChild:!0,children:(0,s.jsx)(r.Link,{href:"/transaction/withdraw",children:z("common.withdraw")})})]})]}),(0,s.jsx)(m.DropdownMenuSeparator,{className:"my-2"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(i.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm",asChild:!0,children:(0,s.jsxs)(r.Link,{href:"/dashboard/assets",children:[(0,s.jsx)(g.LayoutGrid,{className:"h-4 w-4"}),z("navigation.overview")]})}),(0,s.jsx)(i.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm",asChild:!0,children:(0,s.jsxs)(r.Link,{href:"/dashboard/assets/spotwallet",children:[(0,s.jsx)(j.Coins,{className:"h-4 w-4"}),z("navigation.spot")]})}),(0,s.jsx)(i.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm",asChild:!0,children:(0,s.jsxs)(r.Link,{href:"/dashboard/assets/futureaccount",children:[(0,s.jsx)(f.FileText,{className:"h-4 w-4"}),z("navigation.futures")]})}),(0,s.jsx)(i.Button,{variant:"ghost",className:"w-full justify-start gap-3 text-sm",asChild:!0,children:(0,s.jsxs)(r.Link,{href:"/dashboard/assets/staking",children:[(0,s.jsx)(v.HandCoins,{className:"h-4 w-4"}),z("navigation.earn")]})})]})]})]})};var M=e.i(363178),L=e.i(231506),A=e.i(251424),D=e.i(511152),I=e.i(160434);e.s(["Circle",()=>I.default],114683);var I=I;let z=({iconSrc:e,iconAlt:t,icon:i,title:n,description:l,href:o,onClick:d,className:c=""})=>{let h=!!o||!!d,x=(0,s.jsx)(I.default,{className:"w-5 h-5"}),u=(0,s.jsxs)("div",{className:`group p-2 flex gap-2 items-center dark:hover:bg-gray3 hover:bg-gray2 rounded-lg hover:shadow-xl shadow-none ${h?"cursor-pointer rounded-md transition-colors":""} ${c}`,children:[(0,s.jsx)("div",{className:"text-foreground flex items-center justify-center w-5 h-5",children:e?(0,s.jsx)(a.default,{src:e,alt:t||n,width:20,height:20,className:"dark:brightness-100 dark:contrast-100 dark:invert-0 brightness-0 contrast-100"}):i||x}),(0,s.jsxs)("div",{className:"grow",children:[(0,s.jsx)("h4",{className:"text-sm font-semibold group-hover:text-primary transition-colors",children:n}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:l})]}),(0,s.jsx)("div",{className:"size-3 flex-none text-muted-foreground",children:(0,s.jsx)(D.FaChevronRight,{})})]});return o?(0,s.jsx)(r.Link,{href:o,className:"block",onClick:d,children:u}):(0,s.jsx)("div",{onClick:d,children:u})};var F=e.i(890538),G=e.i(852917),U=e.i(243237);let R=({className:e})=>{let{selectedRegion:a,setSelectedRegion:t}=(0,C.useGlobal)(),i=(0,T.useTranslations)();return(0,s.jsx)("div",{className:e,children:(0,s.jsxs)(U.ToggleGroup,{type:"single",value:a,onValueChange:e=>{if("india"===e||"international"===e){t(e);{if("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)return;let s="india"===e?"india.cofinex.io":"www.cofinex.io",a=new URL(window.location.href);a.hostname=s,window.location.assign(a.toString())}}},variant:"outline",size:"sm",className:"w-full",children:[(0,s.jsx)(U.ToggleGroupItem,{value:"international","aria-label":"International",className:"flex-1 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:i("navigation.international")}),(0,s.jsx)(U.ToggleGroupItem,{value:"india","aria-label":"India",className:"flex-1 data-[state=on]:bg-primary data-[state=on]:text-primary-foreground",children:i("navigation.india")})]})})};var H=e.i(984828);let $=function({onClose:e}){let a=(0,T.useTranslations)("navigation.promotion");return(0,s.jsxs)("div",{className:" bg-linear-to-r from-primary/80 to-primary/40 text-foreground text-center px-8 py-1 text-xs font-medium word-spacing-wide relative lg:block hidden capitalize",children:[a("message")," ",(0,s.jsx)(i.Button,{variant:"outline",className:"px-4 py-1 text-xs font-medium h-auto",asChild:!0,children:(0,s.jsxs)(r.Link,{href:"/auth/signup",children:[a("cta")," ",(0,s.jsx)(H.FaArrowRight,{size:16})]})}),(0,s.jsx)(i.Button,{variant:"ghost",className:"absolute right-0 top-0",size:"icon",onClick:()=>e(),children:(0,s.jsx)(c.X,{size:16})})]})};var E=e.i(473665),P=e.i(861745),O=e.i(248256),q=e.i(643531),V=e.i(257608);let X=[{code:"en",label:"English"},{code:"bn",label:"বাংলা"},{code:"ko",label:"한국어"}];function W({className:e,variant:a="ghost",showLabel:n=!1,onSelect:l}){let o=(0,r.usePathname)(),d=(0,r.useRouter)(),c=(0,P.useLocale)(),{languageMappings:h}=(0,t.useContext)(V.GlobalContext),x=X.find(e=>e.code===c)||X[0];return(0,s.jsxs)(m.DropdownMenu,{children:[(0,s.jsx)(m.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsxs)(i.Button,{variant:a,size:n?"default":"icon",className:(0,S.cn)("flex items-center gap-2",e),children:[(0,s.jsx)(O.Globe,{className:"w-5 h-5"}),n&&(0,s.jsx)("span",{children:x.label})]})}),(0,s.jsx)(m.DropdownMenuContent,{align:"end",className:"w-40 bg-background/80 backdrop-blur-md border-input",children:X.map(e=>(0,s.jsxs)(m.DropdownMenuItem,{onClick:()=>(function(e){if(l&&l(),e!==c){if(h&&h[e])return void d.push(h[e]);d.replace(o,{locale:e})}})(e.code),className:(0,S.cn)("flex items-center justify-between cursor-pointer",c===e.code&&"bg-primary/10 text-primary font-medium"),children:[e.label,c===e.code&&(0,s.jsx)(q.Check,{className:"w-4 h-4 ml-2"})]},e.code))})]})}e.s(["default",0,function({loginHeader:e,className:g}){let{authenticated:p,login:j,logout:f,loading:v}=(0,x.useAuth)(),[y,N]=(0,t.useState)(!1),{data:b,isLoading:w}=(0,k.GetAllSpotMarketSummary)(),_=function(){let[e,s]=(0,t.useState)(0);return(0,t.useEffect)(()=>{let e=()=>s(window.scrollY);return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),e}(),[I,U]=(0,t.useState)(null),H=(0,r.useRouter)(),{mutateAsync:P}=(0,L.SyncBalance)(),{mutateAsync:O}=(0,L.CreateUser)(),{showPromotionTopBar:q,setShowPromotionTopBar:V}=(0,C.useGlobal)(),{theme:X}=(0,M.useTheme)(),[Y,K]=(0,t.useState)("/images/logo.svg");(0,t.useEffect)(()=>{K("dark"===X?"/images/logo.svg":"/images/logodark.svg")},[X]);let Q=(0,T.useTranslations)();(0,t.useEffect)(()=>{p&&Promise.all([P().catch(()=>{}),O().catch(()=>{})]).catch(()=>{})},[p,P,O]);let Z=e=>{let s=e.replace("_","-");U(J(e)),H.push(`/market/spot/${s}`),ee()},J=e=>e.replace("_","/"),ee=()=>{N(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:(0,S.cn)(" fixed top-0 inset-x-0 z-50 bg-background transition-all ease-in-out",g,{"shadow-md":_>100,"shadow-none":_<=100}),children:[!p&&q&&(0,s.jsx)($,{onClose:()=>V(!1)}),(0,s.jsxs)("div",{className:"px-4 xl:px-5 xl:py-3 py-3 flex justify-between items-center",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)(r.Link,{href:"/",children:(0,s.jsx)(a.default,{src:Y,alt:"Cofinex",height:18,width:160,className:"mr-6"})}),(0,s.jsx)(R,{className:"hidden md:block min-w-[200px]"}),(0,s.jsx)("div",{className:"hidden xl:block text-base",children:e?(0,s.jsx)("ul",{className:"flex gap-6 text-sm"}):(0,s.jsxs)("ul",{className:"flex items-center text-foreground font-medium",children:[(0,s.jsx)("li",{children:(0,s.jsx)(r.Link,{href:"/market",className:"px-6",children:Q("navigation.markets")})}),(0,s.jsx)("li",{children:(0,s.jsxs)(A.HoverCard,{openDelay:0,children:[(0,s.jsx)(A.HoverCardTrigger,{asChild:!0,children:(0,s.jsxs)(i.Button,{variant:"ghost",className:"text-base",children:[Q("navigation.trade")," ",(0,s.jsx)(D.FaCaretDown,{})]})}),(0,s.jsx)(A.HoverCardContent,{className:"w-[360px] p-4 bg-background/20 backdrop-blur-lg rounded-lg border-input border mt-4",children:(0,s.jsx)("div",{className:"space-y-2",children:(0,s.jsx)(z,{iconSrc:"/images/spot.svg",iconAlt:"Spot",title:Q("navigation.spot"),description:Q("wallet.assets.spot_description"),href:"/market/spot/BTC-USDT/"})})})]})}),(0,s.jsx)("li",{children:(0,s.jsxs)(A.HoverCard,{openDelay:0,children:[(0,s.jsx)(A.HoverCardTrigger,{asChild:!0,children:(0,s.jsxs)(i.Button,{variant:"ghost",className:"text-base",children:[Q("navigation.earn")," ",(0,s.jsx)(D.FaCaretDown,{})]})}),(0,s.jsx)(A.HoverCardContent,{className:"w-[360px] p-4 bg-background/20 backdrop-blur-lg rounded-lg border-input border mt-4",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(z,{iconSrc:"/images/earn.svg",iconAlt:"Overview",title:Q("navigation.overview"),description:Q("wallet.assets.overview_description"),href:"/dashboard/assets/"}),(0,s.jsx)(z,{iconSrc:"/images/affiliateIcon.svg",iconAlt:"Staking",title:Q("navigation.staking"),description:Q("wallet.assets.staking_description"),href:"/staking/"}),(0,s.jsx)(z,{iconSrc:"/images/simpelearn.svg",iconAlt:"Crypto Packs",title:Q("navigation.crypto_packs"),description:Q("wallet.assets.crypto_packs_description"),href:"/sip"})]})})]})}),(0,s.jsx)("li",{children:(0,s.jsxs)(A.HoverCard,{openDelay:0,children:[(0,s.jsx)(A.HoverCardTrigger,{asChild:!0,children:(0,s.jsxs)(i.Button,{variant:"ghost",className:"text-base",children:[Q("navigation.more")," ",(0,s.jsx)(D.FaCaretDown,{})]})}),(0,s.jsx)(A.HoverCardContent,{className:"w-[360px] p-4 bg-background/20 backdrop-blur-lg rounded-lg border-input border mt-4",children:(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(z,{iconSrc:"/images/ticket.svg",iconAlt:"FLYCNX",title:Q("navigation.flycnx"),description:Q("navigation.flycnx_description"),href:"https://flycnx.com/"}),(0,s.jsx)(z,{iconSrc:"/images/academy.svg",iconAlt:"Cofinex Academy",title:Q("navigation.cofinex_academy"),description:Q("navigation.cofinex_academy_description"),href:"/academy"}),(0,s.jsx)(z,{icon:(0,s.jsx)(E.MdOutlineArticle,{className:"w-5 h-5"}),title:Q("navigation.cofinex_blog"),description:Q("navigation.cofinex_blog_description"),href:"/blog"})]})})]})})]})})]}),(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)("div",{className:"hidden lg:flex items-center",children:[!e&&(0,s.jsxs)("div",{className:"flex xl:gap-3 gap-1 items-center",children:[(0,s.jsx)(h.default,{data:b,isLoading:w,selectedToken:I,onSelect:Z,className:"w-44"}),p&&(0,s.jsx)(i.Button,{asChild:!0,variant:"white",children:(0,s.jsx)(r.Link,{href:"/dashboard/assets",children:Q("navigation.assets")})})]}),!e&&(p?(0,s.jsx)("div",{className:" px-1 flex gap-2",children:(0,s.jsx)(i.Button,{variant:"ghost",onClick:f,children:Q("navigation.logout")})}):(0,s.jsxs)("div",{className:"xl:px-6 px-2",children:[(0,s.jsx)(i.Button,{variant:"ghost",onClick:j,disabled:v,children:v?(0,s.jsx)(o.Loader2,{className:"w-4 h-4 animate-spin"}):Q("navigation.login")}),(0,s.jsx)(i.Button,{variant:"white",asChild:!0,children:(0,s.jsx)(r.Link,{href:"/auth/signup",children:Q("navigation.signup")})})]})),p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(B,{}),(0,s.jsx)(u.default,{})]}),(0,s.jsxs)(m.DropdownMenu,{children:[(0,s.jsx)(m.DropdownMenuTrigger,{asChild:!0,children:(0,s.jsx)(i.Button,{variant:"ghost",size:"icon",children:(0,s.jsx)(l.Download,{})})}),(0,s.jsx)(m.DropdownMenuContent,{align:"end",className:"w-52 p-6 bg-background/20 backdrop-blur-lg",children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,s.jsx)("div",{className:"bg-white p-4 rounded-lg border",children:(0,s.jsx)(a.default,{src:"/images/qr-code.webp",alt:"Download App QR Code",width:200,height:200,className:"rounded"})}),(0,s.jsxs)("div",{className:"text-center space-y-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:Q("navigation.scan_to_download_app")}),(0,s.jsx)("p",{className:"text-xs text-gray1",children:Q("navigation.ios_android")})]})]})})]}),(0,s.jsx)(W,{}),(0,s.jsx)("span",{className:"hidden xl:block",children:(0,s.jsx)(n.default,{})})]}),(0,s.jsxs)("div",{className:"xl:hidden",children:[p&&(0,s.jsx)(u.default,{className:"lg:hidden"}),(0,s.jsx)(n.default,{className:"px-0"}),(0,s.jsx)(i.Button,{variant:"ghost",size:"icon",onClick:()=>{N(!y)},className:"text-foreground",children:y?(0,s.jsx)(c.X,{size:24}):(0,s.jsx)(d.Menu,{size:24})})]})]})]})]}),(0,s.jsx)(G.Sheet,{open:y,onOpenChange:N,children:(0,s.jsx)(G.SheetContent,{side:"right",className:"w-80 lg:max-w-[85vw] max-w-[90vw] p-0 xl:hidden",children:(0,s.jsxs)("div",{className:"p-6 h-full flex flex-col",children:[(0,s.jsx)(G.SheetHeader,{className:"mb-3",children:(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)(a.default,{src:Y,alt:"Cofinex",height:18,width:160}),(0,s.jsx)(G.SheetTitle,{className:"sr-only",children:"Mobile Menu"})]})}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,s.jsxs)("nav",{className:"space-y-3",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-gray1 uppercase tracking-wider",children:Q("navigation.menu")}),(0,s.jsx)(R,{className:"flex-shrink-0 min-w-[200px] block md:hidden mb-4"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(r.Link,{href:"/market",className:"block py-3 text-foreground hover:text-primary transition-colors font-medium",onClick:ee,children:Q("navigation.markets")}),(0,s.jsxs)(F.Accordion,{type:"single",collapsible:!0,className:"w-full",children:[(0,s.jsxs)(F.AccordionItem,{value:"trade",className:"border-none",children:[(0,s.jsx)(F.AccordionTrigger,{className:"py-3 text-foreground hover:text-primary [&>svg]:text-foreground",children:Q("navigation.trade")}),(0,s.jsx)(F.AccordionContent,{children:(0,s.jsx)("div",{className:"space-y-2 pl-4",children:(0,s.jsx)(z,{iconSrc:"/images/earn.svg",iconAlt:"Spot",title:Q("navigation.spot"),description:Q("wallet.assets.spot_description"),href:"/market/spot/BTC-USDT/",onClick:ee})})})]}),(0,s.jsxs)(F.AccordionItem,{value:"earn",className:"border-none",children:[(0,s.jsx)(F.AccordionTrigger,{className:"py-3 text-foreground hover:text-primary [&>svg]:text-foreground",children:Q("navigation.earn")}),(0,s.jsx)(F.AccordionContent,{children:(0,s.jsxs)("div",{className:"space-y-2 pl-4",children:[(0,s.jsx)(z,{iconSrc:"/images/earn.svg",iconAlt:"Overview",title:Q("navigation.overview"),description:Q("wallet.assets.overview_description"),href:"/dashboard/assets/",onClick:ee}),(0,s.jsx)(z,{iconSrc:"/images/affiliateIcon.svg",iconAlt:"Staking",title:Q("navigation.staking"),description:Q("wallet.assets.staking_description"),href:"/staking/",onClick:ee}),(0,s.jsx)(z,{iconSrc:"/images/simpelearn.svg",iconAlt:"Crypto Packs",title:Q("navigation.crypto_packs"),description:Q("wallet.assets.crypto_packs_description"),href:"/sip",onClick:ee})]})})]}),(0,s.jsxs)(F.AccordionItem,{value:"more",className:"border-none",children:[(0,s.jsx)(F.AccordionTrigger,{className:"py-3 text-foreground hover:text-primary [&>svg]:text-foreground",children:Q("navigation.more")}),(0,s.jsx)(F.AccordionContent,{children:(0,s.jsxs)("div",{className:"space-y-2 pl-4",children:[(0,s.jsx)(z,{iconSrc:"/images/ticket.svg",iconAlt:"FLYCNX",title:Q("navigation.flycnx"),description:Q("navigation.flycnx_description"),href:"https://flycnx.com/",onClick:ee}),(0,s.jsx)(z,{iconSrc:"/images/academy.svg",iconAlt:"Cofinex Academy",title:Q("navigation.cofinex_academy"),description:Q("navigation.cofinex_academy_description"),href:"https://academy.cofinex.io/wp/",onClick:ee})]})})]})]})]}),!e&&(0,s.jsx)("div",{className:"pt-6 border-t border-gray4 lg:hidden block",children:(0,s.jsx)(h.default,{data:b,isLoading:w,selectedToken:I,onSelect:Z,className:"w-full"})}),!e&&(p?(0,s.jsx)("div",{className:"pt-6 border-t border-gray3 lg:hidden flex gap-3",children:(0,s.jsx)(i.Button,{variant:"outline",onClick:f,className:"flex-1",children:Q("navigation.logout")})}):(0,s.jsxs)("div",{className:"pt-6 border-t border-gray4 lg:hidden flex gap-3",children:[(0,s.jsx)(i.Button,{variant:"white",asChild:!0,className:"flex-1",children:(0,s.jsx)(r.Link,{href:"/auth/signup",onClick:ee,children:Q("home.banner.sign_up_now")})}),(0,s.jsx)(i.Button,{variant:"outline",onClick:j,className:"flex-1",disabled:!1,children:Q("navigation.login")})]})),(0,s.jsxs)("div",{className:"pt-6 border-t border-gray4 space-y-3 lg:hidden",children:[(0,s.jsx)(i.Button,{variant:"ghost",asChild:!0,className:"w-full justify-start",children:(0,s.jsxs)(r.Link,{href:"#",onClick:ee,children:[(0,s.jsx)(l.Download,{className:"mr-2",size:16}),Q("navigation.download_app")]})}),(0,s.jsx)(W,{className:"w-full justify-start px-4 h-11",showLabel:!0,onSelect:ee}),(0,s.jsxs)("div",{className:"flex items-center justify-between w-full py-2",children:[(0,s.jsx)("span",{className:"text-sm text-foreground",children:Q("dark"===X?"navigation.dark":"navigation.light")}),(0,s.jsx)(n.default,{})]})]})]})})]})})})]})}],111188)}]);