import{jsxs as l,jsx as o,Fragment as y}from"react/jsx-runtime";import{ButtonContainer as p}from"../containers/button.js";import"../containers/card.js";import"@styled/css";import{HStack as s,Box as B}from"@styled/jsx";import{token as i}from"@styled/tokens";import C from"../icons/ico-checkmark.js";import $ from"../icons/ico-copy.js";import j from"../icons/ico-eye-closed.js";import k from"../icons/ico-eye-opened.js";import"../primitives/button.js";import"../primitives/checkbox.js";import"../primitives/dropdown-selector.js";import"../primitives/popover.js";import"../primitives/radio.js";import"../primitives/segmented-control.js";import"../primitives/switch.js";import d from"../primitives/text.js";import{useState as h,useEffect as f,useCallback as P}from"react";import"../utils/client-asset-logo.js";import"react-qrcode-logo";import"../utils/secured-by-magic.js";import"../containers/header.js";import"../containers/menu.js";import"../containers/modal.js";import"../containers/overlay.js";const u=b=>{const{content:r,onCopy:n,showHideButton:t,mono:w}=b,[e,m]=h(!!t),[a,c]=h(!1);f(()=>{if(a){const g=setTimeout(()=>{c(!1)},1500);return()=>clearTimeout(g)}},[a]),f(()=>{m(!!t)},[t]);const x=P(()=>{n&&(n(r),c(!0))},[r]);return l(s,{w:"full",px:4,py:3,rounded:10,bg:"surface.secondary",justifyContent:"space-between",position:"relative",children:[o(B,{textWrap:"nowrap",overflow:"hidden",userSelect:e?"none":"auto",filter:e?"blur(10px)":"",children:w?o(d.Mono,{truncate:!0,children:r}):o(d,{truncate:!0,children:r})}),l(s,{gap:3,children:[e&&o(p,{onPress:()=>m(!1),"aria-label":"show",children:o(j,{width:22,height:22,color:i("colors.brand.base")})}),t&&!e&&o(p,{onPress:()=>m(!0),"aria-label":"hide",children:o(k,{width:22,height:22,color:i("colors.brand.base")})}),n&&o(y,{children:a?o(C,{width:22,height:22,color:i("colors.brand.base")}):o(p,{onPress:x,"aria-label":"copy",children:o($,{width:22,height:22,color:i("colors.brand.base")})})})]})]})};u.displayName="TextBox";export{u as default};
//# sourceMappingURL=text-box.js.map
