@git-stats-components/vue 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue.es.js CHANGED
@@ -1,86 +1,86 @@
1
- var nt = Object.defineProperty, rt = Object.defineProperties;
2
- var it = Object.getOwnPropertyDescriptors;
3
- var P = Object.getOwnPropertySymbols;
4
- var lt = Object.prototype.hasOwnProperty, ct = Object.prototype.propertyIsEnumerable;
5
- var V = (e, t, a) => t in e ? nt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a, R = (e, t) => {
6
- for (var a in t || (t = {}))
7
- lt.call(t, a) && V(e, a, t[a]);
8
- if (P)
9
- for (var a of P(t))
10
- ct.call(t, a) && V(e, a, t[a]);
1
+ var ot = Object.defineProperty, nt = Object.defineProperties;
2
+ var rt = Object.getOwnPropertyDescriptors;
3
+ var V = Object.getOwnPropertySymbols;
4
+ var it = Object.prototype.hasOwnProperty, lt = Object.prototype.propertyIsEnumerable;
5
+ var R = (e, t, s) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s, Y = (e, t) => {
6
+ for (var s in t || (t = {}))
7
+ it.call(t, s) && R(e, s, t[s]);
8
+ if (V)
9
+ for (var s of V(t))
10
+ lt.call(t, s) && R(e, s, t[s]);
11
11
  return e;
12
- }, Y = (e, t) => rt(e, it(t));
13
- var M = (e, t, a) => new Promise((i, l) => {
14
- var f = (u) => {
12
+ }, W = (e, t) => nt(e, rt(t));
13
+ var O = (e, t, s) => new Promise((i, l) => {
14
+ var m = (d) => {
15
15
  try {
16
- o(a.next(u));
17
- } catch (b) {
18
- l(b);
16
+ n(s.next(d));
17
+ } catch (p) {
18
+ l(p);
19
19
  }
20
- }, d = (u) => {
20
+ }, u = (d) => {
21
21
  try {
22
- o(a.throw(u));
23
- } catch (b) {
24
- l(b);
22
+ n(s.throw(d));
23
+ } catch (p) {
24
+ l(p);
25
25
  }
26
- }, o = (u) => u.done ? i(u.value) : Promise.resolve(u.value).then(f, d);
27
- o((a = a.apply(e, t)).next());
26
+ }, n = (d) => d.done ? i(d.value) : Promise.resolve(d.value).then(m, u);
27
+ n((s = s.apply(e, t)).next());
28
28
  });
29
- import { ref as S, computed as I, defineComponent as q, watch as z, createElementBlock as y, openBlock as h, createElementVNode as r, createCommentVNode as L, toDisplayString as D, normalizeClass as W, unref as k, renderSlot as j, createTextVNode as C, Fragment as O, renderList as A, normalizeStyle as dt, createStaticVNode as J } from "vue";
30
- function de(e) {
31
- return M(this, null, function* () {
29
+ import { ref as S, computed as E, defineComponent as J, watch as q, createElementBlock as y, openBlock as h, createElementVNode as a, createCommentVNode as U, toDisplayString as D, normalizeClass as T, unref as k, renderSlot as L, createTextVNode as C, Fragment as A, renderList as B, normalizeStyle as ct, createStaticVNode as ut } from "vue";
30
+ function me(e) {
31
+ return O(this, null, function* () {
32
32
  const t = yield fetch(e);
33
33
  if (!t.ok)
34
34
  throw new Error(`Failed to fetch git stats: ${t.statusText}`);
35
35
  return t.json();
36
36
  });
37
37
  }
38
- function ut() {
39
- const e = [], t = /* @__PURE__ */ new Date(), a = new Date(t);
40
- a.setDate(a.getDate() - a.getDay());
41
- const i = new Date(a);
38
+ function dt() {
39
+ const e = [], t = /* @__PURE__ */ new Date(), s = new Date(t);
40
+ s.setDate(s.getDate() - s.getDay());
41
+ const i = new Date(s);
42
42
  i.setDate(i.getDate() - 52 * 7);
43
43
  const l = new Date(i);
44
- for (let f = 0; f < 53; f++) {
45
- const d = {
44
+ for (let m = 0; m < 53; m++) {
45
+ const u = {
46
46
  weekStart: new Date(l).toISOString().split("T")[0],
47
47
  contributionDays: []
48
48
  };
49
- for (let o = 0; o < 7; o++) {
50
- const u = l > t, b = o === 0 || o === 6;
51
- let m = 0;
52
- u || (b ? m = Math.random() < 0.3 ? Math.floor(Math.random() * 5) : 0 : m = Math.floor(Math.random() * 15)), d.contributionDays.push({
49
+ for (let n = 0; n < 7; n++) {
50
+ const d = l > t, p = n === 0 || n === 6;
51
+ let f = 0;
52
+ d || (p ? f = Math.random() < 0.3 ? Math.floor(Math.random() * 5) : 0 : f = Math.floor(Math.random() * 15)), u.contributionDays.push({
53
53
  date: new Date(l).toISOString().split("T")[0],
54
- contributionCount: m,
55
- weekday: o
54
+ contributionCount: f,
55
+ weekday: n
56
56
  }), l.setDate(l.getDate() + 1);
57
57
  }
58
- e.push(d);
58
+ e.push(u);
59
59
  }
60
60
  return e;
61
61
  }
62
- function G(e = {}) {
62
+ function P(e = {}) {
63
63
  const {
64
64
  username: t = "demo-user",
65
- platform: a = "github",
65
+ platform: s = "github",
66
66
  projectCount: i = 30,
67
67
  commitCount: l = 2500
68
- } = e, f = ut();
69
- return f.reduce((d, o) => d + o.contributionDays.reduce(
70
- (u, b) => u + b.contributionCount,
68
+ } = e, m = dt();
69
+ return m.reduce((u, n) => u + n.contributionDays.reduce(
70
+ (d, p) => d + p.contributionCount,
71
71
  0
72
72
  ), 0), {
73
73
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
74
74
  profiles: [
75
75
  {
76
76
  username: t,
77
- platform: a,
77
+ platform: s,
78
78
  stats: {
79
79
  projectCount: i,
80
80
  commitCount: l,
81
- contributions: f.map((d) => ({
82
- firstDay: d.weekStart,
83
- contributionDays: d.contributionDays
81
+ contributions: m.map((u) => ({
82
+ firstDay: u.weekStart,
83
+ contributionDays: u.contributionDays
84
84
  }))
85
85
  }
86
86
  }
@@ -96,13 +96,13 @@ function G(e = {}) {
96
96
  }
97
97
  };
98
98
  }
99
- function ue() {
100
- const e = G({
99
+ function fe() {
100
+ const e = P({
101
101
  username: "demo-github",
102
102
  platform: "github",
103
103
  projectCount: 45,
104
104
  commitCount: 2847
105
- }), t = G({
105
+ }), t = P({
106
106
  username: "demo-gitlab",
107
107
  platform: "gitlab",
108
108
  projectCount: 7,
@@ -122,55 +122,55 @@ function ue() {
122
122
  }
123
123
  };
124
124
  }
125
- function fe(e = "dummy-git-stats.json") {
126
- const t = G(), a = JSON.stringify(t, null, " ");
125
+ function ve(e = "dummy-git-stats.json") {
126
+ const t = P(), s = JSON.stringify(t, null, " ");
127
127
  if (typeof window != "undefined") {
128
- const i = new Blob([a], { type: "application/json" }), l = URL.createObjectURL(i), f = document.createElement("a");
129
- f.href = l, f.download = e, f.click(), URL.revokeObjectURL(l);
128
+ const i = new Blob([s], { type: "application/json" }), l = URL.createObjectURL(i), m = document.createElement("a");
129
+ m.href = l, m.download = e, m.click(), URL.revokeObjectURL(l);
130
130
  } else
131
131
  try {
132
- require("fs").writeFileSync(e, a), console.log(`✓ Dummy data saved to ${e}`);
132
+ require("fs").writeFileSync(e, s), console.log(`✓ Dummy data saved to ${e}`);
133
133
  } catch (i) {
134
134
  console.error("Failed to save dummy data:", i);
135
135
  }
136
136
  }
137
- function ft(e) {
138
- return M(this, null, function* () {
139
- var f, d;
140
- const { dataUrl: t, cacheKey: a = "git_stats_cache", useStaleCache: i = !0 } = e;
137
+ function mt(e) {
138
+ return O(this, null, function* () {
139
+ var m, u;
140
+ const { dataUrl: t, cacheKey: s = "git_stats_cache", useStaleCache: i = !0 } = e;
141
141
  try {
142
- const o = yield fetch(t);
143
- if (o.ok) {
144
- const u = yield o.json();
142
+ const n = yield fetch(t);
143
+ if (n.ok) {
144
+ const d = yield n.json();
145
145
  return typeof window != "undefined" && localStorage.setItem(
146
- a,
147
- JSON.stringify(Y(R({}, u), {
146
+ s,
147
+ JSON.stringify(W(Y({}, d), {
148
148
  cachedAt: Date.now()
149
149
  }))
150
150
  ), {
151
- data: u,
151
+ data: d,
152
152
  error: null,
153
153
  source: "static",
154
- isDummy: ((f = u.metadata) == null ? void 0 : f.isDummy) === !0
154
+ isDummy: ((m = d.metadata) == null ? void 0 : m.isDummy) === !0
155
155
  };
156
156
  }
157
- } catch (o) {
158
- console.warn("Failed to fetch from static file:", o);
157
+ } catch (n) {
158
+ console.warn("Failed to fetch from static file:", n);
159
159
  }
160
160
  if (i && typeof window != "undefined")
161
161
  try {
162
- const o = localStorage.getItem(a);
163
- if (o) {
164
- const u = JSON.parse(o);
162
+ const n = localStorage.getItem(s);
163
+ if (n) {
164
+ const d = JSON.parse(n);
165
165
  return {
166
- data: u,
166
+ data: d,
167
167
  error: null,
168
168
  source: "cache",
169
- isDummy: ((d = u.metadata) == null ? void 0 : d.isDummy) === !0
169
+ isDummy: ((u = d.metadata) == null ? void 0 : u.isDummy) === !0
170
170
  };
171
171
  }
172
- } catch (o) {
173
- console.warn("Failed to load from cache:", o);
172
+ } catch (n) {
173
+ console.warn("Failed to load from cache:", n);
174
174
  }
175
175
  return {
176
176
  data: yt(),
@@ -180,28 +180,28 @@ function ft(e) {
180
180
  };
181
181
  });
182
182
  }
183
- function mt(e) {
184
- const t = new Date(e), a = /* @__PURE__ */ new Date(), i = Math.floor((a.getTime() - t.getTime()) / (1e3 * 60 * 60));
183
+ function ft(e) {
184
+ const t = new Date(e), s = /* @__PURE__ */ new Date(), i = Math.floor((s.getTime() - t.getTime()) / (1e3 * 60 * 60));
185
185
  if (i < 1) return "just now";
186
186
  if (i < 24) return `${i} hours ago`;
187
187
  const l = Math.floor(i / 24);
188
188
  return l === 1 ? "yesterday" : l < 7 ? `${l} days ago` : t.toLocaleDateString("en-US", {
189
189
  month: "short",
190
190
  day: "numeric",
191
- year: t.getFullYear() !== a.getFullYear() ? "numeric" : void 0
191
+ year: t.getFullYear() !== s.getFullYear() ? "numeric" : void 0
192
192
  });
193
193
  }
194
- function me(e) {
194
+ function ye(e) {
195
195
  return e === 0 ? 0 : e <= 3 ? 1 : e <= 6 ? 2 : e <= 9 ? 3 : 4;
196
196
  }
197
197
  function vt(e) {
198
198
  if (e.length === 0) return 0;
199
199
  const t = {};
200
- return e.forEach((a) => {
201
- var d;
202
- const i = a.endDate ? new Date(a.endDate) : /* @__PURE__ */ new Date(), l = new Date(a.startDate), f = (i.getTime() - l.getTime()) / (1e3 * 60 * 60 * 24 * 365.25);
203
- (d = a.skills) == null || d.forEach((o) => {
204
- t[o] || (t[o] = 0), t[o] += f;
200
+ return e.forEach((s) => {
201
+ var u;
202
+ const i = s.endDate ? new Date(s.endDate) : /* @__PURE__ */ new Date(), l = new Date(s.startDate), m = (i.getTime() - l.getTime()) / (1e3 * 60 * 60 * 24 * 365.25);
203
+ (u = s.skills) == null || u.forEach((n) => {
204
+ t[n] || (t[n] = 0), t[n] += m;
205
205
  });
206
206
  }), Math.max(...Object.values(t), 0);
207
207
  }
@@ -229,38 +229,38 @@ function yt() {
229
229
  }
230
230
  };
231
231
  }
232
- function K(e = {}) {
232
+ function z(e = {}) {
233
233
  const {
234
234
  dataUrl: t = "/data/git-stats.json",
235
- cacheTTL: a = 24 * 60 * 60 * 1e3,
235
+ cacheTTL: s = 24 * 60 * 60 * 1e3,
236
236
  useStaleCache: i = !0,
237
237
  cacheKey: l = "git_stats_cache"
238
- } = e, f = S(!1), d = S(null), o = S(null), u = S(null), b = S(!1);
239
- function m() {
240
- return M(this, null, function* () {
241
- f.value = !0, d.value = null;
238
+ } = e, m = S(!1), u = S(null), n = S(null), d = S(null), p = S(!1);
239
+ function f() {
240
+ return O(this, null, function* () {
241
+ m.value = !0, u.value = null;
242
242
  try {
243
- const g = yield ft({
243
+ const b = yield mt({
244
244
  dataUrl: t,
245
- cacheTTL: a,
245
+ cacheTTL: s,
246
246
  cacheKey: l,
247
247
  useStaleCache: i
248
248
  });
249
- return o.value = g.data, d.value = g.error, u.value = g.source, b.value = g.isDummy, g.data;
250
- } catch (g) {
251
- return d.value = g instanceof Error ? g : new Error("Failed to load data"), null;
249
+ return n.value = b.data, u.value = b.error, d.value = b.source, p.value = b.isDummy, b.data;
250
+ } catch (b) {
251
+ return u.value = b instanceof Error ? b : new Error("Failed to load data"), null;
252
252
  } finally {
253
- f.value = !1;
253
+ m.value = !1;
254
254
  }
255
255
  });
256
256
  }
257
- const c = I(() => {
258
- var g;
259
- return (g = o.value) != null && g.lastUpdated ? mt(o.value.lastUpdated) : "";
260
- }), _ = I(() => {
261
- if (b.value)
257
+ const c = E(() => {
258
+ var b;
259
+ return (b = n.value) != null && b.lastUpdated ? ft(n.value.lastUpdated) : "";
260
+ }), _ = E(() => {
261
+ if (p.value)
262
262
  return "⚠️ Using dummy data for testing";
263
- switch (u.value) {
263
+ switch (d.value) {
264
264
  case "static":
265
265
  return "Real-time data";
266
266
  case "cache":
@@ -271,15 +271,15 @@ function K(e = {}) {
271
271
  return "";
272
272
  }
273
273
  });
274
- return m(), {
275
- data: o,
276
- loading: f,
277
- error: d,
278
- dataSource: u,
274
+ return f(), {
275
+ data: n,
276
+ loading: m,
277
+ error: u,
278
+ dataSource: d,
279
279
  dataSourceText: _,
280
280
  lastUpdatedText: c,
281
- isDummy: b,
282
- loadData: m
281
+ isDummy: p,
282
+ loadData: f
283
283
  };
284
284
  }
285
285
  const ht = { class: "git-contribution-graph" }, pt = { class: "graph-header" }, gt = { class: "header-info" }, bt = { class: "contribution-count" }, _t = {
@@ -297,7 +297,7 @@ const ht = { class: "git-contribution-graph" }, pt = { class: "graph-header" },
297
297
  }, Ct = { class: "graph-content-wrapper" }, $t = { class: "months-row" }, Tt = { class: "months-container" }, jt = { class: "grid-container" }, Lt = { class: "contribution-grid" }, Ut = ["title", "onClick"], xt = { class: "graph-footer" }, Ft = {
298
298
  key: 0,
299
299
  class: "last-updated"
300
- }, It = /* @__PURE__ */ q({
300
+ }, It = { class: "legend" }, Et = { class: "legend-squares" }, Nt = /* @__PURE__ */ J({
301
301
  __name: "ContributionGraph",
302
302
  props: {
303
303
  dataUrl: { default: "/data/git-stats.json" },
@@ -308,204 +308,224 @@ const ht = { class: "git-contribution-graph" }, pt = { class: "graph-header" },
308
308
  },
309
309
  emits: ["day-click", "color-scheme-change"],
310
310
  setup(e, { emit: t }) {
311
- const a = e, i = t, { data: l, loading: f, dataSourceText: d, lastUpdatedText: o, isDummy: u } = K(
311
+ const s = e, i = t, { data: l, loading: m, dataSourceText: u, lastUpdatedText: n, isDummy: d } = z(
312
312
  {
313
- dataUrl: a.dataUrl,
314
- cacheTTL: a.cacheTTL
313
+ dataUrl: s.dataUrl,
314
+ cacheTTL: s.cacheTTL
315
315
  }
316
- ), b = S(a.colorScheme), m = S(!1), c = ["green", "blue", "purple", "orange"], _ = S([]), g = S([]);
317
- z(
316
+ ), p = S(s.colorScheme), f = S(!1), c = ["green", "blue", "purple", "orange"], _ = S([]), b = S([]);
317
+ q(
318
318
  l,
319
- (s) => {
320
- var n, v, p;
321
- if ((p = (v = (n = s == null ? void 0 : s.profiles) == null ? void 0 : n[a.profileIndex]) == null ? void 0 : v.stats) != null && p.contributions) {
322
- const w = s.profiles[a.profileIndex].stats.contributions;
323
- w && (_.value = B(w), Q());
319
+ (o) => {
320
+ var r, v, g;
321
+ if ((g = (v = (r = o == null ? void 0 : o.profiles) == null ? void 0 : r[s.profileIndex]) == null ? void 0 : v.stats) != null && g.contributions) {
322
+ const w = o.profiles[s.profileIndex].stats.contributions;
323
+ w && (_.value = G(w), H());
324
324
  } else
325
325
  _.value = [];
326
326
  },
327
327
  { immediate: !0 }
328
328
  );
329
- const T = I(() => !_.value || _.value.length === 0 ? 0 : _.value.reduce((s, n) => !n.days || !Array.isArray(n.days) ? s : s + n.days.reduce((v, p) => v + (p.count || 0), 0), 0));
330
- function B(s) {
331
- if (!s || !Array.isArray(s))
329
+ const j = E(() => !_.value || _.value.length === 0 ? 0 : _.value.reduce((o, r) => !r.days || !Array.isArray(r.days) ? o : o + r.days.reduce((v, g) => v + (g.count || 0), 0), 0));
330
+ function G(o) {
331
+ if (!o || !Array.isArray(o))
332
332
  return $();
333
- const n = s.map((v) => ({
333
+ const r = o.map((v) => ({
334
334
  weekStart: v.firstDay || "",
335
- days: v.contributionDays.map((p) => {
335
+ days: v.contributionDays.map((g) => {
336
336
  var w;
337
337
  return {
338
- date: p.date || "",
339
- count: (w = p.contributionCount) != null ? w : 0,
340
- weekday: p.weekday || 0
338
+ date: g.date || "",
339
+ count: (w = g.contributionCount) != null ? w : 0,
340
+ weekday: g.weekday || 0
341
341
  };
342
342
  })
343
343
  }));
344
- for (; n.length < 53; )
345
- n.push(U());
346
- return n;
344
+ for (; r.length < 53; )
345
+ r.push(x());
346
+ return r;
347
347
  }
348
348
  function $() {
349
- const s = [];
350
- for (let n = 0; n < 53; n++)
351
- s.push(U());
352
- return s;
349
+ const o = [];
350
+ for (let r = 0; r < 53; r++)
351
+ o.push(x());
352
+ return o;
353
353
  }
354
- function U() {
355
- const s = [];
356
- for (let n = 0; n < 7; n++)
357
- s.push({ date: "", count: 0, weekday: n });
358
- return { weekStart: "", days: s };
354
+ function x() {
355
+ const o = [];
356
+ for (let r = 0; r < 7; r++)
357
+ o.push({ date: "", count: 0, weekday: r });
358
+ return { weekStart: "", days: o };
359
359
  }
360
- function Q() {
360
+ function H() {
361
361
  if (!_.value || _.value.length === 0) {
362
- g.value = [];
362
+ b.value = [];
363
363
  return;
364
364
  }
365
- const s = [];
366
- let n = -1, v = -1;
367
- _.value.forEach((p, w) => {
368
- if (!p.days || p.days.length === 0) return;
369
- const E = p.days[0].date;
370
- if (!E) return;
371
- const N = E.split("-");
372
- if (N.length !== 3) return;
373
- const [x, F] = N.map(Number);
374
- if (!(isNaN(x) || isNaN(F)) && (F !== n || x !== v)) {
375
- const ot = new Date(x, F - 1, 1);
376
- s.push({
365
+ const o = [];
366
+ let r = -1, v = -1;
367
+ _.value.forEach((g, w) => {
368
+ if (!g.days || g.days.length === 0) return;
369
+ const N = g.days[0].date;
370
+ if (!N) return;
371
+ const M = N.split("-");
372
+ if (M.length !== 3) return;
373
+ const [F, I] = M.map(Number);
374
+ if (!(isNaN(F) || isNaN(I)) && (I !== r || F !== v)) {
375
+ const at = new Date(F, I - 1, 1);
376
+ o.push({
377
377
  week: w,
378
- month: F - 1,
379
- year: x,
380
- label: ot.toLocaleDateString("en-US", { month: "short" })
381
- }), n = F, v = x;
378
+ month: I - 1,
379
+ year: F,
380
+ label: at.toLocaleDateString("en-US", { month: "short" })
381
+ }), r = I, v = F;
382
382
  }
383
- }), g.value = s;
383
+ }), b.value = o;
384
384
  }
385
- function X(s) {
386
- return `level-${Z(s)} ${b.value}`;
385
+ function Q(o) {
386
+ return `level-${X(o)} ${p.value}`;
387
387
  }
388
- function Z(s) {
389
- return s === 0 ? 0 : s <= 3 ? 1 : s <= 6 ? 2 : s <= 9 ? 3 : 4;
388
+ function X(o) {
389
+ return o === 0 ? 0 : o <= 3 ? 1 : o <= 6 ? 2 : o <= 9 ? 3 : 4;
390
390
  }
391
- function tt(s) {
392
- if (!s.date) return "";
393
- const [n, v, p] = s.date.split("-").map(Number), E = new Date(n, v - 1, p).toLocaleDateString("en-US", {
391
+ function Z(o) {
392
+ if (!o.date) return "";
393
+ const [r, v, g] = o.date.split("-").map(Number), N = new Date(r, v - 1, g).toLocaleDateString("en-US", {
394
394
  weekday: "short",
395
395
  year: "numeric",
396
396
  month: "short",
397
397
  day: "numeric"
398
- }), N = s.count === 1 ? "contribution" : "contributions";
399
- return `${s.count} ${N} on ${E}`;
398
+ }), M = o.count === 1 ? "contribution" : "contributions";
399
+ return `${o.count} ${M} on ${N}`;
400
400
  }
401
- function et(s) {
402
- i("day-click", { date: s.date, count: s.count });
401
+ function tt(o) {
402
+ i("day-click", { date: o.date, count: o.count });
403
403
  }
404
- function at() {
405
- m.value = !m.value;
404
+ function et() {
405
+ f.value = !f.value;
406
406
  }
407
- function st(s) {
408
- b.value = s, m.value = !1, i("color-scheme-change", s);
407
+ function st(o) {
408
+ p.value = o, f.value = !1, i("color-scheme-change", o);
409
409
  }
410
- return (s, n) => (h(), y("div", ht, [
411
- r("div", pt, [
412
- r("div", gt, [
413
- r("h5", bt, D(T.value.toLocaleString()) + " contributions in the last year ", 1),
414
- r("small", {
415
- class: W(["data-source-text", { "is-dummy": k(u) }])
416
- }, D(k(d)), 3)
410
+ return (o, r) => (h(), y("div", ht, [
411
+ a("div", pt, [
412
+ a("div", gt, [
413
+ a("h5", bt, D(j.value.toLocaleString()) + " contributions in the last year ", 1),
414
+ a("small", {
415
+ class: T(["data-source-text", { "is-dummy": k(d) }])
416
+ }, D(k(u)), 3)
417
417
  ]),
418
418
  e.showSettings ? (h(), y("div", _t, [
419
- r("button", {
419
+ a("button", {
420
420
  class: "settings-btn",
421
421
  type: "button",
422
- onClick: at
422
+ onClick: et
423
423
  }, [
424
- j(s.$slots, "settings-icon", {}, () => [
425
- n[0] || (n[0] = C("⚙️", -1))
424
+ L(o.$slots, "settings-icon", {}, () => [
425
+ r[0] || (r[0] = C("⚙️", -1))
426
426
  ], !0),
427
- n[1] || (n[1] = C(" Settings ", -1))
427
+ r[1] || (r[1] = C(" Settings ", -1))
428
428
  ]),
429
- m.value ? (h(), y("div", kt, [
430
- (h(), y(O, null, A(c, (v) => r("button", {
429
+ f.value ? (h(), y("div", kt, [
430
+ (h(), y(A, null, B(c, (v) => a("button", {
431
431
  key: v,
432
- onClick: (p) => st(v),
432
+ onClick: (g) => st(v),
433
433
  class: "settings-item"
434
434
  }, D(v) + " theme ", 9, Dt)), 64))
435
- ])) : L("", !0)
436
- ])) : L("", !0)
435
+ ])) : U("", !0)
436
+ ])) : U("", !0)
437
437
  ]),
438
- k(f) ? (h(), y("div", St, [...n[2] || (n[2] = [
439
- r("div", { class: "spinner" }, null, -1),
440
- r("span", null, "Loading contributions...", -1)
438
+ k(m) ? (h(), y("div", St, [...r[2] || (r[2] = [
439
+ a("div", { class: "spinner" }, null, -1),
440
+ a("span", null, "Loading contributions...", -1)
441
441
  ])])) : (h(), y("div", wt, [
442
- r("div", Ct, [
443
- r("div", $t, [
444
- n[3] || (n[3] = r("div", { class: "month-spacer" }, null, -1)),
445
- r("div", Tt, [
446
- (h(!0), y(O, null, A(g.value, (v) => (h(), y("div", {
442
+ a("div", Ct, [
443
+ a("div", $t, [
444
+ r[3] || (r[3] = a("div", { class: "month-spacer" }, null, -1)),
445
+ a("div", Tt, [
446
+ (h(!0), y(A, null, B(b.value, (v) => (h(), y("div", {
447
447
  key: `${v.year}-${v.month}`,
448
448
  class: "month-label",
449
- style: dt({
449
+ style: ct({
450
450
  gridColumn: `${v.week + 1} / span 1`
451
451
  })
452
452
  }, D(v.label), 5))), 128))
453
453
  ])
454
454
  ]),
455
- r("div", jt, [
456
- n[4] || (n[4] = J('<div class="day-labels" data-v-f1ff100d><div class="day-label" data-v-f1ff100d>Mon</div><div class="day-label" data-v-f1ff100d></div><div class="day-label" data-v-f1ff100d>Wed</div><div class="day-label" data-v-f1ff100d></div><div class="day-label" data-v-f1ff100d>Fri</div><div class="day-label" data-v-f1ff100d></div><div class="day-label" data-v-f1ff100d></div></div>', 1)),
457
- r("div", Lt, [
458
- (h(!0), y(O, null, A(_.value, (v) => (h(), y("div", {
455
+ a("div", jt, [
456
+ r[4] || (r[4] = ut('<div class="day-labels" data-v-3d412399><div class="day-label" data-v-3d412399>Mon</div><div class="day-label" data-v-3d412399></div><div class="day-label" data-v-3d412399>Wed</div><div class="day-label" data-v-3d412399></div><div class="day-label" data-v-3d412399>Fri</div><div class="day-label" data-v-3d412399></div><div class="day-label" data-v-3d412399></div></div>', 1)),
457
+ a("div", Lt, [
458
+ (h(!0), y(A, null, B(_.value, (v) => (h(), y("div", {
459
459
  key: v.weekStart,
460
460
  class: "contribution-week"
461
461
  }, [
462
- (h(!0), y(O, null, A(v.days, (p) => (h(), y("div", {
463
- key: p.date,
464
- class: W(["contribution-day", X(p.count)]),
465
- title: tt(p),
466
- onClick: (w) => et(p)
462
+ (h(!0), y(A, null, B(v.days, (g) => (h(), y("div", {
463
+ key: g.date,
464
+ class: T(["contribution-day", Q(g.count)]),
465
+ title: Z(g),
466
+ onClick: (w) => tt(g)
467
467
  }, null, 10, Ut))), 128))
468
468
  ]))), 128))
469
469
  ])
470
470
  ])
471
471
  ]),
472
- r("div", xt, [
473
- k(o) ? (h(), y("small", Ft, " Last updated: " + D(k(o)), 1)) : L("", !0),
474
- n[5] || (n[5] = J('<div class="legend" data-v-f1ff100d><small class="legend-label" data-v-f1ff100d>Less</small><div class="legend-squares" data-v-f1ff100d><div class="contribution-day level-0" data-v-f1ff100d></div><div class="contribution-day level-1" data-v-f1ff100d></div><div class="contribution-day level-2" data-v-f1ff100d></div><div class="contribution-day level-3" data-v-f1ff100d></div><div class="contribution-day level-4" data-v-f1ff100d></div></div><small class="legend-label" data-v-f1ff100d>More</small></div>', 1))
472
+ a("div", xt, [
473
+ k(n) ? (h(), y("small", Ft, " Last updated: " + D(k(n)), 1)) : U("", !0),
474
+ a("div", It, [
475
+ r[5] || (r[5] = a("small", { class: "legend-label" }, "Less", -1)),
476
+ a("div", Et, [
477
+ a("div", {
478
+ class: T(p.value + " contribution-day level-0")
479
+ }, null, 2),
480
+ a("div", {
481
+ class: T(p.value + " contribution-day level-1")
482
+ }, null, 2),
483
+ a("div", {
484
+ class: T(p.value + " contribution-day level-2")
485
+ }, null, 2),
486
+ a("div", {
487
+ class: T(p.value + " contribution-day level-3")
488
+ }, null, 2),
489
+ a("div", {
490
+ class: T(p.value + " contribution-day level-4")
491
+ }, null, 2)
492
+ ]),
493
+ r[6] || (r[6] = a("small", { class: "legend-label" }, "More", -1))
494
+ ])
475
495
  ])
476
496
  ]))
477
497
  ]));
478
498
  }
479
- }), H = (e, t) => {
480
- const a = e.__vccOpts || e;
499
+ }), K = (e, t) => {
500
+ const s = e.__vccOpts || e;
481
501
  for (const [i, l] of t)
482
- a[i] = l;
483
- return a;
484
- }, Et = /* @__PURE__ */ H(It, [["__scopeId", "data-v-f1ff100d"]]), Nt = { class: "git-stats-breakdown" }, Mt = { class: "stats-grid" }, Ot = { class: "stat-card" }, At = { class: "stat-icon" }, Bt = { class: "stat-content" }, Gt = { class: "stat-value" }, Pt = { class: "stat-card" }, Vt = { class: "stat-icon" }, Rt = { class: "stat-content" }, Yt = {
502
+ s[i] = l;
503
+ return s;
504
+ }, Mt = /* @__PURE__ */ K(Nt, [["__scopeId", "data-v-3d412399"]]), Ot = { class: "git-stats-breakdown" }, At = { class: "stats-grid" }, Bt = { class: "stat-card" }, Gt = { class: "stat-icon" }, Pt = { class: "stat-content" }, Vt = { class: "stat-value" }, Rt = { class: "stat-card" }, Yt = { class: "stat-icon" }, Wt = { class: "stat-content" }, Jt = {
485
505
  key: 0,
486
506
  class: "stat-loading"
487
- }, Wt = {
507
+ }, qt = {
488
508
  key: 1,
489
509
  class: "stat-value"
490
- }, Jt = { class: "stat-card" }, qt = { class: "stat-icon" }, zt = { class: "stat-content" }, Kt = {
510
+ }, zt = { class: "stat-card" }, Kt = { class: "stat-icon" }, Ht = { class: "stat-content" }, Qt = {
491
511
  key: 0,
492
512
  class: "stat-loading"
493
- }, Ht = {
513
+ }, Xt = {
494
514
  key: 1,
495
515
  class: "stat-value"
496
- }, Qt = {
516
+ }, Zt = {
497
517
  key: 0,
498
518
  class: "stat-card"
499
- }, Xt = { class: "stat-icon" }, Zt = { class: "stat-content" }, te = {
519
+ }, te = { class: "stat-icon" }, ee = { class: "stat-content" }, se = {
500
520
  key: 0,
501
521
  class: "stat-loading"
502
- }, ee = {
522
+ }, ae = {
503
523
  key: 1,
504
524
  class: "stat-value"
505
- }, ae = { class: "stat-label" }, se = { class: "stats-footer" }, oe = {
525
+ }, oe = { class: "stat-label" }, ne = { class: "stats-footer" }, re = {
506
526
  key: 0,
507
527
  class: "data-source"
508
- }, ne = { key: 0 }, re = /* @__PURE__ */ q({
528
+ }, ie = { key: 0 }, le = /* @__PURE__ */ J({
509
529
  __name: "StatsBreakdown",
510
530
  props: {
511
531
  dataUrl: { default: "/data/git-stats.json" },
@@ -516,121 +536,121 @@ const ht = { class: "git-contribution-graph" }, pt = { class: "graph-header" },
516
536
  cacheTTL: { default: 24 * 60 * 60 * 1e3 }
517
537
  },
518
538
  setup(e) {
519
- const t = e, { data: a, loading: i, dataSourceText: l, lastUpdatedText: f } = K({
539
+ const t = e, { data: s, loading: i, dataSourceText: l, lastUpdatedText: m } = z({
520
540
  dataUrl: t.dataUrl,
521
541
  cacheTTL: t.cacheTTL
522
- }), d = S(0), o = S(0);
523
- z(
524
- a,
525
- (m) => {
542
+ }), u = S(0), n = S(0);
543
+ q(
544
+ s,
545
+ (f) => {
526
546
  var c, _;
527
- if (m)
547
+ if (f)
528
548
  if (t.profileIndexes.length > 0) {
529
- let g = 0, T = 0;
530
- t.profileIndexes.forEach((B) => {
531
- var U;
532
- const $ = (U = m.profiles) == null ? void 0 : U[B];
533
- $ != null && $.stats && (g += $.stats.projectCount || 0, T += $.stats.commitCount || 0);
534
- }), d.value = g, o.value = T;
549
+ let b = 0, j = 0;
550
+ t.profileIndexes.forEach((G) => {
551
+ var x;
552
+ const $ = (x = f.profiles) == null ? void 0 : x[G];
553
+ $ != null && $.stats && (b += $.stats.projectCount || 0, j += $.stats.commitCount || 0);
554
+ }), u.value = b, n.value = j;
535
555
  } else
536
- d.value = ((c = m.totals) == null ? void 0 : c.projectCount) || 0, o.value = ((_ = m.totals) == null ? void 0 : _.commitCount) || 0;
556
+ u.value = ((c = f.totals) == null ? void 0 : c.projectCount) || 0, n.value = ((_ = f.totals) == null ? void 0 : _.commitCount) || 0;
537
557
  },
538
558
  { immediate: !0 }
539
559
  );
540
- const u = I(() => vt(t.experienceData).toFixed(1)), b = I(() => {
560
+ const d = E(() => vt(t.experienceData).toFixed(1)), p = E(() => {
541
561
  if (t.customStatCalculator) {
542
- const T = {
543
- projects: d.value,
544
- commits: o.value,
545
- years: parseFloat(u.value)
562
+ const j = {
563
+ projects: u.value,
564
+ commits: n.value,
565
+ years: parseFloat(d.value)
546
566
  };
547
- return t.customStatCalculator(T);
567
+ return t.customStatCalculator(j);
548
568
  }
549
- return (d.value * 1.5 + o.value * 1.2 + parseFloat(u.value) * 1.5).toFixed(2);
569
+ return (u.value * 1.5 + n.value * 1.2 + parseFloat(d.value) * 1.5).toFixed(2);
550
570
  });
551
- return (m, c) => (h(), y("div", Nt, [
552
- r("div", Mt, [
553
- r("div", Ot, [
554
- r("div", At, [
555
- j(m.$slots, "icon-experience", {}, () => [
571
+ return (f, c) => (h(), y("div", Ot, [
572
+ a("div", At, [
573
+ a("div", Bt, [
574
+ a("div", Gt, [
575
+ L(f.$slots, "icon-experience", {}, () => [
556
576
  c[0] || (c[0] = C("⏱️", -1))
557
577
  ], !0)
558
578
  ]),
559
- r("div", Bt, [
560
- r("div", Gt, D(u.value), 1),
561
- c[1] || (c[1] = r("div", { class: "stat-label" }, "Years Experience", -1))
579
+ a("div", Pt, [
580
+ a("div", Vt, D(d.value), 1),
581
+ c[1] || (c[1] = a("div", { class: "stat-label" }, "Years Experience", -1))
562
582
  ])
563
583
  ]),
564
- r("div", Pt, [
565
- r("div", Vt, [
566
- j(m.$slots, "icon-projects", {}, () => [
584
+ a("div", Rt, [
585
+ a("div", Yt, [
586
+ L(f.$slots, "icon-projects", {}, () => [
567
587
  c[2] || (c[2] = C("📦", -1))
568
588
  ], !0)
569
589
  ]),
570
- r("div", Rt, [
571
- k(i) ? (h(), y("div", Yt, [...c[3] || (c[3] = [
572
- r("div", { class: "spinner" }, null, -1)
573
- ])])) : (h(), y("div", Wt, D(d.value), 1)),
574
- c[4] || (c[4] = r("div", { class: "stat-label" }, "Projects", -1))
590
+ a("div", Wt, [
591
+ k(i) ? (h(), y("div", Jt, [...c[3] || (c[3] = [
592
+ a("div", { class: "spinner" }, null, -1)
593
+ ])])) : (h(), y("div", qt, D(u.value), 1)),
594
+ c[4] || (c[4] = a("div", { class: "stat-label" }, "Projects", -1))
575
595
  ])
576
596
  ]),
577
- r("div", Jt, [
578
- r("div", qt, [
579
- j(m.$slots, "icon-commits", {}, () => [
597
+ a("div", zt, [
598
+ a("div", Kt, [
599
+ L(f.$slots, "icon-commits", {}, () => [
580
600
  c[5] || (c[5] = C("💻", -1))
581
601
  ], !0)
582
602
  ]),
583
- r("div", zt, [
584
- k(i) ? (h(), y("div", Kt, [...c[6] || (c[6] = [
585
- r("div", { class: "spinner" }, null, -1)
586
- ])])) : (h(), y("div", Ht, D(o.value), 1)),
587
- c[7] || (c[7] = r("div", { class: "stat-label" }, "Commits", -1))
603
+ a("div", Ht, [
604
+ k(i) ? (h(), y("div", Qt, [...c[6] || (c[6] = [
605
+ a("div", { class: "spinner" }, null, -1)
606
+ ])])) : (h(), y("div", Xt, D(n.value), 1)),
607
+ c[7] || (c[7] = a("div", { class: "stat-label" }, "Commits", -1))
588
608
  ])
589
609
  ]),
590
- e.showCustomStat ? (h(), y("div", Qt, [
591
- r("div", Xt, [
592
- j(m.$slots, "icon-custom", {}, () => [
610
+ e.showCustomStat ? (h(), y("div", Zt, [
611
+ a("div", te, [
612
+ L(f.$slots, "icon-custom", {}, () => [
593
613
  c[8] || (c[8] = C("☕", -1))
594
614
  ], !0)
595
615
  ]),
596
- r("div", Zt, [
597
- k(i) ? (h(), y("div", te, [...c[9] || (c[9] = [
598
- r("div", { class: "spinner" }, null, -1)
599
- ])])) : (h(), y("div", ee, D(b.value), 1)),
600
- r("div", ae, [
601
- j(m.$slots, "custom-stat-label", {}, () => [
616
+ a("div", ee, [
617
+ k(i) ? (h(), y("div", se, [...c[9] || (c[9] = [
618
+ a("div", { class: "spinner" }, null, -1)
619
+ ])])) : (h(), y("div", ae, D(p.value), 1)),
620
+ a("div", oe, [
621
+ L(f.$slots, "custom-stat-label", {}, () => [
602
622
  c[10] || (c[10] = C("Coffee Consumed", -1))
603
623
  ], !0)
604
624
  ])
605
625
  ])
606
- ])) : L("", !0)
626
+ ])) : U("", !0)
607
627
  ]),
608
- r("div", se, [
609
- k(l) ? (h(), y("small", oe, [
628
+ a("div", ne, [
629
+ k(l) ? (h(), y("small", re, [
610
630
  C(D(k(l)) + " ", 1),
611
- k(f) ? (h(), y("span", ne, " · " + D(k(f)), 1)) : L("", !0)
612
- ])) : L("", !0)
631
+ k(m) ? (h(), y("span", ie, " · " + D(k(m)), 1)) : U("", !0)
632
+ ])) : U("", !0)
613
633
  ])
614
634
  ]));
615
635
  }
616
- }), ie = /* @__PURE__ */ H(re, [["__scopeId", "data-v-97689125"]]), ve = {
636
+ }), ce = /* @__PURE__ */ K(le, [["__scopeId", "data-v-31f1bb7a"]]), he = {
617
637
  install(e) {
618
- e.component("ContributionGraph", Et), e.component("StatsBreakdown", ie);
638
+ e.component("ContributionGraph", Mt), e.component("StatsBreakdown", ce);
619
639
  }
620
640
  };
621
641
  export {
622
- Et as ContributionGraph,
623
- ie as StatsBreakdown,
642
+ Mt as ContributionGraph,
643
+ ce as StatsBreakdown,
624
644
  vt as calculateYearsExperience,
625
- ve as default,
626
- ft as fetchGitStats,
627
- de as fetchGitStatsAPI,
628
- mt as formatLastUpdated,
629
- ut as generateDummyContributions,
630
- G as generateDummyStats,
631
- ue as generateMultiProfileDummyStats,
632
- me as getContributionLevel,
633
- fe as saveDummyDataToFile,
634
- K as useGitStats
645
+ he as default,
646
+ mt as fetchGitStats,
647
+ me as fetchGitStatsAPI,
648
+ ft as formatLastUpdated,
649
+ dt as generateDummyContributions,
650
+ P as generateDummyStats,
651
+ fe as generateMultiProfileDummyStats,
652
+ ye as getContributionLevel,
653
+ ve as saveDummyDataToFile,
654
+ z as useGitStats
635
655
  };
636
656
  //# sourceMappingURL=vue.es.js.map