hive-react-kit 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/build.css CHANGED
@@ -1769,9 +1769,6 @@
1769
1769
  .fill-current {
1770
1770
  fill: currentcolor;
1771
1771
  }
1772
- .fill-red-500 {
1773
- fill: var(--color-red-500);
1774
- }
1775
1772
  .object-contain {
1776
1773
  object-fit: contain;
1777
1774
  }
package/dist/index.cjs.js CHANGED
@@ -1137,7 +1137,7 @@ ${he}`),ge},clear:()=>{B(""),ue(null),ae(0),ve(null),me&&URL.revokeObjectURL(me)
1137
1137
  transition-colors cursor-pointer`,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:Ae.userAvatar(f.follower),alt:f.follower,className:"w-12 h-12 rounded-full object-cover",onError:h=>{h.target.src=`https://ui-avatars.com/api/?name=${f.follower}&background=random`}}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("h3",{className:"font-semibold text-gray-900 dark:text-white truncate",children:["@",f.follower]})})]})},`${f.follower}-${l}`))})})},b0=({username:t,onSelectUser:r})=>{const[s,n]=k.useState([]),[a,i]=k.useState(!0),[o,c]=k.useState(null),d=async()=>{try{i(!0),c(null);const f=await Ae.getFollowing(t);n(f)}catch(f){c(f instanceof Error?f.message:"Failed to load following list")}finally{i(!1)}};return k.useEffect(()=>{d()},[t]),a?e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[e.jsx(O.Loader2,{className:"w-5 h-5 animate-spin"}),"Loading following list..."]})}):o?e.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] space-y-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:"Failed to load following list"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-4",children:o}),e.jsxs("button",{onClick:d,className:"m-2 inline-flex items-center justify-center rounded-md border border-input text-gray-400 cursor-pointer bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",children:[e.jsx(O.RefreshCw,{className:"w-4 h-4 mr-2"}),"Try Again"]})]})}):s.length===0?e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"This user is not following anyone."})}):e.jsx("div",{className:"space-y-6",children:e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:s.map((f,l)=>e.jsx("div",{onClick:()=>r&&r(f.following),className:`bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700
1138
1138
  rounded-xl p-4 hover:bg-gray-300 dark:hover:bg-gray-700
1139
1139
  transition-colors cursor-pointer`,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:Ae.userAvatar(f.following),alt:f.following,className:"w-12 h-12 rounded-full object-cover",onError:h=>{h.target.src=`https://ui-avatars.com/api/?name=${f.following}&background=random`}}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("h3",{className:"font-semibold text-gray-900 dark:text-white truncate",children:["@",f.following]})})]})},`${f.following}-${l}`))})})},y0=({username:t})=>{const[r,s]=k.useState(null),[n,a]=k.useState(!0),[i,o]=k.useState(null),c=async()=>{try{a(!0),o(null);const u=await Ae.getProfile(t);s(u)}catch(u){o(u instanceof Error?u.message:"Failed to load user details")}finally{a(!1)}};k.useEffect(()=>{c()},[t]);const d=u=>{try{return new Date(u).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}catch{return u}},f=u=>u.replace(/<[^>]*>/g,"");if(n)return e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[e.jsx(O.Loader2,{className:"w-5 h-5 animate-spin"}),"Loading user details..."]})});if(i)return e.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] space-y-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-2",children:"Failed to load user details"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 mb-4",children:i}),e.jsxs("button",{onClick:c,className:"m-2 inline-flex items-center justify-center rounded-md border border-input bg-background p-2 text-sm font-medium text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground disabled:opacity-50 disabled:pointer-events-none",children:[e.jsx(O.RefreshCw,{className:"w-4 h-4"}),"Try Again"]})]})});if(!r?.result)return e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"No user details available"})});const l=r.result,h=l.metadata?.profile;return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-6",children:[h?.about&&e.jsxs("div",{className:"mb-6",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white mb-3",children:"About"}),e.jsx("div",{className:"text-gray-600 dark:text-gray-300 leading-relaxed whitespace-pre-wrap",children:f(h.about)})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 p-4 rounded-lg",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Location"}),e.jsx("p",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:h?.location||"Not specified"})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 p-4 rounded-lg",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Website"}),e.jsx("a",{href:h?.website,target:"_blank",rel:"noopener noreferrer",className:"text-lg font-semibold text-blue-500 hover:underline",children:h?.website||"Not specified"})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 p-4 rounded-lg",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Joined"}),e.jsx("p",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:l.created?d(l.created):"Unknown"})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 p-4 rounded-lg",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Followers"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:l.stats?.followers?.toLocaleString()||"0"})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 p-4 rounded-lg",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Following"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:l.stats?.following?.toLocaleString()||"0"})]}),e.jsxs("div",{className:"bg-gray-50 dark:bg-gray-900 p-4 rounded-lg",children:[e.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Post Count"}),e.jsx("p",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:l.post_count?.toLocaleString()||"0"})]})]})]})})},Hg=({username:t,onVideoClick:r,onAuthorClick:s,onBack:n,onClickUserInfoTab:a,onClickFollowersTab:i,onClickFollowingTab:o,onBookmarkToggle:c,onRss:d,onShare:f,onMoreMenu:l,showMoreMenu:h=!1})=>{const[u,p]=k.useState("videos"),[b,w]=k.useState(null),[x,g]=k.useState(!1),[v,N]=k.useState(!0);k.useEffect(()=>{(async()=>{try{N(!0);const C=await Ae.getProfile(t);w(C)}catch(C){console.error("Failed to fetch user details:",C)}finally{N(!1)}})()},[t]);const j=()=>{if(f)f(t);else{const A=`https://3speak.tv/user/${t}`;navigator.share?navigator.share({title:b?.result?.name||t,url:A}):navigator.clipboard.writeText(A)}},y=()=>{d?d(t):window.open(`https://3speak.tv/rss/${t}.xml`,"_blank")},m=A=>{s(A)};if(v)return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"h-8 bg-gray-200 dark:bg-gray-700 rounded w-32 mb-6"}),e.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl p-6",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[e.jsx("div",{className:"w-16 h-16 bg-gray-200 dark:bg-gray-700 rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("div",{className:"h-6 bg-gray-200 dark:bg-gray-700 rounded w-48"}),e.jsx("div",{className:"h-4 bg-gray-200 dark:bg-gray-700 rounded w-32"})]})]}),e.jsx("div",{className:"flex gap-2",children:Array.from({length:4}).map((A,C)=>e.jsx("div",{className:"h-10 bg-gray-200 dark:bg-gray-700 rounded w-20"},C))})]})]})});const _=b?.result,E=_?.metadata?.profile;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("button",{onClick:n,className:"flex items-center justify-center mr-4 px-2 text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-full",children:[e.jsx(O.ArrowLeft,{className:"w-4 h-4 mr-2"}),"Back"]}),e.jsxs("div",{className:"relative bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden",children:[e.jsx("img",{src:E.cover_image||Ae.userAvatar(t),alt:"Cover",className:"w-full h-48 object-cover",onError:A=>{A.target.src=Ae.userAvatar(t)}}),e.jsx("div",{className:"p-6",children:e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center gap-6",children:[e.jsx("img",{src:E?.profile_image,alt:E?.name,className:"w-24 h-24 rounded-full object-cover border-4 border-white dark:border-gray-800 -mt-16",onError:A=>{A.target.src=Ae.userAvatar(t)}}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-2",children:E?.name||t}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:E?.about||"No description available"}),e.jsxs("div",{className:"flex flex-wrap gap-6 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[e.jsx(O.Users,{className:"w-4 h-4"}),e.jsxs("span",{children:[(_?.stats?.followers||0).toLocaleString()," Followers"]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[e.jsx(O.Users,{className:"w-4 h-4"}),e.jsxs("span",{children:[(_?.stats?.following||0).toLocaleString()," Following"]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-gray-500 dark:text-gray-400",children:[e.jsx(O.Calendar,{className:"w-4 h-4"}),e.jsxs("span",{children:["Joined"," ",_?.created?new Date(_.created).getFullYear():"Unknown"]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Mo,{id:t,toastType:"user",onAdd:(A,C)=>{c?c(A,!0):console.log("Added:",A,C)},onRemove:(A,C)=>{c?c(A,!1):console.log("Removed:",A,C)}}),e.jsx("button",{onClick:y,className:"p-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700",children:e.jsx(O.Rss,{className:"w-4 h-4"})}),e.jsx("button",{onClick:j,className:"p-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700",children:e.jsx(O.Share2,{className:"w-4 h-4"})}),h&&e.jsx("button",{onClick:()=>{l&&l(t)},className:"p-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700",children:e.jsx(O.MoreVertical,{className:"w-4 h-4"})})]})]})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"grid grid-cols-4 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[{key:"videos",label:"Videos"},{key:"about",label:"User Info",callback:a},{key:"followers",label:"Followers",callback:i},{key:"following",label:"Following",callback:o}].map((A,C)=>e.jsx("button",{onClick:()=>{A.callback?A.callback():p(A.key)},className:`px-4 py-2 text-xs sm:text-sm font-medium transition-colors ${u===A.key?"bg-blue-600 dark:bg-blue-500 text-white":"text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-700"}`,children:A.label},A.key))}),e.jsxs("div",{className:"mt-6",children:[u==="videos"&&e.jsx(_n,{feedType:Kt.USER,username:t,onVideoClick:r,onAuthorClick:s}),u==="about"&&e.jsx(y0,{username:t}),u==="followers"&&e.jsx(x0,{username:t,onSelectUser:m}),u==="following"&&e.jsx(b0,{username:t,onSelectUser:m})]})]})]})},Wg=["Spam","Harassment or bullying","Hate speech","Violence or dangerous organizations","Intellectual property violation","Self-harm","Non-consensual intimate images","Doxxing","Minor safety","Other"],Kc=({isOpen:t,onClose:r,onReport:s,reportType:n,targetUsername:a,targetPermlink:i})=>{const[o,c]=k.useState("select"),[d,f]=k.useState(""),[l,h]=k.useState(!1),u=x=>{f(x),c("confirm")},p=async()=>{if(d){h(!0);try{await s(d),r(),c("select"),f("")}catch(x){console.error("Report failed:",x)}finally{h(!1)}}},b=()=>{r(),c("select"),f("")},w=()=>{c("select"),f("")};return t?e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000] p-4",onClick:b,children:e.jsxs("div",{className:"bg-gray-900 rounded-xl shadow-xl max-w-md w-full max-h-[80vh] flex flex-col border border-gray-700",onClick:x=>x.stopPropagation(),children:[e.jsxs("div",{className:"px-6 py-4 border-b border-gray-700",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(O.Flag,{className:"h-5 w-5 text-red-500"}),e.jsxs("h3",{className:"text-lg font-semibold text-white",children:["Report ",n==="user"?"User":"Post"]})]}),e.jsx("button",{onClick:b,className:"p-1 hover:bg-gray-800 rounded transition-colors",children:e.jsx(O.X,{className:"h-5 w-5 text-gray-400"})})]}),e.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:["@",a]})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6",children:[o==="select"&&e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-gray-400 mb-4",children:["Why are you reporting this ",n,"?"]}),e.jsx("div",{className:"space-y-2",children:Wg.map(x=>e.jsx("button",{onClick:()=>u(x),className:"w-full text-left px-4 py-3 border border-gray-700 rounded-lg text-gray-300 hover:bg-gray-800 hover:border-gray-600 transition-colors",children:x},x))})]}),o==="confirm"&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-start space-x-3 mb-4",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(O.AlertTriangle,{className:"h-6 w-6 text-red-500"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"text-sm font-medium text-white mb-2",children:"Report Summary"}),e.jsxs("div",{className:"space-y-2 text-sm text-gray-400",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Type:"})," ",n==="user"?"User":"Post"]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Target:"})," @",a]}),n==="post"&&i&&e.jsxs("p",{children:[e.jsx("strong",{children:"Post:"})," ",i]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Reason:"})," ",d]})]})]})]}),e.jsx("div",{className:"bg-yellow-900/20 border border-yellow-800 rounded-lg p-3",children:e.jsx("p",{className:"text-xs text-yellow-200",children:"Reports are reviewed by our moderation team. False reports may result in action against your account."})})]})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-700 flex items-center justify-end space-x-3",children:[o==="select"&&e.jsx("button",{onClick:b,className:"px-4 py-2 border border-gray-600 text-gray-300 rounded-lg hover:bg-gray-800 transition-colors",children:"Cancel"}),o==="confirm"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:w,className:"px-4 py-2 border border-gray-600 text-gray-300 rounded-lg hover:bg-gray-800 transition-colors",children:"Back"}),e.jsx("button",{onClick:p,disabled:l,className:"px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l?"Reporting...":"Submit Report"})]})]})]})}):null},dn=t=>{const r=new Date,s=new Date(t),n=Math.floor((r.getTime()-s.getTime())/1e3);return n<60?"just now":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<2592e3?`${Math.floor(n/86400)}d ago`:s.toLocaleDateString()},Gg=t=>{if(t===0)return"25";const r=t<0;let s=r?-t:t,n=Math.log10(s);return n=Math.max(n-9,0),n=(r?-1:1)*n,n=n*9+25,Math.round(n).toString()},Jg=t=>{try{return new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}catch{return t}},Qc=t=>{let r=t;return r=r.replace(/<[^>]*>/g,""),r=r.replace(/!\[.*?\]\([^\s)]+\)/g,""),r=r.replace(/\[([^\]]*)\]\([^\s)]+\)/g,"$1"),r=r.replace(/https?:\/\/[^\s)>\]]+/g,""),r=r.replace(/\[.*?\]/g,""),r=r.replace(/\(https?:\/\/[^\s)]*\)/g,""),r=r.replace(/[*_~`#>|]/g,""),r=r.replace(/^[-_*]{3,}\s*$/gm,""),r=r.replace(/\s+/g," ").trim(),r},Yg=({username:t,currentUsername:r,onBack:s,showBackButton:n=!1,tabShown:a,ecencyToken:i,threeSpeakApiKey:o,giphyApiKey:c,templateToken:d,templateApiBaseUrl:f,reportedPosts:l=[],reportedAuthors:h=[],onFollow:u,onUnfollow:p,onIgnoreAuthor:b,onReportUser:w,onUpvote:x,onSubmitComment:g,onClickCommentUpvote:v,onReblog:N,onTip:j,onReportPost:y,onUserClick:m,onPostClick:_,onSnapClick:E,onPollClick:A,onActivityPermlink:C,onActivitySelect:T,onShare:D,onSharePost:L,onCommentClick:H,onFavouriteList:V,onAddToFavourite:z,isFavourited:F=!1,favouriteCount:Y=0})=>{const[G,se]=k.useState(null),[ne,xe]=k.useState(!0),[U,q]=k.useState(null),[B,pe]=k.useState("blogs"),[ee,te]=k.useState([]),[ke,Fe]=k.useState([]),[K,oe]=k.useState([]),[ie,je]=k.useState([]),[De,Re]=k.useState([]),[Be,ue]=k.useState(null),[$e,ae]=k.useState([]),[he,ve]=k.useState([]),[me,Ee]=k.useState({totalHbd:0,totalHpEq:0}),[Te,Ue]=k.useState([]),[Je,ft]=k.useState({totalHp:0,totalHbd:0}),[wt,ht]=k.useState(!1),[At,St]=k.useState([]),[Ct,It]=k.useState([]),[Ze,et]=k.useState([]),[Nt,Ft]=k.useState([]),[jt,Bt]=k.useState(null),[S,P]=k.useState(100),[I,X]=k.useState(!1),[be,Le]=k.useState(!1),[Ye,qe]=k.useState({blogs:!0,posts:!0,snaps:!0,polls:!1,comments:!0,replies:!0,activities:!1,authorRewards:!1,curationRewards:!1,followers:!0,following:!0,wallet:!1,votingPower:!1,badges:!1,witnessVotes:!1}),He=20,bt=100,Tt=k.useRef(null),[Lt,Rt]=k.useState(!1),[Gt,_t]=k.useState(!1),[lt,ge]=k.useState(!1),[Pe,Oe]=k.useState(!1),[Ge,ze]=k.useState(null),mt=k.useRef(null);Lo();const we=t.replace(/^@/,"").trim(),rr=k.useMemo(()=>new Set(l.map($=>`${$.author}/${$.permlink}`)),[l]),Er=k.useMemo(()=>new Set(h),[h]),tt=k.useCallback($=>$.filter(re=>!Er.has(re.author)&&!rr.has(`${re.author}/${re.permlink}`)),[rr,Er]);k.useEffect(()=>{const $=re=>{mt.current&&!mt.current.contains(re.target)&&_t(!1)};return document.addEventListener("click",$),()=>document.removeEventListener("click",$)},[]),k.useEffect(()=>{(async()=>{if(we){xe(!0),q(null);try{const[re,de,le]=await Promise.all([Ae.getProfile(we),Ae.getAccounts([we]),Ae.getDynamicGlobalProperties()]),ce=re?.result,Ce=de?.[0];if(!ce){q("User not found");return}let st;if(le&&Ce?.vesting_shares){const Et=parseFloat(Ce.vesting_shares.split(" ")[0]),xt=parseFloat(le.total_vesting_shares.split(" ")[0]),gt=parseFloat(le.total_vesting_fund_hive.split(" ")[0]);st=Et/xt*gt}let Ie;Ce?.voting_power&&(Ie=Ce.voting_power/1e4*100);let it=!1;if(r&&r!==we)try{it=(await Ae.getFollowing(r)).some(xt=>xt.following===we)}catch{}let dt=null;if(Ce?.posting_json_metadata)try{dt=JSON.parse(Ce.posting_json_metadata)?.profile}catch{}let Ve=null;if(Ce?.json_metadata)try{Ve=JSON.parse(Ce.json_metadata)?.profile}catch{}const Ot=ce.metadata?.profile,Ut={username:ce.name,name:dt?.name||Ve?.name||Ot?.name,about:dt?.about||Ve?.about||Ot?.about,location:dt?.location||Ve?.location||Ot?.location,website:dt?.website||Ve?.website||Ot?.website,profileImage:dt?.profile_image||Ve?.profile_image||Ot?.profile_image,coverImage:dt?.cover_image||Ve?.cover_image||Ot?.cover_image,followersCount:ce.stats?.followers||0,followingCount:ce.stats?.following||0,postsCount:ce.post_count||0,reputation:ce.reputation||0,isFollowing:it,created:ce.created,lastActivity:Ce?.last_post,hivePower:st,votingPower:Ie};se(Ut)}catch(re){console.error("Error fetching user profile:",re),q("Failed to load user profile")}finally{xe(!1)}}})()},[we,r]),k.useEffect(()=>{te([]),Fe([]),Re([]),ue(null),ae([]),ve([]),Ee({totalHbd:0,totalHpEq:0}),Ue([]),ft({totalHp:0,totalHbd:0}),oe([]),je([]),St([]),It([]);const $=a&&a.length>0?a[0]:"blogs";pe($),qe({blogs:!0,posts:!0,snaps:!0,polls:!1,comments:!0,replies:!0,activities:!1,authorRewards:!1,curationRewards:!1,followers:!0,following:!0,wallet:!1,votingPower:!1,badges:!1,witnessVotes:!1}),et([]),Ft([]),Bt(null),P(100)},[we]),k.useEffect(()=>{const $=new AbortController,{signal:re}=$;return(async()=>{if(we){X(!0),ht(!1),B==="authorRewards"&&(ve([]),Ee({totalHbd:0,totalHpEq:0})),B==="curationRewards"&&(Ue([]),ft({totalHp:0,totalHbd:0}));try{switch(B){case"blogs":{const le=tt(await Ae.getUserBlogs(we,He,void 0,void 0,re));te(le),qe(ce=>({...ce,blogs:le.length>=He}));break}case"posts":{const le=tt(await Ae.getUserPosts(we,He,void 0,void 0,re));Fe(le),qe(ce=>({...ce,posts:le.length>=He}));break}case"snaps":{const{snaps:le,nextStartId:ce}=await Ae.getUserSnaps(we,void 0,r,re);Re(tt(le)),ue(ce),qe(Ce=>({...Ce,snaps:ce!==null}));break}case"polls":{const le=tt(await Ae.getUserPolls(we,re));ae(le),qe(ce=>({...ce,polls:!1}));break}case"comments":{const le=tt(await Ae.getUserComments(we,He,void 0,void 0,re));oe(le),qe(ce=>({...ce,comments:le.length>=He}));break}case"replies":{const le=tt(await Ae.getUserReplies(we,He,void 0,void 0,re));je(le),qe(ce=>({...ce,replies:le.length>=He}));break}case"followers":{const le=await Ae.getFollowers(we,null,bt,re);St(le),qe(ce=>({...ce,followers:le.length>=bt}));break}case"following":{const le=await Ae.getFollowing(we,null,bt,re);It(le),qe(ce=>({...ce,following:le.length>=bt}));break}case"authorRewards":{ht(!0);const le=await Ae.getPendingAuthorRewards(we,(ce,Ce,st)=>{re.aborted||(ve([...ce]),Ee({totalHbd:Ce,totalHpEq:st}),X(!1))},re);ve(le.rows),Ee({totalHbd:le.totalHbd,totalHpEq:le.totalHpEq}),ht(!1);break}case"curationRewards":{ht(!0);const le=await Ae.getPendingCurationRewards(we,(ce,Ce,st)=>{re.aborted||(Ue([...ce]),ft({totalHp:Ce,totalHbd:st}),X(!1))},re);Ue(le.rows),ft({totalHp:le.totalHp,totalHbd:le.totalHbd}),ht(!1);break}case"votingPower":{const[le,,ce]=await Promise.all([Ae.getAccounts([we],re),Ae.getDynamicGlobalProperties(re),Ae.getFeedHistory(re)]),Ce=le?.[0];if(Ce){const Ie=Yt=>parseFloat(String(Yt).split(" ")[0])||0,dt=(Ie(Ce.vesting_shares)+Ie(Ce.received_vesting_shares)-Ie(Ce.delegated_vesting_shares))*1e6,Ve=Math.floor(Date.now()/1e3)-Ce.voting_manabar.last_update_time;let Ot=parseFloat(String(Ce.voting_manabar.current_mana))+Ve*dt/432e3;Ot>dt&&(Ot=dt);const Ut=dt>0?Ot/dt*100:0,Et=dt/4,xt=Math.floor(Date.now()/1e3)-Ce.downvote_manabar.last_update_time;let gt=parseFloat(String(Ce.downvote_manabar.current_mana))+xt*Et/432e3;gt>Et&&(gt=Et);const ir=Et>0?gt/Et*100:0;let yr=0;try{const jr=(await(await fetch("https://api.hive.blog/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",method:"rc_api.find_rc_accounts",params:{accounts:[we]},id:1}),signal:re})).json())?.result?.rc_accounts?.[0];if(jr){const Na=parseFloat(jr.rc_manabar.current_mana),M=parseFloat(jr.max_rc);M>0&&(yr=Na/M*100)}}catch{}let vr=0,Fr=0,Ar=0;try{const jr=(await(await fetch("https://api.hive.blog/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",method:"condenser_api.get_reward_fund",params:["post"],id:1}),signal:re})).json())?.result;jr&&(vr=Ie(jr.reward_balance),Fr=parseFloat(jr.recent_claims)||0)}catch{}if(ce?.current_median_history){const Yt=Ie(ce.current_median_history.base),Yr=Ie(ce.current_median_history.quote)||1;Ar=Yt/Yr}Bt({upvotePower:Math.min(Ut,100),downvotePower:Math.min(ir,100),resourceCredits:Math.min(yr,100),maxMana:dt,rewardBalance:vr,recentClaims:Fr,feedPrice:Ar})}break}case"badges":{let le=[],ce=null,Ce=!0;for(;Ce;){const Ie=await Ae.getFollowers(we,ce,1e3,re);le=[...le,...Ie],Ie.length<1e3?Ce=!1:ce=Ie[Ie.length-1].follower}const st=le.map(Ie=>Ie.follower).filter(Ie=>Ie.startsWith("badge-"));et(st);break}case"witnessVotes":{const ce=(await Ae.getAccounts([we],re))?.[0];ce?.witness_votes&&Ft(ce.witness_votes);break}}}catch(le){if(le?.name==="AbortError")return;console.error(`Error fetching ${B}:`,le)}finally{re.aborted||X(!1)}}})(),()=>{$.abort()}},[we,B]);const Or=k.useMemo(()=>tt(ee),[ee,tt]),ar=k.useMemo(()=>tt(ke),[ke,tt]),Rr=k.useMemo(()=>tt(De),[De,tt]),$r=k.useMemo(()=>tt(K),[K,tt]),sr=k.useMemo(()=>tt(ie),[ie,tt]),Nr=k.useMemo(()=>tt($e),[$e,tt]),hr=k.useCallback(async()=>{if(!(be||!Ye[B]||!we)){Le(!0);try{switch(B){case"blogs":{const $=ee[ee.length-1];if(!$)break;const re=await Ae.getUserBlogs(we,He,$.author,$.permlink),de=tt(re.length>0&&re[0].permlink===$.permlink?re.slice(1):re);te(le=>[...le,...de]),qe(le=>({...le,blogs:de.length>=He-1}));break}case"posts":{const $=ke[ke.length-1];if(!$)break;const re=await Ae.getUserPosts(we,He,$.author,$.permlink),de=tt(re.length>0&&re[0].permlink===$.permlink?re.slice(1):re);Fe(le=>[...le,...de]),qe(le=>({...le,posts:de.length>=He-1}));break}case"snaps":{if(!Be)break;const{snaps:$,nextStartId:re}=await Ae.getUserSnaps(we,Be,r);Re(de=>[...de,...tt($)]),ue(re),qe(de=>({...de,snaps:re!==null}));break}case"comments":{const $=K[K.length-1];if(!$)break;const re=await Ae.getUserComments(we,He,$.author,$.permlink),de=tt(re.length>0&&re[0].permlink===$.permlink?re.slice(1):re);oe(le=>[...le,...de]),qe(le=>({...le,comments:de.length>=He-1}));break}case"replies":{const $=ie[ie.length-1];if(!$)break;const re=await Ae.getUserReplies(we,He,$.author,$.permlink),de=tt(re.length>0&&re[0].permlink===$.permlink?re.slice(1):re);je(le=>[...le,...de]),qe(le=>({...le,replies:de.length>=He-1}));break}case"followers":{const $=At[At.length-1];if(!$)break;const re=await Ae.getFollowers(we,$.follower,bt),de=re.length>0&&re[0].follower===$.follower?re.slice(1):re;St(le=>[...le,...de]),qe(le=>({...le,followers:de.length>=bt-1}));break}case"following":{const $=Ct[Ct.length-1];if(!$)break;const re=await Ae.getFollowing(we,$.following,bt),de=re.length>0&&re[0].following===$.following?re.slice(1):re;It(le=>[...le,...de]),qe(le=>({...le,following:de.length>=bt-1}));break}}}catch($){console.error(`Error loading more ${B}:`,$)}finally{Le(!1)}}},[B,we,r,be,Ye,ee,ke,De,Be,K,ie,At,Ct]);k.useEffect(()=>{const $=Tt.current;if(!$)return;const re=new IntersectionObserver(de=>{de[0].isIntersecting&&hr()},{rootMargin:"200px"});return re.observe($),()=>re.disconnect()},[hr]);const W=k.useCallback(async()=>{if(G){Rt(!0),_t(!1);try{const $=G.isFollowing;$&&p?await p(we):!$&&u&&await u(we),se(re=>re&&{...re,isFollowing:!$,followersCount:$?Math.max(0,re.followersCount-1):re.followersCount+1}),setTimeout(async()=>{try{const re=await Ae.getProfile(we);re?.result?.stats&&se(de=>de&&{...de,followersCount:re.result.stats.followers??de.followersCount,followingCount:re.result.stats.following??de.followingCount})}catch{}},3e3)}catch($){console.error("Follow/Unfollow error:",$)}finally{Rt(!1)}}},[G,we,u,p]),Q=k.useCallback(async()=>{Rt(!0);try{b&&await b(we),ge(!1),_t(!1)}catch($){console.error("Error ignoring user:",$)}finally{Rt(!1)}},[we,b]),Ne=k.useCallback(async $=>{Rt(!0);try{w&&await w(we,$),Oe(!1),_t(!1)}catch(re){console.error("Error reporting user:",re)}finally{Rt(!1)}},[we,w]),Se=k.useCallback(()=>{D?.(we)},[we,D]),ut=k.useCallback(async()=>{V&&await V()},[V]),Xe=k.useCallback(async()=>{z&&await z(we)},[we,z]);if(ne)return e.jsxs("div",{className:"dark h-full overflow-y-auto animate-pulse bg-gray-900",children:[e.jsxs("div",{className:"sticky top-0 z-30 bg-gray-900 border-b border-gray-700 px-4 py-3 flex items-center gap-3",children:[n&&e.jsx("div",{className:"w-8 h-8 bg-gray-700 rounded-full"}),e.jsx("div",{className:"w-9 h-9 bg-gray-700 rounded-full"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-28 mb-1.5"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-36"})]}),e.jsx("div",{className:"w-8 h-8 bg-gray-700 rounded-full"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"h-36 sm:h-44 bg-gray-800 w-full"}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-48 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-64 mb-3"}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-20"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-24"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-28"})]})]})]}),e.jsx("div",{className:"border-b border-gray-700 px-2 py-2 flex gap-1 overflow-x-auto",children:[80,64,72,96,80,64,72].map(($,re)=>e.jsx("div",{className:"h-8 bg-gray-800 rounded-lg flex-shrink-0",style:{width:$}},re))}),e.jsx("div",{className:"p-4 space-y-3",children:[1,2,3,4].map($=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-3.5 bg-gray-700 rounded w-24 mb-2"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-full mb-1.5"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-3/5 mb-3"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-12"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-12"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"})]})]})]})},$))})]});if(U||!G)return e.jsx("div",{className:"dark flex items-center justify-center min-h-[400px] bg-gray-900",children:e.jsxs("div",{className:"text-center",children:[e.jsx(O.User,{className:"h-14 w-14 text-gray-500 mx-auto mb-3"}),e.jsx("h3",{className:"text-lg font-medium text-white mb-1",children:"User Not Found"}),e.jsx("p",{className:"text-gray-400",children:U||"This user does not exist"}),n&&s&&e.jsxs("button",{onClick:s,className:"mt-4 inline-flex items-center px-4 py-2 text-sm font-medium rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700",children:[e.jsx(O.ArrowLeft,{className:"h-4 w-4 mr-2"}),"Go Back"]})]})});const kt=({images:$})=>{const[re,de]=k.useState(0),[le,ce]=k.useState(!1);return $.length===0?null:e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"relative w-16 flex-shrink-0 mt-1.5",children:[e.jsx("button",{onClick:Ce=>{Ce.stopPropagation(),ce(!0)},className:"block w-16 h-16 rounded-lg overflow-hidden border border-gray-600 hover:border-blue-500 transition-colors cursor-pointer",children:e.jsx("img",{src:$[re],alt:"",className:"w-full h-full object-cover bg-gray-700",onError:Ce=>{Ce.target.style.display="none"}})}),$.length>1&&e.jsxs("div",{className:"flex items-center justify-between mt-1",children:[e.jsx("button",{onClick:Ce=>{Ce.stopPropagation(),de(st=>(st-1+$.length)%$.length)},className:"p-0.5 text-gray-400 hover:text-white transition-colors",title:"Previous",children:e.jsx(O.ChevronLeft,{className:"h-3.5 w-3.5"})}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:[re+1,"/",$.length]}),e.jsx("button",{onClick:Ce=>{Ce.stopPropagation(),de(st=>(st+1)%$.length)},className:"p-0.5 text-gray-400 hover:text-white transition-colors",title:"Next",children:e.jsx(O.ChevronRight,{className:"h-3.5 w-3.5"})})]})]}),le&&e.jsx("div",{className:"fixed inset-0 z-[2000] bg-black/80 flex items-center justify-center p-4",onClick:()=>ce(!1),children:e.jsxs("div",{className:"relative max-w-3xl max-h-[85vh] w-full flex items-center justify-center",onClick:Ce=>Ce.stopPropagation(),children:[e.jsx("img",{src:$[re],alt:"",className:"max-w-full max-h-[80vh] rounded-lg object-contain"}),e.jsx("button",{onClick:()=>ce(!1),className:"absolute top-2 right-2 text-white/70 hover:text-white bg-black/50 rounded-full p-1.5 transition-colors",title:"Close",children:e.jsx("span",{className:"text-lg leading-none",children:"×"})}),$.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:Ce=>{Ce.stopPropagation(),de(st=>(st-1+$.length)%$.length)},className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white rounded-full p-2 transition-colors",children:e.jsx(O.ChevronLeft,{className:"h-5 w-5"})}),e.jsx("button",{onClick:Ce=>{Ce.stopPropagation(),de(st=>(st+1)%$.length)},className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/70 text-white rounded-full p-2 transition-colors",children:e.jsx(O.ChevronRight,{className:"h-5 w-5"})}),e.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 bg-black/50 text-white text-xs px-3 py-1 rounded-full",children:[re+1," / ",$.length]})]})]})})]})},Pt=($,re,de)=>{const le=$.json_metadata?.image?.length?$.json_metadata.image:[],ce=$.json_metadata?.description||($.body?Qc($.body):""),Ce=$.payout?$.payout.toFixed(3):$.pending_payout_value?$.pending_payout_value.replace(/[^\d.]/g,""):"0.000",st=Ce,Ie=[],it=$.percent_hbd??1e4;if(it===0?Ie.push("Hive Rewards Payout 100% Powered Up"):Ie.push(`Hive Rewards Payout (${(it/200).toFixed(0)}%/${100-it/200}%)`),$.is_paidout){const Ve=$.author_payout_value?$.author_payout_value.replace(/[^\d.]/g,""):"";Ie.push("Past payouts:"),Ie.push(`${Ce} Hive Rewards${Ve?` (Author ${Ve})`:""}`)}else{if($.payout_at){const Ve=new Date($.payout_at),Ot=new Date,Ut=Ve.getTime()-Ot.getTime();if(Ut>0){const Et=Math.floor(Ut/36e5),xt=Math.floor(Et/24),gt=Et%24,ir=xt>0?`in ${xt} day${xt>1?"s":""}${gt>0?` ${gt} hour${gt>1?"s":""}`:""}`:`in ${Et} hour${Et>1?"s":""}`;Ie.push(`Payout will occur: ${ir}`)}}it===0?Ie.push(`${Ce} Hive Rewards (100% Powered Up)`):Ie.push(`${Ce} Hive Rewards (${(it/200).toFixed(0)}%/${100-it/200}%)`)}$.beneficiaries?.length>0&&(Ie.push("Beneficiaries:"),$.beneficiaries.forEach(Ve=>{Ie.push(`${Ve.account}: ${(Ve.weight/100).toFixed(0)}%`)}));const dt=Ie.join(`
1140
- `);return e.jsxs("div",{className:`border border-gray-700 rounded-lg p-4 bg-gray-800 hover:bg-gray-700 transition-colors ${de?"cursor-pointer":""}`,onClick:de,children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center gap-1.5 flex-shrink-0 w-16",children:[e.jsx("img",{src:`https://images.hive.blog/u/${$.author}/avatar`,alt:$.author,className:"w-10 h-10 rounded-full bg-gray-700 flex-shrink-0",onError:Ve=>{Ve.target.src=`https://ui-avatars.com/api/?name=${$.author}&background=random&size=40`}}),e.jsx(kt,{images:le})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("button",{onClick:Ve=>{Ve.stopPropagation(),m?.($.author)},className:"font-medium text-white hover:text-blue-400 text-sm",children:["@",$.author]}),e.jsx("span",{className:"text-xs text-gray-500",children:dn($.created)})]}),$.title&&e.jsx("button",{onClick:()=>_?.($.author,$.permlink,$.title),className:"text-left text-base font-semibold text-white mb-1 line-clamp-2 hover:text-blue-400",children:$.title}),ce&&e.jsx("p",{className:"text-gray-400 text-sm line-clamp-2",children:ce.substring(0,200)}),$.community_title&&e.jsxs("span",{className:"inline-block mt-1 text-xs text-blue-400 font-medium",children:["#",$.community_title]})]})]}),e.jsx("div",{className:"mt-3 pt-2 border-t border-gray-700/50",onClick:Ve=>Ve.stopPropagation(),children:e.jsx(jn,{author:$.author,permlink:$.permlink,currentUser:r,hiveValue:st,hiveIconUrl:"/images/hive_logo.png",payoutTooltip:dt,initialVotes:$.active_votes||[],initialCommentsCount:$.children||0,onUpvote:x?Ve=>x($.author,$.permlink,Ve):void 0,onSubmitComment:g?(Ve,Ot,Ut)=>g(Ve,Ot,Ut):void 0,onClickCommentUpvote:v,onReblog:$.author!==r&&N?()=>N($.author,$.permlink):void 0,onShare:L?()=>L($.author,$.permlink):void 0,onTip:$.author!==r&&j?()=>j($.author,$.permlink):void 0,onReport:$.author!==r&&y?()=>ze({author:$.author,permlink:$.permlink}):void 0,disableCommentsModal:!!H,onComments:H?()=>H($.author,$.permlink):void 0,ecencyToken:i,threeSpeakApiKey:o,giphyApiKey:c,templateToken:d,templateApiBaseUrl:f})})]},`${$.author}/${$.permlink}`)},Ht=$=>{const re=$.poll_stats?.total_voting_accounts_num||0,de=$.status==="Active",Ce=new Date($.end_time)<new Date,st=$.post_body?Qc($.post_body):"",Ie=$.poll_choices?.length||0;return e.jsxs("div",{className:"border border-gray-700 rounded-lg bg-gray-800 hover:bg-gray-700/50 transition-colors cursor-pointer",onClick:()=>A?.($.author,$.permlink,$.question),children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:`https://images.hive.blog/u/${$.author}/avatar`,alt:$.author,className:"w-8 h-8 rounded-full bg-gray-700",onError:it=>{it.target.src=`https://ui-avatars.com/api/?name=${$.author}&background=random&size=32`}}),e.jsxs("div",{children:[e.jsxs("button",{onClick:it=>{it.stopPropagation(),m?.($.author)},className:"text-sm font-medium text-white hover:text-blue-400",children:["@",$.author]}),e.jsx("p",{className:"text-[10px] text-gray-500",children:dn($.created)})]})]}),e.jsx("span",{className:`text-[10px] font-semibold px-2 py-0.5 rounded-full ${de&&!Ce?"bg-green-500/20 text-green-400":"bg-gray-600/30 text-gray-400"}`,children:de&&!Ce?"Active":"Ended"})]}),e.jsx("h3",{className:"text-sm font-semibold text-white mb-1",children:$.question}),st&&e.jsx("p",{className:"text-gray-400 text-xs line-clamp-2 mb-2",children:st.substring(0,150)}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-500",children:[e.jsxs("span",{children:[re," voter",re!==1?"s":""]}),e.jsxs("span",{children:[Ie," option",Ie!==1?"s":""]}),$.poll_stats?.total_hive_hp!=null&&$.poll_stats.total_hive_hp>0&&e.jsxs("span",{children:[($.poll_stats.total_hive_hp/1e3).toFixed(1),"k HP"]}),$.end_time&&e.jsx("span",{children:de&&!Ce?`Ends ${dn($.end_time)}`:"Ended"})]})]}),e.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-gray-700/50",onClick:it=>it.stopPropagation(),children:e.jsx(jn,{author:$.author,permlink:$.permlink,currentUser:r,hiveIconUrl:"/images/hive_logo.png",initialVotes:[],initialCommentsCount:0,onUpvote:x?it=>x($.author,$.permlink,it):void 0,onSubmitComment:g?(it,dt,Ve)=>g(it,dt,Ve):void 0,onClickCommentUpvote:v,onReblog:$.author!==r&&N?()=>N($.author,$.permlink):void 0,onShare:L?()=>L($.author,$.permlink):void 0,onTip:$.author!==r&&j?()=>j($.author,$.permlink):void 0,onReport:$.author!==r&&y?()=>ze({author:$.author,permlink:$.permlink}):void 0,disableCommentsModal:!!H,onComments:H?()=>H($.author,$.permlink):void 0,ecencyToken:i,threeSpeakApiKey:o,giphyApiKey:c,templateToken:d,templateApiBaseUrl:f})})]},`${$.author}/${$.permlink}`)},pt=($,re)=>e.jsx("div",{className:"border border-gray-700 rounded-lg p-4 bg-gray-800 hover:bg-gray-700 transition-colors",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:`https://images.hive.blog/u/${$}/avatar`,alt:$,className:"w-10 h-10 rounded-full flex-shrink-0 bg-gray-700",onError:de=>{de.target.src=`https://ui-avatars.com/api/?name=${$}&background=random&size=40`}}),e.jsxs("button",{onClick:()=>m?.($),className:"font-medium text-white hover:text-blue-400",children:["@",$]})]})},`${$}-${re}`),ct=($=5)=>e.jsx("div",{className:"space-y-3 animate-pulse",children:Array.from({length:$},(re,de)=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"h-3.5 bg-gray-700 rounded w-24"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"})]}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-full mb-1.5"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-3/5 mb-3"}),de%2===0&&e.jsx("div",{className:"h-32 bg-gray-700 rounded-lg w-20 mb-3"}),e.jsxs("div",{className:"flex gap-4 mt-2",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-12"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-12"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-12"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"})]})]})]})},de))}),Dt=($=8)=>e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3 animate-pulse",children:Array.from({length:$},(re,de)=>e.jsx("div",{className:"border border-gray-700 rounded-lg p-4 bg-gray-800",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full flex-shrink-0"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-28"})]})},de))}),Vt=($=3)=>e.jsx("div",{className:"space-y-3 animate-pulse",children:Array.from({length:$},(re,de)=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"h-3.5 bg-gray-700 rounded w-24"}),e.jsx("div",{className:"h-5 bg-gray-700 rounded-full w-14"})]}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5 mb-3"}),e.jsxs("div",{className:"space-y-2 mb-3",children:[e.jsx("div",{className:"h-8 bg-gray-700 rounded-lg w-full"}),e.jsx("div",{className:"h-8 bg-gray-700 rounded-lg w-full"}),e.jsx("div",{className:"h-8 bg-gray-700 rounded-lg w-3/4"})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-20"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-24"})]})]})]})},de))}),Mt=()=>e.jsxs("div",{className:"space-y-3 animate-pulse",children:[e.jsxs("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"w-5 h-5 bg-gray-700 rounded"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-44"})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[1,2,3,4].map($=>e.jsxs("div",{className:"bg-gray-900/50 rounded-lg p-2.5",children:[e.jsx("div",{className:"h-2.5 bg-gray-700 rounded w-12 mb-2"}),e.jsx("div",{className:"h-5 bg-gray-700 rounded w-16"})]},$))})]}),[1,2,3,4,5].map($=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-7 h-7 bg-gray-700 rounded-lg"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/3 mb-3"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-20"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"})]})]})]})},$))]}),er=()=>{switch(B){case"blogs":case"posts":case"snaps":case"comments":case"replies":return ct();case"followers":case"following":case"badges":case"witnessVotes":return Dt();case"polls":return Vt();case"authorRewards":case"curationRewards":return Mt();default:return ct()}},nr=$=>{if(!$||!isFinite($)||$<=0)return"—";const re=Math.floor($/1e3),de=Math.floor(re/60),le=Math.floor(de/60),ce=Math.floor(le/24);return ce>=1?`${ce}d ${le%24}h`:le>=1?`${le}h ${de%60}m`:`${Math.max(1,de)}m`},Jt=($,re=3)=>$==null||isNaN($)?"—":Number($).toLocaleString(void 0,{maximumFractionDigits:re,minimumFractionDigits:re}),or=()=>{if(I&&he.length===0)return Mt();if(he.length===0&&!wt)return e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Award,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No pending author rewards"}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"Rewards appear for posts/comments with pending payouts"})]});const $=he.filter(de=>!de.isComment).length,re=he.length-$;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-gradient-to-r from-amber-900/30 to-orange-900/30 rounded-xl p-4 border border-amber-700/40",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(O.Award,{className:"w-5 h-5 text-amber-400"}),e.jsx("h3",{className:"text-sm font-semibold text-amber-300",children:"Pending Author Rewards"})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Posts"}),e.jsx("p",{className:"text-lg font-bold text-white",children:$})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Comments"}),e.jsx("p",{className:"text-lg font-bold text-white",children:re})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Total HBD"}),e.jsxs("p",{className:"text-lg font-bold text-amber-400",children:["$",Jt(me.totalHbd)]})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Total HP"}),e.jsx("p",{className:"text-lg font-bold text-orange-400",children:Jt(me.totalHpEq)})]})]})]}),he.map((de,le)=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700 hover:border-gray-600 transition-colors cursor-pointer",onClick:()=>_?.(de.author,de.permlink,de.title),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0 ${de.isComment?"bg-blue-900/40 text-blue-400":"bg-emerald-900/40 text-emerald-400"}`,children:de.isComment?e.jsx(O.MessageCircle,{className:"w-3.5 h-3.5"}):e.jsx(O.FileText,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h4",{className:"text-sm font-medium text-white truncate",children:de.title||`${de.author}/${de.permlink}`}),e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0 ${de.isComment?"bg-blue-900/40 text-blue-300":"bg-emerald-900/40 text-emerald-300"}`,children:de.isComment?"Comment":"Post"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 mt-2 text-xs text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Clock,{className:"w-3 h-3"}),"Payout in ",nr(de.payoutMs)]}),e.jsxs("span",{className:"text-amber-400 font-medium",children:["$",Jt(de.hbd)," HBD"]}),de.hpEq!==null&&e.jsxs("span",{className:"text-orange-400 font-medium",children:[Jt(de.hpEq)," HP"]}),de.beneficiaryCut>0&&e.jsxs("span",{className:"text-gray-500",children:["Beneficiary: ",(de.beneficiaryCut*100).toFixed(0),"%"]})]})]})]})},`${de.author}-${de.permlink}-${le}`)),wt&&e.jsx("div",{className:"animate-pulse space-y-3",children:[1,2].map(de=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-7 h-7 bg-gray-700 rounded-lg"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4 mb-2"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-20"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"})]})]})]})},de))})]})},mr=()=>{if(I&&Te.length===0)return Mt();if(Te.length===0&&!wt)return e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.TrendingUp,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No pending curation rewards"}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"Rewards appear for posts you voted on with pending payouts"})]});const $=Te.filter(ce=>!ce.isComment).length,re=Te.length-$,de=Te.filter(ce=>ce.efficiency!==null),le=de.length>0?de.reduce((ce,Ce)=>ce+(Ce.efficiency||0),0)/de.length:null;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-gradient-to-r from-blue-900/30 to-purple-900/30 rounded-xl p-4 border border-blue-700/40",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(O.TrendingUp,{className:"w-5 h-5 text-blue-400"}),e.jsx("h3",{className:"text-sm font-semibold text-blue-300",children:"Pending Curation Rewards"})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-3",children:[e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Posts"}),e.jsx("p",{className:"text-lg font-bold text-white",children:$})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Comments"}),e.jsx("p",{className:"text-lg font-bold text-white",children:re})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Total HP"}),e.jsx("p",{className:"text-lg font-bold text-blue-400",children:Jt(Je.totalHp)})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Total HBD"}),e.jsxs("p",{className:"text-lg font-bold text-purple-400",children:["$",Jt(Je.totalHbd)]})]}),le!==null&&e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Avg Efficiency"}),e.jsxs("p",{className:`text-lg font-bold ${le>=100?"text-emerald-400":"text-amber-400"}`,children:[le.toFixed(1),"%"]})]})]})]}),Te.map((ce,Ce)=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700 hover:border-gray-600 transition-colors cursor-pointer",onClick:()=>_?.(ce.author,ce.permlink,ce.title),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0 ${ce.isComment?"bg-blue-900/40 text-blue-400":"bg-emerald-900/40 text-emerald-400"}`,children:ce.isComment?e.jsx(O.MessageCircle,{className:"w-3.5 h-3.5"}):e.jsx(O.FileText,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"text-sm font-medium text-white truncate",children:ce.title||`${ce.author}/${ce.permlink}`}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["by @",ce.author]})]}),e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0 ${ce.isComment?"bg-blue-900/40 text-blue-300":"bg-emerald-900/40 text-emerald-300"}`,children:ce.isComment?"Comment":"Post"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 mt-2 text-xs text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Clock,{className:"w-3 h-3"}),"Payout in ",nr(ce.payoutMs)]}),e.jsxs("span",{className:"text-blue-400 font-medium",children:[Jt(ce.hp)," HP"]}),e.jsxs("span",{className:"text-purple-400 font-medium",children:["$",Jt(ce.hbd)," HBD"]}),e.jsxs("span",{className:"text-gray-500",children:["Vote: ",ce.weightPct.toFixed(0),"%"]}),ce.efficiency!==null&&e.jsxs("span",{className:`font-medium ${ce.efficiency>=100?"text-emerald-400":"text-amber-400"}`,children:["Eff: ",ce.efficiency.toFixed(1),"%"]}),ce.votedAfterMs!==null&&e.jsxs("span",{className:"text-gray-500",children:["Voted after ",nr(ce.votedAfterMs)]})]})]})]})},`${ce.author}-${ce.permlink}-${Ce}`)),wt&&e.jsx("div",{className:"animate-pulse space-y-3",children:[1,2].map(ce=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-7 h-7 bg-gray-700 rounded-lg"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/3 mb-3"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-20"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-14"})]})]})]})},ce))})]})},tr=()=>{if(B==="wallet")return e.jsx("div",{className:"max-w-lg mx-auto",children:e.jsx(u0,{username:we})});if(B==="activities")return e.jsx(f0,{username:we,onClickPermlink:C,onSelectActivity:T});if(B==="authorRewards")return or();if(B==="curationRewards")return mr();if(B==="votingPower"){if(I)return e.jsxs("div",{className:"max-w-lg mx-auto space-y-6 animate-pulse",children:[[1,2,3].map(xt=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-32"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded-full w-full"})]},xt)),e.jsxs("div",{className:"mt-4 p-4 bg-gray-800 rounded-xl border border-gray-700",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-40 mb-3"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded-full w-full"})]})]});if(!jt)return e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Gauge,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"Voting power data unavailable"})]});const{maxMana:le,rewardBalance:ce,recentClaims:Ce,feedPrice:st}=jt,Ie=S*100,it=le*.02*(Ie/1e4),dt=Ce>0?it/Ce*ce:0,Ve=dt*st,Ot=jt.upvotePower<S*2/100,Ut=(xt,gt=3)=>isNaN(xt)?"—":xt.toLocaleString(void 0,{minimumFractionDigits:gt,maximumFractionDigits:gt}),Et=[{label:"Voting Power",value:jt.upvotePower,color:"#10b981"},{label:"Downvote Power",value:jt.downvotePower,color:"#f59e0b"},{label:"Resource Credits",value:jt.resourceCredits,color:"#3b82f6"}];return e.jsxs("div",{className:"max-w-lg mx-auto space-y-6",children:[e.jsxs("div",{className:"p-4 rounded-xl bg-gray-800 border border-gray-700",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-200",children:"Vote Value"}),e.jsxs("span",{className:"text-xs font-bold text-blue-400",children:[S,"%"]})]}),e.jsx("div",{className:"text-[13px] text-gray-400 mb-3",children:Ce>0?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-white font-medium",children:[Ut(Ve)," HBD"]}),e.jsx("span",{className:"mx-1.5",children:"·"}),e.jsxs("span",{className:"text-gray-300",children:["~",Ut(dt)," HIVE"]}),Ot&&e.jsx("span",{className:"ml-2 text-amber-400 text-xs",children:"⚠ low mana"})]}):e.jsxs("span",{children:["Vote @",S,"% · —"]})}),e.jsx("input",{type:"range",min:0,max:100,step:5,value:S,onChange:xt=>P(Number(xt.target.value)),className:"w-full h-2 rounded-full appearance-none cursor-pointer",style:{background:`linear-gradient(to right, #3b82f6 0%, #3b82f6 ${S}%, #374151 ${S}%, #374151 100%)`,accentColor:"#3b82f6"}}),e.jsxs("div",{className:"flex justify-between text-[11px] text-gray-500 mt-1",children:[e.jsx("span",{children:"0%"}),e.jsx("span",{children:"25%"}),e.jsx("span",{children:"50%"}),e.jsx("span",{children:"75%"}),e.jsx("span",{children:"100%"})]})]}),Et.map(xt=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm font-medium text-gray-300",children:xt.label}),e.jsxs("span",{className:"text-sm font-bold text-white",children:[xt.value.toFixed(2),"%"]})]}),e.jsx("div",{className:"w-full bg-gray-700 rounded-full h-3",children:e.jsx("div",{className:"h-3 rounded-full transition-all duration-500 ease-out",style:{width:`${Math.min(xt.value,100)}%`,backgroundColor:xt.color}})})]},xt.label))]})}if(B==="badges")return I?Dt():Ze.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Award,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No badges found"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Ze.map((le,ce)=>pt(le,ce))});if(B==="witnessVotes")return I?Dt():Nt.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Shield,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No witness votes found"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Nt.map((le,ce)=>pt(le,ce))});if(I)return er();if(B==="followers")return At.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Users,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No followers found"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3",children:At.map((le,ce)=>pt(le.follower,ce))});if(B==="following")return Ct.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Users,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"Not following anyone"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Ct.map((le,ce)=>pt(le.following,ce))});if(B==="polls")return Nr.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.BarChart3,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No polls found"})]}):e.jsx("div",{className:"space-y-3",children:Nr.map(le=>Ht(le))});const re={blogs:{data:Or,type:"blog",icon:O.FileText},posts:{data:ar,type:"post",icon:O.FileText},snaps:{data:Rr,type:"post",icon:O.Camera},comments:{data:$r,type:"comment",icon:O.MessageCircle},replies:{data:sr,type:"reply",icon:O.Reply}}[B];if(!re)return null;if(re.data.length===0){const le=re.icon;return e.jsxs("div",{className:"text-center py-12",children:[e.jsx(le,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsxs("p",{className:"text-gray-400",children:["No ",B," found"]})]})}const de=le=>{if(B==="snaps"&&E)return()=>E(le.author,le.permlink);if((B==="blogs"||B==="posts")&&_)return()=>_(le.author,le.permlink,le.title)};return e.jsx("div",{className:"space-y-3",children:re.data.map(le=>Pt(le,re.type,de(le)))})},br=[{id:"blogs",label:"Blogs",icon:O.FileText},{id:"posts",label:"Posts",icon:O.FileText},{id:"snaps",label:"Snaps",icon:O.Camera},{id:"polls",label:"Polls",icon:O.BarChart3},{id:"comments",label:"Comments",icon:O.MessageCircle},{id:"replies",label:"Replies",icon:O.Reply},{id:"activities",label:"Activities",icon:O.Activity},{id:"authorRewards",label:"Author Rewards",icon:O.Award},{id:"curationRewards",label:"Curation Rewards",icon:O.TrendingUp},{id:"followers",label:"Followers",icon:O.Users},{id:"following",label:"Following",icon:O.Users},{id:"wallet",label:"Wallet",icon:O.Wallet},{id:"votingPower",label:"Voting Power",icon:O.Gauge},{id:"badges",label:"Badges",icon:O.Award},{id:"witnessVotes",label:"Witness Votes",icon:O.Shield}],Ir=a&&a.length>0?a.map($=>br.find(re=>re.id===$)).filter($=>$!==void 0):br,nt=r&&r!==we;return e.jsx("div",{className:"dark flex flex-col h-full bg-gray-900",children:e.jsxs("div",{className:"flex flex-col overflow-y-auto h-full",children:[e.jsx("div",{className:"sticky top-0 z-30 h-[56px] bg-gray-800/95 backdrop-blur-sm border-b border-gray-700 flex items-center",children:e.jsxs("div",{className:"px-4 py-2 flex items-center gap-2 w-full",children:[n&&s&&e.jsx("button",{onClick:s,className:"p-1.5 hover:bg-gray-700 rounded-lg transition-colors flex-shrink-0",children:e.jsx(O.ArrowLeft,{className:"h-5 w-5 text-gray-300"})}),e.jsx("img",{src:G.profileImage||`https://images.hive.blog/u/${we}/avatar`,alt:we,className:"w-8 h-8 rounded-full flex-shrink-0 bg-gray-700",onError:$=>{$.target.src=`https://images.hive.blog/u/${we}/avatar`}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{className:"text-sm font-semibold text-white truncate",children:`@${we}`}),G.reputation>0&&e.jsx("span",{className:"text-[10px] bg-gray-700 text-gray-300 px-1.5 py-0.5 rounded-full flex-shrink-0",children:Gg(G.reputation)})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-400",children:[e.jsxs("button",{onClick:()=>pe("followers"),className:"hover:text-white transition-colors",children:[e.jsx("span",{className:"font-semibold text-gray-200",children:G.followersCount.toLocaleString()})," Followers"]}),e.jsxs("button",{onClick:()=>pe("following"),className:"hover:text-white transition-colors",children:[e.jsx("span",{className:"font-semibold text-gray-200",children:G.followingCount.toLocaleString()})," Following"]}),e.jsxs("span",{children:[e.jsx("span",{className:"font-semibold text-gray-200",children:G.postsCount.toLocaleString()})," Posts"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[V&&e.jsxs("button",{onClick:ut,className:"p-1.5 hover:bg-gray-700 rounded-lg transition-colors relative",title:"Favourite list",children:[e.jsx(O.Heart,{className:"h-4 w-4 text-gray-400"}),Y>0&&e.jsx("span",{className:"absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-4 w-4 flex items-center justify-center",children:Y>99?"99+":Y})]}),e.jsx("button",{onClick:Se,className:"p-1.5 hover:bg-gray-700 rounded-lg transition-colors",title:"Share profile",children:e.jsx(O.Share2,{className:"h-4 w-4 text-gray-400"})}),nt&&e.jsxs("div",{className:"relative",ref:mt,children:[e.jsx("button",{onClick:()=>_t($=>!$),className:"p-1.5 hover:bg-gray-700 rounded-lg transition-colors",title:"More actions",children:e.jsx(O.MoreVertical,{className:"h-4 w-4 text-gray-400"})}),Gt&&e.jsxs("div",{className:"absolute right-0 mt-1 w-48 rounded-lg border border-gray-700 bg-gray-800 shadow-xl z-[100]",onClick:$=>$.stopPropagation(),children:[(u||p)&&e.jsx("button",{onClick:()=>{_t(!1),W()},disabled:Lt,className:"w-full px-4 py-2.5 text-left text-sm text-gray-200 hover:bg-gray-700 disabled:opacity-50 first:rounded-t-lg",children:G.isFollowing?"Unfollow":"Follow"}),b&&e.jsx("button",{onClick:()=>{_t(!1),ge(!0)},disabled:Lt,className:"w-full px-4 py-2.5 text-left text-sm text-red-400 hover:bg-red-900/20 disabled:opacity-50",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O.Ban,{className:"h-4 w-4"})," Ignore Author"]})}),w&&e.jsx("button",{onClick:()=>{_t(!1),Oe(!0)},disabled:Lt,className:"w-full px-4 py-2.5 text-left text-sm text-orange-400 hover:bg-orange-900/20 disabled:opacity-50 last:rounded-b-lg",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O.Flag,{className:"h-4 w-4"})," Report User"]})})]})]})]})]})}),e.jsxs("div",{className:"relative",children:[G.coverImage?e.jsx("div",{className:"w-full h-24 sm:h-32 bg-cover bg-center",style:{backgroundImage:`url(${G.coverImage})`}}):e.jsx("div",{className:"w-full h-24 sm:h-32 bg-gradient-to-r from-blue-600 to-purple-700"}),e.jsx("div",{className:"absolute inset-0 bg-gray-900/80"}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 px-4 pb-3 pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h2",{className:"text-sm font-semibold text-white truncate",children:G.name||`@${we}`}),G.about&&e.jsx("p",{className:"text-gray-300 text-xs leading-relaxed mt-1 line-clamp-2",children:G.about})]}),z&&e.jsx("button",{onClick:Xe,className:"p-2 hover:bg-white/10 rounded-lg transition-colors ml-2 flex-shrink-0",title:F?"Remove from favourites":"Add to favourites",children:e.jsx(O.Heart,{className:`h-5 w-5 ${F?"text-red-500 fill-red-500":"text-white"}`})})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 mt-1.5 text-[11px] text-gray-300",children:[G.location&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.MapPin,{className:"h-3 w-3 text-rose-400"})," ",G.location]}),G.website&&e.jsxs("a",{href:G.website.startsWith("http")?G.website:`https://${G.website}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-blue-400 hover:underline",children:[e.jsx(O.Globe,{className:"h-3 w-3 text-blue-400"})," ",G.website]}),G.created&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Calendar,{className:"h-3 w-3 text-green-400"})," ",Jg(G.created)]}),G.lastActivity&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Clock,{className:"h-3 w-3 text-amber-400"})," ",dn(G.lastActivity)]}),G.votingPower!==void 0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Zap,{className:"h-3 w-3 text-yellow-400"})," VP ",G.votingPower.toFixed(1),"%"]}),G.hivePower!==void 0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Zap,{className:"h-3 w-3 text-orange-400"})," HP ",G.hivePower.toFixed(0)]})]})]})]}),e.jsx("div",{className:"sticky top-[56px] z-20 bg-gray-800 border-b border-gray-700",children:e.jsx("div",{className:"flex overflow-x-auto scrollbar-hide",children:Ir.map($=>{const re=$.icon;return e.jsxs("button",{onClick:()=>pe($.id),className:`flex items-center gap-1 px-3 sm:px-4 py-2.5 text-xs sm:text-sm font-medium whitespace-nowrap transition-colors border-b-2 ${B===$.id?"text-blue-400 border-blue-400":"text-gray-400 border-transparent hover:text-gray-300 hover:border-gray-600"}`,children:[e.jsx(re,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:$.label})]},$.id)})})}),e.jsxs("div",{className:"p-4 flex-1",children:[tr(),B!=="wallet"&&Ye[B]&&e.jsx("div",{ref:Tt,className:"min-h-[60px] py-2",children:be?e.jsx("div",{className:"animate-pulse space-y-3",children:B==="followers"||B==="following"?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3",children:[1,2].map($=>e.jsx("div",{className:"border border-gray-700 rounded-lg p-4 bg-gray-800",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-28"})]})},$))}):e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-3.5 bg-gray-700 rounded w-24 mb-2"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/2"})]})]})})}):e.jsx("div",{className:"h-1"})}),B!=="wallet"&&!Ye[B]&&!I&&e.jsxs("div",{className:"text-center py-4 text-xs text-gray-600",children:["No more ",B," to load"]})]}),lt&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000] p-4",onClick:()=>ge(!1),children:e.jsxs("div",{className:"bg-gray-800 rounded-xl shadow-xl max-w-sm w-full border border-gray-700 p-6",onClick:$=>$.stopPropagation(),children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"Ignore Author"}),e.jsxs("p",{className:"text-sm text-gray-300 mb-6",children:["Are you sure you want to ignore"," ",e.jsxs("span",{className:"text-red-400 font-medium",children:["@",we]}),"? Their content will be hidden from your feed."]}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("button",{onClick:()=>ge(!1),disabled:Lt,className:"px-4 py-2 text-sm font-medium rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700 disabled:opacity-50",children:"Cancel"}),e.jsx("button",{onClick:Q,disabled:Lt,className:"px-4 py-2 text-sm font-medium rounded-lg text-white bg-red-600 hover:bg-red-700 disabled:opacity-50",children:Lt?"Processing...":"Confirm Ignore"})]})]})}),e.jsx(Kc,{isOpen:Pe,onClose:()=>Oe(!1),onReport:Ne,reportType:"user",targetUsername:we}),e.jsx(Kc,{isOpen:!!Ge,onClose:()=>ze(null),onReport:async $=>{if(Ge&&y){await y(Ge.author,Ge.permlink,$);const re=de=>de.author===Ge.author&&de.permlink===Ge.permlink;te(de=>de.filter(le=>!re(le))),Fe(de=>de.filter(le=>!re(le))),Re(de=>de.filter(le=>!re(le))),oe(de=>de.filter(le=>!re(le))),je(de=>de.filter(le=>!re(le))),ae(de=>de.filter(le=>!re(le)))}ze(null)},reportType:"post",targetUsername:Ge?.author||"",targetPermlink:Ge?.permlink})]})})},Xg=t=>{window.open(t,"_blank")},Zg=({app:t,backgroundColor:r,boxShadow:s})=>{const n=()=>{Xg(t.url)};return e.jsx("div",{className:"card hover-lift cursor-pointer transition-all duration-300 h-full",onClick:n,style:{backgroundColor:r??"rgba(15,23,42,0.9)",boxShadow:s??"0 18px 45px rgba(0,0,0,0.6)",border:"1px solid rgba(148,163,184,0.25)"},children:e.jsx("div",{className:"card-body p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"flex-shrink-0",children:t.useCircleBackground!==!1?e.jsx("div",{className:"avatar",children:e.jsx("div",{className:"w-16 h-16 rounded-full",children:e.jsx("img",{src:t.imagePath,alt:`${t.name} logo`,className:"w-full h-full object-cover",onError:a=>{a.currentTarget.src="/placeholder.svg"}})})}):e.jsx("img",{src:t.imagePath,alt:`${t.name} logo`,className:"w-16 h-16 object-contain",onError:a=>{a.currentTarget.src="/placeholder.svg"}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("h3",{className:"card-title text-lg font-bold text-base-content mb-2 line-clamp-2",children:t.name}),t.isComingSoon&&e.jsx("div",{className:"badge badge-warning badge-sm",children:"Coming Soon"})]}),e.jsx("div",{className:"text-base-content/70 text-sm leading-relaxed",children:t.description.split(`
1140
+ `);return e.jsxs("div",{className:`border border-gray-700 rounded-lg p-4 bg-gray-800 hover:bg-gray-700 transition-colors ${de?"cursor-pointer":""}`,onClick:de,children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center gap-1.5 flex-shrink-0 w-16",children:[e.jsx("img",{src:`https://images.hive.blog/u/${$.author}/avatar`,alt:$.author,className:"w-10 h-10 rounded-full bg-gray-700 flex-shrink-0",onError:Ve=>{Ve.target.src=`https://ui-avatars.com/api/?name=${$.author}&background=random&size=40`}}),e.jsx(kt,{images:le})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsxs("button",{onClick:Ve=>{Ve.stopPropagation(),m?.($.author)},className:"font-medium text-white hover:text-blue-400 text-sm",children:["@",$.author]}),e.jsx("span",{className:"text-xs text-gray-500",children:dn($.created)})]}),$.title&&e.jsx("button",{onClick:()=>_?.($.author,$.permlink,$.title),className:"text-left text-base font-semibold text-white mb-1 line-clamp-2 hover:text-blue-400",children:$.title}),ce&&e.jsx("p",{className:"text-gray-400 text-sm line-clamp-2",children:ce.substring(0,200)}),$.community_title&&e.jsxs("span",{className:"inline-block mt-1 text-xs text-blue-400 font-medium",children:["#",$.community_title]})]})]}),e.jsx("div",{className:"mt-3 pt-2 border-t border-gray-700/50",onClick:Ve=>Ve.stopPropagation(),children:e.jsx(jn,{author:$.author,permlink:$.permlink,currentUser:r,hiveValue:st,hiveIconUrl:"/images/hive_logo.png",payoutTooltip:dt,initialVotes:$.active_votes||[],initialCommentsCount:$.children||0,onUpvote:x?Ve=>x($.author,$.permlink,Ve):void 0,onSubmitComment:g?(Ve,Ot,Ut)=>g(Ve,Ot,Ut):void 0,onClickCommentUpvote:v,onReblog:$.author!==r&&N?()=>N($.author,$.permlink):void 0,onShare:L?()=>L($.author,$.permlink):void 0,onTip:$.author!==r&&j?()=>j($.author,$.permlink):void 0,onReport:$.author!==r&&y?()=>ze({author:$.author,permlink:$.permlink}):void 0,disableCommentsModal:!!H,onComments:H?()=>H($.author,$.permlink):void 0,ecencyToken:i,threeSpeakApiKey:o,giphyApiKey:c,templateToken:d,templateApiBaseUrl:f})})]},`${$.author}/${$.permlink}`)},Ht=$=>{const re=$.poll_stats?.total_voting_accounts_num||0,de=$.status==="Active",Ce=new Date($.end_time)<new Date,st=$.post_body?Qc($.post_body):"",Ie=$.poll_choices?.length||0;return e.jsxs("div",{className:"border border-gray-700 rounded-lg bg-gray-800 hover:bg-gray-700/50 transition-colors cursor-pointer",onClick:()=>A?.($.author,$.permlink,$.question),children:[e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:`https://images.hive.blog/u/${$.author}/avatar`,alt:$.author,className:"w-8 h-8 rounded-full bg-gray-700",onError:it=>{it.target.src=`https://ui-avatars.com/api/?name=${$.author}&background=random&size=32`}}),e.jsxs("div",{children:[e.jsxs("button",{onClick:it=>{it.stopPropagation(),m?.($.author)},className:"text-sm font-medium text-white hover:text-blue-400",children:["@",$.author]}),e.jsx("p",{className:"text-[10px] text-gray-500",children:dn($.created)})]})]}),e.jsx("span",{className:`text-[10px] font-semibold px-2 py-0.5 rounded-full ${de&&!Ce?"bg-green-500/20 text-green-400":"bg-gray-600/30 text-gray-400"}`,children:de&&!Ce?"Active":"Ended"})]}),e.jsx("h3",{className:"text-sm font-semibold text-white mb-1",children:$.question}),st&&e.jsx("p",{className:"text-gray-400 text-xs line-clamp-2 mb-2",children:st.substring(0,150)}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-500",children:[e.jsxs("span",{children:[re," voter",re!==1?"s":""]}),e.jsxs("span",{children:[Ie," option",Ie!==1?"s":""]}),$.poll_stats?.total_hive_hp!=null&&$.poll_stats.total_hive_hp>0&&e.jsxs("span",{children:[($.poll_stats.total_hive_hp/1e3).toFixed(1),"k HP"]}),$.end_time&&e.jsx("span",{children:de&&!Ce?`Ends ${dn($.end_time)}`:"Ended"})]})]}),e.jsx("div",{className:"px-4 pb-3 pt-1 border-t border-gray-700/50",onClick:it=>it.stopPropagation(),children:e.jsx(jn,{author:$.author,permlink:$.permlink,currentUser:r,hiveIconUrl:"/images/hive_logo.png",initialVotes:[],initialCommentsCount:0,onUpvote:x?it=>x($.author,$.permlink,it):void 0,onSubmitComment:g?(it,dt,Ve)=>g(it,dt,Ve):void 0,onClickCommentUpvote:v,onReblog:$.author!==r&&N?()=>N($.author,$.permlink):void 0,onShare:L?()=>L($.author,$.permlink):void 0,onTip:$.author!==r&&j?()=>j($.author,$.permlink):void 0,onReport:$.author!==r&&y?()=>ze({author:$.author,permlink:$.permlink}):void 0,disableCommentsModal:!!H,onComments:H?()=>H($.author,$.permlink):void 0,ecencyToken:i,threeSpeakApiKey:o,giphyApiKey:c,templateToken:d,templateApiBaseUrl:f})})]},`${$.author}/${$.permlink}`)},pt=($,re)=>e.jsx("div",{className:"border border-gray-700 rounded-lg p-4 bg-gray-800 hover:bg-gray-700 transition-colors",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("img",{src:`https://images.hive.blog/u/${$}/avatar`,alt:$,className:"w-10 h-10 rounded-full flex-shrink-0 bg-gray-700",onError:de=>{de.target.src=`https://ui-avatars.com/api/?name=${$}&background=random&size=40`}}),e.jsxs("button",{onClick:()=>m?.($),className:"font-medium text-white hover:text-blue-400",children:["@",$]})]})},`${$}-${re}`),ct=($=5)=>e.jsx("div",{className:"space-y-3 animate-pulse",children:Array.from({length:$},(re,de)=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"h-3.5 bg-gray-700 rounded w-24"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"})]}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-full mb-1.5"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-3/5 mb-3"}),de%2===0&&e.jsx("div",{className:"h-32 bg-gray-700 rounded-lg w-20 mb-3"}),e.jsxs("div",{className:"flex gap-4 mt-2",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-12"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-12"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-12"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"})]})]})]})},de))}),Dt=($=8)=>e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3 animate-pulse",children:Array.from({length:$},(re,de)=>e.jsx("div",{className:"border border-gray-700 rounded-lg p-4 bg-gray-800",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full flex-shrink-0"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-28"})]})},de))}),Vt=($=3)=>e.jsx("div",{className:"space-y-3 animate-pulse",children:Array.from({length:$},(re,de)=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"h-3.5 bg-gray-700 rounded w-24"}),e.jsx("div",{className:"h-5 bg-gray-700 rounded-full w-14"})]}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-4/5 mb-3"}),e.jsxs("div",{className:"space-y-2 mb-3",children:[e.jsx("div",{className:"h-8 bg-gray-700 rounded-lg w-full"}),e.jsx("div",{className:"h-8 bg-gray-700 rounded-lg w-full"}),e.jsx("div",{className:"h-8 bg-gray-700 rounded-lg w-3/4"})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-20"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-24"})]})]})]})},de))}),Mt=()=>e.jsxs("div",{className:"space-y-3 animate-pulse",children:[e.jsxs("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"w-5 h-5 bg-gray-700 rounded"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-44"})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[1,2,3,4].map($=>e.jsxs("div",{className:"bg-gray-900/50 rounded-lg p-2.5",children:[e.jsx("div",{className:"h-2.5 bg-gray-700 rounded w-12 mb-2"}),e.jsx("div",{className:"h-5 bg-gray-700 rounded w-16"})]},$))})]}),[1,2,3,4,5].map($=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-7 h-7 bg-gray-700 rounded-lg"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/3 mb-3"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-20"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"})]})]})]})},$))]}),er=()=>{switch(B){case"blogs":case"posts":case"snaps":case"comments":case"replies":return ct();case"followers":case"following":case"badges":case"witnessVotes":return Dt();case"polls":return Vt();case"authorRewards":case"curationRewards":return Mt();default:return ct()}},nr=$=>{if(!$||!isFinite($)||$<=0)return"—";const re=Math.floor($/1e3),de=Math.floor(re/60),le=Math.floor(de/60),ce=Math.floor(le/24);return ce>=1?`${ce}d ${le%24}h`:le>=1?`${le}h ${de%60}m`:`${Math.max(1,de)}m`},Jt=($,re=3)=>$==null||isNaN($)?"—":Number($).toLocaleString(void 0,{maximumFractionDigits:re,minimumFractionDigits:re}),or=()=>{if(I&&he.length===0)return Mt();if(he.length===0&&!wt)return e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Award,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No pending author rewards"}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"Rewards appear for posts/comments with pending payouts"})]});const $=he.filter(de=>!de.isComment).length,re=he.length-$;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-gradient-to-r from-amber-900/30 to-orange-900/30 rounded-xl p-4 border border-amber-700/40",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(O.Award,{className:"w-5 h-5 text-amber-400"}),e.jsx("h3",{className:"text-sm font-semibold text-amber-300",children:"Pending Author Rewards"})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Posts"}),e.jsx("p",{className:"text-lg font-bold text-white",children:$})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Comments"}),e.jsx("p",{className:"text-lg font-bold text-white",children:re})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Total HBD"}),e.jsxs("p",{className:"text-lg font-bold text-amber-400",children:["$",Jt(me.totalHbd)]})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Total HP"}),e.jsx("p",{className:"text-lg font-bold text-orange-400",children:Jt(me.totalHpEq)})]})]})]}),he.map((de,le)=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700 hover:border-gray-600 transition-colors cursor-pointer",onClick:()=>_?.(de.author,de.permlink,de.title),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0 ${de.isComment?"bg-blue-900/40 text-blue-400":"bg-emerald-900/40 text-emerald-400"}`,children:de.isComment?e.jsx(O.MessageCircle,{className:"w-3.5 h-3.5"}):e.jsx(O.FileText,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h4",{className:"text-sm font-medium text-white truncate",children:de.title||`${de.author}/${de.permlink}`}),e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0 ${de.isComment?"bg-blue-900/40 text-blue-300":"bg-emerald-900/40 text-emerald-300"}`,children:de.isComment?"Comment":"Post"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 mt-2 text-xs text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Clock,{className:"w-3 h-3"}),"Payout in ",nr(de.payoutMs)]}),e.jsxs("span",{className:"text-amber-400 font-medium",children:["$",Jt(de.hbd)," HBD"]}),de.hpEq!==null&&e.jsxs("span",{className:"text-orange-400 font-medium",children:[Jt(de.hpEq)," HP"]}),de.beneficiaryCut>0&&e.jsxs("span",{className:"text-gray-500",children:["Beneficiary: ",(de.beneficiaryCut*100).toFixed(0),"%"]})]})]})]})},`${de.author}-${de.permlink}-${le}`)),wt&&e.jsx("div",{className:"animate-pulse space-y-3",children:[1,2].map(de=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-7 h-7 bg-gray-700 rounded-lg"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4 mb-2"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-20"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"})]})]})]})},de))})]})},mr=()=>{if(I&&Te.length===0)return Mt();if(Te.length===0&&!wt)return e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.TrendingUp,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No pending curation rewards"}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"Rewards appear for posts you voted on with pending payouts"})]});const $=Te.filter(ce=>!ce.isComment).length,re=Te.length-$,de=Te.filter(ce=>ce.efficiency!==null),le=de.length>0?de.reduce((ce,Ce)=>ce+(Ce.efficiency||0),0)/de.length:null;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"bg-gradient-to-r from-blue-900/30 to-purple-900/30 rounded-xl p-4 border border-blue-700/40",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(O.TrendingUp,{className:"w-5 h-5 text-blue-400"}),e.jsx("h3",{className:"text-sm font-semibold text-blue-300",children:"Pending Curation Rewards"})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-3",children:[e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Posts"}),e.jsx("p",{className:"text-lg font-bold text-white",children:$})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Comments"}),e.jsx("p",{className:"text-lg font-bold text-white",children:re})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Total HP"}),e.jsx("p",{className:"text-lg font-bold text-blue-400",children:Jt(Je.totalHp)})]}),e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Total HBD"}),e.jsxs("p",{className:"text-lg font-bold text-purple-400",children:["$",Jt(Je.totalHbd)]})]}),le!==null&&e.jsxs("div",{className:"bg-black/30 rounded-lg p-2.5",children:[e.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-wider",children:"Avg Efficiency"}),e.jsxs("p",{className:`text-lg font-bold ${le>=100?"text-emerald-400":"text-amber-400"}`,children:[le.toFixed(1),"%"]})]})]})]}),Te.map((ce,Ce)=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700 hover:border-gray-600 transition-colors cursor-pointer",onClick:()=>_?.(ce.author,ce.permlink,ce.title),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0 ${ce.isComment?"bg-blue-900/40 text-blue-400":"bg-emerald-900/40 text-emerald-400"}`,children:ce.isComment?e.jsx(O.MessageCircle,{className:"w-3.5 h-3.5"}):e.jsx(O.FileText,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"text-sm font-medium text-white truncate",children:ce.title||`${ce.author}/${ce.permlink}`}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["by @",ce.author]})]}),e.jsx("span",{className:`text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0 ${ce.isComment?"bg-blue-900/40 text-blue-300":"bg-emerald-900/40 text-emerald-300"}`,children:ce.isComment?"Comment":"Post"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 mt-2 text-xs text-gray-400",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Clock,{className:"w-3 h-3"}),"Payout in ",nr(ce.payoutMs)]}),e.jsxs("span",{className:"text-blue-400 font-medium",children:[Jt(ce.hp)," HP"]}),e.jsxs("span",{className:"text-purple-400 font-medium",children:["$",Jt(ce.hbd)," HBD"]}),e.jsxs("span",{className:"text-gray-500",children:["Vote: ",ce.weightPct.toFixed(0),"%"]}),ce.efficiency!==null&&e.jsxs("span",{className:`font-medium ${ce.efficiency>=100?"text-emerald-400":"text-amber-400"}`,children:["Eff: ",ce.efficiency.toFixed(1),"%"]}),ce.votedAfterMs!==null&&e.jsxs("span",{className:"text-gray-500",children:["Voted after ",nr(ce.votedAfterMs)]})]})]})]})},`${ce.author}-${ce.permlink}-${Ce}`)),wt&&e.jsx("div",{className:"animate-pulse space-y-3",children:[1,2].map(ce=>e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-7 h-7 bg-gray-700 rounded-lg"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/3 mb-3"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("div",{className:"h-3 bg-gray-700 rounded w-20"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-16"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-14"})]})]})]})},ce))})]})},tr=()=>{if(B==="wallet")return e.jsx("div",{className:"max-w-lg mx-auto",children:e.jsx(u0,{username:we})});if(B==="activities")return e.jsx(f0,{username:we,onClickPermlink:C,onSelectActivity:T});if(B==="authorRewards")return or();if(B==="curationRewards")return mr();if(B==="votingPower"){if(I)return e.jsxs("div",{className:"max-w-lg mx-auto space-y-6 animate-pulse",children:[[1,2,3].map(xt=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-32"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded-full w-full"})]},xt)),e.jsxs("div",{className:"mt-4 p-4 bg-gray-800 rounded-xl border border-gray-700",children:[e.jsx("div",{className:"h-4 bg-gray-700 rounded w-40 mb-3"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded-full w-full"})]})]});if(!jt)return e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Gauge,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"Voting power data unavailable"})]});const{maxMana:le,rewardBalance:ce,recentClaims:Ce,feedPrice:st}=jt,Ie=S*100,it=le*.02*(Ie/1e4),dt=Ce>0?it/Ce*ce:0,Ve=dt*st,Ot=jt.upvotePower<S*2/100,Ut=(xt,gt=3)=>isNaN(xt)?"—":xt.toLocaleString(void 0,{minimumFractionDigits:gt,maximumFractionDigits:gt}),Et=[{label:"Voting Power",value:jt.upvotePower,color:"#10b981"},{label:"Downvote Power",value:jt.downvotePower,color:"#f59e0b"},{label:"Resource Credits",value:jt.resourceCredits,color:"#3b82f6"}];return e.jsxs("div",{className:"max-w-lg mx-auto space-y-6",children:[e.jsxs("div",{className:"p-4 rounded-xl bg-gray-800 border border-gray-700",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-200",children:"Vote Value"}),e.jsxs("span",{className:"text-xs font-bold text-blue-400",children:[S,"%"]})]}),e.jsx("div",{className:"text-[13px] text-gray-400 mb-3",children:Ce>0?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-white font-medium",children:[Ut(Ve)," HBD"]}),e.jsx("span",{className:"mx-1.5",children:"·"}),e.jsxs("span",{className:"text-gray-300",children:["~",Ut(dt)," HIVE"]}),Ot&&e.jsx("span",{className:"ml-2 text-amber-400 text-xs",children:"⚠ low mana"})]}):e.jsxs("span",{children:["Vote @",S,"% · —"]})}),e.jsx("input",{type:"range",min:0,max:100,step:5,value:S,onChange:xt=>P(Number(xt.target.value)),className:"w-full h-2 rounded-full appearance-none cursor-pointer",style:{background:`linear-gradient(to right, #3b82f6 0%, #3b82f6 ${S}%, #374151 ${S}%, #374151 100%)`,accentColor:"#3b82f6"}}),e.jsxs("div",{className:"flex justify-between text-[11px] text-gray-500 mt-1",children:[e.jsx("span",{children:"0%"}),e.jsx("span",{children:"25%"}),e.jsx("span",{children:"50%"}),e.jsx("span",{children:"75%"}),e.jsx("span",{children:"100%"})]})]}),Et.map(xt=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm font-medium text-gray-300",children:xt.label}),e.jsxs("span",{className:"text-sm font-bold text-white",children:[xt.value.toFixed(2),"%"]})]}),e.jsx("div",{className:"w-full bg-gray-700 rounded-full h-3",children:e.jsx("div",{className:"h-3 rounded-full transition-all duration-500 ease-out",style:{width:`${Math.min(xt.value,100)}%`,backgroundColor:xt.color}})})]},xt.label))]})}if(B==="badges")return I?Dt():Ze.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Award,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No badges found"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Ze.map((le,ce)=>pt(le,ce))});if(B==="witnessVotes")return I?Dt():Nt.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Shield,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No witness votes found"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Nt.map((le,ce)=>pt(le,ce))});if(I)return er();if(B==="followers")return At.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Users,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No followers found"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3",children:At.map((le,ce)=>pt(le.follower,ce))});if(B==="following")return Ct.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.Users,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"Not following anyone"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3",children:Ct.map((le,ce)=>pt(le.following,ce))});if(B==="polls")return Nr.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(O.BarChart3,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No polls found"})]}):e.jsx("div",{className:"space-y-3",children:Nr.map(le=>Ht(le))});const re={blogs:{data:Or,type:"blog",icon:O.FileText},posts:{data:ar,type:"post",icon:O.FileText},snaps:{data:Rr,type:"post",icon:O.Camera},comments:{data:$r,type:"comment",icon:O.MessageCircle},replies:{data:sr,type:"reply",icon:O.Reply}}[B];if(!re)return null;if(re.data.length===0){const le=re.icon;return e.jsxs("div",{className:"text-center py-12",children:[e.jsx(le,{className:"h-12 w-12 text-gray-500 mx-auto mb-3"}),e.jsxs("p",{className:"text-gray-400",children:["No ",B," found"]})]})}const de=le=>{if(B==="snaps"&&E)return()=>E(le.author,le.permlink);if((B==="blogs"||B==="posts")&&_)return()=>_(le.author,le.permlink,le.title)};return e.jsx("div",{className:"space-y-3",children:re.data.map(le=>Pt(le,re.type,de(le)))})},br=[{id:"blogs",label:"Blogs",icon:O.FileText},{id:"posts",label:"Posts",icon:O.FileText},{id:"snaps",label:"Snaps",icon:O.Camera},{id:"polls",label:"Polls",icon:O.BarChart3},{id:"comments",label:"Comments",icon:O.MessageCircle},{id:"replies",label:"Replies",icon:O.Reply},{id:"activities",label:"Activities",icon:O.Activity},{id:"authorRewards",label:"Author Rewards",icon:O.Award},{id:"curationRewards",label:"Curation Rewards",icon:O.TrendingUp},{id:"followers",label:"Followers",icon:O.Users},{id:"following",label:"Following",icon:O.Users},{id:"wallet",label:"Wallet",icon:O.Wallet},{id:"votingPower",label:"Voting Power",icon:O.Gauge},{id:"badges",label:"Badges",icon:O.Award},{id:"witnessVotes",label:"Witness Votes",icon:O.Shield}],Ir=a&&a.length>0?a.map($=>br.find(re=>re.id===$)).filter($=>$!==void 0):br,nt=r&&r!==we;return e.jsx("div",{className:"dark flex flex-col h-full bg-gray-900",children:e.jsxs("div",{className:"flex flex-col overflow-y-auto h-full",children:[e.jsx("div",{className:"sticky top-0 z-30 h-[56px] bg-gray-800/95 backdrop-blur-sm border-b border-gray-700 flex items-center",children:e.jsxs("div",{className:"px-4 py-2 flex items-center gap-2 w-full",children:[n&&s&&e.jsx("button",{onClick:s,className:"p-1.5 hover:bg-gray-700 rounded-lg transition-colors flex-shrink-0",children:e.jsx(O.ArrowLeft,{className:"h-5 w-5 text-gray-300"})}),e.jsx("img",{src:G.profileImage||`https://images.hive.blog/u/${we}/avatar`,alt:we,className:"w-8 h-8 rounded-full flex-shrink-0 bg-gray-700",onError:$=>{$.target.src=`https://images.hive.blog/u/${we}/avatar`}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{className:"text-sm font-semibold text-white truncate",children:`@${we}`}),G.reputation>0&&e.jsx("span",{className:"text-[10px] bg-gray-700 text-gray-300 px-1.5 py-0.5 rounded-full flex-shrink-0",children:Gg(G.reputation)})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-gray-400",children:[e.jsxs("button",{onClick:()=>pe("followers"),className:"hover:text-white transition-colors",children:[e.jsx("span",{className:"font-semibold text-gray-200",children:G.followersCount.toLocaleString()})," Followers"]}),e.jsxs("button",{onClick:()=>pe("following"),className:"hover:text-white transition-colors",children:[e.jsx("span",{className:"font-semibold text-gray-200",children:G.followingCount.toLocaleString()})," Following"]}),e.jsxs("span",{children:[e.jsx("span",{className:"font-semibold text-gray-200",children:G.postsCount.toLocaleString()})," Posts"]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[V&&e.jsxs("button",{onClick:ut,className:"p-1.5 hover:bg-gray-700 rounded-lg transition-colors relative",title:"Favourite list",children:[e.jsx(O.Heart,{className:`h-4 w-4 ${F?"text-red-500":"text-gray-400"}`,fill:F?"currentColor":"none"}),Y>0&&e.jsx("span",{className:"absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-4 w-4 flex items-center justify-center",children:Y>99?"99+":Y})]}),e.jsx("button",{onClick:Se,className:"p-1.5 hover:bg-gray-700 rounded-lg transition-colors",title:"Share profile",children:e.jsx(O.Share2,{className:"h-4 w-4 text-gray-400"})}),nt&&e.jsxs("div",{className:"relative",ref:mt,children:[e.jsx("button",{onClick:()=>_t($=>!$),className:"p-1.5 hover:bg-gray-700 rounded-lg transition-colors",title:"More actions",children:e.jsx(O.MoreVertical,{className:"h-4 w-4 text-gray-400"})}),Gt&&e.jsxs("div",{className:"absolute right-0 mt-1 w-48 rounded-lg border border-gray-700 bg-gray-800 shadow-xl z-[100]",onClick:$=>$.stopPropagation(),children:[(u||p)&&e.jsx("button",{onClick:()=>{_t(!1),W()},disabled:Lt,className:"w-full px-4 py-2.5 text-left text-sm text-gray-200 hover:bg-gray-700 disabled:opacity-50 first:rounded-t-lg",children:G.isFollowing?"Unfollow":"Follow"}),b&&e.jsx("button",{onClick:()=>{_t(!1),ge(!0)},disabled:Lt,className:"w-full px-4 py-2.5 text-left text-sm text-red-400 hover:bg-red-900/20 disabled:opacity-50",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O.Ban,{className:"h-4 w-4"})," Ignore Author"]})}),w&&e.jsx("button",{onClick:()=>{_t(!1),Oe(!0)},disabled:Lt,className:"w-full px-4 py-2.5 text-left text-sm text-orange-400 hover:bg-orange-900/20 disabled:opacity-50 last:rounded-b-lg",children:e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(O.Flag,{className:"h-4 w-4"})," Report User"]})})]})]})]})]})}),e.jsxs("div",{className:"relative",children:[G.coverImage?e.jsx("div",{className:"w-full h-24 sm:h-32 bg-cover bg-center",style:{backgroundImage:`url(${G.coverImage})`}}):e.jsx("div",{className:"w-full h-24 sm:h-32 bg-gradient-to-r from-blue-600 to-purple-700"}),e.jsx("div",{className:"absolute inset-0 bg-gray-900/80"}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 px-4 pb-3 pt-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h2",{className:"text-sm font-semibold text-white truncate",children:G.name||`@${we}`}),G.about&&e.jsx("p",{className:"text-gray-300 text-xs leading-relaxed mt-1 line-clamp-2",children:G.about})]}),z&&e.jsx("button",{onClick:Xe,className:"p-2 hover:bg-white/10 rounded-lg transition-colors ml-2 flex-shrink-0",title:F?"Remove from favourites":"Add to favourites",children:e.jsx(O.Heart,{className:`h-5 w-5 ${F?"text-red-500":"text-white"}`,fill:F?"currentColor":"none"})})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 mt-1.5 text-[11px] text-gray-300",children:[G.location&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.MapPin,{className:"h-3 w-3 text-rose-400"})," ",G.location]}),G.website&&e.jsxs("a",{href:G.website.startsWith("http")?G.website:`https://${G.website}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-blue-400 hover:underline",children:[e.jsx(O.Globe,{className:"h-3 w-3 text-blue-400"})," ",G.website]}),G.created&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Calendar,{className:"h-3 w-3 text-green-400"})," ",Jg(G.created)]}),G.lastActivity&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Clock,{className:"h-3 w-3 text-amber-400"})," ",dn(G.lastActivity)]}),G.votingPower!==void 0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Zap,{className:"h-3 w-3 text-yellow-400"})," VP ",G.votingPower.toFixed(1),"%"]}),G.hivePower!==void 0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O.Zap,{className:"h-3 w-3 text-orange-400"})," HP ",G.hivePower.toFixed(0)]})]})]})]}),e.jsx("div",{className:"sticky top-[56px] z-20 bg-gray-800 border-b border-gray-700",children:e.jsx("div",{className:"flex overflow-x-auto scrollbar-hide",children:Ir.map($=>{const re=$.icon;return e.jsxs("button",{onClick:()=>pe($.id),className:`flex items-center gap-1 px-3 sm:px-4 py-2.5 text-xs sm:text-sm font-medium whitespace-nowrap transition-colors border-b-2 ${B===$.id?"text-blue-400 border-blue-400":"text-gray-400 border-transparent hover:text-gray-300 hover:border-gray-600"}`,children:[e.jsx(re,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:$.label})]},$.id)})})}),e.jsxs("div",{className:"p-4 flex-1",children:[tr(),B!=="wallet"&&Ye[B]&&e.jsx("div",{ref:Tt,className:"min-h-[60px] py-2",children:be?e.jsx("div",{className:"animate-pulse space-y-3",children:B==="followers"||B==="following"?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-3",children:[1,2].map($=>e.jsx("div",{className:"border border-gray-700 rounded-lg p-4 bg-gray-800",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-28"})]})},$))}):e.jsx("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("div",{className:"w-10 h-10 bg-gray-700 rounded-full flex-shrink-0"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"h-3.5 bg-gray-700 rounded w-24 mb-2"}),e.jsx("div",{className:"h-4 bg-gray-700 rounded w-3/4 mb-2"}),e.jsx("div",{className:"h-3 bg-gray-700 rounded w-1/2"})]})]})})}):e.jsx("div",{className:"h-1"})}),B!=="wallet"&&!Ye[B]&&!I&&e.jsxs("div",{className:"text-center py-4 text-xs text-gray-600",children:["No more ",B," to load"]})]}),lt&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[1000] p-4",onClick:()=>ge(!1),children:e.jsxs("div",{className:"bg-gray-800 rounded-xl shadow-xl max-w-sm w-full border border-gray-700 p-6",onClick:$=>$.stopPropagation(),children:[e.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"Ignore Author"}),e.jsxs("p",{className:"text-sm text-gray-300 mb-6",children:["Are you sure you want to ignore"," ",e.jsxs("span",{className:"text-red-400 font-medium",children:["@",we]}),"? Their content will be hidden from your feed."]}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("button",{onClick:()=>ge(!1),disabled:Lt,className:"px-4 py-2 text-sm font-medium rounded-lg border border-gray-600 text-gray-300 hover:bg-gray-700 disabled:opacity-50",children:"Cancel"}),e.jsx("button",{onClick:Q,disabled:Lt,className:"px-4 py-2 text-sm font-medium rounded-lg text-white bg-red-600 hover:bg-red-700 disabled:opacity-50",children:Lt?"Processing...":"Confirm Ignore"})]})]})}),e.jsx(Kc,{isOpen:Pe,onClose:()=>Oe(!1),onReport:Ne,reportType:"user",targetUsername:we}),e.jsx(Kc,{isOpen:!!Ge,onClose:()=>ze(null),onReport:async $=>{if(Ge&&y){await y(Ge.author,Ge.permlink,$);const re=de=>de.author===Ge.author&&de.permlink===Ge.permlink;te(de=>de.filter(le=>!re(le))),Fe(de=>de.filter(le=>!re(le))),Re(de=>de.filter(le=>!re(le))),oe(de=>de.filter(le=>!re(le))),je(de=>de.filter(le=>!re(le))),ae(de=>de.filter(le=>!re(le)))}ze(null)},reportType:"post",targetUsername:Ge?.author||"",targetPermlink:Ge?.permlink})]})})},Xg=t=>{window.open(t,"_blank")},Zg=({app:t,backgroundColor:r,boxShadow:s})=>{const n=()=>{Xg(t.url)};return e.jsx("div",{className:"card hover-lift cursor-pointer transition-all duration-300 h-full",onClick:n,style:{backgroundColor:r??"rgba(15,23,42,0.9)",boxShadow:s??"0 18px 45px rgba(0,0,0,0.6)",border:"1px solid rgba(148,163,184,0.25)"},children:e.jsx("div",{className:"card-body p-6",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"flex-shrink-0",children:t.useCircleBackground!==!1?e.jsx("div",{className:"avatar",children:e.jsx("div",{className:"w-16 h-16 rounded-full",children:e.jsx("img",{src:t.imagePath,alt:`${t.name} logo`,className:"w-full h-full object-cover",onError:a=>{a.currentTarget.src="/placeholder.svg"}})})}):e.jsx("img",{src:t.imagePath,alt:`${t.name} logo`,className:"w-16 h-16 object-contain",onError:a=>{a.currentTarget.src="/placeholder.svg"}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("h3",{className:"card-title text-lg font-bold text-base-content mb-2 line-clamp-2",children:t.name}),t.isComingSoon&&e.jsx("div",{className:"badge badge-warning badge-sm",children:"Coming Soon"})]}),e.jsx("div",{className:"text-base-content/70 text-sm leading-relaxed",children:t.description.split(`
1141
1141
  `).map((a,i)=>e.jsx("div",{className:"mb-1",children:a},i))})]})]})})})},Kg=()=>{const[t,r]=k.useState({width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0});k.useEffect(()=>{const i=()=>{r({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const s=t.width<850,n=t.width<=1050&&t.width>=850,a=t.width>1050;return{isMobileView:s,isTabletView:n,isWebView:a,screenSize:t}},Qg=({apps:t,cardBackgroundColor:r,cardShadow:s})=>{const{isMobileView:n,isTabletView:a}=Kg(),i=()=>n?"grid-cols-1":a?"grid-cols-2":"grid-cols-3";return e.jsx("div",{className:"container mx-auto px-4 lg:px-16",children:e.jsx("div",{className:`grid ${i()} gap-6 lg:gap-8`,children:t.map((o,c)=>e.jsx(Zg,{app:o,backgroundColor:r,boxShadow:s},c))})})},ex=[{imagePath:Qe.hreplier,name:"hReplier",url:"https://hreplier.sagarkothari88.one/",description:`- Easily Manage your Hive Blog's replies
1142
1142
  - We are working on Hive Inbox as Key contributors`},{imagePath:Qe.template,name:"hSnaps",url:"https://hsnaps.sagarkothari88.one/",description:`- A Snaps App for Hive Blockchain
1143
1143
  - We are working on Hive Snaps as Key contributors`},{imagePath:Qe.hive_fest_fact_logo,name:"Hive Fest Fact",url:"https://hivefestfacts.sagarkothari88.one/",description:"- Hive Fest Facts is a platform dedicated to sharing interesting and informative facts about Hive Fest, the annual gathering of the Hive blockchain community."},{imagePath:Qe.hpolls_logo,name:"hPolls",url:"https://hpolls.sagarkothari88.one/",description:`- Create and manage polls on the Hive blockchain
package/dist/index.esm.js CHANGED
@@ -33676,7 +33676,7 @@ const f2 = ({
33676
33676
  className: "p-1.5 hover:bg-gray-700 rounded-lg transition-colors relative",
33677
33677
  title: "Favourite list",
33678
33678
  children: [
33679
- /* @__PURE__ */ t(jo, { className: "h-4 w-4 text-gray-400" }),
33679
+ /* @__PURE__ */ t(jo, { className: `h-4 w-4 ${j ? "text-red-500" : "text-gray-400"}`, fill: j ? "currentColor" : "none" }),
33680
33680
  Y > 0 && /* @__PURE__ */ t("span", { className: "absolute -top-1 -right-1 bg-red-500 text-white text-xs rounded-full h-4 w-4 flex items-center justify-center", children: Y > 99 ? "99+" : Y })
33681
33681
  ]
33682
33682
  }
@@ -33772,7 +33772,7 @@ const f2 = ({
33772
33772
  onClick: Xe,
33773
33773
  className: "p-2 hover:bg-white/10 rounded-lg transition-colors ml-2 flex-shrink-0",
33774
33774
  title: j ? "Remove from favourites" : "Add to favourites",
33775
- children: /* @__PURE__ */ t(jo, { className: `h-5 w-5 ${j ? "text-red-500 fill-red-500" : "text-white"}` })
33775
+ children: /* @__PURE__ */ t(jo, { className: `h-5 w-5 ${j ? "text-red-500" : "text-white"}`, fill: j ? "currentColor" : "none" })
33776
33776
  }
33777
33777
  )
33778
33778
  ] }),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hive-react-kit",
3
3
  "private": false,
4
- "version": "0.7.1",
4
+ "version": "0.7.2",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
7
7
  "module": "./dist/index.esm.js",