import{_ as __rest,a as __assign}from"./tslib.es6-bjGg6Bxl.js";import React__default from"react";import{u as useTooltipState,a as useMergeRefs}from"./Tooltip.component-D23JdNpf.js";var TooltipTrigger=React__default.forwardRef(function(a,b){var c=a.children,d=void 0===c?null:c,e=a.asChild,f=a.className,g=void 0===f?"":f,h=__rest(a,["children","asChild","className"]),i=useTooltipState(),j=useMergeRefs([i.refs.setReference,b]);if(void 0!==e&&e&&React__default.isValidElement(d)){var k=d.props,l=k.ref,m=useMergeRefs([i.refs.setReference,b,l]),n=__assign(__assign(__assign({ref:m},h),k),{"data-state":i.open?"open":"closed",className:k.className+"".concat(i.disabled&&" jn-cursor-default")}),o=i.getReferenceProps(n);return React__default.cloneElement(d,o)}return React__default.createElement("button",__assign({ref:j,"data-state":i.open?"open":"closed"},i.getReferenceProps(h),{className:"".concat(g," ").concat(i.disabled&&" jn-cursor-default")}),d)});export{TooltipTrigger as T};