import{r as o,j as e}from"./app-CM5nFMWo.js";import{M as j}from"./MainLayout-BWrNmSJH.js";import{N as f}from"./NavigationBreadcrumbs-V1HUb-gq.js";import{H as N}from"./HeadWithTitleAndMeta-BoCs9j6n.js";import{I as r}from"./SubscriptionStatusContext-B65uHWyD.js";import"./ChevronRightIcon-BhwgMBUy.js";function k(s){var d,n,x,m,h,g;const[t,c]=o.useState(s.item.attributes.CanBeHq?1:0),[l,v]=o.useState(((d=s.obtained)==null?void 0:d.length)>0?s.obtained[0].id:"");return e.jsxs(j,{auth:s.auth,errors:s.errors,headerBar:s.headerBar,footer:s.footer,fullHeight:!0,children:[e.jsx(N,{title:s.title,meta:s.meta}),e.jsxs("div",{className:"flex flex-col flex-1",children:[e.jsx("div",{className:"bg-black",children:e.jsx(f,{breadcrumbs:s.breadcrumbs,preserveQuery:!0})}),e.jsx("div",{className:"flex flex-col relative min-w-full md:min-w-[350px] ",children:e.jsxs("div",{className:"relative flex flex-row items-center py-5 px-5 bg-gray-800 justify-between",children:[e.jsxs("div",{className:"flex flex-row items-center",children:[e.jsx("img",{className:"mr-5 w-[64px] sm:w-[80px] h-[64px] sm:h-[80px]",alt:"icon",src:s.item.icon}),e.jsxs("div",{className:"flex flex-col justify-center",children:[e.jsxs("h1",{className:"text-lg md:text-2xl font-bold text-"+s.item.cssClassName,children:[s.item.name," ",e.jsx("span",{className:"absolute ml-2",children:t===1?"":""})]}),e.jsx("div",{className:"text-lg text-gray-400 hover:text-gray-100",children:s.item.categoryName})]})]}),e.jsxs("div",{children:[s.item.itemLevel>0&&s.item.classJobCategoryName&&e.jsxs("div",{children:[" ",e.jsx("span",{className:"font-bold text-itemstat",children:s.item.itemLevel})," ",LocalizedStrings.get(s.lang,"strings.Item Level")]}),e.jsxs("div",{className:"flex space-x-2",children:[s.item.classJobCategoryName&&e.jsx("div",{className:"text-itemstat font-bold",children:s.item.classJobCategoryName}),s.item.equipLevel>0&&s.item.classJobCategoryName&&e.jsxs("div",{children:["Lv. ",s.item.equipLevel]})]})]}),e.jsxs("div",{children:[s.item.attributes.IsUnique&&e.jsx("div",{children:LocalizedStrings.get(s.lang,"strings.Unique")}),s.item.attributes.IsUntradable&&e.jsx("div",{children:LocalizedStrings.get(s.lang,"strings.Untradable")})]})]})}),e.jsxs("div",{className:"my-3 sm:my-0 flex flex-row rounded-xl bg-black p-5 relative items-center",children:[e.jsxs("div",{className:"w-[256px] mr-5 h-[256px] relative",children:[e.jsx("img",{className:"block w-[256px] h-[256px] max-w-none",alt:"icon",src:s.item.icon}),e.jsx("img",{className:"absolute -top-[1px] -left-[1px] w-[258px] h-[258px] max-w-none",alt:"overlay",src:"https://assets.tomestone.gg/static/item_overlay.png"})]}),e.jsxs("div",{className:"space-y-5 flex-1 flex flex-col",children:[s.item.attributes.CanBeHq&&e.jsxs("div",{className:"flex flex-row space-x-5",children:[e.jsx("div",{onClick:a=>c(1),className:"cursor-pointer "+(t===1?"text-white border-b-4 border-blue-600":"text-gray-400 hover:text-white"),children:LocalizedStrings.get(s.lang,"strings.High Quality")}),e.jsx("div",{onClick:a=>c(0),className:"cursor-pointer "+(t===0?"text-white border-b-4 border-blue-600":"text-gray-400 hover:text-white"),children:LocalizedStrings.get(s.lang,"strings.Normal Quality")})]}),((x=(n=s.item.stats)==null?void 0:n.stats)==null?void 0:x.length)>0&&e.jsx("div",{children:e.jsx("div",{className:"flex flex-wrap space-x-10 whitespace-nowrap pr-10",children:s.item.stats.stats.map(a=>e.jsxs("div",{className:"flex",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-itemstat",children:a.name}),e.jsx("br",{}),t===1&&a.valueHq?a.valueHq:a.value]},a.name),a.autoAttack>0&&e.jsxs("div",{className:"ml-10",children:[e.jsx("span",{className:"text-itemstat",children:LocalizedStrings.get(s.lang,"strings.Auto-attack")}),e.jsx("br",{}),t===1&&a.autoAttackHq?a.autoAttackHq:a.autoAttack]})]},a.name))})}),((h=(m=s.item.stats)==null?void 0:m.bonuses)==null?void 0:h.length)>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-gray-300 text-sm",children:LocalizedStrings.get(s.lang,"strings.Bonuses")}),e.jsx("div",{className:"flex-wrap flex",children:s.item.stats.bonuses.map(a=>e.jsxs("div",{className:"mr-5",children:[e.jsx("span",{className:"text-itemstat",children:a.name})," +",t===1&&a.valueHq?a.valueHq:a.value,a.max>0?"% ("+LocalizedStrings.get(s.lang,"strings.Max")+" "+(t===1&&a.maxHq?a.maxHq:a.max)+")":""]},a.name))})]}),s.item.attributes.MateriaSlotCount>0&&e.jsxs("div",{children:[e.jsx("div",{className:"text-gray-300 text-sm",children:"Materia Slots"}),e.jsx("div",{className:"whitespace-pre-wrap",children:s.item.attributes.MateriaSlotCount})]}),s.item.description&&e.jsxs("div",{children:[e.jsx("div",{className:"text-gray-300 text-sm",children:"Description"}),e.jsx("div",{className:"whitespace-pre-wrap",dangerouslySetInnerHTML:{__html:s.item.description}})]})]})]}),e.jsxs("div",{className:"lg:grid grid-cols-2 gap-x-5 m-5",children:[e.jsxs("div",{className:" px-5 py-5 rounded-xl bg-gray-800",children:[e.jsxs("div",{className:"break-inside-avoid",children:[e.jsx("div",{className:"text-lg font-bold",children:LocalizedStrings.get(s.lang,"strings.ID")}),e.jsx("div",{className:"mb-5 text-lg text-gray-400",children:s.item.id})]}),e.jsxs("div",{className:"break-inside-avoid",children:[e.jsx("div",{className:"text-lg font-bold",children:LocalizedStrings.get(s.lang,"strings.Patch")}),e.jsx("div",{className:"mb-5 text-lg text-gray-400",children:s.item.patch})]})]}),e.jsx("div",{className:" px-5 py-5 rounded-xl bg-gray-800",children:((g=s.obtained)==null?void 0:g.length)>0&&e.jsx("div",{className:"break-inside-avoid",children:e.jsxs("div",{children:[e.jsx("span",{className:"text-lg font-bold",children:LocalizedStrings.get(s.lang,"strings.Obtained from")}),e.jsxs("div",{className:"rounded-xl bg-black p-5 mt-3",children:[e.jsx("div",{className:"flex flex-row space-x-5 mb-3",children:s.obtained.map(function(a){const i=t===1?a.rewardsHq:a.rewards;return i.length?e.jsxs("div",{onClick:b=>v(a.id),className:"cursor-pointer "+(l===a.id?"text-white border-b-4 border-blue-600":"text-gray-400 hover:text-white"),children:[a.label," (",i.length,")"]},a.id):""})}),l==="quests"&&e.jsx("div",{className:"mb-5 text-lg text-gray-400",children:s.obtained.find(a=>a.id==="quests")[t===1?"rewardsHq":"rewards"].map(a=>e.jsxs(r,{href:a.href,className:"flex w-full items-center hover:bg-gray-900 p-3 rounded-xl",children:[e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx("div",{className:"h-14 w-14 justify-center flex flex-row",children:e.jsx("img",{className:"h-14",src:a.icon,alt:"quest icon"})}),e.jsxs("div",{className:"ml-4 flex-1",children:[e.jsx("div",{className:"font-medium text-lg text-white",children:a.name}),e.jsxs("div",{className:"text-gray-400 text-sm",children:[a.category," (ID: ",a.id,")"]})]})]}),e.jsx("div",{className:"ml-3 flex-none text-base text-gray-400",children:LocalizedStrings.get(s.lang,"strings.Reward")})]},a.id))}),l==="npcs"&&e.jsx("div",{className:"mb-5 text-lg text-gray-400",children:s.obtained.find(a=>a.id==="npcs")[t===1?"rewardsHq":"rewards"].map(a=>e.jsxs("div",{className:"flex w-full items-center hover:bg-gray-900 p-3 rounded-xl",children:[e.jsxs(r,{href:a.href,className:"flex flex-1 items-center",children:[e.jsx("div",{className:"h-14 w-14 justify-center flex flex-row",children:e.jsx("img",{className:"h-14",src:a.icon,alt:"npc icon"})}),e.jsxs("div",{className:"ml-4 flex-1",children:[e.jsx("div",{className:"font-medium text-lg text-white",children:a.name}),e.jsx("div",{className:"text-gray-400 text-sm",children:a.placeName})]})]}),e.jsx("div",{className:"ml-3 flex-none flex text-base text-gray-400",children:a.cost.length?a.cost.map(i=>e.jsxs("div",{href:i.tooltip,className:"eorzeadb_link flex flex-col items-center space-y-1",children:[e.jsx(r,{href:i.href,children:e.jsx("img",{className:"w-8 h-8",src:i.icon,alt:i.name})}),e.jsx("div",{className:"text-sm",children:i.count})]},i.id)):LocalizedStrings.get(s.lang,"strings.Reward")})]},a.id))})]})]})})})]})]})]})}export{k as default};
