import*as e from"react";import{PopoverProvider as r,usePopoverContext as o}from"./popover-context.js";export{usePopoverContext}from"./popover-context.js";import{PopoverTransition as s}from"./popover-transition.js";import{usePopover as t}from"./use-popover.js";import{omitThemingProps as a}from"../../../system/dist/esm/system.utils.js";import{useMultiStyleConfig as p}from"../../../system/dist/esm/use-style-config.js";import{StylesProvider as n,useStyles as i}from"../../../system/dist/esm/providers.js";import{runIfFn as m}from"../../../utils/dist/esm/function.js";import{__DEV__ as l}from"../../../utils/dist/esm/assertion.js";import{forwardRef as c}from"../../../system/dist/esm/forward-ref.js";import{chakra as d}from"../../../system/dist/esm/system.js";import{cx as v}from"../../../utils/dist/esm/dom.js";import{CloseButton as u}from"../../../close-button/dist/esm/close-button.js";function f(){return(f=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(e[s]=o[s])}return e}).apply(this,arguments)}function y(e,r){if(null==e)return{};var o,s,t={},a=Object.keys(e);for(s=0;s<a.length;s++)o=a[s],r.indexOf(o)>=0||(t[o]=e[o]);return t}var P=o=>{var s=p("Popover",o),i=a(o),{children:l}=i,c=y(i,["children"]),d=t(c);return e.createElement(r,{value:d},e.createElement(n,{value:s},m(l,{isOpen:d.isOpen,onClose:d.onClose,forceUpdate:d.forceUpdate})))};l&&(P.displayName="Popover");var _=r=>{var s=e.Children.only(r.children),{getTriggerProps:t}=o();return e.cloneElement(s,t(s.props,s.ref))};l&&(_.displayName="PopoverTrigger");var g=c(((r,t)=>{var{rootProps:a}=r,p=y(r,["rootProps"]),{getPopoverProps:n,getPopoverPositionerProps:m}=o(),l=i(),c=f({position:"relative",display:"flex",flexDirection:"column"},l.content);return e.createElement(d.div,f({},m(a),{__css:l.popper,className:"chakra-popover__popper"}),e.createElement(s,f({},n(p,t),{className:v("chakra-popover__content",r.className),__css:c})))}));l&&(g.displayName="PopoverContent");var h=c(((r,s)=>{var{getHeaderProps:t}=o(),a=i();return e.createElement(d.header,f({},t(r,s),{className:v("chakra-popover__header",r.className),__css:a.header}))}));l&&(h.displayName="PopoverHeader");var N=c(((r,s)=>{var{getBodyProps:t}=o(),a=i();return e.createElement(d.div,f({},t(r,s),{className:v("chakra-popover__body",r.className),__css:a.body}))}));l&&(N.displayName="PopoverBody");var j=r=>{var{onClose:s}=o();return e.createElement(u,f({size:"sm",onClick:s,position:"absolute",borderRadius:"md",top:"0.25rem",insetEnd:"0.5rem",padding:"0.5rem"},r))};l&&(j.displayName="PopoverCloseButton");var b=r=>{var s,{bg:t,bgColor:a,backgroundColor:p}=r,{getArrowProps:n,getArrowInnerProps:m}=o(),l=i(),c=null!=(s=null!=t?t:a)?s:p;return e.createElement(d.div,f({},n(),{className:"chakra-popover__arrow-positioner"}),e.createElement(d.div,f({className:v("chakra-popover__arrow",r.className)},m(r),{__css:f({},l.arrow,{"--popper-arrow-bg":c?"colors."+c+", "+c:void 0})})))};l&&(b.displayName="PopoverArrow");export{P as Popover,b as PopoverArrow,N as PopoverBody,j as PopoverCloseButton,g as PopoverContent,h as PopoverHeader,_ as PopoverTrigger};
//# sourceMappingURL=popover.js.map
