import{c as N,j as c,d as C,r as k,Y as P}from"./ErrorMessage-C4749HKn.js";function $(t){const e=N.c(22),{power:n,onClick:l}=t,{author:s,description:i,displayName:r,iconUrl:o,name:a}=n;let m;e[0]!==a||e[1]!==l?(m=()=>{l({name:a})},e[0]=a,e[1]=l,e[2]=m):m=e[2];const u=`powers-list-item-icon${o?" powers-list-item-icon--img":""}`;let p;e[3]!==o?(p=o?c.jsx("img",{src:o}):c.jsx(C,{type:"powers"}),e[3]=o,e[4]=p):p=e[4];let d;e[5]!==u||e[6]!==p?(d=c.jsx("div",{className:u,children:p}),e[5]=u,e[6]=p,e[7]=d):d=e[7];const v=r||a;let f;e[8]!==v?(f=c.jsx("div",{className:"powers-list-item-name",children:v}),e[8]=v,e[9]=f):f=e[9];let x;e[10]!==i?(x=c.jsx("div",{className:"powers-list-item-description",children:i}),e[10]=i,e[11]=x):x=e[11];let w;e[12]!==s?(w=s&&c.jsxs("div",{className:"powers-list-item-author",children:["by",c.jsx("span",{children:s})]}),e[12]=s,e[13]=w):w=e[13];let j;e[14]!==f||e[15]!==x||e[16]!==w?(j=c.jsxs("div",{className:"powers-list-item-content",children:[f,x,w]}),e[14]=f,e[15]=x,e[16]=w,e[17]=j):j=e[17];let h;return e[18]!==m||e[19]!==d||e[20]!==j?(h=c.jsxs("div",{className:"powers-list-item",onClick:m,children:[d,j]}),e[18]=m,e[19]=d,e[20]=j,e[21]=h):h=e[21],h}function y(){const t=N.c(4),{callApi:e}=k.useContext(P);let n;t[0]!==e?(n=i=>{const{name:r}=i;e("viewPowerDetails",{name:r})},t[0]=e,t[1]=n):n=t[1];const l=n;let s;return t[2]!==l?(s={handleClick:l},t[2]=l,t[3]=s):s=t[3],s}function L(t){const e=N.c(8),{firstItem:n,powers:l}=t,{handleClick:s}=y();let i;if(e[0]!==s||e[1]!==l){let o;e[3]!==s?(o=a=>c.jsx($,{power:a,onClick:s},a.name),e[3]=s,e[4]=o):o=e[4],i=l.map(o),e[0]=s,e[1]=l,e[2]=i}else i=e[2];let r;return e[5]!==n||e[6]!==i?(r=c.jsxs("div",{className:"powers-list",children:[n,i]}),e[5]=n,e[6]=i,e[7]=r):r=e[7],r}export{L as P};
