"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("@argent/x-shared/simulation"),C=require("../../../icons/CancelCircleSecondaryIcon.cjs"),h=require("../../../icons/CrossSecondaryIcon.cjs"),q=require("../../../icons/LegalSecondaryIcon.cjs"),A=require("../../../icons/RocketSecondaryIcon.cjs"),R=require("../../../icons/SendSecondaryIcon.cjs"),O=require("../../../icons/UpgradeSecondaryIcon.cjs"),i=require("@chakra-ui/react"),u=require("lodash-es"),S=require("react"),E=require("./getActivityDetailsIcon.cjs"),x=require("./SendOrReceiveActivityIcon.cjs"),j={SendSecondaryIcon:R,RocketSecondaryIcon:A},k=({activity:c,networkId:l,size:r=10,preferMetaIcon:b=!1,...o})=>{var m;const{type:g,status:d,transferSummary:I=[]}=c,{send:y,receive:f}=u.groupBy(I,n=>n.sent?"send":"receive"),t=S.useMemo(()=>u.isEmpty(y)?null:a=>e.jsx(x.SendOrReceiveActivityIcon,{summaryArray:y,networkId:l,size:r,...a}),[l,y,r]),s=S.useMemo(()=>u.isEmpty(f)?null:a=>e.jsx(x.SendOrReceiveActivityIcon,{summaryArray:f,networkId:l,size:r,...a}),[l,f,r]);if(d==="failure"||d==="rejected"||d==="cancelled")return e.jsx(i.Circle,{size:r,bgColor:"surface-elevated-hover",...o,children:e.jsx(C,{})});if(v.isRejectOnChainActivity(c))return e.jsx(i.Circle,{size:r,bgColor:"icon-background-brand",...o,children:e.jsx(h,{})});if(v.isUpgradeActivity(c))return e.jsx(i.Circle,{size:r,bgColor:"icon-background-brand",...o,children:e.jsx(O,{color:"surface-elevated"})});const p=t||s;if(g===v.NativeActivityTypeNative&&(b||!p)){const n=(m=c.meta)==null?void 0:m.icon;if(n&&n in j){const a=j[n];return e.jsx(i.Circle,{size:r,color:"surface-default",bgColor:"icon-background-brand",...o,children:e.jsx(a,{})})}}if(t&&s)return e.jsxs(i.Square,{size:r,position:"relative",...o,children:[e.jsx(t,{size:6,fontSize:"sm",position:"absolute",left:0,top:0}),e.jsx(s,{size:6.5,fontSize:"sm",position:"absolute",right:0,bottom:0,filter:"drop-shadow(-1px -1px var(--chakra-colors-surface-elevated))"})]});if(t)return e.jsx(t,{});if(s)return e.jsx(s,{});if("details"in c&&!u.isEmpty(c.details)){const n=E.getActivityDetailsIcon(c.details);if(n)return e.jsx(i.Circle,{size:r,color:"surface-default",bgColor:"icon-background-brand",...o,children:n})}return e.jsx(i.Circle,{size:r,bgColor:"surface-elevated-hover",...o,children:e.jsx(q,{})})},M=S.memo(k);exports.ActivityIcon=M;exports.icons=j;
