"use strict";var e=require("react/jsx-runtime"),r=require("@styled/tokens"),j=require("../../icons/ico-globe.js"),b=require("../../icons/ico-remove.js"),l=require("../../primitives/button.js");require("../../primitives/checkbox.js"),require("../../primitives/dropdown-selector.js");var s=require("../../primitives/popover.js");require("../../primitives/radio.js"),require("../../primitives/segmented-control.js"),require("../../primitives/switch.js");var n=require("../../primitives/text.js"),f=require("@styled/css/css"),t=require("@styled/jsx"),d=require("react");const p=({connected:i,connectedLabel:x="Connected",disconnectLabel:c,disconnectedLabel:u="Not connected",domain:h,logoUrl:o,onDisconnect:v})=>{const[g,a]=d.useState(!1);return d.useEffect(()=>{a(!1)},[o]),e.jsxs(s.Popover,{iconSize:28,variant:"text",children:[e.jsx(s.Popover.LeadingIcon,{color:r.token("colors.text.tertiary"),children:o&&i&&!g?e.jsxs(t.Circle,{position:"relative",w:7,h:7,children:[e.jsx("img",{style:{borderRadius:"50%"},width:28,height:28,src:o,alt:"app logo",onError:()=>a(!0)}),e.jsx(t.Circle,{size:"7px",position:"absolute",bg:"positive.base",borderWidth:"thin",borderColor:"surface.primary",bottom:"-1px",right:"-1px",boxSizing:"border-box"})]}):e.jsxs("svg",{width:"28",height:"28",children:[e.jsx("circle",{cx:"14",cy:"14",r:"14",fill:r.token("colors.surface.tertiary")}),e.jsx(j.default,{color:r.token("colors.text.tertiary"),x:6,y:6,height:16,width:16})]})}),e.jsxs(s.Popover.Content,{className:f.css({w:"200px"}),children:[e.jsxs(t.Stack,{w:"100%",gap:1,overflow:"hidden",children:[i?e.jsx(n.default,{size:"xs",variant:"success",fontWeight:"normal",children:x}):e.jsx(n.default,{fontColor:"text.tertiary",size:"xs",children:u}),e.jsx(n.default,{truncate:!0,children:h})]}),i&&c&&e.jsxs(e.Fragment,{children:[e.jsx(t.Divider,{color:"surface.quaternary",my:3}),e.jsx(l.default,{label:c,size:"sm",textStyle:"negative",variant:"text",onPress:v,children:e.jsx(l.default.LeadingIcon,{children:e.jsxs("svg",{width:"20",height:"20",children:[e.jsx("circle",{cx:"8",cy:"8",r:"8",fill:r.token("colors.negative.lightest")}),e.jsx(b.default,{color:r.token("colors.negative.base"),x:3,y:3,height:10,width:10})]})})})]})]})]})};exports.ConnectionMenu=p;
//# sourceMappingURL=connection-menu.js.map
