PageSourceSearch

https://trailence.org/chunk-DflvqT1c.js

js trailence.org collected 2026-10-02 02:09:30 UTC 2,560 bytes, 1 lines download raw bytes

1import{An as gy,Dt as Vr,hn as eD,it as Pr,m as Dh,pr as q}from"./chunk-hDFLhPjY.js";import{zn as ww}from"./chunk-D0hd025I.js";var h=class{static getPositionInPage(t){let e={x:t.offsetLeft,y:t.offsetTop};for(;t.offsetParent&&t.offsetParent!==t&&t.offsetParent!==document.body;)t=t.offsetParent,e.x+=t.offsetLeft,e.y+=t.offsetTop,e.x-=t.scrollLeft,e.y-=t.scrollTop;return e}};var D=(()=>{class s{constructor(e,i){this.element=e,this.sanitizer=i}ngOnInit(){this.handler=new r(this.element.nativeElement,this.sanitizer.sanitize(q.HTML,this.appTooltip)??``)}ngOnChanges(e){e.appTooltip&&this.handler&&(this.handler.html=this.sanitizer.sanitize(q.HTML,this.appTooltip)??``)}mouseEnter(){this.handler?.mouseEnter()}mouseLeave(){this.handler?.mouseLeave()}click(e){this.handler?.click(e)}static{this.ɵfac=function(i){return new(i||s)(Vr(Pr),Vr(ww))}}static{this.ɵdir=eD({type:s,selectors:[[``,`appTooltip`,``]],hostBindings:function(i,o){i&1&&Dh(`mouseenter`,function(){return o.mouseEnter()})(`mouseleave`,function(){return o.mouseLeave()})(`click`,function(l){return o.click(l)})},inputs:{appTooltip:`appTooltip`},features:[gy]})}}return s})();var r=class{constructor(t,e){this.element=t,this.html=e,this.fromMouseHover=!1}mouseEnter(){this.shown||(this.fromMouseHover=!0,this.showTooltip())}mouseLeave(){!this.shown||!this.fromMouseHover||(this.fromMouseHover=!1,this.hideTooltip())}click(t){t.preventDefault(),t.stopPropagation(),this.showTooltip()}showTooltip(){if(this.shown)return;let t=h.getPositionInPage(this.element);this.shown=document.createElement(`DIV`),this.shown.classList.add(`app-tooltip`),this.shown.innerHTML=this.html,document.body.appendChild(this.shown);let e=this.shown.offsetHeight,i=this.shown.offsetWidth,o=this.element.offsetHeight,n=this.element.offsetWidth,l=document.documentElement.offsetHeight,p=document.documentElement.offsetWidth;e<t.y?(this.shown.style.top=t.y-e+`px`,i/2<t.x?this.shown.style.left=t.x-i/2+n/2+`px`:this.shown.style.left=`6px`):t.y+o+e<l?(this.shown.style.top=t.y+o+`px`,i/2<t.x?this.shown.style.left=t.x-i/2+n/2+`px`:this.shown.style.left=`6px`):(this.shown.style.top=`6px`,i<t.x?this.shown.style.left=t.x-i+`px`:t.x+n+i<p?this.shown.style.left=t.x+n+`px`:this.shown.style.left=p-i-6+`px`)}hideTooltip(){this.shown&&(this.shown.remove(),this.shown=void 0)}};function P(s,t,e,i){let o=new r(s,``);i.subscribe(e.translateValue$(t),n=>o.html=n),s.addEventListener(`mouseenter`,()=>o.mouseEnter()),s.addEventListener(`mouseleave`,()=>o.mouseLeave()),s.addEventListener(`click`,n=>o.click(n))}export{P as n,D as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.