import{e as h,a as m}from"../chunks/BfcgiW2_.js";import{aC as y,p as l,an as p,x as g,y as D,A as T,aE as v}from"../chunks/TwTPH6iZ.js";import{b as s,i as C,o as k,C as O,s as b}from"../chunks/WyvEpU-T.js";import{p as u,c as w}from"../chunks/CFFbbuus.js";function P(n,e,r={}){const{immediate:d=!0}=r,t=s(!1);let i;function a(){i&&(clearTimeout(i),i=null)}function c(){t.current=!1,a()}function o(...f){a(),t.current=!0,i=setTimeout(()=>{t.current=!1,i=null,n(...f)},e)}return d&&(t.current=!0,C&&o()),k(()=>{c()}),{isPending:s.readonly(t),start:o,stop:c}}class x{opts;#i=y(!0);get isOpenDelayed(){return l(this.#i)}set isOpenDelayed(e){p(this.#i,e,!0)}isPointerInTransit=s(!1);#t;#e=y(null);constructor(e){this.opts=e,this.#t=P(()=>{this.isOpenDelayed=!0},this.opts.skipDelayDuration.current,{immediate:!1})}#s=()=>{this.opts.skipDelayDuration.current!==0&&this.#t.start()};#n=()=>{this.#t.stop()};onOpen=e=>{l(this.#e)&&l(this.#e)!==e&&l(this.#e).handleClose(),this.#n(),this.isOpenDelayed=!1,p(this.#e,e,!0)};onClose=e=>{l(this.#e)===e&&p(this.#e,null),this.#s()};isTooltipOpen=e=>l(this.#e)===e}const F=new O("Tooltip.Provider");function _(n){return F.set(new x(n))}function H(n,e){g(e,!0);let r=u(e,"delayDuration",3,700),d=u(e,"disableCloseOnTriggerClick",3,!1),t=u(e,"disableHoverableContent",3,!1),i=u(e,"disabled",3,!1),a=u(e,"ignoreNonKeyboardFocus",3,!1),c=u(e,"skipDelayDuration",3,300);_({delayDuration:s.with(()=>r()),disableCloseOnTriggerClick:s.with(()=>d()),disableHoverableContent:s.with(()=>t()),disabled:s.with(()=>i()),ignoreNonKeyboardFocus:s.with(()=>a()),skipDelayDuration:s.with(()=>c())});var o=h(),f=D(o);b(f,()=>e.children??v),m(n,o),T()}const K=H;function I(n,e){var r=h(),d=D(r);w(d,()=>K,(t,i)=>{i(t,{children:(a,c)=>{var o=h(),f=D(o);b(f,()=>e.children),m(a,o)},$$slots:{default:!0}})}),m(n,r)}export{I as component};
