forge-openclaw-plugin 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/action-bar-5Ii4UzHa.js +1 -0
- package/dist/assets/activity-page-CWjTKFY3.js +1 -0
- package/dist/assets/ai-surface-workspace-Dd2FSRom.js +1 -0
- package/dist/assets/{atlas-panel-G3wGxjYf.js → atlas-panel-Dinteouh.js} +1 -1
- package/dist/assets/{board-dIX6etHh.js → board-CLOHbg6t.js} +1 -1
- package/dist/assets/calendar-page-BWkXhzDf.js +1 -0
- package/dist/assets/calendar-rules-CjyuTu2I.js +1 -0
- package/dist/assets/{calendar-week-toolbar-CWSK5hJl.js → calendar-week-toolbar-D-nd9tkk.js} +1 -1
- package/dist/assets/{charts-DFnEuIMB.js → charts-DwTguE_x.js} +1 -1
- package/dist/assets/companion-sync-lab-page-G0t1TqqZ.js +1 -0
- package/dist/assets/daily-metrics-dashboard-DpIAdzFX.js +1 -0
- package/dist/assets/define-workbench-box-BIOZopF2.js +1 -0
- package/dist/assets/entity-link-multiselect-DZZjpL_d.js +1 -0
- package/dist/assets/{entity-note-count-link-ef3ZOpKM.js → entity-note-count-link-CmRRdXAr.js} +1 -1
- package/dist/assets/entity-notes-surface-8MPDscsu.js +1 -0
- package/dist/assets/execution-board-Bi8gi8J6.js +1 -0
- package/dist/assets/{faceted-token-search-CZmtyJTT.js → faceted-token-search-BGs4TqxT.js} +1 -1
- package/dist/assets/{flagship-signal-deck-DxRfmfpN.js → flagship-signal-deck-jLxHEHvb.js} +1 -1
- package/dist/assets/{floating-action-menu-cKjNsPYD.js → floating-action-menu-Itpm7T2_.js} +1 -1
- package/dist/assets/{forms-hB0SqEh-.js → forms-C5d5hTf2.js} +1 -1
- package/dist/assets/generic-node-view-KePoUF3Z.js +10 -0
- package/dist/assets/goal-detail-page-a1lEswpJ.js +1 -0
- package/dist/assets/goal-dialog-CYgRzl4y.js +1 -0
- package/dist/assets/goals-page-JY_EJq9U.js +1 -0
- package/dist/assets/{graph-DDUZNRsO.js → graph-Cd5WF3lw.js} +1 -1
- package/dist/assets/habits-page-BRI8AoaQ.js +1 -0
- package/dist/assets/health-boxes-DZJOFTOI.js +1 -0
- package/dist/assets/index-wEZUnRh0.js +2 -0
- package/dist/assets/inline-note-fields-CUVRzQkI.js +1 -0
- package/dist/assets/insight-flow-dialog-By73oG1H.js +1 -0
- package/dist/assets/{insights-page-DHG-o9P_.js → insights-page-DLyN-9yz.js} +3 -3
- package/dist/assets/kanban-boxes-M71CejV4.js +1 -0
- package/dist/assets/kanban-page-InKHhJQD.js +1 -0
- package/dist/assets/knowledge-graph-page-C-GEQGRY.js +1 -0
- package/dist/assets/life-force-page-Dq88NzNp.js +1 -0
- package/dist/assets/{life-force-workspace-sszLD-Yn.js → life-force-workspace-Bl_0slZi.js} +1 -1
- package/dist/assets/{maps-C-yOWiDN.js → maps-D0Mm6WPG.js} +1 -1
- package/dist/assets/{metric-tile-B-tDTcBt.js → metric-tile-yQJgjYrN.js} +1 -1
- package/dist/assets/{motion-Lt5B1XuE.js → motion-DwjmC9aq.js} +1 -1
- package/dist/assets/movement-boxes-C-rc3N8Z.js +1 -0
- package/dist/assets/movement-page-DK-d1uYa.js +1 -0
- package/dist/assets/{note-markdown-CCyyE85h.js → note-markdown-7czv-KMH.js} +1 -1
- package/dist/assets/note-tags-input-CkgkqiT3.js +1 -0
- package/dist/assets/notes-boxes-BQuR1MiB.js +1 -0
- package/dist/assets/notes-page-ec9g1mPh.js +1 -0
- package/dist/assets/{open-in-graph-button-CMjJZX7G.js → open-in-graph-button-B_4fdm4l.js} +1 -1
- package/dist/assets/{orbit-map-v2Pv9RU_.js → orbit-map-DPQNBqS-.js} +1 -1
- package/dist/assets/overview-page-CZjMab2o.js +1 -0
- package/dist/assets/page-hero-BRcqE3a4.js +1 -0
- package/dist/assets/pill-cluster-dy6jG_dV.js +1 -0
- package/dist/assets/{preference-entity-handoff-button-CKDxCnbl.js → preference-entity-handoff-button-DOV-_2Vm.js} +1 -1
- package/dist/assets/preferences-page-Co8w5hzp.js +1 -0
- package/dist/assets/{project-collections-NBwk6yV-.js → project-collections-DNgKleDl.js} +1 -1
- package/dist/assets/project-detail-page-C-Ib1x8w.js +1 -0
- package/dist/assets/project-dialog-D_hgOdB9.js +1 -0
- package/dist/assets/project-management-hierarchy-page-asf61KSz.js +1 -0
- package/dist/assets/project-management-section-nav-DAZA1oXG.js +1 -0
- package/dist/assets/projects-boxes-CHLr1Bs-.js +1 -0
- package/dist/assets/projects-page-BsM8yCqQ.js +1 -0
- package/dist/assets/psyche-behaviors-page-COSZeP4J.js +5 -0
- package/dist/assets/psyche-flashcards-page-CJmgGL9x.js +1 -0
- package/dist/assets/psyche-goal-map-page-avrWNSs9.js +1 -0
- package/dist/assets/psyche-graph-BmwbnNBY.js +1 -0
- package/dist/assets/psyche-metrics-page-CY0J_aMx.js +1 -0
- package/dist/assets/psyche-mode-guide-page-COcswIHZ.js +1 -0
- package/dist/assets/psyche-modes-page-BXF_GZoP.js +1 -0
- package/dist/assets/psyche-page-VsMBNG1F.js +1 -0
- package/dist/assets/psyche-patterns-page-DVoIro0Q.js +5 -0
- package/dist/assets/psyche-questionnaire-builder-page-CahcrbQj.js +1 -0
- package/dist/assets/psyche-questionnaire-detail-page-CYSgADAD.js +1 -0
- package/dist/assets/psyche-questionnaire-run-detail-page-D5q5URTu.js +1 -0
- package/dist/assets/psyche-questionnaire-run-page-DUoA-VSs.js +1 -0
- package/dist/assets/psyche-questionnaires-page-dbQlqbKh.js +1 -0
- package/dist/assets/{psyche-report-detail-page-Ci14mNUK.js → psyche-report-detail-page-D_Mmlf2D.js} +3 -3
- package/dist/assets/psyche-reports-page-CO3J4Js3.js +1 -0
- package/dist/assets/{psyche-schemas-Dxj554nU.js → psyche-schemas-Dtskzvv1.js} +1 -1
- package/dist/assets/psyche-schemas-beliefs-page-BUNGL4zW.js +9 -0
- package/dist/assets/psyche-screen-time-page-Bm18uHDg.js +1 -0
- package/dist/assets/psyche-self-observation-page-VdPMBuK4.js +1 -0
- package/dist/assets/psyche-values-page-DivSQodJ.js +5 -0
- package/dist/assets/question-flow-dialog-Dsnsc8be.js +2 -0
- package/dist/assets/{report-chain-fields-CbkT7WOO.js → report-chain-fields-Bf-WCSJQ.js} +1 -1
- package/dist/assets/rewards-page-CI53Cp0i.js +1 -0
- package/dist/assets/{scheduling-rules-editor-BUGnZJ0g.js → scheduling-rules-editor-Bg3QU_qt.js} +1 -1
- package/dist/assets/{schema-badge-CLAA4p-b.js → schema-badge-CRThEDqP.js} +1 -1
- package/dist/assets/schemas-B8-kIOFQ.js +1 -0
- package/dist/assets/{select-menu-Cqs5t3ng.js → select-menu-rT3Qd5t5.js} +1 -1
- package/dist/assets/{settings-agents-page-pmkVrOO8.js → settings-agents-page-VDUv2WuO.js} +4 -4
- package/dist/assets/settings-bin-page-DfuGJVqc.js +1 -0
- package/dist/assets/{settings-calendar-page-BBjAMOCf.js → settings-calendar-page-ex7eHB1y.js} +3 -3
- package/dist/assets/settings-data-page-BPWyPVGo.js +1 -0
- package/dist/assets/settings-logs-page-CwTT4n63.js +1 -0
- package/dist/assets/settings-mobile-page-B6sVk872.js +1 -0
- package/dist/assets/settings-models-page-Dq5XViZd.js +1 -0
- package/dist/assets/settings-page-BRxdAxbS.js +1 -0
- package/dist/assets/settings-rewards-page-DRvxTwv3.js +1 -0
- package/dist/assets/{settings-section-nav-Co0AaDG-.js → settings-section-nav-D_vKvOWd.js} +1 -1
- package/dist/assets/settings-users-page-B6oSpOaV.js +1 -0
- package/dist/assets/settings-wiki-page-Bkv-SS3J.js +1 -0
- package/dist/assets/sleep-page-DELXxo6j.js +1 -0
- package/dist/assets/sports-page-ByWQL0Gf.js +1 -0
- package/dist/assets/{state-vCcAT5Hq.js → state-BtwEvpO6.js} +1 -1
- package/dist/assets/strategies-page-PuUHsaSJ.js +1 -0
- package/dist/assets/strategy-detail-page-CSyVdv29.js +1 -0
- package/dist/assets/strategy-dialog-Fgpc0z1M.js +1 -0
- package/dist/assets/{surface-CyWI7e1R.js → surface-DzVqQDmf.js} +1 -1
- package/dist/assets/{table-BNqMG3_S.js → table-BuONJH1s.js} +1 -1
- package/dist/assets/task-detail-page-BoLvJ_4F.js +1 -0
- package/dist/assets/task-dialog-B2cGkhLk.js +6 -0
- package/dist/assets/timebox-planning-dialog-BjiC2jh0.js +1 -0
- package/dist/assets/today-boxes-B4f4sBXg.js +1 -0
- package/dist/assets/today-page-Cusp2JI8.js +1 -0
- package/dist/assets/training-load-page-CsZbK6rY.js +1 -0
- package/dist/assets/{ui-C1iwpj2-.js → ui-B9O-eUim.js} +1 -1
- package/dist/assets/use-anchored-overlay-position-BrQ4cqKn.js +1 -0
- package/dist/assets/{use-psyche-focus-target-Ct-acS9G.js → use-psyche-focus-target-Cuxni3SK.js} +1 -1
- package/dist/assets/user-badge-CQygGKVs.js +1 -0
- package/dist/assets/user-ownership-DJGl4rAj.js +1 -0
- package/dist/assets/user-select-field-BNqv8-wd.js +1 -0
- package/dist/assets/utility-widgets-DRESNarT.js +3 -0
- package/dist/assets/{vendor-Dnkkx2co.js → vendor-Cpmju3nw.js} +1 -1
- package/dist/assets/vitals-page-BlTZ4f78.js +1 -0
- package/dist/assets/weekly-review-page-3Pk3NeGE.js +1 -0
- package/dist/assets/weight-loss-page-CRCtv1fX.js +5 -0
- package/dist/assets/{wiki-article-markdown-Bi02AsVt.js → wiki-article-markdown-D0PWvioX.js} +2 -2
- package/dist/assets/{wiki-editor-page-OZf9l4Tg.js → wiki-editor-page-OZMYUgFo.js} +5 -5
- package/dist/assets/wiki-ingest-history-page-DXZHzAqU.js +1 -0
- package/dist/assets/wiki-ingest-modal-Ro0V4UMB.js +1 -0
- package/dist/assets/wiki-page-B1g3Rfxy.js +1 -0
- package/dist/assets/workbench-flow-page-qh5nItU6.js +5 -0
- package/dist/assets/workbench-page-CFWfAYMV.js +1 -0
- package/dist/assets/workout-detail-page-Cw6t6Xj9.js +2 -0
- package/dist/index.html +7 -9
- package/dist/server/server/src/app.js +10 -0
- package/dist/server/server/src/health-weight-loss.js +11 -3
- package/dist/server/server/src/services/dashboard.js +4 -4
- package/dist/server/server/src/services/devrage.js +21 -2
- package/dist/server/server/src/services/gamification.js +71 -32
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/dist/assets/activity-page-DRRbpVK-.js +0 -1
- package/dist/assets/ai-surface-workspace-DJPt-OaW.js +0 -1
- package/dist/assets/calendar-page-y8G1ige8.js +0 -1
- package/dist/assets/calendar-rules-CRhXqGQu.js +0 -1
- package/dist/assets/companion-sync-lab-page-kEgOF3c6.js +0 -1
- package/dist/assets/daily-metrics-dashboard-BJjUIZVA.js +0 -1
- package/dist/assets/entity-notes-surface-CaCjjUaq.js +0 -1
- package/dist/assets/execution-board-RRWm2srb.js +0 -1
- package/dist/assets/goal-detail-page-BgQlK7yT.js +0 -1
- package/dist/assets/goals-page-Cz2i3pVy.js +0 -1
- package/dist/assets/habits-page-BmEmWCGv.js +0 -1
- package/dist/assets/index-QJkjKYzZ.js +0 -19
- package/dist/assets/insight-flow-dialog-CdYMHwMP.js +0 -1
- package/dist/assets/kanban-page-C6S_fJRc.js +0 -1
- package/dist/assets/knowledge-graph-page-juA9QCy0.js +0 -1
- package/dist/assets/life-force-page-ChTIA4mV.js +0 -1
- package/dist/assets/movement-page-Dx3T3HrG.js +0 -1
- package/dist/assets/note-tags-input-BS14YXHn.js +0 -1
- package/dist/assets/notes-page-D3yGl8TN.js +0 -1
- package/dist/assets/overview-page-DSOpBpHf.js +0 -1
- package/dist/assets/page-hero-CONuJu5J.js +0 -1
- package/dist/assets/pill-cluster-W2fY48OM.js +0 -1
- package/dist/assets/preferences-page-Br3zrLlH.js +0 -1
- package/dist/assets/project-detail-page-BIU9_TRN.js +0 -1
- package/dist/assets/project-management-hierarchy-page-C2H620xD.js +0 -1
- package/dist/assets/project-management-section-nav-DRPVS1Eh.js +0 -1
- package/dist/assets/projects-page-w7a_L2-z.js +0 -1
- package/dist/assets/psyche-behaviors-page-Dt4CMC-q.js +0 -5
- package/dist/assets/psyche-flashcards-page-rXz06dqO.js +0 -1
- package/dist/assets/psyche-goal-map-page-BCcD6Jkl.js +0 -1
- package/dist/assets/psyche-graph-CXlAj4ED.js +0 -1
- package/dist/assets/psyche-metrics-page-B1otiir6.js +0 -1
- package/dist/assets/psyche-mode-guide-page-C6AdVIAv.js +0 -1
- package/dist/assets/psyche-modes-page-DoUqz2mR.js +0 -1
- package/dist/assets/psyche-page-BJNLQn8W.js +0 -1
- package/dist/assets/psyche-patterns-page-CzpMSAPu.js +0 -5
- package/dist/assets/psyche-questionnaire-builder-page-DjzatGVZ.js +0 -1
- package/dist/assets/psyche-questionnaire-detail-page-B0Qfowfg.js +0 -1
- package/dist/assets/psyche-questionnaire-run-detail-page-B2dNj4jJ.js +0 -1
- package/dist/assets/psyche-questionnaire-run-page-DyD9Ui-g.js +0 -1
- package/dist/assets/psyche-questionnaires-page-BxfKcoi3.js +0 -1
- package/dist/assets/psyche-reports-page-ALhNueiV.js +0 -1
- package/dist/assets/psyche-schemas-beliefs-page-C0P2Vw6-.js +0 -9
- package/dist/assets/psyche-screen-time-page-BYnaT3cb.js +0 -1
- package/dist/assets/psyche-self-observation-page-eM9vpwIB.js +0 -1
- package/dist/assets/psyche-values-page-BqrGIDok.js +0 -5
- package/dist/assets/rewards-page-DpAJ8IxE.js +0 -1
- package/dist/assets/settings-bin-page-BwtLrweW.js +0 -1
- package/dist/assets/settings-data-page-Bqy5SukM.js +0 -1
- package/dist/assets/settings-logs-page-8khtrf4T.js +0 -1
- package/dist/assets/settings-mobile-page-BcyRjEU_.js +0 -1
- package/dist/assets/settings-models-page-DlSnO9WX.js +0 -1
- package/dist/assets/settings-page-CyBQ2qcB.js +0 -1
- package/dist/assets/settings-rewards-page-BBX2WtVM.js +0 -1
- package/dist/assets/settings-users-page-JSnfFFPu.js +0 -1
- package/dist/assets/settings-wiki-page--nT23Fdy.js +0 -1
- package/dist/assets/sleep-page-CGMi3MtV.js +0 -1
- package/dist/assets/sports-page-Kv5bBoLr.js +0 -1
- package/dist/assets/strategies-page-Br7RdUJO.js +0 -1
- package/dist/assets/strategy-detail-page-CBWXjUhC.js +0 -1
- package/dist/assets/strategy-dialog-BTwkaSxI.js +0 -1
- package/dist/assets/task-detail-page-Qis9354n.js +0 -1
- package/dist/assets/timebox-planning-dialog-DB8snOBD.js +0 -1
- package/dist/assets/today-page-D9A5PU0S.js +0 -1
- package/dist/assets/training-load-page-Bpd4DQAh.js +0 -1
- package/dist/assets/vitals-page-CVYC-4RG.js +0 -1
- package/dist/assets/weekly-review-page-BP7N3fNB.js +0 -1
- package/dist/assets/weight-loss-page-_fX3N1UK.js +0 -5
- package/dist/assets/wiki-ingest-history-page-CzeNSL7N.js +0 -1
- package/dist/assets/wiki-ingest-modal-Ig_xnyc6.js +0 -1
- package/dist/assets/wiki-page-B4xuNgY4.js +0 -1
- package/dist/assets/workbench-flow-page-BhRJCALC.js +0 -5
- package/dist/assets/workbench-page-DxVs2AOY.js +0 -1
- package/dist/assets/workout-detail-page-D4wfkE98.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as m,j as e,du as B,aL as K,bB as W,aH as O,ca as P,br as $,dv as F,bs as V}from"./vendor-Cpmju3nw.js";import{i as G}from"./state-BtwEvpO6.js";import{C as h,a4 as p,k as N,d as U,S as q,e as Q,e2 as Y}from"./index-wEZUnRh0.js";import{e as Z,C as I,X as C,Y as k,T as _,B as y,d as E,a as X,c as D,i as J,P as ee,j as ae,k as ie,f as te}from"./charts-DwTguE_x.js";import{P as re}from"./page-hero-BRcqE3a4.js";import"./motion-DwjmC9aq.js";import"./ui-B9O-eUim.js";import"./board-CLOHbg6t.js";import"./forms-C5d5hTf2.js";function M({height:i,children:a}){const d=m.useRef(null),[n,o]=m.useState(0);return m.useEffect(()=>{const t=d.current;if(!t)return;const u=()=>{o(Math.max(0,Math.floor(t.getBoundingClientRect().width)))};if(u(),typeof ResizeObserver>"u")return window.addEventListener("resize",u),()=>window.removeEventListener("resize",u);const f=new ResizeObserver(u);return f.observe(t),()=>f.disconnect()},[]),e.jsx("div",{ref:d,style:{height:i},className:"min-w-0",children:n>24?a({width:n,height:i}):null})}const T=["below_z1","zone_1","zone_2","zone_3","zone_4","zone_5"],S={below_z1:"Below Z1",zone_1:"Z1",zone_2:"Z2",zone_3:"Z3",zone_4:"Z4",zone_5:"Z5"},se={below_z1:"var(--ui-ink-muted)",zone_1:"var(--info)",zone_2:"var(--success)",zone_3:"var(--warning)",zone_4:"var(--tertiary)",zone_5:"var(--danger)"},w={timeInZone:"Each block totals the minutes Forge can place into adaptive HRR zones from stored heart-rate samples. Weekly is the default planning view because it matches common training microcycles; monthly and daily views help detect longer trends or recent spikes.",smartMode:"Smart modes do not change the underlying data. They change the coaching lens: combat readiness prioritizes hard-day spacing and controlled high intensity, aerobic base prioritizes low-zone development, and endurance pro compares the distribution with pyramidal or polarized endurance planning patterns.",interpretation:"This paragraph explains what the selected mode concludes from the latest load balance, zone distribution, hard-day count, and data confidence. It is a planning summary, not a medical clearance.",drivers:"Drivers are the signals helping the selected mode: examples include enough easy/base work, controlled high-zone share, stable acute/chronic load, or improving data quality.",limiters:"Limiters are the signals that should constrain the next block. If Forge lists a limiter, the next target should usually solve that before adding more hard work.",targets:"Next targets translate the selected mode into a practical week and next workout. The range is intentionally bounded so training can progress without turning every good week into a maximal week."};function ne(i){return i.key==="combat_readiness"?"Combat":i.key==="aerobic_base"?"Base":"Endurance"}function de(i){return i>=82?"signal":i>=65?"default":"meta"}function oe(i){switch(i){case"vo2max_4x4":return"4x4 VO2max";case"zone_2_base":return"Zone 2 / base";case"technical_kickboxing":return"Technical kickboxing";case"easy_aerobic":return"Easy aerobic";case"recovery":return"Recovery";default:return i.replaceAll("_"," ")}}function le(i,a){return a==="daily"?i.bucketKey.slice(5):a==="monthly"?i.bucketKey.slice(2):i.bucketKey.replace(/^20/,"'")}function ce(i,a){const d=a==="daily"?30:12;return i.slice(-d).map(n=>({bucket:le(n,a),total:Math.round(n.durationMinutes),load:n.trainingLoad,confidence:n.confidence,...Object.fromEntries(T.map(o=>[o,n.zoneMinutes[o]??0]))}))}function ue(i,a){return i.zoneTimeSeries[a]}function xe({mode:i}){return e.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-muted)]",children:[e.jsx(W,{className:"size-3.5"}),"Drivers",e.jsx(p,{label:"Explain training drivers",title:"Drivers",content:w.drivers})]}),e.jsx("div",{className:"mt-3 grid gap-2 text-[12px] leading-5 text-[var(--ui-ink-medium)]",children:(i.drivers.length>0?i.drivers:["No positive driver is strong enough yet."]).map(a=>e.jsx("div",{children:a},a))})]}),e.jsxs("div",{className:"rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-muted)]",children:[e.jsx(O,{className:"size-3.5"}),"Limiters",e.jsx(p,{label:"Explain training limiters",title:"Limiters",content:w.limiters})]}),e.jsx("div",{className:"mt-3 grid gap-2 text-[12px] leading-5 text-[var(--ui-ink-medium)]",children:(i.limitingFactors.length>0?i.limitingFactors:["No major limiter in this mode right now."]).map(a=>e.jsx("div",{children:a},a))})]})]})}function me({trainingLoad:i}){const[a,d]=m.useState(i.trainingIntelligence.defaultMode),[n,o]=m.useState("weekly"),t=i.trainingIntelligence.modes.find(r=>r.key===a)??i.trainingIntelligence.modes[0],u=ue(i,n),f=m.useMemo(()=>ce(u,n),[u,n]),L=u.slice(-8).reverse();return t?e.jsxs("section",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.25fr)_minmax(340px,0.75fr)]",children:[e.jsxs(h,{className:"overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"font-label text-[10px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Zone intelligence"}),e.jsx(p,{label:"Explain zone intelligence",title:"Time in zone",content:w.timeInZone})]}),e.jsx("div",{className:"mt-2 text-lg text-[var(--ui-ink-strong)]",children:"Time in zone by training block"}),e.jsx("div",{className:"mt-1 max-w-2xl text-[12px] leading-5 text-[var(--ui-ink-muted)]",children:"Weekly by default because most training plans are adjusted week by week. The stacked bars preserve the full zone split, while the table adds load rate, hard days, and data confidence."})]}),e.jsx("div",{className:"grid grid-cols-3 gap-1 rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-1",children:[["weekly","Week"],["monthly","Month"],["daily","90d"]].map(([r,c])=>e.jsx("button",{type:"button",className:`rounded-[6px] px-3 py-1.5 text-[12px] ${n===r?"bg-[var(--ui-surface-2)] text-[var(--ui-ink-strong)]":"text-[var(--ui-ink-muted)]"}`,onClick:()=>o(r),children:c},r))})]}),e.jsx("div",{className:"mt-5",children:e.jsx(M,{height:320,children:({width:r,height:c})=>e.jsxs(Z,{data:f,width:r,height:c,children:[e.jsx(I,{stroke:"var(--ui-border-subtle)",vertical:!1}),e.jsx(C,{dataKey:"bucket",tick:{fill:"var(--ui-ink-muted)",fontSize:10}}),e.jsx(k,{tick:{fill:"var(--ui-ink-muted)",fontSize:10},width:42}),e.jsx(_,{formatter:(v,l)=>[`${Number(v).toFixed(0)} min`,S[l]??String(l)],contentStyle:{background:"var(--ui-surface-modal)",border:"1px solid var(--ui-border-subtle)",borderRadius:8,color:"var(--ui-ink-strong)"}}),T.map(v=>e.jsx(y,{dataKey:v,stackId:"zones",fill:se[v],name:v},v))]})})}),e.jsx("div",{className:"mt-4 grid gap-3 md:hidden",children:L.map(r=>e.jsxs("div",{className:"rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--ui-ink-strong)]",children:r.bucketKey}),e.jsxs("div",{className:"mt-1 text-xs leading-5 text-[var(--ui-ink-muted)]",children:["Load ",r.trainingLoad," · ",r.loadPerMinute," ","TRIMP/min"]})]}),e.jsx(N,{tone:"meta",children:r.confidence})]}),e.jsx("div",{className:"mt-3 grid grid-cols-2 gap-2 text-[12px] min-[360px]:grid-cols-3",children:T.map(c=>e.jsxs("div",{className:"rounded-[8px] bg-[var(--ui-surface-2)] px-2 py-1.5",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.12em] text-[var(--ui-ink-muted)]",children:S[c]}),e.jsxs("div",{className:"mt-0.5 text-[var(--ui-ink-medium)]",children:[r.zoneMinutes[c]," min"]})]},c))}),e.jsxs("div",{className:"mt-3 text-xs leading-5 text-[var(--ui-ink-muted)]",children:[r.hardDayCount," hard day",r.hardDayCount===1?"":"s"," in this block."]})]},r.bucketKey))}),e.jsxs("div",{className:"mt-4 hidden overflow-x-auto rounded-[8px] border border-[var(--ui-border-subtle)] md:block",children:[e.jsxs("div",{className:"grid min-w-[760px] grid-cols-[96px_72px_72px_repeat(6,64px)_72px_80px] bg-[var(--ui-surface-2)] px-3 py-2 text-[10px] uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:[e.jsx("div",{children:"Block"}),e.jsx("div",{children:"Load"}),e.jsx("div",{children:"TRIMP/min"}),T.map(r=>e.jsx("div",{children:S[r]},r)),e.jsx("div",{children:"Hard"}),e.jsx("div",{children:"Quality"})]}),L.map(r=>e.jsxs("div",{className:"grid min-w-[760px] grid-cols-[96px_72px_72px_repeat(6,64px)_72px_80px] border-t border-[var(--ui-border-subtle)] px-3 py-2 text-[12px] text-[var(--ui-ink-medium)]",children:[e.jsx("div",{className:"text-[var(--ui-ink-strong)]",children:r.bucketKey}),e.jsx("div",{children:r.trainingLoad}),e.jsx("div",{children:r.loadPerMinute}),T.map(c=>e.jsx("div",{children:r.zoneMinutes[c]},c)),e.jsx("div",{children:r.hardDayCount}),e.jsx("div",{children:r.confidence})]},r.bucketKey))]})]}),e.jsxs(h,{className:"overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"font-label text-[10px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Smart training mode"}),e.jsx(p,{label:"Explain smart training modes",title:"Training mode",content:w.smartMode})]}),e.jsx("div",{className:"mt-2 text-lg text-[var(--ui-ink-strong)]",children:t.label})]}),e.jsxs(N,{tone:de(t.score),children:[t.score,"/100"]})]}),e.jsx("div",{className:"mt-4 grid grid-cols-3 gap-1 rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-1",children:i.trainingIntelligence.modes.map(r=>e.jsx("button",{type:"button",className:`rounded-[6px] px-2 py-2 text-[12px] ${r.key===t.key?"bg-[var(--ui-surface-2)] text-[var(--ui-ink-strong)]":"text-[var(--ui-ink-muted)]"}`,onClick:()=>d(r.key),children:ne(r)},r.key))}),e.jsxs("div",{className:"mt-4 rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-muted)]",children:[e.jsx(B,{className:"size-3.5"}),"Interpretation",e.jsx(p,{label:"Explain this interpretation",title:"Interpretation",content:w.interpretation})]}),e.jsx("div",{className:"mt-3 text-[13px] leading-5 text-[var(--ui-ink-medium)]",children:t.summary}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-[11px] text-[var(--ui-ink-muted)]",children:[e.jsxs("div",{children:["Balance: ",t.loadBalance.status]}),e.jsxs("div",{children:["Confidence: ",t.confidence]}),e.jsxs("div",{children:["ACWR: ",t.loadBalance.acuteChronicRatio??"n/a"]}),e.jsxs("div",{children:["Baseline:"," ",t.loadBalance.latestWeekBaselineLoadRatio??"n/a","x"]})]})]}),e.jsx("div",{className:"mt-4",children:e.jsx(xe,{mode:t})}),e.jsxs("div",{className:"mt-4 grid gap-3 rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] uppercase tracking-[0.16em] text-[var(--ui-ink-muted)]",children:[e.jsx(K,{className:"size-3.5"}),"Next targets",e.jsx(p,{label:"Explain next training targets",title:"Next targets",content:w.targets})]}),e.jsxs("div",{className:"grid gap-2 text-[12px] leading-5 text-[var(--ui-ink-medium)]",children:[e.jsxs("div",{children:["Next week: ",t.nextWeekTargets.totalMinutesRange[0],"-",t.nextWeekTargets.totalMinutesRange[1]," min · max"," ",t.nextWeekTargets.maxHardSessions," hard sessions · at least ",t.nextWeekTargets.minimumEasyMinutes," easy/base min."]}),e.jsxs("div",{children:["Next workout:"," ",e.jsx("span",{className:"text-[var(--ui-ink-strong)]",children:oe(t.nextWorkout.recommendedType)})," ","for ",t.nextWorkout.durationMinutesRange[0],"-",t.nextWorkout.durationMinutesRange[1]," min, ceiling"," ",t.nextWorkout.intensityCeiling,"."]}),e.jsx("div",{className:"text-[var(--ui-ink-muted)]",children:t.nextWorkout.reason}),t.nextWeekTargets.warning?e.jsx("div",{className:"rounded-[6px] bg-[var(--ui-warning-soft)] px-2 py-1 text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]",children:t.nextWeekTargets.warning}):null]})]})]})]}):null}const he={low:"var(--success)",moderate:"var(--warning)",high:"var(--danger)"},ge={below_z1:"var(--ui-ink-muted)",zone_1:"var(--info)",zone_2:"var(--success)",zone_3:"var(--warning)",zone_4:"var(--tertiary)",zone_5:"var(--danger)"},x={hero:"Forge estimates cardiovascular training stress from stored workouts, heart-rate samples, adaptive heart-rate-reserve zones, and recent vitals. Use this page to decide whether the next training block should build aerobic base, hold load steady, sharpen intensity, or recover. The numbers support coaching decisions; they are not medical diagnosis.",acuteLoad:"Acute load is the last seven days of Forge's TRIMP-like internal load. It rises when workouts are longer, harder, or spend more time in high heart-rate zones. Compare it with chronic load before adding hard sessions.",chronicBase:"Chronic base is the average weekly load over the last 28 days. It is Forge's estimate of the current load you have recently proven you can absorb.",acwr:"ACWR is acute load divided by chronic weekly load. Values near 1.0 usually mean the current week resembles the recent base. High values ask for recovery checks; low values suggest underloading. Treat it as a flag, not a verdict.",vo2max:"VO2max is the latest available wearable estimate in ml/kg/min. Forge shows the recent change when enough points exist, but wearable VO2max can move with device model, terrain, heat, and workout type.",weeklyMap:"This chart combines weekly internal load, training hours, and the share of time in zones 4 and 5. It helps reveal whether fatigue comes from total volume, hard intensity, or both.",adaptationRadar:"The radar compresses six signals into one coach view: current load, base capacity, acute/chronic balance, heart-rate data quality, high-intensity pressure, and VO2max movement.",intensityTarget:"This compares your recent or all-time low, moderate, and high intensity distribution with broad target bands used in endurance and combat-sport conditioning. The target is a planning reference, not a rule.",hrZones:"These bars show minutes in each adaptive HRR zone. Zone 2 is commonly used for aerobic base, zones 4 and 5 for threshold and VO2max work, and below-zone time often reflects warm-up, recovery, or missing cardiovascular load.",dailyTexture:"Daily texture shows whether load spikes are coming from easy volume, threshold work, or high-intensity minutes. It is useful for spacing hard days and avoiding accidental clusters.",sessionSignals:"Recent workout rows expose the session evidence behind the summary: date, activity, training load, high-zone share, heart-rate response, and data confidence.",sportContribution:"Sport contribution groups load by workout type. In kickboxing and other combat sports, wrist heart rate can undercount short striking spikes, so compare this with how the session actually felt."};function A(i,a=0){return i==null||Number.isNaN(i)?"n/a":`${(i*100).toFixed(a)}%`}function b(i,a=0){return i==null||Number.isNaN(i)?"n/a":i.toFixed(a)}function ve(i){switch(i){case"productive":return{label:"Productive",tone:"signal",text:"Acute load is close to the current chronic base."};case"underloaded":return{label:"Underloaded",tone:"meta",text:"The recent week is below the four-week baseline."};case"overload_watch":return{label:"Watch load",tone:"default",text:"Acute load or strain is elevated enough to deserve recovery checks."};default:return{label:"Building signal",tone:"meta",text:"Forge needs more recent training evidence for a cleaner read."}}}function R({label:i,value:a,detail:d,help:n,icon:o}){return e.jsxs(h,{className:"relative min-h-[136px] overflow-hidden",children:[e.jsx("div",{className:"absolute right-3 top-3 rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-2 text-[var(--ui-ink-muted)]",children:e.jsx(o,{className:"size-4"})}),e.jsxs("div",{className:"flex max-w-[80%] items-center gap-1.5",children:[e.jsx("div",{className:"font-label text-[10px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:i}),e.jsx(p,{label:`Explain ${i}`,title:i,content:n})]}),e.jsx("div",{className:"mt-4 font-display text-4xl leading-none text-[var(--ui-ink-strong)]",children:a}),e.jsx("div",{className:"mt-3 max-w-[24rem] text-[12px] leading-5 text-[var(--ui-ink-muted)]",children:d})]})}function j({eyebrow:i,title:a,description:d,help:n,action:o}){return e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"font-label text-[10px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:i}),e.jsx(p,{label:`Explain ${i}`,title:a,content:n})]}),e.jsx("div",{className:"mt-2 text-lg text-[var(--ui-ink-strong)]",children:a}),d?e.jsx("div",{className:"mt-1 max-w-2xl text-[12px] leading-5 text-[var(--ui-ink-muted)]",children:d}):null]}),o?e.jsx("div",{className:"shrink-0",children:o}):null]})}function pe(i){return i.weeklyLoad.map(a=>({week:a.weekKey.replace(/^20/,"'"),load:a.trainingLoad,hours:a.durationHours,loadPerHour:a.loadPerHour,high:Math.round(a.highPercentage*100),moderate:Math.round(a.moderatePercentage*100),low:Math.round(a.lowPercentage*100)}))}function be(i){return i.dailyLoad.map(a=>({date:a.dateKey.slice(5),load:a.trainingLoad,high:a.highIntensityMinutes,moderate:a.moderateIntensityMinutes,low:a.lowIntensityMinutes}))}function je(i,a){return(a==="recent"?i.recentIntensityDistribution:i.intensityDistribution).map(n=>({...n,percent:Math.round(n.percentage*100),targetLow:Math.round(n.targetRange[0]*100),targetHigh:Math.round(n.targetRange[1]*100),fill:he[n.key]??"var(--ui-ink-medium)"}))}function fe(i,a){return(a==="recent"?i.recentZoneTotals:i.zoneTotals).map(n=>({...n,minutes:Math.round(n.seconds/60),percent:Math.round(n.percentage*100),fill:ge[n.key]??"var(--ui-ink-medium)"}))}function ke(i){const a=i.summary,d=a.acuteChronicRatio==null?45:Math.max(0,Math.min(100,100-Math.abs(a.acuteChronicRatio-1)*80));return[{axis:"Load",value:Math.min(100,a.acuteLoad7d/3)},{axis:"Base",value:Math.min(100,a.chronicWeeklyLoad28d/3)},{axis:"Balance",value:d},{axis:"Quality",value:Math.min(100,a.averageHeartRateCoverage*100)},{axis:"High",value:Math.min(100,a.highIntensityMinutes7d*1.8)},{axis:"VO2",value:a.vo2MaxDelta==null?50:Math.max(0,Math.min(100,50+a.vo2MaxDelta*10))}]}function ye({sessions:i}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid gap-3 md:hidden",children:i.slice(0,20).map(a=>e.jsxs("div",{className:"rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-sm font-medium text-[var(--ui-ink-medium)]",children:a.workoutTypeLabel}),e.jsxs("div",{className:"mt-1 text-[11px] text-[var(--ui-ink-muted)]",children:[a.dateKey.slice(5)," ·"," ",b(a.durationMinutes,0),"m ·"," ",a.confidence]})]}),e.jsxs(N,{tone:"meta",children:[b(a.trainingLoad,0)," load"]})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-[12px] text-[var(--ui-ink-medium)]",children:[e.jsxs("div",{className:"rounded-[8px] bg-[var(--ui-surface-2)] px-2 py-1.5",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"Z4+Z5"}),e.jsx("div",{className:"mt-0.5 text-[var(--ui-ink-strong)]",children:A(a.highIntensityPercentage)})]}),e.jsxs("div",{className:"rounded-[8px] bg-[var(--ui-surface-2)] px-2 py-1.5",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.14em] text-[var(--ui-ink-muted)]",children:"HR"}),e.jsxs("div",{className:"mt-0.5 text-[var(--ui-ink-strong)]",children:[a.averageHr?Math.round(a.averageHr):"n/a",a.maxHr?`/${Math.round(a.maxHr)}`:""]})]})]})]},a.id))}),e.jsxs("div",{className:"hidden overflow-hidden rounded-[8px] border border-[var(--ui-border-subtle)] md:block",children:[e.jsxs("div",{className:"grid grid-cols-[88px_minmax(118px,1fr)_64px_72px_72px] bg-[var(--ui-surface-2)] px-3 py-2 text-[10px] uppercase tracking-[0.16em] text-[var(--ui-ink-muted)]",children:[e.jsx("div",{children:"Date"}),e.jsx("div",{children:"Session"}),e.jsx("div",{children:"Load"}),e.jsx("div",{children:"Z4+Z5"}),e.jsx("div",{children:"HR"})]}),e.jsx("div",{className:"max-h-[370px] overflow-auto",children:i.slice(0,20).map(a=>e.jsxs("div",{className:"grid grid-cols-[88px_minmax(118px,1fr)_64px_72px_72px] border-t border-[var(--ui-border-subtle)] px-3 py-2 text-[12px] text-[var(--ui-ink-medium)]",children:[e.jsx("div",{className:"text-[var(--ui-ink-strong)]/52",children:a.dateKey.slice(5)}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-[var(--ui-ink-medium)]",children:a.workoutTypeLabel}),e.jsxs("div",{className:"mt-0.5 text-[10px] text-[var(--ui-ink-muted)]",children:[b(a.durationMinutes,0),"m ·"," ",a.confidence]})]}),e.jsx("div",{className:"text-[var(--ui-ink-strong)]",children:b(a.trainingLoad,0)}),e.jsx("div",{children:A(a.highIntensityPercentage)}),e.jsxs("div",{children:[a.averageHr?Math.round(a.averageHr):"n/a",a.maxHr?`/${Math.round(a.maxHr)}`:""]})]},a.id))})]})]})}function Ce(){const i=U(),a=Array.isArray(i.selectedUserIds)?i.selectedUserIds:[],[d,n]=m.useState("recent"),o=G({queryKey:["forge-training-load",...a],queryFn:async()=>(await Y(a)).trainingLoad}),t=o.data,u=ve((t==null?void 0:t.summary.readiness)??"insufficient_data"),f=m.useMemo(()=>t?pe(t):[],[t]),L=m.useMemo(()=>t?be(t):[],[t]),r=m.useMemo(()=>t?je(t,d):[],[d,t]),c=m.useMemo(()=>t?fe(t,d):[],[d,t]),v=m.useMemo(()=>t?ke(t):[],[t]);if(o.isLoading)return e.jsx(q,{eyebrow:"Training Load",title:"Loading cardiovascular model",description:"Computing acute load, zone distribution, and target bands from workout evidence.",columns:3,blocks:8});if(o.isError||!t)return e.jsx(Q,{eyebrow:"Training Load",error:o.error??new Error("Training load data unavailable"),onRetry:()=>void o.refetch()});const{summary:l}=t;return e.jsxs("div",{className:"grid gap-5",children:[e.jsx(re,{eyebrow:"Health",entityKind:"habit",title:"Training Load",titleText:"Training Load",description:"Forge estimates cardiovascular training stress from workout duration, heart-rate response, adaptive HRR zones, and recent vitals so you can plan the next training block with clearer load and recovery context.",helpContent:x.hero,badge:`${l.sessionCount} sessions · ${l.reliableSessionCount} high-resolution`,actions:e.jsx(N,{tone:u.tone,children:u.label})}),e.jsxs("section",{className:"grid gap-4 lg:grid-cols-4",children:[R({label:"Acute load",value:b(l.acuteLoad7d,0),detail:`Last 7 days of internal load. ${u.text}`,help:x.acuteLoad,icon:$}),R({label:"Chronic base",value:b(l.chronicWeeklyLoad28d,0),detail:"Average weekly load across the last 28 days.",help:x.chronicBase,icon:F}),R({label:"ACWR",value:b(l.acuteChronicRatio,2),detail:"Acute load divided by chronic weekly load. Useful as a flag, not a verdict.",help:x.acwr,icon:W}),R({label:"VO2 max",value:l.vo2MaxLatest?b(l.vo2MaxLatest,1):"n/a",detail:l.vo2MaxDelta==null?"No delta available yet.":`${l.vo2MaxDelta>=0?"+":""}${l.vo2MaxDelta} since the first recent point.`,help:x.vo2max,icon:V})]}),e.jsx(me,{trainingLoad:t}),e.jsxs("section",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.35fr)_minmax(320px,0.65fr)]",children:[e.jsxs(h,{className:"overflow-hidden",children:[e.jsx(j,{eyebrow:"Weekly load map",title:"Load, hours, and high-intensity share over the last 26 weeks.",description:"Load estimates internal stress; hours show volume; the red line shows how much of each week landed in zones 4 and 5.",help:x.weeklyMap,action:e.jsx(N,{tone:"meta",children:"TRIMP · HRR zones"})}),e.jsx("div",{className:"mt-5",children:e.jsx(M,{height:340,children:({width:s,height:g})=>e.jsxs(E,{data:f,width:s,height:g,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"trainingLoadFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--info)",stopOpacity:.38}),e.jsx("stop",{offset:"100%",stopColor:"var(--info)",stopOpacity:.04})]})}),e.jsx(I,{stroke:"var(--ui-border-subtle)",vertical:!1}),e.jsx(C,{dataKey:"week",tick:{fill:"var(--ui-ink-muted)",fontSize:10}}),e.jsx(k,{yAxisId:"load",tick:{fill:"var(--ui-ink-muted)",fontSize:10},width:42}),e.jsx(k,{yAxisId:"pct",orientation:"right",domain:[0,100],tick:{fill:"var(--ui-ink-muted)",fontSize:10},width:38}),e.jsx(_,{contentStyle:{background:"var(--ui-surface-modal)",border:"1px solid var(--ui-border-subtle)",borderRadius:8,color:"var(--ui-ink-strong)"}}),e.jsx(X,{yAxisId:"load",type:"monotone",dataKey:"load",name:"Training load",stroke:"var(--info)",fill:"url(#trainingLoadFill)",strokeWidth:2}),e.jsx(y,{yAxisId:"load",dataKey:"hours",name:"Hours",fill:"var(--primary)",radius:[3,3,0,0]}),e.jsx(D,{yAxisId:"pct",type:"monotone",dataKey:"high",name:"Z4+Z5 %",stroke:"var(--danger)",strokeWidth:2.4,dot:{r:2}})]})})})]}),e.jsxs(h,{className:"overflow-hidden",children:[e.jsx(j,{eyebrow:"Adaptation radar",title:"Current signal balance",description:"A compact coach view of load, base, balance, data quality, high-intensity pressure, and VO2max movement.",help:x.adaptationRadar}),e.jsx("div",{className:"mt-4",children:e.jsx(M,{height:300,children:({width:s,height:g})=>e.jsxs(J,{data:v,width:s,height:g,children:[e.jsx(ee,{stroke:"var(--ui-border-subtle)"}),e.jsx(ae,{dataKey:"axis",tick:{fill:"var(--ui-ink-muted)",fontSize:10}}),e.jsx(ie,{dataKey:"value",stroke:"var(--success)",fill:"var(--success)",fillOpacity:.24}),e.jsx(_,{contentStyle:{background:"var(--ui-surface-modal)",border:"1px solid var(--ui-border-subtle)",borderRadius:8,color:"var(--ui-ink-strong)"}})]})})})]})]}),e.jsxs("section",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.8fr)_minmax(0,1.2fr)]",children:[e.jsxs(h,{children:[e.jsx(j,{eyebrow:"Intensity target",title:"Distribution vs target bands",description:"Compare the selected time window with broad low, moderate, and high intensity bands.",help:x.intensityTarget,action:e.jsx("div",{className:"grid grid-cols-2 gap-1 rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-1",children:[["recent","28d"],["all","All"]].map(([s,g])=>e.jsx("button",{type:"button",className:`rounded-[6px] px-3 py-1.5 text-[12px] ${d===s?"bg-[var(--ui-surface-2)] text-[var(--ui-ink-strong)]":"text-[var(--ui-ink-muted)]"}`,onClick:()=>n(s),children:g},s))})}),e.jsx("div",{className:"mt-4 grid gap-3",children:r.map(s=>e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 text-[12px]",children:[e.jsx("span",{className:"text-[var(--ui-ink-medium)]",children:s.label}),e.jsxs("span",{className:"text-[var(--ui-ink-strong)]",children:[s.percent,"% · target ",s.targetLow,"-",s.targetHigh,"%"]})]}),e.jsxs("div",{className:"relative h-3 overflow-hidden rounded-full bg-[var(--ui-surface-2)]",children:[e.jsx("div",{className:"absolute inset-y-0 rounded-full bg-[var(--ui-surface-2)]",style:{left:`${s.targetLow}%`,width:`${Math.max(2,s.targetHigh-s.targetLow)}%`}}),e.jsx("div",{className:"relative h-full rounded-full",style:{width:`${Math.max(1,s.percent)}%`,background:s.fill}})]})]},s.key))}),e.jsx("div",{className:"mt-5 grid gap-2 rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-3 text-[12px] leading-5 text-[var(--ui-ink-muted)]",children:t.targetModel.monitoringNotes.map(s=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(K,{className:"mt-0.5 size-3.5 shrink-0 text-[var(--primary)]"}),e.jsx("span",{children:s})]},s))})]}),e.jsxs(h,{children:[e.jsx(j,{eyebrow:"HR zones",title:`Detailed zone distribution for ${d==="recent"?"the last 28 days":"all available sessions"}.`,help:x.hrZones}),e.jsx("div",{className:"mt-4",children:e.jsx(M,{height:290,children:({width:s,height:g})=>e.jsxs(Z,{data:c,width:s,height:g,children:[e.jsx(I,{stroke:"var(--ui-border-subtle)",vertical:!1}),e.jsx(C,{dataKey:"label",interval:0,tick:{fill:"var(--ui-ink-muted)",fontSize:10}}),e.jsx(k,{tick:{fill:"var(--ui-ink-muted)",fontSize:10},width:38}),e.jsx(_,{formatter:(z,H)=>[H==="minutes"?`${z} min`:`${z}%`,H],contentStyle:{background:"var(--ui-surface-modal)",border:"1px solid var(--ui-border-subtle)",borderRadius:8,color:"var(--ui-ink-strong)"}}),e.jsx(y,{dataKey:"minutes",name:"minutes",radius:[4,4,0,0],children:c.map(z=>e.jsx(te,{fill:z.fill},z.key))})]})})})]})]}),e.jsxs("section",{className:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_420px]",children:[e.jsxs(h,{children:[e.jsx(j,{eyebrow:"Daily load texture",title:"Easy, threshold, and high-intensity minutes against daily load.",help:x.dailyTexture}),e.jsx("div",{className:"mt-4",children:e.jsx(M,{height:310,children:({width:s,height:g})=>e.jsxs(E,{data:L,width:s,height:g,children:[e.jsx(I,{stroke:"var(--ui-border-subtle)",vertical:!1}),e.jsx(C,{dataKey:"date",tick:{fill:"var(--ui-ink-muted)",fontSize:10}}),e.jsx(k,{yAxisId:"minutes",tick:{fill:"var(--ui-ink-muted)",fontSize:10},width:38}),e.jsx(k,{yAxisId:"load",orientation:"right",tick:{fill:"var(--ui-ink-muted)",fontSize:10},width:38}),e.jsx(_,{contentStyle:{background:"var(--ui-surface-modal)",border:"1px solid var(--ui-border-subtle)",borderRadius:8,color:"var(--ui-ink-strong)"}}),e.jsx(y,{yAxisId:"minutes",dataKey:"low",stackId:"zones",fill:"var(--success)",name:"low min"}),e.jsx(y,{yAxisId:"minutes",dataKey:"moderate",stackId:"zones",fill:"var(--warning)",name:"threshold min"}),e.jsx(y,{yAxisId:"minutes",dataKey:"high",stackId:"zones",fill:"var(--danger)",name:"high min"}),e.jsx(D,{yAxisId:"load",type:"monotone",dataKey:"load",stroke:"var(--info)",strokeWidth:2.2,dot:!1})]})})})]}),e.jsxs(h,{children:[e.jsx(j,{eyebrow:"Session signals",title:"Recent workouts",help:x.sessionSignals,action:e.jsxs(N,{tone:"meta",children:[l.hardDayCount7d," hard days / 7d"]})}),e.jsx("div",{className:"mt-4",children:e.jsx(ye,{sessions:t.sessionSignals})})]})]}),e.jsxs("section",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]",children:[e.jsxs(h,{children:[e.jsx(j,{eyebrow:"Sport contribution",title:"Load by workout type",help:x.sportContribution}),e.jsx("div",{className:"mt-3 grid gap-3",children:t.activityBreakdown.slice(0,8).map(s=>e.jsxs("div",{className:"grid gap-2 rounded-[8px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-3 sm:grid-cols-[minmax(0,1fr)_76px_76px_76px]",children:[e.jsxs("div",{children:[e.jsx("div",{className:"truncate text-sm text-[var(--ui-ink-strong)]",children:s.workoutTypeLabel}),e.jsxs("div",{className:"mt-1 text-[11px] text-[var(--ui-ink-muted)]",children:[s.sessionCount," sessions ·"," ",s.activityFamilyLabel]})]}),e.jsxs("div",{className:"text-[12px] text-[var(--ui-ink-medium)]",children:[e.jsxs("span",{className:"block text-[var(--ui-ink-strong)]",children:[s.durationHours,"h"]}),"volume"]}),e.jsxs("div",{className:"text-[12px] text-[var(--ui-ink-medium)]",children:[e.jsx("span",{className:"block text-[var(--ui-ink-strong)]",children:s.trainingLoad}),"load"]}),e.jsxs("div",{className:"text-[12px] text-[var(--ui-ink-medium)]",children:[e.jsx("span",{className:"block text-[var(--ui-ink-strong)]",children:A(s.highPercentage)}),"high"]})]},s.workoutType))})]}),e.jsxs(h,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(P,{className:"size-4 text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]"}),e.jsx("div",{className:"font-label text-[10px] uppercase tracking-[0.18em] text-[var(--ui-ink-muted)]",children:"Interpretation guardrails"})]}),e.jsxs("div",{className:"mt-4 grid gap-3 text-[12px] leading-5 text-[var(--ui-ink-muted)]",children:[e.jsx("p",{children:"Forge is estimating training stress from heart-rate reserve zones and a TRIMP-like load. This is good for trend decisions, but it is not a substitute for lactate testing, gas exchange thresholds, or coach-led periodization."}),e.jsx("p",{children:"Combat sports add sensor noise: wrist HR can miss short spikes during punching and clinch work. Treat high-intensity minutes as minimum evidence when the session had a lot of arm motion."}),e.jsx("p",{children:"The practical target is not maximum Z5. Keep hard combat sessions meaningful, then add easy aerobic base when the high-intensity share is already high."})]})]})]})]})}export{Ce as TrainingLoadPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,j as g,E as Ce,F as Je,G as Qe,H as et,_ as tt,J as nt,K as _,L as Se,N as rt,O as ot,P as at}from"./vendor-Dnkkx2co.js";function O(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ue(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Re(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ue(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ue(e[o],null)}}}}function I(...e){return a.useCallback(Re(...e),e)}function it(e,t){const n=a.createContext(t),r=i=>{const{children:c,...s}=i,d=a.useMemo(()=>s,Object.values(s));return g.jsx(n.Provider,{value:d,children:c})};r.displayName=e+"Provider";function o(i){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function st(e,t=[]){let n=[];function r(i,c){const s=a.createContext(c),d=n.length;n=[...n,c];const l=v=>{var E;const{scope:h,children:p,...R}=v,u=((E=h==null?void 0:h[e])==null?void 0:E[d])||s,m=a.useMemo(()=>R,Object.values(R));return g.jsx(u.Provider,{value:m,children:p})};l.displayName=i+"Provider";function f(v,h){var u;const p=((u=h==null?void 0:h[e])==null?void 0:u[d])||s,R=a.useContext(p);if(R)return R;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(c=>a.createContext(c));return function(s){const d=(s==null?void 0:s[e])||i;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return o.scopeName=e,[r,ct(o,...t)]}function ct(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const c=r.reduce((s,{useScope:d,scopeName:l})=>{const v=d(i)[`__scope${l}`];return{...s,...v}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var j=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},ut=Ce[" useId ".trim().toString()]||(()=>{}),lt=0;function q(e){const[t,n]=a.useState(ut());return j(()=>{n(r=>r??String(lt++))},[e]),e||(t?`radix-${t}`:"")}var dt=Ce[" useInsertionEffect ".trim().toString()]||j;function ft({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,c]=vt({defaultProp:t,onChange:n}),s=e!==void 0,d=s?e:o;{const f=a.useRef(e!==void 0);a.useEffect(()=>{const v=f.current;v!==s&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const l=a.useCallback(f=>{var v;if(s){const h=mt(f)?f(e):f;h!==e&&((v=c.current)==null||v.call(c,h))}else i(f)},[s,e,i,c]);return[d,l]}function vt({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),i=a.useRef(t);return dt(()=>{i.current=t},[t]),a.useEffect(()=>{var c;o.current!==n&&((c=i.current)==null||c.call(i,n),o.current=n)},[n,o]),[n,r,i]}function mt(e){return typeof e=="function"}function we(e){const t=gt(e),n=a.forwardRef((r,o)=>{const{children:i,...c}=r,s=a.Children.toArray(i),d=s.find(pt);if(d){const l=d.props.children,f=s.map(v=>v===d?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:v);return g.jsx(t,{...c,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,f):null})}return g.jsx(t,{...c,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function gt(e){const t=a.forwardRef((n,r)=>{const{children:o,...i}=n;if(a.isValidElement(o)){const c=yt(o),s=Et(i,o.props);return o.type!==a.Fragment&&(s.ref=r?Re(r,c):c),a.cloneElement(o,s)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ht=Symbol("radix.slottable");function pt(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ht}function Et(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const d=i(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function yt(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=bt.reduce((e,t)=>{const n=we(`Primitive.${t}`),r=a.forwardRef((o,i)=>{const{asChild:c,...s}=o,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(d,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ct(e,t){e&&Je.flushSync(()=>e.dispatchEvent(t))}function B(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function St(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Rt="DismissableLayer",re="dismissableLayer.update",wt="dismissableLayer.pointerDownOutside",Pt="dismissableLayer.focusOutside",le,Pe=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ne=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...d}=e,l=a.useContext(Pe),[f,v]=a.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=a.useState({}),R=I(t,y=>v(y)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),E=u.indexOf(m),b=f?u.indexOf(f):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=E,w=xt(y=>{const T=y.target,L=[...l.branches].some(W=>W.contains(T));!S||L||(o==null||o(y),c==null||c(y),y.defaultPrevented||s==null||s())},h),P=Ot(y=>{const T=y.target;[...l.branches].some(W=>W.contains(T))||(i==null||i(y),c==null||c(y),y.defaultPrevented||s==null||s())},h);return St(y=>{b===l.layers.size-1&&(r==null||r(y),!y.defaultPrevented&&s&&(y.preventDefault(),s()))},h),a.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(le=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),de(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=le)}},[f,h,n,l]),a.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),de())},[f,l]),a.useEffect(()=>{const y=()=>p({});return document.addEventListener(re,y),()=>document.removeEventListener(re,y)},[]),g.jsx(D.div,{...d,ref:R,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:O(e.onFocusCapture,P.onFocusCapture),onBlurCapture:O(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:O(e.onPointerDownCapture,w.onPointerDownCapture)})});Ne.displayName=Rt;var Nt="DismissableLayerBranch",Dt=a.forwardRef((e,t)=>{const n=a.useContext(Pe),r=a.useRef(null),o=I(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(D.div,{...e,ref:o})});Dt.displayName=Nt;function xt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let d=function(){De(wt,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ot(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&De(Pt,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function de(){const e=new CustomEvent(re);document.dispatchEvent(e)}function De(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ct(o,i):o.dispatchEvent(i)}var J="focusScope.autoFocusOnMount",Q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},Tt="FocusScope",xe=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...c}=e,[s,d]=a.useState(null),l=B(o),f=B(i),v=a.useRef(null),h=I(t,u=>d(u)),p=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let u=function(C){if(p.paused||!s)return;const S=C.target;s.contains(S)?v.current=S:x(v.current,{select:!0})},m=function(C){if(p.paused||!s)return;const S=C.relatedTarget;S!==null&&(s.contains(S)||x(v.current,{select:!0}))},E=function(C){if(document.activeElement===document.body)for(const w of C)w.removedNodes.length>0&&x(s)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const b=new MutationObserver(E);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),b.disconnect()}}},[r,s,p.paused]),a.useEffect(()=>{if(s){me.add(p);const u=document.activeElement;if(!s.contains(u)){const E=new CustomEvent(J,fe);s.addEventListener(J,l),s.dispatchEvent(E),E.defaultPrevented||(At(_t(Oe(s)),{select:!0}),document.activeElement===u&&x(s))}return()=>{s.removeEventListener(J,l),setTimeout(()=>{const E=new CustomEvent(Q,fe);s.addEventListener(Q,f),s.dispatchEvent(E),E.defaultPrevented||x(u??document.body,{select:!0}),s.removeEventListener(Q,f),me.remove(p)},0)}}},[s,l,f,p]);const R=a.useCallback(u=>{if(!n&&!r||p.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,E=document.activeElement;if(m&&E){const b=u.currentTarget,[C,S]=It(b);C&&S?!u.shiftKey&&E===S?(u.preventDefault(),n&&x(C,{select:!0})):u.shiftKey&&E===C&&(u.preventDefault(),n&&x(S,{select:!0})):E===b&&u.preventDefault()}},[n,r,p.paused]);return g.jsx(D.div,{tabIndex:-1,...c,ref:h,onKeyDown:R})});xe.displayName=Tt;function At(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(x(r,{select:t}),document.activeElement!==n)return}function It(e){const t=Oe(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function Oe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!Lt(n,{upTo:t}))return n}function Lt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Mt(e){return e instanceof HTMLInputElement&&"select"in e}function x(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Mt(e)&&t&&e.select()}}var me=Ft();function Ft(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ge(e,t),e.unshift(t)},remove(t){var n;e=ge(e,t),(n=e[0])==null||n.resume()}}}function ge(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _t(e){return e.filter(t=>t.tagName!=="A")}var kt="Portal",Te=a.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=a.useState(!1);j(()=>i(!0),[]);const c=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return c?Qe.createPortal(g.jsx(D.div,{...r,ref:t}),c):null});Te.displayName=kt;function Wt(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var X=e=>{const{present:t,children:n}=e,r=jt(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),i=I(r.ref,Bt(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:i}):null};X.displayName="Presence";function jt(e){const[t,n]=a.useState(),r=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),c=e?"mounted":"unmounted",[s,d]=Wt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const l=$(r.current);i.current=s==="mounted"?l:"none"},[s]),j(()=>{const l=r.current,f=o.current;if(f!==e){const h=i.current,p=$(l);e?d("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),j(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,v=p=>{const u=$(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&u&&(d("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=p=>{p.target===t&&(i.current=$(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function $(e){return(e==null?void 0:e.animationName)||"none"}function Bt(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ee=0;function Ut(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??he()),document.body.insertAdjacentElement("beforeend",e[1]??he()),ee++,()=>{ee===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ee--}},[])}function he(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var G="right-scroll-bar-position",Y="width-before-scroll-bar",$t="with-scroll-bars-hidden",Vt="--removed-body-scroll-bar-size",Ae=et(),te=function(){},z=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:te,onWheelCapture:te,onTouchMoveCapture:te}),o=r[0],i=r[1],c=e.forwardProps,s=e.children,d=e.className,l=e.removeScrollBar,f=e.enabled,v=e.shards,h=e.sideCar,p=e.noRelative,R=e.noIsolation,u=e.inert,m=e.allowPinchZoom,E=e.as,b=E===void 0?"div":E,C=e.gapMode,S=tt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,P=nt([n,t]),y=_(_({},S),o);return a.createElement(a.Fragment,null,f&&a.createElement(w,{sideCar:Ae,removeScrollBar:l,shards:v,noRelative:p,noIsolation:R,inert:u,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:C}),c?a.cloneElement(a.Children.only(s),_(_({},y),{ref:P})):a.createElement(b,_({},y,{className:d,ref:P}),s))});z.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};z.classNames={fullWidth:Y,zeroRight:G};var Kt={left:0,top:0,right:0,gap:0},ne=function(e){return parseInt(e||"",10)||0},Gt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ne(n),ne(r),ne(o)]},Yt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kt;var t=Gt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ht=Se(),k="data-scroll-locked",Xt=function(e,t,n,r){var o=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
import{r as a,j as g,E as Ce,F as Je,G as Qe,H as et,_ as tt,J as nt,K as _,L as Se,N as rt,O as ot,P as at}from"./vendor-Cpmju3nw.js";function O(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ue(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Re(...e){return t=>{let n=!1;const r=e.map(o=>{const i=ue(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():ue(e[o],null)}}}}function I(...e){return a.useCallback(Re(...e),e)}function it(e,t){const n=a.createContext(t),r=i=>{const{children:c,...s}=i,d=a.useMemo(()=>s,Object.values(s));return g.jsx(n.Provider,{value:d,children:c})};r.displayName=e+"Provider";function o(i){const c=a.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function st(e,t=[]){let n=[];function r(i,c){const s=a.createContext(c),d=n.length;n=[...n,c];const l=v=>{var E;const{scope:h,children:p,...R}=v,u=((E=h==null?void 0:h[e])==null?void 0:E[d])||s,m=a.useMemo(()=>R,Object.values(R));return g.jsx(u.Provider,{value:m,children:p})};l.displayName=i+"Provider";function f(v,h){var u;const p=((u=h==null?void 0:h[e])==null?void 0:u[d])||s,R=a.useContext(p);if(R)return R;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(c=>a.createContext(c));return function(s){const d=(s==null?void 0:s[e])||i;return a.useMemo(()=>({[`__scope${e}`]:{...s,[e]:d}}),[s,d])}};return o.scopeName=e,[r,ct(o,...t)]}function ct(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const c=r.reduce((s,{useScope:d,scopeName:l})=>{const v=d(i)[`__scope${l}`];return{...s,...v}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var j=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},ut=Ce[" useId ".trim().toString()]||(()=>{}),lt=0;function q(e){const[t,n]=a.useState(ut());return j(()=>{n(r=>r??String(lt++))},[e]),e||(t?`radix-${t}`:"")}var dt=Ce[" useInsertionEffect ".trim().toString()]||j;function ft({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,c]=vt({defaultProp:t,onChange:n}),s=e!==void 0,d=s?e:o;{const f=a.useRef(e!==void 0);a.useEffect(()=>{const v=f.current;v!==s&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const l=a.useCallback(f=>{var v;if(s){const h=mt(f)?f(e):f;h!==e&&((v=c.current)==null||v.call(c,h))}else i(f)},[s,e,i,c]);return[d,l]}function vt({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),i=a.useRef(t);return dt(()=>{i.current=t},[t]),a.useEffect(()=>{var c;o.current!==n&&((c=i.current)==null||c.call(i,n),o.current=n)},[n,o]),[n,r,i]}function mt(e){return typeof e=="function"}function we(e){const t=gt(e),n=a.forwardRef((r,o)=>{const{children:i,...c}=r,s=a.Children.toArray(i),d=s.find(pt);if(d){const l=d.props.children,f=s.map(v=>v===d?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:v);return g.jsx(t,{...c,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,f):null})}return g.jsx(t,{...c,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function gt(e){const t=a.forwardRef((n,r)=>{const{children:o,...i}=n;if(a.isValidElement(o)){const c=yt(o),s=Et(i,o.props);return o.type!==a.Fragment&&(s.ref=r?Re(r,c):c),a.cloneElement(o,s)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ht=Symbol("radix.slottable");function pt(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ht}function Et(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{const d=i(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function yt(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],D=bt.reduce((e,t)=>{const n=we(`Primitive.${t}`),r=a.forwardRef((o,i)=>{const{asChild:c,...s}=o,d=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(d,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ct(e,t){e&&Je.flushSync(()=>e.dispatchEvent(t))}function B(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function St(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Rt="DismissableLayer",re="dismissableLayer.update",wt="dismissableLayer.pointerDownOutside",Pt="dismissableLayer.focusOutside",le,Pe=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ne=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:c,onDismiss:s,...d}=e,l=a.useContext(Pe),[f,v]=a.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=a.useState({}),R=I(t,y=>v(y)),u=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),E=u.indexOf(m),b=f?u.indexOf(f):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=E,w=xt(y=>{const T=y.target,L=[...l.branches].some(W=>W.contains(T));!S||L||(o==null||o(y),c==null||c(y),y.defaultPrevented||s==null||s())},h),P=Ot(y=>{const T=y.target;[...l.branches].some(W=>W.contains(T))||(i==null||i(y),c==null||c(y),y.defaultPrevented||s==null||s())},h);return St(y=>{b===l.layers.size-1&&(r==null||r(y),!y.defaultPrevented&&s&&(y.preventDefault(),s()))},h),a.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(le=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),de(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=le)}},[f,h,n,l]),a.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),de())},[f,l]),a.useEffect(()=>{const y=()=>p({});return document.addEventListener(re,y),()=>document.removeEventListener(re,y)},[]),g.jsx(D.div,{...d,ref:R,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:O(e.onFocusCapture,P.onFocusCapture),onBlurCapture:O(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:O(e.onPointerDownCapture,w.onPointerDownCapture)})});Ne.displayName=Rt;var Nt="DismissableLayerBranch",Dt=a.forwardRef((e,t)=>{const n=a.useContext(Pe),r=a.useRef(null),o=I(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(D.div,{...e,ref:o})});Dt.displayName=Nt;function xt(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let d=function(){De(wt,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=d,t.addEventListener("click",o.current,{once:!0})):d()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ot(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&De(Pt,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function de(){const e=new CustomEvent(re);document.dispatchEvent(e)}function De(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Ct(o,i):o.dispatchEvent(i)}var J="focusScope.autoFocusOnMount",Q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},Tt="FocusScope",xe=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...c}=e,[s,d]=a.useState(null),l=B(o),f=B(i),v=a.useRef(null),h=I(t,u=>d(u)),p=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let u=function(C){if(p.paused||!s)return;const S=C.target;s.contains(S)?v.current=S:x(v.current,{select:!0})},m=function(C){if(p.paused||!s)return;const S=C.relatedTarget;S!==null&&(s.contains(S)||x(v.current,{select:!0}))},E=function(C){if(document.activeElement===document.body)for(const w of C)w.removedNodes.length>0&&x(s)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const b=new MutationObserver(E);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),b.disconnect()}}},[r,s,p.paused]),a.useEffect(()=>{if(s){me.add(p);const u=document.activeElement;if(!s.contains(u)){const E=new CustomEvent(J,fe);s.addEventListener(J,l),s.dispatchEvent(E),E.defaultPrevented||(At(_t(Oe(s)),{select:!0}),document.activeElement===u&&x(s))}return()=>{s.removeEventListener(J,l),setTimeout(()=>{const E=new CustomEvent(Q,fe);s.addEventListener(Q,f),s.dispatchEvent(E),E.defaultPrevented||x(u??document.body,{select:!0}),s.removeEventListener(Q,f),me.remove(p)},0)}}},[s,l,f,p]);const R=a.useCallback(u=>{if(!n&&!r||p.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,E=document.activeElement;if(m&&E){const b=u.currentTarget,[C,S]=It(b);C&&S?!u.shiftKey&&E===S?(u.preventDefault(),n&&x(C,{select:!0})):u.shiftKey&&E===C&&(u.preventDefault(),n&&x(S,{select:!0})):E===b&&u.preventDefault()}},[n,r,p.paused]);return g.jsx(D.div,{tabIndex:-1,...c,ref:h,onKeyDown:R})});xe.displayName=Tt;function At(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(x(r,{select:t}),document.activeElement!==n)return}function It(e){const t=Oe(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function Oe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!Lt(n,{upTo:t}))return n}function Lt(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Mt(e){return e instanceof HTMLInputElement&&"select"in e}function x(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Mt(e)&&t&&e.select()}}var me=Ft();function Ft(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ge(e,t),e.unshift(t)},remove(t){var n;e=ge(e,t),(n=e[0])==null||n.resume()}}}function ge(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _t(e){return e.filter(t=>t.tagName!=="A")}var kt="Portal",Te=a.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,i]=a.useState(!1);j(()=>i(!0),[]);const c=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return c?Qe.createPortal(g.jsx(D.div,{...r,ref:t}),c):null});Te.displayName=kt;function Wt(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var X=e=>{const{present:t,children:n}=e,r=jt(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),i=I(r.ref,Bt(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:i}):null};X.displayName="Presence";function jt(e){const[t,n]=a.useState(),r=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),c=e?"mounted":"unmounted",[s,d]=Wt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const l=$(r.current);i.current=s==="mounted"?l:"none"},[s]),j(()=>{const l=r.current,f=o.current;if(f!==e){const h=i.current,p=$(l);e?d("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(f&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),j(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,v=p=>{const u=$(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&u&&(d("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=p=>{p.target===t&&(i.current=$(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:a.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function $(e){return(e==null?void 0:e.animationName)||"none"}function Bt(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ee=0;function Ut(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??he()),document.body.insertAdjacentElement("beforeend",e[1]??he()),ee++,()=>{ee===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ee--}},[])}function he(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var G="right-scroll-bar-position",Y="width-before-scroll-bar",$t="with-scroll-bars-hidden",Vt="--removed-body-scroll-bar-size",Ae=et(),te=function(){},z=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:te,onWheelCapture:te,onTouchMoveCapture:te}),o=r[0],i=r[1],c=e.forwardProps,s=e.children,d=e.className,l=e.removeScrollBar,f=e.enabled,v=e.shards,h=e.sideCar,p=e.noRelative,R=e.noIsolation,u=e.inert,m=e.allowPinchZoom,E=e.as,b=E===void 0?"div":E,C=e.gapMode,S=tt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,P=nt([n,t]),y=_(_({},S),o);return a.createElement(a.Fragment,null,f&&a.createElement(w,{sideCar:Ae,removeScrollBar:l,shards:v,noRelative:p,noIsolation:R,inert:u,setCallbacks:i,allowPinchZoom:!!m,lockRef:n,gapMode:C}),c?a.cloneElement(a.Children.only(s),_(_({},y),{ref:P})):a.createElement(b,_({},y,{className:d,ref:P}),s))});z.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};z.classNames={fullWidth:Y,zeroRight:G};var Kt={left:0,top:0,right:0,gap:0},ne=function(e){return parseInt(e||"",10)||0},Gt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ne(n),ne(r),ne(o)]},Yt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kt;var t=Gt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ht=Se(),k="data-scroll-locked",Xt=function(e,t,n,r){var o=e.left,i=e.top,c=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat($t,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(s,"px ").concat(r,`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l}from"./vendor-Cpmju3nw.js";function B(a,i,n){return Math.min(n,Math.max(i,a))}function F(a,i,n){const d=(n==null?void 0:n.offset)??8,c=(n==null?void 0:n.margin)??12,w=(n==null?void 0:n.preferredMaxHeight)??320,o=(n==null?void 0:n.minHeight)??160,[b,f]=l.useState(null),s=l.useCallback(()=>{const r=a.current;if(!r||typeof window>"u"){f(null);return}const t=r.getBoundingClientRect(),e=window.visualViewport,g=(e==null?void 0:e.width)??window.innerWidth,H=(e==null?void 0:e.height)??window.innerHeight,u=(e==null?void 0:e.offsetLeft)??0,m=(e==null?void 0:e.offsetTop)??0,L=Math.min(t.width,g-c*2),M=u+g-c-L,y=B(t.left,u+c,M),h=m+H-t.bottom-d-c,v=t.top-m-d-c,x=h<o&&v>h,A=Math.max(o,x?v:h),E=Math.min(w,A),z=x?Math.max(m+c,t.top-d-E):t.bottom+d;f({position:"fixed",left:y,top:z,width:L,maxHeight:E})},[a,c,o,d,w]);return l.useEffect(()=>{if(!i||typeof window>"u"){f(null);return}let r=0;const t=()=>{r===0&&(r=window.requestAnimationFrame(()=>{r=0,s()}))};s();const e=window.visualViewport;return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),e==null||e.addEventListener("resize",t),e==null||e.addEventListener("scroll",t),()=>{r!==0&&window.cancelAnimationFrame(r),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0),e==null||e.removeEventListener("resize",t),e==null||e.removeEventListener("scroll",t)}},[i,s]),b}export{F as u};
|
package/dist/assets/{use-psyche-focus-target-Ct-acS9G.js → use-psyche-focus-target-Cuxni3SK.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n}from"./vendor-
|
|
1
|
+
import{r as n}from"./vendor-Cpmju3nw.js";function t(e){return e.replaceAll("\\","\\\\").replaceAll('"','\\"')}function i(e){n.useEffect(()=>{if(!e||typeof document>"u")return;const o=window.requestAnimationFrame(()=>{const r=document.querySelector(`[data-psyche-focus-id="${t(e)}"]`);r&&r.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})});return()=>window.cancelAnimationFrame(o)},[e])}function s(e){return e?"border-[color-mix(in_srgb,var(--info)_34%,var(--ui-border-subtle)_66%)] bg-[color-mix(in_srgb,var(--info)_12%,var(--ui-surface-1)_88%)] shadow-[var(--ui-shadow-soft)]":""}export{s as p,i as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a,b2 as d,bI as x}from"./vendor-Cpmju3nw.js";import{k as t,c as s}from"./index-wEZUnRh0.js";function c({user:r,compact:i=!1,size:n,className:o}){if(!r)return a.jsx(t,{size:n??(i?"sm":"md"),className:s("border-[var(--ui-border-subtle)] bg-[var(--ui-surface-1)] text-[var(--ui-ink-soft)]",o),children:"Unassigned"});const e=r.kind==="bot"?d:x;return a.jsxs(t,{size:n??(i?"sm":"md"),className:s("max-w-full gap-1.5 border",r.kind==="bot"?"border-[color-mix(in_srgb,var(--info)_24%,transparent)] bg-[var(--ui-info-soft)] text-[color-mix(in_srgb,var(--info)_78%,var(--ui-ink-strong)_22%)]":"border-[color-mix(in_srgb,var(--warning)_24%,transparent)] bg-[var(--ui-warning-soft)] text-[color-mix(in_srgb,var(--warning)_78%,var(--ui-ink-strong)_22%)]",n==="xs"&&"gap-1",o),children:[a.jsx(e,{className:s(n==="xs"?"size-3":"size-3.5","shrink-0")}),a.jsx("span",{className:"truncate",children:r.displayName}),a.jsx("span",{className:"text-[var(--ui-ink-faint)]",children:r.kind})]})}export{c as U};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(n){return n.map(t=>(t==null?void 0:t.trim())??"").filter(Boolean)}function a(n){return Array.isArray(n)?n:[]}function c(n){const t=a(n);return t.length===1?t[0]:null}function r(n){return n?`${n.displayName} · ${n.kind}${n.handle?` · @${n.handle}`:""}`:""}function d(n,t="Default Forge owner"){return n?`Suggested owner: ${n.displayName} · ${n.kind}`:t}function f(n,t){const e=r(t);return e?`${n} · ${e}`:n}function s(n,t,e="No description yet."){return i([n,r(t)]).join(" · ")||e}function l(n,t){const e=t&&"user"in t?t.user:t;return i([...n,e==null?void 0:e.displayName,e==null?void 0:e.handle,e==null?void 0:e.kind,e==null?void 0:e.description]).join(" ").toLowerCase()}export{d as a,l as b,a as c,s as d,f as e,r as f,c as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./vendor-Cpmju3nw.js";function d({value:a,users:i,onChange:s,label:l="Owner",defaultLabel:r="Default Forge owner",help:n}){return t.jsxs("label",{className:"grid gap-2",children:[t.jsx("span",{className:"text-sm font-medium text-white",children:l}),n?t.jsx("span",{className:"text-xs leading-5 text-white/52",children:n}):null,t.jsxs("select",{value:a??"",onChange:e=>s(e.target.value||null),className:"min-h-10 rounded-[var(--radius-control)] border border-white/10 bg-white/[0.04] px-3 py-2 text-sm text-white outline-none transition focus:border-[rgba(192,193,255,0.3)]",children:[t.jsx("option",{value:"",children:r}),i.map(e=>t.jsxs("option",{value:e.id,children:[e.displayName," · ",e.kind]},e.id))]})]})}export{d as U};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as c,j as e,b8 as P,cW as T,aV as L,cX as Q,cN as U,aS as v,cm as $}from"./vendor-Cpmju3nw.js";import{j as E,k as N}from"./state-BtwEvpO6.js";import{c as w,aa as z,cl as O}from"./index-wEZUnRh0.js";import{c as f,a as u,n as m,m as j,j as g}from"./generic-node-view-KePoUF3Z.js";function R(t){const i=new Date(t.getFullYear(),t.getMonth(),1),r=(i.getDay()+6)%7,n=new Date(i);return n.setDate(n.getDate()-r),Array.from({length:35},(a,s)=>{const l=new Date(n);return l.setDate(n.getDate()+s),l})}function _(t,i){return typeof window>"u"?i:window.localStorage.getItem(t)??i}function A(t,i){typeof window>"u"||window.localStorage.setItem(t,i)}function C({compact:t}){const[i,r]=c.useState(()=>new Date);return c.useEffect(()=>{const n=window.setInterval(()=>r(new Date),3e4);return()=>window.clearInterval(n)},[]),e.jsxs("div",{className:"flex h-full flex-col justify-between gap-4 rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white/45",children:[e.jsx(P,{className:"size-4"}),e.jsx("span",{className:"text-[12px] uppercase tracking-[0.16em]",children:"Local time"})]}),e.jsx("div",{className:w("font-display text-white",t?"text-3xl":"text-5xl"),children:new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(i)}),e.jsx("div",{className:"text-sm text-white/58",children:new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric"}).format(i)})]})}function W({compact:t}){const i=new Date,r=c.useMemo(()=>R(i),[i]),n=t?["M","T","W","T","F","S","S"]:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return e.jsxs("div",{className:"grid gap-3 rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-white",children:[e.jsx(L,{className:"size-4 text-[var(--primary)]"}),new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}).format(i)]}),e.jsx("div",{className:"text-[12px] text-white/45",children:t?"Mini":"Month view"})]}),e.jsxs("div",{className:"grid grid-cols-7 gap-1.5",children:[n.map(a=>e.jsx("div",{className:"text-center text-[11px] uppercase tracking-[0.14em] text-white/35",children:a},a)),r.map(a=>{const s=a.getMonth()===i.getMonth(),l=a.toDateString()===i.toDateString();return e.jsx("div",{className:w("flex min-h-9 items-center justify-center rounded-xl text-sm",l?"bg-[var(--primary)] text-slate-950":s?"bg-white/[0.04] text-white/78":"bg-transparent text-white/24"),children:a.getDate()},a.toISOString())})]})]})}function D({surfaceId:t}){const i=`forge.utility.spotify.${t}`,[r,n]=c.useState(()=>_(i,"https://open.spotify.com/"));return c.useEffect(()=>{A(i,r)},[i,r]),e.jsxs("div",{className:"grid h-full gap-3 rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white",children:[e.jsx(Q,{className:"size-4 text-[var(--secondary)]"}),e.jsx("span",{className:"text-sm font-semibold",children:"Spotify link"})]}),e.jsx("input",{value:r,onChange:a=>n(a.target.value),className:"w-full rounded-2xl border border-white/10 bg-white/[0.04] px-3 py-2.5 text-sm text-white outline-none transition focus:border-[rgba(192,193,255,0.35)]",placeholder:"Paste a playlist, album, or artist URL"}),e.jsxs("a",{href:r,target:"_blank",rel:"noreferrer",className:"inline-flex min-h-10 items-center justify-center gap-2 rounded-2xl bg-[rgba(78,222,163,0.14)] px-3 py-2 text-sm font-medium text-[var(--secondary)] transition hover:bg-[rgba(78,222,163,0.22)]",children:["Open Spotify",e.jsx(U,{className:"size-4"})]})]})}function F({compact:t}){const[i,r]=c.useState(null),[n,a]=c.useState("Locating…");return c.useEffect(()=>{if(typeof navigator>"u"||!navigator.geolocation){a("Location unavailable");return}let s=!1;return navigator.geolocation.getCurrentPosition(async l=>{try{const p=await(await fetch(`https://api.open-meteo.com/v1/forecast?latitude=${l.coords.latitude}&longitude=${l.coords.longitude}¤t=temperature_2m,weather_code`)).json();if(s||!p.current)return;r({temperature:Number(p.current.temperature_2m??0),weatherCode:Number(p.current.weather_code??0)}),a("Live")}catch{s||a("Weather unavailable")}},()=>{s||a("Permission denied")},{maximumAge:3e5,timeout:6e3}),()=>{s=!0}},[]),e.jsxs("div",{className:"flex h-full flex-col justify-between gap-4 rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white",children:[e.jsx(T,{className:"size-4 text-[var(--tertiary)]"}),e.jsx("span",{className:"text-sm font-semibold",children:"Weather"})]}),i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:w("font-display text-white",t?"text-3xl":"text-5xl"),children:[Math.round(i.temperature),"°"]}),e.jsxs("div",{className:"text-sm text-white/58",children:["Code ",i.weatherCode," · ",n]})]}):e.jsx("div",{className:"text-sm text-white/58",children:n})]})}function I({compact:t,defaultUserId:i}){const r=E(),n=c.useRef(null),a=c.useRef(null),[s,l]=c.useState(""),[d,p]=c.useState(""),k=N({mutationFn:async()=>z({contentMarkdown:`# ${s.trim()||"Quick note"}
|
|
2
|
+
|
|
3
|
+
${d.trim()}`,author:"Forge quick capture",userId:i??null,links:[]}),onSuccess:async()=>{l(""),p(""),await r.invalidateQueries({queryKey:["notes-index"]})}}),S=N({mutationFn:async()=>O({title:s.trim()||"Quick capture",contentMarkdown:d.trim(),summary:d.trim().slice(0,180),author:"Forge quick capture"}),onSuccess:async()=>{l(""),p(""),await r.invalidateQueries({queryKey:["wiki-pages"]})}});function x(o,M=o){const h=a.current;if(!h)return;const y=h.selectionStart??0,b=h.selectionEnd??0,V=d.slice(y,b),q=`${d.slice(0,y)}${o}${V}${M}${d.slice(b)}`;p(q),requestAnimationFrame(()=>{h.focus(),h.selectionStart=y+o.length,h.selectionEnd=b+o.length})}return e.jsxs("div",{className:"grid h-full min-h-0 gap-3 rounded-[20px] bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white",children:[e.jsx(v,{className:"size-4 text-[var(--primary)]"}),e.jsx("span",{className:"text-sm font-semibold",children:"Quick capture"})]}),e.jsx("input",{ref:n,value:s,onChange:o=>l(o.target.value),className:"w-full rounded-2xl border border-white/10 bg-white/[0.04] px-3 py-2.5 text-sm text-white outline-none transition focus:border-[rgba(192,193,255,0.35)]",placeholder:"Title"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:[{label:"B",action:()=>x("**")},{label:"I",action:()=>x("_")},{label:"H1",action:()=>x("# ","")},{label:"[]",action:()=>x("- [ ] ","")}].map(o=>e.jsx("button",{type:"button",className:"inline-flex min-h-8 items-center justify-center rounded-xl bg-white/[0.05] px-2.5 text-[12px] font-semibold text-white/72 transition hover:bg-white/[0.08] hover:text-white",onClick:o.action,children:o.label},o.label))}),e.jsx("textarea",{ref:a,value:d,onChange:o=>p(o.target.value),className:w("min-h-0 w-full rounded-[20px] border border-white/10 bg-white/[0.04] px-3 py-3 text-sm text-white outline-none transition focus:border-[rgba(192,193,255,0.35)]",t?"h-28":"h-40"),placeholder:"Write a quick note or rough wiki draft"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center justify-center gap-2 rounded-2xl bg-[rgba(192,193,255,0.16)] px-3 py-2 text-sm font-medium text-[var(--primary)] transition hover:bg-[rgba(192,193,255,0.24)] disabled:opacity-50",disabled:!d.trim()||k.isPending,onClick:()=>k.mutate(),children:[e.jsx($,{className:"size-4"}),"Save as note"]}),e.jsxs("button",{type:"button",className:"inline-flex min-h-10 items-center justify-center gap-2 rounded-2xl bg-[rgba(255,185,95,0.16)] px-3 py-2 text-sm font-medium text-[var(--tertiary)] transition hover:bg-[rgba(255,185,95,0.24)] disabled:opacity-50",disabled:!d.trim()||S.isPending,onClick:()=>S.mutate(),children:[e.jsx(v,{className:"size-4"}),"Save as wiki"]})]})]})}const K={id:"surface:utility:time",surfaceId:"utility",routePath:null,title:"Clock",icon:"timer",description:"Live local time widget.",category:"Utilities",tags:["utility","clock"],inputs:[],params:[],output:[u({label:"Current time",description:"Formatted local time string published by the clock widget."}),m({key:"clock",label:"Clock state",description:"Structured clock state including the current ISO timestamp.",modelName:"ForgeClockState"})],tools:[],NodeView:f({title:"Clock",description:"Live local time widget.",inputs:[],params:[],output:[u({label:"Current time",description:"Formatted local time string published by the clock widget."}),m({key:"clock",label:"Clock state",description:"Structured clock state including the current ISO timestamp.",modelName:"ForgeClockState"})],tools:[]}),WebView:C,execute:t=>g(t,{clock:{now:t.context.now}},new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(t.context.now)))};C.workbench=K;const G={id:"surface:utility:mini-calendar",surfaceId:"utility",routePath:null,title:"Mini calendar",icon:"calendar",description:"Compact month calendar widget.",category:"Utilities",tags:["utility","calendar"],inputs:[],params:[],output:[u({label:"Month view",description:"Summary of the compact month calendar widget."}),m({key:"calendarView",label:"Calendar view",description:"Structured mini-calendar state including the current month anchor.",modelName:"ForgeMiniCalendarView"})],tools:[],NodeView:f({title:"Mini calendar",description:"Compact month calendar widget.",inputs:[],params:[],output:[u({label:"Month view",description:"Summary of the compact month calendar widget."}),m({key:"calendarView",label:"Calendar view",description:"Structured mini-calendar state including the current month anchor.",modelName:"ForgeMiniCalendarView"})],tools:[]}),WebView:W,execute:t=>g(t,{calendarView:{now:t.context.now}},"Compact month calendar")};W.workbench=G;const B={id:"surface:utility:spotify",surfaceId:"utility",routePath:null,title:"Spotify",icon:"music",description:"Pinned music link widget.",category:"Utilities",tags:["utility","spotify"],inputs:[{key:"surfaceId",label:"Surface id",kind:"text",required:!1}],params:[],output:[u({label:"Spotify link",description:"Summary of the pinned music link widget."}),m({key:"spotifyLink",label:"Spotify state",description:"Structured Spotify widget state and pinned surface context.",modelName:"ForgeSpotifyWidgetState"})],tools:[],NodeView:f({title:"Spotify",description:"Pinned music link widget.",inputs:[{key:"surfaceId",label:"Surface id",kind:"text"}],params:[],output:[u({label:"Spotify link",description:"Summary of the pinned music link widget."}),m({key:"spotifyLink",label:"Spotify state",description:"Structured Spotify widget state and pinned surface context.",modelName:"ForgeSpotifyWidgetState"})],tools:[]}),WebView:D,execute:t=>g(t,{spotifyLink:{surfaceId:t.inputs.surfaceId??null}},"Pinned Spotify link")};D.workbench=B;const H={id:"surface:utility:weather",surfaceId:"utility",routePath:null,title:"Weather",icon:"weather",description:"Location-aware weather widget.",category:"Utilities",tags:["utility","weather"],inputs:[],params:[],output:[u({label:"Weather summary",description:"Summary of the weather widget state."}),m({key:"weather",label:"Weather payload",description:"Structured weather widget payload.",modelName:"ForgeWeatherWidgetState"})],tools:[],NodeView:f({title:"Weather",description:"Location-aware weather widget.",inputs:[],params:[],output:[u({label:"Weather summary",description:"Summary of the weather widget state."}),m({key:"weather",label:"Weather payload",description:"Structured weather widget payload.",modelName:"ForgeWeatherWidgetState"})],tools:[]}),WebView:F,execute:t=>g(t,{weather:null},"Weather widget")};F.workbench=H;const X={id:"surface:utility:quick-capture",surfaceId:"utility",routePath:null,title:"Quick capture",icon:"capture",description:"Draft a quick note or wiki page.",category:"Capture",tags:["capture","notes"],inputs:[{key:"defaultUserId",label:"Default user id",kind:"text",required:!1}],params:[],output:[u({label:"Draft summary",description:"Summary of the quick-capture draft state."}),m({key:"draft",label:"Draft context",description:"Structured quick-capture draft context.",modelName:"ForgeQuickCaptureDraft"})],tools:[j("Create a Forge evidence note from captured markdown.")],NodeView:f({title:"Quick capture",description:"Draft a quick note or wiki page.",inputs:[{key:"defaultUserId",label:"Default user id",kind:"text"}],params:[],output:[u({label:"Draft summary",description:"Summary of the quick-capture draft state."}),m({key:"draft",label:"Draft context",description:"Structured quick-capture draft context.",modelName:"ForgeQuickCaptureDraft"})],tools:[j("Create a Forge evidence note from captured markdown.")]}),WebView:I,execute:t=>g(t,{draft:{defaultUserId:t.inputs.defaultUserId??null}},"Quick capture can draft notes and wiki pages.")};I.workbench=X;export{W as M,I as Q,D as S,C as T,F as W};
|
|
@@ -1064,4 +1064,4 @@ Make sure your charset is UTF-8`);u=(u>>>8&255)*192+(u&255),i.put(u,13)}},Tp=n,T
|
|
|
1064
1064
|
The chosen QR Code version cannot contain this amount of data.
|
|
1065
1065
|
Minimum version required to store current data is: `+W+`.
|
|
1066
1066
|
`);const G=k(D,N,Z),ue=e.getSymbolSize(D),q=new i(ue);return S(q,D),M(q),b(q,D),E(q,N,0),D>=7&&w(q,D),A(q,G),isNaN(P)&&(P=c.getBestMask(q,E.bind(null,q,N))),c.applyMask(P,q),E(q,N,P),{modules:q,version:D,errorCorrectionLevel:N,maskPattern:P,segments:Z}}return lp.create=function(D,N){if(typeof D>"u"||D==="")throw new Error("No input text");let P=t.M,Z,W;return typeof N<"u"&&(P=t.from(N.errorCorrectionLevel,t.M),Z=g.from(N.version),W=c.from(N.maskPattern),N.toSJISFunc&&e.setToSJISFunction(N.toSJISFunc)),C(D,Z,P,W)},lp}var xp={},Op={},uT;function a5(){return uT||(uT=1,(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let i=n.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+n);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(u){return[u,u]}))),i.length===6&&i.push("F","F");const o=parseInt(i.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+i.slice(0,6).join("")}}e.getOptions=function(i){i||(i={}),i.color||(i.color={});const o=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,u=i.width&&i.width>=21?i.width:void 0,c=i.scale||4;return{width:u,scale:u?4:c,margin:o,color:{dark:t(i.color.dark||"#000000ff"),light:t(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},e.getScale=function(i,o){return o.width&&o.width>=i+o.margin*2?o.width/(i+o.margin*2):o.scale},e.getImageWidth=function(i,o){const u=e.getScale(i,o);return Math.floor((i+o.margin*2)*u)},e.qrToImageData=function(i,o,u){const c=o.modules.size,f=o.modules.data,h=e.getScale(c,u),g=Math.floor((c+u.margin*2)*h),p=u.margin*h,m=[u.color.light,u.color.dark];for(let v=0;v<g;v++)for(let S=0;S<g;S++){let M=(v*g+S)*4,b=u.color.light;if(v>=p&&S>=p&&v<g-p&&S<g-p){const w=Math.floor((v-p)/h),E=Math.floor((S-p)/h);b=m[f[w*c+E]?1:0]}i[M++]=b.r,i[M++]=b.g,i[M++]=b.b,i[M]=b.a}}})(Op)),Op}var sT;function w$(){return sT||(sT=1,(function(e){const t=a5();function n(o,u,c){o.clearRect(0,0,u.width,u.height),u.style||(u.style={}),u.height=c,u.width=c,u.style.height=c+"px",u.style.width=c+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(u,c,f){let h=f,g=c;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),c||(g=i()),h=t.getOptions(h);const p=t.getImageWidth(u.modules.size,h),m=g.getContext("2d"),v=m.createImageData(p,p);return t.qrToImageData(v.data,u,h),n(m,g,p),m.putImageData(v,0,0),g},e.renderToDataURL=function(u,c,f){let h=f;typeof h>"u"&&(!c||!c.getContext)&&(h=c,c=void 0),h||(h={});const g=e.render(u,c,h),p=h.type||"image/png",m=h.rendererOpts||{};return g.toDataURL(p,m.quality)}})(xp)),xp}var Cp={},cT;function M$(){if(cT)return Cp;cT=1;const e=a5();function t(o,u){const c=o.a/255,f=u+'="'+o.hex+'"';return c<1?f+" "+u+'-opacity="'+c.toFixed(2).slice(1)+'"':f}function n(o,u,c){let f=o+u;return typeof c<"u"&&(f+=" "+c),f}function i(o,u,c){let f="",h=0,g=!1,p=0;for(let m=0;m<o.length;m++){const v=Math.floor(m%u),S=Math.floor(m/u);!v&&!g&&(g=!0),o[m]?(p++,m>0&&v>0&&o[m-1]||(f+=g?n("M",v+c,.5+S+c):n("m",h,0),h=0,g=!1),v+1<u&&o[m+1]||(f+=n("h",p),p=0)):h++}return f}return Cp.render=function(u,c,f){const h=e.getOptions(c),g=u.modules.size,p=u.modules.data,m=g+h.margin*2,v=h.color.light.a?"<path "+t(h.color.light,"fill")+' d="M0 0h'+m+"v"+m+'H0z"/>':"",S="<path "+t(h.color.dark,"stroke")+' d="'+i(p,g,h.margin)+'"/>',M='viewBox="0 0 '+m+" "+m+'"',w='<svg xmlns="http://www.w3.org/2000/svg" '+(h.width?'width="'+h.width+'" height="'+h.width+'" ':"")+M+' shape-rendering="crispEdges">'+v+S+`</svg>
|
|
1067
|
-
`;return typeof f=="function"&&f(null,w),w},Cp}var fT;function T$(){if(fT)return ko;fT=1;const e=i$(),t=_$(),n=w$(),i=M$();function o(u,c,f,h,g){const p=[].slice.call(arguments,1),m=p.length,v=typeof p[m-1]=="function";if(!v&&!e())throw new Error("Callback required as last argument");if(v){if(m<2)throw new Error("Too few arguments provided");m===2?(g=f,f=c,c=h=void 0):m===3&&(c.getContext&&typeof g>"u"?(g=h,h=void 0):(g=h,h=f,f=c,c=void 0))}else{if(m<1)throw new Error("Too few arguments provided");return m===1?(f=c,c=h=void 0):m===2&&!c.getContext&&(h=f,f=c,c=void 0),new Promise(function(S,M){try{const b=t.create(f,h);S(u(b,c,h))}catch(b){M(b)}})}try{const S=t.create(f,h);g(null,u(S,c,h))}catch(S){g(S)}}return ko.create=t.create,ko.toCanvas=o.bind(null,n.render),ko.toDataURL=o.bind(null,n.renderToDataURL),ko.toString=o.bind(null,function(u,c,f){return i.render(u,f)}),ko}var E$=T$();const yQ=Zt(E$);export{LG as $,
|
|
1067
|
+
`;return typeof f=="function"&&f(null,w),w},Cp}var fT;function T$(){if(fT)return ko;fT=1;const e=i$(),t=_$(),n=w$(),i=M$();function o(u,c,f,h,g){const p=[].slice.call(arguments,1),m=p.length,v=typeof p[m-1]=="function";if(!v&&!e())throw new Error("Callback required as last argument");if(v){if(m<2)throw new Error("Too few arguments provided");m===2?(g=f,f=c,c=h=void 0):m===3&&(c.getContext&&typeof g>"u"?(g=h,h=void 0):(g=h,h=f,f=c,c=void 0))}else{if(m<1)throw new Error("Too few arguments provided");return m===1?(f=c,c=h=void 0):m===2&&!c.getContext&&(h=f,f=c,c=void 0),new Promise(function(S,M){try{const b=t.create(f,h);S(u(b,c,h))}catch(b){M(b)}})}try{const S=t.create(f,h);g(null,u(S,c,h))}catch(S){g(S)}}return ko.create=t.create,ko.toCanvas=o.bind(null,n.render),ko.toDataURL=o.bind(null,n.renderToDataURL),ko.toString=o.bind(null,function(u,c,f){return i.render(u,f)}),ko}var E$=T$();const yQ=Zt(E$);export{LG as $,gz as A,qN as B,AG as C,Zt as D,O$ as E,tE as F,P$ as G,vG as H,A$ as I,mG as J,Gc as K,SG as L,D$ as M,yG as N,bG as O,_G as P,nC as Q,x1 as R,xG as S,b8 as T,tQ as U,HG as V,jG as W,UG as X,qG as Y,IG as Z,uN as _,An as a,NF as a$,zG as a0,kz as a1,nQ as a2,Mz as a3,rQ as a4,ZG as a5,ZS as a6,Mu as a7,eQ as a8,WG as a9,gG as aA,pG as aB,WT as aC,UY as aD,DF as aE,WF as aF,HF as aG,dG as aH,XY as aI,Qn as aJ,hG as aK,QF as aL,JY as aM,GY as aN,OV as aO,iV as aP,gF as aQ,eF as aR,KV as aS,FF as aT,XV as aU,lY as aV,KF as aW,dV as aX,pF as aY,vF as aZ,cF as a_,JG as aa,iQ as ab,aQ as ac,DG as ad,Cz as ae,XG as af,KG as ag,QG as ah,GG as ai,FG as aj,VG as ak,t3 as al,YG as am,RG as an,NG as ao,BG as ap,$G as aq,PG as ar,lQ as as,uQ as at,oQ as au,sQ as av,cQ as aw,fQ as ax,hQ as ay,dQ as az,ET as b,RF as b$,DY as b0,fG as b1,eY as b2,X$ as b3,rV as b4,WV as b5,R1 as b6,CF as b7,XF as b8,oF as b9,_Y as bA,$$ as bB,YF as bC,lV as bD,bY as bE,cY as bF,fY as bG,iG as bH,rG as bI,L$ as bJ,Lu as bK,I$ as bL,yY as bM,pY as bN,j$ as bO,uk as bP,U$ as bQ,R$ as bR,C$ as bS,H$ as bT,tV as bU,kV as bV,Q$ as bW,uF as bX,B$ as bY,NV as bZ,nF as b_,nY as ba,sY as bb,ZV as bc,lG as bd,EV as be,uG as bf,tG as bg,fV as bh,$V as bi,qF as bj,VV as bk,zk as bl,SV as bm,Z$ as bn,iY as bo,zV as bp,HY as bq,nV as br,hV as bs,aG as bt,xY as bu,W$ as bv,fF as bw,uY as bx,sV as by,dF as bz,SE as c,Y$ as c$,TY as c0,ZF as c1,RY as c2,EF as c3,BY as c4,TV as c5,q$ as c6,mY as c7,rF as c8,wY as c9,GF as cA,gV as cB,yV as cC,GV as cD,IV as cE,mF as cF,PF as cG,wV as cH,FY as cI,yF as cJ,NY as cK,G$ as cL,YY as cM,PY as cN,aV as cO,AY as cP,_V as cQ,K$ as cR,F$ as cS,BV as cT,LV as cU,$Y as cV,OY as cW,QV as cX,UF as cY,zY as cZ,xF as c_,JF as ca,tF as cb,jF as cc,qV as cd,eV as ce,bF as cf,AF as cg,PV as ch,LY as ci,TF as cj,YV as ck,qY as cl,_F as cm,gQ as cn,UV as co,eG as cp,SY as cq,gY as cr,hY as cs,QY as ct,pQ as cu,dY as cv,ZY as cw,bV as cx,MV as cy,BF as cz,wS as d,jV as d0,iF as d1,FV as d2,wF as d3,cG as d4,vY as d5,OF as d6,JV as d7,mV as d8,VF as d9,jY as dA,aF as dB,J$ as dC,nG as dD,uV as dE,VY as dF,oG as dG,xV as dH,pV as dI,$F as dJ,tY as dK,oV as dL,CV as dM,kF as dN,HV as dO,aY as dP,WY as da,V$ as db,cV as dc,zF as dd,vV as de,MY as df,kY as dg,yQ as dh,oY as di,sF as dj,AV as dk,MF as dl,EY as dm,LF as dn,CY as dp,IY as dq,lF as dr,IF as ds,DV as dt,rY as du,hF as dv,RV as dw,SF as dx,KY as dy,sG as dz,Bc as e,wG as f,_E as g,EN as h,MG as i,Te as j,EG as k,wE as l,LN as m,zt as n,Ur as o,Rr as p,OG as q,U as r,k$ as s,TG as t,kG as u,K1 as v,z$ as w,e9 as x,rl as y,CG as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./vendor-Cpmju3nw.js";import{i as x}from"./state-BtwEvpO6.js";import{P as w}from"./page-hero-BRcqE3a4.js";import{d as f,L as j,e as b,C as u,k as m,c as N,bf as M,bV as k}from"./index-wEZUnRh0.js";import{S as c,f as C,m as R,M as p,D}from"./daily-metrics-dashboard-DpIAdzFX.js";import"./motion-DwjmC9aq.js";import"./ui-B9O-eUim.js";import"./board-CLOHbg6t.js";import"./forms-C5d5hTf2.js";import"./charts-DwTguE_x.js";const V=["restingHeartRate","heartRateVariabilitySDNN","vo2Max","oxygenSaturation","bodyMass","stepCount"];function y(t,a){return a.map(i=>({...i,metrics:t.filter(s=>s.category===i.category)}))}function S(t){return t}function B({metrics:t}){if(!t.summary.hasData||t.metrics.length===0)return null;const a=y(t.metrics,t.summary.categoryBreakdown),i=t.metrics.find(r=>r.metric==="devrageSwearCount")??null,s=t.metrics.find(r=>r.metric==="swearingMessagePercent")??null,d=t.metrics.find(r=>r.metric==="devrageAverageMaxCumulativeRage")??null,n=t.metrics.find(r=>r.metric==="devrageMaxCumulativeRage")??null;return e.jsxs("section",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/38",children:"Psyche metrics"}),e.jsx("div",{className:"mt-1 text-2xl font-semibold text-white",children:"Conversation tone alongside body signals"})]}),e.jsxs(m,{className:"bg-amber-200/10 text-amber-50",children:[t.summary.trackedDays," tracked days"]})]}),e.jsx(D,{swearMetric:i,percentMetric:s,averageRageMetric:d,maxRageMetric:n,compact:!0}),e.jsxs("div",{className:"grid gap-4 xl:grid-cols-4",children:[e.jsx(c,{title:"Devrage count",description:"Daily user-message swear count from stored conversation history.",metric:i}),e.jsx(c,{title:"Swearing rate",description:"Share of scanned user messages that contained at least one tracked swear.",metric:s}),e.jsx(c,{title:"Average rage peak",description:"Average per-thread peak after swears add and clean messages cool the score down.",metric:d}),e.jsx(c,{title:"Max rage peak",description:"Highest cumulative thread score reached on the latest tracked day.",metric:n})]}),e.jsx(p,{groups:a})]})}function U(){var h;const t=f(),a=x({queryKey:["forge-vitals-view",...t.selectedUserIds],queryFn:async()=>(await M(t.selectedUserIds)).vitals}),i=x({queryKey:["forge-psyche-metrics-vitals-view"],queryFn:async()=>(await k()).metrics});if(a.isLoading)return e.jsx(j,{title:"Loading body signals",description:"Reading recent HealthKit body metrics, recovery signals, and daily aggregates."});if(a.isError||!a.data)return e.jsx(b,{error:a.error??new Error("Vitals data unavailable"),onRetry:()=>void a.refetch()});const s=a.data,d=s.metrics.map(S),n=V.map(o=>d.find(l=>l.metric===o)??null),r=s.summary.categoryBreakdown,v=y(d,r),g=!i.isError&&((h=i.data)!=null&&h.summary.hasData)?i.data:null;return e.jsxs("div",{className:"mx-auto grid w-full max-w-[1380px] gap-5",children:[e.jsx(w,{title:"Vitals",description:"Forge now keeps a daily body-signals layer across recovery, cardio fitness, breathing, composition, temperature, and activity. Use this surface to spot drift early, not just admire numbers late.",badge:`${s.summary.metricCount} live metrics`}),e.jsxs("section",{className:"grid gap-4 xl:grid-cols-4",children:[e.jsx(c,{title:"Recovery pulse",description:"Resting heart rate and HRV are the fastest read on load, stress, and whether today needs a gentler edge.",metric:n[0]??n[1]}),e.jsx(c,{title:"Cardio engine",description:"VO2 max and walking heart rate show whether baseline fitness is improving or whether your effort is costing more than usual.",metric:n[2]}),e.jsx(c,{title:"Breath and oxygen",description:"Respiratory rate and oxygen saturation help catch nights or stretches where recovery quality starts to slip.",metric:n[3]}),e.jsx(c,{title:"Body composition",description:"Mass and composition stay close to the daily story so progress is visible without flattening everything into weight alone.",metric:n[4]})]}),e.jsxs("section",{className:"grid gap-4 xl:grid-cols-[minmax(0,1.1fr)_minmax(340px,0.9fr)]",children:[e.jsxs(u,{className:"overflow-hidden rounded-[30px] border-white/8 bg-[radial-gradient(circle_at_top_left,rgba(108,99,255,0.16),transparent_36%),linear-gradient(180deg,rgba(15,19,38,0.98),rgba(9,13,28,0.98))] p-6",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/40",children:"Coverage"}),e.jsxs("div",{className:"text-2xl font-semibold text-white",children:[s.summary.trackedDays," tracked days across ",s.summary.metricCount," metrics"]}),e.jsx("div",{className:"max-w-3xl text-sm leading-6 text-white/58",children:"The companion is compressing HealthKit into daily signal bands, so what you see here is designed for decisions: how your recovery is trending, where your physiology is changing, and which body systems are actually being observed consistently."})]}),e.jsxs(m,{className:"bg-white/[0.08] text-white/72",children:["Latest snapshot ",C(s.summary.latestDateKey)]})]}),e.jsx("div",{className:"mt-5 grid gap-3 md:grid-cols-2 xl:grid-cols-3",children:r.map(o=>{const l=R(o.category);return e.jsxs("div",{className:N("rounded-[22px] border bg-white/[0.03] p-4",l.ring),children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(m,{className:l.badge,children:o.category}),e.jsxs("div",{className:"text-xs text-white/44",children:[o.coverageDays," days"]})]}),e.jsx("div",{className:"mt-3 text-2xl font-semibold text-white",children:o.metricCount}),e.jsxs("div",{className:"mt-1 text-sm text-white/58",children:["active metric",o.metricCount===1?"":"s"]})]},o.category)})})]}),e.jsx(u,{className:"rounded-[30px] border-white/8 bg-[linear-gradient(180deg,rgba(13,19,37,0.96),rgba(10,14,30,0.96))] p-6",children:e.jsxs("div",{className:"grid gap-3",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/40",children:"Daily interpretation"}),e.jsx("div",{className:"text-lg font-semibold text-white",children:"Body signals should feel operational, not medical-chart dead."}),e.jsxs("div",{className:"grid gap-3 text-sm leading-6 text-white/58",children:[e.jsx("div",{children:"Lower resting heart rate paired with stable or rising HRV usually means recovery is holding."}),e.jsx("div",{children:"Rising walking heart rate, falling HRV, or a jump in respiratory rate usually means you are carrying more load than the calendar admits."}),e.jsx("div",{children:"Composition and temperature metrics move slower, but they make the fast signals easier to trust because you can see the surrounding body context."})]}),e.jsxs("div",{className:"mt-2 rounded-[22px] border border-white/8 bg-white/[0.035] p-4 text-sm text-white/70",children:[s.summary.latestMetricCount," metrics updated on the latest tracked day."]})]})})]}),e.jsx(p,{groups:v}),g?e.jsx(B,{metrics:g}):null]})}export{U as VitalsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./vendor-Cpmju3nw.js";import{j as p,i as f,k as g}from"./state-BtwEvpO6.js";import{F as j}from"./flagship-signal-deck-jLxHEHvb.js";import{u as k,S as b,e as v,C as w,k as h,B as N,eB as R,i as $,eC as S}from"./index-wEZUnRh0.js";import{P as z}from"./page-hero-BRcqE3a4.js";import"./motion-DwjmC9aq.js";import"./ui-B9O-eUim.js";import"./board-CLOHbg6t.js";import"./forms-C5d5hTf2.js";const o="font-label text-[11px] uppercase tracking-[0.18em] text-[var(--ui-ink-faint)]",d="overflow-hidden rounded-[20px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)]",x="text-sm leading-6 text-[var(--ui-ink-soft)]";function P({data:s}){const m=Math.max(1,...s.map(i=>i.xp)),t=s.length>0?Math.max(4,Math.min(18,280/s.length-4)):8,c=s.length>1?Math.max(1,(300-s.length*t)/(s.length-1)):0;return e.jsx("div",{className:"mt-4 aspect-[16/9] min-h-56 w-full min-w-0 overflow-hidden rounded-[18px] border border-[var(--ui-border-subtle)] bg-[var(--ui-surface-2)] p-3",children:e.jsxs("svg",{viewBox:"0 0 340 200",role:"img","aria-label":"Weekly review XP chart",className:"h-full w-full",children:[e.jsx("g",{stroke:"var(--ui-border-subtle)",strokeWidth:"1",children:[45,85,125,165].map(i=>e.jsx("line",{x1:"20",x2:"320",y1:i,y2:i},i))}),s.map((i,r)=>{const l=20+r*(t+c),n=Math.max(2,i.xp/m*128);return e.jsxs("g",{children:[e.jsx("rect",{x:l,y:168-n,width:t,height:n,rx:"5",fill:"var(--primary)"}),r===0||r===s.length-1||r%3===0?e.jsx("text",{x:l+t/2,y:"192",fill:"var(--ui-ink-faint)",fontSize:"10",textAnchor:"middle",children:i.label}):null]},`${i.label}-${r}`)})]})})}function K(){var u;const{t:s}=k(),m=p(),t=f({queryKey:["forge-weekly-review"],queryFn:S}),c=g({mutationFn:R,onSuccess:async()=>{await Promise.all([m.invalidateQueries({queryKey:["forge-weekly-review"]}),m.invalidateQueries({queryKey:["forge-xp-metrics"]}),m.invalidateQueries({queryKey:["forge-reward-ledger"]}),$(m),m.invalidateQueries({queryKey:["activity-archive"]})])}}),i=(u=t.data)==null?void 0:u.review;if(t.isLoading)return e.jsx(b,{});if(t.isError)return e.jsx(v,{eyebrow:s("common.weeklyReview.heroEyebrow"),error:t.error,onRetry:()=>void t.refetch()});if(!i)return e.jsx(v,{eyebrow:s("common.weeklyReview.heroEyebrow"),error:new Error("Forge returned an empty weekly review payload."),onRetry:()=>void t.refetch()});const r=i.wins[0]??null,l=i.calibration.find(a=>a.mode==="recover")??i.calibration[0]??null,n=i.calibration.find(a=>a.mode==="accelerate")??i.calibration[0]??null,y=[{id:"week",label:"This week",title:`${i.momentumSummary.totalXp} XP with ${i.momentumSummary.focusHours} focus hours`,detail:`Peak window: ${i.momentumSummary.peakWindow}. Efficiency score is holding at ${i.momentumSummary.efficiencyScore}.`,badge:i.windowLabel},{id:"wins",label:"Wins",title:(r==null?void 0:r.title)??s("common.weeklyReview.noWin"),detail:(r==null?void 0:r.summary)??s("common.weeklyReview.noWinDetail"),badge:r?`+${r.rewardXp} xp`:`${i.wins.length} wins`},{id:"recovery",label:"Recovery",title:(l==null?void 0:l.title)??s("common.weeklyReview.noRecovery"),detail:(l==null?void 0:l.note)??s("common.weeklyReview.noRecoveryDetail"),badge:(l==null?void 0:l.mode)??"maintain"},{id:"next-intent",label:"Next intent",title:(n==null?void 0:n.title)??i.reward.title,detail:(n==null?void 0:n.note)??i.reward.summary,badge:`+${i.reward.rewardXp} xp`}];return e.jsxs("div",{className:"grid gap-5",children:[e.jsx(z,{title:"Weekly Review",description:`${i.windowLabel}. ${s("common.weeklyReview.heroDescription")}`,badge:`${i.momentumSummary.totalXp} xp`}),e.jsxs("section",{className:"grid gap-5 xl:grid-cols-[minmax(0,1.2fr)_minmax(0,0.8fr)]",children:[e.jsxs("div",{className:"grid gap-5",children:[e.jsxs(w,{children:[e.jsx("div",{className:o,children:s("common.weeklyReview.sectionMomentum")}),e.jsx(P,{data:i.chart}),e.jsxs("div",{className:"mt-4 grid gap-3 md:grid-cols-3",children:[e.jsxs("div",{className:`${d} p-4`,children:[e.jsx("div",{className:o,children:"XP"}),e.jsx("div",{className:"mt-2 text-2xl text-[var(--ui-ink-strong)]",children:i.momentumSummary.totalXp})]}),e.jsxs("div",{className:`${d} p-4`,children:[e.jsx("div",{className:o,children:"Focus hours"}),e.jsx("div",{className:"mt-2 text-2xl text-[var(--ui-ink-strong)]",children:i.momentumSummary.focusHours})]}),e.jsxs("div",{className:`${d} p-4`,children:[e.jsx("div",{className:o,children:"Peak window"}),e.jsx("div",{className:"mt-2 break-words text-2xl text-[var(--ui-ink-strong)]",children:i.momentumSummary.peakWindow})]})]})]}),e.jsxs(w,{children:[e.jsx("div",{className:o,children:s("common.weeklyReview.sectionGoals")}),e.jsx("div",{className:"mt-4 grid gap-3",children:i.calibration.map(a=>e.jsxs("div",{className:`${d} p-4`,children:[e.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[e.jsx("div",{className:"min-w-0 flex-1 break-words font-medium text-[var(--ui-ink-strong)]",children:a.title}),e.jsx(h,{className:"max-w-[9rem] shrink-0 self-start",children:a.mode})]}),e.jsx("div",{className:`mt-3 break-words ${x}`,children:a.note})]},a.id))})]})]}),e.jsxs("div",{className:"grid gap-5",children:[e.jsxs(w,{children:[e.jsx("div",{className:o,children:s("common.weeklyReview.sectionWins")}),e.jsx("div",{className:"mt-4 grid gap-3",children:i.wins.map(a=>e.jsxs("div",{className:`${d} p-4`,children:[e.jsxs("div",{className:"flex min-w-0 items-start justify-between gap-3",children:[e.jsx("div",{className:"min-w-0 flex-1 break-words font-medium text-[var(--ui-ink-strong)]",children:a.title}),e.jsxs(h,{tone:"signal",className:"max-w-[8rem] shrink-0 self-start",children:["+",a.rewardXp," xp"]})]}),e.jsx("div",{className:`mt-2 break-words ${x}`,children:a.summary})]},a.id))})]}),e.jsxs(w,{children:[e.jsx("h2",{className:"break-words font-display text-3xl text-[var(--ui-ink-strong)]",children:i.reward.title}),e.jsx("p",{className:`mt-3 leading-7 ${x}`,children:i.reward.summary}),e.jsxs("div",{className:`mt-4 ${d} p-4`,children:[e.jsx("div",{className:o,children:s("common.weeklyReview.completionBonus")}),e.jsxs("div",{className:"mt-2 text-3xl text-[var(--primary)]",children:["+",i.reward.rewardXp," XP"]})]}),e.jsx(N,{className:"mt-4 w-full",disabled:i.completion.finalized,pending:c.isPending,pendingLabel:s("common.weeklyReview.finalizePending"),onClick:async()=>{await c.mutateAsync()},children:i.completion.finalized?s("common.weeklyReview.finalized"):s("common.weeklyReview.finalize")}),e.jsx("div",{className:`mt-3 ${x}`,children:i.completion.finalized?`${s("common.weeklyReview.finalizedDetail")} ${i.completion.finalizedBy?`By ${i.completion.finalizedBy}. `:""}${i.completion.finalizedAt?new Date(i.completion.finalizedAt).toLocaleString():""}`.trim():i.reward.summary})]})]})]}),e.jsx(j,{eyebrow:s("common.weeklyReview.summaryEyebrow"),title:s("common.weeklyReview.summaryTitle"),description:s("common.weeklyReview.summaryDescription"),items:y})]})}export{K as WeeklyReviewPage};
|