forked from cory/tildefriends
Cory McWilliams
de59a7f338
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4031 ed5197a5-7fde-0310-b194-c3ffbd925b24
1 line
728 KiB
Plaintext
1 line
728 KiB
Plaintext
{"version":3,"sources":["../src/options.js","../src/constants.js","../src/create-element.js","../src/component.js","../src/render.js","../src/create-context.js","../src/util.js","../src/diff/children.js","../src/diff/props.js","../src/diff/index.js","../src/clone-element.js","../src/diff/catch-error.js","../src/lib/utils.ts","../src/lib/lru-cache.ts","../src/lib/math.ts","../node_modules/process/browser.js","../src/gl/graphics.ts","../src/gl/utils.ts","../src/gl/rectangle-batch-renderer.ts","../src/lib/color.ts","../src/gl/row-atlas.ts","../src/gl/texture-renderer.ts","../src/gl/overlay-rectangle-renderer.ts","../src/gl/flamechart-color-pass-renderer.ts","../src/gl/canvas-context.ts","../src/app-state/getters.ts","../src/index.js","../src/PureComponent.js","../src/memo.js","../src/forwardRef.js","../src/Children.js","../src/suspense.js","../src/suspense-list.js","../src/portals.js","../src/events.js","../src/lib/atom.ts","../src/lib/view-mode.ts","../src/lib/hash-params.ts","../src/app-state/profile-group.ts","../src/app-state/index.ts","../src/app-state/active-profile-state.ts","../src/app-state/color-scheme.ts","../src/views/themes/dark-theme.ts","../src/views/themes/light-theme.ts","../src/views/themes/theme.tsx","../node_modules/css-in-js-utils/lib/isPrefixedValue.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/calc.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/crossFade.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/cursor.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/filter.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/flex.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/flexboxIE.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/flexboxOld.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/gradient.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/imageSet.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/position.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/sizing.js","../node_modules/hyphenate-style-name/index.js","../node_modules/css-in-js-utils/lib/hyphenateProperty.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/utils/capitalizeString.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/plugins/transition.js","../node_modules/string-hash/index.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/utils/prefixProperty.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/utils/prefixValue.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/utils/addNewValuesOnly.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/utils/isObject.js","../node_modules/aphrodite/node_modules/inline-style-prefixer/static/createPrefixer.js","../node_modules/asap/browser-raw.js","../node_modules/asap/browser-asap.js","../node_modules/aphrodite/es/index.js","../src/views/style.ts","../src/lib/profile-search.ts","../src/views/search-view.tsx","../src/lib/emscripten.ts","../src/views/color-chit.tsx","../src/views/scrollable-list-view.tsx","../src/views/profile-table-view.tsx","../src/lib/flamechart.ts","../src/gl/flamechart-renderer.ts","../src/views/flamechart-style.ts","../src/lib/text-utils.ts","../src/views/flamechart-minimap-view.tsx","../src/views/flamechart-detail-view.tsx","../src/lib/canvas-2d-batch-renderers.ts","../src/views/flamechart-pan-zoom-view.tsx","../src/views/hovertip.tsx","../src/views/flamechart-search-view.tsx","../src/lib/preact-helpers.tsx","../src/views/flamechart-view.tsx","../src/views/flamechart-view-container.tsx","../src/views/flamechart-wrapper.tsx","../src/views/inverted-caller-flamegraph-view.tsx","../src/views/callee-flamegraph-view.tsx","../src/views/sandwich-search-view.tsx","../src/views/sandwich-view.tsx","../src/lib/value-formatters.ts","../node_modules/parcel-bundler/src/builtins/bundle-url.js","../node_modules/parcel-bundler/src/builtins/bundle-loader.js","../src/lib/profile.ts","../src/lib/file-format-spec.ts","../package.json","../src/lib/file-format.ts","../src/lib/fuzzy-find.ts","../src/views/profile-select.tsx","../src/views/toolbar.tsx","../src/lib/js-source-map.ts","../src/views/application.tsx","../src/views/application-container.tsx","../src/speedscope.tsx","../node_modules/parcel-bundler/src/builtins/loaders/browser/js-loader.js"],"names":["options","isValidElement","rerenderQueue","rerenderCount","defer","prevDebounce","IS_HYDRATE","i","EMPTY_OBJ","EMPTY_ARR","IS_NON_DIMENSIONAL","assign","obj","props","removeNode","node","parentNode","removeChild","createElement","type","children","normalizedProps","arguments","length","push","defaultProps","createVNode","key","ref","original","vnode","_children","_parent","_depth","_dom","_nextDom","_component","constructor","_original","createRef","Fragment","Component","context","getDomSibling","childIndex","indexOf","sibling","updateParentDomPointers","child","base","enqueueRender","c","_dirty","debounceRendering","process","queue","sort","a","b","_vnode","some","component","commitQueue","oldVNode","newDom","oldDom","parentDom","_parentDom","diff","_globalContext","ownerSVGElement","commitRoot","diffChildren","newParentVNode","oldParentVNode","globalContext","isSvg","excessDomChildren","isHydrating","j","sibDom","firstChildDom","refs","oldChildren","oldChildrenLength","toChildArray","childVNode","undefined","nextDom","outer","appendChild","nextSibling","insertBefore","value","unmount","applyRef","callback","flattened","Array","isArray","diffProps","dom","newProps","oldProps","hydrate","setProperty","setStyle","style","test","name","oldValue","s","useCapture","nameLower","cssText","replace","toLowerCase","slice","addEventListener","eventProxy","_listeners","removeEventListener","removeAttributeNS","setAttributeNS","removeAttribute","setAttribute","e","event","newVNode","tmp","isNew","oldState","snapshot","clearProcessingException","provider","componentContext","newType","_diff","contextType","_id","_defaultValue","_processingException","_pendingError","prototype","render","doRender","sub","state","_renderCallbacks","_nextState","getDerivedStateFromProps","componentWillMount","componentDidMount","componentWillReceiveProps","_force","shouldComponentUpdate","componentWillUpdate","componentDidUpdate","_render","getChildContext","getSnapshotBeforeUpdate","diffElementNodes","diffed","_catchError","root","_commit","cb","call","oldHtml","newHtml","nodeType","localName","document","createTextNode","createElementNS","is","data","childNodes","dangerouslySetInnerHTML","attributes","__html","innerHTML","checked","current","parentVNode","skipRemove","r","componentWillUnmount","this","replaceNode","_root","cloneElement","createContext","defaultValue","ctx","Consumer","Provider","subs","_this","_props","old","splice","_contextRef","error","hasCaught","getDerivedStateFromError","setState","componentDidCatch","update","forceUpdate","Promise","then","bind","resolve","setTimeout","cachedSetTimeout","cachedClearTimeout","module","exports","defaultSetTimout","Error","defaultClearTimeout","runTimeout","fun","runClearTimeout","marker","clearTimeout","currentQueue","draining","queueIndex","cleanUpNextTick","concat","drainQueue","timeout","len","run","Item","array","noop","nextTick","args","apply","title","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","currentIndex","currentComponent","prevRaf","currentHook","afterPaintEffects","oldBeforeRender","oldAfterDiff","oldCommit","oldBeforeUnmount","getHookState","index","_hook","hooks","__hooks","_list","_pendingEffects","useState","initialState","useReducer","invokeOrReturn","reducer","init","hookState","_value","action","nextValue","useEffect","_skipEffects","argsChanged","_args","useLayoutEffect","useRef","initialValue","useMemo","useImperativeHandle","createHandle","factory","_factory","useCallback","useContext","_context","useDebugValue","formatter","useErrorBoundary","errState","err","flushAfterPaintEffects","forEach","invokeCleanup","invokeEffect","hook","_cleanup","result","oldArgs","newArgs","arg","f","requestAnimationFrame","raf","done","cancelAnimationFrame","window","filter","shallowDiffers","PureComponent","isPureReactComponent","memo","comparer","shouldUpdate","nextProps","updateRef","Memoed","isReactComponent","displayName","_forwarded","oldDiffHook","forwardRef","fn","Forwarded","clone","mapFn","reduce","acc","Children","map","count","only","toArray","oldCatchError","detachedClone","Suspense","_pendingSuspensionCount","_suspenders","_detachOnNextRender","suspended","_suspended","lazy","loader","prom","Lazy","default","SuspenseList","_next","_map","_childDidSuspend","promise","suspendingComponent","resolved","onResolved","onSuspensionComplete","_suspendedComponentWillUnmount","pop","fallback","list","delete","revealOrder","size","delegated","get","unsuspend","wrappedUnsuspend","Map","reverse","set","ContextProvider","Portal","container","wrap","_container","_temp","_unmount","_wrap","_hasMounted","createPortal","CAMEL_PROPS","REACT_ELEMENT_TYPE","Symbol","for","parent","firstChild","preactRender","preactHydrate","oldEventHook","setSafeDescriptor","proto","Object","defineProperty","configurable","v","persist","stoppedPropagating","defaultPrevented","origStopPropagation","stopPropagation","origPreventDefault","preventDefault","isPropagationStopped","isDefaultPrevented","nativeEvent","classNameDescriptor","class","oldVNodeHook","$$typeof","className","enumerable","shouldSanitize","attrs","multiple","selected","ondoubleclick","ondblclick","onbeforeinput","onchange","normalized","oninput","_patchedLifecycles","createFactory","element","preactCloneElement","unmountComponentAtNode","findDOMNode","unstable_batchedUpdates","w","m","ms","wm","wms","wmms","staticPrefixData","plugins","calc","crossFade","cursor","flex","flexboxIE","flexboxOld","gradient","imageSet","position","sizing","transition","prefixMap","_typeof","iterator","_createClass","defineProperties","target","descriptor","writable","Constructor","protoProps","staticProps","_classCallCheck","instance","TypeError","MAP_EXISTS","OrderedElements","elements","keyOrder","shouldReorder","hasOwnProperty","nested","_nested","keys","has","addStyleType","styleType","UPPERCASE_RE","UPPERCASE_RE_TO_KEBAB","match","String","kebabifyStyleName","string","isUnitlessNumber","animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridColumn","fontWeight","lineClamp","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","prefixKey","prefix","charAt","toUpperCase","substring","prefixes","prop","stringifyValue","stringifyAndImportantifyValue","importantify","hashString","toString","hashObject","object","JSON","stringify","_toConsumableArray","arr","arr2","from","prefixAll","defaultSelectorHandlers","pseudoSelectors","selector","baseSelector","generateSubtreeStyles","mediaQueries","generated","join","generateCSS","styleTypes","selectorHandlers","stringHandlers","useImportant","merged","plainDeclarations","generatedStyles","val","handler","newSelector","console","warn","generatedRuleset","generateCSSRuleset","unshift","runStringHandlers","declarations","stringHandlerKeys","transformRule","transformValue","arrayToObjectKeysReducer","originalElements","create","prefixedElements","elementNames","originalStyle","originalIndex","rules","_i","_typeof$1","_toConsumableArray$1","styleTag","injectStyleTag","cssRules","querySelector","head","getElementsByTagName","sheet","styleSheet","insertRule","numRules","rule","innerText","fontFamily","injectStyleOnce","src","animationName","finalVal","valVal","valKey","injectGeneratedCSSOnce","alreadyInjected","injectionBuffer","isBuffering","generatedCSS","_injectionBuffer","flushToStyleTag","definitions","reset","getBufferedStyles","startBuffering","flushToArray","ret","flushToString","getRenderedClassNames","addRenderedClassNames","classNames","processStyleDefinitions","styleDefinitions","classNameBits","definitionBits","_name","_definition","_len","injectAndGetClassName","unminifiedHashFn","str","initialHashFn","hashFn","StyleSheet","sheetDefinition","mappedSheetDefinition","stringVal","rehydrate","renderedClassNames","StyleSheetServer","renderStatic","renderFunc","html","css","content","StyleSheetTestUtils","makeExports","extend","extensions","extensionSelectorHandlers","extension","selectorHandler","minify","shouldMinify","_key","Aphrodite","StyleSheet$1","StyleSheetServer$1","StyleSheetTestUtils$1","bundleURL","getBundleURLCached","getBundleURL","matches","stack","getBaseURL","url","require","loadBundlesLazy","bundles","id","code","LazyPromise","reject","loadBundles","all","loadBundle","bundleLoaders","registerBundleLoader","load","register","bundle","lastIndexOf","bundleLoader","catch","executor","onSuccess","onError","description","repository","main","bin","speedscope","scripts","deploy","prepack","prettier","lint","jest","coverage","typecheck","serve","files","browserslist","author","license","devDependencies","acorn","aphrodite","eslint","jsverify","jszip","pako","preact","protobufjs","typescript","transform","setupFilesAfterEnv","testRegex","collectCoverageFrom","moduleFileExtensions","dependencies","open","script","async","charset","onerror","onload"],"mappings":";AAWMA,aAAAA,OAAAA,eAAAA,QAAAA,aAAAA,CAAAA,OAAAA,IAAAA,QAAAA,OAAAA,EAAAA,QAAAA,QAAAA,EAAAA,QAAAA,EAAAA,QAAAA,cAA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,IAGTylB,EAAOI,OAAS,WACdJ,EAAOG,QAAUH,EAAOI,OAAS,KACjCtgB,KAGFzC,SAASua,qBAAqB,QAAQ,GAAGzf,YAAY6nB","file":"speedscope.eee21de6.js","sourceRoot":"../../assets","sourcesContent":["import { _catchError } from './diff/catch-error';\n\n/**\n * The `option` object can potentially contain callback functions\n * that are called during various stages of our renderer. This is the\n * foundation on which all our addons like `preact/debug`, `preact/compat`,\n * and `preact/hooks` are based on. See the `Options` type in `internal.d.ts`\n * for a full list of available option hooks (most editors/IDEs allow you to\n * ctrl+click or cmd+click on mac the type definition below).\n * @type {import('./internal').Options}\n */\nconst options = {\n\t_catchError\n};\n\nexport default options;\n","export const EMPTY_OBJ = {};\nexport const EMPTY_ARR = [];\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n","import options from './options';\n\n/**\n * Create an virtual node (used for JSX)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * constructor for this virtual node\n * @param {object | null | undefined} [props] The properties of the virtual node\n * @param {Array<import('.').ComponentChildren>} [children] The children of the virtual node\n * @returns {import('./internal').VNode}\n */\nexport function createElement(type, props, children) {\n\tlet normalizedProps = {},\n\t\ti;\n\tfor (i in props) {\n\t\tif (i !== 'key' && i !== 'ref') normalizedProps[i] = props[i];\n\t}\n\n\tif (arguments.length > 3) {\n\t\tchildren = [children];\n\t\t// https://github.com/preactjs/preact/issues/1916\n\t\tfor (i = 3; i < arguments.length; i++) {\n\t\t\tchildren.push(arguments[i]);\n\t\t}\n\t}\n\tif (children != null) {\n\t\tnormalizedProps.children = children;\n\t}\n\n\t// If a Component VNode, check for and apply defaultProps\n\t// Note: type may be undefined in development, must never error here.\n\tif (typeof type == 'function' && type.defaultProps != null) {\n\t\tfor (i in type.defaultProps) {\n\t\t\tif (normalizedProps[i] === undefined) {\n\t\t\t\tnormalizedProps[i] = type.defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn createVNode(\n\t\ttype,\n\t\tnormalizedProps,\n\t\tprops && props.key,\n\t\tprops && props.ref,\n\t\tnull\n\t);\n}\n\n/**\n * Create a VNode (used internally by Preact)\n * @param {import('./internal').VNode[\"type\"]} type The node name or Component\n * Constructor for this virtual node\n * @param {object | string | number | null} props The properties of this virtual node.\n * If this virtual node represents a text node, this is the text of the node (string or number).\n * @param {string | number | null} key The key for this virtual node, used when\n * diffing it against its children\n * @param {import('./internal').VNode[\"ref\"]} ref The ref property that will\n * receive a reference to its created child\n * @returns {import('./internal').VNode}\n */\nexport function createVNode(type, props, key, ref, original) {\n\t// V8 seems to be better at detecting type shapes if the object is allocated from the same call site\n\t// Do not inline into createElement and coerceToVNode!\n\tconst vnode = {\n\t\ttype,\n\t\tprops,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t// _nextDom must be initialized to undefined b/c it will eventually\n\t\t// be set to dom.nextSibling which can return `null` and it is important\n\t\t// to be able to distinguish between an uninitialized _nextDom and\n\t\t// a _nextDom that has been set to `null`\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\tconstructor: undefined,\n\t\t_original: original\n\t};\n\n\tif (original == null) vnode._original = vnode;\n\tif (options.vnode) options.vnode(vnode);\n\n\treturn vnode;\n}\n\nexport function createRef() {\n\treturn {};\n}\n\nexport function Fragment(props) {\n\treturn props.children;\n}\n\n/**\n * Check if a the argument is a valid Preact VNode.\n * @param {*} vnode\n * @returns {vnode is import('./internal').VNode}\n */\nexport const isValidElement = vnode =>\n\tvnode != null && vnode.constructor === undefined;\n","import { assign } from './util';\nimport { diff, commitRoot } from './diff/index';\nimport options from './options';\nimport { Fragment } from './create-element';\n\n/**\n * Base Component class. Provides `setState()` and `forceUpdate()`, which\n * trigger rendering\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components'\n * getChildContext\n */\nexport function Component(props, context) {\n\tthis.props = props;\n\tthis.context = context;\n}\n\n/**\n * Update component state and schedule a re-render.\n * @param {object | ((s: object, p: object) => object)} update A hash of state\n * properties to update with new values or a function that given the current\n * state and props returns a new partial state\n * @param {() => void} [callback] A function to be called once component state is\n * updated\n */\nComponent.prototype.setState = function(update, callback) {\n\t// only clone state when copying to nextState the first time.\n\tlet s;\n\tif (this._nextState !== this.state) {\n\t\ts = this._nextState;\n\t} else {\n\t\ts = this._nextState = assign({}, this.state);\n\t}\n\n\tif (typeof update == 'function') {\n\t\tupdate = update(s, this.props);\n\t}\n\n\tif (update) {\n\t\tassign(s, update);\n\t}\n\n\t// Skip update if updater function returned null\n\tif (update == null) return;\n\n\tif (this._vnode) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Immediately perform a synchronous re-render of the component\n * @param {() => void} [callback] A function to be called after component is\n * re-rendered\n */\nComponent.prototype.forceUpdate = function(callback) {\n\tif (this._vnode) {\n\t\t// Set render mode so that we can differentiate where the render request\n\t\t// is coming from. We need this because forceUpdate should never call\n\t\t// shouldComponentUpdate\n\t\tthis._force = true;\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t}\n};\n\n/**\n * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n * @param {object} props Props (eg: JSX attributes) received from parent\n * element/component\n * @param {object} state The component's current state\n * @param {object} context Context object, as returned by the nearest\n * ancestor's `getChildContext()`\n * @returns {import('./index').ComponentChildren | void}\n */\nComponent.prototype.render = Fragment;\n\n/**\n * @param {import('./internal').VNode} vnode\n * @param {number | null} [childIndex]\n */\nexport function getDomSibling(vnode, childIndex) {\n\tif (childIndex == null) {\n\t\t// Use childIndex==null as a signal to resume the search from the vnode's sibling\n\t\treturn vnode._parent\n\t\t\t? getDomSibling(vnode._parent, vnode._parent._children.indexOf(vnode) + 1)\n\t\t\t: null;\n\t}\n\n\tlet sibling;\n\tfor (; childIndex < vnode._children.length; childIndex++) {\n\t\tsibling = vnode._children[childIndex];\n\n\t\tif (sibling != null && sibling._dom != null) {\n\t\t\t// Since updateParentDomPointers keeps _dom pointer correct,\n\t\t\t// we can rely on _dom to tell us if this subtree contains a\n\t\t\t// rendered DOM node, and what the first rendered DOM node is\n\t\t\treturn sibling._dom;\n\t\t}\n\t}\n\n\t// If we get here, we have not found a DOM node in this vnode's children.\n\t// We must resume from this vnode's sibling (in it's parent _children array)\n\t// Only climb up and search the parent if we aren't searching through a DOM\n\t// VNode (meaning we reached the DOM parent of the original vnode that began\n\t// the search)\n\treturn typeof vnode.type == 'function' ? getDomSibling(vnode) : null;\n}\n\n/**\n * Trigger in-place re-rendering of a component.\n * @param {import('./internal').Component} component The component to rerender\n */\nfunction renderComponent(component) {\n\tlet vnode = component._vnode,\n\t\toldDom = vnode._dom,\n\t\tparentDom = component._parentDom;\n\n\tif (parentDom) {\n\t\tlet commitQueue = [];\n\t\tconst oldVNode = assign({}, vnode);\n\t\toldVNode._original = oldVNode;\n\n\t\tlet newDom = diff(\n\t\t\tparentDom,\n\t\t\tvnode,\n\t\t\toldVNode,\n\t\t\tcomponent._globalContext,\n\t\t\tparentDom.ownerSVGElement !== undefined,\n\t\t\tnull,\n\t\t\tcommitQueue,\n\t\t\toldDom == null ? getDomSibling(vnode) : oldDom\n\t\t);\n\t\tcommitRoot(commitQueue, vnode);\n\n\t\tif (newDom != oldDom) {\n\t\t\tupdateParentDomPointers(vnode);\n\t\t}\n\t}\n}\n\n/**\n * @param {import('./internal').VNode} vnode\n */\nfunction updateParentDomPointers(vnode) {\n\tif ((vnode = vnode._parent) != null && vnode._component != null) {\n\t\tvnode._dom = vnode._component.base = null;\n\t\tfor (let i = 0; i < vnode._children.length; i++) {\n\t\t\tlet child = vnode._children[i];\n\t\t\tif (child != null && child._dom != null) {\n\t\t\t\tvnode._dom = vnode._component.base = child._dom;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn updateParentDomPointers(vnode);\n\t}\n}\n\n/**\n * The render queue\n * @type {Array<import('./internal').Component>}\n */\nlet rerenderQueue = [];\nlet rerenderCount = 0;\n\n/**\n * Asynchronously schedule a callback\n * @type {(cb: () => void) => void}\n */\n/* istanbul ignore next */\n// Note the following line isn't tree-shaken by rollup cuz of rollup/rollup#2566\nconst defer =\n\ttypeof Promise == 'function'\n\t\t? Promise.prototype.then.bind(Promise.resolve())\n\t\t: setTimeout;\n\n/*\n * The value of `Component.debounce` must asynchronously invoke the passed in callback. It is\n * important that contributors to Preact can consistently reason about what calls to `setState`, etc.\n * do, and when their effects will be applied. See the links below for some further reading on designing\n * asynchronous APIs.\n * * [Designing APIs for Asynchrony](https://blog.izs.me/2013/08/designing-apis-for-asynchrony)\n * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/)\n */\n\nlet prevDebounce;\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./internal').Component} c The component to rerender\n */\nexport function enqueueRender(c) {\n\tif (\n\t\t(!c._dirty &&\n\t\t\t(c._dirty = true) &&\n\t\t\trerenderQueue.push(c) &&\n\t\t\t!rerenderCount++) ||\n\t\tprevDebounce !== options.debounceRendering\n\t) {\n\t\tprevDebounce = options.debounceRendering;\n\t\t(prevDebounce || defer)(process);\n\t}\n}\n\n/** Flush the render queue by rerendering all queued components */\nfunction process() {\n\tlet queue;\n\twhile ((rerenderCount = rerenderQueue.length)) {\n\t\tqueue = rerenderQueue.sort((a, b) => a._vnode._depth - b._vnode._depth);\n\t\trerenderQueue = [];\n\t\t// Don't update `renderCount` yet. Keep its value non-zero to prevent unnecessary\n\t\t// process() calls from getting scheduled while `queue` is still being consumed.\n\t\tqueue.some(c => {\n\t\t\tif (c._dirty) renderComponent(c);\n\t\t});\n\t}\n}\n","import { EMPTY_OBJ, EMPTY_ARR } from './constants';\nimport { commitRoot, diff } from './diff/index';\nimport { createElement, Fragment } from './create-element';\nimport options from './options';\n\nconst IS_HYDRATE = EMPTY_OBJ;\n\n/**\n * Render a Preact virtual node into a DOM element\n * @param {import('./index').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * render into\n * @param {Element | Text} [replaceNode] Optional: Attempt to re-use an\n * existing DOM tree rooted at `replaceNode`\n */\nexport function render(vnode, parentDom, replaceNode) {\n\tif (options._root) options._root(vnode, parentDom);\n\n\t// We abuse the `replaceNode` parameter in `hydrate()` to signal if we\n\t// are in hydration mode or not by passing `IS_HYDRATE` instead of a\n\t// DOM element.\n\tlet isHydrating = replaceNode === IS_HYDRATE;\n\n\t// To be able to support calling `render()` multiple times on the same\n\t// DOM node, we need to obtain a reference to the previous tree. We do\n\t// this by assigning a new `_children` property to DOM nodes which points\n\t// to the last rendered tree. By default this property is not present, which\n\t// means that we are mounting a new tree for the first time.\n\tlet oldVNode = isHydrating\n\t\t? null\n\t\t: (replaceNode && replaceNode._children) || parentDom._children;\n\tvnode = createElement(Fragment, null, [vnode]);\n\n\t// List of effects that need to be called after diffing.\n\tlet commitQueue = [];\n\tdiff(\n\t\tparentDom,\n\t\t// Determine the new vnode tree and store it on the DOM element on\n\t\t// our custom `_children` property.\n\t\t((isHydrating ? parentDom : replaceNode || parentDom)._children = vnode),\n\t\toldVNode || EMPTY_OBJ,\n\t\tEMPTY_OBJ,\n\t\tparentDom.ownerSVGElement !== undefined,\n\t\treplaceNode && !isHydrating\n\t\t\t? [replaceNode]\n\t\t\t: oldVNode\n\t\t\t? null\n\t\t\t: EMPTY_ARR.slice.call(parentDom.childNodes),\n\t\tcommitQueue,\n\t\treplaceNode || EMPTY_OBJ,\n\t\tisHydrating\n\t);\n\n\t// Flush all queued effects\n\tcommitRoot(commitQueue, vnode);\n}\n\n/**\n * Update an existing DOM element with data from a Preact virtual node\n * @param {import('./index').ComponentChild} vnode The virtual node to render\n * @param {import('./internal').PreactElement} parentDom The DOM element to\n * update\n */\nexport function hydrate(vnode, parentDom) {\n\trender(vnode, parentDom, IS_HYDRATE);\n}\n","import { enqueueRender } from './component';\n\nexport let i = 0;\n\nexport function createContext(defaultValue) {\n\tconst ctx = {};\n\n\tconst context = {\n\t\t_id: '__cC' + i++,\n\t\t_defaultValue: defaultValue,\n\t\tConsumer(props, context) {\n\t\t\treturn props.children(context);\n\t\t},\n\t\tProvider(props) {\n\t\t\tif (!this.getChildContext) {\n\t\t\t\tconst subs = [];\n\t\t\t\tthis.getChildContext = () => {\n\t\t\t\t\tctx[context._id] = this;\n\t\t\t\t\treturn ctx;\n\t\t\t\t};\n\n\t\t\t\tthis.shouldComponentUpdate = _props => {\n\t\t\t\t\tif (this.props.value !== _props.value) {\n\t\t\t\t\t\tsubs.some(c => {\n\t\t\t\t\t\t\tc.context = _props.value;\n\t\t\t\t\t\t\tenqueueRender(c);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.sub = c => {\n\t\t\t\t\tsubs.push(c);\n\t\t\t\t\tlet old = c.componentWillUnmount;\n\t\t\t\t\tc.componentWillUnmount = () => {\n\t\t\t\t\t\tsubs.splice(subs.indexOf(c), 1);\n\t\t\t\t\t\told && old.call(c);\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn props.children;\n\t\t}\n\t};\n\n\tcontext.Consumer.contextType = context;\n\n\t// Devtools needs access to the context object when it\n\t// encounters a Provider. This is necessary to support\n\t// setting `displayName` on the context object instead\n\t// of on the component itself. See:\n\t// https://reactjs.org/docs/context.html#contextdisplayname\n\tcontext.Provider._contextRef = context;\n\n\treturn context;\n}\n","/**\n * Assign properties from `props` to `obj`\n * @template O, P The obj and props types\n * @param {O} obj The object to copy properties to\n * @param {P} props The object to copy properties from\n * @returns {O & P}\n */\nexport function assign(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn /** @type {O & P} */ (obj);\n}\n\n/**\n * Remove a child node from its parent if attached. This is a workaround for\n * IE11 which doesn't support `Element.prototype.remove()`. Using this function\n * is smaller than including a dedicated polyfill.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n\tlet parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n","import { diff, unmount, applyRef } from './index';\nimport { createVNode } from '../create-element';\nimport { EMPTY_OBJ, EMPTY_ARR } from '../constants';\nimport { removeNode } from '../util';\nimport { getDomSibling } from '../component';\n\n/**\n * Diff the children of a virtual node\n * @param {import('../internal').PreactElement} parentDom The DOM element whose\n * children are being diffed\n * @param {import('../internal').VNode} newParentVNode The new virtual\n * node whose children should be diff'ed against oldParentVNode\n * @param {import('../internal').VNode} oldParentVNode The old virtual\n * node whose children should be diff'ed against newParentVNode\n * @param {object} globalContext The current context object - modified by getChildContext\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {Array<import('../internal').PreactElement>} excessDomChildren\n * @param {Array<import('../internal').Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {Node | Text} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} isHydrating Whether or not we are in hydration\n */\nexport function diffChildren(\n\tparentDom,\n\tnewParentVNode,\n\toldParentVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet i, j, oldVNode, newDom, sibDom, firstChildDom, refs;\n\n\t// This is a compression of oldParentVNode!=null && oldParentVNode != EMPTY_OBJ && oldParentVNode._children || EMPTY_ARR\n\t// as EMPTY_OBJ._children should be `undefined`.\n\tlet oldChildren = (oldParentVNode && oldParentVNode._children) || EMPTY_ARR;\n\n\tlet oldChildrenLength = oldChildren.length;\n\n\t// Only in very specific places should this logic be invoked (top level `render` and `diffElementNodes`).\n\t// I'm using `EMPTY_OBJ` to signal when `diffChildren` is invoked in these situations. I can't use `null`\n\t// for this purpose, because `null` is a valid value for `oldDom` which can mean to skip to this logic\n\t// (e.g. if mounting a new tree in which the old DOM should be ignored (usually for Fragments).\n\tif (oldDom == EMPTY_OBJ) {\n\t\tif (excessDomChildren != null) {\n\t\t\toldDom = excessDomChildren[0];\n\t\t} else if (oldChildrenLength) {\n\t\t\toldDom = getDomSibling(oldParentVNode, 0);\n\t\t} else {\n\t\t\toldDom = null;\n\t\t}\n\t}\n\n\ti = 0;\n\tnewParentVNode._children = toChildArray(\n\t\tnewParentVNode._children,\n\t\tchildVNode => {\n\t\t\tif (childVNode != null) {\n\t\t\t\tchildVNode._parent = newParentVNode;\n\t\t\t\tchildVNode._depth = newParentVNode._depth + 1;\n\n\t\t\t\t// Check if we find a corresponding element in oldChildren.\n\t\t\t\t// If found, delete the array item by setting to `undefined`.\n\t\t\t\t// We use `undefined`, as `null` is reserved for empty placeholders\n\t\t\t\t// (holes).\n\t\t\t\toldVNode = oldChildren[i];\n\n\t\t\t\tif (\n\t\t\t\t\toldVNode === null ||\n\t\t\t\t\t(oldVNode &&\n\t\t\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\t\t\tchildVNode.type === oldVNode.type)\n\t\t\t\t) {\n\t\t\t\t\toldChildren[i] = undefined;\n\t\t\t\t} else {\n\t\t\t\t\t// Either oldVNode === undefined or oldChildrenLength > 0,\n\t\t\t\t\t// so after this loop oldVNode == null or oldVNode is a valid value.\n\t\t\t\t\tfor (j = 0; j < oldChildrenLength; j++) {\n\t\t\t\t\t\toldVNode = oldChildren[j];\n\t\t\t\t\t\t// If childVNode is unkeyed, we only match similarly unkeyed nodes, otherwise we match by key.\n\t\t\t\t\t\t// We always match by type (in either case).\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\toldVNode &&\n\t\t\t\t\t\t\tchildVNode.key == oldVNode.key &&\n\t\t\t\t\t\t\tchildVNode.type === oldVNode.type\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\toldChildren[j] = undefined;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\toldVNode = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\toldVNode = oldVNode || EMPTY_OBJ;\n\n\t\t\t\t// Morph the old element into the new one, but don't append it to the dom yet\n\t\t\t\tnewDom = diff(\n\t\t\t\t\tparentDom,\n\t\t\t\t\tchildVNode,\n\t\t\t\t\toldVNode,\n\t\t\t\t\tglobalContext,\n\t\t\t\t\tisSvg,\n\t\t\t\t\texcessDomChildren,\n\t\t\t\t\tcommitQueue,\n\t\t\t\t\toldDom,\n\t\t\t\t\tisHydrating\n\t\t\t\t);\n\n\t\t\t\tif ((j = childVNode.ref) && oldVNode.ref != j) {\n\t\t\t\t\tif (!refs) refs = [];\n\t\t\t\t\tif (oldVNode.ref) refs.push(oldVNode.ref, null, childVNode);\n\t\t\t\t\trefs.push(j, childVNode._component || newDom, childVNode);\n\t\t\t\t}\n\n\t\t\t\t// Only proceed if the vnode has not been unmounted by `diff()` above.\n\t\t\t\tif (newDom != null) {\n\t\t\t\t\tif (firstChildDom == null) {\n\t\t\t\t\t\tfirstChildDom = newDom;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet nextDom;\n\t\t\t\t\tif (childVNode._nextDom !== undefined) {\n\t\t\t\t\t\t// Only Fragments or components that return Fragment like VNodes will\n\t\t\t\t\t\t// have a non-undefined _nextDom. Continue the diff from the sibling\n\t\t\t\t\t\t// of last DOM child of this child VNode\n\t\t\t\t\t\tnextDom = childVNode._nextDom;\n\n\t\t\t\t\t\t// Eagerly cleanup _nextDom. We don't need to persist the value because\n\t\t\t\t\t\t// it is only used by `diffChildren` to determine where to resume the diff after\n\t\t\t\t\t\t// diffing Components and Fragments. Once we store it the nextDOM local var, we\n\t\t\t\t\t\t// can clean up the property\n\t\t\t\t\t\tchildVNode._nextDom = undefined;\n\t\t\t\t\t} else if (\n\t\t\t\t\t\texcessDomChildren == oldVNode ||\n\t\t\t\t\t\tnewDom != oldDom ||\n\t\t\t\t\t\tnewDom.parentNode == null\n\t\t\t\t\t) {\n\t\t\t\t\t\t// NOTE: excessDomChildren==oldVNode above:\n\t\t\t\t\t\t// This is a compression of excessDomChildren==null && oldVNode==null!\n\t\t\t\t\t\t// The values only have the same type when `null`.\n\n\t\t\t\t\t\touter: if (oldDom == null || oldDom.parentNode !== parentDom) {\n\t\t\t\t\t\t\tparentDom.appendChild(newDom);\n\t\t\t\t\t\t\tnextDom = null;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// `j<oldChildrenLength; j+=2` is an alternative to `j++<oldChildrenLength/2`\n\t\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\t\tsibDom = oldDom, j = 0;\n\t\t\t\t\t\t\t\t(sibDom = sibDom.nextSibling) && j < oldChildrenLength;\n\t\t\t\t\t\t\t\tj += 2\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tif (sibDom == newDom) {\n\t\t\t\t\t\t\t\t\tbreak outer;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tparentDom.insertBefore(newDom, oldDom);\n\t\t\t\t\t\t\tnextDom = oldDom;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Browsers will infer an option's `value` from `textContent` when\n\t\t\t\t\t\t// no value is present. This essentially bypasses our code to set it\n\t\t\t\t\t\t// later in `diff()`. It works fine in all browsers except for IE11\n\t\t\t\t\t\t// where it breaks setting `select.value`. There it will be always set\n\t\t\t\t\t\t// to an empty string. Re-applying an options value will fix that, so\n\t\t\t\t\t\t// there are probably some internal data structures that aren't\n\t\t\t\t\t\t// updated properly.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// To fix it we make sure to reset the inferred value, so that our own\n\t\t\t\t\t\t// value check in `diff()` won't be skipped.\n\t\t\t\t\t\tif (newParentVNode.type == 'option') {\n\t\t\t\t\t\t\tparentDom.value = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we have pre-calculated the nextDOM node, use it. Else calculate it now\n\t\t\t\t\t// Strictly check for `undefined` here cuz `null` is a valid value of `nextDom`.\n\t\t\t\t\t// See more detail in create-element.js:createVNode\n\t\t\t\t\tif (nextDom !== undefined) {\n\t\t\t\t\t\toldDom = nextDom;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toldDom = newDom.nextSibling;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof newParentVNode.type == 'function') {\n\t\t\t\t\t\t// Because the newParentVNode is Fragment-like, we need to set it's\n\t\t\t\t\t\t// _nextDom property to the nextSibling of its last child DOM node.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// `oldDom` contains the correct value here because if the last child\n\t\t\t\t\t\t// is a Fragment-like, then oldDom has already been set to that child's _nextDom.\n\t\t\t\t\t\t// If the last child is a DOM VNode, then oldDom will be set to that DOM\n\t\t\t\t\t\t// node's nextSibling.\n\n\t\t\t\t\t\tnewParentVNode._nextDom = oldDom;\n\t\t\t\t\t}\n\t\t\t\t} else if (\n\t\t\t\t\toldDom &&\n\t\t\t\t\toldVNode._dom == oldDom &&\n\t\t\t\t\toldDom.parentNode != parentDom\n\t\t\t\t) {\n\t\t\t\t\t// The above condition is to handle null placeholders. See test in placeholder.test.js:\n\t\t\t\t\t// `efficiently replace null placeholders in parent rerenders`\n\t\t\t\t\toldDom = getDomSibling(oldVNode);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti++;\n\t\t\treturn childVNode;\n\t\t}\n\t);\n\n\tnewParentVNode._dom = firstChildDom;\n\n\t// Remove children that are not part of any vnode.\n\tif (excessDomChildren != null && typeof newParentVNode.type != 'function') {\n\t\tfor (i = excessDomChildren.length; i--; ) {\n\t\t\tif (excessDomChildren[i] != null) removeNode(excessDomChildren[i]);\n\t\t}\n\t}\n\n\t// Remove remaining oldChildren if there are any.\n\tfor (i = oldChildrenLength; i--; ) {\n\t\tif (oldChildren[i] != null) unmount(oldChildren[i], oldChildren[i]);\n\t}\n\n\t// Set refs only after unmount\n\tif (refs) {\n\t\tfor (i = 0; i < refs.length; i++) {\n\t\t\tapplyRef(refs[i], refs[++i], refs[++i]);\n\t\t}\n\t}\n}\n\n/**\n * Flatten and loop through the children of a virtual node\n * @param {import('../index').ComponentChildren} children The unflattened\n * children of a virtual node\n * @param {(vnode: import('../internal').VNode) => import('../internal').VNode} [callback]\n * A function to invoke for each child before it is added to the flattened list.\n * @param {Array<import('../internal').VNode | string | number>} [flattened] An flat array of children to modify\n * @returns {import('../internal').VNode[]}\n */\nexport function toChildArray(children, callback, flattened) {\n\tif (flattened == null) flattened = [];\n\n\tif (children == null || typeof children == 'boolean') {\n\t\tif (callback) flattened.push(callback(null));\n\t} else if (Array.isArray(children)) {\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\ttoChildArray(children[i], callback, flattened);\n\t\t}\n\t} else if (!callback) {\n\t\tflattened.push(children);\n\t} else if (typeof children == 'string' || typeof children == 'number') {\n\t\tflattened.push(callback(createVNode(null, children, null, null, children)));\n\t} else if (children._dom != null || children._component != null) {\n\t\tflattened.push(\n\t\t\tcallback(\n\t\t\t\tcreateVNode(\n\t\t\t\t\tchildren.type,\n\t\t\t\t\tchildren.props,\n\t\t\t\t\tchildren.key,\n\t\t\t\t\tnull,\n\t\t\t\t\tchildren._original\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t} else {\n\t\tflattened.push(callback(children));\n\t}\n\n\treturn flattened;\n}\n","import { IS_NON_DIMENSIONAL } from '../constants';\nimport options from '../options';\n\n/**\n * Diff the old and new properties of a VNode and apply changes to the DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to apply\n * changes to\n * @param {object} newProps The new props\n * @param {object} oldProps The old props\n * @param {boolean} isSvg Whether or not this node is an SVG node\n * @param {boolean} hydrate Whether or not we are in hydration mode\n */\nexport function diffProps(dom, newProps, oldProps, isSvg, hydrate) {\n\tlet i;\n\n\tfor (i in oldProps) {\n\t\tif (i !== 'children' && i !== 'key' && !(i in newProps)) {\n\t\t\tsetProperty(dom, i, null, oldProps[i], isSvg);\n\t\t}\n\t}\n\n\tfor (i in newProps) {\n\t\tif (\n\t\t\t(!hydrate || typeof newProps[i] == 'function') &&\n\t\t\ti !== 'children' &&\n\t\t\ti !== 'key' &&\n\t\t\ti !== 'value' &&\n\t\t\ti !== 'checked' &&\n\t\t\toldProps[i] !== newProps[i]\n\t\t) {\n\t\t\tsetProperty(dom, i, newProps[i], oldProps[i], isSvg);\n\t\t}\n\t}\n}\n\nfunction setStyle(style, key, value) {\n\tif (key[0] === '-') {\n\t\tstyle.setProperty(key, value);\n\t} else if (\n\t\ttypeof value == 'number' &&\n\t\tIS_NON_DIMENSIONAL.test(key) === false\n\t) {\n\t\tstyle[key] = value + 'px';\n\t} else if (value == null) {\n\t\tstyle[key] = '';\n\t} else {\n\t\tstyle[key] = value;\n\t}\n}\n\n/**\n * Set a property value on a DOM node\n * @param {import('../internal').PreactElement} dom The DOM node to modify\n * @param {string} name The name of the property to set\n * @param {*} value The value to set the property to\n * @param {*} oldValue The old value the property had\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node or not\n */\nexport function setProperty(dom, name, value, oldValue, isSvg) {\n\tlet s, useCapture, nameLower;\n\n\tif (isSvg) {\n\t\tif (name === 'className') {\n\t\t\tname = 'class';\n\t\t}\n\t} else if (name === 'class') {\n\t\tname = 'className';\n\t}\n\n\tif (name === 'style') {\n\t\ts = dom.style;\n\n\t\tif (typeof value == 'string') {\n\t\t\ts.cssText = value;\n\t\t} else {\n\t\t\tif (typeof oldValue == 'string') {\n\t\t\t\ts.cssText = '';\n\t\t\t\toldValue = null;\n\t\t\t}\n\n\t\t\tif (oldValue) {\n\t\t\t\tfor (let i in oldValue) {\n\t\t\t\t\tif (!(value && i in value)) {\n\t\t\t\t\t\tsetStyle(s, i, '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (value) {\n\t\t\t\tfor (let i in value) {\n\t\t\t\t\tif (!oldValue || value[i] !== oldValue[i]) {\n\t\t\t\t\t\tsetStyle(s, i, value[i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6\n\telse if (name[0] === 'o' && name[1] === 'n') {\n\t\tuseCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tnameLower = name.toLowerCase();\n\t\tname = (nameLower in dom ? nameLower : name).slice(2);\n\n\t\tif (value) {\n\t\t\tif (!oldValue) dom.addEventListener(name, eventProxy, useCapture);\n\t\t\t(dom._listeners || (dom._listeners = {}))[name] = value;\n\t\t} else {\n\t\t\tdom.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t} else if (\n\t\tname !== 'list' &&\n\t\tname !== 'tagName' &&\n\t\t// HTMLButtonElement.form and HTMLInputElement.form are read-only but can be set using\n\t\t// setAttribute\n\t\tname !== 'form' &&\n\t\tname !== 'type' &&\n\t\tname !== 'size' &&\n\t\t!isSvg &&\n\t\tname in dom\n\t) {\n\t\tdom[name] = value == null ? '' : value;\n\t} else if (typeof value != 'function' && name !== 'dangerouslySetInnerHTML') {\n\t\tif (name !== (name = name.replace(/^xlink:?/, ''))) {\n\t\t\tif (value == null || value === false) {\n\t\t\t\tdom.removeAttributeNS(\n\t\t\t\t\t'http://www.w3.org/1999/xlink',\n\t\t\t\t\tname.toLowerCase()\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tdom.setAttributeNS(\n\t\t\t\t\t'http://www.w3.org/1999/xlink',\n\t\t\t\t\tname.toLowerCase(),\n\t\t\t\t\tvalue\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (\n\t\t\tvalue == null ||\n\t\t\t(value === false &&\n\t\t\t\t// ARIA-attributes have a different notion of boolean values.\n\t\t\t\t// The value `false` is different from the attribute not\n\t\t\t\t// existing on the DOM, so we can't remove it. For non-boolean\n\t\t\t\t// ARIA-attributes we could treat false as a removal, but the\n\t\t\t\t// amount of exceptions would cost us too many bytes. On top of\n\t\t\t\t// that other VDOM frameworks also always stringify `false`.\n\t\t\t\t!/^ar/.test(name))\n\t\t) {\n\t\t\tdom.removeAttribute(name);\n\t\t} else {\n\t\t\tdom.setAttribute(name, value);\n\t\t}\n\t}\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\tthis._listeners[e.type](options.event ? options.event(e) : e);\n}\n","import { EMPTY_OBJ, EMPTY_ARR } from '../constants';\nimport { Component } from '../component';\nimport { Fragment } from '../create-element';\nimport { diffChildren } from './children';\nimport { diffProps, setProperty } from './props';\nimport { assign, removeNode } from '../util';\nimport options from '../options';\n\n/**\n * Diff two virtual nodes and apply proper changes to the DOM\n * @param {import('../internal').PreactElement} parentDom The parent of the DOM element\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object. Modified by getChildContext\n * @param {boolean} isSvg Whether or not this element is an SVG node\n * @param {Array<import('../internal').PreactElement>} excessDomChildren\n * @param {Array<import('../internal').Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {Element | Text} oldDom The current attached DOM\n * element any new dom elements should be placed around. Likely `null` on first\n * render (except when hydrating). Can be a sibling DOM element when diffing\n * Fragments that have siblings. In most cases, it starts out as `oldChildren[0]._dom`.\n * @param {boolean} [isHydrating] Whether or not we are in hydration\n */\nexport function diff(\n\tparentDom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\toldDom,\n\tisHydrating\n) {\n\tlet tmp,\n\t\tnewType = newVNode.type;\n\n\t// When passing through createElement it assigns the object\n\t// constructor as undefined. This to prevent JSON-injection.\n\tif (newVNode.constructor !== undefined) return null;\n\n\tif ((tmp = options._diff)) tmp(newVNode);\n\n\ttry {\n\t\touter: if (typeof newType == 'function') {\n\t\t\tlet c, isNew, oldProps, oldState, snapshot, clearProcessingException;\n\t\t\tlet newProps = newVNode.props;\n\n\t\t\t// Necessary for createContext api. Setting this property will pass\n\t\t\t// the context value as `this.context` just for this component.\n\t\t\ttmp = newType.contextType;\n\t\t\tlet provider = tmp && globalContext[tmp._id];\n\t\t\tlet componentContext = tmp\n\t\t\t\t? provider\n\t\t\t\t\t? provider.props.value\n\t\t\t\t\t: tmp._defaultValue\n\t\t\t\t: globalContext;\n\n\t\t\t// Get component and set it to `c`\n\t\t\tif (oldVNode._component) {\n\t\t\t\tc = newVNode._component = oldVNode._component;\n\t\t\t\tclearProcessingException = c._processingException = c._pendingError;\n\t\t\t} else {\n\t\t\t\t// Instantiate the new component\n\t\t\t\tif ('prototype' in newType && newType.prototype.render) {\n\t\t\t\t\tnewVNode._component = c = new newType(newProps, componentContext); // eslint-disable-line new-cap\n\t\t\t\t} else {\n\t\t\t\t\tnewVNode._component = c = new Component(newProps, componentContext);\n\t\t\t\t\tc.constructor = newType;\n\t\t\t\t\tc.render = doRender;\n\t\t\t\t}\n\t\t\t\tif (provider) provider.sub(c);\n\n\t\t\t\tc.props = newProps;\n\t\t\t\tif (!c.state) c.state = {};\n\t\t\t\tc.context = componentContext;\n\t\t\t\tc._globalContext = globalContext;\n\t\t\t\tisNew = c._dirty = true;\n\t\t\t\tc._renderCallbacks = [];\n\t\t\t}\n\n\t\t\t// Invoke getDerivedStateFromProps\n\t\t\tif (c._nextState == null) {\n\t\t\t\tc._nextState = c.state;\n\t\t\t}\n\t\t\tif (newType.getDerivedStateFromProps != null) {\n\t\t\t\tif (c._nextState == c.state) {\n\t\t\t\t\tc._nextState = assign({}, c._nextState);\n\t\t\t\t}\n\n\t\t\t\tassign(\n\t\t\t\t\tc._nextState,\n\t\t\t\t\tnewType.getDerivedStateFromProps(newProps, c._nextState)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\toldProps = c.props;\n\t\t\toldState = c.state;\n\n\t\t\t// Invoke pre-render lifecycle methods\n\t\t\tif (isNew) {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tc.componentWillMount != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillMount();\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidMount != null) {\n\t\t\t\t\tc._renderCallbacks.push(c.componentDidMount);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tnewType.getDerivedStateFromProps == null &&\n\t\t\t\t\tnewProps !== oldProps &&\n\t\t\t\t\tc.componentWillReceiveProps != null\n\t\t\t\t) {\n\t\t\t\t\tc.componentWillReceiveProps(newProps, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\t(!c._force &&\n\t\t\t\t\t\tc.shouldComponentUpdate != null &&\n\t\t\t\t\t\tc.shouldComponentUpdate(\n\t\t\t\t\t\t\tnewProps,\n\t\t\t\t\t\t\tc._nextState,\n\t\t\t\t\t\t\tcomponentContext\n\t\t\t\t\t\t) === false) ||\n\t\t\t\t\t(newVNode._original === oldVNode._original && !c._processingException)\n\t\t\t\t) {\n\t\t\t\t\tc.props = newProps;\n\t\t\t\t\tc.state = c._nextState;\n\t\t\t\t\t// More info about this here: https://gist.github.com/JoviDeCroock/bec5f2ce93544d2e6070ef8e0036e4e8\n\t\t\t\t\tif (newVNode._original !== oldVNode._original) c._dirty = false;\n\t\t\t\t\tc._vnode = newVNode;\n\t\t\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t\t\t\tnewVNode._children = oldVNode._children;\n\t\t\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\t\t\tcommitQueue.push(c);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (tmp = 0; tmp < newVNode._children.length; tmp++) {\n\t\t\t\t\t\tif (newVNode._children[tmp]) {\n\t\t\t\t\t\t\tnewVNode._children[tmp]._parent = newVNode;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\n\t\t\t\tif (c.componentWillUpdate != null) {\n\t\t\t\t\tc.componentWillUpdate(newProps, c._nextState, componentContext);\n\t\t\t\t}\n\n\t\t\t\tif (c.componentDidUpdate != null) {\n\t\t\t\t\tc._renderCallbacks.push(() => {\n\t\t\t\t\t\tc.componentDidUpdate(oldProps, oldState, snapshot);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tc.context = componentContext;\n\t\t\tc.props = newProps;\n\t\t\tc.state = c._nextState;\n\n\t\t\tif ((tmp = options._render)) tmp(newVNode);\n\n\t\t\tc._dirty = false;\n\t\t\tc._vnode = newVNode;\n\t\t\tc._parentDom = parentDom;\n\n\t\t\ttmp = c.render(c.props, c.state, c.context);\n\t\t\tlet isTopLevelFragment =\n\t\t\t\ttmp != null && tmp.type == Fragment && tmp.key == null;\n\t\t\tnewVNode._children = isTopLevelFragment\n\t\t\t\t? tmp.props.children\n\t\t\t\t: Array.isArray(tmp)\n\t\t\t\t? tmp\n\t\t\t\t: [tmp];\n\n\t\t\tif (c.getChildContext != null) {\n\t\t\t\tglobalContext = assign(assign({}, globalContext), c.getChildContext());\n\t\t\t}\n\n\t\t\tif (!isNew && c.getSnapshotBeforeUpdate != null) {\n\t\t\t\tsnapshot = c.getSnapshotBeforeUpdate(oldProps, oldState);\n\t\t\t}\n\n\t\t\tdiffChildren(\n\t\t\t\tparentDom,\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\toldDom,\n\t\t\t\tisHydrating\n\t\t\t);\n\n\t\t\tc.base = newVNode._dom;\n\n\t\t\tif (c._renderCallbacks.length) {\n\t\t\t\tcommitQueue.push(c);\n\t\t\t}\n\n\t\t\tif (clearProcessingException) {\n\t\t\t\tc._pendingError = c._processingException = null;\n\t\t\t}\n\n\t\t\tc._force = false;\n\t\t} else if (\n\t\t\texcessDomChildren == null &&\n\t\t\tnewVNode._original === oldVNode._original\n\t\t) {\n\t\t\tnewVNode._children = oldVNode._children;\n\t\t\tnewVNode._dom = oldVNode._dom;\n\t\t} else {\n\t\t\tnewVNode._dom = diffElementNodes(\n\t\t\t\toldVNode._dom,\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tisSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\tif ((tmp = options.diffed)) tmp(newVNode);\n\t} catch (e) {\n\t\tnewVNode._original = null;\n\t\toptions._catchError(e, newVNode, oldVNode);\n\t}\n\n\treturn newVNode._dom;\n}\n\n/**\n * @param {Array<import('../internal').Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {import('../internal').VNode} root\n */\nexport function commitRoot(commitQueue, root) {\n\tif (options._commit) options._commit(root, commitQueue);\n\n\tcommitQueue.some(c => {\n\t\ttry {\n\t\t\tcommitQueue = c._renderCallbacks;\n\t\t\tc._renderCallbacks = [];\n\t\t\tcommitQueue.some(cb => {\n\t\t\t\tcb.call(c);\n\t\t\t});\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t});\n}\n\n/**\n * Diff two virtual nodes representing DOM element\n * @param {import('../internal').PreactElement} dom The DOM element representing\n * the virtual nodes being diffed\n * @param {import('../internal').VNode} newVNode The new virtual node\n * @param {import('../internal').VNode} oldVNode The old virtual node\n * @param {object} globalContext The current context object\n * @param {boolean} isSvg Whether or not this DOM node is an SVG node\n * @param {*} excessDomChildren\n * @param {Array<import('../internal').Component>} commitQueue List of components\n * which have callbacks to invoke in commitRoot\n * @param {boolean} isHydrating Whether or not we are in hydration\n * @returns {import('../internal').PreactElement}\n */\nfunction diffElementNodes(\n\tdom,\n\tnewVNode,\n\toldVNode,\n\tglobalContext,\n\tisSvg,\n\texcessDomChildren,\n\tcommitQueue,\n\tisHydrating\n) {\n\tlet i;\n\tlet oldProps = oldVNode.props;\n\tlet newProps = newVNode.props;\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvg = newVNode.type === 'svg' || isSvg;\n\n\tif (excessDomChildren != null) {\n\t\tfor (i = 0; i < excessDomChildren.length; i++) {\n\t\t\tconst child = excessDomChildren[i];\n\n\t\t\t// if newVNode matches an element in excessDomChildren or the `dom`\n\t\t\t// argument matches an element in excessDomChildren, remove it from\n\t\t\t// excessDomChildren so it isn't later removed in diffChildren\n\t\t\tif (\n\t\t\t\tchild != null &&\n\t\t\t\t((newVNode.type === null\n\t\t\t\t\t? child.nodeType === 3\n\t\t\t\t\t: child.localName === newVNode.type) ||\n\t\t\t\t\tdom == child)\n\t\t\t) {\n\t\t\t\tdom = child;\n\t\t\t\texcessDomChildren[i] = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (dom == null) {\n\t\tif (newVNode.type === null) {\n\t\t\treturn document.createTextNode(newProps);\n\t\t}\n\n\t\tdom = isSvg\n\t\t\t? document.createElementNS('http://www.w3.org/2000/svg', newVNode.type)\n\t\t\t: document.createElement(\n\t\t\t\t\tnewVNode.type,\n\t\t\t\t\tnewProps.is && { is: newProps.is }\n\t\t\t );\n\t\t// we created a new parent, so none of the previously attached children can be reused:\n\t\texcessDomChildren = null;\n\t\t// we are creating a new node, so we can assume this is a new subtree (in case we are hydrating), this deopts the hydrate\n\t\tisHydrating = false;\n\t}\n\n\tif (newVNode.type === null) {\n\t\tif (oldProps !== newProps && dom.data != newProps) {\n\t\t\tdom.data = newProps;\n\t\t}\n\t} else {\n\t\tif (excessDomChildren != null) {\n\t\t\texcessDomChildren = EMPTY_ARR.slice.call(dom.childNodes);\n\t\t}\n\n\t\toldProps = oldVNode.props || EMPTY_OBJ;\n\n\t\tlet oldHtml = oldProps.dangerouslySetInnerHTML;\n\t\tlet newHtml = newProps.dangerouslySetInnerHTML;\n\n\t\t// During hydration, props are not diffed at all (including dangerouslySetInnerHTML)\n\t\t// @TODO we should warn in debug mode when props don't match here.\n\t\tif (!isHydrating) {\n\t\t\tif (oldProps === EMPTY_OBJ) {\n\t\t\t\toldProps = {};\n\t\t\t\tfor (let i = 0; i < dom.attributes.length; i++) {\n\t\t\t\t\toldProps[dom.attributes[i].name] = dom.attributes[i].value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (newHtml || oldHtml) {\n\t\t\t\t// Avoid re-applying the same '__html' if it did not changed between re-render\n\t\t\t\tif (!newHtml || !oldHtml || newHtml.__html != oldHtml.__html) {\n\t\t\t\t\tdom.innerHTML = (newHtml && newHtml.__html) || '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdiffProps(dom, newProps, oldProps, isSvg, isHydrating);\n\n\t\t// If the new vnode didn't have dangerouslySetInnerHTML, diff its children\n\t\tif (newHtml) {\n\t\t\tnewVNode._children = [];\n\t\t} else {\n\t\t\tnewVNode._children = newVNode.props.children;\n\t\t\tdiffChildren(\n\t\t\t\tdom,\n\t\t\t\tnewVNode,\n\t\t\t\toldVNode,\n\t\t\t\tglobalContext,\n\t\t\t\tnewVNode.type === 'foreignObject' ? false : isSvg,\n\t\t\t\texcessDomChildren,\n\t\t\t\tcommitQueue,\n\t\t\t\tEMPTY_OBJ,\n\t\t\t\tisHydrating\n\t\t\t);\n\t\t}\n\n\t\t// (as above, don't diff props during hydration)\n\t\tif (!isHydrating) {\n\t\t\tif (\n\t\t\t\t'value' in newProps &&\n\t\t\t\t(i = newProps.value) !== undefined &&\n\t\t\t\ti !== dom.value\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'value', i, oldProps.value, false);\n\t\t\t}\n\t\t\tif (\n\t\t\t\t'checked' in newProps &&\n\t\t\t\t(i = newProps.checked) !== undefined &&\n\t\t\t\ti !== dom.checked\n\t\t\t) {\n\t\t\t\tsetProperty(dom, 'checked', i, oldProps.checked, false);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n/**\n * Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} ref\n * @param {any} value\n * @param {import('../internal').VNode} vnode\n */\nexport function applyRef(ref, value, vnode) {\n\ttry {\n\t\tif (typeof ref == 'function') ref(value);\n\t\telse ref.current = value;\n\t} catch (e) {\n\t\toptions._catchError(e, vnode);\n\t}\n}\n\n/**\n * Unmount a virtual node from the tree and apply DOM changes\n * @param {import('../internal').VNode} vnode The virtual node to unmount\n * @param {import('../internal').VNode} parentVNode The parent of the VNode that\n * initiated the unmount\n * @param {boolean} [skipRemove] Flag that indicates that a parent node of the\n * current element is already detached from the DOM.\n */\nexport function unmount(vnode, parentVNode, skipRemove) {\n\tlet r;\n\tif (options.unmount) options.unmount(vnode);\n\n\tif ((r = vnode.ref)) {\n\t\tif (!r.current || r.current === vnode._dom) applyRef(r, null, parentVNode);\n\t}\n\n\tlet dom;\n\tif (!skipRemove && typeof vnode.type != 'function') {\n\t\tskipRemove = (dom = vnode._dom) != null;\n\t}\n\n\t// Must be set to `undefined` to properly clean up `_nextDom`\n\t// for which `null` is a valid value. See comment in `create-element.js`\n\tvnode._dom = vnode._nextDom = undefined;\n\n\tif ((r = vnode._component) != null) {\n\t\tif (r.componentWillUnmount) {\n\t\t\ttry {\n\t\t\t\tr.componentWillUnmount();\n\t\t\t} catch (e) {\n\t\t\t\toptions._catchError(e, parentVNode);\n\t\t\t}\n\t\t}\n\n\t\tr.base = r._parentDom = null;\n\t}\n\n\tif ((r = vnode._children)) {\n\t\tfor (let i = 0; i < r.length; i++) {\n\t\t\tif (r[i]) unmount(r[i], parentVNode, skipRemove);\n\t\t}\n\t}\n\n\tif (dom != null) removeNode(dom);\n}\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { assign } from './util';\nimport { EMPTY_ARR } from './constants';\nimport { createVNode } from './create-element';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {import('./internal').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./index').ComponentChildren>} rest Any additional arguments will be used as replacement children.\n * @returns {import('./internal').VNode}\n */\nexport function cloneElement(vnode, props) {\n\tprops = assign(assign({}, vnode.props), props);\n\tif (arguments.length > 2) props.children = EMPTY_ARR.slice.call(arguments, 2);\n\tlet normalizedProps = {};\n\tfor (const i in props) {\n\t\tif (i !== 'key' && i !== 'ref') normalizedProps[i] = props[i];\n\t}\n\n\treturn createVNode(\n\t\tvnode.type,\n\t\tnormalizedProps,\n\t\tprops.key || vnode.key,\n\t\tprops.ref || vnode.ref,\n\t\tnull\n\t);\n}\n","import { enqueueRender } from '../component';\n\n/**\n * Find the closest error boundary to a thrown error and call it\n * @param {object} error The thrown value\n * @param {import('../internal').VNode} vnode The vnode that threw\n * the error that was caught (except for unmounting when this parameter\n * is the highest parent that was being unmounted)\n */\nexport function _catchError(error, vnode) {\n\t/** @type {import('../internal').Component} */\n\tlet component, hasCaught;\n\n\tfor (; (vnode = vnode._parent); ) {\n\t\tif ((component = vnode._component) && !component._processingException) {\n\t\t\ttry {\n\t\t\t\tif (\n\t\t\t\t\tcomponent.constructor &&\n\t\t\t\t\tcomponent.constructor.getDerivedStateFromError != null\n\t\t\t\t) {\n\t\t\t\t\thasCaught = true;\n\t\t\t\t\tcomponent.setState(\n\t\t\t\t\t\tcomponent.constructor.getDerivedStateFromError(error)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (component.componentDidCatch != null) {\n\t\t\t\t\thasCaught = true;\n\t\t\t\t\tcomponent.componentDidCatch(error);\n\t\t\t\t}\n\n\t\t\t\tif (hasCaught)\n\t\t\t\t\treturn enqueueRender((component._pendingError = component));\n\t\t\t} catch (e) {\n\t\t\t\terror = e;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow error;\n}\n","export function lastOf<T>(ts: T[]): T | null {\n return ts[ts.length - 1] || null\n}\n\nexport function sortBy<T>(ts: T[], key: (t: T) => number | string): void {\n function comparator(a: T, b: T) {\n const keyA = key(a)\n const keyB = key(b)\n return keyA < keyB ? -1 : keyA > keyB ? 1 : 0\n }\n ts.sort(comparator)\n}\n\nexport function getOrInsert<K, V>(map: Map<K, V>, k: K, fallback: (k: K) => V): V {\n if (!map.has(k)) map.set(k, fallback(k))\n return map.get(k)!\n}\n\nexport function getOrElse<K, V>(map: Map<K, V>, k: K, fallback: (k: K) => V): V {\n if (!map.has(k)) return fallback(k)\n return map.get(k)!\n}\n\nexport function getOrThrow<K, V>(map: Map<K, V>, k: K): V {\n if (!map.has(k)) {\n throw new Error(`Expected key ${k}`)\n }\n return map.get(k)!\n}\n\n// Intended to be used to de-duplicate objects based on a key property. This\n// allows value comparisons to be done efficiently and for the returned objects\n// to be used intuitively in Map objects.\n//\n// Example usage:\n//\n// export class Frame {\n// private constructor(readonly file: string, readonly name: string) {}\n// get key() { return `${this.file}:${this.name}` }\n// static getOrInsert(set: KeyedSet<Frame>, file: string, name: string) {\n// return set.getOrInsert(set, new Frame(file, name))\n// }\n// }\n//\nexport interface HasKey {\n readonly key: string | number\n}\nexport class KeyedSet<T extends HasKey> implements Iterable<T> {\n private map = new Map<string | number, T>()\n\n getOrInsert(t: T): T {\n const key = t.key\n const existing = this.map.get(key)\n if (existing) return existing\n this.map.set(key, t)\n return t\n }\n forEach(fn: (t: T) => void) {\n this.map.forEach(fn)\n }\n [Symbol.iterator]() {\n return this.map.values()\n }\n}\n\nexport function* itMap<T, U>(it: Iterable<T>, f: (t: T) => U): Iterable<U> {\n for (let t of it) {\n yield f(t)\n }\n}\n\nexport function itForEach<T>(it: Iterable<T>, f: (t: T) => void): void {\n for (let t of it) {\n f(t)\n }\n}\n\nexport function itReduce<T, U>(it: Iterable<T>, f: (a: U, b: T) => U, init: U): U {\n let accum: U = init\n for (let t of it) {\n accum = f(accum, t)\n }\n return accum\n}\n\nexport function zeroPad(s: string, width: number) {\n return new Array(Math.max(width - s.length, 0) + 1).join('0') + s\n}\n\nexport function formatPercent(percent: number) {\n let formattedPercent = `${percent.toFixed(0)}%`\n if (percent === 100) formattedPercent = '100%'\n else if (percent > 99) formattedPercent = '>99%'\n else if (percent < 0.01) formattedPercent = '<0.01%'\n else if (percent < 1) formattedPercent = `${percent.toFixed(2)}%`\n else if (percent < 10) formattedPercent = `${percent.toFixed(1)}%`\n return formattedPercent\n}\n\nexport function fract(x: number) {\n return x - Math.floor(x)\n}\n\nexport function triangle(x: number) {\n return 2.0 * Math.abs(fract(x) - 0.5) - 1.0\n}\n\nexport function findValueBisect(\n lo: number,\n hi: number,\n f: (val: number) => number,\n target: number,\n targetRangeSize = 1,\n): [number, number] {\n console.assert(!isNaN(targetRangeSize) && !isNaN(target))\n while (true) {\n if (hi - lo <= targetRangeSize) return [lo, hi]\n const mid = (hi + lo) / 2\n const val = f(mid)\n if (val < target) lo = mid\n else hi = mid\n }\n}\n\n// Similar to Array.prototype.findIndex, except uses a binary search.\n//\n// This assumes that the condition transitions exactly once from false to true\n// in the list, e.g. the following is a valid input:\n//\n// ls = [a, b, c, d]\n// ls.map(f) = [false, false, true, true]\n//\n// The following is an invalid input:\n//\n// ls = [a, b, c, d]\n// ls.map(f) = [false, true, false, true]\nexport function findIndexBisect<T>(ls: T[], f: (val: T) => boolean): number {\n if (ls.length === 0) return -1\n\n let lo = 0\n let hi = ls.length - 1\n\n while (hi !== lo) {\n const mid = Math.floor((lo + hi) / 2)\n\n if (f(ls[mid])) {\n // The desired index is <= mid\n hi = mid\n } else {\n // The desired index is > mid\n lo = mid + 1\n }\n }\n\n return f(ls[hi]) ? hi : -1\n}\n\nexport function noop(...args: any[]) {}\n\nexport function objectsHaveShallowEquality<T extends object>(a: T, b: T): boolean {\n for (let key in a) {\n if (a[key] !== b[key]) return false\n }\n for (let key in b) {\n if (a[key] !== b[key]) return false\n }\n return true\n}\n\nexport function memoizeByShallowEquality<T extends object, U>(cb: (t: T) => U): (t: T) => U {\n let last: {args: T; result: U} | null = null\n return (args: T) => {\n let result: U\n if (last == null) {\n result = cb(args)\n last = {args, result}\n return result\n } else if (objectsHaveShallowEquality(last.args, args)) {\n return last.result\n } else {\n last.args = args\n last.result = cb(args)\n return last.result\n }\n }\n}\n\nexport function memoizeByReference<T, U>(cb: (t: T) => U): (t: T) => U {\n let last: {args: T; result: U} | null = null\n return (args: T) => {\n let result: U\n if (last == null) {\n result = cb(args)\n last = {args, result}\n return result\n } else if (last.args === args) {\n return last.result\n } else {\n last.args = args\n last.result = cb(args)\n return last.result\n }\n }\n}\n\nexport function lazyStatic<T>(cb: () => T): () => T {\n let last: {result: T} | null = null\n return () => {\n if (last == null) {\n last = {result: cb()}\n }\n return last.result\n }\n}\n\nconst base64lookupTable = lazyStatic(\n (): Map<string, number> => {\n const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n const ret = new Map<string, number>()\n for (let i = 0; i < alphabet.length; i++) {\n ret.set(alphabet.charAt(i), i)\n }\n ret.set('=', -1)\n return ret\n },\n)\n\n// NOTE: There are probably simpler solutions to this problem, but I have this written already, so\n// until we run into problems with this, let's just use this.\n//\n// See: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem#The_Unicode_Problem\nexport function decodeBase64(encoded: string): Uint8Array {\n // Reference: https://www.rfc-editor.org/rfc/rfc4648.txt\n\n const lookupTable = base64lookupTable()\n\n // 3 byte groups are represented as sequneces of 4 characters.\n //\n // \"The encoding process represents 24-bit groups of input bits as output\n // strings of 4 encoded characters.\"\n //\n // \"Special processing is performed if fewer than 24 bits are available\n // at the end of the data being encoded. A full encoding quantum is\n // always completed at the end of a quantity. When fewer than 24 input\n // bits are available in an input group bits with value zero are added\n // (on the right) to form an integral number of 6-bit groups.\"\n\n if (encoded.length % 4 !== 0) {\n throw new Error(\n `Invalid length for base64 encoded string. Expected length % 4 = 0, got length = ${encoded.length}`,\n )\n }\n\n const quartetCount = encoded.length / 4\n let byteCount: number\n\n // Special processing is performed if fewer than 24 bits are available\n // at the end of the data being encoded. A full encoding quantum is\n // always completed at the end of a quantity. When fewer than 24 input\n // bits are available in an input group, bits with value zero are added\n // (on the right) to form an integral number of 6-bit groups. Padding\n // at the end of the data is performed using the '=' character. Since\n // all base 64 input is an integral number of octets, only the following\n // cases can arise:\n //\n // (1) The final quantum of encoding input is an integral multiple of 24\n // bits; here, the final unit of encoded output will be an integral\n // multiple of 4 characters with no \"=\" padding.\n //\n // (2) The final quantum of encoding input is exactly 8 bits; here, the\n // final unit of encoded output will be two characters followed by\n // two \"=\" padding characters.\n //\n // (3) The final quantum of encoding input is exactly 16 bits; here, the\n // final unit of encoded output will be three characters followed by\n // one \"=\" padding character.\n if (encoded.length >= 4) {\n if (encoded.charAt(encoded.length - 1) === '=') {\n if (encoded.charAt(encoded.length - 2) === '=') {\n // Case (2)\n byteCount = quartetCount * 3 - 2\n } else {\n // Case (3)\n byteCount = quartetCount * 3 - 1\n }\n } else {\n // Case (1)\n byteCount = quartetCount * 3\n }\n } else {\n // Case (1)\n byteCount = quartetCount * 3\n }\n\n const bytes = new Uint8Array(byteCount)\n let offset = 0\n\n for (let i = 0; i < quartetCount; i++) {\n const enc1 = encoded.charAt(i * 4 + 0)\n const enc2 = encoded.charAt(i * 4 + 1)\n const enc3 = encoded.charAt(i * 4 + 2)\n const enc4 = encoded.charAt(i * 4 + 3)\n\n const sextet1 = lookupTable.get(enc1)\n const sextet2 = lookupTable.get(enc2)\n const sextet3 = lookupTable.get(enc3)\n const sextet4 = lookupTable.get(enc4)\n\n if (sextet1 == null || sextet2 == null || sextet3 == null || sextet4 == null) {\n throw new Error(\n `Invalid quartet at indices ${i * 4} .. ${i * 4 + 3}: ${encoded.substring(\n i * 4,\n i * 4 + 3,\n )}`,\n )\n }\n\n bytes[offset++] = (sextet1 << 2) | (sextet2 >> 4)\n if (enc3 !== '=') {\n bytes[offset++] = ((sextet2 & 15) << 4) | (sextet3 >> 2)\n }\n if (enc4 !== '=') {\n bytes[offset++] = ((sextet3 & 7) << 6) | sextet4\n }\n }\n\n if (offset !== byteCount) {\n throw new Error(`Expected to decode ${byteCount} bytes, but only decoded ${offset})`)\n }\n\n return bytes\n}\n","class ListNode<V> {\n prev: ListNode<V> | null = null\n next: ListNode<V> | null = null\n constructor(readonly data: V) {}\n}\n\nexport class List<V> {\n private head: ListNode<V> | null = null\n private tail: ListNode<V> | null = null\n private size: number = 0\n constructor() {}\n\n getHead(): ListNode<V> | null {\n return this.head\n }\n getTail(): ListNode<V> | null {\n return this.tail\n }\n getSize(): number {\n return this.size\n }\n\n append(node: ListNode<V>): void {\n if (!this.tail) {\n this.head = this.tail = node\n } else {\n this.tail.next = node\n node.prev = this.tail\n this.tail = node\n }\n this.size++\n }\n\n prepend(node: ListNode<V>): ListNode<V> {\n if (!this.head) {\n this.head = this.tail = node\n } else {\n this.head.prev = node\n node.next = this.head\n this.head = node\n }\n this.size++\n return node\n }\n\n pop(): ListNode<V> | null {\n if (!this.tail) {\n return null\n } else {\n const ret = this.tail\n if (ret.prev) {\n this.tail = ret.prev\n this.tail.next = null\n } else {\n this.head = this.tail = null\n }\n this.size--\n ret.prev = null\n return ret\n }\n }\n\n dequeue(): ListNode<V> | null {\n if (!this.head) {\n return null\n } else {\n const ret = this.head\n if (ret.next) {\n this.head = ret.next\n this.head.prev = null\n } else {\n this.head = this.tail = null\n }\n this.size--\n ret.next = null\n return ret\n }\n }\n\n remove(node: ListNode<V>): void {\n if (node.prev == null) {\n this.dequeue()\n } else if (node.next == null) {\n this.pop()\n } else {\n // Neither first nor last, should be safe to just link\n // neighbours.\n node.next.prev = node.prev\n node.prev.next = node.next\n node.next = null\n node.prev = null\n this.size--\n }\n }\n}\n\ninterface LRUCacheNode<K, V> {\n value: V\n listNode: ListNode<K>\n}\n\nexport class LRUCache<K, V> {\n private list = new List<K>()\n private map = new Map<K, LRUCacheNode<K, V>>()\n\n constructor(private capacity: number) {}\n\n has(key: K): boolean {\n return this.map.has(key)\n }\n\n get(key: K): V | null {\n const node = this.map.get(key)\n if (!node) {\n return null\n }\n // Bring node to the front of the list\n this.list.remove(node.listNode)\n this.list.prepend(node.listNode)\n\n return node ? node.value : null\n }\n\n getSize() {\n return this.list.getSize()\n }\n\n getCapacity() {\n return this.capacity\n }\n\n insert(key: K, value: V) {\n const node = this.map.get(key)\n if (node) {\n this.list.remove(node.listNode)\n }\n // Evict old entries when out of capacity\n while (this.list.getSize() >= this.capacity) {\n this.map.delete(this.list.pop()!.data)\n }\n const listNode = this.list.prepend(new ListNode(key))\n this.map.set(key, {value, listNode})\n }\n\n getOrInsert(key: K, f: (key: K) => V): V {\n let value = this.get(key)\n if (value == null) {\n value = f(key)\n this.insert(key, value)\n }\n return value\n }\n\n removeLRU(): [K, V] | null {\n const oldest = this.list.pop()\n if (!oldest) return null\n const key = oldest.data\n const value = this.map.get(key)!.value\n this.map.delete(key)\n return [key, value]\n }\n\n clear() {\n this.list = new List<K>()\n this.map = new Map<K, LRUCacheNode<K, V>>()\n }\n}\n","export function clamp(x: number, minVal: number, maxVal: number) {\n if (x < minVal) return minVal\n if (x > maxVal) return maxVal\n return x\n}\n\nexport class Vec2 {\n constructor(readonly x: number, readonly y: number) {}\n withX(x: number) {\n return new Vec2(x, this.y)\n }\n withY(y: number) {\n return new Vec2(this.x, y)\n }\n\n plus(other: Vec2) {\n return new Vec2(this.x + other.x, this.y + other.y)\n }\n minus(other: Vec2) {\n return new Vec2(this.x - other.x, this.y - other.y)\n }\n times(scalar: number) {\n return new Vec2(this.x * scalar, this.y * scalar)\n }\n timesPointwise(other: Vec2) {\n return new Vec2(this.x * other.x, this.y * other.y)\n }\n dividedByPointwise(other: Vec2) {\n return new Vec2(this.x / other.x, this.y / other.y)\n }\n dot(other: Vec2) {\n return this.x * other.x + this.y * other.y\n }\n equals(other: Vec2) {\n return this.x === other.x && this.y === other.y\n }\n approxEquals(other: Vec2, epsilon = 1e-9) {\n return Math.abs(this.x - other.x) < epsilon && Math.abs(this.y - other.y) < epsilon\n }\n\n length2() {\n return this.dot(this)\n }\n length() {\n return Math.sqrt(this.length2())\n }\n abs() {\n return new Vec2(Math.abs(this.x), Math.abs(this.y))\n }\n\n static min(a: Vec2, b: Vec2) {\n return new Vec2(Math.min(a.x, b.x), Math.min(a.y, b.y))\n }\n\n static max(a: Vec2, b: Vec2) {\n return new Vec2(Math.max(a.x, b.x), Math.max(a.y, b.y))\n }\n\n static clamp(v: Vec2, min: Vec2, max: Vec2) {\n return new Vec2(clamp(v.x, min.x, max.x), clamp(v.y, min.y, max.y))\n }\n\n static zero = new Vec2(0, 0)\n static unit = new Vec2(1, 1)\n\n flatten(): [number, number] {\n return [this.x, this.y]\n }\n}\n\nexport class AffineTransform {\n constructor(\n readonly m00 = 1,\n readonly m01 = 0,\n readonly m02 = 0,\n readonly m10 = 0,\n readonly m11 = 1,\n readonly m12 = 0,\n ) {}\n\n withScale(s: Vec2) {\n let {m00, m01, m02, m10, m11, m12} = this\n m00 = s.x\n m11 = s.y\n return new AffineTransform(m00, m01, m02, m10, m11, m12)\n }\n static withScale(s: Vec2) {\n return new AffineTransform().withScale(s)\n }\n scaledBy(s: Vec2) {\n return AffineTransform.withScale(s).times(this)\n }\n getScale() {\n return new Vec2(this.m00, this.m11)\n }\n\n withTranslation(t: Vec2) {\n let {m00, m01, m02, m10, m11, m12} = this\n m02 = t.x\n m12 = t.y\n return new AffineTransform(m00, m01, m02, m10, m11, m12)\n }\n static withTranslation(t: Vec2) {\n return new AffineTransform().withTranslation(t)\n }\n getTranslation() {\n return new Vec2(this.m02, this.m12)\n }\n translatedBy(t: Vec2) {\n return AffineTransform.withTranslation(t).times(this)\n }\n\n static betweenRects(from: Rect, to: Rect) {\n return AffineTransform.withTranslation(from.origin.times(-1))\n .scaledBy(new Vec2(to.size.x / from.size.x, to.size.y / from.size.y))\n .translatedBy(to.origin)\n }\n\n times(other: AffineTransform) {\n const m00 = this.m00 * other.m00 + this.m01 * other.m10\n const m01 = this.m00 * other.m01 + this.m01 * other.m11\n const m02 = this.m00 * other.m02 + this.m01 * other.m12 + this.m02\n\n const m10 = this.m10 * other.m00 + this.m11 * other.m10\n const m11 = this.m10 * other.m01 + this.m11 * other.m11\n const m12 = this.m10 * other.m02 + this.m11 * other.m12 + this.m12\n return new AffineTransform(m00, m01, m02, m10, m11, m12)\n }\n\n equals(other: AffineTransform) {\n return (\n this.m00 == other.m00 &&\n this.m01 == other.m01 &&\n this.m02 == other.m02 &&\n this.m10 == other.m10 &&\n this.m11 == other.m11 &&\n this.m12 == other.m12\n )\n }\n\n approxEquals(other: AffineTransform, epsilon = 1e-9) {\n return (\n Math.abs(this.m00 - other.m00) < epsilon &&\n Math.abs(this.m01 - other.m01) < epsilon &&\n Math.abs(this.m02 - other.m02) < epsilon &&\n Math.abs(this.m10 - other.m10) < epsilon &&\n Math.abs(this.m11 - other.m11) < epsilon &&\n Math.abs(this.m12 - other.m12) < epsilon\n )\n }\n\n timesScalar(s: number) {\n const {m00, m01, m02, m10, m11, m12} = this\n return new AffineTransform(s * m00, s * m01, s * m02, s * m10, s * m11, s * m12)\n }\n\n det() {\n const {m00, m01, m02, m10, m11, m12} = this\n const m20 = 0\n const m21 = 0\n const m22 = 1\n\n return (\n m00 * (m11 * m22 - m12 * m21) - m01 * (m10 * m22 - m12 * m20) + m02 * (m10 * m21 - m11 * m20)\n )\n }\n\n adj() {\n const {m00, m01, m02, m10, m11, m12} = this\n const m20 = 0\n const m21 = 0\n const m22 = 1\n\n // Adjugate matrix (a) is the transpose of the\n // cofactor matrix (c).\n //\n // 00 01 02\n // 10 11 12\n // 20 21 22\n\n const a00 = /* c00 = */ +(m11 * m22 - m12 * m21)\n const a01 = /* c10 = */ -(m01 * m22 - m02 * m21)\n const a02 = /* c20 = */ +(m01 * m12 - m02 * m11)\n const a10 = /* c01 = */ -(m10 * m22 - m12 * m20)\n const a11 = /* c11 = */ +(m00 * m22 - m02 * m20)\n const a12 = /* c21 = */ -(m00 * m12 - m02 * m10)\n\n return new AffineTransform(a00, a01, a02, a10, a11, a12)\n }\n\n inverted(): AffineTransform | null {\n const det = this.det()\n if (det === 0) return null\n const adj = this.adj()\n return adj.timesScalar(1 / det)\n }\n\n transformVector(v: Vec2) {\n return new Vec2(v.x * this.m00 + v.y * this.m01, v.x * this.m10 + v.y * this.m11)\n }\n\n inverseTransformVector(v: Vec2): Vec2 | null {\n const inv = this.inverted()\n if (!inv) return null\n return inv.transformVector(v)\n }\n\n transformPosition(v: Vec2) {\n return new Vec2(\n v.x * this.m00 + v.y * this.m01 + this.m02,\n v.x * this.m10 + v.y * this.m11 + this.m12,\n )\n }\n\n inverseTransformPosition(v: Vec2): Vec2 | null {\n const inv = this.inverted()\n if (!inv) return null\n return inv.transformPosition(v)\n }\n\n transformRect(r: Rect) {\n const size = this.transformVector(r.size)\n const origin = this.transformPosition(r.origin)\n\n if (size.x < 0 && size.y < 0) {\n return new Rect(origin.plus(size), size.abs())\n } else if (size.x < 0) {\n return new Rect(origin.withX(origin.x + size.x), size.abs())\n } else if (size.y < 0) {\n return new Rect(origin.withY(origin.y + size.y), size.abs())\n }\n\n return new Rect(origin, size)\n }\n\n inverseTransformRect(r: Rect): Rect | null {\n const inv = this.inverted()\n if (!inv) return null\n return inv.transformRect(r)\n }\n\n flatten(): [number, number, number, number, number, number, number, number, number] {\n // Flatten into GLSL format\n // prettier-ignore\n return [\n this.m00, this.m10, 0,\n this.m01, this.m11, 0,\n this.m02, this.m12, 1,\n ]\n }\n}\n\nexport class Rect {\n constructor(readonly origin: Vec2, readonly size: Vec2) {}\n\n isEmpty() {\n return this.width() == 0 || this.height() == 0\n }\n\n width() {\n return this.size.x\n }\n height() {\n return this.size.y\n }\n\n left() {\n return this.origin.x\n }\n right() {\n return this.left() + this.width()\n }\n top() {\n return this.origin.y\n }\n bottom() {\n return this.top() + this.height()\n }\n\n topLeft() {\n return this.origin\n }\n topRight() {\n return this.origin.plus(new Vec2(this.width(), 0))\n }\n\n bottomRight() {\n return this.origin.plus(this.size)\n }\n bottomLeft() {\n return this.origin.plus(new Vec2(0, this.height()))\n }\n\n withOrigin(origin: Vec2) {\n return new Rect(origin, this.size)\n }\n withSize(size: Vec2) {\n return new Rect(this.origin, size)\n }\n\n closestPointTo(p: Vec2) {\n return new Vec2(clamp(p.x, this.left(), this.right()), clamp(p.y, this.top(), this.bottom()))\n }\n\n distanceFrom(p: Vec2) {\n return p.minus(this.closestPointTo(p)).length()\n }\n\n contains(p: Vec2) {\n return this.distanceFrom(p) === 0\n }\n\n hasIntersectionWith(other: Rect) {\n const top = Math.max(this.top(), other.top())\n const bottom = Math.max(top, Math.min(this.bottom(), other.bottom()))\n if (bottom - top === 0) return false\n\n const left = Math.max(this.left(), other.left())\n const right = Math.max(left, Math.min(this.right(), other.right()))\n if (right - left === 0) return false\n return true\n }\n\n intersectWith(other: Rect): Rect {\n const topLeft = Vec2.max(this.topLeft(), other.topLeft())\n const bottomRight = Vec2.max(topLeft, Vec2.min(this.bottomRight(), other.bottomRight()))\n\n return new Rect(topLeft, bottomRight.minus(topLeft))\n }\n\n equals(other: Rect) {\n return this.origin.equals(other.origin) && this.size.equals(other.size)\n }\n\n approxEquals(other: Rect) {\n return this.origin.approxEquals(other.origin) && this.size.approxEquals(other.size)\n }\n\n area() {\n return this.size.x * this.size.y\n }\n\n static empty = new Rect(Vec2.zero, Vec2.zero)\n static unit = new Rect(Vec2.zero, Vec2.unit)\n static NDC = new Rect(new Vec2(-1, -1), new Vec2(2, 2))\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","// This is a port of the GPU APIs from https://github.com/evanw/sky from Skew to\n// TypeScript.\n//\n// The MIT License (MIT)\n// Original work Copyright (c) 2016 Evan Wallace\n// Modified work Copyright (c) 2018 Jamie Wong\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n// NOTE: This file intentionally has no dependencies.\n\n// Dependencies & polyfills for import from skew\nconst RELEASE =\n typeof process !== 'undefined' && process.env && process.env.NODE_ENV === 'production'\n\nfunction assert(condition: boolean) {\n if (!RELEASE) {\n if (!condition) throw new Error('Assertion failed.')\n }\n}\n\nfunction appendOne<T>(ts: T[], t: T): void {\n if (ts.indexOf(t) === -1) ts.push(t)\n}\n\nfunction removeOne<T>(ts: T[], t: T): void {\n const index = ts.indexOf(t)\n if (index !== -1) ts.splice(index, 1)\n}\n\nfunction TEXTURE_N(gl: WebGLRenderingContext, index: number) {\n assert(index >= 0 && index <= 31)\n return (gl.TEXTURE0 + index) as GLenum\n}\n\nexport namespace Graphics {\n export class Rect {\n constructor(\n public x: number = 0,\n public y: number = 0,\n public width: number = 0,\n public height: number = 0,\n ) {}\n\n set(x: number, y: number, width: number, height: number) {\n this.x = x\n this.y = y\n this.width = width\n this.height = height\n }\n\n equals(other: Rect) {\n return (\n this.x === other.x &&\n this.y === other.y &&\n this.width === other.width &&\n this.height === other.height\n )\n }\n }\n\n export class Color {\n constructor(\n public redF: number,\n public greenF: number,\n public blueF: number,\n public alphaF: number,\n ) {}\n\n equals(other: Color): boolean {\n return (\n this.redF === other.redF &&\n this.greenF === other.greenF &&\n this.blueF === other.blueF &&\n this.alphaF === other.alphaF\n )\n }\n\n static TRANSPARENT = new Color(0, 0, 0, 0)\n }\n\n // Converted from https://github.com/evanw/sky/blob/c72de77/src/graphics/context.sk\n export enum BlendOperation {\n ZERO = 0,\n ONE = 1,\n\n SOURCE_COLOR = 2,\n TARGET_COLOR = 3,\n INVERSE_SOURCE_COLOR = 4,\n INVERSE_TARGET_COLOR = 5,\n\n SOURCE_ALPHA = 6,\n TARGET_ALPHA = 7,\n INVERSE_SOURCE_ALPHA = 8,\n INVERSE_TARGET_ALPHA = 9,\n\n CONSTANT = 10,\n INVERSE_CONSTANT = 11,\n }\n\n export enum Primitive {\n TRIANGLES,\n TRIANGLE_STRIP,\n }\n\n export abstract class Context {\n abstract addContextResetHandler(callback: () => void): void\n abstract beginFrame(): void\n abstract clear(color: Color): void\n\n abstract createMaterial(\n format: VertexFormat,\n vertexSource: string,\n fragmentSource: string,\n ): Material\n abstract createTexture(\n format: TextureFormat,\n width: number,\n height: number,\n pixels?: Uint8Array,\n ): Texture\n abstract createRenderTarget(texture: Texture): RenderTarget\n abstract createVertexBuffer(byteCount: number): VertexBuffer\n abstract currentRenderTarget: RenderTarget | null\n abstract draw(primitive: Primitive, material: Material, vertices: VertexBuffer): void\n abstract endFrame(): void\n abstract removeContextResetHandler(callback: () => void): void\n abstract resize(\n widthInPixels: number,\n heightInPixels: number,\n widthInAppUnits: number,\n heightInAppUnits: number,\n ): void\n abstract setRenderTarget(renderTarget: RenderTarget | null): void\n abstract setViewport(x: number, y: number, width: number, height: number): void\n abstract viewport: Rect\n abstract widthInPixels: number\n abstract heightInPixels: number\n\n abstract renderTargetHeightInPixels: number\n abstract renderTargetWidthInPixels: number\n\n abstract setBlendState(source: BlendOperation, target: BlendOperation): void\n setCopyBlendState() {\n this.setBlendState(BlendOperation.ONE, BlendOperation.ZERO)\n }\n setAddBlendState() {\n this.setBlendState(BlendOperation.ONE, BlendOperation.ONE)\n }\n setPremultipliedBlendState() {\n this.setBlendState(BlendOperation.ONE, BlendOperation.INVERSE_SOURCE_ALPHA)\n }\n setUnpremultipliedBlendState() {\n this.setBlendState(BlendOperation.SOURCE_ALPHA, BlendOperation.INVERSE_SOURCE_ALPHA)\n }\n\n protected resizeEventHandlers = new Set<() => void>()\n addAfterResizeEventHandler(callback: () => void): void {\n this.resizeEventHandlers.add(callback)\n }\n removeAfterResizeEventHandler(callback: () => void): void {\n this.resizeEventHandlers.delete(callback)\n }\n }\n\n export interface Material {\n context: Context\n format: VertexFormat\n fragmentSource: string\n vertexSource: string\n setUniformFloat(name: string, x: number): void\n setUniformInt(name: string, x: number): void\n setUniformVec2(name: string, x: number, y: number): void\n setUniformVec3(name: string, x: number, y: number, z: number): void\n setUniformVec4(name: string, x: number, y: number, z: number, w: number): void\n setUniformMat3(\n name: string,\n m00: number,\n m01: number,\n m02: number,\n m10: number,\n m11: number,\n m12: number,\n m20: number,\n m21: number,\n m22: number,\n ): void\n setUniformSampler(name: string, texture: Texture, index: number): void\n }\n\n export enum AttributeType {\n FLOAT,\n BYTE,\n }\n\n export function attributeByteLength(type: AttributeType) {\n return type == AttributeType.FLOAT ? 4 : 1\n }\n\n export class Attribute {\n constructor(\n readonly name: string,\n readonly type: AttributeType,\n readonly count: number,\n readonly byteOffset: number,\n ) {}\n }\n\n export class VertexFormat {\n private _attributes: Attribute[] = []\n private _stride = 0\n\n get attributes() {\n return this._attributes\n }\n get stride() {\n return this._stride\n }\n\n add(name: string, type: AttributeType, count: number): VertexFormat {\n this.attributes.push(new Attribute(name, type, count, this.stride))\n this._stride += count * attributeByteLength(type)\n return this\n }\n }\n\n export abstract class VertexBuffer {\n abstract byteCount: number\n abstract context: Context\n abstract move(sourceByteOffset: number, targetByteOffset: number, byteCount: number): void\n abstract upload(bytes: Uint8Array, byteOffset?: number): void\n uploadFloat32Array(floats: Float32Array) {\n this.upload(new Uint8Array(floats.buffer), 0)\n }\n uploadFloats(floats: number[]) {\n this.uploadFloat32Array(new Float32Array(floats))\n }\n abstract free(): void\n }\n\n export enum PixelFilter {\n NEAREST,\n LINEAR,\n }\n\n export enum PixelWrap {\n REPEAT,\n CLAMP,\n }\n\n export class TextureFormat {\n constructor(\n readonly minFilter: PixelFilter,\n readonly magFilter: PixelFilter,\n readonly wrap: PixelWrap,\n ) {}\n\n static LINEAR_CLAMP = new TextureFormat(PixelFilter.LINEAR, PixelFilter.LINEAR, PixelWrap.CLAMP)\n static LINEAR_MIN_NEAREST_MAG_CLAMP = new TextureFormat(\n PixelFilter.LINEAR,\n PixelFilter.NEAREST,\n PixelWrap.CLAMP,\n )\n static NEAREST_CLAMP = new TextureFormat(\n PixelFilter.NEAREST,\n PixelFilter.NEAREST,\n PixelWrap.CLAMP,\n )\n }\n\n export interface Texture {\n context: Context\n format: TextureFormat\n width: number\n height: number\n resize(width: number, height: number, pixels?: Uint8Array): void\n setFormat(format: TextureFormat): void\n free(): void\n }\n\n export interface RenderTarget {\n context: Context\n texture: Texture\n setColor(texture: Texture): void\n free(): void\n }\n}\n\n// Converted from https://github.com/evanw/sky/blob/c72de77/src/browser/context.sk\nexport namespace WebGL {\n export class Context extends Graphics.Context {\n private _attributeCount = 0\n private _blendOperationMap: {[key: number]: GLenum}\n private _blendOperations = 0\n private _contextResetHandlers: (() => void)[] = []\n private _currentClearColor = Graphics.Color.TRANSPARENT\n private _currentRenderTarget: RenderTarget | null = null\n private _defaultViewport = new Graphics.Rect()\n private _forceStateUpdate = true\n private _generation = 1\n private _gl: WebGLRenderingContext\n private _height = 0\n private _oldBlendOperations = 0\n private _oldRenderTarget: RenderTarget | null = null\n private _oldViewport = new Graphics.Rect()\n private _width = 0\n\n get widthInPixels() {\n return this._width\n }\n get heightInPixels() {\n return this._height\n }\n\n constructor(canvas: HTMLCanvasElement = document.createElement('canvas')) {\n super()\n let gl = canvas.getContext('webgl', {\n alpha: false,\n antialias: false,\n depth: false,\n preserveDrawingBuffer: false,\n stencil: false,\n })\n\n if (gl == null) {\n throw new Error('Setup failure')\n }\n\n this._gl = gl\n let style = canvas.style\n canvas.width = 0\n canvas.height = 0\n style.width = style.height = '0'\n\n canvas.addEventListener('webglcontextlost', (e: Event) => {\n e.preventDefault()\n })\n\n canvas.addEventListener('webglcontextrestored', this.handleWebglContextRestored)\n\n // Using maps makes these compact in release\n this._blendOperationMap = {\n [Graphics.BlendOperation.ZERO]: this._gl.ZERO,\n [Graphics.BlendOperation.ONE]: this._gl.ONE,\n\n [Graphics.BlendOperation.SOURCE_COLOR]: this._gl.SRC_COLOR,\n [Graphics.BlendOperation.TARGET_COLOR]: this._gl.DST_COLOR,\n [Graphics.BlendOperation.INVERSE_SOURCE_COLOR]: this._gl.ONE_MINUS_SRC_COLOR,\n [Graphics.BlendOperation.INVERSE_TARGET_COLOR]: this._gl.ONE_MINUS_DST_COLOR,\n\n [Graphics.BlendOperation.SOURCE_ALPHA]: this._gl.SRC_ALPHA,\n [Graphics.BlendOperation.TARGET_ALPHA]: this._gl.DST_ALPHA,\n [Graphics.BlendOperation.INVERSE_SOURCE_ALPHA]: this._gl.ONE_MINUS_SRC_ALPHA,\n [Graphics.BlendOperation.INVERSE_TARGET_ALPHA]: this._gl.ONE_MINUS_DST_ALPHA,\n\n [Graphics.BlendOperation.CONSTANT]: this._gl.CONSTANT_COLOR,\n [Graphics.BlendOperation.INVERSE_CONSTANT]: this._gl.ONE_MINUS_CONSTANT_COLOR,\n }\n }\n\n private handleWebglContextRestored = () => {\n this._attributeCount = 0\n this._currentClearColor = Graphics.Color.TRANSPARENT\n this._forceStateUpdate = true\n this._generation++\n for (let handler of this._contextResetHandlers) {\n handler()\n }\n }\n\n public testContextLoss() {\n this.handleWebglContextRestored()\n }\n\n get gl() {\n return this._gl\n }\n get generation() {\n return this._generation\n }\n addContextResetHandler(callback: () => void) {\n appendOne(this._contextResetHandlers, callback)\n }\n removeContextResetHandler(callback: () => void) {\n removeOne(this._contextResetHandlers, callback)\n }\n\n get currentRenderTarget() {\n return this._currentRenderTarget\n }\n\n beginFrame() {\n this.setRenderTarget(null)\n }\n\n endFrame() {}\n\n setBlendState(source: Graphics.BlendOperation, target: Graphics.BlendOperation) {\n this._blendOperations = Context._packBlendModes(source, target)\n }\n\n setViewport(x: number, y: number, width: number, height: number) {\n ;(this._currentRenderTarget != null\n ? this._currentRenderTarget.viewport\n : this._defaultViewport\n ).set(x, y, width, height)\n }\n\n get viewport() {\n return this._currentRenderTarget != null\n ? this._currentRenderTarget.viewport\n : this._defaultViewport\n }\n\n get renderTargetWidthInPixels() {\n return this._currentRenderTarget != null\n ? this._currentRenderTarget.viewport.width\n : this._width\n }\n\n get renderTargetHeightInPixels() {\n return this._currentRenderTarget != null\n ? this._currentRenderTarget.viewport.height\n : this._height\n }\n\n draw(\n primitive: Graphics.Primitive,\n material: Graphics.Material,\n vertices: Graphics.VertexBuffer,\n ) {\n // Update the texture set before preparing the material so uniform samplers can check for that they use different textures\n this._updateRenderTargetAndViewport()\n Material.from(material).prepare()\n\n // Update the vertex buffer before updating the format so attributes can bind correctly\n VertexBuffer.from(vertices).prepare()\n this._updateFormat(material.format)\n\n // Draw now that everything is ready\n this._updateBlendState()\n\n this._gl.drawArrays(\n primitive == Graphics.Primitive.TRIANGLES ? this._gl.TRIANGLES : this._gl.TRIANGLE_STRIP,\n 0,\n Math.floor(vertices.byteCount / material.format.stride),\n )\n\n // Forced state updates are done once after a context loss\n this._forceStateUpdate = false\n }\n\n resize(\n widthInPixels: number,\n heightInPixels: number,\n widthInAppUnits: number,\n heightInAppUnits: number,\n ) {\n let canvas = this._gl.canvas as HTMLCanvasElement\n const bounds = canvas.getBoundingClientRect()\n\n if (\n this._width === widthInPixels &&\n this._height === heightInPixels &&\n bounds.width === widthInAppUnits &&\n bounds.height === heightInAppUnits\n ) {\n // Nothing to do here!\n return\n }\n\n let style = canvas.style\n canvas.width = widthInPixels\n canvas.height = heightInPixels\n style.width = `${widthInAppUnits}px`\n style.height = `${heightInAppUnits}px`\n this.setViewport(0, 0, widthInPixels, heightInPixels)\n this._width = widthInPixels\n this._height = heightInPixels\n\n this.resizeEventHandlers.forEach(cb => cb())\n }\n\n clear(color: Graphics.Color) {\n this._updateRenderTargetAndViewport()\n this._updateBlendState()\n\n if (!color.equals(this._currentClearColor)) {\n this._gl.clearColor(color.redF, color.greenF, color.blueF, color.alphaF)\n this._currentClearColor = color\n }\n\n this._gl.clear(this._gl.COLOR_BUFFER_BIT)\n }\n\n setRenderTarget(renderTarget: Graphics.RenderTarget | null) {\n this._currentRenderTarget = RenderTarget.from(renderTarget)\n }\n\n createMaterial(\n format: Graphics.VertexFormat,\n vertexSource: string,\n fragmentSource: string,\n ): Graphics.Material {\n let material = new Material(this, format, vertexSource, fragmentSource)\n\n // Compiling shaders is really expensive so we want to get that started\n // as early as possible. In Chrome and possibly other browsers, shader\n // compilation can happen asynchronously as long as you don't call\n // useProgram().\n //\n // https://plus.google.com/+BrandonJonesToji/posts/4ERHkicC5Ny\n //\n material.program\n\n return material\n }\n\n createVertexBuffer(byteCount: number): Graphics.VertexBuffer {\n assert(byteCount > 0 && byteCount % 4 == 0)\n return new VertexBuffer(this, byteCount)\n }\n\n createTexture(\n format: Graphics.TextureFormat,\n width: number,\n height: number,\n pixels?: Uint8Array,\n ): Graphics.Texture {\n return new Texture(this, format, width, height, pixels)\n }\n\n createRenderTarget(texture: Graphics.Texture): Graphics.RenderTarget {\n return new RenderTarget(this, Texture.from(texture))\n }\n\n private ANGLE_instanced_arrays: ANGLE_instanced_arrays | null = null\n private ANGLE_instanced_arrays_generation: number = -1\n getANGLE_instanced_arrays(): ANGLE_instanced_arrays {\n if (this.ANGLE_instanced_arrays_generation !== this._generation) {\n this.ANGLE_instanced_arrays = null\n }\n if (!this.ANGLE_instanced_arrays) {\n this.ANGLE_instanced_arrays = this.gl.getExtension('ANGLE_instanced_arrays')\n if (!this.ANGLE_instanced_arrays) {\n throw new Error('Failed to get extension ANGLE_instanced_arrays')\n }\n }\n return this.ANGLE_instanced_arrays!\n }\n\n _updateRenderTargetAndViewport() {\n let renderTarget = this._currentRenderTarget\n let viewport = renderTarget != null ? renderTarget.viewport : this._defaultViewport\n let gl = this._gl\n\n if (this._forceStateUpdate || this._oldRenderTarget != renderTarget) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, renderTarget ? renderTarget.framebuffer : null)\n this._oldRenderTarget = renderTarget\n }\n\n if (this._forceStateUpdate || !this._oldViewport.equals(viewport)) {\n gl.viewport(\n viewport.x,\n this.renderTargetHeightInPixels - viewport.y - viewport.height,\n viewport.width,\n viewport.height,\n )\n this._oldViewport.set(viewport.x, viewport.y, viewport.width, viewport.height)\n }\n }\n\n _updateBlendState() {\n if (this._forceStateUpdate || this._oldBlendOperations != this._blendOperations) {\n let gl = this._gl\n let operations = this._blendOperations\n let oldOperations = this._oldBlendOperations\n let source = (operations & 0xf) as Graphics.BlendOperation\n let target = (operations >> 4) as Graphics.BlendOperation\n\n assert(source in this._blendOperationMap)\n assert(target in this._blendOperationMap)\n\n // Special-case the blend mode that just writes over the target buffer\n if (operations == Context.COPY_BLEND_OPERATIONS) {\n gl.disable(gl.BLEND)\n } else {\n if (this._forceStateUpdate || oldOperations == Context.COPY_BLEND_OPERATIONS) {\n gl.enable(gl.BLEND)\n }\n\n // Otherwise, use actual blending\n gl.blendFunc(this._blendOperationMap[source], this._blendOperationMap[target])\n }\n\n this._oldBlendOperations = operations\n }\n }\n\n _updateFormat(format: Graphics.VertexFormat) {\n // Update the attributes\n let gl = this._gl\n let attributes = format.attributes\n let count = attributes.length\n for (let i = 0; i < count; i++) {\n let attribute = attributes[i]\n let isByte = attribute.type == Graphics.AttributeType.BYTE\n gl.vertexAttribPointer(\n i,\n attribute.count,\n isByte ? gl.UNSIGNED_BYTE : gl.FLOAT,\n isByte,\n format.stride,\n attribute.byteOffset,\n )\n }\n\n // Update the attribute count\n while (this._attributeCount < count) {\n gl.enableVertexAttribArray(this._attributeCount)\n this._attributeCount++\n }\n while (this._attributeCount > count) {\n this._attributeCount--\n gl.disableVertexAttribArray(this._attributeCount)\n }\n this._attributeCount = count\n }\n\n getWebGLInfo(): {renderer: string | null; vendor: string | null; version: string | null} {\n const ext = this.gl.getExtension('WEBGL_debug_renderer_info')\n const renderer = ext ? this.gl.getParameter(ext.UNMASKED_RENDERER_WEBGL) : null\n const vendor = ext ? this.gl.getParameter(ext.UNMASKED_VENDOR_WEBGL) : null\n const version = this.gl.getParameter(this.gl.VERSION)\n return {renderer, vendor, version}\n }\n\n static from(context: Graphics.Context): Context {\n assert(context == null || context instanceof Context)\n return context as Context\n }\n\n static _packBlendModes(\n source: Graphics.BlendOperation,\n target: Graphics.BlendOperation,\n ): number {\n return source | (target << 4)\n }\n\n static COPY_BLEND_OPERATIONS = Context._packBlendModes(\n Graphics.BlendOperation.ONE,\n Graphics.BlendOperation.ZERO,\n )\n }\n\n abstract class Uniform {\n constructor(\n protected readonly _material: Material,\n protected readonly _name: string,\n protected _generation = 0,\n protected _location: WebGLUniformLocation | null = null,\n protected _isDirty = true,\n ) {}\n\n // Upload this uniform if it's dirty\n abstract prepare(): void\n\n get location(): WebGLUniformLocation {\n let context = Context.from(this._material.context)\n if (this._generation != context.generation) {\n this._location = context.gl.getUniformLocation(this._material.program, this._name)\n this._generation = context.generation\n\n // Validate the shader against this uniform\n if (!RELEASE) {\n let program = this._material.program\n let gl = context.gl\n for (let i = 0, ii = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); i < ii; i++) {\n let info = gl.getActiveUniform(program, i)\n if (info && info.name == this._name) {\n assert(info.size == 1)\n switch (info.type) {\n case gl.FLOAT: {\n assert(this instanceof UniformFloat)\n break\n }\n case gl.FLOAT_MAT3: {\n assert(this instanceof UniformMat3)\n break\n }\n case gl.FLOAT_VEC2: {\n assert(this instanceof UniformVec2)\n break\n }\n case gl.FLOAT_VEC3: {\n assert(this instanceof UniformVec3)\n break\n }\n case gl.FLOAT_VEC4: {\n assert(this instanceof UniformVec4)\n break\n }\n case gl.INT: {\n assert(this instanceof UniformInt)\n break\n }\n case gl.SAMPLER_2D: {\n assert(this instanceof UniformSampler)\n break\n }\n default:\n assert(false)\n }\n }\n }\n }\n }\n if (!this._location) {\n throw new Error('Failed to get uniform location')\n }\n return this._location\n }\n }\n\n class UniformFloat extends Uniform {\n private _x = 0.0\n\n set(x: number) {\n if (x != this._x) {\n this._x = x\n this._isDirty = true\n }\n }\n\n prepare() {\n let context = Context.from(this._material.context)\n if (this._generation != context.generation || this._isDirty) {\n context.gl.uniform1f(this.location, this._x)\n this._isDirty = false\n }\n }\n }\n\n class UniformInt extends Uniform {\n private _x = 0\n\n set(x: number) {\n if (x != this._x) {\n this._x = x\n this._isDirty = true\n }\n }\n\n prepare() {\n let context = Context.from(this._material.context)\n if (this._generation != context.generation || this._isDirty) {\n context.gl.uniform1i(this.location, this._x)\n this._isDirty = false\n }\n }\n }\n\n class UniformVec2 extends Uniform {\n private _x = 0.0\n private _y = 0.0\n\n set(x: number, y: number) {\n if (x != this._x || y != this._y) {\n this._x = x\n this._y = y\n this._isDirty = true\n }\n }\n\n prepare() {\n let context = Context.from(this._material.context)\n if (this._generation != context.generation || this._isDirty) {\n context.gl.uniform2f(this.location, this._x, this._y)\n this._isDirty = false\n }\n }\n }\n\n class UniformVec3 extends Uniform {\n private _x = 0.0\n private _y = 0.0\n private _z = 0.0\n\n set(x: number, y: number, z: number) {\n if (x != this._x || y != this._y || z != this._z) {\n this._x = x\n this._y = y\n this._z = z\n this._isDirty = true\n }\n }\n\n prepare() {\n let context = Context.from(this._material.context)\n if (this._generation != context.generation || this._isDirty) {\n context.gl.uniform3f(this.location, this._x, this._y, this._z)\n this._isDirty = false\n }\n }\n }\n\n class UniformVec4 extends Uniform {\n private _x = 0.0\n private _y = 0.0\n private _z = 0.0\n private _w = 0.0\n\n set(x: number, y: number, z: number, w: number) {\n if (x != this._x || y != this._y || z != this._z || w != this._w) {\n this._x = x\n this._y = y\n this._z = z\n this._w = w\n this._isDirty = true\n }\n }\n\n prepare() {\n let context = Context.from(this._material.context)\n if (this._generation != context.generation || this._isDirty) {\n context.gl.uniform4f(this.location, this._x, this._y, this._z, this._w)\n this._isDirty = false\n }\n }\n }\n\n class UniformMat3 extends Uniform {\n private _values = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]\n\n set(\n m00: number,\n m01: number,\n m02: number,\n m10: number,\n m11: number,\n m12: number,\n m20: number,\n m21: number,\n m22: number,\n ) {\n // These values are deliberately transposed because WebGL requires the \"transpose\" argument of uniformMatrix() to be false\n UniformMat3._cachedValues[0] = m00\n UniformMat3._cachedValues[1] = m10\n UniformMat3._cachedValues[2] = m20\n UniformMat3._cachedValues[3] = m01\n UniformMat3._cachedValues[4] = m11\n UniformMat3._cachedValues[5] = m21\n UniformMat3._cachedValues[6] = m02\n UniformMat3._cachedValues[7] = m12\n UniformMat3._cachedValues[8] = m22\n\n for (let i = 0; i < 9; i++) {\n if (UniformMat3._cachedValues[i] != this._values[i]) {\n let swap = this._values\n this._values = UniformMat3._cachedValues\n UniformMat3._cachedValues = swap\n this._isDirty = true\n break\n }\n }\n }\n\n prepare() {\n let context = Context.from(this._material.context)\n if (this._generation != context.generation || this._isDirty) {\n context.gl.uniformMatrix3fv(this.location, false, this._values)\n this._isDirty = false\n }\n }\n\n // Statically allocate this to avoid allocations\n static _cachedValues = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]\n }\n\n class UniformSampler extends Uniform {\n private _texture: Texture | null = null\n private _index = -1\n\n set(texture: Graphics.Texture, index: number) {\n if (this._texture != texture || this._index != index) {\n this._texture = Texture.from(texture)\n this._index = index\n this._isDirty = true\n }\n }\n\n prepare() {\n let context = Context.from(this._material.context)\n let gl = context.gl\n assert(\n this._texture == null ||\n context.currentRenderTarget == null ||\n this._texture != context.currentRenderTarget.texture,\n )\n if (this._generation != context.generation || this._isDirty) {\n gl.uniform1i(this.location, this._index)\n this._isDirty = false\n }\n gl.activeTexture(TEXTURE_N(gl, this._index))\n gl.bindTexture(\n gl.TEXTURE_2D,\n this._texture != null && this._texture.width > 0 && this._texture.height > 0\n ? this._texture.texture\n : null,\n )\n }\n }\n\n class Material implements Graphics.Material {\n constructor(\n private readonly _context: Context,\n private readonly _format: Graphics.VertexFormat,\n private readonly _vertexSource: string,\n private readonly _fragmentSource: string,\n private readonly _uniformsMap: {[key: string]: Uniform} = {},\n private readonly _uniformsList: Uniform[] = [],\n private _generation = 0,\n private _program: WebGLProgram | null = null,\n ) {}\n\n get context() {\n return this._context\n }\n get format() {\n return this._format\n }\n get vertexSource() {\n return this._vertexSource\n }\n get fragmentSource() {\n return this._fragmentSource\n }\n\n setUniformFloat(name: string, x: number) {\n let uniform = this._uniformsMap[name] || null\n if (uniform == null) {\n uniform = new UniformFloat(this, name)\n this._uniformsMap[name] = uniform\n this._uniformsList.push(uniform)\n }\n assert(uniform instanceof UniformFloat)\n ;(uniform as UniformFloat).set(x)\n }\n\n setUniformInt(name: string, x: number) {\n let uniform = this._uniformsMap[name] || null\n if (uniform == null) {\n uniform = new UniformInt(this, name)\n this._uniformsMap[name] = uniform\n this._uniformsList.push(uniform)\n }\n assert(uniform instanceof UniformInt)\n ;(uniform as UniformInt).set(x)\n }\n\n setUniformVec2(name: string, x: number, y: number) {\n let uniform = this._uniformsMap[name] || null\n if (uniform == null) {\n uniform = new UniformVec2(this, name)\n this._uniformsMap[name] = uniform\n this._uniformsList.push(uniform)\n }\n assert(uniform instanceof UniformVec2)\n ;(uniform as UniformVec2).set(x, y)\n }\n\n setUniformVec3(name: string, x: number, y: number, z: number) {\n let uniform = this._uniformsMap[name] || null\n if (uniform == null) {\n uniform = new UniformVec3(this, name)\n this._uniformsMap[name] = uniform\n this._uniformsList.push(uniform)\n }\n assert(uniform instanceof UniformVec3)\n ;(uniform as UniformVec3).set(x, y, z)\n }\n\n setUniformVec4(name: string, x: number, y: number, z: number, w: number) {\n let uniform = this._uniformsMap[name] || null\n if (uniform == null) {\n uniform = new UniformVec4(this, name)\n this._uniformsMap[name] = uniform\n this._uniformsList.push(uniform)\n }\n assert(uniform instanceof UniformVec4)\n ;(uniform as UniformVec4).set(x, y, z, w)\n }\n\n setUniformMat3(\n name: string,\n m00: number,\n m01: number,\n m02: number,\n m10: number,\n m11: number,\n m12: number,\n m20: number,\n m21: number,\n m22: number,\n ) {\n let uniform = this._uniformsMap[name] || null\n if (uniform == null) {\n uniform = new UniformMat3(this, name)\n this._uniformsMap[name] = uniform\n this._uniformsList.push(uniform)\n }\n assert(uniform instanceof UniformMat3)\n ;(uniform as UniformMat3).set(m00, m01, m02, m10, m11, m12, m20, m21, m22)\n }\n\n setUniformSampler(name: string, texture: Graphics.Texture, index: number) {\n let uniform = this._uniformsMap[name] || null\n if (uniform == null) {\n uniform = new UniformSampler(this, name)\n this._uniformsMap[name] = uniform\n this._uniformsList.push(uniform)\n }\n assert(uniform instanceof UniformSampler)\n ;(uniform as UniformSampler).set(texture, index)\n }\n\n get program(): WebGLProgram {\n let gl = this._context.gl\n if (this._generation != this._context.generation) {\n this._program = gl.createProgram()!\n this._compileShader(gl, gl.VERTEX_SHADER, this.vertexSource)\n this._compileShader(gl, gl.FRAGMENT_SHADER, this.fragmentSource)\n let attributes = this.format.attributes\n for (let i = 0; i < attributes.length; i++) {\n gl.bindAttribLocation(this._program, i, attributes[i].name)\n }\n gl.linkProgram(this._program)\n if (!gl.getProgramParameter(this._program, gl.LINK_STATUS)) {\n throw new Error(`${gl.getProgramInfoLog(this._program)}`)\n }\n this._generation = this._context.generation\n\n // Validate this shader against the format\n if (!RELEASE) {\n for (let attribute of attributes) {\n for (\n let i = 0, ii = gl.getProgramParameter(this.program, gl.ACTIVE_ATTRIBUTES);\n i < ii;\n i++\n ) {\n let info = gl.getActiveAttrib(this.program, i)\n if (info && info.name == attribute.name) {\n assert(info.size == 1)\n switch (attribute.count) {\n case 1: {\n assert(info.type == gl.FLOAT)\n break\n }\n case 2: {\n assert(info.type == gl.FLOAT_VEC2)\n break\n }\n case 3: {\n assert(info.type == gl.FLOAT_VEC3)\n break\n }\n case 4: {\n assert(info.type == gl.FLOAT_VEC4)\n break\n }\n default: {\n assert(false)\n }\n }\n }\n }\n }\n }\n }\n return this._program!\n }\n\n prepare(): void {\n this._context.gl.useProgram(this.program)\n for (let uniform of this._uniformsList) {\n uniform.prepare()\n }\n }\n\n _compileShader(gl: WebGLRenderingContext, type: GLenum, source: string) {\n let shader = gl.createShader(type)\n if (!shader) {\n throw new Error('Failed to create shader')\n }\n gl.shaderSource(shader, source)\n gl.compileShader(shader)\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n throw new Error(`${gl.getShaderInfoLog(shader)}`)\n }\n if (!this._program) {\n throw new Error('Tried to attach shader before program was created')\n }\n gl.attachShader(this._program, shader)\n }\n\n static from(material: Graphics.Material): Material {\n assert(material == null || material instanceof Material)\n return material as Material\n }\n }\n\n class VertexBuffer extends Graphics.VertexBuffer {\n private readonly _context: Context\n private _generation = 0\n private _buffer: WebGLBuffer | null = null\n private _bytes: Uint8Array | null = null\n private _isDirty = true\n private _dirtyMin = VertexBuffer.INT_MAX\n private _dirtyMax = 0\n private _totalMin = VertexBuffer.INT_MAX\n private _totalMax = 0\n private _byteCount = 0\n\n constructor(context: Context, byteCount: number) {\n super()\n this._context = context\n this._byteCount = byteCount\n this._bytes = new Uint8Array(byteCount)\n }\n\n get context() {\n return this._context\n }\n get byteCount() {\n return this._byteCount\n }\n\n move(sourceByteOffset: number, targetByteOffset: number, byteCount: number) {\n assert(byteCount >= 0)\n assert(0 <= sourceByteOffset && sourceByteOffset + byteCount <= this._byteCount)\n assert(0 <= targetByteOffset && targetByteOffset + byteCount <= this._byteCount)\n\n if (this._bytes && sourceByteOffset != targetByteOffset && byteCount != 0) {\n this._bytes.set(this._bytes.subarray(sourceByteOffset, this._byteCount), targetByteOffset)\n this._growDirtyRegion(\n Math.min(sourceByteOffset, targetByteOffset),\n Math.max(sourceByteOffset, targetByteOffset) + byteCount,\n )\n }\n }\n\n upload(bytes: Uint8Array, byteOffset: number = 0) {\n assert(0 <= byteOffset && byteOffset + bytes.length <= this._byteCount)\n assert(this._bytes != null)\n this._bytes!.set(bytes, byteOffset)\n this._growDirtyRegion(byteOffset, byteOffset + bytes.length)\n }\n\n free() {\n if (this._buffer) {\n this._context.gl.deleteBuffer(this._buffer)\n }\n\n // Reset the generation to force this to be re-uploaded if it's used again\n // in the future.\n this._generation = 0\n }\n\n prepare(): void {\n let gl = this._context.gl\n\n if (this._generation !== this._context.generation) {\n this._buffer = gl.createBuffer()\n this._generation = this._context.generation\n this._isDirty = true\n }\n\n gl.bindBuffer(gl.ARRAY_BUFFER, this._buffer)\n\n if (this._isDirty) {\n gl.bufferData(gl.ARRAY_BUFFER, this._byteCount, gl.DYNAMIC_DRAW)\n this._dirtyMin = this._totalMin\n this._dirtyMax = this._totalMax\n this._isDirty = false\n }\n\n if (this._dirtyMin < this._dirtyMax) {\n gl.bufferSubData(\n gl.ARRAY_BUFFER,\n this._dirtyMin,\n this._bytes!.subarray(this._dirtyMin, this._dirtyMax),\n )\n this._dirtyMin = VertexBuffer.INT_MAX\n this._dirtyMax = 0\n }\n }\n\n _growDirtyRegion(min: number, max: number) {\n this._dirtyMin = Math.min(this._dirtyMin, min)\n this._dirtyMax = Math.max(this._dirtyMax, max)\n this._totalMin = Math.min(this._totalMin, min)\n this._totalMax = Math.max(this._totalMax, max)\n }\n\n static INT_MAX = 0x7fffffff\n\n static from(buffer: Graphics.VertexBuffer): VertexBuffer {\n assert(buffer == null || buffer instanceof VertexBuffer)\n return buffer as VertexBuffer\n }\n }\n\n class Texture implements Graphics.Texture {\n constructor(\n private readonly _context: Context,\n private _format: Graphics.TextureFormat,\n private _width: number,\n private _height: number,\n private _pixels: Uint8Array | null = null,\n private _texture: WebGLTexture | null = null,\n private _generation = 0,\n private _isFormatDirty = true,\n private _isContentDirty = true,\n ) {}\n\n get context() {\n return this._context\n }\n get format() {\n return this._format\n }\n get width() {\n return this._width\n }\n get height() {\n return this._height\n }\n\n resize(width: number, height: number, pixels: Uint8Array | null = null) {\n this._width = width\n this._height = height\n this._pixels = pixels\n this._isContentDirty = true\n }\n\n setFormat(format: Graphics.TextureFormat) {\n if (this._format != format) {\n this._format = format\n this._isFormatDirty = true\n }\n }\n\n get texture(): WebGLTexture {\n let gl = this._context.gl\n\n // Create\n if (this._generation != this._context.generation) {\n this._texture = gl.createTexture()\n this._generation = this._context.generation\n this._isFormatDirty = true\n this._isContentDirty = true\n }\n\n // Format\n if (this._isFormatDirty) {\n gl.bindTexture(gl.TEXTURE_2D, this._texture)\n gl.texParameteri(\n gl.TEXTURE_2D,\n gl.TEXTURE_MAG_FILTER,\n this.format.magFilter == Graphics.PixelFilter.NEAREST ? gl.NEAREST : gl.LINEAR,\n )\n gl.texParameteri(\n gl.TEXTURE_2D,\n gl.TEXTURE_MIN_FILTER,\n this.format.minFilter == Graphics.PixelFilter.NEAREST ? gl.NEAREST : gl.LINEAR,\n )\n gl.texParameteri(\n gl.TEXTURE_2D,\n gl.TEXTURE_WRAP_S,\n this.format.wrap == Graphics.PixelWrap.REPEAT ? gl.REPEAT : gl.CLAMP_TO_EDGE,\n )\n gl.texParameteri(\n gl.TEXTURE_2D,\n gl.TEXTURE_WRAP_T,\n this.format.wrap == Graphics.PixelWrap.REPEAT ? gl.REPEAT : gl.CLAMP_TO_EDGE,\n )\n this._isFormatDirty = false\n }\n\n if (this._isContentDirty) {\n gl.bindTexture(gl.TEXTURE_2D, this._texture)\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n this._width,\n this._height,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n this._pixels,\n )\n this._isContentDirty = false\n }\n\n return this._texture!\n }\n\n free() {\n if (this.texture) {\n this._context.gl.deleteTexture(this.texture)\n this._generation = 0\n }\n }\n\n static from(texture: Graphics.Texture): Texture {\n assert(texture == null || texture instanceof Texture)\n return texture as Texture\n }\n }\n\n class RenderTarget implements Graphics.RenderTarget {\n constructor(\n private _context: Context,\n private _texture: Texture,\n private _framebuffer: WebGLFramebuffer | null = null,\n private _generation = 0,\n private _isDirty = true,\n private _viewport = new Graphics.Rect(),\n ) {}\n\n get context() {\n return this._context\n }\n get texture() {\n return this._texture\n }\n get viewport() {\n return this._viewport\n }\n setColor(texture: Graphics.Texture) {\n if (this._texture != texture) {\n this._texture = Texture.from(texture)\n this._isDirty = true\n }\n }\n\n get framebuffer(): WebGLFramebuffer {\n let gl = this._context.gl\n let texture = this._texture.texture\n\n // Create\n if (this._generation != this._context.generation) {\n this._framebuffer = gl.createFramebuffer()\n this._generation = this._context.generation\n this._isDirty = true\n }\n\n // Update\n if (this._isDirty) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer)\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0)\n assert(gl.checkFramebufferStatus(gl.FRAMEBUFFER) == gl.FRAMEBUFFER_COMPLETE)\n this._isDirty = false\n }\n\n return this._framebuffer!\n }\n\n free() {\n if (this._framebuffer) {\n this._context.gl.deleteFramebuffer(this._framebuffer)\n this._generation = 0\n }\n }\n\n static from(renderTarget: Graphics.RenderTarget | null): RenderTarget | null {\n assert(renderTarget == null || renderTarget instanceof RenderTarget)\n return renderTarget as RenderTarget | null\n }\n }\n}\n","import {Graphics} from './graphics'\nimport {AffineTransform, Vec2} from '../lib/math'\n\nexport function setUniformAffineTransform(\n material: Graphics.Material,\n name: string,\n transform: AffineTransform,\n) {\n let {m00, m01, m02, m10, m11, m12} = transform\n material.setUniformMat3(name, m00, m01, m02, m10, m11, m12, 0, 0, 1)\n}\nexport function setUniformVec2(material: Graphics.Material, name: string, vec: Vec2) {\n material.setUniformVec2(name, vec.x, vec.y)\n}\n\nexport function renderInto(gl: Graphics.Context, target: Graphics.RenderTarget, cb: () => void) {\n gl.setRenderTarget(target)\n gl.setViewport(0, 0, target.texture.width, target.texture.height)\n cb()\n gl.setRenderTarget(null)\n}\n","import {Rect, Vec2, AffineTransform} from '../lib/math'\nimport {Color} from '../lib/color'\nimport {Graphics} from './graphics'\nimport {setUniformAffineTransform} from './utils'\n\nconst vertexFormat = new Graphics.VertexFormat()\nvertexFormat.add('configSpacePos', Graphics.AttributeType.FLOAT, 2)\nvertexFormat.add('color', Graphics.AttributeType.FLOAT, 3)\n\nconst vert = `\n uniform mat3 configSpaceToNDC;\n\n attribute vec2 configSpacePos;\n attribute vec3 color;\n varying vec3 vColor;\n\n void main() {\n vColor = color;\n vec2 position = (configSpaceToNDC * vec3(configSpacePos, 1)).xy;\n gl_Position = vec4(position, 1, 1);\n }\n`\n\nconst frag = `\n precision mediump float;\n varying vec3 vColor;\n\n void main() {\n gl_FragColor = vec4(vColor.rgb, 1);\n }\n`\n\nexport class RectangleBatch {\n private rects: Rect[] = []\n private colors: Color[] = []\n constructor(private gl: Graphics.Context) {}\n\n getRectCount() {\n return this.rects.length\n }\n\n private buffer: Graphics.VertexBuffer | null = null\n getBuffer(): Graphics.VertexBuffer {\n if (this.buffer) {\n return this.buffer\n }\n\n const corners = [\n [0, 0],\n [1, 0],\n [0, 1],\n [1, 0],\n [0, 1],\n [1, 1],\n ]\n\n const bytes = new Uint8Array(vertexFormat.stride * corners.length * this.rects.length)\n const floats = new Float32Array(bytes.buffer)\n let idx = 0\n\n for (let i = 0; i < this.rects.length; i++) {\n const rect = this.rects[i]\n const color = this.colors[i]\n\n // TODO(jlfwong): In the conversion from regl to graphics.ts, I lost the\n // ability to do instanced drawing. This is a pretty significant hit to\n // the performance here since I need 6x the memory to allocate these\n // things. Adding instanced drawing to graphics.ts is non-trivial, so I'm\n // just going to try this for now.\n for (let corner of corners) {\n floats[idx++] = rect.origin.x + corner[0] * rect.size.x\n floats[idx++] = rect.origin.y + corner[1] * rect.size.y\n\n floats[idx++] = color.r\n floats[idx++] = color.g\n floats[idx++] = color.b\n }\n }\n\n if (idx !== floats.length) {\n throw new Error(\"Buffer expected to be full but wasn't\")\n }\n\n this.buffer = this.gl.createVertexBuffer(bytes.length)\n this.buffer.upload(bytes)\n return this.buffer\n }\n\n addRect(rect: Rect, color: Color) {\n this.rects.push(rect)\n this.colors.push(color)\n\n if (this.buffer) {\n this.buffer.free()\n this.buffer = null\n }\n }\n\n free() {\n if (this.buffer) {\n this.buffer.free()\n this.buffer = null\n }\n }\n}\n\nexport interface RectangleBatchRendererProps {\n batch: RectangleBatch\n configSpaceSrcRect: Rect\n physicalSpaceDstRect: Rect\n}\n\nexport class RectangleBatchRenderer {\n material: Graphics.Material\n constructor(private gl: Graphics.Context) {\n this.material = gl.createMaterial(vertexFormat, vert, frag)\n }\n\n render(props: RectangleBatchRendererProps) {\n setUniformAffineTransform(\n this.material,\n 'configSpaceToNDC',\n (() => {\n const configToPhysical = AffineTransform.betweenRects(\n props.configSpaceSrcRect,\n props.physicalSpaceDstRect,\n )\n\n const viewportSize = new Vec2(this.gl.viewport.width, this.gl.viewport.height)\n\n const physicalToNDC = AffineTransform.withTranslation(new Vec2(-1, 1)).times(\n AffineTransform.withScale(new Vec2(2, -2).dividedByPointwise(viewportSize)),\n )\n\n return physicalToNDC.times(configToPhysical)\n })(),\n )\n\n this.gl.setUnpremultipliedBlendState()\n this.gl.draw(Graphics.Primitive.TRIANGLES, this.material, props.batch.getBuffer())\n }\n}\n","import {clamp} from './math'\n\nexport class Color {\n constructor(\n readonly r: number = 0,\n readonly g: number = 0,\n readonly b: number = 0,\n readonly a: number = 1,\n ) {}\n\n static fromLumaChromaHue(L: number, C: number, H: number) {\n // 0 <= L <= 1\n // 0 <= C <= 1\n // 0 <= H <= 360\n // https://en.wikipedia.org/wiki/HSL_and_HSV#From_luma/chroma/hue\n\n const hPrime = H / 60\n const X = C * (1 - Math.abs((hPrime % 2) - 1))\n const [R1, G1, B1] =\n hPrime < 1\n ? [C, X, 0]\n : hPrime < 2\n ? [X, C, 0]\n : hPrime < 3\n ? [0, C, X]\n : hPrime < 4\n ? [0, X, C]\n : hPrime < 5\n ? [X, 0, C]\n : [C, 0, X]\n\n const m = L - (0.3 * R1 + 0.59 * G1 + 0.11 * B1)\n\n return new Color(clamp(R1 + m, 0, 1), clamp(G1 + m, 0, 1), clamp(B1 + m, 0, 1), 1.0)\n }\n\n static fromCSSHex(hex: string) {\n if (hex.length !== 7 || hex[0] !== '#') {\n throw new Error(`Invalid color input ${hex}`)\n }\n const r = parseInt(hex.substr(1, 2), 16) / 255\n const g = parseInt(hex.substr(3, 2), 16) / 255\n const b = parseInt(hex.substr(5, 2), 16) / 255\n if (r < 0 || r > 1 || g < 0 || g > 1 || b < 0 || b > 1) {\n throw new Error(`Invalid color input ${hex}`)\n }\n return new Color(r, g, b)\n }\n\n withAlpha(a: number): Color {\n return new Color(this.r, this.g, this.b, a)\n }\n\n toCSS(): string {\n return `rgba(${(255 * this.r).toFixed()}, ${(255 * this.g).toFixed()}, ${(\n 255 * this.b\n ).toFixed()}, ${this.a.toFixed(2)})`\n }\n}\n","import {LRUCache} from '../lib/lru-cache'\nimport {RectangleBatch, RectangleBatchRenderer} from './rectangle-batch-renderer'\nimport {Rect, Vec2} from '../lib/math'\nimport {Color} from '../lib/color'\nimport {Graphics} from './graphics'\nimport {TextureRenderer} from './texture-renderer'\nimport {renderInto} from './utils'\n\nexport class RowAtlas<K> {\n private texture: Graphics.Texture\n private renderTarget: Graphics.RenderTarget\n private rowCache: LRUCache<K, number>\n private clearLineBatch: RectangleBatch\n\n constructor(\n private gl: Graphics.Context,\n private rectangleBatchRenderer: RectangleBatchRenderer,\n private textureRenderer: TextureRenderer,\n ) {\n this.texture = gl.createTexture(Graphics.TextureFormat.NEAREST_CLAMP, 4096, 4096)\n this.renderTarget = gl.createRenderTarget(this.texture)\n this.rowCache = new LRUCache(this.texture.height)\n this.clearLineBatch = new RectangleBatch(gl)\n this.clearLineBatch.addRect(Rect.unit, new Color(0, 0, 0, 0))\n\n // All of the cached data is stored GPU-side, and we don't retain a copy of\n // it client-side. This means when we get a context loss event, the data is\n // totally gone. So let's clear our CPU-side cache to reflect that fact.\n gl.addContextResetHandler(() => {\n this.rowCache.clear()\n })\n }\n\n has(key: K) {\n return this.rowCache.has(key)\n }\n getResolution() {\n return this.texture.width\n }\n getCapacity() {\n return this.texture.height\n }\n\n private allocateLine(key: K): number {\n if (this.rowCache.getSize() < this.rowCache.getCapacity()) {\n // Not in cache, but cache isn't full\n const row = this.rowCache.getSize()\n this.rowCache.insert(key, row)\n return row\n } else {\n // Not in cache, and cache is full. Evict something.\n const [, row] = this.rowCache.removeLRU()!\n this.rowCache.insert(key, row)\n return row\n }\n }\n\n writeToAtlasIfNeeded(keys: K[], render: (textureDstRect: Rect, key: K) => void) {\n renderInto(this.gl, this.renderTarget, () => {\n for (let key of keys) {\n let row = this.rowCache.get(key)\n if (row != null) {\n // Already cached!\n continue\n }\n // Not cached -- we'll have to actually render\n row = this.allocateLine(key)\n\n const textureRect = new Rect(new Vec2(0, row), new Vec2(this.texture.width, 1))\n this.rectangleBatchRenderer.render({\n batch: this.clearLineBatch,\n configSpaceSrcRect: Rect.unit,\n physicalSpaceDstRect: textureRect,\n })\n render(textureRect, key)\n }\n })\n }\n\n renderViaAtlas(key: K, dstRect: Rect): boolean {\n let row = this.rowCache.get(key)\n if (row == null) {\n return false\n }\n\n const textureRect = new Rect(new Vec2(0, row), new Vec2(this.texture.width, 1))\n\n // At this point, we have the row in cache, and we can\n // paint directly from it into the framebuffer.\n this.textureRenderer.render({\n texture: this.texture,\n srcRect: textureRect,\n dstRect: dstRect,\n })\n return true\n }\n}\n","import {Vec2, Rect, AffineTransform} from '../lib/math'\nimport {Graphics} from './graphics'\nimport {setUniformAffineTransform} from './utils'\n\nexport interface TextureRendererProps {\n texture: Graphics.Texture\n srcRect: Rect\n dstRect: Rect\n}\n\nconst vert = `\n uniform mat3 uvTransform;\n uniform mat3 positionTransform;\n\n attribute vec2 position;\n attribute vec2 uv;\n varying vec2 vUv;\n\n void main() {\n vUv = (uvTransform * vec3(uv, 1)).xy;\n gl_Position = vec4((positionTransform * vec3(position, 1)).xy, 0, 1);\n }\n`\n\nconst frag = `\n precision mediump float;\n\n varying vec2 vUv;\n uniform sampler2D texture;\n\n void main() {\n gl_FragColor = texture2D(texture, vUv);\n }\n`\n\nexport interface TextureRendererProps {\n texture: Graphics.Texture\n srcRect: Rect\n dstRect: Rect\n}\n\nexport class TextureRenderer {\n private buffer: Graphics.VertexBuffer\n private material: Graphics.Material\n\n constructor(private gl: Graphics.Context) {\n const vertexFormat = new Graphics.VertexFormat()\n vertexFormat.add('position', Graphics.AttributeType.FLOAT, 2)\n vertexFormat.add('uv', Graphics.AttributeType.FLOAT, 2)\n\n const vertices = [\n {pos: [-1, 1], uv: [0, 1]},\n {pos: [1, 1], uv: [1, 1]},\n {pos: [-1, -1], uv: [0, 0]},\n {pos: [1, -1], uv: [1, 0]},\n ]\n const floats: number[] = []\n for (let v of vertices) {\n floats.push(v.pos[0])\n floats.push(v.pos[1])\n floats.push(v.uv[0])\n floats.push(v.uv[1])\n }\n\n this.buffer = gl.createVertexBuffer(vertexFormat.stride * vertices.length)\n this.buffer.upload(new Uint8Array(new Float32Array(floats).buffer))\n this.material = gl.createMaterial(vertexFormat, vert, frag)\n }\n\n render(props: TextureRendererProps) {\n this.material.setUniformSampler('texture', props.texture, 0)\n setUniformAffineTransform(\n this.material,\n 'uvTransform',\n (() => {\n const {srcRect, texture} = props\n const physicalToUV = AffineTransform.withTranslation(new Vec2(0, 1))\n .times(AffineTransform.withScale(new Vec2(1, -1)))\n .times(\n AffineTransform.betweenRects(\n new Rect(Vec2.zero, new Vec2(texture.width, texture.height)),\n Rect.unit,\n ),\n )\n const uvRect = physicalToUV.transformRect(srcRect)\n return AffineTransform.betweenRects(Rect.unit, uvRect)\n })(),\n )\n setUniformAffineTransform(\n this.material,\n 'positionTransform',\n (() => {\n const {dstRect} = props\n\n const {viewport} = this.gl\n const viewportSize = new Vec2(viewport.width, viewport.height)\n\n const physicalToNDC = AffineTransform.withScale(new Vec2(1, -1)).times(\n AffineTransform.betweenRects(new Rect(Vec2.zero, viewportSize), Rect.NDC),\n )\n const ndcRect = physicalToNDC.transformRect(dstRect)\n return AffineTransform.betweenRects(Rect.NDC, ndcRect)\n })(),\n )\n\n this.gl.setUnpremultipliedBlendState()\n this.gl.draw(Graphics.Primitive.TRIANGLE_STRIP, this.material, this.buffer)\n }\n}\n","import {Color} from '../lib/color'\nimport {AffineTransform, Rect} from '../lib/math'\nimport {Theme} from '../views/themes/theme'\nimport {Graphics} from './graphics'\nimport {setUniformAffineTransform, setUniformVec2} from './utils'\n\nexport interface ViewportRectangleRendererProps {\n configSpaceToPhysicalViewSpace: AffineTransform\n configSpaceViewportRect: Rect\n}\n\nconst vertexFormat = new Graphics.VertexFormat()\nvertexFormat.add('position', Graphics.AttributeType.FLOAT, 2)\n\nconst vert = `\n attribute vec2 position;\n\n void main() {\n gl_Position = vec4(position, 0, 1);\n }\n`\n\nconst frag = (theme: Theme) => {\n const {r, g, b} = Color.fromCSSHex(theme.fgSecondaryColor)\n const rgb = `${r.toFixed(1)}, ${g.toFixed(1)}, ${b.toFixed(1)}`\n return `\n precision mediump float;\n\n uniform mat3 configSpaceToPhysicalViewSpace;\n uniform vec2 physicalSize;\n uniform vec2 physicalOrigin;\n uniform vec2 configSpaceViewportOrigin;\n uniform vec2 configSpaceViewportSize;\n uniform float framebufferHeight;\n\n void main() {\n vec2 origin = (configSpaceToPhysicalViewSpace * vec3(configSpaceViewportOrigin, 1.0)).xy;\n vec2 size = (configSpaceToPhysicalViewSpace * vec3(configSpaceViewportSize, 0.0)).xy;\n\n vec2 halfSize = physicalSize / 2.0;\n\n float borderWidth = 2.0;\n\n origin = floor(origin * halfSize) / halfSize + borderWidth * vec2(1.0, 1.0);\n size = floor(size * halfSize) / halfSize - 2.0 * borderWidth * vec2(1.0, 1.0);\n\n vec2 coord = gl_FragCoord.xy;\n coord.x = coord.x - physicalOrigin.x;\n coord.y = framebufferHeight - coord.y - physicalOrigin.y;\n vec2 clamped = clamp(coord, origin, origin + size);\n vec2 gap = clamped - coord;\n float maxdist = max(abs(gap.x), abs(gap.y));\n\n // TOOD(jlfwong): Could probably optimize this to use mix somehow.\n if (maxdist == 0.0) {\n // Inside viewport rectangle\n gl_FragColor = vec4(0, 0, 0, 0);\n } else if (maxdist < borderWidth) {\n // Inside viewport rectangle at border\n gl_FragColor = vec4(${rgb}, 0.8);\n } else {\n // Outside viewport rectangle\n gl_FragColor = vec4(${rgb}, 0.5);\n }\n }\n `\n}\n\nexport class ViewportRectangleRenderer {\n private material: Graphics.Material\n private buffer: Graphics.VertexBuffer\n\n constructor(private gl: Graphics.Context, theme: Theme) {\n const vertices = [\n [-1, 1],\n [1, 1],\n [-1, -1],\n [1, -1],\n ]\n const floats: number[] = []\n for (let v of vertices) {\n floats.push(v[0])\n floats.push(v[1])\n }\n this.buffer = gl.createVertexBuffer(vertexFormat.stride * vertices.length)\n this.buffer.upload(new Uint8Array(new Float32Array(floats).buffer))\n this.material = gl.createMaterial(vertexFormat, vert, frag(theme))\n }\n\n render(props: ViewportRectangleRendererProps) {\n setUniformAffineTransform(\n this.material,\n 'configSpaceToPhysicalViewSpace',\n props.configSpaceToPhysicalViewSpace,\n )\n\n // TODO(jlfwong): Pack these into a Vec4 instead\n setUniformVec2(this.material, 'configSpaceViewportOrigin', props.configSpaceViewportRect.origin)\n setUniformVec2(this.material, 'configSpaceViewportSize', props.configSpaceViewportRect.size)\n // TODO(jlfwong): Pack these into a Vec4 instead\n\n const viewport = this.gl.viewport\n this.material.setUniformVec2('physicalOrigin', viewport.x, viewport.y)\n this.material.setUniformVec2('physicalSize', viewport.width, viewport.height)\n\n this.material.setUniformFloat('framebufferHeight', this.gl.renderTargetHeightInPixels)\n\n this.gl.setBlendState(\n Graphics.BlendOperation.SOURCE_ALPHA,\n Graphics.BlendOperation.INVERSE_SOURCE_ALPHA,\n )\n this.gl.draw(Graphics.Primitive.TRIANGLE_STRIP, this.material, this.buffer)\n }\n}\n","import {Vec2, Rect, AffineTransform} from '../lib/math'\nimport {Theme} from '../views/themes/theme'\nimport {Graphics} from './graphics'\nimport {setUniformAffineTransform} from './utils'\n\nconst vertexFormat = new Graphics.VertexFormat()\nvertexFormat.add('position', Graphics.AttributeType.FLOAT, 2)\nvertexFormat.add('uv', Graphics.AttributeType.FLOAT, 2)\n\nconst vert = `\n uniform mat3 uvTransform;\n uniform mat3 positionTransform;\n\n attribute vec2 position;\n attribute vec2 uv;\n varying vec2 vUv;\n\n void main() {\n vUv = (uvTransform * vec3(uv, 1)).xy;\n gl_Position = vec4((positionTransform * vec3(position, 1)).xy, 0, 1);\n }\n`\n\nconst frag = (colorForBucket: string) => `\n precision mediump float;\n\n uniform vec2 uvSpacePixelSize;\n uniform float renderOutlines;\n\n varying vec2 vUv;\n uniform sampler2D colorTexture;\n\n // https://en.wikipedia.org/wiki/HSL_and_HSV#From_luma/chroma/hue\n vec3 hcl2rgb(float H, float C, float L) {\n float hPrime = H / 60.0;\n float X = C * (1.0 - abs(mod(hPrime, 2.0) - 1.0));\n vec3 RGB =\n hPrime < 1.0 ? vec3(C, X, 0) :\n hPrime < 2.0 ? vec3(X, C, 0) :\n hPrime < 3.0 ? vec3(0, C, X) :\n hPrime < 4.0 ? vec3(0, X, C) :\n hPrime < 5.0 ? vec3(X, 0, C) :\n vec3(C, 0, X);\n\n float m = L - dot(RGB, vec3(0.30, 0.59, 0.11));\n return RGB + vec3(m, m, m);\n }\n\n float triangle(float x) {\n return 2.0 * abs(fract(x) - 0.5) - 1.0;\n }\n\n ${colorForBucket}\n\n void main() {\n vec4 here = texture2D(colorTexture, vUv);\n\n if (here.z == 0.0) {\n // Background color\n gl_FragColor = vec4(0, 0, 0, 0);\n return;\n }\n\n // Sample the 4 surrounding pixels in the depth texture to determine\n // if we should draw a boundary here or not.\n vec4 N = texture2D(colorTexture, vUv + vec2(0, uvSpacePixelSize.y));\n vec4 E = texture2D(colorTexture, vUv + vec2(uvSpacePixelSize.x, 0));\n vec4 S = texture2D(colorTexture, vUv + vec2(0, -uvSpacePixelSize.y));\n vec4 W = texture2D(colorTexture, vUv + vec2(-uvSpacePixelSize.x, 0));\n\n // NOTE: For outline checks, we intentionally check both the right\n // and the left to determine if we're an edge. If a rectangle is a single\n // pixel wide, we don't want to render it as an outline, so this method\n // of checking ensures that we don't outline single physical-space\n // pixel width rectangles.\n if (\n renderOutlines > 0.0 &&\n (\n here.y == N.y && here.y != S.y || // Top edge\n here.y == S.y && here.y != N.y || // Bottom edge\n here.x == E.x && here.x != W.x || // Left edge\n here.x == W.x && here.x != E.x\n )\n ) {\n // We're on an edge! Draw transparent.\n gl_FragColor = vec4(0, 0, 0, 0);\n } else {\n // Not on an edge. Draw the appropriate color.\n gl_FragColor = vec4(colorForBucket(here.z), here.a);\n }\n }\n`\n\nexport interface FlamechartColorPassRenderProps {\n rectInfoTexture: Graphics.Texture\n renderOutlines: boolean\n srcRect: Rect\n dstRect: Rect\n}\n\nexport class FlamechartColorPassRenderer {\n private material: Graphics.Material\n private buffer: Graphics.VertexBuffer\n\n constructor(private gl: Graphics.Context, theme: Theme) {\n const vertices = [\n {pos: [-1, 1], uv: [0, 1]},\n {pos: [1, 1], uv: [1, 1]},\n {pos: [-1, -1], uv: [0, 0]},\n {pos: [1, -1], uv: [1, 0]},\n ]\n const floats: number[] = []\n for (let v of vertices) {\n floats.push(v.pos[0])\n floats.push(v.pos[1])\n floats.push(v.uv[0])\n floats.push(v.uv[1])\n }\n\n this.buffer = gl.createVertexBuffer(vertexFormat.stride * vertices.length)\n this.buffer.uploadFloats(floats)\n this.material = gl.createMaterial(vertexFormat, vert, frag(theme.colorForBucketGLSL))\n }\n\n render(props: FlamechartColorPassRenderProps) {\n const {srcRect, rectInfoTexture} = props\n const physicalToUV = AffineTransform.withTranslation(new Vec2(0, 1))\n .times(AffineTransform.withScale(new Vec2(1, -1)))\n .times(\n AffineTransform.betweenRects(\n new Rect(Vec2.zero, new Vec2(rectInfoTexture.width, rectInfoTexture.height)),\n Rect.unit,\n ),\n )\n const uvRect = physicalToUV.transformRect(srcRect)\n const uvTransform = AffineTransform.betweenRects(Rect.unit, uvRect)\n\n const {dstRect} = props\n const viewportSize = new Vec2(this.gl.viewport.width, this.gl.viewport.height)\n\n const physicalToNDC = AffineTransform.withScale(new Vec2(1, -1)).times(\n AffineTransform.betweenRects(new Rect(Vec2.zero, viewportSize), Rect.NDC),\n )\n const ndcRect = physicalToNDC.transformRect(dstRect)\n const positionTransform = AffineTransform.betweenRects(Rect.NDC, ndcRect)\n\n const uvSpacePixelSize = Vec2.unit.dividedByPointwise(\n new Vec2(props.rectInfoTexture.width, props.rectInfoTexture.height),\n )\n\n this.material.setUniformSampler('colorTexture', props.rectInfoTexture, 0)\n setUniformAffineTransform(this.material, 'uvTransform', uvTransform)\n this.material.setUniformFloat('renderOutlines', props.renderOutlines ? 1.0 : 0.0)\n this.material.setUniformVec2('uvSpacePixelSize', uvSpacePixelSize.x, uvSpacePixelSize.y)\n setUniformAffineTransform(this.material, 'positionTransform', positionTransform)\n\n this.gl.setUnpremultipliedBlendState()\n this.gl.draw(Graphics.Primitive.TRIANGLE_STRIP, this.material, this.buffer)\n }\n}\n","import {Graphics, WebGL} from './graphics'\nimport {RectangleBatchRenderer} from './rectangle-batch-renderer'\nimport {TextureRenderer} from './texture-renderer'\nimport {Rect, Vec2} from '../lib/math'\nimport {ViewportRectangleRenderer} from './overlay-rectangle-renderer'\nimport {FlamechartColorPassRenderer} from './flamechart-color-pass-renderer'\nimport {Color} from '../lib/color'\nimport {Theme} from '../views/themes/theme'\n\ntype FrameCallback = () => void\n\nexport class CanvasContext {\n public readonly gl: WebGL.Context\n public readonly rectangleBatchRenderer: RectangleBatchRenderer\n public readonly textureRenderer: TextureRenderer\n public readonly viewportRectangleRenderer: ViewportRectangleRenderer\n public readonly flamechartColorPassRenderer: FlamechartColorPassRenderer\n public readonly theme: Theme\n\n constructor(canvas: HTMLCanvasElement, theme: Theme) {\n this.gl = new WebGL.Context(canvas)\n this.rectangleBatchRenderer = new RectangleBatchRenderer(this.gl)\n this.textureRenderer = new TextureRenderer(this.gl)\n this.viewportRectangleRenderer = new ViewportRectangleRenderer(this.gl, theme)\n this.flamechartColorPassRenderer = new FlamechartColorPassRenderer(this.gl, theme)\n this.theme = theme\n\n // Whenever the canvas is resized, draw immediately. This prevents\n // flickering during resizing.\n this.gl.addAfterResizeEventHandler(this.onBeforeFrame)\n\n const webGLInfo = this.gl.getWebGLInfo()\n if (webGLInfo) {\n console.log(\n `WebGL initialized. renderer: ${webGLInfo.renderer}, vendor: ${webGLInfo.vendor}, version: ${webGLInfo.version}`,\n )\n }\n ;(window as any)['testContextLoss'] = () => {\n this.gl.testContextLoss()\n }\n }\n\n private animationFrameRequest: number | null = null\n private beforeFrameHandlers = new Set<FrameCallback>()\n addBeforeFrameHandler(callback: FrameCallback) {\n this.beforeFrameHandlers.add(callback)\n }\n removeBeforeFrameHandler(callback: FrameCallback) {\n this.beforeFrameHandlers.delete(callback)\n }\n requestFrame() {\n if (!this.animationFrameRequest) {\n this.animationFrameRequest = requestAnimationFrame(this.onBeforeFrame)\n }\n }\n private onBeforeFrame = () => {\n this.animationFrameRequest = null\n this.gl.setViewport(0, 0, this.gl.renderTargetWidthInPixels, this.gl.renderTargetHeightInPixels)\n const color = Color.fromCSSHex(this.theme.bgPrimaryColor)\n this.gl.clear(new Graphics.Color(color.r, color.g, color.b, color.a))\n\n for (const handler of this.beforeFrameHandlers) {\n handler()\n }\n }\n\n setViewport(physicalBounds: Rect, cb: () => void): void {\n const {origin, size} = physicalBounds\n let viewportBefore = this.gl.viewport\n this.gl.setViewport(origin.x, origin.y, size.x, size.y)\n\n cb()\n\n let {x, y, width, height} = viewportBefore\n this.gl.setViewport(x, y, width, height)\n }\n\n renderBehind(el: Element, cb: () => void) {\n const bounds = el.getBoundingClientRect()\n const physicalBounds = new Rect(\n new Vec2(bounds.left * window.devicePixelRatio, bounds.top * window.devicePixelRatio),\n new Vec2(bounds.width * window.devicePixelRatio, bounds.height * window.devicePixelRatio),\n )\n\n this.setViewport(physicalBounds, cb)\n }\n}\n","import {Frame, Profile} from '../lib/profile'\nimport {memoizeByReference, memoizeByShallowEquality} from '../lib/utils'\nimport {RowAtlas} from '../gl/row-atlas'\nimport {CanvasContext} from '../gl/canvas-context'\nimport {FlamechartRowAtlasKey} from '../gl/flamechart-renderer'\nimport {Theme} from '../views/themes/theme'\n\nexport const createGetColorBucketForFrame = memoizeByReference(\n (frameToColorBucket: Map<number | string, number>) => {\n return (frame: Frame): number => {\n return frameToColorBucket.get(frame.key) || 0\n }\n },\n)\n\nexport const createGetCSSColorForFrame = memoizeByShallowEquality(\n ({\n theme,\n frameToColorBucket,\n }: {\n theme: Theme\n frameToColorBucket: Map<number | string, number>\n }) => {\n const getColorBucketForFrame = createGetColorBucketForFrame(frameToColorBucket)\n return (frame: Frame): string => {\n const t = getColorBucketForFrame(frame) / 255\n return theme.colorForBucket(t).toCSS()\n }\n },\n)\n\nexport const getCanvasContext = memoizeByShallowEquality(\n ({theme, canvas}: {theme: Theme; canvas: HTMLCanvasElement}) => {\n return new CanvasContext(canvas, theme)\n },\n)\n\nexport const getRowAtlas = memoizeByReference((canvasContext: CanvasContext) => {\n return new RowAtlas<FlamechartRowAtlasKey>(\n canvasContext.gl,\n canvasContext.rectangleBatchRenderer,\n canvasContext.textureRenderer,\n )\n})\n\nexport const getProfileToView = memoizeByShallowEquality(\n ({profile, flattenRecursion}: {profile: Profile; flattenRecursion: boolean}): Profile => {\n return flattenRecursion ? profile.getProfileWithRecursionFlattened() : profile\n },\n)\nexport const getFrameToColorBucket = memoizeByReference(\n (profile: Profile): Map<string | number, number> => {\n const frames: Frame[] = []\n profile.forEachFrame(f => frames.push(f))\n function key(f: Frame) {\n return (f.file || '') + f.name\n }\n function compare(a: Frame, b: Frame) {\n return key(a) > key(b) ? 1 : -1\n }\n frames.sort(compare)\n const frameToColorBucket = new Map<string | number, number>()\n for (let i = 0; i < frames.length; i++) {\n frameToColorBucket.set(frames[i].key, Math.floor((255 * i) / frames.length))\n }\n\n return frameToColorBucket\n },\n)\n","import { options } from 'preact';\n\n/** @type {number} */\nlet currentIndex;\n\n/** @type {import('./internal').Component} */\nlet currentComponent;\n\n/** @type {number} */\nlet currentHook = 0;\n\n/** @type {Array<import('./internal').Component>} */\nlet afterPaintEffects = [];\n\nlet oldBeforeRender = options._render;\nlet oldAfterDiff = options.diffed;\nlet oldCommit = options._commit;\nlet oldBeforeUnmount = options.unmount;\n\nconst RAF_TIMEOUT = 100;\nlet prevRaf;\n\noptions._render = vnode => {\n\tif (oldBeforeRender) oldBeforeRender(vnode);\n\n\tcurrentComponent = vnode._component;\n\tcurrentIndex = 0;\n\n\tif (currentComponent.__hooks) {\n\t\tcurrentComponent.__hooks._pendingEffects.forEach(invokeCleanup);\n\t\tcurrentComponent.__hooks._pendingEffects.forEach(invokeEffect);\n\t\tcurrentComponent.__hooks._pendingEffects = [];\n\t}\n};\n\noptions.diffed = vnode => {\n\tif (oldAfterDiff) oldAfterDiff(vnode);\n\n\tconst c = vnode._component;\n\tif (!c) return;\n\n\tconst hooks = c.__hooks;\n\tif (hooks) {\n\t\tif (hooks._pendingEffects.length) {\n\t\t\tafterPaint(afterPaintEffects.push(c));\n\t\t}\n\t}\n};\n\noptions._commit = (vnode, commitQueue) => {\n\tcommitQueue.some(component => {\n\t\ttry {\n\t\t\tcomponent._renderCallbacks.forEach(invokeCleanup);\n\t\t\tcomponent._renderCallbacks = component._renderCallbacks.filter(cb =>\n\t\t\t\tcb._value ? invokeEffect(cb) : true\n\t\t\t);\n\t\t} catch (e) {\n\t\t\tcommitQueue.some(c => {\n\t\t\t\tif (c._renderCallbacks) c._renderCallbacks = [];\n\t\t\t});\n\t\t\tcommitQueue = [];\n\t\t\toptions._catchError(e, component._vnode);\n\t\t}\n\t});\n\n\tif (oldCommit) oldCommit(vnode, commitQueue);\n};\n\noptions.unmount = vnode => {\n\tif (oldBeforeUnmount) oldBeforeUnmount(vnode);\n\n\tconst c = vnode._component;\n\tif (!c) return;\n\n\tconst hooks = c.__hooks;\n\tif (hooks) {\n\t\ttry {\n\t\t\thooks._list.forEach(hook => hook._cleanup && hook._cleanup());\n\t\t} catch (e) {\n\t\t\toptions._catchError(e, c._vnode);\n\t\t}\n\t}\n};\n\n/**\n * Get a hook's state from the currentComponent\n * @param {number} index The index of the hook to get\n * @param {number} type The index of the hook to get\n * @returns {import('./internal').HookState}\n */\nfunction getHookState(index, type) {\n\tif (options._hook) {\n\t\toptions._hook(currentComponent, index, currentHook || type);\n\t}\n\tcurrentHook = 0;\n\n\t// Largely inspired by:\n\t// * https://github.com/michael-klein/funcy.js/blob/f6be73468e6ec46b0ff5aa3cc4c9baf72a29025a/src/hooks/core_hooks.mjs\n\t// * https://github.com/michael-klein/funcy.js/blob/650beaa58c43c33a74820a3c98b3c7079cf2e333/src/renderer.mjs\n\t// Other implementations to look at:\n\t// * https://codesandbox.io/s/mnox05qp8\n\tconst hooks =\n\t\tcurrentComponent.__hooks ||\n\t\t(currentComponent.__hooks = {\n\t\t\t_list: [],\n\t\t\t_pendingEffects: []\n\t\t});\n\n\tif (index >= hooks._list.length) {\n\t\thooks._list.push({});\n\t}\n\treturn hooks._list[index];\n}\n\n/**\n * @param {import('./index').StateUpdater<any>} initialState\n */\nexport function useState(initialState) {\n\tcurrentHook = 1;\n\treturn useReducer(invokeOrReturn, initialState);\n}\n\n/**\n * @param {import('./index').Reducer<any, any>} reducer\n * @param {import('./index').StateUpdater<any>} initialState\n * @param {(initialState: any) => void} [init]\n * @returns {[ any, (state: any) => void ]}\n */\nexport function useReducer(reducer, initialState, init) {\n\t/** @type {import('./internal').ReducerHookState} */\n\tconst hookState = getHookState(currentIndex++, 2);\n\tif (!hookState._component) {\n\t\thookState._component = currentComponent;\n\n\t\thookState._value = [\n\t\t\t!init ? invokeOrReturn(undefined, initialState) : init(initialState),\n\n\t\t\taction => {\n\t\t\t\tconst nextValue = reducer(hookState._value[0], action);\n\t\t\t\tif (hookState._value[0] !== nextValue) {\n\t\t\t\t\thookState._value[0] = nextValue;\n\t\t\t\t\thookState._component.setState({});\n\t\t\t\t}\n\t\t\t}\n\t\t];\n\t}\n\n\treturn hookState._value;\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {any[]} args\n */\nexport function useEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 3);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._args = args;\n\n\t\tcurrentComponent.__hooks._pendingEffects.push(state);\n\t}\n}\n\n/**\n * @param {import('./internal').Effect} callback\n * @param {any[]} args\n */\nexport function useLayoutEffect(callback, args) {\n\t/** @type {import('./internal').EffectHookState} */\n\tconst state = getHookState(currentIndex++, 4);\n\tif (!options._skipEffects && argsChanged(state._args, args)) {\n\t\tstate._value = callback;\n\t\tstate._args = args;\n\n\t\tcurrentComponent._renderCallbacks.push(state);\n\t}\n}\n\nexport function useRef(initialValue) {\n\tcurrentHook = 5;\n\treturn useMemo(() => ({ current: initialValue }), []);\n}\n\n/**\n * @param {object} ref\n * @param {() => object} createHandle\n * @param {any[]} args\n */\nexport function useImperativeHandle(ref, createHandle, args) {\n\tcurrentHook = 6;\n\tuseLayoutEffect(\n\t\t() => {\n\t\t\tif (typeof ref == 'function') ref(createHandle());\n\t\t\telse if (ref) ref.current = createHandle();\n\t\t},\n\t\targs == null ? args : args.concat(ref)\n\t);\n}\n\n/**\n * @param {() => any} factory\n * @param {any[]} args\n */\nexport function useMemo(factory, args) {\n\t/** @type {import('./internal').MemoHookState} */\n\tconst state = getHookState(currentIndex++, 7);\n\tif (argsChanged(state._args, args)) {\n\t\tstate._args = args;\n\t\tstate._factory = factory;\n\t\treturn (state._value = factory());\n\t}\n\n\treturn state._value;\n}\n\n/**\n * @param {() => void} callback\n * @param {any[]} args\n */\nexport function useCallback(callback, args) {\n\tcurrentHook = 8;\n\treturn useMemo(() => callback, args);\n}\n\n/**\n * @param {import('./internal').PreactContext} context\n */\nexport function useContext(context) {\n\tconst provider = currentComponent.context[context._id];\n\t// We could skip this call here, but than we'd not call\n\t// `options._hook`. We need to do that in order to make\n\t// the devtools aware of this hook.\n\tconst state = getHookState(currentIndex++, 9);\n\t// The devtools needs access to the context object to\n\t// be able to pull of the default value when no provider\n\t// is present in the tree.\n\tstate._context = context;\n\tif (!provider) return context._defaultValue;\n\t// This is probably not safe to convert to \"!\"\n\tif (state._value == null) {\n\t\tstate._value = true;\n\t\tprovider.sub(currentComponent);\n\t}\n\treturn provider.props.value;\n}\n\n/**\n * Display a custom label for a custom hook for the devtools panel\n * @type {<T>(value: T, cb?: (value: T) => string | number) => void}\n */\nexport function useDebugValue(value, formatter) {\n\tif (options.useDebugValue) {\n\t\toptions.useDebugValue(formatter ? formatter(value) : value);\n\t}\n}\n\nexport function useErrorBoundary(cb) {\n\tconst state = getHookState(currentIndex++, 10);\n\tconst errState = useState();\n\tstate._value = cb;\n\tif (!currentComponent.componentDidCatch) {\n\t\tcurrentComponent.componentDidCatch = err => {\n\t\t\tif (state._value) state._value(err);\n\t\t\terrState[1](err);\n\t\t};\n\t}\n\treturn [\n\t\terrState[0],\n\t\t() => {\n\t\t\terrState[1](undefined);\n\t\t}\n\t];\n}\n\n/**\n * After paint effects consumer.\n */\nfunction flushAfterPaintEffects() {\n\tafterPaintEffects.some(component => {\n\t\tif (component._parentDom) {\n\t\t\ttry {\n\t\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeCleanup);\n\t\t\t\tcomponent.__hooks._pendingEffects.forEach(invokeEffect);\n\t\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t\t} catch (e) {\n\t\t\t\tcomponent.__hooks._pendingEffects = [];\n\t\t\t\toptions._catchError(e, component._vnode);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t});\n\tafterPaintEffects = [];\n}\n\n/**\n * Schedule a callback to be invoked after the browser has a chance to paint a new frame.\n * Do this by combining requestAnimationFrame (rAF) + setTimeout to invoke a callback after\n * the next browser frame.\n *\n * Also, schedule a timeout in parallel to the the rAF to ensure the callback is invoked\n * even if RAF doesn't fire (for example if the browser tab is not visible)\n *\n * @param {() => void} callback\n */\nfunction afterNextFrame(callback) {\n\tconst done = () => {\n\t\tclearTimeout(timeout);\n\t\tcancelAnimationFrame(raf);\n\t\tsetTimeout(callback);\n\t};\n\tconst timeout = setTimeout(done, RAF_TIMEOUT);\n\n\tlet raf;\n\tif (typeof window != 'undefined') {\n\t\traf = requestAnimationFrame(done);\n\t}\n}\n\n// Note: if someone used options.debounceRendering = requestAnimationFrame,\n// then effects will ALWAYS run on the NEXT frame instead of the current one, incurring a ~16ms delay.\n// Perhaps this is not such a big deal.\n/**\n * Schedule afterPaintEffects flush after the browser paints\n * @param {number} newQueueLength\n */\nfunction afterPaint(newQueueLength) {\n\tif (newQueueLength === 1 || prevRaf !== options.requestAnimationFrame) {\n\t\tprevRaf = options.requestAnimationFrame;\n\t\t(prevRaf || afterNextFrame)(flushAfterPaintEffects);\n\t}\n}\n\n/**\n * @param {import('./internal').EffectHookState} hook\n */\nfunction invokeCleanup(hook) {\n\tif (hook._cleanup) hook._cleanup();\n}\n\n/**\n * Invoke a Hook's effect\n * @param {import('./internal').EffectHookState} hook\n */\nfunction invokeEffect(hook) {\n\tconst result = hook._value();\n\tif (typeof result == 'function') hook._cleanup = result;\n}\n\n/**\n * @param {any[]} oldArgs\n * @param {any[]} newArgs\n */\nfunction argsChanged(oldArgs, newArgs) {\n\treturn !oldArgs || newArgs.some((arg, index) => arg !== oldArgs[index]);\n}\n\nfunction invokeOrReturn(arg, f) {\n\treturn typeof f == 'function' ? f(arg) : f;\n}\n","import { Component } from 'preact';\nimport { shallowDiffers } from './util';\n\n/**\n * Component class with a predefined `shouldComponentUpdate` implementation\n */\nexport class PureComponent extends Component {\n\tconstructor(props) {\n\t\tsuper(props);\n\t\t// Some third-party libraries check if this property is present\n\t\tthis.isPureReactComponent = true;\n\t}\n\n\tshouldComponentUpdate(props, state) {\n\t\treturn (\n\t\t\tshallowDiffers(this.props, props) || shallowDiffers(this.state, state)\n\t\t);\n\t}\n}\n","import { createElement } from 'preact';\nimport { shallowDiffers, assign } from './util';\n\n/**\n * Memoize a component, so that it only updates when the props actually have\n * changed. This was previously known as `React.pure`.\n * @param {import('./internal').FunctionalComponent} c functional component\n * @param {(prev: object, next: object) => boolean} [comparer] Custom equality function\n * @returns {import('./internal').FunctionalComponent}\n */\nexport function memo(c, comparer) {\n\tfunction shouldUpdate(nextProps) {\n\t\tlet ref = this.props.ref;\n\t\tlet updateRef = ref == nextProps.ref;\n\t\tif (!updateRef && ref) {\n\t\t\tref.call ? ref(null) : (ref.current = null);\n\t\t}\n\n\t\tif (!comparer) {\n\t\t\treturn shallowDiffers(this.props, nextProps);\n\t\t}\n\n\t\treturn !comparer(this.props, nextProps) || !updateRef;\n\t}\n\n\tfunction Memoed(props) {\n\t\tthis.shouldComponentUpdate = shouldUpdate;\n\t\treturn createElement(c, assign({}, props));\n\t}\n\tMemoed.prototype.isReactComponent = true;\n\tMemoed.displayName = 'Memo(' + (c.displayName || c.name) + ')';\n\tMemoed._forwarded = true;\n\treturn Memoed;\n}\n","import { options } from 'preact';\nimport { assign } from './util';\n\nlet oldDiffHook = options._diff;\noptions._diff = vnode => {\n\tif (vnode.type && vnode.type._forwarded && vnode.ref) {\n\t\tvnode.props.ref = vnode.ref;\n\t\tvnode.ref = null;\n\t}\n\tif (oldDiffHook) oldDiffHook(vnode);\n};\n\n/**\n * Pass ref down to a child. This is mainly used in libraries with HOCs that\n * wrap components. Using `forwardRef` there is an easy way to get a reference\n * of the wrapped component instead of one of the wrapper itself.\n * @param {import('./index').ForwardFn} fn\n * @returns {import('./internal').FunctionalComponent}\n */\nexport function forwardRef(fn) {\n\tfunction Forwarded(props) {\n\t\tlet clone = assign({}, props);\n\t\tdelete clone.ref;\n\t\treturn fn(clone, props.ref);\n\t}\n\tForwarded.prototype.isReactComponent = Forwarded._forwarded = true;\n\tForwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';\n\treturn Forwarded;\n}\n","import { toChildArray } from 'preact';\n\nconst mapFn = (children, fn) => {\n\tif (!children) return null;\n\treturn toChildArray(children).reduce(\n\t\t(acc, value, index) => acc.concat(fn(value, index)),\n\t\t[]\n\t);\n};\n\n// This API is completely unnecessary for Preact, so it's basically passthrough.\nexport const Children = {\n\tmap: mapFn,\n\tforEach: mapFn,\n\tcount(children) {\n\t\treturn children ? toChildArray(children).length : 0;\n\t},\n\tonly(children) {\n\t\tchildren = toChildArray(children);\n\t\tif (children.length !== 1) {\n\t\t\tthrow new Error('Children.only() expects only one child.');\n\t\t}\n\t\treturn children[0];\n\t},\n\ttoArray: toChildArray\n};\n","import { Component, createElement, options } from 'preact';\nimport { assign } from './util';\n\nconst oldCatchError = options._catchError;\noptions._catchError = function(error, newVNode, oldVNode) {\n\tif (error.then) {\n\t\t/** @type {import('./internal').Component} */\n\t\tlet component;\n\t\tlet vnode = newVNode;\n\n\t\tfor (; (vnode = vnode._parent); ) {\n\t\t\tif ((component = vnode._component) && component._childDidSuspend) {\n\t\t\t\t// Don't call oldCatchError if we found a Suspense\n\t\t\t\treturn component._childDidSuspend(error, newVNode._component);\n\t\t\t}\n\t\t}\n\t}\n\toldCatchError(error, newVNode, oldVNode);\n};\n\nfunction detachedClone(vnode) {\n\tif (vnode) {\n\t\tvnode = assign({}, vnode);\n\t\tvnode._component = null;\n\t\tvnode._children = vnode._children && vnode._children.map(detachedClone);\n\t}\n\treturn vnode;\n}\n\n// having custom inheritance instead of a class here saves a lot of bytes\nexport function Suspense() {\n\t// we do not call super here to golf some bytes...\n\tthis._pendingSuspensionCount = 0;\n\tthis._suspenders = null;\n\tthis._detachOnNextRender = null;\n}\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspense.prototype = new Component();\n\n/**\n * @param {Promise} promise The thrown promise\n * @param {Component<any, any>} suspendingComponent The suspending component\n */\nSuspense.prototype._childDidSuspend = function(promise, suspendingComponent) {\n\t/** @type {import('./internal').SuspenseComponent} */\n\tconst c = this;\n\n\tif (c._suspenders == null) {\n\t\tc._suspenders = [];\n\t}\n\tc._suspenders.push(suspendingComponent);\n\n\tconst resolve = suspended(c._vnode);\n\n\tlet resolved = false;\n\tconst onResolved = () => {\n\t\tif (resolved) return;\n\n\t\tresolved = true;\n\n\t\tif (resolve) {\n\t\t\tresolve(onSuspensionComplete);\n\t\t} else {\n\t\t\tonSuspensionComplete();\n\t\t}\n\t};\n\n\tsuspendingComponent._suspendedComponentWillUnmount =\n\t\tsuspendingComponent.componentWillUnmount;\n\tsuspendingComponent.componentWillUnmount = () => {\n\t\tonResolved();\n\n\t\tif (suspendingComponent._suspendedComponentWillUnmount) {\n\t\t\tsuspendingComponent._suspendedComponentWillUnmount();\n\t\t}\n\t};\n\n\tconst onSuspensionComplete = () => {\n\t\tif (!--c._pendingSuspensionCount) {\n\t\t\tc._vnode._children[0] = c.state._suspended;\n\t\t\tc.setState({ _suspended: (c._detachOnNextRender = null) });\n\n\t\t\tlet suspended;\n\t\t\twhile ((suspended = c._suspenders.pop())) {\n\t\t\t\tsuspended.forceUpdate();\n\t\t\t}\n\t\t}\n\t};\n\n\tif (!c._pendingSuspensionCount++) {\n\t\tc.setState({ _suspended: (c._detachOnNextRender = c._vnode._children[0]) });\n\t}\n\tpromise.then(onResolved, onResolved);\n};\n\nSuspense.prototype.render = function(props, state) {\n\tif (this._detachOnNextRender) {\n\t\tthis._vnode._children[0] = detachedClone(this._detachOnNextRender);\n\t\tthis._detachOnNextRender = null;\n\t}\n\n\treturn [\n\t\tcreateElement(Component, null, state._suspended ? null : props.children),\n\t\tstate._suspended && props.fallback\n\t];\n};\n\n/**\n * Checks and calls the parent component's _suspended method, passing in the\n * suspended vnode. This is a way for a parent (e.g. SuspenseList) to get notified\n * that one of its children/descendants suspended.\n *\n * The parent MAY return a callback. The callback will get called when the\n * suspension resolves, notifying the parent of the fact.\n * Moreover, the callback gets function `unsuspend` as a parameter. The resolved\n * child descendant will not actually get unsuspended until `unsuspend` gets called.\n * This is a way for the parent to delay unsuspending.\n *\n * If the parent does not return a callback then the resolved vnode\n * gets unsuspended immediately when it resolves.\n *\n * @param {import('../src/internal').VNode} vnode\n * @returns {((unsuspend: () => void) => void)?}\n */\nexport function suspended(vnode) {\n\tlet component = vnode._parent._component;\n\treturn component && component._suspended && component._suspended(vnode);\n}\n\nexport function lazy(loader) {\n\tlet prom;\n\tlet component;\n\tlet error;\n\n\tfunction Lazy(props) {\n\t\tif (!prom) {\n\t\t\tprom = loader();\n\t\t\tprom.then(\n\t\t\t\texports => {\n\t\t\t\t\tcomponent = exports.default || exports;\n\t\t\t\t},\n\t\t\t\te => {\n\t\t\t\t\terror = e;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!component) {\n\t\t\tthrow prom;\n\t\t}\n\n\t\treturn createElement(component, props);\n\t}\n\n\tLazy.displayName = 'Lazy';\n\tLazy._forwarded = true;\n\treturn Lazy;\n}\n","import { Component, toChildArray } from 'preact';\nimport { suspended } from './suspense.js';\n\n// Indexes to linked list nodes (nodes are stored as arrays to save bytes).\nconst SUSPENDED_COUNT = 0;\nconst RESOLVED_COUNT = 1;\nconst NEXT_NODE = 2;\n\n// Having custom inheritance instead of a class here saves a lot of bytes.\nexport function SuspenseList() {\n\tthis._next = null;\n\tthis._map = null;\n}\n\n// Mark one of child's earlier suspensions as resolved.\n// Some pending callbacks may become callable due to this\n// (e.g. the last suspended descendant gets resolved when\n// revealOrder === 'together'). Process those callbacks as well.\nconst resolve = (list, child, node) => {\n\tif (++node[RESOLVED_COUNT] === node[SUSPENDED_COUNT]) {\n\t\t// The number a child (or any of its descendants) has been suspended\n\t\t// matches the number of times it's been resolved. Therefore we\n\t\t// mark the child as completely resolved by deleting it from ._map.\n\t\t// This is used to figure out when *all* children have been completely\n\t\t// resolved when revealOrder is 'together'.\n\t\tlist._map.delete(child);\n\t}\n\n\t// If revealOrder is falsy then we can do an early exit, as the\n\t// callbacks won't get queued in the node anyway.\n\t// If revealOrder is 'together' then also do an early exit\n\t// if all suspended descendants have not yet been resolved.\n\tif (\n\t\t!list.props.revealOrder ||\n\t\t(list.props.revealOrder[0] === 't' && list._map.size)\n\t) {\n\t\treturn;\n\t}\n\n\t// Walk the currently suspended children in order, calling their\n\t// stored callbacks on the way. Stop if we encounter a child that\n\t// has not been completely resolved yet.\n\tnode = list._next;\n\twhile (node) {\n\t\twhile (node.length > 3) {\n\t\t\tnode.pop()();\n\t\t}\n\t\tif (node[RESOLVED_COUNT] < node[SUSPENDED_COUNT]) {\n\t\t\tbreak;\n\t\t}\n\t\tlist._next = node = node[NEXT_NODE];\n\t}\n};\n\n// Things we do here to save some bytes but are not proper JS inheritance:\n// - call `new Component()` as the prototype\n// - do not set `Suspense.prototype.constructor` to `Suspense`\nSuspenseList.prototype = new Component();\n\nSuspenseList.prototype._suspended = function(child) {\n\tconst list = this;\n\tconst delegated = suspended(list._vnode);\n\n\tlet node = list._map.get(child);\n\tnode[SUSPENDED_COUNT]++;\n\n\treturn unsuspend => {\n\t\tconst wrappedUnsuspend = () => {\n\t\t\tif (!list.props.revealOrder) {\n\t\t\t\t// Special case the undefined (falsy) revealOrder, as there\n\t\t\t\t// is no need to coordinate a specific order or unsuspends.\n\t\t\t\tunsuspend();\n\t\t\t} else {\n\t\t\t\tnode.push(unsuspend);\n\t\t\t\tresolve(list, child, node);\n\t\t\t}\n\t\t};\n\t\tif (delegated) {\n\t\t\tdelegated(wrappedUnsuspend);\n\t\t} else {\n\t\t\twrappedUnsuspend();\n\t\t}\n\t};\n};\n\nSuspenseList.prototype.render = function(props) {\n\tthis._next = null;\n\tthis._map = new Map();\n\n\tconst children = toChildArray(props.children);\n\tif (props.revealOrder && props.revealOrder[0] === 'b') {\n\t\t// If order === 'backwards' (or, well, anything starting with a 'b')\n\t\t// then flip the child list around so that the last child will be\n\t\t// the first in the linked list.\n\t\tchildren.reverse();\n\t}\n\t// Build the linked list. Iterate through the children in reverse order\n\t// so that `_next` points to the first linked list node to be resolved.\n\tfor (let i = children.length; i--; ) {\n\t\t// Create a new linked list node as an array of form:\n\t\t// \t[suspended_count, resolved_count, next_node]\n\t\t// where suspended_count and resolved_count are numeric counters for\n\t\t// keeping track how many times a node has been suspended and resolved.\n\t\t//\n\t\t// Note that suspended_count starts from 1 instead of 0, so we can block\n\t\t// processing callbacks until componentDidMount has been called. In a sense\n\t\t// node is suspended at least until componentDidMount gets called!\n\t\t//\n\t\t// Pending callbacks are added to the end of the node:\n\t\t// \t[suspended_count, resolved_count, next_node, callback_0, callback_1, ...]\n\t\tthis._map.set(children[i], (this._next = [1, 0, this._next]));\n\t}\n\treturn props.children;\n};\n\nSuspenseList.prototype.componentDidUpdate = SuspenseList.prototype.componentDidMount = function() {\n\t// Iterate through all children after mounting for two reasons:\n\t// 1. As each node[SUSPENDED_COUNT] starts from 1, this iteration increases\n\t// each node[RELEASED_COUNT] by 1, therefore balancing the counters.\n\t// The nodes can now be completely consumed from the linked list.\n\t// 2. Handle nodes that might have gotten resolved between render and\n\t// componentDidMount.\n\tconst list = this;\n\tlist._map.forEach((node, child) => {\n\t\tresolve(list, child, node);\n\t});\n};\n","import { createElement, hydrate, render, _unmount } from 'preact';\n\nclass ContextProvider {\n\tgetChildContext() {\n\t\treturn this.props.context;\n\t}\n\trender(props) {\n\t\treturn props.children;\n\t}\n}\n\n/**\n * Portal component\n * @param {object | null | undefined} props\n */\nfunction Portal(props) {\n\tlet _this = this;\n\tlet container = props.container;\n\tlet wrap = createElement(\n\t\tContextProvider,\n\t\t{ context: _this.context },\n\t\tprops.vnode\n\t);\n\n\t// When we change container we should clear our old container and\n\t// indicate a new mount.\n\tif (_this._container && _this._container !== container) {\n\t\tif (_this._temp.parentNode) _this._container.removeChild(_this._temp);\n\t\t_unmount(_this._wrap);\n\t\t_this._hasMounted = false;\n\t}\n\n\t// When props.vnode is undefined/false/null we are dealing with some kind of\n\t// conditional vnode. This should not trigger a render.\n\tif (props.vnode) {\n\t\tif (!_this._hasMounted) {\n\t\t\t// Create a placeholder that we can use to insert into.\n\t\t\t_this._temp = document.createTextNode('');\n\t\t\t// Hydrate existing nodes to keep the dom intact, when rendering\n\t\t\t// wrap into the container.\n\t\t\thydrate('', container);\n\t\t\t// Append to the container (this matches React's behavior)\n\t\t\tcontainer.appendChild(_this._temp);\n\t\t\t// At this point we have mounted and should set our container.\n\t\t\t_this._hasMounted = true;\n\t\t\t_this._container = container;\n\t\t\t// Render our wrapping element into temp.\n\t\t\trender(wrap, container, _this._temp);\n\t\t\t_this._children = _this._temp._children;\n\t\t} else {\n\t\t\t// When we have mounted and the vnode is present it means the\n\t\t\t// props have changed or a parent is triggering a rerender.\n\t\t\t// This implies we only need to call render. But we need to keep\n\t\t\t// the old tree around, otherwise will treat the vnodes as new and\n\t\t\t// will wrongly call `componentDidMount` on them\n\t\t\tcontainer._children = _this._children;\n\t\t\trender(wrap, container);\n\t\t\t_this._children = container._children;\n\t\t}\n\t}\n\t// When we come from a conditional render, on a mounted\n\t// portal we should clear the DOM.\n\telse if (_this._hasMounted) {\n\t\tif (_this._temp.parentNode) _this._container.removeChild(_this._temp);\n\t\t_unmount(_this._wrap);\n\t}\n\t// Set the wrapping element for future unmounting.\n\t_this._wrap = wrap;\n\n\t_this.componentWillUnmount = () => {\n\t\tif (_this._temp.parentNode) _this._container.removeChild(_this._temp);\n\t\t_unmount(_this._wrap);\n\t};\n\n\treturn null;\n}\n\n/**\n * Create a `Portal` to continue rendering the vnode tree at a different DOM node\n * @param {import('./internal').VNode} vnode The vnode to render\n * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to.\n */\nexport function createPortal(vnode, container) {\n\treturn createElement(Portal, { vnode, container });\n}\n","/**\n * Normalize event handlers like react does. Most famously it uses `onChange` for any input element.\n * @param {import('./internal').VNode} vnode The vnode to normalize events on\n */\nexport function applyEventNormalization({ type, props }) {\n\tif (!props || typeof type != 'string') return;\n\tlet newProps = {};\n\n\tfor (let i in props) {\n\t\tif (/^on(Ani|Tra|Tou)/.test(i)) {\n\t\t\tprops[i.toLowerCase()] = props[i];\n\t\t\tdelete props[i];\n\t\t}\n\t\tnewProps[i.toLowerCase()] = i;\n\t}\n\tif (newProps.ondoubleclick) {\n\t\tprops.ondblclick = props[newProps.ondoubleclick];\n\t\tdelete props[newProps.ondoubleclick];\n\t}\n\tif (newProps.onbeforeinput) {\n\t\tprops.onbeforeinput = props[newProps.onbeforeinput];\n\t\tdelete props[newProps.onbeforeinput];\n\t}\n\t// for *textual inputs* (incl textarea), normalize `onChange` -> `onInput`:\n\tif (\n\t\tnewProps.onchange &&\n\t\t(type === 'textarea' ||\n\t\t\t(type.toLowerCase() === 'input' && !/^fil|che|ra/i.test(props.type)))\n\t) {\n\t\tlet normalized = newProps.oninput || 'oninput';\n\t\tif (!props[normalized]) {\n\t\t\tprops[normalized] = props[newProps.onchange];\n\t\t\tdelete props[newProps.onchange];\n\t\t}\n\t}\n}\n","// This is a very small application state management library.\n//\n// All it provides is a way of specifying state \"atoms\" (basically a value with\n// a setter and a way to be notified when the value updates), and a single\n// preact hook to manage the subscribe/unsubscribe process for you.\n//\n// At the moment, atoms are intended to be globally defined, but the system\n// could easily be adapted to pass down the atoms via context rather than being\n// globally available.\n//\n// To support complex data-types, you can either have simple functions that call\n// the public setter, or subclass Atom. So, for example, here are a few\n// different ways of making a list atom with convenient helpers:\n//\n// # Simple functions being passed atom\n//\n// const myListAtom = new Atom<number[]>([], \"myList\")\n// function push<T>(atom: Atom<T[]>, t: T) {\n// const next = [...atom.get(), t]\n// atom.set(next)\n// }\n// function removeLast<T>(atom: Atom<T[]>, t: T) {\n// const next = [...atom.get()]\n// next.pop()\n// atom.set(next)\n// }\n//\n//\n// # Simple functions operating on global atoms\n//\n// const myListAtom = new Atom<number[]>([], \"myLisT\")\n// function push(t: number) {\n// myListAtom.set([...myListAtom.get(), t])\n// }\n// function removeLast() {\n// const next = [...myListAtom.get()]\n// myListAtom.set(next)\n// }\n//\n//\n// # Subclassing\n//\n// class ListAtom<T> extends Atom<T[]> {\n// push(t: T) {\n// const next = [...this.state, t]\n// this.set(next)\n// }\n// removeLast() {\n// const next = [...this.state]\n// next.pop()\n// this.set(next)\n// }\n// }\n// const myListAtom = new ListAtom<number>([], \"myList\")\n//\n// This library is inspired by https://recoiljs.org/\n\nimport {useLayoutEffect, useState} from 'preact/hooks'\n\ntype AtomListener = () => void\n\nlet AtomDev: {[key: string]: Atom<any>} | null = null\nlet hotReloadStash: Map<string, any> | null = null\n\ndeclare const module: any\nif (process.env.NODE_ENV === 'development') {\n ;(window as any)['Atom'] = AtomDev = {}\n\n module.hot.dispose(() => {\n if (AtomDev) {\n hotReloadStash = new Map()\n for (let key in AtomDev) {\n hotReloadStash.set(key, AtomDev[key].get())\n }\n }\n\n ;(window as any)['Atom_hotReloadStash'] = hotReloadStash\n })\n\n hotReloadStash = (window as any)['Atom_hotReloadStash'] || null\n}\n\nexport class Atom<T> {\n private observers: AtomListener[] = []\n constructor(protected state: T, debugKey: string) {\n if (process.env.NODE_ENV === 'development') {\n if (hotReloadStash?.has(debugKey)) {\n // If we have a stored value from a previous hot reload, use that\n // instead of whatever was passed to the constructor.\n this.state = hotReloadStash.get(debugKey)\n }\n\n if (AtomDev) {\n if (debugKey in AtomDev) {\n console.warn(`[Atom] Multiple atoms tried to register with the key ${debugKey}`)\n }\n AtomDev[debugKey] = this\n }\n }\n\n // We do the bind here rather than in the definition to facilitate\n // inheritance (we want the value defined on both the prototype and the\n // instance).\n this.set = this.set.bind(this)\n this.get = this.get.bind(this)\n }\n\n set(t: T) {\n if (this.state === t) {\n // No-op if the value didn't actually change\n return\n }\n this.state = t\n this.observers.forEach(fn => fn())\n }\n\n get(): T {\n return this.state\n }\n\n subscribe(listener: AtomListener) {\n this.observers.push(listener)\n }\n\n unsubscribe(listener: AtomListener) {\n const index = this.observers.indexOf(listener)\n if (index !== -1) {\n this.observers.splice(index, 1)\n }\n }\n}\n\nexport function useAtom<T>(atom: Atom<T>): T {\n const [value, setValue] = useState(atom.get())\n\n useLayoutEffect(() => {\n // We need to setValue here because it's possible something has changed the\n // value in the store between the atom.get() call above and layout. In most\n // cases this should no-op.\n setValue(atom.get())\n\n function listener() {\n setValue(atom.get())\n }\n\n atom.subscribe(listener)\n return () => {\n atom.unsubscribe(listener)\n }\n }, [atom])\n\n return value\n}\n","export const enum ViewMode {\n CHRONO_FLAME_CHART,\n LEFT_HEAVY_FLAME_GRAPH,\n SANDWICH_VIEW,\n}\n","import {ViewMode} from '../lib/view-mode'\n\nexport interface HashParams {\n profileURL?: string\n title?: string\n localProfilePath?: string\n viewMode?: ViewMode\n}\n\nfunction getViewMode(value: string): ViewMode | null {\n switch (value) {\n case 'time-ordered':\n return ViewMode.CHRONO_FLAME_CHART\n case 'left-heavy':\n return ViewMode.LEFT_HEAVY_FLAME_GRAPH\n case 'sandwich':\n return ViewMode.SANDWICH_VIEW\n default:\n return null\n }\n}\n\nexport function getHashParams(hashContents = window.location.hash): HashParams {\n try {\n if (!hashContents.startsWith('#')) {\n return {}\n }\n const components = hashContents.substr(1).split('&')\n const result: HashParams = {}\n for (const component of components) {\n let [key, value] = component.split('=')\n value = decodeURIComponent(value)\n if (key === 'profileURL') {\n result.profileURL = value\n } else if (key === 'title') {\n result.title = value\n } else if (key === 'localProfilePath') {\n result.localProfilePath = value\n } else if (key === 'view') {\n const mode = getViewMode(value)\n if (mode !== null) {\n result.viewMode = mode\n } else {\n console.error(`Ignoring invalid view specifier: ${value}`)\n }\n }\n }\n return result\n } catch (e) {\n console.error(`Error when loading hash fragment.`)\n console.error(e)\n return {}\n }\n}\n","import {Atom} from '../lib/atom'\nimport {clamp, Rect, Vec2} from '../lib/math'\nimport {CallTreeNode, Frame, Profile, ProfileGroup} from '../lib/profile'\nimport {objectsHaveShallowEquality} from '../lib/utils'\n\nexport interface FlamechartViewState {\n hover: {\n node: CallTreeNode\n event: MouseEvent\n } | null\n selectedNode: CallTreeNode | null\n logicalSpaceViewportSize: Vec2\n configSpaceViewportRect: Rect\n}\n\nexport interface CallerCalleeState {\n selectedFrame: Frame\n invertedCallerFlamegraph: FlamechartViewState\n calleeFlamegraph: FlamechartViewState\n}\n\nexport interface SandwichViewState {\n callerCallee: CallerCalleeState | null\n}\n\nexport interface ProfileState {\n profile: Profile\n chronoViewState: FlamechartViewState\n leftHeavyViewState: FlamechartViewState\n sandwichViewState: SandwichViewState\n}\n\nexport type ProfileGroupState = {\n name: string\n\n // The index within the list of profiles currently being viewed\n indexToView: number\n\n profiles: ProfileState[]\n} | null\n\nexport enum FlamechartID {\n LEFT_HEAVY = 'LEFT_HEAVY',\n CHRONO = 'CHRONO',\n SANDWICH_INVERTED_CALLERS = 'SANDWICH_INVERTED_CALLERS',\n SANDWICH_CALLEES = 'SANDWICH_CALLEES',\n}\n\nlet initialFlameChartViewState: FlamechartViewState = {\n hover: null,\n selectedNode: null,\n configSpaceViewportRect: Rect.empty,\n logicalSpaceViewportSize: Vec2.zero,\n}\n\nexport class ProfileGroupAtom extends Atom<ProfileGroupState> {\n set(newState: ProfileGroupState) {\n const oldState = this.state\n if (oldState != null && newState != null && objectsHaveShallowEquality(oldState, newState)) {\n return\n }\n super.set(newState)\n }\n\n getActiveProfile(): ProfileState | null {\n if (this.state == null) return null\n return this.state.profiles[this.state?.indexToView] || null\n }\n\n setProfileGroup = (group: ProfileGroup) => {\n this.set({\n name: group.name,\n indexToView: group.indexToView,\n profiles: group.profiles.map(p => ({\n profile: p,\n chronoViewState: initialFlameChartViewState,\n leftHeavyViewState: initialFlameChartViewState,\n sandwichViewState: {callerCallee: null},\n })),\n })\n }\n\n setProfileIndexToView = (indexToView: number) => {\n if (this.state == null) return\n\n indexToView = clamp(indexToView, 0, this.state.profiles.length - 1)\n\n this.set({\n ...this.state,\n indexToView,\n })\n }\n\n private updateActiveProfileState(fn: (profileState: ProfileState) => ProfileState) {\n if (this.state == null) return\n const {indexToView, profiles} = this.state\n this.set({\n ...this.state,\n profiles: profiles.map((p, i) => {\n if (i != indexToView) return p\n return fn(p)\n }),\n })\n }\n\n private updateActiveSandwichViewState(\n fn: (sandwichViewState: SandwichViewState) => SandwichViewState,\n ) {\n this.updateActiveProfileState(p => ({\n ...p,\n sandwichViewState: fn(p.sandwichViewState),\n }))\n }\n\n setSelectedFrame = (frame: Frame | null) => {\n if (this.state == null) return\n\n const profile = this.getActiveProfile()\n if (profile == null) {\n return\n }\n\n this.updateActiveSandwichViewState(sandwichViewState => {\n if (frame == null) {\n return {callerCallee: null}\n }\n return {\n callerCallee: {\n invertedCallerFlamegraph: initialFlameChartViewState,\n calleeFlamegraph: initialFlameChartViewState,\n selectedFrame: frame,\n },\n }\n })\n }\n\n private updateFlamechartState(\n id: FlamechartID,\n fn: (flamechartViewState: FlamechartViewState) => FlamechartViewState,\n ) {\n switch (id) {\n case FlamechartID.CHRONO: {\n this.updateActiveProfileState(p => ({\n ...p,\n chronoViewState: fn(p.chronoViewState),\n }))\n break\n }\n\n case FlamechartID.LEFT_HEAVY: {\n this.updateActiveProfileState(p => ({\n ...p,\n leftHeavyViewState: fn(p.leftHeavyViewState),\n }))\n break\n }\n\n case FlamechartID.SANDWICH_CALLEES: {\n this.updateActiveSandwichViewState(s => ({\n ...s,\n callerCallee:\n s.callerCallee == null\n ? null\n : {\n ...s.callerCallee,\n calleeFlamegraph: fn(s.callerCallee.calleeFlamegraph),\n },\n }))\n break\n }\n\n case FlamechartID.SANDWICH_INVERTED_CALLERS: {\n this.updateActiveSandwichViewState(s => ({\n ...s,\n callerCallee:\n s.callerCallee == null\n ? null\n : {\n ...s.callerCallee,\n invertedCallerFlamegraph: fn(s.callerCallee.invertedCallerFlamegraph),\n },\n }))\n break\n }\n }\n }\n\n setFlamechartHoveredNode(\n id: FlamechartID,\n hover: {node: CallTreeNode; event: MouseEvent} | null,\n ) {\n this.updateFlamechartState(id, f => ({\n ...f,\n hover,\n }))\n }\n\n setSelectedNode(id: FlamechartID, selectedNode: CallTreeNode | null) {\n this.updateFlamechartState(id, f => ({\n ...f,\n selectedNode,\n }))\n }\n\n setConfigSpaceViewportRect(id: FlamechartID, configSpaceViewportRect: Rect) {\n this.updateFlamechartState(id, f => ({\n ...f,\n configSpaceViewportRect,\n }))\n }\n\n setLogicalSpaceViewportSize(id: FlamechartID, logicalSpaceViewportSize: Vec2) {\n this.updateFlamechartState(id, f => ({\n ...f,\n logicalSpaceViewportSize,\n }))\n }\n\n clearHoverNode() {\n // TODO(jlfwong): This causes 4 separate observer events. This is probably\n // fine, since I hope that Preact/React are smart about batching re-renders?\n this.setFlamechartHoveredNode(FlamechartID.CHRONO, null)\n this.setFlamechartHoveredNode(FlamechartID.LEFT_HEAVY, null)\n this.setFlamechartHoveredNode(FlamechartID.SANDWICH_CALLEES, null)\n this.setFlamechartHoveredNode(FlamechartID.SANDWICH_INVERTED_CALLERS, null)\n }\n}\n","import {Atom} from '../lib/atom'\nimport {ViewMode} from '../lib/view-mode'\nimport {getHashParams, HashParams} from '../lib/hash-params'\nimport {ProfileGroupAtom} from './profile-group'\n\n// True if recursion should be flattened when viewing flamegraphs\nexport const flattenRecursionAtom = new Atom<boolean>(false, 'flattenRecursion')\n\n// The query used in top-level views\n//\n// An empty string indicates that the search is open by no filter is applied.\n// searchIsActive is stored separately, because we may choose to persist the\n// query even when the search input is closed.\nexport const searchIsActiveAtom = new Atom<boolean>(false, 'searchIsActive')\nexport const searchQueryAtom = new Atom<string>('', 'searchQueryAtom')\n\n// Which top-level view should be displayed\nexport const viewModeAtom = new Atom<ViewMode>(ViewMode.CHRONO_FLAME_CHART, 'viewMode')\n\n// The top-level profile group from which most other data will be derived\nexport const profileGroupAtom = new ProfileGroupAtom(null, 'profileGroup')\n\nviewModeAtom.subscribe(() => {\n // If we switch views, the hover information is no longer relevant\n profileGroupAtom.clearHoverNode()\n})\n\n// Parameters defined by the URL encoded k=v pairs after the # in the URL\nconst hashParams = getHashParams()\nexport const hashParamsAtom = new Atom<HashParams>(hashParams, 'hashParams')\n\n// The <canvas> element used for WebGL\nexport const glCanvasAtom = new Atom<HTMLCanvasElement | null>(null, 'glCanvas')\n\n// True when a file drag is currently active. Used to indicate that the\n// application is a valid drop target.\nexport const dragActiveAtom = new Atom<boolean>(false, 'dragActive')\n\n// True when the application is currently in a loading state. Used to\n// display a loading progress bar.\n\n// Speedscope is usable both from a local HTML file being served\n// from a file:// URL, and via websites. In the case of file:// URLs,\n// however, XHR will be unavailable to fetching files in adjacent directories.\nconst protocol = window.location.protocol\nexport const canUseXHR = protocol === 'http:' || protocol === 'https:'\nconst isImmediatelyLoading = canUseXHR && hashParams.profileURL != null\nexport const loadingAtom = new Atom<boolean>(isImmediatelyLoading, 'loading')\n\n// True when the application is an error state, e.g. because the profile\n// imported was invalid.\nexport const errorAtom = new Atom<boolean>(false, 'error')\n\nexport enum SortField {\n SYMBOL_NAME,\n SELF,\n TOTAL,\n}\n\nexport enum SortDirection {\n ASCENDING,\n DESCENDING,\n}\n\nexport interface SortMethod {\n field: SortField\n direction: SortDirection\n}\n\n// The table sorting method using for the sandwich view, specifying the column\n// to sort by, and the direction to sort that clumn.\nexport const tableSortMethodAtom = new Atom<SortMethod>(\n {\n field: SortField.SELF,\n direction: SortDirection.DESCENDING,\n },\n 'tableSortMethod',\n)\n","import {Profile} from '../lib/profile'\nimport {getProfileToView} from './getters'\nimport {flattenRecursionAtom, profileGroupAtom} from '.'\nimport {FlamechartViewState, SandwichViewState} from './profile-group'\nimport {useAtom} from '../lib/atom'\n\nexport interface ApplicationState {}\n\nexport interface ActiveProfileState {\n profile: Profile\n index: number\n chronoViewState: FlamechartViewState\n leftHeavyViewState: FlamechartViewState\n sandwichViewState: SandwichViewState\n}\n\nexport function useActiveProfileState(): ActiveProfileState | null {\n const flattenRecursion = useAtom(flattenRecursionAtom)\n const profileGroupState = useAtom(profileGroupAtom)\n\n if (!profileGroupState) return null\n if (profileGroupState.indexToView >= profileGroupState.profiles.length) return null\n\n const index = profileGroupState.indexToView\n const profileState = profileGroupState.profiles[index]\n return {\n ...profileGroupState.profiles[profileGroupState.indexToView],\n profile: getProfileToView({\n profile: profileState.profile,\n flattenRecursion,\n }),\n index: profileGroupState.indexToView,\n }\n}\n","import {Atom} from '../lib/atom'\n\nexport const enum ColorScheme {\n // Default: respect prefers-color-schema\n SYSTEM,\n\n // Use dark theme\n DARK,\n\n // use light theme\n LIGHT,\n}\n\nconst localStorageKey = 'speedscope-color-scheme'\n\nfunction getStoredPreference(): ColorScheme {\n const storedPreference = window.localStorage && window.localStorage[localStorageKey]\n if (storedPreference === 'DARK') {\n return ColorScheme.DARK\n } else if (storedPreference === 'LIGHT') {\n return ColorScheme.LIGHT\n } else {\n return ColorScheme.SYSTEM\n }\n}\n\nfunction matchMediaDarkColorScheme(): MediaQueryList {\n return matchMedia('(prefers-color-scheme: dark)')\n}\n\nfunction nextColorScheme(scheme: ColorScheme): ColorScheme {\n const systemPrefersDarkMode = matchMediaDarkColorScheme().matches\n\n // We'll use a different cycling order for changing the color scheme depending\n // on what the *current* system preference is. This should guarantee that when\n // a user interacts with the color scheme toggle for the first time, it always\n // changes the color scheme.\n if (systemPrefersDarkMode) {\n switch (scheme) {\n case ColorScheme.SYSTEM: {\n return ColorScheme.LIGHT\n }\n case ColorScheme.LIGHT: {\n return ColorScheme.DARK\n }\n case ColorScheme.DARK: {\n return ColorScheme.SYSTEM\n }\n }\n } else {\n switch (scheme) {\n case ColorScheme.SYSTEM: {\n return ColorScheme.DARK\n }\n case ColorScheme.DARK: {\n return ColorScheme.LIGHT\n }\n case ColorScheme.LIGHT: {\n return ColorScheme.SYSTEM\n }\n }\n }\n}\n\nclass ColorSchemeAtom extends Atom<ColorScheme> {\n cycleToNextColorScheme = () => {\n this.set(nextColorScheme(this.get()))\n }\n}\n\nexport const colorSchemeAtom = new ColorSchemeAtom(getStoredPreference(), 'colorScheme')\n\ncolorSchemeAtom.subscribe(() => {\n const value = colorSchemeAtom.get()\n\n switch (value) {\n case ColorScheme.DARK: {\n window.localStorage[localStorageKey] = 'DARK'\n break\n }\n case ColorScheme.LIGHT: {\n window.localStorage[localStorageKey] = 'LIGHT'\n break\n }\n case ColorScheme.SYSTEM: {\n delete window.localStorage[localStorageKey]\n break\n }\n default: {\n const _exhaustiveCheck: never = value\n return _exhaustiveCheck\n }\n }\n return value\n})\n","import {Color} from '../../lib/color'\nimport {triangle} from '../../lib/utils'\nimport {Theme} from './theme'\n\n// These colors are intentionally not exported from this file, because these\n// colors are theme specific, and we want all color values to come from the\n// active theme.\nenum Colors {\n LIGHTER_GRAY = '#D0D0D0',\n LIGHT_GRAY = '#BDBDBD',\n GRAY = '#666666',\n DARK_GRAY = '#222222',\n DARKER_GRAY = '#0C0C0C',\n OFF_BLACK = '#060606',\n BLACK = '#000000',\n BLUE = '#00769B',\n PALE_BLUE = '#004E75',\n GREEN = '#0F8A42',\n LIGHT_BROWN = '#D6AE24',\n BROWN = '#A66F1C',\n}\n\nconst C_0 = 0.2\nconst C_d = 0.1\nconst L_0 = 0.2\nconst L_d = 0.1\n\nconst colorForBucket = (t: number) => {\n const x = triangle(30.0 * t)\n const H = 360.0 * (0.9 * t)\n const C = C_0 + C_d * x\n const L = L_0 - L_d * x\n return Color.fromLumaChromaHue(L, C, H)\n}\nconst colorForBucketGLSL = `\n vec3 colorForBucket(float t) {\n float x = triangle(30.0 * t);\n float H = 360.0 * (0.9 * t);\n float C = ${C_0.toFixed(1)} + ${C_d.toFixed(1)} * x;\n float L = ${L_0.toFixed(1)} - ${L_d.toFixed(1)} * x;\n return hcl2rgb(H, C, L);\n }\n`\n\nexport const darkTheme: Theme = {\n fgPrimaryColor: Colors.LIGHTER_GRAY,\n fgSecondaryColor: Colors.GRAY,\n\n bgPrimaryColor: Colors.OFF_BLACK,\n bgSecondaryColor: Colors.DARKER_GRAY,\n\n altFgPrimaryColor: Colors.LIGHTER_GRAY,\n altFgSecondaryColor: Colors.GRAY,\n\n altBgPrimaryColor: Colors.BLACK,\n altBgSecondaryColor: Colors.DARKER_GRAY,\n\n selectionPrimaryColor: Colors.BLUE,\n selectionSecondaryColor: Colors.PALE_BLUE,\n\n weightColor: Colors.GREEN,\n\n searchMatchTextColor: Colors.DARKER_GRAY,\n searchMatchPrimaryColor: Colors.BROWN,\n searchMatchSecondaryColor: Colors.LIGHT_BROWN,\n\n colorForBucket,\n colorForBucketGLSL,\n}\n","import {Color} from '../../lib/color'\nimport {triangle} from '../../lib/utils'\nimport {Theme} from './theme'\n\n// These colors are intentionally not exported from this file, because these\n// colors are theme specific, and we want all color values to come from the\n// active theme.\nenum Colors {\n WHITE = '#FFFFFF',\n OFF_WHITE = '#F6F6F6',\n LIGHT_GRAY = '#BDBDBD',\n GRAY = '#666666',\n DARK_GRAY = '#222222',\n OFF_BLACK = '#111111',\n BLACK = '#000000',\n DARK_BLUE = '#2F80ED',\n PALE_DARK_BLUE = '#8EB7ED',\n GREEN = '#6FCF97',\n YELLOW = '#FEDC62',\n ORANGE = '#FFAC02',\n}\n\nconst C_0 = 0.25\nconst C_d = 0.2\nconst L_0 = 0.8\nconst L_d = 0.15\n\nconst colorForBucket = (t: number) => {\n const x = triangle(30.0 * t)\n const H = 360.0 * (0.9 * t)\n const C = C_0 + C_d * x\n const L = L_0 - L_d * x\n return Color.fromLumaChromaHue(L, C, H)\n}\nconst colorForBucketGLSL = `\n vec3 colorForBucket(float t) {\n float x = triangle(30.0 * t);\n float H = 360.0 * (0.9 * t);\n float C = ${C_0.toFixed(1)} + ${C_d.toFixed(1)} * x;\n float L = ${L_0.toFixed(1)} - ${L_d.toFixed(1)} * x;\n return hcl2rgb(H, C, L);\n }\n`\n\nexport const lightTheme: Theme = {\n fgPrimaryColor: Colors.BLACK,\n fgSecondaryColor: Colors.LIGHT_GRAY,\n\n bgPrimaryColor: Colors.WHITE,\n bgSecondaryColor: Colors.OFF_WHITE,\n\n altFgPrimaryColor: Colors.WHITE,\n altFgSecondaryColor: Colors.LIGHT_GRAY,\n\n altBgPrimaryColor: Colors.BLACK,\n altBgSecondaryColor: Colors.DARK_GRAY,\n\n selectionPrimaryColor: Colors.DARK_BLUE,\n selectionSecondaryColor: Colors.PALE_DARK_BLUE,\n\n weightColor: Colors.GREEN,\n\n searchMatchTextColor: Colors.BLACK,\n searchMatchPrimaryColor: Colors.ORANGE,\n searchMatchSecondaryColor: Colors.YELLOW,\n\n colorForBucket,\n colorForBucketGLSL,\n}\n","import {h, ComponentChildren, createContext} from 'preact'\nimport {useCallback, useContext, useEffect, useState} from 'preact/hooks'\nimport {ColorScheme, colorSchemeAtom} from '../../app-state/color-scheme'\nimport {useAtom} from '../../lib/atom'\nimport {Color} from '../../lib/color'\nimport {memoizeByReference} from '../../lib/utils'\nimport {darkTheme} from './dark-theme'\nimport {lightTheme} from './light-theme'\n\nexport interface Theme {\n fgPrimaryColor: string\n fgSecondaryColor: string\n bgPrimaryColor: string\n bgSecondaryColor: string\n\n altFgPrimaryColor: string\n altFgSecondaryColor: string\n altBgPrimaryColor: string\n altBgSecondaryColor: string\n\n selectionPrimaryColor: string\n selectionSecondaryColor: string\n\n weightColor: string\n\n searchMatchTextColor: string\n searchMatchPrimaryColor: string\n searchMatchSecondaryColor: string\n\n colorForBucket: (t: number) => Color\n colorForBucketGLSL: string\n}\n\nexport const ThemeContext = createContext<Theme>(lightTheme)\n\nexport function useTheme(): Theme {\n return useContext(ThemeContext)\n}\n\nexport function withTheme<T>(cb: (theme: Theme) => T) {\n return memoizeByReference(cb)\n}\n\nfunction matchMediaDarkColorScheme(): MediaQueryList {\n return matchMedia('(prefers-color-scheme: dark)')\n}\n\nexport function colorSchemeToString(scheme: ColorScheme): string {\n switch (scheme) {\n case ColorScheme.SYSTEM: {\n return 'System'\n }\n case ColorScheme.DARK: {\n return 'Dark'\n }\n case ColorScheme.LIGHT: {\n return 'Light'\n }\n }\n}\n\nfunction getTheme(colorScheme: ColorScheme, systemPrefersDarkMode: boolean) {\n switch (colorScheme) {\n case ColorScheme.SYSTEM: {\n return systemPrefersDarkMode ? darkTheme : lightTheme\n }\n case ColorScheme.DARK: {\n return darkTheme\n }\n case ColorScheme.LIGHT: {\n return lightTheme\n }\n }\n}\n\nexport function ThemeProvider(props: {children: ComponentChildren}) {\n const [systemPrefersDarkMode, setSystemPrefersDarkMode] = useState(\n () => matchMediaDarkColorScheme().matches,\n )\n\n const matchMediaListener = useCallback(\n (event: MediaQueryListEvent) => {\n setSystemPrefersDarkMode(event.matches)\n },\n [setSystemPrefersDarkMode],\n )\n\n useEffect(() => {\n const media = matchMediaDarkColorScheme()\n media.addEventListener('change', matchMediaListener)\n return () => {\n media.removeEventListener('change', matchMediaListener)\n }\n }, [matchMediaListener])\n\n const colorScheme = useAtom(colorSchemeAtom)\n const theme = getTheme(colorScheme, systemPrefersDarkMode)\n return <ThemeContext.Provider value={theme} children={props.children} />\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isPrefixedValue;\nvar regex = /-webkit-|-moz-|-ms-/;\n\nfunction isPrefixedValue(value) {\n return typeof value === 'string' && regex.test(value);\n}\nmodule.exports = exports['default'];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = calc;\n\nvar _isPrefixedValue = require(\"css-in-js-utils/lib/isPrefixedValue\");\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar prefixes = [\"-webkit-\", \"-moz-\", \"\"];\nfunction calc(property, value) {\n if (typeof value === \"string\" && !(0, _isPrefixedValue2.default)(value) && value.indexOf(\"calc(\") > -1) {\n return prefixes.map(function (prefix) {\n return value.replace(/calc\\(/g, prefix + \"calc(\");\n });\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = crossFade;\n\nvar _isPrefixedValue = require(\"css-in-js-utils/lib/isPrefixedValue\");\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// http://caniuse.com/#search=cross-fade\nvar prefixes = [\"-webkit-\", \"\"];\nfunction crossFade(property, value) {\n if (typeof value === \"string\" && !(0, _isPrefixedValue2.default)(value) && value.indexOf(\"cross-fade(\") > -1) {\n return prefixes.map(function (prefix) {\n return value.replace(/cross-fade\\(/g, prefix + \"cross-fade(\");\n });\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = cursor;\nvar prefixes = [\"-webkit-\", \"-moz-\", \"\"];\n\nvar values = {\n \"zoom-in\": true,\n \"zoom-out\": true,\n grab: true,\n grabbing: true\n};\n\nfunction cursor(property, value) {\n if (property === \"cursor\" && values.hasOwnProperty(value)) {\n return prefixes.map(function (prefix) {\n return prefix + value;\n });\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = filter;\n\nvar _isPrefixedValue = require(\"css-in-js-utils/lib/isPrefixedValue\");\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// http://caniuse.com/#feat=css-filter-function\nvar prefixes = [\"-webkit-\", \"\"];\nfunction filter(property, value) {\n if (typeof value === \"string\" && !(0, _isPrefixedValue2.default)(value) && value.indexOf(\"filter(\") > -1) {\n return prefixes.map(function (prefix) {\n return value.replace(/filter\\(/g, prefix + \"filter(\");\n });\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = flex;\nvar values = {\n flex: [\"-webkit-box\", \"-moz-box\", \"-ms-flexbox\", \"-webkit-flex\", \"flex\"],\n \"inline-flex\": [\"-webkit-inline-box\", \"-moz-inline-box\", \"-ms-inline-flexbox\", \"-webkit-inline-flex\", \"inline-flex\"]\n};\n\nfunction flex(property, value) {\n if (property === \"display\" && values.hasOwnProperty(value)) {\n return values[value];\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = flexboxIE;\nvar alternativeValues = {\n \"space-around\": \"distribute\",\n \"space-between\": \"justify\",\n \"flex-start\": \"start\",\n \"flex-end\": \"end\"\n};\nvar alternativeProps = {\n alignContent: \"msFlexLinePack\",\n alignSelf: \"msFlexItemAlign\",\n alignItems: \"msFlexAlign\",\n justifyContent: \"msFlexPack\",\n order: \"msFlexOrder\",\n flexGrow: \"msFlexPositive\",\n flexShrink: \"msFlexNegative\",\n flexBasis: \"msFlexPreferredSize\"\n};\n\nfunction flexboxIE(property, value, style) {\n if (alternativeProps.hasOwnProperty(property)) {\n style[alternativeProps[property]] = alternativeValues[value] || value;\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = flexboxOld;\nvar alternativeValues = {\n \"space-around\": \"justify\",\n \"space-between\": \"justify\",\n \"flex-start\": \"start\",\n \"flex-end\": \"end\",\n \"wrap-reverse\": \"multiple\",\n wrap: \"multiple\"\n};\n\nvar alternativeProps = {\n alignItems: \"WebkitBoxAlign\",\n justifyContent: \"WebkitBoxPack\",\n flexWrap: \"WebkitBoxLines\"\n};\n\nfunction flexboxOld(property, value, style) {\n if (property === \"flexDirection\" && typeof value === \"string\") {\n if (value.indexOf(\"column\") > -1) {\n style.WebkitBoxOrient = \"vertical\";\n } else {\n style.WebkitBoxOrient = \"horizontal\";\n }\n if (value.indexOf(\"reverse\") > -1) {\n style.WebkitBoxDirection = \"reverse\";\n } else {\n style.WebkitBoxDirection = \"normal\";\n }\n }\n if (alternativeProps.hasOwnProperty(property)) {\n style[alternativeProps[property]] = alternativeValues[value] || value;\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = gradient;\n\nvar _isPrefixedValue = require(\"css-in-js-utils/lib/isPrefixedValue\");\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar prefixes = [\"-webkit-\", \"-moz-\", \"\"];\n\nvar values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;\n\nfunction gradient(property, value) {\n if (typeof value === \"string\" && !(0, _isPrefixedValue2.default)(value) && values.test(value)) {\n return prefixes.map(function (prefix) {\n return prefix + value;\n });\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = imageSet;\n\nvar _isPrefixedValue = require(\"css-in-js-utils/lib/isPrefixedValue\");\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// http://caniuse.com/#feat=css-image-set\nvar prefixes = [\"-webkit-\", \"\"];\nfunction imageSet(property, value) {\n if (typeof value === \"string\" && !(0, _isPrefixedValue2.default)(value) && value.indexOf(\"image-set(\") > -1) {\n return prefixes.map(function (prefix) {\n return value.replace(/image-set\\(/g, prefix + \"image-set(\");\n });\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = position;\nfunction position(property, value) {\n if (property === \"position\" && value === \"sticky\") {\n return [\"-webkit-sticky\", \"sticky\"];\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = sizing;\nvar prefixes = [\"-webkit-\", \"-moz-\", \"\"];\n\nvar properties = {\n maxHeight: true,\n maxWidth: true,\n width: true,\n height: true,\n columnWidth: true,\n minWidth: true,\n minHeight: true\n};\nvar values = {\n \"min-content\": true,\n \"max-content\": true,\n \"fill-available\": true,\n \"fit-content\": true,\n \"contain-floats\": true\n};\n\nfunction sizing(property, value) {\n if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) {\n return prefixes.map(function (prefix) {\n return prefix + value;\n });\n }\n}\nmodule.exports = exports[\"default\"];","'use strict';\n\nvar uppercasePattern = /[A-Z]/g;\nvar msPattern = /^ms-/;\nvar cache = {};\n\nfunction hyphenateStyleName(string) {\n return string in cache\n ? cache[string]\n : cache[string] = string\n .replace(uppercasePattern, '-$&')\n .toLowerCase()\n .replace(msPattern, '-ms-');\n}\n\nmodule.exports = hyphenateStyleName;\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = hyphenateProperty;\n\nvar _hyphenateStyleName = require('hyphenate-style-name');\n\nvar _hyphenateStyleName2 = _interopRequireDefault(_hyphenateStyleName);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction hyphenateProperty(property) {\n return (0, _hyphenateStyleName2.default)(property);\n}\nmodule.exports = exports['default'];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = capitalizeString;\nfunction capitalizeString(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = transition;\n\nvar _hyphenateProperty = require(\"css-in-js-utils/lib/hyphenateProperty\");\n\nvar _hyphenateProperty2 = _interopRequireDefault(_hyphenateProperty);\n\nvar _isPrefixedValue = require(\"css-in-js-utils/lib/isPrefixedValue\");\n\nvar _isPrefixedValue2 = _interopRequireDefault(_isPrefixedValue);\n\nvar _capitalizeString = require(\"../../utils/capitalizeString\");\n\nvar _capitalizeString2 = _interopRequireDefault(_capitalizeString);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar properties = {\n transition: true,\n transitionProperty: true,\n WebkitTransition: true,\n WebkitTransitionProperty: true,\n MozTransition: true,\n MozTransitionProperty: true\n};\n\n\nvar prefixMapping = {\n Webkit: \"-webkit-\",\n Moz: \"-moz-\",\n ms: \"-ms-\"\n};\n\nfunction prefixValue(value, propertyPrefixMap) {\n if ((0, _isPrefixedValue2.default)(value)) {\n return value;\n }\n\n // only split multi values, not cubic beziers\n var multipleValues = value.split(/,(?![^()]*(?:\\([^()]*\\))?\\))/g);\n\n for (var i = 0, len = multipleValues.length; i < len; ++i) {\n var singleValue = multipleValues[i];\n var values = [singleValue];\n for (var property in propertyPrefixMap) {\n var dashCaseProperty = (0, _hyphenateProperty2.default)(property);\n\n if (singleValue.indexOf(dashCaseProperty) > -1 && dashCaseProperty !== \"order\") {\n var prefixes = propertyPrefixMap[property];\n for (var j = 0, pLen = prefixes.length; j < pLen; ++j) {\n // join all prefixes and create a new value\n values.unshift(singleValue.replace(dashCaseProperty, prefixMapping[prefixes[j]] + dashCaseProperty));\n }\n }\n }\n\n multipleValues[i] = values.join(\",\");\n }\n\n return multipleValues.join(\",\");\n}\n\nfunction transition(property, value, style, propertyPrefixMap) {\n // also check for already prefixed transitions\n if (typeof value === \"string\" && properties.hasOwnProperty(property)) {\n var outputValue = prefixValue(value, propertyPrefixMap);\n // if the property is already prefixed\n var webkitOutput = outputValue.split(/,(?![^()]*(?:\\([^()]*\\))?\\))/g).filter(function (val) {\n return !/-moz-|-ms-/.test(val);\n }).join(\",\");\n\n if (property.indexOf(\"Webkit\") > -1) {\n return webkitOutput;\n }\n\n var mozOutput = outputValue.split(/,(?![^()]*(?:\\([^()]*\\))?\\))/g).filter(function (val) {\n return !/-webkit-|-ms-/.test(val);\n }).join(\",\");\n\n if (property.indexOf(\"Moz\") > -1) {\n return mozOutput;\n }\n\n style[\"Webkit\" + (0, _capitalizeString2.default)(property)] = webkitOutput;\n style[\"Moz\" + (0, _capitalizeString2.default)(property)] = mozOutput;\n return outputValue;\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nfunction hash(str) {\n var hash = 5381,\n i = str.length;\n\n while(i) {\n hash = (hash * 33) ^ str.charCodeAt(--i);\n }\n\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return hash >>> 0;\n}\n\nmodule.exports = hash;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = prefixProperty;\n\nvar _capitalizeString = require(\"./capitalizeString\");\n\nvar _capitalizeString2 = _interopRequireDefault(_capitalizeString);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction prefixProperty(prefixProperties, property, style) {\n if (prefixProperties.hasOwnProperty(property)) {\n var newStyle = {};\n var requiredPrefixes = prefixProperties[property];\n var capitalizedProperty = (0, _capitalizeString2.default)(property);\n var keys = Object.keys(style);\n for (var i = 0; i < keys.length; i++) {\n var styleProperty = keys[i];\n if (styleProperty === property) {\n for (var j = 0; j < requiredPrefixes.length; j++) {\n newStyle[requiredPrefixes[j] + capitalizedProperty] = style[property];\n }\n }\n newStyle[styleProperty] = style[styleProperty];\n }\n return newStyle;\n }\n return style;\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = prefixValue;\nfunction prefixValue(plugins, property, value, style, metaData) {\n for (var i = 0, len = plugins.length; i < len; ++i) {\n var processedValue = plugins[i](property, value, style, metaData);\n\n // we can stop processing if a value is returned\n // as all plugin criteria are unique\n if (processedValue) {\n return processedValue;\n }\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = addNewValuesOnly;\nfunction addIfNew(list, value) {\n if (list.indexOf(value) === -1) {\n list.push(value);\n }\n}\n\nfunction addNewValuesOnly(list, values) {\n if (Array.isArray(values)) {\n for (var i = 0, len = values.length; i < len; ++i) {\n addIfNew(list, values[i]);\n }\n } else {\n addIfNew(list, values);\n }\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = isObject;\nfunction isObject(value) {\n return value instanceof Object && !Array.isArray(value);\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createPrefixer;\n\nvar _prefixProperty = require(\"../utils/prefixProperty\");\n\nvar _prefixProperty2 = _interopRequireDefault(_prefixProperty);\n\nvar _prefixValue = require(\"../utils/prefixValue\");\n\nvar _prefixValue2 = _interopRequireDefault(_prefixValue);\n\nvar _addNewValuesOnly = require(\"../utils/addNewValuesOnly\");\n\nvar _addNewValuesOnly2 = _interopRequireDefault(_addNewValuesOnly);\n\nvar _isObject = require(\"../utils/isObject\");\n\nvar _isObject2 = _interopRequireDefault(_isObject);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createPrefixer(_ref) {\n var prefixMap = _ref.prefixMap,\n plugins = _ref.plugins;\n\n function prefixAll(style) {\n for (var property in style) {\n var value = style[property];\n\n // handle nested objects\n if ((0, _isObject2.default)(value)) {\n style[property] = prefixAll(value);\n // handle array values\n } else if (Array.isArray(value)) {\n var combinedValue = [];\n\n for (var i = 0, len = value.length; i < len; ++i) {\n var processedValue = (0, _prefixValue2.default)(plugins, property, value[i], style, prefixMap);\n (0, _addNewValuesOnly2.default)(combinedValue, processedValue || value[i]);\n }\n\n // only modify the value if it was touched\n // by any plugin to prevent unnecessary mutations\n if (combinedValue.length > 0) {\n style[property] = combinedValue;\n }\n } else {\n var _processedValue = (0, _prefixValue2.default)(plugins, property, value, style, prefixMap);\n\n // only modify the value if it was touched\n // by any plugin to prevent unnecessary mutations\n if (_processedValue) {\n style[property] = _processedValue;\n }\n\n style = (0, _prefixProperty2.default)(prefixMap, property, style);\n }\n }\n\n return style;\n }\n\n return prefixAll;\n}\nmodule.exports = exports[\"default\"];","\"use strict\";\n\n// Use the fastest means possible to execute a task in its own turn, with\n// priority over other events including IO, animation, reflow, and redraw\n// events in browsers.\n//\n// An exception thrown by a task will permanently interrupt the processing of\n// subsequent tasks. The higher level `asap` function ensures that if an\n// exception is thrown by a task, that the task queue will continue flushing as\n// soon as possible, but if you use `rawAsap` directly, you are responsible to\n// either ensure that no exceptions are thrown from your task, or to manually\n// call `rawAsap.requestFlush` if an exception is thrown.\nmodule.exports = rawAsap;\nfunction rawAsap(task) {\n if (!queue.length) {\n requestFlush();\n flushing = true;\n }\n // Equivalent to push, but avoids a function call.\n queue[queue.length] = task;\n}\n\nvar queue = [];\n// Once a flush has been requested, no further calls to `requestFlush` are\n// necessary until the next `flush` completes.\nvar flushing = false;\n// `requestFlush` is an implementation-specific method that attempts to kick\n// off a `flush` event as quickly as possible. `flush` will attempt to exhaust\n// the event queue before yielding to the browser's own event loop.\nvar requestFlush;\n// The position of the next task to execute in the task queue. This is\n// preserved between calls to `flush` so that it can be resumed if\n// a task throws an exception.\nvar index = 0;\n// If a task schedules additional tasks recursively, the task queue can grow\n// unbounded. To prevent memory exhaustion, the task queue will periodically\n// truncate already-completed tasks.\nvar capacity = 1024;\n\n// The flush function processes all tasks that have been scheduled with\n// `rawAsap` unless and until one of those tasks throws an exception.\n// If a task throws an exception, `flush` ensures that its state will remain\n// consistent and will resume where it left off when called again.\n// However, `flush` does not make any arrangements to be called again if an\n// exception is thrown.\nfunction flush() {\n while (index < queue.length) {\n var currentIndex = index;\n // Advance the index before calling the task. This ensures that we will\n // begin flushing on the next task the task throws an error.\n index = index + 1;\n queue[currentIndex].call();\n // Prevent leaking memory for long chains of recursive calls to `asap`.\n // If we call `asap` within tasks scheduled by `asap`, the queue will\n // grow, but to avoid an O(n) walk for every task we execute, we don't\n // shift tasks off the queue after they have been executed.\n // Instead, we periodically shift 1024 tasks off the queue.\n if (index > capacity) {\n // Manually shift all values starting at the index back to the\n // beginning of the queue.\n for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n queue[scan] = queue[scan + index];\n }\n queue.length -= index;\n index = 0;\n }\n }\n queue.length = 0;\n index = 0;\n flushing = false;\n}\n\n// `requestFlush` is implemented using a strategy based on data collected from\n// every available SauceLabs Selenium web driver worker at time of writing.\n// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593\n\n// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that\n// have WebKitMutationObserver but not un-prefixed MutationObserver.\n// Must use `global` or `self` instead of `window` to work in both frames and web\n// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.\n\n/* globals self */\nvar scope = typeof global !== \"undefined\" ? global : self;\nvar BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;\n\n// MutationObservers are desirable because they have high priority and work\n// reliably everywhere they are implemented.\n// They are implemented in all modern browsers.\n//\n// - Android 4-4.3\n// - Chrome 26-34\n// - Firefox 14-29\n// - Internet Explorer 11\n// - iPad Safari 6-7.1\n// - iPhone Safari 7-7.1\n// - Safari 6-7\nif (typeof BrowserMutationObserver === \"function\") {\n requestFlush = makeRequestCallFromMutationObserver(flush);\n\n// MessageChannels are desirable because they give direct access to the HTML\n// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera\n// 11-12, and in web workers in many engines.\n// Although message channels yield to any queued rendering and IO tasks, they\n// would be better than imposing the 4ms delay of timers.\n// However, they do not work reliably in Internet Explorer or Safari.\n\n// Internet Explorer 10 is the only browser that has setImmediate but does\n// not have MutationObservers.\n// Although setImmediate yields to the browser's renderer, it would be\n// preferrable to falling back to setTimeout since it does not have\n// the minimum 4ms penalty.\n// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and\n// Desktop to a lesser extent) that renders both setImmediate and\n// MessageChannel useless for the purposes of ASAP.\n// https://github.com/kriskowal/q/issues/396\n\n// Timers are implemented universally.\n// We fall back to timers in workers in most engines, and in foreground\n// contexts in the following browsers.\n// However, note that even this simple case requires nuances to operate in a\n// broad spectrum of browsers.\n//\n// - Firefox 3-13\n// - Internet Explorer 6-9\n// - iPad Safari 4.3\n// - Lynx 2.8.7\n} else {\n requestFlush = makeRequestCallFromTimer(flush);\n}\n\n// `requestFlush` requests that the high priority event queue be flushed as\n// soon as possible.\n// This is useful to prevent an error thrown in a task from stalling the event\n// queue if the exception handled by Node.js’s\n// `process.on(\"uncaughtException\")` or by a domain.\nrawAsap.requestFlush = requestFlush;\n\n// To request a high priority event, we induce a mutation observer by toggling\n// the text of a text node between \"1\" and \"-1\".\nfunction makeRequestCallFromMutationObserver(callback) {\n var toggle = 1;\n var observer = new BrowserMutationObserver(callback);\n var node = document.createTextNode(\"\");\n observer.observe(node, {characterData: true});\n return function requestCall() {\n toggle = -toggle;\n node.data = toggle;\n };\n}\n\n// The message channel technique was discovered by Malte Ubl and was the\n// original foundation for this library.\n// http://www.nonblocking.io/2011/06/windownexttick.html\n\n// Safari 6.0.5 (at least) intermittently fails to create message ports on a\n// page's first load. Thankfully, this version of Safari supports\n// MutationObservers, so we don't need to fall back in that case.\n\n// function makeRequestCallFromMessageChannel(callback) {\n// var channel = new MessageChannel();\n// channel.port1.onmessage = callback;\n// return function requestCall() {\n// channel.port2.postMessage(0);\n// };\n// }\n\n// For reasons explained above, we are also unable to use `setImmediate`\n// under any circumstances.\n// Even if we were, there is another bug in Internet Explorer 10.\n// It is not sufficient to assign `setImmediate` to `requestFlush` because\n// `setImmediate` must be called *by name* and therefore must be wrapped in a\n// closure.\n// Never forget.\n\n// function makeRequestCallFromSetImmediate(callback) {\n// return function requestCall() {\n// setImmediate(callback);\n// };\n// }\n\n// Safari 6.0 has a problem where timers will get lost while the user is\n// scrolling. This problem does not impact ASAP because Safari 6.0 supports\n// mutation observers, so that implementation is used instead.\n// However, if we ever elect to use timers in Safari, the prevalent work-around\n// is to add a scroll event listener that calls for a flush.\n\n// `setTimeout` does not call the passed callback if the delay is less than\n// approximately 7 in web workers in Firefox 8 through 18, and sometimes not\n// even then.\n\nfunction makeRequestCallFromTimer(callback) {\n return function requestCall() {\n // We dispatch a timeout with a specified delay of 0 for engines that\n // can reliably accommodate that request. This will usually be snapped\n // to a 4 milisecond delay, but once we're flushing, there's no delay\n // between events.\n var timeoutHandle = setTimeout(handleTimer, 0);\n // However, since this timer gets frequently dropped in Firefox\n // workers, we enlist an interval handle that will try to fire\n // an event 20 times per second until it succeeds.\n var intervalHandle = setInterval(handleTimer, 50);\n\n function handleTimer() {\n // Whichever timer succeeds will cancel both timers and\n // execute the callback.\n clearTimeout(timeoutHandle);\n clearInterval(intervalHandle);\n callback();\n }\n };\n}\n\n// This is for `asap.js` only.\n// Its name will be periodically randomized to break any code that depends on\n// its existence.\nrawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;\n\n// ASAP was originally a nextTick shim included in Q. This was factored out\n// into this ASAP package. It was later adapted to RSVP which made further\n// amendments. These decisions, particularly to marginalize MessageChannel and\n// to capture the MutationObserver implementation in a closure, were integrated\n// back into ASAP proper.\n// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js\n","\"use strict\";\n\n// rawAsap provides everything we need except exception management.\nvar rawAsap = require(\"./raw\");\n// RawTasks are recycled to reduce GC churn.\nvar freeTasks = [];\n// We queue errors to ensure they are thrown in right order (FIFO).\n// Array-as-queue is good enough here, since we are just dealing with exceptions.\nvar pendingErrors = [];\nvar requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);\n\nfunction throwFirstError() {\n if (pendingErrors.length) {\n throw pendingErrors.shift();\n }\n}\n\n/**\n * Calls a task as soon as possible after returning, in its own event, with priority\n * over other events like animation, reflow, and repaint. An error thrown from an\n * event will not interrupt, nor even substantially slow down the processing of\n * other events, but will be rather postponed to a lower priority event.\n * @param {{call}} task A callable object, typically a function that takes no\n * arguments.\n */\nmodule.exports = asap;\nfunction asap(task) {\n var rawTask;\n if (freeTasks.length) {\n rawTask = freeTasks.pop();\n } else {\n rawTask = new RawTask();\n }\n rawTask.task = task;\n rawAsap(rawTask);\n}\n\n// We wrap tasks with recyclable task objects. A task object implements\n// `call`, just like a function.\nfunction RawTask() {\n this.task = null;\n}\n\n// The sole purpose of wrapping the task is to catch the exception and recycle\n// the task object after its single use.\nRawTask.prototype.call = function () {\n try {\n this.task.call();\n } catch (error) {\n if (asap.onerror) {\n // This hook exists purely for testing purposes.\n // Its name will be periodically randomized to break any code that\n // depends on its existence.\n asap.onerror(error);\n } else {\n // In a web browser, exceptions are not fatal. However, to avoid\n // slowing down the queue of pending tasks, we rethrow the error in a\n // lower priority turn.\n pendingErrors.push(error);\n requestErrorThrow();\n }\n } finally {\n this.task = null;\n freeTasks[freeTasks.length] = this;\n }\n};\n","import calc from 'inline-style-prefixer/static/plugins/calc';\nimport crossFade from 'inline-style-prefixer/static/plugins/crossFade';\nimport cursor from 'inline-style-prefixer/static/plugins/cursor';\nimport filter from 'inline-style-prefixer/static/plugins/filter';\nimport flex from 'inline-style-prefixer/static/plugins/flex';\nimport flexboxIE from 'inline-style-prefixer/static/plugins/flexboxIE';\nimport flexboxOld from 'inline-style-prefixer/static/plugins/flexboxOld';\nimport gradient from 'inline-style-prefixer/static/plugins/gradient';\nimport imageSet from 'inline-style-prefixer/static/plugins/imageSet';\nimport position from 'inline-style-prefixer/static/plugins/position';\nimport sizing from 'inline-style-prefixer/static/plugins/sizing';\nimport transition from 'inline-style-prefixer/static/plugins/transition';\nimport stringHash from 'string-hash';\nimport createPrefixer from 'inline-style-prefixer/static/createPrefixer';\nimport asap from 'asap';\n\nvar w = [\"Webkit\"];\nvar m = [\"Moz\"];\nvar ms = [\"ms\"];\nvar wm = [\"Webkit\", \"Moz\"];\nvar wms = [\"Webkit\", \"ms\"];\nvar wmms = [\"Webkit\", \"Moz\", \"ms\"];\n\nvar staticPrefixData = {\n plugins: [calc, crossFade, cursor, filter, flex, flexboxIE, flexboxOld, gradient, imageSet, position, sizing, transition],\n prefixMap: { \"transform\": wms, \"transformOrigin\": wms, \"transformOriginX\": wms, \"transformOriginY\": wms, \"backfaceVisibility\": w, \"perspective\": w, \"perspectiveOrigin\": w, \"transformStyle\": w, \"transformOriginZ\": w, \"animation\": w, \"animationDelay\": w, \"animationDirection\": w, \"animationFillMode\": w, \"animationDuration\": w, \"animationIterationCount\": w, \"animationName\": w, \"animationPlayState\": w, \"animationTimingFunction\": w, \"appearance\": wm, \"userSelect\": wmms, \"fontKerning\": w, \"textEmphasisPosition\": w, \"textEmphasis\": w, \"textEmphasisStyle\": w, \"textEmphasisColor\": w, \"boxDecorationBreak\": w, \"clipPath\": w, \"maskImage\": w, \"maskMode\": w, \"maskRepeat\": w, \"maskPosition\": w, \"maskClip\": w, \"maskOrigin\": w, \"maskSize\": w, \"maskComposite\": w, \"mask\": w, \"maskBorderSource\": w, \"maskBorderMode\": w, \"maskBorderSlice\": w, \"maskBorderWidth\": w, \"maskBorderOutset\": w, \"maskBorderRepeat\": w, \"maskBorder\": w, \"maskType\": w, \"textDecorationStyle\": wm, \"textDecorationSkip\": wm, \"textDecorationLine\": wm, \"textDecorationColor\": wm, \"filter\": w, \"fontFeatureSettings\": wm, \"breakAfter\": wmms, \"breakBefore\": wmms, \"breakInside\": wmms, \"columnCount\": wm, \"columnFill\": wm, \"columnGap\": wm, \"columnRule\": wm, \"columnRuleColor\": wm, \"columnRuleStyle\": wm, \"columnRuleWidth\": wm, \"columns\": wm, \"columnSpan\": wm, \"columnWidth\": wm, \"writingMode\": wms, \"flex\": wms, \"flexBasis\": w, \"flexDirection\": wms, \"flexGrow\": w, \"flexFlow\": wms, \"flexShrink\": w, \"flexWrap\": wms, \"alignContent\": w, \"alignItems\": w, \"alignSelf\": w, \"justifyContent\": w, \"order\": w, \"transitionDelay\": w, \"transitionDuration\": w, \"transitionProperty\": w, \"transitionTimingFunction\": w, \"backdropFilter\": w, \"scrollSnapType\": wms, \"scrollSnapPointsX\": wms, \"scrollSnapPointsY\": wms, \"scrollSnapDestination\": wms, \"scrollSnapCoordinate\": wms, \"shapeImageThreshold\": w, \"shapeImageMargin\": w, \"shapeImageOutside\": w, \"hyphens\": wmms, \"flowInto\": wms, \"flowFrom\": wms, \"regionFragment\": wms, \"boxSizing\": m, \"textAlignLast\": m, \"tabSize\": m, \"wrapFlow\": ms, \"wrapThrough\": ms, \"wrapMargin\": ms, \"touchAction\": ms, \"gridTemplateColumns\": ms, \"gridTemplateRows\": ms, \"gridTemplateAreas\": ms, \"gridTemplate\": ms, \"gridAutoColumns\": ms, \"gridAutoRows\": ms, \"gridAutoFlow\": ms, \"grid\": ms, \"gridRowStart\": ms, \"gridColumnStart\": ms, \"gridRowEnd\": ms, \"gridRow\": ms, \"gridColumn\": ms, \"gridColumnEnd\": ms, \"gridColumnGap\": ms, \"gridRowGap\": ms, \"gridArea\": ms, \"gridGap\": ms, \"textSizeAdjust\": wms, \"borderImage\": w, \"borderImageOutset\": w, \"borderImageRepeat\": w, \"borderImageSlice\": w, \"borderImageSource\": w, \"borderImageWidth\": w }\n};\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar MAP_EXISTS = typeof Map !== 'undefined';\n\nvar OrderedElements = function () {\n /* ::\n elements: {[string]: any};\n keyOrder: string[];\n */\n\n function OrderedElements() {\n _classCallCheck(this, OrderedElements);\n\n this.elements = {};\n this.keyOrder = [];\n }\n\n _createClass(OrderedElements, [{\n key: 'forEach',\n value: function () {\n function forEach(callback /* : (string, any) => void */) {\n for (var i = 0; i < this.keyOrder.length; i++) {\n // (value, key) to match Map's API\n callback(this.elements[this.keyOrder[i]], this.keyOrder[i]);\n }\n }\n\n return forEach;\n }()\n }, {\n key: 'set',\n value: function () {\n function set(key /* : string */, value /* : any */, shouldReorder /* : ?boolean */) {\n if (!this.elements.hasOwnProperty(key)) {\n this.keyOrder.push(key);\n } else if (shouldReorder) {\n var index = this.keyOrder.indexOf(key);\n this.keyOrder.splice(index, 1);\n this.keyOrder.push(key);\n }\n\n if (value == null) {\n this.elements[key] = value;\n return;\n }\n\n if (MAP_EXISTS && value instanceof Map || value instanceof OrderedElements) {\n // We have found a nested Map, so we need to recurse so that all\n // of the nested objects and Maps are merged properly.\n var nested = this.elements.hasOwnProperty(key) ? this.elements[key] : new OrderedElements();\n value.forEach(function (value, key) {\n nested.set(key, value, shouldReorder);\n });\n this.elements[key] = nested;\n return;\n }\n\n if (!Array.isArray(value) && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {\n // We have found a nested object, so we need to recurse so that all\n // of the nested objects and Maps are merged properly.\n var _nested = this.elements.hasOwnProperty(key) ? this.elements[key] : new OrderedElements();\n var keys = Object.keys(value);\n for (var i = 0; i < keys.length; i += 1) {\n _nested.set(keys[i], value[keys[i]], shouldReorder);\n }\n this.elements[key] = _nested;\n return;\n }\n\n this.elements[key] = value;\n }\n\n return set;\n }()\n }, {\n key: 'get',\n value: function () {\n function get(key /* : string */) /* : any */{\n return this.elements[key];\n }\n\n return get;\n }()\n }, {\n key: 'has',\n value: function () {\n function has(key /* : string */) /* : boolean */{\n return this.elements.hasOwnProperty(key);\n }\n\n return has;\n }()\n }, {\n key: 'addStyleType',\n value: function () {\n function addStyleType(styleType /* : any */) /* : void */{\n var _this = this;\n\n if (MAP_EXISTS && styleType instanceof Map || styleType instanceof OrderedElements) {\n styleType.forEach(function (value, key) {\n _this.set(key, value, true);\n });\n } else {\n var keys = Object.keys(styleType);\n for (var i = 0; i < keys.length; i++) {\n this.set(keys[i], styleType[keys[i]], true);\n }\n }\n }\n\n return addStyleType;\n }()\n }]);\n\n return OrderedElements;\n}();\n\n/* ::\ntype ObjectMap = { [id:string]: any };\n*/\n\nvar UPPERCASE_RE = /([A-Z])/g;\nvar UPPERCASE_RE_TO_KEBAB = function UPPERCASE_RE_TO_KEBAB(match /* : string */) {\n return (/* : string */'-' + String(match.toLowerCase())\n );\n};\n\nvar kebabifyStyleName = function kebabifyStyleName(string /* : string */) /* : string */{\n var result = string.replace(UPPERCASE_RE, UPPERCASE_RE_TO_KEBAB);\n if (result[0] === 'm' && result[1] === 's' && result[2] === '-') {\n return '-' + String(result);\n }\n return result;\n};\n\n/**\n * CSS properties which accept numbers but are not in units of \"px\".\n * Taken from React's CSSProperty.js\n */\nvar isUnitlessNumber = {\n animationIterationCount: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n flex: true,\n flexGrow: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n flexOrder: true,\n gridRow: true,\n gridColumn: true,\n fontWeight: true,\n lineClamp: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n\n // SVG-related properties\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true\n};\n\n/**\n * Taken from React's CSSProperty.js\n *\n * @param {string} prefix vendor-specific prefix, eg: Webkit\n * @param {string} key style name, eg: transitionDuration\n * @return {string} style name prefixed with `prefix`, properly camelCased, eg:\n * WebkitTransitionDuration\n */\nfunction prefixKey(prefix, key) {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n}\n\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n * Taken from React's CSSProperty.js\n */\nvar prefixes = ['Webkit', 'ms', 'Moz', 'O'];\n\n// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n// infinite loop, because it iterates over the newly added props too.\n// Taken from React's CSSProperty.js\nObject.keys(isUnitlessNumber).forEach(function (prop) {\n prefixes.forEach(function (prefix) {\n isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n });\n});\n\nvar stringifyValue = function stringifyValue(key /* : string */\n, prop /* : any */\n) /* : string */{\n if (typeof prop === \"number\") {\n if (isUnitlessNumber[key]) {\n return \"\" + prop;\n } else {\n return prop + \"px\";\n }\n } else {\n return '' + prop;\n }\n};\n\nvar stringifyAndImportantifyValue = function stringifyAndImportantifyValue(key /* : string */\n, prop /* : any */\n) {\n return (/* : string */importantify(stringifyValue(key, prop))\n );\n};\n\n// Turn a string into a hash string of base-36 values (using letters and numbers)\n// eslint-disable-next-line no-unused-vars\nvar hashString = function hashString(string /* : string */, key /* : ?string */) {\n return (/* string */stringHash(string).toString(36)\n );\n};\n\n// Hash a javascript object using JSON.stringify. This is very fast, about 3\n// microseconds on my computer for a sample object:\n// http://jsperf.com/test-hashfnv32a-hash/5\n//\n// Note that this uses JSON.stringify to stringify the objects so in order for\n// this to produce consistent hashes browsers need to have a consistent\n// ordering of objects. Ben Alpert says that Facebook depends on this, so we\n// can probably depend on this too.\nvar hashObject = function hashObject(object /* : ObjectMap */) {\n return (/* : string */hashString(JSON.stringify(object))\n );\n};\n\n// Given a single style value string like the \"b\" from \"a: b;\", adds !important\n// to generate \"b !important\".\nvar importantify = function importantify(string /* : string */) {\n return (/* : string */\n // Bracket string character access is very fast, and in the default case we\n // normally don't expect there to be \"!important\" at the end of the string\n // so we can use this simple check to take an optimized path. If there\n // happens to be a \"!\" in this position, we follow up with a more thorough\n // check.\n string[string.length - 10] === '!' && string.slice(-11) === ' !important' ? string : String(string) + ' !important'\n );\n};\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar prefixAll = createPrefixer(staticPrefixData);\n\n/* ::\nimport type { SheetDefinition } from './index.js';\ntype StringHandlers = { [id:string]: Function };\ntype SelectorCallback = (selector: string) => string[];\nexport type SelectorHandler = (\n selector: string,\n baseSelector: string,\n callback: SelectorCallback\n) => string[] | string | null;\n*/\n\n/**\n * `selectorHandlers` are functions which handle special selectors which act\n * differently than normal style definitions. These functions look at the\n * current selector and can generate CSS for the styles in their subtree by\n * calling the callback with a new selector.\n *\n * For example, when generating styles with a base selector of '.foo' and the\n * following styles object:\n *\n * {\n * ':nth-child(2n)': {\n * ':hover': {\n * color: 'red'\n * }\n * }\n * }\n *\n * when we reach the ':hover' style, we would call our selector handlers like\n *\n * handler(':hover', '.foo:nth-child(2n)', callback)\n *\n * Since our `pseudoSelectors` handles ':hover' styles, that handler would call\n * the callback like\n *\n * callback('.foo:nth-child(2n):hover')\n *\n * to generate its subtree `{ color: 'red' }` styles with a\n * '.foo:nth-child(2n):hover' selector. The callback would return an array of CSS\n * rules like\n *\n * ['.foo:nth-child(2n):hover{color:red !important;}']\n *\n * and the handler would then return that resulting CSS.\n *\n * `defaultSelectorHandlers` is the list of default handlers used in a call to\n * `generateCSS`.\n *\n * @name SelectorHandler\n * @function\n * @param {string} selector: The currently inspected selector. ':hover' in the\n * example above.\n * @param {string} baseSelector: The selector of the parent styles.\n * '.foo:nth-child(2n)' in the example above.\n * @param {function} generateSubtreeStyles: A function which can be called to\n * generate CSS for the subtree of styles corresponding to the selector.\n * Accepts a new baseSelector to use for generating those styles.\n * @returns {string[] | string | null} The generated CSS for this selector, or\n * null if we don't handle this selector.\n */\nvar defaultSelectorHandlers /* : SelectorHandler[] */ = [\n// Handle pseudo-selectors, like :hover and :nth-child(3n)\nfunction () {\n function pseudoSelectors(selector, baseSelector, generateSubtreeStyles) {\n if (selector[0] !== \":\") {\n return null;\n }\n return generateSubtreeStyles(baseSelector + selector);\n }\n\n return pseudoSelectors;\n}(),\n\n// Handle media queries (or font-faces)\nfunction () {\n function mediaQueries(selector, baseSelector, generateSubtreeStyles) {\n if (selector[0] !== \"@\") {\n return null;\n }\n // Generate the styles normally, and then wrap them in the media query.\n var generated = generateSubtreeStyles(baseSelector);\n return [String(selector) + '{' + String(generated.join('')) + '}'];\n }\n\n return mediaQueries;\n}()];\n\n/**\n * Generate CSS for a selector and some styles.\n *\n * This function handles the media queries and pseudo selectors that can be used\n * in aphrodite styles.\n *\n * @param {string} selector: A base CSS selector for the styles to be generated\n * with.\n * @param {Object} styleTypes: A list of properties of the return type of\n * StyleSheet.create, e.g. [styles.red, styles.blue].\n * @param {Array.<SelectorHandler>} selectorHandlers: A list of selector\n * handlers to use for handling special selectors. See\n * `defaultSelectorHandlers`.\n * @param stringHandlers: See `generateCSSRuleset`\n * @param useImportant: See `generateCSSRuleset`\n *\n * To actually generate the CSS special-construct-less styles are passed to\n * `generateCSSRuleset`.\n *\n * For instance, a call to\n *\n * generateCSS(\".foo\", [{\n * color: \"red\",\n * \"@media screen\": {\n * height: 20,\n * \":hover\": {\n * backgroundColor: \"black\"\n * }\n * },\n * \":active\": {\n * fontWeight: \"bold\"\n * }\n * }], defaultSelectorHandlers);\n *\n * with the default `selectorHandlers` will make 5 calls to\n * `generateCSSRuleset`:\n *\n * generateCSSRuleset(\".foo\", { color: \"red\" }, ...)\n * generateCSSRuleset(\".foo:active\", { fontWeight: \"bold\" }, ...)\n * // These 2 will be wrapped in @media screen {}\n * generateCSSRuleset(\".foo\", { height: 20 }, ...)\n * generateCSSRuleset(\".foo:hover\", { backgroundColor: \"black\" }, ...)\n */\nvar generateCSS = function generateCSS(selector /* : string */\n, styleTypes /* : SheetDefinition[] */\n, selectorHandlers /* : SelectorHandler[] */\n, stringHandlers /* : StringHandlers */\n, useImportant /* : boolean */\n) /* : string[] */{\n var merged = new OrderedElements();\n\n for (var i = 0; i < styleTypes.length; i++) {\n merged.addStyleType(styleTypes[i]);\n }\n\n var plainDeclarations = new OrderedElements();\n var generatedStyles = [];\n\n // TODO(emily): benchmark this to see if a plain for loop would be faster.\n merged.forEach(function (val, key) {\n // For each key, see if one of the selector handlers will handle these\n // styles.\n var foundHandler = selectorHandlers.some(function (handler) {\n var result = handler(key, selector, function (newSelector) {\n return generateCSS(newSelector, [val], selectorHandlers, stringHandlers, useImportant);\n });\n if (result != null) {\n // If the handler returned something, add it to the generated\n // CSS and stop looking for another handler.\n if (Array.isArray(result)) {\n generatedStyles.push.apply(generatedStyles, _toConsumableArray(result));\n } else {\n // eslint-disable-next-line\n console.warn('WARNING: Selector handlers should return an array of rules.' + 'Returning a string containing multiple rules is deprecated.', handler);\n generatedStyles.push('@media all {' + String(result) + '}');\n }\n return true;\n }\n });\n // If none of the handlers handled it, add it to the list of plain\n // style declarations.\n if (!foundHandler) {\n plainDeclarations.set(key, val, true);\n }\n });\n var generatedRuleset = generateCSSRuleset(selector, plainDeclarations, stringHandlers, useImportant, selectorHandlers);\n\n if (generatedRuleset) {\n generatedStyles.unshift(generatedRuleset);\n }\n\n return generatedStyles;\n};\n\n/**\n * Helper method of generateCSSRuleset to facilitate custom handling of certain\n * CSS properties. Used for e.g. font families.\n *\n * See generateCSSRuleset for usage and documentation of paramater types.\n */\nvar runStringHandlers = function runStringHandlers(declarations /* : OrderedElements */\n, stringHandlers /* : StringHandlers */\n, selectorHandlers /* : SelectorHandler[] */\n) /* : void */{\n if (!stringHandlers) {\n return;\n }\n\n var stringHandlerKeys = Object.keys(stringHandlers);\n for (var i = 0; i < stringHandlerKeys.length; i++) {\n var key = stringHandlerKeys[i];\n if (declarations.has(key)) {\n // A declaration exists for this particular string handler, so we\n // need to let the string handler interpret the declaration first\n // before proceeding.\n //\n // TODO(emily): Pass in a callback which generates CSS, similar to\n // how our selector handlers work, instead of passing in\n // `selectorHandlers` and have them make calls to `generateCSS`\n // themselves. Right now, this is impractical because our string\n // handlers are very specialized and do complex things.\n declarations.set(key, stringHandlers[key](declarations.get(key), selectorHandlers),\n\n // Preserve order here, since we are really replacing an\n // unprocessed style with a processed style, not overriding an\n // earlier style\n false);\n }\n }\n};\n\nvar transformRule = function transformRule(key /* : string */\n, value /* : string */\n, transformValue /* : function */\n) {\n return (/* : string */String(kebabifyStyleName(key)) + ':' + String(transformValue(key, value)) + ';'\n );\n};\n\nvar arrayToObjectKeysReducer = function arrayToObjectKeysReducer(acc, val) {\n acc[val] = true;\n return acc;\n};\n\n/**\n * Generate a CSS ruleset with the selector and containing the declarations.\n *\n * This function assumes that the given declarations don't contain any special\n * children (such as media queries, pseudo-selectors, or descendant styles).\n *\n * Note that this method does not deal with nesting used for e.g.\n * psuedo-selectors or media queries. That responsibility is left to the\n * `generateCSS` function.\n *\n * @param {string} selector: the selector associated with the ruleset\n * @param {Object} declarations: a map from camelCased CSS property name to CSS\n * property value.\n * @param {Object.<string, function>} stringHandlers: a map from camelCased CSS\n * property name to a function which will map the given value to the value\n * that is output.\n * @param {bool} useImportant: A boolean saying whether to append \"!important\"\n * to each of the CSS declarations.\n * @returns {string} A string of raw CSS.\n *\n * Examples:\n *\n * generateCSSRuleset(\".blah\", { color: \"red\" })\n * -> \".blah{color: red !important;}\"\n * generateCSSRuleset(\".blah\", { color: \"red\" }, {}, false)\n * -> \".blah{color: red}\"\n * generateCSSRuleset(\".blah\", { color: \"red\" }, {color: c => c.toUpperCase})\n * -> \".blah{color: RED}\"\n * generateCSSRuleset(\".blah:hover\", { color: \"red\" })\n * -> \".blah:hover{color: red}\"\n */\nvar generateCSSRuleset = function generateCSSRuleset(selector /* : string */\n, declarations /* : OrderedElements */\n, stringHandlers /* : StringHandlers */\n, useImportant /* : boolean */\n, selectorHandlers /* : SelectorHandler[] */\n) /* : string */{\n // Mutates declarations\n runStringHandlers(declarations, stringHandlers, selectorHandlers);\n\n var originalElements = Object.keys(declarations.elements).reduce(arrayToObjectKeysReducer, Object.create(null));\n\n // NOTE(emily): This mutates handledDeclarations.elements.\n var prefixedElements = prefixAll(declarations.elements);\n\n var elementNames = Object.keys(prefixedElements);\n if (elementNames.length !== declarations.keyOrder.length) {\n // There are some prefixed values, so we need to figure out how to sort\n // them.\n //\n // Loop through prefixedElements, looking for anything that is not in\n // sortOrder, which means it was added by prefixAll. This means that we\n // need to figure out where it should appear in the sortOrder.\n for (var i = 0; i < elementNames.length; i++) {\n if (!originalElements[elementNames[i]]) {\n // This element is not in the sortOrder, which means it is a prefixed\n // value that was added by prefixAll. Let's try to figure out where it\n // goes.\n var originalStyle = void 0;\n if (elementNames[i][0] === 'W') {\n // This is a Webkit-prefixed style, like \"WebkitTransition\". Let's\n // find its original style's sort order.\n originalStyle = elementNames[i][6].toLowerCase() + elementNames[i].slice(7);\n } else if (elementNames[i][1] === 'o') {\n // This is a Moz-prefixed style, like \"MozTransition\". We check\n // the second character to avoid colliding with Ms-prefixed\n // styles. Let's find its original style's sort order.\n originalStyle = elementNames[i][3].toLowerCase() + elementNames[i].slice(4);\n } else {\n // if (elementNames[i][1] === 's') {\n // This is a Ms-prefixed style, like \"MsTransition\".\n originalStyle = elementNames[i][2].toLowerCase() + elementNames[i].slice(3);\n }\n\n if (originalStyle && originalElements[originalStyle]) {\n var originalIndex = declarations.keyOrder.indexOf(originalStyle);\n declarations.keyOrder.splice(originalIndex, 0, elementNames[i]);\n } else {\n // We don't know what the original style was, so sort it to\n // top. This can happen for styles that are added that don't\n // have the same base name as the original style.\n declarations.keyOrder.unshift(elementNames[i]);\n }\n }\n }\n }\n\n var transformValue = useImportant === false ? stringifyValue : stringifyAndImportantifyValue;\n\n var rules = [];\n for (var _i = 0; _i < declarations.keyOrder.length; _i++) {\n var key = declarations.keyOrder[_i];\n var value = prefixedElements[key];\n if (Array.isArray(value)) {\n // inline-style-prefixer returns an array when there should be\n // multiple rules for the same key. Here we flatten to multiple\n // pairs with the same key.\n for (var j = 0; j < value.length; j++) {\n rules.push(transformRule(key, value[j], transformValue));\n }\n } else {\n rules.push(transformRule(key, value, transformValue));\n }\n }\n\n if (rules.length) {\n return String(selector) + '{' + String(rules.join(\"\")) + '}';\n } else {\n return \"\";\n }\n};\n\nvar _typeof$1 = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _toConsumableArray$1(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\n/* ::\nimport type { SheetDefinition, SheetDefinitions } from './index.js';\nimport type { MaybeSheetDefinition } from './exports.js';\nimport type { SelectorHandler } from './generate.js';\n*/\n\n// The current <style> tag we are inserting into, or null if we haven't\n// inserted anything yet. We could find this each time using\n// `document.querySelector(\"style[data-aphrodite\"])`, but holding onto it is\n// faster.\nvar styleTag /* : ?HTMLStyleElement */ = null;\n\n// Inject a set of rules into a <style> tag in the head of the document. This\n// will automatically create a style tag and then continue to use it for\n// multiple injections. It will also use a style tag with the `data-aphrodite`\n// tag on it if that exists in the DOM. This could be used for e.g. reusing the\n// same style tag that server-side rendering inserts.\nvar injectStyleTag = function injectStyleTag(cssRules /* : string[] */) {\n if (styleTag == null) {\n // Try to find a style tag with the `data-aphrodite` attribute first.\n styleTag = document.querySelector(\"style[data-aphrodite]\") /* : any */;\n\n // If that doesn't work, generate a new style tag.\n if (styleTag == null) {\n // Taken from\n // http://stackoverflow.com/questions/524696/how-to-create-a-style-tag-with-javascript\n var head = document.head || document.getElementsByTagName('head')[0];\n styleTag = document.createElement('style');\n\n styleTag.type = 'text/css';\n styleTag.setAttribute(\"data-aphrodite\", \"\");\n head.appendChild(styleTag);\n }\n }\n\n var sheet = styleTag.styleSheet || styleTag.sheet /* : any */;\n\n if (sheet.insertRule) {\n var numRules = sheet.cssRules.length;\n cssRules.forEach(function (rule) {\n try {\n sheet.insertRule(rule, numRules);\n numRules += 1;\n } catch (e) {\n // The selector for this rule wasn't compatible with the browser\n }\n });\n } else {\n styleTag.innerText = (styleTag.innerText || '') + cssRules.join('');\n }\n};\n\n// Custom handlers for stringifying CSS values that have side effects\n// (such as fontFamily, which can cause @font-face rules to be injected)\nvar stringHandlers = {\n // With fontFamily we look for objects that are passed in and interpret\n // them as @font-face rules that we need to inject. The value of fontFamily\n // can either be a string (as normal), an object (a single font face), or\n // an array of objects and strings.\n fontFamily: function () {\n function fontFamily(val) {\n if (Array.isArray(val)) {\n return val.map(fontFamily).join(\",\");\n } else if ((typeof val === 'undefined' ? 'undefined' : _typeof$1(val)) === \"object\") {\n injectStyleOnce(val.src, \"@font-face\", [val], false);\n return '\"' + String(val.fontFamily) + '\"';\n } else {\n return val;\n }\n }\n\n return fontFamily;\n }(),\n\n // With animationName we look for an object that contains keyframes and\n // inject them as an `@keyframes` block, returning a uniquely generated\n // name. The keyframes object should look like\n // animationName: {\n // from: {\n // left: 0,\n // top: 0,\n // },\n // '50%': {\n // left: 15,\n // top: 5,\n // },\n // to: {\n // left: 20,\n // top: 20,\n // }\n // }\n // TODO(emily): `stringHandlers` doesn't let us rename the key, so I have\n // to use `animationName` here. Improve that so we can call this\n // `animation` instead of `animationName`.\n animationName: function () {\n function animationName(val, selectorHandlers) {\n if (Array.isArray(val)) {\n return val.map(function (v) {\n return animationName(v, selectorHandlers);\n }).join(\",\");\n } else if ((typeof val === 'undefined' ? 'undefined' : _typeof$1(val)) === \"object\") {\n // Generate a unique name based on the hash of the object. We can't\n // just use the hash because the name can't start with a number.\n // TODO(emily): this probably makes debugging hard, allow a custom\n // name?\n var name = 'keyframe_' + String(hashObject(val));\n\n // Since keyframes need 3 layers of nesting, we use `generateCSS` to\n // build the inner layers and wrap it in `@keyframes` ourselves.\n var finalVal = '@keyframes ' + name + '{';\n\n // TODO see if we can find a way where checking for OrderedElements\n // here is not necessary. Alternatively, perhaps we should have a\n // utility method that can iterate over either a plain object, an\n // instance of OrderedElements, or a Map, and then use that here and\n // elsewhere.\n if (val instanceof OrderedElements) {\n val.forEach(function (valVal, valKey) {\n finalVal += generateCSS(valKey, [valVal], selectorHandlers, stringHandlers, false).join('');\n });\n } else {\n Object.keys(val).forEach(function (key) {\n finalVal += generateCSS(key, [val[key]], selectorHandlers, stringHandlers, false).join('');\n });\n }\n finalVal += '}';\n\n injectGeneratedCSSOnce(name, [finalVal]);\n\n return name;\n } else {\n return val;\n }\n }\n\n return animationName;\n }()\n};\n\n// This is a map from Aphrodite's generated class names to `true` (acting as a\n// set of class names)\nvar alreadyInjected = {};\n\n// This is the buffer of styles which have not yet been flushed.\nvar injectionBuffer /* : string[] */ = [];\n\n// A flag to tell if we are already buffering styles. This could happen either\n// because we scheduled a flush call already, so newly added styles will\n// already be flushed, or because we are statically buffering on the server.\nvar isBuffering = false;\n\nvar injectGeneratedCSSOnce = function injectGeneratedCSSOnce(key, generatedCSS) {\n var _injectionBuffer;\n\n if (alreadyInjected[key]) {\n return;\n }\n\n if (!isBuffering) {\n // We should never be automatically buffering on the server (or any\n // place without a document), so guard against that.\n if (typeof document === \"undefined\") {\n throw new Error(\"Cannot automatically buffer without a document\");\n }\n\n // If we're not already buffering, schedule a call to flush the\n // current styles.\n isBuffering = true;\n asap(flushToStyleTag);\n }\n\n (_injectionBuffer = injectionBuffer).push.apply(_injectionBuffer, _toConsumableArray$1(generatedCSS));\n alreadyInjected[key] = true;\n};\n\nvar injectStyleOnce = function injectStyleOnce(key /* : string */\n, selector /* : string */\n, definitions /* : SheetDefinition[] */\n, useImportant /* : boolean */\n) {\n var selectorHandlers /* : SelectorHandler[] */ = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];\n\n if (alreadyInjected[key]) {\n return;\n }\n\n var generated = generateCSS(selector, definitions, selectorHandlers, stringHandlers, useImportant);\n\n injectGeneratedCSSOnce(key, generated);\n};\n\nvar reset = function reset() {\n injectionBuffer = [];\n alreadyInjected = {};\n isBuffering = false;\n styleTag = null;\n};\n\nvar getBufferedStyles = function getBufferedStyles() {\n return injectionBuffer;\n};\n\nvar startBuffering = function startBuffering() {\n if (isBuffering) {\n throw new Error(\"Cannot buffer while already buffering\");\n }\n isBuffering = true;\n};\n\nvar flushToArray = function flushToArray() {\n isBuffering = false;\n var ret = injectionBuffer;\n injectionBuffer = [];\n return ret;\n};\n\nvar flushToString = function flushToString() {\n return flushToArray().join('');\n};\n\nvar flushToStyleTag = function flushToStyleTag() {\n var cssRules = flushToArray();\n if (cssRules.length > 0) {\n injectStyleTag(cssRules);\n }\n};\n\nvar getRenderedClassNames = function getRenderedClassNames() {\n return Object.keys(alreadyInjected);\n};\n\nvar addRenderedClassNames = function addRenderedClassNames(classNames /* : string[] */) {\n classNames.forEach(function (className) {\n alreadyInjected[className] = true;\n });\n};\n\nvar processStyleDefinitions = function processStyleDefinitions(styleDefinitions /* : any[] */\n, classNameBits /* : string[] */\n, definitionBits /* : Object[] */\n, length /* : number */\n) /* : number */{\n for (var i = 0; i < styleDefinitions.length; i += 1) {\n // Filter out falsy values from the input, to allow for\n // `css(a, test && c)`\n if (styleDefinitions[i]) {\n if (Array.isArray(styleDefinitions[i])) {\n // We've encountered an array, so let's recurse\n length += processStyleDefinitions(styleDefinitions[i], classNameBits, definitionBits, length);\n } else {\n classNameBits.push(styleDefinitions[i]._name);\n definitionBits.push(styleDefinitions[i]._definition);\n length += styleDefinitions[i]._len;\n }\n }\n }\n return length;\n};\n\n/**\n * Inject styles associated with the passed style definition objects, and return\n * an associated CSS class name.\n *\n * @param {boolean} useImportant If true, will append !important to generated\n * CSS output. e.g. {color: red} -> \"color: red !important\".\n * @param {(Object|Object[])[]} styleDefinitions style definition objects, or\n * arbitrarily nested arrays of them, as returned as properties of the\n * return value of StyleSheet.create().\n */\nvar injectAndGetClassName = function injectAndGetClassName(useImportant /* : boolean */\n, styleDefinitions /* : MaybeSheetDefinition[] */\n, selectorHandlers /* : SelectorHandler[] */\n) /* : string */{\n var classNameBits = [];\n var definitionBits = [];\n\n // Mutates classNameBits and definitionBits and returns a length which we\n // will append to the hash to decrease the chance of hash collisions.\n var length = processStyleDefinitions(styleDefinitions, classNameBits, definitionBits, 0);\n\n // Break if there aren't any valid styles.\n if (classNameBits.length === 0) {\n return \"\";\n }\n\n var className = void 0;\n if (process.env.NODE_ENV === 'production') {\n className = classNameBits.length === 1 ? '_' + String(classNameBits[0]) : '_' + String(hashString(classNameBits.join())) + String((length % 36).toString(36));\n } else {\n className = classNameBits.join(\"-o_O-\");\n }\n\n injectStyleOnce(className, '.' + String(className), definitionBits, useImportant, selectorHandlers);\n\n return className;\n};\n\n/* ::\nimport type { SelectorHandler } from './generate.js';\nexport type SheetDefinition = { [id:string]: any };\nexport type SheetDefinitions = SheetDefinition | SheetDefinition[];\ntype RenderFunction = () => string;\ntype Extension = {\n selectorHandler: SelectorHandler\n};\nexport type MaybeSheetDefinition = SheetDefinition | false | null | void\n*/\n\nvar unminifiedHashFn = function unminifiedHashFn(str /* : string */, key /* : string */) {\n return String(key) + '_' + String(hashString(str));\n};\n\n// StyleSheet.create is in a hot path so we want to keep as much logic out of it\n// as possible. So, we figure out which hash function to use once, and only\n// switch it out via minify() as necessary.\n//\n// This is in an exported function to make it easier to test.\nvar initialHashFn = function initialHashFn() {\n return process.env.NODE_ENV === 'production' ? hashString : unminifiedHashFn;\n};\n\nvar hashFn = initialHashFn();\n\nvar StyleSheet = {\n create: function () {\n function create(sheetDefinition /* : SheetDefinition */) /* : Object */{\n var mappedSheetDefinition = {};\n var keys = Object.keys(sheetDefinition);\n\n for (var i = 0; i < keys.length; i += 1) {\n var key = keys[i];\n var val = sheetDefinition[key];\n var stringVal = JSON.stringify(val);\n\n mappedSheetDefinition[key] = {\n _len: stringVal.length,\n _name: hashFn(stringVal, key),\n _definition: val\n };\n }\n\n return mappedSheetDefinition;\n }\n\n return create;\n }(),\n rehydrate: function () {\n function rehydrate() {\n var renderedClassNames /* : string[] */ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n addRenderedClassNames(renderedClassNames);\n }\n\n return rehydrate;\n }()\n};\n\n/**\n * Utilities for using Aphrodite server-side.\n *\n * This can be minified out in client-only bundles by replacing `typeof window`\n * with `\"object\"`, e.g. via Webpack's DefinePlugin:\n *\n * new webpack.DefinePlugin({\n * \"typeof window\": JSON.stringify(\"object\")\n * })\n */\nvar StyleSheetServer = typeof window !== 'undefined' ? null : {\n renderStatic: function () {\n function renderStatic(renderFunc /* : RenderFunction */) {\n reset();\n startBuffering();\n var html = renderFunc();\n var cssContent = flushToString();\n\n return {\n html: html,\n css: {\n content: cssContent,\n renderedClassNames: getRenderedClassNames()\n }\n };\n }\n\n return renderStatic;\n }()\n};\n\n/**\n * Utilities for using Aphrodite in tests.\n *\n * Not meant to be used in production.\n */\nvar StyleSheetTestUtils = process.env.NODE_ENV === 'production' ? null : {\n /**\n * Prevent styles from being injected into the DOM.\n *\n * This is useful in situations where you'd like to test rendering UI\n * components which use Aphrodite without any of the side-effects of\n * Aphrodite happening. Particularly useful for testing the output of\n * components when you have no DOM, e.g. testing in Node without a fake DOM.\n *\n * Should be paired with a subsequent call to\n * clearBufferAndResumeStyleInjection.\n */\n suppressStyleInjection: function () {\n function suppressStyleInjection() {\n reset();\n startBuffering();\n }\n\n return suppressStyleInjection;\n }(),\n\n\n /**\n * Opposite method of preventStyleInject.\n */\n clearBufferAndResumeStyleInjection: function () {\n function clearBufferAndResumeStyleInjection() {\n reset();\n }\n\n return clearBufferAndResumeStyleInjection;\n }(),\n\n\n /**\n * Returns a string of buffered styles which have not been flushed\n *\n * @returns {string} Buffer of styles which have not yet been flushed.\n */\n getBufferedStyles: function () {\n function getBufferedStyles$$1() {\n return getBufferedStyles();\n }\n\n return getBufferedStyles$$1;\n }()\n};\n\n/**\n * Generate the Aphrodite API exports, with given `selectorHandlers` and\n * `useImportant` state.\n */\nfunction makeExports(useImportant /* : boolean */\n, selectorHandlers /* : SelectorHandler[] */\n) {\n return {\n StyleSheet: Object.assign({}, StyleSheet, {\n\n /**\n * Returns a version of the exports of Aphrodite (i.e. an object\n * with `css` and `StyleSheet` properties) which have some\n * extensions included.\n *\n * @param {Array.<Object>} extensions: An array of extensions to\n * add to this instance of Aphrodite. Each object should have a\n * single property on it, defining which kind of extension to\n * add.\n * @param {SelectorHandler} [extensions[].selectorHandler]: A\n * selector handler extension. See `defaultSelectorHandlers` in\n * generate.js.\n *\n * @returns {Object} An object containing the exports of the new\n * instance of Aphrodite.\n */\n extend: function () {\n function extend(extensions /* : Extension[] */) {\n var extensionSelectorHandlers = extensions\n // Pull out extensions with a selectorHandler property\n .map(function (extension) {\n return extension.selectorHandler;\n })\n // Remove nulls (i.e. extensions without a selectorHandler\n // property).\n .filter(function (handler) {\n return handler;\n });\n\n return makeExports(useImportant, selectorHandlers.concat(extensionSelectorHandlers));\n }\n\n return extend;\n }()\n }),\n\n StyleSheetServer: StyleSheetServer,\n StyleSheetTestUtils: StyleSheetTestUtils,\n\n minify: function () {\n function minify(shouldMinify /* : boolean */) {\n hashFn = shouldMinify ? hashString : unminifiedHashFn;\n }\n\n return minify;\n }(),\n css: function () {\n function css() /* : MaybeSheetDefinition[] */{\n for (var _len = arguments.length, styleDefinitions = Array(_len), _key = 0; _key < _len; _key++) {\n styleDefinitions[_key] = arguments[_key];\n }\n\n return injectAndGetClassName(useImportant, styleDefinitions, selectorHandlers);\n }\n\n return css;\n }()\n };\n}\n\nvar useImportant = true; // Add !important to all style definitions\n\nvar Aphrodite = makeExports(useImportant, defaultSelectorHandlers);\n\nvar StyleSheet$1 = Aphrodite.StyleSheet,\n StyleSheetServer$1 = Aphrodite.StyleSheetServer,\n StyleSheetTestUtils$1 = Aphrodite.StyleSheetTestUtils,\n css = Aphrodite.css,\n minify = Aphrodite.minify;\n\nexport { StyleSheet$1 as StyleSheet, StyleSheetServer$1 as StyleSheetServer, StyleSheetTestUtils$1 as StyleSheetTestUtils, css, minify, flushToStyleTag };\n","import {StyleSheet} from 'aphrodite'\n\nexport enum FontFamily {\n MONOSPACE = '\"Source Code Pro\", Courier, monospace',\n}\n\nexport enum FontSize {\n LABEL = 10,\n TITLE = 12,\n BIG_BUTTON = 36,\n}\n\nexport enum Sizes {\n MINIMAP_HEIGHT = 100,\n DETAIL_VIEW_HEIGHT = 150,\n TOOLTIP_WIDTH_MAX = 900,\n TOOLTIP_HEIGHT_MAX = 80,\n SEPARATOR_HEIGHT = 2,\n FRAME_HEIGHT = 20,\n TOOLBAR_HEIGHT = 20,\n TOOLBAR_TAB_HEIGHT = TOOLBAR_HEIGHT - SEPARATOR_HEIGHT,\n}\n\nexport enum Duration {\n HOVER_CHANGE = '0.07s',\n}\n\nexport enum ZIndex {\n PROFILE_SELECT = 1,\n HOVERTIP = 2,\n}\n\nexport const commonStyle = StyleSheet.create({\n fillY: {\n height: '100%',\n },\n fillX: {\n width: '100%',\n },\n hbox: {\n display: 'flex',\n flexDirection: 'row',\n position: 'relative',\n overflow: 'hidden',\n },\n vbox: {\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n overflow: 'hidden',\n },\n})\n","import {Profile, Frame, CallTreeNode} from './profile'\nimport {Flamechart, FlamechartFrame} from './flamechart'\nimport {Rect, Vec2} from './math'\n\nexport enum FlamechartType {\n CHRONO_FLAME_CHART,\n LEFT_HEAVY_FLAME_GRAPH,\n}\n\n// In previous versions of speedscope, searching for strings within the profile\n// was done using fuzzy finding. As it turns out, this was surprising behavior\n// to most people, so we've switched to a more traditional substring search that\n// more closely mimics browser behavior.\n//\n// This is case insensitive for both the needle & the haystack. This means\n// searching for \"hello\" will match \"Hello\" and \"HELLO\", and searching for\n// \"HELLO\" will match both \"hello\" and \"Hello\". This matches Chrome's behavior\n// as far as I can tell.\n//\n// See https://github.com/jlfwong/speedscope/issues/352\n//\n// Return ranges for all matches in order to highlight them.\nexport function exactMatchStrings(text: string, pattern: string): [number, number][] {\n const lowerText = text.toLocaleLowerCase()\n const lowerPattern = pattern.toLocaleLowerCase()\n\n let lastIndex = 0\n const matchedRanges: Array<[number, number]> = []\n while (true) {\n let index = lowerText.indexOf(lowerPattern, lastIndex)\n if (index === -1) {\n return matchedRanges\n }\n matchedRanges.push([index, index + pattern.length])\n lastIndex = index + pattern.length\n }\n}\n\n// A utility class for storing cached search results to avoid recomputation when\n// the search results & profile did not change.\nexport class ProfileSearchResults {\n constructor(readonly profile: Profile, readonly searchQuery: string) {}\n\n private matches: Map<Frame, [number, number][] | null> | null = null\n getMatchForFrame(frame: Frame): [number, number][] | null {\n if (!this.matches) {\n this.matches = new Map()\n this.profile.forEachFrame(frame => {\n const match = exactMatchStrings(frame.name, this.searchQuery)\n this.matches!.set(frame, match.length === 0 ? null : match)\n })\n }\n return this.matches.get(frame) || null\n }\n}\n\nexport interface FlamechartSearchMatch {\n configSpaceBounds: Rect\n node: CallTreeNode\n}\n\ninterface CachedFlamechartResult {\n matches: FlamechartSearchMatch[]\n indexForNode: Map<CallTreeNode, number>\n}\n\nexport class FlamechartSearchResults {\n constructor(readonly flamechart: Flamechart, readonly profileResults: ProfileSearchResults) {}\n\n private matches: CachedFlamechartResult | null = null\n private getResults(): CachedFlamechartResult {\n if (this.matches == null) {\n const matches: FlamechartSearchMatch[] = []\n const indexForNode = new Map<CallTreeNode, number>()\n const visit = (frame: FlamechartFrame, depth: number) => {\n const {node} = frame\n if (this.profileResults.getMatchForFrame(node.frame)) {\n const configSpaceBounds = new Rect(\n new Vec2(frame.start, depth),\n new Vec2(frame.end - frame.start, 1),\n )\n indexForNode.set(node, matches.length)\n matches.push({configSpaceBounds, node})\n }\n\n frame.children.forEach(child => {\n visit(child, depth + 1)\n })\n }\n\n const layers = this.flamechart.getLayers()\n if (layers.length > 0) {\n layers[0].forEach(frame => visit(frame, 0))\n }\n\n this.matches = {matches, indexForNode}\n }\n return this.matches\n }\n\n count(): number {\n return this.getResults().matches.length\n }\n\n indexOf(node: CallTreeNode): number | null {\n const result = this.getResults().indexForNode.get(node)\n return result === undefined ? null : result\n }\n\n at(index: number): FlamechartSearchMatch {\n const matches = this.getResults().matches\n if (index < 0 || index >= matches.length) {\n throw new Error(`Index ${index} out of bounds in list of ${matches.length} matches.`)\n }\n return matches[index]\n }\n}\n","import {StyleSheet, css} from 'aphrodite'\nimport {h, createContext, ComponentChildren, Fragment} from 'preact'\nimport {useCallback, useRef, useEffect, useMemo} from 'preact/hooks'\nimport {memo} from 'preact/compat'\nimport {Sizes, FontSize} from './style'\nimport {ProfileSearchResults} from '../lib/profile-search'\nimport {Profile} from '../lib/profile'\nimport {useActiveProfileState} from '../app-state/active-profile-state'\nimport {useTheme, withTheme} from './themes/theme'\nimport {searchIsActiveAtom, searchQueryAtom} from '../app-state'\nimport {useAtom} from '../lib/atom'\n\nfunction stopPropagation(ev: Event) {\n ev.stopPropagation()\n}\n\nexport const ProfileSearchContext = createContext<ProfileSearchResults | null>(null)\n\nexport const ProfileSearchContextProvider = ({children}: {children: ComponentChildren}) => {\n const activeProfileState = useActiveProfileState()\n const profile: Profile | null = activeProfileState ? activeProfileState.profile : null\n const searchIsActive = useAtom(searchIsActiveAtom)\n const searchQuery = useAtom(searchQueryAtom)\n\n const searchResults = useMemo(() => {\n if (!profile || !searchIsActive || searchQuery.length === 0) {\n return null\n }\n return new ProfileSearchResults(profile, searchQuery)\n }, [searchIsActive, searchQuery, profile])\n\n return (\n <ProfileSearchContext.Provider value={searchResults}>{children}</ProfileSearchContext.Provider>\n )\n}\n\ninterface SearchViewProps {\n resultIndex: number | null\n numResults: number | null\n selectNext: () => void\n selectPrev: () => void\n}\n\nexport const SearchView = memo(\n ({numResults, resultIndex, selectNext, selectPrev}: SearchViewProps) => {\n const theme = useTheme()\n const style = getStyle(theme)\n const searchIsActive = useAtom(searchIsActiveAtom)\n const searchQuery = useAtom(searchQueryAtom)\n const setSearchQuery = searchQueryAtom.set\n const setSearchIsActive = searchIsActiveAtom.set\n\n const onInput = useCallback(\n (ev: Event) => {\n const value = (ev.target as HTMLInputElement).value\n setSearchQuery(value)\n },\n [setSearchQuery],\n )\n\n const inputRef = useRef<HTMLInputElement | null>(null)\n\n const close = useCallback(() => setSearchIsActive(false), [setSearchIsActive])\n\n const selectPrevOrNextResult = useCallback(\n (ev: KeyboardEvent) => {\n if (ev.shiftKey) {\n selectPrev()\n } else {\n selectNext()\n }\n },\n [selectPrev, selectNext],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent) => {\n ev.stopPropagation()\n\n // Hitting Esc should close the search box\n if (ev.key === 'Escape') {\n setSearchIsActive(false)\n }\n\n if (ev.key === 'Enter') {\n selectPrevOrNextResult(ev)\n }\n\n if (ev.key == 'f' && (ev.metaKey || ev.ctrlKey)) {\n if (inputRef.current) {\n // If the input is already focused, select all\n inputRef.current.select()\n }\n\n // It seems like when an input is focused, the browser find menu pops\n // up without this line. It seems like it's not sufficient to only\n // preventDefault in the window keydown handler.\n ev.preventDefault()\n }\n },\n [setSearchIsActive, selectPrevOrNextResult],\n )\n\n useEffect(() => {\n const onWindowKeyDown = (ev: KeyboardEvent) => {\n // Cmd+F or Ctrl+F open the search box\n if (ev.key == 'f' && (ev.metaKey || ev.ctrlKey)) {\n // Prevent the browser's search menu from appearing\n ev.preventDefault()\n\n if (inputRef.current) {\n // If the search box is already open, then re-select it immediately.\n inputRef.current.select()\n } else {\n // Otherwise, focus the search, then focus the input on the next\n // frame, when the search box should have mounted.\n setSearchIsActive(true)\n requestAnimationFrame(() => {\n if (inputRef.current) {\n inputRef.current.select()\n }\n })\n }\n }\n }\n\n window.addEventListener('keydown', onWindowKeyDown)\n return () => {\n window.removeEventListener('keydown', onWindowKeyDown)\n }\n }, [setSearchIsActive])\n\n if (!searchIsActive) return null\n\n return (\n <div className={css(style.searchView)}>\n <span className={css(style.icon)}>🔍</span>\n <span className={css(style.inputContainer)}>\n <input\n className={css(style.input)}\n value={searchQuery}\n onInput={onInput}\n onKeyDown={onKeyDown}\n onKeyUp={stopPropagation}\n onKeyPress={stopPropagation}\n ref={inputRef}\n />\n </span>\n {numResults != null && (\n <Fragment>\n <span className={css(style.resultCount)}>\n {resultIndex == null ? '?' : resultIndex + 1}/{numResults}\n </span>\n <button className={css(style.icon, style.button)} onClick={selectPrev}>\n ⬅️\n </button>\n <button className={css(style.icon, style.button)} onClick={selectNext}>\n ➡️\n </button>\n </Fragment>\n )}\n <svg\n className={css(style.icon)}\n onClick={close}\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M4.99999 4.16217L11.6427 10.8048M11.6427 4.16217L4.99999 10.8048\"\n stroke={theme.altFgSecondaryColor}\n />\n </svg>\n </div>\n )\n },\n)\n\nconst getStyle = withTheme(theme =>\n StyleSheet.create({\n searchView: {\n position: 'absolute',\n top: 0,\n right: 10,\n height: Sizes.TOOLBAR_HEIGHT,\n width: 16 * 13,\n borderWidth: 2,\n borderColor: theme.altFgPrimaryColor,\n borderStyle: 'solid',\n fontSize: FontSize.LABEL,\n boxSizing: 'border-box',\n background: theme.altBgSecondaryColor,\n color: theme.altFgPrimaryColor,\n display: 'flex',\n alignItems: 'center',\n },\n inputContainer: {\n flexShrink: 1,\n flexGrow: 1,\n display: 'flex',\n },\n input: {\n width: '100%',\n border: 'none',\n background: 'none',\n fontSize: FontSize.LABEL,\n lineHeight: `${Sizes.TOOLBAR_HEIGHT}px`,\n color: theme.altFgPrimaryColor,\n ':focus': {\n border: 'none',\n outline: 'none',\n },\n '::selection': {\n color: theme.altFgPrimaryColor,\n background: theme.selectionPrimaryColor,\n },\n },\n resultCount: {\n verticalAlign: 'middle',\n },\n icon: {\n flexShrink: 0,\n verticalAlign: 'middle',\n height: '100%',\n margin: '0px 2px 0px 2px',\n fontSize: FontSize.LABEL,\n },\n button: {\n display: 'inline',\n background: 'none',\n border: 'none',\n padding: 0,\n ':focus': {\n outline: 'none',\n },\n },\n }),\n)\n","// Returns `input` with hex escapes expanded (e.g. `\\20` becomes ` `.)\n//\n\nimport {Frame, SymbolRemapper} from './profile'\n\n// NOTE: This will fail to ignore escaped backslahes (e.g. `\\\\20`).\nfunction unescapeHex(input: string): string {\n return input.replace(/\\\\([a-fA-F0-9]{2})/g, (_match, group) => {\n const scalar = parseInt(group, 16)\n return String.fromCharCode(scalar)\n })\n}\n\n// This imports symbol maps generated by emscripten using the \"--emit-symbol-map\" flag.\n// It allows you to visualize a profile captured in a release build as long as you also\n// have the associated symbol map. To do this, first drop the profile into speedscope\n// and then drop the symbol map. After the second drop, the symbols will be remapped to\n// their original names.\nexport function importEmscriptenSymbolMap(contents: string): SymbolRemapper | null {\n const lines = contents.split('\\n')\n if (!lines.length) return null\n\n // Remove a trailing blank line if there is one\n if (lines[lines.length - 1] === '') lines.pop()\n if (!lines.length) return null\n\n const map = new Map<string, string>()\n const intRegex = /^(\\d+):(.+)$/\n const idRegex = /^([\\$\\w]+):([\\$\\w-]+)$/\n\n for (const line of lines) {\n // Match lines like \"103:__ZN8tinyxml210XMLCommentD0Ev\"\n const intMatch = intRegex.exec(line)\n if (intMatch) {\n map.set(`wasm-function[${intMatch[1]}]`, unescapeHex(intMatch[2]))\n continue\n }\n\n // Match lines like \"u6:__ZN8tinyxml210XMLCommentD0Ev\"\n const idMatch = idRegex.exec(line)\n if (idMatch) {\n map.set(idMatch[1], unescapeHex(idMatch[2]))\n continue\n }\n\n return null\n }\n\n return (frame: Frame) => {\n if (!map.has(frame.name)) {\n return null\n }\n\n return {name: map.get(frame.name)}\n }\n}\n","import {h} from 'preact'\nimport {StyleSheet, css} from 'aphrodite'\nimport {FontSize} from './style'\nimport {useTheme, withTheme} from './themes/theme'\n\ninterface ColorChitProps {\n color: string\n}\n\nexport function ColorChit(props: ColorChitProps) {\n const style = getStyle(useTheme())\n return <span className={css(style.stackChit)} style={{backgroundColor: props.color}} />\n}\n\nconst getStyle = withTheme(theme =>\n StyleSheet.create({\n stackChit: {\n position: 'relative',\n top: -1,\n display: 'inline-block',\n verticalAlign: 'middle',\n marginRight: '0.5em',\n border: `1px solid ${theme.fgSecondaryColor}`,\n width: FontSize.LABEL - 2,\n height: FontSize.LABEL - 2,\n },\n }),\n)\n","// A simple implementation of an efficient scrolling list view which\n// renders only items within the viewport + a couple extra items.\n\nimport {h, JSX} from 'preact'\nimport {useState, useCallback, useRef, useMemo, useEffect} from 'preact/hooks'\n\nexport interface ListItem {\n size: number\n}\n\ninterface RangeResult {\n firstVisibleIndex: number\n lastVisibleIndex: number\n invisiblePrefixSize: number\n}\n\ninterface ScrollableListViewProps {\n items: ListItem[]\n axis: 'x' | 'y'\n renderItems: (\n firstVisibleIndex: number,\n lastVisibleIndex: number,\n ) => JSX.Element | JSX.Element[] | null\n className?: string\n initialIndexInView?: number | null\n}\n\nexport const ScrollableListView = ({\n items,\n axis,\n renderItems,\n className,\n initialIndexInView,\n}: ScrollableListViewProps) => {\n const [viewportSize, setViewportSize] = useState<number | null>(null)\n const [viewportScrollOffset, setViewportScrollOffset] = useState<number>(0)\n\n const viewportRef = useRef<HTMLDivElement | null>(null)\n\n const widthOrHeight = axis === 'x' ? 'width' : 'height'\n const leftOrTop = axis === 'x' ? 'left' : 'top'\n const scrollLeftOrScrollTop = axis === 'x' ? 'scrollLeft' : 'scrollTop'\n\n // This is kind of a weird hack, but I'm not sure what the better of doing something like this is.\n const offset = initialIndexInView\n ? items.reduce((a, b, i) => (i < initialIndexInView ? a + b.size : a), 0)\n : 0\n const initialScroll = useRef<number | null>(offset)\n\n const viewportCallback = useCallback(\n (viewport: HTMLDivElement | null) => {\n if (viewport) {\n requestAnimationFrame(() => {\n setViewportSize(viewport.getBoundingClientRect()[widthOrHeight])\n if (initialScroll.current != null) {\n viewport.scrollTo({[leftOrTop]: initialScroll.current})\n initialScroll.current = null\n }\n })\n } else {\n setViewportSize(null)\n }\n viewportRef.current = viewport\n },\n [setViewportSize, widthOrHeight, leftOrTop],\n )\n\n const rangeResult: RangeResult | null = useMemo(() => {\n if (viewportRef.current == null || viewportSize == null || viewportScrollOffset == null) {\n return null\n }\n\n // We render items up to a quarter viewport height outside of the\n // viewport both above and below to prevent flickering.\n const minY = viewportScrollOffset - viewportSize / 4\n const maxY = viewportScrollOffset + viewportSize + viewportSize / 4\n\n let total = 0\n let invisiblePrefixSize = 0\n\n let i = 0\n for (; i < items.length; i++) {\n const item = items[i]\n invisiblePrefixSize = total\n total += item.size\n if (total >= minY) {\n break\n }\n }\n\n const firstVisibleIndex = i\n\n for (; i < items.length; i++) {\n const item = items[i]\n total += item.size\n if (total >= maxY) {\n break\n }\n }\n\n const lastVisibleIndex = Math.min(i, items.length - 1)\n\n return {\n firstVisibleIndex,\n lastVisibleIndex,\n invisiblePrefixSize,\n }\n }, [viewportSize, viewportScrollOffset, items])\n\n const totalSize = useMemo(() => items.reduce((a, b) => a + b.size, 0), [items])\n\n const onViewportScroll = useCallback(() => {\n if (viewportRef.current != null) {\n setViewportScrollOffset(viewportRef.current[scrollLeftOrScrollTop])\n }\n }, [scrollLeftOrScrollTop])\n\n useEffect(() => {\n const resizeListener = () => {\n if (viewportRef.current != null) {\n setViewportSize(viewportRef.current.getBoundingClientRect()[widthOrHeight])\n }\n }\n\n window.addEventListener('resize', resizeListener)\n return () => {\n window.removeEventListener('resize', resizeListener)\n }\n }, [widthOrHeight])\n\n const visibleItems = useMemo(() => {\n return rangeResult\n ? renderItems(rangeResult.firstVisibleIndex, rangeResult.lastVisibleIndex)\n : null\n }, [renderItems, rangeResult])\n\n const content = useMemo(() => {\n return (\n <div style={{height: totalSize}}>\n <div style={{transform: `translateY(${rangeResult?.invisiblePrefixSize || 0}px)`}}>\n {visibleItems}\n </div>\n </div>\n )\n }, [rangeResult, visibleItems, totalSize])\n\n return (\n <div className={className} ref={viewportCallback} onScroll={onViewportScroll}>\n {content}\n </div>\n )\n}\n","import {h, JSX, ComponentChild} from 'preact'\nimport {StyleSheet, css} from 'aphrodite'\nimport {Profile, Frame} from '../lib/profile'\nimport {formatPercent} from '../lib/utils'\nimport {FontSize, Sizes, commonStyle} from './style'\nimport {ColorChit} from './color-chit'\nimport {ListItem, ScrollableListView} from './scrollable-list-view'\nimport {createGetCSSColorForFrame, getFrameToColorBucket} from '../app-state/getters'\nimport {memo} from 'preact/compat'\nimport {useCallback, useMemo, useContext} from 'preact/hooks'\nimport {SandwichViewContext} from './sandwich-view'\nimport {Color} from '../lib/color'\nimport {useTheme, withTheme} from './themes/theme'\nimport {\n SortDirection,\n SortMethod,\n SortField,\n profileGroupAtom,\n tableSortMethodAtom,\n searchIsActiveAtom,\n searchQueryAtom,\n} from '../app-state'\nimport {useAtom} from '../lib/atom'\nimport {ActiveProfileState} from '../app-state/active-profile-state'\n\ninterface HBarProps {\n perc: number\n}\n\nfunction HBarDisplay(props: HBarProps) {\n const style = getStyle(useTheme())\n\n return (\n <div className={css(style.hBarDisplay)}>\n <div className={css(style.hBarDisplayFilled)} style={{width: `${props.perc}%`}} />\n </div>\n )\n}\n\ninterface SortIconProps {\n activeDirection: SortDirection | null\n}\n\nfunction SortIcon(props: SortIconProps) {\n const theme = useTheme()\n const style = getStyle(theme)\n\n const {activeDirection} = props\n const upFill =\n activeDirection === SortDirection.ASCENDING ? theme.fgPrimaryColor : theme.fgSecondaryColor\n const downFill =\n activeDirection === SortDirection.DESCENDING ? theme.fgPrimaryColor : theme.fgSecondaryColor\n\n return (\n <svg\n width=\"8\"\n height=\"10\"\n viewBox=\"0 0 8 10\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={css(style.sortIcon)}\n >\n <path d=\"M0 4L4 0L8 4H0Z\" fill={upFill} />\n <path d=\"M0 4L4 0L8 4H0Z\" transform=\"translate(0 10) scale(1 -1)\" fill={downFill} />\n </svg>\n )\n}\n\ninterface ProfileTableRowViewProps {\n frame: Frame\n matchedRanges: [number, number][] | null\n index: number\n profile: Profile\n selectedFrame: Frame | null\n setSelectedFrame: (f: Frame) => void\n getCSSColorForFrame: (frame: Frame) => string\n}\n\nfunction highlightRanges(\n text: string,\n ranges: [number, number][],\n highlightedClassName: string,\n): JSX.Element {\n const spans: ComponentChild[] = []\n let last = 0\n for (let range of ranges) {\n spans.push(text.slice(last, range[0]))\n spans.push(<span className={highlightedClassName}>{text.slice(range[0], range[1])}</span>)\n last = range[1]\n }\n spans.push(text.slice(last))\n\n return <span>{spans}</span>\n}\n\nconst ProfileTableRowView = ({\n frame,\n matchedRanges,\n profile,\n index,\n selectedFrame,\n setSelectedFrame,\n getCSSColorForFrame,\n}: ProfileTableRowViewProps) => {\n const style = getStyle(useTheme())\n\n const totalWeight = frame.getTotalWeight()\n const selfWeight = frame.getSelfWeight()\n const totalPerc = (100.0 * totalWeight) / profile.getTotalNonIdleWeight()\n const selfPerc = (100.0 * selfWeight) / profile.getTotalNonIdleWeight()\n\n const selected = frame === selectedFrame\n\n // We intentionally use index rather than frame.key here as the tr key\n // in order to re-use rows when sorting rather than creating all new elements.\n return (\n <tr\n key={`${index}`}\n onClick={setSelectedFrame.bind(null, frame)}\n className={css(\n style.tableRow,\n index % 2 == 0 && style.tableRowEven,\n selected && style.tableRowSelected,\n )}\n >\n <td className={css(style.numericCell)}>\n {profile.formatValue(totalWeight)} ({formatPercent(totalPerc)})\n <HBarDisplay perc={totalPerc} />\n </td>\n <td className={css(style.numericCell)}>\n {profile.formatValue(selfWeight)} ({formatPercent(selfPerc)})\n <HBarDisplay perc={selfPerc} />\n </td>\n <td title={frame.file} className={css(style.textCell)}>\n <ColorChit color={getCSSColorForFrame(frame)} />\n {matchedRanges\n ? highlightRanges(\n frame.name,\n matchedRanges,\n css(style.matched, selected && style.matchedSelected),\n )\n : frame.name}\n </td>\n </tr>\n )\n}\n\ninterface ProfileTableViewProps {\n profile: Profile\n selectedFrame: Frame | null\n getCSSColorForFrame: (frame: Frame) => string\n sortMethod: SortMethod\n setSelectedFrame: (frame: Frame | null) => void\n setSortMethod: (sortMethod: SortMethod) => void\n searchQuery: string\n searchIsActive: boolean\n}\n\nexport const ProfileTableView = memo(\n ({\n profile,\n sortMethod,\n setSortMethod,\n selectedFrame,\n setSelectedFrame,\n getCSSColorForFrame,\n searchQuery,\n searchIsActive,\n }: ProfileTableViewProps) => {\n const style = getStyle(useTheme())\n\n const onSortClick = useCallback(\n (field: SortField, ev: MouseEvent) => {\n ev.preventDefault()\n\n if (sortMethod.field == field) {\n // Toggle\n setSortMethod({\n field,\n direction:\n sortMethod.direction === SortDirection.ASCENDING\n ? SortDirection.DESCENDING\n : SortDirection.ASCENDING,\n })\n } else {\n // Set a sane default\n switch (field) {\n case SortField.SYMBOL_NAME: {\n setSortMethod({field, direction: SortDirection.ASCENDING})\n break\n }\n case SortField.SELF: {\n setSortMethod({field, direction: SortDirection.DESCENDING})\n break\n }\n case SortField.TOTAL: {\n setSortMethod({field, direction: SortDirection.DESCENDING})\n break\n }\n }\n }\n },\n [sortMethod, setSortMethod],\n )\n\n const sandwichContext = useContext(SandwichViewContext)\n\n const renderItems = useCallback(\n (firstIndex: number, lastIndex: number) => {\n if (!sandwichContext) return null\n\n const rows: JSX.Element[] = []\n\n for (let i = firstIndex; i <= lastIndex; i++) {\n const frame = sandwichContext.rowList[i]\n const match = sandwichContext.getSearchMatchForFrame(frame)\n rows.push(\n ProfileTableRowView({\n frame,\n matchedRanges: match == null ? null : match,\n index: i,\n profile: profile,\n selectedFrame: selectedFrame,\n setSelectedFrame: setSelectedFrame,\n getCSSColorForFrame: getCSSColorForFrame,\n }),\n )\n }\n\n if (rows.length === 0) {\n if (searchIsActive) {\n rows.push(\n <tr>\n <td className={css(style.emptyState)}>\n No symbol names match query \"{searchQuery}\".\n </td>\n </tr>,\n )\n } else {\n rows.push(\n <tr>\n <td className={css(style.emptyState)}>No symbols found.</td>\n </tr>,\n )\n }\n }\n\n return <table className={css(style.tableView)}>{rows}</table>\n },\n [\n sandwichContext,\n profile,\n selectedFrame,\n setSelectedFrame,\n getCSSColorForFrame,\n searchIsActive,\n searchQuery,\n style.emptyState,\n style.tableView,\n ],\n )\n\n const listItems: ListItem[] = useMemo(\n () =>\n sandwichContext == null\n ? []\n : sandwichContext.rowList.map(f => ({size: Sizes.FRAME_HEIGHT})),\n [sandwichContext],\n )\n\n const onTotalClick = useCallback((ev: MouseEvent) => onSortClick(SortField.TOTAL, ev), [\n onSortClick,\n ])\n const onSelfClick = useCallback((ev: MouseEvent) => onSortClick(SortField.SELF, ev), [\n onSortClick,\n ])\n const onSymbolNameClick = useCallback(\n (ev: MouseEvent) => onSortClick(SortField.SYMBOL_NAME, ev),\n [onSortClick],\n )\n\n return (\n <div className={css(commonStyle.vbox, style.profileTableView)}>\n <table className={css(style.tableView)}>\n <thead className={css(style.tableHeader)}>\n <tr>\n <th className={css(style.numericCell)} onClick={onTotalClick}>\n <SortIcon\n activeDirection={\n sortMethod.field === SortField.TOTAL ? sortMethod.direction : null\n }\n />\n Total\n </th>\n <th className={css(style.numericCell)} onClick={onSelfClick}>\n <SortIcon\n activeDirection={\n sortMethod.field === SortField.SELF ? sortMethod.direction : null\n }\n />\n Self\n </th>\n <th className={css(style.textCell)} onClick={onSymbolNameClick}>\n <SortIcon\n activeDirection={\n sortMethod.field === SortField.SYMBOL_NAME ? sortMethod.direction : null\n }\n />\n Symbol Name\n </th>\n </tr>\n </thead>\n </table>\n <ScrollableListView\n axis={'y'}\n items={listItems}\n className={css(style.scrollView)}\n renderItems={renderItems}\n initialIndexInView={\n selectedFrame == null ? null : sandwichContext?.getIndexForFrame(selectedFrame)\n }\n />\n </div>\n )\n },\n)\n\nconst getStyle = withTheme(theme =>\n StyleSheet.create({\n profileTableView: {\n background: theme.bgPrimaryColor,\n height: '100%',\n },\n scrollView: {\n overflowY: 'auto',\n overflowX: 'hidden',\n flexGrow: 1,\n '::-webkit-scrollbar': {\n background: theme.bgPrimaryColor,\n },\n '::-webkit-scrollbar-thumb': {\n background: theme.fgSecondaryColor,\n borderRadius: 20,\n border: `3px solid ${theme.bgPrimaryColor}`,\n ':hover': {\n background: theme.fgPrimaryColor,\n },\n },\n },\n tableView: {\n width: '100%',\n fontSize: FontSize.LABEL,\n background: theme.bgPrimaryColor,\n },\n tableHeader: {\n borderBottom: `2px solid ${theme.bgSecondaryColor}`,\n textAlign: 'left',\n color: theme.fgPrimaryColor,\n userSelect: 'none',\n },\n sortIcon: {\n position: 'relative',\n top: 1,\n marginRight: Sizes.FRAME_HEIGHT / 4,\n },\n tableRow: {\n background: theme.bgPrimaryColor,\n height: Sizes.FRAME_HEIGHT,\n },\n tableRowEven: {\n background: theme.bgSecondaryColor,\n },\n tableRowSelected: {\n background: theme.selectionPrimaryColor,\n color: theme.altFgPrimaryColor,\n },\n numericCell: {\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n position: 'relative',\n textAlign: 'right',\n paddingRight: Sizes.FRAME_HEIGHT,\n width: 6 * Sizes.FRAME_HEIGHT,\n minWidth: 6 * Sizes.FRAME_HEIGHT,\n },\n textCell: {\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n width: '100%',\n maxWidth: 0,\n },\n hBarDisplay: {\n position: 'absolute',\n background: Color.fromCSSHex(theme.weightColor).withAlpha(0.2).toCSS(),\n bottom: 2,\n height: 2,\n width: `calc(100% - ${2 * Sizes.FRAME_HEIGHT}px)`,\n right: Sizes.FRAME_HEIGHT,\n },\n hBarDisplayFilled: {\n height: '100%',\n position: 'absolute',\n background: theme.weightColor,\n right: 0,\n },\n matched: {\n borderBottom: `2px solid ${theme.fgPrimaryColor}`,\n },\n matchedSelected: {\n borderColor: theme.altFgPrimaryColor,\n },\n emptyState: {\n textAlign: 'center',\n fontWeight: 'bold',\n },\n }),\n)\n\ninterface ProfileTableViewContainerProps {\n activeProfileState: ActiveProfileState\n}\n\nexport const ProfileTableViewContainer = memo((ownProps: ProfileTableViewContainerProps) => {\n const {activeProfileState} = ownProps\n const {profile, sandwichViewState} = activeProfileState\n if (!profile) throw new Error('profile missing')\n const tableSortMethod = useAtom(tableSortMethodAtom)\n const theme = useTheme()\n const {callerCallee} = sandwichViewState\n const selectedFrame = callerCallee ? callerCallee.selectedFrame : null\n const frameToColorBucket = getFrameToColorBucket(profile)\n const getCSSColorForFrame = createGetCSSColorForFrame({theme, frameToColorBucket})\n\n const setSelectedFrame = useCallback((selectedFrame: Frame | null) => {\n profileGroupAtom.setSelectedFrame(selectedFrame)\n }, [])\n const searchIsActive = useAtom(searchIsActiveAtom)\n const searchQuery = useAtom(searchQueryAtom)\n\n return (\n <ProfileTableView\n profile={profile}\n selectedFrame={selectedFrame}\n getCSSColorForFrame={getCSSColorForFrame}\n sortMethod={tableSortMethod}\n setSelectedFrame={setSelectedFrame}\n setSortMethod={tableSortMethodAtom.set}\n searchIsActive={searchIsActive}\n searchQuery={searchQuery}\n />\n )\n})\n","import {Frame, CallTreeNode} from './profile'\n\nimport {lastOf} from './utils'\nimport {clamp, Rect, Vec2} from './math'\n\nexport interface FlamechartFrame {\n node: CallTreeNode\n start: number\n end: number\n parent: FlamechartFrame | null\n children: FlamechartFrame[]\n}\n\ntype StackLayer = FlamechartFrame[]\n\ninterface FlamechartDataSource {\n getTotalWeight(): number\n\n formatValue(v: number): string\n\n forEachCall(\n openFrame: (node: CallTreeNode, value: number) => void,\n closeFrame: (node: CallTreeNode, value: number) => void,\n ): void\n\n getColorBucketForFrame(f: Frame): number\n}\n\nexport class Flamechart {\n // Bottom to top\n private layers: StackLayer[] = []\n private totalWeight: number = 0\n private minFrameWidth: number = 1\n\n getTotalWeight() {\n return this.totalWeight\n }\n getLayers() {\n return this.layers\n }\n getColorBucketForFrame(frame: Frame) {\n return this.source.getColorBucketForFrame(frame)\n }\n getMinFrameWidth() {\n return this.minFrameWidth\n }\n formatValue(v: number) {\n return this.source.formatValue(v)\n }\n\n getClampedViewportWidth(viewportWidth: number) {\n const maxWidth = this.getTotalWeight()\n\n // In order to avoid floating point error, we cap the maximum zoom. In\n // particular, it's important that at the maximum zoom level, the total\n // trace size + a viewport width is not equal to the trace size due to\n // floating point rounding.\n //\n // For instance, if the profile's total weight is 2^60, and the viewport\n // size is 1, trying to move one viewport width right will result in no\n // change because 2^60 + 1 = 2^60 in floating point arithmetic. JavaScript\n // numbers are 64 bit floats, and therefore have 53 mantissa bits. You can\n // see this for yourself in the console. Try:\n //\n // > Math.pow(2, 60) + 1 === Math.pow(2, 60)\n // true\n // > Math.pow(2, 53) + 1 === Math.pow(2, 53)\n // true\n // > Math.pow(2, 52) + 1 === Math.pow(2, 52)\n // false\n //\n // We use 2^40 as a cap instead, since we want to be able to make small\n // adjustments within a viewport width.\n //\n // For reference, this will still allow you to zoom until 1 nanosecond fills\n // the screen in a profile with a duration of over 18 minutes.\n //\n // > Math.pow(2, 40) / (60 * Math.pow(10, 9))\n // 18.325193796266667\n //\n const maxZoom = Math.pow(2, 40)\n\n // In addition to capping zoom to avoid floating point error, we further cap\n // zoom to avoid letting you zoom in so that the smallest element more than\n // fills the screen, since that probably isn't useful. The final zoom cap is\n // determined by the minimum zoom of either 2^40x zoom or the necessary zoom\n // for the smallest frame to fill the screen three times.\n const minWidth = clamp(3 * this.getMinFrameWidth(), maxWidth / maxZoom, maxWidth)\n\n return clamp(viewportWidth, minWidth, maxWidth)\n }\n\n // Given a desired config-space viewport rectangle, clamp the rectangle so\n // that it fits within the given flamechart. This prevents the viewport from\n // extending past the bounds of the flamechart or zooming in too far.\n getClampedConfigSpaceViewportRect({\n configSpaceViewportRect,\n renderInverted,\n }: {\n configSpaceViewportRect: Rect\n renderInverted?: boolean\n }) {\n const configSpaceSize = new Vec2(this.getTotalWeight(), this.getLayers().length)\n const width = this.getClampedViewportWidth(configSpaceViewportRect.size.x)\n const size = configSpaceViewportRect.size.withX(width)\n const origin = Vec2.clamp(\n configSpaceViewportRect.origin,\n new Vec2(0, renderInverted ? 0 : -1),\n Vec2.max(Vec2.zero, configSpaceSize.minus(size).plus(new Vec2(0, 1))),\n )\n return new Rect(origin, configSpaceViewportRect.size.withX(width))\n }\n\n constructor(private source: FlamechartDataSource) {\n const stack: FlamechartFrame[] = []\n const openFrame = (node: CallTreeNode, value: number) => {\n const parent = lastOf(stack)\n const frame: FlamechartFrame = {\n node,\n parent,\n children: [],\n start: value,\n end: value,\n }\n if (parent) {\n parent.children.push(frame)\n }\n stack.push(frame)\n }\n\n this.minFrameWidth = Infinity\n const closeFrame = (node: CallTreeNode, value: number) => {\n console.assert(stack.length > 0)\n const stackTop = stack.pop()!\n stackTop.end = value\n if (stackTop.end - stackTop.start === 0) return\n const layerIndex = stack.length\n while (this.layers.length <= layerIndex) this.layers.push([])\n this.layers[layerIndex].push(stackTop)\n this.minFrameWidth = Math.min(this.minFrameWidth, stackTop.end - stackTop.start)\n }\n\n this.totalWeight = source.getTotalWeight()\n source.forEachCall(openFrame, closeFrame)\n\n if (!isFinite(this.minFrameWidth)) this.minFrameWidth = 1\n }\n}\n","import {Flamechart} from '../lib/flamechart'\nimport {RectangleBatch, RectangleBatchRenderer} from './rectangle-batch-renderer'\nimport {Vec2, Rect, AffineTransform} from '../lib/math'\nimport {Color} from '../lib/color'\nimport {KeyedSet} from '../lib/utils'\nimport {RowAtlas} from './row-atlas'\nimport {Graphics} from './graphics'\nimport {FlamechartColorPassRenderer} from './flamechart-color-pass-renderer'\nimport {renderInto} from './utils'\n\nconst MAX_BATCH_SIZE = 10000\n\ninterface RangeTreeNode {\n getBounds(): Rect\n getRectCount(): number\n getChildren(): RangeTreeNode[]\n forEachLeafNodeWithinBounds(configSpaceBounds: Rect, cb: (leaf: RangeTreeLeafNode) => void): void\n}\n\nclass RangeTreeLeafNode implements RangeTreeNode {\n private children: RangeTreeNode[] = []\n\n constructor(\n private batch: RectangleBatch,\n private bounds: Rect,\n private numPrecedingRectanglesInRow: number,\n ) {}\n\n getBatch() {\n return this.batch\n }\n getBounds() {\n return this.bounds\n }\n getRectCount() {\n return this.batch.getRectCount()\n }\n getChildren() {\n return this.children\n }\n getParity() {\n return this.numPrecedingRectanglesInRow % 2\n }\n forEachLeafNodeWithinBounds(configSpaceBounds: Rect, cb: (leaf: RangeTreeLeafNode) => void) {\n if (!this.bounds.hasIntersectionWith(configSpaceBounds)) return\n cb(this)\n }\n}\n\nclass RangeTreeInteriorNode implements RangeTreeNode {\n private rectCount: number = 0\n private bounds: Rect\n constructor(private children: RangeTreeNode[]) {\n if (children.length === 0) {\n throw new Error('Empty interior node')\n }\n let minLeft = Infinity\n let maxRight = -Infinity\n let minTop = Infinity\n let maxBottom = -Infinity\n for (let child of children) {\n this.rectCount += child.getRectCount()\n const bounds = child.getBounds()\n minLeft = Math.min(minLeft, bounds.left())\n maxRight = Math.max(maxRight, bounds.right())\n minTop = Math.min(minTop, bounds.top())\n maxBottom = Math.max(maxBottom, bounds.bottom())\n }\n this.bounds = new Rect(\n new Vec2(minLeft, minTop),\n new Vec2(maxRight - minLeft, maxBottom - minTop),\n )\n }\n\n getBounds() {\n return this.bounds\n }\n getRectCount() {\n return this.rectCount\n }\n getChildren() {\n return this.children\n }\n\n forEachLeafNodeWithinBounds(configSpaceBounds: Rect, cb: (leaf: RangeTreeLeafNode) => void) {\n if (!this.bounds.hasIntersectionWith(configSpaceBounds)) return\n for (let child of this.children) {\n child.forEachLeafNodeWithinBounds(configSpaceBounds, cb)\n }\n }\n}\n\nexport interface FlamechartRendererProps {\n configSpaceSrcRect: Rect\n physicalSpaceDstRect: Rect\n renderOutlines: boolean\n}\n\ninterface FlamechartRowAtlasKeyInfo {\n stackDepth: number\n zoomLevel: number\n index: number\n}\n\nexport class FlamechartRowAtlasKey {\n readonly stackDepth: number\n readonly zoomLevel: number\n readonly index: number\n\n get key() {\n return `${this.stackDepth}_${this.index}_${this.zoomLevel}`\n }\n private constructor(options: FlamechartRowAtlasKeyInfo) {\n this.stackDepth = options.stackDepth\n this.zoomLevel = options.zoomLevel\n this.index = options.index\n }\n static getOrInsert(set: KeyedSet<FlamechartRowAtlasKey>, info: FlamechartRowAtlasKeyInfo) {\n return set.getOrInsert(new FlamechartRowAtlasKey(info))\n }\n}\n\nexport interface FlamechartRendererOptions {\n inverted: boolean\n}\n\nexport class FlamechartRenderer {\n private layers: RangeTreeNode[] = []\n\n constructor(\n private gl: Graphics.Context,\n private rowAtlas: RowAtlas<FlamechartRowAtlasKey>,\n private flamechart: Flamechart,\n private rectangleBatchRenderer: RectangleBatchRenderer,\n private colorPassRenderer: FlamechartColorPassRenderer,\n private options: FlamechartRendererOptions = {inverted: false},\n ) {\n const nLayers = flamechart.getLayers().length\n for (let stackDepth = 0; stackDepth < nLayers; stackDepth++) {\n const leafNodes: RangeTreeLeafNode[] = []\n const y = options.inverted ? nLayers - 1 - stackDepth : stackDepth\n\n let minLeft = Infinity\n let maxRight = -Infinity\n let batch = new RectangleBatch(this.gl)\n\n let rectCount = 0\n\n const layer = flamechart.getLayers()[stackDepth]\n\n for (let i = 0; i < layer.length; i++) {\n const frame = layer[i]\n if (batch.getRectCount() >= MAX_BATCH_SIZE) {\n leafNodes.push(\n new RangeTreeLeafNode(\n batch,\n new Rect(new Vec2(minLeft, y), new Vec2(maxRight - minLeft, 1)),\n rectCount,\n ),\n )\n minLeft = Infinity\n maxRight = -Infinity\n batch = new RectangleBatch(this.gl)\n }\n const configSpaceBounds = new Rect(\n new Vec2(frame.start, y),\n new Vec2(frame.end - frame.start, 1),\n )\n minLeft = Math.min(minLeft, configSpaceBounds.left())\n maxRight = Math.max(maxRight, configSpaceBounds.right())\n\n // We'll use the red channel to indicate the index to allow\n // us to separate adjacent rectangles within a row from one another,\n // the green channel to indicate the row,\n // and the blue channel to indicate the color bucket to render.\n // We add one to each so we have zero reserved for the background color.\n const color = new Color(\n (1 + (i % 255)) / 256,\n (1 + (stackDepth % 255)) / 256,\n (1 + this.flamechart.getColorBucketForFrame(frame.node.frame)) / 256,\n )\n batch.addRect(configSpaceBounds, color)\n rectCount++\n }\n\n if (batch.getRectCount() > 0) {\n leafNodes.push(\n new RangeTreeLeafNode(\n batch,\n new Rect(new Vec2(minLeft, y), new Vec2(maxRight - minLeft, 1)),\n rectCount,\n ),\n )\n }\n\n // TODO(jlfwong): Making this into a binary tree\n // range than a tree of always-height-two might make this run faster\n this.layers.push(new RangeTreeInteriorNode(leafNodes))\n }\n }\n\n private rectInfoTexture: Graphics.Texture | null = null\n getRectInfoTexture(width: number, height: number): Graphics.Texture {\n if (this.rectInfoTexture) {\n const texture = this.rectInfoTexture\n if (texture.width != width || texture.height != height) {\n texture.resize(width, height)\n }\n } else {\n this.rectInfoTexture = this.gl.createTexture(\n Graphics.TextureFormat.NEAREST_CLAMP,\n width,\n height,\n )\n }\n return this.rectInfoTexture\n }\n\n private rectInfoRenderTarget: Graphics.RenderTarget | null = null\n getRectInfoRenderTarget(width: number, height: number): Graphics.RenderTarget {\n const texture = this.getRectInfoTexture(width, height)\n if (this.rectInfoRenderTarget) {\n if (this.rectInfoRenderTarget.texture != texture) {\n this.rectInfoRenderTarget.texture.free()\n this.rectInfoRenderTarget.setColor(texture)\n }\n }\n if (!this.rectInfoRenderTarget) {\n this.rectInfoRenderTarget = this.gl.createRenderTarget(texture)\n }\n return this.rectInfoRenderTarget\n }\n\n free() {\n if (this.rectInfoRenderTarget) {\n this.rectInfoRenderTarget.free()\n }\n if (this.rectInfoTexture) {\n this.rectInfoTexture.free()\n }\n }\n\n private atlasKeys = new KeyedSet<FlamechartRowAtlasKey>()\n\n configSpaceBoundsForKey(key: FlamechartRowAtlasKey): Rect {\n const {stackDepth, zoomLevel, index} = key\n const configSpaceContentWidth = this.flamechart.getTotalWeight()\n\n const width = configSpaceContentWidth / Math.pow(2, zoomLevel)\n\n const nLayers = this.flamechart.getLayers().length\n const y = this.options.inverted ? nLayers - 1 - stackDepth : stackDepth\n return new Rect(new Vec2(width * index, y), new Vec2(width, 1))\n }\n\n render(props: FlamechartRendererProps) {\n const {configSpaceSrcRect, physicalSpaceDstRect} = props\n\n const atlasKeysToRender: FlamechartRowAtlasKey[] = []\n\n // We want to render the lowest resolution we can while still guaranteeing that the\n // atlas line is higher resolution than its corresponding destination rectangle on\n // the screen.\n const configToPhysical = AffineTransform.betweenRects(configSpaceSrcRect, physicalSpaceDstRect)\n if (configSpaceSrcRect.isEmpty()) {\n // Prevent an infinite loop\n return\n }\n\n let zoomLevel = 0\n while (true) {\n const key = FlamechartRowAtlasKey.getOrInsert(this.atlasKeys, {\n stackDepth: 0,\n zoomLevel,\n index: 0,\n })\n const configSpaceBounds = this.configSpaceBoundsForKey(key)\n const physicalBounds = configToPhysical.transformRect(configSpaceBounds)\n if (physicalBounds.width() < this.rowAtlas.getResolution()) {\n break\n }\n zoomLevel++\n }\n\n const top = Math.max(0, Math.floor(configSpaceSrcRect.top()))\n const bottom = Math.min(this.layers.length, Math.ceil(configSpaceSrcRect.bottom()))\n\n const configSpaceContentWidth = this.flamechart.getTotalWeight()\n const numAtlasEntriesPerLayer = Math.pow(2, zoomLevel)\n const left = Math.floor(\n (numAtlasEntriesPerLayer * configSpaceSrcRect.left()) / configSpaceContentWidth,\n )\n const right = Math.ceil(\n (numAtlasEntriesPerLayer * configSpaceSrcRect.right()) / configSpaceContentWidth,\n )\n\n const nLayers = this.flamechart.getLayers().length\n\n for (let y = top; y < bottom; y++) {\n for (let index = left; index <= right; index++) {\n const stackDepth = this.options.inverted ? nLayers - 1 - y : y\n const key = FlamechartRowAtlasKey.getOrInsert(this.atlasKeys, {\n stackDepth,\n zoomLevel,\n index,\n })\n const configSpaceBounds = this.configSpaceBoundsForKey(key)\n if (!configSpaceBounds.hasIntersectionWith(configSpaceSrcRect)) continue\n atlasKeysToRender.push(key)\n }\n }\n\n // TODO(jlfwong): When I switched the GL backend from regl to the port from\n // evanw/sky, rendering uncached even for massive documents seemed fast\n // enough. It's possible that the row cache is now unnecessary, but I'll\n // leave it around for now since it's not causing issues.\n\n const cacheCapacity = this.rowAtlas.getCapacity()\n const keysToRenderCached = atlasKeysToRender.slice(0, cacheCapacity)\n const keysToRenderUncached = atlasKeysToRender.slice(cacheCapacity)\n\n // Fill the cache\n this.rowAtlas.writeToAtlasIfNeeded(keysToRenderCached, (textureDstRect, key) => {\n const configSpaceBounds = this.configSpaceBoundsForKey(key)\n this.layers[key.stackDepth].forEachLeafNodeWithinBounds(configSpaceBounds, leaf => {\n this.rectangleBatchRenderer.render({\n batch: leaf.getBatch(),\n configSpaceSrcRect: configSpaceBounds,\n physicalSpaceDstRect: textureDstRect,\n })\n })\n })\n\n const renderTarget = this.getRectInfoRenderTarget(\n physicalSpaceDstRect.width(),\n physicalSpaceDstRect.height(),\n )\n\n renderInto(this.gl, renderTarget, () => {\n this.gl.clear(new Graphics.Color(0, 0, 0, 0))\n\n const viewportRect = new Rect(\n Vec2.zero,\n new Vec2(this.gl.viewport.width, this.gl.viewport.height),\n )\n const configToViewport = AffineTransform.betweenRects(configSpaceSrcRect, viewportRect)\n\n // Render from the cache\n for (let key of keysToRenderCached) {\n const configSpaceSrcRect = this.configSpaceBoundsForKey(key)\n this.rowAtlas.renderViaAtlas(key, configToViewport.transformRect(configSpaceSrcRect))\n }\n\n // Render entries that didn't make it into the cache\n for (let key of keysToRenderUncached) {\n const configSpaceBounds = this.configSpaceBoundsForKey(key)\n const physicalBounds = configToViewport.transformRect(configSpaceBounds)\n this.layers[key.stackDepth].forEachLeafNodeWithinBounds(configSpaceBounds, leaf => {\n this.rectangleBatchRenderer.render({\n batch: leaf.getBatch(),\n configSpaceSrcRect: configSpaceBounds,\n physicalSpaceDstRect: physicalBounds,\n })\n })\n }\n })\n\n const rectInfoTexture = this.getRectInfoTexture(\n physicalSpaceDstRect.width(),\n physicalSpaceDstRect.height(),\n )\n\n this.colorPassRenderer.render({\n rectInfoTexture,\n srcRect: new Rect(Vec2.zero, new Vec2(rectInfoTexture.width, rectInfoTexture.height)),\n dstRect: physicalSpaceDstRect,\n renderOutlines: props.renderOutlines,\n })\n }\n}\n","import {StyleSheet} from 'aphrodite'\nimport {FontSize, Sizes} from './style'\nimport {withTheme} from './themes/theme'\n\nexport const getFlamechartStyle = withTheme(theme =>\n StyleSheet.create({\n hoverCount: {\n color: theme.weightColor,\n },\n fill: {\n width: '100%',\n height: '100%',\n position: 'absolute',\n left: 0,\n top: 0,\n },\n minimap: {\n height: Sizes.MINIMAP_HEIGHT,\n borderBottom: `${Sizes.SEPARATOR_HEIGHT}px solid ${theme.fgSecondaryColor}`,\n },\n panZoomView: {\n flex: 1,\n },\n\n detailView: {\n display: 'grid',\n height: Sizes.DETAIL_VIEW_HEIGHT,\n overflow: 'hidden',\n gridTemplateColumns: '120px 120px 1fr',\n gridTemplateRows: 'repeat(4, 1fr)',\n borderTop: `${Sizes.SEPARATOR_HEIGHT}px solid ${theme.fgSecondaryColor}`,\n fontSize: FontSize.LABEL,\n position: 'absolute',\n background: theme.bgPrimaryColor,\n width: '100vw',\n bottom: 0,\n },\n stackTraceViewPadding: {\n padding: 5,\n },\n stackTraceView: {\n height: Sizes.DETAIL_VIEW_HEIGHT,\n lineHeight: `${FontSize.LABEL + 2}px`,\n overflow: 'auto',\n '::-webkit-scrollbar': {\n background: theme.bgPrimaryColor,\n },\n '::-webkit-scrollbar-thumb': {\n background: theme.fgSecondaryColor,\n borderRadius: 20,\n border: `3px solid ${theme.bgPrimaryColor}`,\n ':hover': {\n background: theme.fgPrimaryColor,\n },\n },\n },\n stackLine: {\n whiteSpace: 'nowrap',\n },\n stackFileLine: {\n color: theme.fgSecondaryColor,\n },\n statsTable: {\n display: 'grid',\n gridTemplateColumns: '1fr 1fr',\n gridTemplateRows: `repeat(3, ${FontSize.LABEL + 10}px)`,\n gridGap: '1px 1px',\n textAlign: 'center',\n paddingRight: 1,\n },\n statsTableHeader: {\n gridColumn: '1 / 3',\n },\n statsTableCell: {\n position: 'relative',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n },\n thisInstanceCell: {\n background: theme.selectionPrimaryColor,\n color: theme.altFgPrimaryColor,\n },\n allInstancesCell: {\n background: theme.selectionSecondaryColor,\n color: theme.altFgPrimaryColor,\n },\n barDisplay: {\n position: 'absolute',\n top: 0,\n left: 0,\n background: 'rgba(0, 0, 0, 0.2)',\n width: '100%',\n },\n }),\n)\n","import {findValueBisect} from './utils'\n\nexport const ELLIPSIS = '\\u2026'\n\n// NOTE: This blindly assumes the same result across contexts.\nconst measureTextCache = new Map<string, number>()\n\nlet lastDevicePixelRatio = -1\nexport function cachedMeasureTextWidth(ctx: CanvasRenderingContext2D, text: string): number {\n if (window.devicePixelRatio !== lastDevicePixelRatio) {\n // This cache is no longer valid!\n measureTextCache.clear()\n lastDevicePixelRatio = window.devicePixelRatio\n }\n if (!measureTextCache.has(text)) {\n measureTextCache.set(text, ctx.measureText(text).width)\n }\n return measureTextCache.get(text)!\n}\n\ninterface TrimmedTextResult {\n trimmedString: string\n trimmedLength: number\n prefixLength: number\n suffixLength: number\n originalLength: number\n originalString: string\n}\n\n// Trim text, placing an ellipsis in the middle, with a slight bias towards\n// keeping text from the beginning rather than the end\nexport function buildTrimmedText(text: string, length: number): TrimmedTextResult {\n if (text.length <= length) {\n return {\n trimmedString: text,\n trimmedLength: text.length,\n prefixLength: text.length,\n suffixLength: 0,\n originalString: text,\n originalLength: text.length,\n }\n }\n\n let prefixLength = Math.floor(length / 2)\n const suffixLength = length - prefixLength - 1\n const prefix = text.substr(0, prefixLength)\n const suffix = text.substr(text.length - suffixLength, suffixLength)\n const trimmedString = prefix + ELLIPSIS + suffix\n return {\n trimmedString,\n trimmedLength: trimmedString.length,\n prefixLength: prefix.length,\n suffixLength: suffix.length,\n originalString: text,\n originalLength: text.length,\n }\n}\n\n// Trim text to fit within the given number of pixels on the canvas\nexport function trimTextMid(\n ctx: CanvasRenderingContext2D,\n text: string,\n maxWidth: number,\n): TrimmedTextResult {\n if (cachedMeasureTextWidth(ctx, text) <= maxWidth) {\n return buildTrimmedText(text, text.length)\n }\n const [lo] = findValueBisect(\n 0,\n text.length,\n n => {\n return cachedMeasureTextWidth(ctx, buildTrimmedText(text, n).trimmedString)\n },\n maxWidth,\n )\n return buildTrimmedText(text, lo)\n}\n\nenum IndexTypeInTrimmed {\n IN_PREFIX,\n IN_SUFFIX,\n ELIDED,\n}\n\nfunction getIndexTypeInTrimmed(result: TrimmedTextResult, index: number): IndexTypeInTrimmed {\n if (index < result.prefixLength) {\n return IndexTypeInTrimmed.IN_PREFIX\n } else if (index < result.originalLength - result.suffixLength) {\n return IndexTypeInTrimmed.ELIDED\n } else {\n return IndexTypeInTrimmed.IN_SUFFIX\n }\n}\n\nexport function remapRangesToTrimmedText(\n trimmedText: TrimmedTextResult,\n ranges: [number, number][],\n): [number, number][] {\n // We intentionally don't just re-run fuzzy matching on the trimmed\n // text, beacuse if the search query is \"helloWorld\", the frame name\n // is \"application::helloWorld\", and that gets trimmed down to\n // \"appl...oWorld\", we still want \"oWorld\" to be highlighted, even\n // though the string \"appl...oWorld\" is not matched by the query\n // \"helloWorld\".\n //\n // There's a weird case to consider here: what if the trimmedText is\n // also matched by the query, but results in a different match than\n // the original query? Consider, e.g. the search string of \"ab\". The\n // string \"hello ab shabby\" will be matched at the first \"ab\", but\n // may be trimmed to \"hello...shabby\". In this case, should we\n // highlight the \"ab\" hidden by the ellipsis, or the \"ab\" in\n // \"shabby\"? The code below highlights the ellipsis so that the\n // matched characters don't change as you zoom in and out.\n\n const rangesToHighlightInTrimmedText: [number, number][] = []\n const lengthLoss = trimmedText.originalLength - trimmedText.trimmedLength\n let highlightedEllipsis = false\n\n for (let [origStart, origEnd] of ranges) {\n let startPosType = getIndexTypeInTrimmed(trimmedText, origStart)\n let endPosType = getIndexTypeInTrimmed(trimmedText, origEnd - 1)\n\n switch (startPosType) {\n case IndexTypeInTrimmed.IN_PREFIX: {\n switch (endPosType) {\n case IndexTypeInTrimmed.IN_PREFIX: {\n // The entire range fits in the prefix. Add it unmodified.\n rangesToHighlightInTrimmedText.push([origStart, origEnd])\n break\n }\n case IndexTypeInTrimmed.ELIDED: {\n // The range starts in the prefix, but ends in the elided\n // section. Add just the prefix + one char for the ellipsis.\n rangesToHighlightInTrimmedText.push([origStart, trimmedText.prefixLength + 1])\n highlightedEllipsis = true\n break\n }\n case IndexTypeInTrimmed.IN_SUFFIX: {\n // The range crosses from the prefix to the suffix.\n // Highlight everything including the ellipsis.\n rangesToHighlightInTrimmedText.push([origStart, origEnd - lengthLoss])\n break\n }\n }\n break\n }\n case IndexTypeInTrimmed.ELIDED: {\n switch (endPosType) {\n case IndexTypeInTrimmed.IN_PREFIX: {\n // This should be impossible\n throw new Error('Unexpected highlight range starts in elided and ends in prefix')\n }\n case IndexTypeInTrimmed.ELIDED: {\n // The match starts & ends within the elided section.\n if (!highlightedEllipsis) {\n rangesToHighlightInTrimmedText.push([\n trimmedText.prefixLength,\n trimmedText.prefixLength + 1,\n ])\n highlightedEllipsis = true\n }\n break\n }\n case IndexTypeInTrimmed.IN_SUFFIX: {\n // The match starts in elided, but ends in suffix.\n if (highlightedEllipsis) {\n rangesToHighlightInTrimmedText.push([\n trimmedText.trimmedLength - trimmedText.suffixLength,\n origEnd - lengthLoss,\n ])\n } else {\n rangesToHighlightInTrimmedText.push([trimmedText.prefixLength, origEnd - lengthLoss])\n highlightedEllipsis = true\n }\n break\n }\n }\n break\n }\n case IndexTypeInTrimmed.IN_SUFFIX: {\n switch (endPosType) {\n case IndexTypeInTrimmed.IN_PREFIX: {\n // This should be impossible\n throw new Error('Unexpected highlight range starts in suffix and ends in prefix')\n }\n case IndexTypeInTrimmed.ELIDED: {\n // This should be impossible\n throw new Error('Unexpected highlight range starts in suffix and ends in elided')\n break\n }\n case IndexTypeInTrimmed.IN_SUFFIX: {\n // Match starts & ends in suffix\n rangesToHighlightInTrimmedText.push([origStart - lengthLoss, origEnd - lengthLoss])\n break\n }\n }\n break\n }\n }\n }\n return rangesToHighlightInTrimmedText\n}\n","import {h, Component} from 'preact'\nimport {css} from 'aphrodite'\nimport {Flamechart} from '../lib/flamechart'\nimport {Rect, Vec2, AffineTransform, clamp} from '../lib/math'\nimport {FlamechartRenderer} from '../gl/flamechart-renderer'\nimport {getFlamechartStyle} from './flamechart-style'\nimport {FontFamily, FontSize, Sizes, commonStyle} from './style'\nimport {CanvasContext} from '../gl/canvas-context'\nimport {cachedMeasureTextWidth} from '../lib/text-utils'\nimport {Color} from '../lib/color'\nimport {Theme} from './themes/theme'\n\ninterface FlamechartMinimapViewProps {\n theme: Theme\n\n flamechart: Flamechart\n configSpaceViewportRect: Rect\n\n canvasContext: CanvasContext\n flamechartRenderer: FlamechartRenderer\n\n transformViewport: (transform: AffineTransform) => void\n setConfigSpaceViewportRect: (rect: Rect) => void\n}\n\nenum DraggingMode {\n DRAW_NEW_VIEWPORT,\n TRANSLATE_VIEWPORT,\n}\n\nexport class FlamechartMinimapView extends Component<FlamechartMinimapViewProps, {}> {\n container: Element | null = null\n containerRef = (element: Element | null) => {\n this.container = element || null\n }\n\n overlayCanvas: HTMLCanvasElement | null = null\n overlayCtx: CanvasRenderingContext2D | null = null\n\n private physicalViewSize() {\n return new Vec2(\n this.overlayCanvas ? this.overlayCanvas.width : 0,\n this.overlayCanvas ? this.overlayCanvas.height : 0,\n )\n }\n\n private getStyle() {\n return getFlamechartStyle(this.props.theme)\n }\n\n private minimapOrigin() {\n return new Vec2(0, Sizes.FRAME_HEIGHT * window.devicePixelRatio)\n }\n\n private configSpaceSize() {\n return new Vec2(\n this.props.flamechart.getTotalWeight(),\n this.props.flamechart.getLayers().length,\n )\n }\n\n private configSpaceToPhysicalViewSpace() {\n const minimapOrigin = this.minimapOrigin()\n\n return AffineTransform.betweenRects(\n new Rect(new Vec2(0, 0), this.configSpaceSize()),\n new Rect(minimapOrigin, this.physicalViewSize().minus(minimapOrigin)),\n )\n }\n\n private logicalToPhysicalViewSpace() {\n return AffineTransform.withScale(new Vec2(window.devicePixelRatio, window.devicePixelRatio))\n }\n\n private windowToLogicalViewSpace() {\n if (!this.container) return new AffineTransform()\n const bounds = this.container.getBoundingClientRect()\n return AffineTransform.withTranslation(new Vec2(-bounds.left, -bounds.top))\n }\n\n private renderRects() {\n if (!this.container) return\n\n // Hasn't resized yet -- no point in rendering yet\n if (this.physicalViewSize().x < 2) return\n\n this.props.canvasContext.renderBehind(this.container, () => {\n this.props.flamechartRenderer.render({\n configSpaceSrcRect: new Rect(new Vec2(0, 0), this.configSpaceSize()),\n physicalSpaceDstRect: new Rect(\n this.minimapOrigin(),\n this.physicalViewSize().minus(this.minimapOrigin()),\n ),\n renderOutlines: false,\n })\n\n this.props.canvasContext.viewportRectangleRenderer.render({\n configSpaceViewportRect: this.props.configSpaceViewportRect,\n configSpaceToPhysicalViewSpace: this.configSpaceToPhysicalViewSpace(),\n })\n })\n }\n\n private renderOverlays() {\n const ctx = this.overlayCtx\n if (!ctx) return\n const physicalViewSize = this.physicalViewSize()\n ctx.clearRect(0, 0, physicalViewSize.x, physicalViewSize.y)\n\n const configToPhysical = this.configSpaceToPhysicalViewSpace()\n\n const left = 0\n const right = this.configSpaceSize().x\n\n // TODO(jlfwong): There's a huge amount of code duplication here between\n // this and the FlamechartView.renderOverlays(). Consolidate.\n\n // We want about 10 gridlines to be visible, and want the unit to be\n // 1eN, 2eN, or 5eN for some N\n\n // Ideally, we want an interval every 100 logical screen pixels\n const logicalToConfig = (\n this.configSpaceToPhysicalViewSpace().inverted() || new AffineTransform()\n ).times(this.logicalToPhysicalViewSpace())\n const targetInterval = logicalToConfig.transformVector(new Vec2(200, 1)).x\n\n const physicalViewSpaceFrameHeight = Sizes.FRAME_HEIGHT * window.devicePixelRatio\n const physicalViewSpaceFontSize = FontSize.LABEL * window.devicePixelRatio\n const labelPaddingPx = (physicalViewSpaceFrameHeight - physicalViewSpaceFontSize) / 2\n\n ctx.font = `${physicalViewSpaceFontSize}px/${physicalViewSpaceFrameHeight}px ${FontFamily.MONOSPACE}`\n ctx.textBaseline = 'top'\n\n const minInterval = Math.pow(10, Math.floor(Math.log10(targetInterval)))\n let interval = minInterval\n\n if (targetInterval / interval > 5) {\n interval *= 5\n } else if (targetInterval / interval > 2) {\n interval *= 2\n }\n\n const theme = this.props.theme\n\n {\n ctx.fillStyle = Color.fromCSSHex(theme.bgPrimaryColor).withAlpha(0.8).toCSS()\n ctx.fillRect(0, 0, physicalViewSize.x, physicalViewSpaceFrameHeight)\n ctx.textBaseline = 'top'\n\n for (let x = Math.ceil(left / interval) * interval; x < right; x += interval) {\n // TODO(jlfwong): Ensure that labels do not overlap\n const pos = Math.round(configToPhysical.transformPosition(new Vec2(x, 0)).x)\n const labelText = this.props.flamechart.formatValue(x)\n const textWidth = Math.ceil(cachedMeasureTextWidth(ctx, labelText))\n\n ctx.fillStyle = theme.fgPrimaryColor\n ctx.fillText(labelText, pos - textWidth - labelPaddingPx, labelPaddingPx)\n ctx.fillStyle = theme.fgSecondaryColor\n ctx.fillRect(pos, 0, 1, physicalViewSize.y)\n }\n }\n }\n\n onWindowResize = () => {\n this.onBeforeFrame()\n }\n\n componentWillReceiveProps(nextProps: FlamechartMinimapViewProps) {\n if (this.props.flamechart !== nextProps.flamechart) {\n this.renderCanvas()\n } else if (this.props.configSpaceViewportRect != nextProps.configSpaceViewportRect) {\n this.renderCanvas()\n } else if (this.props.canvasContext !== nextProps.canvasContext) {\n if (this.props.canvasContext) {\n this.props.canvasContext.removeBeforeFrameHandler(this.onBeforeFrame)\n }\n if (nextProps.canvasContext) {\n nextProps.canvasContext.addBeforeFrameHandler(this.onBeforeFrame)\n nextProps.canvasContext.requestFrame()\n }\n }\n }\n\n componentDidMount() {\n window.addEventListener('resize', this.onWindowResize)\n this.props.canvasContext.addBeforeFrameHandler(this.onBeforeFrame)\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.onWindowResize)\n this.props.canvasContext.removeBeforeFrameHandler(this.onBeforeFrame)\n }\n\n private resizeOverlayCanvasIfNeeded() {\n if (!this.overlayCanvas) return\n let {width, height} = this.overlayCanvas.getBoundingClientRect()\n {\n /*\n We render text at a higher resolution then scale down to\n ensure we're rendering at 1:1 device pixel ratio.\n This ensures our text is rendered crisply.\n */\n }\n width = Math.floor(width)\n height = Math.floor(height)\n\n // Still initializing: don't resize yet\n if (width === 0 || height === 0) return\n\n const scaledWidth = width * window.devicePixelRatio\n const scaledHeight = height * window.devicePixelRatio\n\n if (scaledWidth === this.overlayCanvas.width && scaledHeight === this.overlayCanvas.height)\n return\n\n this.overlayCanvas.width = scaledWidth\n this.overlayCanvas.height = scaledHeight\n }\n\n private onBeforeFrame = () => {\n this.maybeClearInteractionLock()\n this.resizeOverlayCanvasIfNeeded()\n this.renderRects()\n this.renderOverlays()\n }\n\n private renderCanvas = () => {\n this.props.canvasContext.requestFrame()\n }\n\n // Inertial scrolling introduces tricky interaction problems.\n // Namely, if you start panning, and hit the edge of the scrollable\n // area, the browser continues to receive WheelEvents from inertial\n // scrolling. If we start zooming by holding Cmd + scrolling, then\n // release the Cmd key, this can cause us to interpret the incoming\n // inertial scrolling events as panning. To prevent this, we introduce\n // a concept of an \"Interaction Lock\". Once a certain interaction has\n // begun, we don't allow the other type of interaction to begin until\n // we've received two frames with no inertial wheel events. This\n // prevents us from accidentally switching between panning & zooming.\n private frameHadWheelEvent = false\n private framesWithoutWheelEvents = 0\n private interactionLock: 'pan' | 'zoom' | null = null\n private maybeClearInteractionLock = () => {\n if (this.interactionLock) {\n if (!this.frameHadWheelEvent) {\n this.framesWithoutWheelEvents++\n if (this.framesWithoutWheelEvents >= 2) {\n this.interactionLock = null\n this.framesWithoutWheelEvents = 0\n }\n }\n this.props.canvasContext.requestFrame()\n }\n this.frameHadWheelEvent = false\n }\n\n private pan(logicalViewSpaceDelta: Vec2) {\n this.interactionLock = 'pan'\n const physicalDelta = this.logicalToPhysicalViewSpace().transformVector(logicalViewSpaceDelta)\n const configDelta = this.configSpaceToPhysicalViewSpace().inverseTransformVector(physicalDelta)\n\n if (!configDelta) return\n this.props.transformViewport(AffineTransform.withTranslation(configDelta))\n }\n\n private zoom(multiplier: number) {\n this.interactionLock = 'zoom'\n const configSpaceViewport = this.props.configSpaceViewportRect\n const configSpaceCenter = configSpaceViewport.origin.plus(configSpaceViewport.size.times(1 / 2))\n if (!configSpaceCenter) return\n\n const zoomTransform = AffineTransform.withTranslation(configSpaceCenter.times(-1))\n .scaledBy(new Vec2(multiplier, 1))\n .translatedBy(configSpaceCenter)\n\n this.props.transformViewport(zoomTransform)\n }\n\n private onWheel = (ev: WheelEvent) => {\n ev.preventDefault()\n\n this.frameHadWheelEvent = true\n\n const isZoom = ev.metaKey || ev.ctrlKey\n\n if (isZoom && this.interactionLock !== 'pan') {\n let multiplier = 1 + ev.deltaY / 100\n\n // On Chrome & Firefox, pinch-to-zoom maps to\n // WheelEvent + Ctrl Key. We'll accelerate it in\n // this case, since it feels a bit sluggish otherwise.\n if (ev.ctrlKey) {\n multiplier = 1 + ev.deltaY / 40\n }\n\n multiplier = clamp(multiplier, 0.1, 10.0)\n\n this.zoom(multiplier)\n } else if (this.interactionLock !== 'zoom') {\n this.pan(new Vec2(ev.deltaX, ev.deltaY))\n }\n\n this.renderCanvas()\n }\n\n private configSpaceMouse(ev: MouseEvent): Vec2 | null {\n const logicalSpaceMouse = this.windowToLogicalViewSpace().transformPosition(\n new Vec2(ev.clientX, ev.clientY),\n )\n const physicalSpaceMouse = this.logicalToPhysicalViewSpace().transformPosition(\n logicalSpaceMouse,\n )\n return this.configSpaceToPhysicalViewSpace().inverseTransformPosition(physicalSpaceMouse)\n }\n\n private dragStartConfigSpaceMouse: Vec2 | null = null\n private dragConfigSpaceViewportOffset: Vec2 | null = null\n private draggingMode: DraggingMode | null = null\n private onMouseDown = (ev: MouseEvent) => {\n const configSpaceMouse = this.configSpaceMouse(ev)\n\n if (configSpaceMouse) {\n if (this.props.configSpaceViewportRect.contains(configSpaceMouse)) {\n // If dragging starting inside the viewport rectangle,\n // we'll move the existing viewport\n this.draggingMode = DraggingMode.TRANSLATE_VIEWPORT\n this.dragConfigSpaceViewportOffset = configSpaceMouse.minus(\n this.props.configSpaceViewportRect.origin,\n )\n } else {\n // If dragging starts outside the the viewport rectangle,\n // we'll start drawing a new viewport\n this.draggingMode = DraggingMode.DRAW_NEW_VIEWPORT\n }\n\n this.dragStartConfigSpaceMouse = configSpaceMouse\n window.addEventListener('mousemove', this.onWindowMouseMove)\n window.addEventListener('mouseup', this.onWindowMouseUp)\n this.updateCursor(configSpaceMouse)\n }\n }\n\n private onWindowMouseMove = (ev: MouseEvent) => {\n if (!this.dragStartConfigSpaceMouse) return\n let configSpaceMouse = this.configSpaceMouse(ev)\n\n if (!configSpaceMouse) return\n this.updateCursor(configSpaceMouse)\n\n // Clamp the mouse position to avoid weird behavior when outside the canvas bounds\n configSpaceMouse = new Rect(new Vec2(0, 0), this.configSpaceSize()).closestPointTo(\n configSpaceMouse,\n )\n\n if (this.draggingMode === DraggingMode.DRAW_NEW_VIEWPORT) {\n const configStart = this.dragStartConfigSpaceMouse\n let configEnd = configSpaceMouse\n\n if (!configStart || !configEnd) return\n const left = Math.min(configStart.x, configEnd.x)\n const right = Math.max(configStart.x, configEnd.x)\n\n const width = right - left\n const height = this.props.configSpaceViewportRect.height()\n\n this.props.setConfigSpaceViewportRect(\n new Rect(new Vec2(left, configEnd.y - height / 2), new Vec2(width, height)),\n )\n } else if (this.draggingMode === DraggingMode.TRANSLATE_VIEWPORT) {\n if (!this.dragConfigSpaceViewportOffset) return\n\n const newOrigin = configSpaceMouse.minus(this.dragConfigSpaceViewportOffset)\n this.props.setConfigSpaceViewportRect(\n this.props.configSpaceViewportRect.withOrigin(newOrigin),\n )\n }\n }\n\n private updateCursor = (configSpaceMouse: Vec2) => {\n if (this.draggingMode === DraggingMode.TRANSLATE_VIEWPORT) {\n document.body.style.cursor = 'grabbing'\n document.body.style.cursor = '-webkit-grabbing'\n } else if (this.draggingMode === DraggingMode.DRAW_NEW_VIEWPORT) {\n document.body.style.cursor = 'col-resize'\n } else if (this.props.configSpaceViewportRect.contains(configSpaceMouse)) {\n document.body.style.cursor = 'grab'\n document.body.style.cursor = '-webkit-grab'\n } else {\n document.body.style.cursor = 'col-resize'\n }\n }\n\n private onMouseLeave = () => {\n if (this.draggingMode == null) {\n document.body.style.cursor = 'default'\n }\n }\n\n private onMouseMove = (ev: MouseEvent) => {\n const configSpaceMouse = this.configSpaceMouse(ev)\n if (!configSpaceMouse) return\n this.updateCursor(configSpaceMouse)\n }\n\n private onWindowMouseUp = (ev: MouseEvent) => {\n this.draggingMode = null\n window.removeEventListener('mousemove', this.onWindowMouseMove)\n window.removeEventListener('mouseup', this.onWindowMouseUp)\n\n const configSpaceMouse = this.configSpaceMouse(ev)\n if (!configSpaceMouse) return\n this.updateCursor(configSpaceMouse)\n }\n\n private overlayCanvasRef = (element: Element | null) => {\n if (element) {\n this.overlayCanvas = element as HTMLCanvasElement\n this.overlayCtx = this.overlayCanvas.getContext('2d')\n this.renderCanvas()\n } else {\n this.overlayCanvas = null\n this.overlayCtx = null\n }\n }\n\n render() {\n const style = this.getStyle()\n\n return (\n <div\n ref={this.containerRef}\n onWheel={this.onWheel}\n onMouseDown={this.onMouseDown}\n onMouseMove={this.onMouseMove}\n onMouseLeave={this.onMouseLeave}\n className={css(style.minimap, commonStyle.vbox)}\n >\n <canvas width={1} height={1} ref={this.overlayCanvasRef} className={css(style.fill)} />\n </div>\n )\n }\n}\n","import {StyleDeclarationValue, css} from 'aphrodite'\nimport {h, JSX} from 'preact'\nimport {getFlamechartStyle} from './flamechart-style'\nimport {formatPercent} from '../lib/utils'\nimport {Frame, CallTreeNode} from '../lib/profile'\nimport {ColorChit} from './color-chit'\nimport {Flamechart} from '../lib/flamechart'\nimport {useTheme} from './themes/theme'\n\ninterface StatisticsTableProps {\n title: string\n grandTotal: number\n selectedTotal: number\n selectedSelf: number\n cellStyle: StyleDeclarationValue\n formatter: (v: number) => string\n}\n\nfunction StatisticsTable(props: StatisticsTableProps) {\n const style = getFlamechartStyle(useTheme())\n\n const total = props.formatter(props.selectedTotal)\n const self = props.formatter(props.selectedSelf)\n const totalPerc = (100.0 * props.selectedTotal) / props.grandTotal\n const selfPerc = (100.0 * props.selectedSelf) / props.grandTotal\n\n return (\n <div className={css(style.statsTable)}>\n <div className={css(props.cellStyle, style.statsTableCell, style.statsTableHeader)}>\n {props.title}\n </div>\n\n <div className={css(props.cellStyle, style.statsTableCell)}>Total</div>\n <div className={css(props.cellStyle, style.statsTableCell)}>Self</div>\n\n <div className={css(props.cellStyle, style.statsTableCell)}>{total}</div>\n <div className={css(props.cellStyle, style.statsTableCell)}>{self}</div>\n\n <div className={css(props.cellStyle, style.statsTableCell)}>\n {formatPercent(totalPerc)}\n <div className={css(style.barDisplay)} style={{height: `${totalPerc}%`}} />\n </div>\n <div className={css(props.cellStyle, style.statsTableCell)}>\n {formatPercent(selfPerc)}\n <div className={css(style.barDisplay)} style={{height: `${selfPerc}%`}} />\n </div>\n </div>\n )\n}\n\ninterface StackTraceViewProps {\n getFrameColor: (frame: Frame) => string\n node: CallTreeNode\n}\nfunction StackTraceView(props: StackTraceViewProps) {\n const style = getFlamechartStyle(useTheme())\n\n const rows: JSX.Element[] = []\n let node: CallTreeNode | null = props.node\n for (; node && !node.isRoot(); node = node.parent) {\n const row: (JSX.Element | string)[] = []\n const {frame} = node\n\n row.push(<ColorChit color={props.getFrameColor(frame)} />)\n\n if (rows.length) {\n row.push(<span className={css(style.stackFileLine)}>> </span>)\n }\n row.push(frame.name)\n\n if (frame.file) {\n let pos = frame.file\n if (frame.line != null) {\n pos += `:${frame.line}`\n if (frame.col != null) {\n pos += `:${frame.col}`\n }\n }\n row.push(<span className={css(style.stackFileLine)}> ({pos})</span>)\n }\n rows.push(<div className={css(style.stackLine)}>{row}</div>)\n }\n return (\n <div className={css(style.stackTraceView)}>\n <div className={css(style.stackTraceViewPadding)}>{rows}</div>\n </div>\n )\n}\n\ninterface FlamechartDetailViewProps {\n flamechart: Flamechart\n getCSSColorForFrame: (frame: Frame) => string\n selectedNode: CallTreeNode\n}\n\nexport function FlamechartDetailView(props: FlamechartDetailViewProps) {\n const style = getFlamechartStyle(useTheme())\n\n const {flamechart, selectedNode} = props\n const {frame} = selectedNode\n\n return (\n <div className={css(style.detailView)}>\n <StatisticsTable\n title={'This Instance'}\n cellStyle={style.thisInstanceCell}\n grandTotal={flamechart.getTotalWeight()}\n selectedTotal={selectedNode.getTotalWeight()}\n selectedSelf={selectedNode.getSelfWeight()}\n formatter={flamechart.formatValue.bind(flamechart)}\n />\n <StatisticsTable\n title={'All Instances'}\n cellStyle={style.allInstancesCell}\n grandTotal={flamechart.getTotalWeight()}\n selectedTotal={frame.getTotalWeight()}\n selectedSelf={frame.getSelfWeight()}\n formatter={flamechart.formatValue.bind(flamechart)}\n />\n <StackTraceView node={selectedNode} getFrameColor={props.getCSSColorForFrame} />\n </div>\n )\n}\n","// This file contains a collection of classes which make it easier to perform\n// batch rendering of Canvas2D primitives. The advantage of this over just doing\n// ctx.beginPath() ... ctx.rect(...) ... ctx.endPath() is that you can construct\n// several different batch renderers are the same time, then decide on their\n// paint order at the end.\n//\n// See FlamechartPanZoomView.renderOverlays for an example of how this is used.\n\nexport interface TextArgs {\n text: string\n x: number\n y: number\n}\n\nexport class BatchCanvasTextRenderer {\n private argsBatch: TextArgs[] = []\n\n text(args: TextArgs) {\n this.argsBatch.push(args)\n }\n\n fill(ctx: CanvasRenderingContext2D, color: string) {\n if (this.argsBatch.length === 0) return\n ctx.fillStyle = color\n for (let args of this.argsBatch) {\n ctx.fillText(args.text, args.x, args.y)\n }\n this.argsBatch = []\n }\n}\n\nexport interface RectArgs {\n x: number\n y: number\n w: number\n h: number\n}\n\nexport class BatchCanvasRectRenderer {\n private argsBatch: RectArgs[] = []\n\n rect(args: RectArgs) {\n this.argsBatch.push(args)\n }\n\n private drawPath(ctx: CanvasRenderingContext2D) {\n ctx.beginPath()\n for (let args of this.argsBatch) {\n ctx.rect(args.x, args.y, args.w, args.h)\n }\n ctx.closePath()\n this.argsBatch = []\n }\n\n fill(ctx: CanvasRenderingContext2D, color: string) {\n if (this.argsBatch.length === 0) return\n ctx.fillStyle = color\n this.drawPath(ctx)\n ctx.fill()\n }\n\n stroke(ctx: CanvasRenderingContext2D, color: string, lineWidth: number) {\n if (this.argsBatch.length === 0) return\n ctx.strokeStyle = color\n ctx.lineWidth = lineWidth\n this.drawPath(ctx)\n ctx.stroke()\n }\n}\n","import {Rect, AffineTransform, Vec2, clamp} from '../lib/math'\nimport {CallTreeNode} from '../lib/profile'\nimport {Flamechart, FlamechartFrame} from '../lib/flamechart'\nimport {CanvasContext} from '../gl/canvas-context'\nimport {FlamechartRenderer} from '../gl/flamechart-renderer'\nimport {Sizes, FontSize, FontFamily, commonStyle} from './style'\nimport {\n cachedMeasureTextWidth,\n ELLIPSIS,\n trimTextMid,\n remapRangesToTrimmedText,\n} from '../lib/text-utils'\nimport {getFlamechartStyle} from './flamechart-style'\nimport {h, Component} from 'preact'\nimport {css} from 'aphrodite'\nimport {ProfileSearchResults} from '../lib/profile-search'\nimport {BatchCanvasTextRenderer, BatchCanvasRectRenderer} from '../lib/canvas-2d-batch-renderers'\nimport {Color} from '../lib/color'\nimport {Theme} from './themes/theme'\n\ninterface FlamechartFrameLabel {\n configSpaceBounds: Rect\n node: CallTreeNode\n}\n\n/**\n * Component to visualize a Flamechart and interact with it via hovering,\n * zooming, and panning.\n *\n * There are 3 vector spaces involved:\n * - Configuration Space: In this space, the horizontal unit is ms, and the\n * vertical unit is stack depth. Each stack frame is one unit high.\n * - Logical view space: Origin is top-left, with +y downwards. This represents\n * the coordinate space of the view as specified in CSS: horizontal and vertical\n * units are both \"logical\" pixels.\n * - Physical view space: Origin is top-left, with +y downwards. This represents\n * the coordinate space of the view as specified in hardware pixels: horizontal\n * and vertical units are both \"physical\" pixels.\n *\n * We use two canvases to draw the flamechart itself: one for the rectangles,\n * which we render via WebGL, and one for the labels, which we render via 2D\n * canvas primitives.\n */\nexport interface FlamechartPanZoomViewProps {\n flamechart: Flamechart\n canvasContext: CanvasContext\n flamechartRenderer: FlamechartRenderer\n renderInverted: boolean\n selectedNode: CallTreeNode | null\n theme: Theme\n\n onNodeHover: (hover: {node: CallTreeNode; event: MouseEvent} | null) => void\n onNodeSelect: (node: CallTreeNode | null) => void\n\n configSpaceViewportRect: Rect\n transformViewport: (transform: AffineTransform) => void\n setConfigSpaceViewportRect: (rect: Rect) => void\n\n logicalSpaceViewportSize: Vec2\n setLogicalSpaceViewportSize: (size: Vec2) => void\n\n searchResults: ProfileSearchResults | null\n}\n\nexport class FlamechartPanZoomView extends Component<FlamechartPanZoomViewProps, {}> {\n private container: Element | null = null\n private containerRef = (element: Element | null) => {\n this.container = element || null\n }\n\n private overlayCanvas: HTMLCanvasElement | null = null\n private overlayCtx: CanvasRenderingContext2D | null = null\n\n private hoveredLabel: FlamechartFrameLabel | null = null\n\n private getStyle() {\n return getFlamechartStyle(this.props.theme)\n }\n\n private setConfigSpaceViewportRect(r: Rect) {\n this.props.setConfigSpaceViewportRect(r)\n }\n\n private overlayCanvasRef = (element: Element | null) => {\n if (element) {\n this.overlayCanvas = element as HTMLCanvasElement\n this.overlayCtx = this.overlayCanvas.getContext('2d')\n this.renderCanvas()\n } else {\n this.overlayCanvas = null\n this.overlayCtx = null\n }\n }\n\n private configSpaceSize() {\n return new Vec2(\n this.props.flamechart.getTotalWeight(),\n this.props.flamechart.getLayers().length,\n )\n }\n\n private physicalViewSize() {\n return new Vec2(\n this.overlayCanvas ? this.overlayCanvas.width : 0,\n this.overlayCanvas ? this.overlayCanvas.height : 0,\n )\n }\n\n private physicalBounds(): Rect {\n if (this.props.renderInverted) {\n // If we're rendering inverted and the flamegraph won't fill the viewport,\n // we want to stick the flamegraph to the bottom of the viewport, not the top.\n\n const physicalViewportHeight = this.physicalViewSize().y\n const physicalFlamegraphHeight =\n (this.configSpaceSize().y + 1) *\n this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT *\n window.devicePixelRatio\n\n if (physicalFlamegraphHeight < physicalViewportHeight) {\n return new Rect(\n new Vec2(0, physicalViewportHeight - physicalFlamegraphHeight),\n this.physicalViewSize(),\n )\n }\n }\n\n return new Rect(new Vec2(0, 0), this.physicalViewSize())\n }\n\n private LOGICAL_VIEW_SPACE_FRAME_HEIGHT = Sizes.FRAME_HEIGHT\n\n private configSpaceToPhysicalViewSpace() {\n return AffineTransform.betweenRects(this.props.configSpaceViewportRect, this.physicalBounds())\n }\n\n private logicalToPhysicalViewSpace() {\n return AffineTransform.withScale(new Vec2(window.devicePixelRatio, window.devicePixelRatio))\n }\n\n private resizeOverlayCanvasIfNeeded() {\n if (!this.overlayCanvas) return\n let {width, height} = this.overlayCanvas.getBoundingClientRect()\n {\n /*\n We render text at a higher resolution then scale down to\n ensure we're rendering at 1:1 device pixel ratio.\n This ensures our text is rendered crisply.\n */\n }\n width = Math.floor(width)\n height = Math.floor(height)\n\n // Still initializing: don't resize yet\n if (width === 0 || height === 0) return\n\n const scaledWidth = width * window.devicePixelRatio\n const scaledHeight = height * window.devicePixelRatio\n\n if (scaledWidth === this.overlayCanvas.width && scaledHeight === this.overlayCanvas.height)\n return\n\n this.overlayCanvas.width = scaledWidth\n this.overlayCanvas.height = scaledHeight\n }\n\n private renderOverlays() {\n const ctx = this.overlayCtx\n if (!ctx) return\n if (this.props.configSpaceViewportRect.isEmpty()) return\n\n const configToPhysical = this.configSpaceToPhysicalViewSpace()\n\n const physicalViewSpaceFontSize = FontSize.LABEL * window.devicePixelRatio\n const physicalViewSpaceFrameHeight =\n this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT * window.devicePixelRatio\n\n const physicalViewSize = this.physicalViewSize()\n\n ctx.clearRect(0, 0, physicalViewSize.x, physicalViewSize.y)\n\n ctx.font = `${physicalViewSpaceFontSize}px/${physicalViewSpaceFrameHeight}px ${FontFamily.MONOSPACE}`\n ctx.textBaseline = 'alphabetic'\n\n const minWidthToRender = cachedMeasureTextWidth(ctx, 'M' + ELLIPSIS + 'M')\n const minConfigSpaceWidthToRender = (\n configToPhysical.inverseTransformVector(new Vec2(minWidthToRender, 0)) || new Vec2(0, 0)\n ).x\n\n const LABEL_PADDING_PX = 5 * window.devicePixelRatio\n\n const labelBatch = new BatchCanvasTextRenderer()\n const fadedLabelBatch = new BatchCanvasTextRenderer()\n const matchedTextHighlightBatch = new BatchCanvasRectRenderer()\n const directlySelectedOutlineBatch = new BatchCanvasRectRenderer()\n const indirectlySelectedOutlineBatch = new BatchCanvasRectRenderer()\n const matchedFrameBatch = new BatchCanvasRectRenderer()\n\n const renderFrameLabelAndChildren = (frame: FlamechartFrame, depth = 0) => {\n const width = frame.end - frame.start\n const y = this.props.renderInverted ? this.configSpaceSize().y - 1 - depth : depth\n const configSpaceBounds = new Rect(new Vec2(frame.start, y), new Vec2(width, 1))\n\n if (width < minConfigSpaceWidthToRender) return\n if (configSpaceBounds.left() > this.props.configSpaceViewportRect.right()) return\n if (configSpaceBounds.right() < this.props.configSpaceViewportRect.left()) return\n\n if (this.props.renderInverted) {\n if (configSpaceBounds.bottom() < this.props.configSpaceViewportRect.top()) return\n } else {\n if (configSpaceBounds.top() > this.props.configSpaceViewportRect.bottom()) return\n }\n\n if (configSpaceBounds.hasIntersectionWith(this.props.configSpaceViewportRect)) {\n let physicalLabelBounds = configToPhysical.transformRect(configSpaceBounds)\n\n if (physicalLabelBounds.left() < 0) {\n physicalLabelBounds = physicalLabelBounds\n .withOrigin(physicalLabelBounds.origin.withX(0))\n .withSize(\n physicalLabelBounds.size.withX(\n physicalLabelBounds.size.x + physicalLabelBounds.left(),\n ),\n )\n }\n if (physicalLabelBounds.right() > physicalViewSize.x) {\n physicalLabelBounds = physicalLabelBounds.withSize(\n physicalLabelBounds.size.withX(physicalViewSize.x - physicalLabelBounds.left()),\n )\n }\n\n if (physicalLabelBounds.width() > minWidthToRender) {\n const match = this.props.searchResults?.getMatchForFrame(frame.node.frame)\n\n const trimmedText = trimTextMid(\n ctx,\n frame.node.frame.name,\n physicalLabelBounds.width() - 2 * LABEL_PADDING_PX,\n )\n\n if (match) {\n const rangesToHighlightInTrimmedText = remapRangesToTrimmedText(\n trimmedText,\n match\n )\n\n // Once we have the character ranges to highlight, we need to\n // actually do the highlighting.\n let lastEndIndex = 0\n let left = physicalLabelBounds.left() + LABEL_PADDING_PX\n\n const padding = (physicalViewSpaceFrameHeight - physicalViewSpaceFontSize) / 2 - 2\n for (let [startIndex, endIndex] of rangesToHighlightInTrimmedText) {\n left += cachedMeasureTextWidth(\n ctx,\n trimmedText.trimmedString.substring(lastEndIndex, startIndex),\n )\n const highlightWidth = cachedMeasureTextWidth(\n ctx,\n trimmedText.trimmedString.substring(startIndex, endIndex),\n )\n matchedTextHighlightBatch.rect({\n x: left,\n y: physicalLabelBounds.top() + padding,\n w: highlightWidth,\n h: physicalViewSpaceFrameHeight - 2 * padding,\n })\n\n left += highlightWidth\n lastEndIndex = endIndex\n }\n }\n\n const batch = this.props.searchResults != null && !match ? fadedLabelBatch : labelBatch\n batch.text({\n text: trimmedText.trimmedString,\n\n // This is specifying the position of the starting text baseline.\n x: physicalLabelBounds.left() + LABEL_PADDING_PX,\n y: Math.round(\n physicalLabelBounds.bottom() -\n (physicalViewSpaceFrameHeight - physicalViewSpaceFontSize) / 2,\n ),\n })\n }\n }\n for (let child of frame.children) {\n renderFrameLabelAndChildren(child, depth + 1)\n }\n }\n\n const frameOutlineWidth = 2 * window.devicePixelRatio\n ctx.strokeStyle = this.props.theme.selectionSecondaryColor\n const minConfigSpaceWidthToRenderOutline = (\n configToPhysical.inverseTransformVector(new Vec2(1, 0)) || new Vec2(0, 0)\n ).x\n\n const renderSpecialFrameOutlines = (frame: FlamechartFrame, depth = 0) => {\n if (!this.props.selectedNode && this.props.searchResults == null) return\n const width = frame.end - frame.start\n const y = this.props.renderInverted ? this.configSpaceSize().y - 1 - depth : depth\n const configSpaceBounds = new Rect(new Vec2(frame.start, y), new Vec2(width, 1))\n\n if (width < minConfigSpaceWidthToRenderOutline) return\n if (configSpaceBounds.left() > this.props.configSpaceViewportRect.right()) return\n if (configSpaceBounds.right() < this.props.configSpaceViewportRect.left()) return\n if (configSpaceBounds.top() > this.props.configSpaceViewportRect.bottom()) return\n\n if (configSpaceBounds.hasIntersectionWith(this.props.configSpaceViewportRect)) {\n if (this.props.searchResults?.getMatchForFrame(frame.node.frame)) {\n const physicalRectBounds = configToPhysical.transformRect(configSpaceBounds)\n matchedFrameBatch.rect({\n x: Math.round(physicalRectBounds.left() + frameOutlineWidth / 2),\n y: Math.round(physicalRectBounds.top() + frameOutlineWidth / 2),\n w: Math.round(Math.max(0, physicalRectBounds.width() - frameOutlineWidth)),\n h: Math.round(Math.max(0, physicalRectBounds.height() - frameOutlineWidth)),\n })\n }\n\n if (this.props.selectedNode != null && frame.node.frame === this.props.selectedNode.frame) {\n let batch =\n frame.node === this.props.selectedNode\n ? directlySelectedOutlineBatch\n : indirectlySelectedOutlineBatch\n\n const physicalRectBounds = configToPhysical.transformRect(configSpaceBounds)\n batch.rect({\n x: Math.round(physicalRectBounds.left() + 1 + frameOutlineWidth / 2),\n y: Math.round(physicalRectBounds.top() + 1 + frameOutlineWidth / 2),\n w: Math.round(Math.max(0, physicalRectBounds.width() - 2 - frameOutlineWidth)),\n h: Math.round(Math.max(0, physicalRectBounds.height() - 2 - frameOutlineWidth)),\n })\n }\n }\n for (let child of frame.children) {\n renderSpecialFrameOutlines(child, depth + 1)\n }\n }\n\n for (let frame of this.props.flamechart.getLayers()[0] || []) {\n renderSpecialFrameOutlines(frame)\n }\n\n for (let frame of this.props.flamechart.getLayers()[0] || []) {\n renderFrameLabelAndChildren(frame)\n }\n\n const theme = this.props.theme\n\n matchedFrameBatch.fill(ctx, theme.searchMatchPrimaryColor)\n matchedTextHighlightBatch.fill(ctx, theme.searchMatchSecondaryColor)\n fadedLabelBatch.fill(ctx, theme.fgSecondaryColor)\n labelBatch.fill(\n ctx,\n this.props.searchResults != null ? theme.searchMatchTextColor : theme.fgPrimaryColor,\n )\n indirectlySelectedOutlineBatch.stroke(ctx, theme.selectionSecondaryColor, frameOutlineWidth)\n directlySelectedOutlineBatch.stroke(ctx, theme.selectionPrimaryColor, frameOutlineWidth)\n\n if (this.hoveredLabel) {\n let color: string = theme.fgPrimaryColor\n if (this.props.selectedNode === this.hoveredLabel.node) {\n color = theme.selectionPrimaryColor\n }\n\n ctx.lineWidth = 2 * devicePixelRatio\n ctx.strokeStyle = color\n\n const physicalViewBounds = configToPhysical.transformRect(this.hoveredLabel.configSpaceBounds)\n ctx.strokeRect(\n Math.round(physicalViewBounds.left()),\n Math.round(physicalViewBounds.top()),\n Math.round(Math.max(0, physicalViewBounds.width())),\n Math.round(Math.max(0, physicalViewBounds.height())),\n )\n }\n\n this.renderTimeIndicators()\n }\n\n private renderTimeIndicators() {\n const ctx = this.overlayCtx\n if (!ctx) return\n\n const physicalViewSpaceFrameHeight =\n this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT * window.devicePixelRatio\n const physicalViewSize = this.physicalViewSize()\n const configToPhysical = this.configSpaceToPhysicalViewSpace()\n const physicalViewSpaceFontSize = FontSize.LABEL * window.devicePixelRatio\n const labelPaddingPx = (physicalViewSpaceFrameHeight - physicalViewSpaceFontSize) / 2\n\n const left = this.props.configSpaceViewportRect.left()\n const right = this.props.configSpaceViewportRect.right()\n // We want about 10 gridlines to be visible, and want the unit to be\n // 1eN, 2eN, or 5eN for some N\n // Ideally, we want an interval every 100 logical screen pixels\n const logicalToConfig = (\n this.configSpaceToPhysicalViewSpace().inverted() || new AffineTransform()\n ).times(this.logicalToPhysicalViewSpace())\n const targetInterval = logicalToConfig.transformVector(new Vec2(200, 1)).x\n const minInterval = Math.pow(10, Math.floor(Math.log10(targetInterval)))\n let interval = minInterval\n if (targetInterval / interval > 5) {\n interval *= 5\n } else if (targetInterval / interval > 2) {\n interval *= 2\n }\n\n const theme = this.props.theme\n\n {\n const y = this.props.renderInverted ? physicalViewSize.y - physicalViewSpaceFrameHeight : 0\n\n ctx.fillStyle = Color.fromCSSHex(theme.bgPrimaryColor).withAlpha(0.8).toCSS()\n ctx.fillRect(0, y, physicalViewSize.x, physicalViewSpaceFrameHeight)\n ctx.textBaseline = 'top'\n for (let x = Math.ceil(left / interval) * interval; x < right; x += interval) {\n // TODO(jlfwong): Ensure that labels do not overlap\n const pos = Math.round(configToPhysical.transformPosition(new Vec2(x, 0)).x)\n const labelText = this.props.flamechart.formatValue(x)\n const textWidth = cachedMeasureTextWidth(ctx, labelText)\n ctx.fillStyle = theme.fgPrimaryColor\n ctx.fillText(labelText, pos - textWidth - labelPaddingPx, y + labelPaddingPx)\n ctx.fillStyle = theme.fgSecondaryColor\n ctx.fillRect(pos, 0, 1, physicalViewSize.y)\n }\n }\n }\n\n private updateConfigSpaceViewport() {\n if (!this.container) return\n const {logicalSpaceViewportSize} = this.props\n const bounds = this.container.getBoundingClientRect()\n const {width, height} = bounds\n\n // Still initializing: don't resize yet\n if (width < 2 || height < 2) return\n\n if (this.props.configSpaceViewportRect.isEmpty()) {\n const configSpaceViewportHeight = height / this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT\n if (this.props.renderInverted) {\n this.setConfigSpaceViewportRect(\n new Rect(\n new Vec2(0, this.configSpaceSize().y - configSpaceViewportHeight + 1),\n new Vec2(this.configSpaceSize().x, configSpaceViewportHeight),\n ),\n )\n } else {\n this.setConfigSpaceViewportRect(\n new Rect(new Vec2(0, -1), new Vec2(this.configSpaceSize().x, configSpaceViewportHeight)),\n )\n }\n } else if (\n !logicalSpaceViewportSize.equals(Vec2.zero) &&\n (logicalSpaceViewportSize.x !== width || logicalSpaceViewportSize.y !== height)\n ) {\n // Resize the viewport rectangle to match the window size aspect\n // ratio.\n this.setConfigSpaceViewportRect(\n this.props.configSpaceViewportRect.withSize(\n this.props.configSpaceViewportRect.size.timesPointwise(\n new Vec2(width / logicalSpaceViewportSize.x, height / logicalSpaceViewportSize.y),\n ),\n ),\n )\n }\n\n const newSize = new Vec2(width, height)\n if (!newSize.equals(logicalSpaceViewportSize)) {\n this.props.setLogicalSpaceViewportSize(newSize)\n }\n }\n\n onWindowResize = () => {\n this.updateConfigSpaceViewport()\n this.onBeforeFrame()\n }\n\n private renderRects() {\n if (!this.container) return\n this.updateConfigSpaceViewport()\n\n if (this.props.configSpaceViewportRect.isEmpty()) return\n\n this.props.canvasContext.renderBehind(this.container, () => {\n this.props.flamechartRenderer.render({\n physicalSpaceDstRect: this.physicalBounds(),\n configSpaceSrcRect: this.props.configSpaceViewportRect,\n renderOutlines: true,\n })\n })\n }\n\n // Inertial scrolling introduces tricky interaction problems.\n // Namely, if you start panning, and hit the edge of the scrollable\n // area, the browser continues to receive WheelEvents from inertial\n // scrolling. If we start zooming by holding Cmd + scrolling, then\n // release the Cmd key, this can cause us to interpret the incoming\n // inertial scrolling events as panning. To prevent this, we introduce\n // a concept of an \"Interaction Lock\". Once a certain interaction has\n // begun, we don't allow the other type of interaction to begin until\n // we've received two frames with no inertial wheel events. This\n // prevents us from accidentally switching between panning & zooming.\n private frameHadWheelEvent = false\n private framesWithoutWheelEvents = 0\n private interactionLock: 'pan' | 'zoom' | null = null\n private maybeClearInteractionLock = () => {\n if (this.interactionLock) {\n if (!this.frameHadWheelEvent) {\n this.framesWithoutWheelEvents++\n if (this.framesWithoutWheelEvents >= 2) {\n this.interactionLock = null\n this.framesWithoutWheelEvents = 0\n }\n }\n this.props.canvasContext.requestFrame()\n }\n this.frameHadWheelEvent = false\n }\n\n private onBeforeFrame = () => {\n this.resizeOverlayCanvasIfNeeded()\n this.renderRects()\n this.renderOverlays()\n this.maybeClearInteractionLock()\n }\n\n private renderCanvas = () => {\n this.props.canvasContext.requestFrame()\n }\n\n private pan(logicalViewSpaceDelta: Vec2) {\n this.interactionLock = 'pan'\n\n const physicalDelta = this.logicalToPhysicalViewSpace().transformVector(logicalViewSpaceDelta)\n const configDelta = this.configSpaceToPhysicalViewSpace().inverseTransformVector(physicalDelta)\n\n if (this.hoveredLabel) {\n this.props.onNodeHover(null)\n }\n\n if (!configDelta) return\n this.props.transformViewport(AffineTransform.withTranslation(configDelta))\n }\n\n private zoom(logicalViewSpaceCenter: Vec2, multiplier: number) {\n this.interactionLock = 'zoom'\n\n const physicalCenter = this.logicalToPhysicalViewSpace().transformPosition(\n logicalViewSpaceCenter,\n )\n const configSpaceCenter = this.configSpaceToPhysicalViewSpace().inverseTransformPosition(\n physicalCenter,\n )\n if (!configSpaceCenter) return\n\n const zoomTransform = AffineTransform.withTranslation(configSpaceCenter.times(-1))\n .scaledBy(new Vec2(multiplier, 1))\n .translatedBy(configSpaceCenter)\n\n this.props.transformViewport(zoomTransform)\n }\n\n private lastDragPos: Vec2 | null = null\n private mouseDownPos: Vec2 | null = null\n private onMouseDown = (ev: MouseEvent) => {\n this.mouseDownPos = this.lastDragPos = new Vec2(ev.offsetX, ev.offsetY)\n this.updateCursor()\n window.addEventListener('mouseup', this.onWindowMouseUp)\n }\n\n private onMouseDrag = (ev: MouseEvent) => {\n if (!this.lastDragPos) return\n const logicalMousePos = new Vec2(ev.offsetX, ev.offsetY)\n this.pan(this.lastDragPos.minus(logicalMousePos))\n this.lastDragPos = logicalMousePos\n\n // When panning by scrolling, the element under\n // the cursor will change, so clear the hovered label.\n if (this.hoveredLabel) {\n this.props.onNodeHover(null)\n }\n }\n\n private onDblClick = (ev: MouseEvent) => {\n if (this.hoveredLabel) {\n const hoveredBounds = this.hoveredLabel.configSpaceBounds\n const viewportRect = new Rect(\n hoveredBounds.origin.minus(new Vec2(0, 1)),\n hoveredBounds.size.withY(this.props.configSpaceViewportRect.height()),\n )\n this.props.setConfigSpaceViewportRect(viewportRect)\n }\n }\n\n private onClick = (ev: MouseEvent) => {\n const logicalMousePos = new Vec2(ev.offsetX, ev.offsetY)\n const mouseDownPos = this.mouseDownPos\n this.mouseDownPos = null\n\n if (mouseDownPos && logicalMousePos.minus(mouseDownPos).length() > 5) {\n // If the cursor is more than 5 logical space pixels away from the mouse\n // down location, then don't interpret this event as a click.\n return\n }\n\n if (this.hoveredLabel) {\n this.props.onNodeSelect(this.hoveredLabel.node)\n this.renderCanvas()\n } else {\n this.props.onNodeSelect(null)\n }\n }\n\n private updateCursor() {\n if (this.lastDragPos) {\n document.body.style.cursor = 'grabbing'\n document.body.style.cursor = '-webkit-grabbing'\n } else {\n document.body.style.cursor = 'default'\n }\n }\n\n private onWindowMouseUp = (ev: MouseEvent) => {\n this.lastDragPos = null\n this.updateCursor()\n window.removeEventListener('mouseup', this.onWindowMouseUp)\n }\n\n private onMouseMove = (ev: MouseEvent) => {\n this.updateCursor()\n if (this.lastDragPos) {\n ev.preventDefault()\n this.onMouseDrag(ev)\n return\n }\n this.hoveredLabel = null\n const logicalViewSpaceMouse = new Vec2(ev.offsetX, ev.offsetY)\n const physicalViewSpaceMouse = this.logicalToPhysicalViewSpace().transformPosition(\n logicalViewSpaceMouse,\n )\n const configSpaceMouse = this.configSpaceToPhysicalViewSpace().inverseTransformPosition(\n physicalViewSpaceMouse,\n )\n\n if (!configSpaceMouse) return\n\n const setHoveredLabel = (frame: FlamechartFrame, depth = 0) => {\n const width = frame.end - frame.start\n const y = this.props.renderInverted ? this.configSpaceSize().y - 1 - depth : depth\n const configSpaceBounds = new Rect(new Vec2(frame.start, y), new Vec2(width, 1))\n if (configSpaceMouse.x < configSpaceBounds.left()) return null\n if (configSpaceMouse.x > configSpaceBounds.right()) return null\n\n if (configSpaceBounds.contains(configSpaceMouse)) {\n this.hoveredLabel = {\n configSpaceBounds,\n node: frame.node,\n }\n }\n\n for (let child of frame.children) {\n setHoveredLabel(child, depth + 1)\n }\n }\n\n for (let frame of this.props.flamechart.getLayers()[0] || []) {\n setHoveredLabel(frame)\n }\n\n if (this.hoveredLabel) {\n this.props.onNodeHover({node: this.hoveredLabel!.node, event: ev})\n } else {\n this.props.onNodeHover(null)\n }\n\n this.renderCanvas()\n }\n\n private onMouseLeave = (ev: MouseEvent) => {\n this.hoveredLabel = null\n this.props.onNodeHover(null)\n this.renderCanvas()\n }\n\n private onWheel = (ev: WheelEvent) => {\n ev.preventDefault()\n this.frameHadWheelEvent = true\n\n const isZoom = ev.metaKey || ev.ctrlKey\n\n let deltaY = ev.deltaY\n let deltaX = ev.deltaX\n if (ev.deltaMode === ev.DOM_DELTA_LINE) {\n deltaY *= this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT\n deltaX *= this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT\n }\n\n if (isZoom && this.interactionLock !== 'pan') {\n let multiplier = 1 + deltaY / 100\n\n // On Chrome & Firefox, pinch-to-zoom maps to\n // WheelEvent + Ctrl Key. We'll accelerate it in\n // this case, since it feels a bit sluggish otherwise.\n if (ev.ctrlKey) {\n multiplier = 1 + deltaY / 40\n }\n\n multiplier = clamp(multiplier, 0.1, 10.0)\n\n this.zoom(new Vec2(ev.offsetX, ev.offsetY), multiplier)\n } else if (this.interactionLock !== 'zoom') {\n this.pan(new Vec2(deltaX, deltaY))\n }\n\n this.renderCanvas()\n }\n\n onWindowKeyPress = (ev: KeyboardEvent) => {\n if (!this.container) return\n const {width, height} = this.container.getBoundingClientRect()\n\n if (ev.key === '=' || ev.key === '+') {\n this.zoom(new Vec2(width / 2, height / 2), 0.5)\n ev.preventDefault()\n } else if (ev.key === '-' || ev.key === '_') {\n this.zoom(new Vec2(width / 2, height / 2), 2)\n ev.preventDefault()\n }\n\n if (ev.ctrlKey || ev.shiftKey || ev.metaKey) return\n\n // NOTE: We intentionally use ev.code rather than ev.key for\n // WASD in order to have the keys retain the same layout even\n // if the keyboard layout is not QWERTY.\n //\n // See: https://github.com/jlfwong/speedscope/pull/184\n if (ev.key === '0') {\n this.zoom(new Vec2(width / 2, height / 2), 1e9)\n } else if (ev.key === 'ArrowRight' || ev.code === 'KeyD') {\n this.pan(new Vec2(100, 0))\n } else if (ev.key === 'ArrowLeft' || ev.code === 'KeyA') {\n this.pan(new Vec2(-100, 0))\n } else if (ev.key === 'ArrowUp' || ev.code === 'KeyW') {\n this.pan(new Vec2(0, -100))\n } else if (ev.key === 'ArrowDown' || ev.code === 'KeyS') {\n this.pan(new Vec2(0, 100))\n } else if (ev.key === 'Escape') {\n this.props.onNodeSelect(null)\n this.renderCanvas()\n }\n }\n\n shouldComponentUpdate() {\n return false\n }\n componentWillReceiveProps(nextProps: FlamechartPanZoomViewProps) {\n if (this.props.flamechart !== nextProps.flamechart) {\n this.hoveredLabel = null\n this.renderCanvas()\n } else if (this.props.searchResults !== nextProps.searchResults) {\n this.renderCanvas()\n } else if (this.props.selectedNode !== nextProps.selectedNode) {\n this.renderCanvas()\n } else if (this.props.configSpaceViewportRect !== nextProps.configSpaceViewportRect) {\n this.renderCanvas()\n } else if (this.props.canvasContext !== nextProps.canvasContext) {\n if (this.props.canvasContext) {\n this.props.canvasContext.removeBeforeFrameHandler(this.onBeforeFrame)\n }\n if (nextProps.canvasContext) {\n nextProps.canvasContext.addBeforeFrameHandler(this.onBeforeFrame)\n nextProps.canvasContext.requestFrame()\n }\n }\n }\n componentDidMount() {\n this.props.canvasContext.addBeforeFrameHandler(this.onBeforeFrame)\n window.addEventListener('resize', this.onWindowResize)\n window.addEventListener('keydown', this.onWindowKeyPress)\n }\n componentWillUnmount() {\n this.props.canvasContext.removeBeforeFrameHandler(this.onBeforeFrame)\n window.removeEventListener('resize', this.onWindowResize)\n window.removeEventListener('keydown', this.onWindowKeyPress)\n }\n\n render() {\n const style = this.getStyle()\n\n return (\n <div\n className={css(style.panZoomView, commonStyle.vbox)}\n onMouseDown={this.onMouseDown}\n onMouseMove={this.onMouseMove}\n onMouseLeave={this.onMouseLeave}\n onClick={this.onClick}\n onDblClick={this.onDblClick}\n onWheel={this.onWheel}\n ref={this.containerRef}\n >\n <canvas width={1} height={1} ref={this.overlayCanvasRef} className={css(style.fill)} />\n </div>\n )\n }\n}\n","import {Vec2} from '../lib/math'\nimport {Sizes, FontSize, FontFamily, ZIndex} from './style'\nimport {css, StyleSheet} from 'aphrodite'\nimport {ComponentChildren, h} from 'preact'\nimport {useTheme, withTheme} from './themes/theme'\nimport { useCallback } from 'preact/hooks'\n\ninterface HovertipProps {\n containerSize: Vec2\n offset: Vec2\n children?: ComponentChildren\n}\n\nexport function Hovertip(props: HovertipProps) {\n const style = getStyle(useTheme())\n\n const {containerSize, offset} = props\n const containerWidth = containerSize.x\n const containerHeight = containerSize.y\n\n const OFFSET_FROM_MOUSE = 7\n\n const updateLocation = useCallback((el: HTMLDivElement | null) => {\n if (!el) return\n\n const clientRect = el.getBoundingClientRect()\n\n // Place the hovertip to the right of the cursor.\n let leftEdgeX = offset.x + OFFSET_FROM_MOUSE\n\n // If this would cause it to overflow the container, align the right\n // edge of the hovertip with the right edge of the container.\n if (leftEdgeX + clientRect.width > containerWidth - 1) {\n leftEdgeX = containerWidth - clientRect.width - 1\n\n // If aligning the right edge overflows the container, align the left edge\n // of the hovertip with the left edge of the container.\n if (leftEdgeX < 1) { leftEdgeX = 1 }\n }\n el.style.left = `${leftEdgeX}px`\n\n // Place the tooltip below the cursor\n let topEdgeY = offset.y + OFFSET_FROM_MOUSE\n\n // If this would cause it to overflow the container, place the hovertip\n // above the cursor instead. This intentionally differs from the horizontal\n // axis logic to avoid the cursor being in the middle of a hovertip when\n // possible.\n if (topEdgeY + clientRect.height > containerHeight - 1) {\n topEdgeY = offset.y - clientRect.height - 1\n\n // If placing the hovertip above the cursor overflows the container, align\n // the top edge of the hovertip with the top edge of the container.\n if (topEdgeY < 1) { topEdgeY = 1 }\n }\n el.style.top = `${topEdgeY}px`\n\n }, [containerWidth, containerHeight, offset.x, offset.y])\n\n return (\n <div className={css(style.hoverTip)} ref={updateLocation}>\n <div className={css(style.hoverTipRow)}>{props.children}</div>\n </div>\n )\n}\n\nconst HOVERTIP_PADDING = 2\n\nconst getStyle = withTheme(theme =>\n StyleSheet.create({\n hoverTip: {\n position: 'absolute',\n background: theme.bgPrimaryColor,\n border: '1px solid black',\n maxWidth: Sizes.TOOLTIP_WIDTH_MAX,\n paddingTop: HOVERTIP_PADDING,\n paddingBottom: HOVERTIP_PADDING,\n pointerEvents: 'none',\n userSelect: 'none',\n fontSize: FontSize.LABEL,\n fontFamily: FontFamily.MONOSPACE,\n zIndex: ZIndex.HOVERTIP,\n },\n hoverTipRow: {\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflowX: 'hidden',\n paddingLeft: HOVERTIP_PADDING,\n paddingRight: HOVERTIP_PADDING,\n maxWidth: Sizes.TOOLTIP_WIDTH_MAX,\n },\n }),\n)\n","import {memo} from 'preact/compat'\nimport {useContext, useMemo, useCallback} from 'preact/hooks'\nimport {SearchView, ProfileSearchContext} from './search-view'\nimport {\n FlamechartSearchMatch,\n FlamechartSearchResults,\n ProfileSearchResults,\n} from '../lib/profile-search'\nimport {Rect, Vec2} from '../lib/math'\nimport {h, createContext, ComponentChildren} from 'preact'\nimport {Flamechart} from '../lib/flamechart'\nimport {CallTreeNode} from '../lib/profile'\n\nexport const FlamechartSearchContext = createContext<FlamechartSearchData | null>(null)\n\nexport interface FlamechartSearchProps {\n flamechart: Flamechart\n selectedNode: CallTreeNode | null\n setSelectedNode: (node: CallTreeNode | null) => void\n configSpaceViewportRect: Rect\n setConfigSpaceViewportRect: (rect: Rect) => void\n children: ComponentChildren\n}\n\ninterface FlamechartSearchData {\n results: FlamechartSearchResults | null\n flamechart: Flamechart\n selectedNode: CallTreeNode | null\n setSelectedNode: (node: CallTreeNode | null) => void\n configSpaceViewportRect: Rect\n setConfigSpaceViewportRect: (rect: Rect) => void\n}\n\nexport const FlamechartSearchContextProvider = ({\n flamechart,\n selectedNode,\n setSelectedNode,\n configSpaceViewportRect,\n setConfigSpaceViewportRect,\n children,\n}: FlamechartSearchProps) => {\n const profileSearchResults: ProfileSearchResults | null = useContext(ProfileSearchContext)\n const flamechartSearchResults: FlamechartSearchResults | null = useMemo(() => {\n if (profileSearchResults == null) {\n return null\n }\n return new FlamechartSearchResults(flamechart, profileSearchResults)\n }, [flamechart, profileSearchResults])\n\n return (\n <FlamechartSearchContext.Provider\n value={{\n results: flamechartSearchResults,\n flamechart,\n selectedNode,\n setSelectedNode,\n configSpaceViewportRect,\n setConfigSpaceViewportRect,\n }}\n >\n {children}\n </FlamechartSearchContext.Provider>\n )\n}\n\nexport const FlamechartSearchView = memo(() => {\n const flamechartData = useContext(FlamechartSearchContext)\n\n // TODO(jlfwong): This pattern is pretty gross, but I really don't want values\n // that can be undefined or null.\n const searchResults = flamechartData == null ? null : flamechartData.results\n const selectedNode = flamechartData == null ? null : flamechartData.selectedNode\n const setSelectedNode = flamechartData == null ? null : flamechartData.setSelectedNode\n const configSpaceViewportRect =\n flamechartData == null ? null : flamechartData.configSpaceViewportRect\n const setConfigSpaceViewportRect =\n flamechartData == null ? null : flamechartData.setConfigSpaceViewportRect\n const flamechart = flamechartData == null ? null : flamechartData.flamechart\n\n const numResults = searchResults == null ? null : searchResults.count()\n const resultIndex: number | null = useMemo(() => {\n if (searchResults == null) return null\n if (selectedNode == null) return null\n return searchResults.indexOf(selectedNode)\n }, [searchResults, selectedNode])\n\n const selectAndZoomToMatch = useCallback(\n (match: FlamechartSearchMatch) => {\n if (!setSelectedNode) return\n if (!flamechart) return\n if (!configSpaceViewportRect) return\n if (!setConfigSpaceViewportRect) return\n\n // After the node is selected, we want to set the viewport so that the new\n // node can be seen clearly.\n //\n // TODO(jlfwong): The lack of animation here can be kind of jarring. It\n // would be nice to have some easier way for people to orient themselves\n // after the viewport shifted.\n const configSpaceResultBounds = match.configSpaceBounds\n\n const viewportRect = new Rect(\n configSpaceResultBounds.origin.minus(new Vec2(0, 1)),\n configSpaceResultBounds.size.withY(configSpaceViewportRect.height()),\n )\n\n setSelectedNode(match.node)\n setConfigSpaceViewportRect(\n flamechart.getClampedConfigSpaceViewportRect({configSpaceViewportRect: viewportRect}),\n )\n },\n [configSpaceViewportRect, setConfigSpaceViewportRect, setSelectedNode, flamechart],\n )\n\n const {selectPrev, selectNext} = useMemo(() => {\n if (numResults == null || numResults === 0 || searchResults == null) {\n return {selectPrev: () => {}, selectNext: () => {}}\n }\n\n return {\n selectPrev: () => {\n if (!searchResults?.at) return\n if (numResults == null || numResults === 0) return\n\n let index = resultIndex == null ? numResults - 1 : resultIndex - 1\n if (index < 0) index = numResults - 1\n const result = searchResults.at(index)\n selectAndZoomToMatch(result)\n },\n\n selectNext: () => {\n if (!searchResults?.at) return\n if (numResults == null || numResults === 0) return\n\n let index = resultIndex == null ? 0 : resultIndex + 1\n if (index >= numResults) index = 0\n const result = searchResults.at(index)\n selectAndZoomToMatch(result)\n },\n }\n }, [numResults, resultIndex, searchResults, selectAndZoomToMatch])\n\n return (\n <SearchView\n resultIndex={resultIndex}\n numResults={numResults}\n selectPrev={selectPrev}\n selectNext={selectNext}\n />\n )\n})\n","import {Component} from 'preact'\n\nexport type VoidState = {\n __dummyField: void\n}\nexport abstract class StatelessComponent<P> extends Component<P, VoidState> {}\n","import {h, Fragment} from 'preact'\nimport {css} from 'aphrodite'\n\nimport {CallTreeNode} from '../lib/profile'\n\nimport {Rect, Vec2, AffineTransform} from '../lib/math'\nimport {formatPercent} from '../lib/utils'\nimport {FlamechartMinimapView} from './flamechart-minimap-view'\n\nimport {Sizes, commonStyle} from './style'\nimport {FlamechartDetailView} from './flamechart-detail-view'\nimport {FlamechartPanZoomView} from './flamechart-pan-zoom-view'\nimport {Hovertip} from './hovertip'\nimport {FlamechartViewProps} from './flamechart-view-container'\nimport {ProfileSearchContext} from './search-view'\nimport {FlamechartSearchView} from './flamechart-search-view'\nimport {getFlamechartStyle} from './flamechart-style'\nimport {StatelessComponent} from '../lib/preact-helpers'\n\nexport class FlamechartView extends StatelessComponent<FlamechartViewProps> {\n private getStyle() {\n return getFlamechartStyle(this.props.theme)\n }\n\n private configSpaceSize() {\n return new Vec2(\n this.props.flamechart.getTotalWeight(),\n this.props.flamechart.getLayers().length,\n )\n }\n\n private setConfigSpaceViewportRect = (viewportRect: Rect): void => {\n const configSpaceDetailViewHeight = Sizes.DETAIL_VIEW_HEIGHT / Sizes.FRAME_HEIGHT\n\n const configSpaceSize = this.configSpaceSize()\n\n const width = this.props.flamechart.getClampedViewportWidth(viewportRect.size.x)\n const size = viewportRect.size.withX(width)\n\n const origin = Vec2.clamp(\n viewportRect.origin,\n new Vec2(0, -1),\n Vec2.max(\n Vec2.zero,\n configSpaceSize.minus(size).plus(new Vec2(0, configSpaceDetailViewHeight + 1)),\n ),\n )\n\n this.props.setConfigSpaceViewportRect(new Rect(origin, viewportRect.size.withX(width)))\n }\n\n private setLogicalSpaceViewportSize = (logicalSpaceViewportSize: Vec2): void => {\n this.props.setLogicalSpaceViewportSize(logicalSpaceViewportSize)\n }\n\n private transformViewport = (transform: AffineTransform): void => {\n const viewportRect = transform.transformRect(this.props.configSpaceViewportRect)\n this.setConfigSpaceViewportRect(viewportRect)\n }\n\n private onNodeHover = (hover: {node: CallTreeNode; event: MouseEvent} | null) => {\n this.props.setNodeHover(hover)\n }\n\n onNodeClick = (node: CallTreeNode | null) => {\n this.props.setSelectedNode(node)\n }\n\n formatValue(weight: number) {\n const totalWeight = this.props.flamechart.getTotalWeight()\n const percent = (100 * weight) / totalWeight\n const formattedPercent = formatPercent(percent)\n return `${this.props.flamechart.formatValue(weight)} (${formattedPercent})`\n }\n\n renderTooltip() {\n if (!this.container) return null\n\n const {hover} = this.props\n if (!hover) return null\n const {width, height, left, top} = this.container.getBoundingClientRect()\n const offset = new Vec2(hover.event.clientX - left, hover.event.clientY - top)\n const frame = hover.node.frame\n\n const style = this.getStyle()\n\n return (\n <Hovertip containerSize={new Vec2(width, height)} offset={offset}>\n <span className={css(style.hoverCount)}>\n {this.formatValue(hover.node.getTotalWeight())}\n </span>{' '}\n {frame.name}\n {frame.file ? (\n <div>\n {frame.file}:{frame.line}\n </div>\n ) : undefined}\n </Hovertip>\n )\n }\n\n container: HTMLDivElement | null = null\n containerRef = (container: Element | null) => {\n this.container = (container as HTMLDivElement) || null\n }\n\n render() {\n const style = this.getStyle()\n\n return (\n <div className={css(style.fill, commonStyle.vbox)} ref={this.containerRef}>\n <FlamechartMinimapView\n theme={this.props.theme}\n configSpaceViewportRect={this.props.configSpaceViewportRect}\n transformViewport={this.transformViewport}\n flamechart={this.props.flamechart}\n flamechartRenderer={this.props.flamechartRenderer}\n canvasContext={this.props.canvasContext}\n setConfigSpaceViewportRect={this.setConfigSpaceViewportRect}\n />\n <ProfileSearchContext.Consumer>\n {searchResults => (\n <Fragment>\n <FlamechartPanZoomView\n theme={this.props.theme}\n canvasContext={this.props.canvasContext}\n flamechart={this.props.flamechart}\n flamechartRenderer={this.props.flamechartRenderer}\n renderInverted={false}\n onNodeHover={this.onNodeHover}\n onNodeSelect={this.onNodeClick}\n selectedNode={this.props.selectedNode}\n transformViewport={this.transformViewport}\n configSpaceViewportRect={this.props.configSpaceViewportRect}\n setConfigSpaceViewportRect={this.setConfigSpaceViewportRect}\n logicalSpaceViewportSize={this.props.logicalSpaceViewportSize}\n setLogicalSpaceViewportSize={this.setLogicalSpaceViewportSize}\n searchResults={searchResults}\n />\n <FlamechartSearchView />\n </Fragment>\n )}\n </ProfileSearchContext.Consumer>\n {this.renderTooltip()}\n {this.props.selectedNode && (\n <FlamechartDetailView\n flamechart={this.props.flamechart}\n getCSSColorForFrame={this.props.getCSSColorForFrame}\n selectedNode={this.props.selectedNode}\n />\n )}\n </div>\n )\n }\n}\n","import {h} from 'preact'\nimport {CanvasContext} from '../gl/canvas-context'\nimport {Flamechart} from '../lib/flamechart'\nimport {FlamechartRenderer, FlamechartRendererOptions} from '../gl/flamechart-renderer'\nimport {Frame, Profile, CallTreeNode} from '../lib/profile'\nimport {memoizeByShallowEquality} from '../lib/utils'\nimport {FlamechartView} from './flamechart-view'\nimport {\n getRowAtlas,\n createGetColorBucketForFrame,\n getCanvasContext,\n createGetCSSColorForFrame,\n getFrameToColorBucket,\n} from '../app-state/getters'\nimport {Vec2, Rect} from '../lib/math'\nimport {memo, useCallback} from 'preact/compat'\nimport {ActiveProfileState} from '../app-state/active-profile-state'\nimport {FlamechartSearchContextProvider} from './flamechart-search-view'\nimport {Theme, useTheme} from './themes/theme'\nimport {FlamechartID, FlamechartViewState} from '../app-state/profile-group'\nimport {profileGroupAtom} from '../app-state'\n\ninterface FlamechartSetters {\n setLogicalSpaceViewportSize: (logicalSpaceViewportSize: Vec2) => void\n setConfigSpaceViewportRect: (configSpaceViewportRect: Rect) => void\n setNodeHover: (hover: {node: CallTreeNode; event: MouseEvent} | null) => void\n setSelectedNode: (node: CallTreeNode | null) => void\n}\n\nexport function useFlamechartSetters(id: FlamechartID): FlamechartSetters {\n return {\n setNodeHover: useCallback(\n (hover: {node: CallTreeNode; event: MouseEvent} | null) => {\n profileGroupAtom.setFlamechartHoveredNode(id, hover)\n },\n [id],\n ),\n setLogicalSpaceViewportSize: useCallback(\n (logicalSpaceViewportSize: Vec2) => {\n profileGroupAtom.setLogicalSpaceViewportSize(id, logicalSpaceViewportSize)\n },\n [id],\n ),\n setConfigSpaceViewportRect: useCallback(\n (configSpaceViewportRect: Rect) => {\n profileGroupAtom.setConfigSpaceViewportRect(id, configSpaceViewportRect)\n },\n [id],\n ),\n setSelectedNode: useCallback(\n (selectedNode: CallTreeNode | null) => {\n profileGroupAtom.setSelectedNode(id, selectedNode)\n },\n [id],\n ),\n }\n}\n\nexport type FlamechartViewProps = {\n theme: Theme\n canvasContext: CanvasContext\n flamechart: Flamechart\n flamechartRenderer: FlamechartRenderer\n renderInverted: boolean\n getCSSColorForFrame: (frame: Frame) => string\n} & FlamechartSetters &\n FlamechartViewState\n\nexport const getChronoViewFlamechart = memoizeByShallowEquality(\n ({\n profile,\n getColorBucketForFrame,\n }: {\n profile: Profile\n getColorBucketForFrame: (frame: Frame) => number\n }): Flamechart => {\n return new Flamechart({\n getTotalWeight: profile.getTotalWeight.bind(profile),\n forEachCall: profile.forEachCall.bind(profile),\n formatValue: profile.formatValue.bind(profile),\n getColorBucketForFrame,\n })\n },\n)\n\nexport const createMemoizedFlamechartRenderer = (options?: FlamechartRendererOptions) =>\n memoizeByShallowEquality(\n ({\n canvasContext,\n flamechart,\n }: {\n canvasContext: CanvasContext\n flamechart: Flamechart\n }): FlamechartRenderer => {\n return new FlamechartRenderer(\n canvasContext.gl,\n getRowAtlas(canvasContext),\n flamechart,\n canvasContext.rectangleBatchRenderer,\n canvasContext.flamechartColorPassRenderer,\n options,\n )\n },\n )\n\nconst getChronoViewFlamechartRenderer = createMemoizedFlamechartRenderer()\n\nexport interface FlamechartViewContainerProps {\n activeProfileState: ActiveProfileState\n glCanvas: HTMLCanvasElement\n}\n\nexport const ChronoFlamechartView = memo((props: FlamechartViewContainerProps) => {\n const {activeProfileState, glCanvas} = props\n const {profile, chronoViewState} = activeProfileState\n\n const theme = useTheme()\n\n const canvasContext = getCanvasContext({theme, canvas: glCanvas})\n const frameToColorBucket = getFrameToColorBucket(profile)\n const getColorBucketForFrame = createGetColorBucketForFrame(frameToColorBucket)\n const getCSSColorForFrame = createGetCSSColorForFrame({theme, frameToColorBucket})\n\n const flamechart = getChronoViewFlamechart({profile, getColorBucketForFrame})\n const flamechartRenderer = getChronoViewFlamechartRenderer({\n canvasContext,\n flamechart,\n })\n\n const setters = useFlamechartSetters(FlamechartID.CHRONO)\n\n return (\n <FlamechartSearchContextProvider\n flamechart={flamechart}\n selectedNode={chronoViewState.selectedNode}\n setSelectedNode={setters.setSelectedNode}\n configSpaceViewportRect={chronoViewState.configSpaceViewportRect}\n setConfigSpaceViewportRect={setters.setConfigSpaceViewportRect}\n >\n <FlamechartView\n theme={theme}\n renderInverted={false}\n flamechart={flamechart}\n flamechartRenderer={flamechartRenderer}\n canvasContext={canvasContext}\n getCSSColorForFrame={getCSSColorForFrame}\n {...chronoViewState}\n {...setters}\n />\n </FlamechartSearchContextProvider>\n )\n})\n\nexport const getLeftHeavyFlamechart = memoizeByShallowEquality(\n ({\n profile,\n getColorBucketForFrame,\n }: {\n profile: Profile\n getColorBucketForFrame: (frame: Frame) => number\n }): Flamechart => {\n return new Flamechart({\n getTotalWeight: profile.getTotalNonIdleWeight.bind(profile),\n forEachCall: profile.forEachCallGrouped.bind(profile),\n formatValue: profile.formatValue.bind(profile),\n getColorBucketForFrame,\n })\n },\n)\n\nconst getLeftHeavyFlamechartRenderer = createMemoizedFlamechartRenderer()\n\nexport const LeftHeavyFlamechartView = memo((ownProps: FlamechartViewContainerProps) => {\n const {activeProfileState, glCanvas} = ownProps\n\n const {profile, leftHeavyViewState} = activeProfileState\n\n const theme = useTheme()\n\n const canvasContext = getCanvasContext({theme, canvas: glCanvas})\n const frameToColorBucket = getFrameToColorBucket(profile)\n const getColorBucketForFrame = createGetColorBucketForFrame(frameToColorBucket)\n const getCSSColorForFrame = createGetCSSColorForFrame({theme, frameToColorBucket})\n\n const flamechart = getLeftHeavyFlamechart({\n profile,\n getColorBucketForFrame,\n })\n const flamechartRenderer = getLeftHeavyFlamechartRenderer({\n canvasContext,\n flamechart,\n })\n\n const setters = useFlamechartSetters(FlamechartID.LEFT_HEAVY)\n\n return (\n <FlamechartSearchContextProvider\n flamechart={flamechart}\n selectedNode={leftHeavyViewState.selectedNode}\n setSelectedNode={setters.setSelectedNode}\n configSpaceViewportRect={leftHeavyViewState.configSpaceViewportRect}\n setConfigSpaceViewportRect={setters.setConfigSpaceViewportRect}\n >\n <FlamechartView\n theme={theme}\n renderInverted={false}\n flamechart={flamechart}\n flamechartRenderer={flamechartRenderer}\n canvasContext={canvasContext}\n getCSSColorForFrame={getCSSColorForFrame}\n {...leftHeavyViewState}\n {...setters}\n />\n </FlamechartSearchContextProvider>\n )\n})\n","import {CallTreeNode} from '../lib/profile'\nimport {StyleSheet, css} from 'aphrodite'\nimport {h} from 'preact'\nimport {commonStyle} from './style'\nimport {Rect, AffineTransform, Vec2} from '../lib/math'\nimport {FlamechartPanZoomView} from './flamechart-pan-zoom-view'\nimport {noop, formatPercent} from '../lib/utils'\nimport {Hovertip} from './hovertip'\nimport {FlamechartViewProps} from './flamechart-view-container'\nimport {withTheme} from './themes/theme'\nimport {StatelessComponent} from '../lib/preact-helpers'\n\nexport class FlamechartWrapper extends StatelessComponent<FlamechartViewProps> {\n private clampViewportToFlamegraph(viewportRect: Rect) {\n const {flamechart, renderInverted} = this.props\n return flamechart.getClampedConfigSpaceViewportRect({\n configSpaceViewportRect: viewportRect,\n renderInverted,\n })\n }\n private setConfigSpaceViewportRect = (configSpaceViewportRect: Rect) => {\n this.props.setConfigSpaceViewportRect(this.clampViewportToFlamegraph(configSpaceViewportRect))\n }\n private setLogicalSpaceViewportSize = (logicalSpaceViewportSize: Vec2): void => {\n this.props.setLogicalSpaceViewportSize(logicalSpaceViewportSize)\n }\n\n private transformViewport = (transform: AffineTransform) => {\n this.setConfigSpaceViewportRect(transform.transformRect(this.props.configSpaceViewportRect))\n }\n private formatValue(weight: number) {\n const totalWeight = this.props.flamechart.getTotalWeight()\n const percent = (100 * weight) / totalWeight\n const formattedPercent = formatPercent(percent)\n return `${this.props.flamechart.formatValue(weight)} (${formattedPercent})`\n }\n private renderTooltip() {\n if (!this.container) return null\n const {hover} = this.props\n if (!hover) return null\n const {width, height, left, top} = this.container.getBoundingClientRect()\n const offset = new Vec2(hover.event.clientX - left, hover.event.clientY - top)\n const style = getStyle(this.props.theme)\n const frame = hover.node.frame\n\n return (\n <Hovertip containerSize={new Vec2(width, height)} offset={offset}>\n <span className={css(style.hoverCount)}>\n {this.formatValue(hover.node.getTotalWeight())}\n </span>{' '}\n {frame.name}\n {frame.file ? (\n <div>\n {frame.file}:{frame.line}\n </div>\n ) : undefined}\n </Hovertip>\n )\n }\n container: HTMLDivElement | null = null\n containerRef = (container: Element | null) => {\n this.container = (container as HTMLDivElement) || null\n }\n private setNodeHover = (\n hover: {\n node: CallTreeNode\n event: MouseEvent\n } | null,\n ) => {\n this.props.setNodeHover(hover)\n }\n render() {\n return (\n <div\n className={css(commonStyle.fillY, commonStyle.fillX, commonStyle.vbox)}\n ref={this.containerRef}\n >\n <FlamechartPanZoomView\n theme={this.props.theme}\n selectedNode={null}\n onNodeHover={this.setNodeHover}\n onNodeSelect={noop}\n configSpaceViewportRect={this.props.configSpaceViewportRect}\n setConfigSpaceViewportRect={this.setConfigSpaceViewportRect}\n transformViewport={this.transformViewport}\n flamechart={this.props.flamechart}\n flamechartRenderer={this.props.flamechartRenderer}\n canvasContext={this.props.canvasContext}\n renderInverted={this.props.renderInverted}\n logicalSpaceViewportSize={this.props.logicalSpaceViewportSize}\n setLogicalSpaceViewportSize={this.setLogicalSpaceViewportSize}\n searchResults={null}\n />\n {this.renderTooltip()}\n </div>\n )\n }\n}\n\nexport const getStyle = withTheme(theme =>\n StyleSheet.create({\n hoverCount: {\n color: theme.weightColor,\n },\n }),\n)\n","import {memoizeByShallowEquality, noop} from '../lib/utils'\nimport {Profile, Frame} from '../lib/profile'\nimport {Flamechart} from '../lib/flamechart'\nimport {\n createMemoizedFlamechartRenderer,\n FlamechartViewContainerProps,\n useFlamechartSetters,\n} from './flamechart-view-container'\nimport {\n getCanvasContext,\n createGetColorBucketForFrame,\n createGetCSSColorForFrame,\n getFrameToColorBucket,\n} from '../app-state/getters'\nimport {FlamechartWrapper} from './flamechart-wrapper'\nimport {h} from 'preact'\nimport {memo} from 'preact/compat'\nimport {useTheme} from './themes/theme'\nimport {FlamechartID} from '../app-state/profile-group'\nimport {flattenRecursionAtom, glCanvasAtom} from '../app-state'\nimport {useAtom} from '../lib/atom'\n\nconst getInvertedCallerProfile = memoizeByShallowEquality(\n ({\n profile,\n frame,\n flattenRecursion,\n }: {\n profile: Profile\n frame: Frame\n flattenRecursion: boolean\n }): Profile => {\n let p = profile.getInvertedProfileForCallersOf(frame)\n return flattenRecursion ? p.getProfileWithRecursionFlattened() : p\n },\n)\n\nconst getInvertedCallerFlamegraph = memoizeByShallowEquality(\n ({\n invertedCallerProfile,\n getColorBucketForFrame,\n }: {\n invertedCallerProfile: Profile\n getColorBucketForFrame: (frame: Frame) => number\n }): Flamechart => {\n return new Flamechart({\n getTotalWeight: invertedCallerProfile.getTotalNonIdleWeight.bind(invertedCallerProfile),\n forEachCall: invertedCallerProfile.forEachCallGrouped.bind(invertedCallerProfile),\n formatValue: invertedCallerProfile.formatValue.bind(invertedCallerProfile),\n getColorBucketForFrame,\n })\n },\n)\n\nconst getInvertedCallerFlamegraphRenderer = createMemoizedFlamechartRenderer({inverted: true})\n\nexport const InvertedCallerFlamegraphView = memo((ownProps: FlamechartViewContainerProps) => {\n const {activeProfileState} = ownProps\n let {profile, sandwichViewState} = activeProfileState\n const flattenRecursion = useAtom(flattenRecursionAtom)\n const glCanvas = useAtom(glCanvasAtom)\n const theme = useTheme()\n\n if (!profile) throw new Error('profile missing')\n if (!glCanvas) throw new Error('glCanvas missing')\n const {callerCallee} = sandwichViewState\n if (!callerCallee) throw new Error('callerCallee missing')\n const {selectedFrame} = callerCallee\n\n const frameToColorBucket = getFrameToColorBucket(profile)\n const getColorBucketForFrame = createGetColorBucketForFrame(frameToColorBucket)\n const getCSSColorForFrame = createGetCSSColorForFrame({theme, frameToColorBucket})\n const canvasContext = getCanvasContext({theme, canvas: glCanvas})\n\n const flamechart = getInvertedCallerFlamegraph({\n invertedCallerProfile: getInvertedCallerProfile({\n profile,\n frame: selectedFrame,\n flattenRecursion,\n }),\n getColorBucketForFrame,\n })\n const flamechartRenderer = getInvertedCallerFlamegraphRenderer({canvasContext, flamechart})\n\n return (\n <FlamechartWrapper\n theme={theme}\n renderInverted={true}\n flamechart={flamechart}\n flamechartRenderer={flamechartRenderer}\n canvasContext={canvasContext}\n getCSSColorForFrame={getCSSColorForFrame}\n {...useFlamechartSetters(FlamechartID.SANDWICH_INVERTED_CALLERS)}\n {...callerCallee.invertedCallerFlamegraph}\n // This overrides the setSelectedNode specified in useFlamechartSettesr\n setSelectedNode={noop}\n />\n )\n})\n","import {memoizeByShallowEquality, noop} from '../lib/utils'\nimport {Profile, Frame} from '../lib/profile'\nimport {Flamechart} from '../lib/flamechart'\nimport {\n createMemoizedFlamechartRenderer,\n FlamechartViewContainerProps,\n useFlamechartSetters,\n} from './flamechart-view-container'\nimport {\n getCanvasContext,\n createGetColorBucketForFrame,\n createGetCSSColorForFrame,\n getFrameToColorBucket,\n} from '../app-state/getters'\nimport {FlamechartWrapper} from './flamechart-wrapper'\nimport {h} from 'preact'\nimport {memo} from 'preact/compat'\nimport {useTheme} from './themes/theme'\nimport {FlamechartID} from '../app-state/profile-group'\nimport {flattenRecursionAtom, glCanvasAtom} from '../app-state'\nimport {useAtom} from '../lib/atom'\n\nconst getCalleeProfile = memoizeByShallowEquality<\n {\n profile: Profile\n frame: Frame\n flattenRecursion: boolean\n },\n Profile\n>(({profile, frame, flattenRecursion}) => {\n let p = profile.getProfileForCalleesOf(frame)\n return flattenRecursion ? p.getProfileWithRecursionFlattened() : p\n})\n\nconst getCalleeFlamegraph = memoizeByShallowEquality<\n {\n calleeProfile: Profile\n getColorBucketForFrame: (frame: Frame) => number\n },\n Flamechart\n>(({calleeProfile, getColorBucketForFrame}) => {\n return new Flamechart({\n getTotalWeight: calleeProfile.getTotalNonIdleWeight.bind(calleeProfile),\n forEachCall: calleeProfile.forEachCallGrouped.bind(calleeProfile),\n formatValue: calleeProfile.formatValue.bind(calleeProfile),\n getColorBucketForFrame,\n })\n})\n\nconst getCalleeFlamegraphRenderer = createMemoizedFlamechartRenderer()\n\nexport const CalleeFlamegraphView = memo((ownProps: FlamechartViewContainerProps) => {\n const {activeProfileState} = ownProps\n const {profile, sandwichViewState} = activeProfileState\n const flattenRecursion = useAtom(flattenRecursionAtom)\n const glCanvas = useAtom(glCanvasAtom)\n const theme = useTheme()\n\n if (!profile) throw new Error('profile missing')\n if (!glCanvas) throw new Error('glCanvas missing')\n const {callerCallee} = sandwichViewState\n if (!callerCallee) throw new Error('callerCallee missing')\n const {selectedFrame} = callerCallee\n\n const frameToColorBucket = getFrameToColorBucket(profile)\n const getColorBucketForFrame = createGetColorBucketForFrame(frameToColorBucket)\n const getCSSColorForFrame = createGetCSSColorForFrame({theme, frameToColorBucket})\n const canvasContext = getCanvasContext({theme, canvas: glCanvas})\n\n const flamechart = getCalleeFlamegraph({\n calleeProfile: getCalleeProfile({profile, frame: selectedFrame, flattenRecursion}),\n getColorBucketForFrame,\n })\n const flamechartRenderer = getCalleeFlamegraphRenderer({canvasContext, flamechart})\n\n return (\n <FlamechartWrapper\n theme={theme}\n renderInverted={false}\n flamechart={flamechart}\n flamechartRenderer={flamechartRenderer}\n canvasContext={canvasContext}\n getCSSColorForFrame={getCSSColorForFrame}\n {...useFlamechartSetters(FlamechartID.SANDWICH_CALLEES)}\n {...callerCallee.calleeFlamegraph}\n // This overrides the setSelectedNode specified in useFlamechartSettesr\n setSelectedNode={noop}\n />\n )\n})\n","import {memo} from 'preact/compat'\nimport {useContext, useMemo} from 'preact/hooks'\nimport {SearchView} from './search-view'\nimport {h} from 'preact'\nimport {SandwichViewContext} from './sandwich-view'\n\nexport const SandwichSearchView = memo(() => {\n const sandwichViewContext = useContext(SandwichViewContext)\n\n const rowList = sandwichViewContext != null ? sandwichViewContext.rowList : null\n const resultIndex =\n sandwichViewContext?.selectedFrame != null\n ? sandwichViewContext.getIndexForFrame(sandwichViewContext.selectedFrame)\n : null\n const numResults = rowList != null ? rowList.length : null\n\n const {selectPrev, selectNext} = useMemo(() => {\n if (rowList == null || numResults == null || numResults === 0 || sandwichViewContext == null) {\n return {selectPrev: () => {}, selectNext: () => {}}\n }\n\n return {\n selectPrev: () => {\n let index = resultIndex == null ? numResults - 1 : resultIndex - 1\n if (index < 0) index = numResults - 1\n sandwichViewContext.setSelectedFrame(rowList[index])\n },\n selectNext: () => {\n let index = resultIndex == null ? 0 : resultIndex + 1\n if (index >= numResults) index = 0\n sandwichViewContext.setSelectedFrame(rowList[index])\n },\n }\n }, [resultIndex, rowList, numResults, sandwichViewContext])\n\n return (\n <SearchView\n resultIndex={resultIndex}\n numResults={numResults}\n selectPrev={selectPrev}\n selectNext={selectNext}\n />\n )\n})\n","import {Frame} from '../lib/profile'\nimport {StyleSheet, css} from 'aphrodite'\nimport {ProfileTableViewContainer} from './profile-table-view'\nimport {h, JSX, createContext} from 'preact'\nimport {memo} from 'preact/compat'\nimport {useCallback, useMemo, useContext} from 'preact/hooks'\nimport {commonStyle, Sizes, FontSize} from './style'\nimport {InvertedCallerFlamegraphView} from './inverted-caller-flamegraph-view'\nimport {CalleeFlamegraphView} from './callee-flamegraph-view'\nimport {SandwichSearchView} from './sandwich-search-view'\nimport {ActiveProfileState} from '../app-state/active-profile-state'\nimport {sortBy} from '../lib/utils'\nimport {ProfileSearchContext} from './search-view'\nimport {Theme, useTheme, withTheme} from './themes/theme'\nimport {SortField, SortDirection, profileGroupAtom, tableSortMethodAtom} from '../app-state'\nimport {useAtom} from '../lib/atom'\nimport {StatelessComponent} from '../lib/preact-helpers'\n\ninterface SandwichViewProps {\n selectedFrame: Frame | null\n profileIndex: number\n theme: Theme\n activeProfileState: ActiveProfileState\n setSelectedFrame: (selectedFrame: Frame | null) => void\n glCanvas: HTMLCanvasElement\n}\n\nclass SandwichView extends StatelessComponent<SandwichViewProps> {\n private setSelectedFrame = (selectedFrame: Frame | null) => {\n this.props.setSelectedFrame(selectedFrame)\n }\n\n onWindowKeyPress = (ev: KeyboardEvent) => {\n if (ev.key === 'Escape') {\n this.setSelectedFrame(null)\n }\n }\n\n componentDidMount() {\n window.addEventListener('keydown', this.onWindowKeyPress)\n }\n componentWillUnmount() {\n window.removeEventListener('keydown', this.onWindowKeyPress)\n }\n\n render() {\n const style = getStyle(this.props.theme)\n\n const {selectedFrame} = this.props\n let flamegraphViews: JSX.Element | null = null\n\n if (selectedFrame) {\n flamegraphViews = (\n <div className={css(commonStyle.fillY, style.callersAndCallees, commonStyle.vbox)}>\n <div className={css(commonStyle.hbox, style.panZoomViewWraper)}>\n <div className={css(style.flamechartLabelParent)}>\n <div className={css(style.flamechartLabel)}>Callers</div>\n </div>\n <InvertedCallerFlamegraphView\n glCanvas={this.props.glCanvas}\n activeProfileState={this.props.activeProfileState}\n />\n </div>\n <div className={css(style.divider)} />\n <div className={css(commonStyle.hbox, style.panZoomViewWraper)}>\n <div className={css(style.flamechartLabelParent, style.flamechartLabelParentBottom)}>\n <div className={css(style.flamechartLabel, style.flamechartLabelBottom)}>Callees</div>\n </div>\n <CalleeFlamegraphView\n glCanvas={this.props.glCanvas}\n activeProfileState={this.props.activeProfileState}\n />\n </div>\n </div>\n )\n }\n\n return (\n <div className={css(commonStyle.hbox, commonStyle.fillY)}>\n <div className={css(style.tableView)}>\n <ProfileTableViewContainer activeProfileState={this.props.activeProfileState} />\n <SandwichSearchView />\n </div>\n {flamegraphViews}\n </div>\n )\n }\n}\n\nconst getStyle = withTheme(theme =>\n StyleSheet.create({\n tableView: {\n position: 'relative',\n flex: 1,\n },\n panZoomViewWraper: {\n flex: 1,\n },\n flamechartLabelParent: {\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'flex-end',\n alignItems: 'flex-start',\n fontSize: FontSize.TITLE,\n width: FontSize.TITLE * 1.2,\n borderRight: `1px solid ${theme.fgSecondaryColor}`,\n },\n flamechartLabelParentBottom: {\n justifyContent: 'flex-start',\n },\n flamechartLabel: {\n transform: 'rotate(-90deg)',\n transformOrigin: '50% 50% 0',\n width: FontSize.TITLE * 1.2,\n flexShrink: 1,\n },\n flamechartLabelBottom: {\n transform: 'rotate(-90deg)',\n display: 'flex',\n justifyContent: 'flex-end',\n },\n callersAndCallees: {\n flex: 1,\n borderLeft: `${Sizes.SEPARATOR_HEIGHT}px solid ${theme.fgSecondaryColor}`,\n },\n divider: {\n height: 2,\n background: theme.fgSecondaryColor,\n },\n }),\n)\n\ninterface SandwichViewContainerProps {\n activeProfileState: ActiveProfileState\n glCanvas: HTMLCanvasElement\n}\n\ninterface SandwichViewContextData {\n rowList: Frame[]\n selectedFrame: Frame | null\n setSelectedFrame: (frame: Frame | null) => void\n getIndexForFrame: (frame: Frame) => number | null\n getSearchMatchForFrame: (frame: Frame) => [number, number][] | null\n}\n\nexport const SandwichViewContext = createContext<SandwichViewContextData | null>(null)\n\nexport const SandwichViewContainer = memo((ownProps: SandwichViewContainerProps) => {\n const {activeProfileState, glCanvas} = ownProps\n const {sandwichViewState, index} = activeProfileState\n const {callerCallee} = sandwichViewState\n\n const theme = useTheme()\n const setSelectedFrame = useCallback((selectedFrame: Frame | null) => {\n profileGroupAtom.setSelectedFrame(selectedFrame)\n }, [])\n\n const profile = activeProfileState.profile\n const tableSortMethod = useAtom(tableSortMethodAtom)\n const profileSearchResults = useContext(ProfileSearchContext)\n\n const selectedFrame = callerCallee ? callerCallee.selectedFrame : null\n\n const rowList: Frame[] = useMemo(() => {\n const rowList: Frame[] = []\n\n profile.forEachFrame(frame => {\n if (profileSearchResults && !profileSearchResults.getMatchForFrame(frame)) {\n return\n }\n rowList.push(frame)\n })\n\n switch (tableSortMethod.field) {\n case SortField.SYMBOL_NAME: {\n sortBy(rowList, f => f.name.toLowerCase())\n break\n }\n case SortField.SELF: {\n sortBy(rowList, f => f.getSelfWeight())\n break\n }\n case SortField.TOTAL: {\n sortBy(rowList, f => f.getTotalWeight())\n break\n }\n }\n if (tableSortMethod.direction === SortDirection.DESCENDING) {\n rowList.reverse()\n }\n\n return rowList\n }, [profile, profileSearchResults, tableSortMethod])\n\n const getIndexForFrame: (frame: Frame) => number | null = useMemo(() => {\n const indexByFrame = new Map<Frame, number>()\n for (let i = 0; i < rowList.length; i++) {\n indexByFrame.set(rowList[i], i)\n }\n return (frame: Frame) => {\n const index = indexByFrame.get(frame)\n return index == null ? null : index\n }\n }, [rowList])\n\n const getSearchMatchForFrame: (frame: Frame) => [number, number][] | null = useMemo(() => {\n return (frame: Frame) => {\n if (profileSearchResults == null) return null\n return profileSearchResults.getMatchForFrame(frame)\n }\n }, [profileSearchResults])\n\n const contextData: SandwichViewContextData = {\n rowList,\n selectedFrame,\n setSelectedFrame,\n getIndexForFrame,\n getSearchMatchForFrame,\n }\n\n return (\n <SandwichViewContext.Provider value={contextData}>\n <SandwichView\n theme={theme}\n activeProfileState={activeProfileState}\n glCanvas={glCanvas}\n setSelectedFrame={setSelectedFrame}\n selectedFrame={selectedFrame}\n profileIndex={index}\n />\n </SandwichViewContext.Provider>\n )\n})\n","import {FileFormat} from './file-format-spec'\nimport {zeroPad} from './utils'\n\nexport interface ValueFormatter {\n unit: FileFormat.ValueUnit\n format(v: number): string\n}\n\nexport class RawValueFormatter implements ValueFormatter {\n unit: FileFormat.ValueUnit = 'none'\n format(v: number) {\n return v.toLocaleString()\n }\n}\n\nexport class TimeFormatter implements ValueFormatter {\n private multiplier: number\n\n constructor(public unit: 'nanoseconds' | 'microseconds' | 'milliseconds' | 'seconds') {\n if (unit === 'nanoseconds') this.multiplier = 1e-9\n else if (unit === 'microseconds') this.multiplier = 1e-6\n else if (unit === 'milliseconds') this.multiplier = 1e-3\n else this.multiplier = 1\n }\n\n formatUnsigned(v: number) {\n const s = v * this.multiplier\n\n if (s / 60 >= 1) {\n const minutes = Math.floor(s / 60)\n const seconds = Math.floor(s - minutes * 60).toString()\n return `${minutes}:${zeroPad(seconds, 2)}`\n }\n if (s / 1 >= 1) return `${s.toFixed(2)}s`\n if (s / 1e-3 >= 1) return `${(s / 1e-3).toFixed(2)}ms`\n if (s / 1e-6 >= 1) return `${(s / 1e-6).toFixed(2)}µs`\n else return `${(s / 1e-9).toFixed(2)}ns`\n }\n\n format(v: number) {\n return `${v < 0 ? '-' : ''}${this.formatUnsigned(Math.abs(v))}`\n }\n}\n\nexport class ByteFormatter implements ValueFormatter {\n unit: FileFormat.ValueUnit = 'bytes'\n\n format(v: number) {\n if (v < 1024) return `${v.toFixed(0)} B`\n v /= 1024\n if (v < 1024) return `${v.toFixed(2)} KB`\n v /= 1024\n if (v < 1024) return `${v.toFixed(2)} MB`\n v /= 1024\n return `${v.toFixed(2)} GB`\n }\n}\n","var bundleURL = null;\nfunction getBundleURLCached() {\n if (!bundleURL) {\n bundleURL = getBundleURL();\n }\n\n return bundleURL;\n}\n\nfunction getBundleURL() {\n // Attempt to find the URL of the current script and use that as the base URL\n try {\n throw new Error;\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n return getBaseURL(matches[0]);\n }\n }\n\n return '/';\n}\n\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\n","var getBundleURL = require('./bundle-url').getBundleURL;\n\nfunction loadBundlesLazy(bundles) {\n if (!Array.isArray(bundles)) {\n bundles = [bundles]\n }\n\n var id = bundles[bundles.length - 1];\n\n try {\n return Promise.resolve(require(id));\n } catch (err) {\n if (err.code === 'MODULE_NOT_FOUND') {\n return new LazyPromise(function (resolve, reject) {\n loadBundles(bundles.slice(0, -1))\n .then(function () {\n return require(id);\n })\n .then(resolve, reject);\n });\n }\n\n throw err;\n }\n}\n\nfunction loadBundles(bundles) {\n return Promise.all(bundles.map(loadBundle));\n}\n\nvar bundleLoaders = {};\nfunction registerBundleLoader(type, loader) {\n bundleLoaders[type] = loader;\n}\n\nmodule.exports = exports = loadBundlesLazy;\nexports.load = loadBundles;\nexports.register = registerBundleLoader;\n\nvar bundles = {};\nfunction loadBundle(bundle) {\n var id;\n if (Array.isArray(bundle)) {\n id = bundle[1];\n bundle = bundle[0];\n }\n\n if (bundles[bundle]) {\n return bundles[bundle];\n }\n\n var type = (bundle.substring(bundle.lastIndexOf('.') + 1, bundle.length) || bundle).toLowerCase();\n var bundleLoader = bundleLoaders[type];\n if (bundleLoader) {\n return bundles[bundle] = bundleLoader(getBundleURL() + bundle)\n .then(function (resolved) {\n if (resolved) {\n module.bundle.register(id, resolved);\n }\n\n return resolved;\n }).catch(function(e) {\n delete bundles[bundle];\n \n throw e;\n });\n }\n}\n\nfunction LazyPromise(executor) {\n this.executor = executor;\n this.promise = null;\n}\n\nLazyPromise.prototype.then = function (onSuccess, onError) {\n if (this.promise === null) this.promise = new Promise(this.executor)\n return this.promise.then(onSuccess, onError)\n};\n\nLazyPromise.prototype.catch = function (onError) {\n if (this.promise === null) this.promise = new Promise(this.executor)\n return this.promise.catch(onError)\n};\n","import {lastOf, KeyedSet} from './utils'\nimport {ValueFormatter, RawValueFormatter} from './value-formatters'\nimport {FileFormat} from './file-format-spec'\nconst demangleCppModule = import('./demangle-cpp')\n\nexport interface FrameInfo {\n key: string | number\n\n // Name of the frame. May be a method name, e.g.\n // \"ActiveRecord##to_hash\"\n name: string\n\n // File path of the code corresponding to this\n // call stack frame.\n file?: string\n\n // Line in the given file where this frame occurs, 1-based.\n line?: number\n\n // Column in the file, 1-based.\n col?: number\n}\n\nexport type SymbolRemapper = (\n frame: Frame,\n) => {name?: string; file?: string; line?: number; col?: number} | null\n\nexport class HasWeights {\n private selfWeight = 0\n private totalWeight = 0\n getSelfWeight() {\n return this.selfWeight\n }\n getTotalWeight() {\n return this.totalWeight\n }\n addToTotalWeight(delta: number) {\n this.totalWeight += delta\n }\n addToSelfWeight(delta: number) {\n this.selfWeight += delta\n }\n\n overwriteWeightWith(other: HasWeights) {\n this.selfWeight = other.selfWeight\n this.totalWeight = other.totalWeight\n }\n}\n\nexport class Frame extends HasWeights {\n key: string | number\n\n // Name of the frame. May be a method name, e.g.\n // \"ActiveRecord##to_hash\"\n name: string\n\n // File path of the code corresponding to this\n // call stack frame.\n file?: string\n\n // Line in the given file where this frame occurs\n line?: number\n\n // Column in the file\n col?: number\n\n private constructor(info: FrameInfo) {\n super()\n this.key = info.key\n this.name = info.name\n this.file = info.file\n this.line = info.line\n this.col = info.col\n }\n\n static root = new Frame({\n key: '(speedscope root)',\n name: '(speedscope root)',\n })\n\n static getOrInsert(set: KeyedSet<Frame>, info: FrameInfo) {\n return set.getOrInsert(new Frame(info))\n }\n}\n\nexport class CallTreeNode extends HasWeights {\n children: CallTreeNode[] = []\n\n isRoot() {\n return this.frame === Frame.root\n }\n\n // If a node is \"frozen\", it means it should no longer be mutated.\n private frozen = false\n isFrozen() {\n return this.frozen\n }\n freeze() {\n this.frozen = true\n }\n\n constructor(readonly frame: Frame, readonly parent: CallTreeNode | null) {\n super()\n }\n}\n\nexport interface ProfileGroup {\n name: string\n indexToView: number\n profiles: Profile[]\n}\n\nexport class Profile {\n protected name: string = ''\n\n protected totalWeight: number\n\n protected frames = new KeyedSet<Frame>()\n\n // Profiles store two call-trees.\n //\n // The \"append order\" call tree is the one in which nodes are ordered in\n // whatever order they were appended to their parent.\n //\n // The \"grouped\" call tree is one in which each node has at most one child per\n // frame. Nodes are ordered in decreasing order of weight\n protected appendOrderCalltreeRoot = new CallTreeNode(Frame.root, null)\n protected groupedCalltreeRoot = new CallTreeNode(Frame.root, null)\n\n public getAppendOrderCalltreeRoot() {\n return this.appendOrderCalltreeRoot\n }\n public getGroupedCalltreeRoot() {\n return this.groupedCalltreeRoot\n }\n\n // List of references to CallTreeNodes at the top of the\n // stack at the time of the sample.\n protected samples: CallTreeNode[] = []\n protected weights: number[] = []\n\n protected valueFormatter: ValueFormatter = new RawValueFormatter()\n\n constructor(totalWeight: number = 0) {\n this.totalWeight = totalWeight\n }\n\n shallowClone(): Profile {\n const profile = new Profile(this.totalWeight)\n Object.assign(profile, this)\n return profile\n }\n\n formatValue(v: number) {\n return this.valueFormatter.format(v)\n }\n setValueFormatter(f: ValueFormatter) {\n this.valueFormatter = f\n }\n getWeightUnit(): FileFormat.ValueUnit {\n return this.valueFormatter.unit\n }\n\n getName() {\n return this.name\n }\n setName(name: string) {\n this.name = name\n }\n\n getTotalWeight() {\n return this.totalWeight\n }\n\n private totalNonIdleWeight: number | null = null\n getTotalNonIdleWeight() {\n if (this.totalNonIdleWeight === null) {\n this.totalNonIdleWeight = this.groupedCalltreeRoot.children.reduce(\n (n, c) => n + c.getTotalWeight(),\n 0,\n )\n }\n return this.totalNonIdleWeight\n }\n\n // This is private because it should only be called in the ProfileBuilder\n // classes. Once a Profile instance has been constructed, it should be treated\n // as immutable.\n protected sortGroupedCallTree() {\n function visit(node: CallTreeNode) {\n node.children.sort((a, b) => -(a.getTotalWeight() - b.getTotalWeight()))\n node.children.forEach(visit)\n }\n visit(this.groupedCalltreeRoot)\n }\n\n forEachCallGrouped(\n openFrame: (node: CallTreeNode, value: number) => void,\n closeFrame: (node: CallTreeNode, value: number) => void,\n ) {\n function visit(node: CallTreeNode, start: number) {\n if (node.frame !== Frame.root) {\n openFrame(node, start)\n }\n\n let childTime = 0\n\n node.children.forEach(function (child) {\n visit(child, start + childTime)\n childTime += child.getTotalWeight()\n })\n\n if (node.frame !== Frame.root) {\n closeFrame(node, start + node.getTotalWeight())\n }\n }\n visit(this.groupedCalltreeRoot, 0)\n }\n\n forEachCall(\n openFrame: (node: CallTreeNode, value: number) => void,\n closeFrame: (node: CallTreeNode, value: number) => void,\n ) {\n let prevStack: CallTreeNode[] = []\n let value = 0\n\n let sampleIndex = 0\n for (let stackTop of this.samples) {\n // Find lowest common ancestor of the current stack and the previous one\n let lca: CallTreeNode | null = null\n\n // This is O(n^2), but n should be relatively small here (stack height),\n // so hopefully this isn't much of a problem\n for (\n lca = stackTop;\n lca && lca.frame != Frame.root && prevStack.indexOf(lca) === -1;\n lca = lca.parent\n ) {}\n\n // Close frames that are no longer open\n while (prevStack.length > 0 && lastOf(prevStack) != lca) {\n const node = prevStack.pop()!\n closeFrame(node, value)\n }\n\n // Open frames that are now becoming open\n const toOpen: CallTreeNode[] = []\n for (\n let node: CallTreeNode | null = stackTop;\n node && node.frame != Frame.root && node != lca;\n node = node.parent\n ) {\n toOpen.push(node)\n }\n toOpen.reverse()\n\n for (let node of toOpen) {\n openFrame(node, value)\n }\n\n prevStack = prevStack.concat(toOpen)\n value += this.weights[sampleIndex++]\n }\n\n // Close frames that are open at the end of the trace\n for (let i = prevStack.length - 1; i >= 0; i--) {\n closeFrame(prevStack[i], value)\n }\n }\n\n forEachFrame(fn: (frame: Frame) => void) {\n this.frames.forEach(fn)\n }\n\n getProfileWithRecursionFlattened(): Profile {\n const builder = new CallTreeProfileBuilder()\n\n const stack: (CallTreeNode | null)[] = []\n const framesInStack = new Set<Frame>()\n\n function openFrame(node: CallTreeNode, value: number) {\n if (framesInStack.has(node.frame)) {\n stack.push(null)\n } else {\n framesInStack.add(node.frame)\n stack.push(node)\n builder.enterFrame(node.frame, value)\n }\n }\n function closeFrame(node: CallTreeNode, value: number) {\n const stackTop = stack.pop()\n if (stackTop) {\n framesInStack.delete(stackTop.frame)\n builder.leaveFrame(stackTop.frame, value)\n }\n }\n\n this.forEachCall(openFrame, closeFrame)\n\n const flattenedProfile = builder.build()\n flattenedProfile.name = this.name\n flattenedProfile.valueFormatter = this.valueFormatter\n\n // When constructing a profile with recursion flattened,\n // counter-intuitive things can happen to \"self time\" measurements\n // for functions.\n // For example, given the following list of stacks w/ weights:\n //\n // a 1\n // a;b;a 1\n // a;b;a;b;a 1\n // a;b;a 1\n //\n // The resulting profile with recursion flattened out will look like this:\n //\n // a 1\n // a;b 3\n //\n // Which is useful to view, but it's counter-intuitive to move self-time\n // for frames around, since analyzing the self-time of functions is an important\n // thing to be able to do accurately, and we don't want this to change when recursion\n // is flattened. To work around that, we'll just copy the weights directly from the\n // un-flattened profile.\n this.forEachFrame(f => {\n flattenedProfile.frames.getOrInsert(f).overwriteWeightWith(f)\n })\n\n return flattenedProfile\n }\n\n getInvertedProfileForCallersOf(focalFrameInfo: FrameInfo): Profile {\n const focalFrame = Frame.getOrInsert(this.frames, focalFrameInfo)\n const builder = new StackListProfileBuilder()\n\n // TODO(jlfwong): Could construct this at profile\n // construction time rather than on demand.\n const nodes: CallTreeNode[] = []\n\n function visit(node: CallTreeNode) {\n if (node.frame === focalFrame) {\n nodes.push(node)\n } else {\n for (let child of node.children) {\n visit(child)\n }\n }\n }\n\n visit(this.appendOrderCalltreeRoot)\n\n for (let node of nodes) {\n const stack: FrameInfo[] = []\n for (let n: CallTreeNode | null = node; n != null && n.frame !== Frame.root; n = n.parent) {\n stack.push(n.frame)\n }\n builder.appendSampleWithWeight(stack, node.getTotalWeight())\n }\n\n const ret = builder.build()\n ret.name = this.name\n ret.valueFormatter = this.valueFormatter\n return ret\n }\n\n getProfileForCalleesOf(focalFrameInfo: FrameInfo): Profile {\n const focalFrame = Frame.getOrInsert(this.frames, focalFrameInfo)\n const builder = new StackListProfileBuilder()\n\n function recordSubtree(focalFrameNode: CallTreeNode) {\n const stack: FrameInfo[] = []\n\n function visit(node: CallTreeNode) {\n stack.push(node.frame)\n builder.appendSampleWithWeight(stack, node.getSelfWeight())\n for (let child of node.children) {\n visit(child)\n }\n stack.pop()\n }\n\n visit(focalFrameNode)\n }\n\n function findCalls(node: CallTreeNode) {\n if (node.frame === focalFrame) {\n recordSubtree(node)\n } else {\n for (let child of node.children) {\n findCalls(child)\n }\n }\n }\n\n findCalls(this.appendOrderCalltreeRoot)\n\n const ret = builder.build()\n ret.name = this.name\n ret.valueFormatter = this.valueFormatter\n return ret\n }\n\n // Demangle symbols for readability\n async demangle() {\n let demangleCpp: ((name: string) => string) | null = null\n\n for (let frame of this.frames) {\n // This function converts a mangled C++ name such as \"__ZNK7Support6ColorFeqERKS0_\"\n // into a human-readable symbol (in this case \"Support::ColorF::==(Support::ColorF&)\")\n if (frame.name.startsWith('__Z')) {\n if (!demangleCpp) {\n demangleCpp = (await demangleCppModule).demangleCpp\n }\n frame.name = demangleCpp(frame.name)\n }\n }\n }\n\n remapSymbols(callback: SymbolRemapper) {\n for (let frame of this.frames) {\n const remapped = callback(frame)\n if (remapped == null) {\n continue\n }\n const {name, file, line, col} = remapped\n if (name != null) {\n frame.name = name\n }\n if (file != null) {\n frame.file = file\n }\n if (line != null) {\n frame.line = line\n }\n if (col != null) {\n frame.col = col\n }\n }\n }\n}\n\nexport class StackListProfileBuilder extends Profile {\n _appendSample(stack: FrameInfo[], weight: number, useAppendOrder: boolean) {\n if (isNaN(weight)) throw new Error('invalid weight')\n let node = useAppendOrder ? this.appendOrderCalltreeRoot : this.groupedCalltreeRoot\n\n let framesInStack = new Set<Frame>()\n\n for (let frameInfo of stack) {\n const frame = Frame.getOrInsert(this.frames, frameInfo)\n const last = useAppendOrder\n ? lastOf(node.children)\n : node.children.find(c => c.frame === frame)\n if (last && !last.isFrozen() && last.frame == frame) {\n node = last\n } else {\n const parent = node\n node = new CallTreeNode(frame, node)\n parent.children.push(node)\n }\n node.addToTotalWeight(weight)\n\n // It's possible for the same frame to occur multiple\n // times in the same call stack due to either direct\n // or indirect recursion. We want to avoid counting that\n // frame multiple times for a single sample, we so just\n // track all of the unique frames that participated in\n // this call stack, then add to their weight at the end.\n framesInStack.add(node.frame)\n }\n node.addToSelfWeight(weight)\n\n if (useAppendOrder) {\n for (let child of node.children) {\n child.freeze()\n }\n }\n\n if (useAppendOrder) {\n node.frame.addToSelfWeight(weight)\n\n for (let frame of framesInStack) {\n frame.addToTotalWeight(weight)\n }\n\n if (node === lastOf(this.samples)) {\n this.weights[this.weights.length - 1] += weight\n } else {\n this.samples.push(node)\n this.weights.push(weight)\n }\n }\n }\n\n appendSampleWithWeight(stack: FrameInfo[], weight: number) {\n if (weight === 0) {\n // Samples with zero weight have no effect, so let's ignore them\n return\n }\n if (weight < 0) {\n throw new Error('Samples must have positive weights')\n }\n\n this._appendSample(stack, weight, true)\n this._appendSample(stack, weight, false)\n }\n\n private pendingSample: {\n stack: FrameInfo[]\n startTimestamp: number\n centralTimestamp: number\n } | null = null\n appendSampleWithTimestamp(stack: FrameInfo[], timestamp: number) {\n if (this.pendingSample) {\n if (timestamp < this.pendingSample.centralTimestamp) {\n throw new Error('Timestamps received out of order')\n }\n const endTimestamp = (timestamp + this.pendingSample.centralTimestamp) / 2\n this.appendSampleWithWeight(\n this.pendingSample.stack,\n endTimestamp - this.pendingSample.startTimestamp,\n )\n this.pendingSample = {stack, startTimestamp: endTimestamp, centralTimestamp: timestamp}\n } else {\n this.pendingSample = {stack, startTimestamp: timestamp, centralTimestamp: timestamp}\n }\n }\n\n build(): Profile {\n if (this.pendingSample) {\n if (this.samples.length > 0) {\n this.appendSampleWithWeight(\n this.pendingSample.stack,\n this.pendingSample.centralTimestamp - this.pendingSample.startTimestamp,\n )\n } else {\n // There is only a single sample. In this case, units will be meaningless,\n // so we'll append with a weight of 1 and also clear any value formatter\n this.appendSampleWithWeight(this.pendingSample.stack, 1)\n this.setValueFormatter(new RawValueFormatter())\n }\n }\n this.totalWeight = Math.max(\n this.totalWeight,\n this.weights.reduce((a, b) => a + b, 0),\n )\n this.sortGroupedCallTree()\n return this\n }\n}\n\n// As an alternative API for importing profiles more efficiently, provide a\n// way to open & close frames directly without needing to construct tons of\n// arrays as intermediaries.\nexport class CallTreeProfileBuilder extends Profile {\n private appendOrderStack: CallTreeNode[] = [this.appendOrderCalltreeRoot]\n private groupedOrderStack: CallTreeNode[] = [this.groupedCalltreeRoot]\n private framesInStack = new Map<Frame, number>()\n private stack: Frame[] = []\n\n private lastValue: number = 0\n private addWeightsToFrames(value: number) {\n const delta = value - this.lastValue\n for (let frame of this.framesInStack.keys()) {\n frame.addToTotalWeight(delta)\n }\n const stackTop = lastOf(this.stack)\n if (stackTop) {\n stackTop.addToSelfWeight(delta)\n }\n }\n private addWeightsToNodes(value: number, stack: CallTreeNode[]) {\n const delta = value - this.lastValue\n for (let node of stack) {\n node.addToTotalWeight(delta)\n }\n const stackTop = lastOf(stack)\n if (stackTop) {\n stackTop.addToSelfWeight(delta)\n }\n }\n\n private _enterFrame(frame: Frame, value: number, useAppendOrder: boolean) {\n let stack = useAppendOrder ? this.appendOrderStack : this.groupedOrderStack\n this.addWeightsToNodes(value, stack)\n\n let prevTop = lastOf(stack)\n\n if (prevTop) {\n if (useAppendOrder) {\n const delta = value - this.lastValue\n if (delta > 0) {\n this.samples.push(prevTop)\n this.weights.push(value - this.lastValue)\n } else if (delta < 0) {\n throw new Error(\n `Samples must be provided in increasing order of cumulative value. Last sample was ${this.lastValue}, this sample was ${value}`,\n )\n }\n }\n\n const last = useAppendOrder\n ? lastOf(prevTop.children)\n : prevTop.children.find(c => c.frame === frame)\n let node: CallTreeNode\n if (last && !last.isFrozen() && last.frame == frame) {\n node = last\n } else {\n node = new CallTreeNode(frame, prevTop)\n prevTop.children.push(node)\n }\n stack.push(node)\n }\n }\n enterFrame(frameInfo: FrameInfo, value: number) {\n const frame = Frame.getOrInsert(this.frames, frameInfo)\n this.addWeightsToFrames(value)\n this._enterFrame(frame, value, true)\n this._enterFrame(frame, value, false)\n\n this.stack.push(frame)\n const frameCount = this.framesInStack.get(frame) || 0\n this.framesInStack.set(frame, frameCount + 1)\n this.lastValue = value\n this.totalWeight = Math.max(this.totalWeight, this.lastValue)\n }\n\n private _leaveFrame(frame: Frame, value: number, useAppendOrder: boolean) {\n let stack = useAppendOrder ? this.appendOrderStack : this.groupedOrderStack\n this.addWeightsToNodes(value, stack)\n\n if (useAppendOrder) {\n const leavingStackTop = this.appendOrderStack.pop()\n if (leavingStackTop == null) {\n throw new Error(`Trying to leave ${frame.key} when stack is empty`)\n }\n if (this.lastValue == null) {\n throw new Error(`Trying to leave a ${frame.key} before any have been entered`)\n }\n leavingStackTop.freeze()\n\n if (leavingStackTop.frame.key !== frame.key) {\n throw new Error(\n `Tried to leave frame \"${frame.name}\" while frame \"${leavingStackTop.frame.name}\" was at the top at ${value}`,\n )\n }\n\n const delta = value - this.lastValue\n if (delta > 0) {\n this.samples.push(leavingStackTop)\n this.weights.push(value - this.lastValue)\n } else if (delta < 0) {\n throw new Error(\n `Samples must be provided in increasing order of cumulative value. Last sample was ${this\n .lastValue!}, this sample was ${value}`,\n )\n }\n } else {\n this.groupedOrderStack.pop()\n }\n }\n\n leaveFrame(frameInfo: FrameInfo, value: number) {\n const frame = Frame.getOrInsert(this.frames, frameInfo)\n this.addWeightsToFrames(value)\n\n this._leaveFrame(frame, value, true)\n this._leaveFrame(frame, value, false)\n\n this.stack.pop()\n const frameCount = this.framesInStack.get(frame)\n if (frameCount == null) return\n if (frameCount === 1) {\n this.framesInStack.delete(frame)\n } else {\n this.framesInStack.set(frame, frameCount - 1)\n }\n this.lastValue = value\n\n this.totalWeight = Math.max(this.totalWeight, this.lastValue)\n }\n\n build(): Profile {\n // Each stack is expected to contain a single node which we initialize to be\n // the root node.\n if (this.appendOrderStack.length > 1 || this.groupedOrderStack.length > 1) {\n throw new Error('Tried to complete profile construction with a non-empty stack')\n }\n this.sortGroupedCallTree()\n return this\n }\n}\n","// This file contains types which specify the speedscope file format.\n\nexport namespace FileFormat {\n export type Profile = EventedProfile | SampledProfile\n\n export interface File {\n $schema: 'https://www.speedscope.app/file-format-schema.json'\n\n // Data shared between profiles\n shared: {\n frames: Frame[]\n }\n\n // List of profile definitions\n profiles: Profile[]\n\n // The name of the contained profile group. If omitted, will use the name of\n // the file itself.\n // Added in 0.6.0\n name?: string\n\n // The index into the `profiles` array that should be displayed upon file\n // load. If omitted, will default to displaying the first profile in the\n // file.\n //\n // Added in 0.6.0\n activeProfileIndex?: number\n\n // The name of the the program which exported this profile. This isn't\n // consumed but can be helpful for debugging generated data by seeing what\n // was generating it! Recommended format is \"name@version\". e.g. when the\n // file was exported by speedscope v0.6.0 itself, it will be\n // \"speedscope@0.6.0\"\n //\n // Added in 0.6.0\n exporter?: string\n }\n\n export interface Frame {\n name: string\n file?: string\n line?: number\n col?: number\n }\n\n export enum ProfileType {\n EVENTED = 'evented',\n SAMPLED = 'sampled',\n }\n\n export interface IProfile {\n // Type of profile. This will future proof the file format to allow many\n // different kinds of profiles to be contained and each type to be part of\n // a discriminated union.\n type: ProfileType\n }\n\n export interface EventedProfile extends IProfile {\n type: ProfileType.EVENTED\n\n // Name of the profile. Typically a filename for the source of the profile.\n name: string\n\n // Unit which all value are specified using in the profile.\n unit: ValueUnit\n\n // The starting value of the profile. This will typically be a timestamp.\n // All event values will be relative to this startValue.\n startValue: number\n\n // The final value of the profile. This will typically be a timestamp. This\n // must be greater than or equal to the startValue. This is useful in\n // situations where the recorded profile extends past the end of the recorded\n // events, which may happen if nothing was happening at the end of the\n // profile.\n endValue: number\n\n // List of events that occured as part of this profile.\n // The \"at\" field of every event must be in non-decreasing order.\n events: (OpenFrameEvent | CloseFrameEvent)[]\n }\n\n // List of indices into the frame array\n type SampledStack = number[]\n\n export interface SampledProfile extends IProfile {\n type: ProfileType.SAMPLED\n\n // Name of the profile. Typically a filename for the source of the profile.\n name: string\n\n // Unit which all value are specified using in the profile.\n unit: ValueUnit\n\n // The starting value of the profile. This will typically be a timestamp.\n // All event values will be relative to this startValue.\n startValue: number\n\n // The final value of the profile. This will typically be a timestamp. This\n // must be greater than or equal to the startValue. This is useful in\n // situations where the recorded profile extends past the end of the recorded\n // events, which may happen if nothing was happening at the end of the\n // profile.\n endValue: number\n\n // List of stacks\n samples: SampledStack[]\n\n // The weight of the sample at the given index. Should have\n // the same length as the samples array.\n weights: number[]\n }\n\n export type ValueUnit =\n | 'none'\n | 'nanoseconds'\n | 'microseconds'\n | 'milliseconds'\n | 'seconds'\n | 'bytes'\n\n export enum EventType {\n OPEN_FRAME = 'O',\n CLOSE_FRAME = 'C',\n }\n\n interface IEvent {\n type: EventType\n at: number\n }\n\n // Indicates a stack frame opened. Every opened stack frame must have a\n // corresponding close frame event, and the ordering must be balanced.\n interface OpenFrameEvent extends IEvent {\n type: EventType.OPEN_FRAME\n // An index into the frames array in the shared data within the profile\n frame: number\n }\n\n interface CloseFrameEvent extends IEvent {\n type: EventType.CLOSE_FRAME\n // An index into the frames array in the shared data within the profile\n frame: number\n }\n}\n","module.exports={name:\"speedscope\",version:\"1.15.0\",description:\"\",repository:\"jlfwong/speedscope\",main:\"index.js\",bin:{speedscope:\"./bin/cli.js\"},scripts:{deploy:\"./scripts/deploy.sh\",prepack:\"./scripts/build-release.sh\",prettier:\"prettier --write 'src/**/*.ts' 'src/**/*.tsx'\",lint:\"eslint 'src/**/*.ts' 'src/**/*.tsx'\",jest:\"./scripts/test-setup.sh && jest --runInBand\",coverage:\"npm run jest -- --coverage\",typecheck:\"tsc --noEmit\",test:\"./scripts/ci.sh\",serve:\"parcel assets/index.html --open --no-autoinstall\"},files:[\"bin/cli.js\",\"dist/release/**\",\"!*.map\"],browserslist:[\"last 2 Chrome versions\",\"last 2 Firefox versions\"],author:\"\",license:\"MIT\",devDependencies:{\"@types/jest\":\"22.2.3\",\"@types/jszip\":\"3.1.4\",\"@types/node\":\"14.0.1\",\"@types/pako\":\"1.0.0\",\"@typescript-eslint/eslint-plugin\":\"4.19.0\",\"@typescript-eslint/parser\":\"4.19.0\",acorn:\"7.2.0\",aphrodite:\"2.1.0\",eslint:\"6.0.0\",\"eslint-plugin-prettier\":\"2.6.0\",\"eslint-plugin-react-hooks\":\"4.0.2\",jest:\"24.3.0\",jsverify:\"0.8.3\",jszip:\"3.1.5\",pako:\"1.0.6\",\"parcel-bundler\":\"1.12.4\",preact:\"10.4.1\",prettier:\"2.0.4\",protobufjs:\"6.8.8\",\"source-map\":\"0.6.1\",\"ts-jest\":\"24.3.0\",typescript:\"4.2.3\",\"typescript-json-schema\":\"0.42.0\",\"uglify-es\":\"3.2.2\",\"uint8array-json-parser\":\"0.0.2\"},jest:{transform:{\"^.+\\\\.tsx?$\":\"ts-jest\"},setupFilesAfterEnv:[\"./src/jest-setup.js\"],testRegex:\"\\\\.test\\\\.tsx?$\",collectCoverageFrom:[\"**/*.{ts,tsx}\",\"!**/*.d.{ts,tsx}\"],moduleFileExtensions:[\"ts\",\"tsx\",\"js\",\"jsx\",\"json\"]},dependencies:{open:\"7.2.0\"}};","import {\n Profile,\n CallTreeNode,\n Frame,\n CallTreeProfileBuilder,\n FrameInfo,\n StackListProfileBuilder,\n ProfileGroup,\n} from './profile'\nimport {TimeFormatter, ByteFormatter, RawValueFormatter} from './value-formatters'\nimport {FileFormat} from './file-format-spec'\n\nexport function exportProfileGroup(profileGroup: ProfileGroup): FileFormat.File {\n const frames: FileFormat.Frame[] = []\n\n const indexForFrame = new Map<Frame, number>()\n function getIndexForFrame(frame: Frame): number {\n let index = indexForFrame.get(frame)\n if (index == null) {\n const serializedFrame: FileFormat.Frame = {\n name: frame.name,\n }\n if (frame.file != null) serializedFrame.file = frame.file\n if (frame.line != null) serializedFrame.line = frame.line\n if (frame.col != null) serializedFrame.col = frame.col\n index = frames.length\n indexForFrame.set(frame, index)\n frames.push(serializedFrame)\n }\n return index\n }\n\n const file: FileFormat.File = {\n exporter: `speedscope@${require('../../package.json').version}`,\n name: profileGroup.name,\n activeProfileIndex: profileGroup.indexToView,\n $schema: 'https://www.speedscope.app/file-format-schema.json',\n shared: {frames},\n profiles: [],\n }\n\n for (let profile of profileGroup.profiles) {\n file.profiles.push(exportProfile(profile, getIndexForFrame))\n }\n\n return file\n}\n\nfunction exportProfile(profile: Profile, getIndexForFrame: (frame: Frame) => number) {\n const eventedProfile: FileFormat.EventedProfile = {\n type: FileFormat.ProfileType.EVENTED,\n name: profile.getName(),\n unit: profile.getWeightUnit(),\n startValue: 0,\n endValue: profile.getTotalWeight(),\n events: [],\n }\n const openFrame = (node: CallTreeNode, value: number) => {\n eventedProfile.events.push({\n type: FileFormat.EventType.OPEN_FRAME,\n frame: getIndexForFrame(node.frame),\n at: value,\n })\n }\n const closeFrame = (node: CallTreeNode, value: number) => {\n eventedProfile.events.push({\n type: FileFormat.EventType.CLOSE_FRAME,\n frame: getIndexForFrame(node.frame),\n at: value,\n })\n }\n profile.forEachCall(openFrame, closeFrame)\n return eventedProfile\n}\n\nfunction importSpeedscopeProfile(\n serialized: FileFormat.Profile,\n frames: FileFormat.Frame[],\n): Profile {\n function setCommonProperties(p: Profile) {\n const {name, unit} = serialized\n\n switch (unit) {\n case 'nanoseconds':\n case 'microseconds':\n case 'milliseconds':\n case 'seconds':\n p.setValueFormatter(new TimeFormatter(unit))\n break\n\n case 'bytes':\n p.setValueFormatter(new ByteFormatter())\n break\n\n case 'none':\n p.setValueFormatter(new RawValueFormatter())\n break\n }\n p.setName(name)\n }\n\n function importEventedProfile(evented: FileFormat.EventedProfile) {\n const {startValue, endValue, events} = evented\n\n const profile = new CallTreeProfileBuilder(endValue - startValue)\n setCommonProperties(profile)\n\n const frameInfos: FrameInfo[] = frames.map((frame, i) => ({key: i, ...frame}))\n\n for (let ev of events) {\n switch (ev.type) {\n case FileFormat.EventType.OPEN_FRAME: {\n profile.enterFrame(frameInfos[ev.frame], ev.at - startValue)\n break\n }\n case FileFormat.EventType.CLOSE_FRAME: {\n profile.leaveFrame(frameInfos[ev.frame], ev.at - startValue)\n break\n }\n }\n }\n return profile.build()\n }\n\n function importSampledProfile(sampled: FileFormat.SampledProfile) {\n const {startValue, endValue, samples, weights} = sampled\n const profile = new StackListProfileBuilder(endValue - startValue)\n setCommonProperties(profile)\n\n const frameInfos: FrameInfo[] = frames.map((frame, i) => ({key: i, ...frame}))\n\n if (samples.length !== weights.length) {\n throw new Error(\n `Expected samples.length (${samples.length}) to equal weights.length (${weights.length})`,\n )\n }\n\n for (let i = 0; i < samples.length; i++) {\n const stack = samples[i]\n const weight = weights[i]\n profile.appendSampleWithWeight(\n stack.map(n => frameInfos[n]),\n weight,\n )\n }\n\n return profile.build()\n }\n\n switch (serialized.type) {\n case FileFormat.ProfileType.EVENTED:\n return importEventedProfile(serialized)\n case FileFormat.ProfileType.SAMPLED:\n return importSampledProfile(serialized)\n }\n}\n\nexport function importSpeedscopeProfiles(serialized: FileFormat.File): ProfileGroup {\n return {\n name: serialized.name || serialized.profiles[0].name || 'profile',\n indexToView: serialized.activeProfileIndex || 0,\n profiles: serialized.profiles.map(p => importSpeedscopeProfile(p, serialized.shared.frames)),\n }\n}\n\nexport function saveToFile(profileGroup: ProfileGroup): void {\n const file = exportProfileGroup(profileGroup)\n const blob = new Blob([JSON.stringify(file)], {type: 'text/json'})\n\n const nameWithoutExt = file.name ? file.name.split('.')[0]! : 'profile'\n const filename = `${nameWithoutExt.replace(/\\W+/g, '_')}.speedscope.json`\n\n console.log('Saving', filename)\n\n const a = document.createElement('a')\n a.download = filename\n a.href = window.URL.createObjectURL(blob)\n a.dataset.downloadurl = ['text/json', a.download, a.href].join(':')\n\n // For this to work in Firefox, the <a> must be in the DOM\n document.body.appendChild(a)\n a.click()\n document.body.removeChild(a)\n}\n","/**\n * This file contains an implementation of fuzzy string matching.\n */\n\nexport interface FuzzyMatch {\n // List of [start, end] indices in the haystack string that match the needle string\n matchedRanges: [number, number][]\n\n // The score of the match for relative ranking. Higher scores indicate\n // \"better\" matches.\n score: number\n}\n\nexport function fuzzyMatchStrings(text: string, pattern: string): FuzzyMatch | null {\n return fzfFuzzyMatchV1(text, pattern)\n}\n\n// The implementation here is based on FuzzyMatchV1, as described here:\n// https://github.com/junegunn/fzf/blob/f81feb1e69e5cb75797d50817752ddfe4933cd68/src/algo/algo.go#L8-L15\n//\n// This is a hand-port to better understand what the code is doing and for added\n// clarity.\n//\n// Capitalized letters only match capitalized letters, but lower-case letters\n// match both.\n//\n// Note: fzf includes a normalization table for homoglyphs. I'm going to ignore that too\n// https://github.com/junegunn/fzf/blob/master/src/algo/normalize.go\nconst charCodeLowerA = 'a'.charCodeAt(0)\nconst charCodeLowerZ = 'z'.charCodeAt(0)\nconst charCodeUpperA = 'A'.charCodeAt(0)\nconst charCodeUpperZ = 'Z'.charCodeAt(0)\nconst charCodeDigit0 = '0'.charCodeAt(0)\nconst charCodeDigit9 = '9'.charCodeAt(0)\n\nenum fzfCharClass {\n charNonWord,\n charLower,\n charUpper,\n charNumber,\n}\n\nfunction fzfCharClassOf(char: string): fzfCharClass {\n const code = char.charCodeAt(0)\n if (charCodeLowerA <= code && code <= charCodeLowerZ) {\n return fzfCharClass.charLower\n } else if (charCodeUpperA <= code && code <= charCodeUpperZ) {\n return fzfCharClass.charUpper\n } else if (charCodeDigit0 <= code && code <= charCodeDigit9) {\n return fzfCharClass.charNumber\n }\n return fzfCharClass.charNonWord\n}\n\nfunction charsMatch(textChar: string, patternChar: string): boolean {\n if (textChar === patternChar) return true\n\n const patternCharCode = patternChar.charCodeAt(0)\n if (charCodeLowerA <= patternCharCode && patternCharCode <= charCodeLowerZ) {\n return textChar.charCodeAt(0) === patternCharCode - charCodeLowerA + charCodeUpperA\n }\n return false\n}\n\nfunction fzfFuzzyMatchV1(text: string, pattern: string): FuzzyMatch | null {\n if (pattern.length == 0) {\n return {matchedRanges: [], score: 0}\n }\n\n // I removed the fzfAsciiFuzzyIndex code because it's not actually clear to\n // me that it's a very helpful optimization.\n\n let pidx = 0\n let sidx = -1\n let eidx = -1\n\n let lenRunes = text.length\n let lenPattern = pattern.length\n\n // Forward pass: scan over the text pattern, identifying the earliest start\n // and the latest end to consider.\n for (let index = 0; index < lenRunes; index++) {\n let char = text[index]\n let pchar = pattern[pidx]\n if (charsMatch(char, pchar)) {\n if (sidx < 0) {\n sidx = index\n }\n pidx++\n if (pidx == lenPattern) {\n // We found the last character in the pattern! eidx is exclusive, so\n // we'll set it to the current index + 1.\n eidx = index + 1\n break\n }\n }\n }\n\n if (eidx == -1) {\n // We couldn't find all the characters in the pattern. No match.\n return null\n }\n\n // Assuming we found all the characters in the pattern, perform the backwards\n // pass.\n pidx--\n for (let index = eidx - 1; index >= sidx; index--) {\n const char = text[index]\n const pchar = pattern[pidx]\n if (charsMatch(char, pchar)) {\n pidx--\n if (pidx < 0) {\n // We found the first character of the pattern, scanning\n // backwards. This *may* have narrowed the match further.\n // For example, for the following inputs:\n //\n // text = \"xxx a b c abc xxx\"\n // pattern = \"abc\"\n //\n // For the forward pass, you get:\n //\n // \"xxx a b c abc xxx\"\n // start^ ^end\n //\n // But after the backward pass, we can narrow this to:\n //\n // \"xxx a b c abc xxx\"\n // start^ ^end\n sidx = index\n return fzfCalculateScore(text, pattern, sidx, eidx)\n }\n }\n }\n\n // This should be unreachable.\n throw new Error('Implementation error. This must be a bug in fzfFuzzyMatchV1')\n}\n\nconst fzfScoreMatch = 16\nconst fzfScoreGapStart = -3\nconst fzfScoreGapExtension = -1\nconst fzfBonusBoundary = fzfScoreMatch / 2\nconst fzfBonusNonWord = fzfScoreMatch / 2\nconst fzfBonusCamel123 = fzfBonusBoundary + fzfScoreGapExtension\nconst fzfBonusConsecutive = -(fzfScoreGapStart + fzfScoreGapExtension)\nconst fzfBonusFirstCharMultiplier = 2\n\nfunction bonusFor(prevClass: fzfCharClass, curClass: fzfCharClass): number {\n if (prevClass === fzfCharClass.charNonWord && curClass !== fzfCharClass.charNonWord) {\n // Prefer matching at word boundaries\n //\n // This should prefer \"a c\" over \"abc\" for a pattern of \"ac\".\n return fzfBonusBoundary\n }\n\n if (\n (prevClass === fzfCharClass.charLower && curClass == fzfCharClass.charUpper) ||\n (prevClass !== fzfCharClass.charNumber && curClass == fzfCharClass.charNumber)\n ) {\n // Prefer matching at the transition point between lower & upper for camelCase,\n // and from transition from letter to number for identifiers like letter123.\n //\n // This should prefer \"OutNode\" over \"phone\" for a pattern of \"n\",\n // and \"abc123\" over \"x211\" for a pattern of \"1\".\n return fzfBonusCamel123\n }\n\n if (curClass === fzfCharClass.charNonWord) {\n return fzfBonusNonWord\n }\n return 0\n}\n\nfunction fzfCalculateScore(text: string, pattern: string, sidx: number, eidx: number): FuzzyMatch {\n let pidx = 0\n let score = 0\n let inGap = false\n let consecutive = 0\n let firstBonus = 0\n let pos: number[] = new Array(pattern.length)\n let prevClass = fzfCharClass.charNonWord\n\n if (sidx > 0) {\n prevClass = fzfCharClassOf(text[sidx - 1])\n }\n for (let idx = sidx; idx < eidx; idx++) {\n let char = text[idx]\n let curClass = fzfCharClassOf(char)\n if (charsMatch(char, pattern[pidx])) {\n pos[pidx] = idx\n score += fzfScoreMatch\n let bonus = bonusFor(prevClass, curClass)\n if (consecutive == 0) {\n firstBonus = bonus\n } else {\n // Break consecutive chunk\n if (bonus === fzfBonusBoundary) {\n firstBonus = bonus\n }\n bonus = Math.max(bonus, firstBonus, fzfBonusConsecutive)\n }\n if (pidx === 0) {\n score += bonus * fzfBonusFirstCharMultiplier\n } else {\n score += bonus\n }\n inGap = false\n consecutive++\n pidx++\n } else {\n if (inGap) {\n // Penalize gaps (this bonus is negative)\n score += fzfScoreGapExtension\n } else {\n // Penalize the beginning of gaps more harshly\n score += fzfScoreGapStart\n }\n inGap = true\n consecutive = 0\n firstBonus = 0\n }\n prevClass = curClass\n }\n\n if (pidx !== pattern.length) {\n throw new Error(\n 'fzfCalculateScore should only be called when pattern is found between sidx and eidx',\n )\n }\n\n let matchedRanges: [number, number][] = [[pos[0], pos[0] + 1]]\n for (let i = 1; i < pos.length; i++) {\n const curPos = pos[i]\n const curRange = matchedRanges[matchedRanges.length - 1]\n if (curRange[1] === curPos) {\n curRange[1] = curPos + 1\n } else {\n matchedRanges.push([curPos, curPos + 1])\n }\n }\n\n return {\n score,\n matchedRanges,\n }\n}\n","import {Profile} from '../lib/profile'\nimport {h, JSX, ComponentChild, Ref} from 'preact'\nimport {useCallback, useState, useMemo, useEffect, useRef} from 'preact/hooks'\nimport {StyleSheet, css} from 'aphrodite'\nimport {ZIndex, Sizes} from './style'\nimport {fuzzyMatchStrings} from '../lib/fuzzy-find'\nimport {sortBy} from '../lib/utils'\nimport {useTheme, withTheme} from './themes/theme'\n\ninterface ProfileSelectRowProps {\n setProfileIndexToView: (profileIndex: number) => void\n setHoveredProfileIndex: (profileIndex: number) => void\n profile: Profile\n matchedRanges: [number, number][]\n hovered: boolean\n selected: boolean\n indexInProfileGroup: number\n indexInFilteredListView: number\n profileCount: number\n nodeRef?: Ref<HTMLDivElement>\n closeProfileSelect: () => void\n}\n\nfunction highlightRanges(\n text: string,\n ranges: [number, number][],\n highlightedClassName: string,\n): JSX.Element {\n const spans: ComponentChild[] = []\n let last = 0\n for (let range of ranges) {\n spans.push(text.slice(last, range[0]))\n spans.push(<span className={highlightedClassName}>{text.slice(range[0], range[1])}</span>)\n last = range[1]\n }\n spans.push(text.slice(last))\n\n return <span>{spans}</span>\n}\n\nexport function ProfileSelectRow({\n setProfileIndexToView,\n setHoveredProfileIndex,\n profile,\n selected,\n hovered,\n profileCount,\n nodeRef,\n closeProfileSelect,\n indexInProfileGroup,\n matchedRanges,\n indexInFilteredListView,\n}: ProfileSelectRowProps) {\n const style = getStyle(useTheme())\n\n const onMouseUp = useCallback(() => {\n closeProfileSelect()\n setProfileIndexToView(indexInProfileGroup)\n }, [closeProfileSelect, setProfileIndexToView, indexInProfileGroup])\n\n const onMouseEnter = useCallback(\n (ev: Event) => {\n setHoveredProfileIndex(indexInProfileGroup)\n },\n [setHoveredProfileIndex, indexInProfileGroup],\n )\n\n const name = profile.getName()\n\n const maxDigits = 1 + Math.floor(Math.log10(profileCount))\n\n const highlightedClassName = css(style.highlighted)\n const highlighted = useMemo(() => {\n const result = highlightRanges(name, matchedRanges, highlightedClassName)\n return result\n }, [name, matchedRanges, highlightedClassName])\n\n // TODO(jlfwong): There's a really gnarly edge-case here where the highlighted\n // ranges are part of the text truncated by ellipsis. I'm just going to punt\n // on solving for that.\n return (\n <div\n ref={nodeRef}\n onMouseUp={onMouseUp}\n onMouseEnter={onMouseEnter}\n title={name}\n className={css(\n style.profileRow,\n indexInFilteredListView % 2 === 0 && style.profileRowEven,\n selected && style.profileRowSelected,\n hovered && style.profileRowHovered,\n )}\n >\n <span\n className={css(style.profileIndex, selected && style.profileIndexSelected)}\n style={{width: maxDigits + 'em'}}\n >\n {indexInProfileGroup + 1}:\n </span>{' '}\n {highlighted}\n </div>\n )\n}\n\ninterface ProfileSelectProps {\n setProfileIndexToView: (profileIndex: number) => void\n indexToView: number\n profiles: Profile[]\n closeProfileSelect: () => void\n visible: boolean\n}\n\nfunction stopPropagation(ev: Event) {\n ev.stopPropagation()\n}\n\ninterface FilteredProfile {\n indexInProfileGroup: number\n profile: Profile\n matchedRanges: [number, number][]\n score: number\n}\n\nfunction getSortedFilteredProfiles(profiles: Profile[], filterText: string): FilteredProfile[] {\n const filtered: FilteredProfile[] = []\n for (let i = 0; i < profiles.length; i++) {\n const profile = profiles[i]\n const match = fuzzyMatchStrings(profile.getName(), filterText)\n if (!match) continue\n filtered.push({\n indexInProfileGroup: i,\n profile,\n ...match,\n })\n }\n sortBy(filtered, p => -p.score)\n return filtered\n}\n\nexport function ProfileSelect({\n profiles,\n closeProfileSelect,\n indexToView,\n visible,\n setProfileIndexToView,\n}: ProfileSelectProps) {\n const style = getStyle(useTheme())\n\n const [filterText, setFilterText] = useState('')\n\n const onFilterTextChange = useCallback(\n (ev: Event) => {\n const value = (ev.target as HTMLInputElement).value\n setFilterText(value)\n },\n [setFilterText],\n )\n\n const focusFilterInput = useCallback(\n (node: HTMLInputElement | null) => {\n if (node) {\n if (visible) {\n node.select()\n } else {\n node.blur()\n }\n }\n },\n [visible],\n )\n\n const filteredProfiles = useMemo(() => {\n return getSortedFilteredProfiles(profiles, filterText)\n }, [profiles, filterText])\n\n const [hoveredProfileIndex, setHoveredProfileIndex] = useState<number | null>(0)\n\n const selectedNodeRef = useRef<HTMLDivElement | null>(null)\n useEffect(() => {\n if (visible) {\n // Whenever the profile select becomes visible...\n\n // Clear any hovered element\n setHoveredProfileIndex(null)\n\n // And scroll the selected profile into view, if possible\n if (selectedNodeRef.current !== null) {\n selectedNodeRef.current.scrollIntoView({\n behavior: 'auto',\n block: 'nearest',\n inline: 'nearest',\n })\n }\n }\n }, [visible])\n\n // TODO(jlfwong): Hi-jacking the behavior of enter and the arrow keys won't\n // work well for some composition methods (e.g. a Chinese character\n // composition keyboard input method).\n const onFilterKeyUp = useCallback(\n (ev: KeyboardEvent) => {\n // Prevent the key-press from propagating to other keyboard shortcut\n // handlers in other components.\n ev.stopPropagation()\n\n let newHoveredIndexInFilteredList: number | null = null\n\n switch (ev.key) {\n case 'Enter': {\n if (hoveredProfileIndex != null) {\n closeProfileSelect()\n setProfileIndexToView(hoveredProfileIndex)\n }\n break\n }\n case 'Escape': {\n closeProfileSelect()\n break\n }\n case 'ArrowDown': {\n ev.preventDefault()\n newHoveredIndexInFilteredList = 0\n if (hoveredProfileIndex != null) {\n const indexInFilteredList = filteredProfiles.findIndex(\n p => p.indexInProfileGroup === hoveredProfileIndex,\n )\n if (indexInFilteredList !== -1) {\n newHoveredIndexInFilteredList = indexInFilteredList + 1\n }\n }\n break\n }\n case 'ArrowUp': {\n ev.preventDefault()\n newHoveredIndexInFilteredList = filteredProfiles.length - 1\n if (hoveredProfileIndex != null) {\n const indexInFilteredList = filteredProfiles.findIndex(\n p => p.indexInProfileGroup === hoveredProfileIndex,\n )\n if (indexInFilteredList !== -1) {\n newHoveredIndexInFilteredList = indexInFilteredList - 1\n }\n }\n break\n }\n }\n\n if (\n newHoveredIndexInFilteredList != null &&\n newHoveredIndexInFilteredList >= 0 &&\n newHoveredIndexInFilteredList < filteredProfiles.length\n ) {\n const indexInProfileGroup =\n filteredProfiles[newHoveredIndexInFilteredList].indexInProfileGroup\n setHoveredProfileIndex(indexInProfileGroup)\n setPendingForcedScroll(true)\n }\n },\n [closeProfileSelect, setProfileIndexToView, hoveredProfileIndex, filteredProfiles],\n )\n\n const [pendingForcedScroll, setPendingForcedScroll] = useState(false)\n useEffect(() => {\n // Whenever the list of filtered profiles changes, set the first element hovered.\n if (filteredProfiles.length > 0) {\n setHoveredProfileIndex(filteredProfiles[0].indexInProfileGroup)\n setPendingForcedScroll(true)\n }\n }, [setHoveredProfileIndex, filteredProfiles])\n\n const hoveredNodeRef = useCallback(\n (hoveredNode: HTMLDivElement | null) => {\n if (pendingForcedScroll && hoveredNode) {\n hoveredNode.scrollIntoView({\n behavior: 'auto',\n block: 'nearest',\n inline: 'nearest',\n })\n setPendingForcedScroll(false)\n }\n },\n [pendingForcedScroll, setPendingForcedScroll],\n )\n\n const selectedHoveredRef = useCallback(\n (node: HTMLDivElement | null) => {\n selectedNodeRef.current = node\n hoveredNodeRef(node)\n },\n [selectedNodeRef, hoveredNodeRef],\n )\n\n // We allow ProfileSelect to be aware of its own visibility in order to retain\n // its scroll offset state between times when it's hidden & shown, and also to\n // scroll the selected node into view once it becomes shown again after the\n // selected profile has changed.\n return (\n <div className={css(style.profileSelectOuter)}>\n <div className={css(style.caret)} />\n <div className={css(style.profileSelectBox)}>\n {/* We stop event propagation for key events on the input to prevent\n this from triggering keyboard shortcuts. */}\n <div className={css(style.filterInputContainer)}>\n <input\n type=\"text\"\n className={css(style.filterInput)}\n ref={focusFilterInput}\n placeholder={'Filter...'}\n value={filterText}\n onInput={onFilterTextChange}\n onKeyDown={onFilterKeyUp}\n onKeyUp={stopPropagation}\n onKeyPress={stopPropagation}\n />\n </div>\n <div className={css(style.profileSelectScrolling)}>\n {filteredProfiles.map(({profile, matchedRanges, indexInProfileGroup}, indexInList) => {\n let ref: Ref<HTMLDivElement> | undefined = undefined\n const selected = indexInProfileGroup === indexToView\n const hovered = indexInProfileGroup === hoveredProfileIndex\n if (selected && hovered) {\n ref = selectedHoveredRef\n } else if (selected) {\n ref = selectedNodeRef\n } else if (hovered) {\n ref = hoveredNodeRef\n }\n return (\n <ProfileSelectRow\n setHoveredProfileIndex={setHoveredProfileIndex}\n indexInProfileGroup={indexInProfileGroup}\n indexInFilteredListView={indexInList}\n hovered={indexInProfileGroup == hoveredProfileIndex}\n selected={indexInProfileGroup === indexToView}\n profile={profile}\n profileCount={profiles.length}\n nodeRef={ref}\n matchedRanges={matchedRanges}\n setProfileIndexToView={setProfileIndexToView}\n closeProfileSelect={closeProfileSelect}\n />\n )\n })}\n {filteredProfiles.length === 0 ? (\n <div className={css(style.profileRow)}>No results match filter \"{filterText}\"</div>\n ) : null}\n </div>\n </div>\n </div>\n )\n}\n\nconst paddingHeight = 10\n\nconst getStyle = withTheme(theme =>\n StyleSheet.create({\n filterInputContainer: {\n display: 'flex',\n flexDirection: 'column',\n padding: 5,\n alignItems: 'stretch',\n },\n filterInput: {\n color: theme.altFgPrimaryColor,\n background: theme.altBgSecondaryColor,\n borderRadius: 5,\n padding: 5,\n ':focus': {\n border: 'none',\n outline: 'none',\n },\n '::selection': {\n color: theme.altFgPrimaryColor,\n background: theme.selectionPrimaryColor,\n },\n },\n caret: {\n width: 0,\n height: 0,\n borderLeft: '5px solid transparent',\n borderRight: '5px solid transparent',\n borderBottom: '5px solid black',\n },\n highlighted: {\n background: theme.selectionSecondaryColor,\n },\n padding: {\n height: paddingHeight,\n background: theme.altBgPrimaryColor,\n },\n profileRow: {\n height: Sizes.FRAME_HEIGHT - 2,\n border: '1px solid transparent',\n textAlign: 'left',\n paddingLeft: 10,\n paddingRight: 10,\n background: theme.altBgPrimaryColor,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n cursor: 'pointer',\n },\n profileRowHovered: {\n border: `1px solid ${theme.selectionPrimaryColor}`,\n },\n profileRowSelected: {\n background: theme.selectionPrimaryColor,\n },\n profileRowEven: {\n background: theme.altBgSecondaryColor,\n },\n profileSelectScrolling: {\n maxHeight: `min(calc(100vh - ${Sizes.TOOLBAR_HEIGHT - 2 * paddingHeight}px), ${\n 20 * Sizes.FRAME_HEIGHT\n }px)`,\n overflow: 'auto',\n '::-webkit-scrollbar': {\n background: theme.altBgPrimaryColor,\n },\n '::-webkit-scrollbar-thumb': {\n background: theme.altFgSecondaryColor,\n borderRadius: 20,\n border: `3px solid ${theme.altBgPrimaryColor}`,\n ':hover': {\n background: theme.altBgPrimaryColor,\n },\n },\n },\n profileSelectBox: {\n width: '100%',\n paddingBottom: 10,\n background: theme.altBgPrimaryColor,\n color: theme.altFgPrimaryColor,\n },\n profileSelectOuter: {\n width: '100%',\n maxWidth: 480,\n margin: '0 auto',\n position: 'relative',\n zIndex: ZIndex.PROFILE_SELECT,\n alignItems: 'center',\n display: 'flex',\n flexDirection: 'column',\n },\n profileIndex: {\n textAlign: 'right',\n display: 'inline-block',\n color: theme.altFgSecondaryColor,\n },\n profileIndexSelected: {\n color: theme.altFgPrimaryColor,\n },\n }),\n)\n","import {ApplicationProps} from './application'\nimport {h, JSX, Fragment} from 'preact'\nimport {useCallback, useState, useEffect} from 'preact/hooks'\nimport {StyleSheet, css} from 'aphrodite'\nimport {Sizes, FontFamily, FontSize, Duration} from './style'\nimport {ProfileSelect} from './profile-select'\nimport {Profile} from '../lib/profile'\nimport {objectsHaveShallowEquality} from '../lib/utils'\nimport {colorSchemeToString, useTheme, withTheme} from './themes/theme'\nimport {ViewMode} from '../lib/view-mode'\nimport {viewModeAtom} from '../app-state'\nimport {ProfileGroupState} from '../app-state/profile-group'\nimport {colorSchemeAtom} from '../app-state/color-scheme'\nimport {useAtom} from '../lib/atom'\n\ninterface ToolbarProps extends ApplicationProps {\n browseForFile(): void\n saveFile(): void\n}\n\nfunction useSetViewMode(setViewMode: (viewMode: ViewMode) => void, viewMode: ViewMode) {\n return useCallback(() => setViewMode(viewMode), [setViewMode, viewMode])\n}\n\nfunction ToolbarLeftContent(props: ToolbarProps) {\n const style = getStyle(useTheme())\n const setChronoFlameChart = useSetViewMode(viewModeAtom.set, ViewMode.CHRONO_FLAME_CHART)\n const setLeftHeavyFlameGraph = useSetViewMode(viewModeAtom.set, ViewMode.LEFT_HEAVY_FLAME_GRAPH)\n const setSandwichView = useSetViewMode(viewModeAtom.set, ViewMode.SANDWICH_VIEW)\n\n if (!props.activeProfileState) return null\n\n return (\n <div className={css(style.toolbarLeft)}>\n <div\n className={css(\n style.toolbarTab,\n props.viewMode === ViewMode.CHRONO_FLAME_CHART && style.toolbarTabActive,\n )}\n onClick={setChronoFlameChart}\n >\n <span className={css(style.emoji)}>🕰</span>Time Order\n </div>\n <div\n className={css(\n style.toolbarTab,\n props.viewMode === ViewMode.LEFT_HEAVY_FLAME_GRAPH && style.toolbarTabActive,\n )}\n onClick={setLeftHeavyFlameGraph}\n >\n <span className={css(style.emoji)}>⬅️</span>Left Heavy\n </div>\n <div\n className={css(\n style.toolbarTab,\n props.viewMode === ViewMode.SANDWICH_VIEW && style.toolbarTabActive,\n )}\n onClick={setSandwichView}\n >\n <span className={css(style.emoji)}>🥪</span>Sandwich\n </div>\n </div>\n )\n}\n\nconst getCachedProfileList = (() => {\n // TODO(jlfwong): It would be nice to just implement this as useMemo, but if\n // we do that using profileGroup or profileGroup.profiles as the cache key,\n // then it will invalidate whenever *anything* changes, because\n // profileGroup.profiles is ProfileState[], which contains component state\n // information for each tab for each profile. So whenever any property in any\n // persisted view state changes for *any* view in *any* profile, the profiles\n // list will get re-generated.\n let cachedProfileList: Profile[] | null = null\n\n return (profileGroup: ProfileGroupState): Profile[] | null => {\n let nextProfileList = profileGroup?.profiles.map(p => p.profile) || null\n\n if (\n cachedProfileList === null ||\n (nextProfileList != null && !objectsHaveShallowEquality(cachedProfileList, nextProfileList))\n ) {\n cachedProfileList = nextProfileList\n }\n\n return cachedProfileList\n }\n})()\n\nfunction ToolbarCenterContent(props: ToolbarProps): JSX.Element {\n const style = getStyle(useTheme())\n\n const {activeProfileState, profileGroup} = props\n const profiles = getCachedProfileList(profileGroup)\n const [profileSelectShown, setProfileSelectShown] = useState(false)\n\n const openProfileSelect = useCallback(() => {\n setProfileSelectShown(true)\n }, [setProfileSelectShown])\n\n const closeProfileSelect = useCallback(() => {\n setProfileSelectShown(false)\n }, [setProfileSelectShown])\n\n useEffect(() => {\n const onWindowKeyPress = (ev: KeyboardEvent) => {\n if (ev.key === 't') {\n ev.preventDefault()\n setProfileSelectShown(true)\n }\n }\n window.addEventListener('keypress', onWindowKeyPress)\n return () => {\n window.removeEventListener('keypress', onWindowKeyPress)\n }\n }, [setProfileSelectShown])\n\n useEffect(() => {\n const onWindowKeyPress = (ev: KeyboardEvent) => {\n if (ev.key === 't') {\n ev.preventDefault()\n setProfileSelectShown(true)\n }\n }\n window.addEventListener('keypress', onWindowKeyPress)\n return () => {\n window.removeEventListener('keypress', onWindowKeyPress)\n }\n }, [setProfileSelectShown])\n\n if (activeProfileState && profileGroup && profiles) {\n if (profileGroup.profiles.length === 1) {\n return <Fragment>{activeProfileState.profile.getName()}</Fragment>\n } else {\n return (\n <div className={css(style.toolbarCenter)} onMouseLeave={closeProfileSelect}>\n <span onMouseOver={openProfileSelect}>\n {activeProfileState.profile.getName()}{' '}\n <span className={css(style.toolbarProfileIndex)}>\n ({activeProfileState.index + 1}/{profileGroup.profiles.length})\n </span>\n </span>\n <div style={{display: profileSelectShown ? 'block' : 'none'}}>\n <ProfileSelect\n setProfileIndexToView={props.setProfileIndexToView}\n indexToView={profileGroup.indexToView}\n profiles={profiles}\n closeProfileSelect={closeProfileSelect}\n visible={profileSelectShown}\n />\n </div>\n </div>\n )\n }\n }\n return <Fragment>{'🔬speedscope'}</Fragment>\n}\n\nfunction ToolbarRightContent(props: ToolbarProps) {\n const style = getStyle(useTheme())\n const colorScheme = useAtom(colorSchemeAtom)\n\n const exportFile = (\n <div className={css(style.toolbarTab)} onClick={props.saveFile}>\n <span className={css(style.emoji)}>⤴️</span>Export\n </div>\n )\n const importFile = (\n <div className={css(style.toolbarTab)} onClick={props.browseForFile}>\n <span className={css(style.emoji)}>⤵️</span>Import\n </div>\n )\n\n const colorSchemeToggle = (\n <div className={css(style.toolbarTab)} onClick={colorSchemeAtom.cycleToNextColorScheme}>\n <span className={css(style.emoji)}>🎨</span>\n <span className={css(style.toolbarTabColorSchemeToggle)}>\n {colorSchemeToString(colorScheme)}\n </span>\n </div>\n )\n\n const help = (\n <div className={css(style.toolbarTab)}>\n <a\n href=\"https://github.com/jlfwong/speedscope#usage\"\n className={css(style.noLinkStyle)}\n target=\"_blank\"\n >\n <span className={css(style.emoji)}>❓</span>Help\n </a>\n </div>\n )\n\n return (\n <div className={css(style.toolbarRight)}>\n {props.activeProfileState && exportFile}\n {importFile}\n {colorSchemeToggle}\n {help}\n </div>\n )\n}\n\nexport function Toolbar(props: ToolbarProps) {\n const style = getStyle(useTheme())\n return (\n <div className={css(style.toolbar)}>\n <ToolbarLeftContent {...props} />\n <ToolbarCenterContent {...props} />\n <ToolbarRightContent {...props} />\n </div>\n )\n}\n\nconst getStyle = withTheme(theme =>\n StyleSheet.create({\n toolbar: {\n height: Sizes.TOOLBAR_HEIGHT,\n flexShrink: 0,\n background: theme.altBgPrimaryColor,\n color: theme.altFgPrimaryColor,\n textAlign: 'center',\n fontFamily: FontFamily.MONOSPACE,\n fontSize: FontSize.TITLE,\n lineHeight: `${Sizes.TOOLBAR_TAB_HEIGHT}px`,\n userSelect: 'none',\n },\n toolbarLeft: {\n position: 'absolute',\n height: Sizes.TOOLBAR_HEIGHT,\n overflow: 'hidden',\n top: 0,\n left: 0,\n marginRight: 2,\n textAlign: 'left',\n },\n toolbarCenter: {\n paddingTop: 1,\n height: Sizes.TOOLBAR_HEIGHT,\n },\n toolbarRight: {\n height: Sizes.TOOLBAR_HEIGHT,\n overflow: 'hidden',\n position: 'absolute',\n top: 0,\n right: 0,\n marginRight: 2,\n textAlign: 'right',\n },\n toolbarProfileIndex: {\n color: theme.altFgSecondaryColor,\n },\n toolbarTab: {\n background: theme.altBgSecondaryColor,\n marginTop: Sizes.SEPARATOR_HEIGHT,\n height: Sizes.TOOLBAR_TAB_HEIGHT,\n lineHeight: `${Sizes.TOOLBAR_TAB_HEIGHT}px`,\n paddingLeft: 2,\n paddingRight: 8,\n display: 'inline-block',\n marginLeft: 2,\n transition: `all ${Duration.HOVER_CHANGE} ease-in`,\n ':hover': {\n background: theme.selectionSecondaryColor,\n },\n },\n toolbarTabActive: {\n background: theme.selectionPrimaryColor,\n ':hover': {\n background: theme.selectionPrimaryColor,\n },\n },\n toolbarTabColorSchemeToggle: {\n display: 'inline-block',\n textAlign: 'center',\n minWidth: '50px',\n },\n emoji: {\n display: 'inline-block',\n verticalAlign: 'middle',\n paddingTop: '0px',\n marginRight: '0.3em',\n },\n noLinkStyle: {\n textDecoration: 'none',\n color: 'inherit',\n },\n }),\n)\n","// This file contains code to allow profiles to be remapped by JavaScript source maps.\n//\n// As of writing, this is using an out-of-date version of source-map, because the\n// source-map library migrated to using web-assembly. This requires loading the\n// web-assembly ball. The easiest way to do this is to load it from a third-party\n// URL, but I want speedscope to work standalone offline. This means that the remaining\n// options require some way of having a local URL that corresponds the .wasm file.\n//\n// Also as of writing, speedscope is bundled with Parcel v1. Trying to import\n// a .wasm file in Parcel v1 tries to load the wasm module itself, which is not\n// what I'm trying to do -- I want SourceMapConsumer.initialize to be the thing\n// booting the WebAssembly, not Parcel itself.\n//\n// One way of getting around this problem is to modify the build system to\n// copy the .wasm file from node_modules/source-map/lib/mappings.wasm. I could do\n// this, but it's a bit of a pain.\n//\n// Another would be to use something like\n// import(\"url:../node_modules/source-map/lib/mappings.wasm\"), and then pass the\n// resulting URL to SourceMapConsumer.initialize. This is also kind of a pain,\n// because I can only do that if I upgrade to Parcel v2. Ultimately, I'd like to\n// use esbuild rather than parcel at all, so for now I'm just punting on this by\n// using an old-version of source-map which doesn't depend on wasm.\n\n// This is rarely used, so let's load it async to avoid bloating the initial\n// bundle.\nimport type {MappingItem, RawSourceMap, SourceMapConsumer} from 'source-map'\nconst sourceMapModule = import('source-map')\n\nimport {Frame, SymbolRemapper} from './profile'\nimport {findIndexBisect} from './utils'\n\nconst DEBUG = false\n\nexport async function importJavaScriptSourceMapSymbolRemapper(\n contentsString: string,\n sourceMapFileName: string,\n): Promise<SymbolRemapper | null> {\n const sourceMap = await sourceMapModule\n\n let consumer: SourceMapConsumer | null = null\n let contents: RawSourceMap | null = null\n\n try {\n contents = JSON.parse(contentsString)\n consumer = new sourceMap.SourceMapConsumer(contents!)\n } catch (e) {\n return null\n }\n\n const mappingItems: MappingItem[] = []\n\n consumer.eachMapping(\n function (m: MappingItem) {\n // The sourcemap library uses 1-based line numbers, and 0-based column\n // numbers. speedscope uses 1-based line-numbers, and 1-based column\n // numbers for its in-memory representation, so we'll normalize that\n // here too.\n mappingItems.push({\n ...m,\n generatedColumn: m.generatedColumn + 1,\n originalColumn: m.originalColumn + 1,\n })\n },\n {},\n\n // We're going to binary search through these later, so make sure they're\n // sorted by their order in the generated file.\n sourceMap.SourceMapConsumer.GENERATED_ORDER,\n )\n\n const sourceMapFileNameWithoutExt = sourceMapFileName.replace(/\\.[^/]*$/, '')\n\n return (frame: Frame) => {\n let fileMatches = false\n if (contents?.file && contents?.file === frame.file) {\n fileMatches = true\n } else if (\n ('/' + frame.file?.replace(/\\.[^/]*$/, '')).endsWith('/' + sourceMapFileNameWithoutExt)\n ) {\n fileMatches = true\n }\n if (!fileMatches) {\n // The source-map doesn't apply to the file this frame is defined in.\n return null\n }\n\n if (frame.line == null || frame.col == null) {\n // If we don't have a line & column number for the frame, we can't\n // remap it.\n return null\n }\n\n // If we got here, then we hopefully have an remapping.\n //\n // Ideally, we'd look up a symbol whose generatedLine & generatedColumn\n // match what we have in our profile, but unfortunately browsers don't do\n // this.\n //\n // Browsers set the column number for a function to the index of the\n // opening paren for the argument list, rather than the beginning of the\n // index of the name.\n //\n // function alpha() { ... }\n // ^\n //\n // const beta = function() { ... }\n // ^\n //\n // const gamma = () => { ... }\n // ^\n //\n // Since we don't have the source code being profiled, we unfortunately\n // can't normalize this to set the column to the first character of the\n // actual name.\n //\n // To work around this limitation, we'll search backwards from the first\n // mapping whose generatedLine & generatedColumn are beyond the location\n // in the profile.\n let mappingIndex = findIndexBisect(mappingItems, m => {\n if (m.generatedLine > frame.line!) return true\n if (m.generatedLine < frame.line!) return false\n if (m.generatedColumn >= frame.col!) return true\n return false\n })\n\n if (mappingIndex === -1) {\n // There are no symbols following the given profile frame symbol, so try\n // to apply the very last mapping.\n mappingIndex = mappingItems.length - 1\n } else if (mappingIndex === 0) {\n // If the very first index in mappingItems is beyond the location in the\n // profile, it means the name we're looking for doesn't have a\n // corresponding entry in the source-map (this can happen if the\n // source-map isn't the right source-map)\n return null\n } else {\n mappingIndex--\n }\n\n const sourceMapItem = mappingItems[mappingIndex]\n const remappedFrameInfo: {name?: string; file?: string; line?: number; col?: number} = {}\n\n if (sourceMapItem.name != null) {\n remappedFrameInfo.name = sourceMapItem.name\n } else if (sourceMapItem.source != null) {\n // HACK: If the item name isn't specified, but the source is present, then\n // we're going to try to guess what the name is by using the originalLine\n // and originalColumn.\n\n // The second argument here is \"returnNullOnMissing\". Without this, it\n // throws instead of returning null.\n const content = consumer?.sourceContentFor(sourceMapItem.source, true)\n if (content) {\n const lines = content.split('\\n')\n const line = lines[sourceMapItem.originalLine - 1]\n if (line) {\n // It's possible this source map entry will contain stuff other than\n // the name, so let's only consider word-ish characters that are part\n // of the prefix.\n const identifierMatch = /\\w+/.exec(line.substr(sourceMapItem.originalColumn - 1))\n if (identifierMatch) {\n remappedFrameInfo.name = identifierMatch[0]\n }\n }\n }\n }\n\n switch (remappedFrameInfo.name) {\n case 'constructor': {\n // If the name was remapped to \"constructor\", then let's use the\n // original name, since \"constructor\" isn't very helpful.\n //\n // TODO(jlfwong): Search backwards for the class keyword and see if we\n // can guess the right name.\n remappedFrameInfo.name = frame.name + ' constructor'\n break\n }\n\n case 'function': {\n // If the name is just \"function\", it probably means we either messed up\n // the remapping, or that we matched an anonymous function. In either\n // case, this isn't helpful, so put this back.\n remappedFrameInfo.name = frame.name\n break\n }\n\n case 'const':\n case 'export': {\n // If we got this, we probably just did a bad job leveraging the hack\n // looking through the source code. Let's fall-back to whatever the\n // original name was.\n remappedFrameInfo.name = frame.name\n break\n }\n }\n\n if (remappedFrameInfo.name && frame.name.includes(remappedFrameInfo.name)) {\n // If the remapped name is a substring of the original name, the original\n // name probably contains more useful information. In that case, just use\n // the original name instead.\n //\n // This can happen, for example, when remapping method names. If a\n // call stack says the symbol name is \"n.zap\" and we remapped it to a\n // function just called \"zap\", we might as well use the original name\n // instead.\n remappedFrameInfo.name = frame.name\n }\n\n if (sourceMapItem.source != null) {\n remappedFrameInfo.file = sourceMapItem.source\n remappedFrameInfo.line = sourceMapItem.originalLine\n remappedFrameInfo.col = sourceMapItem.originalColumn\n }\n\n if (DEBUG) {\n console.groupCollapsed(`Remapping \"${frame.name}\" -> \"${remappedFrameInfo.name}\"`)\n console.log('before', {...frame})\n console.log('item @ index', sourceMapItem)\n console.log('item @ index + 1', mappingItems[mappingIndex + 1])\n console.log('after', remappedFrameInfo)\n console.groupEnd()\n }\n\n return remappedFrameInfo\n }\n}\n","import {h} from 'preact'\nimport {StyleSheet, css} from 'aphrodite'\nimport {FileSystemDirectoryEntry} from '../import/file-system-entry'\n\nimport {ProfileGroup, SymbolRemapper} from '../lib/profile'\nimport {FontFamily, FontSize, Duration} from './style'\nimport {importEmscriptenSymbolMap as importEmscriptenSymbolRemapper} from '../lib/emscripten'\nimport {SandwichViewContainer} from './sandwich-view'\nimport {saveToFile} from '../lib/file-format'\nimport {ActiveProfileState} from '../app-state/active-profile-state'\nimport {LeftHeavyFlamechartView, ChronoFlamechartView} from './flamechart-view-container'\nimport {CanvasContext} from '../gl/canvas-context'\nimport {Toolbar} from './toolbar'\nimport {importJavaScriptSourceMapSymbolRemapper} from '../lib/js-source-map'\nimport {Theme, withTheme} from './themes/theme'\nimport {ViewMode} from '../lib/view-mode'\nimport {canUseXHR} from '../app-state'\nimport {ProfileGroupState} from '../app-state/profile-group'\nimport {HashParams} from '../lib/hash-params'\nimport {StatelessComponent} from '../lib/preact-helpers'\n\nconst importModule = import('../import')\n\n// Force eager loading of a few code-split modules.\n//\n// We put them all in one place so we can directly control the relative priority\n// of these.\nimportModule.then(() => {})\nimport('../lib/demangle-cpp').then(() => {})\nimport('source-map').then(() => {})\n\nasync function importProfilesFromText(\n fileName: string,\n contents: string,\n): Promise<ProfileGroup | null> {\n return (await importModule).importProfileGroupFromText(fileName, contents)\n}\n\nasync function importProfilesFromBase64(\n fileName: string,\n contents: string,\n): Promise<ProfileGroup | null> {\n return (await importModule).importProfileGroupFromBase64(fileName, contents)\n}\n\nasync function importProfilesFromArrayBuffer(\n fileName: string,\n contents: ArrayBuffer,\n): Promise<ProfileGroup | null> {\n return (await importModule).importProfilesFromArrayBuffer(fileName, contents)\n}\n\nasync function importProfilesFromFile(file: File): Promise<ProfileGroup | null> {\n return (await importModule).importProfilesFromFile(file)\n}\nasync function importFromFileSystemDirectoryEntry(entry: FileSystemDirectoryEntry) {\n return (await importModule).importFromFileSystemDirectoryEntry(entry)\n}\n\ndeclare function require(x: string): any\nconst exampleProfileURL = require('../../sample/profiles/stackcollapse/perf-vertx-stacks-01-collapsed-all.txt')\n\ninterface GLCanvasProps {\n canvasContext: CanvasContext | null\n theme: Theme\n setGLCanvas: (canvas: HTMLCanvasElement | null) => void\n}\nexport class GLCanvas extends StatelessComponent<GLCanvasProps> {\n private canvas: HTMLCanvasElement | null = null\n\n private ref = (canvas: Element | null) => {\n if (canvas instanceof HTMLCanvasElement) {\n this.canvas = canvas\n } else {\n this.canvas = null\n }\n\n this.props.setGLCanvas(this.canvas)\n }\n\n private container: HTMLElement | null = null\n private containerRef = (container: Element | null) => {\n if (container instanceof HTMLElement) {\n this.container = container\n } else {\n this.container = null\n }\n }\n\n private maybeResize = () => {\n if (!this.container) return\n if (!this.props.canvasContext) return\n\n let {width, height} = this.container.getBoundingClientRect()\n\n const widthInAppUnits = width\n const heightInAppUnits = height\n const widthInPixels = width * window.devicePixelRatio\n const heightInPixels = height * window.devicePixelRatio\n\n this.props.canvasContext.gl.resize(\n widthInPixels,\n heightInPixels,\n widthInAppUnits,\n heightInAppUnits,\n )\n }\n\n onWindowResize = () => {\n if (this.props.canvasContext) {\n this.props.canvasContext.requestFrame()\n }\n }\n componentWillReceiveProps(nextProps: GLCanvasProps) {\n if (this.props.canvasContext !== nextProps.canvasContext) {\n if (this.props.canvasContext) {\n this.props.canvasContext.removeBeforeFrameHandler(this.maybeResize)\n }\n if (nextProps.canvasContext) {\n nextProps.canvasContext.addBeforeFrameHandler(this.maybeResize)\n nextProps.canvasContext.requestFrame()\n }\n }\n }\n componentDidMount() {\n window.addEventListener('resize', this.onWindowResize)\n }\n componentWillUnmount() {\n if (this.props.canvasContext) {\n this.props.canvasContext.removeBeforeFrameHandler(this.maybeResize)\n }\n window.removeEventListener('resize', this.onWindowResize)\n }\n render() {\n const style = getStyle(this.props.theme)\n return (\n <div ref={this.containerRef} className={css(style.glCanvasView)}>\n <canvas ref={this.ref} width={1} height={1} />\n </div>\n )\n }\n}\n\nexport type ApplicationProps = {\n setGLCanvas: (canvas: HTMLCanvasElement | null) => void\n setLoading: (loading: boolean) => void\n setError: (error: boolean) => void\n setProfileGroup: (profileGroup: ProfileGroup) => void\n setDragActive: (dragActive: boolean) => void\n setViewMode: (viewMode: ViewMode) => void\n setFlattenRecursion: (flattenRecursion: boolean) => void\n setProfileIndexToView: (profileIndex: number) => void\n activeProfileState: ActiveProfileState | null\n canvasContext: CanvasContext | null\n theme: Theme\n profileGroup: ProfileGroupState\n flattenRecursion: boolean\n viewMode: ViewMode\n hashParams: HashParams\n dragActive: boolean\n loading: boolean\n glCanvas: HTMLCanvasElement | null\n error: boolean\n}\n\nexport class Application extends StatelessComponent<ApplicationProps> {\n private async loadProfile(loader: () => Promise<ProfileGroup | null>) {\n this.props.setLoading(true)\n await new Promise(resolve => setTimeout(resolve, 0))\n\n if (!this.props.glCanvas) return\n\n console.time('import')\n\n let profileGroup: ProfileGroup | null = null\n try {\n profileGroup = await loader()\n } catch (e) {\n console.log('Failed to load format', e)\n this.props.setError(true)\n return\n }\n\n // TODO(jlfwong): Make these into nicer overlays\n if (profileGroup == null) {\n alert('Unrecognized format! See documentation about supported formats.')\n this.props.setLoading(false)\n return\n } else if (profileGroup.profiles.length === 0) {\n alert(\"Successfully imported profile, but it's empty!\")\n this.props.setLoading(false)\n return\n }\n\n if (this.props.hashParams.title) {\n profileGroup = {\n ...profileGroup,\n name: this.props.hashParams.title,\n }\n }\n document.title = `${profileGroup.name} - speedscope`\n\n if (this.props.hashParams.viewMode) {\n this.props.setViewMode(this.props.hashParams.viewMode)\n }\n\n for (let profile of profileGroup.profiles) {\n await profile.demangle()\n }\n\n for (let profile of profileGroup.profiles) {\n const title = this.props.hashParams.title || profile.getName()\n profile.setName(title)\n }\n\n console.timeEnd('import')\n\n this.props.setProfileGroup(profileGroup)\n this.props.setLoading(false)\n }\n\n getStyle(): ReturnType<typeof getStyle> {\n return getStyle(this.props.theme)\n }\n\n loadFromFile(file: File) {\n this.loadProfile(async () => {\n const profiles = await importProfilesFromFile(file)\n if (profiles) {\n for (let profile of profiles.profiles) {\n if (!profile.getName()) {\n profile.setName(file.name)\n }\n }\n return profiles\n }\n\n if (this.props.profileGroup && this.props.activeProfileState) {\n // If a profile is already loaded, it's possible the file being imported is\n // a symbol map. If that's the case, we want to parse it, and apply the symbol\n // mapping to the already loaded profile. This can be use to take an opaque\n // profile and make it readable.\n const reader = new FileReader()\n const fileContentsPromise = new Promise<string>(resolve => {\n reader.addEventListener('loadend', () => {\n if (typeof reader.result !== 'string') {\n throw new Error('Expected reader.result to be a string')\n }\n resolve(reader.result)\n })\n })\n reader.readAsText(file)\n const fileContents = await fileContentsPromise\n\n let symbolRemapper: SymbolRemapper | null = null\n\n const emscriptenSymbolRemapper = importEmscriptenSymbolRemapper(fileContents)\n if (emscriptenSymbolRemapper) {\n console.log('Importing as emscripten symbol map')\n symbolRemapper = emscriptenSymbolRemapper\n }\n\n const jsSourceMapRemapper = await importJavaScriptSourceMapSymbolRemapper(\n fileContents,\n file.name,\n )\n if (!symbolRemapper && jsSourceMapRemapper) {\n console.log('Importing as JavaScript source map')\n symbolRemapper = jsSourceMapRemapper\n }\n\n if (symbolRemapper != null) {\n return {\n name: this.props.profileGroup.name || 'profile',\n indexToView: this.props.profileGroup.indexToView,\n profiles: this.props.profileGroup.profiles.map(profileState => {\n // We do a shallow clone here to invalidate certain caches keyed\n // on a reference to the profile group under the assumption that\n // profiles are immutable. Symbol remapping is (at time of\n // writing) the only exception to that immutability.\n const p = profileState.profile.shallowClone()\n p.remapSymbols(symbolRemapper!)\n return p\n }),\n }\n }\n }\n\n return null\n })\n }\n\n loadExample = () => {\n this.loadProfile(async () => {\n const filename = 'perf-vertx-stacks-01-collapsed-all.txt'\n const data = await fetch(exampleProfileURL).then(resp => resp.text())\n return await importProfilesFromText(filename, data)\n })\n }\n\n onDrop = (ev: DragEvent) => {\n this.props.setDragActive(false)\n ev.preventDefault()\n\n if (!ev.dataTransfer) return\n\n const firstItem = ev.dataTransfer.items[0]\n if ('webkitGetAsEntry' in firstItem) {\n const webkitEntry: FileSystemDirectoryEntry = firstItem.webkitGetAsEntry()\n\n // Instrument.app file format is actually a directory.\n if (webkitEntry.isDirectory && webkitEntry.name.endsWith('.trace')) {\n console.log('Importing as Instruments.app .trace file')\n this.loadProfile(async () => {\n return await importFromFileSystemDirectoryEntry(webkitEntry)\n })\n return\n }\n }\n\n let file: File | null = ev.dataTransfer.files.item(0)\n if (file) {\n this.loadFromFile(file)\n }\n }\n\n onDragOver = (ev: DragEvent) => {\n this.props.setDragActive(true)\n ev.preventDefault()\n }\n\n onDragLeave = (ev: DragEvent) => {\n this.props.setDragActive(false)\n ev.preventDefault()\n }\n\n onWindowKeyPress = async (ev: KeyboardEvent) => {\n if (ev.key === '1') {\n this.props.setViewMode(ViewMode.CHRONO_FLAME_CHART)\n } else if (ev.key === '2') {\n this.props.setViewMode(ViewMode.LEFT_HEAVY_FLAME_GRAPH)\n } else if (ev.key === '3') {\n this.props.setViewMode(ViewMode.SANDWICH_VIEW)\n } else if (ev.key === 'r') {\n const {flattenRecursion} = this.props\n this.props.setFlattenRecursion(!flattenRecursion)\n } else if (ev.key === 'n') {\n const {activeProfileState} = this.props\n if (activeProfileState) {\n this.props.setProfileIndexToView(activeProfileState.index + 1)\n }\n } else if (ev.key === 'p') {\n const {activeProfileState} = this.props\n if (activeProfileState) {\n this.props.setProfileIndexToView(activeProfileState.index - 1)\n }\n }\n }\n\n private saveFile = () => {\n if (this.props.profileGroup) {\n const {name, indexToView, profiles} = this.props.profileGroup\n const profileGroup: ProfileGroup = {\n name,\n indexToView,\n profiles: profiles.map(p => p.profile),\n }\n saveToFile(profileGroup)\n }\n }\n\n private browseForFile = () => {\n const input = document.createElement('input')\n input.type = 'file'\n input.addEventListener('change', this.onFileSelect)\n input.click()\n }\n\n private onWindowKeyDown = async (ev: KeyboardEvent) => {\n // This has to be handled on key down in order to prevent the default\n // page save action.\n if (ev.key === 's' && (ev.ctrlKey || ev.metaKey)) {\n ev.preventDefault()\n this.saveFile()\n } else if (ev.key === 'o' && (ev.ctrlKey || ev.metaKey)) {\n ev.preventDefault()\n this.browseForFile()\n }\n }\n\n onDocumentPaste = (ev: Event) => {\n if (document.activeElement != null && document.activeElement.nodeName === 'INPUT') return\n\n ev.preventDefault()\n ev.stopPropagation()\n\n const clipboardData = (ev as ClipboardEvent).clipboardData\n if (!clipboardData) return\n const pasted = clipboardData.getData('text')\n this.loadProfile(async () => {\n return await importProfilesFromText('From Clipboard', pasted)\n })\n }\n\n componentDidMount() {\n window.addEventListener('keydown', this.onWindowKeyDown)\n window.addEventListener('keypress', this.onWindowKeyPress)\n document.addEventListener('paste', this.onDocumentPaste)\n this.maybeLoadHashParamProfile()\n }\n\n componentWillUnmount() {\n window.removeEventListener('keydown', this.onWindowKeyDown)\n window.removeEventListener('keypress', this.onWindowKeyPress)\n document.removeEventListener('paste', this.onDocumentPaste)\n }\n\n async maybeLoadHashParamProfile() {\n const {profileURL} = this.props.hashParams;\n if (profileURL) {\n if (!canUseXHR) {\n alert(\n `Cannot load a profile URL when loading from \"${window.location.protocol}\" URL protocol`,\n )\n return\n }\n this.loadProfile(async () => {\n const response: Response = await fetch(profileURL)\n let filename = new URL(profileURL, window.location.href).pathname\n if (filename.includes('/')) {\n filename = filename.slice(filename.lastIndexOf('/') + 1)\n }\n return await importProfilesFromArrayBuffer(filename, await response.arrayBuffer())\n })\n } else if (this.props.hashParams.localProfilePath) {\n // There isn't good cross-browser support for XHR of local files, even from\n // other local files. To work around this restriction, we load the local profile\n // as a JavaScript file which will invoke a global function.\n ;(window as any)['speedscope'] = {\n loadFileFromBase64: (filename: string, base64source: string) => {\n this.loadProfile(() => importProfilesFromBase64(filename, base64source))\n },\n }\n\n const script = document.createElement('script')\n script.src = `file:///${this.props.hashParams.localProfilePath}`\n document.head.appendChild(script)\n }\n }\n\n onFileSelect = (ev: Event) => {\n const file = (ev.target as HTMLInputElement).files!.item(0)\n if (file) {\n this.loadFromFile(file)\n }\n }\n\n renderLanding() {\n const style = this.getStyle()\n\n return (\n <div className={css(style.landingContainer)}>\n <div className={css(style.landingMessage)}>\n <p className={css(style.landingP)}>\n 👋 Hi there! Welcome to 🔬speedscope, an interactive{' '}\n <a\n className={css(style.link)}\n href=\"http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html\"\n >\n flamegraph\n </a>{' '}\n visualizer. Use it to help you make your software faster.\n </p>\n {canUseXHR ? (\n <p className={css(style.landingP)}>\n Drag and drop a profile file onto this window to get started, click the big blue\n button below to browse for a profile to explore, or{' '}\n <a tabIndex={0} className={css(style.link)} onClick={this.loadExample}>\n click here\n </a>{' '}\n to load an example profile.\n </p>\n ) : (\n <p className={css(style.landingP)}>\n Drag and drop a profile file onto this window to get started, or click the big blue\n button below to browse for a profile to explore.\n </p>\n )}\n <div className={css(style.browseButtonContainer)}>\n <input\n type=\"file\"\n name=\"file\"\n id=\"file\"\n onChange={this.onFileSelect}\n className={css(style.hide)}\n />\n <label for=\"file\" className={css(style.browseButton)} tabIndex={0}>\n Browse\n </label>\n </div>\n\n <p className={css(style.landingP)}>\n See the{' '}\n <a\n className={css(style.link)}\n href=\"https://github.com/jlfwong/speedscope#usage\"\n target=\"_blank\"\n >\n documentation\n </a>{' '}\n for information about supported file formats, keyboard shortcuts, and how to navigate\n around the profile.\n </p>\n\n <p className={css(style.landingP)}>\n speedscope is open source. Please{' '}\n <a\n className={css(style.link)}\n target=\"_blank\"\n href=\"https://github.com/jlfwong/speedscope/issues\"\n >\n report any issues on GitHub\n </a>\n .\n </p>\n </div>\n </div>\n )\n }\n\n renderError() {\n const style = this.getStyle()\n\n return (\n <div className={css(style.error)}>\n <div>😿 Something went wrong.</div>\n <div>Check the JS console for more details.</div>\n </div>\n )\n }\n\n renderLoadingBar() {\n const style = this.getStyle()\n return <div className={css(style.loading)} />\n }\n\n renderContent() {\n const {viewMode, activeProfileState, error, loading, glCanvas} = this.props\n\n if (error) {\n return this.renderError()\n }\n\n if (loading) {\n return this.renderLoadingBar()\n }\n\n if (!activeProfileState || !glCanvas) {\n return this.renderLanding()\n }\n\n switch (viewMode) {\n case ViewMode.CHRONO_FLAME_CHART: {\n return <ChronoFlamechartView activeProfileState={activeProfileState} glCanvas={glCanvas} />\n }\n case ViewMode.LEFT_HEAVY_FLAME_GRAPH: {\n return (\n <LeftHeavyFlamechartView activeProfileState={activeProfileState} glCanvas={glCanvas} />\n )\n }\n case ViewMode.SANDWICH_VIEW: {\n return <SandwichViewContainer activeProfileState={activeProfileState} glCanvas={glCanvas} />\n }\n }\n }\n\n render() {\n const style = this.getStyle()\n return (\n <div\n onDrop={this.onDrop}\n onDragOver={this.onDragOver}\n onDragLeave={this.onDragLeave}\n className={css(style.root, this.props.dragActive && style.dragTargetRoot)}\n >\n <GLCanvas\n setGLCanvas={this.props.setGLCanvas}\n canvasContext={this.props.canvasContext}\n theme={this.props.theme}\n />\n <Toolbar\n saveFile={this.saveFile}\n browseForFile={this.browseForFile}\n {...(this.props as ApplicationProps)}\n />\n <div className={css(style.contentContainer)}>{this.renderContent()}</div>\n {this.props.dragActive && <div className={css(style.dragTarget)} />}\n </div>\n )\n }\n}\n\nconst getStyle = withTheme(theme =>\n StyleSheet.create({\n glCanvasView: {\n position: 'absolute',\n width: '100vw',\n height: '100vh',\n zIndex: -1,\n pointerEvents: 'none',\n },\n error: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n height: '100%',\n },\n loading: {\n height: 3,\n marginBottom: -3,\n background: theme.selectionPrimaryColor,\n transformOrigin: '0% 50%',\n animationName: [\n {\n from: {\n transform: `scaleX(0)`,\n },\n to: {\n transform: `scaleX(1)`,\n },\n },\n ],\n animationTimingFunction: 'cubic-bezier(0, 1, 0, 1)',\n animationDuration: '30s',\n },\n root: {\n width: '100vw',\n height: '100vh',\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n position: 'relative',\n fontFamily: FontFamily.MONOSPACE,\n lineHeight: '20px',\n color: theme.fgPrimaryColor,\n },\n dragTargetRoot: {\n cursor: 'copy',\n },\n dragTarget: {\n boxSizing: 'border-box',\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n border: `5px dashed ${theme.selectionPrimaryColor}`,\n pointerEvents: 'none',\n },\n contentContainer: {\n position: 'relative',\n display: 'flex',\n overflow: 'hidden',\n flexDirection: 'column',\n flex: 1,\n },\n landingContainer: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flex: 1,\n },\n landingMessage: {\n maxWidth: 600,\n },\n landingP: {\n marginBottom: 16,\n },\n hide: {\n display: 'none',\n },\n browseButtonContainer: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n },\n browseButton: {\n marginBottom: 16,\n height: 72,\n flex: 1,\n maxWidth: 256,\n textAlign: 'center',\n fontSize: FontSize.BIG_BUTTON,\n lineHeight: '72px',\n background: theme.selectionPrimaryColor,\n color: theme.altFgPrimaryColor,\n transition: `all ${Duration.HOVER_CHANGE} ease-in`,\n ':hover': {\n background: theme.selectionSecondaryColor,\n },\n },\n link: {\n color: theme.selectionPrimaryColor,\n cursor: 'pointer',\n textDecoration: 'none',\n transition: `all ${Duration.HOVER_CHANGE} ease-in`,\n ':hover': {\n color: theme.selectionSecondaryColor,\n },\n },\n }),\n)\n","import {h} from 'preact'\nimport {getCanvasContext} from '../app-state/getters'\nimport {memo, useMemo} from 'preact/compat'\nimport {useActiveProfileState} from '../app-state/active-profile-state'\nimport {useTheme} from './themes/theme'\nimport {\n dragActiveAtom,\n errorAtom,\n flattenRecursionAtom,\n glCanvasAtom,\n hashParamsAtom,\n loadingAtom,\n profileGroupAtom,\n viewModeAtom,\n} from '../app-state'\nimport {useAtom} from '../lib/atom'\nimport {ProfileSearchContextProvider} from './search-view'\nimport {Application} from './application'\n\nexport const ApplicationContainer = memo(() => {\n const canvas = useAtom(glCanvasAtom)\n const theme = useTheme()\n const canvasContext = useMemo(() => (canvas ? getCanvasContext({theme, canvas}) : null), [\n theme,\n canvas,\n ])\n\n return (\n <ProfileSearchContextProvider>\n <Application\n activeProfileState={useActiveProfileState()}\n canvasContext={canvasContext}\n setGLCanvas={glCanvasAtom.set}\n setLoading={loadingAtom.set}\n setError={errorAtom.set}\n setProfileGroup={profileGroupAtom.setProfileGroup}\n setDragActive={dragActiveAtom.set}\n setViewMode={viewModeAtom.set}\n setFlattenRecursion={flattenRecursionAtom.set}\n setProfileIndexToView={profileGroupAtom.setProfileIndexToView}\n profileGroup={useAtom(profileGroupAtom)}\n theme={theme}\n flattenRecursion={useAtom(flattenRecursionAtom)}\n viewMode={useAtom(viewModeAtom)}\n hashParams={useAtom(hashParamsAtom)}\n glCanvas={canvas}\n dragActive={useAtom(dragActiveAtom)}\n loading={useAtom(loadingAtom)}\n error={useAtom(errorAtom)}\n />\n </ProfileSearchContextProvider>\n )\n})\n","import {h, render} from 'preact'\nimport {ApplicationContainer} from './views/application-container'\nimport {ThemeProvider} from './views/themes/theme'\n\nconsole.log(`speedscope v${require('../package.json').version}`)\n\ndeclare const module: any\nif (module.hot) {\n module.hot.dispose(() => {\n // Force the old component go through teardown steps\n render(<div />, document.body, document.body.lastElementChild || undefined)\n })\n module.hot.accept()\n}\n\nrender(\n <ThemeProvider>\n <ApplicationContainer />\n </ThemeProvider>,\n document.body,\n document.body.lastElementChild || undefined,\n)\n","module.exports = function loadJSBundle(bundle) {\n return new Promise(function (resolve, reject) {\n var script = document.createElement('script');\n script.async = true;\n script.type = 'text/javascript';\n script.charset = 'utf-8';\n script.src = bundle;\n script.onerror = function (e) {\n script.onerror = script.onload = null;\n reject(e);\n };\n\n script.onload = function () {\n script.onerror = script.onload = null;\n resolve();\n };\n\n document.getElementsByTagName('head')[0].appendChild(script);\n });\n};\n"]} |