@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 +0,0 @@
|
|
|
1
|
-
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}from"./icons-gLFQTv74.js";import{t as a}from"./richText-BkxJhl9N.js";import{i as o,r as s}from"./format-q0LwBjID.js";import{t as c}from"./scale-Bcgfo6Hp.js";import{t as l}from"./BlockEmpty-B82uCse8.js";import"./lib-u95BsX_B.js";import{n as u,t as d}from"./motion-DxHSlPN6.js";import{t as f}from"./registry-types-D3q_LrlV.js";import{t as p}from"./annotations-CftUUB13.js";var m=t();function h(e){let t=parseFloat(String(e??``).replace(/[^0-9.-]/g,``));return Number.isNaN(t)?0:t}var g=e=>e.trim().toLowerCase(),_={formatCell:(e,t)=>t,cellTone:()=>void 0,cellBar:()=>void 0,rowTone:()=>void 0,dimUnmatched:!1,summaryRows:[],active:!1};function v(e,t,n){if(!e||e.length===0)return _;let r=t[0]?.key??``,i=new Set(t.filter(e=>e.numeric).map(e=>e.key)),a=new Map,c=new Map,l=new Map,u=new Map,d=!1,f=[];for(let p of e)switch(p.op){case`format`:{let e=p.target.kind===`column`?[p.target.key]:t.map(e=>e.key);for(let t of e)a.set(t,e=>{let t=h(e);return p.as===`currency`?s(t,{currency:`USD`}):p.as===`percent`?s(t,{percent:!0}):p.as===`unit`?o(t,p.unit):p.as===`duration`?o(t,p.unit??`min`):e});break}case`status`:c.set(p.target.key,p.rules);break;case`bar`:{let e=p.target.key,t=Math.max(1,...n.map(t=>Math.abs(h(t[e]))));l.set(e,t);break}case`emphasize`:p.target.kind===`row`&&(u.set(g(p.target.match),p.tone??`presence`),p.dimOthers&&(d=!0));break;case`summary`:{let e=(p.columns??t.map(e=>e.key)).filter(e=>i.has(e)||p.columns?.includes(e)),o={};for(let t of e){let e=n.map(e=>h(e[t]));if(e.length===0)continue;let r;switch(p.stat){case`total`:r=e.reduce((e,t)=>e+t,0);break;case`mean`:r=e.reduce((e,t)=>e+t,0)/e.length;break;case`max`:r=Math.max(...e);break;case`min`:r=Math.min(...e);break;case`count`:r=e.length;break;default:r=0}let i=a.get(t);o[t]=i?i(String(r)):s(r,{})}let c=p.label??{total:`Total`,mean:`Average`,max:`Max`,min:`Min`,count:`Count`}[p.stat];r&&o[r]===void 0&&(o[r]=c),f.push({label:c,cells:o});break}}let m=e=>e?p[e]:void 0;return{active:!0,dimUnmatched:d,summaryRows:f,formatCell:(e,t)=>{let n=a.get(e);return n?n(t):t},cellTone:(e,t)=>{let n=c.get(e);if(!n)return;let r=n.find(e=>g(t).includes(g(e.match)));return r?p[r.tone]:void 0},cellBar:(e,t)=>{let n=l.get(e);if(n)return Math.max(0,Math.min(1,Math.abs(h(t))/n))},rowTone:e=>m(u.get(g(e)))}}var y=r(),b=e=>{let t=parseFloat(String(e).replace(/[^0-9.-]/g,``));return Number.isNaN(t)?0:t};function x({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,columns:r,rows:a,sortKey:o,sortDir:s=`desc`,searchable:c=!0,searchPlaceholder:l=`Filter rows…`,footer:u,annotations:d,delay:f}){let p=i[t]||i.table,[h,g]=(0,m.useState)(o||r[0]?.key),[_,x]=(0,m.useState)(s),[S,C]=(0,m.useState)(``),w=e=>r.find(t=>t.key===e),T=r[0]?.key??``,E=(0,m.useMemo)(()=>v(d,r,a),[d,r,a]),D=(0,m.useMemo)(()=>{let e=S.trim().toLowerCase(),t=a;e&&(t=a.filter(t=>Object.values(t).some(t=>String(t).toLowerCase().includes(e))));let n=w(h);return[...t].sort((e,t)=>{let r=e[h]??``,i=t[h]??``,a=n?.numeric?b(r)-b(i):String(r).localeCompare(String(i));return _===`asc`?a:-a})},[a,S,h,_]),O=e=>{e===h?x(e=>e===`asc`?`desc`:`asc`):(g(e),x(w(e)?.numeric?`desc`:`asc`))};return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(f||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`tbl-head`,children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,style:{marginBottom:0},children:[(0,y.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),c&&(0,y.jsxs)(`label`,{className:`tbl-search`,children:[(0,y.jsx)(i.eye,{className:`tbl-search-ic`}),(0,y.jsx)(`input`,{value:S,onChange:e=>C(e.target.value),placeholder:l}),S&&(0,y.jsx)(`button`,{className:`tbl-search-x`,onClick:()=>C(``),"aria-label":`clear`,children:(0,y.jsx)(i.x,{})})]})]}),(0,y.jsx)(`div`,{className:`dt-scroll`,children:(0,y.jsxs)(`table`,{className:`dt`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsx)(`tr`,{children:r.map(e=>(0,y.jsx)(`th`,{className:`dt-th ${e.align===`right`?`r`:``} ${h===e.key?`on`:``}`,onClick:()=>O(e.key),children:(0,y.jsxs)(`span`,{className:`dt-th-in`,children:[e.label,(0,y.jsx)(`span`,{className:`dt-sort ${h===e.key?_:``}`,children:h===e.key&&_===`asc`?(0,y.jsx)(i.arrowUp,{}):(0,y.jsx)(i.arrowDown,{})})]})},e.key))})}),(0,y.jsxs)(`tbody`,{children:[D.map((e,t)=>{let n=E.active?E.rowTone(e[T]??``):void 0,i=E.dimUnmatched&&!n;return(0,y.jsx)(`tr`,{className:`dt-row${n?` dt-row-emph`:``}${i?` dt-row-dim`:``}`,style:n?{"--emph":n}:void 0,children:r.map(t=>{let n=e[t.key]??``,r=E.active?E.formatCell(t.key,n):n,i=E.active?E.cellTone(t.key,n):void 0,a=E.active?E.cellBar(t.key,n):void 0;return(0,y.jsxs)(`td`,{className:`dt-td ${t.align===`right`?`r tab-num`:``} ${h===t.key?`on`:``}`,style:{...t.color?{color:t.color}:{},...i?{color:i}:{}},children:[a!==void 0&&(0,y.jsx)(`span`,{className:`dt-bar`,style:{width:`${Math.round(a*100)}%`}}),(0,y.jsx)(`span`,{className:`dt-cell-v`,children:r})]},t.key)})},t)}),D.length===0&&(0,y.jsx)(`tr`,{children:(0,y.jsxs)(`td`,{className:`dt-empty`,colSpan:r.length,children:[`No rows match “`,S,`”.`]})})]}),E.summaryRows.length>0&&D.length>0&&(0,y.jsx)(`tfoot`,{children:E.summaryRows.map((e,t)=>(0,y.jsx)(`tr`,{className:`dt-summary`,children:r.map((t,n)=>(0,y.jsx)(`td`,{className:`dt-td dt-summary-td ${t.align===`right`?`r tab-num`:``}`,children:e.cells[t.key]??(n===0?e.label:``)},t.key))},t))})]})}),(0,y.jsxs)(`div`,{className:`tbl-foot-meta faint`,children:[D.length,` of `,a.length,` rows · sorted by `,w(h)?.label,` `,_===`asc`?`↑`:`↓`]}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:u})]})}function S({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,rowGroup:r,colHeaders:a,measures:o,rows:s,measure:c=0,accent:l=`var(--presence)`,footer:u,delay:d}){let f=i[t]||i.table,[p,h]=(0,m.useState)(Math.max(0,Math.min(c,o.length-1))),[g,_]=(0,m.useState)(null),v=o[p],b=v?.key??``,x=e=>typeof e==`number`&&Number.isFinite(e)?e:null,S=(e,t)=>s[e]?.cells[t]?.values[b],C=s.flatMap(e=>e.cells.map(e=>x(e.values[b]))).filter(e=>e!==null),w=C.length>0,T=Math.max(1,...C),E=e=>`${v?.prefix||``}${e.toLocaleString()}${v?.unit||``}`,D=a.map((e,t)=>s.reduce((e,n)=>e+(x(n.cells[t]?.values[b])??0),0)),O=D.reduce((e,t)=>e+t,0),k=e=>/^(totals?|grand\s*total|sum|all)$/i.test(e.trim()),A=s.length>0&&k(s[s.length-1]?.label??``),j=a.some(e=>k(String(e))),M=a.map((e,t)=>s.some(e=>x(e.cells[t]?.values[b])!==null)),ee=w&&!A,N=w&&!j;return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(d||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`tbl-head`,children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,style:{marginBottom:0},children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),o.length>1&&(0,y.jsx)(`div`,{className:`seg`,role:`tablist`,children:o.map((e,t)=>(0,y.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t===p,className:`seg-btn ${t===p?`on`:``}`,onClick:()=>h(t),children:e.label},`${e.key}-${t}`))})]}),(0,y.jsx)(`div`,{className:`dt-scroll`,children:(0,y.jsxs)(`table`,{className:`pv`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`pv-corner`,children:r}),a.map((e,t)=>(0,y.jsx)(`th`,{className:`pv-colh ${g?.c===t?`on`:``}`,children:e},t)),N&&(0,y.jsx)(`th`,{className:`pv-colh tot`,children:`Total`})]})}),(0,y.jsxs)(`tbody`,{children:[s.map((e,t)=>{let n=e.cells.reduce((e,t)=>e+(x(t.values[b])??0),0);return(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`pv-rowh ${g?.r===t?`on`:``}`,children:e.label}),e.cells.map((e,n)=>{let r=S(t,n),i=x(r),a=i===null?0:i/T*.82+.04,o=g?.r===t&&g?.c===n;return(0,y.jsxs)(`td`,{className:`pv-cell ${o?`hot`:``}`,style:{background:i===null?void 0:`color-mix(in oklab, ${l} ${a*100}%, transparent)`},onMouseEnter:()=>_({r:t,c:n}),onMouseLeave:()=>_(null),children:[(0,y.jsx)(`span`,{className:i===null?`pv-v`:`pv-v tab-num`,children:i===null?String(r??``):E(i)}),o&&i!==null&&O>0&&(0,y.jsxs)(`span`,{className:`pv-tip`,children:[(i/O*100).toFixed(1),`% of total`]})]},n)}),N&&(0,y.jsx)(`td`,{className:`pv-cell tot tab-num`,children:E(n)})]},t)}),ee&&(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`pv-rowh tot`,children:`Total`}),D.map((e,t)=>(0,y.jsx)(`td`,{className:`pv-cell tot tab-num`,children:M[t]?E(e):`—`},t)),N&&(0,y.jsx)(`td`,{className:`pv-cell tot grand tab-num`,children:E(O)})]})]})]})}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:u})]})}var C=[`var(--warning)`,`var(--text-secondary)`,`var(--presence-soft)`];function w({r:e,rank:t,value:n,width:r,unit:a,color:o,hot:s,onEnter:c,onLeave:l}){let u=d(n,{duration:900,decimals:0}),f=e.move??0;return(0,y.jsxs)(`div`,{className:`lb-row m-stagger-item m-fade-rise ${s?`hot`:``} ${t<3?`podium`:``}`,style:{"--i":t},onMouseEnter:c,onMouseLeave:l,children:[(0,y.jsxs)(`div`,{className:`lb-rank`,style:t<3?{color:C[t]}:void 0,children:[t<3?(0,y.jsx)(`span`,{className:`lb-medal`,children:`●`}):null,t+1]}),(0,y.jsxs)(`div`,{className:`lb-body`,children:[(0,y.jsxs)(`div`,{className:`lb-top`,children:[(0,y.jsx)(`span`,{className:`lb-name`,children:e.name}),e.sub&&(0,y.jsx)(`span`,{className:`lb-sub faint`,children:e.sub}),(0,y.jsx)(`span`,{className:`lb-spacer`}),(0,y.jsxs)(`span`,{className:`lb-val tab-num`,"data-mark":t===0?`underline`:void 0,children:[u,a]})]}),(0,y.jsx)(`div`,{className:`lb-track`,children:(0,y.jsx)(`div`,{className:`lb-fill`,style:{width:`${r}%`,background:o}})})]}),(0,y.jsxs)(`div`,{className:`lb-move ${f>0?`up`:f<0?`down`:`flat`}`,children:[f>0?(0,y.jsx)(i.arrowUp,{}):f<0?(0,y.jsx)(i.arrowDown,{}):(0,y.jsx)(`span`,{className:`lb-dash`,children:`–`}),f!==0&&(0,y.jsx)(`span`,{className:`tab-num`,children:Math.abs(f)})]})]})}function T({title:e,icon:t=`chart`,iconColor:n=`var(--insight)`,metrics:r,rows:a,metric:o=0,accent:s=`var(--insight)`,footer:c,delay:l}){let u=i[t]||i.chart,[d,f]=(0,m.useState)(Math.max(0,Math.min(o,r.length-1))),[p,h]=(0,m.useState)(null),g=r[d],_=g?.key??``,v=(0,m.useMemo)(()=>[...a].map((e,t)=>({r:e,i:t})).sort((e,t)=>(t.r.values[_]??0)-(e.r.values[_]??0)),[a,_]),b=Math.max(1,...v.map(e=>e.r.values[_]??0));return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(l||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`tbl-head`,children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,style:{marginBottom:0},children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),r.length>1&&(0,y.jsx)(`div`,{className:`seg`,children:r.map((e,t)=>(0,y.jsx)(`button`,{className:`seg-btn ${t===d?`on`:``}`,onClick:()=>f(t),children:e.label},`${e.key}-${t}`))})]}),(0,y.jsx)(`div`,{className:`lb`,children:v.map(({r:e,i:t},n)=>{let r=e.values[_]??0,i=r/b*100;return(0,y.jsx)(w,{r:e,rank:n,value:r,width:i,unit:g?.unit||``,color:n<3?C[n]:s,hot:p===n,onEnter:()=>h(n),onLeave:()=>h(null)},`${e.name}-${t}`)})}),c&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:c})]})}function E(e){return e.join(`.`)}function D(e){if(e==null)return 0;let t=parseFloat(e.replace(/[^0-9.-]/g,``));return Number.isFinite(t)?t:0}function O(e){let t=new Map,n=e=>{let r=e.children?.map(n)??[],i=D(e.value),a=i>0||!r.length?i:r.reduce((e,t)=>e+t.value,0),o=r.reduce((e,t)=>e+(t.pct??0),0),s={value:a,pct:e.pct!=null&&e.pct>0?e.pct:o>0?o:e.pct};return t.set(e,s),s};return e.forEach(n),t}function k({title:e,icon:t=`layers`,iconColor:n=`var(--presence)`,valueLabel:r=`Value`,nodes:a,accent:o=`var(--presence)`,footer:s,delay:c}){let l=i[t]||i.layers,[u,d]=(0,m.useState)(()=>{let e=new Set,t=(n,r)=>n.forEach((n,i)=>{let a=[...r,i];n.open&&n.children?.length&&e.add(E(a)),n.children&&t(n.children,a)});return t(a,[]),e}),f=(0,m.useMemo)(()=>O(a),[a]),p=e=>d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),h=(e,t,n)=>e.flatMap((e,r)=>{let a=[...t,r],s=E(a),c=u.has(s),l=!!e.children?.length,d=e.color||o,m=f.get(e),g=m?.pct,_=m?.value??0,v=D(e.value)>0?e.value:_>0?String(_):e.value,b=[(0,y.jsxs)(`div`,{className:`tt-row ${l?`parent`:`leaf`} ${n===0?`top`:``}`,style:{paddingLeft:8+n*18},onClick:l?()=>p(s):void 0,onKeyDown:l?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),p(s))}:void 0,role:l?`button`:void 0,tabIndex:l?0:void 0,children:[(0,y.jsx)(`span`,{className:`tt-caret ${l?``:`hidden`} ${c?`open`:``}`,children:(0,y.jsx)(i.chevR,{})}),(0,y.jsx)(`span`,{className:`tt-label`,children:e.label}),e.tag&&(0,y.jsx)(`span`,{className:`tt-tag`,style:{color:d,borderColor:`color-mix(in oklab, ${d} 40%, transparent)`},children:e.tag}),(0,y.jsx)(`span`,{className:`tt-spacer`}),g!=null&&(0,y.jsx)(`span`,{className:`tt-bar`,children:(0,y.jsx)(`span`,{className:`tt-bar-fill`,style:{width:`${Math.round(g*100)}%`,background:d}})}),v!=null&&(0,y.jsx)(`span`,{className:`tt-val tab-num`,children:v})]},s)];return l&&c&&b.push(...h(e.children,a,n+1)),b});return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(c||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsxs)(`div`,{className:`tt-header`,children:[(0,y.jsx)(`span`,{className:`tt-h-label`,children:`Item`}),(0,y.jsx)(`span`,{className:`tt-h-val`,children:r})]}),(0,y.jsx)(`div`,{className:`tt`,children:h(a,[],0)}),s&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:s})]})}function A({title:e,icon:t=`clock`,iconColor:n=`var(--presence)`,ticks:r,lanes:a,footer:o,delay:s}){let c=i[t]||i.clock,[l,u]=(0,m.useState)(null);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(s||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(c,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsxs)(`div`,{className:`sw`,children:[a.map((e,t)=>(0,y.jsxs)(`div`,{className:`sw-lane`,children:[(0,y.jsxs)(`div`,{className:`sw-actor`,children:[(0,y.jsx)(`span`,{className:`sw-actor-name`,children:e.actor}),e.sub&&(0,y.jsx)(`span`,{className:`sw-actor-sub faint`,children:e.sub})]}),(0,y.jsxs)(`div`,{className:`sw-track`,children:[(0,y.jsx)(`span`,{className:`sw-baseline`}),e.events.map((e,n)=>{let r=e.color||`var(--presence)`,i=l?.l===t&&l?.e===n,a=`${Math.max(0,Math.min(1,e.at))*100}%`;if(e.span&&e.span>0){let o=`${Math.max(.02,Math.min(1-e.at,e.span))*100}%`;return(0,y.jsxs)(`div`,{className:`sw-bar ${i?`hot`:``}`,style:{left:a,width:o,background:`color-mix(in oklab, ${r} 26%, transparent)`,borderColor:r},onMouseEnter:()=>u({l:t,e:n}),onMouseLeave:()=>u(null),children:[(0,y.jsx)(`span`,{className:`sw-bar-label`,style:{color:r},children:e.label}),i&&e.detail&&(0,y.jsx)(`span`,{className:`sw-tip`,children:e.detail})]},n)}return(0,y.jsxs)(`div`,{className:`sw-evt ${i?`hot`:``}`,style:{left:a},onMouseEnter:()=>u({l:t,e:n}),onMouseLeave:()=>u(null),children:[(0,y.jsx)(`span`,{className:`sw-dot`,style:{background:r,boxShadow:`0 0 0 4px color-mix(in oklab, ${r} 22%, transparent)`}}),(0,y.jsx)(`span`,{className:`sw-evt-label`,children:e.label}),i&&e.detail&&(0,y.jsx)(`span`,{className:`sw-tip`,children:e.detail})]},n)})]})]},t)),r&&r.length>0&&(0,y.jsxs)(`div`,{className:`sw-axis`,children:[(0,y.jsx)(`span`,{className:`sw-actor`}),(0,y.jsx)(`div`,{className:`sw-axis-ticks`,children:r.map((e,t)=>(0,y.jsx)(`span`,{className:`sw-tick faint`,children:e},t))})]})]}),o&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:o})]})}function j({title:e,icon:t=`doc`,iconColor:n=`var(--presence)`,columns:r,rows:o,notes:s,footer:c,delay:l}){let u=i[t]||i.doc,[d,f]=(0,m.useState)(null),[p,h]=(0,m.useState)(null),g=p??d;return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(l||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(`div`,{className:`dt-scroll`,children:(0,y.jsxs)(`table`,{className:`dt ft`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsx)(`tr`,{children:r.map((e,t)=>(0,y.jsx)(`th`,{className:`dt-th ${t===0?``:`r`}`,children:e},t))})}),(0,y.jsx)(`tbody`,{children:o.map((e,t)=>(0,y.jsx)(`tr`,{className:`dt-row`,children:e.cells.map((e,t)=>(0,y.jsxs)(`td`,{className:`dt-td ${t===0?``:`r tab-num`}`,style:e.color?{color:e.color}:void 0,children:[e.v,e.note!=null&&(0,y.jsx)(`button`,{className:`ft-anchor ${g===e.note?`on`:``} ${d===e.note?`pin`:``}`,onMouseEnter:()=>h(e.note),onMouseLeave:()=>h(null),onClick:()=>f(t=>t===e.note?null:e.note),"aria-label":`footnote ${e.note}`,children:e.note})]},t))},t))})]})}),(0,y.jsx)(`div`,{className:`ft-notes`,children:s.map((e,t)=>{let n=t+1;return(0,y.jsxs)(`div`,{className:`ft-note ${g===n?`on`:``}`,children:[(0,y.jsx)(`span`,{className:`ft-note-i`,children:n}),(0,y.jsx)(`span`,{className:`ft-note-t`,dangerouslySetInnerHTML:a(e)})]},t)})}),c&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:c})]})}var M=n(),ee=116,N=34;function P(e){let t=(0,M.c)(48),{row:n,hoverI:r,onHover:i,delay:a}=e,o=(0,m.useRef)(null),s;t[0]===a?s=t[1]:(s={delay:a},t[0]=a,t[1]=s),u(o,s);let c=n.series;if(c.length===0){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`svg`,{className:`sk-svg`,viewBox:`0 0 ${ee} ${N}`,preserveAspectRatio:`none`,"aria-hidden":`true`}),t[2]=e):e=t[2],e}let l=Math.min(...c),d=Math.max(...c)-l||1,f=n.color||(n.deltaDir===`down`?`var(--danger)`:`var(--insight)`),p,h,g,_,v,b;if(t[3]!==l||t[4]!==d||t[5]!==c){let e;t[12]!==l||t[13]!==d||t[14]!==c.length?(e=(e,t)=>[t/(c.length-1||1)*112+2,31-(e-l)/d*28],t[12]=l,t[13]=d,t[14]=c.length,t[15]=e):e=t[15],h=c.map(e),p=h.map(te).join(` `),g=p,_=h[h.length-1][0].toFixed(1),v=N,b=h[0][0].toFixed(1),t[3]=l,t[4]=d,t[5]=c,t[6]=p,t[7]=h,t[8]=g,t[9]=_,t[10]=v,t[11]=b}else p=t[6],h=t[7],g=t[8],_=t[9],v=t[10],b=t[11];let x=`${g} L${_} ${v} L${b} ${N} Z`,S;if(t[16]!==n.name){let e;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=/\W/g,t[18]=e):e=t[18],S=n.name.replace(e,``),t[16]=n.name,t[17]=S}else S=t[17];let C=`sg-${S}`,w;t[19]===i?w=t[20]:(w=()=>i(null),t[19]=i,t[20]=w);let T;t[21]!==i||t[22]!==c.length?(T=e=>{let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width;i(Math.max(0,Math.min(c.length-1,Math.round(n*(c.length-1)))))},t[21]=i,t[22]=c.length,t[23]=T):T=t[23];let E,D;t[24]===f?(E=t[25],D=t[26]):(D=(0,y.jsx)(`stop`,{offset:`0%`,stopColor:f,stopOpacity:`0.28`}),E=(0,y.jsx)(`stop`,{offset:`100%`,stopColor:f,stopOpacity:`0`}),t[24]=f,t[25]=E,t[26]=D);let O;t[27]!==C||t[28]!==E||t[29]!==D?(O=(0,y.jsx)(`defs`,{children:(0,y.jsxs)(`linearGradient`,{id:C,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[D,E]})}),t[27]=C,t[28]=E,t[29]=D,t[30]=O):O=t[30];let k=`url(#${C})`,A;t[31]!==x||t[32]!==k?(A=(0,y.jsx)(`path`,{d:x,fill:k,stroke:`none`}),t[31]=x,t[32]=k,t[33]=A):A=t[33];let j;t[34]!==f||t[35]!==p?(j=(0,y.jsx)(`path`,{ref:o,d:p,fill:`none`,stroke:f,strokeWidth:`1.6`,strokeLinejoin:`round`,strokeLinecap:`round`}),t[34]=f,t[35]=p,t[36]=j):j=t[36];let P;t[37]!==f||t[38]!==r||t[39]!==h?(P=r!=null&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`line`,{x1:h[r][0],y1:`0`,x2:h[r][0],y2:N,stroke:`var(--hover-line)`,strokeWidth:`1`}),(0,y.jsx)(`circle`,{cx:h[r][0],cy:h[r][1],r:`2.6`,fill:f,stroke:`var(--surface-elevated)`,strokeWidth:`1.4`})]}),t[37]=f,t[38]=r,t[39]=h,t[40]=P):P=t[40];let F;return t[41]!==O||t[42]!==A||t[43]!==j||t[44]!==P||t[45]!==w||t[46]!==T?(F=(0,y.jsxs)(`svg`,{className:`sk-svg`,viewBox:`0 0 ${ee} ${N}`,preserveAspectRatio:`none`,"aria-hidden":`true`,onMouseLeave:w,onMouseMove:T,children:[O,A,j,P]}),t[41]=O,t[42]=A,t[43]=j,t[44]=P,t[45]=w,t[46]=T,t[47]=F):F=t[47],F}function te(e,t){return`${t?`L`:`M`}${e[0].toFixed(1)} ${e[1].toFixed(1)}`}function F({title:e,icon:t=`chart`,iconColor:n=`var(--insight)`,valueLabel:r=`Current`,trendLabel:a=`Trend`,rows:o,footer:s,delay:c}){let l=i[t]||i.chart,[u,d]=(0,m.useState)(null);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(c||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsxs)(`div`,{className:`sk-header`,children:[(0,y.jsx)(`span`,{className:`sk-h-name`,children:`Series`}),(0,y.jsx)(`span`,{className:`sk-h-trend`,children:a}),(0,y.jsx)(`span`,{className:`sk-h-val`,children:r})]}),(0,y.jsx)(`div`,{className:`sk`,children:o.map((e,t)=>{let n=e.deltaDir,r=u?.row===t?u.i:null;return(0,y.jsxs)(`div`,{className:`sk-row`,children:[(0,y.jsx)(`span`,{className:`sk-name`,children:e.name}),(0,y.jsxs)(`div`,{className:`sk-trend`,children:[(0,y.jsx)(P,{row:e,hoverI:r,onHover:e=>d(e==null?null:{row:t,i:e}),delay:Math.min(t*60,480)}),r!=null&&(0,y.jsx)(`span`,{className:`sk-point tab-num`,children:e.series[r].toLocaleString()})]}),(0,y.jsxs)(`span`,{className:`sk-val tab-num`,children:[e.value,e.delta&&(0,y.jsxs)(`span`,{className:`sk-delta ${n===`down`?`down`:n===`flat`?`flat`:`up`}`,children:[n===`down`?(0,y.jsx)(i.arrowDown,{}):n===`flat`?null:(0,y.jsx)(i.arrowUp,{}),e.delta]})]})]},t)})}),s&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:s})]})}var I=100,L=40;function ne(e){let t=(0,M.c)(33),{panel:n,gmin:r,gmax:i,kind:a,accent:o}=e,s=n.series,c=i-r||1,l=n.color||o;if(s.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`svg`,{className:`sm-svg`,viewBox:`0 0 ${I} ${L}`,preserveAspectRatio:`none`,"aria-hidden":`true`}),t[0]=e):e=t[0],e}if(a===`bars`){let e=98/s.length,n;if(t[1]!==e||t[2]!==l||t[3]!==r||t[4]!==c||t[5]!==s){let i;t[7]!==e||t[8]!==l||t[9]!==r||t[10]!==c?(i=(t,n)=>{let i=(t-r)/c*36+2;return(0,y.jsx)(`rect`,{x:n*e+e*.16,y:L-i,width:e*.68,height:i,rx:`1`,fill:l,opacity:.55+.45*((t-r)/c)},n)},t[7]=e,t[8]=l,t[9]=r,t[10]=c,t[11]=i):i=t[11],n=s.map(i),t[1]=e,t[2]=l,t[3]=r,t[4]=c,t[5]=s,t[6]=n}else n=t[6];let i;return t[12]===n?i=t[13]:(i=(0,y.jsx)(`svg`,{className:`sm-svg`,viewBox:`0 0 ${I} ${L}`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:n}),t[12]=n,t[13]=i),i}let u,d;if(t[14]!==r||t[15]!==c||t[16]!==s){let e;t[19]!==r||t[20]!==c||t[21]!==s.length?(e=(e,t)=>[t/(s.length-1||1)*96+2,37-(e-r)/c*34],t[19]=r,t[20]=c,t[21]=s.length,t[22]=e):e=t[22],u=s.map(e),d=u.map(re).join(` `),t[14]=r,t[15]=c,t[16]=s,t[17]=u,t[18]=d}else u=t[17],d=t[18];let f=d,p;t[23]!==l||t[24]!==f?(p=(0,y.jsx)(`path`,{d:f,fill:`none`,stroke:l,strokeWidth:`1.7`,strokeLinejoin:`round`,strokeLinecap:`round`}),t[23]=l,t[24]=f,t[25]=p):p=t[25];let m=u[u.length-1],h=u[u.length-1],g;t[26]!==l||t[27]!==m[0]||t[28]!==h[1]?(g=(0,y.jsx)(`circle`,{cx:m[0],cy:h[1],r:`2`,fill:l}),t[26]=l,t[27]=m[0],t[28]=h[1],t[29]=g):g=t[29];let _;return t[30]!==p||t[31]!==g?(_=(0,y.jsxs)(`svg`,{className:`sm-svg`,viewBox:`0 0 ${I} ${L}`,preserveAspectRatio:`none`,"aria-hidden":`true`,children:[p,g]}),t[30]=p,t[31]=g,t[32]=_):_=t[32],_}function re(e,t){return`${t?`L`:`M`}${e[0].toFixed(1)} ${e[1].toFixed(1)}`}function ie({title:e,icon:t=`layers`,iconColor:n=`var(--presence)`,panels:r,cols:a=3,kind:o=`bars`,footer:s,delay:c}){let l=i[t]||i.layers,[u,d]=(0,m.useState)(null),f=r.flatMap(e=>e.series),p=f.length?Math.min(...f):0,h=f.length?Math.max(...f):1;return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(c||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(`div`,{className:`sm-grid`,style:{gridTemplateColumns:`repeat(${a}, minmax(0, 1fr))`},onMouseLeave:()=>d(null),children:r.map((e,t)=>{let n=u!=null&&u!==t,r=e.deltaDir;return(0,y.jsxs)(`div`,{className:`sm-cell ${u===t?`hot`:``} ${n?`dimd`:``}`,onMouseEnter:()=>d(t),children:[(0,y.jsx)(`div`,{className:`sm-label`,children:e.label}),(0,y.jsx)(ne,{panel:e,gmin:p,gmax:h,kind:o,accent:`var(--presence)`}),(0,y.jsxs)(`div`,{className:`sm-foot`,children:[e.stat&&(0,y.jsx)(`span`,{className:`sm-stat tab-num`,children:e.stat}),e.delta&&(0,y.jsxs)(`span`,{className:`sm-delta ${r===`down`?`down`:r===`flat`?`flat`:`up`}`,children:[r===`down`?(0,y.jsx)(i.arrowDown,{}):r===`flat`?null:(0,y.jsx)(i.arrowUp,{}),e.delta]})]})]},t)})}),s&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:s})]})}function ae({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,series:r,rows:a,highlight:o=0,footer:s,delay:c}){let l=i[t]||i.chart,[u,d]=(0,m.useState)(o),[f,p]=(0,m.useState)(null),h=a[0],g=h&&h.values.length>0?h.higherBetter===!1?h.values.indexOf(Math.min(...h.values)):h.values.indexOf(Math.max(...h.values)):-1;return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(c||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(`div`,{className:`cb-legend`,children:r.map((e,t)=>(0,y.jsxs)(`button`,{className:`cb-leg ${u===t?`on`:``} ${u!==-1&&u!==t?`off`:``}`,onClick:()=>d(e=>e===t?-1:t),children:[(0,y.jsx)(`span`,{className:`cb-swatch`,style:{background:e.color}}),e.name]},t))}),(0,y.jsx)(`div`,{className:`cb`,children:a.map((e,t)=>{let n=Math.max(1,...e.values),i=e.values.length===0?-1:e.higherBetter===!1?e.values.indexOf(Math.min(...e.values)):e.values.indexOf(Math.max(...e.values));return(0,y.jsxs)(`div`,{className:`cb-row`,children:[(0,y.jsx)(`div`,{className:`cb-row-label`,children:e.label}),(0,y.jsx)(`div`,{className:`cb-bars`,children:r.map((a,o)=>{let s=e.values[o]??0,c=s/n*100,l=u!==-1&&u!==o,d=f?.r===t&&f?.s===o;return(0,y.jsxs)(`div`,{className:`cb-bar-wrap ${l?`dimd`:``} ${d?`hot`:``}`,onMouseEnter:()=>p({r:t,s:o}),onMouseLeave:()=>p(null),children:[(0,y.jsx)(`div`,{className:`cb-track`,children:(0,y.jsx)(`div`,{className:`cb-fill m-stagger-item m-scale-in`,"data-mark":t===0&&o===g?`circle`:void 0,style:{width:`${c}%`,background:a.color,"--i":t*r.length+o,"--scale-from":0}})}),(0,y.jsxs)(`span`,{className:`cb-num tab-num`,children:[s.toLocaleString(),e.unit||``,o===i&&(0,y.jsx)(`span`,{className:`cb-best`,style:{color:a.color},children:`★`})]}),d&&(0,y.jsxs)(`span`,{className:`cb-tip`,children:[a.name,`:`,` `,(0,y.jsxs)(`b`,{className:`tab-num`,children:[s.toLocaleString(),e.unit||``]})]})]},o)})})]},t)})}),s&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:s})]})}var R=5,oe=96,se=120;function ce(e){let t=typeof e==`number`?e:parseFloat(String(e??``));return Number.isFinite(t)?Math.max(0,Math.min(R,Math.round(t))):0}function le(e){let t=(0,M.c)(5),{score:n}=e,r=`${n} out of ${R}`,i;t[0]===n?i=t[1]:(i=Array.from({length:R},(e,t)=>(0,y.jsx)(`span`,{className:`tbl-cmx-dot`+(t<n?` on`:``)},t)),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,y.jsx)(`span`,{className:`tbl-cmx-rating`,"aria-label":r,children:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function ue(){let e=(0,M.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsxs)(`svg`,{className:`tbl-cmx-glyph partial`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:[(0,y.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.25`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,y.jsx)(`path`,{d:`M8 1.75a6.25 6.25 0 0 1 0 12.5z`,fill:`currentColor`})]}),e[0]=t):t=e[0],t}function de(e){let t=(0,M.c)(9),{cell:n}=e;switch(n.kind??`text`){case`yes`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(i.check,{className:`tbl-cmx-glyph yes`,"aria-label":`yes`}),t[0]=e):e=t[0],e}case`no`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(i.x,{className:`tbl-cmx-glyph no`,"aria-label":`no`}),t[1]=e):e=t[1],e}case`partial`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(ue,{}),t[2]=e):e=t[2],e}case`rating`:{let e;t[3]===n.value?e=t[4]:(e=ce(n.value),t[3]=n.value,t[4]=e);let r;return t[5]===e?r=t[6]:(r=(0,y.jsx)(le,{score:e}),t[5]=e,t[6]=r),r}default:{let e=n.value==null?`—`:String(n.value),r;return t[7]===e?r=t[8]:(r=(0,y.jsx)(`span`,{className:`tbl-cmx-text`,children:e}),t[7]=e,t[8]=r),r}}}function fe(e){let t=new Set;for(let n of e)for(let e of n.cells)t.add(e.kind??`text`);return[`yes`,`no`,`partial`,`rating`].filter(e=>t.has(e))}var pe={yes:`yes`,no:`no`,partial:`partial`,rating:`out of ${R}`};function me({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,cols:r,rows:o,caption:s,footer:c,delay:l}){let u=i[t]||i.table,d=`minmax(${se}px, 1.3fr) repeat(${r.length}, minmax(${oe}px, 1fr))`,f=fe(o);return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(l||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),s&&(0,y.jsx)(`div`,{className:`tbl-cmx-cap`,children:s}),(0,y.jsx)(`div`,{className:`tbl-cmx-scroll`,children:(0,y.jsxs)(`div`,{className:`tbl-cmx-grid`,style:{gridTemplateColumns:d},children:[(0,y.jsx)(`div`,{className:`tbl-cmx-corner`}),r.map((e,t)=>(0,y.jsx)(`div`,{className:`tbl-cmx-colh`,children:e},`h${t}`)),o.map((e,t)=>(0,y.jsxs)(m.Fragment,{children:[(0,y.jsx)(`div`,{className:`tbl-cmx-rowh`,children:e.label}),r.map((t,n)=>{let r=e.cells[n],i=e.best===n;return(0,y.jsxs)(`div`,{className:`tbl-cmx-cell`+(i?` best`:``),children:[r?(0,y.jsx)(de,{cell:r}):(0,y.jsx)(`span`,{className:`tbl-cmx-text`,children:`—`}),r?.note&&(0,y.jsx)(`div`,{className:`tbl-cmx-note`,children:r.note})]},n)})]},t))]})}),f.length>0&&(0,y.jsx)(`div`,{className:`tbl-cmx-legend`,children:f.map(e=>(0,y.jsxs)(`span`,{className:`tbl-cmx-legend-item`,children:[(0,y.jsx)(de,{cell:{kind:e,value:e===`rating`?R:void 0}}),pe[e]]},e))}),c&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(c)})]})}function he({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,rowLabels:r,colLabels:a,cells:o,min:s,max:c,accent:l=`var(--presence)`,diagonal:u=!1,unit:d=``,legend:f,footer:p,delay:h}){let g=i[t]||i.table,[_,v]=(0,m.useState)(null),b=o.flat(),x=s??(b.length?Math.min(...b):0),S=(c??(b.length?Math.max(...b):1))-x||1,C=e=>(e-x)/S;return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(h||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(g,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsxs)(`div`,{className:`mg-wrap`,children:[(0,y.jsxs)(`div`,{className:`mg-grid`,style:{gridTemplateColumns:`minmax(0, auto) repeat(${a.length}, minmax(0, var(--mg-cell)))`},children:[(0,y.jsx)(`span`,{className:`mg-corner`}),a.map((e,t)=>(0,y.jsx)(`span`,{className:`mg-colh ${_?.c===t?`on`:``}`,children:e},t)),r.map((e,t)=>(0,y.jsx)(ge,{ri:t,label:e,vals:o[t]||[],colCount:a.length,norm:C,accent:l,diagonal:u,unit:d,hover:_,setHover:v},t))]}),f&&(0,y.jsxs)(`div`,{className:`mg-legend`,children:[(0,y.jsx)(`span`,{className:`faint`,children:f[0]}),(0,y.jsx)(`span`,{className:`mg-ramp`,style:{background:`linear-gradient(90deg, color-mix(in oklab, ${l} 6%, transparent), ${l})`}}),(0,y.jsx)(`span`,{className:`faint`,children:f[1]})]})]}),p&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},children:p})]})}function ge(e){let t=(0,M.c)(18),{ri:n,label:r,vals:i,colCount:a,norm:o,accent:s,diagonal:c,unit:l,hover:u,setHover:d}=e,f=`mg-rowh ${u?.r===n?`on`:``}`,p;t[0]!==r||t[1]!==f?(p=(0,y.jsx)(`span`,{className:f,children:r}),t[0]=r,t[1]=f,t[2]=p):p=t[2];let m;t[3]===a?m=t[4]:(m=Array.from({length:a}),t[3]=a,t[4]=m);let h;t[5]!==s||t[6]!==c||t[7]!==u||t[8]!==o||t[9]!==n||t[10]!==d||t[11]!==m||t[12]!==l||t[13]!==i?(h=m.map((e,t)=>{let r=i[t]??0,a=Math.max(0,Math.min(1,o(r))),f=c&&n===t,p=u?.r===n&&u?.c===t,m=u&&(u.r===n||u.c===t);return(0,y.jsxs)(`div`,{className:`mg-cell ${p?`hot`:``} ${m&&!p?`cross`:``} ${f?`diag`:``}`,style:{background:`color-mix(in oklab, ${s} ${(a*.9+.04)*100}%, transparent)`},onMouseEnter:()=>d({r:n,c:t}),onMouseLeave:()=>d(null),children:[(0,y.jsxs)(`span`,{className:`mg-v tab-num`,style:{color:a>.55?`var(--surface-deep)`:`var(--text-secondary)`},children:[r,l]}),p&&(0,y.jsxs)(`span`,{className:`mg-tip tab-num`,children:[r,l]})]},t)}),t[5]=s,t[6]=c,t[7]=u,t[8]=o,t[9]=n,t[10]=d,t[11]=m,t[12]=l,t[13]=i,t[14]=h):h=t[14];let g;return t[15]!==p||t[16]!==h?(g=(0,y.jsxs)(y.Fragment,{children:[p,h]}),t[15]=p,t[16]=h,t[17]=g):g=t[17],g}var z={overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`,maxWidth:`100%`};function _e({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,caption:r,corner:o,cols:s,rows:c,bracket:l=!1,footer:u,delay:d}){let f=i[t]||i.table,p=!!s&&s.length>0,m=c.some(e=>e.label!==void 0),h=Math.max(s?.length??0,...c.map(e=>e.cells.length)),g=`${m?`minmax(0, auto) `:``}repeat(${h}, minmax(60px, auto))`,_=(()=>{for(let e=0;e<c.length;e++){let t=c[e].cells.findIndex(e=>e.hot);if(t>=0)return`${e}-${t}`}return null})();return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(d||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),r&&(0,y.jsx)(`div`,{className:`tbl-mtx-cap`,children:r}),(0,y.jsxs)(`div`,{className:`tbl-mtx-frame`,children:[l&&(0,y.jsx)(`div`,{className:`tbl-mtx-brk l`}),(0,y.jsxs)(`div`,{className:`tbl-mtx-grid`,style:{gridTemplateColumns:g},children:[p&&(0,y.jsxs)(y.Fragment,{children:[m&&(0,y.jsx)(`div`,{className:`tbl-mtx-corner`,style:z,title:o,children:o??``}),s.map((e,t)=>(0,y.jsx)(`div`,{className:`tbl-mtx-colh`,style:z,title:e,children:e},`h${t}`))]}),c.map((e,t)=>(0,y.jsx)(ve,{ri:t,hasRowLabels:m,label:e.label,cells:e.cells,salientKey:_},t))]}),l&&(0,y.jsx)(`div`,{className:`tbl-mtx-brk r`})]}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}function ve(e){let t=(0,M.c)(13),{ri:n,hasRowLabels:r,label:i,cells:a,salientKey:o}=e,s;t[0]!==r||t[1]!==i?(s=r&&(0,y.jsx)(`div`,{className:`tbl-mtx-rowh`,style:z,title:i,children:i??``}),t[0]=r,t[1]=i,t[2]=s):s=t[2];let c;if(t[3]!==a||t[4]!==n||t[5]!==o){let e;t[7]!==n||t[8]!==o?(e=(e,t)=>(0,y.jsx)(`div`,{className:`tbl-mtx-cell`+(e.hot?` hot`:``),"data-mark":`${n}-${t}`===o?`circle`:void 0,style:e.color?{...z,background:e.color}:z,title:typeof e.v==`string`?e.v:void 0,children:e.v},t),t[7]=n,t[8]=o,t[9]=e):e=t[9],c=a.map(e),t[3]=a,t[4]=n,t[5]=o,t[6]=c}else c=t[6];let l;return t[10]!==s||t[11]!==c?(l=(0,y.jsxs)(y.Fragment,{children:[s,c]}),t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function ye({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,rowVar:r,rows:o,colVar:l,cols:u,cells:d,unit:f,currency:p,higherBetter:h=!0,baseCell:g,footer:_,delay:v}){let b=i[t]||i.table,[x,S]=(0,m.useState)(null),C=(0,m.useMemo)(()=>c(d.flat()),[d]),w=e=>{if(!C||C[0]===C[1])return`transparent`;let t=(e-C[0])/(C[1]-C[0]);return h||(t=1-t),`color-mix(in oklab, ${t>=.5?`var(--insight)`:`var(--danger)`} ${(Math.abs(t-.5)*2*26).toFixed(0)}%, transparent)`},T=e=>s(e,{unit:p?void 0:f,currency:p});return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(v||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(b,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(`div`,{className:`tb-sens`,onMouseLeave:()=>S(null),children:(0,y.jsxs)(`table`,{className:`tb-sens-tbl`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsxs)(`th`,{className:`tb-sens-corner`,children:[(0,y.jsx)(`span`,{className:`tb-sens-rowvar`,children:r}),(0,y.jsx)(`span`,{className:`tb-sens-colvar`,children:l})]}),u.map((e,t)=>(0,y.jsx)(`th`,{className:`tb-sens-colh tab-num`,children:e},t))]})}),(0,y.jsx)(`tbody`,{children:o.map((e,t)=>(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`tb-sens-rowh tab-num`,children:e}),u.map((e,n)=>{let r=d[t]?.[n],i=g&&g[0]===t&&g[1]===n,a=x&&x[0]===t&&x[1]===n;return(0,y.jsx)(`td`,{className:`tb-sens-cell tab-num`+(i?` is-base`:``)+(a?` is-hot`:``),style:{background:r==null?void 0:w(r)},onMouseEnter:()=>S([t,n]),children:r==null?`—`:T(r)},n)})]},t))})]})}),_&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:10},dangerouslySetInnerHTML:a(_)})]})}function be(e){return e.value<e.low?`low`:e.value>e.high?`high`:`ok`}function xe({title:e,icon:t=`shield`,iconColor:n=`var(--presence)`,results:r,caption:o,footer:c,delay:l}){let u=i[t]||i.shield,d=r.findIndex(e=>be(e)!==`ok`);return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(l||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),o&&(0,y.jsx)(`div`,{className:`tb-lab-cap`,children:o}),(0,y.jsx)(`div`,{className:`tb-lab`,children:r.map((e,t)=>{let n=be(e),r=(e.high-e.low||1)*.4,a=e.low-r,o=e.high+r,c=e=>Math.max(0,Math.min(100,(e-a)/(o-a)*100)),l=e.prior==null?0:Math.sign(e.value-e.prior);return(0,y.jsxs)(`div`,{className:`tb-lab-row flag-`+n,children:[(0,y.jsx)(`div`,{className:`tb-lab-name`,children:e.name}),(0,y.jsxs)(`div`,{className:`tb-lab-val tab-num`,"data-mark":t===d?`underline`:void 0,children:[s(e.value,{unit:e.unit}),l!==0&&(0,y.jsx)(i.arrowUp,{className:`tb-lab-trend`,style:{transform:l<0?`rotate(180deg)`:`none`}})]}),(0,y.jsxs)(`div`,{className:`tb-lab-track`,children:[(0,y.jsx)(`span`,{className:`tb-lab-band`,style:{left:`${c(e.low)}%`,width:`${c(e.high)-c(e.low)}%`}}),(0,y.jsx)(`span`,{className:`tb-lab-mark`,style:{left:`${c(e.value)}%`}})]}),(0,y.jsxs)(`div`,{className:`tb-lab-ref tab-num`,children:[s(e.low),`–`,s(e.high)]}),(0,y.jsx)(`div`,{className:`tb-lab-flag`,children:n===`high`?`High`:n===`low`?`Low`:``})]},t)})}),c&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:10},dangerouslySetInnerHTML:a(c)})]})}function Se({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,recipes:r,ingredients:o,matrix:s,quantities:c,highlight:l,footer:u,delay:d}){let f=i[t]||i.table;return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(d||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(`div`,{className:`im-scroll`,children:(0,y.jsxs)(`table`,{className:`im-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`im-th im-th--label`,children:`Ingredient`}),r.map((e,t)=>(0,y.jsx)(`th`,{className:`im-th`,children:e},t))]})}),(0,y.jsx)(`tbody`,{children:o.map((e,t)=>{let n=l&&e.toLowerCase()===l.toLowerCase();return(0,y.jsxs)(`tr`,{className:`im-row${n?` highlighted`:``}`,children:[(0,y.jsx)(`td`,{className:`im-td-label`,children:e}),r.map((e,n)=>{let r=s[t]?.[n]??!1,a=c?.[t]?.[n];return(0,y.jsx)(`td`,{className:`im-td${r?` used`:``}`,children:r?a?(0,y.jsx)(`span`,{className:`im-qty`,children:a}):(0,y.jsx)(i.check,{className:`ic`,style:{width:13,height:13,color:`var(--insight)`}}):(0,y.jsx)(`span`,{className:`im-empty`})},n)})]},t)})})]})}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}function Ce({title:e,verb:t,language:n,tenses:r,note:i,delay:a}){let o=r[0]?.forms.map(e=>e.pronoun)??[];return(0,y.jsxs)(`div`,{className:`card reveal tbl tbl-cj`,style:{"--delay":(a||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`tbl-cj-header`,children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,style:{marginBottom:0},children:[n&&(0,y.jsx)(`span`,{className:`tbl-cj-lang`,children:n}),e]}),(0,y.jsx)(`div`,{className:`tbl-cj-verb`,children:t})]}),(0,y.jsx)(`div`,{className:`tbl-cj-scroll`,children:(0,y.jsxs)(`table`,{className:`tbl-cj-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`tbl-cj-corner`,scope:`col`}),r.map(e=>(0,y.jsx)(`th`,{className:`tbl-cj-tense-head`,scope:`col`,children:e.name},e.name))]})}),(0,y.jsx)(`tbody`,{children:o.map((e,t)=>(0,y.jsxs)(`tr`,{className:`tbl-cj-row`,children:[(0,y.jsx)(`th`,{className:`tbl-cj-pronoun`,scope:`row`,children:e}),r.map(e=>{let n=e.forms[t];return(0,y.jsx)(`td`,{className:`tbl-cj-form${n?.irregular?` tbl-cj-irregular`:``}`,children:n?.form??`—`},e.name)})]},e))})]})}),r.some(e=>e.forms.some(e=>e.irregular))&&(0,y.jsxs)(`div`,{className:`tbl-cj-legend faint`,children:[(0,y.jsx)(`span`,{className:`tbl-cj-legend-swatch`}),` irregular form`]}),i&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:10},children:i})]})}var B={safe:{color:`var(--insight)`,icon:`check`,label:`Safe`},caution:{color:`var(--warning)`,icon:`alert`,label:`Caution`},avoid:{color:`var(--danger)`,icon:`x`,label:`Avoid`},unknown:{color:`var(--text-faint)`,icon:`eye`,label:`Check a pro`}},we=[`safe`,`caution`,`avoid`,`unknown`];function Te({title:e,icon:t=`shield`,iconColor:n=`var(--presence)`,rows:r,columns:o,cells:s,legend:c=!0,footer:l,delay:u}){let d=i[t]||i.shield,f=r??[],p=o??[],m=(e,t)=>`${e.trim().toLowerCase()}${t.trim().toLowerCase()}`,h=new Map;for(let e of s??[]){if(!e?.row||!e?.col)continue;let t=B[e.level]?e.level:`unknown`;h.set(m(e.row,e.col),{level:t,reason:e.reason})}let g=we.filter(e=>[...h.values()].some(t=>t.level===e)),_=`minmax(116px, 1.1fr) repeat(${Math.max(p.length,1)}, minmax(132px, 1fr))`;return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(u||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(d,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(`div`,{className:`clm-scroll`,children:(0,y.jsxs)(`div`,{className:`clm-grid`,style:{gridTemplateColumns:_},role:`grid`,children:[(0,y.jsx)(`div`,{className:`clm-corner`,role:`columnheader`}),p.map((e,t)=>(0,y.jsx)(`div`,{className:`clm-colh`,role:`columnheader`,title:e,children:e},t)),f.map((e,t)=>(0,y.jsxs)(`div`,{className:`clm-row`,role:`row`,children:[(0,y.jsx)(`div`,{className:`clm-rowh`,role:`rowheader`,title:e,children:e}),p.map((t,n)=>{let r=h.get(m(e,t))??{level:`unknown`},a=B[r.level],o=i[a.icon]||i.eye;return(0,y.jsxs)(`div`,{className:`clm-cell clm-${r.level}`,style:{"--clm-c":a.color},role:`gridcell`,children:[(0,y.jsxs)(`span`,{className:`clm-tag`,children:[(0,y.jsx)(o,{className:`ic clm-tag-ic`}),(0,y.jsx)(`span`,{className:`clm-tag-lbl`,children:a.label})]}),(0,y.jsx)(`span`,{className:`clm-reason`,children:r.reason||a.label})]},n)})]},t))]})}),c&&g.length>0&&(0,y.jsx)(`div`,{className:`clm-legend`,children:g.map(e=>{let t=B[e],n=i[t.icon]||i.eye;return(0,y.jsxs)(`span`,{className:`clm-leg-item`,style:{"--clm-c":t.color},children:[(0,y.jsx)(n,{className:`ic clm-leg-ic`}),t.label]},e)})}),l&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(l)})]})}function Ee(e,t){let n=s(Math.abs(e),{currency:t,decimals:0});return e<0?`(${n})`:n}function De({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,periods:r,rows:o,currency:s=`USD`,caption:c,footer:l,delay:u}){let d=i[t]||i.chart;return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(u||0)+`ms`},children:[e&&(0,y.jsxs)(`div`,{className:`card-eyebrow`,style:{marginBottom:c?4:14},children:[(0,y.jsx)(d,{className:`ic`,style:{color:n}}),` `,e]}),c&&(0,y.jsx)(`div`,{className:`fs-cap`,children:c}),(0,y.jsx)(`div`,{className:`fs-scroll`,children:(0,y.jsxs)(`table`,{className:`fs-tbl`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`fs-h-label`,children:`\xA0`}),r.map((e,t)=>(0,y.jsx)(`th`,{className:`fs-h-period`,children:e},t))]})}),(0,y.jsx)(`tbody`,{children:o.map((e,t)=>{let n=e.kind||`line`,i=Math.max(0,e.indent||0);return(0,y.jsxs)(`tr`,{className:`fs-row fs-${n}`,children:[(0,y.jsx)(`td`,{className:`fs-label`,style:{paddingLeft:2+i*14},children:e.label}),r.map((t,n)=>{let r=e.values[n];return(0,y.jsx)(`td`,{className:`fs-val tab-num ${r!=null&&r<0?`neg`:``}`,children:r==null?`—`:Ee(r,s)},n)})]},t)})})]})}),l&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(l)})]})}function Oe({title:e,icon:t=`layers`,iconColor:n=`var(--presence)`,cohorts:r,periods:o,unit:c=`%`,caption:l,footer:u,delay:d}){let f=i[t]||i.layers,[p,h]=(0,m.useState)(null),g=Math.max(0,...r.map(e=>e.values.length)),_=o&&o.length?o:Array.from({length:g},(e,t)=>`M${t}`),v=r.flatMap(e=>e.values).filter(e=>e!=null),b=v.length?Math.min(...v):0,x=(v.length?Math.max(...v):1)-b||1,S=e=>(e-b)/x,C=Array.from({length:g},(e,t)=>{let n=r.map(e=>e.values[t]).filter(e=>e!=null);return n.length?n.reduce((e,t)=>e+t,0)/n.length:null}),w=e=>s(e,{decimals:e%1==0?0:1})+c;return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(d||0)+`ms`},children:[e&&(0,y.jsxs)(`div`,{className:`card-eyebrow`,style:{marginBottom:l?4:14},children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),l&&(0,y.jsx)(`div`,{className:`fs-cap`,children:l}),(0,y.jsx)(`div`,{className:`cg-scroll`,children:(0,y.jsxs)(`table`,{className:`cg-tbl`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`cg-h-cohort`,children:`Cohort`}),_.map((e,t)=>(0,y.jsx)(`th`,{className:`cg-h-period ${p?.c===t?`on`:``}`,children:e},t))]})}),(0,y.jsx)(`tbody`,{children:r.map((e,t)=>(0,y.jsxs)(`tr`,{children:[(0,y.jsxs)(`th`,{className:`cg-cohort`,scope:`row`,children:[(0,y.jsx)(`span`,{className:`cg-cohort-name`,children:e.label}),e.size!=null&&(0,y.jsx)(`span`,{className:`cg-cohort-size`,children:s(e.size,{compact:e.size>=1e4})})]}),Array.from({length:g},(n,r)=>{let i=e.values[r];if(i==null)return(0,y.jsx)(`td`,{className:`cg-cell cg-empty`},r);let a=Math.max(0,Math.min(1,S(i))),o=p?.r===t&&p?.c===r;return(0,y.jsx)(`td`,{className:`cg-cell tab-num ${o?`hot`:``}`,style:{background:`color-mix(in oklab, var(--insight) ${(a*.82+.06)*100}%, transparent)`,color:a>.5?`var(--surface-deep)`:`var(--text-secondary)`},onMouseEnter:()=>h({r:t,c:r}),onMouseLeave:()=>h(null),children:w(i)},r)})]},t))}),(0,y.jsx)(`tfoot`,{children:(0,y.jsxs)(`tr`,{className:`cg-foot`,children:[(0,y.jsx)(`th`,{className:`cg-cohort cg-foot-label`,scope:`row`,children:`Average`}),C.map((e,t)=>(0,y.jsx)(`td`,{className:`cg-cell cg-avg tab-num`,children:e==null?``:w(e)},t))]})})]})}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}var ke=(e,t)=>Math.max(1,Math.min(t,Math.round(e)));function Ae(e,t,n){let r=e*t/(n*n);return r>=.55?`high`:r>=.28?`med`:`low`}var je={low:`var(--insight)`,med:`var(--warning)`,high:`var(--danger)`};function Me({title:e,icon:t=`shield`,iconColor:n=`var(--presence)`,risks:r,size:o=5,caption:s,footer:c,delay:l}){let u=i[t]||i.shield,d=o,[f,p]=(0,m.useState)(null),h=r.map(e=>({...e,likelihood:ke(e.likelihood,d),impact:ke(e.impact,d)})),g=(e,t)=>h.map((e,t)=>({r:e,idx:t})).filter(({r:n})=>n.likelihood===e&&n.impact===t),_=Array.from({length:d},(e,t)=>d-t),v=Array.from({length:d},(e,t)=>t+1);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(l||0)+`ms`},children:[e&&(0,y.jsxs)(`div`,{className:`card-eyebrow`,style:{marginBottom:s?4:14},children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),s&&(0,y.jsx)(`div`,{className:`fs-cap`,children:s}),(0,y.jsxs)(`div`,{className:`rm-plot`,children:[(0,y.jsx)(`div`,{className:`rm-ylabel`,children:`Likelihood`}),(0,y.jsxs)(`div`,{className:`rm-grid-wrap`,children:[(0,y.jsx)(`div`,{className:`rm-grid`,style:{gridTemplateColumns:`repeat(${d}, minmax(0, 1fr))`},children:_.map(e=>v.map(t=>{let n=Ae(e,t,d),r=je[n],i=g(e,t);return(0,y.jsx)(`div`,{className:`rm-cell rm-${n}`,style:{background:`color-mix(in oklab, ${r} 16%, transparent)`,borderColor:`color-mix(in oklab, ${r} 30%, transparent)`},children:i.map(({r:e,idx:t})=>(0,y.jsx)(`span`,{className:`rm-chip ${f===t?`hot`:``}`,style:{background:`color-mix(in oklab, ${r} 26%, var(--surface-elevated))`,borderColor:r},onMouseEnter:()=>p(t),onMouseLeave:()=>p(null),children:e.label},t))},`${e}-${t}`)}))}),(0,y.jsx)(`div`,{className:`rm-xlabel`,children:`Impact →`})]})]}),(0,y.jsx)(`ol`,{className:`rm-register`,children:h.map((e,t)=>{let n=je[Ae(e.likelihood,e.impact,d)];return(0,y.jsxs)(`li`,{className:`rm-reg-row ${f===t?`hot`:``}`,onMouseEnter:()=>p(t),onMouseLeave:()=>p(null),children:[(0,y.jsx)(`span`,{className:`rm-reg-dot`,style:{background:n}}),(0,y.jsxs)(`div`,{className:`rm-reg-body`,children:[(0,y.jsxs)(`div`,{className:`rm-reg-top`,children:[(0,y.jsx)(`span`,{className:`rm-reg-label`,children:e.label}),e.owner&&(0,y.jsx)(`span`,{className:`rm-reg-owner`,children:e.owner})]}),e.mitigation&&(0,y.jsx)(`div`,{className:`rm-reg-mit`,children:e.mitigation})]})]},t)})}),c&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(c)})]})}var Ne={met:{color:`var(--insight)`,label:`Met`},partial:{color:`var(--warning)`,label:`Partial`},ongoing:{color:`var(--presence)`,label:`Ongoing`}};function Pe({title:e,icon:t=`shield`,iconColor:n=`var(--presence)`,entries:r,caption:o,footer:s,delay:c}){let l=i[t]||i.shield,u=r??[];return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(c||0)+`ms`},children:[e&&(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(l,{className:`ic`,style:{color:n}}),` `,e]}),o&&(0,y.jsx)(`div`,{className:`fs-cap`,children:o}),(0,y.jsx)(`div`,{className:`cp-scroll`,children:(0,y.jsxs)(`div`,{className:`cp-grid`,role:`table`,children:[(0,y.jsxs)(`div`,{className:`cp-head`,role:`row`,children:[(0,y.jsx)(`span`,{className:`cp-colh`,role:`columnheader`,children:`Assessment / Dx`}),(0,y.jsx)(`span`,{className:`cp-colh`,role:`columnheader`,children:`Goal`}),(0,y.jsx)(`span`,{className:`cp-colh`,role:`columnheader`,children:`Interventions`}),(0,y.jsx)(`span`,{className:`cp-colh`,role:`columnheader`,children:`Rationale`})]}),u.map((e,t)=>{let n=Ne[e.status??`ongoing`];return(0,y.jsxs)(`div`,{className:`cp-row`,role:`row`,style:{"--cp-c":n.color},children:[(0,y.jsxs)(`div`,{className:`cp-cell cp-assess`,role:`cell`,children:[(0,y.jsx)(`span`,{className:`cp-assess-text`,children:e.assessment}),e.diagnosis&&(0,y.jsx)(`span`,{className:`cp-dx`,children:e.diagnosis})]}),(0,y.jsxs)(`div`,{className:`cp-cell cp-goal`,role:`cell`,children:[(0,y.jsx)(`span`,{className:`cp-goal-text`,children:e.goal}),(0,y.jsxs)(`span`,{className:`cp-status`,children:[(0,y.jsx)(`span`,{className:`cp-status-dot`}),n.label]})]}),(0,y.jsx)(`div`,{className:`cp-cell`,role:`cell`,children:(0,y.jsx)(`ul`,{className:`cp-intervs`,children:(e.interventions??[]).map((e,t)=>(0,y.jsx)(`li`,{className:`cp-interv`,children:e},t))})}),(0,y.jsx)(`div`,{className:`cp-cell cp-rationale`,role:`cell`,children:e.rationale||(0,y.jsx)(`span`,{className:`cp-dash`,children:`—`})})]},t)})]})}),s&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(s)})]})}function Fe({title:e,icon:t=`shield`,iconColor:n=`var(--presence)`,drug:r,route:o,computed:s,ladder:c,adjustments:l,caption:u,footer:d,delay:f}){let p=i[t]||i.shield,m=c??[],h=e=>m.length>1?38+e/(m.length-1)*62:100;return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(f||0)+`ms`},children:[e&&(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsxs)(`div`,{className:`dl-head`,children:[(0,y.jsx)(`span`,{className:`dl-drug`,children:r}),o&&(0,y.jsx)(`span`,{className:`dl-route`,children:o}),u&&(0,y.jsx)(`span`,{className:`dl-cap`,children:u})]}),s&&(0,y.jsxs)(`div`,{className:`dl-calc`,children:[(0,y.jsxs)(`div`,{className:`dl-calc-side`,children:[(0,y.jsx)(`span`,{className:`dl-calc-tag`,children:`Input`}),(0,y.jsx)(`span`,{className:`dl-calc-val`,children:s.input})]}),(0,y.jsxs)(`div`,{className:`dl-calc-op`,children:[(0,y.jsx)(i.chevR,{className:`ic`}),(0,y.jsx)(`span`,{className:`dl-calc-formula`,title:s.formula,children:s.formula}),(0,y.jsx)(i.chevR,{className:`ic`})]}),(0,y.jsxs)(`div`,{className:`dl-calc-side dl-calc-out`,children:[(0,y.jsx)(`span`,{className:`dl-calc-tag`,children:`Starting dose`}),(0,y.jsx)(`span`,{className:`dl-calc-val`,children:s.result})]})]}),(0,y.jsx)(`div`,{className:`dl-ladder`,children:m.map((e,t)=>(0,y.jsxs)(`div`,{className:`dl-rung ${e.ceiling?`ceiling`:``}`,style:{"--dl-h":`${h(t)}%`},children:[(0,y.jsx)(`span`,{className:`dl-bar`}),(0,y.jsxs)(`div`,{className:`dl-rung-body`,children:[(0,y.jsxs)(`div`,{className:`dl-rung-top`,children:[(0,y.jsx)(`span`,{className:`dl-step`,children:e.step}),(0,y.jsx)(`span`,{className:`dl-dose`,children:e.dose}),e.ceiling&&(0,y.jsxs)(`span`,{className:`dl-ceiling-tag`,children:[(0,y.jsx)(i.alert,{className:`ic`}),` Max`]})]}),e.note&&(0,y.jsx)(`span`,{className:`dl-note`,children:e.note})]})]},t))}),l&&l.length>0&&(0,y.jsxs)(`div`,{className:`dl-adjust`,children:[(0,y.jsx)(`div`,{className:`dl-adjust-h`,children:`Dose adjustments`}),(0,y.jsx)(`ul`,{className:`dl-adjust-list`,children:l.map((e,t)=>(0,y.jsxs)(`li`,{className:`dl-adjust-row`,children:[(0,y.jsx)(`span`,{className:`dl-adjust-cond`,children:e.condition}),(0,y.jsx)(`span`,{className:`dl-adjust-change`,children:e.change})]},t))})]}),d&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(d)})]})}function Ie({title:e,icon:t=`cart`,iconColor:n=`var(--presence)`,columns:r,rows:o,unit:s,highlight:c,guide:l,caption:u,footer:d,delay:f}){let p=i[t]||i.cart,m=e=>e.trim().toLowerCase(),h=c?m(c):null;return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(f||0)+`ms`},children:[e&&(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),u&&(0,y.jsx)(`div`,{className:`sz-cap`,children:u}),(0,y.jsx)(`div`,{className:`sz-scroll`,children:(0,y.jsxs)(`table`,{className:`sz-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`sz-th sz-th--size`,children:`Size`}),r.map((e,t)=>(0,y.jsx)(`th`,{className:`sz-th`,children:e},t))]})}),(0,y.jsx)(`tbody`,{children:o.map((e,t)=>{let n=h!==null&&m(e.size)===h;return(0,y.jsxs)(`tr`,{className:`sz-row${n?` on`:``}`,children:[(0,y.jsxs)(`th`,{className:`sz-size`,scope:`row`,children:[e.size,n&&(0,y.jsx)(`span`,{className:`sz-pick`,children:`Your size`})]}),r.map((t,n)=>(0,y.jsx)(`td`,{className:`sz-td`,children:e.values[n]??(0,y.jsx)(`span`,{className:`sz-dash`,children:`—`})},n))]},t)})})]})}),(l||s)&&(0,y.jsxs)(`div`,{className:`sz-guide`,children:[(0,y.jsx)(i.sliders,{className:`sz-guide-ic`}),(0,y.jsxs)(`span`,{className:`sz-guide-t`,children:[s&&(0,y.jsxs)(`b`,{className:`sz-guide-unit`,children:[s,`.`]}),` `,l]})]}),d&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(d)})]})}function Le(e){let t=(0,M.c)(4),{value:n}=e;if(n===!0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`span`,{className:`pt-yes`,children:(0,y.jsx)(i.check,{className:`ic`,"aria-label":`included`})}),t[0]=e):e=t[0],e}if(typeof n==`string`&&n.length>0){let e;return t[1]===n?e=t[2]:(e=(0,y.jsx)(`span`,{className:`pt-text`,children:n}),t[1]=n,t[2]=e),e}let r;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,y.jsx)(`span`,{className:`pt-no`,"aria-label":`not included`,children:`—`}),t[3]=r):r=t[3],r}function Re({plan:e,i:t}){return(0,y.jsxs)(`div`,{className:`pt-plan m-stagger-item m-scale-in`+(e.highlighted?` hot`:``),style:{"--i":t},children:[e.highlighted&&(0,y.jsx)(`span`,{className:`pt-ribbon`,children:`Most popular`}),(0,y.jsx)(`div`,{className:`pt-name`,children:e.name||`Plan ${t+1}`}),(0,y.jsxs)(`div`,{className:`pt-price-row`,children:[(0,y.jsx)(`span`,{className:`pt-price`,children:e.price}),e.period&&(0,y.jsx)(`span`,{className:`pt-period`,children:e.period})]}),e.tagline&&(0,y.jsx)(`div`,{className:`pt-tagline`,children:e.tagline}),e.ctaLabel&&(0,y.jsx)(`span`,{className:`pt-cta`,children:e.ctaLabel})]})}function ze({title:e,icon:t=`cart`,iconColor:n=`var(--presence)`,plans:r,features:o,caption:s,footer:c,delay:u}){let d=i[t]||i.cart,f=r?.length??0;if(f===0)return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(u||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(d,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(l,{message:`No plans to compare`})]});let p=`minmax(128px, 1.1fr) repeat(${f}, minmax(148px, 1fr))`,m=o??[];return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(u||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(d,{className:`ic`,style:{color:n}}),` `,e]}),s&&(0,y.jsx)(`div`,{className:`pt-cap`,children:s}),(0,y.jsx)(`div`,{className:`pt-scroll`,children:(0,y.jsxs)(`div`,{className:`pt-grid`,style:{gridTemplateColumns:p,"--pt-cols":p},role:`grid`,children:[(0,y.jsx)(`div`,{className:`pt-corner`,role:`columnheader`}),r.map((e,t)=>(0,y.jsx)(`div`,{role:`columnheader`,children:(0,y.jsx)(Re,{plan:e,i:t})},t)),m.map((e,t)=>(0,y.jsxs)(`div`,{className:`pt-row m-stagger-item m-fade-rise`,style:{"--i":t},role:`row`,children:[(0,y.jsx)(`div`,{className:`pt-feat`,role:`rowheader`,title:e.label,children:e.label}),r.map((t,n)=>(0,y.jsx)(`div`,{className:`pt-cell`+(t.highlighted?` hot`:``),role:`gridcell`,children:(0,y.jsx)(Le,{value:e.values?.[n]})},n))]},t))]})}),m.length>0&&(0,y.jsxs)(`div`,{className:`pt-legend`,children:[(0,y.jsxs)(`span`,{className:`pt-leg-item`,children:[(0,y.jsx)(i.check,{className:`ic pt-leg-ic`}),` included`]}),(0,y.jsxs)(`span`,{className:`pt-leg-item`,children:[(0,y.jsx)(`span`,{className:`pt-leg-dash`,children:`—`}),` not included`]})]}),c&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(c)})]})}var V={R:{color:`var(--presence)`,label:`Responsible`},A:{color:`var(--warning)`,label:`Accountable`},C:{color:`var(--insight)`,label:`Consulted`},I:{color:`var(--text-muted)`,label:`Informed`}},Be=[`R`,`A`,`C`,`I`];function Ve({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,tasks:r,roles:o,cells:s,legend:c=!0,footer:u,delay:d}){let f=i[t]||i.table,p=r??[],m=o??[];if(p.length===0||m.length===0)return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(d||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(l,{message:`No tasks or roles to map`})]});let h=(e,t)=>`${e.trim().toLowerCase()} ${t.trim().toLowerCase()}`,g=new Map;for(let e of s??[])!e?.task||!e?.role||!V[e.rating]||g.set(h(e.task,e.role),e.rating);let _=Be.filter(e=>[...g.values()].includes(e)),v=`minmax(120px, 1.2fr) repeat(${m.length}, minmax(88px, 1fr))`;return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(d||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(`div`,{className:`raci-scroll`,children:(0,y.jsxs)(`div`,{className:`raci-grid`,style:{gridTemplateColumns:v},role:`grid`,children:[(0,y.jsx)(`div`,{className:`raci-corner`,role:`columnheader`}),m.map((e,t)=>(0,y.jsx)(`div`,{className:`raci-colh`,role:`columnheader`,title:e,children:e},t)),p.map((e,t)=>(0,y.jsxs)(`div`,{className:`raci-row m-stagger-item m-fade-rise`,style:{"--i":t},role:`row`,children:[(0,y.jsx)(`div`,{className:`raci-rowh`,role:`rowheader`,title:e,children:e}),m.map((t,n)=>{let r=g.get(h(e,t));if(!r)return(0,y.jsx)(`div`,{className:`raci-cell raci-empty`,role:`gridcell`,children:(0,y.jsx)(`span`,{className:`raci-dash`,children:`–`})},n);let i=V[r];return(0,y.jsx)(`div`,{className:`raci-cell`,style:{"--raci-c":i.color},role:`gridcell`,title:i.label,children:(0,y.jsx)(`span`,{className:`raci-badge`,children:r})},n)})]},t))]})}),c&&_.length>0&&(0,y.jsx)(`div`,{className:`raci-legend`,children:_.map(e=>(0,y.jsxs)(`span`,{className:`raci-leg-item`,style:{"--raci-c":V[e].color},children:[(0,y.jsx)(`span`,{className:`raci-leg-badge`,children:e}),V[e].label]},e))}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}var H=e=>typeof e==`string`?e:e==null?``:String(e);function He({title:e,icon:t=`check`,iconColor:n=`var(--presence)`,criteria:r,levels:o,cells:s,scores:c,maxScore:u,footer:f,delay:p}){let h=i[t]||i.check,g=Array.isArray(r)?r:r?[String(r)]:[],_=Array.isArray(o)?o:o?[String(o)]:[],v=(0,m.useMemo)(()=>{let e=(e,t)=>`${H(e).trim().toLowerCase()} ${H(t).trim().toLowerCase()}`,t=new Map;for(let n of s??[])!n?.criterion||!n?.level||t.set(e(n.criterion,n.level),{descriptor:n.descriptor,achieved:n.achieved});return t},[s]),b=(0,m.useMemo)(()=>Array.isArray(c)?c:[],[c]),x=(0,m.useMemo)(()=>{let e=new Map;for(let t of b)t?.criterion&&e.set(H(t.criterion).trim().toLowerCase(),t.score);return e},[b]),S=b.length>0,C=(0,m.useMemo)(()=>b.reduce((e,t)=>e+(Number.isFinite(t.score)?t.score:0),0),[b]),w=u==null?void 0:u*g.length,T=d(C,{duration:900,decimals:C%1==0?0:1});if(g.length===0||_.length===0)return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(p||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(h,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(l,{message:`No criteria or levels to score`})]});let E=`minmax(130px, 1.1fr) repeat(${_.length}, minmax(150px, 1fr))${S?` minmax(64px, 0.5fr)`:``}`;return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(p||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(h,{className:`ic`,style:{color:n}}),` `,e,S&&(0,y.jsxs)(`span`,{className:`rub-total`,children:[T,w==null?``:` / ${w}`,` pts`]})]}),(0,y.jsx)(`div`,{className:`rub-scroll`,children:(0,y.jsxs)(`div`,{className:`rub-grid`,style:{gridTemplateColumns:E},role:`grid`,children:[(0,y.jsx)(`div`,{className:`rub-corner`,role:`columnheader`}),_.map((e,t)=>(0,y.jsx)(`div`,{className:`rub-colh`,role:`columnheader`,title:H(e),children:H(e)},t)),S&&(0,y.jsx)(`div`,{className:`rub-colh rub-score-h`,children:`Score`}),g.map((e,t)=>{let n=H(e).trim().toLowerCase(),r=x.get(n);return(0,y.jsxs)(`div`,{className:`rub-row m-stagger-item m-fade-rise`,style:{"--i":t},role:`row`,children:[(0,y.jsx)(`div`,{className:`rub-rowh`,role:`rowheader`,title:H(e),children:H(e)}),_.map((e,t)=>{let r=v.get(`${n} ${H(e).trim().toLowerCase()}`);return(0,y.jsxs)(`div`,{className:`rub-cell`+(r?.achieved?` achieved`:``),role:`gridcell`,children:[r?.achieved&&(0,y.jsx)(i.check,{className:`ic rub-check`}),(0,y.jsx)(`span`,{className:`rub-desc`,children:r?.descriptor||`—`})]},t)}),S&&(0,y.jsx)(`div`,{className:`rub-cell rub-score-cell`,role:`gridcell`,children:r==null?`—`:(0,y.jsxs)(`span`,{className:`tab-num`,children:[r,u==null?``:`/${u}`]})})]},t)})]})}),f&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(f)})]})}var U=e=>typeof e==`string`?e:e==null?``:String(e);function Ue(e,t,n){let r=n-t||1,i=Math.max(0,Math.min(1,(e-t)/r));return i>=.66?`var(--insight)`:i>=.33?`var(--warning)`:`var(--danger)`}function We({title:e,icon:t=`chat`,iconColor:n=`var(--presence)`,candidates:r,criteria:o,cells:s,scale:c,footer:u,delay:d}){let f=i[t]||i.chat,p=(0,m.useMemo)(()=>Array.isArray(r)?r:r?[String(r)]:[],[r]),h=(0,m.useMemo)(()=>Array.isArray(o)?o:o?[String(o)]:[],[o]),g=c?.min??1,_=c?.max??5,v=(0,m.useMemo)(()=>{let e=(e,t)=>`${U(e).trim().toLowerCase()} ${U(t).trim().toLowerCase()}`,t=new Map;for(let n of s??[])!n?.candidate||!n?.criterion||!Number.isFinite(n.rating)||t.set(e(n.candidate,n.criterion),{rating:n.rating,note:n.note});return t},[s]),b=(0,m.useMemo)(()=>{let e=new Map;for(let t of p){let n=U(t).trim().toLowerCase(),r=h.map(e=>v.get(`${n} ${U(e).trim().toLowerCase()}`)?.rating).filter(e=>e!=null);r.length>0&&e.set(t,r.reduce((e,t)=>e+t,0)/r.length)}return e},[p,h,v]);if(p.length===0||h.length===0)return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(d||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(l,{message:`No candidates or criteria to score`})]});let x=`minmax(128px, 1.1fr) repeat(${h.length}, minmax(130px, 1fr))`;return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(d||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(`div`,{className:`isc-scroll`,children:(0,y.jsxs)(`div`,{className:`isc-grid`,style:{gridTemplateColumns:x},role:`grid`,children:[(0,y.jsx)(`div`,{className:`isc-corner`,role:`columnheader`}),h.map((e,t)=>(0,y.jsx)(`div`,{className:`isc-colh`,role:`columnheader`,title:U(e),children:U(e)},t)),p.map((e,t)=>{let n=b.get(e);return(0,y.jsxs)(`div`,{className:`isc-row m-stagger-item m-fade-rise`,style:{"--i":t},role:`row`,children:[(0,y.jsxs)(`div`,{className:`isc-rowh`,role:`rowheader`,title:U(e),children:[(0,y.jsx)(`span`,{className:`isc-name`,children:U(e)}),n!=null&&(0,y.jsx)(`span`,{className:`isc-avg`,style:{"--isc-c":Ue(n,g,_)},children:n.toFixed(1)})]}),h.map((t,n)=>{let r=v.get(`${U(e).trim().toLowerCase()} ${U(t).trim().toLowerCase()}`);if(!r)return(0,y.jsx)(`div`,{className:`isc-cell isc-empty`,role:`gridcell`,children:(0,y.jsx)(`span`,{className:`isc-dash`,children:`—`})},n);let i=Ue(r.rating,g,_);return(0,y.jsxs)(`div`,{className:`isc-cell`,style:{"--isc-c":i},role:`gridcell`,children:[(0,y.jsxs)(`span`,{className:`isc-badge tab-num`,children:[r.rating,(0,y.jsxs)(`span`,{className:`isc-scale`,children:[`/`,_]})]}),r.note&&(0,y.jsx)(`span`,{className:`isc-note`,children:r.note})]},n)})]},t)})]})}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}function W(e){return e>=97?`A+`:e>=93?`A`:e>=90?`A-`:e>=87?`B+`:e>=83?`B`:e>=80?`B-`:e>=77?`C+`:e>=73?`C`:e>=70?`C-`:e>=67?`D+`:e>=63?`D`:e>=60?`D-`:`F`}function G(e){let t=e[0];return t===`A`?`var(--insight)`:t===`B`?`var(--presence)`:t===`C`?`var(--warning)`:`var(--danger)`}function Ge({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,students:r,assignments:o,cells:s,showClassAverage:c=!0,footer:u,delay:f}){let p=i[t]||i.table,h=(0,m.useMemo)(()=>r??[],[r]),g=(0,m.useMemo)(()=>o??[],[o]),_=(0,m.useMemo)(()=>{let e=(e,t)=>`${e.trim().toLowerCase()} ${t.trim().toLowerCase()}`,t=new Map;for(let n of s??[])!n?.student||!n?.assignment||!Number.isFinite(n.score)||t.set(e(n.student,n.assignment),{score:n.score,maxScore:n.maxScore??100});return t},[s]),{avgByStudent:v,classAvg:b}=(0,m.useMemo)(()=>{let e=new Map,t=[];for(let n of h){let r=n.trim().toLowerCase(),i=g.map(e=>_.get(`${r} ${e.trim().toLowerCase()}`)).filter(e=>e!=null).map(e=>e.score/(e.maxScore||1)*100);i.length>0&&(e.set(n,i.reduce((e,t)=>e+t,0)/i.length),t.push(...i))}return{avgByStudent:e,classAvg:t.length>0?t.reduce((e,t)=>e+t,0)/t.length:0}},[h,g,_]),x=d(b,{duration:900,decimals:0});if(h.length===0||g.length===0)return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(f||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(l,{message:`No students or assignments to grade`})]});let S=c,C=`minmax(128px, 1.1fr) repeat(${g.length}, minmax(104px, 1fr))${S?` minmax(84px, 0.6fr)`:``}`;return(0,y.jsxs)(`div`,{className:`card reveal`,style:{"--delay":(f||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(p,{className:`ic`,style:{color:n}}),` `,e,c&&(0,y.jsxs)(`span`,{className:`gb-total`,style:{"--gb-c":G(W(b))},children:[`class avg `,x,`%`]})]}),(0,y.jsx)(`div`,{className:`gb-scroll`,children:(0,y.jsxs)(`div`,{className:`gb-grid`,style:{gridTemplateColumns:C},role:`grid`,children:[(0,y.jsx)(`div`,{className:`gb-corner`,role:`columnheader`}),g.map((e,t)=>(0,y.jsx)(`div`,{className:`gb-colh`,role:`columnheader`,title:e,children:e},t)),S&&(0,y.jsx)(`div`,{className:`gb-colh gb-avg-h`,children:`Average`}),h.map((e,t)=>{let n=v.get(e);return(0,y.jsxs)(`div`,{className:`gb-row m-stagger-item m-fade-rise`,style:{"--i":t},role:`row`,children:[(0,y.jsx)(`div`,{className:`gb-rowh`,role:`rowheader`,title:e,children:e}),g.map((t,n)=>{let r=_.get(`${e.trim().toLowerCase()} ${t.trim().toLowerCase()}`);if(!r)return(0,y.jsx)(`div`,{className:`gb-cell gb-empty`,role:`gridcell`,children:(0,y.jsx)(`span`,{className:`gb-dash`,children:`—`})},n);let i=W(r.score/(r.maxScore||1)*100);return(0,y.jsxs)(`div`,{className:`gb-cell`,style:{"--gb-c":G(i)},role:`gridcell`,children:[(0,y.jsxs)(`span`,{className:`gb-score tab-num`,children:[r.score,`/`,r.maxScore]}),(0,y.jsx)(`span`,{className:`gb-letter`,children:i})]},n)}),S&&(0,y.jsx)(`div`,{className:`gb-cell gb-avg-cell`,role:`gridcell`,children:n==null?`—`:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`span`,{className:`gb-score tab-num`,children:[n.toFixed(0),`%`]}),(0,y.jsx)(`span`,{className:`gb-letter`,style:{"--gb-c":G(W(n))},children:W(n)})]})})]},t)})]})}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}var Ke={int:`var(--presence)`,float:`var(--presence-deep)`,str:`var(--insight-soft)`,bool:`var(--warning)`,category:`var(--insight)`,datetime:`var(--presence-soft)`},qe=new Set([`int`,`float`,`str`,`bool`,`category`,`datetime`]);function Je(e){return typeof e==`string`&&qe.has(e)?e:`str`}function Ye(e){let t=typeof e==`number`?e:parseFloat(String(e??``));return Number.isFinite(t)?Math.max(0,Math.min(100,t)):null}function Xe(e){return e>=40?`var(--danger)`:e>=15?`var(--warning)`:`var(--insight)`}function Ze(e){return typeof e==`number`&&Number.isFinite(e)?Math.max(0,Math.round(e)):null}function Qe({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,source:r,nRows:o,nCols:c,variables:u,footer:d,delay:f}){let p=i[t]||i.table,m=(Array.isArray(u)?u:[]).filter(e=>typeof e?.name==`string`&&e.name.trim().length>0),h=Ze(o),g=Ze(c)??(m.length||null),_=[];return r&&_.push(r),h!=null&&_.push(`${s(h,{compact:h>=1e5})} rows`),g!=null&&_.push(`${s(g)} cols`),(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(f||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),_.length>0&&(0,y.jsx)(`div`,{className:`dd-cap`,children:_.join(` · `)}),m.length===0?(0,y.jsx)(l,{message:`No variables documented`}):(0,y.jsx)(`div`,{className:`dd-scroll`,children:(0,y.jsxs)(`div`,{className:`dd-grid`,role:`grid`,children:[(0,y.jsx)(`div`,{className:`dd-colh`,role:`columnheader`,children:`Variable`}),(0,y.jsx)(`div`,{className:`dd-colh`,role:`columnheader`,children:`Type`}),(0,y.jsx)(`div`,{className:`dd-colh`,role:`columnheader`,children:`Unit`}),(0,y.jsx)(`div`,{className:`dd-colh dd-colh-desc`,role:`columnheader`,children:`Description`}),(0,y.jsx)(`div`,{className:`dd-colh dd-colh-miss`,role:`columnheader`,children:`Missing`}),m.map((e,t)=>{let n=Je(e.dtype),r=Ye(e.missingPct);return(0,y.jsxs)(`div`,{className:`dd-row m-stagger-item m-fade-rise`,style:{"--i":t},role:`row`,children:[(0,y.jsx)(`div`,{className:`dd-name`,role:`gridcell`,title:e.name,children:e.name}),(0,y.jsx)(`div`,{role:`gridcell`,children:(0,y.jsx)(`span`,{className:`dd-pill`,style:{"--dd-c":Ke[n]},children:n})}),(0,y.jsx)(`div`,{className:`dd-unit`,role:`gridcell`,children:e.unit||`—`}),(0,y.jsx)(`div`,{className:`dd-desc`,role:`gridcell`,children:e.description||`—`}),(0,y.jsx)(`div`,{className:`dd-miss`,role:`gridcell`,children:r==null?(0,y.jsx)(`span`,{className:`dd-miss-dash`,children:`—`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`div`,{className:`dd-miss-track`,children:(0,y.jsx)(`div`,{className:`dd-miss-fill`,style:{width:`${r}%`,background:Xe(r)}})}),(0,y.jsxs)(`span`,{className:`dd-miss-pct tab-num`,children:[r%1==0?r:r.toFixed(1),`%`]})]})})]},`${e.name}-${t}`)})]})}),d&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(d)})]})}function $e(e,t,n){return t===`better`||t===`worse`?t:e==null||e===0?`flat`:e>0===n?`better`:`worse`}function et(e){return Number.isFinite(e)?e.toLocaleString(void 0,{maximumFractionDigits:3}):`—`}function tt(e){return e==null||!Number.isFinite(e)||e===0?`±0`:`${e>0?`+`:`−`}${Math.abs(e).toLocaleString(void 0,{maximumFractionDigits:3})}`}function nt({title:e,icon:t=`sliders`,iconColor:n=`var(--presence)`,baseline:r,baselineValue:o,metric:s,rows:c,higherBetter:u=!0,footer:d,delay:f}){let p=i[t]||i.sliders,m=(Array.isArray(c)?c:[]).filter(e=>e&&typeof e.removed==`string`&&e.removed.trim().length>0&&Number.isFinite(e.value)),h=typeof r==`string`&&r.trim().length>0,g=Number.isFinite(o)?o:null;return!h&&m.length===0?(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(f||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(l,{message:`No ablation results to compare`})]}):(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(f||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),s&&(0,y.jsx)(`div`,{className:`abl-cap`,children:s}),(0,y.jsxs)(`div`,{className:`abl-list`,children:[h&&(0,y.jsxs)(`div`,{className:`abl-row abl-baseline`,children:[(0,y.jsx)(`span`,{className:`abl-name`,children:r}),(0,y.jsx)(`span`,{className:`abl-val tab-num`,children:g==null?`—`:et(g)}),(0,y.jsx)(`span`,{className:`abl-delta flat`,children:`baseline`})]}),m.map((e,t)=>{let n=Number.isFinite(e.delta)?e.delta:g==null?null:e.value-g,r=$e(n,e.deltaDirection,u);return(0,y.jsxs)(`div`,{className:`abl-row m-stagger-item m-fade-rise`,style:{"--i":t+1},children:[(0,y.jsxs)(`span`,{className:`abl-name`,children:[`w/o `,e.removed]}),(0,y.jsx)(`span`,{className:`abl-val tab-num`,children:et(e.value)}),(0,y.jsx)(`span`,{className:`abl-delta ${r}`,children:tt(n)})]},t)})]}),d&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(d)})]})}var rt={"nmr-1h":{name:`¹H NMR`,xHeader:`δ (ppm)`,xDecimals:2,showMultInteg:!0,intensityLabel:`Intensity`,assignLabel:`Assignment`,domain:[0,12],descending:!0},"nmr-13c":{name:`¹³C NMR`,xHeader:`δ (ppm)`,xDecimals:1,showMultInteg:!0,intensityLabel:`Intensity`,assignLabel:`Assignment`,domain:[0,220],descending:!0},ir:{name:`IR`,xHeader:`cm⁻¹`,xDecimals:0,showMultInteg:!1,intensityLabel:`Intensity`,assignLabel:`Functional group`,domain:[400,4e3],descending:!0},ms:{name:`MS`,xHeader:`m/z`,xDecimals:0,showMultInteg:!1,intensityLabel:`Rel. abundance`,assignLabel:`Fragment`,domain:[0,100],descending:!1}};function it(e){return e===`nmr-1h`||e===`nmr-13c`||e===`ir`||e===`ms`?e:`nmr-1h`}function K(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function q(e,t){return Number.isFinite(e)?e.toFixed(t):`—`}function J(e){return Math.max(0,Math.min(100,e))}function at({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,technique:r,compound:o,solvent:s,peaks:c,footer:u,delay:d}){let f=i[t]||i.chart,p=rt[it(r)],m=(Array.isArray(c)?c:[]).filter(e=>K(e?.x)!=null),h=[...m].sort((e,t)=>p.descending?t.x-e.x:e.x-t.x),g=m.map(e=>e.x),_=g.length?Math.min(p.domain[0],...g):p.domain[0],v=g.length?Math.max(p.domain[1],...g):p.domain[1],b=v-_||1,x=[p.name,o,s].filter(e=>typeof e==`string`&&e.length>0),S=p.showMultInteg?`minmax(64px, 0.7fr) minmax(56px, 0.55fr) minmax(56px, 0.55fr) minmax(120px, 2fr)`:`minmax(72px, 0.7fr) minmax(110px, 1.1fr) minmax(120px, 2fr)`;return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(d||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),(0,y.jsx)(`div`,{className:`spt-cap`,children:x.join(` · `)}),h.length===0?(0,y.jsx)(l,{message:`No peaks to show`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`spt-axis`,role:`img`,"aria-label":`${p.name} axis from ${q(p.descending?v:_,0)} to ${q(p.descending?_:v,0)} ${p.xHeader}`,children:[(0,y.jsx)(`div`,{className:`spt-axis-line`}),h.map((e,t)=>{let n=(e.x-_)/b,r=J((p.descending?1-n:n)*100);return(0,y.jsx)(`div`,{className:`spt-tick`,style:{left:`${r}%`}},t)}),(0,y.jsx)(`span`,{className:`spt-axis-end spt-axis-lo`,children:q(p.descending?v:_,0)}),(0,y.jsx)(`span`,{className:`spt-axis-end spt-axis-hi`,children:q(p.descending?_:v,0)})]}),(0,y.jsx)(`div`,{className:`spt-scroll`,children:(0,y.jsxs)(`div`,{className:`spt-grid`,style:{gridTemplateColumns:S},role:`grid`,children:[(0,y.jsx)(`div`,{className:`spt-colh`,role:`columnheader`,children:p.xHeader}),p.showMultInteg?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`div`,{className:`spt-colh`,role:`columnheader`,children:`Mult.`}),(0,y.jsx)(`div`,{className:`spt-colh`,role:`columnheader`,children:`Integ.`})]}):(0,y.jsx)(`div`,{className:`spt-colh`,role:`columnheader`,children:p.intensityLabel}),(0,y.jsx)(`div`,{className:`spt-colh spt-colh-assign`,role:`columnheader`,children:p.assignLabel}),h.map((e,t)=>{let n=K(e.integration),i=K(e.intensity);return(0,y.jsxs)(`div`,{className:`spt-row m-stagger-item m-fade-rise`,style:{"--i":t},role:`row`,children:[(0,y.jsx)(`div`,{className:`spt-x tab-num`,role:`gridcell`,children:q(e.x,p.xDecimals)}),p.showMultInteg?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`div`,{className:`spt-mult`,role:`gridcell`,children:e.multiplicity||`—`}),(0,y.jsx)(`div`,{className:`spt-integ tab-num`,role:`gridcell`,children:n==null?`—`:`${n}${it(r)===`nmr-1h`?`H`:``}`})]}):(0,y.jsx)(`div`,{className:`spt-intensity`,role:`gridcell`,children:i==null?(0,y.jsx)(`span`,{className:`spt-dash`,children:`—`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`div`,{className:`spt-int-track`,children:(0,y.jsx)(`div`,{className:`spt-int-fill`,style:{width:`${J(i)}%`}})}),(0,y.jsxs)(`span`,{className:`spt-int-pct tab-num`,children:[Math.round(J(i)),`%`]})]})}),(0,y.jsx)(`div`,{className:`spt-assign`,role:`gridcell`,children:e.assignment||`—`})]},t)})]})})]}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}function Y(e){let t=typeof e==`number`?e:parseFloat(String(e??``));return Number.isFinite(t)?Math.max(1,Math.min(10,Math.round(t))):1}function ot(e){return e>=7?`var(--danger)`:e>=4?`var(--warning)`:`var(--insight)`}function st(e){return e>=200?`var(--danger)`:e>=80?`var(--warning)`:`var(--insight)`}function ct(e){let t=(0,M.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,y.jsx)(`div`,{className:`fma-meta`,children:n}),t[0]=n,t[1]=r),r}function lt({title:e,icon:t=`alert`,iconColor:n=`var(--warning)`,items:r,footer:o,delay:s}){let c=i[t]||i.alert,u=(Array.isArray(r)?r:[]).filter(e=>e&&typeof e.failureMode==`string`&&e.failureMode.trim().length>0).map(e=>{let t=Y(e.severity),n=Y(e.occurrence),r=Y(e.detection);return{item:e,severity:t,occurrence:n,detection:r,rpn:t*n*r}}).sort((e,t)=>t.rpn-e.rpn),d=Math.min(3,u.length);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(s||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(c,{className:`ic`,style:{color:n}}),` `,e]}),u.length===0?(0,y.jsx)(l,{message:`No failure modes to analyze`}):(0,y.jsx)(`div`,{className:`fma-list`,children:u.flatMap((e,t)=>{let n=Math.max(0,Math.min(100,e.rpn/1e3*100)),r=(0,y.jsxs)(`div`,{className:`fma-row m-stagger-item m-fade-rise`,style:{"--i":t},children:[(0,y.jsxs)(`div`,{className:`fma-top`,children:[(0,y.jsxs)(`div`,{className:`fma-name`,children:[(0,y.jsx)(`span`,{className:`fma-mode`,children:e.item.failureMode}),e.item.owner&&(0,y.jsx)(`span`,{className:`fma-owner`,children:e.item.owner})]}),(0,y.jsxs)(`div`,{className:`fma-sod`,children:[(0,y.jsxs)(`span`,{className:`fma-badge`,style:{"--fma-c":ot(e.severity)},title:`Severity`,children:[`S `,e.severity]}),(0,y.jsxs)(`span`,{className:`fma-badge`,style:{"--fma-c":ot(e.occurrence)},title:`Occurrence`,children:[`O `,e.occurrence]}),(0,y.jsxs)(`span`,{className:`fma-badge`,style:{"--fma-c":ot(e.detection)},title:`Detection`,children:[`D `,e.detection]})]}),(0,y.jsxs)(`div`,{className:`fma-rpn-wrap`,children:[(0,y.jsx)(`span`,{className:`fma-rpn tab-num`,style:{"--fma-rc":st(e.rpn)},children:e.rpn}),(0,y.jsx)(`span`,{className:`fma-rpn-label`,children:`RPN`})]})]}),(e.item.cause||e.item.effect)&&(0,y.jsxs)(ct,{children:[e.item.cause&&(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`b`,{children:`Cause`}),` `,e.item.cause]}),e.item.effect&&(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`b`,{children:`Effect`}),` `,e.item.effect]})]}),(0,y.jsx)(`div`,{className:`fma-track`,children:(0,y.jsx)(`div`,{className:`fma-fill`,style:{width:`${n}%`,background:st(e.rpn)}})}),(e.item.currentControl||e.item.action)&&(0,y.jsxs)(ct,{children:[e.item.currentControl&&(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`b`,{children:`Control`}),` `,e.item.currentControl]}),e.item.action&&(0,y.jsxs)(`span`,{className:`fma-action`,children:[(0,y.jsx)(`b`,{children:`Action`}),` `,e.item.action]})]})]},t);return t===d-1&&d<u.length?[r,(0,y.jsx)(`div`,{className:`fma-priority-rule`},`rule-${t}`)]:[r]})}),o&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}function ut(e,t){return s(e,{currency:t,decimals:2})}function dt(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function ft({title:e,icon:t=`layers`,iconColor:n=`var(--presence)`,rows:r,currency:o=`USD`,footer:s,delay:c}){let u=i[t]||i.layers,d=(Array.isArray(r)?r:[]).filter(e=>e&&typeof e.label==`string`&&e.label.trim().length>0).map(e=>{let t=Math.max(0,Math.round(e.indent||0)),n=e.kind===`subassembly`||e.kind===`total`?e.kind:`part`,r=dt(e.qty),i=dt(e.unitCost);return{row:e,indent:t,kind:n,qty:r,unitCost:i,extended:n===`part`&&i!=null?(r??1)*i:null}}),f=Array(d.length).fill(0),p=[];for(let e=d.length-1;e>=0;e--){let t=d[e],n=0;for(;p.length>0&&p[p.length-1].indent>t.indent;)n+=p.pop().subtotal;f[e]=n,t.kind===`part`&&t.extended!=null&&(n+=t.extended),p.push({indent:t.indent,subtotal:n})}let m=d.filter(e=>e.kind===`part`&&e.extended!=null).reduce((e,t)=>e+t.extended,0);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(c||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),d.length===0?(0,y.jsx)(l,{message:`No parts to list`}):(0,y.jsx)(`div`,{className:`bom-scroll`,children:(0,y.jsxs)(`table`,{className:`bom-tbl`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`bom-h-label`,children:`Item`}),(0,y.jsx)(`th`,{className:`bom-h-part`,children:`Part #`}),(0,y.jsx)(`th`,{className:`bom-h-num`,children:`Qty`}),(0,y.jsx)(`th`,{className:`bom-h-num`,children:`Unit cost`}),(0,y.jsx)(`th`,{className:`bom-h-num`,children:`Ext. cost`})]})}),(0,y.jsx)(`tbody`,{children:d.map((e,t)=>{let n=e.kind===`part`?e.extended:e.kind===`subassembly`?f[t]:m;return(0,y.jsxs)(`tr`,{className:`bom-row bom-${e.kind}`,children:[(0,y.jsx)(`td`,{className:`bom-label`,style:{paddingLeft:2+e.indent*14},children:e.row.label}),(0,y.jsx)(`td`,{className:`bom-part tab-num`,children:e.kind===`part`&&e.row.partNo?e.row.partNo:`—`}),(0,y.jsx)(`td`,{className:`bom-num tab-num`,children:e.kind===`part`&&e.qty!=null?e.qty:`—`}),(0,y.jsx)(`td`,{className:`bom-num tab-num`,children:e.kind===`part`&&e.unitCost!=null?ut(e.unitCost,o):`—`}),(0,y.jsx)(`td`,{className:`bom-num bom-ext tab-num`,children:n==null?`—`:ut(n,o)})]},t)})})]})}),s&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(s)})]})}function pt({title:e,icon:t=`clock`,iconColor:n=`var(--presence)`,approaches:r,footer:o,delay:s}){let c=i[t]||i.clock,u=(Array.isArray(r)?r:[]).filter(e=>e&&typeof e.name==`string`&&e.name.trim().length>0);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(s||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(c,{className:`ic`,style:{color:n}}),` `,e]}),u.length===0?(0,y.jsx)(l,{message:`No approaches to compare`}):(0,y.jsx)(`div`,{className:`cxs-scroll`,children:(0,y.jsxs)(`div`,{className:`cxs-grid`,role:`grid`,"aria-label":e,children:[(0,y.jsx)(`div`,{className:`cxs-colh`,role:`columnheader`,children:`Approach`}),(0,y.jsx)(`div`,{className:`cxs-colh`,role:`columnheader`,children:`Time`}),(0,y.jsx)(`div`,{className:`cxs-colh`,role:`columnheader`,children:`Space`}),(0,y.jsx)(`div`,{className:`cxs-colh cxs-colh-notes`,role:`columnheader`,children:`Notes`}),u.map((e,t)=>(0,y.jsxs)(`div`,{className:`cxs-row m-stagger-item m-fade-rise`,style:{"--i":t},role:`row`,children:[(0,y.jsx)(`div`,{className:`cxs-name`,role:`gridcell`,title:e.name,children:e.name}),(0,y.jsx)(`div`,{className:`cxs-complexity tab-num`,role:`gridcell`,children:e.timeComplexity||`—`}),(0,y.jsx)(`div`,{className:`cxs-complexity tab-num`,role:`gridcell`,children:e.spaceComplexity||`—`}),(0,y.jsx)(`div`,{className:`cxs-notes`,role:`gridcell`,children:e.notes||`—`})]},`${e.name}-${t}`))]})}),o&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}var mt=[-1,-.5,0,.5,1];function X(e){if(!Number.isFinite(e))return`0.0`;let t=Math.round(e*10)/10;return t===0?`0.0`:`${t>0?`+`:`−`}${Math.abs(t).toFixed(1)}`}function ht(e){return e===0?`transparent`:`color-mix(in oklab, ${e>0?`var(--danger)`:`var(--presence)`} ${(Math.abs(e)*88).toFixed(1)}%, transparent)`}function gt({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,genes:r,samples:o,values:s,scaleLabel:c=`log2 fold-change`,footer:u,delay:d}){let f=i[t]||i.table,[p,h]=(0,m.useState)(null),g=Array.isArray(r)?r:[],_=Array.isArray(o)?o:[],v=g.map((e,t)=>{let n=Array.isArray(s)?s[t]:void 0;return _.map((e,t)=>{let r=Array.isArray(n)?n[t]:void 0;return typeof r==`number`&&Number.isFinite(r)?r:0})}),b=Math.max(1e-9,...v.flat().map(e=>Math.abs(e))),x=e=>Math.max(-1,Math.min(1,e/b));return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(d||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),g.length===0||_.length===0?(0,y.jsx)(l,{message:`Needs at least one gene and one sample to plot`}):(0,y.jsxs)(`div`,{className:`eh-wrap`,children:[(0,y.jsxs)(`div`,{className:`eh-grid`,style:{gridTemplateColumns:`minmax(0, auto) repeat(${_.length}, minmax(0, var(--eh-cell)))`},children:[(0,y.jsx)(`span`,{className:`eh-corner`}),_.map((e,t)=>(0,y.jsx)(`span`,{className:`eh-colh ${p?.c===t?`on`:``}`,title:e,children:e},t)),g.map((e,t)=>(0,y.jsx)(_t,{ri:t,label:e,vals:v[t],colCount:_.length,norm:x,hover:p,setHover:h},t))]}),(0,y.jsxs)(`div`,{className:`eh-legend`,children:[(0,y.jsx)(`span`,{className:`faint tab-num`,children:X(-b)}),mt.map(e=>(0,y.jsx)(`span`,{className:`eh-swatch`,style:{background:ht(e)}},e)),(0,y.jsx)(`span`,{className:`faint tab-num`,children:X(b)}),(0,y.jsx)(`span`,{className:`eh-scale-label faint`,children:c})]})]}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}function _t(e){let t=(0,M.c)(15),{ri:n,label:r,vals:i,colCount:a,norm:o,hover:s,setHover:c}=e,l=`eh-rowh ${s?.r===n?`on`:``}`,u;t[0]!==r||t[1]!==l?(u=(0,y.jsx)(`span`,{className:l,title:r,children:r}),t[0]=r,t[1]=l,t[2]=u):u=t[2];let d;t[3]===a?d=t[4]:(d=Array.from({length:a}),t[3]=a,t[4]=d);let f;t[5]!==s||t[6]!==o||t[7]!==n||t[8]!==c||t[9]!==d||t[10]!==i?(f=d.map((e,t)=>{let r=i[t]??0,a=o(r),l=s?.r===n&&s?.c===t,u=s&&(s.r===n||s.c===t);return(0,y.jsxs)(`div`,{className:`eh-cell ${l?`hot`:``} ${u&&!l?`cross`:``}`,style:{background:ht(a),color:Math.abs(a)>.55?`var(--surface-deep)`:`var(--text-secondary)`},onMouseEnter:()=>c({r:n,c:t}),onMouseLeave:()=>c(null),children:[(0,y.jsx)(`span`,{className:`eh-v tab-num`,children:X(r)}),l&&(0,y.jsx)(`span`,{className:`eh-tip tab-num`,children:X(r)})]},t)}),t[5]=s,t[6]=o,t[7]=n,t[8]=c,t[9]=d,t[10]=i,t[11]=f):f=t[11];let p;return t[12]!==u||t[13]!==f?(p=(0,y.jsxs)(y.Fragment,{children:[u,f]}),t[12]=u,t[13]=f,t[14]=p):p=t[14],p}var vt=new Set([`outstanding`,`produced`,`objected`,`privileged`]),yt={outstanding:`var(--warning)`,produced:`var(--insight)`,objected:`var(--danger)`,privileged:`var(--presence)`},bt={outstanding:`Outstanding`,produced:`Produced`,objected:`Objected`,privileged:`Privileged`},xt=[`outstanding`,`produced`,`objected`,`privileged`];function St(e){return typeof e==`string`&&vt.has(e)?e:`outstanding`}function Ct(e,t){let n=Date.parse(e),r=Date.parse(t);return Number.isFinite(n)&&Number.isFinite(r)?n-r:Number.isFinite(n)?-1:Number.isFinite(r)?1:e.localeCompare(t)}function wt({title:e,icon:t=`doc`,iconColor:n=`var(--presence)`,requests:r,footer:o,delay:s}){let c=i[t]||i.doc,[u,d]=(0,m.useState)(`all`),[f,p]=(0,m.useState)(`num`),[h,g]=(0,m.useState)(`asc`),_=(Array.isArray(r)?r:[]).filter(e=>typeof e?.description==`string`&&e.description.trim().length>0).map((e,t)=>({req:e,num:typeof e.num==`number`&&Number.isFinite(e.num)?e.num:t+1,party:typeof e.requestingParty==`string`&&e.requestingParty.trim()?e.requestingParty:`Unspecified`,status:St(e.status)})),v=(0,m.useMemo)(()=>{let e={outstanding:0,produced:0,objected:0,privileged:0};for(let t of _)e[t.status]++;return e},[_]),b=u===`all`?_:_.filter(e=>e.status===u),x=(0,m.useMemo)(()=>{let e=h===`asc`?1:-1;return[...b].sort((t,n)=>{switch(f){case`num`:return(t.num-n.num)*e;case`party`:return t.party.localeCompare(n.party)*e;case`status`:return(xt.indexOf(t.status)-xt.indexOf(n.status))*e;case`due`:return Ct(t.req.dueDate||``,n.req.dueDate||``)*e}})},[b,f,h]),S=e=>{e===f?g(e=>e===`asc`?`desc`:`asc`):(p(e),g(`asc`))},C=({label:e,sk:t})=>(0,y.jsx)(`th`,{className:`dtr-th`,children:(0,y.jsxs)(`button`,{type:`button`,className:`dtr-th-btn`,onClick:()=>S(t),children:[e,f===t&&(0,y.jsx)(`span`,{className:`dtr-th-arrow`,children:h===`asc`?`↑`:`↓`})]})});return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(s||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(c,{className:`ic`,style:{color:n}}),` `,e]}),_.length===0?(0,y.jsx)(l,{message:`No discovery requests logged`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`dtr-chips`,role:`tablist`,children:[(0,y.jsxs)(`button`,{type:`button`,className:`dtr-chip ${u===`all`?`on`:``}`,onClick:()=>d(`all`),children:[`All `,(0,y.jsx)(`span`,{className:`dtr-count`,children:_.length})]}),xt.map(e=>(0,y.jsxs)(`button`,{type:`button`,className:`dtr-chip ${u===e?`on`:``}`,style:{"--dtr-c":yt[e]},onClick:()=>d(e),children:[bt[e],` `,(0,y.jsx)(`span`,{className:`dtr-count`,children:v[e]})]},e))]}),(0,y.jsx)(`div`,{className:`dtr-scroll`,children:(0,y.jsxs)(`table`,{className:`dtr-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(C,{label:`#`,sk:`num`}),(0,y.jsx)(`th`,{className:`dtr-th dtr-th-desc`,children:`Description`}),(0,y.jsx)(C,{label:`Requesting party`,sk:`party`}),(0,y.jsx)(C,{label:`Status`,sk:`status`}),(0,y.jsx)(`th`,{className:`dtr-th`,children:`Bates`}),(0,y.jsx)(C,{label:`Due`,sk:`due`})]})}),(0,y.jsx)(`tbody`,{children:x.map((e,t)=>(0,y.jsxs)(`tr`,{className:`dtr-row m-stagger-item m-fade-rise`,children:[(0,y.jsx)(`td`,{className:`dtr-num tab-num`,children:e.num}),(0,y.jsx)(`td`,{className:`dtr-desc`,children:e.req.description}),(0,y.jsx)(`td`,{className:`dtr-party`,children:e.party}),(0,y.jsxs)(`td`,{children:[(0,y.jsx)(`span`,{className:`dtr-status`,style:{"--dtr-c":yt[e.status]},children:bt[e.status]}),e.status===`privileged`&&e.req.privilegeBasis&&(0,y.jsx)(`div`,{className:`dtr-priv-note`,children:e.req.privilegeBasis})]}),(0,y.jsx)(`td`,{className:`dtr-bates`,children:e.req.batesRange||`—`}),(0,y.jsx)(`td`,{className:`dtr-due`,children:e.req.dueDate||`—`})]},`${e.num}-${t}`))})]})})]}),o&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}var Tt=new Set([`urgent`,`recommended`,`elective`]),Et={urgent:`var(--danger)`,recommended:`var(--warning)`,elective:`var(--insight)`};function Dt(e){return typeof e==`string`&&Tt.has(e)?e:`recommended`}function Ot(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function kt(e){return e?/complet|done/i.test(e)?`var(--insight)`:/progress|underway|started/i.test(e)?`var(--warning)`:`var(--text-muted)`:`var(--text-muted)`}var At=`Unscheduled`;function jt({title:e,icon:t=`shield`,iconColor:n=`var(--presence)`,entries:r,footer:o,delay:c}){let u=i[t]||i.shield,d=(Array.isArray(r)?r:[]).filter(e=>typeof e?.procedure==`string`&&e.procedure.trim().length>0).map(e=>({entry:e,priority:Dt(e.priority),cost:Ot(e.cost),visit:typeof e.visit==`string`&&e.visit.trim()?e.visit:At})),f=(0,m.useMemo)(()=>{let e=[],t=new Map;for(let n of d)t.has(n.visit)||(t.set(n.visit,[]),e.push(n.visit)),t.get(n.visit).push(n);return e.map(e=>({visit:e,rows:t.get(e),subtotal:t.get(e).reduce((e,t)=>e+(t.cost??0),0)}))},[d]),p=d.reduce((e,t)=>e+(t.cost??0),0),h=0;return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(c||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),d.length===0?(0,y.jsx)(l,{message:`No treatment entries planned`}):(0,y.jsx)(`div`,{className:`dtp-scroll`,children:(0,y.jsxs)(`table`,{className:`dtp-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`dtp-th`,children:`Tooth`}),(0,y.jsx)(`th`,{className:`dtp-th dtp-th-proc`,children:`Procedure`}),(0,y.jsx)(`th`,{className:`dtp-th`,children:`Priority`}),(0,y.jsx)(`th`,{className:`dtp-th`,children:`Status`}),(0,y.jsx)(`th`,{className:`dtp-th dtp-th-num`,children:`Cost`})]})}),(0,y.jsx)(`tbody`,{children:f.map(e=>(0,y.jsxs)(m.Fragment,{children:[(0,y.jsxs)(`tr`,{className:`dtp-visit-row`,children:[(0,y.jsx)(`td`,{className:`dtp-visit-head`,colSpan:4,children:e.visit}),(0,y.jsx)(`td`,{className:`dtp-visit-subtotal tab-num`,children:s(e.subtotal,{currency:`USD`,decimals:0})})]}),e.rows.map(t=>{let n=h++;return(0,y.jsxs)(`tr`,{className:`dtp-row m-stagger-item m-fade-rise`,style:{"--i":n},children:[(0,y.jsx)(`td`,{className:`dtp-tooth`,children:t.entry.tooth||`—`}),(0,y.jsxs)(`td`,{className:`dtp-proc`,children:[t.entry.procedure,t.entry.surface&&(0,y.jsxs)(`span`,{className:`dtp-surface`,children:[` · `,t.entry.surface]})]}),(0,y.jsx)(`td`,{children:(0,y.jsx)(`span`,{className:`dtp-priority`,style:{"--dtp-c":Et[t.priority]},children:t.priority})}),(0,y.jsx)(`td`,{children:(0,y.jsx)(`span`,{className:`dtp-status`,style:{"--dtp-c":kt(t.entry.status)},children:t.entry.status||`—`})}),(0,y.jsx)(`td`,{className:`dtp-num tab-num`,children:t.cost==null?`—`:s(t.cost,{currency:`USD`,decimals:0})})]},`${e.visit}-${n}`)})]},e.visit))}),(0,y.jsx)(`tfoot`,{children:(0,y.jsxs)(`tr`,{className:`dtp-total-row`,children:[(0,y.jsx)(`td`,{className:`dtp-total-label`,colSpan:4,children:`Total plan cost`}),(0,y.jsx)(`td`,{className:`dtp-total-val tab-num`,children:s(p,{currency:`USD`,decimals:0})})]})})]})}),o&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}var Mt=new Set([`yea`,`nay`,`present`,`absent`]),Nt={yea:`var(--insight)`,nay:`var(--danger)`,present:`var(--warning)`,absent:`var(--text-muted)`},Pt={yea:`✓`,nay:`✕`,present:`•`,absent:`–`},Z={yea:`Yea`,nay:`Nay`,present:`Present`,absent:`Absent`},Ft=[`yea`,`nay`,`present`,`absent`];function It(e){return typeof e==`string`&&Mt.has(e)?e:`absent`}var Lt=[`var(--presence)`,`var(--presence-deep)`,`var(--insight-soft)`,`var(--warning-soft)`,`var(--presence-soft)`];function Rt(e){if(!e)return`var(--text-muted)`;let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)>>>0;return Lt[t%Lt.length]}function zt({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,bill:r,legislators:o,footer:s,delay:c}){let u=i[t]||i.chart,d=(Array.isArray(o)?o:[]).filter(e=>typeof e?.name==`string`&&e.name.trim().length>0).map(e=>({leg:e,name:e.name,party:typeof e.party==`string`?e.party.trim():``,vote:It(e.vote)})),f=(0,m.useMemo)(()=>{let e={yea:0,nay:0,present:0,absent:0};for(let t of d)e[t.vote]++;return e},[d]),p=Math.max(1,d.length);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(c||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),r&&(0,y.jsx)(`div`,{className:`rc-bill`,children:r}),d.length===0?(0,y.jsx)(l,{message:`No votes recorded`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`rc-tally`,children:[(0,y.jsx)(`div`,{className:`rc-tally-bar`,children:Ft.filter(e=>f[e]>0).map(e=>(0,y.jsx)(`div`,{className:`rc-tally-seg`,style:{width:`${f[e]/p*100}%`,background:Nt[e]},title:`${Z[e]}: ${f[e]}`},e))}),(0,y.jsx)(`div`,{className:`rc-tally-labels`,children:Ft.map(e=>(0,y.jsxs)(`span`,{className:`rc-tally-label`,style:{"--rc-c":Nt[e]},children:[(0,y.jsx)(`span`,{className:`rc-tally-dot`}),` `,f[e],` `,Z[e]]},e))})]}),(0,y.jsx)(`div`,{className:`rc-scroll`,children:(0,y.jsxs)(`table`,{className:`rc-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`rc-th`,children:`Legislator`}),(0,y.jsx)(`th`,{className:`rc-th`,children:`Party`}),(0,y.jsx)(`th`,{className:`rc-th rc-th-vote`,children:`Vote`})]})}),(0,y.jsx)(`tbody`,{children:d.map((e,t)=>(0,y.jsxs)(`tr`,{className:`rc-row m-stagger-item m-fade-rise`,style:{"--i":t,"--rc-party":Rt(e.party)},children:[(0,y.jsx)(`td`,{className:`rc-name`,children:e.name}),(0,y.jsx)(`td`,{className:`rc-party`,children:e.party||`—`}),(0,y.jsx)(`td`,{className:`rc-vote-cell`,children:(0,y.jsxs)(`span`,{className:`rc-vote`,style:{"--rc-c":Nt[e.vote]},children:[(0,y.jsx)(`span`,{className:`rc-vote-glyph`,children:Pt[e.vote]}),Z[e.vote]]})})]},`${e.name}-${t}`))})]})})]}),s&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(s)})]})}var Bt=new Set([`mint`,`good`,`fair`]),Vt={mint:`var(--insight)`,good:`var(--presence)`,fair:`var(--warning)`};function Ht(e){return typeof e==`string`&&Bt.has(e)?e:null}function Ut(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function Wt({title:e,icon:t=`layers`,iconColor:n=`var(--presence)`,items:r,footer:o,delay:c}){let u=i[t]||i.layers,d=(Array.isArray(r)?r:[]).filter(e=>typeof e?.name==`string`&&e.name.trim().length>0),f=d.reduce((e,t)=>e+(Ut(t.value)??0),0),p=d.filter(e=>Ut(e.value)!=null).length;return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(c||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),d.length===0?(0,y.jsx)(l,{message:`No items in this collection yet`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`ctk-summary`,children:[(0,y.jsxs)(`div`,{className:`ctk-summary-stat`,children:[(0,y.jsx)(`span`,{className:`ctk-summary-val tab-num`,children:d.length}),(0,y.jsx)(`span`,{className:`ctk-summary-label`,children:d.length===1?`item`:`items`})]}),p>0&&(0,y.jsxs)(`div`,{className:`ctk-summary-stat`,children:[(0,y.jsx)(`span`,{className:`ctk-summary-val ctk-summary-total tab-num`,children:s(f,{currency:`USD`,decimals:0})}),(0,y.jsx)(`span`,{className:`ctk-summary-label`,children:`estimated value`})]})]}),(0,y.jsx)(`div`,{className:`ctk-grid`,children:d.map((e,t)=>{let n=Ht(e.condition),r=Ut(e.value);return(0,y.jsxs)(`div`,{className:`ctk-card m-stagger-item m-scale-in`,style:{"--i":t},children:[(0,y.jsxs)(`div`,{className:`ctk-card-top`,children:[(0,y.jsx)(`span`,{className:`ctk-name`,title:e.name,children:e.name}),n&&(0,y.jsx)(`span`,{className:`ctk-condition`,style:{"--ctk-c":Vt[n]},children:n})]}),e.acquiredDate&&(0,y.jsx)(`div`,{className:`ctk-date`,children:e.acquiredDate}),r!=null&&(0,y.jsx)(`div`,{className:`ctk-value tab-num`,children:s(r,{currency:`USD`,decimals:0})}),e.notes&&(0,y.jsx)(`div`,{className:`ctk-notes`,children:e.notes})]},`${e.name}-${t}`)})})]}),o&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}function Q(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function Gt(e){let t=s(Math.abs(e),{currency:`USD`,decimals:0});return e<0?`(${t})`:e>0?`+${t}`:t}function Kt({title:e,icon:t=`chart`,iconColor:n=`var(--presence)`,subject:r,comps:o,suggestedListPrice:c,footer:u,delay:d}){let f=i[t]||i.chart,p=r&&typeof r==`object`?r:{},m=Q(p.beds),h=Q(p.baths),g=Q(p.sqft),_=Q(p.yearBuilt),v=(Array.isArray(o)?o:[]).filter(e=>typeof e?.address==`string`&&e.address.trim().length>0).map(e=>{let t=Q(e.soldPrice),n=(Array.isArray(e.adjustments)?e.adjustments:[]).filter(e=>typeof e?.label==`string`&&e.label.trim().length>0).map(e=>({adj:e,amount:Q(e.amount)})),r=n.reduce((e,t)=>e+(t.amount??0),0);return{comp:e,soldPrice:t,sqft:Q(e.sqft),distance:Q(e.distance),adjustments:n,adjustedPrice:t==null?null:t+r}}),b=c&&typeof c==`object`?c:{},x=Q(b.low),S=Q(b.high),C=Q(b.point),w=[{label:`Beds`,value:m==null?`—`:String(m)},{label:`Baths`,value:h==null?`—`:String(h)},{label:`Sqft`,value:g==null?`—`:s(g)},{label:`Year built`,value:_==null?`—`:String(_)}];return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(d||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(f,{className:`ic`,style:{color:n}}),` `,e]}),typeof p.address==`string`&&p.address&&(0,y.jsx)(`div`,{className:`cma-subject-addr`,children:p.address}),(0,y.jsx)(`div`,{className:`cma-summary`,children:w.map(e=>(0,y.jsxs)(`div`,{className:`cma-field`,children:[(0,y.jsx)(`span`,{className:`cma-field-label`,children:e.label}),(0,y.jsx)(`span`,{className:`cma-field-value`,children:e.value})]},e.label))}),v.length===0?(0,y.jsx)(l,{message:`No comparable sales to show`}):(0,y.jsx)(`div`,{className:`cma-scroll`,children:(0,y.jsxs)(`table`,{className:`cma-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`cma-th cma-th-addr`,children:`Comparable`}),(0,y.jsx)(`th`,{className:`cma-th cma-th-num`,children:`Sold price`}),(0,y.jsx)(`th`,{className:`cma-th`,children:`Sold date`}),(0,y.jsx)(`th`,{className:`cma-th cma-th-num`,children:`Sqft`}),(0,y.jsx)(`th`,{className:`cma-th cma-th-num`,children:`Dist.`}),(0,y.jsx)(`th`,{className:`cma-th`,children:`Adjustments`}),(0,y.jsx)(`th`,{className:`cma-th cma-th-num`,children:`Adjusted price`})]})}),(0,y.jsx)(`tbody`,{children:v.map((e,t)=>(0,y.jsxs)(`tr`,{className:`cma-row m-stagger-item m-fade-rise`,children:[(0,y.jsx)(`td`,{className:`cma-addr`,children:e.comp.address}),(0,y.jsx)(`td`,{className:`cma-num tab-num`,children:e.soldPrice==null?`—`:s(e.soldPrice,{currency:`USD`,decimals:0})}),(0,y.jsx)(`td`,{className:`cma-date`,children:e.comp.soldDate||`—`}),(0,y.jsx)(`td`,{className:`cma-num tab-num`,children:e.sqft==null?`—`:s(e.sqft)}),(0,y.jsx)(`td`,{className:`cma-num tab-num`,children:e.distance==null?`—`:`${s(e.distance,{decimals:1})} mi`}),(0,y.jsx)(`td`,{className:`cma-adj`,children:e.adjustments.length===0?(0,y.jsx)(`span`,{className:`cma-adj-none`,children:`—`}):(0,y.jsx)(`ul`,{className:`cma-adj-list`,children:e.adjustments.map((e,t)=>(0,y.jsxs)(`li`,{className:`cma-adj-item`,children:[(0,y.jsx)(`span`,{className:`cma-adj-label`,children:e.adj.label}),e.amount!=null&&e.amount!==0&&(0,y.jsx)(`span`,{className:`cma-adj-amt tab-num ${e.amount<0?`neg`:`pos`}`,children:Gt(e.amount)})]},t))})}),(0,y.jsx)(`td`,{className:`cma-num cma-adjusted tab-num`,children:e.adjustedPrice==null?`—`:s(e.adjustedPrice,{currency:`USD`,decimals:0})})]},`${e.comp.address}-${t}`))})]})}),(0,y.jsxs)(`div`,{className:`cma-banner`,children:[(0,y.jsx)(`span`,{className:`cma-banner-label`,children:`Suggested list price`}),x!=null&&S!=null?(0,y.jsxs)(`span`,{className:`cma-banner-value tab-num`,children:[s(x,{currency:`USD`,decimals:0}),` – `,s(S,{currency:`USD`,decimals:0}),C!=null&&(0,y.jsxs)(`span`,{className:`cma-banner-point`,children:[` `,`· point `,s(C,{currency:`USD`,decimals:0})]})]}):(0,y.jsx)(`span`,{className:`cma-banner-value cma-banner-empty`,children:`Not yet estimated`})]}),u&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(u)})]})}function qt(e){let t=s(Math.abs(e),{currency:`USD`,decimals:0});return e<0?`(${t})`:t}function Jt(e){return typeof e==`number`&&Number.isFinite(e)?e:0}function Yt(e){return e===`subtotal`||e===`total`?e:`line`}var Xt=new Set([`refund`,`owed`]);function Zt(e){return typeof e==`string`&&Xt.has(e)?e:`owed`}function Qt({title:e,icon:t=`doc`,iconColor:n=`var(--presence)`,filingStatus:r,taxYear:o,rows:c,refundOrOwed:u,footer:d,delay:f}){let p=i[t]||i.doc,m=(Array.isArray(c)?c:[]).filter(e=>typeof e?.label==`string`&&e.label.trim().length>0),h=u&&typeof u==`object`?u:{},g=Jt(h.amount),_=Zt(h.direction),v=[r,o!=null&&o!==``?`Tax year ${o}`:``].filter(Boolean).join(` · `);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(f||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,style:{marginBottom:v?4:14},children:[(0,y.jsx)(p,{className:`ic`,style:{color:n}}),` `,e]}),v&&(0,y.jsx)(`div`,{className:`trs-cap`,children:v}),m.length===0?(0,y.jsx)(l,{message:`No return lines to show`}):(0,y.jsx)(`div`,{className:`trs-scroll`,children:(0,y.jsx)(`table`,{className:`trs-tbl`,children:(0,y.jsx)(`tbody`,{children:m.map((e,t)=>{let n=Yt(e.kind),r=Math.max(0,e.indent||0),i=Jt(e.amount);return(0,y.jsxs)(`tr`,{className:`trs-row trs-${n}`,children:[(0,y.jsx)(`td`,{className:`trs-label`,style:{paddingLeft:2+r*14},children:e.label}),(0,y.jsx)(`td`,{className:`trs-val tab-num ${i<0?`neg`:``}`,children:qt(i)})]},t)})})})}),(0,y.jsxs)(`div`,{className:`trs-banner trs-banner-${_}`,children:[(0,y.jsx)(`span`,{className:`trs-banner-label`,children:_===`refund`?`Refund`:`Amount owed`}),(0,y.jsx)(`span`,{className:`trs-banner-val tab-num`,children:s(g,{currency:`USD`,decimals:0})})]}),d&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(d)})]})}function $(e){return typeof e==`number`&&Number.isFinite(e)?s(e,{currency:`USD`,decimals:0}):`—`}function $t({title:e,icon:t=`table`,iconColor:n=`var(--presence)`,assetDescription:r,cost:o,method:s,usefulLife:c,annualDepreciation:u,rows:d,footer:f,delay:p}){let m=i[t]||i.table,h=(Array.isArray(d)?d:[]).filter(e=>typeof e?.period==`string`&&e.period.trim().length>0),g=h.length-1,_=[{label:`Cost basis`,value:$(o)},{label:`Method`,value:typeof s==`string`&&s?s:`—`},{label:`Useful life`,value:c!=null&&c!==``?String(c):`—`},{label:`Annual depreciation`,value:$(u),highlight:!0}];return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(p||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,style:{marginBottom:r?4:14},children:[(0,y.jsx)(m,{className:`ic`,style:{color:n}}),` `,e]}),r&&(0,y.jsx)(`div`,{className:`dep-cap`,children:r}),(0,y.jsx)(`div`,{className:`dep-summary`,children:_.map(e=>(0,y.jsxs)(`div`,{className:`dep-field${e.highlight?` highlight`:``}`,children:[(0,y.jsx)(`span`,{className:`dep-field-label`,children:e.label}),(0,y.jsx)(`span`,{className:`dep-field-value`,...e.highlight?{"data-mark":`underline`}:{},children:e.value})]},e.label))}),h.length===0?(0,y.jsx)(l,{message:`No schedule rows to show`}):(0,y.jsx)(`div`,{className:`dep-scroll`,children:(0,y.jsxs)(`table`,{className:`dep-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`dep-th`,children:`Period`}),(0,y.jsx)(`th`,{className:`dep-th dep-th-num`,children:`Beginning basis`}),(0,y.jsx)(`th`,{className:`dep-th dep-th-num`,children:`Depreciation`}),(0,y.jsx)(`th`,{className:`dep-th dep-th-num`,children:`Accumulated`}),(0,y.jsx)(`th`,{className:`dep-th dep-th-num`,children:`Ending basis`})]})}),(0,y.jsx)(`tbody`,{children:h.map((e,t)=>(0,y.jsxs)(`tr`,{className:`dep-row ${t===0||t===g?`edge`:``}`,children:[(0,y.jsx)(`td`,{className:`dep-period`,children:e.period}),(0,y.jsx)(`td`,{className:`dep-num tab-num`,children:$(e.beginningBasis)}),(0,y.jsx)(`td`,{className:`dep-num tab-num`,children:$(e.depreciationExpense)}),(0,y.jsx)(`td`,{className:`dep-num tab-num`,children:$(e.accumulatedDepreciation)}),(0,y.jsx)(`td`,{className:`dep-num dep-ending tab-num`,children:$(e.endingBasis)})]},t))})]})}),f&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(f)})]})}var en=new Set([`catering`,`venue`,`photo`,`av`,`decor`,`other`]),tn={catering:`cart`,venue:`layers`,photo:`image`,av:`speaker`,decor:`sparkle`,other:`doc`},nn={catering:`Catering`,venue:`Venue`,photo:`Photo/Video`,av:`AV`,decor:`Decor`,other:`Other`};function rn(e){return typeof e==`string`&&en.has(e)?e:`other`}var an=new Set([`inquired`,`booked`,`confirmed`]),on={inquired:`var(--text-muted)`,booked:`var(--warning)`,confirmed:`var(--insight)`};function sn(e){return typeof e==`string`&&an.has(e)?e:`inquired`}function cn(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function ln({title:e,icon:t=`layers`,iconColor:n=`var(--presence)`,vendors:r,footer:o,delay:c}){let u=i[t]||i.layers,d=(Array.isArray(r)?r:[]).filter(e=>typeof e?.name==`string`&&e.name.trim().length>0);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(c||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),d.length===0?(0,y.jsx)(l,{message:`No vendors tracked yet`}):(0,y.jsx)(`div`,{className:`vnd-list`,children:d.map((e,t)=>{let n=rn(e.category),r=sn(e.status),a=i[tn[n]]||i.doc,o=cn(e.depositAmount),c=cn(e.balanceDue),l=e.depositPaid?o??0:0,u=(o??0)+(c??0),d=u>0?l/u*100:0,f=u>0?100-d:0;return(0,y.jsxs)(`div`,{className:`vnd-row m-stagger-item m-fade-rise`,style:{"--i":t},children:[(0,y.jsx)(`div`,{className:`vnd-cat`,title:nn[n],children:(0,y.jsx)(a,{className:`ic`})}),(0,y.jsxs)(`div`,{className:`vnd-body`,children:[(0,y.jsxs)(`div`,{className:`vnd-top`,children:[(0,y.jsx)(`span`,{className:`vnd-name`,children:e.name}),(0,y.jsx)(`span`,{className:`vnd-catlabel`,children:nn[n]}),(0,y.jsx)(`span`,{className:`vnd-spacer`}),(0,y.jsx)(`span`,{className:`vnd-status`,style:{"--vnd-c":on[r]},children:r})]}),u>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`vnd-track`,children:[(0,y.jsx)(`div`,{className:`vnd-fill-paid`,style:{width:`${d}%`}}),(0,y.jsx)(`div`,{className:`vnd-fill-due`,style:{width:`${f}%`}})]}),(0,y.jsxs)(`div`,{className:`vnd-money`,children:[o!=null&&(0,y.jsxs)(`span`,{className:`vnd-deposit`,children:[`Deposit `,s(o,{currency:`USD`,decimals:0}),e.depositPaid?` · paid`:` · unpaid`]}),c!=null&&(0,y.jsxs)(`span`,{className:`vnd-balance`,children:[`Balance `,s(c,{currency:`USD`,decimals:0}),e.dueDate?` due ${e.dueDate}`:``]}),e.contractSigned&&(0,y.jsx)(`span`,{className:`vnd-contract`,children:`Contract signed`})]})]})]})]},`${e.name}-${t}`)})}),o&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}var un=new Set([`pitched`,`negotiating`,`contracted`,`delivered`,`paid`]),dn={pitched:`var(--text-muted)`,negotiating:`var(--warning)`,contracted:`var(--presence)`,delivered:`var(--presence-soft)`,paid:`var(--insight)`};function fn(e){return typeof e==`string`&&un.has(e)?e:`pitched`}function pn(e){return typeof e==`number`&&Number.isFinite(e)?e:null}function mn({title:e,icon:t=`spark`,iconColor:n=`var(--presence)`,deals:r,footer:o,delay:c}){let u=i[t]||i.spark,d=(Array.isArray(r)?r:[]).filter(e=>typeof e?.brand==`string`&&e.brand.trim().length>0);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(c||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(u,{className:`ic`,style:{color:n}}),` `,e]}),d.length===0?(0,y.jsx)(l,{message:`No sponsorship deals tracked yet`}):(0,y.jsx)(`div`,{className:`spn-scroll`,children:(0,y.jsxs)(`table`,{className:`spn-table`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{children:[(0,y.jsx)(`th`,{className:`spn-th`,children:`Brand`}),(0,y.jsx)(`th`,{className:`spn-th`,children:`Deliverable`}),(0,y.jsx)(`th`,{className:`spn-th spn-th-num`,children:`Rate`}),(0,y.jsx)(`th`,{className:`spn-th`,children:`Status`}),(0,y.jsx)(`th`,{className:`spn-th`,children:`Date`})]})}),(0,y.jsx)(`tbody`,{children:d.map((e,t)=>{let n=fn(e.status),r=pn(e.rate),i=n===`paid`,a=typeof e.currency==`string`&&e.currency.trim()?e.currency:`USD`;return(0,y.jsxs)(`tr`,{className:`spn-row m-stagger-item m-fade-rise ${i?`paid`:`unpaid`}`,style:{"--i":t},children:[(0,y.jsx)(`td`,{className:`spn-brand`,children:e.brand}),(0,y.jsx)(`td`,{className:`spn-deliverable`,children:e.deliverable||`—`}),(0,y.jsx)(`td`,{className:`spn-rate tab-num`,children:r==null?`—`:s(r,{currency:a,decimals:0})}),(0,y.jsx)(`td`,{children:(0,y.jsx)(`span`,{className:`spn-status`,style:{"--spn-c":dn[n]},children:n})}),(0,y.jsx)(`td`,{className:`spn-date`,children:n===`paid`&&e.paidDate?`Paid ${e.paidDate}`:e.dueDate?`Due ${e.dueDate}`:`—`})]},`${e.brand}-${t}`)})})]})}),o&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}var hn=new Set([`low`,`medium`,`high`]),gn={low:`var(--insight)`,medium:`var(--warning)`,high:`var(--danger)`};function _n(e){return typeof e==`string`&&hn.has(e)?e:null}function vn({title:e,icon:t=`shield`,iconColor:n=`var(--presence)`,cases:r,footer:o,delay:s}){let c=i[t]||i.shield,u=(Array.isArray(r)?r:[]).filter(e=>typeof e?.clientRef==`string`&&e.clientRef.trim().length>0);return(0,y.jsxs)(`div`,{className:`card reveal tbl`,style:{"--delay":(s||0)+`ms`},children:[(0,y.jsxs)(`div`,{className:`card-eyebrow`,children:[(0,y.jsx)(c,{className:`ic`,style:{color:n}}),` `,e]}),u.length===0?(0,y.jsx)(l,{message:`No cases on this list`}):(0,y.jsx)(`div`,{className:`csl-list`,children:u.map((e,t)=>{let n=_n(e.riskLevel);return(0,y.jsxs)(`div`,{className:`csl-row m-stagger-item m-fade-rise`,style:{"--i":t,"--csl-c":n?gn[n]:`var(--line-strong)`},children:[(0,y.jsx)(`div`,{className:`csl-risk-bar`}),(0,y.jsxs)(`div`,{className:`csl-body`,children:[(0,y.jsxs)(`div`,{className:`csl-top`,children:[(0,y.jsx)(`span`,{className:`csl-ref`,children:e.clientRef}),(0,y.jsx)(`span`,{className:`csl-status`,children:e.status||`—`}),(0,y.jsx)(`span`,{className:`csl-spacer`}),n?(0,y.jsxs)(`span`,{className:`csl-riskbadge`,children:[n,` risk`]}):(0,y.jsx)(`span`,{className:`csl-riskbadge csl-unscored`,children:`unscored`})]}),(0,y.jsxs)(`div`,{className:`csl-meta`,children:[e.nextContact&&(0,y.jsxs)(`span`,{className:`csl-contact`,children:[`Next contact `,e.nextContact]}),e.note&&(0,y.jsx)(`span`,{className:`csl-note`,children:e.note})]})]})]},`${e.clientRef}-${t}`)})}),o&&(0,y.jsx)(`div`,{className:`insight-summary`,style:{marginTop:12},dangerouslySetInnerHTML:a(o)})]})}var yn=e({tablesRegistry:()=>bn}),bn={matrix:f(_e),datatable:f(x),pivot:f(S),leaderboard:f(T),treetable:f(k),swimlane:f(A),footnotetable:f(j),sparktable:f(F),smallmultiples:f(ie),comparebars:f(ae),comparematrix:f(me),matrixgrid:f(he),sensitivitytable:f(ye),labpanel:f(xe),ingredientmatrix:f(Se),conjugation:f(Ce),clearancematrix:f(Te),financialstatement:f(De),cohortgrid:f(Oe),riskmatrix:f(Me),careplan:f(Pe),doseladder:f(Fe),sizechart:f(Ie),pricingtable:f(ze),raci:f(Ve),rubric:f(He),interviewscorecard:f(We),gradebook:f(Ge),datadictionary:f(Qe),ablationtable:f(nt),spectrumtable:f(at),fmeatable:f(lt),billofmaterials:f(ft),complexitysummary:f(pt),expressionheatmap:f(gt),discoverytracker:f(wt),dentaltreatmentplan:f(jt),rollcall:f(zt),collectiontracker:f(Wt),cma:f(Kt),taxreturnsummary:f(Qt),depreciationschedule:f($t),vendortracker:f(ln),sponsorshiptracker:f(mn),caseload:f(vn)};export{bn as n,yn as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={videoembed:{blurb:`Video player with chapter markers and chapter-list navigation.`,optional:[`icon`,`iconColor`,`durationLabel`,`active`,`footer`]},geomap:{blurb:`A REAL interactive map (OpenStreetMap tiles) for actual places. Give each marker real {lat, lng} coordinates (decimal degrees), a name, and an optional detail. When the answer spans several places or segments (a multi-day trip, a multi-stop route), emit ONE map PER segment — each plotting that segment’s own stops — not a single overview, unless an overview is what was asked. This is the only map type — always use it for any real-world location. For a zoning/land-use ask specifically, prefer zoningmap, which teaches the zone-polygon shape more directly.`,optional:[`icon`,`iconColor`,`zoom`,`zones`,`footer`],itemShapes:[{prop:`zones`,text:`label`,textAliases:[`name`,`title`]}],propHints:{"zones[].coords":`the zone boundary as real [lat, lng] pairs (decimal degrees), at least 3 points`,"zones[].category":`'residential'|'commercial'|'industrial'|'mixed'|'open-space'`}},lightbox:{blurb:`Inline gallery grid with full-screen lightbox on tap.`,optional:[`icon`,`iconColor`,`footer`]},moodboard:{blurb:`Masonry layout of images, color swatches, and text blocks.`,optional:[`icon`,`iconColor`,`footer`],propHints:{"tiles[].kind":`'image'|'color'|'text'`}},palette:{blurb:`An actual COLOR palette — swatches with hex codes and WCAG contrast verdicts (brand/design palettes). Never as a generic category, tag, or option list — use chipset or badgeset.`,optional:[`icon`,`iconColor`,`footer`],itemShapes:[{prop:`swatches`,text:`name`,textAliases:[`label`,`title`]}]},mediacard:{blurb:`A poster-forward detail card for ONE recommended title (film/show/book/game): cover art, year/runtime/rating chips, a 0–100 score badge, a spoiler-safe logline, genre tags, and "where to watch" provider chips. Give a real cover.src when you have one; otherwise it falls back to the cover.from/to gradient. Pick this for a single "what should I watch/read next" pick — use carousel or lightbox for a gallery of several.`,optional:[`icon`,`iconColor`,`year`,`runtime`,`rating`,`score`,`genres`,`logline`,`providers`,`footer`],stringItems:[`genres`,`providers`],propHints:{score:`a number 0–100 (aggregate/critic score); omit if unknown rather than guessing`,"cover.src":`real poster/cover image URL; omit to show the from/to gradient placeholder`,"cover.from":`gradient start, e.g. var(--presence-deep)`,"cover.to":`gradient end, e.g. var(--presence-soft)`}},diagram:{blurb:`Labeled vector diagram with shapes (circles, rects, lines, polygons, paths) and annotated callout labels—for anatomy, physics, geography, engineering schematics.`,optional:[`icon`,`iconColor`,`ratio`,`footer`],propHints:{"shapes[].kind":`'circle'|'rect'|'line'|'polygon'|'path'`}},svgblock:{blurb:`Tier-3 escape hatch: model-drawn SVG for a visual no native component covers (a molecule, a circuit, a geometric figure, a custom infographic). Strictly sanitized on render; design tokens (var(--presence) etc.) work via CSS inheritance, so it is light/dark-aware. Use ONLY when diagram/geometrycanvas/vectorspace/reactionmechanism/molecularstructure/etc. do not apply.`,optional:[`icon`,`iconColor`,`caption`,`footer`],propHints:{svg:`Complete <svg> with a viewBox (e.g. viewBox="0 0 400 300") and NO width/height attributes. Colors: ONLY var(--presence/--insight/--warning/--danger/--text-primary/--text-secondary/--text-muted/--surface-card) — never hex. Allowed elements: path, rect, circle, ellipse, line, polyline, polygon, text, tspan, g, defs, linearGradient/radialGradient/stop, clipPath, mask, pattern, marker, use(#id). Forbidden: script, style, foreignObject, image, a, event handlers, animation, and any external/javascript:/data: URL — all are stripped on render.`,caption:`Optional plain-text label shown below the SVG.`}}};export{e as D};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={painscale:{blurb:`Clinical pain rating — Wong-Baker FACES or a 0–10 visual-analog scale.`,optional:[`title`,`icon`,`iconColor`,`kind`,`anchors`,`caption`,`footer`],stringItems:[`anchors`],propHints:{value:`0..10 (0 = no pain, 10 = worst pain)`,kind:`'faces' (six Wong-Baker faces, default) | 'vas' (visual-analog 0–10 bar)`}},habittracker:{blurb:`Weekly multi-habit grid with per-habit completion rings and a week summary.`,optional:[`title`,`icon`,`iconColor`,`days`,`caption`,`footer`],itemShapes:[{prop:`habits`,text:`name`,textAliases:[`label`,`title`]}],stringItems:[`days`],propHints:{"habits[].done":"array of booleans, one per day, aligned to `days` (default Mon..Sun)"}},streakgrid:{blurb:`Habit-streak card — recent-day dots, current/best counters, don't-break-the-chain framing.`,optional:[`title`,`icon`,`iconColor`,`habit`,`current`,`best`,`caption`,`footer`],propHints:{"days[].done":`boolean — whether the habit was kept that day (oldest → newest)`}},datatable:{blurb:`Sortable, filterable table with search — annotate it (currency, totals, highlights).`,optional:[`icon`,`iconColor`,`sortKey`,`sortDir`,`searchable`,`searchPlaceholder`,`footer`,`annotations`],propHints:{annotations:`OPTIONAL closed-grammar adornments that turn a plain table into a receipt/ledger/scorecard. An array of {op,...}: {"op":"format","target":{"kind":"column","key":"<col>"},"as":"currency|percent|unit"}; {"op":"summary","stat":"total|mean|max|min","columns":["<col>"]} (WE compute it — never send the number); {"op":"emphasize","target":{"kind":"row","match":"<row label>"},"tone":"presence|insight|warning|danger"}; {"op":"status","target":{"kind":"column","key":"<col>"},"rules":[{"match":"<text>","tone":"danger"}]}; {"op":"bar","target":{"kind":"column","key":"<col>"}}. Reference only real column keys / row labels.`}},pivot:{blurb:`Two-way crosstab (row category × column category) of ONE metric per view; color-scaled cells, togglable measures, row/col totals.`,optional:[`icon`,`iconColor`,`measure`,`accent`,`footer`],stringItems:[`colHeaders`],propHints:{colHeaders:`category labels across the top (quarters, regions, stages…) — the column dimension, NOT metric names`,measures:`the metric(s) the toggle switches between; the active one fills every column. Different metrics (e.g. Revenue vs Margin) go HERE — never as separate colHeaders, which would just repeat a column. e.g. [{key:'rev',label:'Revenue'}]`,"rows[].cells[].values":`object keyed by each measure.key → that metric at this row × column`}},leaderboard:{blurb:`Ranked rows with medals, bars, and rank-movement indicators; toggle metrics.`,optional:[`icon`,`iconColor`,`metric`,`accent`,`footer`],itemShapes:[{prop:`rows`,text:`name`,textAliases:[`label`,`title`]}]},treetable:{blurb:`Hierarchical tree with expand/collapse rows, inline bars, and tags.`,optional:[`icon`,`iconColor`,`valueLabel`,`accent`,`footer`],itemShapes:[{prop:`nodes`,text:`label`,children:{prop:`children`,text:`label`}}],propHints:{"nodes[].value":`the row's own displayed amount, e.g. "¥1,000" — a SEPARATE field from label, never appended to it as text`,"nodes[].pct":`0..1 share of the whole for the inline bar (e.g. this row's value ÷ the total) — omit rather than guess if there's no meaningful whole to share`,valueLabel:`header for the value column, e.g. "Budget" or "Revenue" (defaults to "Value")`}},swimlane:{blurb:`Concurrent processes as horizontal lanes, each owned by an ACTOR, with time-ordered events/bars across them (UML sequence, multi-team handoffs, request flow). Never for generic multi-row data — use datatable for tabular data.`,optional:[`icon`,`iconColor`,`ticks`,`footer`],itemShapes:[{prop:`lanes`,text:`actor`,textAliases:[`label`,`name`,`title`],children:{prop:`events`,text:`label`,textAliases:[`name`,`title`,`text`]}}],stringItems:[`ticks`]}};export{e as D};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=/\[\[([^[\]|]*)\|([^[\]]*)\]\]/g,t=/\[\[([^[\]|]*)\]\]/g,n=/\[\[[^\]]*$/,r=/\s*(?<!\])\((?:\s*(?:\[[^\]]*\]\((?:https?:\/\/|www\.)[^)]*\)|https?:\/\/[^\s)]+)\s*[,;·|]*\s*)+\)/gi,i=/\[([^\]]*)\]\((?:https?:\/\/|www\.|mailto:)[^)]*\)/gi,a=/\bhttps?:\/\/[^\s)\]]+/gi,o=/\s*\(?\s*\[[^\]]*\]\((?:https?:\/\/|www\.|\/)[^)]*$/;function s(e){return e.replace(r,``).replace(o,``).replace(i,`$1`).replace(a,``).replace(/[ \t]{2,}/g,` `).replace(/\s+([.,;:!?])/g,`$1`).trimEnd()}function c(e,t,n){let r=e,i;do i=r,r=r.replace(t,n);while(r!==i);return r}function l(r){return c(c(r,e,`$1`),t,`$1`).replace(n,``).trimEnd()}function u(e){return l(e).replace(/<[^>]*>/g,``).trimEnd()}function d(r){let i=c(r,e,`$2`);return i=c(i,t,`$1`),i.replace(n,``).trimEnd()}function f(e){return s(u(e))}function p(e){return s(d(e))}var m=String.raw`\$?\d[\d,]*(?:\.\d+)?(?:\s?(?:dollars?|USD|cents?|percent|%))?`,h=RegExp(`(${m})(\\s*[,;]?\\s+)\\1(?!\\w)`,`gi`);function g(e){let t=e,n;do n=t,t=t.replace(h,`$1`);while(t!==n);return t}function _(e,t,n=.3){let r=e.trim();if(r.length<=t)return r;let i=r.slice(0,t-1),a=[...i.matchAll(/[.!?](?=["')\]]?(?:\s|$))/g)].at(-1);if(a?.index!==void 0&&a.index>t*n)return i.slice(0,a.index+1);let o=i.lastIndexOf(` `);return(o>t*.6?i.slice(0,o):i).trimEnd()+`…`}export{p as a,f as i,u as n,l as o,d as r,_ as s,g as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{t}from"./friendlyAsk-BBdRZIar.js";import{n,t as r}from"./contentVault-xfUwSJ3i.js";import{r as i}from"./localBudget-CxLP6bjE.js";var a={"15min":15,hourly:60,"6h":360,daily:1440,manual:1/0},o={daily:1440,weekly:10080,"on-change":1/0,manual:1/0};function s(e,t){return Number.isFinite(t)?e+t*6e4:2**53-1}function c(e){return e===`manual`?0:Math.round(43200/a[e])}function l(e,t){let n=e.window;if(n){if(t<n.startAt)return n.startAt;if(t>n.endAt)return 2**53-1}return s(t,a[e.data])}var u=`mavea-dash-opens-v1`,d=2592e6;function f(e){return!!e&&typeof e==`object`}function ee(e,t){if(!f(e))return{};let n=t-d,r={};for(let[t,i]of Object.entries(e)){if(!t||!Array.isArray(i))continue;let e=i.filter(e=>typeof e==`number`&&Number.isFinite(e)&&e>=n).slice(-30);e.length&&(r[t]=e)}return r}var p;function te(e){try{if(typeof localStorage>`u`)return{};let t=localStorage.getItem(u);return t?ee(JSON.parse(t),e):{}}catch{return{}}}function m(e=Date.now()){return p??=te(e),p}function h(e){p=e;try{typeof localStorage<`u`&&localStorage.setItem(u,JSON.stringify(e))}catch{}}function ne(e,t=Date.now()){if(!e)return;let n=m(t),r=[...n[e]??[],t].filter(e=>e>=t-d).slice(-30);h({...n,[e]:r})}function re(e,t,n=Date.now()){return(m(n)[e]??[]).filter(e=>e>=t).length}function g(e){let t=m(),n={};for(let[r,i]of Object.entries(t))e.has(r)&&(n[r]=i);h(n)}var ie=12,_=new Map,v=0,y=new Set;function b(){for(let e of y)e()}function ae(e){return y.add(e),()=>y.delete(e)}function oe(e,t=Date.now()){v+=1;let n={id:`run-${v}`,dashboardId:e,startedAt:t,steps:[{name:`scheduled`,ok:!0,at:t}]},r=_.get(e)??[];return _.set(e,[n,...r].slice(0,ie)),b(),n}function se(e,t,n,r={}){e&&(e.steps.push({name:t,ok:n,at:r.at??Date.now(),...r.count===void 0?{}:{count:r.count},...r.detail?{detail:r.detail}:{}}),b())}function ce(e,t){e&&(e.endedAt=t.at??Date.now(),t.outcome&&(e.outcome=t.outcome),t.failure&&(e.failure=t.failure),t.attempts!==void 0&&(e.attempts=t.attempts),b())}var le=[];function ue(e){return _.get(e)??le}function de(e){e===void 0?_.clear():_.delete(e),b()}var fe=`mavea-dashboards`,x=`observations`,pe=1,me=200;function he(){return typeof indexedDB<`u`}var S=null;function C(){return S||(S=new Promise((e,t)=>{let n=indexedDB.open(fe,pe);n.onupgradeneeded=()=>{let e=n.result;if(!e.objectStoreNames.contains(x)){let t=e.createObjectStore(x,{keyPath:`id`});t.createIndex(`byTarget`,[`dashboardId`,`targetId`,`observedAt`]),t.createIndex(`byDashboard`,`dashboardId`)}},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error??Error(`indexedDB open failed`))}),S.catch(()=>{S=null}),S)}function w(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onerror=()=>n(e.error??Error(`indexedDB transaction failed`)),e.onabort=()=>n(e.error??Error(`indexedDB transaction aborted`))})}async function ge(e,t,r,i=Date.now(),a){if(he())try{let o=await n({data:r,...a?.length?{receipts:a}:{}}),s=(await C()).transaction(x,`readwrite`),c=s.objectStore(x),l={id:`${e}:${t}:${i}`,dashboardId:e,targetId:t,observedAt:i,payload:o};c.put(l),await w(s),await _e(e,t)}catch{}}async function _e(e,t){try{let n=(await C()).transaction(x,`readwrite`),r=n.objectStore(x).index(`byTarget`),i=IDBKeyRange.bound([e,t,0],[e,t,1/0]),a=[];await new Promise((e,t)=>{let n=r.openKeyCursor(i,`next`);n.onsuccess=()=>{let t=n.result;if(!t)return e();a.push(t.primaryKey),t.continue()},n.onerror=()=>t(n.error??Error(`cursor failed`))});let o=a.length-me;if(o>0){let e=n.objectStore(x);for(let t of a.slice(0,o))e.delete(t)}await w(n)}catch{}}async function ve(e){if(he())try{let t=(await C()).transaction(x,`readwrite`),n=t.objectStore(x).index(`byDashboard`),r=t.objectStore(x);await new Promise((t,i)=>{let a=n.openKeyCursor(IDBKeyRange.only(e));a.onsuccess=()=>{let e=a.result;if(!e)return t();r.delete(e.primaryKey),e.continue()},a.onerror=()=>i(a.error??Error(`cursor failed`))}),await w(t)}catch{}}function T(e){return e.state?e.state:e.lastRefreshedAt===null?{status:`pending`}:e.lastDataOutcome===`unverified`?{status:`degraded`,lastSuccessAt:e.lastRefreshedAt,failure:{kind:`ungrounded`},lastAttemptAt:e.lastRefreshedAt}:{status:`active`,lastSuccessAt:e.lastRefreshedAt}}function E(e){return{status:`active`,lastSuccessAt:e}}function D(e,t,n){let r=e.status===`active`||e.status===`degraded`?e.lastSuccessAt:void 0;return r===void 0?{status:`pending`,failure:t,lastAttemptAt:n}:{status:`degraded`,lastSuccessAt:r,failure:t,lastAttemptAt:n}}function ye(e){switch(e.kind){case`auth`:return`Your model rejected the key — reconnect it in Live, then check again.`;case`rate-limit`:return`Your model provider is rate-limiting right now. This retries itself shortly.`;case`network`:return`Couldn't reach your model. This retries itself once the connection is back.`;case`no-model`:return`No model is connected yet — connect one in Live and this starts checking.`;case`ungrounded`:return`No live source backed this up — the model may not have searched. Try a stronger model in Settings, or reword what to track.`;case`provider-unavailable`:return`Your model provider is unavailable right now. This retries itself shortly.`}}function be(e){switch(e){case`no-model`:return{kind:`no-model`};case`unverified`:return{kind:`ungrounded`};case`failed`:return{kind:`network`};default:return null}}var xe=e({DASHBOARDS_EVENT:()=>k,DASHBOARDS_QUOTA_EVENT:()=>A,MAX_METRICS:()=>12,MAX_WIDGETS:()=>12,addDashboard:()=>Ue,addWidget:()=>et,appendSource:()=>it,applyRefreshResult:()=>bt,blockToWidget:()=>Ke,clearDashboards:()=>Xe,clearOneShot:()=>vt,createBlankDashboard:()=>Ge,ensureFirstCheck:()=>mt,foldInto:()=>ot,getDashboard:()=>He,getDashboards:()=>Ve,hasDroppedWrite:()=>F,invalidate:()=>Re,markAiRefreshed:()=>ht,markDataRefreshed:()=>ft,markDataRetry:()=>pt,markTrackerFailure:()=>$,markVerdictFailed:()=>dt,mergeDashboards:()=>We,newDashboardId:()=>I,removeDashboard:()=>Ye,removeWidget:()=>$e,reorderWidgets:()=>Ze,setCadenceWindow:()=>gt,setOneShot:()=>_t,setVerdict:()=>ut,setWidgetOrder:()=>nt,setWidgetRefreshQuery:()=>tt,setWidgetSpan:()=>Qe,updateCadence:()=>Je,updateDashboard:()=>qe,updateMetricValue:()=>ct,updateTripwireStates:()=>lt,whenDashboardsHydrated:()=>Le}),O=`mavea-dashboards-v1`,k=O,A=`${O}:quota`,j=24,Se=12,Ce=4096,we=60,M=null,N=0,P=!1;function F(){return P}function I(){try{let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID()}catch{}return N+=1,`dash-${N.toString(36)}-${Math.floor(Math.random()*1e9).toString(36)}`}function Te(e){let t=JSON.stringify(e,(e,t)=>typeof t==`string`&&t.length>Ce&&t.startsWith(`data:`)?``:t);return JSON.parse(t)}function L(e){return!!e&&typeof e==`object`}function R(e,t){return typeof e==`number`&&Number.isFinite(e)?e:t}function z(e,t=``){return typeof e==`string`?e:t}function Ee(e){return e===`5min`?`15min`:z(e,`manual`)}function De(e){if(!L(e))return null;let t=e.at,n=e.value;return typeof t!=`number`||!Number.isFinite(t)||typeof n!=`number`||!Number.isFinite(n)?null:{at:t,value:n}}var Oe=new Set([`auth`,`rate-limit`,`network`,`no-model`,`ungrounded`,`provider-unavailable`]);function B(e){if(!L(e))return;let t=L(e.failure)&&Oe.has(z(e.failure.kind))?{kind:z(e.failure.kind),...typeof e.failure.retryAt==`number`&&Number.isFinite(e.failure.retryAt)?{retryAt:e.failure.retryAt}:{}}:void 0,n=typeof e.lastAttemptAt==`number`&&Number.isFinite(e.lastAttemptAt)?e.lastAttemptAt:void 0,r=typeof e.lastSuccessAt==`number`&&Number.isFinite(e.lastSuccessAt)?e.lastSuccessAt:void 0;if(e.status===`pending`)return{status:`pending`,...t?{failure:t}:{},...n===void 0?{}:{lastAttemptAt:n}};if(e.status===`active`&&r!==void 0)return{status:`active`,lastSuccessAt:r};if(e.status===`degraded`&&t&&n!==void 0)return{status:`degraded`,failure:t,lastAttemptAt:n,...r===void 0?{}:{lastSuccessAt:r}}}function ke(e){if(!L(e))return null;let t=(Array.isArray(e.history)?e.history:[]).map(De).filter(e=>e!==null).slice(-60);return{...e,history:t.length?t:void 0}}function Ae(e){if(!L(e))return;let t=e.startAt,n=e.endAt;if(!(typeof t!=`number`||!Number.isFinite(t))&&!(typeof n!=`number`||!Number.isFinite(n)||n<=t))return{label:z(e.label),startAt:t,endAt:n,origin:e.origin===`search`?`search`:`user`}}function je(e){if(!(!L(e)||typeof e.text!=`string`||!e.text))return{text:e.text,at:R(e.at,0)}}function Me(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(!L(n)||typeof n.expected!=`string`||!n.expected)continue;let e=n.result;(e===`hit`||e===`miss`||e===`unclear`)&&t.push({at:R(n.at,0),expected:n.expected,result:e,...typeof n.note==`string`&&n.note?{note:n.note}:{}})}return t.slice(-20)}function V(e,t){if(!e.window||t<=e.window.endAt)return e;let{window:n,...r}=e;return r}var H=new Set([`thesis`,`alignmentgauge`,`standingalerts`,`sourceslineage`]);function Ne(e,t,n){let r=n||t;return r?e.map(e=>{if(e.refreshQuery?.trim()||e.metricId||H.has(e.block.type))return e;let t=e.block.props?.title,n=typeof t==`string`&&t.trim()?`${r} — ${t.trim()}`:r;return{...e,refreshQuery:n}}):e}function Pe(e){if(!L(e))return null;let n=z(e.id);if(!n)return null;let r=L(e.thesis)?e.thesis:null,i=Array.isArray(e.widgets)?e.widgets.filter(e=>L(e)&&L(e.block)):[],a=L(e.cadence)?e.cadence:{},o=L(e.alerts)?e.alerts:{},s=Fe(e.lastVerdict),c=z(e.title,`Untitled`),l=t(z(e.question)),u=Ae(a.window),d=je(e.prediction),f=Me(e.predictionHistory);return{id:n,title:c,question:l,thesis:{text:z(r?.text),saidAt:R(r?.saidAt,0)},tripwires:Array.isArray(e.tripwires)?e.tripwires:[],metrics:Array.isArray(e.metrics)?e.metrics.map(ke).filter(e=>e!==null):[],sources:Array.isArray(e.sources)?e.sources:[],widgets:Ne(i.slice(0,12),c,l),cadence:{data:Ee(a.data),ai:z(a.ai,`manual`),...u?{window:u}:{}},smartTrigger:typeof e.smartTrigger!=`boolean`||e.smartTrigger,alerts:{inApp:o.inApp!==!1,push:o.push===!0},...typeof e.topic==`string`&&e.topic?{topic:e.topic}:{},createdAt:R(e.createdAt,0),updatedAt:R(e.updatedAt,0),...typeof e.lastTouchedByUserAt==`number`&&Number.isFinite(e.lastTouchedByUserAt)?{lastTouchedByUserAt:e.lastTouchedByUserAt}:{},nextDataAt:R(e.nextDataAt,0),nextAiAt:R(e.nextAiAt,2**53-1),...typeof e.oneShotAt==`number`&&Number.isFinite(e.oneShotAt)?{oneShotAt:e.oneShotAt,oneShotLabel:z(e.oneShotLabel)}:{},...d?{prediction:d}:{},...f.length?{predictionHistory:f}:{},lastRefreshedAt:typeof e.lastRefreshedAt==`number`&&Number.isFinite(e.lastRefreshedAt)?e.lastRefreshedAt:null,...e.lastDataOutcome===`updated`||e.lastDataOutcome===`no-change`||e.lastDataOutcome===`unverified`?{lastDataOutcome:e.lastDataOutcome}:{},...B(e.state)?{state:B(e.state)}:{},...s?{lastVerdict:s}:{},...typeof e.lastVerdictAttemptAt==`number`&&Number.isFinite(e.lastVerdictAttemptAt)?{lastVerdictAttemptAt:e.lastVerdictAttemptAt}:{},...typeof e.lastVerdictError==`string`&&e.lastVerdictError?{lastVerdictError:e.lastVerdictError}:{}}}function Fe(e){return!L(e)||typeof e.text!=`string`||!e.text?null:{text:e.text,at:R(e.at,0),grounded:e.grounded===!0,...Array.isArray(e.sources)?{sources:e.sources}:{},...typeof e.tripwireId==`string`?{tripwireId:e.tripwireId}:{}}}var U=!1,W=0;function G(e){return Array.isArray(e)?e.map(Pe).filter(e=>e!==null):[]}async function K(e){let t=++W,r=!1;try{if(typeof localStorage>`u`)return;let a=await n(e);if(t!==W)return;r=await i(O,a)}catch{}if(!r){P=!0;try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(A))}catch{}}}function Ie(){try{if(typeof localStorage>`u`)return[];let e=localStorage.getItem(O);if(!e)return[];let t=G(JSON.parse(e));return t.length&&K(t),t}catch{return[]}}async function q(){try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(O);if(!e)return;try{JSON.parse(e);return}catch{}let t=G(await r(e));if(U)return;M=t,U=!0,typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(k,{detail:t}))}catch{}}var J=q();function Le(){return J}function Y(){return M??=Ie(),M}function Re(){let e=M;M=null,U=!1,J=q();try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(O);if(!e)return;JSON.parse(e)}catch{M=e}}function ze(e){return e.length<=j?e:[...e].sort((e,t)=>(t.lastTouchedByUserAt??t.updatedAt)-(e.lastTouchedByUserAt??e.updatedAt)).slice(0,j)}function X(e){let t=G(e);M=t,U=!0,K(t);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(k,{detail:t}))}catch{}}function Z(e,t,n=Date.now(),r={}){let i=!1,a=Y().map(a=>a.id===e?(i=!0,{...t(a),updatedAt:n,...r.userTouch?{lastTouchedByUserAt:n}:{}}):a);i&&X(a)}var Q=null,Be=null;function Ve(){let e=Y();return(Be!==e||Q===null)&&(Q=[...e].sort((e,t)=>(t.lastTouchedByUserAt??t.createdAt)-(e.lastTouchedByUserAt??e.createdAt)),Be=e),Q}function He(e){return Y().find(t=>t.id===e)??null}function Ue(e){X(ze([Te({...e,lastTouchedByUserAt:e.lastTouchedByUserAt??e.updatedAt}),...Y().filter(t=>t.id!==e.id)]))}function We(e){let t=G(e);if(!t.length)return 0;let n=new Map(Y().map(e=>[e.id,e]));for(let e of t){let t=n.get(e.id);(!t||e.updatedAt>=t.updatedAt)&&n.set(e.id,e)}return X(ze([...n.values()])),t.length}function Ge(e){let t=e.now??Date.now();return{id:I(),title:e.title||`Untitled dashboard`,question:e.question??``,thesis:{text:``,saidAt:t},tripwires:[],metrics:[],sources:[{kind:`ORIGIN`,conversationId:`pin`,title:e.title||`Pinned cards`,contributed:`Started by pinning a card.`,at:t}],widgets:[],cadence:{data:`manual`,ai:`manual`},smartTrigger:!1,alerts:{inApp:!0,push:!1},...e.topic?{topic:e.topic}:{},createdAt:t,updatedAt:t,nextDataAt:2**53-1,nextAiAt:2**53-1,lastRefreshedAt:null}}function Ke(e,t=`pin`,n){let r=new Set([`chart`,`plot`,`dualaxis`,`bars`,`timeline`,`breakdown`,`table`]);return{id:`w-pin-`+Math.random().toString(36).slice(2,9),block:e,span:r.has(e.type)?2:1,fromSource:t,...n?.trim()?{refreshQuery:n.trim()}:{}}}function qe(e,t){Z(e,e=>({...e,...t}),void 0,{userTouch:!0})}function Je(e,t,n=Date.now()){Z(e,e=>{let r={...e.cadence,...t};return{...e,cadence:r,...t.data===void 0?{}:{nextDataAt:l(r,n)},...t.ai===void 0?{}:{nextAiAt:s(n,o[r.ai])}}},n,{userTouch:!0})}function Ye(e){let t=Y().filter(t=>t.id!==e);t.length!==Y().length&&(X(t),g(new Set(t.map(e=>e.id))),de(e),ve(e))}function Xe(){Y().length!==0&&(X([]),g(new Set))}function Ze(e,t,n){Z(e,e=>{let r=[...e.widgets];if(t<0||t>=r.length||n<0||n>=r.length)return e;let[i]=r.splice(t,1);return r.splice(n,0,i),{...e,widgets:r}},void 0,{userTouch:!0})}function Qe(e,t,n){Z(e,e=>({...e,widgets:e.widgets.map(e=>e.id===t?{...e,span:n}:e)}),void 0,{userTouch:!0})}function $e(e,t){Z(e,e=>({...e,widgets:e.widgets.filter(e=>e.id!==t)}),void 0,{userTouch:!0})}function et(e,t,n={}){let r=Array.isArray(t)?t:[t];r.length!==0&&Z(e,e=>{let t=Math.max(0,Math.min(n.at??e.widgets.length,e.widgets.length)),i=[...e.widgets.slice(0,t),...r,...e.widgets.slice(t)],a=i;if(i.length>12){let e=i.filter(e=>!H.has(e.block.type)),t=i.length-12;if(e.length>=t){let n=new Set(e.slice(-t).map(e=>e.id));a=i.filter(e=>!n.has(e.id))}else a=i.slice(0,12)}return{...e,widgets:a,...n.source?{sources:[...e.sources,n.source].slice(-rt)}:{}}},void 0,{userTouch:!0})}function tt(e,t,n){let r=n.trim();if(!r||t.length===0)return;let i=new Set(t);Z(e,e=>({...e,widgets:e.widgets.map(e=>i.has(e.id)?{...e,refreshQuery:r}:e)}))}function nt(e,t){Z(e,e=>{let n=new Map(e.widgets.map(e=>[e.id,e])),r=t.map(e=>n.get(e)).filter(e=>!!e),i=new Set(r.map(e=>e.id)),a=e.widgets.filter(e=>!i.has(e.id));return{...e,widgets:[...r,...a]}},void 0,{userTouch:!0})}var rt=24;function it(e,t){Z(e,e=>({...e,sources:[...e.sources,t].slice(-24)}),void 0,{userTouch:!0})}var at=12;function ot(e,t){Z(e,e=>({...e,metrics:[...e.metrics,...t.metrics].slice(0,12),tripwires:[...e.tripwires,...t.tripwires].slice(0,12),widgets:[...e.widgets,...t.widgets].slice(0,12),sources:[...e.sources,t.source].slice(-24)}),void 0,{userTouch:!0})}function st(e,t,n){if(n===null)return e;let r=[...e??[],{at:t,value:n}];return r.length>we?r.slice(-60):r}function ct(e,t,n,r,i,a=Date.now()){Z(e,e=>({...e,metrics:e.metrics.map(e=>e.id===t?{...e,lastValue:n,lastRaw:r,origin:i,asOf:a,history:st(e.history,a,n)}:e)}),a,{userTouch:i===`user`})}function lt(e,t,n=Date.now()){Z(e,e=>({...e,tripwires:t}),n)}function ut(e,t,n=Date.now()){Z(e,e=>({...e,lastVerdict:t,lastVerdictAttemptAt:n,lastVerdictError:void 0}),n)}function dt(e,t,n){Z(e,e=>({...e,lastVerdictAttemptAt:t,lastVerdictError:n}),t)}function ft(e,t=Date.now(),n=`updated`){Z(e,e=>{let r=V(e.cadence,t);return{...e,cadence:r,nextDataAt:l(r,t),lastRefreshedAt:t,lastDataOutcome:n,state:E(t)}})}function $(e,t,n=Date.now()){Z(e,e=>({...e,state:D(T(e),t,n)}))}function pt(e,t){Z(e,e=>({...e,nextDataAt:t,...e.oneShotAt!==void 0&&e.oneShotAt<t?{oneShotAt:t}:{}}))}function mt(e,t=Date.now()){Z(e,e=>e.oneShotAt===void 0?{...e,oneShotAt:t,oneShotLabel:`first check`}:e)}function ht(e,t=Date.now()){Z(e,e=>({...e,nextAiAt:s(t,o[e.cadence.ai])}))}function gt(e,t,n=Date.now()){Z(e,e=>{let r=t?{...e.cadence,window:t}:{...e.cadence,window:void 0};return{...e,cadence:r,nextDataAt:l(r,n)}},n,{userTouch:t?.origin===`user`})}function _t(e,t,n,r=Date.now()){Z(e,e=>({...e,oneShotAt:t,oneShotLabel:n}),r,{userTouch:!0})}function vt(e,t=Date.now()){Z(e,e=>({...e,oneShotAt:void 0,oneShotLabel:void 0}),t)}var yt=3e5;function bt(e,t,n=Date.now()){Z(e,e=>{let r=new Map((t.values??[]).map(e=>[e.metricId,e])),i=new Map((t.blocks??[]).map(e=>[e.widgetId,e.block])),a=e.prediction,o=e.predictionHistory;if(t.grade&&a){let e={at:n,expected:a.text,result:t.grade.result,...t.grade.note?{note:t.grade.note}:{}};o=[...o??[],e].slice(-20),a=void 0}t.expects?.trim()&&(a={text:t.expects.trim(),at:n});let s=V(e.cadence,n),c=l(s,n),u=t.outcome===`unverified`&&e.lastDataOutcome!==`unverified`&&c!==2**53-1&&(!s.window||n>=s.window.startAt)?Math.min(c,n+yt):c;return{...e,cadence:s,metrics:e.metrics.map(e=>{let t=r.get(e.id);return t?{...e,lastValue:t.value,lastRaw:t.raw,origin:t.origin,asOf:n,history:st(e.history,n,t.value)}:e}),widgets:e.widgets.map(e=>{let t=i.get(e.id);return t?{...e,block:t}:e}),...t.tripwires?{tripwires:t.tripwires}:{},...t.consumedOneShot?{oneShotAt:void 0,oneShotLabel:void 0}:{},nextDataAt:u,lastRefreshedAt:n,lastDataOutcome:t.outcome,state:t.outcome===`unverified`?D(T(e),{kind:`ungrounded`},n):E(n),prediction:a,predictionHistory:o}},n)}export{xe as A,ue as B,Ye as C,nt as D,ut as E,Le as F,re as G,se as H,be as I,a as J,ne as K,ye as L,qe as M,ct as N,tt as O,lt as P,T as R,I as S,gt as T,oe as U,ce as V,ae as W,l as X,c as Y,s as Z,ht as _,Ue as a,dt as b,Ke as c,mt as d,ot as f,Re as g,F as h,Se as i,Je as j,Qe as k,vt as l,Ve as m,A as n,et as o,He as p,o as q,at as r,bt as s,k as t,Ge as u,pt as v,$e as w,We as x,$ as y,ge as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./friendlyAsk-BBdRZIar.js";import{n as t,t as n}from"./contentVault-xfUwSJ3i.js";import{n as r,r as i,t as a}from"./localBudget-CxLP6bjE.js";var o=[`stat`,`value`,`big`,`headline`];function s(e){let t=[e.points,e.bars,e.data,e.series,e.values];for(let e of t){if(!Array.isArray(e))continue;let t=e.map(e=>{if(typeof e==`number`)return e;if(e&&typeof e==`object`){let t=e,n=t.v??t.y??t.value;if(typeof n==`number`)return n}return NaN}).filter(e=>Number.isFinite(e));if(t.length>=2)return t.slice(0,24)}}function c(e){return e.find(e=>e.type===`insight`&&!!e.id)||e.find(e=>{if(!e.id)return!1;let t=e.props??{};return o.some(e=>typeof t[e]==`string`&&t[e].trim())})}function l(e){let t=c(e.blocks);if(!t)return null;let n=t.props??{},r=o.find(e=>typeof n[e]==`string`&&n[e].trim());if(!r)return null;let i=typeof n.delta==`string`&&n.delta.trim()?n.delta.trim():void 0,a=typeof n.deltaDir==`string`?n.deltaDir:void 0,l=typeof n.unit==`string`&&n.unit.trim()?n.unit.trim():void 0;return{value:n[r].trim(),unit:l,delta:i,deltaDir:a,points:s(n),kind:t.type}}var u=`mavea-live-library-v1`,d=u,f=12,p=24e4,m=4096,h=null,g=0;function _(){try{let e=globalThis.crypto;if(e?.randomUUID)return e.randomUUID()}catch{}return g+=1,`lib-${g.toString(36)}-${Math.floor(Math.random()*1e9).toString(36)}`}function v(e){return e.replace(/\s+/g,` `).trim().toLowerCase()}function y(e){let t=JSON.stringify(e,(e,t)=>typeof t==`string`&&t.length>m&&t.startsWith(`data:`)?``:t);return JSON.parse(t)}function b(e){return!!e&&typeof e==`object`&&Array.isArray(e.blocks)}function x(t){if(!t||typeof t!=`object`)return null;let n=t;if(!b(n.spec))return null;let r=typeof n.question==`string`?e(n.question):``;return r.trim()?{id:typeof n.id==`string`&&n.id?n.id:_(),question:r,title:typeof n.title==`string`?n.title:n.spec.title??``,savedAt:typeof n.savedAt==`number`&&Number.isFinite(n.savedAt)?n.savedAt:0,lead:n.lead&&typeof n.lead==`object`?n.lead:null,spec:n.spec,...typeof n.topic==`string`&&n.topic?{topic:n.topic}:{}}:null}var S=!1,C=0;function w(e){return Array.isArray(e)?e.map(x).filter(e=>e!==null).slice(0,f):[]}async function T(e){let n=++C;try{if(typeof localStorage>`u`)return;let r=await t(e);if(n!==C)return;await i(u,r)}catch{}}async function E(){let e=h;if(!e||e.length<2)return 0;let n=e.slice(0,-1),i=++C,a=await t(n);if(i!==C)return 0;h=n;let o=r(u,a);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(d,{detail:n}))}catch{}return o}a(u,E);function D(){try{if(typeof localStorage>`u`)return[];let e=localStorage.getItem(u);if(!e)return[];let t=w(JSON.parse(e));return t.length&&T(t),t}catch{return[]}}async function O(){try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(u);if(!e)return;try{JSON.parse(e);return}catch{}let t=w(await n(e));if(S)return;h=t,S=!0,typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(d,{detail:t}))}catch{}}var k=O();function A(){return k}function j(){return h||(h=D(),h)}function M(e){let t=w(e);h=t,S=!0,T(t);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(d,{detail:t}))}catch{}}function N(){return j()}function P(e){let t=e.map(x).filter(e=>e!==null);if(!t.length)return 0;let n=new Map(j().map(e=>[e.id,e]));for(let e of t){let t=n.get(e.id);(!t||e.savedAt>=t.savedAt)&&n.set(e.id,e)}return M([...n.values()].sort((e,t)=>t.savedAt-e.savedAt)),t.length}function F(e,t,n=Date.now()){try{let r=t.trim();if(!r||!b(e)||e.blocks.length===0)return;let i=y(e),a={id:_(),question:r,title:i.title??``,savedAt:n,lead:l(i),spec:i,...i.topic?{topic:i.topic}:{}};if(JSON.stringify(a).length>p)return;let o=v(r);M([a,...j().filter(e=>v(e.question)!==o)].slice(0,f))}catch{}}function I(e){let t=j().filter(t=>t.id!==e);t.length!==j().length&&M(t)}function L(){M([])}export{I as a,P as i,L as n,F as o,N as r,A as s,d as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./friendlyAsk-BBdRZIar.js";import{n as t,t as n}from"./contentVault-xfUwSJ3i.js";var r=`mavea-live-atlas-v1`,i=r,a=500,o=null,s=!1,c=0;function l(e){return e.replace(/\s+/g,` `).trim().toLowerCase()}function u(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&typeof t.question==`string`&&typeof t.title==`string`&&typeof t.firstSeen==`number`&&typeof t.savedAt==`number`&&typeof t.blocks==`number`}function d(t){return Array.isArray(t)?t.filter(u).map(t=>({...t,question:e(t.question)})):[]}async function f(e){let n=++c;try{let i=await t(e);if(n!==c)return;localStorage.setItem(r,i)}catch{}}function p(){try{let e=localStorage.getItem(r);if(!e)return[];let t=d(JSON.parse(e));return t.length&&f(t),t}catch{return[]}}async function m(){try{let e=localStorage.getItem(r);if(!e)return;try{JSON.parse(e);return}catch{}let t=d(await n(e));if(s)return;o=t,s=!0,window.dispatchEvent(new CustomEvent(i))}catch{}}var h=m();function g(){return h}function _(){return o??=p(),o}function v(e){let t=d(e);o=t,s=!0,f(t);try{window.dispatchEvent(new CustomEvent(i))}catch{}}function y(){return _()}function b(e){let t=d(e);if(!t.length)return 0;let n=new Map(_().map(e=>[e.id,e]));for(let e of t){let t=n.get(e.id);if(!t)n.set(e.id,e);else{let r=Math.min(t.firstSeen,e.firstSeen);n.set(e.id,e.savedAt>=t.savedAt?{...e,firstSeen:r}:{...t,firstSeen:r})}}return v([...n.values()].sort((e,t)=>t.savedAt-e.savedAt).slice(0,a)),t.length}function x(e){try{let t=[..._()],n=new Map(t.map(e=>[e.id,e])),r=!1;for(let t of e){let e=l(t.question);if(!e)continue;let i={id:e,question:t.question,title:t.title,firstSeen:n.get(e)?.firstSeen??t.savedAt,savedAt:t.savedAt,blocks:t.spec.blocks.length,...t.topic?{topic:t.topic}:{}},a=n.get(e);a&&a.savedAt===i.savedAt&&a.blocks===i.blocks||(n.set(e,i),r=!0)}if(!r)return t.length;let i=[...n.values()].sort((e,t)=>t.savedAt-e.savedAt).slice(0,a);return v(i),i.length}catch{return _().length}}function S(e,t){return t.find(t=>l(t.question)===e.id)}var C=`mavea-live-atlas-last-open`;function w(){try{let e=typeof localStorage<`u`?localStorage.getItem(C):null;return e&&parseInt(e,10)||0}catch{return 0}}function T(){try{typeof localStorage<`u`&&localStorage.setItem(C,String(Date.now()))}catch{}}export{S as a,T as i,w as n,x as o,b as r,g as s,y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-DkW27tQK.js";import{r as t}from"./history-D2EH2X6D.js";import{t as n}from"./friendlyAsk-BBdRZIar.js";import{n as r,t as i}from"./contentVault-xfUwSJ3i.js";import{n as a,r as o,t as s}from"./localBudget-CxLP6bjE.js";function c(e){return e.toLowerCase().replace(/['’]/g,``).replace(/[^a-z0-9]+/g,` `).trim()}function l(e,t){let n=t?.failOpen??!1;if(!e||!e.trim())return()=>n;let r=c(e),i=r.split(` `).filter(Boolean);return e=>{let t=c(e);if(!t)return!1;if(r.includes(t))return!0;let n=t.split(` `).filter(Boolean),a=n.length;if(a===0)return!1;let o=Math.ceil(a*.9),s=new Set(n);for(let e=0;e+a<=i.length;e++){let t=0;for(let n=0;n<a;n++)s.has(i[e+n])&&t++;if(t>=o)return!0}return!1}}var u=80,d=120,f=90,p=120,m=120,h=30,g=32,_=/\b(?:trauma(?:ti[sz](?:ed?|ing))?|ptsd|clinical depression|major depression|anxiety disorder|bipolar|narcissistic|borderline personality|attachment disorder|co-?dependent(?:ency)?|dissociat(?:e|ed|ion)|avoidant attachment|anxious attachment|emotional dysregulation|hypervigilance|love-?bombing|codependency|enmeshment|enmeshed|parentif(?:ied|ying)|scapegoat(?:ing)?|golden child)\b/i,v=new Set([`person`,`option`,`want`,`fear`,`constraint`,`tradeoff`,`contradiction`,`open_loop`,`action`,`value`,`question`]),ee=new Set([`supports`,`tensions`,`depends_on`,`same_thread`,`blocks`]),y=new Set([`forming`,`stable`,`maybe`]),b=new Set([`said`,`inferred`]);function x(e,t){if(typeof e!=`string`)return null;let n=e.trim();return n?n.length>t?`${n.slice(0,t-1)}…`:n:null}function S(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=x(n.id,32);if(!r)return null;let i=v.has(n.kind)?n.kind:null;if(!i)return null;let a=x(n.label,u);if(!a)return null;let o=x(n.quote,d);if(!o||_.test(a)||_.test(o)||!t(o))return null;let s=y.has(n.status)?n.status:`stable`,c=b.has(n.confidence)?n.confidence:`said`,l=typeof n.weight==`number`?n.weight:1;return{id:r,kind:i,label:a,quote:o,status:s,confidence:c,weight:Math.max(1,Math.min(3,Math.round(l)))}}function C(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=x(n.from,32),i=x(n.to,32);if(!r||!i||t&&(!t.has(r)||!t.has(i))||r===i)return null;let a=ee.has(n.kind)?n.kind:null;if(!a)return null;let o=typeof n.label==`string`?x(n.label,h)??void 0:void 0;return{from:r,to:i,kind:a,...o?{label:o}:{}}}function te(e,t){if(!e||typeof e!=`object`)return null;let n=e,r=x(n.id,32);if(!r)return null;let i=x(n.label,g);if(!i||_.test(i))return null;let a=Array.isArray(n.atomIds)?n.atomIds:[],o=new Set,s=[];for(let e of a){let n=x(e,32);n&&t.has(n)&&!o.has(n)&&(o.add(n),s.push(n))}if(s.length===0)return null;let c=typeof n.weight==`number`?n.weight:1;return{id:r,label:i,atomIds:s,weight:Math.max(1,Math.min(3,Math.round(c)))}}function w(e,t){let n=null;if(e&&typeof e==`object`&&!Array.isArray(e))n=e;else if(typeof e==`string`){let t=e.match(/\{[\s\S]*\}/);if(!t)return null;try{n=JSON.parse(t[0])}catch{return null}}if(!n)return null;let r=x(n.center,f);if(!r)return null;let i=typeof n.title==`string`?x(n.title,60)??void 0:void 0,a=l(t,{failOpen:!0}),o=(Array.isArray(n.atoms)?n.atoms:[]).map(e=>S(e,a)).filter(e=>e!==null);if(o.length===0)return null;let s=new Set(o.map(e=>e.id)),c=(Array.isArray(n.links)?n.links:[]).map(e=>C(e,s)).filter(e=>e!==null),u=(Array.isArray(n.clusters)?n.clusters:[]).map(e=>te(e,s)).filter(e=>e!==null),d;if(n.unsaid&&typeof n.unsaid==`object`&&!Array.isArray(n.unsaid)){let e=n.unsaid,t=x(e.label,p),r=x(e.why,m);t&&r&&!_.test(t)&&!_.test(r)&&(d={label:t,why:r,confidence:`maybe`})}return{center:r,...i?{title:i}:{},atoms:o,links:c,...u.length?{clusters:u}:{},...d?{unsaid:d}:{}}}function T(e,t){let n=null;if(e&&typeof e==`object`&&!Array.isArray(e))n=e;else if(typeof e==`string`){let t=e.match(/\{[\s\S]*\}/);if(!t)return null;try{n=JSON.parse(t[0])}catch{return null}}if(!n)return null;let r=l(t,{failOpen:!0}),i=(Array.isArray(n.add)?n.add:[]).map(e=>S(e,r)).filter(e=>e!==null),a=(Array.isArray(n.addLinks)?n.addLinks:[]).map(e=>C(e)).filter(e=>e!==null);return i.length===0&&a.length===0?null:{add:i,addLinks:a}}var E=e({SESSION_STORAGE_KEY:()=>O,SESSION_TTL_MS:()=>k,SESSION_TURNS_CAP:()=>10,clearSession:()=>$,hasSavedSession:()=>Q,loadSession:()=>Z,saveSession:()=>Y,whenSessionSettled:()=>X});function D(e){return e===`replace`||e===`augment`||e===`refine`}var O=`mavea-live-session-v1`,k=6048e5,A=6e5,j=4096;function M(e){let t=JSON.stringify(e,(e,t)=>typeof t==`string`&&t.length>j&&t.startsWith(`data:`)?``:t);return JSON.parse(t)}function N(e){return!!e&&typeof e==`object`&&Array.isArray(e.blocks)}function P(e){if(!e||typeof e!=`object`)return null;let t=e;return t.role!==`user`&&t.role!==`assistant`||typeof t.content!=`string`?null:{role:t.role,content:t.role===`user`?n(t.content):t.content}}function F(e,t){if(!e||typeof e!=`object`)return null;let n=e;if(![`circle`,`underline`,`point`,`highlight`,`rising`,`falling`,`bracket`,`note`,`connect`].includes(n.kind)||typeof n.at!=`string`||!n.at)return null;let r={kind:n.kind,at:n.at};if(typeof n.to==`string`&&n.to&&(r.to=n.to),typeof n.label==`string`&&n.label&&(r.label=n.label),r.kind===`note`&&!r.label)return null;if((n.color===`key`||n.color===`cool`)&&(r.color=n.color),r.kind===`connect`){let e=typeof n.onIndex==`number`?Math.round(n.onIndex):-1;if(!r.to||e<0||e>=t)return null;r.onIndex=e}return r}function I(e,t){if(!Array.isArray(e))return[];let n=[];for(let r of e){if(!r||typeof r!=`object`)continue;let e=r;if(typeof e.index!=`number`)continue;let i={index:e.index,...typeof e.say==`string`?{say:e.say}:{},...typeof e.saySpoken==`string`?{saySpoken:e.saySpoken}:{}},a=F(e.mark,t);if(a&&(i.mark=a),Array.isArray(e.marks)){let n=e.marks.map(e=>F(e,t)).filter(e=>e!==null);n.length&&(i.marks=n)}n.push(i)}return n}function L(e){if(!e||typeof e!=`object`)return null;let r=e;if(!N(r.spec)||r.spec.blocks.length===0||typeof r.question!=`string`)return null;let i=r.mind?w(r.mind):null,a={question:n(r.question),...typeof r.id==`string`&&r.id.trim()?{id:r.id}:{},narration:typeof r.narration==`string`?r.narration:``,...typeof r.spoken==`string`?{spoken:r.spoken}:{},mode:D(r.mode)?r.mode:`replace`,...typeof r.topicShift==`boolean`?{topicShift:r.topicShift}:{},tour:I(r.tour,r.spec.blocks.length),spec:r.spec,at:typeof r.at==`number`&&Number.isFinite(r.at)?r.at:0,...i?{mind:i}:{}};return a.id=t(a),a}var R=null,z=!1,B=null,V=0,H=0;function U(e){let t=e;if(!t||typeof t!=`object`||t.v!==1||typeof t.savedAt!=`number`||!Number.isFinite(t.savedAt)||!Array.isArray(t.frames))return null;let n=t.frames.map(L).filter(e=>e!==null).slice(-10);if(!n.length)return null;let r=(Array.isArray(t.history)?t.history:[]).map(P).filter(e=>e!==null);return{v:1,savedAt:t.savedAt,history:r,frames:n}}async function W(e){let t=++H;try{if(typeof localStorage>`u`)return;let n=await r(e);if(t!==H)return;await o(O,n)}catch{}}async function G(){let e=R;if(!e||e.frames.length<2)return 0;let t={...e,frames:e.frames.slice(1)},n=++H,i=await r(t);return n===H?(R=t,a(O,i)):0}s(O,G);function K(){try{if(typeof localStorage>`u`)return null;let e=localStorage.getItem(O);if(!e)return null;let t=U(JSON.parse(e));return t&&W(t),t}catch{return null}}var q=null;function J(){return z?Promise.resolve():q||(q=(async()=>{try{if(typeof localStorage>`u`)return;let e=localStorage.getItem(O);if(!e)return;let t,n=!1;try{t=U(JSON.parse(e)),n=t!==null}catch{t=U(await i(e))}if(z)return;R=t,t&&(B=t,n&&W(t))}catch{}finally{z=!0,q=null}})(),q)}J();function Y(e,t,n=Date.now()){if(!z){let r=V;J().then(()=>{r===V&&(z=!0,Y(e,t,n))});return}try{if(typeof localStorage>`u`)return;if(!t.length){$();return}let r=B&&n-B.savedAt<=6048e5?B:null,i=r?.frames.length?r.frames[r.frames.length-1]:null,a=!!i&&!t.some(e=>e.at===i.at),o=a?[...r.frames,...t]:t,s=a?[...r.history,...e]:e,c=M(o.slice(-10)).map(L).filter(e=>e!==null),l={v:1,savedAt:n,history:s.slice(-20).map(P).filter(e=>e!==null),frames:c},u=JSON.stringify(l);if(u.length>A&&c.length>1){let e=u.length,t=0;for(;e>A&&c.length-t>1;)e-=JSON.stringify(c[t]).length+1,t++;c=c.slice(t),l={...l,frames:c},u=JSON.stringify(l)}if(u.length>A)return;R=l,z=!0,W(l)}catch{}}function X(e=1200){return z?Promise.resolve():Promise.race([J(),new Promise(t=>setTimeout(t,e))]).then(()=>void 0)}function Z(e=Date.now()){let t=R??K();return t&&!R&&(R=t,z=!0),t?e-t.savedAt>6048e5?null:t:(J(),null)}function Q(){if(R)return!0;try{return typeof localStorage<`u`&&!!localStorage.getItem(`mavea-live-session-v1`)}catch{return!1}}function $(){R=null,B=null,z=!0,V++,H++;try{typeof localStorage<`u`&&localStorage.removeItem(O)}catch{}}export{Y as a,T as c,Z as i,$ as n,E as o,Q as r,w as s,O as t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/liveSchema-DyfND6P2.js","assets/icons-gLFQTv74.js","assets/jsx-runtime-DeHZSEgm.js","assets/rolldown-runtime-DkW27tQK.js","assets/spokenText-C88IQJ0M.js","assets/safeImageUrl-BINWXOTz.js","assets/catalog-BHjl-1uH.js","assets/sourceHost-BV3t2XDb.js","assets/annotations-CftUUB13.js","assets/catalog-Db9GWM6N.js","assets/preload-helper-CiWYd9n-.js","assets/facts-BUGuVUIc.js","assets/blockTypes-DUDdP3pB.js","assets/streamParse-BX0bAppQ.js"])))=>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{n as r,t as i}from"./preload-helper-CiWYd9n-.js";import{i as a,t as o}from"./http-Lar_UMKb.js";import{E as s,G as c,H as l,L as u,P as d,U as f,V as p,_ as m,b as h,m as g,p as _,s as v,v as y,y as b,z as ee}from"./store-Ba9vzL4H.js";import{t as te}from"./providers-0DthJW_I.js";import{l as x,n as S}from"./useLiveConfig-B4CmBiAK.js";import{t as ne}from"./json-B0N3XRZU.js";import{i as C}from"./number-zqlPMliA.js";import{i as w,n as T,r as E}from"./ledger-Cv0LBflx.js";import{d as re,i as D,l as O,o as ie,u as k}from"./format-g3dP8OI3.js";import{t as A}from"./dataPending-DGdCvY5Y.js";import{t as j}from"./now-C9-UAzTC.js";import{n as ae,t as oe}from"./predictions-CkVKHq-5.js";import{t as se}from"./notify-Bz4wuE4T.js";import{a as M,i as ce,r as le,t as ue,u as de}from"./dashboardEvents-CiayRLrH.js";var N=t(),fe=n(),pe=`mavea-dashboard-scheduler`;function me(){if(typeof navigator>`u`)return null;let e=navigator.locks;return typeof e?.request==`function`?e:null}async function he(e){let t=me();if(!t){await e();return}try{await t.request(pe,{ifAvailable:!0},async t=>{t&&await e()})}catch{await e()}}function ge(e){return new Set(e.toLowerCase().replace(/[^a-z0-9 ]/g,` `).replace(/\s+/g,` `).trim().split(` `).filter(e=>e.length>3))}function P(e){return e.replace(/\s+/g,` `).trim().toLowerCase()}var _e={WATCHING:`watching`,CLEAR:`clear`,TRIGGERED:`triggered`,AWAITING:`awaiting`},ve={ORIGIN:`origin`,ADDED:`added`,LINKED:`linked`},ye={CLEAR:1,WATCHING:.75,TRIGGERED:0,AWAITING:0};function be(e){let t=e.tripwires.filter(e=>e.state!==`AWAITING`);if(t.length===0)return null;let n=t.reduce((e,t)=>e+ye[t.state],0);return Math.round(100*n/t.length)}function xe(e){return e===null?``:e>=80?`Tracking well`:e>=55?`Holding, with risks`:e>=30?`Slipping`:`Lines are breaking`}var Se=new Set([`thesis`,`alignmentgauge`,`standingalerts`,`sourceslineage`]);function Ce(e){let t=e.block.type;return Se.has(t)?!0:!!e.metricId&&t===`insight`}function we(e,t){let n=t.block.type;if(!Se.has(n)){if(t.metricId&&n===`insight`){let n=e.metrics.find(e=>e.id===t.metricId);if(n){let e=n.lastValue===null?`—`:n.lastRaw??O(String(n.lastValue),n.unit),r=n.lastValue===null?`inferred`:`strong`,i=t.block.props;return{...t.block,props:{...i,stat:e,conf:r}}}}return t.block}let r=e.sources.find(e=>e.kind===`ORIGIN`);if(n===`thesis`){let n=e.tripwires[0],i={reasoning:e.thesis.text,...r?{asOf:r.title}:{},...n?{reconsiderIf:n.label,tripwireState:_e[n.state]}:{}};return{...t.block,props:i}}if(n===`alignmentgauge`){let n=be(e),r={pct:n,band:xe(n)};return{...t.block,props:r}}if(n===`standingalerts`){let n={alerts:e.tripwires.map(e=>({label:e.label,state:_e[e.state]}))};return{...t.block,props:n}}let i={rows:e.sources.map(e=>({kind:ve[e.kind],label:e.title,...e.contributed?{contributed:e.contributed}:{}}))};return{...t.block,props:i}}var Te={metric:`{"kind":"metric","value":number,"raw"?:string}`,series:`{"kind":"series","points":[{"label":string,"value":number}]}`,list:`{"kind":"list","items":[string]}`,table:`{"kind":"table","columns":[string],"rows":[[string]]}`,event:`{"kind":"event","events":[{"when":string,"title":string,"detail"?:string}]}`};function F(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function I(e){return Array.isArray(e)?e:[]}function L(e){return typeof e==`string`?e.trim():typeof e==`number`&&Number.isFinite(e)?String(e):typeof e==`boolean`?e?`yes`:`no`:``}function R(e,...t){for(let n of t){let t=L(e[n]);if(t)return t}return``}function Ee(e){if(!F(e))return L(e);let t=R(e,`text`,`label`,`title`,`name`,`item`);if(t){let n=Object.entries(e).filter(([e])=>![`text`,`label`,`title`,`name`,`item`].includes(e)).map(([,e])=>L(e)).filter(Boolean);return n.length?`${t} — ${n.join(` — `)}`:t}return Object.values(e).map(L).filter(Boolean).join(` — `)}function De(e,t){let n=F(t)?t:{};switch(e){case`metric`:{let e=C(n.value??n.number??n.amount??t);if(e===null)return null;let r=R(n,`raw`,`display`,`formatted`);return{kind:`metric`,value:e,...r?{raw:r}:{}}}case`series`:{let e=I(n.points??n.data??n.series).map(e=>{let t=F(e)?e:{},n=R(t,`label`,`name`,`x`,`when`,`date`),r=C(t.value??t.y??t.amount);return n&&r!==null?{label:n,value:r}:null}).filter(e=>e!==null);return e.length?{kind:`series`,points:e}:null}case`list`:{let e=I(n.items??n.list??n.entries??t).map(Ee).filter(Boolean);return e.length?{kind:`list`,items:e}:null}case`table`:{let e=I(n.rows??n.data??t),r=I(n.columns??n.headers??n.cols).map(L).filter(Boolean);!r.length&&F(e[0])&&(r=Object.keys(e[0]).map(L));let i=e.map(e=>Array.isArray(e)?e.map(L):F(e)?r.map(t=>L(e[t])):[]).filter(e=>e.some(Boolean));return r.length&&i.length?{kind:`table`,columns:r,rows:i}:null}case`event`:{let e=I(n.events??n.items??t).map(e=>{let t=F(e)?e:{},n=R(t,`title`,`name`,`event`,`label`);if(!n)return null;let r=R(t,`when`,`date`,`time`,`at`,`start`),i=R(t,`detail`,`description`,`note`,`status`);return{when:r,title:n,...i?{detail:i}:{}}}).filter(e=>e!==null);return e.length?{kind:`event`,events:e}:null}}}var Oe={list:`list`,checklist:`list`,timeline:`event`,datatable:`table`,standings:`table`,chart:`series`,bars:`series`};function z(e){return Oe[e]??null}function B(e,t){return e.raw??O(String(e.value),t)}function ke(e,t,n={},r){let i=typeof n.title==`string`?n.title:``,a={...i?{title:i}:{},...n.icon?{icon:n.icon}:{}};switch(e){case`insight`:return t.kind===`metric`?{...n,...a,stat:B(t,r),conf:`strong`}:null;case`kpi`:return t.kind===`metric`?{...a,items:[{label:i||`Now`,value:B(t,r)}]}:t.kind===`series`?{...a,items:t.points.slice(-4).map(e=>({label:e.label,value:String(e.value)}))}:null;case`list`:case`checklist`:{let n=t.kind===`list`?t.items:t.kind===`event`?t.events.map(e=>[e.when,e.title,e.detail].filter(Boolean).join(` — `)):t.kind===`series`?t.points.map(e=>`${e.label} — ${e.value}`):t.kind===`table`?t.rows.map(e=>e.filter(Boolean).join(` — `)):null;return n?.length?e===`checklist`?{...a,rows:n.map(e=>({t:e,st:`todo`}))}:{...a,items:n}:null}case`timeline`:return t.kind===`event`?{...a,events:t.events.map(e=>({time:e.when,title:e.title,...e.detail?{detail:e.detail}:{}}))}:null;case`datatable`:{if(t.kind!==`table`)return null;let e=t.columns.map((e,t)=>({key:`c${t}`,label:e}));return{...a,columns:e,rows:t.rows.map(e=>Object.fromEntries(e.map((e,t)=>[`c${t}`,e])))}}case`standings`:{if(t.kind!==`table`)return null;let e=t.rows.map(e=>({team:e[0]??``,rec:e[1]??``,gb:e[2]??``})).filter(e=>e.team);return e.length?{...a,rows:e}:null}case`chart`:return t.kind===`series`?{...a,labels:t.points.map(e=>e.label),series:[{name:i||`Value`,color:`var(--insight)`,data:t.points.map(e=>e.value)}],conf:`strong`}:null;case`bars`:return t.kind===`series`?{...a,bars:t.points.map(e=>({label:e.label,value:e.value})),conf:`strong`}:null;default:return null}}r();function Ae(e){let t=e instanceof Error?e.message:String(e);if(/\b429\b|rate.?limit/i.test(t)){let e=Number(/(?:in|after)\s+([\d.]+)\s*s/i.exec(t)?.[1]);return Number.isFinite(e)&&e>0?{kind:`rate-limit`,retryAt:Date.now()+Math.min(e*1e3,12e4)}:{kind:`rate-limit`}}return/\b401\b|\b403\b|api key|unauthor/i.test(t)?{kind:`auth`}:/\b5\d\d\b|overloaded|unavailable|capacity/i.test(t)?{kind:`provider-unavailable`}:{kind:`network`}}function je(e,t,n,r){switch(e){case`gt`:return t>r;case`gte`:return t>=r;case`lt`:return t<r;case`lte`:return t<=r;case`crosses_up`:return n!==null&&n<r&&t>=r;case`crosses_down`:return n!==null&&n>r&&t<=r;case`pct_rise`:return n!==null&&n!==0&&(t-n)/Math.abs(n)*100>=r;case`pct_drop`:return n!==null&&n!==0&&(n-t)/Math.abs(n)*100>=r;default:return!1}}function Me(e,t,n){if(n===0)return!0;let r=t/n;switch(e){case`gt`:case`gte`:return r>=.9;case`lt`:case`lte`:return r<=1.1;default:return!0}}function Ne(e,t,n){return t===null?`AWAITING`:je(e.comparator,t,n,e.threshold)?`TRIGGERED`:Me(e.comparator,t,e.threshold)?`WATCHING`:`CLEAR`}function V(e,t={}){let n=new Map(e.metrics.map(e=>[e.id,e])),r=[];return{tripwires:e.tripwires.map(e=>{let i=n.get(e.metricId),a=i?i.lastValue:null,o=Ne(e,a,e.metricId in t?t[e.metricId]:a),s=o===`TRIGGERED`&&e.state!==`TRIGGERED`?{...e,state:o,brokenValue:a??void 0,brokenAt:i?.asOf}:{...e,state:o};return o===`TRIGGERED`&&e.state!==`TRIGGERED`&&r.push(s),s}),newlyTriggered:r}}function Pe(e,t){return e.nextDataAt<=t||e.oneShotAt!==void 0&&e.oneShotAt<=t}function H(e){return e.oneShotAt===void 0?e.nextDataAt:Math.min(e.nextDataAt,e.oneShotAt)}function Fe(e,t=Date.now(),n=4){return e.filter(e=>Pe(e,t)).sort((e,t)=>H(e)-H(t)).slice(0,n)}function Ie(e,t=Date.now()){return e.filter(e=>e.nextAiAt<=t).sort((e,t)=>e.nextAiAt-t.nextAiAt)[0]??null}function U(e,t,n=Date.now()){return e.smartTrigger&&t.length>0?{fire:!0,trigger:t[0]}:(e.cadence.ai===`daily`||e.cadence.ai===`weekly`)&&n>=e.nextAiAt?{fire:!0,trigger:`scheduled`}:{fire:!1,trigger:null}}function W(e){let t=[];for(let n of o(e.sources)){let e=a(n);typeof e.title==`string`&&typeof e.url==`string`&&t.push({title:e.title,url:e.url})}return t}function G(e,t){return(e.sources?.length??0)>0||W(t).length>0}function Le(e){return`- VALUE "${e.label}" — ${e.query}`}function Re(e,t,n){let r=z(e.block.type);return r?`- DATA #${t} [${r}] ${e.refreshQuery}\n return EXACTLY: ${Te[r]}`:`- BLOCK #${t} [${e.block.type}] ${e.refreshQuery}\n`+(n?` expected props (use EXACTLY these field names): ${n}\n`:``)+` current content: ${JSON.stringify(e.block.props??{}).slice(0,600)}`}function ze(){return{values:{},widgets:{}}}function Be(e){return{metrics:e.metrics.filter(e=>e.query.trim()!==``&&!e.blankKey),targets:e.widgets.filter(e=>!!e.refreshQuery?.trim()&&!Ce(e))}}function Ve(e){let t=[e.block.type];if(e.block.type===`composite`){let n=e.block.props.regions;for(let e of n??[]){let n=e?.block?.type;typeof n==`string`&&n&&t.push(n)}}return t}function He(e,t,n){let r=n.reduce((e,t)=>e+(z(t.block.type)?300:1200),0);return 400+t.length*120+r+(e.prediction?150:0)}var Ue=12e3;function K(e){let t=[],n=1200;for(let r of e){let{metrics:e,targets:i}=Be(r);if(e.length===0&&i.length===0)continue;let a=He(r,e,i);if(t.length>0&&n+a>Ue)break;n+=a,t.push({d:r,metrics:e,targets:i})}return t}function We(e,t){let n=Math.max(0,Math.round((t-e)/6e4));if(n<60)return`${n}m ago`;let r=Math.round(n/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function Ge(e,t,n){let r=[...e.metrics.map(Le),...e.targets.map((e,t)=>Re(e,t,n(e.block.type))),...e.d.prediction?[`- PREVIOUS EXPECTATION (made ${We(e.d.prediction.at,t)}): "${e.d.prediction.text}" — grade it.`]:[]];return`DASHBOARD ${e.d.id} "${e.d.title}"\n${r.join(`
|
|
3
|
-
`)}`}function Ke(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function qe(e,t){let n=e.dashboards;if(n===void 0&&t.length===1)return{[t[0].d.id]:e};let r=new Map,i=[];if(Array.isArray(n))for(let e of n){let t=a(e);i.push(t),typeof t.id==`string`&&t.id&&r.set(t.id,t)}else if(Ke(n))for(let[e,t]of Object.entries(n))r.set(e,a(t));let o={};return t.forEach((e,t)=>{o[e.d.id]=r.get(e.d.id)??i[t]??{}}),o}function Je(e){let t=a(e);if(typeof t.metricLabel!=`string`||!t.metricLabel.trim())return;let n=o(t.readings).filter(e=>typeof e==`string`&&!!e.trim());if(!(n.length<2))return{metricLabel:t.metricLabel.trim(),readings:n,note:typeof t.note==`string`?t.note.trim().slice(0,200):``}}function Ye(e){let t=a(e),n=typeof t.start==`string`?Date.parse(t.start):NaN,r=typeof t.end==`string`?Date.parse(t.end):NaN;if(!(!Number.isFinite(n)||!Number.isFinite(r)||r<=n)&&!(r-n>6048e5))return{startAt:n,endAt:r,label:typeof t.label==`string`?t.label.trim().slice(0,60):``}}var Xe=` YOUR PREVIOUS ATTEMPT DID NOT ACTUALLY SEARCH (no citations came back). Before answering this time, you MUST run a real web search for every DASHBOARD section above and report only what those searches returned, listing the real URLs relied on in "sources" — this is not optional. If search is genuinely unavailable or turns up nothing, return null values and omit "sources" entirely; never invent a value or a source just to satisfy this instruction.`;async function Ze(e,t,n={}){let r=Date.now(),s={ok:!0,grounded:!1,perDashboard:{},sources:[],attempts:0};if(e.length===0&&!n.briefingContext)return s;try{let s=te(t.provider),c=e.flatMap(e=>e.targets.filter(e=>!z(e.block.type))),l=new Set(c.flatMap(Ve)),u=l.size>0,d=u?await i(()=>import(`./liveSchema-DyfND6P2.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])):null,f=e.map(e=>Ge(e,r,d?d.blockShapeHint:()=>null)).join(`
|
|
4
|
-
|
|
5
|
-
`),p={type:`object`,properties:{dashboards:{type:`array`,description:`One object per DASHBOARD section above, in the same order, each echoing its id.`,items:{type:`object`,properties:{id:{type:`string`},values:{type:`object`,description:`Map of VALUE label -> current numeric value, or null.`},observations:{type:`array`,description:`Exactly one object per DATA item for this dashboard, in the same order, each in the exact shape that DATA line specifies.`,items:{type:`object`}},blocks:{type:`array`,description:`Exactly one block per BLOCK item for this dashboard, in order.`,items:{type:`object`,properties:{type:{type:`string`},props:{type:`object`}},required:[`type`,`props`]}},expects:{type:`string`,description:`A short "by next check" expectation — omit if nothing here is genuinely predictable.`},grade:{type:`object`,description:`ONLY when this dashboard has a PREVIOUS EXPECTATION line.`,properties:{result:{type:`string`},note:{type:`string`}}},disagreement:{type:`object`,description:`ONLY when two real sources genuinely disagreed on a value.`,properties:{metricLabel:{type:`string`},readings:{type:`array`,items:{type:`string`}},note:{type:`string`}}},liveWindow:{type:`object`,description:`ONLY when search revealed a real, bounded live-event window.`,properties:{start:{type:`string`},end:{type:`string`},label:{type:`string`}}}},required:[`id`]}},...n.briefingContext?{briefing:{type:`string`,description:`2-4 sentences summarizing ALL dashboards (this batch + the given CONTEXT), real values only; use [[shown|said]] pronunciation twins for speech-risky terms.`}}:{},sources:{type:`array`,description:`OMIT unless this call used web search. Real source URLs actually relied on — never invented.`,items:{type:`object`,properties:{title:{type:`string`},url:{type:`string`}},required:[`title`,`url`]}}},required:[`dashboards`]},m=u===!1,h=Math.min(m?4e3:14e3,Math.max(m?1500:3e3,1200+e.reduce((e,t)=>e+He(t.d,t.metrics,t.targets),0)+(n.briefingContext?700:0))),g=j()+` You are checking several standing trackers at once. Return ONLY JSON: {"dashboards": [{"id": string, "values": {...}, "observations": [...], "blocks": [...], "expects"?: string, "grade"?: {...}, "disagreement"?: {...}, "liveWindow"?: {...}}, ...], `+(n.briefingContext?`"briefing": string, `:``)+`"sources": [...]}. Use web search for every DASHBOARD section below — never invent a value or detail. ECHO each dashboard's exact "id" so results map back correctly. For a VALUE item, give its CURRENT real number (no units) or null if unverifiable. For a BLOCK For a DATA item, return ONE object in "observations" (same order as the DATA lines) in the exact shape that line prints — plain data, no component or prop names, and omit the entry entirely rather than inventing a value you did not find. For a BLOCK item, produce exactly one block whose "type" is the EXACT bracketed type given — never substitute a different one — matching its current content for detail level (real names, numbers, dates). Where a BLOCK lists "expected props", copy that shape EXACTLY: the same field names, and an array shown as string[] takes plain strings, never objects. CRITICAL — a "current content" showing something live, in progress, or upcoming is NOT necessarily still true right now: explicitly check whether it has SINCE concluded and report the concluding outcome if so, reasoning from the date/time above which of upcoming/live/finished applies at this exact moment. If a dashboard has a PREVIOUS EXPECTATION line, grade it honestly ("hit" it came true, "miss" it did not, "unclear" if genuinely unknowable yet) — grade ONLY dashboards that have this line, never invent a grade otherwise. Offer a fresh "expects" only when something is genuinely predictable by the next check; most checks have nothing worth predicting, so omit it far more often than not. If two real sources genuinely disagree on a value, report it in "disagreement" instead of silently picking one. If search reveals a real bounded live-event window (a match's actual start/end time) for a dashboard, report it in "liveWindow" with ISO start/end — never invent a time. `+(n.briefingContext?`Also compose "briefing": 2-4 warm, concrete sentences summarizing ALL dashboards — this batch PLUS the CONTEXT lines below (already-known values — do NOT search for those, use them as given) — real values only, never memory. The briefing is displayed and spoken: preserve normal spelling on the left, but wrap every name, place, brand, or non-English term a voice might mispronounce as [[shown|said]] (for example [[Omakase|oh-mah-kah-seh]]). The said side must be lowercase voice-safe syllables matching a native/source-language pronunciation, never IPA or an Anglicized guess. `:``)+`If search genuinely turns up nothing more specific than what is already shown, say so honestly rather than inventing new specifics or repeating the old ones as if just confirmed. CITE SOURCES — every real URL actually relied on, in "sources"; omit it entirely if you used no search.`,_=`Use web search.\n\n${f}`+(n.briefingContext?`\n\nCONTEXT (already known — do not search these):\n${n.briefingContext}`:``),v=e=>s.generate({system:e?g+Xe:g,history:[],user:_,maxTokens:h,temperature:.15,thinkingLevel:e?`high`:`low`,tools:{webSearch:!0,requireSearch:!0},format:p,...u?{blockTypes:[...l],complexity:`brief`}:{}},t).then(e=>({rr:e,grounded:G(e,a(ne(e.raw)))})),y=await v(!1),b=1;!y.grounded&&e.length>0&&(y=await v(!0),b=2);let{rr:x}=y,S=a(ne(x.raw)),w=G(x,S),T=qe(S,e),E=x.sources&&x.sources.length?x.sources:W(S),re=[...new Set(E.map(e=>ie(e.url)).filter(Boolean))],D=d?d.validateLiveResponse:null,k={};for(let t of e){let e=T[t.d.id]??{},n=ze();if(w&&t.metrics.length>0){let r=a(e.values),i=new Map(Object.entries(r).map(([e,t])=>[P(e),t]));for(let e of t.metrics){let t=C(r[e.label]??i.get(P(e.label)));t!==null&&(n.values[e.id]={value:t,raw:O(String(t),e.unit)})}}if(t.targets.length>0&&w){let i=o(e.observations??e.data);t.targets.forEach((e,a)=>{let o=z(e.block.type);if(!o)return;let s=De(o,i[a]);if(!s)return;let c=e.block.props??{},l=e.metricId?t.d.metrics.find(t=>t.id===e.metricId):void 0,u=ke(e.block.type,s,c,l?.unit);u&&(n.widgets[e.id]={...e.block,props:u},ee(t.d.id,e.id,s,r,re))})}if(t.targets.length>0&&D){let r=o(e.blocks);t.targets.forEach((e,t)=>{if(z(e.block.type))return;let i=r[t];if(!i)return;let a=D({narration:``,title:`x`,sub:``,blocks:[i]},new Set(Ve(e)),1,w,!0)?.blocks[0];a&&a.type===e.block.type&&(n.widgets[e.id]=a)})}if(w){let r=oe(e.expects);if(r&&(n.expects=r),t.d.prediction){let t=ae(e.grade);t&&(n.grade=t)}let i=Je(e.disagreement);i&&(n.disagreement=i);let a=Ye(e.liveWindow);a&&(n.liveWindow=a)}k[t.d.id]=n}Object.values(k).every(e=>Object.keys(e.values).length===0&&Object.keys(e.widgets).length===0&&!e.expects)&&console.warn(`[dashboards] refreshDashboards got a response but nothing parsed out of it for any dashboard (${w?`empty/unparseable`:`ungrounded after ${b} attempt${b>1?`s`:``}, discarded`})`,{dashboardIds:e.map(e=>e.d.id),raw:x.raw});let A=n.briefingContext&&w&&typeof S.briefing==`string`&&S.briefing.trim()?S.briefing.trim():void 0;return{ok:!0,grounded:w,perDashboard:k,sources:E,attempts:b,...A?{briefing:A}:{}}}catch(t){console.error(`[dashboards] refreshDashboards failed`,t);let n={};for(let t of e)n[t.d.id]=ze();return{ok:!1,grounded:!1,perDashboard:n,sources:[],attempts:0,failure:Ae(t)}}}function Qe(e){let t=Array.isArray(e?.sources)?e.sources:[],n=[];for(let e of t){let t=e&&typeof e==`object`?e:{};typeof t.title==`string`&&typeof t.url==`string`&&n.push({title:t.title,url:t.url})}return n}function $e(e){try{let t=typeof e==`string`?JSON.parse(et(e)):e,n=t?.verdict;return{text:typeof n==`string`&&n.trim()?n.trim():null,sources:Qe(t)}}catch{return{text:typeof e==`string`&&e.trim()?e.trim():null,sources:[]}}}function et(e){let t=e.indexOf(`{`),n=e.lastIndexOf(`}`);return t>=0&&n>t?e.slice(t,n+1):e}async function q(e,t,n,r=Date.now()){try{let i=te(n.provider),a=t===`scheduled`?null:t,o=a?e.metrics.find(e=>e.id===a.metricId):void 0,s=e.metrics.map(e=>`${e.label}=${e.lastRaw??`—`}`).join(`, `),c=a?`A line the user set just crossed: "${a.label}" — ${o?.label??a.label} is now ${o?.lastRaw??a.brokenValue??`past the threshold`}. Currently tracked: ${s}. Using web search, say briefly and honestly what the latest numbers show and whether this reads as a real move or just noise.`:`Currently tracked: ${s}. Using web search, give a brief, honest read: what the latest numbers show and what has materially changed since the last check.`,l=await i.generate({system:j()+` You give a brief, honest read on the latest numbers a user is tracking: what they show now, what has materially changed since the last check, and — if a specific line was crossed — whether that looks like a real move or noise. One or two plain sentences. Never invent data. CITE YOUR SOURCES — whenever you used web search, include the exact source URLs you actually relied on as a top-level "sources": [{"title": string, "url": string}] array; only real URLs from the search results — never invent one, and omit "sources" entirely if you didn’t search. Return ONLY JSON: {"verdict":"…","sources":[...]}.`,history:[],user:c,maxTokens:700,temperature:.3,thinkingLevel:`low`,tools:{webSearch:!0}},n),{text:u,sources:d}=$e(l.raw);return u?{text:u,at:r,grounded:(l.sources?.length??0)>0||d.length>0,...l.sources&&l.sources.length?{sources:l.sources}:{},...a?{tripwireId:a.id}:{}}:null}catch(e){return console.error(`[dashboards] analyzeMove failed`,e),null}}function tt(e){let t=(e??[]).slice(-3);if(t.length<3)return 0;let[n,r,i]=t;return n.value<r.value&&r.value<i.value?1:n.value>r.value&&r.value>i.value?-1:0}function nt(e){let t=e.metrics.filter(e=>(e.history?.length??0)>=3);for(let n=0;n<t.length;n++)for(let r=n+1;r<t.length;r++){let i=t[n],a=t[r],o=tt(i.history);if(o!==0&&o===tt(a.history))return{text:`${i.label} and ${a.label} have moved together over the last three checks.`,dashboardIds:[e.id]}}return null}function rt(e,t){let n=e.filter(e=>{let n=e.cadence.window;return!!n&&t>=n.startAt&&t<=n.endAt});if(n.length<2)return null;let[r,i]=n;return{text:`${r.title} and ${i.title} overlap right now — their checks are batched into shared searches while both are live.`,dashboardIds:[r.id,i.id]}}var it=5;function at(e){if(e.cadence.data!==`15min`&&e.cadence.data!==`hourly`)return null;let t=e.metrics.find(e=>(e.history?.length??0)>=it);if(!t?.history)return null;let n=t.history.slice(-5);return n.every(e=>e.value===n[0].value)?{text:`${t.label} hasn't moved across ${e.title}'s last ${it} checks.`,dashboardIds:[e.id]}:null}function ot(e,t){let n=t.note?` ${t.note}`:``;return{text:`Sources disagreed on ${t.metricLabel}: ${t.readings.join(` vs `)}.${n}`,dashboardIds:[e.id]}}var st=432e5;function ct(e,t,n){let r=n-st;return e.some(e=>e.kind===`insight`&&e.at>=r&&e.text===t.text)}function lt(e,t,n,r=2){let i=[],a=rt(e,n);a&&i.push(a);for(let t of e){let e=nt(t);e&&i.push(e);let n=at(t);n&&i.push(n)}return i.filter(e=>!ct(t,e,n)).slice(0,r)}var ut=e({checkAllDashboardsNow:()=>Ct,readDashboardNow:()=>wt,refreshDashboardNow:()=>St,runRefreshBatch:()=>$,selectTickTargets:()=>Tt,useDashboardLoop:()=>Et,useVerdictPending:()=>ht}),dt=15e3,ft=3e5;function pt(e,t){switch(e?.kind){case`rate-limit`:return e.retryAt?Math.max(15e3,e.retryAt-t):6e4;case`provider-unavailable`:return 12e4;case`auth`:return 216e5;default:return ft}}var J=new Set,Y=new Set,X=`mavea-dashboard-verdict-pending`;function Z(e,t){t?Y.add(e):Y.delete(e);try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(X,{detail:e}))}catch{}}function mt(e){return window.addEventListener(X,e),()=>window.removeEventListener(X,e)}function ht(e){let t=(0,fe.c)(2),n;return t[0]===e?n=t[1]:(n=()=>Y.has(e),t[0]=e,t[1]=n),(0,N.useSyncExternalStore)(mt,n,gt)}function gt(){return!1}function _t(e,t){return e.map(e=>{let n=t.perDashboard[e.d.id]??{values:{},widgets:{}},r=e.metrics.find(e=>n.values[e.id]);return r?`${e.d.title} at ${n.values[r.id].raw}`:e.targets.some(e=>n.widgets[e.id])?`${e.d.title} updated`:t.grounded?`${e.d.title} checked`:`${e.d.title} — couldn't verify`}).join(` · `)}var Q=`Daily search budget reached — auto-checks paused until midnight. Manual checks still work.`;function vt(e){let t=new Date(e);return t.setHours(0,0,0,0),t.getTime()}function yt(e){let t=vt(e);w().some(e=>e.kind===`savings`&&e.at>=t&&e.text===Q)||T({kind:`savings`,text:Q,dashboardIds:[],searches:0})}async function bt(e,t,n,r,i,a,o=!1){let{d:c}=e,l=Object.keys(t.values).length>0||Object.keys(t.widgets).length>0?`updated`:o?`unverified`:`no-change`,u=c.metrics.map(e=>{let n=t.values[e.id];return n?{...e,lastValue:n.value}:e}),d={...c,metrics:u},{tripwires:f,newlyTriggered:p}=V(d,n),g=c.oneShotAt!==void 0&&c.oneShotAt<=a;v(c.id,{values:Object.entries(t.values).map(([e,t])=>({metricId:e,value:t.value,raw:t.raw,origin:`search`})),blocks:Object.entries(t.widgets).map(([e,t])=>({widgetId:e,block:t})),tripwires:f,outcome:l,...t.expects?{expects:t.expects}:{},...t.grade?{grade:t.grade}:{},...g?{consumedOneShot:!0}:{}},a),p.length&&(se(d,p),T({kind:`alert`,text:`${p.map(e=>e.label).join(`, `)} crossed the line you set.`,dashboardIds:[c.id],searches:0}),d.alerts.inApp&&ue({dashboardId:c.id,dashboardTitle:c.title,tripwireLabel:p[0].label})),t.disagreement&&T({kind:`insight`,text:ot(c,t.disagreement).text,dashboardIds:[c.id],searches:0});let _={...c,tripwires:f},y=U(_,p,a);if(y.fire&&y.trigger&&i){Z(c.id,!0);let e=await q(_,y.trigger,r,a);Z(c.id,!1),e?s(c.id,e,a):h(c.id,a,`Mavéa couldn't get a fresh read — will try again.`),m(c.id,a),T({kind:y.trigger===`scheduled`?`check`:`alert`,text:e?e.text.slice(0,200):`Couldn't get a fresh read on ${c.title}.`,dashboardIds:[c.id],searches:1,...e?.sources?.length?{sourceCount:e.sources.length}:{}})}else y.fire&&y.trigger&&m(c.id,a);return l}async function $(e,t,n,r={}){let i=Date.now(),a={},o=K(e),s=e.filter(e=>!o.some(t=>t.d.id===e.id)),c={};for(let t of e)c[t.id]=Object.fromEntries(t.metrics.map(e=>[e.id,e.lastValue]));for(let e of s)a[e.id]=await bt({d:e,metrics:[],targets:[]},{values:{},widgets:{}},c[e.id],t,n,i);if(o.length===0)return a;let d=new Map(o.map(e=>[e.d.id,f(e.d.id,i)])),m=e=>{for(let t of d.values())e(t)};if(!n)return a;let h=o.map(e=>e.d.id);A(h,!0);try{let e=await Ze(o,t,r.briefing?{briefingContext:r.briefing.context}:{});if(!e.ok){let t=e.failure??{kind:`network`},n=pt(e.failure,i);m(n=>{l(n,`search`,!1,{detail:u(t)}),p(n,{outcome:`failed`,failure:t,attempts:e.attempts})});for(let e of o)y(e.d.id,i+n),b(e.d.id,t,i),a[e.d.id]=`failed`;return a}for(let r of o){let o=e.perDashboard[r.d.id]??{values:{},widgets:{}},s=d.get(r.d.id)??null;l(s,`search`,!0,{count:e.attempts}),l(s,`sources`,e.sources.length>0,{count:e.sources.length,...e.sources.length===0?{detail:`The model answered without citing a live source.`}:{}});let u=Object.keys(o.values).length+Object.keys(o.widgets).length;l(s,`extraction`,u>0,{count:u,...u===0?{detail:`Nothing in the reply matched this tracker’s metrics or cards.`}:{}}),l(s,`grounding`,e.grounded,{...e.grounded?{}:{detail:`Ungrounded — every value from it was discarded.`}}),a[r.d.id]=await bt(r,o,c[r.d.id],t,n,i,!e.grounded);let f=a[r.d.id];l(s,`saved`,f===`updated`||f===`no-change`),l(s,`tripwires`,!0),p(s,{outcome:f===`failed`?`failed`:f,attempts:e.attempts,...f===`unverified`?{failure:{kind:`ungrounded`}}:{}})}r.briefing&&e.briefing&&(M(e.briefing,r.briefing.allDashboards,i),T({kind:`briefing`,text:`Morning briefing compiled — folded into this batched search.`,dashboardIds:o.map(e=>e.d.id),searches:0}));let s=[...new Set(e.sources.map(e=>ie(e.url)))].filter(Boolean);return T({kind:`check`,text:_t(o,e),dashboardIds:o.map(e=>e.d.id),...s.length?{domains:s}:{},searches:1,...e.sources.length?{sourceCount:e.sources.length}:{},...r.manual?{manual:!0}:{}}),a}finally{A(h,!1)}}async function xt(e,t,n,r){let{tripwires:i,newlyTriggered:a}=V(e);d(e.id,i,r),a.length&&(se(e,a),e.alerts.inApp&&ue({dashboardId:e.id,dashboardTitle:e.title,tripwireLabel:a[0].label}));let o={...e,tripwires:i},c=U(o,a,r);if(!c.fire||!c.trigger||!n)return;Z(e.id,!0);let l=await q(o,c.trigger,t,r);Z(e.id,!1),l?s(e.id,l,r):h(e.id,r,`Mavéa couldn't get a fresh read — will try again.`),m(e.id,r),T({kind:c.trigger===`scheduled`?`check`:`alert`,text:l?l.text.slice(0,200):`Couldn't get a fresh read on ${e.title}.`,dashboardIds:[e.id],searches:1,...l?.sources?.length?{sourceCount:l.sources.length}:{}})}async function St(e){if(J.has(e))return`busy`;let t=_(e);if(!t)return`busy`;let n=x(S());if(!n.apiKey)return`no-model`;J.add(e);try{let r=await $([t],n,!0,{manual:!0});return r[e]===`failed`?`failed`:r[e]===`unverified`?`unverified`:`done`}finally{J.delete(e)}}async function Ct(){let e=x(S());if(!e.apiKey)return`no-model`;let t=g().filter(D),n=t.filter(e=>!J.has(e.id));if(n.length===0)return t.length>0?`busy`:`done`;for(;n.length>0;){let t=K(n);if(t.length===0)break;let r=t.map(e=>e.d.id);r.forEach(e=>J.add(e));let i={};try{i=await $(t.map(e=>e.d),e,!0,{manual:!0})}finally{r.forEach(e=>J.delete(e))}if(r.length>0&&r.every(e=>i[e]===`failed`))return`failed`;n=n.filter(e=>!r.includes(e.id))}return`done`}async function wt(e){if(Y.has(e))return`busy`;let t=_(e);if(!t)return`failed`;let n=x(S());if(!n.apiKey)return`no-model`;let r=Date.now(),i=t.tripwires.find(e=>e.state===`TRIGGERED`),a=i??`scheduled`;Z(e,!0);let o;try{o=await q(t,a,n,r)}finally{Z(e,!1)}return o?s(e,o,r):h(e,r,`Mavéa couldn’t get a fresh read — try again in a moment.`),m(e,r),T({kind:i?`alert`:`check`,text:o?o.text.slice(0,200):`Couldn’t get a fresh read on ${t.title}.`,dashboardIds:[e],searches:1,manual:!0,...o?.sources?.length?{sourceCount:o.sources.length}:{}}),o?`done`:`failed`}function Tt(e,t,n,r,i){let a=Fe(e,r).filter(e=>!i.has(e.id)),o=Ie(e,r);o&&i.has(o.id)&&(o=null);let s=k(t,n,r),c=!1;s.paused&&(c=a.some(D)||!!o,a=a.filter(e=>!D(e)),o=null);let l=K(a);return o&&l.some(e=>e.d.id===o.id)&&(o=null),{dueData:a,dueAi:o,pausedAndBlocked:c}}function Et(){let e=(0,N.useRef)(!1);(0,N.useEffect)(()=>{let t=!0,n=async()=>{if(e.current||!t||typeof document<`u`&&document.visibilityState!==`visible`)return;let n=x(S()),r=!!n.apiKey,i=Date.now(),a=g(),o=re(),s=w();de(a,s,e=>E(s,e,i),e=>c(e,i-6048e5,i),i);for(let e of lt(a,s,i))T({kind:`insight`,text:e.text,dashboardIds:e.dashboardIds,searches:0});let{dueData:l,dueAi:u,pausedAndBlocked:d}=Tt(a,s,o.dailySearchBudget,i,J);d&&yt(i);let f=r&&o.briefingEnabled&&le(i);if(l.length===0&&!u){if(f&&!a.some(D)){let e=ce(a,new Set);if(e){let t=await Ze([],n,{briefingContext:e});t.briefing&&(M(t.briefing,a,i),T({kind:`briefing`,text:`Morning briefing compiled.`,dashboardIds:[],searches:1}))}}return}e.current=!0,l.forEach(e=>J.add(e.id)),u&&J.add(u.id);try{if(l.length>0){let e=f?{context:ce(a,new Set(K(l).map(e=>e.d.id))),allDashboards:a}:void 0;await $(l,n,r,e?{briefing:e}:{})}u&&await xt(u,n,r,i)}finally{l.forEach(e=>J.delete(e.id)),u&&J.delete(u.id),e.current=!1}},r=()=>{he(n).catch(e=>{console.error(`[dashboards] scheduled tick failed`,e)})},i=window.setInterval(r,dt),a=()=>{document.visibilityState===`visible`&&r()};return document.addEventListener(`visibilitychange`,a),r(),()=>{t=!1,window.clearInterval(i),document.removeEventListener(`visibilitychange`,a)}},[])}export{ht as a,ge as c,ut as i,P as l,St as n,V as o,Et as r,we as s,wt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
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{i as r,n as i}from"./info-CiqHR5cs.js";import{r as a,t as o}from"./keyVault-Aw5Y2PjT.js";import"./providers-0DthJW_I.js";var s=e({LIVE_V2_EVENT:()=>f,SECRET_PERSISTENCE_EVENT:()=>p,exportConfig:()=>J,getLiveConfigV2:()=>A,getSecretPersistenceStatus:()=>R,hasModelConfigured:()=>q,importConfig:()=>te,importConfigWithSummary:()=>Z,resetLiveConfig:()=>W,setLiveConfigV2:()=>H,setProviderField:()=>G,toCaps:()=>Q,toModelConfig:()=>K,useLiveConfig:()=>$,whenSecretPersistenceSettled:()=>z}),c=n(),l=t(),u=`mavea-live-v2`,d=`mavea-live-v2:secrets`,f=u,p=`${u}:secret-persistence`,m=25e4,h=512,g={provider:`gemini`,models:{},keys:{},rememberKey:!1,webSearch:!1,searchMode:`off`,quality:`balanced`,searchProvider:`wikipedia`,searchKeys:{},memoryEnabled:!1,autoSaveFlashcards:!1,generativeBlocks:!0,worldEnabled:!0,libraryEnabled:!0,teachMode:!1,annotationsEnabled:!0,morningBrief:!1,explainLevel:`standard`,fontScale:`normal`,pttKey:`Alt`,pttSide:`any`,voiceSpeed:1};function _(e){return e===`left`||e===`right`?e:`any`}var v=null;function y(e){return i.some(t=>t.id===e)?e:g.provider}function b(e){let t={};if(e&&typeof e==`object`)for(let n of i){let r=e[n.id];typeof r==`string`&&r.length<=h&&(t[n.id]=r)}return t}function x(e,t){return typeof e==`boolean`?e:t}function S(e){return typeof e==`number`&&Number.isFinite(e)?Math.min(2,Math.max(.75,e)):g.voiceSpeed}function C(e){return e===`wikipedia`||e===`brave`||e===`tavily`?e:g.searchProvider}function w(e){return e===`off`||e===`realtime`?e:void 0}function T(e){return e===`fast`||e===`balanced`||e===`thorough`?e:g.quality}function E(e){return e===`simple`||e===`deep`?e:g.explainLevel}function D(e){return e===`smaller`||e===`larger`?e:g.fontScale}function O(e){let t={};if(e&&typeof e==`object`)for(let n of[`brave`,`tavily`]){let r=e[n];typeof r==`string`&&r.length<=h&&(t[n]=r)}return t}function k(){try{if(typeof localStorage>`u`)return{...g};let e=localStorage.getItem(u);if(!e)return{...g};let t=JSON.parse(e),n=x(t.webSearch,g.webSearch),r=w(t.searchMode)??(t.searchMode===void 0&&n?`realtime`:`off`);return{provider:y(t.provider),models:b(t.models),keys:b(t.keys),rememberKey:x(t.rememberKey,g.rememberKey),webSearch:n,searchMode:r,quality:T(t.quality),searchProvider:C(t.searchProvider),searchKeys:O(t.searchKeys),memoryEnabled:x(t.memoryEnabled,g.memoryEnabled),autoSaveFlashcards:x(t.autoSaveFlashcards,g.autoSaveFlashcards),generativeBlocks:x(t.generativeBlocks,g.generativeBlocks),worldEnabled:x(t.worldEnabled,g.worldEnabled),libraryEnabled:x(t.libraryEnabled,g.libraryEnabled),teachMode:x(t.teachMode,g.teachMode),annotationsEnabled:x(t.annotationsEnabled,g.annotationsEnabled),morningBrief:x(t.morningBrief,g.morningBrief),explainLevel:E(t.explainLevel),fontScale:D(t.fontScale),pttKey:typeof t.pttKey==`string`&&t.pttKey?t.pttKey:g.pttKey,pttSide:_(t.pttSide),voiceSpeed:S(t.voiceSpeed)}}catch{return{...g}}}function A(){return v||(v=k(),v)}function j(e){try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(u,{detail:e}))}catch{}}function M(e){return Object.keys(e.keys).length>0||Object.keys(e.searchKeys).length>0}var N=0,P=!1,F=`not-requested`,I=Promise.resolve();function L(e){F=e;try{typeof window<`u`&&typeof CustomEvent==`function`&&window.dispatchEvent(new CustomEvent(p,{detail:e}))}catch{}}function R(){return F}async function z(){return await I,F}async function B(e){let t=++N;if(typeof localStorage>`u`){L(e.rememberKey&&M(e)?`session-only`:`not-requested`);return}if(!e.rememberKey||!M(e)){if(e.rememberKey&&!P){L(`pending`);return}try{localStorage.removeItem(d)}catch{}t===N&&L(`not-requested`);return}L(`pending`);try{let n=await a(JSON.stringify({keys:e.keys,searchKeys:e.searchKeys}));if(t!==N)return;localStorage.setItem(d,n),L(`persisted`)}catch{if(t!==N)return;try{localStorage.removeItem(d)}catch{}L(`session-only`)}}async function V(){if(typeof localStorage>`u`){L(`unavailable`);return}let e;try{e=localStorage.getItem(d)}catch{P=!0,L(`unavailable`);return}if(!e){P=!0,L(`not-requested`);return}let t=N;try{let n=JSON.parse(await o(e));if(t===N){let e=A();v={...e,keys:{...e.keys,...b(n.keys)},searchKeys:{...e.searchKeys,...O(n.searchKeys)}},j(v),L(`persisted`)}}catch{t===N&&L(`unavailable`)}finally{P=!0}}function H(e){let t={...A(),...e};v=t;try{if(typeof localStorage<`u`){let e={...t,keys:{},searchKeys:{}};localStorage.setItem(u,JSON.stringify(e)),I=B(t)}else L(t.rememberKey?M(t)?`session-only`:`unavailable`:`not-requested`)}catch{L(t.rememberKey?M(t)?`session-only`:`unavailable`:`not-requested`)}return j(t),t}function U(){typeof localStorage>`u`||(M(A())?(P=!0,H({})):I=V())}U();function W(){return H(g)}function G(e,t,n){let r=A(),i=t===`model`?`models`:`keys`;return H({[i]:{...r[i],[e]:n}})}function K(e){return{provider:e.provider,model:e.models[e.provider]||r(e.provider).defaultModel,apiKey:e.keys[e.provider]}}function q(e){let t=r(e.provider);return!!(e.models[e.provider]||t.defaultModel)&&(!t.needsKey||!!e.keys[e.provider])}function J(){let e={...A(),keys:{},searchKeys:{},rememberKey:!1};return JSON.stringify(e,null,2)}var ee=[`provider`,`models`,`webSearch`,`searchMode`,`quality`,`searchProvider`,`memoryEnabled`,`autoSaveFlashcards`,`generativeBlocks`,`worldEnabled`,`libraryEnabled`,`teachMode`,`annotationsEnabled`,`morningBrief`,`explainLevel`,`fontScale`,`pttKey`,`pttSide`,`voiceSpeed`];function Y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function X(e){return typeof e==`string`||Array.isArray(e)?e.length>0:e&&typeof e==`object`?Object.keys(e).length>0:e!=null}function Z(e,t={}){if((typeof TextEncoder==`function`?new TextEncoder().encode(e).byteLength:e.length*2)>m)throw Error(`Invalid config file — the settings object is too large.`);let n;try{n=JSON.parse(e)}catch{throw Error(`Invalid config file — could not parse JSON.`)}if(!n||typeof n!=`object`||Array.isArray(n))throw Error(`Invalid config file — expected a settings object.`);let r=n;if(Object.keys(r).length>64)throw Error(`Invalid config file — the settings object has too many fields.`);let i=A(),a=t.mode===`merge`?{...i,...r}:r,o=x(a.webSearch,g.webSearch),s=w(a.searchMode)??(a.searchMode===void 0&&o?`realtime`:`off`),c={provider:y(a.provider),models:b(a.models),keys:i.keys,rememberKey:t.preserveSecretState!==!1&&i.rememberKey,webSearch:o,searchMode:s,quality:T(a.quality),searchProvider:C(a.searchProvider),searchKeys:i.searchKeys,memoryEnabled:x(a.memoryEnabled,g.memoryEnabled),autoSaveFlashcards:x(a.autoSaveFlashcards,g.autoSaveFlashcards),generativeBlocks:x(a.generativeBlocks,g.generativeBlocks),worldEnabled:x(a.worldEnabled,g.worldEnabled),libraryEnabled:x(a.libraryEnabled,g.libraryEnabled),teachMode:x(a.teachMode,g.teachMode),annotationsEnabled:x(a.annotationsEnabled,g.annotationsEnabled),morningBrief:x(a.morningBrief,g.morningBrief),explainLevel:E(a.explainLevel),fontScale:D(a.fontScale),pttKey:typeof a.pttKey==`string`&&a.pttKey.length>0&&a.pttKey.length<=32?a.pttKey:g.pttKey,pttSide:_(a.pttSide),voiceSpeed:S(a.voiceSpeed)},l=[];return Y(r,`keys`)&&X(r.keys)&&l.push(`provider-api-keys`),Y(r,`searchKeys`)&&X(r.searchKeys)&&l.push(`search-api-keys`),[`githubToken`,`github_token`,`ghToken`].some(e=>Y(r,e)&&X(r[e]))&&l.push(`github-token`),{config:H(c),credentialsIgnored:l,appliedFields:ee.filter(e=>Y(r,e))}}function te(e,t){return Z(e,t).config}function Q(e){return{webSearch:e.searchMode!==`off`,searchMode:e.searchMode,quality:e.quality,memoryEnabled:e.memoryEnabled,generativeBlocks:e.generativeBlocks,worldEnabled:e.worldEnabled,explainLevel:e.explainLevel}}function $(){let e=(0,c.c)(4),[t,n]=(0,l.useState)(ne),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{if(typeof window>`u`)return;let e=()=>n(A());return window.addEventListener(f,e),e(),()=>window.removeEventListener(f,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,l.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a=[t,H],e[2]=t,e[3]=a),a}function ne(){return A()}export{W as a,Q as c,s as d,Z as i,K as l,A as n,H as o,q as r,G as s,J as t,$ as u};
|
|
@@ -1 +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{n as r,r as i,t as a}from"./theme-D5D55hZi.js";import{C as o,S as s,T as c,b as l,w as u,x as d}from"./index-LiHcEJt_.js";import{u as f}from"./useLiveConfig-B4CmBiAK.js";import{a as p,i as m,o as h,t as g}from"./store-D2IJF4SA.js";import{r as _,t as v}from"./queue-Adae4IzW.js";var y=t(),b=e(),x=n(),S=[`smaller`,`normal`,`larger`],C={smaller:`Smaller`,normal:`Normal`,larger:`Larger`},w=`mavea:appearancechange`;function T(e){window.dispatchEvent(new CustomEvent(w,{detail:e}))}function E(){let e=(0,y.c)(11),[t,n]=(0,b.useState)(O),[s,l]=(0,b.useState)(D),[p,m]=f(),h,g;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=()=>{let e=e=>{let t=e.detail;t&&(n(t.template),l(t.theme))};return window.addEventListener(w,e),()=>window.removeEventListener(w,e)},g=[],e[0]=h,e[1]=g):(h=e[0],g=e[1]),(0,b.useEffect)(h,g);let _;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{u(document,e),d(document,e),o(e);let t={template:e,theme:r()};n(e),l(t.theme),T(t)},e[2]=_):_=e[2];let v=_,x;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{a(e),i(e);let t={template:c(),theme:e};n(t.template),l(e),T(t)},e[3]=x):x=e[3];let S=x,C;e[4]===m?C=e[5]:(C=e=>m({fontScale:e}),e[4]=m,e[5]=C);let E=C,k;return e[6]!==t||e[7]!==p.fontScale||e[8]!==E||e[9]!==s?(k={active:t,theme:s,fontScale:p.fontScale,pickTemplate:v,pickTheme:S,pickFontScale:E},e[6]=t,e[7]=p.fontScale,e[8]=E,e[9]=s,e[10]=k):k=e[10],k}function D(){return r()}function O(){return c()}function k(e){let t=(0,y.c)(13),{templateId:n}=e,r;t[0]===n?r=t[1]:(r=l.find(e=>e.id===n)??l[0],t[0]=n,t[1]=r);let i=r,a;t[2]!==i.preview.accent||t[3]!==i.preview.background||t[4]!==i.preview.ink||t[5]!==i.preview.surface?(a={"--preview-bg":i.preview.background,"--preview-surface":i.preview.surface,"--preview-ink":i.preview.ink,"--preview-accent":i.preview.accent},t[2]=i.preview.accent,t[3]=i.preview.background,t[4]=i.preview.ink,t[5]=i.preview.surface,t[6]=a):a=t[6];let o=a,s=`appearance-preview appearance-preview--${i.preview.geometry}`,c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,x.jsx)(`span`,{className:`appearance-preview-aa`,children:`Aa`}),t[7]=c):c=t[7];let u,d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,x.jsxs)(`span`,{className:`appearance-preview-copy`,children:[(0,x.jsx)(`i`,{}),(0,x.jsx)(`i`,{})]}),d=(0,x.jsx)(`span`,{className:`appearance-preview-data`,children:`08`}),t[8]=u,t[9]=d):(u=t[8],d=t[9]);let f;return t[10]!==o||t[11]!==s?(f=(0,x.jsxs)(`span`,{className:s,style:o,"aria-hidden":`true`,children:[c,u,d]}),t[10]=o,t[11]=s,t[12]=f):f=t[12],f}function A({active:e,theme:t,fontScale:n,embedded:r=!1,onPickTemplate:i,onPickTheme:a,onPickFontScale:o,onClose:s,optionRefs:c}){let d=(0,b.useId)(),f=(e,t)=>{let n;if(e.key===`ArrowRight`||e.key===`ArrowDown`)n=(t+1)%l.length;else if(e.key===`ArrowLeft`||e.key===`ArrowUp`)n=(t-1+l.length)%l.length;else if(e.key===`Home`)n=0;else if(e.key===`End`)n=l.length-1;else return;e.preventDefault(),c?.current[n]?.focus()};return(0,x.jsxs)(`div`,{className:`appearance-panel${r?` is-embedded`:``}`,role:r?void 0:`dialog`,"aria-modal":!r||void 0,"aria-labelledby":d,children:[(0,x.jsxs)(`div`,{className:`appearance-head`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{id:d,children:r?`Appearance`:`Choose your workspace`}),(0,x.jsx)(`p`,{children:`A visual identity for how you think.`})]}),s&&(0,x.jsx)(`button`,{type:`button`,className:`appearance-close`,onClick:s,"aria-label":`Close appearance`,children:`×`})]}),(0,x.jsxs)(`div`,{className:`appearance-mode`,"aria-label":`Color mode`,children:[(0,x.jsx)(`span`,{children:`Color mode`}),(0,x.jsx)(`div`,{className:`appearance-segmented`,children:[`light`,`dark`].map(e=>(0,x.jsxs)(`button`,{type:`button`,"aria-pressed":t===e,className:t===e?`is-active`:``,onClick:()=>a(e),children:[(0,x.jsx)(`span`,{className:`appearance-mode-icon is-${e}`,"aria-hidden":`true`}),e===`light`?`Light`:`Dark`]},e))})]}),(0,x.jsxs)(`div`,{className:`appearance-mode`,"aria-label":`Text size`,children:[(0,x.jsx)(`span`,{children:`Text size`}),(0,x.jsx)(`div`,{className:`appearance-segmented is-triple`,children:S.map(e=>(0,x.jsx)(`button`,{type:`button`,"aria-pressed":n===e,className:n===e?`is-active`:``,onClick:()=>o(e),children:C[e]},e))})]}),(0,x.jsx)(`div`,{className:`appearance-grid`,role:`radiogroup`,"aria-label":`Workspace themes`,children:l.map((t,n)=>(0,x.jsxs)(`button`,{ref:e=>{c&&(c.current[n]=e)},type:`button`,role:`radio`,"aria-label":`${t.label}, ${t.persona}. ${t.tagline} Best for ${t.bestFor}.`,"aria-checked":t.id===e,tabIndex:t.id===e?0:-1,className:`appearance-option${t.id===e?` is-active`:``}`,onClick:()=>i(t.id),onKeyDown:e=>f(e,n),onPointerEnter:()=>u(document,t.id),onFocus:()=>u(document,t.id),children:[(0,x.jsx)(k,{templateId:t.id}),(0,x.jsxs)(`span`,{className:`appearance-option-copy`,children:[(0,x.jsxs)(`span`,{className:`appearance-option-title`,children:[(0,x.jsx)(`strong`,{children:t.label}),(0,x.jsx)(`em`,{children:t.persona})]}),(0,x.jsx)(`span`,{className:`appearance-option-tagline`,children:t.tagline}),(0,x.jsxs)(`span`,{className:`appearance-option-best`,children:[`Best for `,t.bestFor.toLowerCase()]}),(0,x.jsx)(`span`,{className:`appearance-option-font`,children:t.preview.fontRole})]}),(0,x.jsx)(`span`,{className:`appearance-check`,"aria-hidden":`true`,children:`✓`})]},t.id))})]})}function j({triggerClassName:e=`topbar-icon-btn`}={}){let{active:t,theme:n,fontScale:r,pickTemplate:i,pickTheme:a,pickFontScale:o}=E(),[c,u]=(0,b.useState)(!1),d=(0,b.useRef)(null),f=(0,b.useRef)(null),p=(0,b.useRef)([]);(0,b.useEffect)(()=>s(document),[]);let m=(0,b.useCallback)(()=>{u(!1),requestAnimationFrame(()=>f.current?.focus())},[]);(0,b.useEffect)(()=>{if(!c)return;let e=l.findIndex(e=>e.id===t);requestAnimationFrame(()=>{if(window.matchMedia?.(`(max-width: 720px)`).matches??!1){d.current?.querySelector(`.appearance-close`)?.focus({preventScroll:!0});return}p.current[Math.max(0,e)]?.focus({preventScroll:!0})});let n=e=>{d.current&&!d.current.contains(e.target)&&m()},r=e=>{if(e.key===`Escape`){e.preventDefault(),m();return}if(e.key!==`Tab`||!d.current)return;let t=Array.from(d.current.querySelectorAll(`button:not([disabled])`));if(!t.length)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())};return window.addEventListener(`pointerdown`,n),window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`pointerdown`,n),window.removeEventListener(`keydown`,r)}},[t,m,c]);let h=l.find(e=>e.id===t)??l[0];return(0,x.jsxs)(`div`,{className:`tpl-picker appearance-picker`,ref:d,children:[(0,x.jsx)(`button`,{ref:f,type:`button`,className:`${e} tpl-btn appearance-trigger`,onClick:()=>u(e=>!e),title:`Appearance: ${h.label} · ${h.persona} · ${n===`light`?`Light`:`Dark`}`,"aria-label":`Choose appearance (current: ${h.label}, ${h.persona}, ${n} mode)`,"aria-expanded":c,"aria-haspopup":`dialog`,children:(0,x.jsxs)(`span`,{className:`appearance-mark`,"aria-hidden":`true`,children:[(0,x.jsx)(`i`,{style:{background:h.preview.accent}}),(0,x.jsx)(`i`,{style:{background:h.preview.surface}})]})}),c&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{className:`appearance-backdrop`,type:`button`,onClick:m,"aria-label":`Close appearance`}),(0,x.jsx)(A,{active:t,theme:n,fontScale:r,onPickTemplate:i,onPickTheme:a,onPickFontScale:o,onClose:m,optionRefs:p})]})]})}function M(){let e=(0,y.c)(7),{active:t,theme:n,fontScale:r,pickTemplate:i,pickTheme:a,pickFontScale:o}=E(),s;return e[0]!==t||e[1]!==r||e[2]!==o||e[3]!==i||e[4]!==a||e[5]!==n?(s=(0,x.jsx)(A,{embedded:!0,active:t,theme:n,fontScale:r,onPickTemplate:i,onPickTheme:a,onPickFontScale:o}),e[0]=t,e[1]=r,e[2]=o,e[3]=i,e[4]=a,e[5]=n,e[6]=s):s=e[6],s}function N(e){let[t,n]=(0,b.useState)(e);return(0,b.useEffect)(()=>{if(typeof window>`u`)return;let t=()=>n(e());return t(),window.addEventListener(g,t),window.addEventListener(`focus`,t),document.addEventListener(`visibilitychange`,t),()=>{window.removeEventListener(g,t),window.removeEventListener(`focus`,t),document.removeEventListener(`visibilitychange`,t)}},[]),t}function P(){return N(v)}function F(){return N(h)}function I(){return N(p)}function L(){return N(R)}function R(){return m()}function z(){return N(B)}function B(){return _()}export{P as a,F as i,I as n,M as o,z as r,j as s,L as t};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./types-C42I77wh.js";import{t}from"./json-B0N3XRZU.js";import{i as n,r}from"./verbatim-DBTj9sPD.js";import{n as i}from"./citation-BsSvaaer.js";import{a,r as o}from"./number-zqlPMliA.js";import{i as s,n as c,r as l,s as u,t as d}from"./receipts-D7zveV-I.js";var f={text:``,chunks:[]},p=e=>({text:e,chunks:[]});function m(e){let{source:t,text:n}=e;return[t.url?`${t.title??t.url}\n${t.url}`:t.title??``,n].filter(e=>e.trim()).join(`
|
|
2
|
-
`)}function h(e,t){let n=[],r=[],i=0;for(let a of e){let e=m(a);if(!e.trim())continue;let o=e.length+(r.length?2:0);i+o>t||(i+=o,r.push(e),n.push({source:a.source,text:e}))}return{text:r.join(`
|
|
3
|
-
|
|
4
|
-
`),chunks:n}}function g(e){return{source:{kind:`web`,title:e.title,...e.url?{url:e.url,host:i(e.url)}:{}},text:e.snippet??``}}function _(e){let t=e.chunks.map(e=>({source:e.source,text:n(e.text)}));return e=>{let r=n(e);if(!r)return null;let i=t.filter(e=>e.text.includes(r));return i.length===1?i[0].source:null}}function v(e,t=`an unnamed cause`){let n=e??``;return n.replace(/[\p{Cf}\p{Cc}]/gu,``).trim().length>0?n.trim():t}function y(e){let t=e.replace(/[-_]+/g,` `).trim();return t.length===0?e:t[0].toUpperCase()+t.slice(1)}var b=/^\d{4}$/,x=/^(\d{4})[-/](\d{1,2})$/;function S(e){let t=e.trim();if(b.test(t))return Date.UTC(Number(t),0,1);let n=x.exec(t);if(n){let e=Number(n[2]);return e>=1&&e<=12?Date.UTC(Number(n[1]),e-1,1):null}let r=Date.parse(t);return Number.isFinite(r)?r:null}var C=[`economy`,`policy`,`technology`,`science`,`environment`,`society`,`health`,`conflict`];function w(e){return typeof e==`string`&&C.includes(e)?e:void 0}var T=new Set([`root`,`mechanism`,`outcome`]),E=[`T0`,`T1`,`T2`,`T3`],D=140,O=40,k=120,A=240,j=240,ee=24,M=12,N=6,P=16,F=4,I=48,te=40,L=24,ne=24;function R(e,t){if(typeof e!=`string`)return null;let n=e.trim();return n?n.length>t?n.slice(0,t):n:null}var re=e=>e<0?0:e>1?1:e;function z(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,ne).replace(/-+$/,``)}function B(e){if(typeof e!=`string`)return null;let t=e.trim();if(!t||t.length>L)return null;let n=S(t);return n===null?null:{label:t,at:n}}function ie(t,n,r){let i=typeof t==`string`?{t}:t;if(!i||typeof i!=`object`||Array.isArray(i))return;let a=i,o=B(a.t);if(!o)return;let s=B(a.until),c=E.includes(a.tier)?a.tier:`T0`,u=R(a.quote,A),d=e(c)&&u?{quote:u,tier:c,receipt:a.receipt}:r?{...r,receipt:void 0}:null,f=d&&d.quote.includes(o.label)&&n.holds(d.quote)?{tier:d.tier,receipt:l(d.receipt,d.quote,n.sourceOf(d.quote))}:{tier:`T0`};return{t:o.label,...s&&s.at>o.at?{until:s.label}:{},...f}}function V(t,n,r,i){let o=T.has(t.role)?t.role:`mechanism`,c=typeof t.depth==`number`&&Number.isFinite(t.depth)?Math.max(0,Math.round(t.depth)):o===`root`?0:o===`outcome`?2:1,u=E.includes(t.tier)?t.tier:`T0`,d=typeof t.value==`number`&&Number.isFinite(t.value)?t.value:void 0,f=R(t.unit,M)??void 0,p=R(t.detail,j)??void 0,m=w(t.domain),h=s(t),g;e(u)?h&&r.holds(h)?(g=l(t.receipt,h,r.sourceOf(h)),d!==void 0&&!a(d,h)&&(d=void 0)):(u=`T0`,d=void 0):u===`T3`?(!i||d===void 0)&&(u=`T0`,d=void 0):d=void 0;let _=ie(t.date,r,g&&e(u)?{quote:g.quote,tier:u}:null);return{label:n,role:o,depth:c,tier:u,...d===void 0?{}:{value:d},...f?{unit:f}:{},...g?{receipt:g}:{},...p?{detail:p}:{},..._?{date:_}:{},...m?{domain:m}:{}}}function H(t,n,r){if(!t||typeof t!=`object`||Array.isArray(t))return;let i=t,o=E.includes(i.tier)?i.tier:`T0`;if(o===`T0`||o===`T3`&&!r)return;let c=R(i.unit,M)??void 0,u=s(i),d=e(o)&&u&&n.holds(u)?l(i.receipt,u):void 0,f=[];for(let t of Array.isArray(i.points)?i.points:[]){if(f.length>=te)break;if(!t||typeof t!=`object`)continue;let r=t,i=R(r.t,L),c=typeof r.value==`number`&&Number.isFinite(r.value)?r.value:void 0;if(!(!i||c===void 0)){if(e(o)){let e=s(r);if(!e||!n.holds(e)||!a(c,e))continue;f.push({t:i,value:c,receipt:l(r.receipt,e,n.sourceOf(e))})}else f.push({t:i,value:c})}}if(f.length!==0)return{points:f,tier:o,...c?{unit:c}:{},...d?{receipt:d}:{}}}function U(e,t,n,r){let i=[],a=new Set;for(let o of Array.isArray(e)?e:[]){if(i.length>=F)break;if(!o||typeof o!=`object`)continue;let e=o,s=R(e.id,O)??R(e.label,k);if(!s)continue;let c=s.startsWith(`${t}.`)?s.slice(t.length+1):s,l=z(c);if(!l)continue;let u=`${t}.${l}`;if(a.has(u))continue;a.add(u);let d=R(e.label,k)??y(c),f=H(e.series,n,r);i.push({id:u,...V(e,d,n,r),...f?{series:f}:{}})}return i}function ae(e,t){let n=new Map(e.map(e=>[e,0])),r=new Map(e.map(e=>[e,[]]));for(let e of t){let t=r.get(e.from);!t||!n.has(e.to)||(n.set(e.to,n.get(e.to)+1),t.push(e.to))}let i=[...r.keys()].filter(e=>n.get(e)===0),a=0;for(let e=0;e<i.length;e+=1){a+=1;for(let t of r.get(i[e])){let e=n.get(t)-1;n.set(t,e),e===0&&i.push(t)}}return a===r.size}function oe(e,t){let n=new Map(e.map(e=>[e,[]]));t.forEach((e,t)=>{let r=n.get(e.from);r&&n.has(e.to)&&r.push(t)});let r=new Map,i=new Set;for(let a of e){if(r.has(a))continue;r.set(a,1);let e=[{id:a,next:0}];for(;e.length>0;){let a=e[e.length-1],o=n.get(a.id);if(a.next>=o.length){r.set(a.id,2),e.pop();continue}let s=o[a.next];a.next+=1;let{to:c}=t[s],l=r.get(c);l===1?i.add(s):l===void 0&&(r.set(c,1),e.push({id:c,next:0}))}}return i}var W=e=>{let t=e.slice(0,3).map(e=>`${e.from} → ${e.to}`);return e.length>t.length?`${t.join(`, `)}, +${e.length-t.length} more`:t.join(`, `)};function G(e,t){if(ae(e,t))return{edges:[...t],notes:[]};let n=oe(e,t),r=t.filter((e,t)=>n.has(t));return{edges:t.filter((e,t)=>!n.has(t)),notes:[`Dropped ${r.length} link${r.length===1?``:`s`} that closed a causal loop (${W(r)}) — a causal web cannot come back round to its own cause.`]}}var K=e=>e.length===0?[]:[`Dropped ${e.length} self-link${e.length===1?``:`s`} (${W(e)}) — nothing causes itself.`];function q(e,t){let n=Math.max(0,N-t.length),r=[...(e??[]).slice(0,n),...t];return r.length>0?r.slice(0,N):void 0}function se(n,i){let a=typeof n==`string`?t(n):n;if(!a||typeof a!=`object`||Array.isArray(a))return null;let s=a,m=R(s.title,D);if(!m)return null;let h=s.provenance&&typeof s.provenance==`object`?s.provenance:{},g=h.illustrative===!0,v=typeof i==`string`?p(i):i??f,y={holds:r(v.text),sourceOf:_(v)},b=[],x=new Set;for(let e of Array.isArray(s.nodes)?s.nodes:[]){if(b.length>=P)break;if(!e||typeof e!=`object`)continue;let t=e,n=R(t.id,O),r=R(t.label,k);if(!n||!r||x.has(n))continue;x.add(n);let i=H(t.series,y,g),a=U(t.children,n,y,g);b.push({id:n,...V(t,r,y,g),...i?{series:i}:{},...a.length?{children:a}:{}})}if(b.length<2)return null;let S=new Set(b.map(e=>e.id)),C=[],w=[];for(let t of Array.isArray(s.edges)?s.edges:[]){if(C.length>=I)break;if(!t||typeof t!=`object`)continue;let n=t,r=R(n.from,O),i=R(n.to,O);if(!r||!i||!S.has(r)||!S.has(i))continue;if(r===i){w.push({from:r,to:i});continue}let a=n.sign===-1?-1:1,s=R(n.verb,ee)??void 0,f=n.relation==null?void 0:u(n.relation),p=E.includes(n.tier)?n.tier:`T0`,m=typeof n.weight==`number`&&Number.isFinite(n.weight)?re(n.weight):void 0,h=d(n,y.holds,y.sourceOf),g=!1,_=m;_!==void 0&&!h.some(e=>o(_,e.quote))&&(m=void 0),e(p)&&m!==void 0&&h.length>0||(p=`T0`,m=void 0,g=!0);let v=n.counter&&typeof n.counter==`object`?n.counter:null,b=v?R(v.quote,A):null,x=b&&y.holds(b)?l(v,b,y.sourceOf(b)):void 0;C.push({from:r,to:i,sign:a,tier:p,...s?{verb:s}:{},...m===void 0?{}:{weight:m},...h.length?{receipt:h[0],receipts:h}:{},...g?{provisional:!0}:{},...f?{relation:f}:{},...x?{counter:x}:{},status:c({tier:p,weight:m,receipt:h[0],receipts:h,counter:x})})}let T=G([...S],C),j=R(s.outcomeId,O);(!j||!S.has(j))&&(j=(b.find(e=>e.role===`outcome`)??b.reduce((e,t)=>t.depth>e.depth?t:e)).id);let M=q(Array.isArray(h.notes)?h.notes.map(e=>String(e)):void 0,[...K(w),...T.notes]);return{title:m,outcomeId:j,nodes:b,edges:T.edges,provenance:{...g?{illustrative:!0}:{},...M?{notes:M}:{}}}}var J=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,``);function Y(e,t){let n=new Set(e.nodes.map(e=>e.id)),r=new Map;for(let t of e.nodes){let e=J(t.label),n=r.get(e);n?n.push(t.id):r.set(e,[t.id])}let i=new Map,a=new Set,o=new Set,s=[],c=new Set(n);for(let t of e.nodes)for(let e of t.children??[])c.add(e.id);for(let l of t.nodes){if(i.has(l.id))continue;let t=n.has(l.id)?l.id:null;if(!t){let e=r.get(J(l.label));e&&e.length===1&&(t=e[0])}if(t){if(o.has(t))continue;o.add(t),i.set(l.id,t),a.add(l.id);continue}if(e.nodes.length+s.length>=P)continue;let u=l.id;for(let e=2;c.has(u);e+=1)u=`${l.id}-${e}`;c.add(u),i.set(l.id,u),s.push({node:l,id:u})}return{idMap:i,matched:a,fresh:s}}function ce(e,t){return t.nodes.length===0?0:Y(e,t).matched.size/t.nodes.length}var le=t=>e(t.tier)&&!!t.receipt;function ue(t,n){return n?t?e(n.tier)||!e(t.tier)?n:t:n:t}function X(e,t){let n=le(t)?t:e,r=ue(e.series,t.series),i=t.detail??e.detail,a=t.date??e.date,o=t.domain??e.domain;return{id:e.id,label:e.label,role:e.role,depth:e.depth,tier:n.tier,...n.value===void 0?{}:{value:n.value},...n.unit?{unit:n.unit}:{},...n.receipt?{receipt:n.receipt}:{},...a?{date:a}:{},...r?{series:r}:{},...i?{detail:i}:{},...o?{domain:o}:{}}}function Z(e,t,n,r){let i=e?[...e]:[],a=new Map(i.map((e,t)=>[e.id,t]));for(let e of t??[]){let t=z(e.id.startsWith(`${n}.`)?e.id.slice(n.length+1):e.id.split(`.`).pop()??``);if(!t)continue;let o=`${r}.${t}`,{children:s,...c}=e,l={...c,id:o},u=a.get(o);u===void 0?i.length<F&&(a.set(o,i.length),i.push(l)):i[u]=X(i[u],l)}return i.length?i:void 0}function de(e,t){let n=Z(e.children,t.children,t.id,e.id);return{...X(e,t),...n?{children:n}:{}}}var Q=e=>e.receipts??(e.receipt?[e.receipt]:[]);function fe(e,t){let n=Q(e),r=Q(t).length>0&&n.length===0?t:e,i=r===t?e:t,a=[],o=new Set;for(let e of[...Q(r),...Q(i)])a.length>=3||o.has(e.quote)||(o.add(e.quote),a.push(e));let s=r.relation??i.relation,l=r.counter??i.counter;return{from:e.from,to:e.to,sign:r.sign,tier:r.tier,...r.verb?{verb:r.verb}:{},...r.weight===void 0?{}:{weight:r.weight},...a.length?{receipt:a[0],receipts:a}:{},...r.provisional?{provisional:!0}:{},...s?{relation:s}:{},...l?{counter:l}:{},status:c({tier:r.tier,...r.weight===void 0?{}:{weight:r.weight},...a.length?{receipt:a[0],receipts:a}:{},...l?{counter:l}:{}})}}function pe(e,t){let{idMap:n,fresh:r}=Y(e,t),i=new Map(t.nodes.map(e=>[e.id,e])),a=[...e.nodes],o=new Map(e.nodes.map((e,t)=>[e.id,t]));for(let[e,t]of n){let n=o.get(t);if(n===void 0)continue;let r=i.get(e);r&&(a[n]=de(a[n],r))}for(let{node:e,id:t}of r){let{children:n,...r}=e,i=Z(void 0,e.children,e.id,t);a.push({...r,id:t,...i?{children:i}:{}})}let s=[...e.edges],c=new Map(e.edges.map((e,t)=>[`${e.from}\0${e.to}`,t])),l=e=>n.get(e)??(o.has(e)?e:void 0);for(let e of t.edges){let t=l(e.from),n=l(e.to);if(!t||!n||t===n)continue;let r=`${t}\0${n}`,i=c.get(r);i===void 0?s.length<I&&(c.set(r,s.length),s.push({...e,from:t,to:n})):s[i]=fe(s[i],{...e,from:t,to:n})}let u=G(a.map(e=>e.id),s),d=q(e.provenance.notes,u.notes);return{title:e.title,outcomeId:e.outcomeId,nodes:a,edges:u.edges,provenance:{...e.provenance.illustrative?{illustrative:!0}:{},...d?{notes:d}:{}}}}function me(e,n,i,a){let o=typeof e==`string`?t(e):e;if(!o||typeof o!=`object`)return[];let s=o.children,c=typeof i==`string`?p(i):i??f;return U(s,n,{holds:r(c.text),sourceOf:_(c)},a)}function he(e,t,n){if(n.length===0)return e;let r=$(e.nodes,t,n);return r===e.nodes?e:{...e,nodes:[...r]}}function $(e,t,n){let r=!1,i=e.map(e=>{if(e.id===t)return(e.children?.length??0)>0?e:(r=!0,{...e,children:[...n]});if(e.children===void 0)return e;let i=$(e.children,t,n);return i===e.children?e:(r=!0,{...e,children:[...i]})});return r?i:e}export{ce as a,v as c,g as d,pe as i,f as l,me as n,C as o,se as r,S as s,he as t,h as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{T as e,j as t}from"./kokoro-DXRj0KQX.js";import{n,t as r}from"./nextFrame-12y0UrAd.js";var i=1100,a=15e3,o=1e4,s=12e3,c=8e3,l=3500,u=2500,d=3e3;function f(e){return e*2+12e3}function p(e,t=1700){let n=e.trim();return n?Math.min(7e3,Math.max(1500,Math.round(n.split(/\s+/).length*385+500))):t}function m(e){return new Promise(t=>setTimeout(t,e))}async function h(e,t=a){return await n(e.started,t)??!1}async function g(e,t,r=i){await Promise.all([n(e.finished,f(t)),m(r)])}function _(n){let r=n.speaking??e,i=n.subscribe??t;return new Promise(e=>{let t=!1,a=!1,o=()=>{a||(a=!0,c(),clearTimeout(l),e())},s=()=>{t&&!r()&&o()},c=i(s);setTimeout(()=>{t=!0,s()},n.floorMs);let l=setTimeout(o,n.capMs)})}async function v(e){try{await n((async()=>{await r(),await r(),await n(e.loadFams(),c),e.settle&&await e.settle(),e.wantVoice&&e.firstLine&&await n(e.firstLine.started,o)})(),s)}catch{}}export{v as a,p as c,_ as d,d as i,g as l,u as n,m as o,l as r,f as s,i as t,h as u};
|
|
File without changes
|