UNPKG

@tomplum/react-git-log

Version:

A flexible, themable, React component for visualising Git commit history, branch and tag metadata.

1,291 lines 154 kB
import './index.css';var br = Object.defineProperty; var yr = (t, r, e) => r in t ? br(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e; var X = (t, r, e) => yr(t, typeof r != "symbol" ? r + "" : r, e); import * as q from "react"; import me, { createContext as Je, useContext as Ze, useMemo as A, useCallback as K, useState as xe, useRef as ht, useEffect as ze, cloneElement as Cr, Children as _r, isValidElement as $r } from "react"; import Tr from "react-dom"; function _e(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } var Be = { exports: {} }, Me = {}; /** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var $t; function Nr() { if ($t) return Me; $t = 1; var t = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment"); function e(i, l, s) { var h = null; if (s !== void 0 && (h = "" + s), l.key !== void 0 && (h = "" + l.key), "key" in l) { s = {}; for (var c in l) c !== "key" && (s[c] = l[c]); } else s = l; return l = s.ref, { $$typeof: t, type: i, key: h, ref: l !== void 0 ? l : null, props: s }; } return Me.Fragment = r, Me.jsx = e, Me.jsxs = e, Me; } var ke = {}; /** * @license React * react-jsx-runtime.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Tt; function Rr() { return Tt || (Tt = 1, process.env.NODE_ENV !== "production" && function() { function t(p) { if (p == null) return null; if (typeof p == "function") return p.$$typeof === E ? null : p.displayName || p.name || null; if (typeof p == "string") return p; switch (p) { case m: return "Fragment"; case w: return "Profiler"; case y: return "StrictMode"; case $: return "Suspense"; case R: return "SuspenseList"; case D: return "Activity"; } if (typeof p == "object") switch (typeof p.tag == "number" && console.error( "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue." ), p.$$typeof) { case v: return "Portal"; case O: return (p.displayName || "Context") + ".Provider"; case S: return (p._context.displayName || "Context") + ".Consumer"; case k: var L = p.render; return p = p.displayName, p || (p = L.displayName || L.name || "", p = p !== "" ? "ForwardRef(" + p + ")" : "ForwardRef"), p; case j: return L = p.displayName || null, L !== null ? L : t(p.type) || "Memo"; case b: L = p._payload, p = p._init; try { return t(p(L)); } catch { } } return null; } function r(p) { return "" + p; } function e(p) { try { r(p); var L = !1; } catch { L = !0; } if (L) { L = console; var N = L.error, I = typeof Symbol == "function" && Symbol.toStringTag && p[Symbol.toStringTag] || p.constructor.name || "Object"; return N.call( L, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", I ), r(p); } } function i(p) { if (p === m) return "<>"; if (typeof p == "object" && p !== null && p.$$typeof === b) return "<...>"; try { var L = t(p); return L ? "<" + L + ">" : "<...>"; } catch { return "<...>"; } } function l() { var p = T.A; return p === null ? null : p.getOwner(); } function s() { return Error("react-stack-top-frame"); } function h(p) { if (G.call(p, "key")) { var L = Object.getOwnPropertyDescriptor(p, "key").get; if (L && L.isReactWarning) return !1; } return p.key !== void 0; } function c(p, L) { function N() { C || (C = !0, console.error( "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", L )); } N.isReactWarning = !0, Object.defineProperty(p, "key", { get: N, configurable: !0 }); } function u() { var p = t(this.type); return x[p] || (x[p] = !0, console.error( "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release." )), p = this.props.ref, p !== void 0 ? p : null; } function a(p, L, N, I, V, z, U, ee) { return N = z.ref, p = { $$typeof: d, type: p, key: L, props: z, _owner: V }, (N !== void 0 ? N : null) !== null ? Object.defineProperty(p, "ref", { enumerable: !1, get: u }) : Object.defineProperty(p, "ref", { enumerable: !1, value: null }), p._store = {}, Object.defineProperty(p._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: 0 }), Object.defineProperty(p, "_debugInfo", { configurable: !1, enumerable: !1, writable: !0, value: null }), Object.defineProperty(p, "_debugStack", { configurable: !1, enumerable: !1, writable: !0, value: U }), Object.defineProperty(p, "_debugTask", { configurable: !1, enumerable: !1, writable: !0, value: ee }), Object.freeze && (Object.freeze(p.props), Object.freeze(p)), p; } function n(p, L, N, I, V, z, U, ee) { var Y = L.children; if (Y !== void 0) if (I) if (B(Y)) { for (I = 0; I < Y.length; I++) o(Y[I]); Object.freeze && Object.freeze(Y); } else console.error( "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead." ); else o(Y); if (G.call(L, "key")) { Y = t(p); var Z = Object.keys(L).filter(function(re) { return re !== "key"; }); I = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", H[Y + I] || (Z = 0 < Z.length ? "{" + Z.join(": ..., ") + ": ...}" : "{}", console.error( `A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`, I, Y, Z, Y ), H[Y + I] = !0); } if (Y = null, N !== void 0 && (e(N), Y = "" + N), h(L) && (e(L.key), Y = "" + L.key), "key" in L) { N = {}; for (var W in L) W !== "key" && (N[W] = L[W]); } else N = L; return Y && c( N, typeof p == "function" ? p.displayName || p.name || "Unknown" : p ), a( p, Y, z, V, l(), N, U, ee ); } function o(p) { typeof p == "object" && p !== null && p.$$typeof === d && p._store && (p._store.validated = 1); } var f = me, d = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), S = Symbol.for("react.consumer"), O = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), $ = Symbol.for("react.suspense"), R = Symbol.for("react.suspense_list"), j = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), E = Symbol.for("react.client.reference"), T = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, G = Object.prototype.hasOwnProperty, B = Array.isArray, M = console.createTask ? console.createTask : function() { return null; }; f = { "react-stack-bottom-frame": function(p) { return p(); } }; var C, x = {}, P = f["react-stack-bottom-frame"].bind( f, s )(), _ = M(i(s)), H = {}; ke.Fragment = m, ke.jsx = function(p, L, N, I, V) { var z = 1e4 > T.recentlyCreatedOwnerStacks++; return n( p, L, N, !1, I, V, z ? Error("react-stack-top-frame") : P, z ? M(i(p)) : _ ); }, ke.jsxs = function(p, L, N, I, V) { var z = 1e4 > T.recentlyCreatedOwnerStacks++; return n( p, L, N, !0, I, V, z ? Error("react-stack-top-frame") : P, z ? M(i(p)) : _ ); }; }()), ke; } var Nt; function pt() { return Nt || (Nt = 1, process.env.NODE_ENV === "production" ? Be.exports = Nr() : Be.exports = Rr()), Be.exports; } var g = pt(); const Sr = "_container_132e7_1", Rt = { container: Sr }, Mr = "_tooltip_6a7sr_1", kr = { tooltip: Mr }, ir = [ "rgb(0, 255, 128)", // Neon green "rgb(41, 121, 255)", // Electric blue "rgb(201, 81, 238)", // Pink "rgb(255, 160, 0)", // Amber "rgb(0, 184, 212)", // Dark cyan "rgb(103, 58, 183)", // Royal violet "rgb(224,33,70)", // Red "rgb(0, 121, 107)", // Teal storm "rgb(255, 193, 7)" // Solar gold ], Er = [ "rgb(0, 200, 83)", // Bright green "rgb(25, 118, 210)", // Medium blue "rgb(244, 143, 177)", // Soft pink "rgb(255, 193, 7)", // Golden amber "rgb(3, 169, 244)", // Sky blue "rgb(156, 39, 176)", // Vibrant violet "rgb(229, 57, 53)", // Warm red "rgb(0, 137, 123)", // Ocean teal "rgb(255, 160, 0)" // Deep yellow-orange ]; var se = {}, rt, St; function Lr() { return St || (St = 1, rt = function(r, e, i, l) { var s = i ? i.call(l, r, e) : void 0; if (s !== void 0) return !!s; if (r === e) return !0; if (typeof r != "object" || !r || typeof e != "object" || !e) return !1; var h = Object.keys(r), c = Object.keys(e); if (h.length !== c.length) return !1; for (var u = Object.prototype.hasOwnProperty.bind(e), a = 0; a < h.length; a++) { var n = h[a]; if (!u(n)) return !1; var o = r[n], f = e[n]; if (s = i ? i.call(l, o, f, n) : void 0, s === !1 || s === void 0 && o !== f) return !1; } return !0; }), rt; } var Mt; function jr() { if (Mt) return se; Mt = 1, Object.defineProperty(se, "__esModule", { value: !0 }), se.PreOrder = se.ReverseInOrder = se.InOrder = se.IntervalTree = se.Node = void 0; var t = Lr(); function r(a, n) { return a < n ? n : a; } function e(a) { return a === void 0 ? -1 : a.height; } var i = ( /** @class */ function() { function a(n, o) { this.intervalTree = n, this.records = [], this.height = 0, this.key = o.low, this.max = o.high, this.records.push(o); } return a.prototype.getNodeHigh = function() { for (var n = this.records[0].high, o = 1; o < this.records.length; o++) this.records[o].high > n && (n = this.records[o].high); return n; }, a.prototype.updateHeight = function() { this.height = r(e(this.left), e(this.right)) + 1; }, a.prototype.updateMaxOfParents = function() { if (this !== void 0) { var n = this.getNodeHigh(); this.left !== void 0 && this.right !== void 0 ? this.max = r(r(this.left.max, this.right.max), n) : this.left !== void 0 && this.right === void 0 ? this.max = r(this.left.max, n) : this.left === void 0 && this.right !== void 0 ? this.max = r(this.right.max, n) : this.max = n, this.parent && this.parent.updateMaxOfParents(); } }, a.prototype._updateMaxAfterRightRotate = function() { var n = this.parent, o = n.left, f = o.getNodeHigh(); o.left === void 0 && o.right !== void 0 ? o.max = r(f, o.right.max) : o.left !== void 0 && o.right === void 0 ? o.max = r(f, o.left.max) : o.left === void 0 && o.right === void 0 ? o.max = f : o.max = r(r(o.left.max, o.right.max), f); var d = this.getNodeHigh(); this.left === void 0 && this.right !== void 0 ? this.max = r(d, this.right.max) : this.left !== void 0 && this.right === void 0 ? this.max = r(d, this.left.max) : this.left === void 0 && this.right === void 0 ? this.max = d : this.max = r(r(this.left.max, this.right.max), d), n.max = r(r(n.left.max, n.right.max), n.getNodeHigh()); }, a.prototype._updateMaxAfterLeftRotate = function() { var n = this.parent, o = n.right, f = o.getNodeHigh(); o.left === void 0 && o.right !== void 0 ? o.max = r(f, o.right.max) : o.left !== void 0 && o.right === void 0 ? o.max = r(f, o.left.max) : o.left === void 0 && o.right === void 0 ? o.max = f : o.max = r(r(o.left.max, o.right.max), f); var d = this.getNodeHigh(); this.left === void 0 && this.right !== void 0 ? this.max = r(d, this.right.max) : this.left !== void 0 && this.right === void 0 ? this.max = r(d, this.left.max) : this.left === void 0 && this.right === void 0 ? this.max = d : this.max = r(r(this.left.max, this.right.max), d), n.max = r(r(n.left.max, o.max), n.getNodeHigh()); }, a.prototype._leftRotate = function() { var n = this.right; n.parent = this.parent, n.parent === void 0 ? this.intervalTree.root = n : n.parent.left === this ? n.parent.left = n : n.parent.right === this && (n.parent.right = n), this.right = n.left, this.right !== void 0 && (this.right.parent = this), n.left = this, this.parent = n, this.updateHeight(), n.updateHeight(); }, a.prototype._rightRotate = function() { var n = this.left; n.parent = this.parent, n.parent === void 0 ? this.intervalTree.root = n : n.parent.left === this ? n.parent.left = n : n.parent.right === this && (n.parent.right = n), this.left = n.right, this.left !== void 0 && (this.left.parent = this), n.right = this, this.parent = n, this.updateHeight(), n.updateHeight(); }, a.prototype._rebalance = function() { if (e(this.left) >= 2 + e(this.right)) { var n = this.left; e(n.left) >= e(n.right) ? (this._rightRotate(), this._updateMaxAfterRightRotate()) : (n._leftRotate(), this._rightRotate(), this._updateMaxAfterRightRotate()); } else if (e(this.right) >= 2 + e(this.left)) { var o = this.right; e(o.right) >= e(o.left) ? (this._leftRotate(), this._updateMaxAfterLeftRotate()) : (o._rightRotate(), this._leftRotate(), this._updateMaxAfterLeftRotate()); } }, a.prototype.insert = function(n) { n.low < this.key ? this.left === void 0 ? (this.left = new a(this.intervalTree, n), this.left.parent = this) : this.left.insert(n) : this.right === void 0 ? (this.right = new a(this.intervalTree, n), this.right.parent = this) : this.right.insert(n), this.max < n.high && (this.max = n.high), this.updateHeight(), this._rebalance(); }, a.prototype._getOverlappingRecords = function(n, o, f) { if (n.key <= f && o <= n.getNodeHigh()) { for (var d = [], v = 0; v < n.records.length; v++) n.records[v].high >= o && d.push(n.records[v]); return d; } return []; }, a.prototype.search = function(n, o) { if (this === void 0) return []; var f = [], d = [], v = []; return n > this.max ? [] : (this.left !== void 0 && this.left.max >= n && (f = this.left.search(n, o)), d = this._getOverlappingRecords(this, n, o), o < this.key ? f.concat(d) : (this.right !== void 0 && (v = this.right.search(n, o)), f.concat(d, v))); }, a.prototype.searchExisting = function(n) { if (this !== void 0) { if (this.key === n) return this; if (n < this.key) { if (this.left !== void 0) return this.left.searchExisting(n); } else if (this.right !== void 0) return this.right.searchExisting(n); } }, a.prototype._minValue = function() { return this.left === void 0 ? this : this.left._minValue(); }, a.prototype.remove = function(n) { var o = this.parent; if (n.key < this.key) return this.left !== void 0 ? this.left.remove(n) : void 0; if (n.key > this.key) return this.right !== void 0 ? this.right.remove(n) : void 0; if (this.left !== void 0 && this.right !== void 0) { var f = this.right._minValue(); return this.key = f.key, this.records = f.records, this.right.remove(this); } else { if (o.left === this) return this.right !== void 0 ? (o.left = this.right, this.right.parent = o) : (o.left = this.left, this.left !== void 0 && (this.left.parent = o)), o.updateMaxOfParents(), o.updateHeight(), o._rebalance(), this; if (o.right === this) return this.right !== void 0 ? (o.right = this.right, this.right.parent = o) : (o.right = this.left, this.left !== void 0 && (this.left.parent = o)), o.updateMaxOfParents(), o.updateHeight(), o._rebalance(), this; } }, a; }() ); se.Node = i; var l = ( /** @class */ function() { function a() { this.count = 0; } return a.prototype.insert = function(n) { if (n.low > n.high) throw new Error("`low` value must be lower or equal to `high` value"); if (this.root === void 0) return this.root = new i(this, n), this.count++, !0; var o = this.root.searchExisting(n.low); if (o !== void 0) { for (var f = 0; f < o.records.length; f++) if (t(o.records[f], n)) return !1; return o.records.push(n), n.high > o.max && (o.max = n.high, o.parent && o.parent.updateMaxOfParents()), this.count++, !0; } else return this.root.insert(n), this.count++, !0; }, a.prototype.search = function(n, o) { return this.root === void 0 ? [] : this.root.search(n, o); }, a.prototype.remove = function(n) { if (this.root === void 0) return !1; var o = this.root.searchExisting(n.low); if (o === void 0) return !1; if (o.records.length > 1) { for (var f = void 0, d = 0; d < o.records.length; d++) if (t(o.records[d], n)) { f = o.records[d], o.records.splice(d, 1); break; } if (f) { if (f = void 0, n.high === o.max) { var v = o.getNodeHigh(); o.left !== void 0 && o.right !== void 0 ? o.max = r(r(o.left.max, o.right.max), v) : o.left !== void 0 && o.right === void 0 ? o.max = r(o.left.max, v) : o.left === void 0 && o.right !== void 0 ? o.max = r(o.right.max, v) : o.max = v, o.parent && o.parent.updateMaxOfParents(); } return this.count--, !0; } else return !1; } else if (o.records.length === 1) if (t(o.records[0], n)) if (this.root.key === o.key) { var m = new i(this, { low: n.low, high: n.low }); m.left = this.root, this.root.parent = m; var y = this.root.remove(o); return this.root = m.left, this.root !== void 0 && (this.root.parent = void 0), y ? (y = void 0, this.count--, !0) : !1; } else { var y = this.root.remove(o); return y ? (y = void 0, this.count--, !0) : !1; } else return !1; else return !1; }, a.prototype.inOrder = function() { return new h(this.root); }, a.prototype.reverseInOrder = function() { return new c(this.root); }, a.prototype.preOrder = function() { return new u(this.root); }, a; }() ); se.IntervalTree = l; var s = ( /** @class */ function() { function a() { this.tree = new l(); } return a.prototype.insert = function(n, o, f) { return this.tree.insert({ low: n, high: o, data: f }); }, a.prototype.remove = function(n, o, f) { return this.tree.remove({ low: n, high: o, data: f }); }, a.prototype.search = function(n, o) { return this.tree.search(n, o).map(function(f) { return f.data; }); }, a.prototype.inOrder = function() { return this.tree.inOrder(); }, a.prototype.reverseInOrder = function() { return this.tree.reverseInOrder(); }, a.prototype.preOrder = function() { return this.tree.preOrder(); }, Object.defineProperty(a.prototype, "count", { get: function() { return this.tree.count; }, enumerable: !1, configurable: !0 }), a; }() ); se.default = s; var h = ( /** @class */ function() { function a(n) { this.stack = [], n !== void 0 && this.push(n); } return a.prototype[Symbol.iterator] = function() { return this; }, a.prototype.next = function() { return this.currentNode === void 0 ? { done: !0, value: void 0 } : this.i < this.currentNode.records.length ? { done: !1, value: this.currentNode.records[this.i++] } : (this.currentNode.right !== void 0 ? this.push(this.currentNode.right) : this.pop(), this.next()); }, a.prototype.push = function(n) { for (this.currentNode = n, this.i = 0; this.currentNode.left !== void 0; ) this.stack.push(this.currentNode), this.currentNode = this.currentNode.left; }, a.prototype.pop = function() { this.currentNode = this.stack.pop(), this.i = 0; }, a; }() ); se.InOrder = h; var c = ( /** @class */ function() { function a(n) { this.stack = [], n !== void 0 && this.push(n); } return a.prototype[Symbol.iterator] = function() { return this; }, a.prototype.next = function() { return this.currentNode === void 0 ? { done: !0, value: void 0 } : this.currentNode.records.length && this.i >= 0 ? { done: !1, value: this.currentNode.records[this.i--] } : (this.currentNode.left !== void 0 ? this.push(this.currentNode.left) : this.pop(), this.next()); }, a.prototype.push = function(n) { var o, f, d, v; for (this.currentNode = n, this.i = ((f = (o = this.currentNode) === null || o === void 0 ? void 0 : o.records.length) !== null && f !== void 0 ? f : 0) - 1; this.currentNode.right !== void 0; ) this.stack.push(this.currentNode), this.currentNode = this.currentNode.right, this.i = ((v = (d = this.currentNode) === null || d === void 0 ? void 0 : d.records.length) !== null && v !== void 0 ? v : 0) - 1; }, a.prototype.pop = function() { var n, o; this.currentNode = this.stack.pop(), this.i = ((o = (n = this.currentNode) === null || n === void 0 ? void 0 : n.records.length) !== null && o !== void 0 ? o : 0) - 1; }, a; }() ); se.ReverseInOrder = c; var u = ( /** @class */ function() { function a(n) { this.stack = [], this.i = 0, this.currentNode = n; } return a.prototype[Symbol.iterator] = function() { return this; }, a.prototype.next = function() { return this.currentNode === void 0 ? { done: !0, value: void 0 } : this.i < this.currentNode.records.length ? { done: !1, value: this.currentNode.records[this.i++] } : (this.currentNode.right !== void 0 && this.push(this.currentNode.right), this.currentNode.left !== void 0 && this.push(this.currentNode.left), this.pop(), this.next()); }, a.prototype.push = function(n) { this.stack.push(n); }, a.prototype.pop = function() { this.currentNode = this.stack.pop(), this.i = 0; }, a; }() ); return se.PreOrder = u, se; } var Dr = jr(); const or = /* @__PURE__ */ _e(Dr), te = 40, gt = 20, He = 2, sr = 16, Re = 24, kt = { hash: "defaultCommit", branch: "unknown", parents: [], children: [], authorDate: (/* @__PURE__ */ new Date()).toString(), message: "Working tree index", committerDate: (/* @__PURE__ */ new Date()).toString(), isBranchTip: !1 }, ar = Je({ headCommit: kt, indexCommit: kt, currentBranch: "master", showTable: !0, showBranchesTags: !0, selectedCommit: void 0, setSelectedCommit: (t) => { console.debug(`Tried to invoke setSelectedCommit(${JSON.stringify(t)}) before the GitContext was initialised.`); }, previewedCommit: void 0, setPreviewedCommit: (t) => { console.debug(`Tried to invoke setPreviewedCommit(${JSON.stringify(t)}) before the GitContext was initialised.`); }, graphOrientation: "normal", setGraphOrientation: (t) => { console.debug(`Tried to invoke setGraphOrientation(${t}) before the GitContext was initialised.`); }, graphData: { children: /* @__PURE__ */ new Map(), edges: new or(), graphWidth: 0, commits: [], positions: /* @__PURE__ */ new Map(), parents: /* @__PURE__ */ new Map(), hashToCommit: /* @__PURE__ */ new Map() }, rowSpacing: 0, graphWidth: 300, nodeSize: gt, setNodeSize: (t) => { console.debug(`Tried to invoke setNodeSize(${t}) before the GitContext was initialised.`); }, setGraphWidth: (t) => { console.debug(`Tried to invoke setGraphWidth(${t}) before the GitContext was initialised.`); }, isServerSidePaginated: !1, paging: { endIndex: 0, startIndex: 0 }, isIndexVisible: !0 }), Q = () => Ze(ar), cr = Je({ colours: ir, theme: "light" }), Pr = () => Ze(cr), Et = (t) => { if (t < 1) return []; const r = []; if (t === 1) r.push("rgb(54,229,234)"); else for (let e = 0; e < t; e++) { const i = e / (t - 1) * 360, l = e === 0 ? 0 : e === t - 1 ? 359 : i, s = Or(l, 100, 50); r.push(`rgb(${s[0]}, ${s[1]}, ${s[2]})`); } return r; }, Or = (t, r, e) => { r /= 100, e /= 100; const i = (h) => (h + t / 30) % 12, l = r * Math.min(e, 1 - e), s = (h) => Math.round((e - l * Math.max(-1, Math.min(i(h) - 3, Math.min(9 - i(h), 1)))) * 255); return [s(0), s(8), s(4)]; }, Ir = ({ children: t, theme: r, colours: e, graphWidth: i }) => { const { shiftAlphaChannel: l } = ie(), s = A(() => { switch (e) { case "rainbow-light": return Et(i + 1); case "rainbow-dark": return Et(i + 1).map((c) => l(c, 0.6)); case "neon-aurora-dark": return ir; case "neon-aurora-light": return Er; default: return r === "light" ? e : e.map((c) => l(c, 0.6)); } }, [e, i, l, r]), h = A(() => ({ colours: s, theme: r }), [r, s]); return /* @__PURE__ */ g.jsx(cr.Provider, { value: h, children: t }); }, ie = () => { const { graphData: t } = Q(), { theme: r, colours: e } = Pr(), i = A(() => r === "dark" ? "rgba(70,70,70,0.8)" : "rgba(231, 231, 231, 0.5)", [r]), l = A(() => r === "dark" ? "rgb(255, 255, 255)" : "rgb(0, 0, 0)", [r]), s = K((f, d) => { const v = f == null ? void 0 : f.match(/\d+/g); if (f && v != null) { const [m, y, w] = v.map(Number), S = r === "dark" ? "rgb(0, 0, 0)" : "rgb(255, 255, 255)", [O, k, $] = S.match(/\d+/g).map(Number), R = Math.round(m * d + O * (1 - d)), j = Math.round(y * d + k * (1 - d)), b = Math.round(w * d + $ * (1 - d)); return `rgb(${R}, ${j}, ${b})`; } return f; }, [r]), h = K((f, d) => `rgba(${f == null ? void 0 : f.replace("rgb(", "").replace(")", "")}, ${d})`, []), c = K((f) => { const d = e[f]; return d || e[f % e.length]; }, [e]), u = K((f) => { if (f.hash === "index") return c(0); const d = t.positions.get(f.hash); if (d) { const v = d[1]; return c(v); } return console.warn(`Commit ${f.hash} did not have a mapped graph position`), "rgb(0, 0, 0)"; }, [c, t.positions]), a = K((f) => ({ backgroundColour: s(f.columnColour, 0.15), borderColour: f.columnColour }), [s]), n = K((f) => h(c(f), 0.15), [c, h]), o = K((f) => r === "dark" ? s(u(f), 0.2) : s(u(f), 0.1), [u, s, r]); return { theme: r, hoverColour: i, textColour: l, getTooltipBackground: o, reduceOpacity: h, getCommitColour: u, shiftAlphaChannel: s, getGraphColumnColour: c, getCommitNodeColours: a, getGraphColumnSelectedBackgroundColour: n, hoverTransitionDuration: 0.3 }; }, Hr = ({ id: t, commit: r }) => { const { textColour: e, getTooltipBackground: i, getCommitColour: l } = ie(), s = i(r); return /* @__PURE__ */ g.jsx( "div", { className: kr.tooltip, id: `tag-${t}-tooltip`, "data-testid": `tag-${t}-tooltip`, style: { color: e, background: s, border: `2px solid ${l(r)}` }, children: r.branch } ); }, zr = "_tagContainer_ioghg_1", Vr = "_tag_ioghg_1", Ar = "_tagLine_ioghg_22", nt = { tagContainer: zr, tag: Vr, tagLine: Ar }; var Ee = {}, Le = {}, Lt; function Gr() { if (Lt) return Le; Lt = 1, Object.defineProperty(Le, "__esModule", { value: !0 }), Le.PopoverPortal = void 0; var t = me, r = Tr, e = function(i) { var l = i.container, s = i.element, h = i.scoutElement, c = i.children; return (0, t.useLayoutEffect)(function() { return l.appendChild(s), l.appendChild(h), function() { l.removeChild(s), l.removeChild(h); }; }, [l, s, h]), (0, r.createPortal)(c, s); }; return Le.PopoverPortal = e, Le; } var je = {}, jt; function mt() { return jt || (jt = 1, function(t) { var r = je && je.__assign || function() { return r = Object.assign || function(u) { for (var a, n = 1, o = arguments.length; n < o; n++) { a = arguments[n]; for (var f in a) Object.prototype.hasOwnProperty.call(a, f) && (u[f] = a[f]); } return u; }, r.apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), t.getNudgedPopoverRect = t.getNewPopoverRect = t.popoverRectForPosition = t.createContainer = t.rectsAreEqual = t.createRect = t.EMPTY_RECT = void 0, t.EMPTY_RECT = { top: 0, left: 0, right: 0, bottom: 0, width: 0, height: 0 }; var e = function(u) { var a = u.top, n = u.left, o = u.width, f = u.height; return { top: a, left: n, width: o, height: f, right: n + o, bottom: a + f }; }; t.createRect = e; var i = function(u, a) { return u === a || (u == null ? void 0 : u.bottom) === (a == null ? void 0 : a.bottom) && (u == null ? void 0 : u.height) === (a == null ? void 0 : a.height) && (u == null ? void 0 : u.left) === (a == null ? void 0 : a.left) && (u == null ? void 0 : u.right) === (a == null ? void 0 : a.right) && (u == null ? void 0 : u.top) === (a == null ? void 0 : a.top) && (u == null ? void 0 : u.width) === (a == null ? void 0 : a.width); }; t.rectsAreEqual = i; var l = function(u) { var a = u.containerStyle, n = u.containerClassName, o = window.document.createElement("div"); return n && (o.className = n), Object.assign(o.style, a), o; }; t.createContainer = l; var s = function(u, a, n, o, f) { var d = a.left + a.width / 2, v = a.top + a.height / 2, m = n.width, y = n.height, w, S; switch (u) { case "left": w = v - y / 2, S = a.left - o - m, f === "start" && (w = a.top), f === "end" && (w = a.bottom - y); break; case "bottom": w = a.bottom + o, S = d - m / 2, f === "start" && (S = a.left), f === "end" && (S = a.right - m); break; case "right": w = v - y / 2, S = a.right + o, f === "start" && (w = a.top), f === "end" && (w = a.bottom - y); break; default: w = a.top - y - o, S = d - m / 2, f === "start" && (S = a.left), f === "end" && (S = a.right - m); break; } return (0, t.createRect)({ left: S, top: w, width: m, height: y }); }; t.popoverRectForPosition = s; var h = function(u, a) { var n = u.position, o = u.align, f = u.childRect, d = u.popoverRect, v = u.boundaryRect, m = u.padding, y = u.reposition, w = (0, t.popoverRectForPosition)(n, f, d, m, o), S = y && (n === "top" && w.top < v.top + a || n === "left" && w.left < v.left + a || n === "right" && w.right > v.right - a || n === "bottom" && w.bottom > v.bottom - a); return { rect: w, boundaryViolation: S }; }; t.getNewPopoverRect = h; var c = function(u, a, n) { var o = a.top + n, f = a.left + n, d = a.right - n, v = a.bottom - n, m = u.top < o ? o : u.top; m = m + u.height > v ? v - u.height : m; var y = u.left < f ? f : u.left; return y = y + u.width > d ? d - u.width : y, (0, t.createRect)(r(r({}, u), { top: m, left: y })); }; t.getNudgedPopoverRect = c; }(je)), je; } var De = {}, Pe = {}, Dt; function Br() { if (Dt) return Pe; Dt = 1, Object.defineProperty(Pe, "__esModule", { value: !0 }), Pe.useElementRef = void 0; var t = me, r = mt(), e = function(i) { var l = i.containerClassName, s = i.containerStyle, h = (0, t.useRef)(), c = (0, t.useState)(function() { return (0, r.createContainer)({ containerStyle: s, containerClassName: l }); })[0]; return (0, t.useLayoutEffect)(function() { c.className = l; }, [l, c]), (0, t.useLayoutEffect)(function() { Object.assign(c.style, s); }, [s, c]), h.current = c, h; }; return Pe.useElementRef = e, Pe; } var Pt; function Yr() { if (Pt) return De; Pt = 1, Object.defineProperty(De, "__esModule", { value: !0 }), De.usePopover = void 0; var t = me, r = mt(), e = Br(), i = { position: "fixed", overflow: "visible", top: "0px", left: "0px" }, l = { position: "fixed", top: "0px", left: "0px", width: "0px", height: "0px", visibility: "hidden" }, s = function(h) { var c = h.isOpen, u = h.childRef, a = h.positions, n = h.containerClassName, o = h.parentElement, f = h.transform, d = h.transformMode, v = h.align, m = h.padding, y = h.reposition, w = h.boundaryInset, S = h.boundaryElement, O = h.onPositionPopover, k = (0, e.useElementRef)({ containerClassName: "react-tiny-popover-scout", containerStyle: l }), $ = (0, e.useElementRef)({ containerClassName: n != null && n.length > 0 && n !== "react-tiny-popover-container" ? "react-tiny-popover-container ".concat(n) : "react-tiny-popover-container", containerStyle: i }), R = (0, t.useCallback)(function(j) { var b, D, E = j === void 0 ? {} : j, T = E.positionIndex, G = T === void 0 ? 0 : T, B = E.parentRect, M = B === void 0 ? o.getBoundingClientRect() : B, C = E.childRect, x = C === void 0 ? (b = u == null ? void 0 : u.current) === null || b === void 0 ? void 0 : b.getBoundingClientRect() : C, P = E.scoutRect, _ = P === void 0 ? (D = k == null ? void 0 : k.current) === null || D === void 0 ? void 0 : D.getBoundingClientRect() : P, H = E.popoverRect, p = H === void 0 ? $.current.getBoundingClientRect() : H, L = E.boundaryRect, N = L === void 0 ? S === o ? M : S.getBoundingClientRect() : L; if (!(!x || !M || !c)) { if (f && d === "absolute") { var I = typeof f == "function" ? f({ childRect: x, popoverRect: p, parentRect: M, boundaryRect: N, padding: m, align: v, nudgedTop: 0, nudgedLeft: 0, boundaryInset: w, violations: r.EMPTY_RECT, hasViolations: !1 }) : f, V = I.top, z = I.left, U = Math.round(M.left + z - _.left), ee = Math.round(M.top + V - _.top); $.current.style.transform = "translate(".concat(U, "px, ").concat(ee, "px)"), O({ childRect: x, popoverRect: (0, r.createRect)({ left: U, top: ee, width: p.width, height: p.height }), parentRect: M, boundaryRect: N, padding: m, align: v, transform: { top: V, left: z }, nudgedTop: 0, nudgedLeft: 0, boundaryInset: w, violations: r.EMPTY_RECT, hasViolations: !1 }); return; } var Y = G === a.length, Z = Y ? a[0] : a[G], W = (0, r.getNewPopoverRect)({ childRect: x, popoverRect: p, boundaryRect: N, position: Z, align: v, padding: m, reposition: y }, w), re = W.rect, pe = W.boundaryViolation; if (pe && y && !Y) { R({ positionIndex: G + 1, childRect: x, popoverRect: p, parentRect: M, boundaryRect: N }); return; } var ue = re.top, we = re.left, le = re.width, Ve = re.height, be = y && !Y, $e = (0, r.getNudgedPopoverRect)(re, N, w), Ae = $e.left, Ge = $e.top, de = ue, F = we; be && (de = Ge, F = Ae), de = Math.round(de - _.top), F = Math.round(F - _.left), $.current.style.transform = "translate(".concat(F, "px, ").concat(de, "px)"); var J = { top: N.top + w - de, left: N.left + w - F, right: F + le - N.right + w, bottom: de + Ve - N.bottom + w }, oe = { childRect: x, popoverRect: (0, r.createRect)({ left: F, top: de, width: le, height: Ve }), parentRect: M, boundaryRect: N, position: Z, align: v, padding: m, nudgedTop: Ge - ue, nudgedLeft: Ae - we, boundaryInset: w, violations: { top: J.top <= 0 ? 0 : J.top, left: J.left <= 0 ? 0 : J.left, right: J.right <= 0 ? 0 : J.right, bottom: J.bottom <= 0 ? 0 : J.bottom }, hasViolations: J.top > 0 || J.left > 0 || J.right > 0 || J.bottom > 0 }; if (f) { O(oe); var Te = typeof f == "function" ? f(oe) : f, fe = Te.top, he = Te.left; $.current.style.transform = "translate(".concat(Math.round(F + (he ?? 0)), "px, ").concat(Math.round(de + (fe ?? 0)), "px)"), oe.nudgedLeft += he ?? 0, oe.nudgedTop += fe ?? 0, oe.transform = { top: fe, left: he }; } O(oe); } }, [ o, u, k, $, S, c, f, d, a, v, m, y, w, O ]); return { positionPopover: R, popoverRef: $, scoutRef: k }; }; return De.usePopover = s, De; } var Oe = {}, Ot; function Wr() { if (Ot) return Oe; Ot = 1, Object.defineProperty(Oe, "__esModule", { value: !0 }), Oe.useMemoizedArray = void 0; var t = me, r = function(e) { var i = (0, t.useRef)(e), l = (0, t.useMemo)(function() { if (i.current === e) return i.current; if (i.current.length !== e.length) return i.current = e, e; for (var s = 0; s < e.length; s += 1) if (e[s] !== i.current[s]) return i.current = e, e; return i.current; }, [e]); return l; }; return Oe.useMemoizedArray = r, Oe; } var Ie = {}, It; function Fr() { if (It) return Ie; It = 1, Object.defineProperty(Ie, "__esModule", { value: !0 }), Ie.useHandlePrevValues = void 0; var t = me, r = function(e) { var i = (0, t.useRef)(e.positions), l = (0, t.useRef)(e.reposition), s = (0, t.useRef)(e.transformMode), h = (0, t.useRef)(e.transform), c = (0, t.useRef)(e.boundaryElement), u = (0, t.useRef)(e.boundaryInset), a = (0, t.useCallback)(function() { i.current = e.positions, l.current = e.reposition, s.current = e.transformMode, h.current = e.transform, c.current = e.boundaryElement, u.current = e.boundaryInset; }, [ e.boundaryElement, e.boundaryInset, e.positions, e.reposition, e.transform, e.transformMode ]); return { prev: { positions: i.current, reposition: l.current, transformMode: s.current, transform: h.current, boundaryElement: c.current, boundaryInset: u.current }, updatePrevValues: a }; }; return Ie.useHandlePrevValues = r, Ie; } var ye = {}, Ht; function lr() { if (Ht) return ye; Ht = 1; var t = ye && ye.__assign || function() { return t = Object.assign || function(i) { for (var l, s = 1, h = arguments.length; s < h; s++) { l = arguments[s]; for (var c in l) Object.prototype.hasOwnProperty.call(l, c) && (i[c] = l[c]); } return i; }, t.apply(this, arguments); }; Object.defineProperty(ye, "__esModule", { value: !0 }), ye.useArrowContainer = void 0; var r = me, e = function(i) { var l = i.childRect, s = i.popoverRect, h = i.position, c = i.arrowSize, u = i.arrowColor, a = (0, r.useMemo)(function() { return { padding: c }; }, [c]), n = (0, r.useMemo)(function() { return t({ position: "absolute" }, function() { var o = c * 2, f = l.top - s.top + l.height / 2 - o / 2, d = l.left - s.left + l.width / 2 - o / 2, v = c, m = s.width - c, y = s.height - c; switch (d = d < v ? v : d, d = d + o > m ? m - o : d, f = f < v ? v : f, f = f + o > y ? y - o : f, f = Number.isNaN(f) ? 0 : f, d = Number.isNaN(d) ? 0 : d, h) { case "right": return { borderTop: "".concat(c, "px solid transparent"), borderBottom: "".concat(c, "px solid transparent"), borderRight: "".concat(c, "px solid ").concat(u), left: 0, top: f }; case "left": return { borderTop: "".concat(c, "px solid transparent"), borderBottom: "".concat(c, "px solid transparent"), borderLeft: "".concat(c, "px solid ").concat(u), right: 0, top: f }; case "bottom": return { borderLeft: "".concat(c, "px solid transparent"), borderRight: "".concat(c, "px solid transparent"), borderBottom: "".concat(c, "px solid ").concat(u), top: 0, left: d }; case "top": return { borderLeft: "".concat(c, "px solid transparent"), borderRight: "".concat(c, "px solid transparent"), borderTop: "".concat(c, "px solid ").concat(u), bottom: 0, left: d }; default: return { display: "hidden" }; } }()); }, [ u, c, l.height, l.left, l.top, l.width, s.height, s.left, s.top, s.width, h ]); return { arrowContainerStyle: a, arrowStyle: n }; }; return ye.useArrowContainer = e, ye; } var Ce = {}, zt; function qr() { if (zt) return Ce; zt = 1; var t = Ce && Ce.__assign || function() { return t = Object.assign || function(s) { for (var h, c = 1, u = arguments.length; c < u; c++) { h = arguments[c]; for (var a in h) Object.prototype.hasOwnProperty.call(h, a) && (s[a] = h[a]); } return s; }, t.apply(this, arguments); }; Object.defineProperty(Ce, "__esModule", { value: !0 }), Ce.ArrowContainer = void 0; var r = pt(), e = me, i = lr(), l = function(s) { var h = s.childRect, c = s.popoverRect, u = s.position, a = s.arrowColor, n = s.arrowSize, o = s.arrowClassName, f = s.arrowStyle, d = s.className, v = s.children, m = s.style, y = (0, i.useArrowContainer)({ childRect: h, popoverRect: c, position: u, arrowColor: a, arrowSize: n }), w = y.arrowContainerStyle, S = y.arrowStyle, O = (0, e.useMemo)(function() { return t(t({}, w), m); }, [w, m]), k = (0, e.useMemo)(function() { return t(t({}, S), f); }, [S, f]); return (0, r.jsxs)("div", { className: d, style: O, children: [(0, r.jsx)("div", { style: k, className: o }), v] }); }; return Ce.ArrowContainer = l, Ce; } var Vt; function Ur() { return Vt || (Vt = 1, function(t) { var r = Ee && Ee.__assign || function() { return r = Object.assign || function(d) { for (var v, m = 1, y = arguments.length; m < y; m++) { v = arguments[m]; for (var w in v) Object.prototype.hasOwnProperty.call(v, w) && (d[w] = v[w]); } return d; }, r.apply(this, arguments); }; Object.defineProperty(t, "__esModule", { value: !0 }), t.Popover = t.usePopover = t.ArrowContainer = t.useArrowContainer = void 0; var e = pt(), i = me, l = Gr(), s = mt(), h = Yr(); Object.defineProperty(t, "usePopover", { enumerable: !0, get: function() { return h.usePopover; } }); var c = Wr(), u = Fr(), a = lr(); Object.defineProperty(t, "useArrowContainer", { enumerable: !0, get: function() { return a.useArrowContainer; } }); var n = qr(); Object.defineProperty(t, "ArrowContainer", { enumerable: !0, get: function() { return n.ArrowContainer; } }); var o = ["top", "left", "right", "bottom"], f = (0, i.forwardRef)(function(d, v) { var m = d.isOpen, y = d.children, w = d.content, S = d.positions, O = S === void 0 ? o : S, k = d.align, $ = k === void 0 ? "center" : k, R = d.padding, j = R === void 0 ? 0 : R, b = d.reposition, D = b === void 0 ? !0 : b, E = d.parentElement, T = E === void 0 ? window.document.body : E, G = d.boundaryElement, B = G === void 0 ? T : G, M = d.containerClassName, C = d.containerStyle, x = d.transform, P = d.transformMode, _ = P === void 0 ? "absolute" : P, H = d.boundaryInset, p = H === void 0 ? 0 : H, L = d.onClickOutside, N = d.clickOutsideCapture, I = N === void 0 ? !1 : N, V = (0, c.useMemoizedArray)(Array.isArray(O) ? O : [O]), z = (0, u.useHandlePrevValues)({ positions: V, reposition: D, transformMode: _, transform: x, boundaryElement: B, boundaryInset: p }), U = z.prev, ee = z.updatePrevValues, Y = (0, i.useRef)(), Z = (0, i.useState)({ align: $, nudgedLeft: 0, nudgedTop: 0, position: V[0], padding: j, childRect: s.EMPTY_RECT, popoverRect: s.EMPTY_RECT, parentRect: s.EMPTY_RECT, boundaryRect: s.EMPTY_RECT, boundaryInset: p, violations: s.EMPTY_RECT, hasViolations: !1 }), W = Z[0], re = Z[1], pe = (0, i.useCallback)(function(F) { return re(F); }, []), ue = (0, h.usePopover)({ isOpen: m, childRef: Y, containerClassName: M, parentElement: T, boundaryElement: B, transform: x, transformMode: _, positions: V, align: $, padding: j, boundaryInset: p, reposition: D, onPositionPopover: pe }), we = ue.positionPopover, le = ue.popoverRef, Ve = ue.scoutRef; (0, i.useLayoutEffect)(function() { var F = !0, J = function() { var oe, Te; if (m && F) { var fe = (oe = Y == null ? void 0 : Y.current) === null || oe === void 0 ? void 0 : oe.getBoundingClientRect(), he = (Te = le == null ? void 0 : le.current) === null || Te === void 0 ? void 0 : Te.getBoundingClientRect(); fe != null && he != null && (!(0, s.rectsAreEqual)(fe, W.childRect) || he.width !== W.popoverRect.width || he.height !== W.popoverRect.height || W.padding !== j || W.align !== $ || V !== U.positions || D !== U.reposition || _ !== U.transformMode || x !== U.transform || B !== U.boundaryElement || p !== U.boundaryInset) && we(), ee(), F && window.requestAnimationFrame(J); } }; return J(), function() { F = !1; }; }, [ $, B, p, m, j, le, W.align, W.childRect, W.padding, W.popoverRect.height, W.popoverRect.width, we, V, U.boundaryElement, U.boundaryInset, U.positions, U.reposition, U.transform, U.transformMode, D, x, _, ee ]), (0, i.useEffect)(function() { var F = le.current; return Object.assign(F.style, C), function() { Object.keys(C ?? {}).forEach(function(J) { return delete F.style[J]; }); }; }, [C, m, le]); var be = (0, i.useCallback)(function(F) { var J, oe; m && !(!((J = le.current) === null || J === void 0) && J.contains(F.target)) && !(!((oe = Y.current) === null || oe === void 0) && oe.contains(F.target)) && (L == null || L(F)); }, [m, L, le]), $e = (0, i.useCallback)(function() { Y.current && m && window.requestAnimationFrame(function() { return we(); }); }, [we, m]); (0, i.useEffect)(function() { var F = T.ownerDocument.body; return F.addEventListener("click", be, I), F.addEventListener("contextmenu", be, I), window.addEventListener("resize", $e), function() { F.removeEventListener("click", be, I), F.removeEventListener("contextmenu", be, I), window.removeEventListener("res