@mavea/mavea 1.0.11 → 1.0.13

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.
Files changed (158) hide show
  1. package/CHANGELOG.md +18 -1
  2. package/README.md +33 -164
  3. package/dist/.vite/manifest.json +606 -606
  4. package/dist/assets/{AppCommandPalette-DzUPm-Qa.js → AppCommandPalette-D_g8-7C0.js} +1 -1
  5. package/dist/assets/{BlockEmpty-Dp9IPo4S.js → BlockEmpty-Ddhgr5pu.js} +1 -1
  6. package/dist/assets/{BriefingPlayer-CTab7H0c.js → BriefingPlayer-D-QhLgXI.js} +1 -1
  7. package/dist/assets/{CanvasSkeleton-BCq4yAAN.js → CanvasSkeleton-BIiOmCMG.js} +2 -2
  8. package/dist/assets/{CheckLogRail-DbGJtneK.js → CheckLogRail-ZrDqyjQ7.js} +1 -1
  9. package/dist/assets/{CodeOutput-DjsCJAel.js → CodeOutput-D7sVg1Nr.js} +1 -1
  10. package/dist/assets/{CommandPalette-Cq9mDWiI.js → CommandPalette-DNa2q8E_.js} +1 -1
  11. package/dist/assets/{CourseLessonReader-Dz8IhHEw.js → CourseLessonReader-BIpGjcJk.js} +2 -2
  12. package/dist/assets/{CourseRail-DjK_L3eD.js → CourseRail-CQaotzN0.js} +1 -1
  13. package/dist/assets/{CoursesApp-Dv4yt63y.js → CoursesApp-q3kZJmu1.js} +2 -2
  14. package/dist/assets/{CrossExamPanel-DJCn13Aa.js → CrossExamPanel-BIJslibV.js} +1 -1
  15. package/dist/assets/{DashPresent-pfOEJGzV.js → DashPresent-DGSE0vYM.js} +1 -1
  16. package/dist/assets/{DashboardDetail-BSZ3CgcK.js → DashboardDetail-BpaLNg8R.js} +2 -2
  17. package/dist/assets/DashboardLoopRuntime-14yzj-xx.js +1 -0
  18. package/dist/assets/{DashboardOverview-DpJ2BDNu.js → DashboardOverview-8x3OxX2i.js} +1 -1
  19. package/dist/assets/{DashboardSettings-C1rC3iTs.js → DashboardSettings-f_zxcs5j.js} +1 -1
  20. package/dist/assets/{DashboardsApp-DeBWrYDk.js → DashboardsApp-mvMbGmp0.js} +2 -2
  21. package/dist/assets/{DeepZoomApp-B91oHx2Y.js → DeepZoomApp-E7bDmzuL.js} +1 -1
  22. package/dist/assets/{DelegatePanel-bFmfn9-D.js → DelegatePanel-pwRk9pFf.js} +1 -1
  23. package/dist/assets/{DemoGallery-fYIVdHQV.js → DemoGallery-DDzX8Z7I.js} +1 -1
  24. package/dist/assets/{DropSelect-DbxAWKQn.js → DropSelect-BMZYAX6q.js} +1 -1
  25. package/dist/assets/{ExportModal-HczU1Zg1.js → ExportModal-CTMJaU1l.js} +2 -2
  26. package/dist/assets/{ExtractionPreview-BfjJci-N.js → ExtractionPreview-C9wq7CrK.js} +1 -1
  27. package/dist/assets/{FlagshipCTA-CTb5P2Ix.js → FlagshipCTA-DPNSflKv.js} +1 -1
  28. package/dist/assets/{FlagshipCommandPalette-DLkDmsF-.js → FlagshipCommandPalette-55zqyPFm.js} +1 -1
  29. package/dist/assets/{FlagshipShowcase-CrFSCHHX.js → FlagshipShowcase-BWpoPWOn.js} +1 -1
  30. package/dist/assets/{FlashcardsApp-CV777TGC.js → FlashcardsApp-apCj3I17.js} +1 -1
  31. package/dist/assets/{ForecastPanel-BfAngk8l.js → ForecastPanel-CMRD-UKn.js} +1 -1
  32. package/dist/assets/{GalleryApp-DLssAAhN.js → GalleryApp-CcsbirLT.js} +1 -1
  33. package/dist/assets/{HonestByDesign-B0o03QVw.js → HonestByDesign-DU4qmc61.js} +1 -1
  34. package/dist/assets/{HowItWorks-DfUsQ2xD.js → HowItWorks-CkZXftN-.js} +1 -1
  35. package/dist/assets/{LegalApp-CnFE80Ja.js → LegalApp-BmZpqH-6.js} +1 -1
  36. package/dist/assets/{LegalMarkdownDocument-BidNcrNj.js → LegalMarkdownDocument-CcbAfubz.js} +1 -1
  37. package/dist/assets/{LegalPageShell-CFktFKTK.js → LegalPageShell-raMATqhx.js} +1 -1
  38. package/dist/assets/{LeverPanel-DgfX7mTL.js → LeverPanel-DVUgGcYW.js} +1 -1
  39. package/dist/assets/{Library-CAnmN5YL.js → Library-D725dNcx.js} +1 -1
  40. package/dist/assets/{LibraryOverlay-D7Gg_GIv.js → LibraryOverlay-D7PzQIpH.js} +1 -1
  41. package/dist/assets/LiveApp-B8Jw1Q0h.js +61 -0
  42. package/dist/assets/{LiveApp-COz1ZZp9.css → LiveApp-DQhDk2ma.css} +1 -1
  43. package/dist/assets/{LiveSettings-5UCN5UWM.js → LiveSettings-BQ06gZB7.js} +3 -3
  44. package/dist/assets/{MindMapViewerDrawer-DoXy6hCD.js → MindMapViewerDrawer-CIMuABKE.js} +1 -1
  45. package/dist/assets/{MindShape-BJCnqyTi.js → MindShape-0KPrv0CF.js} +1 -1
  46. package/dist/assets/MindShape-Bel2yDqO.css +1 -0
  47. package/dist/assets/{PinToDashboard-Dq77a2iP.js → PinToDashboard-ML4NFCAU.js} +1 -1
  48. package/dist/assets/{PlanReview-DvxM1675.js → PlanReview-CbJ_7Ld1.js} +1 -1
  49. package/dist/assets/{Presence-LNSqCz8N.js → Presence-B_zDfiE7.js} +1 -1
  50. package/dist/assets/{PresentationDeck-8kT0cMtk.js → PresentationDeck-Tm3PUdh5.js} +1 -1
  51. package/dist/assets/{PrismApp-Jf4pIAkh.js → PrismApp-Bc-6PO_P.js} +2 -2
  52. package/dist/assets/{PrismAskController-QXSoZBNb.js → PrismAskController-OwqFx5Pk.js} +1 -1
  53. package/dist/assets/{PrismBriefingPlayer-edFfwMNP.js → PrismBriefingPlayer-Bu_ZxYdh.js} +2 -2
  54. package/dist/assets/{PrismOverlay-CYItOpax.js → PrismOverlay-UTsJ8R5d.js} +4 -4
  55. package/dist/assets/{PrivacyApp-Dqz_BgOS.js → PrivacyApp-BLXan6dm.js} +1 -1
  56. package/dist/assets/{Recap-Ba2qZ2lX.js → Recap-5rYrcMCC.js} +1 -1
  57. package/dist/assets/{ReelJelly-9SCjNeHq.js → ReelJelly-Dg3XGB0c.js} +1 -1
  58. package/dist/assets/{RehearsalPanel-CtYKPl6O.js → RehearsalPanel-CM4466Os.js} +3 -3
  59. package/dist/assets/{ReplayCard-MSWq-Mxr.js → ReplayCard-wMIMlorH.js} +2 -2
  60. package/dist/assets/{ReplayOverlay-ChDrwMLh.js → ReplayOverlay-BomkTonB.js} +1 -1
  61. package/dist/assets/{RewindOverlay-CM9d5xhh.js → RewindOverlay-Izf89nG9.js} +1 -1
  62. package/dist/assets/{RippleApp-B7G_jg05.js → RippleApp-8QSIEjTX.js} +2 -2
  63. package/dist/assets/{RippleAskController-CJjt7VG8.js → RippleAskController-Cd86GrKs.js} +1 -1
  64. package/dist/assets/{RippleOverlay-Cfu3ZVL1.js → RippleOverlay-SCrXZTqz.js} +2 -2
  65. package/dist/assets/{SeeDontRead-DHhwv6RU.js → SeeDontRead-Bp8qsF20.js} +1 -1
  66. package/dist/assets/ShareModal-C-sD-aia.js +32 -0
  67. package/dist/assets/{ShareModal-C8S7ySls.css → ShareModal-PobtP7AJ.css} +1 -1
  68. package/dist/assets/{ShipCascade-B6kVuilv.js → ShipCascade-Cq_I4c_v.js} +1 -1
  69. package/dist/assets/{ShipCourse-CerQYrsy.js → ShipCourse-CzsJyMnT.js} +1 -1
  70. package/dist/assets/{ShipHotspots-DOmWYgHH.js → ShipHotspots-OMjPhQWP.js} +1 -1
  71. package/dist/assets/{ShipIncident-D0lvmytD.js → ShipIncident-Cqn6ZmKz.js} +1 -1
  72. package/dist/assets/{ShipMigration-D70LbiJk.js → ShipMigration-5_ZWn7K9.js} +1 -1
  73. package/dist/assets/{ShipOnboarding-B_0dp9a-.js → ShipOnboarding-Yr8oKgmQ.js} +1 -1
  74. package/dist/assets/{ShipRead-Cp2s7bSL.js → ShipRead-Bnw7mnv3.js} +1 -1
  75. package/dist/assets/{ShipRollout-Bw9pvbSM.js → ShipRollout-ECsDrqAd.js} +1 -1
  76. package/dist/assets/{ShipSuggestions-eHLjOJL5.js → ShipSuggestions-C6oDw2F8.js} +1 -1
  77. package/dist/assets/{ShipWorkspace-DwdoBSix.js → ShipWorkspace-BT6gZrqd.js} +1 -1
  78. package/dist/assets/{SignatureLoop-Bl43npTM.js → SignatureLoop-D7sibSnc.js} +1 -1
  79. package/dist/assets/{SynthesisApp-BkOWv_pc.js → SynthesisApp-B768x2r_.js} +2 -2
  80. package/dist/assets/{SynthesisOverlay-CHlVL7sT.js → SynthesisOverlay-Ds0MhZLQ.js} +1 -1
  81. package/dist/assets/{TermsApp-PakIMrh0.js → TermsApp-Da8FeMj3.js} +1 -1
  82. package/dist/assets/{TopicCanvas-wmAsICUd.js → TopicCanvas-D64O3lvD.js} +2 -2
  83. package/dist/assets/{TourPrism-VQqowXpY.js → TourPrism-CTf1G-Vv.js} +1 -1
  84. package/dist/assets/{TrackerTile-C1mU8Zxj.js → TrackerTile-DeujTCk-.js} +2 -2
  85. package/dist/assets/{TwoSurfaces-SNT4AVzV.js → TwoSurfaces-kyK2yqm0.js} +1 -1
  86. package/dist/assets/{UnderstoodPanel-BkwhDLhW.js → UnderstoodPanel-Dgwk_Cuj.js} +1 -1
  87. package/dist/assets/{WhyMachineOverlay-DgYhqU53.js → WhyMachineOverlay-C4eQC0lg.js} +1 -1
  88. package/dist/assets/{WowFeatures-Cky9THxT.js → WowFeatures-CaBZ5WPM.js} +1 -1
  89. package/dist/assets/{ZoomDeck-BXwcRCO_.js → ZoomDeck-DnCtbhx1.js} +1 -1
  90. package/dist/assets/{alternateFinishes-Cn5LyQ0-.js → alternateFinishes-FSV_gA1A.js} +1 -1
  91. package/dist/assets/{annotationAuto-L2AxlJ2F.js → annotationAuto-x_dV8z65.js} +1 -1
  92. package/dist/assets/annotationReel-SeXzv0P-.js +1 -0
  93. package/dist/assets/{backup-Cw4GBHBV.js → backup-0zODkqi-.js} +1 -1
  94. package/dist/assets/canvas-uhcwigAL.js +1 -0
  95. package/dist/assets/{catalog-2srqP2Jf.js → catalog-Car_1ocN.js} +1 -1
  96. package/dist/assets/{dashboardEvents-S4Y2aOP_.js → dashboardEvents-BqcPN-K8.js} +2 -2
  97. package/dist/assets/{dist-BJbBdhc0.js → dist-BTg4yEWr.js} +1 -1
  98. package/dist/assets/{fit-C3MkNFdn.js → fit-I3tuibfX.js} +1 -1
  99. package/dist/assets/{generateLive-Ci8kqPD9.js → generateLive-Dk24OxVt.js} +1 -1
  100. package/dist/assets/{index-DWHIOldG.js → index-CWqRe4-B.js} +3 -3
  101. package/dist/assets/{jspdf.es.min-CfZM9xhl.js → jspdf.es.min-wkD3BzGZ.js} +1 -1
  102. package/dist/assets/kokoro-B-3GqktX.js +1 -0
  103. package/dist/assets/{lib-C9jT-CD8.js → lib-CwruVYU_.js} +1 -1
  104. package/dist/assets/{liveSchema-Dw4t_k7M.js → liveSchema-CCpVMy0H.js} +1 -1
  105. package/dist/assets/{motion-QSGW_vc_.js → motion-CURfDtdH.js} +1 -1
  106. package/dist/assets/{notes-D21K92Wx.js → notes-BG5QP-Dj.js} +1 -1
  107. package/dist/assets/{pdf-BP_vXBKO.js → pdf-x4qTBJIZ.js} +1 -1
  108. package/dist/assets/{perfProbe-DFw7brPU.js → perfProbe-BFwfpxJt.js} +1 -1
  109. package/dist/assets/{pin-BzDcIYD4.js → pin-DRN5H7py.js} +1 -1
  110. package/dist/assets/{portal-n6TW0FuE.js → portal-BYHo9LOD.js} +1 -1
  111. package/dist/assets/{pptxgen.es-GleD8us4.js → pptxgen.es-DGywGiaX.js} +1 -1
  112. package/dist/assets/{prewarm-CehIIttc.js → prewarm-CQNCE4Uq.js} +1 -1
  113. package/dist/assets/{quietHours-Brg4oaDf.js → quietHours-CKjQ2pGY.js} +1 -1
  114. package/dist/assets/{registry-CoCl26Tl.js → registry-1BWL6SXY.js} +1 -1
  115. package/dist/assets/registry-5a-E7vEN.css +1 -0
  116. package/dist/assets/{registry-mmGDT0wn.js → registry-9S6KiKjR.js} +1 -1
  117. package/dist/assets/{registry-BE1QBNKm.js → registry-BZQeYzgv.js} +1 -1
  118. package/dist/assets/{registry-CG5W7Xs6.js → registry-Bc6_RQ8l.js} +1 -1
  119. package/dist/assets/{registry-_mqmf4_W.js → registry-BklPTZre.js} +1 -1
  120. package/dist/assets/{registry-ia68k5sK.js → registry-Bl3NkU-0.js} +1 -1
  121. package/dist/assets/{registry-NNLA0NQi.js → registry-BpBiRe-o.js} +1 -1
  122. package/dist/assets/{registry-h3m1zDGt.js → registry-Bpx4VBWb.js} +1 -1
  123. package/dist/assets/{registry-BvEfWbB0.js → registry-BueBIP-N.js} +1 -1
  124. package/dist/assets/{registry-eQ4cE0zj.js → registry-CNr6L-3z.js} +1 -1
  125. package/dist/assets/{registry-CrpEXqNF.js → registry-CfTTYQrE.js} +1 -1
  126. package/dist/assets/{registry-CePhqBU6.js → registry-CqfjqOX5.js} +2 -2
  127. package/dist/assets/{registry-D86iln18.js → registry-D84Bs-bD.js} +1 -1
  128. package/dist/assets/{registry-DgIia4dY.js → registry-DBsjgIxw.js} +1 -1
  129. package/dist/assets/{registry-vPwth4BB.js → registry-DEgW3zel.js} +1 -1
  130. package/dist/assets/{registry-BPpjU0S5.js → registry-DFmFBfRz.js} +1 -1
  131. package/dist/assets/{registry-Cpr0zSyk.js → registry-DrqQbf_n.js} +1 -1
  132. package/dist/assets/{registry-VKh9QiDf.js → registry-Dw42uggW.js} +1 -1
  133. package/dist/assets/{registry-HB-VAc6H.js → registry-GLjcQX0n.js} +1 -1
  134. package/dist/assets/{registry-BYn3Bcie.js → registry-Z3TIPbYJ.js} +1 -1
  135. package/dist/assets/{registry-ChG5tFfx.js → registry-_T6pLDPG.js} +2 -2
  136. package/dist/assets/{registry-VS55xdsN.js → registry-aUZZeh27.js} +1 -1
  137. package/dist/assets/{registry-CFU0k7VB.js → registry-cPmSqaRu.js} +1 -1
  138. package/dist/assets/{relate-DDWak0Tv.js → relate-yq30L3hZ.js} +1 -1
  139. package/dist/assets/{shikiHighlight-SWupBCFg.js → shikiHighlight-BgZoQAHs.js} +1 -1
  140. package/dist/assets/src-B-t8Mww-.js +2 -0
  141. package/dist/assets/{useDashboardLoop-BSBGTrE2.js → useDashboardLoop-mGmJwv27.js} +3 -3
  142. package/dist/assets/{useLiveConfig-Cc4IKgOd.js → useLiveConfig-vMyjo2gV.js} +1 -1
  143. package/dist/assets/{useSpatialCanvas-D3nfHkST.js → useSpatialCanvas-CEXy6ZC2.js} +1 -1
  144. package/dist/assets/{useSpotlightWalk-gVilFhpa.js → useSpotlightWalk-B9XJ6OLK.js} +1 -1
  145. package/dist/assets/{useSrsCards-BhFfq4vc.js → useSrsCards-Vc6B2_he.js} +1 -1
  146. package/dist/assets/{useStudy-DRNarubG.js → useStudy-6QnY-Fw_.js} +1 -1
  147. package/dist/assets/{useZoomGesture-BdeFOm7j.js → useZoomGesture-BONUz5cE.js} +1 -1
  148. package/dist/index.html +1 -1
  149. package/package.json +1 -1
  150. package/dist/assets/DashboardLoopRuntime-DfnDIGFz.js +0 -1
  151. package/dist/assets/LiveApp-DmU3RMfZ.js +0 -61
  152. package/dist/assets/MindShape-Ca3MXEgK.css +0 -1
  153. package/dist/assets/ShareModal-d_o2hebL.js +0 -32
  154. package/dist/assets/annotationReel-DdHNp2IH.js +0 -1
  155. package/dist/assets/canvas-BwR8ltlj.js +0 -1
  156. package/dist/assets/kokoro-Da60jB7C.js +0 -1
  157. package/dist/assets/registry-CtbuZWYz.css +0 -1
  158. package/dist/assets/src-DbgF7cRH.js +0 -2
@@ -1,8 +1,8 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-BP_vXBKO.js","assets/index-DWHIOldG.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ShareModal-d_o2hebL.js","assets/ReelJelly-9SCjNeHq.js","assets/geometry-DXAbnb0J.js","assets/registry-ChG5tFfx.js","assets/fit-C3MkNFdn.js","assets/share-QHGHNDhQ.js","assets/icons-CHVz6kv_.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/spokenText-D4zPX9JY.js","assets/toast-BBNs2h3L.js","assets/threads-CkMgrSDP.js","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-Da60jB7C.js","assets/ShareModal-C8S7ySls.css","assets/annotationAuto-L2AxlJ2F.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/BriefingPlayer-CTab7H0c.js","assets/BriefingPlayer-TpFZB77N.css","assets/annotationReel-DdHNp2IH.js","assets/PrismAskController-QXSoZBNb.js","assets/sourceHost-BV3t2XDb.js","assets/citation-BcvmjKS8.js","assets/verbatim-CBMzUDlf.js","assets/search-Be63DJkp.js","assets/PrismAskController-DBoxQSJR.css","assets/PrismBriefingPlayer-edFfwMNP.js","assets/CrossExamPanel-DJCn13Aa.js","assets/CrossExamPanel-CZ0ShGma.css","assets/ForecastPanel-BfAngk8l.js","assets/ForecastPanel-Da2ZBUrE.css","assets/LeverPanel-DgfX7mTL.js","assets/dag-C3Xx8pOD.js","assets/LeverPanel-DhpJY76O.css","assets/WhyMachineOverlay-DgYhqU53.js","assets/useSpatialCanvas-D3nfHkST.js","assets/WhyMachineOverlay-BZk3PVTl.css","assets/run-BYP2YlZT.js","assets/extractNumbers-CuhagRkd.js","assets/streamParse-DRgMHWye.js","assets/run-DSVvshaB.js","assets/run-Dc2ZJz6n.js","assets/model-BE0UHu1w.js","assets/explode-WBykfhqW.js","assets/json-B0N3XRZU.js","assets/cache-BumECILO.js","assets/speed-DwPw9KSv.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{I as n,J as r,L as i,ht as a,k as o,mt as s,q as c}from"./index-DWHIOldG.js";import{t as l}from"./useFocusTrap-DbfG6zbM.js";import{t as u}from"./toast-BBNs2h3L.js";import{r as d}from"./sourceHost-BV3t2XDb.js";import{t as f}from"./penStrokes-9Q_l7NTt.js";import{S as p,b as m,d as h,h as g,m as _,o as v,s as y,t as b,v as x,x as S,y as C}from"./providers-wzm7E8Pa.js";import{n as w}from"./streamParse-DRgMHWye.js";import{t as T}from"./search-Be63DJkp.js";import{a as E,i as D,t as O}from"./verbatim-CBMzUDlf.js";import{t as k}from"./officeDoc-B6nEhNp4.js";import{t as A}from"./citation-BcvmjKS8.js";var j=e(),M=a();function ee(e,t=220){return`DOCUMENT OUTLINE — a thin slice of every page:\n${e.map((e,n)=>`[page ${n+1}] ${e.slice(0,t).replace(/\s+/g,` `).trim()}`).join(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-x4qTBJIZ.js","assets/index-CWqRe4-B.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ShareModal-C-sD-aia.js","assets/ReelJelly-Dg3XGB0c.js","assets/geometry-DXAbnb0J.js","assets/registry-_T6pLDPG.js","assets/fit-I3tuibfX.js","assets/share-QHGHNDhQ.js","assets/icons-CHVz6kv_.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/spokenText-D4zPX9JY.js","assets/toast-BBNs2h3L.js","assets/threads-CkMgrSDP.js","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-B-3GqktX.js","assets/ShareModal-PobtP7AJ.css","assets/annotationAuto-x_dV8z65.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/BriefingPlayer-D-QhLgXI.js","assets/BriefingPlayer-TpFZB77N.css","assets/annotationReel-SeXzv0P-.js","assets/PrismAskController-OwqFx5Pk.js","assets/sourceHost-BV3t2XDb.js","assets/citation-BcvmjKS8.js","assets/verbatim-CBMzUDlf.js","assets/search-Be63DJkp.js","assets/PrismAskController-DBoxQSJR.css","assets/PrismBriefingPlayer-Bu_ZxYdh.js","assets/CrossExamPanel-BIJslibV.js","assets/CrossExamPanel-CZ0ShGma.css","assets/ForecastPanel-CMRD-UKn.js","assets/ForecastPanel-Da2ZBUrE.css","assets/LeverPanel-DVUgGcYW.js","assets/dag-C3Xx8pOD.js","assets/LeverPanel-DhpJY76O.css","assets/WhyMachineOverlay-C4eQC0lg.js","assets/useSpatialCanvas-CEXy6ZC2.js","assets/WhyMachineOverlay-BZk3PVTl.css","assets/run-BYP2YlZT.js","assets/extractNumbers-CuhagRkd.js","assets/streamParse-DRgMHWye.js","assets/run-DSVvshaB.js","assets/run-Dc2ZJz6n.js","assets/model-BE0UHu1w.js","assets/explode-WBykfhqW.js","assets/json-B0N3XRZU.js","assets/cache-BumECILO.js","assets/speed-DwPw9KSv.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{I as n,J as r,L as i,ht as a,k as o,mt as s,q as c}from"./index-CWqRe4-B.js";import{t as l}from"./useFocusTrap-DbfG6zbM.js";import{t as u}from"./toast-BBNs2h3L.js";import{r as d}from"./sourceHost-BV3t2XDb.js";import{t as f}from"./penStrokes-9Q_l7NTt.js";import{S as p,b as m,d as h,h as g,m as _,o as v,s as y,t as b,v as x,x as S,y as C}from"./providers-wzm7E8Pa.js";import{n as w}from"./streamParse-DRgMHWye.js";import{t as T}from"./search-Be63DJkp.js";import{a as E,i as D,t as O}from"./verbatim-CBMzUDlf.js";import{t as k}from"./officeDoc-B6nEhNp4.js";import{t as A}from"./citation-BcvmjKS8.js";var j=e(),M=a();function ee(e,t=220){return`DOCUMENT OUTLINE — a thin slice of every page:\n${e.map((e,n)=>`[page ${n+1}] ${e.slice(0,t).replace(/\s+/g,` `).trim()}`).join(`
3
3
  `)}`}function N(e,t,n){let r=[];try{let n=typeof e==`object`?e:JSON.parse(String(e).match(/\{[\s\S]*\}/)?.[0]??`{}`);Array.isArray(n.pages)&&(r=n.pages.map(e=>Number(e)).filter(e=>Number.isInteger(e)&&e>=1&&e<=t))}catch{}let i=[...new Set(r)].sort((e,t)=>e-t).slice(0,n);if(i.length>0)return i;let a=Math.max(1,Math.floor(t/Math.max(1,n))),o=[];for(let e=1;e<=t&&o.length<n;e+=a)o.push(e);return o}function te(e,t,n,r){return`DOCUMENT TEXT (cite "page" by these markers):\n${t.map(t=>{let i=r?.[t-1];return`${i?`[page ${t} — "${i}"]`:`[page ${t}]`}\n${(e[t-1]??``).slice(0,n)}`}).join(`
4
4
 
5
- `)}`}function P(e,t){let n=[];for(let r of e){let e=O(r.quote,t,r.page);if(e>0){n.push({...r,page:e});continue}let i=[...new Set([r.page,...t.map((e,t)=>t+1)])].filter(e=>e>=1&&e<=t.length);for(let e of i){let i=E(r.quote,t[e-1]);if(i){n.push({...r,quote:i,page:e});break}}}return n}var F=null,I=0,L=new Map;function R(){if(typeof Worker>`u`)return null;if(F)return F;try{return F=new Worker(new URL(`/assets/prismGround.worker-CIvKqxm2.js`,``+import.meta.url),{type:`module`}),F.onmessage=e=>{let t=e.data,n=L.get(t.id);n&&(L.delete(t.id),t.ok?n.resolve(t.claims??[]):n.reject(Error(t.error??`Grounding failed`)))},F.onerror=()=>{let e=Error(`Grounding worker failed`);for(let t of L.values())t.reject(e);L.clear(),F?.terminate(),F=null},F}catch{return F=null,null}}async function z(e,t){let n=[];for(let r=0;r<e.length;r+=16)n.push(...P(e.slice(r,r+16),t)),r+16<e.length&&await new Promise(e=>setTimeout(e,0));return n}async function ne(e,t){let n=R();if(!n)return z(e,t);let r=I+=1;try{return await new Promise((i,a)=>{L.set(r,{resolve:i,reject:a}),n.postMessage({id:r,candidates:e,pages:t})})}catch{return z(e,t)}}r();var re=null;function B(){return re||(re=c(()=>import(`./pdf-BP_vXBKO.js`).then(e=>{let t=e.default??e;return t?.GlobalWorkerOptions&&(t.GlobalWorkerOptions.workerSrc=new URL(`/assets/pdf.worker.min-yatZIOMy.mjs`,``+import.meta.url).href),t}),__vite__mapDeps([0,1,2,3,4,5,6])).catch(()=>null),re)}function ie(e){if(typeof e?.str!=`string`||e.str.trim()===``)return null;let t=e.transform??[1,0,0,1,0,0],n=Math.hypot(t[2],t[3])||(typeof e.height==`number`?e.height:0)||10;return{it:e,left:t[4],y:t[5],w:typeof e.width==`number`?e.width:0,h:n}}function V(e){e.sort((e,t)=>t.y-e.y||e.left-t.left);let t=[],n=[],r=0,i=0;for(let a of e)n.length>0&&Math.abs(a.y-r)>Math.max(i,a.h)*.5&&(t.push(n),n=[]),n.length===0&&(r=a.y,i=a.h),n.push(a);n.length>0&&t.push(n);let a=[];for(let e of t){e.sort((e,t)=>e.left-t.left);for(let t of e)a.push(t.it)}return a}function ae(e){let t=e.map(ie).filter(e=>e!==null);if(t.length<2)return t.map(e=>e.it);let n=Math.min(...t.map(e=>e.left)),r=Math.max(...t.map(e=>e.left+e.w)),i=Math.max(...t.map(e=>e.y)),a=Math.min(...t.map(e=>e.y)),o=r-n||1,s=i-a||1,c=null,l=t.filter(e=>e.y<i-.1*s&&e.y>a+.04*s);if(l.length>6)for(let e of[.5,.48,.52,.46,.54]){let r=n+e*o,i=l.filter(e=>e.left<r-2&&e.left+e.w>r+2).length,a=t.filter(e=>e.left+e.w/2<r).length,s=t.length-a;if(i<=Math.max(2,l.length*.02)&&a>t.length*.2&&s>t.length*.2){c=r;break}}if(c===null)return V(t);let u=c;return[...V(t.filter(e=>e.left+e.w/2<u)),...V(t.filter(e=>e.left+e.w/2>=u))]}async function H(e){let t=await B();if(!t?.getDocument)return null;try{let n=await v(e),r=await t.getDocument({data:n.slice()}).promise,i=[];for(let e=1;e<=r.numPages;e+=1){let t=await r.getPage(e),n=ae((await t.getTextContent()).items).map(e=>typeof e.str==`string`?e.str:``).join(` `);i.push(n),t.cleanup?.()}return await r.destroy?.(),i}catch{return null}}function U(){return Math.min(2,Math.max(1,typeof window<`u`&&window.devicePixelRatio||1))}function oe(e){return Math.max(600,Math.min(1900,Math.round((Number.isFinite(e)&&e>0?e:1200)*1.15)))}var W=e=>e.file??e.bytes??e.data,se=null,G=null,K=null,q=0;async function ce(e,t){let n=W(e);for(;K&&K.key!==n;)await K.promise.catch(()=>{});if(se===n&&G)return G;if(K&&K.key===n)return K.promise;let r=q,i=(async()=>{if(G)try{await G.destroy?.()}catch{}let i=y(e)??await v(e),a=await t.getDocument({data:i.slice()}).promise;if(r!==q){try{await a.destroy?.()}catch{}throw Error(`render doc superseded`)}return G=a,se=n,a})(),a={key:n,promise:i};K=a;try{return await i}finally{K===a&&(K=null)}}async function le(){q+=1,K=null;let e=G;G=null,se=null;try{await e?.destroy?.()}catch{}}function J(e){return Array.from(e.normalize(`NFKC`)).map(e=>e===`­`?``:`‘’‛`.includes(e)?`'`:`“”`.includes(e)?`"`:/[‐-―]/.test(e)?`-`:/\s/.test(e)?` `:e.toLowerCase())}async function ue(e,t,n,r=720,i=!1,a=[]){let o=await B();if(!o?.getDocument)return null;let s=null;try{let c=await ce(e,o);if(t<1||t>c.numPages)return null;s=await c.getPage(t);let l=s.getViewport({scale:1}),u=U(),d=r/l.width*u,f=s.getViewport({scale:d}),p=document.createElement(`canvas`);p.width=Math.ceil(f.width),p.height=Math.ceil(f.height);let m=p.getContext(`2d`);if(!m)return null;await s.render({canvasContext:m,viewport:f}).promise;let h=await s.getTextContent(),g=de(h,n,f,o),_=a.map(e=>de(h,e,f,o)),v=null;if(i||me(n))try{v=ve(await s.getOperatorList(),h,g,f,o)}catch{v=null}return{canvas:p,rects:g,figure:v,alsoRects:_}}catch{return null}finally{s?.cleanup?.()}}function de(e,t,n,r){let i=D(t);if(!i)return[];let a=[];for(let t of ae(e.items)){if(typeof t.str!=`string`)continue;let e=fe(t,n,r);if(!e)continue;let i=J(t.str),o=i.filter(e=>e.length>0).length||1,s=e.w/o,c=0;for(let t of i)t!==``&&(a.push({ch:t,rect:{x:e.x+s*c,y:e.y,w:s,h:e.h}}),c+=1);a.push({ch:` `,rect:{x:e.x+e.w,y:e.y,w:0,h:e.h}})}let o=[];for(let e=0;e<a.length;e+=1){let t=a[e];if(t.ch===`-`){let t=e+1;for(;t<a.length&&a[t].ch===` `;)t+=1;if(t>e+1){e=t-1;continue}}if(t.ch===` `){let t=o[o.length-1];if(t&&`$€£¥`.includes(t.ch)){let t=e+1;for(;t<a.length&&a[t].ch===` `;)t+=1;if(t<a.length&&/[\d(]/.test(a[t].ch))continue}if(t&&t.ch===` `)continue}o.push(t)}let s=o.map(e=>e.ch).join(``).indexOf(i);return s<0?[]:pe(o.slice(s,s+i.length).filter(e=>e.rect.w>0).map(e=>e.rect))}function fe(e,t,n){try{let r=n.Util.transform(t.transform,e.transform),i=r[4],a=r[5],o=(e.width||0)*t.scale,s=Math.hypot(r[2],r[3])||10,c=s*1.15;return o<=0?null:{x:i,y:a-s,w:o,h:c}}catch{return null}}function pe(e){if(e.length===0)return e;let t=[...e].sort((e,t)=>e.y-t.y||e.x-t.x),n=[];for(let e of t){let t=n[n.length-1];if(t&&Math.abs(t.y-e.y)<t.h*.6&&e.x<=t.x+t.w+t.h){let n=Math.max(t.x+t.w,e.x+e.w);t.x=Math.min(t.x,e.x),t.w=n-t.x,t.y=Math.min(t.y,e.y),t.h=Math.max(t.h,e.h)}else n.push({...e})}return n}function me(e){return/\b(fig(?:ure|\.)?|table|chart|diagram|graph|plot|schematic|illustration)\b/i.test(e)}function he(e,t,n){let r=n.OPS??{},i=e.fnArray??[],a=e.argsArray??[],o=t.transform,s=[],c=[];for(let e=0;e<i.length;e+=1){let l=i[e];if(l===r.save)s.push(o);else if(l===r.restore)o=s.pop()??t.transform;else if(l===r.transform)o=n.Util.transform(o,a[e]);else if(l===r.paintImageXObject||l===r.paintInlineImage||l===r.paintImageMaskXObject||l===r.paintJpegXObject){let e=o,t=[e[4],e[0]+e[4],e[2]+e[4],e[0]+e[2]+e[4]],n=[e[5],e[1]+e[5],e[3]+e[5],e[1]+e[3]+e[5]],r=Math.min(...t),i=Math.min(...n),a=Math.max(...t)-r,s=Math.max(...n)-i;a>8&&s>8&&c.push({x:r,y:i,w:a,h:s})}}return c}function ge(e,t,n){let r=[];for(let i of e.items){if(typeof i.str!=`string`||i.str.trim()===``)continue;let e=fe(i,t,n);e&&r.push(e)}return pe(r)}function _e(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function ve(e,t,n,r,i){let a=he(e,r,i);if(a.length===0||n.length===0)return null;let o=ye(n),s=o.x+o.w/2,c=null,l=1/0;for(let e of a){let t=e.x+e.w/2,n=Math.abs(t-s);if(n>Math.max(e.w,o.w))continue;let r=be(e,o)+n*.5;r<l&&(l=r,c=e)}if(!c)return null;let u=ge(t,r,i).filter(e=>!_e(e,o)),d=xe(c,u,o);return!d||d.w<10||d.h<10?null:d}function ye(e){let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.w)),i=Math.max(...e.map(e=>e.y+e.h));return{x:t,y:n,w:r-t,h:i-n}}function be(e,t){return e.y+e.h<t.y?t.y-(e.y+e.h):t.y+t.h<e.y?e.y-(t.y+t.h):0}function xe(e,t,n){let r=e.y,i=e.y+e.h,a=n.y+n.h/2;for(let n of t){let t=n.y+n.h/2;Math.min(e.x+e.w,n.x+n.w)-Math.max(e.x,n.x)<e.w*.3||(t<a&&n.y+n.h>e.y&&t<e.y+e.h/2&&(r=Math.max(r,n.y+n.h)),t>a&&n.y<i&&(i=Math.min(i,n.y)))}return i-r<10?null:{x:e.x,y:r,w:e.w,h:i-r}}var Se=/\.(csv|tsv|tab)$/i,Ce=/\.(md|markdown)$/i,we=/\.(json|jsonl|ndjson)$/i,Te=/\.(ya?ml|toml|xml|js|ts|jsx|tsx|py|rb|go|rs|java|c|h|cpp|cs|sh|sql|css|html?)$/i,Ee=40,De=1600;function Oe(e){let t=e.replace(/\r\n?/g,`
5
+ `)}`}function P(e,t){let n=[];for(let r of e){let e=O(r.quote,t,r.page);if(e>0){n.push({...r,page:e});continue}let i=[...new Set([r.page,...t.map((e,t)=>t+1)])].filter(e=>e>=1&&e<=t.length);for(let e of i){let i=E(r.quote,t[e-1]);if(i){n.push({...r,quote:i,page:e});break}}}return n}var F=null,I=0,L=new Map;function R(){if(typeof Worker>`u`)return null;if(F)return F;try{return F=new Worker(new URL(`/assets/prismGround.worker-CIvKqxm2.js`,``+import.meta.url),{type:`module`}),F.onmessage=e=>{let t=e.data,n=L.get(t.id);n&&(L.delete(t.id),t.ok?n.resolve(t.claims??[]):n.reject(Error(t.error??`Grounding failed`)))},F.onerror=()=>{let e=Error(`Grounding worker failed`);for(let t of L.values())t.reject(e);L.clear(),F?.terminate(),F=null},F}catch{return F=null,null}}async function z(e,t){let n=[];for(let r=0;r<e.length;r+=16)n.push(...P(e.slice(r,r+16),t)),r+16<e.length&&await new Promise(e=>setTimeout(e,0));return n}async function ne(e,t){let n=R();if(!n)return z(e,t);let r=I+=1;try{return await new Promise((i,a)=>{L.set(r,{resolve:i,reject:a}),n.postMessage({id:r,candidates:e,pages:t})})}catch{return z(e,t)}}r();var re=null;function B(){return re||(re=c(()=>import(`./pdf-x4qTBJIZ.js`).then(e=>{let t=e.default??e;return t?.GlobalWorkerOptions&&(t.GlobalWorkerOptions.workerSrc=new URL(`/assets/pdf.worker.min-yatZIOMy.mjs`,``+import.meta.url).href),t}),__vite__mapDeps([0,1,2,3,4,5,6])).catch(()=>null),re)}function ie(e){if(typeof e?.str!=`string`||e.str.trim()===``)return null;let t=e.transform??[1,0,0,1,0,0],n=Math.hypot(t[2],t[3])||(typeof e.height==`number`?e.height:0)||10;return{it:e,left:t[4],y:t[5],w:typeof e.width==`number`?e.width:0,h:n}}function V(e){e.sort((e,t)=>t.y-e.y||e.left-t.left);let t=[],n=[],r=0,i=0;for(let a of e)n.length>0&&Math.abs(a.y-r)>Math.max(i,a.h)*.5&&(t.push(n),n=[]),n.length===0&&(r=a.y,i=a.h),n.push(a);n.length>0&&t.push(n);let a=[];for(let e of t){e.sort((e,t)=>e.left-t.left);for(let t of e)a.push(t.it)}return a}function ae(e){let t=e.map(ie).filter(e=>e!==null);if(t.length<2)return t.map(e=>e.it);let n=Math.min(...t.map(e=>e.left)),r=Math.max(...t.map(e=>e.left+e.w)),i=Math.max(...t.map(e=>e.y)),a=Math.min(...t.map(e=>e.y)),o=r-n||1,s=i-a||1,c=null,l=t.filter(e=>e.y<i-.1*s&&e.y>a+.04*s);if(l.length>6)for(let e of[.5,.48,.52,.46,.54]){let r=n+e*o,i=l.filter(e=>e.left<r-2&&e.left+e.w>r+2).length,a=t.filter(e=>e.left+e.w/2<r).length,s=t.length-a;if(i<=Math.max(2,l.length*.02)&&a>t.length*.2&&s>t.length*.2){c=r;break}}if(c===null)return V(t);let u=c;return[...V(t.filter(e=>e.left+e.w/2<u)),...V(t.filter(e=>e.left+e.w/2>=u))]}async function H(e){let t=await B();if(!t?.getDocument)return null;try{let n=await v(e),r=await t.getDocument({data:n.slice()}).promise,i=[];for(let e=1;e<=r.numPages;e+=1){let t=await r.getPage(e),n=ae((await t.getTextContent()).items).map(e=>typeof e.str==`string`?e.str:``).join(` `);i.push(n),t.cleanup?.()}return await r.destroy?.(),i}catch{return null}}function U(){return Math.min(2,Math.max(1,typeof window<`u`&&window.devicePixelRatio||1))}function oe(e){return Math.max(600,Math.min(1900,Math.round((Number.isFinite(e)&&e>0?e:1200)*1.15)))}var W=e=>e.file??e.bytes??e.data,se=null,G=null,K=null,q=0;async function ce(e,t){let n=W(e);for(;K&&K.key!==n;)await K.promise.catch(()=>{});if(se===n&&G)return G;if(K&&K.key===n)return K.promise;let r=q,i=(async()=>{if(G)try{await G.destroy?.()}catch{}let i=y(e)??await v(e),a=await t.getDocument({data:i.slice()}).promise;if(r!==q){try{await a.destroy?.()}catch{}throw Error(`render doc superseded`)}return G=a,se=n,a})(),a={key:n,promise:i};K=a;try{return await i}finally{K===a&&(K=null)}}async function le(){q+=1,K=null;let e=G;G=null,se=null;try{await e?.destroy?.()}catch{}}function J(e){return Array.from(e.normalize(`NFKC`)).map(e=>e===`­`?``:`‘’‛`.includes(e)?`'`:`“”`.includes(e)?`"`:/[‐-―]/.test(e)?`-`:/\s/.test(e)?` `:e.toLowerCase())}async function ue(e,t,n,r=720,i=!1,a=[]){let o=await B();if(!o?.getDocument)return null;let s=null;try{let c=await ce(e,o);if(t<1||t>c.numPages)return null;s=await c.getPage(t);let l=s.getViewport({scale:1}),u=U(),d=r/l.width*u,f=s.getViewport({scale:d}),p=document.createElement(`canvas`);p.width=Math.ceil(f.width),p.height=Math.ceil(f.height);let m=p.getContext(`2d`);if(!m)return null;await s.render({canvasContext:m,viewport:f}).promise;let h=await s.getTextContent(),g=de(h,n,f,o),_=a.map(e=>de(h,e,f,o)),v=null;if(i||me(n))try{v=ve(await s.getOperatorList(),h,g,f,o)}catch{v=null}return{canvas:p,rects:g,figure:v,alsoRects:_}}catch{return null}finally{s?.cleanup?.()}}function de(e,t,n,r){let i=D(t);if(!i)return[];let a=[];for(let t of ae(e.items)){if(typeof t.str!=`string`)continue;let e=fe(t,n,r);if(!e)continue;let i=J(t.str),o=i.filter(e=>e.length>0).length||1,s=e.w/o,c=0;for(let t of i)t!==``&&(a.push({ch:t,rect:{x:e.x+s*c,y:e.y,w:s,h:e.h}}),c+=1);a.push({ch:` `,rect:{x:e.x+e.w,y:e.y,w:0,h:e.h}})}let o=[];for(let e=0;e<a.length;e+=1){let t=a[e];if(t.ch===`-`){let t=e+1;for(;t<a.length&&a[t].ch===` `;)t+=1;if(t>e+1){e=t-1;continue}}if(t.ch===` `){let t=o[o.length-1];if(t&&`$€£¥`.includes(t.ch)){let t=e+1;for(;t<a.length&&a[t].ch===` `;)t+=1;if(t<a.length&&/[\d(]/.test(a[t].ch))continue}if(t&&t.ch===` `)continue}o.push(t)}let s=o.map(e=>e.ch).join(``).indexOf(i);return s<0?[]:pe(o.slice(s,s+i.length).filter(e=>e.rect.w>0).map(e=>e.rect))}function fe(e,t,n){try{let r=n.Util.transform(t.transform,e.transform),i=r[4],a=r[5],o=(e.width||0)*t.scale,s=Math.hypot(r[2],r[3])||10,c=s*1.15;return o<=0?null:{x:i,y:a-s,w:o,h:c}}catch{return null}}function pe(e){if(e.length===0)return e;let t=[...e].sort((e,t)=>e.y-t.y||e.x-t.x),n=[];for(let e of t){let t=n[n.length-1];if(t&&Math.abs(t.y-e.y)<t.h*.6&&e.x<=t.x+t.w+t.h){let n=Math.max(t.x+t.w,e.x+e.w);t.x=Math.min(t.x,e.x),t.w=n-t.x,t.y=Math.min(t.y,e.y),t.h=Math.max(t.h,e.h)}else n.push({...e})}return n}function me(e){return/\b(fig(?:ure|\.)?|table|chart|diagram|graph|plot|schematic|illustration)\b/i.test(e)}function he(e,t,n){let r=n.OPS??{},i=e.fnArray??[],a=e.argsArray??[],o=t.transform,s=[],c=[];for(let e=0;e<i.length;e+=1){let l=i[e];if(l===r.save)s.push(o);else if(l===r.restore)o=s.pop()??t.transform;else if(l===r.transform)o=n.Util.transform(o,a[e]);else if(l===r.paintImageXObject||l===r.paintInlineImage||l===r.paintImageMaskXObject||l===r.paintJpegXObject){let e=o,t=[e[4],e[0]+e[4],e[2]+e[4],e[0]+e[2]+e[4]],n=[e[5],e[1]+e[5],e[3]+e[5],e[1]+e[3]+e[5]],r=Math.min(...t),i=Math.min(...n),a=Math.max(...t)-r,s=Math.max(...n)-i;a>8&&s>8&&c.push({x:r,y:i,w:a,h:s})}}return c}function ge(e,t,n){let r=[];for(let i of e.items){if(typeof i.str!=`string`||i.str.trim()===``)continue;let e=fe(i,t,n);e&&r.push(e)}return pe(r)}function _e(e,t){return e.x<t.x+t.w&&e.x+e.w>t.x&&e.y<t.y+t.h&&e.y+e.h>t.y}function ve(e,t,n,r,i){let a=he(e,r,i);if(a.length===0||n.length===0)return null;let o=ye(n),s=o.x+o.w/2,c=null,l=1/0;for(let e of a){let t=e.x+e.w/2,n=Math.abs(t-s);if(n>Math.max(e.w,o.w))continue;let r=be(e,o)+n*.5;r<l&&(l=r,c=e)}if(!c)return null;let u=ge(t,r,i).filter(e=>!_e(e,o)),d=xe(c,u,o);return!d||d.w<10||d.h<10?null:d}function ye(e){let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.w)),i=Math.max(...e.map(e=>e.y+e.h));return{x:t,y:n,w:r-t,h:i-n}}function be(e,t){return e.y+e.h<t.y?t.y-(e.y+e.h):t.y+t.h<e.y?e.y-(t.y+t.h):0}function xe(e,t,n){let r=e.y,i=e.y+e.h,a=n.y+n.h/2;for(let n of t){let t=n.y+n.h/2;Math.min(e.x+e.w,n.x+n.w)-Math.max(e.x,n.x)<e.w*.3||(t<a&&n.y+n.h>e.y&&t<e.y+e.h/2&&(r=Math.max(r,n.y+n.h)),t>a&&n.y<i&&(i=Math.min(i,n.y)))}return i-r<10?null:{x:e.x,y:r,w:e.w,h:i-r}}var Se=/\.(csv|tsv|tab)$/i,Ce=/\.(md|markdown)$/i,we=/\.(json|jsonl|ndjson)$/i,Te=/\.(ya?ml|toml|xml|js|ts|jsx|tsx|py|rb|go|rs|java|c|h|cpp|cs|sh|sql|css|html?)$/i,Ee=40,De=1600;function Oe(e){let t=e.replace(/\r\n?/g,`
6
6
  `).split(`
7
7
  `);if(t.length&&t[t.length-1]===``&&t.pop(),t.length===0)return[];let n=t[0],r=t.slice(1);if(r.length===0)return[n];let i=[];for(let e=0;e<r.length;e+=Ee)i.push([n,...r.slice(e,e+Ee)].join(`
8
8
  `));return i}function ke(e){let t=e.replace(/\r\n?/g,`
@@ -127,5 +127,5 @@ CLAIMS AND THEIR SOURCES:
127
127
  ${e.map(e=>{let n=(t.get(e.id)??[]).map(e=>` - "${e.title}": ${e.snippet} (${e.url})`).join(`
128
128
  `);return`[claim ${e.id}] "${e.quote}"\n sources:\n${n}`}).join(`
129
129
 
130
- `)}`}async function Xn(e,t){let n=t.provider??Vn(t.searchProviderId,t.apiKey),r=e.filter(e=>e.role===`load-bearing`).slice(0,t.maxClaims??12);if(r.length===0)return[];let i=new Map;await Promise.all(r.map(async e=>{let r=await n.search(Wn(e),{apiKey:t.apiKey,signal:t.signal,limit:t.perClaimResults??4});i.set(e.id,r.map(e=>({title:e.title,url:e.url,snippet:e.snippet})))}));let a=r.filter(e=>(i.get(e.id)?.length??0)>0),o=r.filter(e=>(i.get(e.id)?.length??0)===0).map(e=>({claimId:e.id,verdict:`unsupported`,note:`No live source was found to check this.`}));if(a.length===0)return o;let s=Math.min(4096,Math.max(1400,250+a.length*150)),c;try{c=(await b(t.cfg.provider).generate({system:Jn,history:[],user:Yn(a,i),maxTokens:s,temperature:0,format:null,...t.signal?{signal:t.signal}:{}},t.cfg)).raw}catch{for(let e of a)o.push({claimId:e.id,verdict:`unsupported`,note:`Could not reach the fact-checker.`});return o}let l=qn(c),u=new Set;for(let e of l)u.has(e.claimId)||a.some(t=>t.id===e.claimId)&&(u.add(e.claimId),o.push(Bn(e,i.get(e.claimId)??[])));for(let e of a)u.has(e.id)||o.push({claimId:e.id,verdict:`unsupported`,note:`The sources did not clearly speak to this.`});return o}var Zn=4,Qn=3,$n=2,er={contradicted:4,disputed:3,outdated:2,unsupported:1,holds:0},tr={contradicts:`contradicts`,"in-tension":`is in tension with`,agrees:`agrees with`};function nr(e,t){let n=e.replace(/\s+/g,` `).trim();if(n.length<=t)return n;let r=n.slice(0,t),i=r.lastIndexOf(` `);return(i>t*.6?r.slice(0,i):r).trimEnd()+`…`}function rr(e){return Math.max(2600,Math.min(7e3,Math.round(e.length*60)+1200))}function ir(e){let t=new Map;for(let n of e)t.set(n.a,(t.get(n.a)??0)+1),t.set(n.b,(t.get(n.b)??0)+1);return t}function ar(e,t,n){if(e.length===0)return[];let r=new Map(e.map(e=>[e.id,e])),i=ir(t),a=[],o=new Set,s=0,c=(e,t,n,r)=>{a.push({id:`b${s+=1}`,kind:e,claimIds:t,caption:n,spoken:r,dwellMs:rr(r)});for(let e of t)o.add(e)},l=e.filter(e=>e.role===`load-bearing`),u=[...l.length>0?l:e].sort((e,t)=>(i.get(t.id)??0)-(i.get(e.id)??0)||e.page-t.page||e.id.localeCompare(t.id))[0];c(`open`,[u.id],`The case rests on this — “${nr(u.quote,96)}” · p.${u.page}`,`The whole case rests on this, on page ${u.page}. ${nr(u.quote,220)}`);let d={contradicts:0,"in-tension":1,agrees:2},f=t.filter(e=>e.relation!==`agrees`&&r.has(e.a)&&r.has(e.b)).sort((e,t)=>d[e.relation]-d[t.relation]).slice(0,Zn);for(let e of f){let t=r.get(e.a),n=r.get(e.b),i=e.crossDoc?` (across documents)`:``;c(`tension`,[t.id,n.id],`p.${t.page}: “${nr(t.quote,52)}” — ${tr[e.relation]}${i} — p.${n.page}: “${nr(n.quote,52)}”`,`On page ${t.page}, the document says ${nr(t.quote,140)}. But it ${tr[e.relation]} page ${n.page}: ${nr(n.quote,140)}.`)}let p=e.map(e=>({c:e,v:n.get(e.id)})).filter(e=>!!e.v&&er[e.v]>=2&&!o.has(e.c.id)).sort((e,t)=>er[t.v]-er[e.v]||e.c.page-t.c.page).slice(0,Qn);for(let{c:e,v:t}of p){let n=Fn[t].label;c(`verdict`,[e.id],`${n} — “${nr(e.quote,72)}” · p.${e.page}`,`The public record marks this ${n.toLowerCase()}: ${nr(e.quote,160)}`)}let m=e.filter(e=>(e.role===`context`||e.kind===`definition`)&&!o.has(e.id)).sort((e,t)=>e.page-t.page).slice(0,$n);for(let e of m)c(`context`,[e.id],`Context — ${nr(e.title,64)} · p.${e.page}`,`For context: ${e.title}.`);let h=e.map(e=>({c:e,v:n.get(e.id)})).filter(e=>!!e.v&&er[e.v]>=2).sort((e,t)=>er[t.v]-er[e.v]||e.c.page-t.c.page)[0];if(h){let e=Fn[h.v].label;c(`close`,[h.c.id],`The weak point — ${e}: “${nr(h.c.quote,68)}” · p.${h.c.page}`,`So the weakest point: the public record marks this ${e.toLowerCase()} — ${nr(h.c.quote,150)}`)}else if(f.length>0){let e=f[0],t=r.get(e.a),n=r.get(e.b);c(`close`,[t.id,n.id],`The weak point — the document contradicts itself: p.${t.page} vs p.${n.page}`,`And the weakest point is that the document contradicts itself, between page ${t.page} and page ${n.page}.`)}else{let e=n.get(u.id)===`holds`;c(`close`,[u.id],e?`Nothing here contradicts itself — the case rests on this one claim, and it holds.`:`Nothing here contradicts itself — the whole case rests on this one claim.`,e?`Nothing here contradicts itself. The case rests entirely on that one claim — and the public record backs it.`:`Nothing here contradicts itself. The whole case rests on that one claim.`)}return a}var or=16;function sr(){let e=(0,M.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=(0,j.useRef)(t),[r,i]=(0,j.useState)(0),a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{let t=n.current,r=t.findIndex(t=>t.seed===e.seed);r>=0?t[r]=e:(t.push(e),t.length>or&&t.shift()),i(t.length)},e[1]=a):a=e[1];let o=a,s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{n.current=[],i(0)},e[2]=s):s=e[2];let c=s,l;return e[3]===r?l=e[4]:(l={steps:n,count:r,record:o,clear:c},e[3]=r,e[4]=l),l}var cr={forecast:`#5468e0`,stat:`#12a37a`,finding:`#1f9d7e`,risk:`#e0474d`,definition:`#5a6678`,method:`#cf8327`,diagram:`#5468e0`},lr=`#6a4fd0`;function ur(e){return cr[e]}var dr={"load-bearing":`The document leans on this`,supporting:`Supporting evidence`,context:`Context`};function fr(e){return`${dr[e.role]} — ${e.title}`}function pr(e){let t=e.role===`load-bearing`,n=e.kind===`forecast`;if(!(!t&&!n))return{...t?{star:t}:{},...n?{question:n}:{}}}var mr={forecast:`forecast`,stat:`figure`,finding:`finding`,risk:`risk`,definition:`definition`,method:`method`,diagram:`figure`},hr={"load-bearing":e=>`The ${e} the document leans on`,supporting:e=>`Supporting ${e}`,context:e=>`Context — ${e}`};function gr(e){return`${hr[e.role](mr[e.kind])} · page ${e.page}`}var _r=s();r();var vr=n(()=>c(()=>import(`./ShareModal-d_o2hebL.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([7,2,1,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),yr=vr.Component;function br({steps:e,spec:t,pdfs:n,cfg:r,placed:a,verdicts:s}){let[l,d]=(0,j.useState)(!1),[f,p]=(0,j.useState)(null);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,disabled:l,onClick:(0,j.useCallback)(async()=>{if(!l){d(!0);try{let[{autoAnnotationSteps:r},{buildAnnotationReel:i}]=await Promise.all([c(()=>import(`./annotationAuto-L2AxlJ2F.js`),__vite__mapDeps([22,23,2,24,25,26,1,3,4,5,6,27])),c(()=>import(`./annotationReel-DdHNp2IH.js`).then(e=>e.t),__vite__mapDeps([28,2,10,1,3,4,5,6,11,16])),vr.preload()]),o=e.current,l=o.length>=1?o.slice():await r(t,n,{placed:a,verdicts:s,max:6});if(!l.length){u(`Turn on Annotate, then ask a question or tap a claim to mark it up`,`warn`);return}p(i(l,{fileName:t.fileName}))}finally{d(!1)}}},[l,e,t,n,a,s]),title:`Make a shareable reel of the marked-up pages`,...i(vr.preload),children:l?`Preparing…`:`Share reel`}),f&&(0,_r.createPortal)((0,Q.jsx)(o,{label:`Annotation reel`,overlay:!0,children:(0,Q.jsx)(yr,{script:f,cfg:r??void 0,onClose:()=>p(null)})}),document.body)]})}r();var xr=n(()=>c(()=>import(`./PrismAskController-QXSoZBNb.js`).then(e=>({default:e.PrismAskController})),__vite__mapDeps([29,1,2,3,4,5,6,23,24,25,30,31,32,33,34]))),Sr=n(()=>c(()=>import(`./PrismBriefingPlayer-edFfwMNP.js`).then(e=>({default:e.PrismBriefingPlayer})),__vite__mapDeps([35,1,2,3,4,5,6,26,27]))),Cr=n(()=>c(()=>import(`./CrossExamPanel-DJCn13Aa.js`).then(e=>({default:e.CrossExamPanel})),__vite__mapDeps([36,1,2,3,4,5,6,37]))),wr=n(()=>c(()=>import(`./ForecastPanel-BfAngk8l.js`).then(e=>({default:e.ForecastPanel})),__vite__mapDeps([38,1,2,3,4,5,6,30,39]))),Tr=n(()=>c(()=>import(`./LeverPanel-DgfX7mTL.js`).then(e=>({default:e.LeverPanel})),__vite__mapDeps([40,1,2,3,4,5,6,41,42]))),Er=n(()=>c(()=>import(`./WhyMachineOverlay-DgYhqU53.js`).then(e=>({default:e.WhyMachineOverlay})),__vite__mapDeps([43,1,2,3,4,5,6,44,30,45]))),Dr=xr.Component,Or=Sr.Component,kr=Cr.Component,Ar=wr.Component,jr=Tr.Component,Mr=Er.Component,Nr=null,Pr=null,Fr=null,Ir=null,Lr=null,Rr=()=>Nr??=c(()=>import(`./run-BYP2YlZT.js`),__vite__mapDeps([46,23,2,24,25,32,47,48])),zr=()=>Pr??=c(()=>import(`./run-DSVvshaB.js`),__vite__mapDeps([49,23,2,24,25,32,48])),Br=()=>Fr??=c(()=>import(`./run-Dc2ZJz6n.js`),__vite__mapDeps([50,23,2,24,25,31,32,47,33,48])),Vr=()=>Ir??=c(()=>import(`./model-BE0UHu1w.js`),__vite__mapDeps([51,23,2,24,25,32,41,47])),Hr=()=>Lr??=c(()=>import(`./explode-WBykfhqW.js`),__vite__mapDeps([52,23,2,24,25,31,32,53,54,55])),Ur=null;function Wr(){return Ur??=c(()=>import(`./kokoro-Da60jB7C.js`).then(e=>e.i),__vite__mapDeps([20,2,1,3,4,5,6,16])),Ur}function Gr(){Ur&&Ur.then(e=>e.cancelKokoro())}function Kr(e){Wr().then(t=>t.speakKokoroResult(e,`mavea`))}var qr={forecast:{color:`var(--presence)`,label:`FORECAST`},stat:{color:`var(--insight)`,label:`STAT`},finding:{color:`var(--insight-soft)`,label:`FINDING`},risk:{color:`var(--danger)`,label:`RISK`},definition:{color:`var(--text-muted)`,label:`DEFINITION`},method:{color:`var(--warning)`,label:`METHOD`},diagram:{color:`var(--presence)`,label:`FIGURE`}},Jr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--danger)`],Yr={contradicts:`contradicts`,"in-tension":`in tension`,agrees:`agrees`},Xr=[{kind:`forecast`,desc:`what it predicts`},{kind:`finding`,desc:`what it observed`},{kind:`definition`,desc:`its terms`},{kind:`method`,desc:`how it knows`},{kind:`stat`,desc:`a hard number`},{kind:`risk`,desc:`the caveats`},{kind:`diagram`,desc:`a figure or chart`}],Zr=[{relation:`agrees`,name:`Supports`,desc:`one claim props up another`},{relation:`contradicts`,name:`Contradicts`,desc:`two passages disagree`},{relation:`in-tension`,name:`In tension`,desc:`a softer pull, not a clash`}],Qr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--insight-soft)`];function $r(e,t){let n=t?`another document`:`another passage`;return e===`agrees`?`agrees with ${n}`:e===`in-tension`?`in tension with ${n}`:`contradicts ${n}`}function ei(e){return e?e.relation:`anchored`}function ti(e){return e?e.relation===`agrees`?`agrees · ready`:e.relation===`in-tension`?`in tension`:`in contradiction`:`anchored · ready`}function ni({pdf:e,cfg:t,search:n,onClose:r,world:a,corpusChrome:s,autoBriefing:c}){let u=(0,j.useMemo)(()=>Array.isArray(e)?e:[e],[e]),f=u.length>1,[p,m]=(0,j.useState)(!1),h=_t(t),{phase:g,spec:_,corpus:v,proposed:y,error:b}=a??h,{explode:x}=h,[S,C]=(0,j.useState)(null),[w,T]=(0,j.useState)(null),[E,D]=(0,j.useState)(null),[O,k]=(0,j.useState)(()=>new Set),[A,M]=(0,j.useState)(!1),[ee,N]=(0,j.useState)(!1),[te,P]=(0,j.useState)(null),[F,I]=(0,j.useState)(0),[L,R]=(0,j.useState)(null),[z,ne]=(0,j.useState)(()=>new Set),re=(0,j.useRef)(()=>{}),[B,ie]=(0,j.useState)(null),[V,ae]=(0,j.useState)(!1),[H,U]=(0,j.useState)(!1),oe=(0,j.useRef)(null),[W,se]=(0,j.useState)(null),[G,K]=(0,j.useState)(!1),[q,ce]=(0,j.useState)(!1),[J,ue]=(0,j.useState)(null),de=(0,j.useRef)(null),[fe,pe]=(0,j.useState)(null),[me,he]=(0,j.useState)(!1),[ge,_e]=(0,j.useState)(!1),[ve,ye]=(0,j.useState)(null),be=(0,j.useRef)(null),[xe,Se]=(0,j.useState)(null),[Ce,we]=(0,j.useState)(!1),[Te,Ee]=(0,j.useState)(!1),De=(0,j.useRef)(!1),Oe=(0,j.useRef)(null),[ke,Ae]=(0,j.useState)(`map`),[je,Me]=(0,j.useState)(null),[Ne,Pe]=(0,j.useState)(null),Fe=(0,j.useRef)(null),[Ie,Le]=(0,j.useState)(!1),[Re,ze]=(0,j.useState)(44),Be=(0,j.useRef)(null),Ve=(0,j.useRef)(!1),He=(0,j.useRef)(null);l(He);let[Ue,We]=(0,j.useState)(()=>new Map),[Ge,Ke]=(0,j.useState)(!1),[qe,Je]=(0,j.useState)(c===!0),[Ye,Xe]=(0,j.useState)(!1),[Ze,Qe]=(0,j.useState)(``),{steps:$e,record:et,clear:tt}=sr(),nt=(0,j.useCallback)(e=>{Ve.current=!0,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()},[]),rt=(0,j.useCallback)(e=>{if(!Ve.current||!Be.current)return;let t=Be.current.getBoundingClientRect(),n=(t.right-e.clientX)/t.width*100;ze(Math.max(24,Math.min(100,n)))},[]),it=(0,j.useCallback)(e=>{Ve.current=!1;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),at=(0,j.useRef)(!1);(0,j.useEffect)(()=>{a||at.current||(at.current=!0,x(u))},[u,x]),(0,j.useEffect)(()=>()=>void le(),[]),(0,j.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(L?(Gr(),R(null),ne(new Set),C(null),re.current()):w?T(null):E?D(null):S?C(null):r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[L,w,E,S,r]);let[ot,st]=(0,j.useState)(null);(0,j.useEffect)(()=>{if(!_||_.claims.length<48)return;let e=!0;return Nt(_,Jr).then(t=>{e&&st({spec:_,result:t})}),()=>{e=!1}},[_]);let Y=(0,j.useMemo)(()=>_?_.claims.length<48?Tt(_,Jr):ot?.spec===_?ot.result:null:null,[ot,_]),ct=(0,j.useRef)(null),lt=(0,j.useMemo)(()=>{if(!Y||Y.claims.length===0)return;let e=1/0,t=1/0,n=-1/0,r=-1/0;for(let i of Y.claims)e=Math.min(e,i.x),t=Math.min(t,i.y),n=Math.max(n,i.x+200),r=Math.max(r,i.y+96);for(let i of Y.regions)e=Math.min(e,i.cx),t=Math.min(t,i.cy),n=Math.max(n,i.cx),r=Math.max(r,i.cy);return{x:e-56,y:t-56,w:n-e+112,h:r-t+112}},[Y]),X=xt(ct,Y?.width??1,Y?.height??1,lt),ut=(0,j.useMemo)(()=>{let e=new Map;if(Y)for(let t of Y.claims)e.set(t.id,t);return e},[Y]),dt=(0,j.useMemo)(()=>{let e=new Map,t=(t,n)=>{(e.get(t)??e.set(t,new Set).get(t)).add(n),(e.get(n)??e.set(n,new Set).get(n)).add(t)};if(Y)for(let e of Y.links)t(e.a,e.b);if(_)for(let e of _.threads)t(e.a,e.b);let n=new Map;for(let[t,r]of e)n.set(t,[...r].map(e=>ut.get(e)).filter(e=>!!e).sort((e,t)=>e.page-t.page||e.title.localeCompare(t.title)).map(e=>e.id));return n},[Y,_,ut]),ft=S?ut.get(S)??null:null,pt=(0,j.useMemo)(()=>S?dt.get(S)??[]:[],[S,dt]),mt=_?.threads.filter(e=>e.crossDoc).length??0,Z=g===`settled`&&!!Y,[ht,gt]=(0,j.useState)(null),vt=(0,j.useMemo)(()=>{let e=new Set;return s?.contradictions.forEach(t=>{e.add(t.a),e.add(t.b)}),e},[s]),yt=(0,j.useMemo)(()=>{let e=new Set;return s?.consensus.forEach(t=>t.memberClaimIds.forEach(t=>e.add(t))),e},[s]),bt=s?.lens??`all`;(0,j.useEffect)(()=>{if(!s||!Z)return;let e=bt===`contradictions`?s.contradictions:bt===`gaps`?s.gaps:bt===`consensus`?s.consensus:[];if(bt===`all`||e.length===0){X.fit();return}let t=e.map(e=>e.x),n=e.map(e=>e.y);X.frame({x:Math.min(...t)-200,y:Math.min(...n)-200,w:Math.max(...t)-Math.min(...t)+400,h:Math.max(...n)-Math.min(...n)+400},{maxScale:1.1})},[bt,Z]);let St=g===`igniting`?`EXTRACTING`:g===`blooming`?`MAPPING`:g===`settled`?`SETTLED`:g===`error`?`COULDN’T MAP`:`READY`,Ct=_?.claims.length??0,wt=(0,j.useCallback)(()=>{C(null),T(null),D(null),k(new Set),Gr(),R(null),ne(new Set),oe.current?.abort(),ie(null),U(!1),ae(!1),de.current?.abort(),se(null),ce(!1),K(!1),ue(null),be.current?.abort(),pe(null),_e(!1),he(!1),ye(null),Oe.current?.abort(),Se(null),Ee(!1),we(!1),De.current=!1,Fe.current?.abort(),Me(null),Pe(null),Ae(`map`),x(u)},[x,u]),Et=(0,j.useRef)(null),{frame:Dt,fit:Ot}=X;re.current=Ot,(0,j.useEffect)(()=>{if(!Z||!Y||!_||Et.current===_)return;Et.current=_;let e=Y.claims.filter(e=>e.role===`load-bearing`);if(e.length===0||e.length===Y.claims.length)return;let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);let a=96*1.3;Dt({x:t-200,y:n-a,w:r-t+400,h:i-n+a*2},{maxScale:1.2})},[Z,Y,_,Dt]);let kt=(0,j.useRef)(null);(0,j.useEffect)(()=>{if(!Z||!_||!t||kt.current===_||(kt.current=_,We(new Map),Ke(!1),!n?.enabled)||_.claims.filter(e=>e.role===`load-bearing`).length===0)return;let e=new AbortController;return Ke(!0),Xn(_.claims,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal}).then(t=>{e.signal.aborted||We(new Map(t.map(e=>[e.claimId,e])))}).catch(()=>{}).finally(()=>{e.signal.aborted||Ke(!1)}),()=>e.abort()},[Z,_,t,n]);let At=(0,j.useMemo)(()=>[...Ue.values()].map(e=>e.verdict),[Ue]),jt=(0,j.useMemo)(()=>Rn(At),[At]),Mt=(0,j.useCallback)(e=>{let t=(_?.documents[e]?.fileName??`Doc ${e+1}`).replace(/\.[^.]+$/,``).trim();return t.length>18?t.slice(0,17).trimEnd()+`…`:t||`Doc ${e+1}`},[_]),Pt=(0,j.useCallback)((e,t)=>{if(!Y)return;let n=Y.claims.filter(n=>n.source===e&&n.page===t);if(n.length===0){let r=Y.claims.filter(t=>t.source===e);if(r.length===0)return;let i=r.reduce((e,n)=>Math.abs(n.page-t)<Math.abs(e.page-t)?n:e);n=r.filter(e=>e.page===i.page)}let r=1/0,i=1/0,a=-1/0,o=-1/0;for(let e of n)r=Math.min(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);Dt({x:r-200,y:i-96*1.3,w:a-r+400,h:o-i+96*2.6},{maxScale:1.4})},[Y,Dt]),Ft=(0,j.useCallback)(e=>{T(null),C(null),Qe(``),D(e),Pt(e.doc,e.page)},[Pt]),It=(0,j.useCallback)(e=>{k(new Set(e.spans.map(e=>`${e.doc}:${e.page}`))),e.spans.length>0&&Ft(e.spans[0]),Qe(e.text)},[Ft]),Lt=(0,j.useMemo)(()=>!Z||!t||!v?null:{corpus:v,cfg:t,multiDoc:f,...n?{search:n}:{}},[Z,t,v,f,n]);(0,j.useEffect)(()=>()=>Fe.current?.abort(),[]);let Rt=(0,j.useCallback)(()=>{if(!t||!v)return;Fe.current?.abort();let e=new AbortController;Fe.current=e,Pe(`why`);let n=v.flat().join(`
130
+ `)}`}async function Xn(e,t){let n=t.provider??Vn(t.searchProviderId,t.apiKey),r=e.filter(e=>e.role===`load-bearing`).slice(0,t.maxClaims??12);if(r.length===0)return[];let i=new Map;await Promise.all(r.map(async e=>{let r=await n.search(Wn(e),{apiKey:t.apiKey,signal:t.signal,limit:t.perClaimResults??4});i.set(e.id,r.map(e=>({title:e.title,url:e.url,snippet:e.snippet})))}));let a=r.filter(e=>(i.get(e.id)?.length??0)>0),o=r.filter(e=>(i.get(e.id)?.length??0)===0).map(e=>({claimId:e.id,verdict:`unsupported`,note:`No live source was found to check this.`}));if(a.length===0)return o;let s=Math.min(4096,Math.max(1400,250+a.length*150)),c;try{c=(await b(t.cfg.provider).generate({system:Jn,history:[],user:Yn(a,i),maxTokens:s,temperature:0,format:null,...t.signal?{signal:t.signal}:{}},t.cfg)).raw}catch{for(let e of a)o.push({claimId:e.id,verdict:`unsupported`,note:`Could not reach the fact-checker.`});return o}let l=qn(c),u=new Set;for(let e of l)u.has(e.claimId)||a.some(t=>t.id===e.claimId)&&(u.add(e.claimId),o.push(Bn(e,i.get(e.claimId)??[])));for(let e of a)u.has(e.id)||o.push({claimId:e.id,verdict:`unsupported`,note:`The sources did not clearly speak to this.`});return o}var Zn=4,Qn=3,$n=2,er={contradicted:4,disputed:3,outdated:2,unsupported:1,holds:0},tr={contradicts:`contradicts`,"in-tension":`is in tension with`,agrees:`agrees with`};function nr(e,t){let n=e.replace(/\s+/g,` `).trim();if(n.length<=t)return n;let r=n.slice(0,t),i=r.lastIndexOf(` `);return(i>t*.6?r.slice(0,i):r).trimEnd()+`…`}function rr(e){return Math.max(2600,Math.min(7e3,Math.round(e.length*60)+1200))}function ir(e){let t=new Map;for(let n of e)t.set(n.a,(t.get(n.a)??0)+1),t.set(n.b,(t.get(n.b)??0)+1);return t}function ar(e,t,n){if(e.length===0)return[];let r=new Map(e.map(e=>[e.id,e])),i=ir(t),a=[],o=new Set,s=0,c=(e,t,n,r)=>{a.push({id:`b${s+=1}`,kind:e,claimIds:t,caption:n,spoken:r,dwellMs:rr(r)});for(let e of t)o.add(e)},l=e.filter(e=>e.role===`load-bearing`),u=[...l.length>0?l:e].sort((e,t)=>(i.get(t.id)??0)-(i.get(e.id)??0)||e.page-t.page||e.id.localeCompare(t.id))[0];c(`open`,[u.id],`The case rests on this — “${nr(u.quote,96)}” · p.${u.page}`,`The whole case rests on this, on page ${u.page}. ${nr(u.quote,220)}`);let d={contradicts:0,"in-tension":1,agrees:2},f=t.filter(e=>e.relation!==`agrees`&&r.has(e.a)&&r.has(e.b)).sort((e,t)=>d[e.relation]-d[t.relation]).slice(0,Zn);for(let e of f){let t=r.get(e.a),n=r.get(e.b),i=e.crossDoc?` (across documents)`:``;c(`tension`,[t.id,n.id],`p.${t.page}: “${nr(t.quote,52)}” — ${tr[e.relation]}${i} — p.${n.page}: “${nr(n.quote,52)}”`,`On page ${t.page}, the document says ${nr(t.quote,140)}. But it ${tr[e.relation]} page ${n.page}: ${nr(n.quote,140)}.`)}let p=e.map(e=>({c:e,v:n.get(e.id)})).filter(e=>!!e.v&&er[e.v]>=2&&!o.has(e.c.id)).sort((e,t)=>er[t.v]-er[e.v]||e.c.page-t.c.page).slice(0,Qn);for(let{c:e,v:t}of p){let n=Fn[t].label;c(`verdict`,[e.id],`${n} — “${nr(e.quote,72)}” · p.${e.page}`,`The public record marks this ${n.toLowerCase()}: ${nr(e.quote,160)}`)}let m=e.filter(e=>(e.role===`context`||e.kind===`definition`)&&!o.has(e.id)).sort((e,t)=>e.page-t.page).slice(0,$n);for(let e of m)c(`context`,[e.id],`Context — ${nr(e.title,64)} · p.${e.page}`,`For context: ${e.title}.`);let h=e.map(e=>({c:e,v:n.get(e.id)})).filter(e=>!!e.v&&er[e.v]>=2).sort((e,t)=>er[t.v]-er[e.v]||e.c.page-t.c.page)[0];if(h){let e=Fn[h.v].label;c(`close`,[h.c.id],`The weak point — ${e}: “${nr(h.c.quote,68)}” · p.${h.c.page}`,`So the weakest point: the public record marks this ${e.toLowerCase()} — ${nr(h.c.quote,150)}`)}else if(f.length>0){let e=f[0],t=r.get(e.a),n=r.get(e.b);c(`close`,[t.id,n.id],`The weak point — the document contradicts itself: p.${t.page} vs p.${n.page}`,`And the weakest point is that the document contradicts itself, between page ${t.page} and page ${n.page}.`)}else{let e=n.get(u.id)===`holds`;c(`close`,[u.id],e?`Nothing here contradicts itself — the case rests on this one claim, and it holds.`:`Nothing here contradicts itself — the whole case rests on this one claim.`,e?`Nothing here contradicts itself. The case rests entirely on that one claim — and the public record backs it.`:`Nothing here contradicts itself. The whole case rests on that one claim.`)}return a}var or=16;function sr(){let e=(0,M.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=(0,j.useRef)(t),[r,i]=(0,j.useState)(0),a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{let t=n.current,r=t.findIndex(t=>t.seed===e.seed);r>=0?t[r]=e:(t.push(e),t.length>or&&t.shift()),i(t.length)},e[1]=a):a=e[1];let o=a,s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{n.current=[],i(0)},e[2]=s):s=e[2];let c=s,l;return e[3]===r?l=e[4]:(l={steps:n,count:r,record:o,clear:c},e[3]=r,e[4]=l),l}var cr={forecast:`#5468e0`,stat:`#12a37a`,finding:`#1f9d7e`,risk:`#e0474d`,definition:`#5a6678`,method:`#cf8327`,diagram:`#5468e0`},lr=`#6a4fd0`;function ur(e){return cr[e]}var dr={"load-bearing":`The document leans on this`,supporting:`Supporting evidence`,context:`Context`};function fr(e){return`${dr[e.role]} — ${e.title}`}function pr(e){let t=e.role===`load-bearing`,n=e.kind===`forecast`;if(!(!t&&!n))return{...t?{star:t}:{},...n?{question:n}:{}}}var mr={forecast:`forecast`,stat:`figure`,finding:`finding`,risk:`risk`,definition:`definition`,method:`method`,diagram:`figure`},hr={"load-bearing":e=>`The ${e} the document leans on`,supporting:e=>`Supporting ${e}`,context:e=>`Context — ${e}`};function gr(e){return`${hr[e.role](mr[e.kind])} · page ${e.page}`}var _r=s();r();var vr=n(()=>c(()=>import(`./ShareModal-C-sD-aia.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([7,2,1,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),yr=vr.Component;function br({steps:e,spec:t,pdfs:n,cfg:r,placed:a,verdicts:s}){let[l,d]=(0,j.useState)(!1),[f,p]=(0,j.useState)(null);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,disabled:l,onClick:(0,j.useCallback)(async()=>{if(!l){d(!0);try{let[{autoAnnotationSteps:r},{buildAnnotationReel:i}]=await Promise.all([c(()=>import(`./annotationAuto-x_dV8z65.js`),__vite__mapDeps([22,23,2,24,25,26,1,3,4,5,6,27])),c(()=>import(`./annotationReel-SeXzv0P-.js`).then(e=>e.t),__vite__mapDeps([28,2,10,1,3,4,5,6,11,16])),vr.preload()]),o=e.current,l=o.length>=1?o.slice():await r(t,n,{placed:a,verdicts:s,max:6});if(!l.length){u(`Turn on Annotate, then ask a question or tap a claim to mark it up`,`warn`);return}p(i(l,{fileName:t.fileName}))}finally{d(!1)}}},[l,e,t,n,a,s]),title:`Make a shareable reel of the marked-up pages`,...i(vr.preload),children:l?`Preparing…`:`Share reel`}),f&&(0,_r.createPortal)((0,Q.jsx)(o,{label:`Annotation reel`,overlay:!0,children:(0,Q.jsx)(yr,{script:f,cfg:r??void 0,onClose:()=>p(null)})}),document.body)]})}r();var xr=n(()=>c(()=>import(`./PrismAskController-OwqFx5Pk.js`).then(e=>({default:e.PrismAskController})),__vite__mapDeps([29,1,2,3,4,5,6,23,24,25,30,31,32,33,34]))),Sr=n(()=>c(()=>import(`./PrismBriefingPlayer-Bu_ZxYdh.js`).then(e=>({default:e.PrismBriefingPlayer})),__vite__mapDeps([35,1,2,3,4,5,6,26,27]))),Cr=n(()=>c(()=>import(`./CrossExamPanel-BIJslibV.js`).then(e=>({default:e.CrossExamPanel})),__vite__mapDeps([36,1,2,3,4,5,6,37]))),wr=n(()=>c(()=>import(`./ForecastPanel-CMRD-UKn.js`).then(e=>({default:e.ForecastPanel})),__vite__mapDeps([38,1,2,3,4,5,6,30,39]))),Tr=n(()=>c(()=>import(`./LeverPanel-DVUgGcYW.js`).then(e=>({default:e.LeverPanel})),__vite__mapDeps([40,1,2,3,4,5,6,41,42]))),Er=n(()=>c(()=>import(`./WhyMachineOverlay-C4eQC0lg.js`).then(e=>({default:e.WhyMachineOverlay})),__vite__mapDeps([43,1,2,3,4,5,6,44,30,45]))),Dr=xr.Component,Or=Sr.Component,kr=Cr.Component,Ar=wr.Component,jr=Tr.Component,Mr=Er.Component,Nr=null,Pr=null,Fr=null,Ir=null,Lr=null,Rr=()=>Nr??=c(()=>import(`./run-BYP2YlZT.js`),__vite__mapDeps([46,23,2,24,25,32,47,48])),zr=()=>Pr??=c(()=>import(`./run-DSVvshaB.js`),__vite__mapDeps([49,23,2,24,25,32,48])),Br=()=>Fr??=c(()=>import(`./run-Dc2ZJz6n.js`),__vite__mapDeps([50,23,2,24,25,31,32,47,33,48])),Vr=()=>Ir??=c(()=>import(`./model-BE0UHu1w.js`),__vite__mapDeps([51,23,2,24,25,32,41,47])),Hr=()=>Lr??=c(()=>import(`./explode-WBykfhqW.js`),__vite__mapDeps([52,23,2,24,25,31,32,53,54,55])),Ur=null;function Wr(){return Ur??=c(()=>import(`./kokoro-B-3GqktX.js`).then(e=>e.i),__vite__mapDeps([20,2,1,3,4,5,6,16])),Ur}function Gr(){Ur&&Ur.then(e=>e.cancelKokoro())}function Kr(e){Wr().then(t=>t.speakKokoroResult(e,`mavea`))}var qr={forecast:{color:`var(--presence)`,label:`FORECAST`},stat:{color:`var(--insight)`,label:`STAT`},finding:{color:`var(--insight-soft)`,label:`FINDING`},risk:{color:`var(--danger)`,label:`RISK`},definition:{color:`var(--text-muted)`,label:`DEFINITION`},method:{color:`var(--warning)`,label:`METHOD`},diagram:{color:`var(--presence)`,label:`FIGURE`}},Jr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--danger)`],Yr={contradicts:`contradicts`,"in-tension":`in tension`,agrees:`agrees`},Xr=[{kind:`forecast`,desc:`what it predicts`},{kind:`finding`,desc:`what it observed`},{kind:`definition`,desc:`its terms`},{kind:`method`,desc:`how it knows`},{kind:`stat`,desc:`a hard number`},{kind:`risk`,desc:`the caveats`},{kind:`diagram`,desc:`a figure or chart`}],Zr=[{relation:`agrees`,name:`Supports`,desc:`one claim props up another`},{relation:`contradicts`,name:`Contradicts`,desc:`two passages disagree`},{relation:`in-tension`,name:`In tension`,desc:`a softer pull, not a clash`}],Qr=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--insight-soft)`];function $r(e,t){let n=t?`another document`:`another passage`;return e===`agrees`?`agrees with ${n}`:e===`in-tension`?`in tension with ${n}`:`contradicts ${n}`}function ei(e){return e?e.relation:`anchored`}function ti(e){return e?e.relation===`agrees`?`agrees · ready`:e.relation===`in-tension`?`in tension`:`in contradiction`:`anchored · ready`}function ni({pdf:e,cfg:t,search:n,onClose:r,world:a,corpusChrome:s,autoBriefing:c}){let u=(0,j.useMemo)(()=>Array.isArray(e)?e:[e],[e]),f=u.length>1,[p,m]=(0,j.useState)(!1),h=_t(t),{phase:g,spec:_,corpus:v,proposed:y,error:b}=a??h,{explode:x}=h,[S,C]=(0,j.useState)(null),[w,T]=(0,j.useState)(null),[E,D]=(0,j.useState)(null),[O,k]=(0,j.useState)(()=>new Set),[A,M]=(0,j.useState)(!1),[ee,N]=(0,j.useState)(!1),[te,P]=(0,j.useState)(null),[F,I]=(0,j.useState)(0),[L,R]=(0,j.useState)(null),[z,ne]=(0,j.useState)(()=>new Set),re=(0,j.useRef)(()=>{}),[B,ie]=(0,j.useState)(null),[V,ae]=(0,j.useState)(!1),[H,U]=(0,j.useState)(!1),oe=(0,j.useRef)(null),[W,se]=(0,j.useState)(null),[G,K]=(0,j.useState)(!1),[q,ce]=(0,j.useState)(!1),[J,ue]=(0,j.useState)(null),de=(0,j.useRef)(null),[fe,pe]=(0,j.useState)(null),[me,he]=(0,j.useState)(!1),[ge,_e]=(0,j.useState)(!1),[ve,ye]=(0,j.useState)(null),be=(0,j.useRef)(null),[xe,Se]=(0,j.useState)(null),[Ce,we]=(0,j.useState)(!1),[Te,Ee]=(0,j.useState)(!1),De=(0,j.useRef)(!1),Oe=(0,j.useRef)(null),[ke,Ae]=(0,j.useState)(`map`),[je,Me]=(0,j.useState)(null),[Ne,Pe]=(0,j.useState)(null),Fe=(0,j.useRef)(null),[Ie,Le]=(0,j.useState)(!1),[Re,ze]=(0,j.useState)(44),Be=(0,j.useRef)(null),Ve=(0,j.useRef)(!1),He=(0,j.useRef)(null);l(He);let[Ue,We]=(0,j.useState)(()=>new Map),[Ge,Ke]=(0,j.useState)(!1),[qe,Je]=(0,j.useState)(c===!0),[Ye,Xe]=(0,j.useState)(!1),[Ze,Qe]=(0,j.useState)(``),{steps:$e,record:et,clear:tt}=sr(),nt=(0,j.useCallback)(e=>{Ve.current=!0,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault()},[]),rt=(0,j.useCallback)(e=>{if(!Ve.current||!Be.current)return;let t=Be.current.getBoundingClientRect(),n=(t.right-e.clientX)/t.width*100;ze(Math.max(24,Math.min(100,n)))},[]),it=(0,j.useCallback)(e=>{Ve.current=!1;try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}},[]),at=(0,j.useRef)(!1);(0,j.useEffect)(()=>{a||at.current||(at.current=!0,x(u))},[u,x]),(0,j.useEffect)(()=>()=>void le(),[]),(0,j.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(L?(Gr(),R(null),ne(new Set),C(null),re.current()):w?T(null):E?D(null):S?C(null):r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[L,w,E,S,r]);let[ot,st]=(0,j.useState)(null);(0,j.useEffect)(()=>{if(!_||_.claims.length<48)return;let e=!0;return Nt(_,Jr).then(t=>{e&&st({spec:_,result:t})}),()=>{e=!1}},[_]);let Y=(0,j.useMemo)(()=>_?_.claims.length<48?Tt(_,Jr):ot?.spec===_?ot.result:null:null,[ot,_]),ct=(0,j.useRef)(null),lt=(0,j.useMemo)(()=>{if(!Y||Y.claims.length===0)return;let e=1/0,t=1/0,n=-1/0,r=-1/0;for(let i of Y.claims)e=Math.min(e,i.x),t=Math.min(t,i.y),n=Math.max(n,i.x+200),r=Math.max(r,i.y+96);for(let i of Y.regions)e=Math.min(e,i.cx),t=Math.min(t,i.cy),n=Math.max(n,i.cx),r=Math.max(r,i.cy);return{x:e-56,y:t-56,w:n-e+112,h:r-t+112}},[Y]),X=xt(ct,Y?.width??1,Y?.height??1,lt),ut=(0,j.useMemo)(()=>{let e=new Map;if(Y)for(let t of Y.claims)e.set(t.id,t);return e},[Y]),dt=(0,j.useMemo)(()=>{let e=new Map,t=(t,n)=>{(e.get(t)??e.set(t,new Set).get(t)).add(n),(e.get(n)??e.set(n,new Set).get(n)).add(t)};if(Y)for(let e of Y.links)t(e.a,e.b);if(_)for(let e of _.threads)t(e.a,e.b);let n=new Map;for(let[t,r]of e)n.set(t,[...r].map(e=>ut.get(e)).filter(e=>!!e).sort((e,t)=>e.page-t.page||e.title.localeCompare(t.title)).map(e=>e.id));return n},[Y,_,ut]),ft=S?ut.get(S)??null:null,pt=(0,j.useMemo)(()=>S?dt.get(S)??[]:[],[S,dt]),mt=_?.threads.filter(e=>e.crossDoc).length??0,Z=g===`settled`&&!!Y,[ht,gt]=(0,j.useState)(null),vt=(0,j.useMemo)(()=>{let e=new Set;return s?.contradictions.forEach(t=>{e.add(t.a),e.add(t.b)}),e},[s]),yt=(0,j.useMemo)(()=>{let e=new Set;return s?.consensus.forEach(t=>t.memberClaimIds.forEach(t=>e.add(t))),e},[s]),bt=s?.lens??`all`;(0,j.useEffect)(()=>{if(!s||!Z)return;let e=bt===`contradictions`?s.contradictions:bt===`gaps`?s.gaps:bt===`consensus`?s.consensus:[];if(bt===`all`||e.length===0){X.fit();return}let t=e.map(e=>e.x),n=e.map(e=>e.y);X.frame({x:Math.min(...t)-200,y:Math.min(...n)-200,w:Math.max(...t)-Math.min(...t)+400,h:Math.max(...n)-Math.min(...n)+400},{maxScale:1.1})},[bt,Z]);let St=g===`igniting`?`EXTRACTING`:g===`blooming`?`MAPPING`:g===`settled`?`SETTLED`:g===`error`?`COULDN’T MAP`:`READY`,Ct=_?.claims.length??0,wt=(0,j.useCallback)(()=>{C(null),T(null),D(null),k(new Set),Gr(),R(null),ne(new Set),oe.current?.abort(),ie(null),U(!1),ae(!1),de.current?.abort(),se(null),ce(!1),K(!1),ue(null),be.current?.abort(),pe(null),_e(!1),he(!1),ye(null),Oe.current?.abort(),Se(null),Ee(!1),we(!1),De.current=!1,Fe.current?.abort(),Me(null),Pe(null),Ae(`map`),x(u)},[x,u]),Et=(0,j.useRef)(null),{frame:Dt,fit:Ot}=X;re.current=Ot,(0,j.useEffect)(()=>{if(!Z||!Y||!_||Et.current===_)return;Et.current=_;let e=Y.claims.filter(e=>e.role===`load-bearing`);if(e.length===0||e.length===Y.claims.length)return;let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x),i=Math.max(i,a.y);let a=96*1.3;Dt({x:t-200,y:n-a,w:r-t+400,h:i-n+a*2},{maxScale:1.2})},[Z,Y,_,Dt]);let kt=(0,j.useRef)(null);(0,j.useEffect)(()=>{if(!Z||!_||!t||kt.current===_||(kt.current=_,We(new Map),Ke(!1),!n?.enabled)||_.claims.filter(e=>e.role===`load-bearing`).length===0)return;let e=new AbortController;return Ke(!0),Xn(_.claims,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal}).then(t=>{e.signal.aborted||We(new Map(t.map(e=>[e.claimId,e])))}).catch(()=>{}).finally(()=>{e.signal.aborted||Ke(!1)}),()=>e.abort()},[Z,_,t,n]);let At=(0,j.useMemo)(()=>[...Ue.values()].map(e=>e.verdict),[Ue]),jt=(0,j.useMemo)(()=>Rn(At),[At]),Mt=(0,j.useCallback)(e=>{let t=(_?.documents[e]?.fileName??`Doc ${e+1}`).replace(/\.[^.]+$/,``).trim();return t.length>18?t.slice(0,17).trimEnd()+`…`:t||`Doc ${e+1}`},[_]),Pt=(0,j.useCallback)((e,t)=>{if(!Y)return;let n=Y.claims.filter(n=>n.source===e&&n.page===t);if(n.length===0){let r=Y.claims.filter(t=>t.source===e);if(r.length===0)return;let i=r.reduce((e,n)=>Math.abs(n.page-t)<Math.abs(e.page-t)?n:e);n=r.filter(e=>e.page===i.page)}let r=1/0,i=1/0,a=-1/0,o=-1/0;for(let e of n)r=Math.min(r,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);Dt({x:r-200,y:i-96*1.3,w:a-r+400,h:o-i+96*2.6},{maxScale:1.4})},[Y,Dt]),Ft=(0,j.useCallback)(e=>{T(null),C(null),Qe(``),D(e),Pt(e.doc,e.page)},[Pt]),It=(0,j.useCallback)(e=>{k(new Set(e.spans.map(e=>`${e.doc}:${e.page}`))),e.spans.length>0&&Ft(e.spans[0]),Qe(e.text)},[Ft]),Lt=(0,j.useMemo)(()=>!Z||!t||!v?null:{corpus:v,cfg:t,multiDoc:f,...n?{search:n}:{}},[Z,t,v,f,n]);(0,j.useEffect)(()=>()=>Fe.current?.abort(),[]);let Rt=(0,j.useCallback)(()=>{if(!t||!v)return;Fe.current?.abort();let e=new AbortController;Fe.current=e,Pe(`why`);let n=v.flat().join(`
131
131
  `).slice(0,8e3),r=f?`Why — the argument these documents make`:`Why does "${u[0].name.replace(/\.[a-z0-9]+$/i,``)}" reach its conclusion?`;Hr().then(({explodeWhy:i})=>i(r,n,t,e.signal)).then(t=>{e.signal.aborted||Me(t)}).finally(()=>{e.signal.aborted||Pe(null)})},[t,v,f,u]);(0,j.useEffect)(()=>{I(e=>e+1),M(!1),N(!1),P(null),D(null),Qe(``),gt(null),k(new Set),Gr(),tt(),R(null),ne(new Set),oe.current?.abort(),ie(null),U(!1),ae(!1),de.current?.abort(),se(null),ce(!1),K(!1),ue(null),be.current?.abort(),pe(null),_e(!1),he(!1),ye(null),Oe.current?.abort(),Se(null),Ee(!1),we(!1),De.current=!1,Fe.current?.abort(),Me(null),Pe(null)},[_,tt]);let $=(0,j.useMemo)(()=>{if(!Z)return null;if(w)return{source:w.doc,page:w.page,quote:``,color:`var(--presence)`,kindLabel:`PAGE`,title:`Reading the document`,isFigure:!1,connections:[],fromAsk:!1,browse:!0,penExplain:``,penColor:lr};if(E)return{source:E.doc,page:E.page,quote:E.quote,color:`var(--presence)`,kindLabel:`ANSWER`,title:`From your question`,isFigure:!1,connections:[],fromAsk:!0,penExplain:Ze||`“${E.quote.slice(0,160)}”`,penColor:lr};if(ft){let e=(Y?.claims??[]).filter(e=>e.id!==ft.id&&e.source===ft.source&&e.page===ft.page&&e.quote.trim().length>0).slice(0,6).map(e=>({quote:e.quote,color:qr[e.kind].color,note:e.title}));return{source:ft.source,page:ft.page,quote:ft.quote,color:qr[ft.kind].color,kindLabel:qr[ft.kind].label,title:ft.title,isFigure:ft.kind===`diagram`,...ft.box?{box:ft.box}:{},also:e,connections:pt.map(e=>({id:e,title:ut.get(e)?.title??``})),fromAsk:!1,penExplain:fr(ft),penColor:ur(ft.kind),...pr(ft)?{penAccent:pr(ft)}:{}}}return null},[Z,w,E,Ze,ft,pt,ut,Y]),zt=Z&&(!!$||!!ht),Bt=(0,j.useCallback)(e=>{if(!$)return;let t={...e,color:$.penColor,title:$.title,explanation:$.penExplain,...$.penAccent?{accent:$.penAccent}:{}};et(t),Ye&&t.explanation&&(Gr(),Kr(t.explanation))},[$,Ye,et]),Vt=!!L,Ht=(0,j.useCallback)(e=>{let t=e.map(e=>ut.get(e)).filter(e=>!!e);if(t.length===0)return;let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let e of t)n=Math.min(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.x),a=Math.max(a,e.y);Dt({x:n-200,y:r-96*1.4,w:i-n+400,h:a-r+96*2.8},{maxScale:t.length>1?1.05:1.5})},[ut,Dt]),Ut=(0,j.useMemo)(()=>new Map([...Ue].map(([e,t])=>[e,t.verdict])),[Ue]),Wt=(0,j.useCallback)(e=>{ne(new Set(e.claimIds)),Ht(e.claimIds),(qe||c)&&C(e.claimIds[0]??null)},[qe,c,Ht]),Gt=(0,j.useCallback)(()=>{Gr(),R(null),ne(new Set),C(null),Ot()},[Ot]),Kt=(0,j.useCallback)(e=>{e!==`recon`&&(oe.current?.abort(),ae(!1)),e!==`xe`&&(de.current?.abort(),K(!1)),e!==`fa`&&(be.current?.abort(),he(!1)),e!==`lv`&&(Oe.current?.abort(),we(!1))},[]),qt=(0,j.useCallback)(()=>{if(!Y||!_)return;let e=ar(Y.claims,_.threads,Ut);e.length!==0&&(Gr(),Kt(`none`),C(null),D(null),M(!1),U(!1),ce(!1),_e(!1),Ee(!1),(qe||c)&&ze(e=>Math.max(e,60)),R(e))},[Y,_,Ut,qe,c,Kt]),Jt=(0,j.useRef)(!1),Yt=(0,j.useRef)(qt);Yt.current=qt;let Xt=(0,j.useRef)(null);(0,j.useEffect)(()=>{!c||Jt.current||g!==`settled`||!Y||!_||(Jt.current=!0,Xt.current=setTimeout(()=>Yt.current(),800))},[c,g,Y,_]),(0,j.useEffect)(()=>()=>{Xt.current!==null&&clearTimeout(Xt.current)},[]),(0,j.useEffect)(()=>()=>oe.current?.abort(),[]);let Zt=(0,j.useMemo)(()=>{let e=new Set;if(B)for(let t of B)for(let n of t.claimIds)e.add(n);return e},[B]),Qt=(0,j.useCallback)(()=>{if(H){U(!1);return}if(Kt(`recon`),ce(!1),_e(!1),Ee(!1),M(!1),B){U(!0);return}if(!_||!v||!t)return;oe.current?.abort();let e=new AbortController;oe.current=e,ae(!0);let n=_.claims.map(e=>({id:e.id,page:e.page,quote:e.quote}));Rr().then(({runReconcile:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||(ie(t),U(!0))}).catch(()=>{e.signal.aborted||ie([])}).finally(()=>{e.signal.aborted||ae(!1)})},[H,B,_,v,t,Kt]);(0,j.useEffect)(()=>()=>de.current?.abort(),[]);let $t=(0,j.useMemo)(()=>{let e=new Set;if(W)for(let t of W)e.add(t.claimId);return e},[W]),en=(0,j.useMemo)(()=>{let e=new Set;if(W)for(let t of W)t.status===`open`&&e.add(t.claimId);return e},[W]),tn=(0,j.useCallback)(e=>{ue(e.id),Ft({doc:e.doc,page:e.anchorPage,quote:e.anchorQuote})},[Ft]),nn=(0,j.useCallback)(()=>{if(q){ce(!1);return}if(Kt(`xe`),U(!1),_e(!1),Ee(!1),M(!1),W){ce(!0);return}if(!_||!v||!t)return;de.current?.abort();let e=new AbortController;de.current=e,K(!0),ce(!0);let n=_.claims.filter(e=>e.role===`load-bearing`).map(e=>({id:e.id,source:e.source,page:e.page,quote:e.quote,title:e.title}));zr().then(({runCrossExam:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||se(t)}).catch(()=>{e.signal.aborted||se([])}).finally(()=>{e.signal.aborted||K(!1)})},[q,W,_,v,t,Kt]);(0,j.useEffect)(()=>()=>be.current?.abort(),[]);let rn=(0,j.useMemo)(()=>{let e=new Set;if(fe)for(let t of fe)e.add(t.claimId);return e},[fe]),an=(0,j.useCallback)(e=>{ye(e.claimId);let t=ut.get(e.claimId);t&&Ft({doc:t.source,page:e.page,quote:e.predicted})},[ut,Ft]),on=(0,j.useCallback)(()=>{if(ge){_e(!1);return}if(Kt(`fa`),U(!1),ce(!1),Ee(!1),M(!1),fe){_e(!0);return}if(!_||!t||!n?.enabled)return;be.current?.abort();let e=new AbortController;be.current=e,he(!0),_e(!0);let r=_.claims.filter(e=>e.kind===`forecast`).map(e=>({id:e.id,page:e.page,quote:e.quote}));Br().then(({runAutopsy:i})=>i(r,{cfg:t,searchProviderId:n.providerId,apiKey:n.apiKey,signal:e.signal})).then(t=>{e.signal.aborted||pe(t)}).catch(()=>{e.signal.aborted||pe([])}).finally(()=>{e.signal.aborted||he(!1)})},[ge,fe,_,t,n,Kt]);(0,j.useEffect)(()=>()=>Oe.current?.abort(),[]);let sn=(0,j.useMemo)(()=>{let e=new Set;if(xe)for(let t of xe.nodes)e.add(`${t.doc}:${t.page}`);return e},[xe]),cn=(0,j.useCallback)(e=>{Ft({doc:e.doc,page:e.page,quote:e.quote})},[Ft]),ln=(0,j.useCallback)(()=>{if(Te){Ee(!1);return}if(Kt(`lv`),U(!1),ce(!1),_e(!1),M(!1),De.current){Ee(!0);return}if(!_||!v||!t)return;Oe.current?.abort();let e=new AbortController;Oe.current=e,De.current=!0,we(!0),Ee(!0);let n=_.claims.map(e=>({quote:e.quote,page:e.page,doc:e.source}));Vr().then(({runLevers:r})=>r(n,v,t,e.signal)).then(t=>{e.signal.aborted||Se(t)}).catch(()=>{e.signal.aborted||Se(null)}).finally(()=>{e.signal.aborted||we(!1)})},[Te,_,v,t,Kt]);return(0,Q.jsxs)(`div`,{className:`prism-scrim`,"data-expanded":p?`true`:void 0,onClick:r,role:`button`,tabIndex:0,"aria-label":`Close Prism`,onKeyDown:e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),r())},children:[(0,Q.jsxs)(`section`,{className:`prism-panel`,role:`dialog`,"aria-label":`Prism`,"data-phase":g,ref:He,onClick:e=>e.stopPropagation(),children:[(0,Q.jsxs)(`header`,{className:`prism-head`,children:[(0,Q.jsxs)(`div`,{className:`prism-file`,children:[(0,Q.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,Q.jsx)(`path`,{d:`M6 2h8l4 4v16H6z`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`}),(0,Q.jsx)(`path`,{d:`M14 2v4h4`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`})]}),(0,Q.jsx)(`span`,{className:`prism-file-name`,children:f?`${u.length} documents`:u[0].name}),_&&(0,Q.jsxs)(`span`,{className:`prism-file-pages`,children:[`· `,_.pageCount,` pages`]})]}),(0,Q.jsxs)(`div`,{className:`prism-head-right`,children:[Z&&s&&(0,Q.jsx)(`div`,{className:`syn-lenses`,role:`tablist`,"aria-label":`Lens`,children:[[`all`,`All`,0],[`contradictions`,`Contradictions`,s.counts.contradictions],[`gaps`,`Gaps`,s.counts.gaps],[`consensus`,`Consensus`,s.counts.consensus]].map(([e,t,n])=>(0,Q.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":s.lens===e,className:`syn-lens`+(s.lens===e?` is-active`:``),onClick:()=>{gt(null),s.setLens(e)},children:[t,n>0&&(0,Q.jsx)(`span`,{className:`syn-lens-n`,children:n})]},e))}),Z&&y>0&&(0,Q.jsxs)(`span`,{className:`prism-counter`,title:`Every shown claim is a verbatim quote on its real page. Anything that couldn't be cited was dropped before it rendered.`,children:[(0,Q.jsx)(`strong`,{children:y}),` read · `,(0,Q.jsx)(`strong`,{children:Ct}),` grounded`,y>Ct?(0,Q.jsxs)(Q.Fragment,{children:[` `,`· `,(0,Q.jsx)(`strong`,{children:y-Ct}),` dropped`]}):null]}),(0,Q.jsxs)(`span`,{className:`prism-phase`,"data-active":g===`igniting`||g===`blooming`,title:St,children:[(0,Q.jsx)(`span`,{className:`prism-phase-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-phase-label`,children:St})]}),Z&&(0,Q.jsxs)(`button`,{type:`button`,className:`prism-replay`,onClick:()=>{D(null),C(null),T({doc:0,page:1})},"aria-label":`Read the whole document, page by page`,title:`Read the whole document, page by page`,children:[`▤`,(0,Q.jsx)(`span`,{className:`prism-replay-label`,children:` Read document`})]}),Z&&(0,Q.jsxs)(`button`,{type:`button`,className:`prism-replay`,onClick:wt,"aria-label":`Replay — re-map the document from scratch`,title:`Replay — re-map the document from scratch`,children:[`↻`,(0,Q.jsx)(`span`,{className:`prism-replay-label`,children:` Replay`})]}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-close`,onClick:()=>m(e=>!e),"aria-label":p?`Exit full screen`:`Expand to full screen`,title:p?`Exit full screen`:`Full screen`,children:p?`⤡`:`⤢`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-close`,onClick:r,"aria-label":`Close Prism`,children:`✕`})]})]}),f&&Z&&_&&(0,Q.jsxs)(`div`,{className:`prism-legend`,role:`list`,"aria-label":`Documents`,children:[_.documents.map((e,t)=>{let n=_.claims.filter(e=>e.source===t).length;return(0,Q.jsxs)(`span`,{className:`prism-legend-item`,role:`listitem`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-swatch`,style:{background:Qr[t%Qr.length]},"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-legend-name`,children:e.fileName.replace(/\.pdf$/i,``)}),(0,Q.jsx)(`span`,{className:`prism-legend-count`,children:n})]},t)}),mt>0&&(0,Q.jsxs)(`span`,{className:`prism-legend-cross`,children:[mt,` cross-document link`,mt===1?``:`s`]})]}),(0,Q.jsxs)(`div`,{className:`prism-split`,"data-split":zt?`true`:void 0,"data-pdfonly":zt&&Re>=99?`true`:void 0,ref:Be,children:[(0,Q.jsxs)(`div`,{className:`prism-stage`+(X.panning?` is-panning`:``),ref:ct,onWheel:Z?X.onWheel:void 0,onPointerDown:Z?X.onPointerDown:void 0,onPointerMove:Z?X.onPointerMove:void 0,onPointerUp:Z?X.onPointerUp:void 0,onPointerCancel:Z?X.onPointerUp:void 0,onClickCapture:e=>{X.movedRef.current&&(e.stopPropagation(),e.preventDefault(),X.movedRef.current=!1)},children:[(g===`idle`||g===`igniting`)&&(0,Q.jsxs)(`div`,{className:`prism-doc`,"data-igniting":g===`igniting`,"aria-hidden":`true`,children:[(0,Q.jsxs)(`div`,{className:`prism-doc-page`,children:[(0,Q.jsx)(`span`,{className:`prism-doc-eyebrow`,children:f?`DOCUMENTS`:`DOCUMENT`}),(0,Q.jsx)(`span`,{className:`prism-doc-title`,children:f?`${u.length} documents`:u[0].name.replace(/\.pdf$/i,``)}),(0,Q.jsx)(`div`,{className:`prism-doc-lines`,children:[92,84,88,70,90,60,80,66].map((e,t)=>(0,Q.jsx)(`span`,{className:`prism-doc-line`,style:{width:`${e}%`}},t))})]}),g===`igniting`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`prism-shock`}),ri.map((e,t)=>(0,Q.jsx)(`span`,{className:`prism-shard`,style:{"--sx":e.x,"--sy":e.y,"--sr":e.r,width:e.w,height:e.h,animationDelay:`${e.d}ms`}},t))]})]}),g===`blooming`&&(0,Q.jsxs)(`div`,{className:`prism-blooming`,children:[(0,Q.jsx)(`span`,{className:`prism-bloom-orb`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-bloom-label`,children:`Reading the document — mapping its claims…`})]}),g===`error`&&(0,Q.jsxs)(`div`,{className:`prism-error`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`prism-error-msg`,children:b}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-error-retry`,onClick:wt,children:`Try again`})]}),Z&&Y&&(0,Q.jsxs)(`div`,{className:`prism-world`,"data-briefing":Vt?`true`:void 0,style:{width:Y.width,height:Y.height,transform:X.transform},children:[Y.regions.map(e=>(0,Q.jsxs)(`div`,{className:`prism-region`,style:{left:e.cx,top:e.cy,"--region-color":e.color},children:[(0,Q.jsx)(`span`,{className:`prism-region-glow`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-region-name`,children:e.name})]},e.name)),Y.links.length>0&&(0,Q.jsx)(`svg`,{className:`prism-links`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:Y.links.map((e,t)=>{let n=ut.get(e.a),r=ut.get(e.b);return!n||!r?null:(0,Q.jsx)(`line`,{x1:n.x,y1:n.y,x2:r.x,y2:r.y},t)})}),_&&_.threads.length>0&&(0,Q.jsx)(`svg`,{className:`prism-threads`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:_.threads.map((e,t)=>{let n=ut.get(e.a),r=ut.get(e.b);if(!n||!r)return null;let i=(n.x+r.x)/2,a=(n.y+r.y)/2-28;return(0,Q.jsxs)(`g`,{className:`prism-thread`+(ke===`map`?``:` prism-thread-hot`),"data-relation":e.relation,"data-cross":e.crossDoc?`true`:void 0,children:[(0,Q.jsx)(`path`,{d:`M ${n.x} ${n.y} Q ${i} ${a} ${r.x} ${r.y}`,fill:`none`}),(0,Q.jsx)(`foreignObject`,{x:i-90,y:a-12,width:`180`,height:`22`,children:(0,Q.jsxs)(`span`,{className:`prism-thread-label`,children:[Yr[e.relation],e.crossDoc?` across docs`:` · p.${n.page}↔p.${r.page}`]})})]},t)})}),H&&B&&B.length>0&&(0,Q.jsx)(`svg`,{className:`prism-threads prism-recon`,width:Y.width,height:Y.height,"aria-hidden":`true`,children:B.map(e=>{if(e.a===e.b)return null;let t=ut.get(e.a),n=ut.get(e.b);if(!t||!n)return null;let r=(t.x+n.x)/2,i=(t.y+n.y)/2-28;return(0,Q.jsxs)(`g`,{className:`prism-thread prism-thread-hot`,"data-relation":`contradicts`,children:[(0,Q.jsx)(`path`,{d:`M ${t.x} ${t.y} Q ${r} ${i} ${n.x} ${n.y}`,fill:`none`}),(0,Q.jsx)(`foreignObject`,{x:r-90,y:i-16,width:`180`,height:`30`,children:(0,Q.jsxs)(`span`,{className:`prism-thread-label prism-recon-label`,children:[e.stated,` ≠ `,e.computed]})})]},e.id)})}),Y.claims.map(e=>{let t=qr[e.kind],n=S===e.id,r=Ue.get(e.id),i=_?.threads.find(t=>t.a===e.id||t.b===e.id),a=r?.citation?d(r.citation.url):null,o=!!i,c=i?i.relation===`agrees`?`var(--insight)`:i.relation===`in-tension`?`var(--warning)`:`var(--danger)`:t.color,l=ke===`contra`&&!o,u=O.has(`${e.source}:${e.page}`),f=!!E&&O.size>0&&!u,p=z.has(e.id),m=Vt&&z.size>0&&!p,h=H&&Zt.has(e.id),g=H&&Zt.size>0&&!h,v=q&&en.has(e.id),y=q&&en.size>0&&!$t.has(e.id),b=ge&&rn.has(e.id),x=ge&&rn.size>0&&!b,w=Te&&sn.has(`${e.source}:${e.page}`),k=Te&&sn.size>0&&!w,A=!!s&&(bt===`gaps`?!0:bt===`contradictions`?!vt.has(e.id):bt===`consensus`?!yt.has(e.id):!1),j=()=>{Vt||(T(null),D(null),gt(null),C(n?null:e.id))};return(0,Q.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-pressed":n,className:`prism-claim`+(n?` is-open`:``)+(o?` is-flagged`:``)+(u||p||h||b||w?` is-cited`:``)+(v?` is-objected`:``)+(l||f||m||g||y||x||k||A?` is-dim`:``),"data-role":e.role,style:{left:e.x,top:e.y,"--kind-color":c},onClick:j,onKeyDown:e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),j())},children:[(0,Q.jsxs)(`span`,{className:`prism-claim-head`,children:[(0,Q.jsxs)(`span`,{className:`prism-claim-kind`,children:[(0,Q.jsx)(`span`,{className:`prism-claim-dot`,"aria-hidden":`true`}),t.label]}),e.role===`load-bearing`&&(0,Q.jsx)(`span`,{className:`prism-claim-key`,title:`Load-bearing — the document leans on this`,children:`★ KEY`}),(0,Q.jsxs)(`span`,{className:`prism-claim-page`,children:[`p.`,e.page]})]}),(0,Q.jsx)(`span`,{className:`prism-claim-title`,children:e.title}),r&&(0,Q.jsxs)(`span`,{className:`prism-seal`,"data-verdict":r.verdict,style:{"--seal-color":Fn[r.verdict].token},children:[(0,Q.jsx)(`span`,{className:`prism-seal-dot`,"aria-hidden":`true`}),Fn[r.verdict].label]}),n&&(0,Q.jsxs)(`span`,{className:`prism-claim-body`,children:[(0,Q.jsxs)(`span`,{className:`prism-claim-quote`,children:[`“`,e.quote,`”`]}),i&&(0,Q.jsxs)(`span`,{className:`prism-claim-flag`,children:[$r(i.relation,i.crossDoc),` — follow the thread`]}),r&&(0,Q.jsxs)(`span`,{className:`prism-claim-verdict`,"data-verdict":r.verdict,style:{"--seal-color":Fn[r.verdict].token},children:[(0,Q.jsxs)(`span`,{className:`prism-verdict-head`,children:[(0,Q.jsx)(`span`,{className:`prism-verdict-label`,children:Fn[r.verdict].label}),(0,Q.jsx)(`span`,{className:`prism-verdict-note`,children:r.note})]}),r.citation&&a&&(0,Q.jsxs)(`a`,{className:`prism-verdict-cite`,href:a,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),children:[`“`,r.citation.quote,`”`,(0,Q.jsxs)(`span`,{className:`prism-verdict-host`,children:[`— `,r.citation.host,r.citation.date?` · ${r.citation.date}`:``]})]})]})]}),!n&&(0,Q.jsx)(`span`,{className:`prism-claim-state`,"data-state":ei(i),children:ti(i)})]},e.id)}),s&&(0,Q.jsxs)(Q.Fragment,{children:[s.consensus.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`syn-consensus`+(bt!==`all`&&bt!==`consensus`?` is-dim`:``),style:{left:e.x-e.r,top:e.y-e.r,width:e.r*2,height:e.r*2},onClick:()=>{X.movedRef.current||(C(null),gt({kind:`consensus`,id:e.id}))},children:(0,Q.jsxs)(`span`,{className:`syn-consensus-badge`,children:[e.sourceCount,` of `,e.corpusSize,` agree`]})},e.id)),s.contradictions.map(e=>{let t=bt!==`all`&&bt!==`contradictions`;return(0,Q.jsxs)(`button`,{type:`button`,className:`syn-obj syn-obj-`+e.relation+(t?` is-dim`:``),style:{left:e.x,top:e.y},onClick:()=>{X.movedRef.current||(C(null),gt({kind:`contradiction`,id:e.id}))},children:[(0,Q.jsx)(`span`,{className:`syn-obj-dot`,"aria-hidden":`true`}),e.label]},e.id)}),s.gaps.map(e=>(0,Q.jsx)(`button`,{type:`button`,className:`syn-obj syn-gap`+(bt!==`all`&&bt!==`gaps`?` is-dim`:``),style:{left:e.x,top:e.y},onClick:()=>{X.movedRef.current||(C(null),gt({kind:`gap`,id:e.id}))},children:e.label},e.id))]})]}),Z&&(0,Q.jsxs)(`div`,{className:`prism-zoom`,"aria-label":`Zoom the map`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>X.zoomBy(1.25),"aria-label":`Zoom in`,children:`+`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>X.zoomBy(1/1.25),"aria-label":`Zoom out`,children:`−`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>X.fit(),"aria-label":`Fit the whole map`,title:`Fit`,children:`⤢`})]}),Z&&ee&&Lt&&(0,Q.jsx)(o,{label:`Document ask`,children:(0,Q.jsx)(Dr,{open:A&&!Vt&&!q&&!ge&&!Te,ctx:Lt,seed:te,onAnswer:It,onFocusSpan:Ft,activeSpan:E,multiDoc:f,docLabel:Mt,onClose:()=>M(!1)},F)}),Z&&L&&(0,Q.jsx)(o,{label:`Briefing`,children:(0,Q.jsx)(Or,{beats:L,onBeat:Wt,onExit:Gt})}),Z&&q&&!Vt&&(0,Q.jsx)(o,{label:`Cross-examination`,children:(0,Q.jsx)(kr,{objections:W??[],busy:G,onFocusObjection:tn,activeId:J,multiDoc:f,docLabel:Mt,onClose:()=>ce(!1)})}),Z&&ge&&!Vt&&(0,Q.jsx)(o,{label:`Forecast review`,children:(0,Q.jsx)(Ar,{grades:fe??[],busy:me,onFocusForecast:an,activeId:ve,onClose:()=>_e(!1)})}),Z&&Te&&!Vt&&(0,Q.jsx)(o,{label:`Live levers`,children:(0,Q.jsx)(jr,{model:xe,busy:Ce,onFocusNode:cn,onClose:()=>Ee(!1)})})]}),zt&&(0,Q.jsx)(`div`,{className:`prism-divider`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the map and the source page`,tabIndex:0,onPointerDown:nt,onPointerMove:rt,onPointerUp:it,onPointerCancel:it,onKeyDown:e=>{e.key===`ArrowLeft`?ze(e=>Math.min(100,e+4)):e.key===`ArrowRight`&&ze(e=>Math.max(24,e-4))},children:(0,Q.jsx)(`span`,{className:`prism-divider-grip`,"aria-hidden":`true`})}),$&&Z&&u[$.source]&&(()=>{let e=u[$.source],t=_?.documents[$.source]?.slideImages,n=_?.documents[$.source]?.pageCount??1;return(0,Q.jsxs)(`div`,{className:`prism-page-wrap`,style:{"--pdf-pct":`${Re}%`},children:[(0,Q.jsx)(Pn,{pdf:e,slideImages:t,source:$.source,page:$.page,quote:$.quote,color:$.color,also:$.also,note:$.penExplain,penOn:qe,penColor:$.penColor,penAccent:$.penAccent,onAnnotated:Bt,kindLabel:$.kindLabel,isFigure:$.isFigure,docName:f?e.name:void 0,title:$.title,connections:$.connections,onNavigate:e=>{T(null),D(null),C(e)},onClose:()=>{T(null),D(null),C(null)},pageCount:n,onPageChange:e=>{let t=Math.min(n,Math.max(1,e));D(null),C(null),T({doc:$.source,page:t})}}),qe&&!Vt&&$.penExplain&&(0,Q.jsxs)(`div`,{className:`prism-pen-caption`,children:[(0,Q.jsx)(`span`,{className:`prism-pen-caption-text`,children:$.penExplain}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-pen-mute`,onClick:()=>Xe(e=>!e),"aria-pressed":Ye,title:Ye?`Mute narration`:`Read it aloud`,children:Ye?`🔊`:`🔇`})]})]})})(),ht&&Z&&s&&(0,Q.jsx)(`div`,{className:`prism-page-wrap syn-detail-panel`,style:{"--pdf-pct":`${Re}%`},children:(0,Q.jsxs)(`div`,{className:`syn-detail`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-page-close syn-detail-close`,onClick:()=>gt(null),"aria-label":`Close`,children:`✕`}),ht.kind===`contradiction`&&(()=>{let e=s.contradictions.find(e=>e.id===ht.id);if(!e)return null;let t=ut.get(e.a),n=ut.get(e.b);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":e.relation,children:e.relation===`contradicts`?`Contradiction`:`In tension`}),(0,Q.jsx)(`h3`,{className:`syn-detail-title`,children:e.label}),!e.comparable&&(0,Q.jsxs)(`p`,{className:`syn-banner`,children:[`Not directly comparable`,e.caveat?` — differs on ${e.caveat}`:``,`.`]}),(0,Q.jsx)(`div`,{className:`syn-tape`,children:[t,n].map((e,t)=>e&&(0,Q.jsxs)(`button`,{type:`button`,className:`syn-tape-side`,onClick:()=>{gt(null),C(e.id)},children:[(0,Q.jsxs)(`span`,{className:`syn-tape-cite`,children:[s.sourceLabel(e.source),` · p.`,e.page]}),(0,Q.jsxs)(`span`,{className:`syn-tape-quote`,children:[`“`,e.quote,`”`]})]},t))}),e.delta&&(0,Q.jsxs)(`p`,{className:`syn-delta`,children:[e.delta.aValue,` vs `,e.delta.bValue,` `,e.delta.unit]}),(0,Q.jsx)(`button`,{type:`button`,className:`syn-interrogate`,onClick:()=>{N(!0),M(!0),P(t=>({id:(t?.id??0)+1,question:e.seedQuestion}))},children:`Interrogate — are these comparable?`})]})})(),ht.kind===`gap`&&(()=>{let e=s.gaps.find(e=>e.id===ht.id);return e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":`gap`,children:e.kind===`absent`?`Gap`:`Thin coverage`}),(0,Q.jsx)(`h3`,{className:`syn-detail-title`,children:e.facet.label}),(0,Q.jsxs)(`p`,{className:`syn-receipt`,children:[(0,Q.jsxs)(`strong`,{children:[e.coveredCount,` of `,e.sourcesScanned,` sources`]}),` `,`mention this`,e.coveredCount===0?` — nothing in the corpus covers it`:``,`.`]}),(0,Q.jsx)(`p`,{className:`syn-searched-label`,children:`Searched for, verbatim:`}),(0,Q.jsx)(`ul`,{className:`syn-searched`,children:e.searchedForms.map(e=>(0,Q.jsx)(`li`,{children:e},e))}),(0,Q.jsx)(`p`,{className:`syn-note`,children:`A statement about the corpus text — it dissolves the moment a source covers it.`})]}):null})(),ht.kind===`consensus`&&(()=>{let e=s.consensus.find(e=>e.id===ht.id);return e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`syn-detail-kind`,"data-rel":`agrees`,children:`Consensus`}),(0,Q.jsxs)(`p`,{className:`syn-consensus-count`,children:[(0,Q.jsxs)(`strong`,{children:[e.sourceCount,` of `,e.corpusSize,` sources`]}),` `,`agree`]}),(0,Q.jsx)(`p`,{className:`syn-proposition`,children:e.proposition}),(0,Q.jsx)(`p`,{className:`syn-proposition-note`,children:`A paraphrase of the shared point — the verbatim lines are below.`}),(0,Q.jsx)(`div`,{className:`syn-members`,children:e.memberClaimIds.map(e=>{let t=ut.get(e);return t&&(0,Q.jsxs)(`button`,{type:`button`,className:`syn-member`,onClick:()=>{gt(null),C(e)},children:[(0,Q.jsxs)(`span`,{className:`syn-tape-cite`,children:[s.sourceLabel(t.source),` · p.`,t.page]}),(0,Q.jsxs)(`span`,{className:`syn-tape-quote`,children:[`“`,t.quote,`”`]})]},e)})}),e.band&&(0,Q.jsxs)(`p`,{className:`syn-delta`,children:[e.band.min,`–`,e.band.max,` `,e.band.unit]})]}):null})()]})})]}),Z&&!V&&!H&&(Ge||jt)&&(0,Q.jsxs)(`div`,{className:`prism-standing`,"data-verifying":Ge?`true`:void 0,role:`status`,children:[(0,Q.jsx)(`span`,{className:`prism-standing-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-standing-text`,children:Ge?`Checking the key claims against the public record…`:jt})]}),Z&&(V||H)&&(0,Q.jsxs)(`div`,{className:`prism-standing`,"data-verifying":V?`true`:void 0,"data-recon":`true`,role:`status`,children:[(0,Q.jsx)(`span`,{className:`prism-standing-dot`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-standing-text`,children:V?`Checking the document’s own numbers against each other…`:B&&B.length>0?`${B.length===1?`A number doesn’t`:`${B.length} numbers don’t`} add up — the document’s own figures disagree`:`Every number checks out — the document’s figures are consistent.`})]}),Z&&(0,Q.jsxs)(`footer`,{className:`prism-foot`,children:[(0,Q.jsxs)(`span`,{className:`prism-foot-stat`,children:[Ct,` claim`,Ct===1?``:`s`,` · `,Y?.regions.length??0,` region`,(Y?.regions.length??0)===1?``:`s`,` · every card cites a real page`,y>Ct?` · ${y-Ct} ungrounded dropped`:``]}),(0,Q.jsxs)(`div`,{className:`prism-foot-actions`,children:[(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Ask`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(A?` is-active`:` prism-foot-btn--primary`),onClick:()=>{A||(U(!1),ce(!1),_e(!1),Ee(!1)),A||N(!0),M(e=>!e)},...i(xr.preload),"aria-pressed":A,title:`Ask the document a question — the answer lights up the exact lines`,children:A?`Hide ask`:`Ask the document`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Vt?` is-active`:``),onClick:Vt?Gt:qt,...i(Sr.preload),disabled:!Y||Y.claims.length===0,"aria-pressed":Vt,title:`Play a silent, captioned flight through the document's argument — ending on its weakest point`,children:Vt?`End briefing`:`Brief me`})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Verify`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(H?` is-active`:``),onClick:Qt,...i(()=>Rr().then(()=>void 0)),disabled:V||!t||!_||_.claims.length===0,"aria-pressed":H,title:`Check the document's own figures against each other — flags numbers that don't add up, computed in pure code`,children:V?`Checking…`:H?`Hide numbers`:`Check the numbers`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(q?` is-active`:``),onClick:nn,...i(()=>Promise.all([Cr.preload(),zr()]).then(()=>void 0)),disabled:G||!t||!_||_.claims.filter(e=>e.role===`load-bearing`).length===0,"aria-pressed":q,title:`Raise the sharpest objection to each load-bearing claim — and show only the ones the document never answers`,children:G?`Examining…`:q?`Hide objections`:`Cross-examine`}),_&&_.claims.some(e=>e.kind===`forecast`)&&(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(ge?` is-active`:``),onClick:on,...i(()=>Promise.all([wr.preload(),Br()]).then(()=>void 0)),disabled:me||!t||!n?.enabled,"aria-pressed":ge,title:n?.enabled?`Grade the document's dated predictions against what actually happened (uses web search)`:`Turn on web search in Live settings to grade the document’s forecasts against reality`,children:me?`Grading…`:ge?`Hide forecasts`:`Grade forecasts`}),_&&_.claims.some(e=>/\d/.test(e.quote))&&(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Te?` is-active`:``),onClick:ln,...i(()=>Promise.all([Tr.preload(),Vr()]).then(()=>void 0)),disabled:Ce||!t||!v,"aria-pressed":Te,title:`Find the model implied under the document and drag its assumptions — every figure traces to a page, the conclusion recomputes live`,children:Ce?`Modeling…`:Te?`Hide levers`:`Live levers`})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Explore`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(ke===`contra`?` is-active`:``),onClick:()=>Ae(e=>e===`contra`?`map`:`contra`),disabled:!_||_.threads.length===0,title:_&&_.threads.length===0?f?`No links found between these documents`:`No contradictions found in this document`:void 0,children:_&&_.threads.length>0?f?`Show links (${_.threads.length})`:`Find contradictions (${_.threads.length})`:f?`No links`:`No contradictions`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:Rt,...i(()=>Promise.all([Er.preload(),Hr()]).then(()=>void 0)),disabled:!t||!v||Ne!==null,title:`Explode this document into a causal web — every link traces to a page`,children:Ne===`why`?`Tracing…`:`Why (causes)`})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group`,children:[(0,Q.jsx)(`span`,{className:`prism-foot-group-label`,children:`Annotate & share`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(qe?` is-active`:``),onClick:()=>Je(e=>!e),"aria-pressed":qe,title:`Annotate — Mavéa draws a pen mark over the cited lines and explains, on every question, claim, and briefing beat`,children:qe?`Pen on`:`Annotate`}),_&&(0,Q.jsx)(br,{steps:$e,spec:_,pdfs:u,cfg:t,placed:Y?.claims,verdicts:Ut})]}),(0,Q.jsxs)(`div`,{className:`prism-foot-group prism-foot-group--quiet`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`,onClick:()=>Ae(`map`),children:`Reset view`}),(0,Q.jsx)(`button`,{type:`button`,className:`prism-foot-btn`+(Ie?` is-active`:``),onClick:()=>Le(e=>!e),"aria-pressed":Ie,children:`Legend`})]})]})]}),Z&&Ie&&(0,Q.jsxs)(`aside`,{className:`prism-legend-panel`,"aria-label":`What the colors and lines mean`,children:[(0,Q.jsxs)(`div`,{className:`prism-legend-col`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-title`,children:`THE KIND PALETTE`}),(0,Q.jsx)(`ul`,{className:`prism-legend-kinds`,children:Xr.map(e=>(0,Q.jsxs)(`li`,{className:`prism-legend-kind`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-kind-dot`,style:{background:qr[e.kind].color},"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`prism-legend-kind-name`,children:qr[e.kind].label}),(0,Q.jsxs)(`span`,{className:`prism-legend-kind-desc`,children:[`· `,e.desc]})]},e.kind))})]}),(0,Q.jsxs)(`div`,{className:`prism-legend-col`,children:[(0,Q.jsx)(`span`,{className:`prism-legend-title`,children:`THE THREAD PALETTE`}),(0,Q.jsx)(`ul`,{className:`prism-legend-threads`,children:Zr.map(e=>(0,Q.jsxs)(`li`,{className:`prism-legend-thread`,children:[(0,Q.jsx)(`svg`,{className:`prism-legend-thread-line`,"data-relation":e.relation,viewBox:`0 0 40 8`,width:`40`,height:`8`,"aria-hidden":`true`,children:(0,Q.jsx)(`line`,{x1:`2`,y1:`4`,x2:`38`,y2:`4`})}),(0,Q.jsx)(`span`,{className:`prism-legend-thread-name`,children:e.name}),(0,Q.jsxs)(`span`,{className:`prism-legend-thread-desc`,children:[`· `,e.desc]})]},e.relation))}),(0,Q.jsxs)(`p`,{className:`prism-legend-note`,children:[`Threads never turn into red errors — a contradiction is a line you can follow to both pages. The thread map is what makes the document `,(0,Q.jsx)(`strong`,{children:`arguable`}),`, not just readable.`]})]})]}),!Z&&g!==`error`&&(0,Q.jsx)(`footer`,{className:`prism-foot prism-foot-quiet`,children:(0,Q.jsx)(`span`,{className:`prism-foot-stat`,children:`The document blooms into a map of its claims — each one a verbatim quote anchored to its page.`})})]}),je&&(0,Q.jsx)(o,{label:`Why map`,overlay:!0,children:(0,Q.jsx)(Mr,{dag:je,onClose:()=>Me(null)})})]})}var ri=[{x:`-210px`,y:`-150px`,r:`-34deg`,w:34,h:44,d:0},{x:`190px`,y:`-170px`,r:`28deg`,w:28,h:38,d:40},{x:`-260px`,y:`40px`,r:`-14deg`,w:40,h:30,d:20},{x:`250px`,y:`70px`,r:`22deg`,w:30,h:40,d:60},{x:`-120px`,y:`190px`,r:`-44deg`,w:24,h:32,d:80},{x:`150px`,y:`200px`,r:`18deg`,w:36,h:28,d:30},{x:`-300px`,y:`-40px`,r:`-24deg`,w:26,h:36,d:50},{x:`300px`,y:`-30px`,r:`30deg`,w:32,h:42,d:10},{x:`40px`,y:`-220px`,r:`12deg`,w:22,h:30,d:70},{x:`-60px`,y:`230px`,r:`-18deg`,w:30,h:24,d:90}];export{ni as PrismOverlay,Pt as a,He as c,ne as d,ar as i,H as l,gr as n,Et as o,ur as r,Ve as s,pr as t,ue as u};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./jsx-runtime-DaSxXjOY.js";import{ht as t}from"./index-DWHIOldG.js";import{t as n}from"./LegalMarkdownDocument-BidNcrNj.js";var r=t(),i=`# Mavéa Privacy Notice
1
+ import{t as e}from"./jsx-runtime-DaSxXjOY.js";import{ht as t}from"./index-CWqRe4-B.js";import{t as n}from"./LegalMarkdownDocument-CcbAfubz.js";var r=t(),i=`# Mavéa Privacy Notice
2
2
 
3
3
  Effective: July 19, 2026
4
4
 
@@ -1 +1 @@
1
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DWHIOldG.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";var i=e(),a=n(),o=t();function s(e){let t=(0,a.c)(34),{model:n,onJump:s,onShare:l,onClose:u}=e,d=(0,i.useRef)(null);r(d);let f,p;t[0]===u?(f=t[1],p=t[2]):(f=()=>{let e=e=>{e.key===`Escape`&&u()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},p=[u],t[0]=u,t[1]=f,t[2]=p),(0,i.useEffect)(f,p);let m;t[3]===u?m=t[4]:(m=e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),u())},t[3]=u,t[4]=m);let h;t[5]===n.heading?h=t[6]:(h=(0,o.jsx)(`h2`,{className:`recap-title voice-text`,children:n.heading}),t[5]=n.heading,t[6]=h);let g;t[7]===n.meta?g=t[8]:(g=(0,o.jsx)(`p`,{className:`recap-meta`,children:n.meta}),t[7]=n.meta,t[8]=g);let _;t[9]!==h||t[10]!==g?(_=(0,o.jsxs)(`header`,{className:`recap-head`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;if(t[12]!==n.rows||t[13]!==s){let e;t[15]===s?e=t[16]:(e=e=>(0,o.jsx)(`li`,{children:(0,o.jsxs)(`button`,{type:`button`,className:`recap-row`,onClick:()=>s(e.frameIndex),children:[(0,o.jsxs)(`span`,{className:`recap-row-key`,children:[e.title,(0,o.jsx)(`span`,{className:`recap-row-clock`,children:e.clock})]}),(0,o.jsx)(`span`,{className:`recap-row-line`,children:e.line}),e.corrected&&(0,o.jsx)(`span`,{className:`recap-row-corrected`,children:e.corrected})]})},e.frameIndex),t[15]=s,t[16]=e),v=n.rows.map(e),t[12]=n.rows,t[13]=s,t[14]=v}else v=t[14];let y;t[17]===v?y=t[18]:(y=(0,o.jsx)(`ul`,{className:`recap-rows`,children:v}),t[17]=v,t[18]=y);let b;t[19]===l?b=t[20]:(b=l&&(0,o.jsx)(`button`,{type:`button`,className:`recap-share`,onClick:l,children:`Share as Story`}),t[19]=l,t[20]=b);let x;t[21]===u?x=t[22]:(x=(0,o.jsx)(`button`,{type:`button`,className:`recap-keep`,onClick:u,children:`Keep talking`}),t[21]=u,t[22]=x);let S;t[23]!==x||t[24]!==b?(S=(0,o.jsxs)(`footer`,{className:`recap-actions`,children:[b,x]}),t[23]=x,t[24]=b,t[25]=S):S=t[25];let C;t[26]!==S||t[27]!==_||t[28]!==y?(C=(0,o.jsxs)(`section`,{className:`recap-panel`,ref:d,tabIndex:-1,role:`dialog`,"aria-label":`Session recap`,onClick:c,children:[_,y,S]}),t[26]=S,t[27]=_,t[28]=y,t[29]=C):C=t[29];let w;return t[30]!==u||t[31]!==C||t[32]!==m?(w=(0,o.jsx)(`div`,{className:`recap-scrim`,onClick:u,role:`button`,tabIndex:0,"aria-label":`Close session recap`,onKeyDown:m,children:C}),t[30]=u,t[31]=C,t[32]=m,t[33]=w):w=t[33],w}function c(e){return e.stopPropagation()}export{s as Recap};
1
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-CWqRe4-B.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";var i=e(),a=n(),o=t();function s(e){let t=(0,a.c)(34),{model:n,onJump:s,onShare:l,onClose:u}=e,d=(0,i.useRef)(null);r(d);let f,p;t[0]===u?(f=t[1],p=t[2]):(f=()=>{let e=e=>{e.key===`Escape`&&u()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},p=[u],t[0]=u,t[1]=f,t[2]=p),(0,i.useEffect)(f,p);let m;t[3]===u?m=t[4]:(m=e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),u())},t[3]=u,t[4]=m);let h;t[5]===n.heading?h=t[6]:(h=(0,o.jsx)(`h2`,{className:`recap-title voice-text`,children:n.heading}),t[5]=n.heading,t[6]=h);let g;t[7]===n.meta?g=t[8]:(g=(0,o.jsx)(`p`,{className:`recap-meta`,children:n.meta}),t[7]=n.meta,t[8]=g);let _;t[9]!==h||t[10]!==g?(_=(0,o.jsxs)(`header`,{className:`recap-head`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;if(t[12]!==n.rows||t[13]!==s){let e;t[15]===s?e=t[16]:(e=e=>(0,o.jsx)(`li`,{children:(0,o.jsxs)(`button`,{type:`button`,className:`recap-row`,onClick:()=>s(e.frameIndex),children:[(0,o.jsxs)(`span`,{className:`recap-row-key`,children:[e.title,(0,o.jsx)(`span`,{className:`recap-row-clock`,children:e.clock})]}),(0,o.jsx)(`span`,{className:`recap-row-line`,children:e.line}),e.corrected&&(0,o.jsx)(`span`,{className:`recap-row-corrected`,children:e.corrected})]})},e.frameIndex),t[15]=s,t[16]=e),v=n.rows.map(e),t[12]=n.rows,t[13]=s,t[14]=v}else v=t[14];let y;t[17]===v?y=t[18]:(y=(0,o.jsx)(`ul`,{className:`recap-rows`,children:v}),t[17]=v,t[18]=y);let b;t[19]===l?b=t[20]:(b=l&&(0,o.jsx)(`button`,{type:`button`,className:`recap-share`,onClick:l,children:`Share as Story`}),t[19]=l,t[20]=b);let x;t[21]===u?x=t[22]:(x=(0,o.jsx)(`button`,{type:`button`,className:`recap-keep`,onClick:u,children:`Keep talking`}),t[21]=u,t[22]=x);let S;t[23]!==x||t[24]!==b?(S=(0,o.jsxs)(`footer`,{className:`recap-actions`,children:[b,x]}),t[23]=x,t[24]=b,t[25]=S):S=t[25];let C;t[26]!==S||t[27]!==_||t[28]!==y?(C=(0,o.jsxs)(`section`,{className:`recap-panel`,ref:d,tabIndex:-1,role:`dialog`,"aria-label":`Session recap`,onClick:c,children:[_,y,S]}),t[26]=S,t[27]=_,t[28]=y,t[29]=C):C=t[29];let w;return t[30]!==u||t[31]!==C||t[32]!==m?(w=(0,o.jsx)(`div`,{className:`recap-scrim`,onClick:u,role:`button`,tabIndex:0,"aria-label":`Close session recap`,onKeyDown:m,children:C}),t[30]=u,t[31]=C,t[32]=m,t[33]=w):w=t[33],w}function c(e){return e.stopPropagation()}export{s as Recap};
@@ -1 +1 @@
1
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DWHIOldG.js";import{d as r,f as i,i as a,n as o,r as s,t as c}from"./geometry-DXAbnb0J.js";var l=n(),u=e(),d=t();function f(e){let t=(0,l.c)(19),{size:n}=e,f=(0,u.useId)(),g;if(t[0]!==f){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\W/g,t[2]=e):e=t[2],g=f.replace(e,``),t[0]=f,t[1]=g}else g=t[1];let _=`reel-jelly-${g}`,v,y,b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,d.jsx)(`stop`,{className:`reel-jelly-stop s1`,offset:`0`}),y=(0,d.jsx)(`stop`,{className:`reel-jelly-stop s2`,offset:`0.55`}),b=(0,d.jsx)(`stop`,{className:`reel-jelly-stop s3`,offset:`1`}),t[3]=v,t[4]=y,t[5]=b):(v=t[3],y=t[4],b=t[5]);let x;t[6]===_?x=t[7]:(x=(0,d.jsx)(`defs`,{children:(0,d.jsxs)(`linearGradient`,{id:_,x1:`40`,y1:`60`,x2:`160`,y2:`104`,gradientUnits:`userSpaceOnUse`,children:[v,y,b]})}),t[6]=_,t[7]=x);let S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,d.jsx)(`g`,{className:`reel-jelly-strands`,children:i.map(h)}),t[8]=S):S=t[8];let C=`url(#${_})`,w;t[9]===C?w=t[10]:(w=(0,d.jsx)(`path`,{className:`reel-jelly-bell`,d:c,fill:C}),t[9]=C,t[10]=w);let T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,d.jsx)(`path`,{className:`reel-jelly-sheen`,d:o}),t[11]=T):T=t[11];let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,d.jsxs)(`g`,{className:`reel-jelly-face`,children:[s.map(m),a.map(p),(0,d.jsx)(`path`,{className:`reel-jelly-smile`,d:r})]}),t[12]=E):E=t[12];let D;t[13]!==x||t[14]!==w?(D=(0,d.jsxs)(`svg`,{viewBox:`0 0 200 220`,focusable:`false`,children:[x,S,w,T,E]}),t[13]=x,t[14]=w,t[15]=D):D=t[15];let O;return t[16]!==n||t[17]!==D?(O=(0,d.jsx)(`div`,{className:`reel-jelly`,"data-size":n,"aria-hidden":`true`,children:D}),t[16]=n,t[17]=D,t[18]=O):O=t[18],O}function p(e){let{side:t,x:n}=e;return(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`circle`,{className:`reel-jelly-ball`,cx:n,cy:72,r:9}),(0,d.jsx)(`circle`,{className:`reel-jelly-pupil`,cx:n,cy:72.7,r:5.2}),(0,d.jsx)(`circle`,{className:`reel-jelly-glint`,cx:n+2.5,cy:69.3,r:2.3})]},t)}function m(e){let{side:t,cx:n,cy:r}=e;return(0,d.jsx)(`ellipse`,{className:`reel-jelly-cheek`,cx:n,cy:r,rx:8,ry:5},t)}function h(e,t){return(0,d.jsx)(`path`,{className:`c${t+1}`,d:e},t)}export{f as t};
1
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-CWqRe4-B.js";import{d as r,f as i,i as a,n as o,r as s,t as c}from"./geometry-DXAbnb0J.js";var l=n(),u=e(),d=t();function f(e){let t=(0,l.c)(19),{size:n}=e,f=(0,u.useId)(),g;if(t[0]!==f){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\W/g,t[2]=e):e=t[2],g=f.replace(e,``),t[0]=f,t[1]=g}else g=t[1];let _=`reel-jelly-${g}`,v,y,b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,d.jsx)(`stop`,{className:`reel-jelly-stop s1`,offset:`0`}),y=(0,d.jsx)(`stop`,{className:`reel-jelly-stop s2`,offset:`0.55`}),b=(0,d.jsx)(`stop`,{className:`reel-jelly-stop s3`,offset:`1`}),t[3]=v,t[4]=y,t[5]=b):(v=t[3],y=t[4],b=t[5]);let x;t[6]===_?x=t[7]:(x=(0,d.jsx)(`defs`,{children:(0,d.jsxs)(`linearGradient`,{id:_,x1:`40`,y1:`60`,x2:`160`,y2:`104`,gradientUnits:`userSpaceOnUse`,children:[v,y,b]})}),t[6]=_,t[7]=x);let S;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,d.jsx)(`g`,{className:`reel-jelly-strands`,children:i.map(h)}),t[8]=S):S=t[8];let C=`url(#${_})`,w;t[9]===C?w=t[10]:(w=(0,d.jsx)(`path`,{className:`reel-jelly-bell`,d:c,fill:C}),t[9]=C,t[10]=w);let T;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,d.jsx)(`path`,{className:`reel-jelly-sheen`,d:o}),t[11]=T):T=t[11];let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,d.jsxs)(`g`,{className:`reel-jelly-face`,children:[s.map(m),a.map(p),(0,d.jsx)(`path`,{className:`reel-jelly-smile`,d:r})]}),t[12]=E):E=t[12];let D;t[13]!==x||t[14]!==w?(D=(0,d.jsxs)(`svg`,{viewBox:`0 0 200 220`,focusable:`false`,children:[x,S,w,T,E]}),t[13]=x,t[14]=w,t[15]=D):D=t[15];let O;return t[16]!==n||t[17]!==D?(O=(0,d.jsx)(`div`,{className:`reel-jelly`,"data-size":n,"aria-hidden":`true`,children:D}),t[16]=n,t[17]=D,t[18]=O):O=t[18],O}function p(e){let{side:t,x:n}=e;return(0,d.jsxs)(`g`,{children:[(0,d.jsx)(`circle`,{className:`reel-jelly-ball`,cx:n,cy:72,r:9}),(0,d.jsx)(`circle`,{className:`reel-jelly-pupil`,cx:n,cy:72.7,r:5.2}),(0,d.jsx)(`circle`,{className:`reel-jelly-glint`,cx:n+2.5,cy:69.3,r:2.3})]},t)}function m(e){let{side:t,cx:n,cy:r}=e;return(0,d.jsx)(`ellipse`,{className:`reel-jelly-cheek`,cx:n,cy:r,rx:8,ry:5},t)}function h(e,t){return(0,d.jsx)(`path`,{className:`c${t+1}`,d:e},t)}export{f as t};
@@ -1,6 +1,6 @@
1
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DWHIOldG.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";import{n as i}from"./spokenText-D4zPX9JY.js";import{u as a}from"./kokoro-Da60jB7C.js";import{t as o}from"./FeatureUseNotice-CoK5HkbR.js";import{t as s}from"./providers-wzm7E8Pa.js";var c=e(),ee=n();function l(e){return[`You are role-playing the OTHER SIDE of a conversation the user is rehearsing: ${e.counterpart}.`,`The conversation: ${e.scenario}.`,`Ground everything in this context the user supplied — and NOTHING else:`,`"""${e.context||`(none given)`}"""`,`If the context does not tell you how this person would react, play a realistic, generic version of the role — never invent specific facts, history, or quotes about the real person.`,`Stay in character. Push back the way this role realistically would; do not cave easily, do not be cartoonishly hostile.`,`The reply is displayed AND spoken. Keep normal spelling on screen, but wrap every name, place, brand, or non-English term a voice might mispronounce as [[shown|said]] — for example [[Omakase|oh-mah-kah-seh]]. The said side must be lowercase voice-safe syllables matching a native/source-language pronunciation, never IPA or an Anglicized guess.`,`Reply ONLY with JSON: {"reply":"what you say next, 1-3 sentences, spoken language"}. No other keys, no prose outside the JSON.`].join(`
1
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-CWqRe4-B.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";import{u as i}from"./kokoro-B-3GqktX.js";import{n as a}from"./spokenText-D4zPX9JY.js";import{t as o}from"./FeatureUseNotice-CoK5HkbR.js";import{t as s}from"./providers-wzm7E8Pa.js";var c=e(),ee=n();function l(e){return[`You are role-playing the OTHER SIDE of a conversation the user is rehearsing: ${e.counterpart}.`,`The conversation: ${e.scenario}.`,`Ground everything in this context the user supplied — and NOTHING else:`,`"""${e.context||`(none given)`}"""`,`If the context does not tell you how this person would react, play a realistic, generic version of the role — never invent specific facts, history, or quotes about the real person.`,`Stay in character. Push back the way this role realistically would; do not cave easily, do not be cartoonishly hostile.`,`The reply is displayed AND spoken. Keep normal spelling on screen, but wrap every name, place, brand, or non-English term a voice might mispronounce as [[shown|said]] — for example [[Omakase|oh-mah-kah-seh]]. The said side must be lowercase voice-safe syllables matching a native/source-language pronunciation, never IPA or an Anglicized guess.`,`Reply ONLY with JSON: {"reply":"what you say next, 1-3 sentences, spoken language"}. No other keys, no prose outside the JSON.`].join(`
2
2
  `)}function u(){return[`You are a direct, warm conversation coach. The user just finished a practice take of a hard conversation.`,`Judge ONLY what is in the transcript — quote or reference their actual words; never invent things they said.`,`If an earlier take summary is given, say concretely what improved or regressed since it.`,`Reply ONLY with JSON: {"note":"how this take went, 1-2 sentences","tip":"ONE concrete thing to do differently next take, 1-2 sentences"}.`].join(`
3
3
  `)}var d=220,f=260;function p(e){try{return typeof e==`string`?JSON.parse(e.match(/\{[\s\S]*\}/)?.[0]??`{}`):e}catch{return{}}}function m(e){return e.map(e=>({role:e.who===`you`?`user`:`assistant`,content:e.text}))}async function te(e,t,n,r){try{let i=m(t),a=i.pop();if(!a||a.role!==`user`)return``;let o=await s(n.provider).generate({system:l(e),history:i,user:a.content,maxTokens:d},n);if(r.aborted)return``;let c=p(o.raw).reply;return typeof c==`string`?c.trim().slice(0,600):``}catch{return``}}async function ne(e,t,n,r,i,a){try{if(!t.some(e=>e.who===`you`))return null;let o=t.map(t=>`${t.who===`you`?`USER`:e.counterpart.toUpperCase()}: ${t.text}`).join(`
4
4
  `),c=[`Conversation being rehearsed: ${e.scenario}`,r?`Earlier take, your summary then: ${r}`:null,`Take ${n} transcript:`,o].filter(Boolean).join(`
5
- `),ee=await s(i.provider).generate({system:u(),history:[],user:c,maxTokens:f},i);if(a.aborted)return null;let l=p(ee.raw),d=typeof l.note==`string`?l.note.trim().slice(0,400):``,m=typeof l.tip==`string`?l.tip.trim().slice(0,400):``;return d&&m?{note:d,tip:m}:null}catch{return null}}function re(e){return`Debrief: I had the real "${e.scenario}" conversation. Here's what happened: `}var h=t();function ie(e){let t=(0,ee.c)(74),{cfg:n,memoryNodes:s,speak:l,onDebrief:u,onClose:d}=e,[f,p]=(0,c.useState)(``),[m,ie]=(0,c.useState)(``),[g,le]=(0,c.useState)(``),[_,ue]=(0,c.useState)(!1),[v,de]=(0,c.useState)(`setup`),[y,fe]=(0,c.useState)(1),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[0]=b):b=t[0];let[x,S]=(0,c.useState)(b),[C,pe]=(0,c.useState)(``),[w,T]=(0,c.useState)(null),[E,me]=(0,c.useState)(!1),[D,he]=(0,c.useState)(null),ge=(0,c.useRef)(null);r(ge);let _e=(0,c.useRef)(null),O=(0,c.useRef)(null),k,A;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>()=>{O.current?.abort(),a()},A=[],t[1]=k,t[2]=A):(k=t[1],A=t[2]),(0,c.useEffect)(k,A);let j;t[3]!==s||t[4]!==_?(j=_?s.map(ce).join(`. `):``,t[3]=s,t[4]=_,t[5]=j):j=t[5];let ve=j,M;t[6]===f?M=t[7]:(M=f.trim(),t[6]=f,t[7]=M);let N;t[8]===m?N=t[9]:(N=m.trim(),t[8]=m,t[9]=N);let P;t[10]===g?P=t[11]:(P=g.trim(),t[10]=g,t[11]=P);let F;t[12]!==ve||t[13]!==P?(F=[P,ve].filter(Boolean),t[12]=ve,t[13]=P,t[14]=F):F=t[14];let I=F.join(`
6
- `),L;t[15]!==M||t[16]!==N||t[17]!==I?(L={scenario:M,counterpart:N,context:I},t[15]=M,t[16]=N,t[17]=I,t[18]=L):L=t[18];let R=L,z;t[19]!==n||t[20]!==R||t[21]!==l?(z=async e=>{O.current?.abort();let t=new AbortController;O.current=t,T(`reply`),me(!1);let r=await te(R,e,n,t.signal);if(!t.signal.aborted){if(T(null),!r){me(!0);return}S([...e,{who:`them`,text:i(r)}]),l?.(r)}},t[19]=n,t[20]=R,t[21]=l,t[22]=z):z=t[22];let B=z,V;t[23]!==w||t[24]!==C||t[25]!==x||t[26]!==B?(V=()=>{let e=C.trim();if(!e||w)return;pe(``),he(null);let t=[...x,{who:`you`,text:e}];S(t),B(t)},t[23]=w,t[24]=C,t[25]=x,t[26]=B,t[27]=V):V=t[27];let H=V,U;t[28]!==w||t[29]!==n||t[30]!==x||t[31]!==R||t[32]!==y?(U=async()=>{if(w)return;O.current?.abort();let e=new AbortController;O.current=e,T(`coach`);let t=await ne(R,x,y,_e.current,n,e.signal);e.signal.aborted||(T(null),he(t),t&&(_e.current=t.note),fe(se),S([]))},t[28]=w,t[29]=n,t[30]=x,t[31]=R,t[32]=y,t[33]=U):U=t[33];let ye=U,W,G;t[34]===d?(W=t[35],G=t[36]):(W=()=>{let e=e=>{e.key===`Escape`&&d()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},G=[d],t[34]=d,t[35]=W,t[36]=G),(0,c.useEffect)(W,G);let be=R.scenario.length>0&&R.counterpart.length>0,K;t[37]===d?K=t[38]:(K=e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),d())},t[37]=d,t[38]=K);let q;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,h.jsx)(`h2`,{className:`reh-title`,children:`The Rehearsal`}),t[39]=q):q=t[39];let J;t[40]!==R.scenario||t[41]!==v||t[42]!==y?(J=v===`take`&&(0,h.jsxs)(`span`,{className:`reh-take-badge`,children:[R.scenario,` · take `,y]}),t[40]=R.scenario,t[41]=v,t[42]=y,t[43]=J):J=t[43];let Y;t[44]===d?Y=t[45]:(Y=(0,h.jsx)(`button`,{type:`button`,className:`reh-close`,onClick:d,"aria-label":`Close the rehearsal`,children:`✕`}),t[44]=d,t[45]=Y);let X;t[46]!==J||t[47]!==Y?(X=(0,h.jsxs)(`header`,{className:`reh-head`,children:[q,J,Y]}),t[46]=J,t[47]=Y,t[48]=X):X=t[48];let Z;t[49]!==w||t[50]!==D||t[51]!==g||t[52]!==m||t[53]!==C||t[54]!==ye||t[55]!==E||t[56]!==x||t[57]!==s||t[58]!==u||t[59]!==be||t[60]!==B||t[61]!==H||t[62]!==f||t[63]!==R||t[64]!==v||t[65]!==_?(Z=v===`setup`?(0,h.jsxs)(`div`,{className:`reh-setup`,children:[(0,h.jsx)(`p`,{className:`reh-lead`,children:`Practice the conversation that scares you — against the other side, played only from what you share here.`}),(0,h.jsx)(o,{kind:`simulation`,from:`live`}),(0,h.jsxs)(`label`,{className:`reh-field`,children:[(0,h.jsx)(`span`,{children:`The conversation`}),(0,h.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:`asking my manager for the raise`})]}),(0,h.jsxs)(`label`,{className:`reh-field`,children:[(0,h.jsx)(`span`,{children:`Mavéa plays`}),(0,h.jsx)(`input`,{value:m,onChange:e=>ie(e.target.value),placeholder:`my manager`})]}),(0,h.jsxs)(`label`,{className:`reh-field`,children:[(0,h.jsx)(`span`,{children:`What should they know? (how this person talks, their constraints, history)`}),(0,h.jsx)(`textarea`,{value:g,onChange:e=>le(e.target.value),rows:4,placeholder:`She defers to budget freezes. Our last 1:1 she said scope would be 'recognized eventually'…`})]}),s.length>0&&(0,h.jsxs)(`label`,{className:`reh-memory`,children:[(0,h.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>ue(e.target.checked)}),`Also ground them in what Mavéa remembers (`,s.length,` `,s.length===1?`concept`:`concepts`,`)`]}),(0,h.jsx)(`p`,{className:`reh-honest`,children:`They'll only know what's above — where it runs out, they play the role straight instead of pretending to know the real person.`}),(0,h.jsx)(`button`,{type:`button`,className:`reh-start`,disabled:!be,onClick:()=>de(`take`),children:`Start take 1`})]}):(0,h.jsxs)(`div`,{className:`reh-take`,children:[(0,h.jsxs)(`ul`,{className:`reh-lines`,children:[x.map((e,t)=>(0,h.jsxs)(`li`,{className:`reh-line `+e.who,children:[(0,h.jsx)(`span`,{className:`reh-line-who`,children:e.who===`you`?`You`:R.counterpart}),(0,h.jsx)(`span`,{className:`reh-line-text`,children:e.text})]},t)),w===`reply`&&(0,h.jsxs)(`li`,{className:`reh-thinking`,children:[R.counterpart,` is thinking…`]}),E&&(0,h.jsxs)(`li`,{className:`reh-failed`,children:[`They didn't respond.`,` `,(0,h.jsx)(`button`,{type:`button`,onClick:()=>void B(x),children:`Try again`})]})]}),D&&(0,h.jsxs)(`aside`,{className:`reh-coach`,"aria-label":`Coach, between takes`,children:[(0,h.jsx)(`span`,{className:`reh-coach-kicker`,children:`COACH — BETWEEN TAKES`}),(0,h.jsx)(`p`,{className:`reh-coach-note`,children:D.note}),(0,h.jsx)(`p`,{className:`reh-coach-tip`,children:D.tip})]}),w===`coach`&&(0,h.jsx)(`p`,{className:`reh-thinking`,children:`Coach is watching the take back…`}),(0,h.jsxs)(`div`,{className:`reh-compose`,children:[(0,h.jsx)(`input`,{value:C,onChange:e=>pe(e.target.value),onKeyDown:e=>{e.key===`Enter`&&H()},placeholder:x.length===0?`Open the conversation — your first line`:`Your next line`,"aria-label":`Your line`}),(0,h.jsx)(`button`,{type:`button`,className:`reh-say`,disabled:!C.trim()||w!==null,onClick:H,children:`Say it`})]}),(0,h.jsxs)(`footer`,{className:`reh-actions`,children:[(0,h.jsx)(`button`,{type:`button`,className:`reh-end`,disabled:w!==null||!x.some(ae),onClick:()=>void ye(),children:`End take · get coached`}),(0,h.jsx)(`button`,{type:`button`,className:`reh-debrief`,onClick:()=>u(re(R)),title:`Had the real conversation? Tell Mavéa how it went.`,children:`Debrief the real one`})]})]}),t[49]=w,t[50]=D,t[51]=g,t[52]=m,t[53]=C,t[54]=ye,t[55]=E,t[56]=x,t[57]=s,t[58]=u,t[59]=be,t[60]=B,t[61]=H,t[62]=f,t[63]=R,t[64]=v,t[65]=_,t[66]=Z):Z=t[66];let Q;t[67]!==X||t[68]!==Z?(Q=(0,h.jsxs)(`section`,{className:`reh-panel`,ref:ge,tabIndex:-1,role:`dialog`,"aria-label":`The Rehearsal`,onClick:oe,children:[X,Z]}),t[67]=X,t[68]=Z,t[69]=Q):Q=t[69];let $;return t[70]!==d||t[71]!==K||t[72]!==Q?($=(0,h.jsx)(`div`,{className:`reh-scrim`,onClick:d,role:`button`,tabIndex:0,"aria-label":`Close the rehearsal`,onKeyDown:K,children:Q}),t[70]=d,t[71]=K,t[72]=Q,t[73]=$):$=t[73],$}function ae(e){return e.who===`you`}function oe(e){return e.stopPropagation()}function se(e){return e+1}function ce(e){return e.body}export{ie as RehearsalPanel};
5
+ `),ee=await s(i.provider).generate({system:u(),history:[],user:c,maxTokens:f},i);if(a.aborted)return null;let l=p(ee.raw),d=typeof l.note==`string`?l.note.trim().slice(0,400):``,m=typeof l.tip==`string`?l.tip.trim().slice(0,400):``;return d&&m?{note:d,tip:m}:null}catch{return null}}function re(e){return`Debrief: I had the real "${e.scenario}" conversation. Here's what happened: `}var h=t();function ie(e){let t=(0,ee.c)(74),{cfg:n,memoryNodes:s,speak:l,onDebrief:u,onClose:d}=e,[f,p]=(0,c.useState)(``),[m,ie]=(0,c.useState)(``),[g,le]=(0,c.useState)(``),[_,ue]=(0,c.useState)(!1),[v,de]=(0,c.useState)(`setup`),[y,fe]=(0,c.useState)(1),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[0]=b):b=t[0];let[x,S]=(0,c.useState)(b),[C,pe]=(0,c.useState)(``),[w,T]=(0,c.useState)(null),[E,me]=(0,c.useState)(!1),[D,he]=(0,c.useState)(null),ge=(0,c.useRef)(null);r(ge);let _e=(0,c.useRef)(null),O=(0,c.useRef)(null),k,A;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>()=>{O.current?.abort(),i()},A=[],t[1]=k,t[2]=A):(k=t[1],A=t[2]),(0,c.useEffect)(k,A);let j;t[3]!==s||t[4]!==_?(j=_?s.map(ce).join(`. `):``,t[3]=s,t[4]=_,t[5]=j):j=t[5];let ve=j,M;t[6]===f?M=t[7]:(M=f.trim(),t[6]=f,t[7]=M);let N;t[8]===m?N=t[9]:(N=m.trim(),t[8]=m,t[9]=N);let P;t[10]===g?P=t[11]:(P=g.trim(),t[10]=g,t[11]=P);let F;t[12]!==ve||t[13]!==P?(F=[P,ve].filter(Boolean),t[12]=ve,t[13]=P,t[14]=F):F=t[14];let I=F.join(`
6
+ `),L;t[15]!==M||t[16]!==N||t[17]!==I?(L={scenario:M,counterpart:N,context:I},t[15]=M,t[16]=N,t[17]=I,t[18]=L):L=t[18];let R=L,z;t[19]!==n||t[20]!==R||t[21]!==l?(z=async e=>{O.current?.abort();let t=new AbortController;O.current=t,T(`reply`),me(!1);let r=await te(R,e,n,t.signal);if(!t.signal.aborted){if(T(null),!r){me(!0);return}S([...e,{who:`them`,text:a(r)}]),l?.(r)}},t[19]=n,t[20]=R,t[21]=l,t[22]=z):z=t[22];let B=z,V;t[23]!==w||t[24]!==C||t[25]!==x||t[26]!==B?(V=()=>{let e=C.trim();if(!e||w)return;pe(``),he(null);let t=[...x,{who:`you`,text:e}];S(t),B(t)},t[23]=w,t[24]=C,t[25]=x,t[26]=B,t[27]=V):V=t[27];let H=V,U;t[28]!==w||t[29]!==n||t[30]!==x||t[31]!==R||t[32]!==y?(U=async()=>{if(w)return;O.current?.abort();let e=new AbortController;O.current=e,T(`coach`);let t=await ne(R,x,y,_e.current,n,e.signal);e.signal.aborted||(T(null),he(t),t&&(_e.current=t.note),fe(se),S([]))},t[28]=w,t[29]=n,t[30]=x,t[31]=R,t[32]=y,t[33]=U):U=t[33];let ye=U,W,G;t[34]===d?(W=t[35],G=t[36]):(W=()=>{let e=e=>{e.key===`Escape`&&d()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},G=[d],t[34]=d,t[35]=W,t[36]=G),(0,c.useEffect)(W,G);let be=R.scenario.length>0&&R.counterpart.length>0,K;t[37]===d?K=t[38]:(K=e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),d())},t[37]=d,t[38]=K);let q;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,h.jsx)(`h2`,{className:`reh-title`,children:`The Rehearsal`}),t[39]=q):q=t[39];let J;t[40]!==R.scenario||t[41]!==v||t[42]!==y?(J=v===`take`&&(0,h.jsxs)(`span`,{className:`reh-take-badge`,children:[R.scenario,` · take `,y]}),t[40]=R.scenario,t[41]=v,t[42]=y,t[43]=J):J=t[43];let Y;t[44]===d?Y=t[45]:(Y=(0,h.jsx)(`button`,{type:`button`,className:`reh-close`,onClick:d,"aria-label":`Close the rehearsal`,children:`✕`}),t[44]=d,t[45]=Y);let X;t[46]!==J||t[47]!==Y?(X=(0,h.jsxs)(`header`,{className:`reh-head`,children:[q,J,Y]}),t[46]=J,t[47]=Y,t[48]=X):X=t[48];let Z;t[49]!==w||t[50]!==D||t[51]!==g||t[52]!==m||t[53]!==C||t[54]!==ye||t[55]!==E||t[56]!==x||t[57]!==s||t[58]!==u||t[59]!==be||t[60]!==B||t[61]!==H||t[62]!==f||t[63]!==R||t[64]!==v||t[65]!==_?(Z=v===`setup`?(0,h.jsxs)(`div`,{className:`reh-setup`,children:[(0,h.jsx)(`p`,{className:`reh-lead`,children:`Practice the conversation that scares you — against the other side, played only from what you share here.`}),(0,h.jsx)(o,{kind:`simulation`,from:`live`}),(0,h.jsxs)(`label`,{className:`reh-field`,children:[(0,h.jsx)(`span`,{children:`The conversation`}),(0,h.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:`asking my manager for the raise`})]}),(0,h.jsxs)(`label`,{className:`reh-field`,children:[(0,h.jsx)(`span`,{children:`Mavéa plays`}),(0,h.jsx)(`input`,{value:m,onChange:e=>ie(e.target.value),placeholder:`my manager`})]}),(0,h.jsxs)(`label`,{className:`reh-field`,children:[(0,h.jsx)(`span`,{children:`What should they know? (how this person talks, their constraints, history)`}),(0,h.jsx)(`textarea`,{value:g,onChange:e=>le(e.target.value),rows:4,placeholder:`She defers to budget freezes. Our last 1:1 she said scope would be 'recognized eventually'…`})]}),s.length>0&&(0,h.jsxs)(`label`,{className:`reh-memory`,children:[(0,h.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>ue(e.target.checked)}),`Also ground them in what Mavéa remembers (`,s.length,` `,s.length===1?`concept`:`concepts`,`)`]}),(0,h.jsx)(`p`,{className:`reh-honest`,children:`They'll only know what's above — where it runs out, they play the role straight instead of pretending to know the real person.`}),(0,h.jsx)(`button`,{type:`button`,className:`reh-start`,disabled:!be,onClick:()=>de(`take`),children:`Start take 1`})]}):(0,h.jsxs)(`div`,{className:`reh-take`,children:[(0,h.jsxs)(`ul`,{className:`reh-lines`,children:[x.map((e,t)=>(0,h.jsxs)(`li`,{className:`reh-line `+e.who,children:[(0,h.jsx)(`span`,{className:`reh-line-who`,children:e.who===`you`?`You`:R.counterpart}),(0,h.jsx)(`span`,{className:`reh-line-text`,children:e.text})]},t)),w===`reply`&&(0,h.jsxs)(`li`,{className:`reh-thinking`,children:[R.counterpart,` is thinking…`]}),E&&(0,h.jsxs)(`li`,{className:`reh-failed`,children:[`They didn't respond.`,` `,(0,h.jsx)(`button`,{type:`button`,onClick:()=>void B(x),children:`Try again`})]})]}),D&&(0,h.jsxs)(`aside`,{className:`reh-coach`,"aria-label":`Coach, between takes`,children:[(0,h.jsx)(`span`,{className:`reh-coach-kicker`,children:`COACH — BETWEEN TAKES`}),(0,h.jsx)(`p`,{className:`reh-coach-note`,children:D.note}),(0,h.jsx)(`p`,{className:`reh-coach-tip`,children:D.tip})]}),w===`coach`&&(0,h.jsx)(`p`,{className:`reh-thinking`,children:`Coach is watching the take back…`}),(0,h.jsxs)(`div`,{className:`reh-compose`,children:[(0,h.jsx)(`input`,{value:C,onChange:e=>pe(e.target.value),onKeyDown:e=>{e.key===`Enter`&&H()},placeholder:x.length===0?`Open the conversation — your first line`:`Your next line`,"aria-label":`Your line`}),(0,h.jsx)(`button`,{type:`button`,className:`reh-say`,disabled:!C.trim()||w!==null,onClick:H,children:`Say it`})]}),(0,h.jsxs)(`footer`,{className:`reh-actions`,children:[(0,h.jsx)(`button`,{type:`button`,className:`reh-end`,disabled:w!==null||!x.some(ae),onClick:()=>void ye(),children:`End take · get coached`}),(0,h.jsx)(`button`,{type:`button`,className:`reh-debrief`,onClick:()=>u(re(R)),title:`Had the real conversation? Tell Mavéa how it went.`,children:`Debrief the real one`})]})]}),t[49]=w,t[50]=D,t[51]=g,t[52]=m,t[53]=C,t[54]=ye,t[55]=E,t[56]=x,t[57]=s,t[58]=u,t[59]=be,t[60]=B,t[61]=H,t[62]=f,t[63]=R,t[64]=v,t[65]=_,t[66]=Z):Z=t[66];let Q;t[67]!==X||t[68]!==Z?(Q=(0,h.jsxs)(`section`,{className:`reh-panel`,ref:ge,tabIndex:-1,role:`dialog`,"aria-label":`The Rehearsal`,onClick:oe,children:[X,Z]}),t[67]=X,t[68]=Z,t[69]=Q):Q=t[69];let $;return t[70]!==d||t[71]!==K||t[72]!==Q?($=(0,h.jsx)(`div`,{className:`reh-scrim`,onClick:d,role:`button`,tabIndex:0,"aria-label":`Close the rehearsal`,onKeyDown:K,children:Q}),t[70]=d,t[71]=K,t[72]=Q,t[73]=$):$=t[73],$}function ae(e){return e.who===`you`}function oe(e){return e.stopPropagation()}function se(e){return e+1}function ce(e){return e.body}export{ie as RehearsalPanel};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-d_o2hebL.js","assets/chunk-BVpWp9h4.js","assets/index-DWHIOldG.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ReelJelly-9SCjNeHq.js","assets/geometry-DXAbnb0J.js","assets/registry-ChG5tFfx.js","assets/fit-C3MkNFdn.js","assets/share-QHGHNDhQ.js","assets/icons-CHVz6kv_.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/spokenText-D4zPX9JY.js","assets/toast-BBNs2h3L.js","assets/threads-CkMgrSDP.js","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-Da60jB7C.js","assets/ShareModal-C8S7ySls.css"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{I as r,J as i,L as a,ht as o,k as s,mt as c,q as l}from"./index-DWHIOldG.js";import{n as u}from"./icons-CHVz6kv_.js";import"./ShareModal-d_o2hebL.js";import"./annotationReel-DdHNp2IH.js";var d=t(),f=o(),p=c();function m(e){if(!e||!e.blocks?.length)return[];let t=e.blocks.map((e,t)=>({index:t}));return[{question:e.opener||e.title||``,narration:e.found||e.sub||e.opener||e.title||``,mode:`replace`,tour:t,spec:e,at:0}]}var h=n();i();var g=r(()=>l(()=>import(`./ShareModal-d_o2hebL.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),_=g.Component;function v(e){let t=(0,f.c)(9),{frames:n,spec:r}=e,[i,o]=(0,d.useState)(!1),c;t[0]!==n||t[1]!==r?(c=n??(r?m(r):[]),t[0]=n,t[1]=r,t[2]=c):c=t[2];let l=c;if(!l.length)return null;let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,h.jsx)(`button`,{type:`button`,style:y,onClick:()=>o(!0),...a(g.preload),children:`✨ Share as a story`}),t[3]=u):u=t[3];let v;t[4]!==i||t[5]!==l?(v=i&&(0,p.createPortal)((0,h.jsx)(s,{label:`Share story`,overlay:!0,children:(0,h.jsx)(_,{frames:l,onClose:()=>o(!1)})}),document.body),t[4]=i,t[5]=l,t[6]=v):v=t[6];let b;return t[7]===v?b=t[8]:(b=(0,h.jsxs)(h.Fragment,{children:[u,v]}),t[7]=v,t[8]=b),b}var y={display:`inline-flex`,alignItems:`center`,gap:8,padding:`10px 18px`,borderRadius:`var(--r-full)`,border:`none`,background:`var(--presence)`,color:`#fff`,font:`650 14px/1 var(--font)`,cursor:`pointer`,alignSelf:`flex-start`},b=e({ReplayCard:()=>x});function x(e){let t=(0,f.c)(12),{delay:n,line:r,spec:i}=e,a=(n||0)+`ms`,o;t[0]===a?o=t[1]:(o={"--delay":a},t[0]=a,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,h.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,h.jsx)(u.play,{className:`ic`,style:{color:`var(--presence-soft)`}}),` Mavéa Replay`]}),t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={fontSize:17,marginBottom:14},t[3]=l):l=t[3];let d=r||`“I dropped in 3 statements. Mavéa showed me where my money went in 20 seconds.”`,p;t[4]===d?p=t[5]:(p=(0,h.jsx)(`div`,{className:`insight-title`,style:l,children:d}),t[4]=d,t[5]=p);let m;t[6]===i?m=t[7]:(m=i&&(0,h.jsx)(v,{spec:i}),t[6]=i,t[7]=m);let g;return t[8]!==s||t[9]!==p||t[10]!==m?(g=(0,h.jsxs)(`div`,{className:`card replay-card reveal`,style:s,children:[c,p,m]}),t[8]=s,t[9]=p,t[10]=m,t[11]=g):g=t[11],g}export{b as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ShareModal-C-sD-aia.js","assets/chunk-BVpWp9h4.js","assets/index-CWqRe4-B.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/ReelJelly-Dg3XGB0c.js","assets/geometry-DXAbnb0J.js","assets/registry-_T6pLDPG.js","assets/fit-I3tuibfX.js","assets/share-QHGHNDhQ.js","assets/icons-CHVz6kv_.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/spokenText-D4zPX9JY.js","assets/toast-BBNs2h3L.js","assets/threads-CkMgrSDP.js","assets/useFocusTrap-DbfG6zbM.js","assets/kokoro-B-3GqktX.js","assets/ShareModal-PobtP7AJ.css"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./chunk-BVpWp9h4.js";import{t}from"./react-BQSORdFI.js";import{t as n}from"./jsx-runtime-DaSxXjOY.js";import{I as r,J as i,L as a,ht as o,k as s,mt as c,q as l}from"./index-CWqRe4-B.js";import{n as u}from"./icons-CHVz6kv_.js";import"./ShareModal-C-sD-aia.js";import"./annotationReel-SeXzv0P-.js";var d=t(),f=o(),p=c();function m(e){if(!e||!e.blocks?.length)return[];let t=e.blocks.map((e,t)=>({index:t}));return[{question:e.opener||e.title||``,narration:e.found||e.sub||e.opener||e.title||``,mode:`replace`,tour:t,spec:e,at:0}]}var h=n();i();var g=r(()=>l(()=>import(`./ShareModal-C-sD-aia.js`).then(e=>e.t).then(e=>({default:e.ShareModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),_=g.Component;function v(e){let t=(0,f.c)(9),{frames:n,spec:r}=e,[i,o]=(0,d.useState)(!1),c;t[0]!==n||t[1]!==r?(c=n??(r?m(r):[]),t[0]=n,t[1]=r,t[2]=c):c=t[2];let l=c;if(!l.length)return null;let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,h.jsx)(`button`,{type:`button`,style:y,onClick:()=>o(!0),...a(g.preload),children:`✨ Share as a story`}),t[3]=u):u=t[3];let v;t[4]!==i||t[5]!==l?(v=i&&(0,p.createPortal)((0,h.jsx)(s,{label:`Share story`,overlay:!0,children:(0,h.jsx)(_,{frames:l,onClose:()=>o(!1)})}),document.body),t[4]=i,t[5]=l,t[6]=v):v=t[6];let b;return t[7]===v?b=t[8]:(b=(0,h.jsxs)(h.Fragment,{children:[u,v]}),t[7]=v,t[8]=b),b}var y={display:`inline-flex`,alignItems:`center`,gap:8,padding:`10px 18px`,borderRadius:`var(--r-full)`,border:`none`,background:`var(--presence)`,color:`#fff`,font:`650 14px/1 var(--font)`,cursor:`pointer`,alignSelf:`flex-start`},b=e({ReplayCard:()=>x});function x(e){let t=(0,f.c)(12),{delay:n,line:r,spec:i}=e,a=(n||0)+`ms`,o;t[0]===a?o=t[1]:(o={"--delay":a},t[0]=a,t[1]=o);let s=o,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,h.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,h.jsx)(u.play,{className:`ic`,style:{color:`var(--presence-soft)`}}),` Mavéa Replay`]}),t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={fontSize:17,marginBottom:14},t[3]=l):l=t[3];let d=r||`“I dropped in 3 statements. Mavéa showed me where my money went in 20 seconds.”`,p;t[4]===d?p=t[5]:(p=(0,h.jsx)(`div`,{className:`insight-title`,style:l,children:d}),t[4]=d,t[5]=p);let m;t[6]===i?m=t[7]:(m=i&&(0,h.jsx)(v,{spec:i}),t[6]=i,t[7]=m);let g;return t[8]!==s||t[9]!==p||t[10]!==m?(g=(0,h.jsxs)(`div`,{className:`card replay-card reveal`,style:s,children:[c,p,m]}),t[8]=s,t[9]=p,t[10]=m,t[11]=g):g=t[11],g}export{b as t};
@@ -1 +1 @@
1
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./TopicCanvas-wmAsICUd.js";import"./canvas-BwR8ltlj.js";import{t as r}from"./generateBeats-b64CL54v.js";var i=e();function a(e){let t=[];for(let n of e.tour){let r=e.spec.blocks[n.index]?.id;r&&t.push(n.say?{spot:r,say:n.say}:{spot:r})}return t}function o(e){let t=a(e),n=r(e.spec.blocks,{opener:e.narration,...t.length?{tour:t}:{}});return{spec:e.spec,say:e.spoken??e.narration,beats:n}}function s(e,t=0){let n=Math.max(0,Math.min(t,e.length));return e.slice(n).map(o)}var c=t(),l=700;function u({frames:e,initialIndex:t,speak:r,cancelSpeak:a,onClose:o}){let[u,d]=(0,i.useState)(()=>Math.min(Math.max(0,t),e.length-1)),[f,p]=(0,i.useState)(null),[m,h]=(0,i.useState)(!1),[g,_]=(0,i.useState)(()=>e[t]?.spec??null),v=(0,i.useRef)(null),y=(0,i.useRef)(null),b=e[u]??null,x=(0,i.useCallback)(()=>{y.current?.(),y.current=null,a?.(),h(!1),p(null)},[a]),S=(0,i.useCallback)((e,t)=>{if(x(),!e.length)return;let n=!1,i;y.current=()=>{n=!0,i&&clearTimeout(i)},h(!0);let o=0,s=()=>{if(n)return;if(o>=e.length){h(!1),p(null);return}let c=e[o];d(t+o),_(c.spec),a?.(),c.say&&r?.(c.say);let u=0,f=()=>{if(n)return;if(u>=c.beats.length){o+=1,i=setTimeout(s,l);return}let e=c.beats[u++];e.set&&`spot`in e.set&&p(e.set.spot??null),i=setTimeout(f,e.ms??0)};f()};s()},[x,r,a]),C=(0,i.useCallback)(()=>{b&&S(s([b],0),u)},[b,u,S]),w=(0,i.useCallback)(()=>{S(s(e,u),u)},[e,u,S]),T=(0,i.useCallback)(()=>{d(0),S(s(e,0),0)},[e,S]),E=(0,i.useCallback)(t=>{x(),d(t),_(e[t]?.spec??null)},[e,x]);return(0,i.useEffect)(()=>{if(!f)return;let e=window.setTimeout(()=>{let e=v.current;if(!e)return;let t=e.querySelector(`.spotlit`);if(!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.top-n.top-(e.clientHeight-r.height)/2;e.scrollTo({top:Math.max(0,e.scrollTop+i),behavior:`smooth`})},90);return()=>window.clearTimeout(e)},[f]),(0,i.useEffect)(()=>()=>x(),[x]),!b||!g?null:(0,c.jsxs)(`div`,{onClick:()=>{x(),o()},role:`button`,tabIndex:0,"aria-label":`Close replay overlay`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),x(),o())},style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.6)`,zIndex:60,display:`flex`,padding:20,gap:16},children:[(0,c.jsxs)(`div`,{onClick:e=>e.stopPropagation(),role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),e.stopPropagation())},style:{flex:`0 0 240px`,display:`flex`,flexDirection:`column`,gap:8,overflow:`auto`,background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:12,padding:12},children:[(0,c.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,c.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Conversation`}),(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:12},onClick:()=>{x(),o()},children:`← Live`})]}),e.map((e,t)=>{let n=t===u;return(0,c.jsxs)(`button`,{onClick:()=>E(t),title:e.question,style:{textAlign:`left`,padding:`8px 10px`,borderRadius:8,border:`1px solid `+(n?`var(--presence)`:`var(--line)`),background:n?`var(--surface-elevated)`:`transparent`,cursor:`pointer`,color:`inherit`,font:`inherit`,display:`flex`,flexDirection:`column`,gap:2},children:[(0,c.jsxs)(`span`,{style:{fontSize:12.5,fontWeight:n?600:400,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[t+1,`. `,e.question||e.spec.title]}),(0,c.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-muted)`},children:[e.spec.blocks.length,` cards`,e.mode===`replace`?``:` · ${e.mode}`]})]},t)})]}),(0,c.jsxs)(`div`,{onClick:e=>e.stopPropagation(),role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),e.stopPropagation())},style:{flex:1,display:`flex`,flexDirection:`column`,gap:10,minWidth:0},children:[(0,c.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexWrap:`wrap`},children:[(0,c.jsx)(`span`,{className:`faint`,style:{fontSize:12.5,marginRight:`auto`},children:b.spec.title}),m?(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:x,children:`◼ Stop`}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:C,children:`▶ Replay this`}),(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:w,children:`▶ From here`}),(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:T,children:`▶ From start`})]})]}),(0,c.jsx)(`div`,{ref:v,className:`canvas-scroll`,style:{flex:1,overflow:`auto`,background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:12,padding:16},children:(0,c.jsx)(`div`,{className:`topic-wrap`,children:(0,c.jsx)(n,{data:g,spot:f,built:{},onProve:()=>{}})})})]})]})}export{u as ReplayOverlay};
1
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./TopicCanvas-D64O3lvD.js";import"./canvas-uhcwigAL.js";import{t as r}from"./generateBeats-b64CL54v.js";var i=e();function a(e){let t=[];for(let n of e.tour){let r=e.spec.blocks[n.index]?.id;r&&t.push(n.say?{spot:r,say:n.say}:{spot:r})}return t}function o(e){let t=a(e),n=r(e.spec.blocks,{opener:e.narration,...t.length?{tour:t}:{}});return{spec:e.spec,say:e.spoken??e.narration,beats:n}}function s(e,t=0){let n=Math.max(0,Math.min(t,e.length));return e.slice(n).map(o)}var c=t(),l=700;function u({frames:e,initialIndex:t,speak:r,cancelSpeak:a,onClose:o}){let[u,d]=(0,i.useState)(()=>Math.min(Math.max(0,t),e.length-1)),[f,p]=(0,i.useState)(null),[m,h]=(0,i.useState)(!1),[g,_]=(0,i.useState)(()=>e[t]?.spec??null),v=(0,i.useRef)(null),y=(0,i.useRef)(null),b=e[u]??null,x=(0,i.useCallback)(()=>{y.current?.(),y.current=null,a?.(),h(!1),p(null)},[a]),S=(0,i.useCallback)((e,t)=>{if(x(),!e.length)return;let n=!1,i;y.current=()=>{n=!0,i&&clearTimeout(i)},h(!0);let o=0,s=()=>{if(n)return;if(o>=e.length){h(!1),p(null);return}let c=e[o];d(t+o),_(c.spec),a?.(),c.say&&r?.(c.say);let u=0,f=()=>{if(n)return;if(u>=c.beats.length){o+=1,i=setTimeout(s,l);return}let e=c.beats[u++];e.set&&`spot`in e.set&&p(e.set.spot??null),i=setTimeout(f,e.ms??0)};f()};s()},[x,r,a]),C=(0,i.useCallback)(()=>{b&&S(s([b],0),u)},[b,u,S]),w=(0,i.useCallback)(()=>{S(s(e,u),u)},[e,u,S]),T=(0,i.useCallback)(()=>{d(0),S(s(e,0),0)},[e,S]),E=(0,i.useCallback)(t=>{x(),d(t),_(e[t]?.spec??null)},[e,x]);return(0,i.useEffect)(()=>{if(!f)return;let e=window.setTimeout(()=>{let e=v.current;if(!e)return;let t=e.querySelector(`.spotlit`);if(!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.top-n.top-(e.clientHeight-r.height)/2;e.scrollTo({top:Math.max(0,e.scrollTop+i),behavior:`smooth`})},90);return()=>window.clearTimeout(e)},[f]),(0,i.useEffect)(()=>()=>x(),[x]),!b||!g?null:(0,c.jsxs)(`div`,{onClick:()=>{x(),o()},role:`button`,tabIndex:0,"aria-label":`Close replay overlay`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),x(),o())},style:{position:`fixed`,inset:0,background:`rgba(0,0,0,0.6)`,zIndex:60,display:`flex`,padding:20,gap:16},children:[(0,c.jsxs)(`div`,{onClick:e=>e.stopPropagation(),role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),e.stopPropagation())},style:{flex:`0 0 240px`,display:`flex`,flexDirection:`column`,gap:8,overflow:`auto`,background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:12,padding:12},children:[(0,c.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`},children:[(0,c.jsx)(`span`,{style:{fontSize:13,fontWeight:600},children:`Conversation`}),(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:12},onClick:()=>{x(),o()},children:`← Live`})]}),e.map((e,t)=>{let n=t===u;return(0,c.jsxs)(`button`,{onClick:()=>E(t),title:e.question,style:{textAlign:`left`,padding:`8px 10px`,borderRadius:8,border:`1px solid `+(n?`var(--presence)`:`var(--line)`),background:n?`var(--surface-elevated)`:`transparent`,cursor:`pointer`,color:`inherit`,font:`inherit`,display:`flex`,flexDirection:`column`,gap:2},children:[(0,c.jsxs)(`span`,{style:{fontSize:12.5,fontWeight:n?600:400,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:[t+1,`. `,e.question||e.spec.title]}),(0,c.jsxs)(`span`,{style:{fontSize:11,color:`var(--text-muted)`},children:[e.spec.blocks.length,` cards`,e.mode===`replace`?``:` · ${e.mode}`]})]},t)})]}),(0,c.jsxs)(`div`,{onClick:e=>e.stopPropagation(),role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),e.stopPropagation())},style:{flex:1,display:`flex`,flexDirection:`column`,gap:10,minWidth:0},children:[(0,c.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flexWrap:`wrap`},children:[(0,c.jsx)(`span`,{className:`faint`,style:{fontSize:12.5,marginRight:`auto`},children:b.spec.title}),m?(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:x,children:`◼ Stop`}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:C,children:`▶ Replay this`}),(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:w,children:`▶ From here`}),(0,c.jsx)(`button`,{className:`entry-action`,style:{fontSize:13},onClick:T,children:`▶ From start`})]})]}),(0,c.jsx)(`div`,{ref:v,className:`canvas-scroll`,style:{flex:1,overflow:`auto`,background:`var(--surface-elevated)`,border:`1px solid var(--line)`,borderRadius:12,padding:16},children:(0,c.jsx)(`div`,{className:`topic-wrap`,children:(0,c.jsx)(n,{data:g,spot:f,built:{},onProve:()=>{}})})})]})]})}export{u as ReplayOverlay};
@@ -1 +1 @@
1
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DWHIOldG.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";import{t as i}from"./motion-QSGW_vc_.js";import{o as a}from"./useStudy-DRNarubG.js";import{C as o}from"./dashboardEvents-S4Y2aOP_.js";import{n as s,o as c,r as l}from"./CheckLogRail-DbGJtneK.js";import{r as u}from"./predictions-CYS7Vo39.js";var d=e(),f=n(),p=10080*60*1e3,m=20;function h(e,t){return e.reduce((e,n)=>{let r=u(n.predictionHistory,t);return{hits:e.hits+r.hits,total:e.total+r.total}},{hits:0,total:0})}function g(e,t,n=m){let r=t-p,i=[];for(let t of e)for(let e of t.predictionHistory??[])e.at>=r&&i.push({grade:e,dashboardTitle:t.title});return i.sort((e,t)=>e.grade.at-t.grade.at),i.length>n?i.slice(i.length-n):i}function _(e,t){let n=t-p,r=null,i=-1;for(let t of e)for(let e of t.predictionHistory??[]){if(e.at<n||e.result!==`hit`)continue;let a=e.expected.length+(e.note?.length??0);a>i&&(i=a,r={expected:e.expected,note:e.note,dashboardTitle:t.title})}return r}function v(e,t){let n=[];return e.totalSearches>0&&n.push(`searches`),e.topMoment&&n.push(`moment`),t.total>0&&n.push(`calls`),e.estSavedPerMonth>0&&n.push(`saved`),n}function y(e){return e.length>0?e:[`fallback`]}var b=t(),x=[`S`,`M`,`T`,`W`,`T`,`F`,`S`];function S(e){return x[new Date(`${e}T00:00:00Z`).getUTCDay()]}function C(e){return new Date(e).toLocaleDateString([],{weekday:`long`,month:`long`,day:`numeric`})}function w(e){return{"--d":`${e}ms`}}function T(e){let t=(0,f.c)(22),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.totalSearches,r),o;t[1]===n.byDay?o=t[2]:(o=Math.max(1,...n.byDay.map(E)),t[1]=n.byDay,t[2]=o);let s=o,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`This week`}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=w(90),t[4]=l):l=t[4];let u;t[5]===a?u=t[6]:(u=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:l,children:a}),t[5]=a,t[6]=u);let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(170),t[7]=d):d=t[7];let p=n.totalSearches===1?``:`es`,m;t[8]===p?m=t[9]:(m=(0,b.jsxs)(`p`,{className:`rw-figure-label rw-child`,style:d,children:[`search`,p,`, all week`]}),t[8]=p,t[9]=m);let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(260),t[10]=h):h=t[10];let g;if(t[11]!==s||t[12]!==n.byDay){let e;t[14]===s?e=t[15]:(e=e=>(0,b.jsxs)(`div`,{className:`rw-bar`,title:`${e.searches} search${e.searches===1?``:`es`}`,children:[(0,b.jsx)(`div`,{className:`rw-bar-track`,children:(0,b.jsx)(`div`,{className:`rw-bar-fill`,style:{height:`${e.searches/s*100}%`}})}),(0,b.jsx)(`span`,{className:`rw-bar-day`,children:S(e.date)})]},e.date),t[14]=s,t[15]=e),g=n.byDay.map(e),t[11]=s,t[12]=n.byDay,t[13]=g}else g=t[13];let _;t[16]===g?_=t[17]:(_=(0,b.jsx)(`div`,{className:`rw-bars rw-child`,style:h,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==u||t[20]!==m?(v=(0,b.jsxs)(b.Fragment,{children:[c,u,m,_]}),t[18]=_,t[19]=u,t[20]=m,t[21]=v):v=t[21],v}function E(e){return e.searches}function ee(e){let t=(0,f.c)(22),{rewind:n}=e,r=n.topMoment;if(!r)return null;let i;t[0]===r?i=t[1]:(i=s(r),t[0]=r,t[1]=i);let a=i,o=a?.tone??`plain`,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`The moment that mattered`}),t[2]=c):c=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(110),t[3]=u):u=t[3];let d;t[4]===r.text?d=t[5]:(d=(0,b.jsx)(`p`,{className:`rw-moment-text`,children:r.text}),t[4]=r.text,t[5]=d);let p;t[6]===a?p=t[7]:(p=a&&(0,b.jsx)(`span`,{className:`rw-moment-chip`,children:a.label}),t[6]=a,t[7]=p);let m;t[8]===r.at?m=t[9]:(m=C(r.at),t[8]=r.at,t[9]=m);let h;t[10]===r.at?h=t[11]:(h=l(r.at),t[10]=r.at,t[11]=h);let g;t[12]!==m||t[13]!==h?(g=(0,b.jsxs)(`span`,{className:`rw-moment-time`,children:[m,` · `,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14];let _;t[15]!==p||t[16]!==g?(_=(0,b.jsxs)(`div`,{className:`rw-moment-meta`,children:[p,g]}),t[15]=p,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==d||t[19]!==_||t[20]!==o?(v=(0,b.jsxs)(b.Fragment,{children:[c,(0,b.jsxs)(`div`,{className:`rw-moment rw-child`,"data-tone":o,style:u,children:[d,_]})]}),t[18]=d,t[19]=_,t[20]=o,t[21]=v):v=t[21],v}var D={hit:`✓`,miss:`✗`,unclear:`—`};function O(e){let t=(0,f.c)(19),{tally:n,grades:r,quote:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={duration:1200},t[0]=o):o=t[0];let s=i(n.hits,o),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={duration:1200},t[1]=c):c=t[1];let l=i(n.total,c),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`Call record`}),t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(90),t[3]=d):d=t[3];let p;t[4]!==s||t[5]!==l?(p=(0,b.jsxs)(`p`,{className:`rw-figure rw-child`,style:d,children:[s,`/`,l]}),t[4]=s,t[5]=l,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`calls graded this week`}),t[7]=m):m=t[7];let h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(250),t[8]=h):h=t[8];let g;t[9]===r?g=t[10]:(g=r.map(k),t[9]=r,t[10]=g);let _;t[11]===g?_=t[12]:(_=(0,b.jsx)(`div`,{className:`rw-chips rw-child`,style:h,role:`list`,children:g}),t[11]=g,t[12]=_);let v;t[13]===a?v=t[14]:(v=a&&(0,b.jsxs)(`p`,{className:`rw-quote rw-child`,style:w(330),children:[`“`,a.expected,a.note?` — ${a.note}`:``,`”`,(0,b.jsx)(`span`,{className:`rw-quote-attr`,children:a.dashboardTitle})]}),t[13]=a,t[14]=v);let y;return t[15]!==v||t[16]!==p||t[17]!==_?(y=(0,b.jsxs)(b.Fragment,{children:[u,p,m,_,v]}),t[15]=v,t[16]=p,t[17]=_,t[18]=y):y=t[18],y}function k(e,t){let{grade:n}=e;return(0,b.jsx)(`span`,{className:`rw-chip rw-chip--${n.result}`,role:`listitem`,title:n.expected,children:D[n.result]},`${n.at}-${t}`)}function te(e){let t=(0,f.c)(12),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.estSavedPerMonth,r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`If you keep this up`}),t[1]=o):o=t[1];let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=w(90),t[2]=s):s=t[2];let c;t[3]===a?c=t[4]:(c=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:s,children:a}),t[3]=a,t[4]=c);let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`searches saved / month`}),t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(250),t[6]=u):u=t[6];let d;t[7]===n.estSavedPerMonth?d=t[8]:(d=(0,b.jsxs)(`p`,{className:`rw-caption rw-child`,style:u,children:[`Applying Mavéa's suggestions this week is projected to save about `,n.estSavedPerMonth,` `,`searches a month — a rate estimate from real cadence changes, not a count of searches actually skipped this week.`]}),t[7]=n.estSavedPerMonth,t[8]=d);let p;return t[9]!==c||t[10]!==d?(p=(0,b.jsxs)(b.Fragment,{children:[o,c,l,d]}),t[9]=c,t[10]=d,t[11]=p):p=t[11],p}function ne(){let e=(0,f.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(`p`,{className:`rw-fallback-text rw-child`,style:w(40),children:`Nothing to look back on yet — come back after a week of checks.`}),e[0]=t):t=e[0],t}function A(e){let t=(0,f.c)(70),{onClose:n}=e,i=(0,d.useRef)(null),s;t[0]===n?s=t[1]:(s={onEscape:n},t[0]=n,t[1]=s),r(i,s);let[l]=(0,d.useState)(ie),u=c(),p=a(),m;t[2]!==u||t[3]!==l?(m=o(u,l),t[2]=u,t[3]=l,t[4]=m):m=t[4];let x=m,S;t[5]!==p||t[6]!==l?(S=h(p,l),t[5]=p,t[6]=l,t[7]=S):S=t[7];let C=S,w;t[8]!==p||t[9]!==l?(w=g(p,l),t[8]=p,t[9]=l,t[10]=w):w=t[10];let E=w,D;t[11]!==p||t[12]!==l?(D=_(p,l),t[11]=p,t[12]=l,t[13]=D):D=t[13];let k=D,A;t[14]!==x||t[15]!==C?(A=v(x,C),t[14]=x,t[15]=C,t[16]=A):A=t[16];let j=A,M;t[17]===j?M=t[18]:(M=y(j),t[17]=j,t[18]=M);let N=M,[P,F]=(0,d.useState)(0),I,L;t[19]===N.length?(I=t[20],L=t[21]):(I=()=>{F(e=>Math.min(e,N.length-1))},L=[N.length],t[19]=N.length,t[20]=I,t[21]=L),(0,d.useEffect)(I,L);let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>F(re),t[22]=R):R=t[22];let z=R,B;t[23]===N.length?B=t[24]:(B=()=>F(e=>Math.min(N.length-1,e+1)),t[23]=N.length,t[24]=B);let V=B,H;t[25]===V?H=t[26]:(H=e=>{e.key===`ArrowRight`||e.key===` `?(e.preventDefault(),V()):e.key===`ArrowLeft`&&(e.preventDefault(),z())},t[25]=V,t[26]=H);let U=H,W=N.length>1,G;t[27]!==W||t[28]!==P||t[29]!==N.length?(G=W&&(0,b.jsxs)(`span`,{className:`rw-counter`,"aria-live":`polite`,children:[P+1,` of `,N.length]}),t[27]=W,t[28]=P,t[29]=N.length,t[30]=G):G=t[30];let K;t[31]===n?K=t[32]:(K=(0,b.jsx)(`button`,{type:`button`,className:`rw-close`,onClick:n,"aria-label":`Close`,children:`×`}),t[31]=n,t[32]=K);let q;t[33]!==G||t[34]!==K?(q=(0,b.jsxs)(`div`,{className:`rw-chrome`,children:[G,K]}),t[33]=G,t[34]=K,t[35]=q):q=t[35];let J;t[36]!==W||t[37]!==P?(J=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--prev`,"aria-label":`Previous slide`,onClick:z,disabled:P===0}),t[36]=W,t[37]=P,t[38]=J):J=t[38];let Y;if(t[39]!==E||t[40]!==P||t[41]!==k||t[42]!==x||t[43]!==N||t[44]!==C){let e;t[46]!==E||t[47]!==P||t[48]!==k||t[49]!==x||t[50]!==C?(e=(e,t)=>(0,b.jsxs)(`div`,{className:`rw-slide`,"data-active":t===P||void 0,children:[e===`searches`&&(0,b.jsx)(T,{rewind:x}),e===`moment`&&(0,b.jsx)(ee,{rewind:x}),e===`calls`&&(0,b.jsx)(O,{tally:C,grades:E,quote:k}),e===`saved`&&(0,b.jsx)(te,{rewind:x}),e===`fallback`&&(0,b.jsx)(ne,{})]},e),t[46]=E,t[47]=P,t[48]=k,t[49]=x,t[50]=C,t[51]=e):e=t[51],Y=N.map(e),t[39]=E,t[40]=P,t[41]=k,t[42]=x,t[43]=N,t[44]=C,t[45]=Y}else Y=t[45];let X;t[52]!==W||t[53]!==V||t[54]!==P||t[55]!==N.length?(X=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--next`,"aria-label":`Next slide`,onClick:V,disabled:P===N.length-1}),t[52]=W,t[53]=V,t[54]=P,t[55]=N.length,t[56]=X):X=t[56];let Z;t[57]!==J||t[58]!==Y||t[59]!==X?(Z=(0,b.jsxs)(`div`,{className:`rw-stage`,children:[J,Y,X]}),t[57]=J,t[58]=Y,t[59]=X,t[60]=Z):Z=t[60];let Q;t[61]!==W||t[62]!==P||t[63]!==N?(Q=W&&(0,b.jsx)(`div`,{className:`rw-dots`,children:N.map((e,t)=>(0,b.jsx)(`button`,{type:`button`,className:`rw-dot`,"data-active":t===P||void 0,"aria-label":`Go to slide ${t+1} of ${N.length}`,onClick:()=>F(t)},e))}),t[61]=W,t[62]=P,t[63]=N,t[64]=Q):Q=t[64];let $;return t[65]!==U||t[66]!==q||t[67]!==Z||t[68]!==Q?($=(0,b.jsxs)(`div`,{className:`rw-overlay`,ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Weekly Rewind`,tabIndex:-1,onKeyDown:U,children:[q,Z,Q]}),t[65]=U,t[66]=q,t[67]=Z,t[68]=Q,t[69]=$):$=t[69],$}function re(e){return Math.max(0,e-1)}function ie(){return Date.now()}export{A as RewindOverlay};
1
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-CWqRe4-B.js";import{t as r}from"./useFocusTrap-DbfG6zbM.js";import{t as i}from"./motion-CURfDtdH.js";import{o as a}from"./useStudy-6QnY-Fw_.js";import{C as o}from"./dashboardEvents-BqcPN-K8.js";import{n as s,o as c,r as l}from"./CheckLogRail-ZrDqyjQ7.js";import{r as u}from"./predictions-CYS7Vo39.js";var d=e(),f=n(),p=10080*60*1e3,m=20;function h(e,t){return e.reduce((e,n)=>{let r=u(n.predictionHistory,t);return{hits:e.hits+r.hits,total:e.total+r.total}},{hits:0,total:0})}function g(e,t,n=m){let r=t-p,i=[];for(let t of e)for(let e of t.predictionHistory??[])e.at>=r&&i.push({grade:e,dashboardTitle:t.title});return i.sort((e,t)=>e.grade.at-t.grade.at),i.length>n?i.slice(i.length-n):i}function _(e,t){let n=t-p,r=null,i=-1;for(let t of e)for(let e of t.predictionHistory??[]){if(e.at<n||e.result!==`hit`)continue;let a=e.expected.length+(e.note?.length??0);a>i&&(i=a,r={expected:e.expected,note:e.note,dashboardTitle:t.title})}return r}function v(e,t){let n=[];return e.totalSearches>0&&n.push(`searches`),e.topMoment&&n.push(`moment`),t.total>0&&n.push(`calls`),e.estSavedPerMonth>0&&n.push(`saved`),n}function y(e){return e.length>0?e:[`fallback`]}var b=t(),x=[`S`,`M`,`T`,`W`,`T`,`F`,`S`];function S(e){return x[new Date(`${e}T00:00:00Z`).getUTCDay()]}function C(e){return new Date(e).toLocaleDateString([],{weekday:`long`,month:`long`,day:`numeric`})}function w(e){return{"--d":`${e}ms`}}function T(e){let t=(0,f.c)(22),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.totalSearches,r),o;t[1]===n.byDay?o=t[2]:(o=Math.max(1,...n.byDay.map(E)),t[1]=n.byDay,t[2]=o);let s=o,c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`This week`}),t[3]=c):c=t[3];let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=w(90),t[4]=l):l=t[4];let u;t[5]===a?u=t[6]:(u=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:l,children:a}),t[5]=a,t[6]=u);let d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(170),t[7]=d):d=t[7];let p=n.totalSearches===1?``:`es`,m;t[8]===p?m=t[9]:(m=(0,b.jsxs)(`p`,{className:`rw-figure-label rw-child`,style:d,children:[`search`,p,`, all week`]}),t[8]=p,t[9]=m);let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(260),t[10]=h):h=t[10];let g;if(t[11]!==s||t[12]!==n.byDay){let e;t[14]===s?e=t[15]:(e=e=>(0,b.jsxs)(`div`,{className:`rw-bar`,title:`${e.searches} search${e.searches===1?``:`es`}`,children:[(0,b.jsx)(`div`,{className:`rw-bar-track`,children:(0,b.jsx)(`div`,{className:`rw-bar-fill`,style:{height:`${e.searches/s*100}%`}})}),(0,b.jsx)(`span`,{className:`rw-bar-day`,children:S(e.date)})]},e.date),t[14]=s,t[15]=e),g=n.byDay.map(e),t[11]=s,t[12]=n.byDay,t[13]=g}else g=t[13];let _;t[16]===g?_=t[17]:(_=(0,b.jsx)(`div`,{className:`rw-bars rw-child`,style:h,children:g}),t[16]=g,t[17]=_);let v;return t[18]!==_||t[19]!==u||t[20]!==m?(v=(0,b.jsxs)(b.Fragment,{children:[c,u,m,_]}),t[18]=_,t[19]=u,t[20]=m,t[21]=v):v=t[21],v}function E(e){return e.searches}function ee(e){let t=(0,f.c)(22),{rewind:n}=e,r=n.topMoment;if(!r)return null;let i;t[0]===r?i=t[1]:(i=s(r),t[0]=r,t[1]=i);let a=i,o=a?.tone??`plain`,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`The moment that mattered`}),t[2]=c):c=t[2];let u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(110),t[3]=u):u=t[3];let d;t[4]===r.text?d=t[5]:(d=(0,b.jsx)(`p`,{className:`rw-moment-text`,children:r.text}),t[4]=r.text,t[5]=d);let p;t[6]===a?p=t[7]:(p=a&&(0,b.jsx)(`span`,{className:`rw-moment-chip`,children:a.label}),t[6]=a,t[7]=p);let m;t[8]===r.at?m=t[9]:(m=C(r.at),t[8]=r.at,t[9]=m);let h;t[10]===r.at?h=t[11]:(h=l(r.at),t[10]=r.at,t[11]=h);let g;t[12]!==m||t[13]!==h?(g=(0,b.jsxs)(`span`,{className:`rw-moment-time`,children:[m,` · `,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14];let _;t[15]!==p||t[16]!==g?(_=(0,b.jsxs)(`div`,{className:`rw-moment-meta`,children:[p,g]}),t[15]=p,t[16]=g,t[17]=_):_=t[17];let v;return t[18]!==d||t[19]!==_||t[20]!==o?(v=(0,b.jsxs)(b.Fragment,{children:[c,(0,b.jsxs)(`div`,{className:`rw-moment rw-child`,"data-tone":o,style:u,children:[d,_]})]}),t[18]=d,t[19]=_,t[20]=o,t[21]=v):v=t[21],v}var D={hit:`✓`,miss:`✗`,unclear:`—`};function O(e){let t=(0,f.c)(19),{tally:n,grades:r,quote:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={duration:1200},t[0]=o):o=t[0];let s=i(n.hits,o),c;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c={duration:1200},t[1]=c):c=t[1];let l=i(n.total,c),u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`Call record`}),t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=w(90),t[3]=d):d=t[3];let p;t[4]!==s||t[5]!==l?(p=(0,b.jsxs)(`p`,{className:`rw-figure rw-child`,style:d,children:[s,`/`,l]}),t[4]=s,t[5]=l,t[6]=p):p=t[6];let m;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`calls graded this week`}),t[7]=m):m=t[7];let h;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(h=w(250),t[8]=h):h=t[8];let g;t[9]===r?g=t[10]:(g=r.map(k),t[9]=r,t[10]=g);let _;t[11]===g?_=t[12]:(_=(0,b.jsx)(`div`,{className:`rw-chips rw-child`,style:h,role:`list`,children:g}),t[11]=g,t[12]=_);let v;t[13]===a?v=t[14]:(v=a&&(0,b.jsxs)(`p`,{className:`rw-quote rw-child`,style:w(330),children:[`“`,a.expected,a.note?` — ${a.note}`:``,`”`,(0,b.jsx)(`span`,{className:`rw-quote-attr`,children:a.dashboardTitle})]}),t[13]=a,t[14]=v);let y;return t[15]!==v||t[16]!==p||t[17]!==_?(y=(0,b.jsxs)(b.Fragment,{children:[u,p,m,_,v]}),t[15]=v,t[16]=p,t[17]=_,t[18]=y):y=t[18],y}function k(e,t){let{grade:n}=e;return(0,b.jsx)(`span`,{className:`rw-chip rw-chip--${n.result}`,role:`listitem`,title:n.expected,children:D[n.result]},`${n.at}-${t}`)}function te(e){let t=(0,f.c)(12),{rewind:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={duration:1400},t[0]=r):r=t[0];let a=i(n.estSavedPerMonth,r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,b.jsx)(`p`,{className:`rw-eyebrow rw-child`,style:w(20),children:`If you keep this up`}),t[1]=o):o=t[1];let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=w(90),t[2]=s):s=t[2];let c;t[3]===a?c=t[4]:(c=(0,b.jsx)(`p`,{className:`rw-figure rw-child`,style:s,children:a}),t[3]=a,t[4]=c);let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,b.jsx)(`p`,{className:`rw-figure-label rw-child`,style:w(170),children:`searches saved / month`}),t[5]=l):l=t[5];let u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=w(250),t[6]=u):u=t[6];let d;t[7]===n.estSavedPerMonth?d=t[8]:(d=(0,b.jsxs)(`p`,{className:`rw-caption rw-child`,style:u,children:[`Applying Mavéa's suggestions this week is projected to save about `,n.estSavedPerMonth,` `,`searches a month — a rate estimate from real cadence changes, not a count of searches actually skipped this week.`]}),t[7]=n.estSavedPerMonth,t[8]=d);let p;return t[9]!==c||t[10]!==d?(p=(0,b.jsxs)(b.Fragment,{children:[o,c,l,d]}),t[9]=c,t[10]=d,t[11]=p):p=t[11],p}function ne(){let e=(0,f.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,b.jsx)(`p`,{className:`rw-fallback-text rw-child`,style:w(40),children:`Nothing to look back on yet — come back after a week of checks.`}),e[0]=t):t=e[0],t}function A(e){let t=(0,f.c)(70),{onClose:n}=e,i=(0,d.useRef)(null),s;t[0]===n?s=t[1]:(s={onEscape:n},t[0]=n,t[1]=s),r(i,s);let[l]=(0,d.useState)(ie),u=c(),p=a(),m;t[2]!==u||t[3]!==l?(m=o(u,l),t[2]=u,t[3]=l,t[4]=m):m=t[4];let x=m,S;t[5]!==p||t[6]!==l?(S=h(p,l),t[5]=p,t[6]=l,t[7]=S):S=t[7];let C=S,w;t[8]!==p||t[9]!==l?(w=g(p,l),t[8]=p,t[9]=l,t[10]=w):w=t[10];let E=w,D;t[11]!==p||t[12]!==l?(D=_(p,l),t[11]=p,t[12]=l,t[13]=D):D=t[13];let k=D,A;t[14]!==x||t[15]!==C?(A=v(x,C),t[14]=x,t[15]=C,t[16]=A):A=t[16];let j=A,M;t[17]===j?M=t[18]:(M=y(j),t[17]=j,t[18]=M);let N=M,[P,F]=(0,d.useState)(0),I,L;t[19]===N.length?(I=t[20],L=t[21]):(I=()=>{F(e=>Math.min(e,N.length-1))},L=[N.length],t[19]=N.length,t[20]=I,t[21]=L),(0,d.useEffect)(I,L);let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>F(re),t[22]=R):R=t[22];let z=R,B;t[23]===N.length?B=t[24]:(B=()=>F(e=>Math.min(N.length-1,e+1)),t[23]=N.length,t[24]=B);let V=B,H;t[25]===V?H=t[26]:(H=e=>{e.key===`ArrowRight`||e.key===` `?(e.preventDefault(),V()):e.key===`ArrowLeft`&&(e.preventDefault(),z())},t[25]=V,t[26]=H);let U=H,W=N.length>1,G;t[27]!==W||t[28]!==P||t[29]!==N.length?(G=W&&(0,b.jsxs)(`span`,{className:`rw-counter`,"aria-live":`polite`,children:[P+1,` of `,N.length]}),t[27]=W,t[28]=P,t[29]=N.length,t[30]=G):G=t[30];let K;t[31]===n?K=t[32]:(K=(0,b.jsx)(`button`,{type:`button`,className:`rw-close`,onClick:n,"aria-label":`Close`,children:`×`}),t[31]=n,t[32]=K);let q;t[33]!==G||t[34]!==K?(q=(0,b.jsxs)(`div`,{className:`rw-chrome`,children:[G,K]}),t[33]=G,t[34]=K,t[35]=q):q=t[35];let J;t[36]!==W||t[37]!==P?(J=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--prev`,"aria-label":`Previous slide`,onClick:z,disabled:P===0}),t[36]=W,t[37]=P,t[38]=J):J=t[38];let Y;if(t[39]!==E||t[40]!==P||t[41]!==k||t[42]!==x||t[43]!==N||t[44]!==C){let e;t[46]!==E||t[47]!==P||t[48]!==k||t[49]!==x||t[50]!==C?(e=(e,t)=>(0,b.jsxs)(`div`,{className:`rw-slide`,"data-active":t===P||void 0,children:[e===`searches`&&(0,b.jsx)(T,{rewind:x}),e===`moment`&&(0,b.jsx)(ee,{rewind:x}),e===`calls`&&(0,b.jsx)(O,{tally:C,grades:E,quote:k}),e===`saved`&&(0,b.jsx)(te,{rewind:x}),e===`fallback`&&(0,b.jsx)(ne,{})]},e),t[46]=E,t[47]=P,t[48]=k,t[49]=x,t[50]=C,t[51]=e):e=t[51],Y=N.map(e),t[39]=E,t[40]=P,t[41]=k,t[42]=x,t[43]=N,t[44]=C,t[45]=Y}else Y=t[45];let X;t[52]!==W||t[53]!==V||t[54]!==P||t[55]!==N.length?(X=W&&(0,b.jsx)(`button`,{type:`button`,className:`rw-zone rw-zone--next`,"aria-label":`Next slide`,onClick:V,disabled:P===N.length-1}),t[52]=W,t[53]=V,t[54]=P,t[55]=N.length,t[56]=X):X=t[56];let Z;t[57]!==J||t[58]!==Y||t[59]!==X?(Z=(0,b.jsxs)(`div`,{className:`rw-stage`,children:[J,Y,X]}),t[57]=J,t[58]=Y,t[59]=X,t[60]=Z):Z=t[60];let Q;t[61]!==W||t[62]!==P||t[63]!==N?(Q=W&&(0,b.jsx)(`div`,{className:`rw-dots`,children:N.map((e,t)=>(0,b.jsx)(`button`,{type:`button`,className:`rw-dot`,"data-active":t===P||void 0,"aria-label":`Go to slide ${t+1} of ${N.length}`,onClick:()=>F(t)},e))}),t[61]=W,t[62]=P,t[63]=N,t[64]=Q):Q=t[64];let $;return t[65]!==U||t[66]!==q||t[67]!==Z||t[68]!==Q?($=(0,b.jsxs)(`div`,{className:`rw-overlay`,ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Weekly Rewind`,tabIndex:-1,onKeyDown:U,children:[q,Z,Q]}),t[65]=U,t[66]=q,t[67]=Z,t[68]=Q,t[69]=$):$=t[69],$}function re(e){return Math.max(0,e-1)}function ie(){return Date.now()}export{A as RewindOverlay};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RippleOverlay-Cfu3ZVL1.js","assets/index-DWHIOldG.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/useSpatialCanvas-D3nfHkST.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/cache-BumECILO.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/githubToken-DtcLYqwm.js","assets/keyVault-DEsNh9FR.js","assets/useFocusTrap-DbfG6zbM.js","assets/RippleOverlay-_iiZsQVZ.css","assets/useLiveConfig-Cc4IKgOd.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/kokoro-Da60jB7C.js","assets/spokenText-D4zPX9JY.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./lazyRetry-D50B1UMY.js";import{I as r,J as i,M as a,N as o,k as s,o as c,q as l}from"./index-DWHIOldG.js";import{t as u}from"./homeTarget-BcZYH3DY.js";var d=e(),f=t();i();var p=r(()=>l(()=>import(`./RippleOverlay-Cfu3ZVL1.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),m=p.Component,h=n(()=>l(()=>import(`./seed-b1xc0dj2.js`),[]));function g(){(0,d.useEffect)(()=>a(o()),[]);let[e,t]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0;return p.preload().catch(()=>{}),h().then(({SEED_SHIP:n})=>{e&&t(n)}),()=>{e=!1}},[]);let[n,r]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0,t=window.setTimeout(()=>{l(async()=>{let{getLiveConfigV2:e,toModelConfig:t}=await import(`./useLiveConfig-Cc4IKgOd.js`).then(e=>e.d);return{getLiveConfigV2:e,toModelConfig:t}},__vite__mapDeps([17,2,1,3,4,5,6,18,19,20,14])).then(({getLiveConfigV2:t,toModelConfig:n})=>{if(!e)return;let i=n(t());r(i.apiKey?i:null)})},250);return()=>{e=!1,window.clearTimeout(t)}},[]);let i=(0,d.useCallback)(e=>{l(()=>import(`./kokoro-Da60jB7C.js`).then(e=>e.y).then(t=>t.speak(e,`mavea`)),__vite__mapDeps([21,2,1,3,4,5,6,22]))},[]);return e?(0,f.jsx)(s,{label:`Ripple overview`,children:(0,f.jsx)(m,{model:e,cfg:n,speak:i,onClose:()=>{window.location.hash=u().href}})}):(0,f.jsx)(c,{})}export{g as RippleApp};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RippleOverlay-SCrXZTqz.js","assets/index-CWqRe4-B.js","assets/chunk-BVpWp9h4.js","assets/jsx-runtime-DaSxXjOY.js","assets/react-BQSORdFI.js","assets/lazyRetry-D50B1UMY.js","assets/index-CepQEz75.css","assets/useSpatialCanvas-CEXy6ZC2.js","assets/FeatureUseNotice-CoK5HkbR.js","assets/FeatureUseNotice-CsCxxfOl.css","assets/cache-BumECILO.js","assets/colors-D49Req-e.js","assets/courseStore-DfafnL-9.js","assets/githubToken-DtcLYqwm.js","assets/keyVault-DEsNh9FR.js","assets/useFocusTrap-DbfG6zbM.js","assets/RippleOverlay-_iiZsQVZ.css","assets/useLiveConfig-vMyjo2gV.js","assets/providers-wzm7E8Pa.js","assets/http-CJCtjYpA.js","assets/info-CiqHR5cs.js","assets/kokoro-B-3GqktX.js","assets/spokenText-D4zPX9JY.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{t as n}from"./lazyRetry-D50B1UMY.js";import{I as r,J as i,M as a,N as o,k as s,o as c,q as l}from"./index-CWqRe4-B.js";import{t as u}from"./homeTarget-BcZYH3DY.js";var d=e(),f=t();i();var p=r(()=>l(()=>import(`./RippleOverlay-SCrXZTqz.js`).then(e=>({default:e.RippleOverlay})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),m=p.Component,h=n(()=>l(()=>import(`./seed-b1xc0dj2.js`),[]));function g(){(0,d.useEffect)(()=>a(o()),[]);let[e,t]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0;return p.preload().catch(()=>{}),h().then(({SEED_SHIP:n})=>{e&&t(n)}),()=>{e=!1}},[]);let[n,r]=(0,d.useState)(null);(0,d.useEffect)(()=>{let e=!0,t=window.setTimeout(()=>{l(async()=>{let{getLiveConfigV2:e,toModelConfig:t}=await import(`./useLiveConfig-vMyjo2gV.js`).then(e=>e.d);return{getLiveConfigV2:e,toModelConfig:t}},__vite__mapDeps([17,2,1,3,4,5,6,18,19,20,14])).then(({getLiveConfigV2:t,toModelConfig:n})=>{if(!e)return;let i=n(t());r(i.apiKey?i:null)})},250);return()=>{e=!1,window.clearTimeout(t)}},[]);let i=(0,d.useCallback)(e=>{l(()=>import(`./kokoro-B-3GqktX.js`).then(e=>e.y).then(t=>t.speak(e,`mavea`)),__vite__mapDeps([21,2,1,3,4,5,6,22]))},[]);return e?(0,f.jsx)(s,{label:`Ripple overview`,children:(0,f.jsx)(m,{model:e,cfg:n,speak:i,onClose:()=>{window.location.hash=u().href}})}):(0,f.jsx)(c,{})}export{g as RippleApp};
@@ -1,4 +1,4 @@
1
- import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-DWHIOldG.js";import{t as r}from"./providers-wzm7E8Pa.js";import{r as i}from"./githubBrowser-DywfDeYx.js";import{t as a}from"./json-B0N3XRZU.js";import{n as o}from"./verbatim-CBMzUDlf.js";import{t as s}from"./links--u_phi0x.js";var c=e(),l=n(),u=t(),d={full:{label:`grounded in the repo`,token:`var(--insight)`},partial:{label:`partly grounded`,token:`var(--warning)`},none:{label:`not covered by what Ripple has read`,token:`var(--text-muted)`}},f={newgrad:[`Explain this repo like I’m new`,`Where should I start reading?`],working:[`What’s the blast radius of this change?`,`What would I need to know to review this?`],principal:[`What’s the crux here?`,`What would a principal push back on?`]};function p(e){let t=e.file?e.file.split(`/`).pop()??e.file:`source`;return e.unpinned?`${t} · unverified`:t}function m(e){let t=(0,l.c)(26),{open:n,onClose:r,turns:i,busy:a,onAsk:o,altitude:m,hasModel:g,seed:_,repo:v,gitRef:y,focusFile:b}=e,[x,S]=(0,c.useState)(``),C=(0,c.useRef)(null),w=(0,c.useRef)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{let e=C.current;e&&(e.scrollTop=e.scrollHeight)},t[0]=T):T=t[0];let E;t[1]===i?E=t[2]:(E=[i],t[1]=i,t[2]=E),(0,c.useEffect)(T,E);let D,O;t[3]===_?(D=t[4],O=t[5]):(D=()=>{_&&(S(_.text),w.current?.focus())},O=[_],t[3]=_,t[4]=D,t[5]=O),(0,c.useEffect)(D,O);let k;t[6]!==a||t[7]!==x||t[8]!==o?(k=e=>{let t=(e??x).trim();!t||a||(o(t),S(``))},t[6]=a,t[7]=x,t[8]=o,t[9]=k):k=t[9];let A=k,j=h;if(!n)return null;let M;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,u.jsxs)(`span`,{className:`ripple-ask-title`,children:[(0,u.jsx)(`span`,{className:`ripple-ask-spark`,"aria-hidden":`true`}),`Ask`]}),t[10]=M):M=t[10];let N;t[11]===r?N=t[12]:(N=(0,u.jsxs)(`header`,{className:`ripple-ask-head`,children:[M,(0,u.jsx)(`button`,{type:`button`,className:`ripple-ask-min`,onClick:r,"aria-label":`Collapse the ask rail`,children:`✕`})]}),t[11]=r,t[12]=N);let P;t[13]!==m||t[14]!==a||t[15]!==x||t[16]!==b||t[17]!==y||t[18]!==g||t[19]!==v||t[20]!==A||t[21]!==i?(P=g?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`ripple-ask-chips`,role:`group`,"aria-label":`Suggested questions`,children:[f[m].map(e=>(0,u.jsx)(`button`,{type:`button`,className:`ripple-ask-preset`,onClick:()=>A(e),disabled:a,children:e},e)),b&&(0,u.jsxs)(`button`,{type:`button`,className:`ripple-ask-preset`,onClick:()=>A(`What breaks if I change ${b}?`),disabled:a,children:[`What breaks if I change `,b,`?`]})]}),(0,u.jsxs)(`div`,{className:`ripple-ask-thread`,ref:C,children:[i.length===0&&(0,u.jsx)(`p`,{className:`ripple-ask-empty`,children:`Ask anything about this repo or PR. The answer cites real files — and says so honestly when nothing gathered addresses it.`}),i.map(e=>(0,u.jsxs)(`div`,{className:`ripple-ask-turn`,children:[(0,u.jsx)(`p`,{className:`ripple-ask-q`,children:e.question}),e.status===`pending`&&(0,u.jsxs)(`p`,{className:`ripple-ask-pending`,children:[(0,u.jsx)(`span`,{className:`ripple-ask-dot`,"aria-hidden":`true`}),`Reading the repo…`]}),e.status===`error`&&(0,u.jsx)(`p`,{className:`ripple-ask-err`,children:e.error}),e.status===`done`&&e.answer&&(0,u.jsxs)(`div`,{className:`ripple-ask-a`,children:[(0,u.jsxs)(`span`,{className:`ripple-ask-cover`,"data-coverage":e.answer.coverage,style:{"--cover-color":d[e.answer.coverage].token},children:[(0,u.jsx)(`span`,{className:`ripple-ask-cover-dot`,"aria-hidden":`true`}),d[e.answer.coverage].label]}),e.answer.text&&(0,u.jsx)(`p`,{className:`ripple-ask-text`,children:e.answer.text}),e.answer.citations.length>0&&(0,u.jsx)(`div`,{className:`ripple-ask-cites`,role:`group`,"aria-label":`Sources`,children:e.answer.citations.map((e,t)=>{let n=e.unpinned?null:s(v,y,e.file),r=p(e),i=`${e.file}\n“${e.quote}”`;return n?(0,u.jsxs)(`a`,{className:`ripple-ask-cite`,href:n,target:`_blank`,rel:`noopener noreferrer`,title:i,children:[r,` ↗`]},`${e.file}:${t}`):(0,u.jsx)(`span`,{className:`ripple-ask-cite`,"data-unpinned":e.unpinned?`true`:void 0,title:i,children:r},`${e.file}:${t}`)})})]})]},e.id))]}),(0,u.jsxs)(`form`,{className:`ripple-ask-form`,onSubmit:e=>{e.preventDefault(),A()},children:[(0,u.jsx)(`textarea`,{ref:w,className:`ripple-ask-input`,value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),A())},rows:1,placeholder:a?`Reading the repo…`:`Ask about this repo or PR…`,"aria-label":`Ask about this repo or PR`}),(0,u.jsx)(`button`,{type:`submit`,className:`ripple-ask-send`,disabled:a||x.trim().length===0,"aria-label":`Ask`,children:`↵`})]})]}):(0,u.jsx)(`div`,{className:`ripple-ask-empty-state`,children:(0,u.jsx)(`p`,{children:`Connect a model in Settings → Live to ask questions about this repo.`})}),t[13]=m,t[14]=a,t[15]=x,t[16]=b,t[17]=y,t[18]=g,t[19]=v,t[20]=A,t[21]=i,t[22]=P):P=t[22];let F;return t[23]!==N||t[24]!==P?(F=(0,u.jsxs)(`section`,{className:`ripple-ask-rail`,"aria-label":`Ask`,onPointerDown:j,onWheel:j,onClick:j,children:[N,P]}),t[23]=N,t[24]=P,t[25]=F):F=t[25],F}function h(e){return e.stopPropagation()}var g=3,_=3e3,v=6e3,y=40,b=40,x=30,S=12,C=6;function w(e,t){return`${e}::${t}`}function T(e,t,n=new Set,r=g){let i=Array.from(new Set(t.toLowerCase().match(/[a-z0-9]{4,}/g)??[]));return i.length===0?[]:e.map((e,t)=>({p:e,i:t})).filter(({p:e})=>!n.has(e)).map(({p:e,i:t})=>{let n=e.toLowerCase();return{p:e,i:t,score:i.reduce((e,t)=>e+ +!!n.includes(t),0)}}).filter(e=>e.score>0).sort((e,t)=>t.score-e.score||e.i-t.i).slice(0,r).map(e=>e.p)}async function E(e,t){if(!e.repo||!e.treePaths?.length)return;let n=T(e.treePaths,t,new Set(e.fileCache.keys()));if(n.length===0)return;let r=await Promise.all(n.map(t=>i(t,e.gitRef,e.repo).catch(()=>({ok:!1}))));e.signal?.aborted||r.forEach((t,r)=>{t.ok&&t.content&&e.fileCache.set(n[r],t.content.slice(0,_))})}function D(e,t){let n=[],r=e.pr;return n.push(`REPO: ${r.repo}${r.title?` — ${r.title}`:``}`),r.summary&&n.push(`SUMMARY: ${r.summary}`),r.risks.length&&n.push(`RISKS:\n${r.risks.slice(0,S).map(e=>`- [${e.level}] ${e.text}`).join(`
1
+ import{t as e}from"./react-BQSORdFI.js";import{t}from"./jsx-runtime-DaSxXjOY.js";import{ht as n}from"./index-CWqRe4-B.js";import{t as r}from"./providers-wzm7E8Pa.js";import{r as i}from"./githubBrowser-DywfDeYx.js";import{t as a}from"./json-B0N3XRZU.js";import{n as o}from"./verbatim-CBMzUDlf.js";import{t as s}from"./links--u_phi0x.js";var c=e(),l=n(),u=t(),d={full:{label:`grounded in the repo`,token:`var(--insight)`},partial:{label:`partly grounded`,token:`var(--warning)`},none:{label:`not covered by what Ripple has read`,token:`var(--text-muted)`}},f={newgrad:[`Explain this repo like I’m new`,`Where should I start reading?`],working:[`What’s the blast radius of this change?`,`What would I need to know to review this?`],principal:[`What’s the crux here?`,`What would a principal push back on?`]};function p(e){let t=e.file?e.file.split(`/`).pop()??e.file:`source`;return e.unpinned?`${t} · unverified`:t}function m(e){let t=(0,l.c)(26),{open:n,onClose:r,turns:i,busy:a,onAsk:o,altitude:m,hasModel:g,seed:_,repo:v,gitRef:y,focusFile:b}=e,[x,S]=(0,c.useState)(``),C=(0,c.useRef)(null),w=(0,c.useRef)(null),T;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{let e=C.current;e&&(e.scrollTop=e.scrollHeight)},t[0]=T):T=t[0];let E;t[1]===i?E=t[2]:(E=[i],t[1]=i,t[2]=E),(0,c.useEffect)(T,E);let D,O;t[3]===_?(D=t[4],O=t[5]):(D=()=>{_&&(S(_.text),w.current?.focus())},O=[_],t[3]=_,t[4]=D,t[5]=O),(0,c.useEffect)(D,O);let k;t[6]!==a||t[7]!==x||t[8]!==o?(k=e=>{let t=(e??x).trim();!t||a||(o(t),S(``))},t[6]=a,t[7]=x,t[8]=o,t[9]=k):k=t[9];let A=k,j=h;if(!n)return null;let M;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,u.jsxs)(`span`,{className:`ripple-ask-title`,children:[(0,u.jsx)(`span`,{className:`ripple-ask-spark`,"aria-hidden":`true`}),`Ask`]}),t[10]=M):M=t[10];let N;t[11]===r?N=t[12]:(N=(0,u.jsxs)(`header`,{className:`ripple-ask-head`,children:[M,(0,u.jsx)(`button`,{type:`button`,className:`ripple-ask-min`,onClick:r,"aria-label":`Collapse the ask rail`,children:`✕`})]}),t[11]=r,t[12]=N);let P;t[13]!==m||t[14]!==a||t[15]!==x||t[16]!==b||t[17]!==y||t[18]!==g||t[19]!==v||t[20]!==A||t[21]!==i?(P=g?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`ripple-ask-chips`,role:`group`,"aria-label":`Suggested questions`,children:[f[m].map(e=>(0,u.jsx)(`button`,{type:`button`,className:`ripple-ask-preset`,onClick:()=>A(e),disabled:a,children:e},e)),b&&(0,u.jsxs)(`button`,{type:`button`,className:`ripple-ask-preset`,onClick:()=>A(`What breaks if I change ${b}?`),disabled:a,children:[`What breaks if I change `,b,`?`]})]}),(0,u.jsxs)(`div`,{className:`ripple-ask-thread`,ref:C,children:[i.length===0&&(0,u.jsx)(`p`,{className:`ripple-ask-empty`,children:`Ask anything about this repo or PR. The answer cites real files — and says so honestly when nothing gathered addresses it.`}),i.map(e=>(0,u.jsxs)(`div`,{className:`ripple-ask-turn`,children:[(0,u.jsx)(`p`,{className:`ripple-ask-q`,children:e.question}),e.status===`pending`&&(0,u.jsxs)(`p`,{className:`ripple-ask-pending`,children:[(0,u.jsx)(`span`,{className:`ripple-ask-dot`,"aria-hidden":`true`}),`Reading the repo…`]}),e.status===`error`&&(0,u.jsx)(`p`,{className:`ripple-ask-err`,children:e.error}),e.status===`done`&&e.answer&&(0,u.jsxs)(`div`,{className:`ripple-ask-a`,children:[(0,u.jsxs)(`span`,{className:`ripple-ask-cover`,"data-coverage":e.answer.coverage,style:{"--cover-color":d[e.answer.coverage].token},children:[(0,u.jsx)(`span`,{className:`ripple-ask-cover-dot`,"aria-hidden":`true`}),d[e.answer.coverage].label]}),e.answer.text&&(0,u.jsx)(`p`,{className:`ripple-ask-text`,children:e.answer.text}),e.answer.citations.length>0&&(0,u.jsx)(`div`,{className:`ripple-ask-cites`,role:`group`,"aria-label":`Sources`,children:e.answer.citations.map((e,t)=>{let n=e.unpinned?null:s(v,y,e.file),r=p(e),i=`${e.file}\n“${e.quote}”`;return n?(0,u.jsxs)(`a`,{className:`ripple-ask-cite`,href:n,target:`_blank`,rel:`noopener noreferrer`,title:i,children:[r,` ↗`]},`${e.file}:${t}`):(0,u.jsx)(`span`,{className:`ripple-ask-cite`,"data-unpinned":e.unpinned?`true`:void 0,title:i,children:r},`${e.file}:${t}`)})})]})]},e.id))]}),(0,u.jsxs)(`form`,{className:`ripple-ask-form`,onSubmit:e=>{e.preventDefault(),A()},children:[(0,u.jsx)(`textarea`,{ref:w,className:`ripple-ask-input`,value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),A())},rows:1,placeholder:a?`Reading the repo…`:`Ask about this repo or PR…`,"aria-label":`Ask about this repo or PR`}),(0,u.jsx)(`button`,{type:`submit`,className:`ripple-ask-send`,disabled:a||x.trim().length===0,"aria-label":`Ask`,children:`↵`})]})]}):(0,u.jsx)(`div`,{className:`ripple-ask-empty-state`,children:(0,u.jsx)(`p`,{children:`Connect a model in Settings → Live to ask questions about this repo.`})}),t[13]=m,t[14]=a,t[15]=x,t[16]=b,t[17]=y,t[18]=g,t[19]=v,t[20]=A,t[21]=i,t[22]=P):P=t[22];let F;return t[23]!==N||t[24]!==P?(F=(0,u.jsxs)(`section`,{className:`ripple-ask-rail`,"aria-label":`Ask`,onPointerDown:j,onWheel:j,onClick:j,children:[N,P]}),t[23]=N,t[24]=P,t[25]=F):F=t[25],F}function h(e){return e.stopPropagation()}var g=3,_=3e3,v=6e3,y=40,b=40,x=30,S=12,C=6;function w(e,t){return`${e}::${t}`}function T(e,t,n=new Set,r=g){let i=Array.from(new Set(t.toLowerCase().match(/[a-z0-9]{4,}/g)??[]));return i.length===0?[]:e.map((e,t)=>({p:e,i:t})).filter(({p:e})=>!n.has(e)).map(({p:e,i:t})=>{let n=e.toLowerCase();return{p:e,i:t,score:i.reduce((e,t)=>e+ +!!n.includes(t),0)}}).filter(e=>e.score>0).sort((e,t)=>t.score-e.score||e.i-t.i).slice(0,r).map(e=>e.p)}async function E(e,t){if(!e.repo||!e.treePaths?.length)return;let n=T(e.treePaths,t,new Set(e.fileCache.keys()));if(n.length===0)return;let r=await Promise.all(n.map(t=>i(t,e.gitRef,e.repo).catch(()=>({ok:!1}))));e.signal?.aborted||r.forEach((t,r)=>{t.ok&&t.content&&e.fileCache.set(n[r],t.content.slice(0,_))})}function D(e,t){let n=[],r=e.pr;return n.push(`REPO: ${r.repo}${r.title?` — ${r.title}`:``}`),r.summary&&n.push(`SUMMARY: ${r.summary}`),r.risks.length&&n.push(`RISKS:\n${r.risks.slice(0,S).map(e=>`- [${e.level}] ${e.text}`).join(`
2
2
  `)}`),e.changes.length&&n.push(`CHANGES (${e.changes.length}):\n${e.changes.slice(0,y).map(e=>`- ${e.file} [${e.kind}/${e.risk}]: ${e.intent}${e.why?` — ${e.why}`:``}`).join(`
3
3
  `)}`),e.nodes.length&&n.push(`SYSTEM NODES (${e.nodes.length}):\n${e.nodes.slice(0,b).map(e=>{let t=[e.contract,e.problem,e.fix].filter(Boolean).join(` | `);return`- ${e.label}${e.sub?` (${e.sub})`:``}${t?`: ${t}`:``}`}).join(`
4
4
  `)}`),e.modules.length&&n.push(`MODULES (${e.modules.length}):\n${e.modules.slice(0,x).map(e=>`- ${e.name}: ${[e.purpose,e.explain].filter(Boolean).join(` `)}`.trim()).join(`