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