import{r as s,E as m,_ as h,s as d,aD as b,j as n,aE as u,ap as y,bx as w,bc as x,b8 as E,bq as g,br as T,aJ as B}from"./index.DvRPFfw6.js";var v=s.forwardRef(function(t,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(m,h({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:o}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))});v.displayName="Fullscreen";var f=s.forwardRef(function(t,o){var e={fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"};return s.createElement(m,h({iconAttrs:e,iconVerticalAlign:"middle",iconViewBox:"0 0 24 24"},t,{ref:o}),s.createElement("path",{fill:"none",d:"M0 0h24v24H0V0z"}),s.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))});f.displayName="FullscreenExit";const c="-2.65rem",z=d("div",{target:"e1y9jy7j0"})(({theme:t,locked:o,target:e})=>({padding:`${t.spacing.sm} 0 ${t.spacing.sm} ${t.spacing.sm}`,position:"absolute",top:o?c:"-1rem",right:t.spacing.none,transition:"none",...!o&&{opacity:0,"&:active, &:focus-visible, &:hover":{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c},...e&&{[`${e}:hover &, ${e}:active &, ${e}:focus-visible &`]:{transition:"opacity 150ms 100ms, top 100ms 100ms",opacity:1,top:c}}}})),C=d("div",{target:"e1y9jy7j1"})(({theme:t})=>({color:b(t)?t.colors.fadedText60:t.colors.bodyText,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-end",boxShadow:"1px 2px 8px rgba(0, 0, 0, 0.08)",borderRadius:t.radii.default,backgroundColor:t.colors.lightenedBg05,width:"fit-content",zIndex:t.zIndices.sidebar+1,padding:t.spacing.twoXS})),M=d("div",{target:"e1y9jy7j2"})(({height:t,useContainerWidth:o,topCentered:e})=>({position:"relative",height:o&&t?t:"fit-content",maxWidth:"100%",width:o?"100%":"fit-content",...e?{display:"flex",justifyContent:"center"}:{}}));function p({label:t,show_label:o,icon:e,onClick:a}){const l=y(),i=o?t:"";return n("div",{"data-testid":"stElementToolbarButton",children:n(w,{content:n(B,{source:t,allowHTML:!1,style:{fontSize:l.fontSizes.sm}}),placement:x.TOP,onMouseEnterDelay:1e3,inline:!0,children:u(T,{onClick:r=>{a&&a(),r.stopPropagation()},kind:E.ELEMENT_TOOLBAR,"aria-label":t,children:[e&&n(g,{content:e,size:"md",testid:"stElementToolbarButtonIcon"}),i&&n("span",{children:i})]})})})}const S=({onExpand:t,onCollapse:o,isFullScreen:e,locked:a,children:l,target:i,disableFullscreenMode:r})=>n(z,{className:"stElementToolbar","data-testid":"stElementToolbar",locked:a||e,target:i,children:u(C,{"data-testid":"stElementToolbarButtonContainer",children:[l,t&&!r&&!e&&n(p,{label:"Fullscreen",icon:v,onClick:()=>t()}),o&&!r&&e&&n(p,{label:"Close fullscreen",icon:f,onClick:()=>o()})]})});export{M as S,S as T,p as a};
