'use client';'use strict';

var chunkKIT7C63G_cjs = require('./chunk-KIT7C63G.cjs');
var chunk6U6JVUY3_cjs = require('./chunk-6U6JVUY3.cjs');
var chunkQOC26J56_cjs = require('./chunk-QOC26J56.cjs');
var chunkHVMKYLVQ_cjs = require('./chunk-HVMKYLVQ.cjs');
var chunkIFXORR66_cjs = require('./chunk-IFXORR66.cjs');
var chunk4IQP4J4C_cjs = require('./chunk-4IQP4J4C.cjs');
var chunk5XB54L7P_cjs = require('./chunk-5XB54L7P.cjs');
var css = require('@onbeam/styled-system/css');
var recipes = require('@onbeam/styled-system/recipes');
var jsxRuntime = require('react/jsx-runtime');
var react = require('react');
var reactDialog = require('@radix-ui/react-dialog');

var u=chunk5XB54L7P_cjs.a(({as:C="div",id:b,name:k,subname:o,logo:m,detailCaption:c,detailLabel:i,className:g,isSelected:v,isDisabled:d,onClick:p,action:a,address:y,chainId:B,...P},x)=>{let e=recipes.selectModal(),r=d||v;return jsxRuntime.jsxs(C,{ref:x,tabIndex:r?-1:0,"aria-disabled":r,className:css.cx(e.listItem,e.listItemHover,g),"data-testid":"token-item",onClick:r?void 0:()=>p?.(b),...P,children:[jsxRuntime.jsxs("div",{className:e.token,children:[jsxRuntime.jsx(chunkKIT7C63G_cjs.a,{as:"div",disabled:r,disableChevron:!0,icon:m,children:k}),o&&jsxRuntime.jsx("span",{className:e.tokenSubname,children:o})]}),a&&jsxRuntime.jsxs("div",{className:e.action,children:[jsxRuntime.jsx("p",{children:a.title}),jsxRuntime.jsx("div",{onClick:n=>n.stopPropagation(),onKeyDown:n=>n.stopPropagation(),children:jsxRuntime.jsx(chunk6U6JVUY3_cjs.a,{as:"span",role:"button",tabIndex:0,onClick:a.onClick,className:e.actionButton,children:a.buttonLabel})})]}),(i||c)&&jsxRuntime.jsxs("div",{className:e.detail,children:[i&&jsxRuntime.jsx("span",{className:e.detailLabel,"data-selected":v,children:i}),c&&jsxRuntime.jsx("span",{className:e.detailCaption,children:c})]})]})});u.displayName="SelectModalItem";var w=chunk5XB54L7P_cjs.a(({as:C="div",label:b,searchPlaceholder:k="search",items:o=[],selectedId:m,title:c,listTitle:i,onChange:g,onOpenChange:v,searchQuery:d,onSearch:p,sort:a,filter:y,selectButtonProps:B,...P},x)=>{let[e,r]=react.useState(o.find(t=>t.id===m)),n=y?o.filter(y):o,h=a?[...n].sort(a):n,f=recipes.selectModal();return react.useEffect(()=>{r(o.find(t=>t.id===m));},[o,m]),jsxRuntime.jsx(chunkHVMKYLVQ_cjs.a,{description:"select an item",hideDescription:!0,trigger:jsxRuntime.jsx(chunkKIT7C63G_cjs.a,{icon:e?.logo,label:jsxRuntime.jsx(chunkQOC26J56_cjs.a,{children:b}),...B,children:e?.name||"select"}),title:c,onOpenChange:t=>{v?.(t),t&&p?.("");},children:jsxRuntime.jsxs("div",{ref:x,...P,children:[p&&d!==void 0&&jsxRuntime.jsx(chunk4IQP4J4C_cjs.a,{type:"search",placeholder:k,className:f.search,value:d,onChange:t=>{p(t.currentTarget.value);}}),i&&jsxRuntime.jsx("span",{className:f.listTitle,children:i}),jsxRuntime.jsx("div",{className:css.cx(recipes.gridBackground(),recipes.noiseBackground(),f.box),children:jsxRuntime.jsxs("ul",{children:[h.map((t,E)=>jsxRuntime.jsxs("li",{children:[E!==0&&jsxRuntime.jsx(chunkIFXORR66_cjs.a,{}),jsxRuntime.jsx(u,{as:reactDialog.Close,onClick:F=>g?.(F,t),isSelected:t.id===e?.id,...t})]},t.id)),!h.length&&jsxRuntime.jsxs("li",{className:css.cx(f.listItem,f.emptyText),children:["No results found ",d&&`for "${d}"`]})]})})]})})});w.displayName="SelectModal";var U={Item:u};

exports.a = w;
exports.b = U;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-EUSB4HPL.cjs.map