import{P,ea as _,ha as C,ka as O}from"./chunk-4P6SOZDY.js";import{E as M}from"./chunk-MDIMQ3H3.js";import{Ec as x,Ib as m,Jb as f,Kb as h,La as a,Rb as u,Xb as g,Yc as s,Za as r,ib as c,kb as l,lc as b,mc as v,ob as d,oc as y,ra as i,sd as w}from"./chunk-GJDGQISV.js";var D=(t,p)=>({"tooltip-container-bottom":t,"tooltip-container-top":p});function R(t,p){t&1&&u(0)}var B=(()=>{class t{static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275cmp=c({type:t,selectors:[["POS-tooltip"]],inputs:{text:"text",position:"position",content:"content"},decls:3,vars:7,consts:[[4,"ngTemplateOutlet"]],template:function(e,n){e&1&&(f(0,"div"),v(1),d(2,R,1,0,"ng-container",0),h()),e&2&&(b(x(4,D,n.position=="top"||!n.position,n.position=="bottom")),r(),y(" ",n.text," "),r(),m("ngTemplateOutlet",n.content))},dependencies:[M,O,w],styles:['.tooltip-container-top[_ngcontent-%COMP%]{box-shadow:0 0 5px #0003;margin:.7rem 1rem 1rem;min-width:50px;max-width:400px;background:#fff;border:1px solid #ccc;pointer-events:none;position:relative;min-height:1rem;padding:.5rem;border-radius:4px}.tooltip-container-top[_ngcontent-%COMP%]:after, .tooltip-container-top[_ngcontent-%COMP%]:before{content:"";display:block;position:absolute;bottom:100%;width:0;height:0;border-style:solid}.tooltip-container-top[_ngcontent-%COMP%]:after{left:calc(49% + 2px);border-color:transparent transparent #fff transparent;border-width:6px}.tooltip-container-top[_ngcontent-%COMP%]:before{left:49%;border-color:transparent transparent #ccc transparent;border-width:8px}.tooltip-container-bottom[_ngcontent-%COMP%]{box-shadow:0 0 5px #0003;margin:.7rem 1rem 1rem;min-width:50px;max-width:400px;background:#fff;border:1px solid #ccc;pointer-events:none;position:relative;min-height:1rem;padding:.5rem;border-radius:4px}.tooltip-container-bottom[_ngcontent-%COMP%]:after, .tooltip-container-bottom[_ngcontent-%COMP%]:before{content:"";display:block;position:absolute;bottom:100%;width:0;height:0;border-style:solid}.tooltip-container-bottom[_ngcontent-%COMP%]:after{left:calc(40% + 2px);border-color:#fff transparent transparent transparent;border-width:6px;top:100%}.tooltip-container-bottom[_ngcontent-%COMP%]:before{left:40%;border-color:#ccc transparent transparent transparent;border-width:8px;top:100%}']})}}return t})(),q=(()=>{class t{constructor(){this.overlayPositionBuilder=i(_),this.elementRef=i(a),this.overlay=i(C),this.content=s.required({alias:"customTooltip"}),this.position=s()}ngOnInit(){let o=this.initPosition(),e=this.overlayPositionBuilder.flexibleConnectedTo(this.elementRef).withPositions([o]);this.overlayRef=this.overlay.create({positionStrategy:e})}initPosition(){let o={originX:"center",originY:"bottom",overlayX:"center",overlayY:"top"};return this.position()==="top"&&(o={originX:"center",originY:"top",overlayX:"center",overlayY:"bottom"}),o}show(){let o=this.content();if(o){this.overlayRef.detach();let e=new P(B),n=this.overlayRef.attach(e);typeof o=="string"?n.instance.text=o:n.instance.content=o,n.instance.position=this.position()??"top"}}hide(){this.overlayRef.detach()}static{this.\u0275fac=function(e){return new(e||t)}}static{this.\u0275dir=l({type:t,selectors:[["","customTooltip",""]],hostBindings:function(e,n){e&1&&g("mouseenter",function(){return n.show()})("mouseleave",function(){return n.hide()})},inputs:{content:[1,"customTooltip","content"],position:[1,"position"]}})}}return t})();export{B as a,q as b};
