(()=>{"use strict";new Intl.NumberFormat(void 0,{maximumFractionDigits:2}),new Intl.NumberFormat(void 0,{minimumFractionDigits:2,maximumFractionDigits:2});let a=(a,b,c)=>{let d=b.parent;for(let e=(d?.row||-1)+1;;++e){let d=a[e];if(d){if(!d.every(({startTime:a,endTime:d})=>a+c>b.endTime||d-c<b.startTime))continue}else d=[],a.push(d);b.row=e,d.push(b);break}},b=0;self.addEventListener("message",a=>{let c=a.data;switch(b=Math.max(b,c.requestId||0),c.type){case"calculateSpanPositions":d(c.root);break;case"filterSpans":f(c.root,c.filter)}});let c=(a,b)=>{for(let d of("parent"in a&&(a.row=-1,a.isVisible=!0,b.push(a)),a.children.slice().sort((a,b)=>a.startTime-b.startTime||b.duration-a.duration)))c(d,b)},d=d=>{let e=b,f=[],g=[];c(d,g);let h=Date.now()-10,i=-64,j=0,k=()=>{for(let a of f)a.sort((a,b)=>a.startTime-b.startTime);postMessage({requestId:e,type:"setRowsResult",rows:f,isEnd:!g.length}),h=Date.now(),i=j};for(;;){let b=g.shift();if(!b)return void k();a(f,b,.001),++j,(Date.now()-h>=15||j-i>=256)&&k()}},e=/(?<=^|\s)(?<pair>(?<key>[\w.]+):(?<value>\S*))/g,f=(a,c)=>{let d=b,f=new Set,g=c.replace(e,"").replace(/\s{2,}/g," ").trim(),h=[];for(let a of c.matchAll(e)){let{key:b="",value:c=""}=a.groups||{};h.push([b,c.toLocaleLowerCase()])}let i=a=>!!a.name.toLocaleLowerCase().includes(g)&&h.every(([b,c])=>{let d=a.attributes[b];return!!d&&String(d).toLocaleLowerCase().includes(c)}),j=a=>{for(let b of a.children)i(b.span)&&f.add(b.span.spanId),j(b)};j(a),postMessage({requestId:d,type:"updateHighlight",matches:f})};module.exports={}})();