-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
2718 lines (2484 loc) · 126 KB
/
Copy pathscript.js
File metadata and controls
2718 lines (2484 loc) · 126 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
const STORAGE_KEY = "ai-job-dashboard-state-v3";
const CUSTOM_JOBS_KEY = "ai-job-dashboard-custom-jobs-v1";
let companies = [];
let topTargets = null;
let hiringSignals = [];
let outreachTargets = [];
let managerQueue = [];
let sourceHealth = [];
let storybrandAnalysis = [];
let firecrawlStatus = [];
let outreachDrafts = [];
let actionsToday = [];
let workspaceFileHandle = null;
let workspaceAutosaveTimer = null;
let lastSavedAt = null;
let isTodayMode = true;
let customJobs = [];
let manualJobEditIndex = null;
let selectedJobKey = "";
let currentView = "overview";
const HOSTED_DASHBOARD_URL = "https://tonybeal40.github.io/pythonjobs-/";
const BOARD_STATUSES = ["not-started", "researching", "applied", "outreach", "interview"];
const MASTER_RESUME_PROFILE = {
phone: "618-292-5320",
email: "tonybeal40@gmail.com",
location: "Greater St. Louis Area",
headline: "Revenue Operations | Sales Operations | GTM Systems | Business Development",
linkedin_url: "linkedin.com/in/tony-beal40",
linkedin_headline: "Revenue Operations & Business Development Leader | Pipeline Generation | Strategic Accounts | Enterprise Deal Execution | B2B Manufacturing",
linkedin_metrics: "10,769 followers | 500+ connections",
summary: "Business development leader and revenue systems operator with 15+ years driving growth across industrial and B2B markets. Strongest in outbound prospecting, pipeline development, CRM workflow design, and AI-assisted commercial systems that improve pipeline visibility and execution.",
wins: [
"Built more than $6M in outbound pipeline through targeted prospecting, segmentation, and repeatable outbound systems design.",
"Generated 3,700+ new accounts and acquired 1,000+ customers through disciplined outreach and territory strategy.",
"Improved commercial execution with CRM workflows, KPI reporting, StoryBrand messaging, and AI-assisted prospect intelligence."
],
experience: [
"Director of Business Development | ProForm Manufacturing | Built $6M+ outbound pipeline and opened new vertical markets.",
"Revenue Operations & Commercial Development | Natoli Engineering | Improved account targeting, outreach structure, and pipeline visibility.",
"Regional Sales Manager | BioGaia USA | Built 3,700+ accounts and led a team exceeding goals for 8 consecutive years.",
"Sales Manager | Wicks Aircraft & Motorsports | Generated 1,000+ new customers through targeted prospecting.",
"Account Manager | KeHE Distributors | Managed multi-region accounts and grew revenue through expansion strategy."
],
tools: [
"Apollo.io",
"LinkedIn Sales Navigator",
"HubSpot",
"Salesforce",
"Monday.com",
"CRM workflow automation",
"Analytics dashboards",
"AI-assisted prospecting"
]
};
function initialsForCompany(company) {
const parts = String(company || "").replace(/[^A-Za-z0-9 ]/g, " ").split(/\s+/).filter(Boolean);
return parts.slice(0, 2).map((part) => part[0]?.toUpperCase() || "").join("") || "CO";
}
function brandTheme(company) {
const name = String(company || "");
let hash = 0;
for (let index = 0; index < name.length; index += 1) {
hash = name.charCodeAt(index) + ((hash << 5) - hash);
}
const hue = Math.abs(hash) % 360;
const accent = `hsl(${hue} 86% 66%)`;
const accentSoft = `hsla(${hue} 88% 68% / 0.18)`;
const accentWarm = `hsl(${(hue + 42) % 360} 78% 70%)`;
return `--brand-accent:${accent};--brand-soft:${accentSoft};--brand-warm:${accentWarm};`;
}
function hostFromUrl(url) {
if (!url) return "";
try {
return new URL(url).hostname.replace(/^www\./, "");
} catch (error) {
return "";
}
}
function sourceLabelFromUrl(url) {
const host = hostFromUrl(url);
if (!host) return "Direct";
if (host.includes("linkedin")) return "LinkedIn";
if (host.includes("greenhouse")) return "Greenhouse";
if (host.includes("lever")) return "Lever";
if (host.includes("wellfound")) return "Wellfound";
if (host.includes("indeed")) return "Indeed";
return host;
}
function faviconUrl(url) {
const host = hostFromUrl(url);
if (!host) return "";
return `https://www.google.com/s2/favicons?domain=${encodeURIComponent(host)}&sz=128`;
}
function logoMarkup(company, url, small = false) {
const initials = safeText(initialsForCompany(company));
const favicon = faviconUrl(url);
const smallClass = small ? " brand-mark-small" : "";
return `
<span class="brand-mark${smallClass}">
${favicon ? `<img src="${safeText(favicon)}" alt="" loading="lazy" onerror="this.style.display='none'; this.nextElementSibling.style.display='inline-flex';">` : ""}
<span class="brand-mark-fallback"${favicon ? ' style="display:none"' : ""}>${initials}</span>
</span>
`;
}
function companyKey(item) {
return item?.name || item?.company || "";
}
function jobKey(job) {
return `${job?.company || ""}::${job?.title || ""}`;
}
function getSelectedJob() {
const jobs = topTargets?.topJobs || [];
if (!jobs.length) return null;
return jobs.find((job) => jobKey(job) === selectedJobKey) || jobs[0];
}
function getScopedJobs(limit = 4) {
const selected = getSelectedJob();
if (selected) return [selected];
return (topTargets?.topJobs || []).slice(0, limit);
}
function toLinkedInSearchUrl(label) {
return `https://www.linkedin.com/search/results/all/?keywords=${encodeURIComponent(label)}`;
}
function toCompanyLinkedInUrl(company) {
return toLinkedInSearchUrl(`${company} company`);
}
function toPeopleLinkedInUrl(company, title = "VP Revenue Operations") {
return `https://www.linkedin.com/search/results/people/?keywords=${encodeURIComponent(`${title} ${company}`)}`;
}
function findStorybrand(company) {
return storybrandAnalysis.find((item) => item.company === company) || null;
}
function findManager(company) {
return managerQueue.find((item) => item.company === company) || null;
}
function findTopJobForCompany(company) {
return (topTargets?.topJobs || []).find((item) => item.company === company) || null;
}
function setCompanyStatus(companyName, status) {
const company = companies.find((item) => companyKey(item) === companyName);
if (!company) return;
company.status = status;
persistNotes();
renderAll();
}
function getSavedCompanies() {
return companies
.filter((company) => Boolean(company.saved))
.sort((left, right) => {
const leftScore = Number(left.score || 0);
const rightScore = Number(right.score || 0);
return rightScore - leftScore || companyKey(left).localeCompare(companyKey(right));
});
}
function safeText(value) {
const text = value ?? "";
return String(text)
.replaceAll("&", "&")
.replaceAll("<", "<")
.replaceAll(">", ">")
.replaceAll('"', """);
}
function labelForStatus(status) {
const labels = {
"not-started": "Not Started",
researching: "Researching",
applied: "Applied",
outreach: "Outreach Sent",
interview: "Interview"
};
return labels[status] || status || "Not Started";
}
function statusClass(status) {
return `status-${status || "not-started"}`;
}
function formatTable(containerId, rows, columns) {
const container = document.getElementById(containerId);
if (!rows || rows.length === 0) {
container.innerHTML = '<p class="muted">No data available yet.</p>';
return;
}
let html = "<table><thead><tr>";
columns.forEach((column) => {
html += `<th>${safeText(column.label)}</th>`;
});
html += "</tr></thead><tbody>";
rows.forEach((row) => {
html += "<tr>";
columns.forEach((column) => {
const value = typeof column.render === "function" ? column.render(row) : row[column.key];
html += `<td>${value ?? ""}</td>`;
});
html += "</tr>";
});
html += "</tbody></table>";
container.innerHTML = html;
}
function loadSavedNotes() {
const raw = localStorage.getItem(STORAGE_KEY);
return raw ? JSON.parse(raw) : {};
}
function loadCustomJobs() {
const raw = localStorage.getItem(CUSTOM_JOBS_KEY);
return raw ? JSON.parse(raw) : [];
}
function persistCustomJobs() {
localStorage.setItem(CUSTOM_JOBS_KEY, JSON.stringify(customJobs));
}
function mergeCustomJobsIntoTopTargets() {
if (!topTargets) {
topTargets = { topJobs: [], topCompanies: [] };
}
const seen = new Set();
topTargets.topJobs = [...customJobs, ...(topTargets.topJobs || [])].filter((job) => {
const key = `${job.company || ""}::${job.title || ""}`;
if (seen.has(key)) return false;
seen.add(key);
return true;
});
}
function buildStateSnapshot() {
const snapshot = {};
companies.forEach((company) => {
snapshot[companyKey(company)] = {
notes: company.notes || "",
status: company.status || "not-started",
saved: Boolean(company.saved)
};
});
return snapshot;
}
function buildWorkspacePayload() {
return {
exportedAt: new Date().toISOString(),
customJobs,
selectedJobKey,
currentView,
companies: companies.map((company) => ({
...company,
key: companyKey(company)
})),
state: buildStateSnapshot()
};
}
async function saveWorkspaceToHandle(handle) {
const writable = await handle.createWritable();
await writable.write(JSON.stringify(buildWorkspacePayload(), null, 2));
await writable.close();
}
function applyWorkspacePayload(payload) {
const importedCompanies = Array.isArray(payload?.companies) ? payload.companies : [];
const importedState = payload?.state || {};
if (Array.isArray(payload?.customJobs)) {
customJobs = payload.customJobs;
persistCustomJobs();
}
if (typeof payload?.selectedJobKey === "string") {
selectedJobKey = payload.selectedJobKey;
}
if (typeof payload?.currentView === "string") {
currentView = payload.currentView;
}
if (importedCompanies.length) {
const stateByKey = new Map(
importedCompanies.map((company) => [company.key || companyKey(company), company])
);
companies = companies.map((company) => {
const match = stateByKey.get(companyKey(company));
return match ? { ...company, ...match } : company;
});
}
companies = companies.map((company) => {
const state = importedState[companyKey(company)];
return state ? { ...company, ...state } : company;
});
persistNotes();
renderAll();
}
function formatSavedTime(value) {
if (!value) return "";
try {
return new Date(value).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });
} catch (error) {
return "";
}
}
function renderWorkspaceState() {
const badge = document.getElementById("stateStatus");
const focusButton = document.getElementById("focusModeBtn");
if (badge) {
const parts = [];
parts.push(workspaceFileHandle ? "Workspace linked" : "Local state only");
if (lastSavedAt) {
parts.push(`Saved ${formatSavedTime(lastSavedAt)}`);
}
badge.textContent = parts.join(" | ");
badge.classList.toggle("is-linked", Boolean(workspaceFileHandle));
}
if (focusButton) {
focusButton.textContent = isTodayMode ? "Show Full View" : "Today Mode";
}
document.body.classList.toggle("today-mode", isTodayMode);
document.body.dataset.view = currentView;
}
function renderViewTabs() {
const tabs = Array.from(document.querySelectorAll(".view-tab"));
tabs.forEach((tab) => {
tab.classList.toggle("is-active", tab.dataset.view === currentView);
});
}
function scheduleWorkspaceAutosave() {
if (!workspaceFileHandle) return;
clearTimeout(workspaceAutosaveTimer);
const badge = document.getElementById("stateStatus");
badge?.classList.add("is-saving");
workspaceAutosaveTimer = window.setTimeout(async () => {
try {
await saveWorkspaceToHandle(workspaceFileHandle);
lastSavedAt = new Date().toISOString();
} catch (error) {
// Local storage remains the baseline fallback.
} finally {
badge?.classList.remove("is-saving");
renderWorkspaceState();
}
}, 700);
}
function persistNotes() {
localStorage.setItem(STORAGE_KEY, JSON.stringify(buildStateSnapshot()));
lastSavedAt = new Date().toISOString();
renderWorkspaceState();
scheduleWorkspaceAutosave();
}
function applySavedNotes() {
const saved = loadSavedNotes();
companies = companies.map((company) => {
const item = saved[companyKey(company)];
return item ? { ...company, ...item } : company;
});
}
function updateSummary() {
const applied = companies.filter((company) => company.status === "applied").length;
const interviews = companies.filter((company) => company.status === "interview").length;
const activeTargets = companies.filter((company) => company.saved || company.status !== "not-started" || company.notes).length;
const setCount = (id, value) => {
const node = document.getElementById(id);
if (node) node.textContent = String(value);
};
setCount("topJobsCount", (topTargets?.topJobs || []).length);
setCount("activeTargetsCount", activeTargets);
setCount("outreachTargetsCount", outreachTargets.length);
setCount("appliedCount", applied);
setCount("interviewCount", interviews);
setCount("savedCount", companies.filter((c) => Boolean(c.saved)).length);
}
function getSummaryCounts() {
return {
applied: companies.filter((company) => company.status === "applied").length,
interviews: companies.filter((company) => company.status === "interview").length,
outreach: companies.filter((company) => company.status === "outreach").length,
saved: companies.filter((company) => Boolean(company.saved)).length,
activeTargets: companies.filter((company) => company.saved || company.status !== "not-started" || company.notes).length,
topJobs: (topTargets?.topJobs || []).length,
manualJobs: customJobs.length
};
}
function renderActionDeck() {
const container = document.getElementById("actionDeck");
const bestJob = (topTargets?.topJobs || [])[0];
const bestSignal = hiringSignals[0];
const bestGap = storybrandAnalysis[0];
const bestFirecrawl = firecrawlStatus.find((item) => item.status === "ok");
const cards = [
{
label: "Best Role Today",
title: bestJob ? `${bestJob.company} | ${bestJob.title}` : "No top role yet",
body: bestJob ? `Score ${bestJob.score}. ${bestJob.top_win || "Use the recommended resume angle before applying."}` : "Run the morning pipeline to surface the best-fit job."
},
{
label: "Best Early Signal",
title: bestSignal ? `${bestSignal.company} | score ${bestSignal.signal_score}` : "No signal yet",
body: bestSignal ? `${(bestSignal.signals || []).join(", ")}. ${bestSignal.recommended_action || ""}` : "No hiring-signal output is available yet."
},
{
label: "Best Messaging Gap",
title: bestGap ? `${bestGap.company} | ${bestGap.score_label}` : "No website scan yet",
body: bestGap ? bestGap.messaging_gap : "StoryBrand analysis will appear after the company intelligence pass runs."
},
{
label: "Latest Firecrawl Layer",
title: bestFirecrawl ? `${bestFirecrawl.company} captured` : "No Firecrawl page yet",
body: bestFirecrawl ? "Public company page captured to markdown and ready for messaging analysis." : "Run the Firecrawl fetcher to add richer page extracts."
}
];
container.innerHTML = cards.map((card) => `
<article class="focus-card reveal-card">
<span class="focus-label">${safeText(card.label)}</span>
<strong>${safeText(card.title)}</strong>
<p>${safeText(card.body)}</p>
</article>
`).join("");
}
function renderJobJumpStrip() {
const container = document.getElementById("jobJumpStrip");
if (!container) return;
const jobs = (topTargets?.topJobs || []).slice(0, 5);
if (!jobs.length) {
container.innerHTML = "";
return;
}
container.innerHTML = jobs.map((job) => {
const persisted = companies.find((item) => companyKey(item) === job.company) || {};
const selected = jobKey(job) === selectedJobKey || (!selectedJobKey && job === jobs[0]);
return `
<article class="job-jump-btn${selected ? " is-selected" : ""}" style="${brandTheme(job.company)}">
<div class="job-jump-top">
<div>
<span class="focus-label">Top Role</span>
<strong class="job-jump-title">${safeText(job.company)} | ${safeText(job.title)}</strong>
</div>
<span class="mini-chip">${safeText(job.score ?? "")}</span>
</div>
<div class="job-jump-meta">
${job.location ? `<span>${safeText(job.location)}</span>` : ""}
${job.salary_text ? `<span>${safeText(job.salary_text)}</span>` : ""}
<span>${safeText(job.recency_label || "Active")}</span>
</div>
<div class="job-jump-actions">
${job.url ? `<a class="primary-btn" href="${safeText(job.url)}" target="_blank" rel="noreferrer">Open Job</a>` : `<a class="primary-btn" href="#assetsSection">Open Assets</a>`}
<button class="ghost-btn select-job-btn" type="button" data-company="${safeText(job.company)}" data-title="${safeText(job.title)}">${selected ? "Selected" : "Focus Job"}</button>
<button class="ghost-btn export-resume-mode-btn" type="button" data-company="${safeText(job.company)}" data-title="${safeText(job.title)}" data-mode="full-tailored-pdf">Full Resume</button>
<button class="ghost-btn export-application-packet-btn" type="button" data-company="${safeText(job.company)}" data-title="${safeText(job.title)}">Build Packet</button>
<button class="ghost-btn quick-status-btn" type="button" data-company="${safeText(job.company)}" data-status="applied">Mark Applied</button>
</div>
<textarea class="shortcut-note-input" data-company="${safeText(job.company)}" placeholder="Quick note for ${safeText(job.company)}...">${safeText(persisted.notes || "")}</textarea>
</article>
`;
}).join("");
container.querySelectorAll(".shortcut-note-input").forEach((area) => {
area.addEventListener("input", (event) => {
const company = companies.find((item) => companyKey(item) === event.target.dataset.company);
if (!company) return;
company.notes = event.target.value;
persistNotes();
});
});
}
function renderSelectedJobBanner() {
const container = document.getElementById("selectedJobBanner");
if (!container) return;
const job = getSelectedJob();
if (!job) {
container.classList.remove("is-active");
container.innerHTML = "";
return;
}
const company = companies.find((item) => companyKey(item) === job.company) || {};
const story = findStorybrand(job.company) || {};
container.classList.add("is-active");
container.innerHTML = `
<div>
<p class="section-kicker">Selected Target</p>
<h3>${safeText(job.company)} | ${safeText(job.title)}</h3>
<p>${safeText(job.location || "Remote / location not specified")} ${job.salary_text ? `| ${safeText(job.salary_text)}` : ""} | ${safeText(story.messaging_gap || company.revops_maturity_gap || "Use the assets below to tailor your application around this target.")}</p>
</div>
<div class="selected-job-actions">
${job.url ? `<a class="primary-btn" href="${safeText(job.url)}" target="_blank" rel="noreferrer">Open Job</a>` : ""}
<button class="ghost-btn export-resume-mode-btn" type="button" data-company="${safeText(job.company)}" data-title="${safeText(job.title)}" data-mode="best-resume-pdf">Best Resume</button>
<button class="ghost-btn export-application-packet-btn" type="button" data-company="${safeText(job.company)}" data-title="${safeText(job.title)}">Complete Packet</button>
<button class="ghost-btn clear-selected-job-btn" type="button">Show Top Set</button>
</div>
`;
}
function renderWorkflowHint() {
const container = document.getElementById("workflowHint");
if (!container) return;
const message = workspaceFileHandle
? "Today Mode is on by default. Work the top role, save your updates, then use Quick Save Workspace before moving to another machine. You can also add a manual job below anytime."
: "Today Mode is on by default. Start with the top role, then save a workspace file once so your laptop workflow stays in sync. You can also paste jobs into chat and I can fold them into the system.";
container.innerHTML = `
<article class="workflow-hint-card">
<strong>Recommended daily flow</strong>
<p>${safeText(message)}</p>
</article>
`;
}
function renderWhyThisWins() {
const container = document.getElementById("whyThisWins");
if (!container) return;
container.innerHTML = `
<p class="section-kicker">Why This Wins</p>
<h3>This is not a faster apply bot. It is a personal hiring radar.</h3>
<p>Most tools help candidates apply faster. This system is built to help you target companies earlier, position yourself better, and move like an operator instead of a passive applicant.</p>
<div class="story-points">
<div class="story-point">
<strong>Signals before postings</strong>
<span>Track sales-team expansion, GTM gaps, and company momentum before a RevOps role is obvious.</span>
</div>
<div class="story-point">
<strong>Application assets on demand</strong>
<span>Build the resume, cover letter, and full packet around the actual company and role context.</span>
</div>
<div class="story-point">
<strong>Career RevOps</strong>
<span>Treat your search like pipeline management: target, sequence, follow up, and move the right opportunities forward.</span>
</div>
</div>
`;
}
function renderScoreboardStrip() {
const container = document.getElementById("scoreboardStrip");
if (!container) return;
const counts = getSummaryCounts();
container.innerHTML = `
<p class="section-kicker">Scoreboard</p>
<h3>Keep the page tied to outcomes, not activity.</h3>
<p>The real scoreboard is interviews, replies, and active target movement. Use this to stay focused on what is converting.</p>
<div class="scoreboard-grid">
<div class="scoreboard-item"><strong>${counts.topJobs}</strong><span>Top jobs</span></div>
<div class="scoreboard-item"><strong>${counts.saved}</strong><span>Saved companies</span></div>
<div class="scoreboard-item"><strong>${counts.outreach}</strong><span>Outreach sent</span></div>
<div class="scoreboard-item"><strong>${counts.applied}</strong><span>Applications sent</span></div>
<div class="scoreboard-item"><strong>${counts.interviews}</strong><span>Interviews</span></div>
<div class="scoreboard-item"><strong>${counts.manualJobs}</strong><span>Manual jobs added</span></div>
</div>
`;
}
function renderHeroPreview() {
const container = document.getElementById("heroPreview");
if (!container) return;
const selected = getSelectedJob() || (topTargets?.topJobs || [])[0];
const company = selected ? (companies.find((item) => companyKey(item) === selected.company) || {}) : {};
const story = selected ? (findStorybrand(selected.company) || {}) : {};
container.innerHTML = `
<div class="hero-preview-card">
<span class="focus-label">Focused Target</span>
<strong>${safeText(selected ? `${selected.company} | ${selected.title}` : "No selected target yet")}</strong>
<p>${safeText(selected ? ((selected.resume_angle || [])[0] || "Use the selected-job workflow to build the application assets.") : "Choose a shortcut card to lock the asset area onto one job.")}</p>
</div>
<div class="hero-preview-card">
<span class="focus-label">StoryBrand Angle</span>
<strong>${safeText(selected ? (story.score_label || "Messaging review ready") : "Messaging angle")}</strong>
<p>${safeText(selected ? (story.messaging_gap || company.revops_maturity_gap || "Position yourself around execution clarity, GTM systems, and pipeline visibility.") : "Your narrative should connect company friction to the value you bring.")}</p>
</div>
`;
}
function renderManualJobsList() {
const container = document.getElementById("manualJobsList");
if (!container) return;
if (!customJobs.length) {
container.innerHTML = '<p class="muted">No manual jobs added yet.</p>';
return;
}
container.innerHTML = customJobs.map((job, index) => `
<div class="stack-item manual-job-item">
<div>
<strong>${safeText(job.company)} | ${safeText(job.title)}</strong>
<p>${safeText(job.location || "Location not added")} | ${safeText(job.salary_text || "Comp not added")}</p>
</div>
<div class="draft-actions">
${job.url ? `<a class="action-link" href="${safeText(job.url)}" target="_blank" rel="noreferrer">Open</a>` : ""}
<button class="ghost-btn move-manual-job-btn" type="button" data-index="${index}" data-direction="up">Up</button>
<button class="ghost-btn move-manual-job-btn" type="button" data-index="${index}" data-direction="down">Down</button>
<button class="ghost-btn edit-manual-job-btn" type="button" data-index="${index}">Edit</button>
<button class="ghost-btn remove-manual-job-btn" type="button" data-index="${index}">Remove</button>
</div>
</div>
`).join("");
}
function renderActionsToday() {
const container = document.getElementById("actionsToday");
if (!actionsToday.length) {
container.innerHTML = '<p class="muted">No actions generated yet.</p>';
return;
}
container.innerHTML = actionsToday.slice(0, 4).map((action) => `
<article class="focus-card reveal-card">
<span class="focus-label">${safeText(action.type || "action")}</span>
<strong>${safeText(action.headline || "")}</strong>
<p>${safeText(action.details || "")}</p>
</article>
`).join("");
}
function renderTodayCommandRail() {
const container = document.getElementById("todayCommandRail");
if (!container) return;
const topJob = (topTargets?.topJobs || [])[0];
const topCompany = (topTargets?.topCompanies || [])[0];
const topDraft = outreachDrafts[0];
const topManager = topCompany ? (findManager(topCompany.company) || {}) : {};
const items = [
{
kicker: "Apply First",
title: topJob ? `${topJob.company} | ${topJob.title}` : "No top role",
body: topJob ? `Best source: ${sourceLabelFromUrl(topJob.url)}. Resume angle: ${(topJob.resume_angle || [])[0] || "Lead with systems and pipeline visibility."}` : "Run the pipeline to surface the highest-fit role.",
actions: topJob ? `
${topJob.url ? `<a class="primary-btn" href="${safeText(topJob.url)}" target="_blank" rel="noreferrer">Open Job</a>` : ""}
<button class="ghost-btn export-resume-mode-btn" type="button" data-company="${safeText(topJob.company)}" data-title="${safeText(topJob.title)}" data-mode="best-resume-pdf">Best Resume</button>
<button class="ghost-btn export-application-packet-btn" type="button" data-company="${safeText(topJob.company)}" data-title="${safeText(topJob.title)}">Build Packet</button>
<button class="ghost-btn quick-status-btn" type="button" data-company="${safeText(topJob.company)}" data-status="applied">Mark Applied</button>
` : ""
},
{
kicker: "Target Now",
title: topCompany ? topCompany.company : "No top company",
body: topCompany ? `${topCompany.hiring_signal || ""} ${topCompany.revops_maturity_gap || ""}` : "No company priority available yet.",
actions: topCompany ? `
${topCompany.website ? `<a class="primary-btn" href="${safeText(topCompany.website)}" target="_blank" rel="noreferrer">Open Site</a>` : ""}
<a class="ghost-btn" href="${safeText(toCompanyLinkedInUrl(topCompany.company))}" target="_blank" rel="noreferrer">LinkedIn</a>
<button class="ghost-btn save-company-btn" type="button" data-company="${safeText(topCompany.company)}">${companies.find((item) => companyKey(item) === topCompany.company)?.saved ? "Unsave" : "Save Company"}</button>
` : ""
},
{
kicker: "Send Next",
title: topDraft ? topDraft.company : "No outreach draft",
body: topDraft ? topDraft.outreach_angle || topDraft.subject || "" : "No outreach recommendation available yet.",
actions: topDraft ? `
<button class="ghost-btn copy-btn" type="button" data-copy="${safeText(topDraft.outreach_angle || topDraft.subject || "")}" data-label="Copy Angle">Copy Angle</button>
<a class="ghost-btn" href="${safeText(topManager.manual_search_url || toPeopleLinkedInUrl(topDraft.company, topManager.probable_hiring_manager || "VP Revenue Operations"))}" target="_blank" rel="noreferrer">Find Manager</a>
<button class="ghost-btn quick-status-btn" type="button" data-company="${safeText(topDraft.company)}" data-status="outreach">Mark Outreach</button>
` : ""
}
];
container.innerHTML = items.map((item) => `
<article class="today-card reveal-card">
<span class="focus-label">${safeText(item.kicker)}</span>
<strong>${safeText(item.title)}</strong>
<p>${safeText(item.body)}</p>
${item.actions ? `<div class="action-drawer">${item.actions}</div>` : ""}
</article>
`).join("");
}
function buildManualJobRecord(input) {
return {
company: input.company,
title: input.title,
url: input.url || "",
location: input.location || "Manual entry",
salary_text: input.salary || "",
source_label: "Manual",
recency_label: "Added manually",
trend_label: "New",
source_confidence: "high",
score: 95,
top_win: "Manual priority target added directly to the dashboard.",
resume_angle: [
"Lead with revenue systems, outbound execution, and pipeline visibility.",
"Tie your background directly to this role's operational and commercial outcomes."
]
};
}
function resetManualJobForm() {
manualJobEditIndex = null;
const editIndexInput = document.getElementById("manualJobEditIndex");
const addButton = document.getElementById("addManualJobBtn");
const cancelButton = document.getElementById("cancelManualJobEditBtn");
if (editIndexInput) editIndexInput.value = "";
if (addButton) addButton.textContent = "Add Job";
if (cancelButton) cancelButton.hidden = true;
["manualJobCompany", "manualJobTitle", "manualJobUrl", "manualJobLocation", "manualJobSalary"].forEach((id) => {
const input = document.getElementById(id);
if (input) input.value = "";
});
}
function startManualJobEdit(index) {
const job = customJobs[index];
if (!job) return;
manualJobEditIndex = index;
const editIndexInput = document.getElementById("manualJobEditIndex");
const addButton = document.getElementById("addManualJobBtn");
const cancelButton = document.getElementById("cancelManualJobEditBtn");
if (editIndexInput) editIndexInput.value = String(index);
if (addButton) addButton.textContent = "Update Job";
if (cancelButton) cancelButton.hidden = false;
const fields = {
manualJobCompany: job.company || "",
manualJobTitle: job.title || "",
manualJobUrl: job.url || "",
manualJobLocation: job.location === "Manual entry" ? "" : (job.location || ""),
manualJobSalary: job.salary_text || ""
};
Object.entries(fields).forEach(([id, value]) => {
const input = document.getElementById(id);
if (input) input.value = value;
});
document.getElementById("manualJobCompany")?.focus();
}
function renderSpotlightCards() {
const container = document.getElementById("spotlightCards");
const companiesToShow = (topTargets?.topCompanies || []).slice(0, 4);
if (!companiesToShow.length) {
container.innerHTML = '<p class="muted">No spotlight companies available yet.</p>';
return;
}
container.innerHTML = companiesToShow.map((company) => {
const story = findStorybrand(company.company) || {};
const manager = findManager(company.company) || {};
const signal = hiringSignals.find((item) => companyKey(item.company) === company.company) || {};
const job = findTopJobForCompany(company.company);
const linkedinUrl = toCompanyLinkedInUrl(company.company);
const peopleUrl = manager.manual_search_url || toPeopleLinkedInUrl(company.company);
const persisted = companies.find((item) => companyKey(item) === company.company) || company;
const statusValue = persisted.status || "not-started";
const saved = Boolean(persisted.saved);
const signalBreakdown = Object.entries(signal.signal_breakdown || {})
.filter(([, value]) => Number(value) > 0)
.sort((a, b) => Number(b[1]) - Number(a[1]))
.map(([label, value]) => `${label.replace(/_/g, " ")} +${value}`)
.join(" | ");
return `
<article class="spotlight-card reveal-card" style="${brandTheme(company.company)}">
<div class="spotlight-top">
${logoMarkup(company.company, company.website || persisted.website || "")}
<div style="flex:1">
<h3>${safeText(company.company || "")}</h3>
<p class="muted">${safeText(company.industry || "")}</p>
</div>
<span class="score-badge">${safeText(company.score ?? "")}</span>
</div>
<div class="spotlight-meta">
<span class="meta-pill">${safeText(company.hiring_signal || "No hiring signal")}</span>
<span class="meta-pill">${safeText(story.score_label || "No messaging score")}</span>
<span class="meta-pill">${safeText(sourceLabelFromUrl(company.website || ""))}</span>
${saved ? '<span class="saved-chip">Saved</span>' : ""}
</div>
${job ? `<div class="job-meta-row">
${job.location ? `<span class="mini-chip">${safeText(job.location)}</span>` : ""}
${job.salary_text ? `<span class="mini-chip">${safeText(job.salary_text)}</span>` : ""}
${job.recency_label ? `<span class="mini-chip">${safeText(job.recency_label)}</span>` : ""}
${job.source_label ? `<span class="mini-chip">${safeText(job.source_label)}</span>` : ""}
${job.trend_label ? `<span class="mini-chip">${safeText(job.trend_label)}</span>` : ""}
</div>` : ""}
<p>${safeText(company.revops_maturity_gap || "")}</p>
<p><strong>Messaging gap:</strong> ${safeText(story.messaging_gap || "Not available yet.")}</p>
<p><strong>Resume fix:</strong> ${safeText(company.notes || "")}</p>
${signalBreakdown ? `<p><strong>Signal breakdown:</strong> ${safeText(signalBreakdown)}</p>` : ""}
${job?.keyword_matches?.length ? `<div class="job-meta-row">
${job.keyword_matches.slice(0, 5).map((keyword) => `<span class="mini-chip keyword-chip">${safeText(keyword)}</span>`).join("")}
</div>` : ""}
<div class="link-row">
<a class="action-link" href="${safeText(company.website || "")}" target="_blank" rel="noreferrer">Website</a>
<a class="action-link" href="${safeText(linkedinUrl)}" target="_blank" rel="noreferrer">LinkedIn</a>
<a class="action-link" href="${safeText(peopleUrl)}" target="_blank" rel="noreferrer">Hiring Manager</a>
</div>
<div class="spotlight-controls">
<select class="status-select spotlight-status" data-company="${safeText(company.company || "")}">
<option value="not-started" ${statusValue === "not-started" ? "selected" : ""}>Not Started</option>
<option value="researching" ${statusValue === "researching" ? "selected" : ""}>Researching</option>
<option value="applied" ${statusValue === "applied" ? "selected" : ""}>Applied</option>
<option value="outreach" ${statusValue === "outreach" ? "selected" : ""}>Outreach Sent</option>
<option value="interview" ${statusValue === "interview" ? "selected" : ""}>Interview</option>
</select>
<button class="ghost-btn save-company-btn" type="button" data-company="${safeText(company.company || "")}">${saved ? "Unsave" : "Save Company"}</button>
<button class="ghost-btn jump-note-btn" type="button" data-company="${safeText(company.company || "")}">Jump to Notes</button>
</div>
<div class="quick-status-row">
<button class="ghost-btn quick-status-btn" type="button" data-company="${safeText(company.company || "")}" data-status="researching">Researching</button>
<button class="ghost-btn quick-status-btn" type="button" data-company="${safeText(company.company || "")}" data-status="applied">Applied</button>
<button class="ghost-btn quick-status-btn" type="button" data-company="${safeText(company.company || "")}" data-status="outreach">Outreach</button>
<button class="ghost-btn quick-status-btn" type="button" data-company="${safeText(company.company || "")}" data-status="interview">Interview</button>
</div>
<details class="detail-drawer">
<summary>Open Full Company Brief</summary>
<p><strong>RevOps maturity gap:</strong> ${safeText(company.revops_maturity_gap || "")}</p>
<p><strong>Site summary:</strong> ${safeText(story.site_summary || "Not available yet.")}</p>
<p><strong>Outreach angle:</strong> ${safeText(story.suggested_outreach_angle || "Not available yet.")}</p>
<p><strong>Manual manager target:</strong> ${safeText(manager.probable_hiring_manager || "Not available yet.")}</p>
<div class="draft-actions">
<button class="ghost-btn export-company-packet-btn" type="button" data-company="${safeText(company.company || "")}">Export Company Packet</button>
<button class="ghost-btn export-company-cover-btn" type="button" data-company="${safeText(company.company || "")}">Export Cover Letter</button>
</div>
</details>
</article>
`;
}).join("");
}
function renderOutreachDrafts() {
const container = document.getElementById("outreachDrafts");
if (!outreachDrafts.length) {
container.innerHTML = '<p class="muted">No outreach drafts available yet.</p>';
return;
}
container.innerHTML = outreachDrafts.slice(0, 6).map((draft) => `
<article class="draft-card">
<h3>${safeText(draft.company || "")}</h3>
<p class="draft-subject">${safeText(draft.subject || "")}</p>
<span class="draft-meta">${safeText(draft.target_title || "")}</span>
<pre>${safeText(draft.message || "")}</pre>
<div class="draft-actions">
<button class="ghost-btn copy-btn" type="button" data-copy="${safeText(draft.message || "")}" data-label="Copy Message">Copy Message</button>
<button class="ghost-btn copy-btn" type="button" data-copy="${safeText(draft.subject || "")}" data-label="Copy Subject">Copy Subject</button>
</div>
</article>
`).join("");
}
function renderResumeFixes() {
const container = document.getElementById("resumeFixes");
const jobs = topTargets?.topJobs || [];
if (!jobs.length) {
container.innerHTML = '<p class="muted">No resume fixes available yet.</p>';
return;
}
container.innerHTML = jobs.slice(0, 6).map((job) => {
const company = companies.find((item) => companyKey(item) === job.company) || {};
const story = findStorybrand(job.company) || {};
const fixes = [
(job.resume_angle || [])[0] || "Lead with your RevOps systems-builder positioning.",
company.revops_maturity_gap || "Tie your experience to pipeline visibility and process discipline.",
story.suggested_outreach_angle || "Sharpen the commercial outcome and buyer language."
];
return `
<article class="draft-card">
<h3>${safeText(job.company)} | ${safeText(job.title)}</h3>
<p class="draft-subject">Resume corrections for this target</p>
<span class="draft-meta">${safeText(job.resume_angle_key || "revops_salesops")}</span>
<pre>${safeText(`1. ${fixes[0]}\n2. ${fixes[1]}\n3. ${fixes[2]}\n4. Reinforce this proof point: ${job.top_win || ""}`)}</pre>
</article>
`;
}).join("");
}
function getVisibleCompanies() {
const search = document.getElementById("searchBox").value.trim().toLowerCase();
const statusFilter = document.getElementById("statusFilter").value;
const sortBy = document.getElementById("sortBy").value;
const filtered = companies.filter((company) => {
const haystack = [
companyKey(company),
company.description,
company.fit,
company.resumeAngle,
company.notes || "",
...(company.tags || [])
].join(" ").toLowerCase();
if (search && !haystack.includes(search)) return false;
if (statusFilter !== "all" && company.status !== statusFilter) return false;
return true;
});
filtered.sort((left, right) => {
if (sortBy === "score-desc") return Number(right.score || 0) - Number(left.score || 0);
if (sortBy === "name-asc") return companyKey(left).localeCompare(companyKey(right));
if (sortBy === "status") return left.status.localeCompare(right.status);
if (sortBy === "updated") return new Date(right.updatedAt || 0) - new Date(left.updatedAt || 0);
return 0;
});
return filtered;
}
function renderResumeAngles() {
const container = document.getElementById("resumeAngles");
const jobs = topTargets?.topJobs || [];
if (!jobs.length) {
container.innerHTML = '<p class="muted">No resume guidance yet.</p>';
return;
}
container.innerHTML = jobs.slice(0, 4).map((job) => `
<div class="stack-item">
<strong>${safeText(job.company)} | ${safeText(job.title)}</strong>
<span>${safeText((job.resume_angle || [])[0] || "No resume angle available.")}</span>
</div>
`).join("");
}
function renderSavedCompanies() {
const container = document.getElementById("savedCompanies");
if (!container) return;
const savedCompanies = getSavedCompanies();
if (!savedCompanies.length) {
container.innerHTML = '<p class="muted">Save companies from Spotlight to build a cleaner working list.</p>';
return;
}
container.innerHTML = savedCompanies.slice(0, 10).map((company) => {
const job = findTopJobForCompany(companyKey(company));
const story = findStorybrand(companyKey(company)) || {};
const manager = findManager(companyKey(company)) || {};
return `
<article class="saved-company-item reveal-card" style="${brandTheme(companyKey(company))}">
<div class="saved-company-head">
${logoMarkup(companyKey(company), company.website || "", true)}
<div>
<strong>${safeText(companyKey(company))}</strong>
</div>
</div>
<div class="saved-company-meta">
<span class="status-pill ${safeText(statusClass(company.status))}">${safeText(labelForStatus(company.status))}</span>
<span class="mini-chip">${safeText(company.industry || "Unknown industry")}</span>
${company.score ? `<span class="mini-chip">Score ${safeText(company.score)}</span>` : ""}
${job?.location ? `<span class="mini-chip">${safeText(job.location)}</span>` : ""}
</div>
<p class="small-copy">${safeText(company.notes || company.revops_maturity_gap || "No notes yet.")}</p>
<p class="small-copy"><strong>Best role:</strong> ${safeText(job ? `${job.title}` : "No linked role yet")}</p>
<p class="small-copy"><strong>Messaging gap:</strong> ${safeText(story.messaging_gap || "No messaging scan yet.")}</p>
<p class="small-copy"><strong>Likely manager:</strong> ${safeText(manager.probable_hiring_manager || "Manual review pending")}</p>
<div class="saved-company-links">
${company.website ? `<a class="action-link" href="${safeText(company.website)}" target="_blank" rel="noreferrer">Website</a>` : ""}
<a class="action-link" href="${safeText(toCompanyLinkedInUrl(companyKey(company)))}" target="_blank" rel="noreferrer">LinkedIn</a>
<button class="ghost-btn jump-note-btn" type="button" data-company="${safeText(companyKey(company))}">Notes</button>
</div>
<div class="quick-status-row">
<button class="ghost-btn quick-status-btn" type="button" data-company="${safeText(companyKey(company))}" data-status="researching">Research</button>
<button class="ghost-btn quick-status-btn" type="button" data-company="${safeText(companyKey(company))}" data-status="applied">Applied</button>
<button class="ghost-btn quick-status-btn" type="button" data-company="${safeText(companyKey(company))}" data-status="outreach">Outreach</button>
</div>
</article>
`;
}).join("");
}
function renderJobIntelligence() {
const container = document.getElementById("jobIntelligence");
if (!container) return;
const jobs = topTargets?.topJobs || [];
if (!jobs.length) {
container.innerHTML = '<p class="muted">No job intelligence available yet.</p>';
return;