@mavea/mavea 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/PRIVACY.md +9 -2
- package/README.md +19 -3
- package/SECURITY.md +1 -1
- package/TERMS.md +4 -2
- package/TRADEMARKS.md +3 -1
- package/bin/mavea.mjs +40 -8
- package/dist/.vite/manifest.json +886 -846
- package/dist/assets/AnnotationLayer-BRYhJ1LB.css +1 -0
- package/dist/assets/AnnotationLayer-Bh1yiSAK.js +2 -0
- package/dist/assets/{AppCommandPalette-DdOPNZ0e.js → AppCommandPalette-DS4sLY_K.js} +1 -1
- package/dist/assets/{AtlasView-DO_p0TdZ.js → AtlasView-CYZ9sfXb.js} +1 -1
- package/dist/assets/BlockEmpty-B-giiUPy.js +1 -0
- package/dist/assets/{CadenceCard-DxceyiPA.js → CadenceCard-j1V7XOxX.js} +1 -1
- package/dist/assets/{CheckLogRail-BibJTid0.js → CheckLogRail-onH7DaxW.js} +1 -1
- package/dist/assets/{CommandPalette-Bs6tpdZl.js → CommandPalette-Cz8h94Jd.js} +1 -1
- package/dist/assets/ConversationVideoStudio-adb7legp.js +1 -0
- package/dist/assets/CourseLessonReader-CkzViEij.js +2 -0
- package/dist/assets/CourseLessonReader-DNHFQOkX.css +1 -0
- package/dist/assets/{CourseRail-CUa7uIGG.css → CourseRail-BDQIWara.css} +1 -1
- package/dist/assets/{CourseRail-BQmUsG6v.js → CourseRail-DD8gtAn4.js} +1 -1
- package/dist/assets/CoursesApp-B0HFM8Al.js +2 -0
- package/dist/assets/{DashPresent-BDWgO9am.js → DashPresent-BdOJ7F9D.js} +1 -1
- package/dist/assets/DashboardDetail-Chrpi1Yk.js +2 -0
- package/dist/assets/DashboardLoopGate-B01Hpm7O.js +2 -0
- package/dist/assets/DashboardLoopRuntime-BcdZtIgH.js +1 -0
- package/dist/assets/{DashboardSettings-DJon1Q4o.js → DashboardSettings-5tn-dw6G.js} +1 -1
- package/dist/assets/DashboardsApp--jjj-GVX.js +2 -0
- package/dist/assets/DeepZoomApp-BpQbKTjc.js +37 -0
- package/dist/assets/DelegatePanel-e4y0CJsn.js +33 -0
- package/dist/assets/{DemoGallery-DrSlMsnu.js → DemoGallery-DF1ShRG4.js} +1 -1
- package/dist/assets/{DropSelect-GwIXHA5o.js → DropSelect-D3Q9Su_x.js} +1 -1
- package/dist/assets/{ExportModal-DBUjC71U.js → ExportModal-DkmyBpeN.js} +1 -1
- package/dist/assets/ExportModal-sX8MPVPW.css +1 -0
- package/dist/assets/{ExtractionPreview-D4M6eXqb.js → ExtractionPreview-C6F1q3qG.js} +2 -2
- package/dist/assets/FeatureUseNotice-CCI4mM39.js +1 -0
- package/dist/assets/{FlagshipCommandPalette-DAO849RC.js → FlagshipCommandPalette-BkjvGrKT.js} +1 -1
- package/dist/assets/{FlagshipShowcase-g2x-1c70.js → FlagshipShowcase-Dx2noFrP.js} +1 -1
- package/dist/assets/{FlashcardsApp-BUKzCr65.js → FlashcardsApp-C1TeLlkY.js} +1 -1
- package/dist/assets/GalleryApp-7oBldBKU.js +1 -0
- package/dist/assets/{HonestByDesign-DgZFEpEx.js → HonestByDesign-DlRrxgrO.js} +1 -1
- package/dist/assets/{HowItWorks-DPFpdeGE.js → HowItWorks-BM2yn2dq.js} +1 -1
- package/dist/assets/LegalApp-DPfTD0jz.js +1 -0
- package/dist/assets/{LegalMarkdownDocument-BBTHuW_M.js → LegalMarkdownDocument-DJgwmK1q.js} +1 -1
- package/dist/assets/{LegalPageShell-hMA-7JLf.js → LegalPageShell-DuIwSVSJ.js} +1 -1
- package/dist/assets/Library-CDgWdTiF.js +1 -0
- package/dist/assets/{LibraryOverlay-DSUWcUe4.js → LibraryOverlay-DsLhiJzF.js} +1 -1
- package/dist/assets/LiveApp-CEaISHEZ.css +1 -0
- package/dist/assets/LiveApp-DNYYimuo.js +79 -0
- package/dist/assets/LiveSettings-CDHQnEtF.js +6 -0
- package/dist/assets/{MindMapViewerDrawer-CKdJtHno.js → MindMapViewerDrawer-C3BgiubE.js} +1 -1
- package/dist/assets/{MindShape-B3lg_z4X.js → MindShape-DVlgSR1B.js} +1 -1
- package/dist/assets/{PinToDashboard-DpQjBLPa.js → PinToDashboard-Dd_egidB.js} +1 -1
- package/dist/assets/{PlanReview-CrTbmMAd.js → PlanReview-wOsBpofo.js} +1 -1
- package/dist/assets/PresentationDeck-BSMzp5T9.js +1 -0
- package/dist/assets/PrismApp-DbbDNVpy.js +2 -0
- package/dist/assets/{PrismAskController-C4MuB8om.js → PrismAskController-BgwijoI2.js} +1 -1
- package/dist/assets/PrismBriefingPlayer-B1_ziOwl.js +2 -0
- package/dist/assets/PrismOverlay-5ZVXu4WL.css +1 -0
- package/dist/assets/PrismOverlay-DLxvsh9l.js +105 -0
- package/dist/assets/PrismWorkbench-ZlhI7Mhw.js +1 -0
- package/dist/assets/{PrivacyApp-A2Bu6LVd.js → PrivacyApp-Ki_5bM9Z.js} +10 -3
- package/dist/assets/ReplayCard-WKBKeSKc.js +2 -0
- package/dist/assets/ReplayOverlay-PFSJv540.js +1 -0
- package/dist/assets/{RewindOverlay-BO7YgDsW.js → RewindOverlay-okltPbfw.js} +1 -1
- package/dist/assets/{RippleApp-BXt7tenS.js → RippleApp-DqVyZYKV.js} +2 -2
- package/dist/assets/{RippleAskController-BzdwYcYY.js → RippleAskController-BqnazbZ7.js} +1 -1
- package/dist/assets/{RippleOverlay-BSxubBwj.js → RippleOverlay-4McJCSV8.js} +2 -2
- package/dist/assets/{SeeDontRead-0He5hS2C.js → SeeDontRead-gARjJuF7.js} +1 -1
- package/dist/assets/ShareModal-C5HVVMtQ.js +2 -0
- package/dist/assets/{ShipCourse-Dg6kCWyH.js → ShipCourse-BUm4TKUk.js} +1 -1
- package/dist/assets/{SignatureLoop-QPwB2oNN.js → SignatureLoop-CYspJuij.js} +1 -1
- package/dist/assets/SynthesisApp-BNhF9aJ2.js +2 -0
- package/dist/assets/SynthesisOverlay-Bvwdc8uQ.js +66 -0
- package/dist/assets/TemplatePicker-DBa4lkpf.js +1 -0
- package/dist/assets/{TermsApp-zcPDYfuh.js → TermsApp-BvwDtgIz.js} +5 -3
- package/dist/assets/TopicCanvas-Cwc6-K3q.js +2 -0
- package/dist/assets/{TourPrism-DbinDupp.js → TourPrism-CCjys3-x.js} +1 -1
- package/dist/assets/{TrackerTile-CrT9u1I4.js → TrackerTile-B4j5qtop.js} +2 -2
- package/dist/assets/{TwoSurfaces-L0CDuyOZ.js → TwoSurfaces-fGm1MJrD.js} +1 -1
- package/dist/assets/WorldOverlay-CLWtwuSl.css +1 -0
- package/dist/assets/WorldOverlay-JOp1rLyU.js +2 -0
- package/dist/assets/{WowFeatures-CwBk4ZMO.js → WowFeatures-D5dJvp9W.js} +1 -1
- package/dist/assets/{ZoomDeck-DlnesweX.js → ZoomDeck-DYmkT0TA.js} +1 -1
- package/dist/assets/{alternateFinishes-Cgks49KV.js → alternateFinishes-BHcX08Hs.js} +2 -2
- package/dist/assets/annotationAuto-B8_I3PNS.js +1 -0
- package/dist/assets/annotationReel-BA8Fv9Or.js +1 -0
- package/dist/assets/audioTrack-BJ2D_nuy.js +1 -0
- package/dist/assets/{BlockEmpty-B82uCse8.js → axis-DHAV38YM.js} +1 -1
- package/dist/assets/backup-DkCsHNEE.js +1 -0
- package/dist/assets/cache-7UEbF3S6.js +1 -0
- package/dist/assets/canvas-CYrbzF43.js +1 -0
- package/dist/assets/capture-Y6Qm8zCN.js +2 -0
- package/dist/assets/{catalog-Db9GWM6N.js → catalog-CRekRbKO.js} +1 -1
- package/dist/assets/chapters-DcdG3Lu8.js +1 -0
- package/dist/assets/{codeContext-goNoLAIr.js → codeContext-CFnI3GLf.js} +1 -1
- package/dist/assets/{confirmAdd-CZ829Mbx.js → confirmAdd-D-TTCQ31.js} +1 -1
- package/dist/assets/contentVault-XKWjF2FB.js +1 -0
- package/dist/assets/{dashboardEvents-CiayRLrH.js → dashboardEvents-MzCzak6K.js} +1 -1
- package/dist/assets/{deepen-DAeHHFiI.js → deepen-FZiVqiEc.js} +1 -1
- package/dist/assets/effort-BftNJCCV.js +39 -0
- package/dist/assets/empty-D51uhW0E.js +1 -0
- package/dist/assets/explode-niun7Zqc.js +15 -0
- package/dist/assets/{format-g3dP8OI3.js → format-BkvssSOr.js} +1 -1
- package/dist/assets/{generate-COfYQFmT.js → generate-BZobrQPX.js} +1 -1
- package/dist/assets/{generateBeats-COflu5Zi.js → generateBeats-Dqtfd8HC.js} +1 -1
- package/dist/assets/generateCourse-DPL0bO3L.js +28 -0
- package/dist/assets/generateLive-B7nlaqz8.js +24 -0
- package/dist/assets/{gesture-Bouqjr3g.js → gesture-BBS5nQEi.js} +2 -2
- package/dist/assets/{githubBrowser-BDiuD9dz.js → githubBrowser-CErQprLW.js} +1 -1
- package/dist/assets/homeTarget-CDc-r2mj.js +1 -0
- package/dist/assets/http-Bqk6nJiH.js +2 -0
- package/dist/assets/index-CFE0vqqO.css +1 -0
- package/dist/assets/{index-LiHcEJt_.js → index-Db-FgYxX.js} +4 -4
- package/dist/assets/json-J4Y32_i9.js +1 -0
- package/dist/assets/kokoro-yB7iU_JU.js +1 -0
- package/dist/assets/{ledger-Cv0LBflx.js → ledger-DHS2di3l.js} +1 -1
- package/dist/assets/lens-DyGK7Owa.js +1 -0
- package/dist/assets/{lib-u95BsX_B.js → lib-Dkb5WBRc.js} +1 -1
- package/dist/assets/liveSchema-Z_39HuDI.js +125 -0
- package/dist/assets/{loader-DgMLGfAC.js → loader-Ciz6XbG-.js} +2 -2
- package/dist/assets/{model-CAewjw45.js → model-FR-9md4s.js} +1 -1
- package/dist/assets/{neighborhoods-CqECCmo8.js → neighborhoods-B56WegJs.js} +1 -1
- package/dist/assets/notes-CEloxKQ3.js +1 -0
- package/dist/assets/offers-eBNj_lSP.js +1 -0
- package/dist/assets/{openWorld-BHTJM39n.js → openWorld-B4VY6xO7.js} +1 -1
- package/dist/assets/{owners-HRBX7JN_.js → owners-CP-4Q59L.js} +1 -1
- package/dist/assets/{pen-DtEW1xf4.js → pen-UKrUHlDA.js} +1 -1
- package/dist/assets/{penStrokes-DlHnO9xE.js → penStrokes-CTC3AYiz.js} +1 -1
- package/dist/assets/{perfProbe-ezVn1mOu.js → perfProbe-DrOeB7yd.js} +1 -1
- package/dist/assets/{pin-BPGVDgnq.js → pin-C5_s4Ju5.js} +1 -1
- package/dist/assets/{planTracker-BwoKEftp.js → planTracker-BA-x4jbw.js} +1 -1
- package/dist/assets/{portal-B9DmFo6J.js → portal-TqJbr2rR.js} +1 -1
- package/dist/assets/prewarm-Bt5X_9CM.js +1 -0
- package/dist/assets/providers-CPhoN8j0.js +1 -0
- package/dist/assets/quietHours-LtXDl4-v.js +1 -0
- package/dist/assets/{ready-yBSGJubb.js → ready-_sg3IJkE.js} +1 -1
- package/dist/assets/{registry-7tKTrzeZ.js → registry-BHDUu15I.js} +1 -1
- package/dist/assets/{registry-D06LKiUk.js → registry-BPLbZIVz.js} +1 -1
- package/dist/assets/registry-BQuygaKz.js +1 -0
- package/dist/assets/registry-B_wlsfxh.js +1 -0
- package/dist/assets/{registry-Bl2qfp5V.js → registry-Bjf2Ggs6.js} +1 -1
- package/dist/assets/{registry-CE1T0z9x.js → registry-BmjYillB.js} +1 -1
- package/dist/assets/{registry-DGNSqTxE.js → registry-BodYWiga.js} +1 -1
- package/dist/assets/{registry-Bl7zAWKt.js → registry-BwlvYVHq.js} +1 -1
- package/dist/assets/{registry-BJEvFgoL.js → registry-BxkAuBx8.js} +1 -1
- package/dist/assets/{registry-BdHj_oIs.js → registry-C3bIc5Kp.js} +1 -1
- package/dist/assets/{registry-CEV5h2cu.css → registry-CIcGBgtK.css} +1 -1
- package/dist/assets/{registry-BlujNlQJ.js → registry-CfIJ9dJS.js} +1 -1
- package/dist/assets/{registry-CvylL2BN.css → registry-CmWPyj7Q.css} +1 -1
- package/dist/assets/{registry-BDXwUn3i.js → registry-CvtHBjkb.js} +1 -1
- package/dist/assets/{registry-Dd1lcXrO.js → registry-Cz5cZREW.js} +2 -2
- package/dist/assets/registry-Di1fTdpi.js +48 -0
- package/dist/assets/registry-GxnzELw0.js +1 -0
- package/dist/assets/{registry-Cgo4C0ux.js → registry-JRteQJcE.js} +1 -1
- package/dist/assets/registry-MwJlqlFZ.js +1 -0
- package/dist/assets/{registry-B53EEn8S.js → registry-YrewlFlo.js} +1 -1
- package/dist/assets/{registry-qRfnKTt4.js → registry-uiAoJKXu.js} +1 -1
- package/dist/assets/{relate-aQFFr11O.js → relate-CCma73G9.js} +1 -1
- package/dist/assets/{replay-CalqEgdW.js → replay-dMDmsTaD.js} +1 -1
- package/dist/assets/{run-CwMSPOps.js → run-BVgCc5Xi.js} +1 -1
- package/dist/assets/{run-DCQrxgHA.js → run-CW67JOGe.js} +1 -1
- package/dist/assets/{run-CuHaB8wF.js → run-DqsfL9JC.js} +1 -1
- package/dist/assets/{select-wEtBn9U6.js → select-BuqyXI8k.js} +1 -1
- package/dist/assets/sentenceCase-CLDiNB0f.js +1 -0
- package/dist/assets/shard054-CNzJxw2V.js +1 -0
- package/dist/assets/shard070-BmNyRhxw.js +1 -0
- package/dist/assets/spokenText-Dy-GZvZV.js +1 -0
- package/dist/assets/store-C9s8Bfz0.js +1 -0
- package/dist/assets/store-CgA7mKy1.js +1 -0
- package/dist/assets/store-D16dGt7I.js +1 -0
- package/dist/assets/{store-BWLbFXiY.js → store-DqOaVRLn.js} +1 -1
- package/dist/assets/store-gfPI5TVE.js +1 -0
- package/dist/assets/useDashboardLoop-Cnxmf7wU.js +5 -0
- package/dist/assets/{useDashboards-lgQnk2Al.js → useDashboards-B-EjE8FH.js} +1 -1
- package/dist/assets/{useLedger-1WVXef68.js → useLedger-D4cXEwI0.js} +1 -1
- package/dist/assets/useLiveConfig-CvOQTr0s.js +1 -0
- package/dist/assets/useStudy-70Iz4ZVn.js +1 -0
- package/dist/assets/validate-MQG0EcTD.js +4 -0
- package/dist/assets/walkSync-D6leFb_u.js +1 -0
- package/dist/fonts/LICENSE.txt +2 -0
- package/dist/fonts/PROVENANCE.md +1 -0
- package/dist/fonts/caveat-var-latin.woff2 +0 -0
- package/dist/fonts/fonts.css +10 -0
- package/dist/index.html +6 -2
- package/dist/legal/PRIVACY.md +9 -2
- package/dist/legal/SECURITY.md +1 -1
- package/dist/legal/TERMS.md +4 -2
- package/dist/legal/TRADEMARKS.md +3 -1
- package/docs/media/go-hub.jpg +0 -0
- package/docs/media/living-answer.jpg +0 -0
- package/package.json +1 -1
- package/dist/assets/AnnotationLayer-Cccb12ps.js +0 -0
- package/dist/assets/AnnotationLayer-ClU-e6qL.css +0 -1
- package/dist/assets/BriefingPlayer-74mRKyjl.js +0 -1
- package/dist/assets/ConversationVideoStudio-DMIPUCcq.js +0 -1
- package/dist/assets/CourseLessonReader-COmTQdSK.css +0 -1
- package/dist/assets/CourseLessonReader-D29Kix4f.js +0 -2
- package/dist/assets/CoursesApp-DcDsS_ZS.js +0 -2
- package/dist/assets/DashboardDetail-BrnAdWfy.js +0 -2
- package/dist/assets/DashboardLoopGate-NxMcQ4rD.js +0 -2
- package/dist/assets/DashboardLoopRuntime-Dsy9u1wa.js +0 -1
- package/dist/assets/DashboardsApp-DxyMn3x_.js +0 -2
- package/dist/assets/DeepZoomApp-nNjqoyYE.js +0 -37
- package/dist/assets/DelegatePanel-DN_ZL0j7.js +0 -33
- package/dist/assets/ExportModal-D4WpAg2c.css +0 -1
- package/dist/assets/FeatureUseNotice-Bda9jr3W.js +0 -1
- package/dist/assets/GalleryApp-ot_A7ZF-.js +0 -1
- package/dist/assets/LegalApp-C56kWdmK.js +0 -1
- package/dist/assets/Library-CVj7R6F4.js +0 -1
- package/dist/assets/LiveApp-B62EMybC.js +0 -79
- package/dist/assets/LiveApp-CziqEsOb.css +0 -1
- package/dist/assets/LiveSettings-BITIaMoT.js +0 -6
- package/dist/assets/PresentationDeck-CfYadu9V.js +0 -1
- package/dist/assets/PrismApp-bRKK_3JA.js +0 -2
- package/dist/assets/PrismBriefingPlayer-ChJj6hSS.js +0 -2
- package/dist/assets/PrismOverlay-BwnF4BEn.css +0 -1
- package/dist/assets/PrismOverlay-Pp6ZKmTc.js +0 -105
- package/dist/assets/PrismWorkbench-BCV7r4Oa.js +0 -1
- package/dist/assets/ReplayCard-B6NYiYzQ.js +0 -2
- package/dist/assets/ReplayOverlay-BJKtJ-vc.js +0 -1
- package/dist/assets/ShareModal-xYdZWJxy.js +0 -2
- package/dist/assets/SynthesisApp-DrCq6NDa.js +0 -2
- package/dist/assets/SynthesisOverlay-DCa-2Pz_.js +0 -66
- package/dist/assets/TopicCanvas-Bw4bMFpe.js +0 -2
- package/dist/assets/WorldOverlay-BcjqG1BR.js +0 -2
- package/dist/assets/WorldOverlay-D7ay5y4D.css +0 -1
- package/dist/assets/annotationAuto-B2UdfJNj.js +0 -1
- package/dist/assets/annotationReel-K2FYv-3B.js +0 -1
- package/dist/assets/backup-685QrAjt.js +0 -1
- package/dist/assets/cache-CvbSI-pr.js +0 -1
- package/dist/assets/canvas-C3O7MEA3.js +0 -1
- package/dist/assets/capture-DgJLQ_0-.js +0 -2
- package/dist/assets/chapters-CIvdCeBC.js +0 -1
- package/dist/assets/contentVault-xfUwSJ3i.js +0 -1
- package/dist/assets/effort-jJe4iMIq.js +0 -39
- package/dist/assets/empty-BO1NC9qY.js +0 -1
- package/dist/assets/explode-CPnvJiTg.js +0 -15
- package/dist/assets/friendlyAsk-BBdRZIar.js +0 -1
- package/dist/assets/generateCourse-BldPpgdh.js +0 -28
- package/dist/assets/generateLive-DGwnpIip.js +0 -24
- package/dist/assets/homeTarget-CwFsJYwb.js +0 -1
- package/dist/assets/http-Lar_UMKb.js +0 -2
- package/dist/assets/index-BIUYTk1W.css +0 -1
- package/dist/assets/json-B0N3XRZU.js +0 -1
- package/dist/assets/kokoro-DXRj0KQX.js +0 -1
- package/dist/assets/lens-ChFJD9il.js +0 -1
- package/dist/assets/liveSchema-DyfND6P2.js +0 -100
- package/dist/assets/notes-DzIAEESd.js +0 -1
- package/dist/assets/prewarm-BgUqAJbF.js +0 -1
- package/dist/assets/providers-0DthJW_I.js +0 -1
- package/dist/assets/quietHours-DyynzDyC.js +0 -1
- package/dist/assets/registry-BQzvA61G.js +0 -1
- package/dist/assets/registry-BT6ydF33.js +0 -1
- package/dist/assets/registry-CPImC7mO.js +0 -1
- package/dist/assets/registry-KRYoVMCh.js +0 -48
- package/dist/assets/registry-QbArAJKB.js +0 -1
- package/dist/assets/shard054-BoC-LNYu.js +0 -1
- package/dist/assets/shard070-Dm9m2a5U.js +0 -1
- package/dist/assets/spokenText-C88IQJ0M.js +0 -1
- package/dist/assets/store-Ba9vzL4H.js +0 -1
- package/dist/assets/store-BwyOArJl.js +0 -1
- package/dist/assets/store-D-f8ZuaK.js +0 -1
- package/dist/assets/store-ruEsXJjU.js +0 -1
- package/dist/assets/useDashboardLoop-ifcuVRo-.js +0 -5
- package/dist/assets/useLiveConfig-B4CmBiAK.js +0 -1
- package/dist/assets/useStudy-CySgE3Cx.js +0 -1
- package/dist/assets/validate-sGUCmPAs.js +0 -4
- package/dist/assets/walkSync-DBne70gg.js +0 -1
- /package/dist/assets/{BriefingPlayer-DHV4vMga.css → PrismBriefingPlayer-DHV4vMga.css} +0 -0
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{h as r,v as i}from"./attachments-BW-vki-E.js";import{t as a}from"./providers-0DthJW_I.js";import{i as o,n as s}from"./verbatim-DBTj9sPD.js";import{a as c,i as l,o as u,r as d,s as f,t as p}from"./PrismOverlay-Pp6ZKmTc.js";import{f as m}from"./pen-DtEW1xf4.js";var h=e(),g=t(),_=/[a-z0-9]{4,}/g;function v(e){return new Set(e.toLowerCase().match(_)??[])}function y(e,t){if(e.size===0||t.size===0)return 0;let n=0;for(let r of e)t.has(r)&&(n+=1);return n/(e.size+t.size-n)}function b(e,t=12){let n=new Map;for(let t of e.toLowerCase().match(_)??[])n.set(t,(n.get(t)??0)+1);return[...n.entries()].sort((e,t)=>t[1]-e[1]||(e[0]<t[0]?-1:1)).slice(0,t).map(([e])=>e)}function x(e,t=2){return e.replace(/\s+/g,` `).split(/(?<=[.!?])\s+/).map(e=>e.trim()).filter(Boolean).slice(0,t)}var S={thousand:1e3,k:1e3,million:1e6,m:1e6,billion:1e9,bn:1e9,b:1e9,trillion:0xe8d4a51000};function C(e){let t=e.toLowerCase();return t===`%`||t===`percent`||t===`pct`?`pct`:/^(week|wk|month|mo|year|yr|day)s?$/.test(t)?`time`:/^(mg|kg|µg|mcg|g|ml|l)$/.test(t)?`dose`:`count`}var w=/(\$|€|£|¥)?\s?(\d{1,3}(?:,\d{3})+|\d+)(?:\.(\d+))?\s?(thousand|million|billion|trillion|bn)?\s?(%|percent|pct|mg|kg|µg|mcg|ml|weeks?|wks?|months?|mos?|years?|yrs?|days?)?/gi;function T(e){let t=[];for(let n of e.matchAll(w)){let[e,r,i,a,o,s]=n;if(!i)continue;let c=Number(`${i.replace(/,/g,``)}${a?`.${a}`:``}`);if(!Number.isFinite(c))continue;o&&(c*=S[o.toLowerCase()]??1);let l=(r??s??``).trim(),u=r?`money`:s?C(s):`count`;t.push({value:c,unit:l,family:u,raw:e.trim()})}return t}function E(e,t){for(let n of T(e))if(!t||n.family===t)return n;return null}function D(e){let t=` ${e.toLowerCase()} `;return/\b(p[ae]diatric|children|child|adolescents?|infants?|neonat|under[\s-]?18|aged? \d{1,2})\b/.test(t)?`pediatric`:/\b(elderly|geriatric|older adults?|aged 65)\b/.test(t)?`elderly`:/\b(adults?|grown[\s-]?ups?)\b/.test(t)?`adult`:null}function O(e){let t=e.toLowerCase(),n=t.match(/\b(\d{1,3})\s?(week|wk|month|mo|year|yr|day)s?\b/);if(n)return`${n[1]}${n[2].replace(/s$/,``)}`;let r=t.match(/\bphase\s?([1-4]|i{1,3}|iv)\b/);if(r)return`phase${r[1]}`;let i=t.match(/\bby\s(20\d{2})\b/);return i?`by${i[1]}`:null}function k(e,t){let n=D(e),r=D(t);if(n&&r&&n!==r)return`population`;let i=O(e),a=O(t);return i&&a&&i!==a?`timeframe`:null}function ee(e){let t=e.slice(0,1200),n=t.match(/\b([A-Z][a-zà-ÿ]+)\s+et al\.?,?\s*(\d{4})/);if(n)return`${n[1]} et al. ${n[2]}`;let r=t.match(/\b([A-Z][a-zà-ÿ]+)\s*\(?(19|20)\d{2}\)?/);return r?`${r[1]} ${r[0].match(/\d{4}/)?.[0]??``}`.trim():``}function te(e,t={}){let{minOverlap:n=.12,topK:r=120,maxDocFraction:i=.35,crossSourceOnly:a=!0}=t,o=e.length;if(o<2)return[];let s=e.map(e=>v(e.text)),c=e.map(e=>e.source),l=new Map;s.forEach((e,t)=>{for(let n of e){let e=l.get(n);e?e.push(t):l.set(n,[t])}});let u=Math.max(6,Math.floor(o*i)),d=new Set,f=[];for(let t of l.values())if(!(t.length<2||t.length>u))for(let r=0;r<t.length;r+=1)for(let i=r+1;i<t.length;i+=1){let o=t[r],l=t[i];if(a&&c[o]===c[l])continue;let u=o<l?`${o}|${l}`:`${l}|${o}`;if(d.has(u))continue;d.add(u);let p=y(s[o],s[l]);if(p>=n){let t=e[o],n=e[l];f.push(t.id<n.id?{a:t.id,b:n.id,overlap:p}:{a:n.id,b:t.id,overlap:p})}}return f.sort((e,t)=>t.overlap-e.overlap||(e.a<t.a?-1:e.a>t.a?1:e.b<t.b?-1:1)),f.slice(0,r)}function A(e){let t=new Map,n=e=>{let n=e;for(;t.get(n)!==n;)n=t.get(n);let r=e;for(;t.get(r)!==n;){let e=t.get(r);t.set(r,n),r=e}return n},r=e=>{t.has(e)||t.set(e,e)};for(let{a:i,b:a}of e)r(i),r(a),t.set(n(i),n(a));let i=new Map;for(let e of t.keys()){let t=n(e),r=i.get(t);r?r.push(e):i.set(t,[e])}return[...i.values()].map(e=>e.slice().sort())}var j=[`pct`,`money`,`dose`,`count`];function M(e,t){let n=Math.max(1,Math.abs(e),Math.abs(t));return Math.abs(e-t)<=.005*n}function N(e,t){return t.some(t=>s(e,t))}function P(e,t,n,r,i){if(t.source===n.source)return null;let a=String(e.relation).toLowerCase();if(a!==`contradicts`&&a!==`in-tension`)return null;let o=k(t.quote,n.quote),s=(e.matchPhrase??``).trim(),c=s.length>0&&N(s,r)&&N(s,i),l,u=!1;for(let e of j){let r=E(t.quote,e),i=E(n.quote,e);if(r&&i){M(r.value,i.value)?u=!0:l={aValue:r.value,bValue:i.value,unit:r.unit||i.unit};break}}let d=!!e.comparable&&c&&!o&&!u,f=a===`contradicts`&&d?`contradicts`:`in-tension`,p;return o?p=o:!d&&!u&&a===`contradicts`&&(p=`scope`),{relation:f,comparable:d,...c?{matchPhrase:s}:{},...p?{caveat:p}:{},...l?{delta:l}:{}}}function F(e,t,n,r={}){let{minCorpus:i=3,minSurfaceForms:a=3,minCorpusForThin:o=10,thinFraction:s=.1}=r;return t<i||n<a?null:e<=0?`absent`:t>=o&&e<=Math.max(1,Math.ceil(t*s))?`thin`:null}function I(e,t){let n=new Set;for(let r of e){let e=t.get(r);e!==void 0&&n.add(e)}return n.size}function L(e,t=2){return e>=t}function R(e){if(e&&typeof e==`object`)return e;let t=String(e),n=t.indexOf(`{`);if(n<0)return null;let r=0,i=!1,a=!1;for(let e=n;e<t.length;e+=1){let o=t[e];if(i){a?a=!1:o===`\\`?a=!0:o===`"`&&(i=!1);continue}if(o===`"`)i=!0;else if(o===`{`)r+=1;else if(o===`}`&&(--r,r===0))try{return JSON.parse(t.slice(n,e+1))}catch{return null}}return null}function z(e){return typeof e==`string`?e:``}function B(e,t){if(!e)return[];let n=e[t];return Array.isArray(n)?n:[]}var V=`You compare pairs of grounded claims from different sources and return strict JSON only. You never invent a quote; a shared "matchPhrase" must be copied verbatim from the claims. When two claims measure different endpoints, populations, or timeframes you mark them "not-comparable".`;function ne(e){return`These are candidate claim pairs, each from two DIFFERENT sources in a large corpus. For each
|
|
2
|
-
pair, decide how the two claims relate on the ONE quantity they share.
|
|
3
|
-
|
|
4
|
-
Pairs:
|
|
5
|
-
${e.map((e,t)=>`[p${t}]\n A (${e.a.id}): "${e.a.quote}"\n B (${e.b.id}): "${e.b.quote}"`).join(`
|
|
6
|
-
`)}
|
|
7
|
-
|
|
8
|
-
Return ONLY a JSON object (no prose, no fences):
|
|
9
|
-
{ "pairs": [ { "id": "p0", "relation": "contradicts|in-tension|agrees|not-comparable",
|
|
10
|
-
"sharedQuantity": "the one thing both measure, e.g. 'drug efficacy'", "comparable": true,
|
|
11
|
-
"matchPhrase": "a short phrase copied VERBATIM that appears in BOTH claims' text, proving same scope",
|
|
12
|
-
"point": "for agrees only: the shared point in one sentence" } ] }
|
|
13
|
-
|
|
14
|
-
Rules:
|
|
15
|
-
- "agrees" (be generous — this is how consensus is found): the two claims make the same or a mutually
|
|
16
|
-
SUPPORTING point — e.g. both report a benefit on the same outcome, or point the same direction on a
|
|
17
|
-
shared measure — even if the specifics differ. Give the shared "point" in one sentence.
|
|
18
|
-
- "contradicts" (be strict — a false one is worse than a missed one): they DIRECTLY conflict on the
|
|
19
|
-
SAME measured quantity, same population, same timeframe. When a contradiction is at all doubtful,
|
|
20
|
-
use "in-tension" (related but pulling different ways) or "not-comparable" instead.
|
|
21
|
-
- "not-comparable": they are about genuinely different things with no shared outcome or measure.
|
|
22
|
-
- "comparable": true ONLY when the two truly measure the same thing on the same scope.
|
|
23
|
-
- "matchPhrase": copy a phrase that is present, word-for-word, in BOTH claims above (proving they talk
|
|
24
|
-
about the same scope). Omit it if there is no shared verbatim phrase.
|
|
25
|
-
- Every "id" MUST be one of the [p#] ids above.`}function H(e){let t=[D(e),O(e)].filter(Boolean);return t.length?t.join(`, `):`unspecified scope`}function re(e,t){return`Are these comparable? "${e.title}" (${H(e.quote)}) vs "${t.title}" (${H(t.quote)}) — do they measure the same endpoint, population, and timeframe?`}function U(e,t){let n=t.trim();return e===`contradicts`?n?`Sources disagree on ${n}`:`Two sources disagree`:n?`Tension over ${n}`:`Sources in tension`}async function W(e,t){let n=[];for(let r of e){let e=t.claimById.get(r.a),i=t.claimById.get(r.b);e&&i&&e.source!==i.source&&n.push({a:e,b:i,pair:r})}if(n.length===0)return{contradictions:[],agreements:[]};let r=Math.min(8192,Math.max(2048,300+n.length*100)),i;try{i=(await a(t.cfg.provider).generate({system:V,history:[],user:ne(n),maxTokens:r,temperature:0,format:null,...t.signal?{signal:t.signal}:{}},t.cfg)).raw}catch{return{contradictions:[],agreements:[]}}let o=R(i),s=o&&Array.isArray(o.pairs)?o.pairs:[],c=[],l=[],u=0,d=new Set;for(let e of s){if(!e||typeof e!=`object`)continue;let r=e,i=Number(String(r.id).replace(/^p/,``)),a=Number.isInteger(i)?n[i]:void 0;if(!a)continue;let o=[a.a.id,a.b.id].sort().join(`|`);if(d.has(o))continue;d.add(o);let s=z(r.relation).toLowerCase();if(s===`agrees`){l.push({a:a.a.id,b:a.b.id,point:z(r.point).trim()});continue}let f=P({relation:s,sharedQuantity:z(r.sharedQuantity),comparable:!!r.comparable,matchPhrase:z(r.matchPhrase)},a.a,a.b,t.corpus[a.a.source]??[],t.corpus[a.b.source]??[]);if(!f)continue;let p=z(r.sharedQuantity).trim();c.push({id:`x${u}`,theme:a.a.region,a:a.a.id,b:a.b.id,relation:f.relation,sharedQuantity:p,comparable:f.comparable,label:U(f.relation,p),seedQuestion:re(a.a,a.b),...f.matchPhrase?{matchPhrase:f.matchPhrase}:{},...f.caveat?{caveat:f.caveat}:{},...f.delta?{delta:f.delta}:{}}),u+=1}return{contradictions:c,agreements:l}}function G(e){let t=o(e);if(!t)return null;let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(?:^|[^a-z0-9])${n}(?:[^a-z0-9]|$)`)}function K(e,t){for(let n of t.surfaceForms){let t=G(n);if(t&&t.test(e))return!0}return!1}function q(e,t){let n=[];return t.forEach((t,r)=>{K(t,e)&&n.push(r)}),{coveredCount:n.length,coveringSources:n}}function J(e,t){return t===`absent`?`No coverage — ${e.label}`:`Thin coverage — ${e.label}`}function Y(e,t,n,r={}){let i=t.length,a=[];return e.forEach((e,o)=>{let{coveredCount:s}=q(e,t),c=F(s,i,e.surfaceForms.length,r);c&&a.push({id:`g${o}`,theme:n(e),facet:e,sourcesScanned:i,coveredCount:s,kind:c,searchedForms:e.surfaceForms.slice(),label:J(e,c)})}),a}function X(e){let t=Array.isArray(e)?e:[],n=[];return t.forEach((e,t)=>{if(!e||typeof e!=`object`)return;let r=e,i=typeof r.label==`string`?r.label.trim():``,a=Array.isArray(r.surfaceForms)?Array.from(new Set(r.surfaceForms.filter(e=>typeof e==`string`).map(e=>e.trim()).filter(e=>e.length>=3))):[];!i||a.length===0||n.push({id:`f${t}`,label:i,surfaceForms:a,...typeof r.rationale==`string`&&r.rationale.trim()?{rationale:r.rationale.trim()}:{}})}),n}var ie=8,ae=5e3,oe=6;function se(e){let t=e.replace(/\.[a-z0-9]+$/i,``).trim();return t.length>40?`${t.slice(0,39).trimEnd()}…`:t||`Source`}async function ce(e,t){if(t)return{att:e,pages:t.slice(),kind:`text`};try{if(r(e)){let t=await c(e);return t.pages&&t.pages.length>0?{att:e,pages:t.pages,kind:`office`}:{att:e,pages:[],kind:`image-deck`}}return i(e)?{att:e,pages:await u(e)??[],kind:`text`}:{att:e,pages:await m(e)??[],kind:`pdf`}}catch{return{att:e,pages:[],kind:`pdf`}}}async function le(e,t,n){let r=Array(e.length),i=0;return await Promise.all(Array.from({length:Math.min(t,e.length)},async()=>{for(;;){let t=i;if(i+=1,t>=e.length)return;r[t]=await n(e[t],t)}})),r}async function ue(e,t,n,r,i){try{return R((await a(e.provider).generate({system:t,history:[],user:n,maxTokens:r,temperature:0,format:null,...i?{signal:i}:{}},e)).raw)}catch{return null}}async function de(e,t,n,r,i){try{let o=await a(e.provider).generate({system:t,history:[],user:n,maxTokens:r,temperature:0,format:null,...i?{signal:i}:{}},e);return typeof o.raw==`string`?o.raw:JSON.stringify(o.raw)}catch{return``}}var fe=`You organize a corpus of sources into a small set of themes and list the facets a complete treatment would cover, returning strict JSON only. You never claim a facet is present or absent — you only name what to expect and the words it would appear under.`;function pe(e){let t=e.map((e,t)=>`[${t}] ${e.label}\n terms: ${e.terms.join(`, `)}\n "${e.lead.join(` `)}"`).join(`
|
|
26
|
-
`);return`Below are short digests of ${e.length} sources in one corpus (top terms + a lead line each).
|
|
27
|
-
|
|
28
|
-
${t}
|
|
29
|
-
|
|
30
|
-
Return ONLY a JSON object (no prose, no fences):
|
|
31
|
-
{
|
|
32
|
-
"themes": ["Efficacy", "Safety", "Cost", "Adoption"],
|
|
33
|
-
"facets": [ { "label": "Pediatric population", "theme": "Safety",
|
|
34
|
-
"surfaceForms": ["pediatric","paediatric","children","under 18"], "rationale": "why a full treatment would cover it" } ]
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
Rules:
|
|
38
|
-
- "themes": 3-7 broad topics that span the corpus (NOT one per source) — the map's regions.
|
|
39
|
-
- "facets": the sub-topics a COMPLETE treatment of these themes would address. For each, give 3-8
|
|
40
|
-
surface forms — the exact words/synonyms it would appear under IF a source covered it (so absence can
|
|
41
|
-
be checked literally). "theme" must be one of "themes". Do NOT say whether any source covers it.
|
|
42
|
-
- Base everything on the digests above — do not invent facets unrelated to this corpus.`}var me=`You extract grounded, verbatim-quoted claims from sources and tag each with a theme, returning strict JSON only. Every quote must be copied character-for-character from the source text.`;function he(e,t,n){let r=e.reduce((e,t)=>e+t.length,0),i=e.map((e,n)=>({i:n,t:e,s:ge(e,t)})),a=r<=n?i:i.slice().sort((e,t)=>t.s-e.s||e.i-t.i),o=[],s=0;for(let e of a)if(o.push({i:e.i,t:e.t}),s+=e.t.length,s>=n&&o.length>=2)break;return o.sort((e,t)=>e.i-t.i).map(e=>`[p.${e.i+1}]\n${e.t.slice(0,Math.max(400,Math.round(n/o.length)))}`).join(`
|
|
43
|
-
|
|
44
|
-
`)}function ge(e,t){let n=e.toLowerCase(),r=0;for(let e of t)n.includes(e)&&(r+=1);return r}function _e(e,t){let n=e.map(e=>`=== source ${e.source} — ${e.label} ===\n${e.slice}`).join(`
|
|
45
|
-
|
|
46
|
-
`);return`Themes for this corpus (tag every claim with exactly one): ${t.join(` | `)}
|
|
47
|
-
|
|
48
|
-
Extract the most important claims from each source below. Copy each "quote" VERBATIM from that source's
|
|
49
|
-
text (it is verified word-for-word — anything not found is dropped). Cite the "page" from its [p.N]
|
|
50
|
-
marker, and the "source" number from its heading.
|
|
51
|
-
|
|
52
|
-
${n}
|
|
53
|
-
|
|
54
|
-
Return ONLY a JSON object (no prose, no fences):
|
|
55
|
-
{ "claims": [ { "source": 0, "quote": "verbatim phrase (6-160 chars)", "page": 3,
|
|
56
|
-
"theme": "one of the themes above", "kind": "forecast|stat|finding|risk|definition|method|diagram",
|
|
57
|
-
"title": "a 3-7 word headline", "role": "load-bearing|supporting|context",
|
|
58
|
-
"ask": "a short follow-up question" } ] }
|
|
59
|
-
|
|
60
|
-
Rules:
|
|
61
|
-
- Copy quotes character-for-character from the text above; never paraphrase or round.
|
|
62
|
-
- "theme" MUST be one of: ${t.join(`, `)}.
|
|
63
|
-
- Extract 6-12 DISTINCT claims from EACH source — cover its different facets (definition, mechanism,
|
|
64
|
-
specific findings and numbers, health effects, risks, evidence quality), not just the opening lines.
|
|
65
|
-
Favor specific, checkable statements — especially ones with a number, a finding, or a direct claim
|
|
66
|
-
another source might agree or disagree with. Mark only a few "load-bearing".`}var ve=new Set([`forecast`,`stat`,`finding`,`risk`,`definition`,`method`,`diagram`]),ye=new Set([`load-bearing`,`supporting`,`context`]);function be(e){let t=z(e).toLowerCase();return ve.has(t)?t:`finding`}function xe(e){let t=z(e).toLowerCase().trim();return ye.has(t)?t:`supporting`}function Z(e){let t=z(e.quote),n=Number(e.page),r=Number(e.source);return!t||!Number.isInteger(n)||!Number.isInteger(r)?null:{source:r,quote:t,page:n,theme:z(e.theme).trim(),kind:be(e.kind),title:z(e.title).trim()||t.slice(0,40),role:xe(e.role),ask:z(e.ask).trim()||`What does this mean?`}}function Se(e){let t=R(e),n=t&&Array.isArray(t.claims)?t.claims:null;if(n&&n.length){let e=n.filter(e=>!!e&&typeof e==`object`).map(Z).filter(e=>e!==null);if(e.length)return e}return Ce(e)}function Ce(e){let t=[];for(let n=0;n<e.length;n+=1){if(e[n]!==`{`)continue;let r=0,i=!1,a=!1,o=-1;for(let t=n;t<e.length;t+=1){let n=e[t];if(i){a?a=!1:n===`\\`?a=!0:n===`"`&&(i=!1);continue}if(n===`"`)i=!0;else if(n===`{`)r+=1;else if(n===`}`&&(--r,r===0)){o=t;break}}if(o<0)break;let s=e.slice(n,o+1);if(s.includes(`"quote"`))try{let e=Z(JSON.parse(s));e&&(t.push(e),n=o)}catch{}}return t}function we(e,t){let n=[];for(let r=0;r<e.length;r+=Math.max(1,t))n.push(e.slice(r,r+t));return n}async function Te(e,t,n,r={}){let{pagesOverride:i,onProgress:a,batchSize:s=ie}=r,c=0;a?.(`Reading ${e.length} sources…`);let l=(await le(e,oe,(e,t)=>ce(e,i?.[t]))).filter(e=>e.pages.length>0);if(l.length===0)return{spec:null,error:`No readable text could be extracted from these sources.`,callCount:c,proposed:0};let u=l.map((e,t)=>({id:`s${t}`,fileName:e.att.name,kind:e.kind,pageCount:e.pages.length,label:ee(e.pages.join(` `))||se(e.att.name),...e.slideImages?{slideImages:e.slideImages}:{}})),d=l.map(e=>e.pages),p=l.map((e,t)=>{let n=e.pages.join(` `);return{label:u[t].label,terms:b(n,12),lead:x(n,2)}});a?.(`Finding themes…`);let m=Math.min(4096,Math.max(1600,900+p.length*45)),h=await ue(t,fe,pe(p),m,n);c+=1;let g=Ee(B(h,`themes`).map(z)),_=new Set(g),y=X(B(h,`facets`)),S=new Map;for(let e of B(h,`facets`))if(e&&typeof e==`object`){let t=e,n=z(t.label).trim(),r=z(t.theme).trim();n&&_.has(r)&&S.set(n,r)}let C=g[0]??`Findings`;g.length===0&&g.push(C),a?.(`Mapping claims…`);let w=v(g.join(` `)),T=l.map((e,t)=>({source:t,label:u[t].label,slice:he(e.pages,w,ae)})),E=[],D=0;for(let e of we(T,s)){let r=await de(t,me,_e(e,g),Math.min(8192,1500+e.length*850),n);c+=1;let i=Se(r);D+=i.length;for(let t of e){let e=i.filter(e=>e.source===t.source);(await f(e,d[t.source])).forEach((e,n)=>{let r=_.has(e.theme)?e.theme:C;E.push({id:`s${t.source}c${n}`,quote:e.quote,page:e.page,kind:e.kind,title:e.title,ask:e.ask,role:e.role,region:r,source:t.source})})}}if(E.length===0)return{spec:null,error:`No claims could be grounded across these sources.`,callCount:c,corpus:d,proposed:D};a?.(`Finding contradictions…`);let O=new Map(E.map(e=>[e.id,e])),k=new Map(E.map(e=>[e.id,e.source])),A=te(E.map(e=>({id:e.id,source:e.source,text:`${e.title}. ${e.quote}`}))),{contradictions:j,agreements:M}=await W(A,{claimById:O,corpus:d,cfg:t,signal:n});A.length>0&&(c+=1);let N=Oe(M,O,k,l.length),P=Y(y,d.map(e=>o(e.join(` `))),e=>S.get(e.label)??``),F=De(g,E),I=[...j.map(e=>({a:e.a,b:e.b,relation:e.relation,crossDoc:!0})),...M.map(e=>({a:e.a,b:e.b,relation:`agrees`,crossDoc:!0}))],L=new Set;for(let e of N)for(let t of e.memberClaimIds){let e=k.get(t);e!==void 0&&L.add(e)}let R={sources:u,themes:F,claims:E,threads:I,contradictions:j,gaps:P,consensus:N,counts:{contradictions:j.length,gaps:P.length,consensus:L.size},pageCount:u.reduce((e,t)=>e+t.pageCount,0)},V=u.map(()=>0);for(let e of E)V[e.source]!==void 0&&(V[e.source]+=1);return{spec:R,corpus:d,sourcesAtt:l.map(e=>e.att),callCount:c,proposed:D,debug:{facetCount:y.length,candidatePairs:A.length,agreements:M.length,claimsBySource:V}}}function Ee(e){let t=new Set,n=[];for(let r of e){let e=r.trim();if(!e)continue;let i=e.toLowerCase();if(!t.has(i)&&(t.add(i),n.push(e),n.length>=8))break}return n}function De(e,t){let n=new Map;for(let e of t){let t=n.get(e.region)??{sources:new Set,count:0};t.sources.add(e.source),t.count+=1,n.set(e.region,t)}let r=[...e,...[...n.keys()].filter(t=>!e.includes(t))],i=[];for(let e of r){let t=n.get(e);t&&i.push({id:e,name:e,sourceCount:t.sources.size,claimCount:t.count})}return i}function Oe(e,t,n,r){let i=A(e.map(e=>({a:e.a,b:e.b}))),a=[],o=0;for(let s of i){let i=I(s,n);if(!L(i))continue;let c=new Set(s),l=e.find(e=>c.has(e.a)&&c.has(e.b)&&e.point),u=t.get(s[0]);a.push({id:`c${o}`,theme:u?.region??``,proposition:l?.point||u?.title||`Sources agree`,memberClaimIds:s,sourceCount:i,corpusSize:r,...Q(s,t)}),o+=1}return a}function Q(e,t){for(let n of[`pct`,`money`,`dose`,`count`]){let r=[],i=``;for(let a of e){let e=t.get(a),o=e&&E(e.quote,n);o&&(r.push(o.value),i||=o.unit)}if(r.length>=2)return{band:{unit:i,min:Math.min(...r),max:Math.max(...r)}}}return{}}var ke=900;function Ae(e){let t=(0,g.c)(15),[n,r]=(0,h.useState)(`idle`),[i,a]=(0,h.useState)(null),[o,s]=(0,h.useState)(null),[c,l]=(0,h.useState)(null),[u,d]=(0,h.useState)(0),[f,p]=(0,h.useState)(``),[m,_]=(0,h.useState)(null),v=(0,h.useRef)(null),y=(0,h.useRef)(null),b=(0,h.useRef)(0),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{v.current?.abort(),v.current=null,y.current!==null&&(clearTimeout(y.current),y.current=null)},t[0]=x):x=t[0];let S=x,C,w;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>S,w=[S],t[1]=C,t[2]=w):(C=t[1],w=t[2]),(0,h.useEffect)(C,w);let T;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>{S(),b.current+=1,r(`idle`),a(null),s(null),l(null),d(0),p(``),_(null)},t[3]=T):T=t[3];let E=T,D;t[4]===e?D=t[5]:(D=t=>{if(!e){_(`Connect a model to synthesize a corpus.`),r(`error`);return}S();let n=b.current+=1,i=new AbortController;v.current=i,a(null),s(null),d(0),_(null),p(`Reading ${t.length} sources…`),r(`igniting`),y.current=setTimeout(()=>{b.current===n&&r(je)},ke),Te(t,e,i.signal,{onProgress:e=>{b.current===n&&p(e)}}).then(e=>{b.current===n&&(e.spec?(a(e.spec),s(e.corpus??null),l(e.sourcesAtt??null),d(e.proposed),r(`settled`)):(_(e.error??`This corpus could not be synthesized.`),r(`error`)))}).catch(e=>{b.current===n&&(i.signal.aborted||(_(e instanceof Error?e.message:`Synthesis failed.`),r(`error`)))})},t[4]=e,t[5]=D);let O=D,k;return t[6]!==o||t[7]!==m||t[8]!==n||t[9]!==u||t[10]!==c||t[11]!==i||t[12]!==f||t[13]!==O?(k={phase:n,spec:i,corpus:o,sourcesAtt:c,proposed:u,stage:f,error:m,synthesize:O,reset:E},t[6]=o,t[7]=m,t[8]=n,t[9]=u,t[10]=c,t[11]=i,t[12]=f,t[13]=O,t[14]=k):k=t[14],k}function je(e){return e===`igniting`?`blooming`:e}function Me(e){return{documents:e.sources.map(e=>({fileName:e.fileName,pageCount:e.pageCount,...e.slideImages?{slideImages:e.slideImages}:{}})),fileName:e.sources[0]?.fileName??`corpus`,pageCount:e.pageCount,claims:e.claims,regions:e.themes.map(e=>e.name),threads:e.threads}}var Ne=n(),$=[`var(--presence)`,`var(--insight)`,`var(--warning)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--danger)`];function Pe({sources:e,cfg:t,search:n,onClose:r,demo:i}){let a=Ae(t),o=i?`settled`:a.phase,s=i?i.spec:a.spec,c=i?i.corpus:a.corpus;(0,h.useEffect)(()=>{if(!i)return e&&e.length>0&&a.synthesize(e),()=>a.reset()},[e]);let[u,f]=(0,h.useState)(`all`),[m,g]=(0,h.useState)(null);(0,h.useEffect)(()=>{if(!s||s.claims.length<48)return;let e=!0;return d(s,$).then(t=>{e&&g({spec:s,result:t})}),()=>{e=!1}},[s]);let _=(0,h.useMemo)(()=>s?s.claims.length<48?l(s,$):m?.spec===s?m.result:null:null,[s,m]),v=(0,h.useMemo)(()=>s?Me(s):null,[s]),y=(0,h.useCallback)(e=>s?.sources[e]?.label??`Source ${e+1}`,[s]),b=(0,h.useMemo)(()=>i?(i.spec.sources??[]).map(e=>({name:e.fileName,mime:`text/plain`,data:``,size:0})):(a.sourcesAtt??e??[]).slice(),[i,a.sourcesAtt,e]),x={phase:o,spec:v,corpus:c,proposed:i?s?.claims.length??0:a.proposed,error:a.error,stage:a.stage},S=s&&_?{lens:u,setLens:f,counts:s.counts,contradictions:_.contradictions,gaps:_.gaps,consensus:_.consensus,sourceLabel:y}:void 0;return(0,Ne.jsx)(p,{pdf:b,cfg:i?null:t,...n?{search:n}:{},onClose:r,world:x,...S?{corpusChrome:S}:{}})}export{Pe as SynthesisOverlay};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/deepen-DAeHHFiI.js","assets/deepenStore-BWLLzLCY.js","assets/catalog-Db9GWM6N.js","assets/preload-helper-CiWYd9n-.js","assets/rolldown-runtime-DkW27tQK.js","assets/facts-BUGuVUIc.js","assets/blockTypes-DUDdP3pB.js","assets/liveSchema-DyfND6P2.js","assets/icons-gLFQTv74.js","assets/jsx-runtime-DeHZSEgm.js","assets/spokenText-C88IQJ0M.js","assets/safeImageUrl-BINWXOTz.js","assets/catalog-BHjl-1uH.js","assets/sourceHost-BV3t2XDb.js","assets/annotations-CftUUB13.js","assets/streamParse-BX0bAppQ.js","assets/providers-0DthJW_I.js","assets/http-Lar_UMKb.js","assets/info-CiqHR5cs.js","assets/attachments-BW-vki-E.js","assets/route-CMdTFx0P.js","assets/cache-CvbSI-pr.js","assets/ledger-BssK9Pv2.js","assets/select-wEtBn9U6.js","assets/shapes-BwoDrn09.js","assets/ReplayCard-B6NYiYzQ.js","assets/react-BZJXY1be.js","assets/compiler-runtime-qQQXpJgv.js","assets/preloadableLazy-MIX1ApBW.js","assets/cachedImport-DW0gP14h.js","assets/lazyRetry-D50B1UMY.js","assets/index-LiHcEJt_.js","assets/useInView-DsTvv7L_.js","assets/coreIcons-DDTChE1H.js","assets/theme-D5D55hZi.js","assets/index-BIUYTk1W.css","assets/annotationReel-K2FYv-3B.js","assets/registry-Dd1lcXrO.js","assets/svgLabel-BQMDdcT2.js","assets/fit-CMu7prjb.js","assets/ReplayCard-Cs6mzTRa.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./react-BZJXY1be.js";import{t as n}from"./compiler-runtime-qQQXpJgv.js";import{t as r}from"./jsx-runtime-DeHZSEgm.js";import{n as i,t as a}from"./preload-helper-CiWYd9n-.js";import{lt as o}from"./index-LiHcEJt_.js";import{n as s}from"./icons-gLFQTv74.js";import{i as c,n as l,r as u,t as d}from"./loader-DgMLGfAC.js";import{n as f,t as p}from"./FallbackCard-ap_4wOfj.js";import{n as m,t as h}from"./blockLabel-FogyzEQY.js";import{t as g}from"./useFocusTrap-CJmpNZv2.js";import{t as _}from"./motion-BY_Egaxm.js";import{i as v,n as y,t as b}from"./useSpatialCanvas-CfmZOXXP.js";import{a as x,i as S,n as C,o as w,s as T,t as E}from"./CanvasSkeleton-BmGjJHUQ.js";import{t as D}from"./richText-BkxJhl9N.js";import{t as O}from"./toast-BBNs2h3L.js";import{i as k,r as A}from"./format-q0LwBjID.js";import{t as j}from"./safeImageUrl-BINWXOTz.js";import{t as M}from"./useValidatedImage-BQi2c66o.js";import{a as N,n as P,o as F}from"./deepenStore-BWLLzLCY.js";import{i as I,r as L,t as ee}from"./catalog-BHjl-1uH.js";import{n as R}from"./http-Lar_UMKb.js";import{n as te}from"./lib-u95BsX_B.js";var z=t();function ne(e,t){let n=l(e),r=Array.from(n).sort().join(`,`),[i,a]=(0,z.useState)(()=>u(n)),o=(0,z.useRef)(null);return(0,z.useEffect)(()=>{if(u(n)){o.current=t,a(!0);return}o.current!==t&&(o.current=null,a(!1));let e=!0;return c(r.split(`,`)).then(()=>{e&&(o.current=t,a(!0))}),()=>{e=!1}},[r,t]),i}var B=n(),re=null,V=new WeakMap;function H(){return typeof ResizeObserver>`u`?null:(re||=new ResizeObserver(e=>{for(let t of e)V.get(t.target)?.()}),re)}function U(e,t){let n=H();return n?(V.set(e,t),n.observe(e),()=>{n.unobserve(e),V.delete(e)}):()=>{}}var W=r(),G=new Set([`hidden`,`clip`,`auto`,`scroll`]);function K(e){let t=(0,B.c)(14),{children:n,maxAspect:r,className:i}=e,a=(0,z.useRef)(null),o=(0,z.useRef)(null),[s,c]=(0,z.useState)(1),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=a.current,t=o.current;if(!e||!t)return;let n=()=>{let n=e.clientWidth;if(!n)return;let r=t.querySelectorAll(`*`),i=t.style.transform;t.style.transform=`none`;let a=[];for(let e of r){let t=getComputedStyle(e);(G.has(t.overflowX)||G.has(t.overflowY)||t.webkitLineClamp!==`none`)&&a.push(e)}let o=[];for(let e of a)o.push({el:e,o:e.style.overflow,c:e.style.webkitLineClamp}),e.style.overflow=`visible`,e.style.webkitLineClamp=`unset`;let s=t.scrollWidth;for(let e of r)e.scrollWidth>s&&(s=e.scrollWidth);for(let e of o)e.el.style.overflow=e.o,e.el.style.webkitLineClamp=e.c;if(t.style.transform=i,!s||s<=n+1){c(ie);return}let l=n/s,u=Math.max(.4,Math.floor(l*1e3)/1e3);c(e=>Math.abs(e-u)>.002?u:e)};return n(),U(e,n)},t[0]=l):l=t[0];let u;t[1]===n?u=t[2]:(u=[n],t[1]=n,t[2]=u),(0,z.useLayoutEffect)(l,u);let d=s<1,f=`fit-box`+(i?` `+i:``),p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p={contentVisibility:`auto`,containIntrinsicSize:`auto 200px`},t[3]=p):p=t[3];let m;t[4]!==s||t[5]!==r||t[6]!==d?(m=d?{transformOrigin:`top left`,transform:`scale(${s})`,width:`${100/s}%`,marginBottom:`calc(${s-1} * 100%)`,...r?{maxHeight:`calc(${r} * 100cqw)`,overflow:`hidden`}:{}}:void 0,t[4]=s,t[5]=r,t[6]=d,t[7]=m):m=t[7];let h;t[8]!==n||t[9]!==m?(h=(0,W.jsx)(`div`,{ref:o,style:m,children:n}),t[8]=n,t[9]=m,t[10]=h):h=t[10];let g;return t[11]!==f||t[12]!==h?(g=(0,W.jsx)(`div`,{ref:a,className:f,style:p,children:h}),t[11]=f,t[12]=h,t[13]=g):g=t[13],g}function ie(e){return e===1?e:1}var ae=new Set([`gridtrace`,`chronologicaltimeline`,`roadmap`,`matrix`,`sparktable`,`gantt`]),q=`mavea-bloom-mode`,J=q,Y=!0,oe=null;function se(){try{if(typeof localStorage>`u`)return Y;let e=localStorage.getItem(q);return e===`on`||e!==`off`&&Y}catch{return Y}}function X(){return oe===null&&(oe=se()),oe}function ce(e){oe=e;try{typeof localStorage<`u`&&localStorage.setItem(q,e?`on`:`off`)}catch{}try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(J))}catch{}}function le(){let[e,t]=(0,z.useState)(()=>X());return(0,z.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>t(X());return window.addEventListener(J,e),()=>window.removeEventListener(J,e)},[]),[e,(0,z.useCallback)(ce,[])]}var ue=o(),Z=260,Q=56,$={min:.2,max:3};function de(e){return e.col>=10?640:e.col>=7?500:360}function fe(e){return Math.max(1,Math.min(e,Math.round(Math.sqrt(e*1.3))))}function pe(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=[];for(let a=0;a<r;a++){let r=Z;for(let i=0;i<n;i++){let o=a*n+i;o<e.length&&(r=Math.max(r,t[o]||Z))}i[a]=r}let a=[],o=0;for(let e=0;e<r;e++)a[e]=o,o+=i[e]+Q;let s=[];for(let t=0;t<r;t++){let r=[];for(let i=0;i<n;i++){let a=t*n+i;a<e.length&&r.push(a)}t%2==1&&r.reverse(),s[t]=r}let c=s.map(t=>t.reduce((t,n)=>t+de(e[n]),0)+Math.max(0,t.length-1)*Q),l=Math.max(...c,1),u=Array(e.length);return s.forEach((t,n)=>{let r=(l-c[n])/2;for(let n of t){let t=de(e[n]);u[n]={x:r,w:t},r+=t+Q}}),{placed:e.map((e,r)=>{let o=Math.floor(r/n),s=t[r]||Z,{x:c,w:l}=u[r];return{block:e,x:c,y:a[o]+(i[o]-s)/2,w:l,h:s,cx:c+l/2,cy:a[o]+i[o]/2}}),w:l,h:Math.max(Z,o-Q)}}function me(e){if(e.length<2)return``;let t=`M ${e[0].x} ${e[0].y}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]??e[n],i=e[n],a=e[n+1],o=e[n+2]??a,s=i.x+(a.x-r.x)/6,c=i.y+(a.y-r.y)/6,l=a.x-(o.x-i.x)/6,u=a.y-(o.y-i.y)/6;t+=` C ${s} ${c} ${l} ${u} ${a.x} ${a.y}`}return t}function he(e){let t=e.props?.title;return typeof t==`string`&&t.trim()?t.trim():m(e)}function ge(e){let t=(0,B.c)(26),{data:n,onExit:r,selectedBlockIds:i}=e,a=(0,z.useRef)(null),o=i?.size??0,s=(0,z.useRef)(null),c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{s.current=a.current?.querySelector(`.cv-viewport`)??null},l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,z.useLayoutEffect)(c,l);let u;t[2]===r?u=t[3]:(u={onEscape:r,initialFocus:s},t[2]=r,t[3]=u),g(a,u);let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=[],t[4]=d):d=t[4],(0,z.useEffect)(_e,d);let f=`${n.title} — canvas`,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsx)(`span`,{className:`cv-takeover-glyph`,"aria-hidden":`true`,children:`◇`}),t[5]=p):p=t[5];let m;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,W.jsx)(`span`,{className:`cv-takeover-eyebrow`,children:`Canvas`}),t[6]=m):m=t[6];let h;t[7]===n.title?h=t[8]:(h=(0,W.jsxs)(`div`,{className:`cv-takeover-id`,children:[p,(0,W.jsxs)(`div`,{className:`cv-takeover-titles`,children:[m,(0,W.jsx)(`span`,{className:`cv-takeover-title`,children:n.title})]})]}),t[7]=n.title,t[8]=h);let _;t[9]===o?_=t[10]:(_=o>0&&(0,W.jsxs)(`span`,{className:`cv-takeover-selection`,"aria-live":`polite`,children:[o,` selected`]}),t[9]=o,t[10]=_);let v;t[11]!==r||t[12]!==o?(v=r&&(0,W.jsxs)(`button`,{type:`button`,className:`cv-takeover-close`,onClick:r,children:[o>0?(0,W.jsxs)(W.Fragment,{children:[`Ask about `,o,` →`]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`←`}),` Back to answer`]}),(0,W.jsx)(`kbd`,{"aria-hidden":`true`,children:`esc`})]}),t[11]=r,t[12]=o,t[13]=v):v=t[13];let y;t[14]!==_||t[15]!==v?(y=(0,W.jsxs)(`div`,{className:`cv-takeover-actions`,children:[_,v]}),t[14]=_,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==y||t[18]!==h?(b=(0,W.jsxs)(`header`,{className:`cv-takeover-head`,children:[h,y]}),t[17]=y,t[18]=h,t[19]=b):b=t[19];let x;t[20]===e?x=t[21]:(x=(0,W.jsx)(ve,{...e}),t[20]=e,t[21]=x);let S;return t[22]!==b||t[23]!==x||t[24]!==f?(S=(0,ue.createPortal)((0,W.jsxs)(`div`,{ref:a,className:`cv-takeover`,role:`dialog`,"aria-modal":`true`,"aria-label":f,children:[b,x]}),document.body),t[22]=b,t[23]=x,t[24]=f,t[25]=S):S=t[25],S}function _e(){let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}}function ve({blocks:e,spot:t,renderBlock:n,onAskBlock:r,selectedBlockIds:i}){let a=(0,z.useMemo)(()=>e.filter(e=>!!e.id),[e]),o=(0,z.useMemo)(()=>fe(a.length),[a.length]),s=(0,z.useRef)([]),[c,l]=(0,z.useState)([]),u=(0,z.useCallback)(()=>{let e=a.map((e,t)=>s.current[t]?.offsetHeight||Z);l(t=>t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[a]);(0,z.useLayoutEffect)(()=>{u()},[u]),(0,z.useEffect)(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>u());return s.current.forEach(t=>t&&e.observe(t)),()=>e.disconnect()},[u,a]);let{placed:d,w:m,h}=(0,z.useMemo)(()=>pe(a,c,o),[a,c,o]),g=(0,z.useMemo)(()=>({x:-28,y:-28,w:m+Q,h:h+Q}),[m,h]),x=(0,z.useMemo)(()=>me(d.map(e=>({x:e.cx,y:e.cy}))),[d]),{camera:S,transform:C,viewportRef:w,fitTo:T,zoomAtClient:E,pan:D,setCamera:O}=b({clamp:$,margin:40}),k=_(),A=(0,z.useRef)(S);A.current=S;let j=(0,z.useRef)(0),M=(0,z.useRef)(!1);(0,z.useEffect)(()=>{if(M.current)return;let e=0,t=0;e=requestAnimationFrame(()=>{t=requestAnimationFrame(()=>T(g))});let n=setTimeout(()=>T(g),360);return()=>{cancelAnimationFrame(e),cancelAnimationFrame(t),clearTimeout(n)}},[g,T]);let N=(0,z.useCallback)(e=>{let t=w.current,n=d[e];if(!t||!n)return;M.current=!0,j.current=e;let r=t.getBoundingClientRect(),i=Math.min(Math.max(A.current.scale,.85),$.max);O(y(n.cx,n.cy,i,{w:r.width,h:r.height},$))},[d,w,O]),P=(0,z.useRef)(!1);(0,z.useEffect)(()=>{if(!t){P.current&&(M.current=!1,T(g)),P.current=!1;return}let e=d.findIndex(e=>e.block.id===t);e>=0&&(P.current=!0,N(e))},[t,d,N,T,g]);let[F,I]=(0,z.useState)(!1),L=(0,z.useRef)(!1),ee=(0,z.useRef)(!1),R=(0,z.useRef)({x:0,y:0}),te=(0,z.useCallback)(e=>{e.button===0&&(e.target.closest(`.cv-node-ask, .cv-controls, a, button, input, select, textarea, [contenteditable="true"]`)||(L.current=!0,M.current=!0,ee.current=!1,I(!0),R.current={x:e.clientX,y:e.clientY},e.currentTarget.setPointerCapture(e.pointerId)))},[]),ne=(0,z.useCallback)(e=>{if(!L.current)return;let t=e.clientX-R.current.x,n=e.clientY-R.current.y;Math.abs(t)+Math.abs(n)>3&&(ee.current=!0),R.current={x:e.clientX,y:e.clientY},D(t,n)},[D]),B=(0,z.useCallback)(e=>{let t=L.current;L.current=!1,I(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}if(!t||ee.current)return;let n=w.current;if(!n||d.length===0)return;let r=n.getBoundingClientRect(),i=v(A.current,e.clientX-r.left,e.clientY-r.top),a=d.findIndex(e=>i.x>=e.x&&i.x<=e.x+e.w&&i.y>=e.y&&i.y<=e.y+e.h);a>=0&&N(a)},[d,w,N]);(0,z.useEffect)(()=>{let e=w.current;if(!e)return;let t=e=>{e.preventDefault(),M.current=!0,E(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)};return e.addEventListener(`wheel`,t,{passive:!1}),()=>e.removeEventListener(`wheel`,t)},[w,E]);let re=(0,z.useCallback)(e=>{let t=w.current;if(!t)return;let n=t.getBoundingClientRect();M.current=!0,E(e,n.left+n.width/2,n.top+n.height/2)},[w,E]),V=(0,z.useCallback)(e=>{e.key===`ArrowRight`||e.key===`ArrowDown`?(e.preventDefault(),N(Math.min(d.length-1,j.current+1))):e.key===`ArrowLeft`||e.key===`ArrowUp`?(e.preventDefault(),N(Math.max(0,j.current-1))):e.key===`Home`&&(e.preventDefault(),T(g))},[N,T,g,d.length]),H=S.scale>=.6;return(0,W.jsxs)(`div`,{className:`cv-viewport`+(F?` is-panning`:``),ref:w,role:`group`,"aria-label":`Answer canvas — this answer's cards as a board you can pan and zoom`,tabIndex:0,onPointerDown:te,onPointerMove:ne,onPointerUp:B,onPointerCancel:B,onKeyDown:V,children:[(0,W.jsxs)(`div`,{className:`cv-controls`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:()=>re(1.25),title:`Zoom in`,"aria-label":`Zoom in`,children:`+`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>re(1/1.25),title:`Zoom out`,"aria-label":`Zoom out`,children:`−`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>T(g),title:`Fit the whole canvas`,"aria-label":`Fit the whole canvas`,children:`⊡`})]}),(0,W.jsxs)(`div`,{className:`cv-world`,style:{width:m,height:h,transform:C},children:[(0,W.jsx)(`svg`,{className:`cv-thread-svg`,width:m,height:h,viewBox:`0 0 ${m} ${h}`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{className:`cv-thread`+(k?``:` cv-draw`),d:x,pathLength:1})}),d.map((e,a)=>{let o=e.block.id,c=i?.has(o)??!1;return(0,W.jsxs)(`div`,{ref:e=>{s.current[a]=e},className:`cv-node`+(c?` is-selected`:``)+(t===o?` is-spot`:``),style:{left:e.x,top:e.y,width:e.w},"data-kind":e.block.type,children:[(0,W.jsxs)(`div`,{className:`cv-node-label`,title:he(e.block),children:[(0,W.jsx)(`span`,{className:`cv-node-step`,children:a+1}),(0,W.jsx)(`span`,{className:`cv-node-title`,children:he(e.block)})]}),(0,W.jsx)(`div`,{className:`cv-node-inner`,children:(0,W.jsx)(f,{fallback:(0,W.jsx)(p,{block:e.block}),children:n(e.block)})}),r&&H&&(0,W.jsx)(`button`,{type:`button`,className:`cv-node-ask`,onClick:t=>{t.stopPropagation(),r(e.block)},children:c?`Selected`:`Ask`})]},o)})]})]})}function ye(e){let t=(0,B.c)(35),{num:n,title:r,summary:i,stat:a,delta:o,deltaDir:c,conf:l,sources:u,spotlight:d,dimmed:f,onProve:p,delay:m,children:h}=e,g=`card reveal`+(d?` spotlight`:``)+(f?` dimmed`:``),_=(m||0)+`ms`,v;t[0]===_?v=t[1]:(v={"--delay":_},t[0]=_,t[1]=v);let y=v,b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,W.jsx)(s.spark,{className:`ic`,style:{color:`var(--insight)`}}),t[2]=b):b=t[2];let x;t[3]===n?x=t[4]:(x=(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[b,`Finding `,n]}),t[3]=n,t[4]=x);let C;t[5]===r?C=t[6]:(C=(0,W.jsx)(`div`,{className:`insight-title`,children:r}),t[5]=r,t[6]=C);let w;t[7]!==o||t[8]!==c||t[9]!==a?(w=a&&(0,W.jsxs)(`div`,{className:`insight-stat`,children:[(0,W.jsx)(`span`,{className:`big tab-num`,"data-mark":`underline`,children:a}),o&&(0,W.jsxs)(`span`,{className:`delta `+(c||`up`),children:[c===`good`||c===`down`?(0,W.jsx)(s.arrowDown,{style:{width:13,height:13}}):(0,W.jsx)(s.arrowUp,{style:{width:13,height:13}}),o]})]}),t[7]=o,t[8]=c,t[9]=a,t[10]=w):w=t[10];let T;t[11]===i?T=t[12]:(T=(0,W.jsx)(`div`,{className:`insight-summary`,children:i}),t[11]=i,t[12]=T);let E;t[13]===u?E=t[14]:(E=u&&u.map(be),t[13]=u,t[14]=E);let D;t[15]===E?D=t[16]:(D=(0,W.jsx)(`div`,{className:`card-foot-l`,children:E}),t[15]=E,t[16]=D);let O;t[17]!==l||t[18]!==u?.length?(O=l&&(0,W.jsx)(S,{level:l,title:u?.length?void 0:`Best estimate from the model's knowledge — not verified`}),t[17]=l,t[18]=u?.length,t[19]=O):O=t[19];let k;t[20]!==D||t[21]!==O?(k=(0,W.jsxs)(`div`,{className:`card-foot`,children:[D,O]}),t[20]=D,t[21]=O,t[22]=k):k=t[22];let A;t[23]===p?A=t[24]:(A=p&&(0,W.jsx)(`div`,{style:{marginTop:14},children:(0,W.jsxs)(`button`,{className:`mini-btn accent`,onClick:p,children:[(0,W.jsx)(s.proof,{}),` Prove it`]})}),t[23]=p,t[24]=A);let j;return t[25]!==h||t[26]!==g||t[27]!==k||t[28]!==A||t[29]!==y||t[30]!==x||t[31]!==C||t[32]!==w||t[33]!==T?(j=(0,W.jsxs)(`div`,{className:g,style:y,children:[x,C,w,T,h,k,A]}),t[25]=h,t[26]=g,t[27]=k,t[28]=A,t[29]=y,t[30]=x,t[31]=C,t[32]=w,t[33]=T,t[34]=j):j=t[34],j}function be(e,t){return(0,W.jsx)(w,{file:e.file,loc:e.loc},t)}function xe({title:e,series:t,labels:n,unit:r=`$`,delay:i,footer:a,conf:o}){let[c,l]=(0,z.useState)(null),u={l:50,r:50,t:14,b:26},d=t.flatMap(e=>e.data),f=(d.length?Math.max(...d):1)*1.12,p=Math.min(0,...d),m=f-p||1,h=n.length,g=e=>u.l+(h>1?e/(h-1):0)*(560-u.l-u.r),_=e=>u.t+(1-(e-p)/m)*(220-u.t-u.b),v=(()=>{let e=0,n=-1/0;for(let r of t)r.data.forEach((t,r)=>{t>n&&(n=t,e=r)});return e})(),y=e=>e.map((e,t)=>`${t?`L`:`M`}${g(t).toFixed(1)} ${_(e).toFixed(1)}`).join(` `),b=e=>`${y(e)} L${g(h-1)} ${_(p)} L${g(0)} ${_(p)} Z`;return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.chart,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,W.jsxs)(`div`,{className:`chart-wrap`,children:[(0,W.jsxs)(`svg`,{viewBox:`0 0 560 220`,width:`100%`,style:{display:`block`,overflow:`visible`},onMouseLeave:()=>l(null),children:[(0,W.jsx)(`defs`,{children:t.map((e,t)=>(0,W.jsxs)(`linearGradient`,{id:`g${t}`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:e.color,stopOpacity:`0.28`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:e.color,stopOpacity:`0`})]},t))}),[.25,.5,.75].map((e,t)=>(0,W.jsx)(`line`,{x1:u.l,x2:560-u.r,y1:u.t+e*(220-u.t-u.b),y2:u.t+e*(220-u.t-u.b),stroke:`var(--grid-line)`},t)),t.map((e,t)=>(0,W.jsxs)(`g`,{children:[e.area!==!1&&(0,W.jsx)(`path`,{className:`tc-area`,d:b(e.data),fill:`url(#g${t})`}),(0,W.jsx)(`path`,{className:`tc-line`,d:y(e.data),pathLength:1,fill:`none`,stroke:e.color,strokeWidth:`2.4`,strokeLinecap:`round`,strokeLinejoin:`round`})]},t)),n.map((e,t)=>(0,W.jsx)(`rect`,{x:g(t)-560/h/2,y:0,width:560/h,height:220,fill:`transparent`,"data-mark":t===v?`circle`:void 0,onMouseEnter:()=>l(t)},t)),c!=null&&(0,W.jsxs)(`g`,{children:[(0,W.jsx)(`line`,{x1:g(c),x2:g(c),y1:u.t,y2:220-u.b,stroke:`var(--hover-line)`}),t.map((e,t)=>(0,W.jsx)(`circle`,{cx:g(c),cy:_(e.data[c]),r:`4.5`,fill:e.color,stroke:`var(--surface-default)`,strokeWidth:`2`},t))]}),n.map((e,t)=>(0,W.jsx)(`text`,{x:g(t),y:214,fontSize:`11`,textAnchor:`middle`,fill:`var(--text-muted)`,children:e},t))]}),c!=null&&(0,W.jsxs)(`div`,{className:`chart-tip`,style:{opacity:1,left:`${g(c)/560*100}%`,top:`${_(Math.max(...t.map(e=>e.data[c])))/220*100}%`},children:[(0,W.jsx)(`strong`,{children:n[c]}),t.map((e,n)=>(0,W.jsxs)(`div`,{style:{color:e.color,fontVariantNumeric:`tabular-nums`},children:[e.name,`: `,r,t[n].data[c].toLocaleString()]},n))]})]}),(0,W.jsx)(`div`,{className:`chart-legend`,children:t.map((e,t)=>(0,W.jsxs)(`span`,{className:`legend-item`,children:[(0,W.jsx)(`span`,{className:`sw`,style:{background:e.color}}),e.name]},t))}),a&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:a}),o&&(0,W.jsxs)(`div`,{className:`card-foot`,children:[(0,W.jsx)(`div`,{className:`card-foot-l`}),(0,W.jsx)(S,{level:o,title:`Best estimate from the model's knowledge — not verified`})]})]})}function Se({title:e,icon:t=`table`,iconColor:n=`var(--insight)`,rows:r,conf:i,delay:a}){let o=s[t]||s.table,c=(()=>{let e=r.findIndex(e=>e.hot);if(e>=0)return e;let t=0;return r.forEach((e,n)=>{e.pct>r[t].pct&&(t=n)}),t})();return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsx)(`div`,{className:`cat-list`,children:r.map((e,t)=>(0,W.jsxs)(`div`,{className:`cat-row`,children:[(0,W.jsxs)(`div`,{className:`cat-top`,children:[(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`span`,{className:`cat-name`,children:e.name}),e.tag&&(0,W.jsx)(`span`,{className:`cat-tag`,style:e.tagColor?{color:e.tagColor,background:`transparent`,border:`1px solid currentColor`}:void 0,children:e.tag})]}),(0,W.jsx)(`span`,{className:`tab-num`,children:e.val})]}),(0,W.jsx)(`div`,{className:`cat-bar`,children:(0,W.jsx)(`i`,{"data-mark":t===c?`circle`:void 0,style:{width:e.pct+`%`,background:e.hot?`var(--warning)`:`var(--presence)`}})})]},e.name))}),i&&(0,W.jsxs)(`div`,{className:`card-foot`,children:[(0,W.jsx)(`div`,{className:`card-foot-l`}),(0,W.jsx)(S,{level:i,title:`Best estimate from the model's knowledge — not verified`})]})]})}function Ce(e){let t=(0,B.c)(13),{title:n,events:r,delay:i,eyebrow:a}=e,o=(i||0)+`ms`,c;t[0]===o?c=t[1]:(c={"--delay":o},t[0]=o,t[1]=c);let l=c,u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,W.jsx)(s.clock,{className:`ic`,style:{color:`var(--presence-soft)`}}),t[2]=u):u=t[2];let d=a||n,f;t[3]===d?f=t[4]:(f=(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[u,` `,d]}),t[3]=d,t[4]=f);let p;t[5]===r?p=t[6]:(p=r.map(we),t[5]=r,t[6]=p);let m;t[7]===p?m=t[8]:(m=(0,W.jsx)(`div`,{className:`timeline`,children:p}),t[7]=p,t[8]=m);let h;return t[9]!==l||t[10]!==f||t[11]!==m?(h=(0,W.jsxs)(`div`,{className:`card reveal`,style:l,children:[f,m]}),t[9]=l,t[10]=f,t[11]=m,t[12]=h):h=t[12],h}function we(e,t){return(0,W.jsxs)(`div`,{className:`tl-row`,children:[(0,W.jsx)(`div`,{className:`tl-rail`,children:(0,W.jsx)(`span`,{className:`tl-dot`,"data-mark":t===0?`point`:void 0,style:{background:e.color||`var(--presence)`}})}),(0,W.jsxs)(`div`,{className:`tl-body`,children:[(0,W.jsx)(`div`,{className:`tl-time`,children:e.time}),(0,W.jsxs)(`div`,{className:`tl-title`,children:[e.title,e.tag&&(0,W.jsx)(`span`,{className:`cat-tag`,style:{marginLeft:8},children:e.tag})]}),e.detail&&(0,W.jsx)(`div`,{className:`tl-detail`,children:e.detail})]})]},t)}function Te({title:e,icon:t=`layers`,iconColor:n=`var(--presence-soft)`,items:r,delay:i}){let a=s[t]||s.layers;return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(a,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsx)(`div`,{className:`check-list`,children:r.map((e,t)=>(0,W.jsxs)(`div`,{className:`check-row`,children:[(0,W.jsx)(`span`,{className:`check-ic`,children:(0,W.jsx)(s.check,{})}),(0,W.jsx)(`span`,{"data-mark":t===0?`underline`:void 0,dangerouslySetInnerHTML:D(e)})]},t))})]})}function Ee(e){let t=(0,B.c)(26),{eyebrow:n,options:r,criteria:i,recommendation:a,delay:o}=e,c=(o||0)+`ms`,l;t[0]===c?l=t[1]:(l={"--delay":c},t[0]=c,t[1]=l);let u=l,d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,W.jsx)(s.layers,{className:`ic`,style:{color:`var(--presence-soft)`}}),t[2]=d):d=t[2];let f=n||`Side by side`,p;t[3]===f?p=t[4]:(p=(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[d,` `,f]}),t[3]=f,t[4]=p);let m=`minmax(0, 1.1fr) repeat(${r.length}, minmax(0, 1fr))`,h;t[5]===m?h=t[6]:(h={gridTemplateColumns:m},t[5]=m,t[6]=h);let g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,W.jsx)(`div`,{className:`cmp-corner`}),t[7]=g):g=t[7];let _;t[8]===r?_=t[9]:(_=r.map(De),t[8]=r,t[9]=_);let v;if(t[10]!==i||t[11]!==r){let e;t[13]===r?e=t[14]:(e=(e,t)=>(0,W.jsxs)(z.Fragment,{children:[(0,W.jsx)(`div`,{className:`cmp-crit`,children:e.label}),e.cells.map((e,t)=>(0,W.jsxs)(`div`,{className:`cmp-val`+(e.win?` win`:``)+(r[t]&&r[t].pick?` in-pick`:``),children:[e.win&&(0,W.jsx)(`span`,{className:`cmp-tick`,children:(0,W.jsx)(s.check,{style:{width:11,height:11}})}),(0,W.jsx)(`span`,{children:e.v})]},t))]},t),t[13]=r,t[14]=e),v=i.map(e),t[10]=i,t[11]=r,t[12]=v}else v=t[12];let y;t[15]!==_||t[16]!==v||t[17]!==h?(y=(0,W.jsxs)(`div`,{className:`cmp`,style:h,children:[g,_,v]}),t[15]=_,t[16]=v,t[17]=h,t[18]=y):y=t[18];let b;t[19]===a?b=t[20]:(b=a&&(0,W.jsxs)(`div`,{className:`cmp-rec`,children:[(0,W.jsx)(s.sparkle,{style:{width:16,height:16,color:`var(--insight)`,flexShrink:0}}),(0,W.jsx)(`span`,{dangerouslySetInnerHTML:D(a)})]}),t[19]=a,t[20]=b);let x;return t[21]!==y||t[22]!==b||t[23]!==u||t[24]!==p?(x=(0,W.jsxs)(`div`,{className:`card reveal`,style:u,children:[p,y,b]}),t[21]=y,t[22]=b,t[23]=u,t[24]=p,t[25]=x):x=t[25],x}function De(e,t){return(0,W.jsxs)(`div`,{className:`cmp-opt`+(e.pick?` pick`:``),"data-mark":e.pick?`circle`:void 0,children:[(0,W.jsx)(`div`,{className:`cmp-opt-name`,children:e.name}),e.sub&&(0,W.jsx)(`div`,{className:`cmp-opt-sub`,children:e.sub}),e.pick&&(0,W.jsxs)(`div`,{className:`cmp-pick`,children:[(0,W.jsx)(s.check,{style:{width:12,height:12}}),` Mavéa's pick`]})]},t)}function Oe({kicker:e,head:t,bullets:n,foot:r,eyebrow:i=`One-pager · ready to share`,delay:a}){return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.slides,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,i]}),(0,W.jsxs)(`div`,{className:`slide-card`,children:[(0,W.jsx)(`div`,{className:`slide-kicker`,children:e}),(0,W.jsx)(`div`,{className:`slide-head`,children:t}),(0,W.jsx)(`div`,{className:`slide-bullets`,children:n.map((e,t)=>(0,W.jsxs)(`div`,{className:`slide-bullet`,children:[(0,W.jsx)(`span`,{className:`bdot`,"data-mark":t===0?`circle`:void 0,style:{background:e.color||`var(--presence)`}}),(0,W.jsx)(`span`,{dangerouslySetInnerHTML:D(e.text)})]},t))}),(0,W.jsxs)(`div`,{className:`slide-foot`,children:[(0,W.jsx)(`span`,{children:r||`Made by Mavéa · from your files`}),(0,W.jsx)(`span`,{children:`June 2026`})]})]}),(0,W.jsxs)(`div`,{className:`action-btns`,style:{marginTop:16},children:[(0,W.jsxs)(`button`,{className:`btn-ghost`,onClick:()=>O(`Tell Mavéa what to change — it'll redo the one-pager`,`info`),children:[(0,W.jsx)(s.edit,{style:{width:15,height:15}}),` Edit`]}),(0,W.jsx)(`button`,{className:`btn-ghost`,onClick:()=>O(`Simplified — fewer words, bigger takeaways`,`good`),children:`Make it simpler`}),(0,W.jsxs)(`button`,{className:`btn-primary`,style:{flex:`0 0 auto`,padding:`0 20px`},onClick:()=>window.print(),title:`Export this canvas to PDF`,children:[(0,W.jsx)(s.export,{style:{width:16,height:16}}),` Export`]})]})]})}function ke(e,t){return t||(e?e.startsWith(`calendar.`)?`Adds one event to your calendar. No invites are sent.`:e.startsWith(`github.`)?`Opens a draft PR. It won't merge until you review and approve it on GitHub.`:`Mavéa needs your OK before it does anything. Nothing happens until you confirm.`:`Mavéa needs your OK before it does anything. Nothing happens until you confirm.`)}function Ae({delay:e,onConfirm:t,eyebrow:n=`Action`,icon:r=`mail`,title:i=`Run this action`,lines:a,perm:o,cta:c=`Confirm`,doneText:l=`Done`,mcpId:u,fields:d}){let[f,p]=(0,z.useState)(`idle`),[m,h]=(0,z.useState)(()=>Object.fromEntries((d??[]).map(e=>[e.param,e.value]))),[g,_]=(0,z.useState)(``),v=(0,z.useRef)(void 0);(0,z.useEffect)(()=>()=>clearTimeout(v.current),[]);let y=s[r]||s.mail,b=ke(u,o),x=async()=>{p(`running`),await new Promise(e=>{v.current=setTimeout(e,1400)}),p(`done`),t?.()};return(0,W.jsxs)(`div`,{className:`card action-card reveal`,style:{"--delay":(e||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(y,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,n]}),(0,W.jsx)(`div`,{className:`insight-title`,style:{fontSize:17},children:i}),f!==`editing`&&a&&a.length>0&&(0,W.jsx)(`div`,{className:`action-preview`,children:a.map((e,t)=>(0,W.jsxs)(`div`,{style:{marginTop:t?6:0},children:[(0,W.jsx)(`span`,{className:`to`,children:e.k}),` · `,e.v]},t))}),f===`editing`&&d&&d.length>0&&(0,W.jsx)(`div`,{className:`action-edit-fields`,children:d.map(e=>(0,W.jsxs)(`div`,{className:`action-edit-field`,children:[(0,W.jsx)(`label`,{className:`action-edit-label`,children:e.label}),e.multiline?(0,W.jsx)(`textarea`,{className:`action-edit-input action-edit-textarea`,value:m[e.param]??``,onChange:t=>h(n=>({...n,[e.param]:t.target.value})),rows:4}):(0,W.jsx)(`input`,{className:`action-edit-input`,type:`text`,value:m[e.param]??``,onChange:t=>h(n=>({...n,[e.param]:t.target.value}))})]},e.param))}),f!==`editing`&&(0,W.jsxs)(`div`,{className:`perm`,children:[(0,W.jsx)(s.lock,{}),` `,b]}),f===`done`&&(0,W.jsxs)(`button`,{type:`button`,onClick:t,disabled:!t,style:{display:`flex`,alignItems:`center`,gap:8,color:`var(--insight)`,fontWeight:600,fontSize:14,marginTop:6,background:`none`,border:0,padding:0,textAlign:`left`,cursor:t?`pointer`:`default`},children:[(0,W.jsx)(s.check,{style:{width:18,height:18}}),` `,l,t&&(0,W.jsx)(`span`,{className:`open-app-hint`,children:`· open ↗`})]}),f===`error`&&(0,W.jsxs)(`div`,{className:`action-error`,children:[(0,W.jsx)(`span`,{className:`action-error-msg`,children:g}),(0,W.jsx)(`button`,{className:`btn-ghost`,style:{marginLeft:12},onClick:()=>{p(`idle`),_(``)},children:`Retry`})]}),f===`idle`&&(0,W.jsxs)(`div`,{className:`action-btns`,children:[(0,W.jsxs)(`button`,{className:`btn-primary`,onClick:x,children:[(0,W.jsx)(s.check,{style:{width:16,height:16}}),` `,c]}),d&&d.length>0&&(0,W.jsx)(`button`,{className:`btn-ghost`,onClick:()=>p(`editing`),children:`Edit first`})]}),f===`editing`&&(0,W.jsxs)(`div`,{className:`action-btns`,children:[(0,W.jsxs)(`button`,{className:`btn-primary`,onClick:()=>x(),children:[(0,W.jsx)(s.check,{style:{width:16,height:16}}),` Confirm`]}),(0,W.jsx)(`button`,{className:`btn-ghost`,onClick:()=>p(`idle`),children:`Cancel`})]}),f===`running`&&(0,W.jsx)(`div`,{className:`action-btns`,children:(0,W.jsxs)(`button`,{className:`btn-primary`,disabled:!0,children:[(0,W.jsx)(`span`,{className:`tiny-spin`}),` Working…`]})})]})}function je({title:e,icon:t=`spark`,iconColor:n=`var(--insight)`,rings:r,footer:i,delay:a}){let o=s[t]||s.spark,c=`rs`+(0,z.useId)().replace(/:/g,``),l=2*Math.PI*52;return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsx)(`div`,{className:`ring-row`,children:r.map((e,t)=>{let n=Math.max(0,Math.min(1,e.pct)),r=e.color||`var(--presence)`;return(0,W.jsxs)(`div`,{className:`ring-item`,children:[(0,W.jsxs)(`svg`,{viewBox:`0 0 130 130`,className:`ring-svg`,children:[(0,W.jsxs)(`defs`,{children:[(0,W.jsxs)(`linearGradient`,{id:`${c}g${t}`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:r,stopOpacity:`0.65`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:r})]}),(0,W.jsxs)(`filter`,{id:`${c}f${t}`,x:`-40%`,y:`-40%`,width:`180%`,height:`180%`,children:[(0,W.jsx)(`feGaussianBlur`,{stdDeviation:`3`,result:`b`}),(0,W.jsxs)(`feMerge`,{children:[(0,W.jsx)(`feMergeNode`,{in:`b`}),(0,W.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]})]}),(0,W.jsx)(`circle`,{cx:`65`,cy:`65`,r:52,fill:`none`,stroke:`var(--track)`,strokeWidth:`11`}),(0,W.jsx)(`circle`,{cx:`65`,cy:`65`,r:52,fill:`none`,stroke:`url(#${c}g${t})`,strokeWidth:`11`,strokeLinecap:`round`,strokeDasharray:l,strokeDashoffset:l*(1-n),filter:`url(#${c}f${t})`,transform:`rotate(-90 65 65)`,className:`ring-arc`,"data-mark":t===0?`circle`:void 0}),(()=>{let t=String(e.display??``),n=t.length,r=Math.max(9,Math.min(25,Math.round(155/Math.max(1,n)))),i=n>10;return(0,W.jsx)(`text`,{x:`65`,y:e.unit?61:70,textAnchor:`middle`,className:`ring-val`,style:{fontSize:r},...i?{textLength:92,lengthAdjust:`spacingAndGlyphs`}:{},children:t})})(),e.unit&&(0,W.jsx)(`text`,{x:`65`,y:`80`,textAnchor:`middle`,className:`ring-unit`,children:e.unit})]}),(0,W.jsx)(`div`,{className:`ring-label`,children:e.label}),e.hint&&(0,W.jsx)(`div`,{className:`ring-hint`,children:e.hint})]},t)})}),i&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:6},children:i})]})}function Me({title:e,icon:t=`chart`,iconColor:n=`var(--presence-soft)`,bars:r,unit:i=``,goal:a,goalLabel:o,footer:c,conf:l,delay:u}){let d=s[t]||s.chart,f=Math.max(...r.map(e=>e.value),a||0)*1.05||1,p=(()=>{let e=r.findIndex(e=>e.hot);if(e>=0)return e;let t=0;return r.forEach((e,n)=>{e.value>r[t].value&&(t=n)}),t})(),m=i.trim(),h=m!==``&&(/^[$€£¥₹]/.test(m)||m===`%`||m.length<=2),g=h?``:m;return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(u||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(d,{className:`ic`,style:{color:n}}),` `,e]}),g&&(0,W.jsx)(`div`,{className:`bars-unit`,children:g}),(0,W.jsxs)(`div`,{className:`bars-chart`,children:[(0,W.jsxs)(`div`,{className:`bars-plot`,children:[a!=null&&(0,W.jsx)(`div`,{className:`bars-goal`,style:{bottom:`${a/f*100}%`},children:(0,W.jsx)(`span`,{className:`bars-goal-label`,children:o||`Goal`})}),r.map((e,t)=>(0,W.jsx)(`div`,{className:`bar-col`,children:(0,W.jsx)(`div`,{className:`bar-fill`,"data-mark":t===p?`circle`:void 0,style:{height:`${e.value/f*100}%`,background:e.hot?`var(--warning)`:e.color||`var(--presence)`},children:(0,W.jsx)(`span`,{className:`bar-val tab-num`,children:e.label2||(h?k(e.value,i):A(e.value))})})},t))]}),(0,W.jsx)(`div`,{className:`bars-axis`,children:r.map((e,t)=>(0,W.jsx)(`div`,{className:`bar-label`,children:e.label},t))})]}),c&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:14},children:c}),l&&(0,W.jsxs)(`div`,{className:`card-foot`,children:[(0,W.jsx)(`div`,{className:`card-foot-l`}),(0,W.jsx)(S,{level:l,title:`Best estimate from the model's knowledge — not verified`})]})]})}function Ne({title:e,icon:t=`layers`,iconColor:n=`var(--presence-soft)`,total:r,segments:i,footer:a,conf:o,delay:c}){let l=s[t]||s.layers,u=i.reduce((e,t)=>e+t.value,0)||1,d=i.reduce((e,t,n)=>t.value>i[e].value?n:e,0);return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(c||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),r&&(0,W.jsx)(`div`,{className:`stack-total tab-num`,children:r}),(0,W.jsx)(`div`,{className:`stack-bar`,children:i.map((e,t)=>(0,W.jsx)(`div`,{className:`stack-seg`,title:`${e.label} · ${e.display}`,"data-mark":t===d?`circle`:void 0,style:{width:`${e.value/u*100}%`,background:e.color}},t))}),(0,W.jsx)(`div`,{className:`stack-legend`,children:i.map((e,t)=>(0,W.jsxs)(`div`,{className:`stack-leg`,children:[(0,W.jsx)(`span`,{className:`sw`,style:{background:e.color}}),(0,W.jsx)(`span`,{className:`stack-leg-name`,children:e.label}),(0,W.jsx)(`span`,{className:`stack-leg-val tab-num`,children:e.display})]},t))}),a&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:a}),o&&(0,W.jsxs)(`div`,{className:`card-foot`,children:[(0,W.jsx)(`div`,{className:`card-foot-l`}),(0,W.jsx)(S,{level:o,title:`Best estimate from the model's knowledge — not verified`})]})]})}function Pe({title:e,icon:t=`chart`,iconColor:n=`var(--warning)`,points:r,xLabel:i,yLabel:a,xDomain:o,yDomain:c,trend:l,footer:u,delay:d}){let f=s[t]||s.chart,p={l:54,r:14,t:14,b:38},m=1/0,h=-1/0,g=1/0,_=-1/0;for(let e of r)e.x<m&&(m=e.x),e.x>h&&(h=e.x),e.y<g&&(g=e.y),e.y>_&&(_=e.y);let v=o||[m,h],y=c||[g,_],b=v[1]-v[0]||1,x=y[1]-y[0]||1,S=e=>p.l+(e-v[0])/b*(540-p.l-p.r),C=e=>p.t+(1-(e-y[0])/x)*(240-p.t-p.b),w=(()=>{let e=r.findIndex(e=>e.hot);if(e>=0)return e;let t=0;return r.forEach((e,n)=>{e.y>r[t].y&&(t=n)}),t})();return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(d||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsxs)(`svg`,{viewBox:`0 0 540 240`,width:`100%`,style:{display:`block`,overflow:`visible`},children:[[0,.5,1].map((e,t)=>{let n=p.t+e*(240-p.t-p.b);return(0,W.jsx)(`line`,{x1:p.l,x2:540-p.r,y1:n,y2:n,stroke:`var(--grid-line)`},t)}),(0,W.jsx)(`line`,{x1:p.l,x2:p.l,y1:p.t,y2:240-p.b,stroke:`var(--grid-strong)`}),(0,W.jsx)(`line`,{x1:p.l,x2:540-p.r,y1:240-p.b,y2:240-p.b,stroke:`var(--grid-strong)`}),l&&(0,W.jsx)(`line`,{x1:S(l[0][0]),y1:C(l[0][1]),x2:S(l[1][0]),y2:C(l[1][1]),stroke:`var(--warning)`,strokeWidth:`2`,strokeDasharray:`5 5`,opacity:`0.7`}),r.map((e,t)=>(0,W.jsx)(`circle`,{cx:S(e.x),cy:C(e.y),r:e.hot?7:5.5,fill:e.hot?`var(--warning)`:`var(--presence)`,stroke:`var(--surface-default)`,strokeWidth:`2`,opacity:e.hot?1:.8,"data-mark":t===w?`circle`:void 0},t)),(0,W.jsx)(`text`,{x:270,y:234,textAnchor:`middle`,fontSize:`11`,fill:`var(--text-muted)`,children:i}),(0,W.jsx)(`text`,{x:0,y:0,transform:`translate(13, ${(p.t+240-p.b)/2}) rotate(-90)`,textAnchor:`middle`,fontSize:`11`,fill:`var(--text-muted)`,children:a})]}),u&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:10},children:u})]})}function Fe({title:e,icon:t=`clock`,iconColor:n=`var(--insight)`,cols:r,rows:i,levelColor:a,footer:o,legend:c,delay:l}){let u=s[t]||s.clock,d=0,f=0,p=-1;i.forEach((e,t)=>{e.cells.forEach((e,n)=>{let r=typeof e==`object`&&e?e.lvl??0:e??0;r!=null&&r>p&&(p=r,d=t,f=n)})});let m=e=>e==null?`var(--cell-empty)`:`color-mix(in oklab, ${a||`var(--presence)`} ${[.14,.34,.6,.92][Math.max(0,Math.min(3,e))]*100}%, transparent)`;return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(l||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsxs)(`div`,{className:`heat-wrap`,children:[r&&(0,W.jsxs)(`div`,{className:`heat-cols`,children:[(0,W.jsx)(`span`,{className:`heat-rowhead`}),r.map((e,t)=>(0,W.jsx)(`span`,{className:`heat-col-label`,children:e},t))]}),i.map((e,t)=>(0,W.jsxs)(`div`,{className:`heat-row`,children:[(0,W.jsx)(`span`,{className:`heat-rowhead`,children:e.label}),e.cells.map((e,n)=>(0,W.jsx)(`span`,{className:`heat-cell`,title:e&&typeof e==`object`&&e.note?e.note:``,"data-mark":t===d&&n===f?`circle`:void 0,style:{background:m(typeof e==`object`&&e?e.lvl:e)},children:typeof e==`object`&&e&&e.mark?(0,W.jsx)(`span`,{className:`heat-mark`,children:e.mark}):null},n))]},t))]}),c&&(0,W.jsxs)(`div`,{className:`heat-legend`,children:[(0,W.jsx)(`span`,{className:`faint`,children:c[0]}),[0,1,2,3].map(e=>(0,W.jsx)(`span`,{className:`heat-cell sm`,style:{background:m(e)}},e)),(0,W.jsx)(`span`,{className:`faint`,children:c[1]})]}),o&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:o})]})}function Ie({title:e,icon:t=`sparkle`,iconColor:n=`var(--presence-soft)`,steps:r,footer:i,delay:a}){let o=s[t]||s.sparkle;return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsx)(`div`,{className:`flow`,children:r.map((e,t)=>(0,W.jsxs)(z.Fragment,{children:[(0,W.jsxs)(`div`,{className:`flow-step`,style:{"--sc":e.color||`var(--presence)`},children:[(0,W.jsx)(`div`,{className:`flow-num`,"data-mark":t===0?`circle`:void 0,children:t+1}),(0,W.jsx)(`div`,{className:`flow-title`,children:e.title}),(0,W.jsx)(`div`,{className:`flow-sub`,children:e.sub})]}),t<r.length-1&&(0,W.jsx)(`div`,{className:`flow-arrow`,children:(0,W.jsx)(s.chevR,{})})]},t))}),i&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:14},children:i})]})}function Le({title:e=`From the web`,live:t=!0,results:n,footer:r,delay:i}){return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.globe,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e,t&&(0,W.jsxs)(`span`,{className:`web-live`,children:[(0,W.jsx)(`span`,{className:`web-live-dot`}),`live`]})]}),(0,W.jsx)(`div`,{className:`web-list`,children:n.map((e,t)=>(0,W.jsxs)(`button`,{type:`button`,className:`web-result`,onClick:()=>O(`Opening `+e.domain+` →`),children:[(0,W.jsx)(`span`,{className:`web-fav`,"data-mark":t===0?`circle`:void 0,style:{background:e.color||`var(--presence)`},children:(e.domain||`?`)[0].toUpperCase()}),(0,W.jsxs)(`span`,{className:`web-body`,children:[(0,W.jsx)(`span`,{className:`web-title`,children:e.title}),(0,W.jsxs)(`span`,{className:`web-url`,children:[e.domain,e.path||``]}),(0,W.jsx)(`span`,{className:`web-excerpt`,dangerouslySetInnerHTML:D(e.excerpt)})]}),(0,W.jsx)(s.external,{className:`web-ext`})]},t))}),r&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:r})]})}function Re(e){let t=(0,B.c)(12),{item:n}=e,r=n.src??``,i;t[0]!==n.candidates||t[1]!==r?(i=[r,...n.candidates??[]].map(Be).filter(ze),t[0]=n.candidates,t[1]=r,t[2]=i):i=t[2];let a=i,o;t[3]===n.fallbackSrc?o=t[4]:(o=j(n.fallbackSrc),t[3]=n.fallbackSrc,t[4]=o);let c=o,l=M(a),u=l.src??(a.length&&l.state===`none`?c:void 0);if(!u){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,W.jsx)(s.image,{className:`img-ph-ic`}),t[5]=e):e=t[5],e}let d;t[6]===c?d=t[7]:(d=e=>{let t=e.currentTarget;c&&t.src!==c&&(t.src=c)},t[6]=c,t[7]=d);let f;return t[8]!==n.label||t[9]!==u||t[10]!==d?(f=(0,W.jsx)(`img`,{className:`img-real`,src:u,alt:n.label,loading:`lazy`,referrerPolicy:`no-referrer`,onError:d}),t[8]=n.label,t[9]=u,t[10]=d,t[11]=f):f=t[11],f}function ze(e){return!!e}function Be(e){return j(e)}function Ve({eyebrow:e=`From the web`,items:t,footer:n,delay:r}){return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(r||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.image,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,W.jsx)(`div`,{className:`gallery`,children:t.map((e,t)=>{let n=()=>O(`Saved “`+e.label+`” to your notes`);return(0,W.jsxs)(`div`,{className:`img-tile`,role:`button`,tabIndex:0,"aria-label":`Save ${e.label} to your notes`,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},style:{"--h1":e.h1||`#3a4a6e`,"--h2":e.h2||`#1a2236`,cursor:`pointer`},children:[(0,W.jsxs)(`span`,{className:`img-ph`,children:[(0,W.jsx)(Re,{item:e}),e.tag&&(0,W.jsx)(`span`,{className:`img-tag`,children:e.tag}),e.source&&(0,W.jsx)(`span`,{className:`img-src`,children:e.source})]}),(0,W.jsx)(`span`,{className:`img-cap`,children:e.label})]},e.label+t)})}),n&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:n})]})}function He({title:e=`What this change touches`,center:t,nodes:n,footer:r,delay:i}){let a=n.map((e,t)=>{let r=(-90+360/n.length*t)*Math.PI/180;return{...e,x:180+Math.cos(r)*74,y:125+Math.sin(r)*74*.86}}),o=Math.max(0,a.findIndex(e=>e.hot));return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.layers,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,W.jsx)(`div`,{className:`codemap`,children:(0,W.jsxs)(`svg`,{viewBox:`0 0 360 250`,width:`100%`,style:{display:`block`},children:[a.map((e,t)=>(0,W.jsx)(`line`,{x1:180,y1:125,x2:e.x,y2:e.y,stroke:e.hot?`var(--warning)`:`var(--grid-strong)`,strokeWidth:e.hot?1.6:1,strokeDasharray:e.hot?`0`:`3 3`},t)),a.map((e,t)=>(0,W.jsxs)(`g`,{transform:`translate(${e.x} ${e.y})`,children:[(0,W.jsx)(`circle`,{r:`6`,fill:e.hot?`var(--warning)`:`var(--surface-elevated-2)`,stroke:e.hot?`var(--warning)`:`var(--line-strong)`,strokeWidth:`1.5`,"data-mark":t===o?`circle`:void 0}),(0,W.jsx)(`text`,{x:`0`,y:e.y>125?20:-12,textAnchor:`middle`,fontSize:`10.5`,fill:`var(--text-secondary)`,className:`mono`,children:e.label}),e.note&&(0,W.jsx)(`text`,{x:`0`,y:e.y>125?32:-24,textAnchor:`middle`,fontSize:`9`,fill:`var(--text-muted)`,children:e.note})]},t)),(0,W.jsxs)(`g`,{transform:`translate(180 125)`,children:[(0,W.jsx)(`circle`,{r:`11`,fill:`var(--presence)`,stroke:`var(--surface-default)`,strokeWidth:`2`}),(0,W.jsx)(`circle`,{r:`11`,fill:`none`,stroke:`var(--presence)`,strokeWidth:`1`,opacity:`0.4`,className:`codemap-pulse`}),(0,W.jsx)(`text`,{x:`0`,y:`28`,textAnchor:`middle`,fontSize:`11`,fontWeight:`600`,fill:`var(--text-primary)`,className:`mono`,children:t})]})]})}),r&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:8},children:r})]})}function Ue(e){let t=(0,B.c)(32),{title:n,file:r,add:i,del:a,lines:o,footer:c,delay:l}=e,u=(l||0)+`ms`,d;t[0]===u?d=t[1]:(d={"--delay":u},t[0]=u,t[1]=d);let f=d,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,W.jsx)(s.edit,{className:`ic`,style:{color:`var(--presence-soft)`}}),t[2]=p):p=t[2];let m=n||`The change`,h;t[3]===m?h=t[4]:(h=(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[p,` `,m]}),t[3]=m,t[4]=h);let g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,W.jsx)(s.doc,{style:{width:13,height:13}}),t[5]=g):g=t[5];let _;t[6]===r?_=t[7]:(_=(0,W.jsxs)(`span`,{className:`diff-file mono`,children:[g,` `,r]}),t[6]=r,t[7]=_);let v;t[8]===i?v=t[9]:(v=(0,W.jsxs)(`span`,{className:`add`,children:[`+`,i]}),t[8]=i,t[9]=v);let y;t[10]===a?y=t[11]:(y=(0,W.jsxs)(`span`,{className:`del`,children:[`−`,a]}),t[10]=a,t[11]=y);let b;t[12]!==y||t[13]!==v?(b=(0,W.jsxs)(`span`,{className:`diff-stat`,children:[v,` `,y]}),t[12]=y,t[13]=v,t[14]=b):b=t[14];let x;t[15]!==b||t[16]!==_?(x=(0,W.jsxs)(`div`,{className:`diff-head`,children:[_,b]}),t[15]=b,t[16]=_,t[17]=x):x=t[17];let S;t[18]===o?S=t[19]:(S=o.map(We),t[18]=o,t[19]=S);let C;t[20]===S?C=t[21]:(C=(0,W.jsx)(`div`,{className:`diff-body mono`,children:S}),t[20]=S,t[21]=C);let w;t[22]!==x||t[23]!==C?(w=(0,W.jsxs)(`div`,{className:`diff`,children:[x,C]}),t[22]=x,t[23]=C,t[24]=w):w=t[24];let T;t[25]===c?T=t[26]:(T=c&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:c}),t[25]=c,t[26]=T);let E;return t[27]!==w||t[28]!==T||t[29]!==f||t[30]!==h?(E=(0,W.jsxs)(`div`,{className:`card reveal`,style:f,children:[h,w,T]}),t[27]=w,t[28]=T,t[29]=f,t[30]=h,t[31]=E):E=t[31],E}function We(e,t){return(0,W.jsxs)(`div`,{className:`diff-line `+(e.t||`ctx`),children:[(0,W.jsx)(`span`,{className:`diff-gutter`,children:e.t===`add`?`+`:e.t===`del`?`−`:``}),(0,W.jsx)(`span`,{className:`diff-code`,dangerouslySetInnerHTML:D(e.c)})]},t)}var Ge={pass:s.check,fail:s.x,skip:s.clock};function Ke({title:e=`Tests after the change`,summary:t,items:n,footer:r,delay:i}){let a=n.findIndex(e=>e.status===`fail`);return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.proof,{className:`ic`,style:{color:`var(--insight)`}}),` `,e]}),t&&(0,W.jsx)(`div`,{className:`checks-summary`,children:t}),(0,W.jsx)(`div`,{className:`checks-list`,children:n.map((e,t)=>{let n=Ge[e.status]||s.check;return(0,W.jsxs)(`div`,{className:`check2-row `+e.status,children:[(0,W.jsx)(`span`,{className:`check2-ic`,"data-mark":t===a?`circle`:void 0,children:(0,W.jsx)(n,{})}),(0,W.jsx)(`span`,{className:`check2-name mono`,children:e.name}),e.note&&(0,W.jsx)(`span`,{className:`check2-note`,children:e.note})]},t)})}),r&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:r})]})}function qe({title:e,icon:t=`chart`,iconColor:n=`var(--presence-soft)`,size:r=132,thickness:i=18,rows:a,footer:o,conf:c,delay:l}){let u=s[t]||s.chart,d=r/2-i/2,f=2*Math.PI*d,p=0,m=a.map(e=>{let t=f*e.pct/100,n={len:t,off:-p,color:e.color};return p+=t,n}),h=a.reduce((e,t,n)=>t.pct>a[e].pct?n:e,0);return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(l||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsxs)(`div`,{className:`donut-wrap`,children:[(0,W.jsx)(`svg`,{className:`donut`,viewBox:`0 0 ${r} ${r}`,width:r,height:r,children:(0,W.jsxs)(`g`,{transform:`rotate(-90 ${r/2} ${r/2})`,children:[(0,W.jsx)(`circle`,{cx:r/2,cy:r/2,r:d,fill:`none`,stroke:`var(--surface-glass-strong)`,strokeWidth:i}),m.map((e,t)=>(0,W.jsx)(`circle`,{className:`donut-seg`,cx:r/2,cy:r/2,r:d,fill:`none`,stroke:e.color,strokeWidth:i,strokeLinecap:`butt`,strokeDasharray:`${Math.max(0,e.len-1.5)} ${f-Math.max(0,e.len-1.5)}`,strokeDashoffset:e.off,"data-mark":t===h?`circle`:void 0},t))]})}),(0,W.jsx)(`ul`,{className:`donut-legend`,children:a.map((e,t)=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`i`,{className:`sw`,style:{background:e.color}}),(0,W.jsx)(`span`,{className:`dl-label`,children:e.label}),(0,W.jsxs)(`span`,{className:`dl-pct tab-num`,children:[e.pct,`%`]})]},t))})]}),o&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:o}),c&&(0,W.jsxs)(`div`,{className:`card-foot`,children:[(0,W.jsx)(`div`,{className:`card-foot-l`}),(0,W.jsx)(S,{level:c,title:`Best estimate from the model's knowledge — not verified`})]})]})}function Je({title:e,icon:t=`spark`,iconColor:n=`var(--insight)`,value:r,max:i=100,size:a=116,color:o,band:c,driver:l,footer:u,conf:d,delay:f}){let p=s[t]||s.spark,m=a/2-10,h=Math.max(0,Math.min(1,r/i)),g=o||(r>=40?`var(--warning)`:`var(--insight)`);return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(f||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsxs)(`div`,{className:`risk-wrap`,children:[(0,W.jsxs)(`div`,{className:`gauge-host`,children:[(0,W.jsxs)(`svg`,{className:`gauge`,viewBox:`0 0 ${a} ${a}`,width:a,height:a,children:[(0,W.jsx)(`circle`,{cx:a/2,cy:a/2,r:m,fill:`none`,stroke:`var(--surface-glass-strong)`,strokeWidth:`9`}),(0,W.jsx)(`circle`,{className:`gauge-arc`,cx:a/2,cy:a/2,r:m,fill:`none`,stroke:g,strokeWidth:`9`,strokeLinecap:`round`,pathLength:1,strokeDasharray:1,strokeDashoffset:1-h,transform:`rotate(-90 ${a/2} ${a/2})`})]}),(0,W.jsxs)(`div`,{className:`gauge-center`,children:[(0,W.jsx)(`div`,{className:`gauge-num tab-num`,"data-mark":`underline`,style:{color:g},children:r}),c&&(0,W.jsx)(`div`,{className:`gauge-band`,children:c})]})]}),l&&(0,W.jsx)(`p`,{className:`risk-driver`,dangerouslySetInnerHTML:D(l)})]}),u&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:u}),d&&(0,W.jsxs)(`div`,{className:`card-foot`,children:[(0,W.jsx)(`div`,{className:`card-foot-l`}),(0,W.jsx)(S,{level:d,title:`Best estimate from the model's knowledge — not verified`})]})]})}function Ye({title:e=`Around the league`,icon:t=`bell`,iconColor:n=`var(--presence-soft)`,games:r,footer:i,delay:a}){let o=s[t]||s.bell,c=Math.max(0,r.findIndex(e=>e.hot));return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsx)(`ul`,{className:`score-list`,children:r.map((e,t)=>(0,W.jsxs)(`li`,{className:`game`+(e.hot?` hot`:``),"data-mark":t===c?`circle`:void 0,style:{"--ti":t},children:[(0,W.jsxs)(`div`,{className:`g-rows`,children:[(0,W.jsxs)(`div`,{className:`g-team`,children:[(0,W.jsx)(`span`,{className:`g-name`,children:e.away}),(0,W.jsx)(`span`,{className:`g-score tab-num`,children:e.as})]}),(0,W.jsxs)(`div`,{className:`g-team`,children:[(0,W.jsx)(`span`,{className:`g-name`,children:e.home}),(0,W.jsx)(`span`,{className:`g-score tab-num`,children:e.hs})]})]}),(0,W.jsxs)(`span`,{className:`g-status`+(e.hot?` live`:``),children:[e.hot&&(0,W.jsx)(`span`,{className:`live-dot`}),e.status]})]},t))}),i&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:i})]})}function Xe({title:e=`Standings`,icon:t=`table`,iconColor:n=`var(--insight)`,rows:r,footer:i,delay:a}){let o=s[t]||s.table;return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsx)(`ul`,{className:`stand-list`,children:r.map((e,t)=>(0,W.jsxs)(`li`,{className:`stand`,style:{"--ti":t},children:[(0,W.jsx)(`span`,{className:`stand-rank`,children:t+1}),(0,W.jsx)(`span`,{className:`stand-team`,"data-mark":t===0?`underline`:void 0,children:e.team}),(0,W.jsx)(`span`,{className:`stand-rec tab-num`,children:e.rec}),(0,W.jsx)(`span`,{className:`stand-gb tab-num`,children:e.gb})]},t))}),i&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:i})]})}function Ze({title:e=`By stage`,icon:t=`layers`,iconColor:n=`var(--presence-soft)`,headline:r,sub:i,unit:a=`$`,suffix:o=`M`,stages:c,footer:l,delay:u}){let d=s[t]||s.layers,f=Math.max(1,...c.map(e=>e.v)),p=c.reduce((e,t,n)=>t.v>c[e].v?n:e,0);return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(u||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(d,{className:`ic`,style:{color:n}}),` `,e]}),(r||i)&&(0,W.jsxs)(`div`,{className:`stat-row`,children:[r&&(0,W.jsx)(`div`,{className:`big-stat tab-num`,style:{color:`var(--presence)`},children:r}),i&&(0,W.jsx)(`span`,{className:`delta accent`,children:i})]}),(0,W.jsx)(`ul`,{className:`funnel`,children:c.map((e,t)=>(0,W.jsxs)(`li`,{className:`funnel-row`,style:{"--ti":t},children:[(0,W.jsx)(`span`,{className:`funnel-label`,children:e.k}),(0,W.jsx)(`span`,{className:`funnel-track`,children:(0,W.jsx)(`span`,{className:`funnel-fill`,"data-mark":t===p?`circle`:void 0,style:{width:e.v/f*100+`%`}})}),(0,W.jsxs)(`span`,{className:`funnel-val tab-num`,children:[a,e.v,o]})]},t))}),l&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:l})]})}function Qe(e){return e===4?2:Math.min(Math.max(e,1),3)}function $e({title:e,icon:t=`spark`,iconColor:n=`var(--insight)`,cols:r,kpis:i,footer:a,conf:o,delay:c}){let l=s[t]||s.spark;return(0,W.jsxs)(`div`,{className:`card reveal kpi-card`,style:{"--delay":(c||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsx)(`div`,{className:`kpi-grid`,style:{"--kpi-cols":r??Qe(i.length)},children:i.map((e,t)=>(0,W.jsxs)(`div`,{className:`kpi`,children:[(0,W.jsx)(`div`,{className:`kpi-val tab-num`,"data-mark":t===0?`underline`:void 0,style:e.color?{color:e.color}:void 0,children:e.val}),(0,W.jsx)(`div`,{className:`kpi-label`,children:e.label})]},t))}),a&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:a}),o&&(0,W.jsxs)(`div`,{className:`card-foot`,children:[(0,W.jsx)(`div`,{className:`card-foot-l`}),(0,W.jsx)(S,{level:o,title:`Best estimate from the model's knowledge — not verified`})]})]})}function et({title:e=`What customers are saying`,icon:t=`quote`,iconColor:n=`var(--presence-soft)`,quotes:r,footer:i,delay:a}){let o=s[t]||s.quote;return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsx)(`ul`,{className:`quote-list`,children:r.map((e,t)=>(0,W.jsxs)(`li`,{className:`quote-item q-`+(e.tone||`neutral`),style:{"--ti":t},children:[(0,W.jsxs)(`p`,{className:`quote-text`,children:[`“`,e.text,`”`]}),(0,W.jsx)(`span`,{className:`quote-who`,children:e.who})]},t))}),i&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:i})]})}function tt({title:e=`Plan`,icon:t=`check`,iconColor:n=`var(--insight)`,rows:r,footer:i,delay:a}){let o=s[t]||s.check,c=(()=>{let e=r.findIndex(e=>e.st===`doing`);return e>=0?e:r.findIndex(e=>e.st===`todo`)})();return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(a||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(o,{className:`ic`,style:{color:n}}),` `,e]}),(0,W.jsx)(`ul`,{className:`plan-list`,children:r.map((e,t)=>(0,W.jsxs)(`li`,{className:`plan-row st-`+e.st,style:{"--ti":t},children:[(0,W.jsx)(`span`,{className:`plan-check`,"data-mark":t===c?`circle`:void 0,children:e.st===`done`?(0,W.jsx)(s.check,{style:{width:12,height:12}}):e.st===`doing`?(0,W.jsx)(`span`,{className:`plan-dot`}):null}),(0,W.jsx)(`span`,{className:`plan-t`,children:e.t})]},t))}),i&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:i})]})}function nt({title:e=`What I learned about you`,items:t,conf:n,delay:r}){return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(r||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.sparkle,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,W.jsx)(`div`,{className:`understand-list`,children:t.map((e,t)=>(0,W.jsxs)(`div`,{className:`understand-row`,children:[(0,W.jsx)(`span`,{className:`understand-check`,children:(0,W.jsx)(s.check,{})}),(0,W.jsx)(`span`,{className:`understand-text`,"data-mark":t===0?`underline`:void 0,dangerouslySetInnerHTML:D(e.text)}),(0,W.jsxs)(`span`,{className:`understand-meta`,children:[e.source&&(0,W.jsx)(w,{file:e.source}),(0,W.jsx)(`button`,{className:`understand-edit`,title:`Fix this`,type:`button`,onClick:()=>O(`Tell Mavéa what's off — it'll adjust`,`info`),children:(0,W.jsx)(s.edit,{})})]})]},t))}),(0,W.jsxs)(`div`,{className:`card-foot`,style:{marginTop:14},children:[(0,W.jsx)(`span`,{className:`faint`,style:{fontSize:12.5},children:`Read straight from your site — correct anything.`}),n&&(0,W.jsx)(S,{level:n,title:t.some(e=>e.source)?void 0:`Best estimate from the model's knowledge — not verified`})]})]})}function rt({title:e=`The data model`,entities:t,relations:n,footer:r,delay:i}){return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(i||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.layers,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,W.jsx)(`div`,{className:`schema`,children:t.map((e,t)=>(0,W.jsxs)(`div`,{className:`entity`,style:{"--ec":e.color||`var(--presence)`},children:[(0,W.jsxs)(`div`,{className:`entity-head`,children:[(0,W.jsx)(s.table,{style:{width:13,height:13}}),` `,e.name,e.badge&&(0,W.jsx)(`span`,{className:`entity-badge`,children:e.badge})]}),(0,W.jsx)(`div`,{className:`entity-fields`,children:e.fields.map((e,t)=>(0,W.jsxs)(`div`,{className:`entity-field`,children:[(0,W.jsx)(`span`,{className:`ef-key`+(e.key?` is-key`:``),children:e.name}),(0,W.jsx)(`span`,{className:`ef-type`,children:e.type})]},t))})]},t))}),n&&(0,W.jsx)(`div`,{className:`relations`,children:n.map((e,t)=>(0,W.jsxs)(`span`,{className:`relation`,children:[(0,W.jsx)(`b`,{children:e.from}),` `,e.label,` `,(0,W.jsx)(`b`,{children:e.to})]},t))}),r&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:r})]})}var it={dashboard:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`wl w60`}),(0,W.jsxs)(`div`,{className:`wgrid`,children:[(0,W.jsx)(`span`,{}),(0,W.jsx)(`span`,{}),(0,W.jsx)(`span`,{})]}),(0,W.jsx)(`span`,{className:`wbar`})]}),table:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`wl w40`}),(0,W.jsx)(`span`,{className:`wrow`}),(0,W.jsx)(`span`,{className:`wrow`}),(0,W.jsx)(`span`,{className:`wrow`}),(0,W.jsx)(`span`,{className:`wrow`})]}),board:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`wl w40`}),(0,W.jsxs)(`div`,{className:`wcols`,children:[(0,W.jsx)(`span`,{}),(0,W.jsx)(`span`,{}),(0,W.jsx)(`span`,{})]})]}),detail:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`wl w50`}),(0,W.jsx)(`span`,{className:`wblock`}),(0,W.jsx)(`span`,{className:`wl w70`}),(0,W.jsx)(`span`,{className:`wl w50`})]}),list:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`wl w40`}),(0,W.jsx)(`span`,{className:`wrow`}),(0,W.jsx)(`span`,{className:`wrow`}),(0,W.jsx)(`span`,{className:`wrow`})]})};function at({title:e=`The screens you'll get`,screens:t,footer:n,delay:r}){return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(r||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.slides,{className:`ic`,style:{color:`var(--presence-soft)`}}),` `,e]}),(0,W.jsx)(`div`,{className:`screenmap`,children:t.map((e,t)=>{let n=()=>O(`Opening `+e.name+` — you can rename or reorder`,`info`);return(0,W.jsxs)(`div`,{className:`screen-thumb`,role:`button`,tabIndex:0,"aria-label":`Open ${e.name}`,onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},children:[(0,W.jsx)(`div`,{className:`screen-wire`,children:it[e.kind]||it.table}),(0,W.jsx)(`figcaption`,{children:e.name})]},t)})}),n&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:n})]})}function ot({title:e=`Building it`,steps:t,footer:n,delay:r}){let[i,a]=(0,z.useState)(0),o=t.filter(e=>e.status===`active`).length;(0,z.useEffect)(()=>{if(o===0)return;let e=(r||0)+1400,t=Array.from({length:o},(t,n)=>setTimeout(()=>a(e=>Math.max(e,n+1)),e+n*900));return()=>t.forEach(clearTimeout)},[o,r]);let c=0,l=t.map(e=>{if(e.status!==`active`)return e;let t=c<i;return c+=1,t?{...e,status:`done`}:e}),u=l.findIndex(e=>e.status===`active`);return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(r||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.spark,{className:`ic`,style:{color:`var(--insight)`}}),` `,e]}),(0,W.jsx)(`div`,{className:`buildsteps`,children:l.map((e,t)=>(0,W.jsxs)(`div`,{className:`buildstep `+(e.status||`done`),children:[(0,W.jsx)(`span`,{className:`buildstep-ic`,"data-mark":t===u?`circle`:void 0,children:e.status===`active`?(0,W.jsx)(`span`,{className:`tiny-spin`}):e.status===`todo`?(0,W.jsx)(`span`,{className:`bs-dot`}):(0,W.jsx)(s.check,{})}),(0,W.jsxs)(`span`,{className:`buildstep-body`,children:[(0,W.jsx)(`span`,{className:`buildstep-label`,children:e.label}),e.sub&&(0,W.jsx)(`span`,{className:`buildstep-sub`,children:e.sub})]})]},t))}),n&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:n})]})}function st({app:e,seededFrom:t,nav:n,stages:r,rows:i,kpis:a,columns:o,groupColumns:c=[`Group`,`Items`,`Total`],pipelineLabel:l=`Pipeline by stage`,agg:u=`money`,createdNote:d=`created this with Mavéa`,activities:f,footer:p,delay:m}){let[h,g]=(0,z.useState)(n[0]?.label||``),_=n.find(e=>e.label===h)||n[0],v=e=>u===`money`?`$`+Math.round(e/1e3)+`k`:e.toLocaleString(),y=i.reduce((e,t)=>e+(t.amt||0),0),b=new Map,x=new Map;for(let e of i){let t=b.get(e.group)??{count:0,value:0,color:e.color};t.count+=1,t.value+=e.amt||0,b.set(e.group,t),x.set(e.stage,(x.get(e.stage)??0)+1)}let S=Array.from(b,([e,t])=>({name:e,...t})),C=r.reduce((e,t)=>Math.max(e,x.get(t.key)??0),1),w=f||[],T=({s:e})=>{let t=r.find(t=>t.key===e)||r[0];return(0,W.jsx)(`span`,{className:`at-stage `+t.kind,children:e})};return(0,W.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(m||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,W.jsx)(s.external,{className:`ic`,style:{color:`var(--insight)`}}),` Live preview · your app`,(0,W.jsxs)(`span`,{className:`preview-live`,children:[(0,W.jsx)(`span`,{className:`web-live-dot`}),`working`]})]}),(0,W.jsxs)(`div`,{className:`appframe`,children:[(0,W.jsxs)(`div`,{className:`appframe-bar`,children:[(0,W.jsx)(`span`,{className:`aflight`}),(0,W.jsx)(`span`,{className:`aflight`}),(0,W.jsx)(`span`,{className:`aflight`}),(0,W.jsxs)(`span`,{className:`afurl mono`,children:[e.toLowerCase().replace(/\s+/g,`-`),`.mavea.app`]})]}),(0,W.jsxs)(`div`,{className:`appframe-body`,children:[(0,W.jsxs)(`div`,{className:`appnav`,children:[(0,W.jsx)(`div`,{className:`appnav-brand`,children:e}),n.map((e,t)=>(0,W.jsx)(`button`,{className:`appnav-item`+(h===e.label?` on`:``),type:`button`,onClick:()=>g(e.label),children:e.label},t))]}),(0,W.jsxs)(`div`,{className:`appmain`,children:[(0,W.jsxs)(`div`,{className:`appmain-top`,children:[(0,W.jsx)(`span`,{className:`appmain-title`,children:_?.label}),_?.view===`dashboard`&&t&&(0,W.jsx)(`span`,{className:`appmain-sub`,children:t})]}),_?.view===`dashboard`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`appkpis`,children:a.map((e,t)=>(0,W.jsxs)(`div`,{className:`appkpi`,children:[(0,W.jsx)(`span`,{className:`appkpi-v tab-num`,children:e.v}),(0,W.jsx)(`span`,{className:`appkpi-k`,children:e.k})]},t))}),(0,W.jsxs)(`div`,{className:`appdash`,children:[(0,W.jsxs)(`div`,{className:`apppanel`,children:[(0,W.jsx)(`div`,{className:`apppanel-h`,children:l}),r.map((e,t)=>{let n=i.filter(t=>t.stage===e.key),r=n.reduce((e,t)=>e+(t.amt||0),0),a=Math.round(y?r/y*100:n.length/C*100);return(0,W.jsxs)(`div`,{className:`apppipe`,children:[(0,W.jsxs)(`span`,{className:`apppipe-l`,children:[e.key,` `,(0,W.jsxs)(`span`,{className:`faint`,children:[`· `,n.length]})]}),(0,W.jsx)(`span`,{className:`apppipe-bar`,children:(0,W.jsx)(`i`,{style:{width:Math.max(6,a)+`%`,background:e.color}})}),(0,W.jsx)(`span`,{className:`apppipe-v tab-num`,children:y?v(r):n.length})]},t)})]}),(0,W.jsxs)(`div`,{className:`apppanel`,children:[(0,W.jsx)(`div`,{className:`apppanel-h`,children:`Recent activity`}),w.map((e,t)=>(0,W.jsxs)(`div`,{className:`appact`,children:[(0,W.jsx)(`span`,{className:`at-ava`,style:{background:e.color},children:e.who[0]}),(0,W.jsxs)(`span`,{className:`appact-t`,children:[(0,W.jsx)(`b`,{children:e.who}),` `,e.what]}),(0,W.jsx)(`span`,{className:`appact-when`,children:e.when})]},t))]})]})]}),_?.view===`table`&&(0,W.jsxs)(`div`,{className:`apptable`,children:[(0,W.jsxs)(`div`,{className:`apptable-head`,children:[(0,W.jsx)(`span`,{children:o[0]}),(0,W.jsx)(`span`,{children:o[1]}),(0,W.jsx)(`span`,{children:o[2]}),(0,W.jsx)(`span`,{className:`ta-r`,children:o[3]})]}),i.map((e,t)=>(0,W.jsxs)(`div`,{className:`apptable-row`,children:[(0,W.jsxs)(`span`,{className:`at-name`,children:[(0,W.jsx)(`span`,{className:`at-ava`,style:{background:e.color},children:e.name[0]}),e.name]}),(0,W.jsx)(`span`,{children:e.group}),(0,W.jsx)(`span`,{children:(0,W.jsx)(T,{s:e.stage})}),(0,W.jsx)(`span`,{className:`ta-r tab-num`,children:e.value})]},t))]}),_?.view===`board`&&(0,W.jsx)(`div`,{className:`appboard`,children:r.map((e,t)=>(0,W.jsxs)(`div`,{className:`appcol`,children:[(0,W.jsxs)(`div`,{className:`appcol-h`,children:[(0,W.jsx)(`span`,{className:`appcol-dot`,style:{background:e.color}}),e.key,(0,W.jsx)(`span`,{className:`faint`,children:i.filter(t=>t.stage===e.key).length})]}),i.filter(t=>t.stage===e.key).map((e,t)=>(0,W.jsxs)(`div`,{className:`appdeal`,children:[(0,W.jsx)(`div`,{className:`appdeal-n`,children:e.name}),(0,W.jsxs)(`div`,{className:`appdeal-m`,children:[e.group,` · `,(0,W.jsx)(`span`,{className:`tab-num`,children:e.value})]})]},t))]},t))}),_?.view===`group`&&(0,W.jsxs)(`div`,{className:`apptable`,children:[(0,W.jsxs)(`div`,{className:`apptable-head threecol`,children:[(0,W.jsx)(`span`,{children:c[0]}),(0,W.jsx)(`span`,{children:c[1]}),(0,W.jsx)(`span`,{className:`ta-r`,children:c[2]})]}),S.map((e,t)=>(0,W.jsxs)(`div`,{className:`apptable-row threecol`,children:[(0,W.jsxs)(`span`,{className:`at-name`,children:[(0,W.jsx)(`span`,{className:`at-ava`,style:{background:e.color},children:e.name[0]}),e.name]}),(0,W.jsx)(`span`,{children:e.count}),(0,W.jsx)(`span`,{className:`ta-r tab-num`,children:v(e.value)})]},t))]}),_?.view===`activity`&&(0,W.jsx)(`div`,{className:`appactivity`,children:w.concat([{who:`You`,what:d,when:`just now`,color:`var(--presence-deep)`}]).map((e,t)=>(0,W.jsxs)(`div`,{className:`appact row`,children:[(0,W.jsx)(`span`,{className:`at-ava`,style:{background:e.color},children:e.who[0]}),(0,W.jsxs)(`span`,{className:`appact-t`,children:[(0,W.jsx)(`b`,{children:e.who}),` `,e.what]}),(0,W.jsx)(`span`,{className:`appact-when`,children:e.when})]},t))})]})]})]}),p&&(0,W.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:p})]})}function ct(e){return e>=1100?12:e>=820?9:e>=580?6:4}var lt=e=>{let t=e.type??``,n=N[t],r=e.col;return r===void 0?n:n?{...n,pref:r}:{pref:r}};function ut(e,t){if(e.length===0)return e;try{return F(e,lt,t)}catch{return e}}function dt(e,t){let[n,r]=(0,z.useState)(()=>typeof window<`u`?ct(window.innerWidth):12),i=(0,z.useRef)(null),a=(0,z.useRef)(null),o=(0,z.useRef)(0);return(0,z.useLayoutEffect)(()=>{let e=t.current;if(e===i.current||(i.current=e,a.current?.disconnect(),cancelAnimationFrame(o.current),!e||typeof ResizeObserver>`u`))return;a.current||=new ResizeObserver(e=>{cancelAnimationFrame(o.current),o.current=requestAnimationFrame(()=>{let t=e[0],n=t?.contentRect.width??t?.target?.offsetWidth;n!==void 0&&r(e=>{let t=ct(n);return e===t?e:t})})}),a.current.observe(e);let n=ct(e.offsetWidth);r(e=>e===n?e:n)}),(0,z.useLayoutEffect)(()=>()=>{cancelAnimationFrame(o.current),a.current?.disconnect(),a.current=null},[]),{displayBlocks:(0,z.useMemo)(()=>{try{return F(e,lt,n)}catch{return e}},[e,n]),budget:n}}var ft=new Set([`auto`,`scroll`]);function pt(e){let t=(e.closest(`.card`)?.querySelector(`.card-eyebrow, h1, h2, h3, [role="heading"]`)?.textContent)?.trim().replace(/\s+/g,` `).slice(0,100);return t?`Scrollable content: ${t}`:`Scrollable card content`}function mt(e,t){let n=(0,B.c)(5),r;n[0]===e.current?r=n[1]:(r=()=>{let t=e.current;if(!t)return;let n=new Map,r=new Set,i=!1,a=!1,o=0,s=e=>n.has(e)||e.scrollWidth<=e.clientWidth+8?!1:ft.has(getComputedStyle(e).overflowX),c=e=>{if(n.has(e))return;let t=e.hasAttribute(`tabindex`),r=e.hasAttribute(`role`),i=e.hasAttribute(`aria-label`)||e.hasAttribute(`aria-labelledby`);t||(e.tabIndex=0),r||e.setAttribute(`role`,`region`),i||e.setAttribute(`aria-label`,pt(e)),e.classList.add(`canvas-hscroll`);let a=()=>{let t=e.scrollLeft+e.clientWidth>=e.scrollWidth-2;e.classList.toggle(`canvas-hscroll--end`,t)};a(),e.addEventListener(`scroll`,a,{passive:!0}),n.set(e,()=>{e.removeEventListener(`scroll`,a),e.classList.remove(`canvas-hscroll`,`canvas-hscroll--end`),t||e.removeAttribute(`tabindex`),r||e.removeAttribute(`role`),i||e.removeAttribute(`aria-label`)})},l=e=>{let n=e instanceof HTMLElement?e:e.parentElement;for(;n&&n.parentElement!==t;)n=n.parentElement;return n},u=()=>{if(o=0,a){a=!1;for(let[e,t]of n)e.isConnected||(t(),n.delete(e))}let e=i?[t]:[...r].filter(e=>t.contains(e));i=!1,r.clear();let l=[];for(let n of e){n!==t&&s(n)&&l.push(n);for(let e of n.querySelectorAll(`*`))s(e)&&l.push(e)}for(let e of l)c(e)},d=()=>{o||=requestAnimationFrame(u)},f=()=>{i=!0,d()};f();let p=window.setTimeout(f,700),m=typeof MutationObserver>`u`?null:new MutationObserver(e=>{for(let t of e){if(t.removedNodes.length){a=!0;let e=l(t.target);e&&r.add(e)}for(let e of t.addedNodes){let t=l(e);t&&r.add(t)}}(r.size||a)&&d()});m?.observe(t,{childList:!0,subtree:!0});let h=-1,g=typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{let t=e.at(-1)?.contentRect.width??h;t!==h&&(h=t,f())});return g?.observe(t),()=>{o&&cancelAnimationFrame(o),clearTimeout(p),m?.disconnect(),g?.disconnect();for(let e of n.values())e()}},n[0]=e.current,n[1]=r);let i;n[2]!==t||n[3]!==e?(i=[e,t],n[2]=t,n[3]=e,n[4]=i):i=n[4],(0,z.useEffect)(r,i)}var ht=/…\s*$/u,gt=0;function _t(e){return(e??``).replace(/\s+/g,` `).trim()}var vt=/\S/u;function yt(e){let t=new Map,n=e=>{if(e.tagName.toLowerCase()===`title`)return t.set(e,``),``;let r=``;for(let t of e.childNodes)t.nodeType===Node.TEXT_NODE?r+=`${t.textContent??``} `:t instanceof Element&&(r+=`${n(t)} `);return t.set(e,r),r};return n(e),t}function bt(e,t){let n=t.textOverflow===`ellipsis`&&t.whiteSpace.includes(`nowrap`)&&e.scrollWidth>e.clientWidth+1,r=t.webkitLineClamp||t.getPropertyValue(`-webkit-line-clamp`),i=Number.parseInt(r,10),a=Number.isFinite(i)&&i>0&&e.scrollHeight>e.clientHeight+2;return n||a}function xt(e){let t=[...e.children].find(e=>e.tagName.toLowerCase()===`title`);return _t(e.getAttribute(`data-full-text`)||e.getAttribute(`title`)||t?.textContent||e.getAttribute(`aria-label`))}function St(e,t,n){let r=xt(e)||(n?t:``),i=e;if(!r||r===t){let n=e.parentElement,a=n?xt(n):``;a&&a!==t&&(r=a,i=n)}return!r||!n&&(r===t||r.length<=t.replace(ht,``).length)||!(i instanceof HTMLElement)&&!(i instanceof SVGElement)?null:{target:i,full:r}}function Ct(e){return e.matches(`button, a[href], input, select, textarea, summary, [contenteditable="true"]`)}function wt(e,t){if(e.hasAttribute(`data-semantic-ellipsis`))return null;let n=t.get(e)??``;if(!vt.test(n))return null;let r=getComputedStyle(e);if(r.visibility===`hidden`||parseFloat(r.opacity)===0)return null;let i=_t(n),a=e instanceof HTMLElement&&bt(e,r);if(!ht.test(i)&&!a)return null;let o=St(e,i,a);return o?{source:e,...o}:null}function Tt(e,t){(0,z.useEffect)(()=>{let t=e.current;if(!t)return;let n=`canvas-text-disclosure-${++gt}`,r=document.createElement(`div`);r.id=n,r.className=`canvas-text-popover`,r.setAttribute(`role`,`tooltip`),r.hidden=!0,document.body.appendChild(r);let i=new Map,a=new Set,o=new Set,s=!1,c=!1,l=null,u=0,d=0,f=e=>{let t=e.getBoundingClientRect();r.style.maxWidth=`${Math.max(180,Math.min(420,window.innerWidth-24))}px`,r.style.left=`0px`,r.style.top=`0px`;let n=r.getBoundingClientRect(),i=Math.min(window.innerWidth-n.width-12,Math.max(12,t.left)),a=t.top-n.height-8,o=a>=12?a:Math.min(window.innerHeight-n.height-12,t.bottom+8);r.style.left=`${Math.round(i)}px`,r.style.top=`${Math.round(Math.max(12,o))}px`},p=()=>{d&&window.clearTimeout(d),d=0,l?.removeAttribute(`data-text-disclosure-active`),l=null,r.hidden=!0},m=(e,t)=>{d&&window.clearTimeout(d),l?.removeAttribute(`data-text-disclosure-active`),l=e,e.setAttribute(`data-text-disclosure-active`,`true`),r.textContent=t,r.hidden=!1,f(e)},h=({source:e,target:t,full:r})=>{if(e.setAttribute(`data-text-disclosure`,`true`),a.add(e),i.has(t))return;let o=t.hasAttribute(`tabindex`),s=t.hasAttribute(`role`),c=t.getAttribute(`aria-label`),u=t.getAttribute(`aria-describedby`);o||t.setAttribute(`tabindex`,`0`),!s&&!Ct(t)&&t.setAttribute(`role`,`button`),c||t.setAttribute(`aria-label`,r);let f=new Set(_t(u).split(` `).filter(Boolean));f.add(n),t.setAttribute(`aria-describedby`,[...f].join(` `)),t.setAttribute(`data-text-disclosure`,`true`);let h=()=>m(t,r),g=()=>{d=window.setTimeout(p,120)},_=()=>l===t?p():m(t,r),v=e=>{let n=e.key;n===`Escape`&&p(),(n===`Enter`||n===` `)&&!Ct(t)&&(e.preventDefault(),m(t,r))};t.addEventListener(`pointerenter`,h),t.addEventListener(`pointerleave`,g),t.addEventListener(`focus`,h),t.addEventListener(`blur`,g),t.addEventListener(`click`,_),t.addEventListener(`keydown`,v),i.set(t,()=>{t.removeEventListener(`pointerenter`,h),t.removeEventListener(`pointerleave`,g),t.removeEventListener(`focus`,h),t.removeEventListener(`blur`,g),t.removeEventListener(`click`,_),t.removeEventListener(`keydown`,v),t.removeAttribute(`data-text-disclosure`),t.removeAttribute(`data-text-disclosure-active`),o||t.removeAttribute(`tabindex`),s||t.removeAttribute(`role`),c||t.removeAttribute(`aria-label`),u===null?t.removeAttribute(`aria-describedby`):t.setAttribute(`aria-describedby`,u)})},g=e=>{let n=e instanceof HTMLElement?e:e.parentElement;for(;n&&n.parentElement!==t;)n=n.parentElement;return n},_=()=>{if(u=0,c){c=!1;for(let[e,t]of i)e.isConnected||(t(),i.delete(e));for(let e of a)e.isConnected||(e.removeAttribute(`data-text-disclosure`),a.delete(e))}let e=s?[t]:[...o].filter(e=>t.contains(e));s=!1,o.clear();let n=[];for(let r of e){let e=yt(r);if(r!==t){let t=wt(r,e);t&&n.push(t)}for(let t of r.querySelectorAll(`*`)){let r=wt(t,e);r&&n.push(r)}}for(let e of n)h(e)},v=()=>{u||=requestAnimationFrame(_)},y=()=>{s=!0,v()},b=e=>{l&&!l.contains(e.target)&&p()},x=()=>{l&&!r.hidden&&f(l)};y();let S=window.setTimeout(y,700),C=typeof MutationObserver>`u`?null:new MutationObserver(e=>{for(let t of e){if(t.removedNodes.length){c=!0;let e=g(t.target);e&&o.add(e)}for(let e of t.addedNodes){let t=g(e);t&&o.add(t)}}(o.size||c)&&v()});C?.observe(t,{childList:!0,subtree:!0});let w=-1,T=typeof ResizeObserver>`u`?null:new ResizeObserver(e=>{let t=e.at(-1)?.contentRect.width??w;t!==w&&(w=t,y())});return T?.observe(t),document.addEventListener(`pointerdown`,b,!0),window.addEventListener(`resize`,x,{passive:!0}),window.addEventListener(`scroll`,x,{passive:!0,capture:!0}),()=>{u&&cancelAnimationFrame(u),d&&window.clearTimeout(d),clearTimeout(S),C?.disconnect(),T?.disconnect(),document.removeEventListener(`pointerdown`,b,!0),window.removeEventListener(`resize`,x),window.removeEventListener(`scroll`,x,!0);for(let e of i.values())e();for(let e of a)e.removeAttribute(`data-text-disclosure`);r.remove()}},[e,t])}function Et(e){if(!e)return;let t=e.parentElement;if(!t)return;let n=()=>{let n=Math.ceil(e.getBoundingClientRect().width);n>0&&t.style.setProperty(`--block-actions-w`,`${n+18}px`)};return n(),U(e,n)}function Dt(e){return e.some(e=>typeof e.section==`string`&&e.section.trim()!==``)}function Ot(e){if(!Dt(e))return[{label:``,order:0,standard:e.slice(),deeper:[]}];let t=0,n=new Map;for(let r of e){let e=r.section,i=(typeof e==`string`?e.trim():``)||`__ungrouped__`;if(!n.has(i)){let e=typeof r.order==`number`?r.order:0;n.set(i,{ord:e||++t,standard:[],deeper:[]})}let a=n.get(i),o=r.depth;(typeof o==`number`?o:1)>=2?a.deeper.push(r):a.standard.push(r)}let r=[];for(let[e,t]of n)t.standard.length===0&&t.deeper.length>0&&t.standard.push(t.deeper.shift()),r.push({label:e===`__ungrouped__`?``:e,order:t.ord,standard:t.standard,deeper:t.deeper});return r.sort((e,t)=>e.order-t.order),r}i();var kt=[{col:6},{col:6}];function At({section:e,renderCard:t,readingMode:n}){let[r,i]=(0,z.useState)(!1),[o,c]=(0,z.useState)(null),[l,u]=(0,z.useState)(!1),d=(0,z.useRef)(!0);(0,z.useEffect)(()=>(d.current=!0,()=>{d.current=!1}),[]);let f=e.deeper.length>0?e.deeper:o??[],p=e.deeper.length===0&&o===null&&P(e.label,e.standard),m=f.length>0||p,h=n&&f.length>0||r,g=`depth-drawer-${e.order}`;return(0,W.jsxs)(`div`,{className:`depth-section`,children:[e.label&&(0,W.jsxs)(`div`,{className:`depth-section-header`,children:[e.order>0&&(0,W.jsx)(`span`,{className:`depth-section-num`,"aria-hidden":`true`,children:e.order}),(0,W.jsx)(`span`,{className:`depth-section-label`,children:e.label}),m&&(0,W.jsxs)(`button`,{type:`button`,className:`depth-go-deeper`+(h?` is-open`:``),"aria-expanded":h,"aria-controls":g,"aria-busy":l||void 0,onClick:()=>{let t=!r;i(t),!(!t||!p||l)&&(u(!0),a(async()=>{let{deepenSection:e}=await import(`./deepen-DAeHHFiI.js`);return{deepenSection:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24])).then(({deepenSection:t})=>t(e.label,e.standard)).then(e=>{d.current&&(u(!1),e&&e.length>0?c(e):i(!1))}).catch(()=>{d.current&&(u(!1),i(!1))}))},children:[(0,W.jsx)(s.arrowDown,{className:`depth-deeper-icon`,"aria-hidden":`true`}),`Go deeper`,f.length>0&&(0,W.jsxs)(`span`,{className:`depth-deeper-count`,children:[`(`,f.length,`)`]})]})]}),(0,W.jsx)(`div`,{className:`card-grid`,children:e.standard.map((e,n)=>t(e,n))}),m&&(0,W.jsx)(`div`,{className:`depth-drawer`+(h?` is-open`:``),id:g,"aria-hidden":!h,children:(0,W.jsx)(`div`,{className:`depth-drawer-inner`,children:(0,W.jsx)(`div`,{className:`card-grid depth-drawer-grid`,"aria-busy":l||void 0,children:l&&f.length===0?(0,W.jsx)(E,{blocks:kt}):f.map((n,r)=>t(n,e.standard.length+r))})})})]})}function jt(e){let t=(0,B.c)(33),{bend:n}=e,[r,i]=(0,z.useState)(n.param.value),a=n.param.unit??``,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,W.jsx)(`span`,{className:`bend-kicker`,children:`BEND IT`}),t[0]=o):o=t[0];let s;t[1]===n.label?s=t[2]:(s=(0,W.jsx)(`span`,{className:`bend-label`,children:n.label}),t[1]=n.label,t[2]=s);let c;t[3]===r?c=t[4]:(c=I(r),t[3]=r,t[4]=c);let l;t[5]===a?l=t[6]:(l=a&&(0,W.jsx)(`em`,{children:a}),t[5]=a,t[6]=l);let u;t[7]!==c||t[8]!==l?(u=(0,W.jsxs)(`span`,{className:`bend-value`,children:[c,l]}),t[7]=c,t[8]=l,t[9]=u):u=t[9];let d;t[10]!==s||t[11]!==u?(d=(0,W.jsxs)(`div`,{className:`bend-head`,children:[o,s,u]}),t[10]=s,t[11]=u,t[12]=d):d=t[12];let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>i(Number(e.target.value)),t[13]=f):f=t[13];let p=`Bend ${n.label}`,m;t[14]!==n.param.max||t[15]!==n.param.min||t[16]!==n.param.step||t[17]!==p||t[18]!==r?(m=(0,W.jsx)(`input`,{className:`bend-slider`,type:`range`,min:n.param.min,max:n.param.max,step:n.param.step,value:r,onChange:f,"aria-label":p}),t[14]=n.param.max,t[15]=n.param.min,t[16]=n.param.step,t[17]=p,t[18]=r,t[19]=m):m=t[19];let h;if(t[20]!==n.label||t[21]!==n.outputs||t[22]!==r){let e;t[24]!==n.label||t[25]!==r?(e=e=>{let t=L(e.formula,r);return t===null?null:(0,W.jsxs)(`li`,{title:`= ${e.formula.replaceAll(`x`,`(${n.label})`)}`,children:[(0,W.jsx)(`span`,{className:`bend-out-label`,children:e.label}),(0,W.jsxs)(`span`,{className:`bend-out-value`,children:[I(t),e.unit&&(0,W.jsx)(`em`,{children:e.unit})]})]},e.label)},t[24]=n.label,t[25]=r,t[26]=e):e=t[26],h=n.outputs.map(e),t[20]=n.label,t[21]=n.outputs,t[22]=r,t[23]=h}else h=t[23];let g;t[27]===h?g=t[28]:(g=(0,W.jsx)(`ul`,{className:`bend-outputs`,children:h}),t[27]=h,t[28]=g);let _;return t[29]!==g||t[30]!==d||t[31]!==m?(_=(0,W.jsxs)(`div`,{className:`bend-strip`,"data-bend":!0,children:[d,m,g]}),t[29]=g,t[30]=d,t[31]=m,t[32]=_):_=t[32],_}var Mt=15e3,Nt=5e3;async function Pt(e,t){let n=ee(e);if(!n)return{ok:!1,detail:`Unknown action: ${e}`};for(let e of n.params)if(e.required&&!(t[e.name]??``).trim())return{ok:!1,detail:`Missing required field: ${e.name}`};try{let r=JSON.stringify({args:t}),i=await R(`/actions/confirm`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,args:t})},Nt),a=await i.json().catch(()=>({}));if(!i.ok||!a.confirmationToken)return{ok:!1,detail:a.detail||`The action confirmation expired. Please try again.`};let o=await R(`/actions/${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`,"x-action-confirmation":a.confirmationToken},body:r},Mt),s=await o.json().catch(()=>({}));return o.ok?{ok:!0,detail:s.detail||`${n.label} — done.`}:{ok:!1,detail:s.detail||`The ${n.mcp} action didn't go through (${o.status}).`}}catch{return{ok:!1,detail:`Couldn't reach the ${n.mcp} connector — is it set up in this deployment?`}}}function Ft({id:e,label:t,args:n={},delay:r=0}){let i=ee(e),[a,o]=(0,z.useState)(`idle`),[s,c]=(0,z.useState)(``);if(!i)return null;let l={};for(let[e,t]of Object.entries(n))l[e]=typeof t==`string`?t:t==null?``:String(t);return(0,W.jsxs)(`div`,{className:`card reveal`,style:{animationDelay:`${r}ms`},children:[(0,W.jsx)(`div`,{className:`card-eyebrow`,children:i.label}),(0,W.jsx)(`div`,{style:{fontWeight:600,fontSize:15,marginBottom:10},children:t||i.desc}),(0,W.jsx)(`dl`,{style:{margin:`0 0 12px`,display:`grid`,gap:4},children:i.params.map(e=>{let t=l[e.name];return t?(0,W.jsxs)(`div`,{style:{display:`flex`,gap:8,fontSize:13},children:[(0,W.jsx)(`dt`,{className:`faint`,style:{minWidth:84},children:e.name}),(0,W.jsx)(`dd`,{style:{margin:0},children:t})]},e.name):null})}),a===`done`?(0,W.jsxs)(`div`,{style:{fontSize:13,color:`var(--insight)`},children:[`✓ `,s]}):a===`error`?(0,W.jsx)(`div`,{style:{fontSize:13,color:`var(--warning)`},children:s}):(0,W.jsx)(`button`,{className:`entry-action`,onClick:async()=>{o(`running`);let t=await Pt(e,l);c(t.detail),o(t.ok?`done`:`error`)},disabled:a===`running`,style:{fontSize:13},children:a===`running`?`Working…`:i.cta}),(0,W.jsx)(`div`,{className:`faint`,style:{fontSize:11.5,marginTop:8},children:`Review before confirming. You are responsible for recipients, account changes, irreversible effects, provider terms, charges, and other consequences.`})]})}var It=6;function Lt(e,t){return e?.find(e=>e.key===t)}function Rt(e,t){return!e||e.kind!==`card`?!1:!e.accepts||e.accepts.includes(t)}function zt(e,t,n){let[r,i]=(0,z.useState)(null),a=(0,z.useRef)(null),o=(0,z.useRef)(null),s=(0,z.useRef)(e);s.current=e;let c=(0,z.useRef)(t);c.current=t;let l=(0,z.useRef)(n);l.current=n;let u=()=>{o.current?.classList.remove(`is-drop-target`),o.current=null},d=(e,t,n)=>{let r=document.elementFromPoint(e,t)?.closest(`[data-blank-key]`)??null,i=r?.getAttribute(`data-blank-key`)??``;return r&&Rt(Lt(s.current,i),n)?{el:r,key:i}:null};return{handleProps:(0,z.useCallback)(e=>({onPointerDown:t=>{t.button===0&&(a.current={block:e,startX:t.clientX,startY:t.clientY,armed:!1},t.currentTarget.setPointerCapture(t.pointerId))},onPointerMove:e=>{let t=a.current;if(!t)return;if(!t.armed){if(Math.hypot(e.clientX-t.startX,e.clientY-t.startY)<It)return;t.armed=!0}i({label:m(t.block),x:e.clientX,y:e.clientY});let n=d(e.clientX,e.clientY,t.block.type);if(o.current&&o.current!==n?.el&&u(),n){let e=n.el.querySelector(`.blank-drop`)??n.el;e.classList.add(`is-drop-target`),o.current=e}},onPointerUp:e=>{let t=a.current;if(a.current=null,i(null),u(),t){if(t.armed){let n=d(e.clientX,e.clientY,t.block.type);n&&c.current(n.key,t.block)}else l.current?.(t.block)}}}),[]),ghost:r?(0,W.jsx)(`div`,{className:`card-drag-ghost`,style:{left:r.x,top:r.y},"aria-hidden":!0,children:r.label}):null}}function Bt(e){let t=e.find(e=>e.type===`insight`&&!!e.id);return t?.id?t.id:e.find(e=>!!e.id)?.id??null}var Vt=340;function Ht(e){let t=(0,B.c)(9),{block:n,renderBlock:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={width:Vt},t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,W.jsx)(p,{block:n}),t[1]=n,t[2]=a);let o;t[3]!==n||t[4]!==r?(o=r(n),t[3]=n,t[4]=r,t[5]=o):o=t[5];let s;return t[6]!==a||t[7]!==o?(s=(0,W.jsx)(`span`,{className:`filmstrip-thumb`,"aria-hidden":`true`,inert:!0,children:(0,W.jsx)(`span`,{className:`filmstrip-thumb-design`,style:i,children:(0,W.jsx)(f,{fallback:a,children:o})})}),t[6]=a,t[7]=o,t[8]=s):s=t[8],s}var Ut=(0,z.memo)(Ht,(e,t)=>e.block===t.block),Wt=24;function Gt(e){let t=(0,B.c)(21),{blocks:n,activeId:r,narratingId:i,onPick:a,renderBlock:o}=e,s=n.slice(0,Wt),c=n.length-s.length,l=(0,z.useRef)(null),u;t[0]===r?u=t[1]:(u=e=>e.id===r,t[0]=r,t[1]=u);let d=Math.max(0,s.findIndex(u)),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{let e=window.setTimeout(()=>{let e=l.current?.querySelector(`.filmstrip-entry.active`);e&&typeof e.scrollIntoView==`function`&&e.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:_()?`auto`:`smooth`})},60);return()=>window.clearTimeout(e)},t[2]=f):f=t[2];let p;t[3]===r?p=t[4]:(p=[r],t[3]=r,t[4]=p),(0,z.useEffect)(f,p);let g=e=>{let t=s.length;if(!t)return;let n=document.activeElement,r=n instanceof HTMLElement?n.dataset.idx:void 0,i=r===void 0?d:Number(r),o;bb37:switch(e.key){case`ArrowDown`:case`ArrowRight`:o=Math.min(t-1,i+1);break bb37;case`ArrowUp`:case`ArrowLeft`:o=Math.max(0,i-1);break bb37;case`Home`:o=0;break bb37;case`End`:o=t-1;break bb37;default:return}e.preventDefault(),l.current?.querySelector(`[data-idx="${o}"]`)?.focus();let c=s[o].id;c&&a(c)},v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,W.jsx)(`div`,{className:`filmstrip-eyebrow`,children:`In this view`}),t[5]=v):v=t[5];let y;t[6]!==r||t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==d?(y=(e,t)=>{let n=e.id===r,s=!!e.id&&e.id===i;return(0,W.jsxs)(`div`,{role:`button`,"data-idx":t,tabIndex:t===d?0:-1,className:`filmstrip-entry`+(n?` active`:``)+(s?` speaking`:``),"aria-current":n?`true`:void 0,"aria-label":`${h(e)} — ${m(e)}`,onClick:()=>a(e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),a(e.id))},children:[(0,W.jsx)(Ut,{block:e,renderBlock:o}),s&&(0,W.jsx)(`span`,{className:`filmstrip-speaking`,"aria-hidden":`true`}),(0,W.jsxs)(`span`,{className:`filmstrip-meta`,children:[(0,W.jsx)(`span`,{className:`filmstrip-kind`,children:h(e)}),(0,W.jsx)(`span`,{className:`filmstrip-title`,children:m(e)})]})]},e.id)},t[6]=r,t[7]=i,t[8]=a,t[9]=o,t[10]=d,t[11]=y):y=t[11];let b=s.map(y),x;t[12]===c?x=t[13]:(x=c>0&&(0,W.jsxs)(`div`,{className:`filmstrip-more`,children:[`+`,c,` more card`,c===1?``:`s`]}),t[12]=c,t[13]=x);let S;t[14]!==g||t[15]!==b||t[16]!==x?(S=(0,W.jsxs)(`div`,{className:`filmstrip-list`,ref:l,role:`toolbar`,onKeyDown:g,children:[b,x]}),t[14]=g,t[15]=b,t[16]=x,t[17]=S):S=t[17];let C;return t[18]!==S||t[19]!==v?(C=(0,W.jsxs)(`aside`,{className:`filmstrip-rail`,"aria-label":`All cards in this view`,children:[v,S]}),t[18]=S,t[19]=v,t[20]=C):C=t[20],C}var Kt=560;function qt(e){let t=(0,B.c)(93),{data:n,blocks:r,spot:i,renderBlock:a,onAskBlock:o,selectedBlockIds:c,onNarrate:l,narratingId:u,muted:d,walkNotes:h,presenting:g}=e,v;t[0]===r?v=t[1]:(v=r.filter(Jt),t[0]=r,t[1]=v);let y=v,[b,x]=(0,z.useState)(null),S;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>x(null),t[2]=S):S=t[2];let C;t[3]===n.id?C=t[4]:(C=[n.id],t[3]=n.id,t[4]=C),(0,z.useEffect)(S,C);let w;t[5]!==l||t[6]!==y?(w=e=>{x(e);let t=y.find(t=>t.id===e);t&&l?.(t)},t[5]=l,t[6]=y,t[7]=w):w=t[7];let T=w,E;t[8]!==b||t[9]!==y||t[10]!==i?(E=(b&&y.some(e=>e.id===b)?b:null)??(i&&y.some(e=>e.id===i)?i:null)??Bt(y),t[8]=b,t[9]=y,t[10]=i,t[11]=E):E=t[11];let D=E,O;t[12]!==D||t[13]!==y?(O=y.find(e=>e.id===D)??y[0],t[12]=D,t[13]=y,t[14]=O):O=t[14];let k=O,[A,j]=(0,z.useState)(null),M=(0,z.useRef)(k?.id??null),N;t[15]===k?.id?N=t[16]:(N=()=>{let e=k?.id??null;if(e===M.current)return;let t=M.current;if(M.current=e,!t||_()){j(null);return}j(t);let n=window.setTimeout(()=>j(null),Kt);return()=>window.clearTimeout(n)},t[15]=k?.id,t[16]=N);let P=k?.id,F;t[17]===P?F=t[18]:(F=[P],t[17]=P,t[18]=F),(0,z.useEffect)(N,F);let I;t[19]!==k||t[20]!==c?(I=!!k?.id&&!!c?.has(k.id),t[19]=k,t[20]=c,t[21]=I):I=t[21];let L=I,ee=!d&&!!k?.id&&u===k.id,R=k?.note||null,te;t[22]!==k?.id||t[23]!==A||t[24]!==y?(te=A&&A!==k?.id?y.find(e=>e.id===A):void 0,t[22]=k?.id,t[23]=A,t[24]=y,t[25]=te):te=t[25];let ne=te,re;t[26]===k?.id?re=t[27]:(re=e=>e.id===k?.id,t[26]=k?.id,t[27]=re);let V=y.findIndex(re),H;t[28]!==V||t[29]!==T||t[30]!==y?(H=()=>{V>0&&T(y[V-1].id)},t[28]=V,t[29]=T,t[30]=y,t[31]=H):H=t[31];let U=H,G;t[32]!==V||t[33]!==T||t[34]!==y?(G=()=>{V<y.length-1&&T(y[V+1].id)},t[32]=V,t[33]=T,t[34]=y,t[35]=G):G=t[35];let K=G,ie,ae;if(t[36]!==K||t[37]!==U||t[38]!==g?(ie=()=>{if(!g)return;let e=e=>{e.key===`ArrowRight`||e.key===`ArrowDown`||e.key===` `?(e.preventDefault(),K()):(e.key===`ArrowLeft`||e.key===`ArrowUp`)&&(e.preventDefault(),U())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},ae=[g,U,K],t[36]=K,t[37]=U,t[38]=g,t[39]=ie,t[40]=ae):(ie=t[39],ae=t[40]),(0,z.useEffect)(ie,ae),!k)return null;let q,J;if(t[41]!==T||t[42]!==k.id||t[43]!==g||t[44]!==h){let e=!g&&h&&h.length>0?[...h].reverse():null;q=`focus-stage`+(e?` has-notes`:``),J=e&&(0,W.jsxs)(`aside`,{className:`focus-notes`,"aria-label":`Mavéa's notes`,children:[(0,W.jsx)(`div`,{className:`focus-notes-eyebrow`,children:`Mavéa’s notes`}),(0,W.jsx)(`ol`,{className:`focus-notes-list`,children:e.map(e=>(0,W.jsx)(`li`,{children:(0,W.jsx)(`button`,{type:`button`,className:`focus-note`+(e.spot===k?.id?` active`:``),onClick:()=>T(e.spot),title:`Bring this card back on stage`,children:e.text})},e.spot))})]}),t[41]=T,t[42]=k.id,t[43]=g,t[44]=h,t[45]=q,t[46]=J}else q=t[45],J=t[46];let Y;t[47]!==ne||t[48]!==a?(Y=ne&&(0,W.jsx)(`div`,{className:`focus-hero-card focus-out`,"aria-hidden":`true`,children:(0,W.jsx)(f,{fallback:(0,W.jsx)(p,{block:ne}),children:a(ne)})},`out-`+ne.id),t[47]=ne,t[48]=a,t[49]=Y):Y=t[49];let oe=k.id,se=k.id,X;t[50]===ee?X=t[51]:(X=ee&&(0,W.jsxs)(`div`,{className:`focus-speaking`,"aria-hidden":`true`,children:[(0,W.jsxs)(`span`,{className:`focus-speaking-bars`,children:[(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{}),(0,W.jsx)(`i`,{})]}),`Speaking`]}),t[50]=ee,t[51]=X);let ce;t[52]===k?ce=t[53]:(ce=(0,W.jsx)(p,{block:k}),t[52]=k,t[53]=ce);let le;t[54]!==k||t[55]!==a?(le=a(k),t[54]=k,t[55]=a,t[56]=le):le=t[56];let ue;t[57]!==ce||t[58]!==le?(ue=(0,W.jsx)(f,{fallback:ce,children:le}),t[57]=ce,t[58]=le,t[59]=ue):ue=t[59];let Z;t[60]!==k||t[61]!==L||t[62]!==o?(Z=o&&k.id&&(0,W.jsx)(`div`,{className:`block-actions`,children:(0,W.jsxs)(`button`,{type:`button`,className:`block-action-pill block-ask`+(L?` picked`:``),"aria-pressed":L,"aria-label":L?`Unpin ${m(k)}`:`Ask about ${m(k)}`,onClick:e=>{e.stopPropagation(),o(k)},children:[(0,W.jsx)(s.chat,{}),(0,W.jsx)(`span`,{className:`block-pill-label`,children:L?`Selected`:`Ask`})]})}),t[60]=k,t[61]=L,t[62]=o,t[63]=Z):Z=t[63];let Q;t[64]!==k.id||t[65]!==X||t[66]!==ue||t[67]!==Z?(Q=(0,W.jsxs)(`div`,{className:`focus-hero-card focus-in askable`,"data-spot-id":se,children:[X,ue,Z]},oe),t[64]=k.id,t[65]=X,t[66]=ue,t[67]=Z,t[68]=Q):Q=t[68];let $;t[69]!==Y||t[70]!==Q?($=(0,W.jsxs)(`div`,{className:`focus-hero`,children:[Y,Q]}),t[69]=Y,t[70]=Q,t[71]=$):$=t[71];let de;t[72]!==k.id||t[73]!==R?(de=R&&(0,W.jsx)(`p`,{className:`focus-caption`,"aria-live":`polite`,children:R},`cap-`+k.id),t[72]=k.id,t[73]=R,t[74]=de):de=t[74];let fe;t[75]!==$||t[76]!==de?(fe=(0,W.jsxs)(`div`,{className:`focus-main`,children:[$,de]}),t[75]=$,t[76]=de,t[77]=fe):fe=t[77];let pe;t[78]!==V||t[79]!==K||t[80]!==T||t[81]!==U||t[82]!==k.id||t[83]!==u||t[84]!==g||t[85]!==y||t[86]!==a?(pe=g?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{type:`button`,className:`present-arrow present-arrow-prev`,onClick:U,disabled:V<=0,"aria-label":`Previous slide`,children:(0,W.jsx)(s.chevL,{})}),(0,W.jsx)(`button`,{type:`button`,className:`present-arrow present-arrow-next`,onClick:K,disabled:V>=y.length-1,"aria-label":`Next slide`,children:(0,W.jsx)(s.chevR,{})}),(0,W.jsx)(`div`,{className:`present-nav`,"aria-label":`Slide navigation`,children:(0,W.jsxs)(`span`,{className:`present-nav-count`,"aria-live":`polite`,"aria-atomic":`true`,children:[V+1,` `,(0,W.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),` `,y.length]})})]}):(0,W.jsx)(Gt,{blocks:y,activeId:k.id??null,narratingId:u??null,onPick:T,renderBlock:a}),t[78]=V,t[79]=K,t[80]=T,t[81]=U,t[82]=k.id,t[83]=u,t[84]=g,t[85]=y,t[86]=a,t[87]=pe):pe=t[87];let me;return t[88]!==q||t[89]!==J||t[90]!==fe||t[91]!==pe?(me=(0,W.jsxs)(`div`,{className:q,children:[J,fe,pe]}),t[88]=q,t[89]=J,t[90]=fe,t[91]=pe,t[92]=me):me=t[92],me}function Jt(e){return!!e.id}var Yt=[{mode:`focus`,label:`Focus`},{mode:`everything`,label:`Everything`}];function Xt(e){let t=(0,B.c)(5),{value:n,onChange:r}=e,i;t[0]!==r||t[1]!==n?(i=Yt.map(e=>{let t=n===e.mode;return(0,W.jsx)(`button`,{type:`button`,className:`focus-toggle-opt`+(t?` active`:``),"aria-pressed":t,onClick:()=>r(e.mode),children:e.label},e.mode)}),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a;return t[3]===i?a=t[4]:(a=(0,W.jsx)(`div`,{className:`focus-toggle`,role:`group`,"aria-label":`Canvas view`,children:i}),t[3]=i,t[4]=a),a}var Zt=e({TopicCanvas:()=>cn});i();var Qt=(0,z.lazy)(()=>a(()=>import(`./ReplayCard-B6NYiYzQ.js`).then(e=>e.t).then(e=>({default:e.ReplayCard})),__vite__mapDeps([25,4,26,27,9,3,28,29,30,31,32,33,34,35,8,36,37,38,39,10,40]))),$t=1,en=1.75,tn=.15,nn=1.15;function rn(e){return typeof e!=`number`||!Number.isFinite(e)?6:Math.min(12,Math.max(1,Math.round(e)))}function an(e,t){let n=s[e]||s.layers;return(0,W.jsx)(n,{className:`ic`,style:{color:t||`var(--presence)`}})}function on({block:e,nest:t,spotlight:n,dimmed:r,spot:i,onProve:a,onUnrenderable:o}){let s={delay:e.delay};if(e.type===`composite`){if(t>=2)return null;let n=e.props;return(0,W.jsxs)(`div`,{className:`card reveal cmp-card`,style:{"--delay":(e.delay||0)+`ms`},children:[(0,W.jsxs)(`div`,{className:`card-eyebrow`,children:[n.icon&&an(n.icon,n.iconColor),` `,n.title]}),(0,W.jsx)(`div`,{className:`cmp-grid`,children:n.regions.map((e,n)=>(0,W.jsx)(`div`,{className:`cmp-cell`,"data-spot-id":e.block.id,"data-kind":e.block.type,style:{"--cmp-span":rn(e.span)},children:(0,W.jsx)(sn,{block:e.block,nest:t+1,spotlight:!!e.block.id&&i===e.block.id,dimmed:!!e.block.id&&!!i&&i!==e.block.id,spot:e.block.type===`composite`?i:null,onProve:a,onUnrenderable:o})},n))}),n.footer&&(0,W.jsx)(`div`,{className:`cmp-foot`,children:n.footer})]})}if(e.type===`insight`)return(0,W.jsx)(ye,{num:e.num,...e.props,...s,spotlight:n,dimmed:r,onProve:e.prove?a:void 0});if(e.type===`chart`)return(0,W.jsx)(xe,{...e.props,...s});if(e.type===`breakdown`)return(0,W.jsx)(Se,{...e.props,...s});if(e.type===`timeline`)return(0,W.jsx)(Ce,{...e.props,...s});if(e.type===`list`)return(0,W.jsx)(Te,{...e.props,...s});if(e.type===`compare`)return(0,W.jsx)(Ee,{...e.props,...s});if(e.type===`ring`)return(0,W.jsx)(je,{...e.props,...s});if(e.type===`bars`)return(0,W.jsx)(Me,{...e.props,...s});if(e.type===`stack`)return(0,W.jsx)(Ne,{...e.props,...s});if(e.type===`scatter`)return(0,W.jsx)(Pe,{...e.props,...s});if(e.type===`heat`)return(0,W.jsx)(Fe,{...e.props,...s});if(e.type===`flow`)return(0,W.jsx)(Ie,{...e.props,...s});if(e.type===`web`)return(0,W.jsx)(Le,{...e.props,...s});if(e.type===`gallery`)return(0,W.jsx)(Ve,{...e.props,...s});if(e.type===`codemap`)return(0,W.jsx)(He,{...e.props,...s});if(e.type===`diff`)return(0,W.jsx)(Ue,{...e.props,...s});if(e.type===`checks`)return(0,W.jsx)(Ke,{...e.props,...s});if(e.type===`donut`)return(0,W.jsx)(qe,{...e.props,...s});if(e.type===`gauge`)return(0,W.jsx)(Je,{...e.props,...s});if(e.type===`scoreboard`)return(0,W.jsx)(Ye,{...e.props,...s});if(e.type===`standings`)return(0,W.jsx)(Xe,{...e.props,...s});if(e.type===`pipeline`)return(0,W.jsx)(Ze,{...e.props,...s});if(e.type===`kpi`)return(0,W.jsx)($e,{...e.props,...s});if(e.type===`quotes`)return(0,W.jsx)(et,{...e.props,...s});if(e.type===`checklist`)return(0,W.jsx)(tt,{...e.props,...s});if(e.type===`understand`)return(0,W.jsx)(nt,{...e.props,...s});if(e.type===`schema`)return(0,W.jsx)(rt,{...e.props,...s});if(e.type===`screenmap`)return(0,W.jsx)(at,{...e.props,...s});if(e.type===`buildprog`)return(0,W.jsx)(ot,{...e.props,...s});if(e.type===`preview`)return(0,W.jsx)(st,{...e.props,...s});if(e.type===`action`){let t=e.props;return(0,W.jsx)(Ft,{...t,...s})}let c=e,l=d(c.type);if(l){let e=l(c.props,{delay:c.delay,spotlight:n,dimmed:r,blockId:c.id,onUnrenderable:o});return ae.has(c.type)?(0,W.jsx)(K,{children:e}):e}return(0,W.jsx)(p,{block:e})}var sn=(0,z.memo)(on);function cn({data:e,spot:t,built:n,onProve:r,onAskBlock:i,onAddToDashboard:a,selectedBlockIds:o,viewMode:c,onViewMode:l,onNarrate:u,narratingId:d,muted:h,noteGutter:g,walkNotes:_,bend:v,onAddToFlashcard:y,flashedIds:b,headerSlot:S,viewSlot:w,belowHeaderSlot:E,presenting:D,blankFill:O}){let[k,A]=(0,z.useState)(null),[j,M]=(0,z.useState)(!1),[N,P]=(0,z.useState)(null),[F,I]=(0,z.useState)(nn);(0,z.useEffect)(()=>{if(!N)return;let e=e=>{e.key===`Escape`&&P(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[N]);let L=(0,z.useRef)(null),[ee]=le(),[R,B]=(0,z.useState)(()=>new Set);(0,z.useEffect)(()=>{B(e=>e.size?new Set:e)},[e.id]);let re=(0,z.useCallback)(e=>{B(t=>t.has(e)?t:new Set(t).add(e))},[]),V=(0,z.useMemo)(()=>R.size?e.blocks.filter(e=>!e.id||!R.has(e.id)):e.blocks,[e.blocks,R]),{displayBlocks:H=V,budget:U}=dt(V,L),G=ne(e.blocks,e.id),K=`${e.id}:${G}:${U}`;mt(L,K),Tt(L,K);let ie=e.blocks.find(e=>e.type===`preview`),ae=ie?ie.props:null,q=c!==void 0&&H.filter(e=>!!e.id).length>=2,J=q&&c===`focus`,Y=c!==void 0&&T(e),oe=Y&&c===`canvas`,se=(0,z.useRef)(c);se.current=c,(0,z.useEffect)(()=>{se.current===`canvas`&&l?.(`everything`)},[e.id,l]);let X=e.blanks?.filter(e=>e.kind===`card`)??[],ce=!!O&&X.length>0,ue=zt(e.blanks,(e,t)=>O?.fill({kind:`card`,key:e,label:m(t),block:t}),e=>{let t=X.find(e=>e.key===O?.activeKey)??X[0];t&&O?.fill({kind:`card`,key:t.key,label:m(e),block:e})}),Z=(0,z.useRef)(r);Z.current=r;let Q=(0,z.useCallback)(()=>Z.current(),[]),$=e=>(0,W.jsx)(sn,{block:e,nest:0,spotlight:!!e.id&&t===e.id,dimmed:!!e.id&&!!t&&t!==e.id,spot:e.type===`composite`?t:null,onProve:Q,onUnrenderable:re}),de=t=>t.kind===`slide`?(0,W.jsx)(Oe,{...t.props}):t.kind===`action`?(0,W.jsx)(Ae,{...t.props,onConfirm:ae?()=>A(ae):void 0}):t.kind===`replay`?(0,W.jsx)(z.Suspense,{fallback:null,children:(0,W.jsx)(Qt,{...t.props,spec:e})}):null,fe=(0,z.useMemo)(()=>Ot(H).map(e=>({...e,standard:ut(e.standard,U),deeper:ut(e.deeper,U)})),[H,U]),[pe,me]=(0,z.useState)(null);pe!==e.id&&Dt(H)&&me(e.id);let he=pe===e.id,_e=fe.some(e=>e.deeper.length>0),ve=(e,n)=>{let r=!!e.id,c=r&&t===e.id,l=r&&!!t&&t!==e.id,u=r&&!!i,d=r&&!!a,h=r&&!!y,g=h&&!!b?.has(e.id),_=u&&!!o?.has(e.id),x=r&&(u||d||h),S=ce&&r&&e.type!==`blanks`;return(0,W.jsxs)(`div`,{className:`col-`+e.col+(c?` spotlit`:``)+(l?` dimmed`:``)+(u?` askable`:``)+(d?` addable`:``)+(h?` flashcardable`:``)+(x?` zoomable`:``)+(_?` picked`:``),"data-spot-id":e.id,"data-kind":e.type,children:[(0,W.jsx)(f,{fallback:(0,W.jsx)(p,{block:e}),children:$(e)}),v&&v.blockId===e.id&&(0,W.jsx)(jt,{bend:v}),(u||d||h||x||S)&&(0,W.jsxs)(`div`,{className:`block-actions`,ref:Et,children:[S&&(0,W.jsx)(`button`,{type:`button`,className:`card-drag-handle`,title:`Drag ${m(e)} into a slot`,"aria-label":`Use ${m(e)} to fill a slot`,...ue.handleProps(e),children:(0,W.jsx)(`span`,{"aria-hidden":!0,children:`⠿`})}),u&&(0,W.jsxs)(`button`,{type:`button`,className:`block-action-pill block-ask`,"aria-pressed":_,title:_?`Selected — ask about it below`:`Ask about ${m(e)}`,"aria-label":_?`Unpin ${m(e)}`:`Ask about ${m(e)}`,onClick:t=>{t.stopPropagation(),i(e)},children:[(0,W.jsx)(s.chat,{}),(0,W.jsx)(`span`,{className:`block-pill-label`,children:_?`Selected`:`Ask`})]}),d&&(0,W.jsxs)(`button`,{type:`button`,className:`block-action-pill block-ask block-add`,title:`Add ${m(e)} to a dashboard`,"aria-label":`Add ${m(e)} to a dashboard`,onClick:t=>{t.stopPropagation(),a(e)},children:[(0,W.jsx)(s.plus,{}),(0,W.jsx)(`span`,{className:`block-pill-label`,children:`Dashboard`})]}),h&&(0,W.jsxs)(`button`,{type:`button`,className:`block-action-pill block-cards`+(g?` is-flashed`:``),"aria-pressed":g,title:g?`${m(e)} is in your flashcards`:`Make flashcards from ${m(e)}`,"aria-label":`Make flashcards from ${m(e)}`,onClick:t=>{t.stopPropagation(),y(e)},children:[g?(0,W.jsx)(s.check,{}):(0,W.jsx)(s.layers,{}),(0,W.jsx)(`span`,{className:`block-pill-label`,children:g?`Added`:`Cards`})]}),x&&(0,W.jsxs)(`button`,{type:`button`,className:`block-action-pill block-zoom`,title:`Zoom into ${m(e)}`,"aria-label":`Zoom into ${m(e)}`,onClick:t=>{t.stopPropagation(),P(e),I(nn)},children:[(0,W.jsx)(s.zoomIn,{}),(0,W.jsx)(`span`,{className:`block-pill-label`,children:`Zoom`})]})]})]},e.id||n)};return(0,W.jsxs)(te.Provider,{value:O??null,children:[ue.ghost,(0,W.jsxs)(`div`,{className:`canvas-header`,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`canvas-title`,children:e.title}),(0,W.jsx)(`div`,{className:`canvas-sub`,children:e.sub})]}),(0,W.jsxs)(`div`,{className:`canvas-header-actions`,children:[S,oe?(0,W.jsxs)(`button`,{type:`button`,className:`canvas-exit`,onClick:()=>l?.(`everything`),children:[(0,W.jsx)(`span`,{"aria-hidden":!0,children:`←`}),` Back to answer`]}):(0,W.jsxs)(W.Fragment,{children:[he&&_e&&!J&&(0,W.jsx)(`button`,{type:`button`,className:`depth-reading-toggle`+(j?` is-reading`:``),"aria-pressed":j,title:j?`Collapse all deeper sections`:`Expand all deeper sections`,onClick:()=>M(e=>!e),children:j?`Collapse sections`:`Expand sections`}),q&&l&&(0,W.jsx)(Xt,{value:J?`focus`:`everything`,onChange:l}),w,Y&&l&&(0,W.jsxs)(`button`,{type:`button`,className:`canvas-open`,onClick:()=>l(`canvas`),title:`Spread this answer's cards on a board you can wander`,children:[(0,W.jsx)(`span`,{className:`canvas-open-glyph`,"aria-hidden":!0,children:`◇`}),` `,`View as canvas`]})]})]})]}),E,e.context.length>0&&(0,W.jsxs)(`div`,{className:`context-row`,style:{marginBottom:18},children:[(0,W.jsx)(`span`,{className:`faint`,style:{fontSize:12.5,marginRight:2},children:`Reading`}),e.context.map((e,t)=>(0,W.jsx)(x,{name:e.name,color:e.color},t))]}),G&&oe?(0,W.jsx)(ge,{data:e,blocks:H,spot:t,renderBlock:$,onAskBlock:i,selectedBlockIds:o,onExit:()=>l?.(`everything`)}):G&&J?(0,W.jsx)(qt,{data:e,blocks:H,spot:t,renderBlock:$,onAskBlock:i,selectedBlockIds:o,onNarrate:u,narratingId:d,muted:h,walkNotes:_,presenting:D}):(0,W.jsx)(`div`,{className:`card-grid`+(ee?` bloom-on`:``)+(g?` note-gutter`:``),ref:L,role:G?void 0:`status`,"aria-busy":!G||void 0,"aria-label":G?void 0:`Loading visuals`,children:!G&&he?H.map((e,t)=>C(e,t,U)):(0,W.jsxs)(W.Fragment,{children:[he?fe.map((e,t)=>(0,W.jsx)(At,{section:e,renderCard:ve,readingMode:j},e.label||t)):H.map((e,t)=>G?ve(e,t):C(e,t,U)),Object.keys(n).filter(t=>G&&n[t]&&e.extras&&e.extras[t]).map(t=>{let n=e.extras[t],r=Math.min(12,Math.max(1,n.col||6));return(0,W.jsx)(`div`,{className:`col-`+(U<9?12:r),children:de(n)},t)})]})}),e.awaiting&&O?.complete&&(()=>{let t=Object.keys(O.values).length,n=e.blanks?.length??0,r=n>0&&t===n,i=O.busy?`Completing your answer…`:r?`All filled — finish when ready`:t===0?`Fill the blanks above to finish`:`${t} of ${n} filled`;return(0,W.jsxs)(`div`,{className:`blank-complete-bar${O.busy?` is-busy`:``}${r&&!O.busy?` is-ready`:``}`,role:`status`,"aria-live":`polite`,children:[(0,W.jsxs)(`span`,{className:`blank-complete-count`,children:[O.busy&&(0,W.jsx)(`span`,{className:`blank-complete-spinner`,"aria-hidden":`true`}),i]}),(0,W.jsx)(`button`,{type:`button`,className:`blank-complete-btn`,disabled:O.busy||t===0,onClick:O.complete,children:`Complete the answer`})]})})(),k&&(0,W.jsx)(`div`,{className:`app-scrim`,role:`button`,tabIndex:0,"aria-label":`Close app preview`,onClick:()=>A(null),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),A(null))},children:(0,W.jsxs)(`div`,{className:`app-launch`,role:`button`,tabIndex:0,onClick:e=>e.stopPropagation(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},children:[(0,W.jsxs)(`div`,{className:`app-launch-head`,children:[(0,W.jsxs)(`span`,{className:`app-launch-title`,children:[k.app,(0,W.jsxs)(`span`,{className:`app-launch-pill`,children:[(0,W.jsx)(`span`,{className:`web-live-dot`}),` Live on your workspace`]})]}),(0,W.jsx)(`button`,{className:`drawer-x`,onClick:()=>A(null),"aria-label":`Close app`,children:(0,W.jsx)(s.x,{})})]}),(0,W.jsx)(`div`,{className:`app-launch-body`,children:(0,W.jsx)(st,{...k})})]})}),N&&(0,W.jsx)(`div`,{className:`zoom-scrim`,role:`button`,tabIndex:0,"aria-label":`Close zoomed view`,onClick:()=>P(null),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),P(null))},children:(0,W.jsxs)(`div`,{className:`zoom-sheet`,role:`button`,tabIndex:0,"aria-label":m(N),onClick:e=>e.stopPropagation(),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},children:[(0,W.jsxs)(`div`,{className:`zoom-sheet-toolbar`,children:[(0,W.jsx)(`button`,{type:`button`,className:`zoom-sheet-zoom-btn`,"aria-label":`Zoom out`,disabled:F<=$t,onClick:()=>I(e=>Math.max($t,+(e-tn).toFixed(2))),children:(0,W.jsx)(s.zoomOut,{})}),(0,W.jsxs)(`span`,{className:`zoom-sheet-zoom-level`,children:[Math.round(F*100),`%`]}),(0,W.jsx)(`button`,{type:`button`,className:`zoom-sheet-zoom-btn`,"aria-label":`Zoom in`,disabled:F>=en,onClick:()=>I(e=>Math.min(en,+(e+tn).toFixed(2))),children:(0,W.jsx)(s.zoomIn,{})}),(0,W.jsx)(`button`,{type:`button`,className:`zoom-sheet-x`,"aria-label":`Close`,onClick:()=>P(null),children:(0,W.jsx)(s.x,{})})]}),(0,W.jsx)(`div`,{className:`zoom-sheet-body`,style:{zoom:F},children:$(N)})]})})]})}export{Zt as n,cn as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/lens-ChFJD9il.js","assets/display-CAb_PiGv.js","assets/facts-BUGuVUIc.js","assets/types-DuEbJpIA.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{t as e}from"./react-BZJXY1be.js";import{t}from"./compiler-runtime-qQQXpJgv.js";import{t as n}from"./jsx-runtime-DeHZSEgm.js";import{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{a,i as o,s}from"./spokenText-C88IQJ0M.js";import{i as c,n as l,t as u}from"./loader-DgMLGfAC.js";import{t as d}from"./useFocusTrap-CJmpNZv2.js";import{r as f,t as p}from"./useSpatialCanvas-CfmZOXXP.js";import{i as m}from"./format-q0LwBjID.js";import{a as h,i as g,n as _,r as v}from"./scale-Bcgfo6Hp.js";import{t as y}from"./spreadLabels-CQ8hufvK.js";import{a as b,i as x,n as S,t as C}from"./display-CAb_PiGv.js";import{t as w}from"./types-C42I77wh.js";import{r as T,t as E}from"./sourceHost-BV3t2XDb.js";import{r as D}from"./stepDriver-DwjFet6U.js";import{c as O,l as k,o as A,u as j}from"./walkSync-DBne70gg.js";import{n as M}from"./emphasize-BqCIst-B.js";import{c as N,s as P,t as F}from"./validate-sGUCmPAs.js";import{n as I,s as L}from"./receipts-D7zveV-I.js";import{n as R,r as z}from"./value-Dx7DZob4.js";import{t as B}from"./types-DuEbJpIA.js";import{n as V,t as H}from"./engine-BiM6INsW.js";var U=e(),W=t(),G=n();function ee(e){return e.kind}var K=.33,te=.1,q=.005;function ne(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return`would barely change`;let n=Math.abs(e)>1e-9?Math.abs(e):1,r=(t-e)/n,i=Math.abs(r);if(i<=q)return`would barely change`;let a=r>0?`rise`:`fall`;return i>=K?`would ${a} meaningfully`:i>=te?`would ${a} somewhat`:`would ${a} slightly`}var re=.6;function ie(e){if(!Number.isFinite(e))return null;let t=e-1,n=Math.abs(t);if(n<=.005)return null;let r=t>0?`stronger`:`weaker`;return n>=re?`much ${r}`:n>=K?r:`slightly ${r}`}function ae(e){let t=[];for(let n of e?.points??[]){let e=P(n.t);e===null||!Number.isFinite(n.value)||t.push({t:e,v:n.value})}return t.sort((e,t)=>e.t-t.t)}function oe(e,t){let n=e.date?P(e.date.t):null;if(n!==null){let t=e.date?.until?P(e.date.until):null;return t!==null&&t>n?{start:n,end:t}:{start:n}}if(t.length===0)return null;let r=t[0].t,i=t[t.length-1].t;return i>r?{start:r,end:i}:{start:r}}function se(e){return e.filter(e=>e.from!==e.to)}function ce(e){return se(e).map((e,t)=>({id:e.id??`${e.from}->${e.to}#${t}`,from:e.from,to:e.to,sign:e.sign,...e.relation===void 0?{}:{kind:e.relation},...typeof e.weight==`number`?{weight:e.weight}:{},...e.provisional?{provisional:!0}:{}}))}function le(e){let t=[],n=(e,r,i=0)=>{if(i>1)return;let a=ae(e.series),o=e.unit??e.series?.unit,s=oe(e,a);t.push({id:e.id,label:e.label,role:e.role,depth:e.depth,tier:e.tier,...e.value===void 0?{}:{value:e.value},...o===void 0?{}:{unit:o},...a.length>0?{series:a}:{},...s?{date:s}:{},...s&&e.date&&w(e.date.tier??`T0`)?{dateGrounded:!0}:{},...e.domain===void 0?{}:{domain:e.domain},...r===void 0?{}:{parentId:r}});for(let t of e.children??[])n(t,e.id,i+1)};for(let t of e.nodes)n(t);return{nodes:t,edges:ce(e.edges),outcomeId:e.outcomeId}}var ue={w:1090,h:650},de=1.4,fe=86*de;160*de;var pe=116*de,me=9/(11*de),J=e=>String(Math.round(e*100)/100),he=e=>e&&/^[a-z-]{1,24}$/.test(e)?` morph-edge--rel-${e}`:``,ge=525949.2*60*1e3,Y=e=>1970+e/ge,_e=e=>(e-1970)*ge,ve=6e4,ye=60*ve,be={minute:ve,hour:ye,day:24*ye,month:ge/12},xe=[{grain:`minute`,n:1},{grain:`minute`,n:5},{grain:`minute`,n:10},{grain:`minute`,n:15},{grain:`minute`,n:30},{grain:`hour`,n:1},{grain:`hour`,n:2},{grain:`hour`,n:3},{grain:`hour`,n:6},{grain:`hour`,n:12},{grain:`day`,n:1},{grain:`day`,n:2},{grain:`day`,n:5},{grain:`day`,n:10},{grain:`month`,n:1},{grain:`month`,n:2},{grain:`month`,n:3},{grain:`month`,n:6}],X=3,Se=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Ce=64;function we(e){let t=new Date(0);return t.setUTCFullYear(Math.floor(e/12),(e%12+12)%12,1),t.setUTCHours(0,0,0,0),t.getTime()}function Te(e,t,n){if(t.grain===`month`){let r=new Date(e),i=Math.floor((r.getUTCFullYear()*12+r.getUTCMonth())/t.n)*t.n,a=we(i);return n&&a<e?we(i+t.n):a}let r=be[t.grain]*t.n,i=Math.floor(e/r)*r;return n&&i<e?i+r:i}function Ee(e,t){let n=new Date(e);if(!Number.isFinite(n.getTime()))return String(Math.round(Y(e)));let r=`${Se[n.getUTCMonth()]} ${n.getUTCFullYear()}`;if(t===`month`)return r;let i=`${n.getUTCDate()} ${r}`;if(t===`day`||n.getUTCHours()===0&&n.getUTCMinutes()===0)return i;let a=e=>String(e).padStart(2,`0`);return`${a(n.getUTCHours())}:${a(n.getUTCMinutes())}`}function De(e,t){if(t.grain!==`month`)return e+be[t.grain]*t.n;let n=new Date(e);return we(n.getUTCFullYear()*12+n.getUTCMonth()+t.n)}function Oe(e,t,n){let r=Te(_e(e),n,!1),i=Te(_e(t),n,!0),a=[];for(let e=r;e<=i&&a.length<Ce;e=De(e,n))a.push({year:Y(e),text:Ee(e,n.grain)});return{domain:[Y(r),Y(i)],ticks:a}}function ke(e,t,n){let r=Math.max(1,Math.round(v(t-e,n))),i=Math.floor(e/r)*r,a=Math.ceil(t/r)*r,o=[];for(let e=i;e<=a&&o.length<Ce;e+=r)o.push({year:e,text:String(e)});return{domain:[i,a],ticks:o}}function Ae(e,t,n=6){let[r,i]=e<t?[e,t]:[e-.5,t+.5];if(i-r>=X)return ke(r,i,n);let a=(i-r)*ge/n,o=xe[xe.length-1],s=1/0;for(let e of xe){let t=Math.abs(Math.log(be[e.grain]*e.n/a));t<s&&(s=t,o=e)}return Oe(r,i,o)}var je=8,Z=12,Me=16,Ne=6,Pe=12+Math.ceil(15.525*de);function Q(e,t,n,r=ue){let i=new Map;if(e.length===0)return{positions:i,band:null,bbox:t};let a=pe+Me,o=44*de+Ne,s=Math.max(t.w,r.w),c=Math.max(1,Math.floor((s-24+Me)/a)),l=Math.min(e.length,c),u=Math.ceil(e.length/c),d=l*pe+(l-1)*Me,f={id:`shelf`,x:t.x,y:t.y+t.h+je,w:Math.max(t.w,d+24),h:Pe+Ne+u*o-Ne+Z,className:`morph-shelf`,label:n};return e.forEach((e,t)=>{i.set(e.id,{x:f.x+Z+t%c*a,y:f.y+Pe+Ne+Math.floor(t/c)*o,w:116,h:44,face:`entry`,shelved:!0})}),{positions:i,band:f,bbox:{x:t.x,y:t.y,w:Math.max(t.w,f.w),h:f.y+f.h-t.y}}}var Fe=440,Ie=2,Le=1.25,$=320;function Re(e){if(!(e===void 0||!Number.isFinite(e))){if(e<.995)return`weaker`;if(e>1.005)return`stronger`}}function ze(){let e=(0,W.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsx)(`marker`,{id:`mv-arrow`,className:`mv-marker mv-marker-up`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M0.5 1 L9.5 5 L0.5 9 Z`})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,G.jsx)(`marker`,{id:`mv-arrow-damp`,className:`mv-marker mv-marker-down`,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:17,markerHeight:17,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M8 0.6 L8 9.4`})}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,G.jsx)(`marker`,{id:`mv-arrow-open`,className:`mv-marker mv-marker-open`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,G.jsx)(`path`,{d:`M1 1.4 L9 5 L1 8.6 Z`})}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,G.jsx)(`marker`,{id:`mv-arrow-ring`,className:`mv-marker mv-marker-ring`,viewBox:`0 0 10 10`,refX:`7.4`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:13,markerHeight:13,orient:`auto`,children:(0,G.jsx)(`circle`,{cx:`5`,cy:`5`,r:`3`})}),e[3]=i):i=e[3];let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsxs)(`defs`,{children:[t,n,r,i,(0,G.jsx)(`marker`,{id:`mv-dot`,className:`mv-marker mv-marker-dot`,viewBox:`0 0 10 10`,refX:`5`,refY:`5`,markerUnits:`userSpaceOnUse`,markerWidth:9,markerHeight:9,orient:`auto`,children:(0,G.jsx)(`circle`,{cx:`5`,cy:`5`,r:`2.6`})})]}),e[4]=a):a=e[4],a}function Be(e,t){let n=(0,W.c)(5),r;n[0]===e.current?r=n[1]:(r=()=>{let t=e.current;if(!t||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)return;let n=t.querySelectorAll(`[data-draw]:not(.m-draw-path):not([data-drawn])`),r=Array.from(n,He);n.forEach((e,t)=>{let n=r[t];n!==null&&(e.style.setProperty(`--path-len`,`${n}px`),e.style.setProperty(`--delay`,`${Fe}ms`),e.classList.add(`m-draw-path`))});let i=Ve;return t.addEventListener(`animationend`,i),()=>t.removeEventListener(`animationend`,i)},n[0]=e.current,n[1]=r);let i;n[2]!==t||n[3]!==e?(i=[e,t],n[2]=t,n[3]=e,n[4]=i):i=n[4],(0,U.useEffect)(r,i)}function Ve(e){if(e.animationName!==`mavea-draw`)return;let t=e.target;t.classList.remove(`m-draw-path`),t.style.removeProperty(`--path-len`),t.style.removeProperty(`--delay`),t.dataset.drawn=``}function He(e){return typeof e.getTotalLength==`function`?e.getTotalLength():null}function Ue(e){let t=(0,W.c)(33),{chrome:n,bbox:r,exiting:i,onSettle:a}=e,o=(0,U.useRef)(null);Be(o,n.paths);let s=i?``:void 0,c=i?!0:void 0,l=r.w,u=r.h,d=`${r.x} ${r.y} ${r.w} ${r.h}`,f;t[0]===n.bands?f=t[1]:(f=n.bands.map(Ge),t[0]=n.bands,t[1]=f);let p;t[2]===n.paths?p=t[3]:(p=n.paths.map(We),t[2]=n.paths,t[3]=p);let m;t[4]!==r.h||t[5]!==r.w||t[6]!==d||t[7]!==f||t[8]!==p?(m=(0,G.jsxs)(`svg`,{ref:o,className:`mv-chrome-svg`,width:l,height:u,viewBox:d,"aria-hidden":`true`,children:[f,p]}),t[4]=r.h,t[5]=r.w,t[6]=d,t[7]=f,t[8]=p,t[9]=m):m=t[9];let h;if(t[10]!==r.x||t[11]!==r.y||t[12]!==n.bands){let e;t[14]!==r.x||t[15]!==r.y?(e=e=>e.label===void 0?null:(0,G.jsx)(`div`,{className:`mv-shelf-label`,style:{left:e.x-r.x+12,top:e.y-r.y+12},children:e.label},`${e.id}:label`),t[14]=r.x,t[15]=r.y,t[16]=e):e=t[16],h=n.bands.map(e),t[10]=r.x,t[11]=r.y,t[12]=n.bands,t[13]=h}else h=t[13];let g;if(t[17]!==r.x||t[18]!==r.y||t[19]!==n.labels){let e;t[21]!==r.x||t[22]!==r.y?(e=e=>(0,G.jsx)(`div`,{className:`mv-chrome-label ${e.className}`,"data-anchor":e.anchor??`start`,style:{left:e.x-r.x,top:e.y-r.y},children:e.text},e.id),t[21]=r.x,t[22]=r.y,t[23]=e):e=t[23],g=n.labels.map(e),t[17]=r.x,t[18]=r.y,t[19]=n.labels,t[20]=g}else g=t[20];let _;t[24]!==g||t[25]!==h?(_=(0,G.jsxs)(`div`,{className:`mv-chrome-labels`,children:[h,g]}),t[24]=g,t[25]=h,t[26]=_):_=t[26];let v;return t[27]!==a||t[28]!==s||t[29]!==_||t[30]!==c||t[31]!==m?(v=(0,G.jsxs)(`div`,{className:`mv-chrome`,"data-exiting":s,onTransitionEnd:a,"aria-hidden":c,children:[m,_]}),t[27]=a,t[28]=s,t[29]=_,t[30]=c,t[31]=m,t[32]=v):v=t[32],v}function We(e){return(0,G.jsx)(`path`,{className:e.className,d:e.d,fill:`none`,"data-draw":e.draw?``:void 0},e.id)}function Ge(e){return(0,G.jsx)(`rect`,{className:`mv-band ${e.className}`,x:e.x,y:e.y,width:e.w,height:e.h,rx:12},e.id)}function Ke(e){if(e instanceof Element)return e.closest(`.mv-node`)?.dataset.id}var qe=(0,U.memo)(function(e){let t=(0,W.c)(49),{nodes:n,edges:r,layout:i,exiting:a,settleExit:o,activate:s,lod:c,renderFace:l,onNodeClick:u,onEdgeClick:d,selectedId:f,litEdgeId:p}=e,m=(0,U.useRef)(null);Be(m,i.edgePaths);let{bbox:h}=i,g;if(t[0]!==r||t[1]!==n){let e=new Map(n.map(Ye));g=new Map;for(let t of r){let n=e.get(t.from);n!==void 0&&Number.isFinite(n)&&g.set(t.id,n)}t[0]=r,t[1]=n,t[2]=g}else g=t[2];let _=g,v;t[3]!==a||t[4]!==o?(v=a&&(0,G.jsx)(Ue,{chrome:a.layout.chrome,bbox:a.layout.bbox,exiting:!0,onSettle:()=>o(a.token)},a.token),t[3]=a,t[4]=o,t[5]=v):v=t[5];let y;t[6]!==h||t[7]!==i.chrome||t[8]!==i.rep?(y=(0,G.jsx)(Ue,{chrome:i.chrome,bbox:h},i.rep),t[6]=h,t[7]=i.chrome,t[8]=i.rep,t[9]=y):y=t[9];let b=h.w,x=h.h,S=`${h.x} ${h.y} ${h.w} ${h.h}`,C;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,G.jsx)(ze,{}),t[10]=C):C=t[10];let w;if(t[11]!==_||t[12]!==i.edgePaths||t[13]!==p||t[14]!==d){let e;t[16]!==_||t[17]!==p||t[18]!==d?(e=e=>(0,G.jsxs)(`g`,{className:`mv-edge-g`,"data-lit":p===e.id?``:void 0,"data-shift":Re(_.get(e.id)),style:_.has(e.id)?{"--mv-shift":_.get(e.id)}:void 0,onClick:d?()=>d(e.id):void 0,children:[d&&(0,G.jsx)(`path`,{className:`mv-edge-hit`,d:e.d,fill:`none`}),(0,G.jsx)(`path`,{className:e.className,d:e.d,fill:`none`,"data-draw":``,style:e.width===void 0?void 0:{"--mv-edge-w":e.width}})]},e.id),t[16]=_,t[17]=p,t[18]=d,t[19]=e):e=t[19],w=i.edgePaths.map(e),t[11]=_,t[12]=i.edgePaths,t[13]=p,t[14]=d,t[15]=w}else w=t[15];let T;t[20]!==h.h||t[21]!==h.w||t[22]!==S||t[23]!==w?(T=(0,G.jsxs)(`svg`,{ref:m,className:`mv-edges`,width:b,height:x,viewBox:S,"aria-hidden":`true`,children:[C,w]}),t[20]=h.h,t[21]=h.w,t[22]=S,t[23]=w,t[24]=T):T=t[24];let E;if(t[25]!==s||t[26]!==h.x||t[27]!==h.y||t[28]!==i.positions||t[29]!==c||t[30]!==n||t[31]!==u||t[32]!==l||t[33]!==f){let e;t[35]!==s||t[36]!==h.x||t[37]!==h.y||t[38]!==i.positions||t[39]!==c||t[40]!==u||t[41]!==l||t[42]!==f?(e=(e,t)=>{let n=i.positions.get(e.id);if(!n)return null;let r={"--nx":`${n.x+n.w/2-h.x}px`,"--ny":`${n.y+n.h/2-h.y}px`,"--mv-i":t,...e.shift===void 0?{}:{"--mv-shift":e.shift}},a=u!==void 0&&!n.folded,o=l?.(e,`entry`);return(0,G.jsxs)(`div`,{className:`mv-node`,"data-id":e.id,"data-role":e.role,"data-tier":e.tier,"data-domain":e.domain,"data-series":e.series?.length?``:void 0,"data-face":n.face,"data-shelved":n.shelved?``:void 0,"data-folded":n.folded?``:void 0,"data-shift":Re(e.shift),"data-selected":f===e.id?``:void 0,"data-lod":c,style:r,"aria-hidden":n.folded?!0:void 0,role:a?`button`:void 0,tabIndex:a?0:void 0,onClick:a?()=>s(e):void 0,onKeyDown:a?t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),u?.(e))}:void 0,children:[(0,G.jsxs)(`div`,{className:`mv-face mv-face-card`,children:[(0,G.jsx)(`span`,{className:`mv-label`,children:e.label}),(0,G.jsxs)(`span`,{className:`mv-card-foot`,children:[e.domain!==void 0&&(0,G.jsx)(`span`,{className:`mv-domain`,title:e.domain,"aria-label":e.domain}),e.value!==void 0&&(0,G.jsxs)(`span`,{className:`mv-value`,children:[e.value.toLocaleString(),e.unit??``]}),l?.(e,`card`),e.tier!==void 0&&(0,G.jsx)(`span`,{className:`mv-tier`,children:e.tier})]})]}),(0,G.jsx)(`div`,{className:`mv-face mv-face-entry`,children:(0,G.jsxs)(`span`,{className:`mv-label`,children:[o,o?` `:null,e.label]})}),(0,G.jsx)(`div`,{className:`mv-face mv-face-mark`,children:l?.(e,`mark`)})]},e.id)},t[35]=s,t[36]=h.x,t[37]=h.y,t[38]=i.positions,t[39]=c,t[40]=u,t[41]=l,t[42]=f,t[43]=e):e=t[43],E=n.map(e),t[25]=s,t[26]=h.x,t[27]=h.y,t[28]=i.positions,t[29]=c,t[30]=n,t[31]=u,t[32]=l,t[33]=f,t[34]=E}else E=t[34];let D;return t[44]!==v||t[45]!==y||t[46]!==T||t[47]!==E?(D=(0,G.jsxs)(G.Fragment,{children:[v,y,T,E]}),t[44]=v,t[45]=y,t[46]=T,t[47]=E,t[48]=D):D=t[48],D});function Je({stage:e,world:t,renderFace:n,onNodeClick:r,onEdgeClick:i,selectedId:a,litEdgeId:o}){let{cam:s,layout:c,exiting:l,lod:u,settleExit:d,morphing:f,settle:p}=e,{viewportRef:m,zoomAtClient:h,pan:g}=s,[_,v]=(0,U.useState)(!1),y=(0,U.useRef)(new Map),b=(0,U.useRef)(0),x=(0,U.useRef)(!1),S=(0,U.useRef)(!1),C=(0,U.useRef)(!1),w=(0,U.useRef)({x:0,y:0}),T=(0,U.useCallback)((t,n,r,i)=>{if(x.current){h(t,n,r);return}e.pinch(t,n,r,i)!==`zoom`&&(x.current=!0)},[e,h]),E=(0,U.useRef)(T);E.current=T,(0,U.useEffect)(()=>{let e=m.current;if(!e)return;let t,n=e=>{if(e.preventDefault(),p(),e.ctrlKey){E.current(Math.exp(-e.deltaY/100),e.clientX,e.clientY,Ke(e.target)),clearTimeout(t),t=setTimeout(()=>{x.current=!1},$);return}h(e.deltaY<0?1.12:1/1.12,e.clientX,e.clientY)};return e.addEventListener(`wheel`,n,{passive:!1}),()=>{clearTimeout(t),e.removeEventListener(`wheel`,n)}},[m,h,p]);let D=()=>{let[e,t]=[...y.current.values()];return{x:(e.x+t.x)/2,y:(e.y+t.y)/2,d:Math.hypot(e.x-t.x,e.y-t.y)}},O=(0,U.useCallback)(e=>{if(p(),y.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),y.current.size>=2){e.currentTarget.setPointerCapture(e.pointerId),S.current=!1,v(!1),b.current=0;return}S.current=!0,C.current=!1,v(!0),w.current={x:e.clientX,y:e.clientY}},[p]),k=(0,U.useRef)({dx:0,dy:0}),A=(0,U.useRef)(0),j=(0,U.useCallback)(()=>{A.current!==0&&(cancelAnimationFrame(A.current),A.current=0);let{dx:e,dy:t}=k.current;(e!==0||t!==0)&&(k.current={dx:0,dy:0},g(e,t))},[g]),M=(0,U.useCallback)((e,t)=>{k.current.dx+=e,k.current.dy+=t,A.current===0&&(A.current=requestAnimationFrame(()=>{A.current=0;let e=k.current;k.current={dx:0,dy:0},(e.dx!==0||e.dy!==0)&&g(e.dx,e.dy)}))},[g]);(0,U.useEffect)(()=>()=>cancelAnimationFrame(A.current),[]);let N=(0,U.useCallback)(e=>{let t=y.current;if(!t.has(e.pointerId))return;if(t.set(e.pointerId,{x:e.clientX,y:e.clientY}),t.size>=2){let{x:t,y:n,d:r}=D();if(b.current===0){b.current=r;return}let i=r/b.current;(i>Le||i<1/Le)&&(b.current=r,E.current(i,t,n,Ke(e.target)));return}if(!S.current)return;let n=e.clientX-w.current.x,r=e.clientY-w.current.y;Math.abs(n)+Math.abs(r)>Ie&&!C.current&&(C.current=!0,e.currentTarget.setPointerCapture(e.pointerId)),w.current={x:e.clientX,y:e.clientY},M(n,r)},[M]),P=(0,U.useCallback)(e=>{j(),y.current.delete(e.pointerId),y.current.size<2&&(b.current=0,x.current=!1),y.current.size===0&&(S.current=!1,v(!1)),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},[j]),F=(0,U.useCallback)(e=>{C.current||r?.(e)},[r]),I=(0,U.useCallback)(e=>{e.propertyName===`transform`&&p()},[p]),{bbox:L}=c,R={transform:s.transform,width:L.w,height:L.h,"--mv-cam-scale":s.camera.scale};return(0,G.jsx)(`div`,{className:`mv-viewport`,ref:m,"data-panning":_?`true`:void 0,style:{"--mv-cam-scale":s.camera.scale},onPointerDown:O,onPointerMove:N,onPointerUp:P,onPointerCancel:P,children:(0,G.jsx)(`div`,{className:`mv-world`,style:R,"data-morphing":f?``:void 0,onTransitionEnd:I,children:(0,G.jsx)(qe,{nodes:t.nodes,edges:t.edges,layout:c,exiting:l,settleExit:d,activate:F,lod:u,renderFace:n,onNodeClick:r,onEdgeClick:i,selectedId:a,litEdgeId:o})})})}function Ye(e){return[e.id,e.shift]}function Xe(e,t){return e===`in`?`zoom-camera`:t?`ascend`:`zoom-camera`}var Ze=880,Qe=340,$e=468,et=56,tt=26,nt=16,rt=7,it=30*de;function at(e){let t=(e.series??[]).filter(e=>Number.isFinite(e.t)&&Number.isFinite(e.v)).map(e=>({t:Y(e.t),v:e.v})).sort((e,t)=>e.t-t.t);return t.length>0?{node:e,points:t}:null}var ot=e=>at(e)!==null;function st(e,t){let n=e*Math.max(et,(t-1)*it+30)+(e-1)*tt,r=Math.min($e,Math.max(Qe,n)),i=Math.max(it,Math.min(tt,r/(4*e)));return{h:(r-(e-1)*i)/e,gap:i}}function ct(e,t,n){let[r,i]=e===t?_(e,t,n):[e,t],a=v(i-r,n),o=[Math.floor(r/a)*a,Math.ceil(i/a)*a];return{domain:o,ticks:h(o[0]-a*1e-9,o[1],a)}}function lt(e){let t=1/0,n=-1/0,r=new Map;for(let i of e){let e=new Map;for(let a of i.nodes){let i=at(a);if(!i)continue;let o=a.unit??``,s=r.get(o);s||r.set(o,s={lo:1/0,hi:-1/0,marks:0}),e.set(o,(e.get(o)??0)+1);for(let e of i.points)t=Math.min(t,e.t),n=Math.max(n,e.t),s.lo=Math.min(s.lo,e.v),s.hi=Math.max(s.hi,e.v)}for(let[t,n]of e){let e=r.get(t);e.marks=Math.max(e.marks,n)}}if(t===1/0)return null;let i=1;for(let e of r.values())i=Math.max(i,e.marks);let{h:a,gap:o}=st(r.size,i),s=Math.max(2,Math.min(5,Math.round(a/60))),c=[],l=new Map;for(let[e,t]of r){let{domain:n,ticks:r}=ct(t.lo,t.hi,s);l.set(e,c.length),c.push({unit:e,domain:n,ticks:r,top:c.length*(a+o),h:a})}let u=Ae(t,n);return{x:u.domain,xTicks:u.ticks,bands:c,bandOf:l,height:c.length*a+(c.length-1)*o}}function ut(e,t){let n=new Map,r=new Map;for(let t of e){let e=r.get(t.band);e?e.push(t):r.set(t.band,[t])}for(let[e,i]of r){let{top:r,bottom:a}=t(e);i.sort((e,t)=>e.x-t.x||e.y-t.y||e.id.localeCompare(t.id));let o=[],s=()=>{if(o.length!==0){for(let[e,t]of y(o,{gap:it,top:r,bottom:a}))n.set(e,t);o=[]}};for(let e of i)o.length>0&&e.x-o[o.length-1].x>=it&&s(),o.push(e);s()}return n}function dt(e,t,n){let r=[],i=[];for(let n of e.nodes){let e=at(n);e&&t?r.push(e):i.push(n)}let a=new Map,o={bands:[],paths:[],labels:[]},s=1/0,c=-1/0,l=56;if(r.length>0&&t){let e=g(t.x,[56,56+Ze]),n=t.bands.map(e=>g(e.domain,[56+e.top+e.h,56+e.top])),i=e=>t.bandOf.get(e.unit??``)??0;t.bands.forEach((e,r)=>{let i=n[r];for(let t of e.ticks)o.paths.push({id:`grid:${r}:${t}`,d:`M ${J(56)} ${J(i(t))} L ${J(56+Ze)} ${J(i(t))}`,className:`morph-gridline`}),o.labels.push({id:`ytick:${r}:${t}`,x:46,y:i(t)+4,text:String(t),className:`morph-axis-label`,anchor:`end`}),s=Math.min(s,46-String(t).length*rt);t.bands.length>1&&o.labels.push({id:`unit:${r}`,x:56,y:56+e.top-11,text:e.unit===``?`no unit`:e.unit,className:`morph-axis-label`,anchor:`start`})}),t.xTicks.forEach((n,r)=>{let i=e(n.year);o.labels.push({id:`xtick:${r}`,x:i,y:56+t.height+22,text:n.text,className:`morph-axis-label`,anchor:`middle`});let a=n.text.length*rt/2;s=Math.min(s,i-a),c=Math.max(c,i+a)}),s=Math.min(s,56),c=Math.max(c,56+Ze),l=Math.max(l,56+t.height+28);let u=[...r].sort((e,t)=>e.node.id.localeCompare(t.node.id)),d=u.map(t=>{let r=i(t.node),a=t.points[t.points.length-1];return{id:t.node.id,band:r,x:e(a.t),y:n[r](a.v)}}),f=ut(d,e=>({top:56+t.bands[e].top,bottom:56+t.bands[e].top+t.bands[e].h})),p=new Map,m=new Map;for(let e of d){let t=m.get(e.band);t?t.push(e):m.set(e.band,[e])}t.bands.forEach((e,t)=>{let n=m.get(t);if(n===void 0||n.length===0)return;let r=y(n.map(e=>({id:e.id,y:f.get(e.id)??e.y})),{gap:nt,top:56+e.top+6,bottom:56+e.top+e.h-6});for(let[e,t]of r)p.set(e,t)}),u.forEach((t,r)=>{let{x:i,y:s}=d[r],l=n[d[r].band],u=t.points.map((t,n)=>`${n===0?`M`:`L`} ${J(e(t.t))} ${J(l(t.v))}`).join(` `),m=t.node.id;o.paths.push({id:`series:${m}`,d:u,className:`morph-series`,draw:!0});let h=f.get(t.node.id)??s;Math.abs(h-s)>.01&&o.paths.push({id:`leader:${t.node.id}`,d:`M ${J(i)} ${J(s)} L ${J(i)} ${J(h)}`,className:`morph-tick`}),a.set(m,{x:i-15,y:h-15,w:30,h:30,face:`mark`});let g=i+15+8;o.labels.push({id:`label:${t.node.id}`,x:g,y:(p.get(t.node.id)??h)+4,text:t.node.label,className:`morph-series-label`,anchor:`start`}),c=Math.max(c,g+t.node.label.length*rt)})}let u=Q(i,s===1/0?{x:0,y:0,w:112,h:112}:{x:s-56,y:0,w:c-s+112,h:l+56},`${i.length} with nothing measured over time — the chart cannot plot these`,n);u.band&&o.bands.push(u.band);for(let[e,t]of u.positions)a.set(e,t);return{positions:a,edgePaths:[],chrome:o,bbox:u.bbox}}var ft=(e,t)=>({rep:`chart`,...dt(e,lt([e]),t?.viewport??ue)}),pt=new WeakMap;function mt(e,t){let n=new Set;for(let r of e)r.from===r.to||!t(r)||(n.add(r.from),n.add(r.to));return n}function ht(e){let t=pt.get(e);if(t)return t;let n=mt(e.edges,e=>typeof e.weight==`number`);return pt.set(e,n),n}var gt=340,_t=4,vt=fe+30,yt=3;function bt(e,t){return e.parentId===void 0&&ht(t).has(e.id)}var xt=(e,t)=>{let n=t?.viewport??ue,r=e.nodes.filter(e=>e.parentId===void 0),i=r.filter(t=>bt(t,e)),a=r.filter(t=>!bt(t,e)),o=e.nodes.filter(e=>e.parentId!==void 0),s=new Map,c={bands:[],paths:[],labels:[]},l=[],u=new Set(i.map(e=>e.id)),d=e.edges.filter(e=>e.from!==e.to&&typeof e.weight==`number`&&u.has(e.from)&&u.has(e.to)),f=i.reduce((e,t)=>Math.min(e,t.depth??0),1/0),p=new Map;for(let e of d)p.set(e.from,(p.get(e.from)??0)+(e.weight??0));let m=i.reduce((e,t)=>Math.max(e,Number.isFinite(f)?(t.depth??0)-f:0),0),h=e=>{let t=Number.isFinite(f)?(e.depth??0)-f:0;return m<=0?0:m<_t?t:Math.round(t/m*3)},g=new Map;for(let e of i){let t=h(e),n=g.get(t);n?n.push(e):g.set(t,[e])}for(let e of g.values())e.sort((e,t)=>(p.get(t.id)??0)-(p.get(e.id)??0)||e.id.localeCompare(t.id));let _=Math.max(1,...[...g.values()].map(e=>e.length));for(let[e,t]of g){let n=(_-t.length)*vt/2;t.forEach((t,r)=>{s.set(t.id,{x:56+e*gt,y:56+n+r*vt,w:200,h:64,face:`card`})})}for(let e of d){let t=s.get(e.from),n=s.get(e.to),r=t.x+t.w,i=t.y+t.h/2,a=n.x,o=n.y+n.h/2,c=(r+a)/2,u=Math.min(1,Math.max(0,e.weight??0));l.push({id:e.id,d:`M ${J(r)} ${J(i)} C ${J(c)} ${J(i)} ${J(c)} ${J(o)} ${J(a)} ${J(o)}`,className:`morph-edge morph-ribbon`+he(e.kind),width:yt+u*23})}for(let e of o){let t=(e.parentId===void 0?void 0:s.get(e.parentId))??{x:56,y:56};s.set(e.id,{x:t.x,y:t.y,w:200,h:64,face:`card`,folded:!0})}let v=Q(a,{x:0,y:0,w:112+(Math.max(1,...[...g.keys()].map(e=>e+1))-1)*gt+200,h:112+_*vt},`${a.length} with no measured share — the ribbons cannot size these`,n);for(let[e,t]of v.positions)s.set(e,t);return v.band&&c.bands.push(v.band),{rep:`flow`,positions:s,edgePaths:l,chrome:c,bbox:v.bbox}},St=200;function Ct(e,t=24){let n=e.length;if(n<2)return;let r=e.map(e=>Math.max(e.w,e.h)),i=2*[...r].sort((e,t)=>e-t)[n>>1],a=[];for(let e=0;e<n;e++)r[e]>i&&a.push(e);a.length>n/8&&(a=[]);let o=Array(n).fill(!0);for(let e of a)o[e]=!1;let s=0;for(let e=0;e<n;e++)o[e]&&(s=Math.max(s,r[e]));s=Math.max(s+t,1);let c=(n,r)=>{let i=e[n],a=e[r],o=a.x+a.w/2-(i.x+i.w/2),s=a.y+a.h/2-(i.y+i.h/2);o===0&&s===0&&(o=n-r,s=r-n);let c=(i.w+a.w)/2+t-Math.abs(o),l=(i.h+a.h)/2+t-Math.abs(s);if(c<=0||l<=0)return!1;if(c<=l){let e=c/2*(o<0?-1:1);i.x-=e,a.x+=e}else{let e=l/2*(s<0?-1:1);i.y-=e,a.y+=e}return!0},l=Array(n),u=new Map;for(let t=0;t<St;t++){u.clear();let t=[],r=[],i=[];for(let a=0;a<n;a++){if(!o[a])continue;let n=e[a],c=Math.floor((n.x+n.w/2)/s),d=Math.floor((n.y+n.h/2)/s),f=u.get(c);f===void 0&&(f=new Map,u.set(c,f));let p=f.get(d);p===void 0&&(p=i.length,f.set(d,p),t.push(c),r.push(d),i.push([])),i[p].push(a),l[a]=p}let d=i.map((e,n)=>{let a=[];for(let e=-1;e<=1;e++){let o=u.get(t[n]+e);if(o!==void 0)for(let e=-1;e<=1;e++){let t=o.get(r[n]+e);if(t!==void 0)for(let e of i[t])a.push(e)}}return a.sort((e,t)=>e-t)}),f=Array(i.length).fill(0),p=!1,m=0;for(let e=0;e<n;e++){for(;m<a.length&&a[m]<=e;)m++;if(!o[e]){for(let t=e+1;t<n;t++)c(e,t)&&(p=!0);continue}let t=l[e],r=d[t],i=f[t];for(;i<r.length&&r[i]<=e;)i++;f[t]=i;let s=m;for(;i<r.length||s<a.length;){let t=s>=a.length||i<r.length&&r[i]<a[s]?r[i++]:a[s++];c(e,t)&&(p=!0)}}if(!p)break}}var wt=300,Tt=fe+4,Et=4,Dt=fe+Et,Ot=wt-200,kt=200+Et,At=96,jt=30,Mt=20,Nt=18,Pt=15,Ft=2.5,It=1/1.4,Lt=1.7,Rt=2.6,zt={rows:1,reach:0};function Bt(e,t){let n=e.map(e=>t(e.id).rows).sort((e,t)=>t-e),r=e.map(e=>t(e.id).reach).sort((e,t)=>t-e),i=[0],a=0;for(let e of n)i.push(a+=e);return{size:e.length,rows:a,tallest:i,reaches:r}}function Vt(e,t){let n=[],r=[],i=[],a=[];for(let o of e){let e=Math.max(1,Math.min(o.size,Math.ceil(o.rows/t))),s=Math.ceil(o.size/e),c=Math.ceil(o.size/s);i.push(n.length),a.push(s);for(let e=0;e<c;e++)n.push(o.tallest[Math.min(s,o.size-e*s)]),r.push(200+(o.reaches[e]??0))}return{rows:n,widths:r,start:i,per:a}}function Ht(e,t){let n=[],r=[],i=[];for(let a=0;a<e.rows.length;a++){let o=Math.floor(a/t),s=a%t===0?0:n[a-1]+e.widths[a-1]+Ot;n.push(s),r[o]=Math.max(r[o]??1,e.rows[a]),i[o]=Math.max(i[o]??0,s+e.widths[a])}return{columnX:n,bandRows:r,bandW:i}}var Ut=12;function Wt(e,t){let n=n=>{let r=(t.h-(n-1)*At-112)/n,i=Math.max(2,Math.floor((r-64)/Tt)+1),a=Vt(e,i),o=Math.max(1,Math.ceil(a.rows.length/n)),{bandRows:s,bandW:c}=Ht(a,o),l=200;for(let e of c)l=Math.max(l,e);let u=(n-1)*At;for(let e=0;e<n;e++)u+=((s[e]??1)-1)*Tt+64;return{bands:n,rowCap:i,perBand:o,fit:Math.min(t.w/(l+112),t.h/(u+112)),aspect:l/u}},r=n(1);if(e.length<2||r.fit>=It)return r;let i=r;for(let e=2;e<=Ut;e++){let t=n(e);if(t.fit>=It&&t.aspect<=Ft)return t;if(t.fit>i.fit&&(i=t),t.perBand===1)break}return i}function Gt(e,t,n){let r=Wt(t,n),i=Vt(t,r.rowCap),{columnX:a,bandRows:o}=Ht(i,r.perBand),s=new Map,c=new Map;e.forEach((e,t)=>{s.set(e,i.start[t]),c.set(e,i.per[t])});let l=o.length>0?o:[1],u=[],d=[],f=[],p=0;for(let e of l){let t=(e-1)*Tt+64;u.push(p+t/2),d.push(t),p+=t,f.push(p+At/2),p+=At}return{perBand:r.perBand,columnRows:i.rows,columnX:a,startOf:s,splitOf:c,centreY:u,height:d,gutterY:f}}function Kt(e,t){let n=new Map,r=new Set;for(let t of e)typeof t.depth==`number`&&Number.isFinite(t.depth)?(n.set(t.id,t.depth),r.add(t.id)):n.set(t.id,0);let i=t.edges.filter(e=>e.from!==e.to&&n.has(e.from)&&n.has(e.to)),a=new Map,o=new Map(e.map(e=>[e.id,0]));for(let e of i){let t=a.get(e.from);t===void 0?a.set(e.from,[e.to]):t.push(e.to),o.set(e.to,o.get(e.to)+1)}let s=(e,t)=>r.has(e)?t:t+1,c=e.filter(e=>o.get(e.id)===0).map(e=>e.id),l=new Set;for(let e=0;e<c.length;e++){let t=c[e];l.add(t);let r=n.get(t);for(let e of a.get(t)??[]){let t=s(e,r);t>n.get(e)&&n.set(e,t);let i=o.get(e)-1;o.set(e,i),i===0&&c.push(e)}}if(l.size<e.length){let t=i.filter(e=>!l.has(e.to));for(let r=e.length;r>0;r--){let e=!1;for(let r of t){let t=s(r.to,n.get(r.from));t>n.get(r.to)&&(n.set(r.to,t),e=!0)}if(!e)break}}let u=t.outcomeId;if(u!==void 0&&n.has(u)&&!r.has(u)&&(a.get(u)?.length??0)===0){let e=-1/0;for(let t of n.values())t>e&&(e=t);n.set(u,e)}return n}function qt(e,t){let n=new Map(e.map(e=>[e.id,0])),r=new Map(e.map(e=>[e.id,0])),i=new Map,a=0;for(let o of e)for(let e of t.get(o.id)??[]){if(e===o.id||!n.has(e))continue;let t=i.get(e);t===void 0?i.set(e,[o.id]):t.push(o.id),r.set(o.id,r.get(o.id)+1),a++}if(a===0)return n;let o=e.filter(e=>r.get(e.id)===0).map(e=>e.id);for(let e=0;e<o.length;e++){let t=o[e],a=n.get(t);for(let e of i.get(t)??[]){a+1>n.get(e)&&n.set(e,a+1);let t=r.get(e)-1;r.set(e,t),t===0&&o.push(e)}}return n}function Jt(e,t){let n=new Map,r=new Set,i=[],a=new Set;for(let o of e){if(n.has(o.id))continue;i.length=0,a.clear();let e=o,s=0,c=!1;for(;;){let o=e.parentId===void 0?void 0:t.get(e.parentId);if(o===void 0){n.set(e.id,null);break}if(i.push(e),a.add(e.id),n.has(o.id)){c=r.has(o.id),s=n.get(o.id)??0;break}if(a.has(o.id)){c=!0;break}e=o}if(c)for(let e of i)n.set(e.id,null),r.add(e.id);else for(let e=i.length-1;e>=0;e--)n.set(i[e].id,++s)}return n}function Yt(e,t){let n=new Map(e.nodes.map(e=>[e.id,e])),r=Jt(e.nodes,n),i=e.nodes.filter(e=>r.get(e.id)===null),a=e.nodes.filter(e=>r.get(e.id)!==null).sort((e,t)=>r.get(e.id)-r.get(t.id)||e.id.localeCompare(t.id)),o=t?.expandedIds,s=t?.previous,c=new Map,l=Kt(i,e),u=new Set(i.map(e=>e.id)),d=new Set;for(let e of a){let t=e.parentId;o?.has(t)===!0&&(u.has(t)||d.has(t))&&d.add(e.id)}let f=new Map,p=e=>f.get(e)??zt;for(let e=a.length-1;e>=0;e--){let t=a[e];if(!d.has(t.id))continue;let n=p(t.id),r=f.get(t.parentId);f.set(t.parentId,{rows:(r?.rows??0)+n.rows,reach:Math.max(r?.reach??0,kt+n.reach)})}let m=new Map,h=new Map;for(let e of a){let t=h.get(e.parentId)??0;m.set(e.id,t),h.set(e.parentId,t+p(e.id).rows)}let g=new Map;for(let t of e.edges)!u.has(t.from)||!u.has(t.to)||(g.has(t.to)||g.set(t.to,[]),g.get(t.to).push(t.from));let _=new Map;for(let e of i){let t=l.get(e.id),n=_.get(t);n===void 0?_.set(t,[e]):n.push(e)}let v=[..._.keys()].sort((e,t)=>e-t),y=t?.viewport??ue,b=Gt(v,v.map(e=>Bt(_.get(e),p)),y),x=new Map;for(let e of v){let t=_.get(e),n=qt(t,g),r=t.map((e,t)=>{let r=(g.get(e.id)??[]).map(e=>c.get(e)?.y).filter(e=>e!==void 0);return{n:e,bary:r.length?r.reduce((e,t)=>e+t,0)/r.length:s?.get(e.id)?.y??t*Tt,rank:n.get(e.id)}});r.sort((e,t)=>e.rank-t.rank||e.bary-t.bary||e.n.id.localeCompare(t.n.id));let i=b.startOf.get(e),a=b.splitOf.get(e),o=[],l=[];r.forEach((e,t)=>{let n=Math.floor(t/a);o.push(l[n]??0),l[n]=(l[n]??0)+p(e.n.id).rows}),r.forEach((e,t)=>{let n=Math.floor(t/a),r=i+n,s=Math.floor(r/b.perBand),u=p(e.n.id).rows;x.set(e.n.id,s),c.set(e.n.id,{x:b.columnX[r],y:b.centreY[s]+(o[t]+(u-1)/2-(l[n]-1)/2)*Tt})})}for(let e of a){let t=e.parentId,n=c.get(t);if(x.set(e.id,x.get(t)??0),d.has(e.id)){let r=p(e.id).rows,i=h.get(t);c.set(e.id,{x:n.x+kt,y:n.y+(m.get(e.id)+(r-1)/2-(i-1)/2)*Dt})}else c.set(e.id,{x:n.x,y:n.y})}if(d.size>0){let e=[...i,...a.filter(e=>d.has(e.id))],t=e.map(e=>{let t=c.get(e.id);return{x:t.x-100,y:t.y-fe/2,w:200,h:fe}});Ct(t,Et),e.forEach((e,n)=>{c.set(e.id,{x:t[n].x+100,y:t[n].y+fe/2})});for(let e of a){if(d.has(e.id))continue;let t=c.get(e.parentId);c.set(e.id,{x:t.x,y:t.y})}}let S=1/0,C=1/0,w=-1/0,T=-1/0;for(let e of c.values())S=Math.min(S,e.x-100),C=Math.min(C,e.y-32),w=Math.max(w,e.x+100),T=Math.max(T,e.y+32);let E=c.size===0,D=E?0:56-S,O=E?0:56-C,k=new Map;for(let t of e.nodes){let e=c.get(t.id);k.set(t.id,{x:e.x+D-100,y:e.y+O-32,w:200,h:64,face:`card`,...r.get(t.id)!==null&&!d.has(t.id)?{folded:!0}:{}})}let A=e=>u.has(e)||d.has(e),j=E?56:w+D,M=e.edges.filter(e=>A(e.from)&&A(e.to)).map(e=>{let t=k.get(e.from),n=k.get(e.to),r=x.get(e.from)??0,i=x.get(e.to)??0,a=r===i?-1:Math.max(r,i)-1;return{e,from:t,to:n,gutter:a,vertical:a<0&&n.x<=t.x&&Math.abs(n.y-t.y)>1}}),N=new Map,P=new Map,F=new Map,I=(e,t)=>void e.set(t,(e.get(t)??0)+1);for(let e of M)e.gutter>=0&&I(N,e.gutter),!e.vertical&&(I(P,e.e.to),I(F,e.e.from));let L=new Map,R=new Map,z=new Map,B=(e,t,n)=>e.y+e.h/2+(n-(t-1)/2)*Math.min(Pt,e.h/(t+1)),V=[];for(let{e,from:t,to:n,gutter:r,vertical:i}of M){let a;if(i){let e=t.x+t.w/2,r=n.x+n.w/2,i=n.y>t.y,o=i?t.y+t.h:t.y,s=i?n.y:n.y+n.h,c=(o+s)/2;a=`M ${J(e)} ${J(o)} C ${J(e)} ${J(c)} ${J(r)} ${J(c)} ${J(r)} ${J(s)}`}else{let i=z.get(e.from)??0,o=R.get(e.to)??0;z.set(e.from,i+1),R.set(e.to,o+1);let s=t.x+t.w,c=B(t,F.get(e.from),i),l=n.x,u=B(n,P.get(e.to),o);if(r<0){let e=(s+l)/2;a=`M ${J(s)} ${J(c)} C ${J(e)} ${J(c)} ${J(e)} ${J(u)} ${J(l)} ${J(u)}`}else{let e=N.get(r),t=L.get(r)??0;L.set(r,t+1);let n=Math.min(Nt,(At-32)/Math.max(1,e)),i=b.gutterY[r]+O+(t-(e-1)/2)*n,o=j+jt,d=Math.min(l,56)-jt,f=(o+d)/2;a=`M ${J(s)} ${J(c)} C ${J(o)} ${J(c)} ${J(o)} ${J(i)} ${J(f)} ${J(i)} C ${J(d)} ${J(i)} ${J(d)} ${J(u)} ${J(l)} ${J(u)}`}}V.push({id:e.id,d:a,className:`morph-edge`+he(e.kind)+(e.sign===-1?` morph-edge--damp`:``)+(e.provisional?` morph-edge--provisional`:``)+(r<0?``:` morph-edge--wrap`),...typeof e.weight==`number`&&Number.isFinite(e.weight)?{width:Lt+Math.min(1,Math.max(0,e.weight))*Rt}:{}})}let H=E?{x:0,y:0,w:112,h:112}:{x:0,y:0,w:w-S+112,h:T-C+112};return{positions:k,edgePaths:V,chrome:{bands:E||b.centreY.length<2?[]:b.centreY.map((e,t)=>{let n=Math.max(H.y,e-b.height[t]/2+O-Mt),r=Math.min(H.y+H.h,e+b.height[t]/2+O+Mt);return{id:`reading-band:${t}`,x:56-Mt,y:n,w:j-56+40,h:Math.max(0,r-n),className:`morph-reading-band`}}),paths:[],labels:[]},bbox:H}}var Xt=(e,t)=>({rep:`graph`,...Yt(e,t)}),Zt=920,Qt=16,$t=44+Qt,en=12,tn=8,nn=12;function rn(e){if(!e.date||!Number.isFinite(e.date.start))return null;let t=Y(e.date.start),n=e.date.end;return{node:e,startYear:t,...n!==void 0&&Number.isFinite(n)&&n>e.date.start?{endYear:Y(n)}:{}}}var an=e=>rn(e)!==null;function on(e){let t=1/0,n=-1/0;for(let r of e)for(let e of r.nodes){let r=rn(e);r&&(t=Math.min(t,r.startYear),n=Math.max(n,r.endYear??r.startYear))}return t===1/0?null:Ae(t,n,6)}function sn(e){let t=1;for(;t<e;)t*=2;let n=Array(t*2).fill(1/0),r=0;return(e,i)=>{let a=1;if(n[1]<=i)for(;a<t;)a=n[a*2]<=i?a*2:a*2+1;else a=t+r++;let o=a-t;for(n[a]=e;a>1;)a>>=1,n[a]=Math.min(n[a*2],n[a*2+1]);return o}}function cn(e,t,n){let r=[],i=[];for(let n of e.nodes){let e=rn(n);e&&t?r.push(e):i.push(n)}r.sort((e,t)=>e.startYear-t.startYear||e.node.id.localeCompare(t.node.id));let a=new Map,o={bands:[],paths:[],labels:[]},s=[],c=1/0,l=-1/0,u=56;if(r.length>0&&t){let n=g(t.domain,[56,56+Zt]),i=sn(r.length);for(let e of r){let t=n(e.startYear),r=e.endYear===void 0?t:n(e.endYear),s=e.endYear===void 0?t-80:t,d=Math.min(s,t)-32,f=Math.max(s+160,r)+32,p=56+i(f+nn,d)*$t;a.set(e.node.id,{x:s,y:p,w:160,h:44,face:`entry`}),e.endYear!==void 0&&o.bands.push({id:`period:${e.node.id}`,x:t,y:p-6,w:Math.max(r-t,2),h:56,className:`morph-period`}),c=Math.min(c,d),l=Math.max(l,f),u=Math.max(u,p+44)}let d=u+Qt+en;o.paths.push({id:`axis`,d:`M ${J(56)} ${J(d)} L ${J(56+Zt)} ${J(d)}`,className:`morph-axis`}),t.ticks.forEach((e,t)=>{let r=n(e.year);o.paths.push({id:`tick:${t}`,d:`M ${J(r)} ${J(d)} L ${J(r)} ${J(d+tn)}`,className:`morph-tick`}),o.labels.push({id:`tick-label:${t}`,x:r,y:d+tn+16,text:e.text,className:`morph-axis-label`,anchor:`middle`}),c=Math.min(c,r-e.text.length*3.5),l=Math.max(l,r+e.text.length*3.5)}),c=Math.min(c,56),l=Math.max(l,56+Zt),u=d+tn+20;let f=new Set(r.map(e=>e.node.id));for(let t of e.edges){if(t.from===t.to||!f.has(t.from)||!f.has(t.to))continue;let e=a.get(t.from),n=a.get(t.to),r=e.x+e.w/2,i=n.x+n.w/2,o=e.y,c=n.y,l=Math.min(72,Math.max(20,Math.abs(i-r)*.2));s.push({id:t.id,d:`M ${J(r)} ${J(o)} C ${J(r)} ${J(o-l)} ${J(i)} ${J(c-l)} ${J(i)} ${J(c)}`,className:`morph-edge morph-edge--faint`+he(t.kind)})}}let d=Q(i,c===1/0?{x:0,y:0,w:112,h:112}:{x:c-56,y:0,w:l-c+112,h:u+56},`${i.length} with no date — the timeline cannot place these`,n);d.band&&o.bands.push(d.band);for(let[e,t]of d.positions)a.set(e,t);return{positions:a,edgePaths:s,chrome:o,bbox:d.bbox}}var ln=(e,t)=>({rep:`timeline`,...cn(e,on([e]),t?.viewport??ue)}),un={min:me,max:2.2},dn=56,fn=1300,pn=1300,mn=.7,hn=120,gn=120,_n=[`graph`,`flow`,`timeline`,`chart`],vn={graph:Xt,timeline:ln,chart:ft,flow:xt},yn={graph:`What caused what`,timeline:`The same causes, in time`,chart:`How much each one moved`,flow:`How much each one contributed`},bn={graph:()=>!0,timeline:an,chart:ot,flow:bt},xn=2,Sn=1/3;function Cn(e,t){let n=t.nodes.filter(e=>e.parentId===void 0);if(n.length===0)return!1;let r=n.filter(n=>bn[e](n,t)).length;return r>=Math.min(xn,n.length)&&r/n.length>=Sn}var wn=e=>({x:0,y:0,w:e.w,h:e.h}),Tn=(e,t,n)=>[t-e.x,n-e.y];function En(e,t,n){let r=e.positions.get(t);if(!r)return null;let i=r.x,a=r.y,o=r.x+r.w,s=r.y+r.h;for(let r of n.get(t)??[]){let t=e.positions.get(r);!t||t.folded||(i=Math.min(i,t.x),a=Math.min(a,t.y),o=Math.max(o,t.x+t.w),s=Math.max(s,t.y+t.h))}let[c,l]=Tn(e.bbox,i-hn,a-hn);return{x:c,y:l,w:o-i+240,h:s-a+240}}function Dn(e){let{world:t,onAscend:n,driverId:r,insetBottom:i}=e,[a,o]=(0,U.useState)(e.initialRep??`graph`),[s,c]=(0,U.useState)(()=>new Set),[l,u]=(0,U.useState)(null),d=p({clamp:un,margin:dn,...i===void 0?{}:{insetBottom:i}}),m=(0,U.useRef)(void 0),{viewport:h}=d,g=(0,U.useMemo)(()=>h?{w:Math.max(1,h.w-112),h:Math.max(1,h.h-112)}:void 0,[h]),_=(0,U.useMemo)(()=>vn[a](t,{expandedIds:s,previous:m.current,...g?{viewport:g}:{}}),[a,t,s,g]);(0,U.useEffect)(()=>{let e=new Map;for(let[t,n]of _.positions)e.set(t,{x:n.x,y:n.y});m.current=e},[_]);let v=(0,U.useRef)(a);v.current=a;let y=(0,U.useRef)(_);y.current=_;let b=(0,U.useRef)(d.camera);b.current=d.camera;let x=(0,U.useRef)(s);x.current=s;let S=(0,U.useRef)(n);S.current=n;let[C,w]=(0,U.useState)(null),{endFlight:T}=d,E=(0,U.useCallback)(()=>{w({layout:y.current,rep:v.current,expandedIds:x.current}),T()},[T]),O=(0,U.useRef)(0),k=(0,U.useRef)(void 0);(0,U.useEffect)(()=>()=>clearTimeout(k.current),[]);let A=(0,U.useCallback)(e=>{if(e===v.current)return;let t=++O.current;u({layout:y.current,token:t}),clearTimeout(k.current),k.current=setTimeout(()=>{t===O.current&&u(null)},fn),v.current=e,o(e)},[]),j=(0,U.useCallback)(e=>{e===O.current&&(clearTimeout(k.current),u(null))},[]),M=(0,U.useRef)(null),N=(0,U.useCallback)(e=>{let t=new Set(x.current);t.delete(e)||(t.add(e),M.current=e),c(t)},[]),P=(0,U.useMemo)(()=>{let e=new Map;for(let n of t.nodes){if(n.parentId===void 0)continue;let t=e.get(n.parentId);t?t.push(n.id):e.set(n.parentId,[n.id])}return e},[t]),{fitTo:F,setCamera:I,viewportRef:L}=d;(0,U.useEffect)(()=>{let e=M.current;if(M.current=null,e!==null){let t=En(_,e,P);if(t){F(t);return}}F(wn(_.bbox))},[_,P,F,I,L]);let R=(0,U.useMemo)(()=>new Map(t.nodes.map(e=>[e.id,e.parentId])),[t]),z=(0,U.useMemo)(()=>{let e=new Set;for(let t of R.values())t!==void 0&&e.add(t);return e},[R]),B=(0,U.useCallback)(e=>{let t=0,n=e,r=new Set;for(;n!==void 0&&!r.has(n);)r.add(n),n=R.get(n),n!==void 0&&(t+=1);return t},[R]),{zoomAtClient:V}=d,H=(0,U.useCallback)((e,t,n,r)=>{if(e>=1)return r!==void 0&&z.has(r)&&!x.current.has(r)?(N(r),`expand`):(V(e,t,n),`zoom`);let i=L.current?.getBoundingClientRect();if(Xe(`out`,!!i&&(i.width>0||i.height>0)&&f(b.current,wn(y.current.bbox),{w:i.width,h:i.height},dn,un))===`zoom-camera`)return V(e,t,n),`zoom`;let a=[...x.current];if(a.length>0){let e=a[0],t=B(e);for(let n of a){let r=B(n);r>t&&(e=n,t=r)}return N(e),`collapse`}return S.current?.(),`ascend`},[z,N,V,L,B]),W=(0,U.useCallback)(e=>{let t=y.current,n=e===null?void 0:t.positions.get(e);if(!n||n.folded){F(wn(t.bbox));return}let[r,i]=Tn(t.bbox,n.x-gn,n.y-gn);F({x:r,y:i,w:n.w+240,h:n.h+240})},[F]);(0,U.useEffect)(()=>{if(r!==void 0)return D(r,{count:_n.length,setIndex:e=>A(_n[Math.min(_n.length-1,Math.max(0,Math.trunc(e)))]),spokenFor:()=>void 0,captionFor:e=>{let t=_n[e];return t?yn[t]:void 0}})},[r,A]);let G=C?.layout!==_||d.flying;return(0,U.useEffect)(()=>{if(!G)return;let e=setTimeout(E,pn);return()=>clearTimeout(e)},[G,_,E]),{rep:a,setRep:A,layout:_,exiting:l,settleExit:j,expandedIds:s,toggleExpand:N,cam:d,morphing:G,settle:E,lod:d.camera.scale>=mn?`near`:`far`,pinch:H,focusNode:W}}function On({label:e,min:t,max:n,step:r=1,value:i,onChange:a,format:o,color:s=`var(--presence)`}){let c=n-t||1,l=(i-t)/c*100;return(0,G.jsxs)(`label`,{className:`viz-ctl`,style:{"--ctl-c":s,"--ctl-pct":l+`%`},children:[(0,G.jsx)(`span`,{className:`viz-ctl-label`,children:e}),(0,G.jsx)(`input`,{type:`range`,className:`viz-ctl-range`,min:t,max:n,step:r,value:i,"aria-label":e,onChange:e=>a(Number(e.target.value))}),(0,G.jsx)(`span`,{className:`viz-ctl-val tab-num`,children:o?o(i):i.toLocaleString()})]})}var kn=`No cause is established yet, so there is nothing to push on.`;function An(e){let t=(0,W.c)(17),{levers:n,onSet:r,onReset:i}=e,a;t[0]===n?a=t[1]:(a=n.every(Mn),t[0]=n,t[1]=a);let o=a,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`WHAT IF`}),t[2]=s):s=t[2];let c;t[3]!==i||t[4]!==o?(c=(0,G.jsxs)(`div`,{className:`tr-levers-head`,children:[s,(0,G.jsx)(`button`,{type:`button`,className:`tr-reset`,onClick:i,disabled:o,children:`Reset`})]}),t[3]=i,t[4]=o,t[5]=c):c=t[5];let l;t[6]===n.length?l=t[7]:(l=n.length===0&&(0,G.jsx)(`p`,{className:`tr-levers-empty`,children:kn}),t[6]=n.length,t[7]=l);let u;if(t[8]!==n||t[9]!==r){let e;t[11]===r?e=t[12]:(e=e=>(0,G.jsx)(On,{label:e.label,min:0,max:100,value:e.pct,onChange:t=>r(e.id,t),format:jn},e.id),t[11]=r,t[12]=e),u=n.map(e),t[8]=n,t[9]=r,t[10]=u}else u=t[10];let d;return t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,G.jsxs)(`div`,{className:`tr-levers`,children:[c,l,u]}),t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function jn(e){return`${e}%`}function Mn(e){return e.pct===100}var Nn=(0,U.memo)(An),Pn=(0,U.createContext)(null);function Fn(){return(0,U.useContext)(Pn)}function In(e){let t=(0,W.c)(19),{id:n,className:r}=e,i=Fn(),a,o,s,c,l,u;if(t[0]!==r||t[1]!==n||t[2]!==i){u=Symbol.for(`react.early_return_sentinel`);bb0:{let e=i?.registry.values.get(n);if(!e){u=null;break bb0}let d=`tr-num`+(r?` ${r}`:``);if(e.kind===`structure`){u=(0,G.jsx)(`span`,{className:`${d} tr-num-qual`,"data-status":`structure`,children:e.resolution.raw});break bb0}a=`button`,o=d,s=ee(e),t[9]!==n||t[10]!==i?(c=e=>i?.open(n,e.currentTarget),t[9]=n,t[10]=i,t[11]=c):c=t[11],l=x(e)}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u}else a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8];if(u!==Symbol.for(`react.early_return_sentinel`))return u;let d;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,G.jsx)(`span`,{className:`tr-sr`,children:`, source available`}),t[12]=d):d=t[12];let f;return t[13]!==a||t[14]!==o||t[15]!==s||t[16]!==c||t[17]!==l?(f=(0,G.jsxs)(`button`,{type:a,className:o,"data-status":s,onClick:c,children:[l,d]}),t[13]=a,t[14]=o,t[15]=s,t[16]=c,t[17]=l,t[18]=f):f=t[18],f}var Ln=8,Rn=6;function zn(e,t,n){return Math.max(Ln,Math.min(e,n-t-Ln))}function Bn(e,t,n){if(!(e.width>0||e.height>0||e.left>0||e.top>0))return{left:zn((n.w-t.w)/2,t.w,n.w),top:zn((n.h-t.h)/2,t.h,n.h)};let r=e.bottom+Rn,i=e.top-Rn-t.h,a=r+t.h+Ln>n.h&&i>=Ln;return{left:zn(e.left,t.w,n.w),top:zn(a?i:r,t.h,n.h)}}var Vn=320,Hn=340,Un=8;function Wn(e){let t=(0,W.c)(64),{registry:n,valueId:r,anchorRect:i,trail:a,hinted:o,onMarkHinted:s,onDrill:c,onBack:l,onNavigate:u,onDismiss:f}=e,p=(0,U.useRef)(null),m;t[0]===f?m=t[1]:(m={onEscape:f},t[0]=f,t[1]=m),d(p,m);let[h]=(0,U.useState)(!o),g,_;t[2]===s?(g=t[3],_=t[4]):(g=()=>s(),_=[s],t[2]=s,t[3]=g,t[4]=_),(0,U.useEffect)(g,_);let v=(0,U.useRef)(!0),y;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{v.current||p.current?.focus({preventScroll:!0}),v.current=!1},t[5]=y):y=t[5];let w;t[6]===r?w=t[7]:(w=[r],t[6]=r,t[7]=w),(0,U.useEffect)(y,w);let D,O;t[8]===f?(D=t[9],O=t[10]):(D=()=>{let e=e=>{let t=p.current;t&&e.target instanceof Node&&!t.contains(e.target)&&f()};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},O=[f],t[8]=f,t[9]=D,t[10]=O),(0,U.useEffect)(D,O);let k=n.values,A,j,M,N,P,F,I,L,R,z,B,V,H,K;if(t[11]!==i||t[12]!==l||t[13]!==c||t[14]!==u||t[15]!==n.usedIn||t[16]!==n.values||t[17]!==a||t[18]!==r){V=Symbol.for(`react.early_return_sentinel`);bb0:{if(K=k.get(r),!K){V=null;break bb0}let e=ee(K),o=K.scope,s=n.usedIn.get(r)??[],d=K.kind===`grounded`?K.resolution.receipt:null,f=K.kind===`grounded`&&K.resolution.tier===`T1`,m=d?.url?T(d.url):null,h=d?d.host??(d.url?E(d.url):null):null,g=K.kind===`calculated`?K.calc.inputs:[],_=g.slice(0,Un),v=g.length-_.length,y;t[33]!==n.values||t[34]!==a?(y=a.length>0?n.values.get(a[a.length-1]):void 0,t[33]=n.values,t[34]=a,t[35]=y):y=t[35];let w=y,D;t[36]===i?D=t[37]:(D=Bn(i,{w:Vn,h:Hn},{w:window.innerWidth,h:window.innerHeight}),t[36]=i,t[37]=D);let{left:O,top:U}=D;H=p,A=`tr-card`,j=`dialog`,M=`false`,N=`Where ${K.label} came from`,P=-1,t[38]!==O||t[39]!==U?(F={left:O,top:U,width:Vn,maxHeight:Hn},t[38]=O,t[39]=U,t[40]=F):F=t[40];let W;t[41]!==l||t[42]!==w?(W=w&&(0,G.jsxs)(`button`,{type:`button`,className:`tr-back`,onClick:l,"aria-label":`Back to ${w.label}`,children:[`‹ back`,(0,G.jsxs)(`span`,{className:`tr-back-to`,children:[` to `,w.label]})]}),t[41]=l,t[42]=w,t[43]=W):W=t[43],I=(0,G.jsxs)(`header`,{className:`tr-head`,children:[W,(0,G.jsx)(`span`,{className:`tr-badge`,"data-status":e,children:C[e]}),(0,G.jsx)(`p`,{className:`tr-figure`,children:x(K)}),(0,G.jsx)(`p`,{className:`tr-label`,children:K.label})]}),L=d&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`SOURCE`}),d.quote&&(0,G.jsxs)(`blockquote`,{className:`tr-quote`,children:[`“`,d.quote,`”`]}),f?(0,G.jsx)(`p`,{className:`tr-host`,children:b(d)}):h&&(0,G.jsxs)(`p`,{className:`tr-host`,children:[m?(0,G.jsx)(`a`,{href:m,target:`_blank`,rel:`noreferrer noopener`,children:h}):h,d.date&&(0,G.jsxs)(`span`,{className:`tr-date`,children:[` · `,d.date]})]})]}),R=o&&(o.region||o.period||o.unit)&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`SCOPE`}),(0,G.jsx)(`p`,{className:`tr-chips`,children:[o.region,o.period,o.unit].filter(Kn).map(Gn)})]}),z=K.kind===`calculated`&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`CALCULATION`}),(0,G.jsx)(`p`,{className:`tr-formula`,children:S(K.calc.formula,e=>n.values.get(e)?.label)}),(0,G.jsx)(`ul`,{className:`tr-inputs`,children:_.map(e=>{let t=n.values.get(e);return(0,G.jsx)(`li`,{children:t?(0,G.jsxs)(`button`,{type:`button`,className:`tr-input`,onClick:()=>c(e),children:[(0,G.jsx)(`span`,{className:`tr-input-label`,children:t.label}),(0,G.jsx)(`span`,{className:`tr-input-val`,children:x(t)})]}):(0,G.jsx)(`span`,{className:`tr-input tr-input-missing`,children:e})},e)})}),v>0&&(0,G.jsxs)(`p`,{className:`tr-more`,children:[`…and `,v,` more`]}),K.calc.note&&(0,G.jsx)(`p`,{className:`tr-note`,children:K.calc.note})]}),B=s.length>0&&(0,G.jsxs)(`section`,{className:`tr-sec`,children:[(0,G.jsx)(`h3`,{className:`tr-sec-title`,children:`USED IN`}),(0,G.jsx)(`ul`,{className:`tr-used`,children:s.map(e=>(0,G.jsx)(`li`,{children:u?(0,G.jsx)(`button`,{type:`button`,className:`tr-usedin`,onClick:()=>u(e),children:e.label}):(0,G.jsx)(`span`,{className:`tr-usedin tr-usedin-flat`,children:e.label})},`${e.surface}:${e.id}:${e.label}`))})]})}t[11]=i,t[12]=l,t[13]=c,t[14]=u,t[15]=n.usedIn,t[16]=n.values,t[17]=a,t[18]=r,t[19]=A,t[20]=j,t[21]=M,t[22]=N,t[23]=P,t[24]=F,t[25]=I,t[26]=L,t[27]=R,t[28]=z,t[29]=B,t[30]=V,t[31]=H,t[32]=K}else A=t[19],j=t[20],M=t[21],N=t[22],P=t[23],F=t[24],I=t[25],L=t[26],R=t[27],z=t[28],B=t[29],V=t[30],H=t[31],K=t[32];if(V!==Symbol.for(`react.early_return_sentinel`))return V;let te;t[44]!==K.kind||t[45]!==K.resolution?(te=K.kind===`illustrative`&&(0,G.jsxs)(`p`,{className:`tr-caveat`,children:[`Illustrative — shows the shape, not a measured fact. `,K.resolution.illustrative]}),t[44]=K.kind,t[45]=K.resolution,t[46]=te):te=t[46];let q;t[47]===h?q=t[48]:(q=h&&(0,G.jsx)(`p`,{className:`tr-hint`,children:`Any figure like this one opens its own receipt.`}),t[47]=h,t[48]=q);let ne;return t[49]!==A||t[50]!==j||t[51]!==M||t[52]!==N||t[53]!==P||t[54]!==F||t[55]!==I||t[56]!==L||t[57]!==R||t[58]!==z||t[59]!==B||t[60]!==te||t[61]!==q||t[62]!==H?(ne=(0,G.jsxs)(`div`,{ref:H,className:A,role:j,"aria-modal":M,"aria-label":N,tabIndex:P,style:F,children:[I,L,R,z,B,te,q]}),t[49]=A,t[50]=j,t[51]=M,t[52]=N,t[53]=P,t[54]=F,t[55]=I,t[56]=L,t[57]=R,t[58]=z,t[59]=B,t[60]=te,t[61]=q,t[62]=H,t[63]=ne):ne=t[63],ne}function Gn(e){return(0,G.jsx)(`span`,{className:`tr-chip`,children:e},e)}function Kn(e){return!!e}function qn(e){let t=(0,W.c)(23),{registry:n,onNavigate:r,children:i,ref:a}=e,[o,s]=(0,U.useState)(null),[c,l]=(0,U.useState)(!1),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>s(null),t[0]=u):u=t[0];let d;t[1]===n?d=t[2]:(d=[n],t[1]=n,t[2]=d),(0,U.useEffect)(u,d);let f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>s(null),t[3]=f):f=t[3];let p=f,m,h;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>({dismiss:p}),h=[p],t[4]=m,t[5]=h):(m=t[4],h=t[5]),(0,U.useImperativeHandle)(a,m,h);let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(e,t)=>{t.focus(),s({valueId:e,anchorRect:t.getBoundingClientRect(),trail:[]})},t[6]=g):g=t[6];let _=g,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>l(!0),t[7]=v):v=t[7];let y=v,b;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>{s(t=>t&&{valueId:e,anchorRect:t.anchorRect,trail:[...t.trail,t.valueId]})},t[8]=b):b=t[8];let x=b,S;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>{s(Jn)},t[9]=S):S=t[9];let C=S,w;t[10]!==c||t[11]!==r||t[12]!==n?(w={registry:n,open:_,onNavigate:r,hinted:c,markHinted:y},t[10]=c,t[11]=r,t[12]=n,t[13]=w):w=t[13];let T=w,E;t[14]!==o||t[15]!==c||t[16]!==r||t[17]!==n?(E=o&&(0,G.jsx)(Wn,{registry:n,valueId:o.valueId,anchorRect:o.anchorRect,trail:o.trail,hinted:c,onMarkHinted:y,onDrill:x,onBack:C,onNavigate:r,onDismiss:p}),t[14]=o,t[15]=c,t[16]=r,t[17]=n,t[18]=E):E=t[18];let D;return t[19]!==i||t[20]!==E||t[21]!==T?(D=(0,G.jsxs)(Pn.Provider,{value:T,children:[i,E]}),t[19]=i,t[20]=E,t[21]=T,t[22]=D):D=t[22],D}function Jn(e){let t=e?.trail[e.trail.length-1];return!e||t===void 0?e:{valueId:t,anchorRect:e.anchorRect,trail:e.trail.slice(0,-1)}}var Yn=`Recomputed locally from the causes above — a model of what would happen, never an observation.`,Xn=`What was actually measured. This column never moves when a lever is pulled.`;function Zn(e,t){return(e>0?`+`:``)+m(e,t)}function Qn(e){return e!==null&&Number.isFinite(e)&&e>=0&&e<=1}function $n(e){return e.exactBase===null?`nothing measured stands behind this outcome`:`not every step is grounded, so the total stays unmeasured`}function er(e){let t=(0,W.c)(22),{baseline:n,current:r,unit:i,active:a,observedNote:o}=e,s;t[0]!==n.exactBase||t[1]!==n.fullyGrounded||t[2]!==i?(s=n.fullyGrounded&&n.exactBase!==null?m(n.exactBase,i):null,t[0]=n.exactBase,t[1]=n.fullyGrounded,t[2]=i,t[3]=s):s=t[3];let c=s,l=r.exactBase??n.exactBase,u=a?`1`:void 0,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,G.jsx)(`span`,{className:`tr-chip tr-wi-chip`,title:Xn,children:`OBSERVED`}),t[4]=d):d=t[4];let f;t[5]!==n||t[6]!==c||t[7]!==o?(f=(0,G.jsxs)(`div`,{className:`tr-wi-col`,children:[d,c===null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}),(0,G.jsx)(`p`,{className:`tr-wi-note tr-wi-why`,children:o??$n(n)})]}):(0,G.jsx)(`p`,{className:`tr-wi-figure`,children:c})]}),t[5]=n,t[6]=c,t[7]=o,t[8]=f):f=t[8];let p;t[9]!==a||t[10]!==l||t[11]!==r.exactDelta||t[12]!==r.explainedPct||t[13]!==r.fullyGrounded||t[14]!==r.relBase||t[15]!==r.relCur||t[16]!==i?(p=a&&(0,G.jsxs)(`div`,{className:`tr-wi-col tr-wi-hypo`,"data-world":`hypothetical`,children:[(0,G.jsx)(`span`,{className:`tr-chip tr-wi-chip tr-wi-chip-hypo`,title:Yn,children:`HYPOTHETICAL (MODELED)`}),r.fullyGrounded&&l!==null&&r.exactDelta!==null?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`tr-wi-figure`,children:m(l+r.exactDelta,i)}),(0,G.jsx)(`p`,{className:`tr-wi-delta`,children:Zn(r.exactDelta,i)}),Qn(r.explainedPct)&&(0,G.jsxs)(`p`,{className:`tr-wi-note`,children:[Math.round(r.explainedPct*100),`% explained`]})]}):r.relCur===null?(0,G.jsx)(`p`,{className:`tr-wi-figure tr-wi-dash`,children:`—`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`tr-wi-figure tr-wi-phrase`,children:ne(r.relBase??0,r.relCur)}),(0,G.jsx)(`p`,{className:`tr-wi-note`,children:`relative, not measured`})]})]}),t[9]=a,t[10]=l,t[11]=r.exactDelta,t[12]=r.explainedPct,t[13]=r.fullyGrounded,t[14]=r.relBase,t[15]=r.relCur,t[16]=i,t[17]=p):p=t[17];let h;return t[18]!==u||t[19]!==f||t[20]!==p?(h=(0,G.jsxs)(`div`,{className:`tr-wi`,"data-active":u,children:[f,p]}),t[18]=u,t[19]=f,t[20]=p,t[21]=h):h=t[21],h}var tr=(0,U.memo)(er);function nr(e){return{id:e.id,label:e.label,role:e.role,depth:e.depth,tier:e.tier,...e.value===void 0?{}:{value:e.value},...e.unit?{unit:e.unit}:{},...e.receipt?{receipt:e.receipt}:{}}}function rr(e){let t=e.receipts?.[0]??e.receipt;return{from:e.from,to:e.to,sign:e.sign,tier:e.tier,...e.verb?{verb:e.verb}:{},...e.weight===void 0?{}:{weight:e.weight},...t&&!e.provisional?{receipt:t}:{},...e.provisional?{provisional:!0}:{}}}function ir(e){return{center:e.title,outcomeId:e.outcomeId,nodes:e.nodes.map(nr),edges:e.edges.map(rr),provenance:{...e.provenance.illustrative?{illustrative:!0}:{},...e.provenance.notes?.length?{notes:e.provenance.notes}:{}}}}var ar=e=>`node:${e}`,or=(e,t)=>`node:${e}@${t}`;function sr(e,t){let n=e.provenance.illustrative===!0,r=[],i=[],a=[],o=new Map,s=[],c=new Map,l=(e,t,n)=>{!e||o.has(e.id)||(o.set(e.id,e),s.push(t),i.push(n))},u=(e,t)=>{c.set(e.id,e.label),r.push({id:e.id,label:e.label,role:e.role,...e.detail===void 0?{}:{detail:e.detail},...e.domain===void 0?{}:{domain:e.domain},...t===void 0?{}:{parentId:t}});let i=e.series,a=e.unit??i?.unit,o=t=>({valueId:t,surface:`node`,id:e.id,label:e.label});if(e.value!==void 0){let t=ar(e.id);l(R(t,e.label,e.value,e.tier,a,e.receipt,n),o(t),{valueId:t,entityId:e.id})}if(i)for(let t of i.points){let r=or(e.id,t.t),a=R(r,`${e.label} · ${t.t}`,t.value,i.tier,i.unit,t.receipt??i.receipt,n,t.t);l(a,o(r),{valueId:r,entityId:e.id,at:t.t})}for(let t of e.children??[])u(t,e.id)};for(let t of e.nodes)u(t);return se(e.edges).forEach((e,n)=>{let r=`${c.get(e.from)??e.from} ${e.verb??`→`} ${c.get(e.to)??e.to}`,i=t.edges[n]?.id;if(i!==void 0){a.push({id:i,from:e.from,to:e.to,...e.relation===void 0?{}:{kind:e.relation},...e.sign===void 0?{}:{sign:e.sign},...e.weight===void 0?{}:{weight:e.weight}});for(let t of[e.from,e.to])s.push({valueId:ar(t),surface:`edge`,id:i,label:r})}}),{title:e.title,entities:r,relations:a,facts:i,trust:z(o,s),outcomeId:e.outcomeId,...n?{illustrative:n}:{}}}var cr=1100;function lr(e,t,n,r){let i=!1,a=e=>{i||(i=!0,r(e))};(async()=>{for(let r=Math.max(0,t);r<e.length;r++){let t=e[r];if(!t)continue;if(n.isCancelled()){a(`cancelled`);return}let i=O(t.say),o=n.speakLine?.(t.say)??null,s=o?await j(o):!1;if(n.isCancelled()){a(`cancelled`);return}n.apply(t,r),o&&s?await k(o,i,cr):await A(i)}a(n.isCancelled()?`cancelled`:`complete`)})()}function ur({beats:e,apply:t,speakLine:n}){let[r,i]=(0,U.useState)(-1),[a,o]=(0,U.useState)(!1),s=(0,U.useRef)(0),c=(0,U.useRef)(e);c.current=e;let l=(0,U.useRef)(t);l.current=t;let u=(0,U.useRef)(n);u.current=n;let d=(0,U.useCallback)(()=>{s.current+=1,o(!1)},[]),f=(0,U.useCallback)(e=>{let t=s.current+=1;o(!0),lr(c.current,e,{speakLine:e=>u.current?.(e)??null,apply:(e,t)=>{i(t),l.current(e,t)},isCancelled:()=>s.current!==t},()=>{s.current===t&&o(!1)})},[]);(0,U.useEffect)(()=>()=>void(s.current+=1),[]),(0,U.useEffect)(()=>{s.current+=1,o(!1),i(-1)},[e]);let p=(0,U.useCallback)(()=>{if(a){d();return}let e=c.current.length;e!==0&&f(r>=0&&r<e-1?r:0)},[a,r,f,d]),m=(0,U.useCallback)(e=>{let t=c.current.length;t!==0&&f(Math.min(Math.max(e,0),t-1))},[f]),h=(0,U.useCallback)(()=>{d(),i(-1)},[d]);return{index:r,playing:a,caption:r>=0?e[r]?.caption??null:null,toggle:p,seek:m,reset:h}}function dr(e){let t=(0,W.c)(28),{count:n,index:r,playing:i,caption:a,expanded:o,onToggle:s,onSeek:c}=e;if(n===0)return null;let l=Math.min(Math.max(r,-1),n-1),u=i?``:void 0,d=o?``:void 0,f=`${o?108:54}px`,p;t[0]===f?p=t[1]:(p={"--wo-transport-h":f},t[0]=f,t[1]=p);let m=p,h=i?`Pause the walkthrough`:`Walk me through it`,g=i?`❙❙`:`▶`,_;t[2]===g?_=t[3]:(_=(0,G.jsx)(`span`,{className:`wo-play-glyph`,"aria-hidden":`true`,children:g}),t[2]=g,t[3]=_);let v=i?`Pause`:`Walk me through it`,y;t[4]===v?y=t[5]:(y=(0,G.jsx)(`span`,{className:`wo-play-label`,children:v}),t[4]=v,t[5]=y);let b;t[6]!==s||t[7]!==y||t[8]!==h||t[9]!==_?(b=(0,G.jsxs)(`button`,{type:`button`,className:`wo-play`,onClick:s,"aria-label":h,children:[_,y]}),t[6]=s,t[7]=y,t[8]=h,t[9]=_,t[10]=b):b=t[10];let x;t[11]!==l||t[12]!==n||t[13]!==o||t[14]!==c?(x=o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`wo-track`,role:`group`,"aria-label":`Walkthrough beats`,children:Array.from({length:n},(e,t)=>(0,G.jsx)(`button`,{type:`button`,className:`wo-tick`,"data-state":t<l?`past`:t===l?`now`:`ahead`,onClick:()=>c(t),"aria-label":`Beat ${t+1} of ${n}`,"aria-current":t===l?`step`:void 0},t))}),(0,G.jsxs)(`span`,{className:`wo-transport-count`,"aria-hidden":`true`,children:[l<0?n:l+1,`/`,n]})]}),t[11]=l,t[12]=n,t[13]=o,t[14]=c,t[15]=x):x=t[15];let S;t[16]!==b||t[17]!==x?(S=(0,G.jsxs)(`div`,{className:`wo-transport-row`,children:[b,x]}),t[16]=b,t[17]=x,t[18]=S):S=t[18];let C;t[19]!==a||t[20]!==o?(C=o&&(0,G.jsx)(`p`,{className:`wo-caption`,"aria-live":`polite`,children:a===null?``:M(a)}),t[19]=a,t[20]=o,t[21]=C):C=t[21];let w;return t[22]!==u||t[23]!==S||t[24]!==C||t[25]!==d||t[26]!==m?(w=(0,G.jsxs)(`div`,{className:`wo-transport`,"data-playing":u,"data-open":d,style:m,children:[S,C]}),t[22]=u,t[23]=S,t[24]=C,t[25]=d,t[26]=m,t[27]=w):w=t[27],w}var fr=170,pr={contributes:`fed by`,causes:`driven by`,dampens:`held back by`,enables:`made possible by`,correlates:`moving together with`},mr={1:`pushed up by`,[-1]:`pushed down by`};function hr(e){let t=e.split(` `,1)[0]??``;return t.length===0||/[A-Z]/.test(t.slice(1))?e:e[0].toLowerCase()+e.slice(1)}var gr={graph:`And that is how the causes fit together.`,timeline:`And here are the same causes, in time.`,chart:`And here is what each one actually measured.`,flow:`And here is how much each one contributed.`};function _r(e,t){let n=e.values.get(ar(t));if(!n||n.kind===`structure`)return null;let r=x(n);return n.kind===`illustrative`?{say:`Illustratively, about ${r}.`,shown:`Illustratively, about ${r}.`}:{say:`Measured at ${r}.`,shown:`Measured at ${r}.`}}function vr(e){return e.kind?e.kind===`dampens`||e.kind===`enables`||e.kind===`correlates`:e.sign===-1}function yr(e){return e.kind&&pr[e.kind]?pr[e.kind]:mr[e.sign??1]??`fed by`}function br(e){let t=e.nodes.filter(e=>e.parentId===void 0),n=new Set(t.map(e=>e.id)),r=e.edges.filter(e=>n.has(e.from)&&n.has(e.to)),i=new Map(t.map(e=>[e.id,e.depth??0])),a=new Map;for(let e of r)a.set(e.from,(a.get(e.from)??0)+(e.weight??0));let o=new Map(t.map(e=>[e.id,0]));for(let e of r)o.set(e.to,(o.get(e.to)??0)+1);let s=(e,t)=>(i.get(e)??0)-(i.get(t)??0)||(a.get(t)??0)-(a.get(e)??0)||(e<t?-1:+(e>t)),c=t.filter(e=>o.get(e.id)===0).map(e=>e.id),l=[],u=new Set;for(;c.length>0;){c.sort(s);let e=c.shift();if(!(e===void 0||u.has(e))){u.add(e),l.push(e);for(let t of r){if(t.from!==e)continue;let n=(o.get(t.to)??0)-1;o.set(t.to,n),n<=0&&!u.has(t.to)&&c.push(t.to)}}}for(let e of t.map(e=>e.id).sort(s))u.has(e)||l.push(e);return l}function xr(e,t,n,r={}){let i=br(t);if(i.length<2)return[];let c=new Map(e.nodes.map(e=>[e.id,e])),l=new Map(t.nodes.map(e=>[e.id,e.label])),u=new Map(i.map((e,t)=>[e,t])),d=e=>t.edges.filter(t=>t.to===e&&u.has(t.from)&&(u.get(t.from)??0)<(u.get(e)??0)).sort((e,t)=>(t.weight??0)-(e.weight??0)||(e.id<t.id?-1:1))[0],f=[],p=i.at(-1)===e.outcomeId?i.length-1:i.length,m=p===1?`One cause, one outcome. Here is how it connects.`:`${p} causes, one outcome. Here is how they connect.`;f.push({nodeId:e.outcomeId,wide:!0,rep:`graph`,say:m,caption:m});let h=null;for(let[t,r]of i.entries()){let u=c.get(r),p=l.get(r)??r,m=d(r),g=r===e.outcomeId&&t===i.length-1,_=m?l.get(m.from)??m.from:null,v;v=g?m?`And it ends here: ${hr(p)}, ${yr(m)} ${m.from===h?`it`:hr(_??``)}.`:`And it ends here: ${hr(p)}.`:m?m.from===h?vr(m)?`Then ${hr(p)}, ${yr(m)} it.`:`Then ${hr(p)}.`:`${p}, ${yr(m)} ${hr(_??``)}.`:t===0?`It starts with ${hr(p)}.`:`Alongside it: ${p}.`,h=r;let y=[v],b=[v],x=_r(n,r);x&&(y.push(x.say),b.push(x.shown));let S=u?.detail;S&&(y.push(s(a(S),fr)),b.push(s(o(S),fr))),f.push({nodeId:r,...m?{edgeId:m.id}:{},say:y.join(` `),caption:b.join(` `)})}if(r.closeOn){let t=gr[r.closeOn];f.push({nodeId:e.outcomeId,wide:!0,rep:r.closeOn,say:t,caption:t})}return f}r();var Sr=[{rep:`graph`,label:`Graph`},{rep:`flow`,label:`Contribution`},{rep:`timeline`,label:`Over time`},{rep:`chart`,label:`As a chart`}],Cr={graph:`Left to right is what led to what. Colour is the direction of the push; thickness is how much of the outcome the link explains.`,timeline:`Left to right is WHEN, read against the axis below; a bar is how long a cause lasted. Height only keeps entries from overlapping — it means nothing.`,chart:`Each mark is a cause plotted against its own measured history. Causes with nothing measured are held aside rather than drawn at zero.`,flow:`Ribbon thickness is how much of the outcome that link was MEASURED to explain. A cause whose links carry no measured share is held aside rather than drawn thin, which would read as a finding nobody made.`},wr=`an illustrative world measures nothing, so there is no baseline`;function Tr(e,t){for(let n of e){if(n.id===t)return n.children;let e=n.children===void 0?void 0:Tr(n.children,t);if(e)return e}}function Er(e){let{value:t,...n}=e;return n}function Dr(e,t){let n=new Map;for(let[r,i]of e.relativeByNode){let e=t.relativeByNode.get(r)??0;i>0&&n.set(r,e/i)}return n}function Or(e,t,n,r){return{exactBase:n??null,exactDelta:e.outcomeDelta,explainedPct:e.explainedPct,fullyGrounded:e.fullyGrounded&&!r,relBase:t.relativeOutcome,relCur:e.relativeOutcome}}function kr(e){let t=(0,W.c)(12),{spec:n,question:r,failed:i,onRetry:a,onClose:o,view:s,onExpandNode:c,autoWalk:l,speakLine:u}=e;if(n){let e;return t[0]!==l||t[1]!==o||t[2]!==c||t[3]!==u||t[4]!==n||t[5]!==s?(e=(0,G.jsx)(jr,{spec:n,view:s,onClose:o,onExpandNode:c,autoWalk:l,speakLine:u}),t[0]=l,t[1]=o,t[2]=c,t[3]=u,t[4]=n,t[5]=s,t[6]=e):e=t[6],e}let d=r??``,f=i===!0,p;return t[7]!==o||t[8]!==a||t[9]!==d||t[10]!==f?(p=(0,G.jsx)(Ar,{title:d,failed:f,onRetry:a,onClose:o}),t[7]=o,t[8]=a,t[9]=d,t[10]=f,t[11]=p):p=t[11],p}function Ar(e){let t=(0,W.c)(17),{title:n,failed:r,onRetry:i,onClose:a}=e,o=`Living answer: ${n}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,G.jsx)(`span`,{className:`wo-kicker`,children:`THE LIVING ANSWER`}),t[0]=s):s=t[0];let c;t[1]===n?c=t[2]:(c=(0,G.jsxs)(`div`,{className:`wo-title`,children:[s,(0,G.jsx)(`h2`,{children:n})]}),t[1]=n,t[2]=c);let l;t[3]===a?l=t[4]:(l=a&&(0,G.jsx)(`div`,{className:`wo-head-actions`,children:(0,G.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:a,"aria-label":`Close`,children:`✕`})}),t[3]=a,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,G.jsxs)(`header`,{className:`wo-head`,children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d;t[8]!==r||t[9]!==i?(d=(0,G.jsx)(`div`,{className:`wo-shell`,role:`status`,"aria-live":`polite`,children:r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`p`,{className:`wo-shell-line`,children:`This world didn’t come back.`}),(0,G.jsx)(`p`,{className:`wo-shell-note`,children:`Nothing was built, and Mavéa won’t stand in a causal web it can’t source. The answer behind this card is untouched.`}),i&&(0,G.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:i,children:`Try again`})]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`wo-shell-pulse`,"aria-hidden":`true`}),(0,G.jsx)(`p`,{className:`wo-shell-line`,children:`Building this world…`}),(0,G.jsx)(`p`,{className:`wo-shell-note`,children:`One model call, grounded in what this answer already found. Once it is built it is kept — re-opening it, and replaying this turn, costs nothing.`})]})}),t[8]=r,t[9]=i,t[10]=d):d=t[10];let f;t[11]!==u||t[12]!==d?(f=(0,G.jsxs)(`div`,{className:`wo-panel`,children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;return t[14]!==o||t[15]!==f?(p=(0,G.jsx)(`section`,{className:`wo-scrim`,"aria-label":o,children:f}),t[14]=o,t[15]=f,t[16]=p):p=t[16],p}function jr({spec:e,view:t,onClose:n,onExpandNode:r,autoWalk:a,speakLine:o}){let[s,d]=(0,U.useState)(()=>new Map),[f,p]=(0,U.useState)(null),m=(0,U.useMemo)(()=>{if(s.size===0)return e;let t=e;for(let[e,n]of s)t=F(t,e,n);return t},[e,s]),h=m.provenance.illustrative===!0,g=(0,U.useMemo)(()=>le(m),[m]),_=(0,U.useMemo)(()=>sr(m,g),[m,g]),v=_.trust,y=(0,U.useMemo)(()=>ir(m),[m]),[b,x]=(0,U.useState)(()=>new Map),[S,C]=(0,U.useState)(null),[w,T]=(0,U.useState)(!1),E=(0,U.useMemo)(()=>[...b.values()].some(e=>e!==100),[b]),D=(0,U.useMemo)(()=>[...b].map(([e,t])=>({nodeId:e,pct:t/100})),[b]),O=(0,U.useMemo)(()=>H(y,[]),[y]),k=(0,U.useMemo)(()=>H(y,D),[y,D]),A=(0,U.useMemo)(()=>E?Dr(O,k):null,[E,O,k]),j=(0,U.useDeferredValue)(A),M=(0,U.useCallback)(e=>Cn(e,g),[g]),P=t&&M(t)?t:void 0,R=Dn({world:g,insetBottom:w?108:54,...P?{initialRep:P}:{}}),{rep:z,setRep:W,expandedIds:ee,toggleExpand:K}=R;(0,U.useEffect)(()=>{P&&W(P)},[P,W]);let te=(0,U.useMemo)(()=>{let e=g.nodes.map(e=>{let t=Er(e),n=j?.get(e.parentId??e.id),r=N(e.label);return{...t,label:r,...n===void 0?{}:{shift:n}}});return{...g,nodes:e}},[g,j]),q=(0,U.useMemo)(()=>{let e=new Map,t=n=>{e.set(n.id,n);for(let e of n.children??[])t(e)};for(let e of m.nodes)t(e);return e},[m]),ne=(0,U.useMemo)(()=>{let e=se(m.edges);return new Map(g.edges.map((t,n)=>[t.id,e[n]]))},[g,m]),re=(0,U.useMemo)(()=>new Set(g.nodes.map(e=>e.parentId).filter(e=>e!==void 0)),[g]),ae=(0,U.useRef)(null),oe=(0,U.useCallback)(()=>ae.current?.dismiss(),[]),ce=(0,U.useCallback)(e=>{(e.surface===`node`||e.surface===`edge`)&&C({kind:e.surface,id:e.id})},[]),[ue,de]=(0,U.useState)(void 0),fe=M(`timeline`)?`timeline`:void 0,[pe,me]=(0,U.useState)([]);(0,U.useEffect)(()=>{let e=globalThis.requestIdleCallback,t=()=>me(xr(m,g,v,fe?{closeOn:fe}:{}));if(typeof e==`function`){let n=e(t,{timeout:2e3});return()=>globalThis.cancelIdleCallback?.(n)}let n=setTimeout(t,1);return()=>clearTimeout(n)},[m,g,v,fe]);let{focusNode:J}=R,he=(0,U.useCallback)(e=>{e.rep&&W(e.rep),C({kind:`node`,id:e.nodeId}),de(e.edgeId),e.wide?J(null):e.rep||J(e.nodeId)},[J,W]),{index:ge,playing:Y,caption:_e,toggle:ve,seek:ye,reset:be}=ur((0,U.useMemo)(()=>({beats:pe,apply:he,...o?{speakLine:o}:{}}),[pe,he,o]));(0,U.useEffect)(()=>{T(Y||ge>=0)},[Y,ge]);let xe=(0,U.useRef)(!1);(0,U.useEffect)(()=>{!a||xe.current||pe.length===0||(xe.current=!0,ve())},[a,pe.length,ve]);let X=(0,U.useCallback)(()=>{be(),de(void 0)},[be]),Se=(0,U.useRef)(n);Se.current=n;let Ce=(0,U.useRef)(ve);Ce.current=ve;let we=(0,U.useRef)(X);we.current=X,(0,U.useEffect)(()=>{let e=e=>{if(e.key===`Escape`){we.current(),Se.current?.();return}(e.key===` `||e.key===`Spacebar`)&&(e.target?.closest(`button, input, select, textarea, [contenteditable="true"]`)||(e.preventDefault(),Ce.current()))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let Te=(0,U.useCallback)(e=>{X(),C({kind:`node`,id:e.id})},[X]),Ee=(0,U.useCallback)(e=>{X(),C({kind:`edge`,id:e})},[X]),De=(0,U.useCallback)((e,t)=>{X(),x(n=>new Map(n).set(e,t))},[X]),Oe=(0,U.useCallback)(()=>{X(),x(new Map)},[X]),ke=(0,U.useCallback)(e=>g.nodes.find(t=>t.id===e)?.parentId===void 0,[g]),Ae=(0,U.useCallback)(e=>{!r||f!==null||(p(e),r(e,m).then(t=>{p(null);let n=t===null?void 0:Tr(t.nodes,e);n?.length&&(d(t=>new Map(t).set(e,n)),ke(e)?K(e):C({kind:`node`,id:e}))},()=>p(null)))},[r,ke,f,m,K]),je=(0,U.useCallback)((e,t)=>{if(t===`entry`&&z===`timeline`){let t=q.get(e.id),n=t?.date,r=t?.series?.points,i=n?.until!==void 0||(r?.length??0)>1,a=n?.t??r?.[0]?.t;return i||!a?null:(0,G.jsx)(`span`,{className:`wo-when`,"data-said":e.dateGrounded?``:void 0,children:a})}if(t!==`card`)return null;let n=ee.has(e.id),i=re.has(e.id),a=e.parentId===void 0,o=!i&&r!==void 0,s=i&&a,c=f===e.id;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(In,{id:ar(e.id),className:`wo-num`}),e.shift!==void 0&&ie(e.shift)!==null&&(0,G.jsx)(`span`,{className:`wo-shift`,"data-dir":e.shift<1?`down`:`up`,children:ie(e.shift)}),(s||o)&&(0,G.jsx)(`button`,{type:`button`,className:`wo-expand`,"aria-expanded":n,"aria-busy":c||void 0,disabled:c||o&&f!==null,"aria-label":`${s&&n?`Fold up`:`Break down`} ${e.label}`,onClick:t=>{t.stopPropagation(),s?K(e.id):Ae(e.id)},children:c?`breaking down…`:s&&n?`fold up`:`break down`})]})},[re,ee,K,r,f,Ae,q,z]),Z=q.get(m.outcomeId),Me=(0,U.useMemo)(()=>Or(O,O,Z?.value,h),[O,Z?.value,h]),Ne=(0,U.useMemo)(()=>Or(k,O,Z?.value,h),[k,O,Z?.value,h]),Pe=(0,U.useMemo)(()=>({causes:m.nodes.length,links:m.edges.length,sourced:m.nodes.filter(e=>e.receipt!==void 0).length}),[m]),Q=S?.kind===`node`?q.get(S.id):void 0,Fe=(0,U.useMemo)(()=>Q===void 0?[]:B(_,Q.id),[_,Q]),[Ie,Le]=(0,U.useState)(null);(0,U.useEffect)(()=>{if(Q===void 0){Le(null);return}let e=!0;return(async()=>{let{hierarchyLens:t}=await i(async()=>{let{hierarchyLens:e}=await import(`./lens-ChFJD9il.js`);return{hierarchyLens:e}},__vite__mapDeps([0,1,2,3]));if(!e)return;let n=t.compile(_,Q.id);if(n===null){Le(null);return}await c(l([n.block]));let r=u(n.block.type);e&&r&&Le({plan:n,render:r})})(),()=>{e=!1}},[_,Q]);let $=S?.kind===`edge`?ne.get(S.id):void 0,Re=(0,U.useMemo)(()=>m.nodes.filter(e=>e.role===`root`).map(e=>({id:e.id,label:N(e.label),pct:b.get(e.id)??100})),[m.nodes,b]);return(0,G.jsx)(qn,{registry:v,onNavigate:ce,ref:ae,children:(0,G.jsx)(`section`,{className:`wo-scrim`,"aria-label":`Living answer: ${m.title}`,children:(0,G.jsxs)(`div`,{className:`wo-panel`,children:[(0,G.jsxs)(`header`,{className:`wo-head`,children:[(0,G.jsxs)(`div`,{className:`wo-title`,children:[(0,G.jsx)(`span`,{className:`wo-kicker`,children:`THE LIVING ANSWER`}),(0,G.jsx)(`h2`,{children:m.title})]}),(0,G.jsxs)(`div`,{className:`wo-head-actions`,children:[(0,G.jsx)(`div`,{className:`wo-views`,role:`group`,"aria-label":`View`,children:Sr.filter(e=>M(e.rep)).map(e=>(0,G.jsx)(`button`,{type:`button`,className:`wo-chip`,"aria-pressed":z===e.rep,onClick:()=>{X(),W(e.rep)},children:e.label},e.rep))}),(0,G.jsx)(`button`,{type:`button`,className:`wo-btn`,onClick:Oe,disabled:!E,children:`Reset`}),n&&(0,G.jsx)(`button`,{type:`button`,className:`wo-btn wo-btn-close`,onClick:n,"aria-label":`Close`,children:`✕`})]})]}),h&&(0,G.jsx)(`div`,{className:`wo-banner wo-banner-illustrative`,children:`Illustrative model — shows the shape, not your numbers.`}),(0,G.jsx)(`p`,{className:`wo-legend`,children:Cr[z]}),(0,G.jsxs)(`div`,{className:`wo-body`,children:[(0,G.jsxs)(`div`,{className:`wo-stage`,onWheelCapture:oe,onPointerDownCapture:oe,children:[(0,G.jsx)(Je,{stage:R,world:te,renderFace:je,onNodeClick:Te,onEdgeClick:Ee,selectedId:S?.kind===`node`?S.id:void 0,litEdgeId:ue}),(0,G.jsx)(dr,{count:pe.length,index:ge,playing:Y,caption:_e,expanded:w,onToggle:ve,onSeek:ye})]}),(0,G.jsxs)(`aside`,{className:`wo-rail`,children:[(0,G.jsx)(Nn,{levers:Re,onSet:De,onReset:Oe}),(0,G.jsx)(tr,{baseline:Me,current:Ne,unit:Z?.unit,active:E,observedNote:h?wr:void 0}),(0,G.jsxs)(`div`,{className:`wo-detail`,children:[(0,G.jsx)(`span`,{className:`wo-rail-kicker`,children:`EVIDENCE`}),!S&&(0,G.jsxs)(`div`,{className:`wo-standing`,children:[(0,G.jsxs)(`dl`,{className:`wo-facts`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Causes`}),(0,G.jsx)(`dd`,{children:Pe.causes})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:`Links`}),(0,G.jsx)(`dd`,{children:Pe.links})]}),(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`dt`,{children:h?`Illustrative`:`With a source`}),(0,G.jsx)(`dd`,{children:h?`every cause`:Pe.sourced})]})]}),Z&&(0,G.jsxs)(`p`,{className:`wo-standing-outcome`,children:[(0,G.jsx)(`span`,{className:`wo-standing-lead`,children:`It ends at`}),` `,Z.label,Z.detail?(0,G.jsx)(`span`,{className:`wo-standing-note`,children:Z.detail}):null]}),(0,G.jsx)(`p`,{className:`wo-hint`,children:`Tap a cause or a link to see what stands behind it.`})]}),Q&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`h3`,{className:`wo-detail-title`,children:Q.label}),Q.detail&&(0,G.jsx)(`p`,{className:`wo-detail-note`,children:Q.detail}),(0,G.jsx)(`p`,{className:`wo-detail-figure`,children:(0,G.jsx)(In,{id:ar(Q.id)})}),Q.series&&(0,G.jsx)(`ul`,{className:`wo-series`,children:Q.series.points.map((e,t)=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`span`,{className:`wo-series-t`,children:e.t}),(0,G.jsx)(In,{id:or(Q.id,e.t)})]},`${e.t}:${t}`))}),(Ie||Fe.length>0)&&(0,G.jsxs)(`div`,{className:`wo-parts`,children:[(0,G.jsx)(`span`,{className:`wo-rail-kicker`,children:`WHAT THIS IS MADE OF`}),Ie?Ie.render(Ie.plan.block.props,{delay:0}):(0,G.jsx)(`ul`,{className:`wo-part-list`,children:Fe.map(e=>(0,G.jsx)(`li`,{children:N(e.label)},e.id))})]})]}),$&&(0,G.jsx)(V,{relation:L($.relation),sign:$.sign,status:$.status??I($),receipts:$.receipts??($.receipt?[$.receipt]:[]),counter:$.counter,provisional:$.provisional})]})]})]})]})})})}export{kr as WorldOverlay};
|