Repository navigation
Expand file tree
/
Copy pathprotocol-summary.html
More file actions
1415 lines (1334 loc) · 85.3 KB
/
Copy pathprotocol-summary.html
File metadata and controls
1415 lines (1334 loc) · 85.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover">
<title>Your Protocol — Apex Protocol</title>
<meta name="description" content="Your full protocol: cycle length, titration, dosing schedule.">
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, max-age=0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<link rel="icon" href="assets/favicon.ico">
<link rel="apple-touch-icon" href="assets/favicon.ico">
<link href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&family=Barlow:wght@300;400;500;600&display=swap" rel="stylesheet">
<!-- SINGLE SOURCE OF TRUTH for peptide data — see /data/peptides.json -->
<script src="data/peptide-data.js"></script>
<script>
// Nuke any service worker / cached HTML so the latest renderer runs
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then(rs => rs.forEach(r => r.unregister()));
if (window.caches) caches.keys().then(ks => ks.forEach(k => caches.delete(k)));
}
</script>
<style>
:root {
--bg:#080c10; --panel:#0d1318; --panel2:#121a22; --border:#1a2d3a;
--accent:#00d4ff; --accent2:#00ff9d; --accent3:#ff6b35; --accent4:#a78bfa;
--warn:#fbbf24; --bad:#ef4444;
--text:#cbd5e1; --muted:#7a8d99; --white:#eaf4f8;
}
*{box-sizing:border-box;margin:0;padding:0;}
html,body{min-height:100%;}
body{
background:var(--bg);color:var(--text);font-family:'Barlow',sans-serif;
font-size:15px;line-height:1.6;min-height:100vh;overflow-x:hidden;
padding-top:env(safe-area-inset-top);
padding-bottom:env(safe-area-inset-bottom);
}
body::before{
content:'';position:fixed;inset:0;
background:radial-gradient(ellipse at 80% 0%, rgba(0,212,255,.06) 0%, transparent 55%),radial-gradient(ellipse at 10% 90%, rgba(0,255,157,.04) 0%, transparent 50%);
pointer-events:none;z-index:0;
}
.wrap{max-width:760px;margin:0 auto;padding:0 16px;position:relative;z-index:1;}
.top{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;position:sticky;top:0;z-index:50;background:rgba(8,12,16,.92);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);border-bottom:1px solid var(--border);margin:0 -16px;}
.brand{display:flex;align-items:center;gap:8px;text-decoration:none;}
.brand-mark{font-family:'Rajdhani',sans-serif;font-size:20px;font-weight:700;color:var(--accent2);letter-spacing:.16em;}
.brand-tag{font-family:'Share Tech Mono',monospace;font-size:9px;letter-spacing:.25em;color:var(--muted);text-transform:uppercase;border-left:1px solid var(--border);padding-left:8px;}
.back-btn{display:inline-flex;align-items:center;gap:6px;font-family:'Share Tech Mono',monospace;font-size:10px;letter-spacing:.22em;color:var(--muted);text-decoration:none;text-transform:uppercase;padding:8px 12px;border:1px solid var(--border);border-radius:6px;transition:all .15s;-webkit-tap-highlight-color:transparent;}
.back-btn:hover,.back-btn:active{color:var(--accent2);border-color:var(--accent2);}
.hero{padding:24px 0 12px;}
.hero-eyebrow{font-family:'Share Tech Mono',monospace;font-size:10px;letter-spacing:.25em;color:var(--accent);text-transform:uppercase;margin-bottom:6px;}
.hero h1{font-family:'Rajdhani',sans-serif;font-weight:700;font-size:clamp(26px,5vw,38px);line-height:1.05;letter-spacing:-.4px;color:var(--white);margin-bottom:8px;}
.hero h1 .hl{color:var(--accent2);}
.hero .sub{font-size:14px;color:var(--text);max-width:560px;line-height:1.5;}
.stepper{display:flex;align-items:center;gap:8px;padding:8px 0 18px;font-family:'Share Tech Mono',monospace;font-size:9px;letter-spacing:.18em;color:var(--muted);text-transform:uppercase;overflow-x:auto;white-space:nowrap;scrollbar-width:none;}
.stepper::-webkit-scrollbar{display:none;}
.step{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border:1px solid var(--border);border-radius:20px;flex-shrink:0;}
.step.done{color:var(--muted);}
.step.active{color:var(--accent2);border-color:var(--accent2);background:rgba(0,255,157,.08);}
.step .dot{width:6px;height:6px;border-radius:50%;background:currentColor;}
/* SUMMARY STATS BAR */
.summary{
display:grid;grid-template-columns:repeat(3,1fr);gap:8px;
background:var(--panel);border:1px solid var(--border);border-radius:12px;
padding:14px;margin-bottom:16px;
}
.sum-item{text-align:center;}
.sum-v{font-family:'Rajdhani',sans-serif;font-weight:700;font-size:22px;color:var(--accent2);line-height:1;}
.sum-l{font-family:'Share Tech Mono',monospace;font-size:9px;letter-spacing:.18em;color:var(--muted);text-transform:uppercase;margin-top:4px;}
/* PROTOCOL CARDS */
.proto-list{display:flex;flex-direction:column;gap:12px;padding-bottom:18px;}
.proto-card{
background:var(--panel);border:1px solid var(--border);border-radius:12px;
padding:18px;
}
.proto-card.titration{border-color:rgba(0,255,157,.3);}
.proto-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px;}
.proto-name{font-family:'Rajdhani',sans-serif;font-weight:700;font-size:18px;color:var(--white);letter-spacing:-.2px;line-height:1.1;}
.proto-mech{font-family:'Share Tech Mono',monospace;font-size:9px;letter-spacing:.18em;color:var(--muted);text-transform:uppercase;margin-top:2px;}
.proto-cycle-pill{font-family:'Share Tech Mono',monospace;font-size:9px;letter-spacing:.18em;color:var(--accent);background:rgba(0,212,255,.12);padding:5px 10px;border-radius:4px;text-transform:uppercase;font-weight:700;flex-shrink:0;white-space:nowrap;}
.proto-rows{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px;}
@media (max-width:480px){.proto-rows{grid-template-columns:1fr;}}
.proto-row{background:var(--panel2);border:1px solid var(--border);border-radius:8px;padding:10px 12px;}
.proto-r-label{font-family:'Share Tech Mono',monospace;font-size:9px;letter-spacing:.18em;color:var(--muted);text-transform:uppercase;margin-bottom:3px;}
.proto-r-value{font-family:'Rajdhani',sans-serif;font-weight:700;font-size:15px;color:var(--white);line-height:1.1;}
/* TITRATION TABLE */
.tit-table{
background:rgba(0,255,157,.04);border:1px solid rgba(0,255,157,.25);border-radius:8px;
padding:10px;margin-top:10px;
}
.tit-title{font-family:'Share Tech Mono',monospace;font-size:9px;letter-spacing:.2em;color:var(--accent2);text-transform:uppercase;margin-bottom:8px;font-weight:700;}
.tit-rows{display:flex;flex-direction:column;gap:6px;}
.tit-row{display:flex;justify-content:space-between;align-items:center;padding:6px 8px;background:var(--panel2);border-radius:5px;font-size:13px;}
.tit-week{font-family:'Share Tech Mono',monospace;font-size:11px;color:var(--muted);letter-spacing:.1em;font-weight:700;}
.tit-dose{font-family:'Rajdhani',sans-serif;font-weight:700;color:var(--white);font-size:14px;}
/* SPLIT DOSING TOGGLE */
.split-toggle{
display:flex;align-items:center;justify-content:space-between;gap:10px;
margin-top:10px;padding:10px 12px;
background:var(--panel2);border:1px solid var(--border);border-radius:8px;
cursor:pointer;transition:border-color .15s;
-webkit-tap-highlight-color:transparent;
}
.split-toggle:hover{border-color:var(--accent4);}
.split-toggle.on{border-color:var(--accent4);background:rgba(167,139,250,.08);}
.split-info{flex:1;min-width:0;}
.split-label{font-family:'Rajdhani',sans-serif;font-weight:700;font-size:14px;color:var(--white);letter-spacing:-.1px;display:flex;align-items:center;gap:6px;}
.split-sub{font-size:11px;color:var(--muted);margin-top:2px;line-height:1.3;}
.split-switch{
width:42px;height:24px;border-radius:14px;
background:var(--border);position:relative;flex-shrink:0;
transition:background .15s;
}
.split-switch::after{
content:'';position:absolute;top:2px;left:2px;
width:20px;height:20px;border-radius:50%;background:#cbd5e1;
transition:transform .2s cubic-bezier(.2,.8,.2,1);
}
.split-toggle.on .split-switch{background:var(--accent4);}
.split-toggle.on .split-switch::after{transform:translateX(18px);background:#fff;}
.split-research-note{
margin-top:8px;padding:8px 10px;background:rgba(251,191,36,.08);
border-left:3px solid var(--warn);border-radius:5px;
font-size:11px;color:var(--text);line-height:1.4;
}
.split-research-note strong{color:#fff;}
/* CYCLE-POSITION ASK (for titrating peptides) */
.cycle-ask{
margin-top:10px;padding:12px;
background:linear-gradient(135deg,rgba(0,212,255,.06),rgba(0,255,157,.02));
border:1px solid rgba(0,212,255,.3);border-radius:8px;
}
.cycle-ask-title{font-family:'Rajdhani',sans-serif;font-weight:700;font-size:14px;color:#fff;letter-spacing:-.1px;margin-bottom:8px;display:flex;align-items:center;gap:6px;}
.cycle-ask-title::before{content:'⚡';}
.cycle-ask-buttons{display:flex;gap:6px;margin-bottom:0;}
.cycle-ask-btn{
flex:1;padding:9px 10px;border-radius:6px;
font-family:'Rajdhani',sans-serif;font-weight:700;font-size:11px;letter-spacing:.06em;
background:var(--panel2);border:1px solid var(--border);color:var(--text);
cursor:pointer;transition:all .15s;text-transform:uppercase;
-webkit-tap-highlight-color:transparent;
}
.cycle-ask-btn:hover{border-color:var(--accent);}
.cycle-ask-btn.on{background:rgba(0,212,255,.15);border-color:var(--accent);color:var(--accent);}
.cycle-ask-fields{display:none;flex-direction:column;gap:8px;margin-top:10px;}
.cycle-ask-fields.show{display:flex;}
.cycle-ask-field-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
@media (max-width:480px){.cycle-ask-field-row{grid-template-columns:1fr;}}
.cycle-ask-field{
background:var(--panel2);border:1px solid var(--border);border-radius:6px;padding:8px 10px;
}
.cycle-ask-field label{
display:block;font-family:'Share Tech Mono',monospace;font-size:9px;
letter-spacing:.16em;color:var(--muted);text-transform:uppercase;margin-bottom:4px;
}
.cycle-ask-field select,.cycle-ask-field input{
width:100%;background:transparent;border:0;outline:0;
font-family:'Rajdhani',sans-serif;font-weight:700;font-size:14px;color:#fff;
appearance:none;-webkit-appearance:none;
}
.cycle-ask-field select{cursor:pointer;}
.cycle-ask-summary{
margin-top:8px;padding:8px 10px;background:rgba(0,255,157,.06);
border-left:3px solid var(--accent2);border-radius:5px;
font-size:11px;color:var(--text);line-height:1.4;
}
.cycle-ask-summary strong{color:#fff;}
.continue-bar{position:sticky;bottom:0;background:var(--bg);padding:14px 0 max(14px, env(safe-area-inset-bottom));border-top:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;gap:10px;}
.cb-summary{font-size:12px;color:var(--muted);}
.cb-summary strong{color:var(--accent2);font-weight:700;font-size:14px;}
.cb-btn{font-family:'Rajdhani',sans-serif;font-weight:700;font-size:14px;letter-spacing:.08em;text-transform:uppercase;padding:13px 22px;border-radius:8px;border:0;cursor:pointer;background:linear-gradient(135deg,#00ff9d,#10b981);color:#080c10;box-shadow:0 4px 14px rgba(0,255,157,.4);transition:transform .15s,box-shadow .15s;-webkit-tap-highlight-color:transparent;white-space:nowrap;}
.cb-btn:hover,.cb-btn:active{transform:translateY(-1px);box-shadow:0 6px 18px rgba(0,255,157,.55);}
.empty{text-align:center;padding:60px 20px;}
.empty-icon{font-size:56px;margin-bottom:16px;opacity:.6;}
.empty-title{font-family:'Rajdhani',sans-serif;font-weight:700;font-size:22px;color:var(--white);margin-bottom:8px;}
.empty-sub{font-size:13px;color:var(--text);margin-bottom:20px;}
.foot{padding:18px 0;display:flex;justify-content:center;align-items:center;font-family:'Share Tech Mono',monospace;font-size:9px;color:var(--muted);letter-spacing:.15em;text-align:center;border-top:1px solid var(--border);margin-top:18px;}
</style>
<link rel="stylesheet" href="assets/apex-ios.css">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Apex">
<meta name="theme-color" content="#080c10">
</head>
<body>
<div class="wrap">
<div class="top">
<a href="reconstitute.html" class="back-btn">← Back</a>
<a href="index.html" class="brand">
<span class="brand-mark">APEX</span>
<span class="brand-tag">Protocol</span>
</a>
<div style="width:60px;"></div>
</div>
<div class="hero">
<div class="hero-eyebrow">Step 3 of 3 · Final Review</div>
<h1>Your <span class="hl">protocol</span></h1>
<p class="sub">Cycle length, titration, dosing — all in one place. Hit "Start Tracking" to send it to your daily tracker.</p>
</div>
<div class="stepper">
<a href="index.html" class="step done" style="text-decoration:none;cursor:pointer;"><span class="dot"></span>Select</a>
<a href="reconstitute.html" class="step done" style="text-decoration:none;cursor:pointer;"><span class="dot"></span>Reconstitute</a>
<a href="protocol-summary.html" class="step active" style="text-decoration:none;cursor:pointer;"><span class="dot"></span>Protocol</a>
</div>
<div id="summary" class="summary" style="display:none;">
<div class="sum-item"><div class="sum-v" id="sum-peptides">0</div><div class="sum-l">Peptides</div></div>
<div class="sum-item"><div class="sum-v" id="sum-weeks">0</div><div class="sum-l">Avg Cycle (wks)</div></div>
<div class="sum-item"><div class="sum-v" id="sum-titrate">0</div><div class="sum-l">Need Titration</div></div>
</div>
<div id="proto-list" class="proto-list"></div>
<div id="empty-state" class="empty" style="display:none;">
<div class="empty-icon">📋</div>
<div class="empty-title">Heading to your tracker…</div>
<div class="empty-sub">No active selection — taking you straight to your daily protocol view.</div>
<a href="tracker-v2.html" class="cb-btn" style="display:inline-block;text-decoration:none;">Open My Tracker →</a>
</div>
<div class="continue-bar" id="continue-bar" style="display:none;">
<div class="cb-summary"><strong id="cb-count">0</strong> protocols ready</div>
<button class="cb-btn" id="continue-btn">+ Add To Stack</button>
</div>
<div class="foot">⚠ RESEARCH USE ONLY · NOT MEDICAL ADVICE</div>
</div>
<script>
(function(){
// PROTOCOL DATA: cycle length, dose default, frequency, titration schedule
const PROTO = {
'aod9604.html': { name:'AOD-9604', mech:'GH fragment lipolysis', cycleWks:12, dose:'300 mcg', freq:'daily, fasted AM' },
'5amino1mq.html': { name:'5-Amino-1MQ', mech:'NNMT inhibitor', cycleWks:12, dose:'1-2 mg', freq:'daily SubQ' },
'slu-pp-322.html': { name:'SLU-PP-332', mech:'ERRα agonist', cycleWks:8, dose:'500 mcg-1 mg', freq:'3-5x weekly SubQ' },
'retatrutide.html': { name:'Retatrutide', mech:'Triple G agonist', cycleWks:24, dose:'titrated', freq:'weekly',
titration:[{w:'Wk 1-4',d:'2 mg/wk'},{w:'Wk 5-8',d:'4 mg/wk'},{w:'Wk 9-12',d:'6 mg/wk'},{w:'Wk 13-16',d:'8 mg/wk'},{w:'Wk 17-20',d:'10 mg/wk'},{w:'Wk 21+',d:'12 mg/wk (max)'}] },
'semaglutide.html': { name:'Semaglutide', mech:'GLP-1 agonist', cycleWks:24, dose:'titrated', freq:'weekly',
titration:[{w:'Wk 1-4',d:'0.25 mg/wk'},{w:'Wk 5-8',d:'0.5 mg/wk'},{w:'Wk 9-12',d:'1.0 mg/wk'},{w:'Wk 13-16',d:'1.7 mg/wk'},{w:'Wk 17+',d:'2.4 mg/wk (max)'}] },
'tirzepatide.html': { name:'Tirzepatide', mech:'GLP-1 + GIP', cycleWks:24, dose:'titrated', freq:'weekly',
titration:[{w:'Wk 1-4',d:'2.5 mg/wk'},{w:'Wk 5-8',d:'5 mg/wk'},{w:'Wk 9-12',d:'7.5 mg/wk'},{w:'Wk 13-16',d:'10 mg/wk'},{w:'Wk 17-20',d:'12.5 mg/wk'},{w:'Wk 21+',d:'15 mg/wk (max)'}] },
'melanotan1.html': { name:'Melanotan I', mech:'MC1R agonist', cycleWks:8, dose:'500 mcg-1 mg', freq:'daily until tan, then 2x/wk' },
'melanotan2.html': { name:'Melanotan II', mech:'MC1-4R agonist', cycleWks:8, dose:'250-500 mcg', freq:'daily during loading, then 2x/wk' },
'pt141.html': { name:'PT-141', mech:'MC4R agonist', cycleWks:'as needed', dose:'1.75 mg', freq:'30-60 min pre-event' },
'ipamorelin.html': { name:'Ipamorelin', mech:'Ghrelin / GHS-R', cycleWks:12, dose:'200-300 mcg', freq:'2-3x daily, fasted' },
'cjc1295-dac.html': { name:'CJC-1295 DAC', mech:'GHRH analog (DAC)', cycleWks:12, dose:'1-2 mg', freq:'2x weekly' },
'cjc-no-dac.html': { name:'CJC-1295', mech:'GHRH analog', cycleWks:12, dose:'100 mcg', freq:'2-3x daily, fasted' },
'sermorelin.html': { name:'Sermorelin', mech:'GHRH analog', cycleWks:12, dose:'100-300 mcg', freq:'nightly, fasted' },
'tesamorelin.html': { name:'Tesamorelin', mech:'GHRH (visceral fat)', cycleWks:26, dose:'1-2 mg', freq:'daily SubQ' },
'cjc-ipa-blend.html':{ name:'CJC + Ipa Blend',mech:'GHRH + Ghrelin blend', cycleWks:12, dose:'200-300 mcg ea.', freq:'2-3x daily, fasted' },
'igf1-lr3.html': { name:'IGF-1 LR3', mech:'IGF-1 analog', cycleWks:4, dose:'30-50 mcg', freq:'daily, post-workout' },
'bpc157.html': { name:'BPC-157', mech:'Body protective compound', cycleWks:6, dose:'250-500 mcg', freq:'daily, near injury site' },
'tb500.html': { name:'TB-500', mech:'Thymosin Beta-4', cycleWks:6, dose:'2-2.5 mg', freq:'2x weekly (loading 4-6 wks)' },
'ghkcu.html': { name:'GHK-Cu', mech:'Copper tripeptide', cycleWks:8, dose:'1-3 mg', freq:'daily SubQ or topical' },
'kpv.html': { name:'KPV', mech:'Anti-inflammatory tripep.', cycleWks:6, dose:'250-500 mcg', freq:'daily' },
'll37.html': { name:'LL-37', mech:'Cathelicidin AMP', cycleWks:4, dose:'50-200 mcg', freq:'daily SubQ' },
'thymosin-alpha1.html':{ name:'Thymosin α1', mech:'Immune modulator', cycleWks:8, dose:'1.6 mg', freq:'2x weekly' },
'ara290.html': { name:'ARA-290', mech:'EPO derivative', cycleWks:4, dose:'4 mg', freq:'daily' },
'epitalon.html': { name:'Epitalon', mech:'Telomerase activator', cycleWks:'10 days pulsed', dose:'5-10 mg', freq:'daily x10 days, 2x/yr' },
'ss31.html': { name:'SS-31', mech:'Mitochondrial peptide', cycleWks:8, dose:'3-7 mg', freq:'daily SubQ' },
'motsc.html': { name:'MOTS-c', mech:'Mitokine / AMPK', cycleWks:8, dose:'5 mg', freq:'2-3x weekly' },
'cartalax.html': { name:'Cartalax', mech:'Bioregulator (cartilage)', cycleWks:'20-day pulsed', dose:'200 mcg', freq:'daily x20 days, 2x/yr' },
'fox04-dri.html': { name:'FOX04-DRI', mech:'Senolytic', cycleWks:'5 days pulsed', dose:'1-5 mg', freq:'5-day pulses, 1-2x/yr' },
'glutathione.html': { name:'Glutathione', mech:'Master antioxidant', cycleWks:12, dose:'200-600 mg', freq:'2-3x weekly' },
'nad-plus.html': { name:'NAD+', mech:'Mitochondrial cofactor', cycleWks:12, dose:'titrated', freq:'3x weekly (Mon · Wed · Fri)',
// NAD+ subQ stings — gradual ramp on same M/W/F schedule throughout.
// daySpans = explicit [startDay, endDay] for non-uniform phase lengths.
titration:[{w:'Wk 1 tolerance',d:'25 mg per injection · M/W/F',daySpan:[1,7]},{w:'Wk 2',d:'50 mg per injection · M/W/F',daySpan:[8,14]},{w:'Wk 3-4',d:'75 mg per injection · M/W/F',daySpan:[15,28]},{w:'Wk 5-12 full dose',d:'100 mg per injection · M/W/F',daySpan:[29,84]}] },
'selank.html': { name:'Selank', mech:'Anxiolytic neuropeptide', cycleWks:4, dose:'250-500 mcg', freq:'daily intranasal' },
'semax.html': { name:'Semax', mech:'BDNF upregulator', cycleWks:4, dose:'250-500 mcg', freq:'daily intranasal' },
'dsip.html': { name:'DSIP', mech:'Delta sleep peptide', cycleWks:4, dose:'100-300 mcg', freq:'pre-bed' },
'dihexa.html': { name:'Dihexa', mech:'HGF mimetic', cycleWks:4, dose:'8-25 mg', freq:'daily SubQ' },
'pe2228.html': { name:'PE-22-28', mech:'TREK-1 modulator', cycleWks:4, dose:'250-500 mcg', freq:'daily SubQ' },
'l-carnitine.html': { name:'L-Carnitine', mech:'Fat oxidation cofactor', cycleWks:8, dose:'200-500 mg', freq:'pre-workout SubQ' },
'glutamine.html': { name:'Glutamine', mech:'Gut + immune amino', cycleWks:8, dose:'200-500 mg', freq:'daily SubQ' },
'wolverine.html': { name:'Wolverine Stack',mech:'BPC 5mg + TB-500 5mg combined in ONE vial', cycleWks:6, dose:'see components', freq:'daily', combinedBottle:true },
'klow.html': { name:'KLOW Stack', mech:'KPV + TB-500 + BPC-157 + GHK-Cu — ALL combined in ONE vial', cycleWks:6, dose:'see components', freq:'daily', combinedBottle:true, copperWarning:true },
'glow.html': { name:'GLOW Stack', mech:'GHK-Cu + TB-500 + BPC-157 — ALL combined in ONE vial', cycleWks:8, dose:'see components', freq:'daily', combinedBottle:true, copperWarning:true },
'cardiac-stack.html':{ name:'Cardiac Stack', mech:'Heart-focused stack', cycleWks:12, dose:'see components', freq:'daily' },
'longevity-stack.html':{name:'Longevity Stack',mech:'Multi-peptide longevity', cycleWks:16, dose:'see components', freq:'pulsed' },
'mito-reset.html': { name:'Mito Reset', mech:'Mitochondrial protocol', cycleWks:12, dose:'see components', freq:'daily' },
// ── TESTOSTERONE (Rx-only · Schedule III · pre-mixed in oil, no recon) ──
'testosterone-cyp.html': { name:'Testosterone Cypionate', mech:'Androgen · long ester (8-day half-life)', cycleWks:52, dose:'100-200 mg', freq:'2x weekly (Mon + Thu)', rx:true, premixed:true },
'testosterone-enth.html': { name:'Testosterone Enanthate', mech:'Androgen · long ester (7-day half-life)', cycleWks:52, dose:'100-200 mg', freq:'2x weekly (Mon + Thu)', rx:true, premixed:true },
'testosterone-prop.html': { name:'Testosterone Propionate', mech:'Androgen · short ester (1-day half-life)', cycleWks:52, dose:'50-100 mg', freq:'3x weekly (Mon · Wed · Fri)', rx:true, premixed:true }
};
let selection = [];
try { selection = JSON.parse(localStorage.getItem('apex_selection')) || []; } catch(e){}
const list = document.getElementById('proto-list');
const empty = document.getElementById('empty-state');
const summary = document.getElementById('summary');
const continueBar = document.getElementById('continue-bar');
const continueBtn = document.getElementById('continue-btn');
if (!selection.length) {
// Render escape hatch RIGHT BELOW the hero (visible above the fold)
const hero = document.querySelector('.hero');
const card = document.createElement('div');
card.style.cssText = 'margin:24px 0;padding:32px 24px;background:rgba(251,191,36,.08);border:2px solid rgba(251,191,36,.5);border-radius:14px;text-align:center;animation:apexFadeIn .35s ease;';
card.innerHTML = `
<div style="font-size:48px;margin-bottom:12px;">⚠️</div>
<div style="font-family:'Rajdhani',sans-serif;font-weight:700;font-size:24px;color:#fbbf24;margin-bottom:10px;letter-spacing:-.3px;">Nothing to summarize yet</div>
<div style="font-size:14px;color:#cbd5e1;margin-bottom:22px;line-height:1.5;max-width:420px;margin-left:auto;margin-right:auto;">Looks like you haven't picked any peptides yet — or your selection got cleared. Pick where you want to go:</div>
<div style="display:flex;gap:10px;justify-content:center;flex-wrap:wrap;">
<a href="research-hub.html" style="display:inline-flex;align-items:center;gap:8px;padding:14px 26px;background:linear-gradient(135deg,#00ff9d,#10b981);color:#080c10;font-family:'Rajdhani',sans-serif;font-weight:800;font-size:14px;letter-spacing:.1em;text-transform:uppercase;text-decoration:none;border-radius:10px;box-shadow:0 4px 16px rgba(0,255,157,.4);">+ Build a New Stack</a>
<a href="tracker-v2.html" style="display:inline-flex;align-items:center;gap:8px;padding:14px 26px;background:transparent;color:#cbd5e1;font-family:'Rajdhani',sans-serif;font-weight:700;font-size:14px;letter-spacing:.1em;text-transform:uppercase;text-decoration:none;border-radius:10px;border:1px solid #1a2d3a;">Open My Tracker →</a>
</div>
`;
hero.parentNode.insertBefore(card, hero.nextSibling);
return;
}
// Peptides eligible for split dosing — DECLARED BEFORE renderCard runs.
// (Was declared after forEach, causing ReferenceError on first render.)
const SPLIT_ELIGIBLE = {
'retatrutide.html': { freqLabel:'2x weekly (Mon + Thu)', factor:2 },
'semaglutide.html': { freqLabel:'2x weekly (Mon + Thu)', factor:2 },
'tirzepatide.html': { freqLabel:'2x weekly (Mon + Thu)', factor:2 },
// Testosterone esters: weekly dose can be split 2x, 3x, or daily (7x)
'testosterone-cyp.html': { freqLabel:'2x weekly (Mon + Thu)', factor:2, allowDaily:true },
'testosterone-enth.html': { freqLabel:'2x weekly (Mon + Thu)', factor:2, allowDaily:true },
'testosterone-prop.html': { freqLabel:'3x weekly (Mon · Wed · Fri)', factor:3, allowDaily:true }
};
function splitDoseString(doseStr, factor){
if (!doseStr || typeof doseStr !== 'string') return doseStr;
return doseStr.replace(/(\d+(?:\.\d+)?)\s*(mg|mcg)/gi, function(_, n, unit){
const v = parseFloat(n) / factor;
const rounded = (v % 1 === 0) ? v : v.toFixed(2).replace(/\.?0+$/,'');
return rounded + ' ' + unit;
}).replace(/\/\s*wk\b/g, '/dose');
}
const splitState = {};
try { Object.assign(splitState, JSON.parse(localStorage.getItem('apex_split_dose')||'{}')); } catch(e){}
function persistSplit(){
try { localStorage.setItem('apex_split_dose', JSON.stringify(splitState)); } catch(e){}
}
// ── DEFAULT CONCENTRATION MAP — vial mg / bac mL per slug ──
// Mirrors reconstitute.html PEP defaults. Used to convert mg/mcg → units everywhere.
const RECON_DEFAULTS = {
'aod9604.html': { vial:10, bac:2, acetic:1 },
'5amino1mq.html': { vial:10, bac:2 },
'slu-pp-322.html': { vial:5, bac:2 },
'retatrutide.html': { vial:30, bac:3 },
'semaglutide.html': { vial:10, bac:3 },
'tirzepatide.html': { vial:30, bac:1.5 },
'melanotan1.html': { vial:10, bac:3 },
'melanotan2.html': { vial:10, bac:3 },
'pt141.html': { vial:10, bac:3 },
'ipamorelin.html': { vial:5, bac:3 },
'cjc1295-dac.html': { vial:5, bac:2 },
'cjc-no-dac.html': { vial: 5, bac: 3 },
'sermorelin.html': { vial:5, bac:2 },
'tesamorelin.html': { vial:10, bac:2 },
'cjc-ipa-blend.html': { vial:10, bac:2 },
'igf1-lr3.html': { vial:1, bac:3 },
'bpc157.html': { vial:5, bac:3 },
'tb500.html': { vial:10, bac:2 },
'ghkcu.html': { vial:50, bac:3 },
'kpv.html': { vial:5, bac:3 },
'll37.html': { vial:5, bac:3 },
'thymosin-alpha1.html':{ vial:10, bac:3 },
'ara290.html': { vial:10, bac:1 },
'epitalon.html': { vial:50, bac:3 },
'ss31.html': { vial:50, bac:2 },
'motsc.html': { vial:10, bac:2 },
'cartalax.html': { vial:5, bac:3 },
'fox04-dri.html': { vial:10, bac:2 },
'glutathione.html': { vial: 1000,bac: 2 },
'nad-plus.html': { vial:500, bac:5 },
'selank.html': { vial:10, bac:6 }, // spray
'semax.html': { vial:10, bac:6 }, // spray
'dsip.html': { vial:5, bac:3 },
'dihexa.html': { vial:50, bac:1 },
'pe2228.html': { vial:10, bac:3 },
'l-carnitine.html': { vial: 1000,bac: 2 },
'glutamine.html': { vial: 1000,bac: 2 },
'wolverine.html': { vial:10, bac:3 },
'klow.html': { vial:80, bac:3 },
'glow.html': { vial:10, bac:3 },
// Testosterone: pre-mixed in oil. We use vial:bac math to keep one code path,
// even though there's no actual reconstitution. T-Cyp/Enth = 200 mg/mL,
// T-Prop = 100 mg/mL. Vial size is the bottle's total mg (10 mL bottle).
'testosterone-cyp.html': { vial:2000, bac:10 },
'testosterone-enth.html': { vial:2000, bac:10 },
'testosterone-prop.html': { vial:1000, bac:10 }
};
// ── SSOT OVERRIDE: pull vial/bac and key flags from /data/peptides.json ──
if (window.APEX_PEPTIDES) {
for (const [slug, p] of Object.entries(window.APEX_PEPTIDES)) {
if (slug === '_meta') continue;
if (p.vial_mg != null && p.bac_ml != null) {
RECON_DEFAULTS[slug] = { vial: p.vial_mg, bac: p.bac_ml };
}
if (PROTO[slug]) {
if (p.cycle_weeks != null) PROTO[slug].cycleWks = p.cycle_weeks;
if (p.dose_label) PROTO[slug].dose = p.dose_label;
if (p.freq) PROTO[slug].freq = p.freq;
if (p.combined_bottle === true) PROTO[slug].combinedBottle = true;
if (p.warning && /copper.*tb-?500/i.test(p.warning)) PROTO[slug].copperWarning = true;
}
}
}
// Only SLU-PP-332 is pill form. Selank + Semax are nasal spray. Everything else is injection (units).
const ORAL_SLUGS = new Set();
const SPRAY_SLUGS = new Set(['selank.html','semax.html']);
// Stacks have no single numeric dose — keep "see components" label.
const COMPONENT_RX = /see components/i;
// Component breakdown for each stack — used to render dose-per-peptide rows
const STACK_COMPONENTS = {
'wolverine.html': [
{ slug:'bpc157.html', name:'BPC-157', dose:'250 mcg', freq:'daily' },
{ slug:'tb500.html', name:'TB-500', dose:'2.5 mg', freq:'2x weekly' }
],
'klow.html': [
{ slug:'kpv.html', name:'KPV', dose:'500 mcg', freq:'daily' },
{ slug:'tb500.html', name:'TB-500', dose:'2.5 mg', freq:'2x weekly' },
{ slug:'bpc157.html', name:'BPC-157', dose:'250 mcg', freq:'daily' },
{ slug:'ghkcu.html', name:'GHK-Cu', dose:'1-3 mg', freq:'daily' }
],
'glow.html': [
{ slug:'ghkcu.html', name:'GHK-Cu', dose:'1-3 mg', freq:'daily' },
{ slug:'tb500.html', name:'TB-500', dose:'2.5 mg', freq:'2x weekly' },
{ slug:'bpc157.html', name:'BPC-157', dose:'250 mcg', freq:'daily' }
],
'cardiac-stack.html': [
{ slug:'tb500.html', name:'TB-500', dose:'2.5 mg', freq:'2x weekly' },
{ slug:'bpc157.html', name:'BPC-157', dose:'250 mcg', freq:'daily' },
{ slug:'motsc.html', name:'MOTS-c', dose:'5 mg', freq:'2-3x weekly' },
{ slug:'ss31.html', name:'SS-31', dose:'5 mg', freq:'daily' }
],
'longevity-stack.html': [
{ slug:'ghkcu.html', name:'GHK-Cu', dose:'1-3 mg', freq:'daily' },
{ slug:'epitalon.html',name:'Epitalon', dose:'5-10 mg', freq:'10-day pulse, 2x/yr' },
{ slug:'ss31.html', name:'SS-31', dose:'5 mg', freq:'daily' },
{ slug:'nad-plus.html',name:'NAD+', dose:'100 mg', freq:'2-3x weekly maint.' }
],
'mito-reset.html': [
{ slug:'motsc.html', name:'MOTS-c', dose:'5 mg', freq:'2-3x weekly' },
{ slug:'ss31.html', name:'SS-31', dose:'5 mg', freq:'daily' },
{ slug:'nad-plus.html', name:'NAD+', dose:'100 mg', freq:'2-3x weekly maint.' },
{ slug:'glutathione.html',name:'Glutathione',dose:'200-600 mg', freq:'2-3x weekly' }
]
};
// Convert "300 mcg" / "5-10 mg" / "1 mg" → big-green units number.
// Returns the original label only for: SLU-PP (pill), Selank/Semax (spray), stacks (see components).
// The number is wrapped in a green span so it pops on the card.
function doseToUnitsLabel(doseStr, slug, opts){
if (!doseStr) return '—';
const s = String(doseStr);
const intensity = (opts && opts.intensity) || 'recommended';
// ── PREFER SSOT canonical dose_mg_per_inj over range parsing ──
// When dose_label is a range like "2-5 mg" the old logic used the midpoint
// (3.5mg) instead of the SSOT canonical value (3mg). Now we use the SSOT
// value for 'recommended' intensity, fall back to range parsing for mild/aggressive.
const ssot = (window.APEX_PEPTIDES || {})[slug];
// Only short-circuit to SSOT when caller passed a generic/non-numeric dose string
// (e.g., "titrated", "see schedule"). If doseStr has explicit mg/mcg, parse THAT
// instead — otherwise titration steps all render as the same flat SSOT canonical value.
const hasExplicitDose = /\d+(?:\.\d+)?\s*(mg|mcg)/i.test(s);
if (ssot && ssot.dose_mg_per_inj != null && intensity === 'recommended' && !hasExplicitDose) {
const recon = (opts && opts.userRecon) || RECON_DEFAULTS[slug];
if (recon && recon.vial && recon.bac) {
const conc = recon.vial / recon.bac;
const units = Math.round((ssot.dose_mg_per_inj / conc) * 100);
return '<span style="color:var(--accent2);font-weight:800;font-size:1.1em;">' + units + '</span> <span style="color:var(--muted);">units</span>';
}
}
// Collapse range to single value based on intensity tier (mild/aggressive only — recommended uses SSOT above)
function collapseRange(str){
const r = str.match(/(\d+(?:\.\d+)?)\s*[-–—]\s*(\d+(?:\.\d+)?)\s*(mg|mcg)/i);
if (!r) return str;
const lo=parseFloat(r[1]), hi=parseFloat(r[2]), unit=r[3];
let val = intensity==='mild' ? lo : intensity==='aggressive' ? hi : (lo+hi)/2;
val = unit.toLowerCase()==='mcg' ? Math.round(val/5)*5 : Math.round(val*10)/10;
return str.replace(r[0], val + ' ' + unit);
}
const collapsed = collapseRange(s);
if (ORAL_SLUGS.has(slug)) return '<span style="color:var(--accent3);font-weight:800;">1</span> <span style="color:var(--muted);">capsule</span>';
if (SPRAY_SLUGS.has(slug)) {
const m = collapsed.match(/(\d+(?:\.\d+)?)\s*mcg/i);
const sprays = m ? Math.max(1, Math.round(parseFloat(m[1])/100)) : null;
return sprays
? '<span style="color:var(--accent);font-weight:800;">'+sprays+'</span> <span style="color:var(--muted);">spray'+(sprays>1?'s':'')+' · intranasal</span>'
: '<span style="color:var(--accent);font-weight:800;">intranasal</span>';
}
if (COMPONENT_RX.test(s)) return '<span style="color:var(--muted);font-style:italic;">see components below</span>';
const recon = (opts && opts.userRecon) || RECON_DEFAULTS[slug];
if (!recon || !recon.vial || !recon.bac) return '<a href="reconstitute.html" style="color:#fbbf24;font-weight:700;text-decoration:none;">⚠ Set vial size</a>';
const concMgPerMl = recon.vial / (recon.bac + (recon.acetic||0));
function mgToUnits(mg){ return Math.round(mg / concMgPerMl * 100); }
function fmtUnits(num, suffix){
// Number in green-bold accent, "units" muted, suffix muted
return `<span style="color:var(--accent2);font-weight:800;font-size:1.05em;">${num}</span> <span style="color:var(--muted);font-weight:600;font-size:.92em;">units${suffix ? ' / ' + suffix : ''}</span>`;
}
function fmtRangeUnits(lo, hi, suffix){
return `<span style="color:var(--accent2);font-weight:800;font-size:1.05em;">${lo}–${hi}</span> <span style="color:var(--muted);font-weight:600;font-size:.92em;">units${suffix ? ' / ' + suffix : ''}</span>`;
}
// After collapse, dose is single value. Convert to units.
const m = collapsed.match(/(\d+(?:\.\d+)?)\s*(mg|mcg)/i);
if (!m) return '<span style="color:var(--muted);">—</span>';
const amount = parseFloat(m[1]);
const unit = m[2].toLowerCase();
const amountMg = unit === 'mcg' ? amount/1000 : amount;
const u = mgToUnits(amountMg);
if (u < 1 || u > 200) return '<a href="reconstitute.html" style="color:#fbbf24;font-weight:700;text-decoration:none;">⚠ Adjust vial size</a>';
const suffix = s.match(/\/\s*(wk|week|day|d)\b/i);
return fmtUnits(u, suffix ? suffix[1] : '');
}
// Cycle-position state per slug
const cycleState = {};
try { Object.assign(cycleState, JSON.parse(localStorage.getItem('apex_cycle_position')||'{}')); } catch(e){}
function persistCyclePosition(){
try { localStorage.setItem('apex_cycle_position', JSON.stringify(cycleState)); } catch(e){}
}
let titrationCount = 0;
let totalWeeks = 0;
let weeksCount = 0;
function slugToName(slug){
return slug.replace(/\.html$/, '').replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase());
}
selection.forEach(slug => {
let p = PROTO[slug];
if (!p) {
console.warn('[protocol-summary] missing PROTO for', slug, '→ fallback render');
p = { name: slugToName(slug), mech: '(set in tracker)', cycleWks: 8, dose: 'set in tracker', freq: 'daily', titration: null };
}
if (p.titration) titrationCount++;
if (typeof p.cycleWks === 'number') { totalWeeks += p.cycleWks; weeksCount++; }
list.appendChild(renderCard(slug, p));
});
document.getElementById('sum-peptides').textContent = selection.length;
document.getElementById('sum-weeks').textContent = weeksCount > 0 ? Math.round(totalWeeks / weeksCount) : '—';
document.getElementById('sum-titrate').textContent = titrationCount;
summary.style.display = 'grid';
document.getElementById('cb-count').textContent = selection.length;
continueBar.style.display = 'flex';
function renderCard(slug, p){
const card = document.createElement('div');
card.className = 'proto-card' + (p.titration ? ' titration' : '');
card.dataset.slug = slug;
card.setAttribute('data-peptide-card', slug);
const splitCfg = SPLIT_ELIGIBLE[slug];
const isSplit = !!splitState[slug];
function buildTitHtml(){
if (!p.titration) return '';
const cs = cycleState[slug] || {};
const userRecon = (cs.vialMg > 0 && cs.bacMl > 0) ? { vial: cs.vialMg, bac: cs.bacMl } : null;
// ── SYNC WITH CADENCE: scale titration to user's chosen per-dose mg ──
// The raw titration array is authored at the canonical 1x/wk per-injection dose
// (e.g., NAD+ Wk1=25mg, Wk5+=100mg). When user picks 3x/wk @ 67mg, the ladder
// must ramp to 67mg at "full dose", not 100. We treat the ladder as percent of
// its own peak: each step's mg / peak mg = percent → scale to user's per-dose.
let chosenPerDoseMg = null;
let chosenPattern = null;
try {
const choice = (JSON.parse(localStorage.getItem('apex_cadence_choice')||'{}'))[slug];
if (choice) {
const ssotPep = (window.APEX_PEPTIDES || {})[slug];
const opt = ssotPep && ssotPep.cadence_flex && ssotPep.cadence_flex.options.find(o => o.pattern === choice);
if (opt) { chosenPerDoseMg = opt.per_dose_mg; chosenPattern = opt.pattern; }
}
} catch(_){}
// Find ladder peak in mg (assumes "X mg" parseable in titration steps)
function parseStepMg(s){
const m = String(s).match(/(\d+(?:\.\d+)?)\s*(mg|mcg)/i);
if (!m) return null;
const v = parseFloat(m[1]);
return m[2].toLowerCase()==='mcg' ? v/1000 : v;
}
const peakMg = Math.max(...p.titration.map(t => parseStepMg(t.d) || 0));
const rows = p.titration.map(t => {
let stepDose = (splitCfg && isSplit) ? splitDoseString(t.d, splitCfg.factor) : t.d;
// If user picked a cadence with a different per-dose, scale this step proportionally
if (chosenPerDoseMg != null && peakMg > 0) {
const stepMg = parseStepMg(stepDose);
if (stepMg != null) {
const scaledMg = (stepMg / peakMg) * chosenPerDoseMg;
const scaledLbl = scaledMg < 1 ? Math.round(scaledMg*1000)+' mcg' : (Math.round(scaledMg*10)/10) + ' mg';
stepDose = stepDose.replace(/\d+(?:\.\d+)?\s*(mg|mcg)/i, scaledLbl);
}
}
const unitsLbl = doseToUnitsLabel(stepDose, slug, { userRecon });
return `<div class="tit-row"><span class="tit-week">${t.w}</span><span class="tit-dose">${unitsLbl}</span></div>`;
}).join('');
const unitContext = isSplit
? `Units <strong>per dose</strong> · ${splitCfg.freqLabel}`
: (chosenPattern
? `Units <strong>per dose</strong> · ${chosenPattern}`
: `Units <strong>per WEEK</strong> · single weekly injection`);
return `
<div class="tit-table">
<div class="tit-title">⚡ Titration Schedule${isSplit ? ' (Split)' : ''}</div>
<div class="tit-subtitle" style="font-size:11px;color:var(--muted,#7a8d99);margin:-2px 0 8px;font-family:'Share Tech Mono',monospace;letter-spacing:.05em;">${unitContext}</div>
<div class="tit-rows">${rows}</div>
</div>`;
}
function buildSplitToggle(){
if (!splitCfg) return '';
return `
<div class="split-toggle${isSplit?' on':''}" data-slug="${slug}" role="switch" aria-checked="${isSplit}" tabindex="0">
<div class="split-info">
<div class="split-label">💉 Split Dosing</div>
<div class="split-sub">${isSplit ? 'Active — ' + splitCfg.freqLabel : 'Tap to split your weekly dose into 2 smaller doses (Mon + Thu)'}</div>
</div>
<div class="split-switch"></div>
</div>
${isSplit ? `<div class="split-research-note"><strong>Heads up:</strong> Split dosing has a real pharmacokinetic argument (lower peaks, smoother coverage) but <strong>no published clinical trial</strong> validates it for ${p.name}. Phase 2/3 trials all used weekly dosing. Many users report fewer GI side effects on split dosing — anecdotal.</div>` : ''}
`;
}
function buildCycleAsk(){
// Skip ONLY for multi-bottle stacks. Combined-bottle stacks (Wolverine)
// need vial+BAC inputs because they're physically ONE bottle the user mixes.
if (COMPONENT_RX.test(p.dose || '') && !p.combinedBottle) return '';
const hasTitration = p.titration && Array.isArray(p.titration) && p.titration.length >= 2;
const cs = cycleState[slug] || { mode: 'new' };
// Non-titrating peptide: render the simple version (week-only)
if (!hasTitration) {
const isMid = cs.mode === 'mid';
const totalWeeks = (typeof p.cycleWks === 'number') ? p.cycleWks : 8;
let weekOpts = '';
for (let w = 1; w <= totalWeeks; w++) {
weekOpts += `<option value="${w}"${cs.currentWeek === w ? ' selected' : ''}>Week ${w}</option>`;
}
// ── PREMIXED (testosterone): show weekly mL dial + split + auto-calc'd units
if (p.premixed) {
const concPremixed = p.name.includes('Propionate') ? 100 : 200; // mg/mL
const weeklyMl = (typeof cs.weeklyMl === 'number' && cs.weeklyMl > 0) ? cs.weeklyMl : 0.5;
const pinsPerWk = (typeof cs.pinsPerWeek === 'number' && cs.pinsPerWeek > 0) ? cs.pinsPerWeek : 2;
const totalWeeklyUnits = Math.round(weeklyMl * 100);
const totalWeeklyMg = Math.round(weeklyMl * concPremixed);
const perPinUnits = pinsPerWk > 0 ? Math.round(totalWeeklyUnits / pinsPerWk) : 0;
const pinOptsT = [2,3,7].map(n => `<option value="${n}"${pinsPerWk === n ? ' selected' : ''}>${n}× / wk (${({2:'Mon + Thu',3:'M/W/F',7:'daily'})[n]})</option>`).join('');
return `
<div class="cycle-ask">
<div class="cycle-ask-title">Your testosterone protocol</div>
<div class="cycle-ask-fields show">
<div class="cycle-ask-field-row">
<div class="cycle-ask-field">
<label>Weekly dose (mL / cc)</label>
<input type="number" min="0" max="3" step="0.1" value="${weeklyMl}" data-cycle-weekly-ml data-slug="${slug}" inputmode="decimal" placeholder="0.5">
</div>
<div class="cycle-ask-field">
<label>Split into</label>
<select data-cycle-pins data-slug="${slug}">${pinOptsT}</select>
</div>
</div>
<div class="cycle-ask-field-row">
<div class="cycle-ask-field" style="background:rgba(0,255,157,.06);border-color:rgba(0,255,157,.3);">
<label style="color:var(--accent2);">Per pin</label>
<div style="font-family:'Rajdhani',sans-serif;font-weight:800;font-size:18px;color:var(--accent2);">${perPinUnits} <span style="font-size:11px;color:var(--muted);font-weight:600;">units</span></div>
</div>
<div class="cycle-ask-field" style="background:rgba(0,212,255,.04);border-color:rgba(0,212,255,.25);">
<label style="color:var(--accent);">Weekly total</label>
<div style="font-family:'Rajdhani',sans-serif;font-weight:800;font-size:18px;color:var(--accent);">${totalWeeklyUnits} <span style="font-size:11px;color:var(--muted);font-weight:600;">u (${totalWeeklyMg} mg)</span></div>
</div>
</div>
</div>
</div>
`;
}
const summary = (isMid && cs.currentWeek)
? `<div class="cycle-ask-summary"><strong>Picking up at Week ${cs.currentWeek}.</strong> Tracker will set your start date back so you land on the right cycle day.</div>`
: '';
return `
<div class="cycle-ask">
<div class="cycle-ask-title">Where are you in your cycle?</div>
<div class="cycle-ask-buttons">
<button class="cycle-ask-btn${!isMid ? ' on' : ''}" data-cycle-mode="new" data-slug="${slug}">Brand new — start week 1</button>
<button class="cycle-ask-btn${isMid ? ' on' : ''}" data-cycle-mode="mid" data-slug="${slug}">Already on cycle</button>
</div>
<div class="cycle-ask-fields${isMid ? ' show' : ''}">
<div class="cycle-ask-field-row">
<div class="cycle-ask-field">
<label>Current week</label>
<select data-cycle-week data-slug="${slug}">${weekOpts}</select>
</div>
</div>
${summary}
</div>
</div>
`;
}
// Titrating peptide → continue to full form below
const isMid = cs.mode === 'mid';
const isSplitEligible = !!splitCfg; // GLP-1s only
const isMidSplit = isMid && cs.midSplit === true;
const totalWeeks = (typeof p.cycleWks === 'number') ? p.cycleWks : 24;
const VIAL_DEFAULTS = {
'retatrutide.html': 30, 'semaglutide.html': 10, 'tirzepatide.html': 30, 'nad-plus.html': 500
};
const vialMg = (cs.vialMg && cs.vialMg > 0) ? cs.vialMg : (VIAL_DEFAULTS[slug] || 10);
const bacMl = (cs.bacMl && cs.bacMl > 0) ? cs.bacMl : (slug === 'nad-plus.html' ? 5 : 3);
// Single-dose mode: lastUnits = total weekly units
// Split mode: lastUnits = per-pin units, pinsPerWeek = 2 or 3
const lastUnits = (typeof cs.lastUnits === 'number' && cs.lastUnits > 0) ? cs.lastUnits : '';
const pinsPerWeek = (typeof cs.pinsPerWeek === 'number' && cs.pinsPerWeek > 0) ? cs.pinsPerWeek : 2;
const concMgPerMl = bacMl > 0 ? (vialMg / bacMl) : 0;
// Effective weekly mg
let weeklyDoseMg = 0;
if (typeof cs.lastUnits === 'number' && cs.lastUnits > 0) {
const perPinMg = cs.lastUnits * concMgPerMl / 100;
weeklyDoseMg = isMidSplit ? (perPinMg * pinsPerWeek) : perPinMg;
}
const fmt = v => v < 1 ? v.toFixed(2) : v.toFixed(1);
// Build week dropdown
let weekOpts = '';
for (let w = 1; w <= totalWeeks; w++) {
weekOpts += `<option value="${w}"${cs.currentWeek === w ? ' selected' : ''}>Week ${w}</option>`;
}
// Build pins-per-week dropdown (2 or 3)
// Build pin options. Testosterone allows 7× (daily microdose).
const allowDaily = !!(splitCfg && splitCfg.allowDaily);
const pinChoices = allowDaily ? [2, 3, 7] : [2, 3];
const pinLabels = { 2:'Mon + Thu', 3:'Mon · Wed · Fri', 7:'daily' };
const pinsOpts = pinChoices.map(n =>
`<option value="${n}"${pinsPerWeek === n ? ' selected' : ''}>${n}× / week (${pinLabels[n]})</option>`
).join('');
// Live summary
let summary = '';
if (isMid && cs.currentWeek) {
const cycleDays = totalWeeks * 7;
const dayApprox = (cs.currentWeek - 1) * 7 + 1;
const phaseLen = cycleDays / p.titration.length;
const phaseIdx = Math.min(p.titration.length - 1, Math.floor((dayApprox - 1) / phaseLen));
const phase = p.titration[phaseIdx];
let doseLine = '';
if (cs.lastUnits > 0) {
if (isMidSplit) {
const totalUnitsWk = cs.lastUnits * pinsPerWeek;
doseLine = ` <strong>${cs.lastUnits} units × ${pinsPerWeek}/week</strong> = <strong>${totalUnitsWk} units/wk total</strong>.`;
} else {
doseLine = ` Your <strong>${cs.lastUnits} units</strong>/week.`;
}
}
summary = `<div class="cycle-ask-summary">
<strong>Picking up at Week ${cs.currentWeek}.</strong> Tracker drops you in phase: <strong>${phase.w} → ${phase.d}</strong>.${doseLine}
</div>`;
}
// Split sub-toggle (only renders if splitCfg + isMid)
const splitSubToggle = (isSplitEligible && isMid) ? `
<div class="split-toggle${isMidSplit ? ' on' : ''}" data-mid-split data-slug="${slug}" role="switch" aria-checked="${isMidSplit}" tabindex="0" style="margin-top:8px;">
<div class="split-info">
<div class="split-label">💉 Split Protocol</div>
<div class="split-sub">${isMidSplit ? `Active — ${pinsPerWeek}× / week (${pinLabels[pinsPerWeek] || ''})` : 'Are you splitting your weekly dose into multiple pins?'}</div>
</div>
<div class="split-switch"></div>
</div>
` : '';
// The dose row depends on split state
const doseRow = isMidSplit ? `
<div class="cycle-ask-field-row">
<div class="cycle-ask-field">
<label>Pins per week</label>
<select data-cycle-pins data-slug="${slug}">${pinsOpts}</select>
</div>
<div class="cycle-ask-field">
<label>Per-pin dose (units)</label>
<input type="number" min="1" max="120" step="1" value="${lastUnits}" placeholder="e.g. 25" data-cycle-units data-slug="${slug}" inputmode="numeric">
</div>
</div>
` : `
<div class="cycle-ask-field-row">
<div class="cycle-ask-field">
<label>Current week</label>
<select data-cycle-week data-slug="${slug}">${weekOpts}</select>
</div>
<div class="cycle-ask-field">
<label>Last dose (units)</label>
<input type="number" min="1" max="120" step="1" value="${lastUnits}" placeholder="e.g. 50" data-cycle-units data-slug="${slug}" inputmode="numeric">
</div>
</div>
`;
// Always show "Current week" — but if splitting, show as standalone row
const weekRow = isMidSplit ? `
<div class="cycle-ask-field-row">
<div class="cycle-ask-field">
<label>Current week</label>
<select data-cycle-week data-slug="${slug}">${weekOpts}</select>
</div>
<div class="cycle-ask-field" style="background:rgba(0,255,157,.04);border-color:rgba(0,255,157,.25);">
<label style="color:var(--accent2);">Total weekly units</label>
<div style="font-family:'Rajdhani',sans-serif;font-weight:700;font-size:14px;color:var(--accent2);">${(typeof cs.lastUnits === 'number' && cs.lastUnits > 0) ? (cs.lastUnits * pinsPerWeek) + ' u/wk' : '—'}</div>
</div>
</div>
` : '';
return `
<div class="cycle-ask">
<div class="cycle-ask-title">Where are you in your cycle?</div>
<div class="cycle-ask-buttons">
<button class="cycle-ask-btn${cs.mode === 'new' || !cs.mode ? ' on' : ''}" data-cycle-mode="new" data-slug="${slug}">Brand new — start week 1</button>
<button class="cycle-ask-btn${isMid ? ' on' : ''}" data-cycle-mode="mid" data-slug="${slug}">Already on cycle</button>
</div>
<div class="cycle-ask-fields${isMid ? ' show' : ''}">
<div class="cycle-ask-field-row">
<div class="cycle-ask-field">
<label>How big was your vial?</label>
<input type="number" min="1" step="1" value="${vialMg}" data-cycle-vial data-slug="${slug}" inputmode="numeric"> mg
</div>
<div class="cycle-ask-field">
<label>How many cc of BAC?</label>
<input type="number" min="0.5" step="0.5" value="${bacMl}" data-cycle-bac data-slug="${slug}" inputmode="decimal"> mL
</div>
</div>
${splitSubToggle}
${doseRow}
${weekRow}
${summary}
</div>
</div>
`;
}
function buildStackComponents(){
const comps = STACK_COMPONENTS[slug];
if (!comps) return '';
const isCombined = !!p.combinedBottle;
// ── ONE-TIME EDUCATION: show full breakdown only on first view per peptide ──
// After user acks it, collapse to a compact summary. Frequency + units stay
// in the main proto-rows above; this block becomes a "ⓘ See composition" link.
// Default behavior for combined bottles: COLLAPSED. The educational warning
// is meant to fire once on selection (compare/build flow), not every time the
// user lands on the protocol summary. Here we just want clean units + freq.
var __combinedAcked = isCombined;
const ssotEntry = (window.APEX_PEPTIDES || {})[slug] || {};
const ssotComps = ssotEntry.components || [];
const cs = cycleState[slug] || {};
const totalBac = (isCombined && cs.bacMl > 0) ? cs.bacMl : (ssotEntry.bac_ml || 3);
const totalVialMg = (cs.vialMg > 0) ? cs.vialMg : (ssotEntry.vial_mg || 10);
let rows;
let recommendedVolumeMl = 0;
let targetComponentName = '';
if (isCombined) {
// ── COMBINED BOTTLE: target SMALLEST-DOSE component, show what every other peptide
// ── ACTUALLY gets at that injection volume. Honest about the trade-off.
const componentMgInVial = totalVialMg / comps.length;
const concPerComponent = componentMgInVial / totalBac; // mg/mL of each component in the bottle
// Parse target dose for each component and compute volume needed for that target
const parseDoseMg = (doseStr) => {
const m = String(doseStr).match(/(\d+(?:\.\d+)?)\s*(mg|mcg)/i);
if (!m) return null;
const v = parseFloat(m[1]);
return m[2].toLowerCase() === 'mcg' ? v / 1000 : v;
};
const compsWithMath = comps.map(c => {
const ssotC = ssotComps.find(x => x.name === c.name);
const targetMg = (ssotC && ssotC.dose_mg) || parseDoseMg(c.dose);
const volumeForTarget = (targetMg && concPerComponent > 0) ? targetMg / concPerComponent : 0;
return { ...c, targetMg, volumeForTarget };
});
// Recommended volume = the smallest of all target volumes (limits the over-dose risk)
const candidates = compsWithMath.filter(x => x.volumeForTarget > 0);
const smallest = candidates.reduce((acc, x) => (!acc || x.volumeForTarget < acc.volumeForTarget) ? x : acc, null);
recommendedVolumeMl = smallest ? smallest.volumeForTarget : 0;
targetComponentName = smallest ? smallest.name : '';
const recommendedUnits = Math.round(recommendedVolumeMl * 100);
rows = compsWithMath.map(c => {
// What dose this component ACTUALLY receives at the recommended volume
const deliveredMg = recommendedVolumeMl * concPerComponent;
const deliveredLabel = deliveredMg < 1 ? (deliveredMg * 1000).toFixed(0) + ' mcg' : deliveredMg.toFixed(2) + ' mg';
const isTarget = c.name === targetComponentName;
const targetMgLabel = c.targetMg < 1 ? (c.targetMg * 1000).toFixed(0) + ' mcg' : c.targetMg + ' mg';
const ratio = c.targetMg ? deliveredMg / c.targetMg : 0;
let statusBadge, statusColor;
if (isTarget) {
statusBadge = '✅ TARGET HIT';
statusColor = 'var(--accent2)';
} else if (ratio < 0.5) {
const pctUnder = Math.round((1 - ratio) * 100);
statusBadge = `⚠ ${pctUnder}% UNDER (microdose)`;
statusColor = '#fbbf24';
} else if (ratio > 1.5) {
const xOver = ratio.toFixed(1);
statusBadge = `🚨 ${xOver}× OVERDOSE`;
statusColor = '#FF6B35';
} else {
statusBadge = 'sub-target';
statusColor = 'var(--muted)';
}
return `
<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:rgba(0,212,255,.04);border:1px solid ${isTarget ? 'rgba(0,255,157,.4)' : 'rgba(0,212,255,.15)'};border-radius:8px;margin-top:6px;">
<div style="display:flex;flex-direction:column;gap:2px;min-width:0;">
<div style="font-family:'Rajdhani',sans-serif;font-weight:700;font-size:14px;color:#fff;letter-spacing:-.2px;">${c.name}</div>
<div style="font-size:11px;color:var(--muted);">target ${targetMgLabel} · ${c.freq}</div>
</div>
<div style="text-align:right;flex-shrink:0;">
<div style="font-size:13px;font-weight:700;color:#fff;">${deliveredLabel} <span style="color:var(--muted);font-size:10px;">delivered</span></div>
<div style="font-size:9px;color:${statusColor};font-family:'Share Tech Mono',monospace;letter-spacing:.08em;margin-top:2px;">${statusBadge}</div>
</div>
</div>`;
}).join('');
// Recommended volume callout
const recommendedCallout = recommendedUnits > 0 ? `
<div style="margin-top:8px;padding:12px 14px;background:rgba(0,255,157,.08);border:1px solid rgba(0,255,157,.4);border-radius:8px;">
<div style="font-family:'Share Tech Mono',monospace;font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--accent2);margin-bottom:4px;">⚡ Recommended injection volume (targets ${targetComponentName})</div>
<div style="font-family:'Rajdhani',sans-serif;font-weight:700;font-size:24px;color:var(--accent2);">${recommendedUnits} units <span style="font-size:13px;color:var(--muted);font-weight:500;">on the pen · daily</span></div>
<div style="font-size:11px;color:var(--text);margin-top:6px;line-height:1.5;">This volume hits ${targetComponentName} at its proper dose. Every other peptide in the bottle is sub-target (see below) — they're still active but underdosed. <strong>For full optimal dosing of every peptide, run separate vials.</strong></div>
</div>` : '';
rows = recommendedCallout + rows;
} else {
// Multi-bottle stack — each component has its own recon, no compromise
rows = comps.map(c => {
const userRecon = RECON_DEFAULTS[c.slug];
const unitsLbl = doseToUnitsLabel(c.dose, c.slug, { userRecon });
return `
<div style="display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:rgba(0,212,255,.04);border:1px solid rgba(0,212,255,.15);border-radius:8px;margin-top:6px;">
<div style="display:flex;flex-direction:column;gap:2px;min-width:0;">
<div style="font-family:'Rajdhani',sans-serif;font-weight:700;font-size:14px;color:#fff;letter-spacing:-.2px;">${c.name}</div>
<div style="font-size:11px;color:var(--muted);">${c.freq}</div>
</div>
<div style="text-align:right;font-size:13px;font-weight:700;flex-shrink:0;">${unitsLbl}</div>
</div>`;
}).join('');
}
const heading = isCombined
? `🧪 Inside this ONE bottle <span style="color:var(--muted);font-weight:400;text-transform:none;letter-spacing:0;">— each draw delivers all peptides at once</span>`
: `⊞ Stack Components <span style="color:var(--muted);font-weight:400;text-transform:none;letter-spacing:0;">— separate bottles</span>`;
// ── COMBINED-BOTTLE COMPROMISE WARNING ──────────────────────────
// Combined bottles can't independently dose each peptide. Tell the truth.
const combinedCompromise = isCombined ? `
<div style="margin-top:10px;padding:11px 13px;background:rgba(251,191,36,.10);border:1px solid rgba(251,191,36,.45);border-radius:8px;color:#fbbf24;font-size:12px;line-height:1.55;">
<strong style="color:#fbbf24;">⚠ The combined-bottle compromise.</strong>
One vial = locked dose ratio. You can't independently dose each peptide. Each component's "units" above shows what's needed AT ITS PROPER DOSE — but injecting that volume changes the dose of every other peptide in the bottle.<br><br>
<strong>Practical rule:</strong> target the <strong>smallest-dose component</strong> (usually BPC-157 at 0.25mg). Inject that volume <strong>daily</strong>. The other peptides will be sub-target but still active. For full optimal dosing of every peptide — <strong>run separate vials.</strong>
</div>` : '';
const copperWarn = p.copperWarning ? `
<div style="margin-top:10px;padding:11px 13px;background:rgba(239,68,68,.10);border:1px solid rgba(239,68,68,.45);border-radius:8px;color:#fca5a5;font-size:12px;line-height:1.5;">
<strong style="color:#ef4444;">⚠ Heads up — copper degrades TB-500.</strong>
GHK-<strong>Cu</strong> contains copper. When you combine GHK-Cu and TB-500 in the same vial,
the copper oxidizes the methionine residues in TB-500 and degrades it within days.
If you want both peptides, run them in <strong>separate bottles</strong> (or at least mix
fresh weekly and use within ~7 days). The "all-in-one" bottle is convenient but it's
chemically a bad idea for long-term storage.
</div>` : '';
const ackBtn = (isCombined && !__combinedAcked) ? `
<button type="button" data-combined-ack="${slug}" style="margin-top:12px;width:100%;padding:11px 14px;background:linear-gradient(135deg,var(--accent2),var(--accent));color:#080c10;border:0;border-radius:8px;font-family:'Rajdhani',sans-serif;font-weight:800;font-size:13px;letter-spacing:.06em;text-transform:uppercase;cursor:pointer;-webkit-tap-highlight-color:transparent;">✓ Got it — collapse this</button>
` : '';
const fullBlock = `
<div style="font-family:'Share Tech Mono',monospace;font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--muted);margin-bottom:8px;">${heading}</div>
${rows}
${copperWarn}
${ackBtn}`;
if (__combinedAcked) {
return `
<details style="margin-top:14px;padding:10px 12px;background:rgba(11,15,20,.4);border:1px solid var(--border);border-radius:10px;">