MCPcopy
hub / github.com/joerick/pyinstrument / b

Function b

pyinstrument/renderers/html_resources/app.js:1–1  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1var pyinstrumentHTMLRenderer=function(){"use strict";var is=Object.defineProperty;var ns=(F,ve,Pe)=>ve in F?is(F,ve,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):F[ve]=Pe;var T=(F,ve,Pe)=>ns(F,typeof ve!="symbol"?ve+"":ve,Pe);function F(){}function ve(i){return i()}function Pe(){return Object.create(null)}function oe(i){i.forEach(ve)}function pt(i){return typeof i=="function"}function re(i,e){return i!=i?e==e:i!==e||i&&typeof i=="object"||typeof i=="function"}function ki(i){return Object.keys(i).length===0}function St(i,...e){if(i==null){for(const n of e)n(void 0);return F}const t=i.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function ge(i,e,t){i.$$.on_destroy.push(St(e,t))}function Ci(i,e,t){return i.set(t),e}function u(i,e){i.appendChild(e)}function S(i,e,t){i.insertBefore(e,t||null)}function L(i){i.parentNode&&i.parentNode.removeChild(i)}function f(i){return document.createElement(i)}function V(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function I(i){return document.createTextNode(i)}function b(){return I(" ")}function Mi(){return I("")}function x(i,e,t,n){return i.addEventListener(e,t,n),()=>i.removeEventListener(e,t,n)}function vt(i){return function(e){return e.preventDefault(),i.call(this,e)}}function gt(i){return function(e){return e.stopPropagation(),i.call(this,e)}}function a(i,e,t){t==null?i.removeAttribute(e):i.getAttribute(e)!==t&&i.setAttribute(e,t)}function _t(i){let e;return{p(...t){e=t,e.forEach(n=>i.push(n))},r(){e.forEach(t=>i.splice(i.indexOf(t),1))}}}function Fi(i){return Array.from(i.childNodes)}function _e(i,e){e=""+e,i.data!==e&&(i.data=e)}function ae(i,e){i.value=e??""}function j(i,e,t,n){t==null?i.style.removeProperty(e):i.style.setProperty(e,t,"")}function Ee(i,e,t){i.classList.toggle(e,!!t)}function Pi(i,e,{bubbles:t=!1,cancelable:n=!1}={}){return new CustomEvent(i,{detail:e,bubbles:t,cancelable:n})}class Ri{constructor(e=!1){T(this,"is_svg",!1);T(this,"e");T(this,"n");T(this,"t");T(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,n=null){this.e||(this.is_svg?this.e=V(t.nodeName):this.e=f(t.nodeType===11?"TEMPLATE":t.nodeName),this.t=t.tagName!=="TEMPLATE"?t:t.content,this.c(e)),this.i(n)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)S(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(L)}}let Ye;function Xe(i){Ye=i}function wt(){if(!Ye)throw new Error("Function called outside component initialization");return Ye}function bt(i){wt().$$.on_mount.push(i)}function Ii(i){wt().$$.on_destroy.push(i)}function Li(){const i=wt();return(e,t,{cancelable:n=!1}={})=>{const s=i.$$.callbacks[e];if(s){const l=Pi(e,t,{cancelable:n});return s.slice().forEach(r=>{r.call(i,l)}),!l.defaultPrevented}return!0}}const Se=[],ke=[];let De=[];const Dt=[],Si=Promise.resolve();let yt=!1;function Di(){yt||(yt=!0,Si.then(Ht))}function Tt(i){De.push(i)}const At=new Set;let He=0;function Ht(){if(He!==0)return;const i=Ye;do{try{for(;He<Se.length;){const e=Se[He];He++,Xe(e),Hi(e.$$)}}catch(e){throw Se.length=0,He=0,e}for(Xe(null),Se.length=0,He=0;ke.length;)ke.pop()();for(let e=0;e<De.length;e+=1){const t=De[e];At.has(t)||(At.add(t),t())}De.length=0}while(Se.length);for(;Dt.length;)Dt.pop()();yt=!1,At.clear(),Xe(i)}function Hi(i){if(i.fragment!==null){i.update(),oe(i.before_update);const e=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,e),i.after_update.forEach(Tt)}}function Oi(i){const e=[],t=[];De.forEach(n=>i.indexOf(n)===-1?e.push(n):t.push(n)),t.forEach(n=>n()),De=e}const nt=new Set;let Re;function Oe(){Re={r:0,c:[],p:Re}}function Ve(){Re.r||oe(Re.c),Re=Re.p}function D(i,e){i&&i.i&&(nt.delete(i),i.i(e))}function N(i,e,t,n){if(i&&i.o){if(nt.has(i))return;nt.add(i),Re.c.push(()=>{nt.delete(i),n&&(t&&i.d(1),n())}),i.o(e)}else n&&n()}function Ot(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Vi(i,e){N(i,1,1,()=>{e.delete(i.key)})}function xi(i,e,t,n,s,l,r,o,c,d,v,p){let m=i.length,h=l.length,g=m;const w={};for(;g--;)w[i[g].key]=g;const E=[],C=new Map,y=new Map,k=[];for(g=h;g--;){const M=p(s,l,g),_=t(M);let A=r.get(_);A?k.push(()=>A.p(M,e)):(A=d(_,M),A.c()),C.set(_,E[g]=A),_ in w&&y.set(_,Math.abs(g-w[_]))}const H=new Set,W=new Set;function P(M){D(M,1),M.m(o,v),r.set(M.key,M),v=M.first,h--}for(;m&&h;){const M=E[h-1],_=i[m-1],A=M.key,R=_.key;M===_?(v=M.first,m--,h--):C.has(R)?!r.has(A)||H.has(A)?P(M):W.has(R)?m--:y.get(A)>y.get(R)?(W.add(A),P(M)):(H.add(R),m--):(c(_,r),m--)}for(;m--;){const M=i[m];C.has(M.key)||c(M,r)}for(;h;)P(E[h-1]);return oe(k),E}function we(i){i&&i.c()}function ce(i,e,t){const{fragment:n,after_update:s}=i.$$;n&&n.m(e,t),Tt(()=>{const l=i.$$.on_mount.map(ve).filter(pt);i.$$.on_destroy?i.$$.on_destroy.push(...l):oe(l),i.$$.on_mount=[]}),s.forEach(Tt)}function ue(i,e){const t=i.$$;t.fragment!==null&&(Oi(t.after_update),oe(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function Ni(i,e){i.$$.dirty[0]===-1&&(Se.push(i),Di(),i.$$.dirty.fill(0)),i.$$.dirty[e/31|0]|=1<<e%31}function de(i,e,t,n,s,l,r=null,o=[-1]){const c=Ye;Xe(i);const d=i.$$={fragment:null,ctx:[],props:l,update:F,not_equal:s,bound:Pe(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Pe(),dirty:o,skip_bound:!1,root:e.target||c.$$.root};r&&r(d.root);let v=!1;if(d.ctx=t?t(i,e.props||{},(p,m,...h)=>{const g=h.length?h[0]:m;return d.ctx&&s(d.ctx[p],d.ctx[p]=g)&&(!d.skip_bound&&d.bound[p]&&d.bound[p](g),v&&Ni(i,p)),m}):[],d.update(),v=!0,oe(d.before_update),d.fragment=n?n(d.ctx):!1,e.target){if(e.hydrate){const p=Fi(e.target);d.fragment&&d.fragment.l(p),p.forEach(L)}else d.fragment&&d.fragment.c();e.intro&&D(i.$$.fragment),ce(i,e.target,e.anchor),Ht()}Xe(c)}class he{constructor(){T(this,"$$");T(this,"$$set")}$destroy(){ue(this,1),this.$destroy=F}$on(e,t){if(!pt(t))return F;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const s=n.indexOf(t);s!==-1&&n.splice(s,1)}}$set(e){this.$$set&&!ki(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const $i="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add($i);function Bi(i){let e,t;return{c(){e=V("svg"),t=V("path"),a(t,"fill-rule","evenodd"),a(t,"clip-rule","evenodd"),a(t,"d","M5.11634 0.889422C4.86506 -0.296474 3.17237 -0.296474 2.92109 0.889422C2.78291 1.54158 2.10994 1.93011 1.47607 1.72371C0.323418 1.34837 -0.522932 2.81429 0.378448 3.62484C0.87414 4.07059 0.87414 4.84767 0.378448 5.29341C-0.522931 6.10397 0.323418 7.56989 1.47607 7.19455C2.10994 6.98814 2.78291 7.37668 2.92109 8.02883C3.17237 9.21473 4.86506 9.21473 5.11634 8.02883C5.25452 7.37668 5.92749 6.98814 6.56136 7.19455C7.71401 7.56989 8.56036 6.10397 7.65898 5.29341C7.16329 4.84767 7.16329 4.07059 7.65898 3.62484C8.56036 2.81429 7.71401 1.34837 6.56136 1.72371C5.92749 1.93011 5.25452 1.54158 5.11634 0.889422ZM4.01883 6.33408C5.05436 6.33408 5.89383 5.49462 5.89383 4.45908C5.89383 3.42355 5.05436 2.58408 4.01883 2.58408C2.98329 2.58408 2.14383 3.42355 2.14383 4.45908C2.14383 5.49462 2.98329 6.33408 4.01883 6.33408Z"),a(t,"fill","currentColor"),a(e,"width","9"),a(e,"height","9"),a(e,"viewBox","0 0 9 9"),a(e,"fill","none"),a(e,"xmlns","http://www.w3.org/2000/svg")},m(n,s){S(n,e,s),u(e,t)},p:F,i:F,o:F,d(n){n&&L(e)}}}class zi extends he{constructor(e){super(),de(this,e,null,Bi,re,{})}}function Wi(i){let e,t,n,s,l,r,o,c,d,v,p,m,h,g,w,E,C;return{c(){e=V("svg"),t=V("g"),n=V("path"),s=V("path"),l=V("defs"),r=V("filter"),o=V("feFlood"),c=V("feBlend"),d=V("feGaussianBlur"),v=V("linearGradient"),p=V("stop"),m=V("stop"),h=V("stop"),g=V("linearGradient"),w=V("stop"),E=V("stop"),C=V("stop"),a(n,"fill-rule","evenodd"),a(n,"clip-rule","evenodd"),a(n,"d","M30 9H10V11.5H30V9ZM30 19H12.5V21.5H30V19ZM12.5 14H32.5V16.5H12.5V14ZM20 24H12.5V26.5H20V24ZM12.5 29H20V31.5H12.5V29ZM22.5 34H10V36.5H22.5V34Z"),a(n,"fill","url(#paint0_linear_67_262)"),a(t,"opacity","0.5"),a(t,"filter","url(#filter0_f_67_262)"),a(s,"fill-rule","evenodd"),a(s,"clip-rule","evenodd"),a(s,"d","M30 9H10V11.5H30V9ZM30 19H12.5V21.5H30V19ZM12.5 14H32.5V16.5H12.5V14ZM20 24H12.5V26.5H20V24ZM12.5 29H20V31.5H12.5V29ZM22.5 34H10V36.5H22.5V34Z"),a(s,"fill","url(#paint1_linear_67_262)"),a(o,"flood-opacity","0"),a(o,"result","BackgroundImageFix"),a(c,"mode","normal"),a(c,"in","SourceGraphic"),a(c,"in2","BackgroundImageFix"),a(c,"result","shape"),a(d,"stdDeviation","3.39785"),a(d,"result","effect1_foregroundBlur_67_262"),a(r,"id","filter0_f_67_262"),a(r,"x","3.2043"),a(r,"y","2.2043"),a(r,"width","36.0914"),a(r,"height","41.0914"),a(r,"filterUnits","userSpaceOnUse"),a(r,"color-interpolation-filters","sRGB"),a(p,"stop-color","#FFAA00"),a(m,"offset","0.514478"),a(m,"stop-color","#FFEB00"),a(h,"offset","1"),a(h,"stop-color","#98FF05"),a(v,"id","paint0_linear_67_262"),a(v,"x1","7.3769"),a(v,"y1","18.4566"),a(v,"x2","20.6583"),a(v,"y2","33.1038"),a(v,"gradientUnits","userSpaceOnUse"),a(w,"stop-color","#FFC834"),a(E,"offset","0.514478"),a(E,"stop-color","#FAF534"),a(C,"offset","1"),a(C,"stop-color","#B8FF38"),a(g,"id","paint1_linear_67_262"),a(g,"x1","7.3769"),a(g,"y1","18.4566"),a(g,"x2","20.6583"),a(g,"y2","33.1038"),a(g,"gradientUnits","userSpaceOnUse"),a(e,"width","44"),a(e,"height","44"),a(e,"viewBox","0 0 44 44"),a(e,"fill","none"),a(e,"xmlns","http://www.w3.org/2000/svg")},m(y,k){S(y,e,k),u(e,t),u(t,n),u(e,s),u(e,l),u(l,r),u(r,o),u(r,c),u(r,d),u(l,v),u(v,p),u(v,m),u(v,h),u(l,g),u(g,w),u(g,E),u(g,C)},p:F,i:F,o:F,d(y){y&&L(e)}}}class qi extends he{constructor(e){super(),de(this,e,null,Wi,re,{})}}const xe=[];function Ui(i,e){return{subscribe:st(i,e).subscribe}}function st(i,e=F){let t;const n=new Set;function s(o){if(re(i,o)&&(i=o,t)){const c=!xe.length;for(const d of n)d[1](),xe.push(d,i);if(c){for(let d=0;d<xe.length;d+=2)xe[d][0](xe[d+1]);xe.length=0}}}function l(o){s(o(i))}function r(o,c=F){const d=[o,c];return n.add(d),n.size===1&&(t=e(s,l)||F),o(i),()=>{n.delete(d),n.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:r}}function Vt(i,e,t){const n=!Array.isArray(i),s=n?[i]:i;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return Ui(t,(r,o)=>{let c=!1;const d=[];let v=0,p=F;const m=()=>{if(v)return;p();const g=e(n?d[0]:d,r,o);l?r(g):p=pt(g)?g:F},h=s.map((g,w)=>St(g,E=>{d[w]=E,v&=~(1<<w),c&&m()},()=>{v|=1<<w}));return c=!0,m(),function(){oe(h),p(),c=!1}})}var Et={local:{},session:{}};function Yi(i){return i==="local"?localStorage:sessionStorage}function kt(i,e,t){var n,s,l,r,o,c,d,v;t!=null&&t.onError&&console.warn("onError has been deprecated. Please use onWriteError instead");const p=(n=t==null?void 0:t.serializer)!=null?n:JSON,m=(s=t==null?void 0:t.storage)!=null?s:"local",h=(l=t==null?void 0:t.syncTabs)!=null?l:!0,g=(o=(r=t==null?void 0:t.onWriteError)!=null?r:t==null?void 0:t.onError)!=null?o:P=>console.error(`Error when writing value from persisted store "${i}" to ${m}`,P),w=(c=t==null?void 0:t.onParseError)!=null?c:(P,M)=>console.error(`Error when parsing ${P?'"'+P+'"':"value"} from persisted store "${i}"`,M),E=(d=t==null?void 0:t.beforeRead)!=null?d:P=>P,C=(v=t==null?void 0:t.beforeWrite)!=null?v:P=>P,y=typeof window<"u"&&typeof document<"u",k=y?Yi(m):null;function H(P,M){const _=C(M);try{k==null||k.setItem(P,p.stringify(_))}catch(A){g(A)}}function W(){function P(R){try{return p.parse(R)}catch(B){w(R,B)}}const M=k==null?void 0:k.getItem(i);if(M==null)return e;const _=P(M);return _==null?e:E(_)}if(!Et[m][i]){const P=W(),M=st(P,R=>{if(y&&m=="local"&&h){const B=J=>{if(J.key===i&&J.newValue){let $;try{$=p.parse(J.newValue)}catch(ee){w(J.newValue,ee);return}const Le=E($);R(Le)}};return window.addEventListener("storage",B),()=>window.removeEventListener("storage",B)}}),{subscribe:_,set:A}=M;Et[m][i]={set(R){A(R),H(i,R)},update(R){return M.update(B=>{const J=R(B);return H(i,J),J})},reset(){this.set(e)},subscribe:_}}return Et[m][i]}function xt(){return{collapseMode:"non-application",collapseCustomHide:"",collapseCustomShow:"",removeImportlib:!0,removeTracebackHide:!0,removePyinstrument:!0,removeIrrelevant:!0,removeIrrelevantThreshold:.001,timeFormat:"absolute"}}const Z=kt("pyinstrument:viewOptionsCallStack",xt(),{syncTabs:!0,beforeRead(i){return{...xt(),...i}}}),Ge=kt("pyinstrument:viewOptions",{viewMode:"call-stack"},{syncTabs:!1}),je=kt("pyinstrument:viewOptionsTimeline",{removeImportlib:!0,removeTracebackHide:!0,removePyinstrument:!0,removeIrrelevant:!0,removeIrrelevantThreshold:1e-4},{syncTabs:!0});class Xi extends Error{constructor(e){super(`Unreachable case: ${e}`)}}function Gi(i,e){const t=e*(i.length-1),n=Math.floor(t),s=Math.ceil(t),l=i[n],r=i[s],o=t-n;return Zi(o,{to:[l,r]})}function ji(i,e,t){return i===1/0?(console.warn("clamp: value is Infinity, returning `max`",i),t):i===-1/0?(console.warn("clamp: value is -Infinity, returning `min`",i),e):Number.isFinite(i)?i<e?e:i>t?t:i:(console.warn("clamp: value isn't finite, returning `min`",i),e)}function Ne(i,e){const{from:t=[0,1],to:n=[0,1]}=e,s=e.clamp||!1;let l=(i-t[0])/(t[1]-t[0])*(n[1]-n[0])+n[0];return s&&(l=ji(l,Math.min(n[0],n[1]),Math.max(n[0],n[1]))),l}function Zi(i,e){return`rgb(
2 ${Ne(i,{from:e.from,to:[e.to[0][0],e.to[1][0]],clamp:e.clamp})},
3 ${Ne(i,{from:e.from,to:[e.to[0][1],e.to[1][1]],clamp:e.clamp})},
4 ${Ne(i,{from:e.from,to:[e.to[0][2],e.to[1][2]],clamp:e.clamp})}

Callers 1

cFunction · 0.70

Calls 1

IFunction · 0.70

Tested by

no test coverage detected