lookatstudy-mobile 0.23.0 → 0.24.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/package.json +1 -1
- package/seed-course.json +15 -15
- package/server.cjs +342 -22
- package/web/assets/{CanvasStage-Ba-21anG.js → CanvasStage-u_7YeGk1.js} +1 -1
- package/web/assets/{CommandPalette-SKnzQMcN.js → CommandPalette-Q5j7BQf4.js} +1 -1
- package/web/assets/{CourseSearchPanel-BW3fNReR.js → CourseSearchPanel-BYGHjhnk.js} +1 -1
- package/web/assets/{ExamView-BnH6BraN.js → ExamView-DU5X7LyZ.js} +1 -1
- package/web/assets/{MindmapView-B4SeCLQj.js → MindmapView-C61d4ddf.js} +3 -3
- package/web/assets/{ReviewPanel-DkGT8tNA.js → ReviewPanel-DoLMdlpR.js} +1 -1
- package/web/assets/SettingsView-CD9th6O0.js +7 -0
- package/web/assets/{VoicePanel-CxNeKn4V.js → VoicePanel-Cvl2BLq2.js} +1 -1
- package/web/assets/{abnfDiagram-N423BO3Z-B4kvB05N.js → abnfDiagram-N423BO3Z-BvTcLUtE.js} +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-ODA7YWAP-B5zhG8XJ.js → abnfDiagram-VCTEODGH-ODA7YWAP-NpbseUTF.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-C4PU3XN7-ybcWxxhr.js → architectureDiagram-5GKGNRK7-C4PU3XN7-DGtDmisd.js} +1 -1
- package/web/assets/{architectureDiagram-T3A2C74G-D5eb-etB.js → architectureDiagram-T3A2C74G-huu8moy9.js} +1 -1
- package/web/assets/{arrow-right-D4GV0Gpo.js → arrow-right-B0QrRNSR.js} +1 -1
- package/web/assets/{blockDiagram-NRAW4CY4-UMJ6PMQQ-DwEVReBp.js → blockDiagram-NRAW4CY4-UMJ6PMQQ-BxiaVwV9.js} +1 -1
- package/web/assets/{blockDiagram-VBNYF7ZC-DuM7ndnl.js → blockDiagram-VBNYF7ZC-BAnlmDNm.js} +1 -1
- package/web/assets/{c4Diagram-5PPSVZJV-BQkRaO7S.js → c4Diagram-5PPSVZJV-MUU8xp1X.js} +1 -1
- package/web/assets/{c4Diagram-UCG6FXSJ-75X3U2P3-Di1jNn7S.js → c4Diagram-UCG6FXSJ-75X3U2P3-7rpgYEob.js} +1 -1
- package/web/assets/channel-BJoUn5Z8.js +1 -0
- package/web/assets/{chunk-2GRJ4B5K-C7VAL2Yd.js → chunk-2GRJ4B5K-BZ6Sj0-3.js} +1 -1
- package/web/assets/{chunk-2Q5K7J3B-Jpo34qVL.js → chunk-2Q5K7J3B-BkOSQBqV.js} +1 -1
- package/web/assets/{chunk-5RXB4S5H-CrW8aZl4.js → chunk-5RXB4S5H-DgXJvWY0.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-Dv4MffdC.js → chunk-5VM5RSS4-D-BptZQ9.js} +1 -1
- package/web/assets/{chunk-6Q2QTUOP-CI07iNTB.js → chunk-6Q2QTUOP-DIJ0lWTD.js} +1 -1
- package/web/assets/{chunk-7XDTSPCN-DsQtrF-N.js → chunk-7XDTSPCN-vxuDBi1y.js} +1 -1
- package/web/assets/{chunk-CTNIYPP6-CpdWBpIN.js → chunk-CTNIYPP6-F5ZMIO6O.js} +1 -1
- package/web/assets/{chunk-CXNFBKHE-BDCDRaZC.js → chunk-CXNFBKHE-CFr1EfBh.js} +1 -1
- package/web/assets/{chunk-GF5L2VYU-DtpZkefy.js → chunk-GF5L2VYU-jqePwawx.js} +1 -1
- package/web/assets/{chunk-ISA7TJRJ-C3LgQ-bA.js → chunk-ISA7TJRJ-DiKuu0wz.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-DJM1SevB.js → chunk-JWPE2WC7-CLC3hqKr.js} +1 -1
- package/web/assets/{chunk-KBJHAD2P-7KeTMqC1.js → chunk-KBJHAD2P-DSEKcYpO.js} +1 -1
- package/web/assets/{chunk-LV3HUYFY-B2sGhGxz.js → chunk-LV3HUYFY-P2e0-qZ6.js} +1 -1
- package/web/assets/{chunk-M3IUQBOH-Dazbegdb.js → chunk-M3IUQBOH-Bdt4MjFy.js} +1 -1
- package/web/assets/{chunk-NDIOYS4C-Cx7mCz5-.js → chunk-NDIOYS4C-7HlPLAGd.js} +1 -1
- package/web/assets/{chunk-RE4WF27V-BNzpDJts.js → chunk-RE4WF27V-D4vIv_G3.js} +1 -1
- package/web/assets/{chunk-RYQCIY6F-Boq_29rU.js → chunk-RYQCIY6F-tTcuHeqw.js} +1 -1
- package/web/assets/{chunk-VII2H2IX-kQVDZD-x.js → chunk-VII2H2IX-BkXECJ1Z.js} +1 -1
- package/web/assets/{chunk-X5GNSKZ3-DT5Ja5IF.js → chunk-X5GNSKZ3-D7yjZGWk.js} +1 -1
- package/web/assets/{chunk-XCWWM2C3-BAq7zpgL.js → chunk-XCWWM2C3-C_es6n6S.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-D3vcLngc.js → chunk-XXDRQBXY-Bsuow-B8.js} +1 -1
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-B3DqqoSe.js +1 -0
- package/web/assets/classDiagram-JCYQIIEL-C2n-a_rM.js +1 -0
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-B3DqqoSe.js +1 -0
- package/web/assets/classDiagram-v2-OCEON4UE-C2n-a_rM.js +1 -0
- package/web/assets/{core-4d9vIKK9.js → core-Bgf5ngI5.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-OB24KH3T-DwFzf1xR.js → cose-bilkent-JH36ORCC-OB24KH3T-DM0H6Gci.js} +1 -1
- package/web/assets/{cose-bilkent-JH36ORCC-RoUdcSs7.js → cose-bilkent-JH36ORCC-x05QuEnY.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-GVF3BKWE-Bdt2EF7g.js → cynefin-OW5HDTMX-GVF3BKWE-DY90g1OE.js} +1 -1
- package/web/assets/{cynefin-VYW2F7L2-Br1TXK2f.js → cynefin-VYW2F7L2-DjqH_9VW.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-H3WIRU3N-DFRlDIhn.js → cynefinDiagram-5FMLGOSQ-H3WIRU3N-DoaOZ7iJ.js} +1 -1
- package/web/assets/{cynefinDiagram-MW4NZA55-DeqLH2Db.js → cynefinDiagram-MW4NZA55-DI8ePik6.js} +1 -1
- package/web/assets/{dagre-3AP2YEHR-DCERTXHT-wbCkJQSQ.js → dagre-3AP2YEHR-DCERTXHT-BwLHkvZV.js} +1 -1
- package/web/assets/{dagre-VZM6K2ZE-X3laLObS.js → dagre-VZM6K2ZE-0zjstOys.js} +1 -1
- package/web/assets/{diagram-7IWD3JNH-8bZxUpBi.js → diagram-7IWD3JNH-CoRwcTua.js} +1 -1
- package/web/assets/{diagram-B4RE2ZJO-CsGnKBa4.js → diagram-B4RE2ZJO-Cau1H7nm.js} +1 -1
- package/web/assets/{diagram-LBJQPF4R-CxaNBwKI.js → diagram-LBJQPF4R-CZIgxCTB.js} +1 -1
- package/web/assets/{diagram-Q27KOJAE-CjVLD6gb.js → diagram-Q27KOJAE-B_LnuCra.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-MULGZGEL-wKLcWkw4.js → diagram-S7CK7UJ4-MULGZGEL-C7lZT5bQ.js} +1 -1
- package/web/assets/{diagram-UB23O5K3-CUZ34yVE.js → diagram-UB23O5K3-qTFCSozX.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-YQBY353J-B_ah6OV8.js → diagram-UQ7AKVKN-YQBY353J-CIootVI_.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-WLNH2ELY-BhbJ7E_e.js → diagram-VSXAHHWV-WLNH2ELY-BW8LpgQJ.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-XW6YQV5G-DnFEyO87.js → diagram-VX7I27RA-XW6YQV5G-DfhGfGMR.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-HG7RF65D-Vughovua.js → diagram-Z3DM3KII-HG7RF65D-seunnnEY.js} +1 -1
- package/web/assets/{ebnfDiagram-BXEA7PRR-B2ehf44X.js → ebnfDiagram-BXEA7PRR-ksZAvx5f.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-OKY4VHYD-BjbgNq8R.js → ebnfDiagram-PWID7BFC-OKY4VHYD-Bvj1acAA.js} +1 -1
- package/web/assets/{elk.bundled-CktUbZ7z.js → elk.bundled-DP5Rghza.js} +1 -1
- package/web/assets/{erDiagram-JOGREHBK-9wI_YE-7.js → erDiagram-JOGREHBK-Dz3-stVV.js} +1 -1
- package/web/assets/{erDiagram-SSCWMZ5O-PIPKOIK7-V60k7zg6.js → erDiagram-SSCWMZ5O-PIPKOIK7-DoltPq2T.js} +1 -1
- package/web/assets/{flowDiagram-A5DVABFB-2Z4AVO5R-CJdwjvtN.js → flowDiagram-A5DVABFB-2Z4AVO5R-EXpUdCkE.js} +1 -1
- package/web/assets/{flowDiagram-UKHOOZJN-B3XmqjMH.js → flowDiagram-UKHOOZJN--KUxj2rZ.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-JZNG7GOG-2a6TiXM3.js → ganttDiagram-EL5Y4UJY-JZNG7GOG-B3_qeHhv.js} +1 -1
- package/web/assets/{ganttDiagram-PKOTCBZU-B7B9nD6g.js → ganttDiagram-PKOTCBZU-DDw97tpG.js} +1 -1
- package/web/assets/{gitGraphDiagram-DS77QQ5N-VwKL0Ozk.js → gitGraphDiagram-DS77QQ5N-DXUcbzn4.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-DMWMLL3G-BMs5FYkE.js → gitGraphDiagram-WWUBYQGX-DMWMLL3G-BrLu7NzO.js} +1 -1
- package/web/assets/{index-DFryMRAp.js → index-BUFumkqO.js} +4 -4
- package/web/assets/{index-xynt7zMk.js → index-C-4sKCSr.js} +1 -1
- package/web/assets/{index-DkjixD09.js → index-CODVWHV0.js} +1 -1
- package/web/assets/{index-Vtc_VHiK.js → index-CRlVl931.js} +1 -1
- package/web/assets/{index-D0FRqjBW.js → index-CrB9w7Gs.js} +1 -1
- package/web/assets/{infoDiagram-6WML65LV-CD6GNI7J.js → infoDiagram-6WML65LV-rLhQ8DQz.js} +1 -1
- package/web/assets/{infoDiagram-RXCK75RN-HANS5KVC-k8vzCiSp.js → infoDiagram-RXCK75RN-HANS5KVC-BhbqgWa_.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-7GCIT7WU-Ckl5jIU6.js → ishikawaDiagram-5VMMS53U-7GCIT7WU-DR-PXM0c.js} +1 -1
- package/web/assets/{ishikawaDiagram-WSZJBQD7-CEdvuK4K.js → ishikawaDiagram-WSZJBQD7-Bf-J9Ov1.js} +1 -1
- package/web/assets/{journeyDiagram-EYS64GPL-OAPELBT7-DtCRso4h.js → journeyDiagram-EYS64GPL-OAPELBT7-jFQUZit6.js} +1 -1
- package/web/assets/{journeyDiagram-NVQOT4AX-CxPjI9L-.js → journeyDiagram-NVQOT4AX-CWed0L5n.js} +1 -1
- package/web/assets/{kanban-definition-27J2QSJJ-DnuNCFkl.js → kanban-definition-27J2QSJJ-DhTIozq4.js} +1 -1
- package/web/assets/{kanban-definition-3QL26DDD-I7RKWQQY-yNRn2nj0.js → kanban-definition-3QL26DDD-I7RKWQQY-MOg0W8Vc.js} +1 -1
- package/web/assets/{katex-N6JRN4PM-B9dEOiMG.js → katex-N6JRN4PM-DUl1EV3T.js} +1 -1
- package/web/assets/{main-CGE6fm01.js → main-D3HpSUyK.js} +9 -9
- package/web/assets/{mermaid-layout-elk.core-BUAJJUsd.js → mermaid-layout-elk.core-KBAfwQxu.js} +2 -2
- package/web/assets/{mermaid.core-BD32Za4p.js → mermaid.core-BVbO1Vp8.js} +4 -4
- package/web/assets/{mindmap-definition-FAOFIHXS-DX6VEGs_.js → mindmap-definition-FAOFIHXS-UC1xDIuF.js} +1 -1
- package/web/assets/{mindmap-definition-FBJOCRG2-KIYZG64Y-DYiBZnHG.js → mindmap-definition-FBJOCRG2-KIYZG64Y-DyTkl7Qq.js} +1 -1
- package/web/assets/{pegDiagram-VL7TDLO6-Big72xut.js → pegDiagram-VL7TDLO6-D3DtO4SS.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-OIP57N6J-N0pgSR7W.js → pegDiagram-XKGWAZYB-OIP57N6J-D6RFGa8P.js} +1 -1
- package/web/assets/{pet-DopPVlAf.js → pet-BawFRWlx.js} +1 -1
- package/web/assets/{pieDiagram-7S7Q4E2Y-BLXLqOCg.js → pieDiagram-7S7Q4E2Y-Bggk64R7.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-2UOTW327-BuB4rTS2.js → pieDiagram-E7YTZNPT-2UOTW327-DbtP5dKZ.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-SN3ASJJK-4S-5LgOz.js → quadrantDiagram-AXDQQJYC-SN3ASJJK-CbdnLdcx.js} +1 -1
- package/web/assets/{quadrantDiagram-CIZ2JOQS-BUwizsLb.js → quadrantDiagram-CIZ2JOQS-D8oWqljf.js} +1 -1
- package/web/assets/{railroadDiagram-AXF67PYL-D3qxyYSE.js → railroadDiagram-AXF67PYL-DqYMsbyG.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-34742W6X-CzT_bN34.js → railroadDiagram-O6MQD6OU-34742W6X-BxDZ-lKK.js} +1 -1
- package/web/assets/{render-O7CIS3YK-DhYmSGoI.js → render-O7CIS3YK-C5zxvpoJ.js} +7 -7
- package/web/assets/{requirementDiagram-EFPCY7ZU-NGAFFSMB-iWwnW8VG.js → requirementDiagram-EFPCY7ZU-NGAFFSMB-vkMFulyy.js} +1 -1
- package/web/assets/{requirementDiagram-LRYGKXZP-Cf95T2or.js → requirementDiagram-LRYGKXZP-4uQ-OIOg.js} +1 -1
- package/web/assets/{rotate-ccw-natFwqj6.js → rotate-ccw-C3k3pTDh.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-3D3M4XPB-CjA_LC6M.js → sankeyDiagram-P5KCCOFB-3D3M4XPB-Ct2_9lW6.js} +1 -1
- package/web/assets/{sankeyDiagram-W5VNT64P-CeGCHk7F.js → sankeyDiagram-W5VNT64P-CdtMmhMM.js} +1 -1
- package/web/assets/{sequenceDiagram-SI44F4Z6-BDsExCj2.js → sequenceDiagram-SI44F4Z6-BTa9vGYr.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-Q2IOPB4R-DbWhuP8u.js → sequenceDiagram-WJ2MYXX4-Q2IOPB4R-Du5hMpfL.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-PSGVOMYM-DB5JtURh.js → sizeCapture-X5ZJPWSS-PSGVOMYM-Dv_CbP4j.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-_5trx7u2.js → sizeCapture-X5ZJPWSS-xJHPAAZ7.js} +1 -1
- package/web/assets/{stateDiagram-HBIQ2CUA-4M2S6MAN-CBEhL8_A.js → stateDiagram-HBIQ2CUA-4M2S6MAN-BhhZM57P.js} +1 -1
- package/web/assets/{stateDiagram-OKZ733FA-BPHwMfDA.js → stateDiagram-OKZ733FA-CHCQNs83.js} +1 -1
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-CNwPFEas.js +1 -0
- package/web/assets/stateDiagram-v2-UEYNNEHI-uaaN79rE.js +1 -0
- package/web/assets/{swimlanes-SLNWSIFB-CDgj9OM9.js → swimlanes-SLNWSIFB-Bste-JE-.js} +2 -2
- package/web/assets/{swimlanes-XN3QIQJK-N6N2CCQ6-D3F0tmOR.js → swimlanes-XN3QIQJK-N6N2CCQ6-03elMVxe.js} +1 -1
- package/web/assets/swimlanesDiagram-ULZ7WXOC-CNw-u2S_.js +8 -0
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-jhFh1EB2.js +8 -0
- package/web/assets/{timeline-definition-24CTP7MA-KN7RSRVM-C0Ufqqk-.js → timeline-definition-24CTP7MA-KN7RSRVM-Cba_QLsv.js} +1 -1
- package/web/assets/{timeline-definition-Z64GVDOM-81O3UI2y.js → timeline-definition-Z64GVDOM-nDvkF_F-.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-AKJ7LXAN-Cwa7TjWJ.js → vennDiagram-4TSXK5OY-AKJ7LXAN-Bjm0zDVN.js} +1 -1
- package/web/assets/{vennDiagram-T6HMQDX7-BfOTIcvk.js → vennDiagram-T6HMQDX7-KudBxp6e.js} +1 -1
- package/web/assets/{wardleyDiagram-T6FBY63Y-CYCyu4_S.js → wardleyDiagram-T6FBY63Y-d1R0A5mS.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-3B6A3BN5-CHXrbpNv.js → wardleyDiagram-VM6X3IG4-3B6A3BN5-BOTe--eD.js} +1 -1
- package/web/assets/{xychartDiagram-ELKLHX3M-7mp6PB7p.js → xychartDiagram-ELKLHX3M-ChfX530c.js} +1 -1
- package/web/assets/{xychartDiagram-S5SC5T6Z-OBDNV6WG-Ch73fB_B.js → xychartDiagram-S5SC5T6Z-OBDNV6WG-DcSRUgks.js} +1 -1
- package/web/index.html +2 -2
- package/web/pet.html +2 -2
- package/web/assets/SettingsView-dExmRnIv.js +0 -7
- package/web/assets/channel-KoPlHvUR.js +0 -1
- package/web/assets/classDiagram-DTDB5LWJ-LWRDKZ5K-P8Aw4zHn.js +0 -1
- package/web/assets/classDiagram-JCYQIIEL-Dm2NSERp.js +0 -1
- package/web/assets/classDiagram-v2-JRS7N3AN-2BZHGRP2-P8Aw4zHn.js +0 -1
- package/web/assets/classDiagram-v2-OCEON4UE-Dm2NSERp.js +0 -1
- package/web/assets/stateDiagram-v2-4QOOHH4V-LBBLA2WV-lZeXiw9L.js +0 -1
- package/web/assets/stateDiagram-v2-UEYNNEHI-cH9YNExR.js +0 -1
- package/web/assets/swimlanesDiagram-ULZ7WXOC-C3faa0-8.js +0 -8
- package/web/assets/swimlanesDiagram-VK2B7HYN-E6N4H5SY-D5nVBF4q.js +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./elk.bundled-
|
|
2
|
-
import{r as h,j as e,c as de}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./elk.bundled-DP5Rghza.js","./index-C-4sKCSr.js","./index-DjoBjasB.css","./_commonjs-dynamic-modules-TDtrdbi3.js","./mermaid.core-BVbO1Vp8.js","./main-D3HpSUyK.js","./main-BXa7WYYr.css","./transform-CzGDKG_M.js","./step-SI6FXFD6.js","./mermaid-layout-elk.core-KBAfwQxu.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as h,j as e,c as de}from"./index-C-4sKCSr.js";import{c as Q,u as L,b as me,E as ue,X as Y,_ as J,H as he,I as R,J as fe,N as xe,k as ge,K as be,O as pe,j as U,Q as we,R as je,V as ye,Y as ke}from"./main-D3HpSUyK.js";import{M as H,C as F}from"./CanvasStage-u_7YeGk1.js";import{A as ve}from"./arrow-right-B0QrRNSR.js";import{R as Ne}from"./rotate-ccw-C3k3pTDh.js";/**
|
|
3
3
|
* @license lucide-react v0.468.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
@@ -14,8 +14,8 @@ import{r as h,j as e,c as de}from"./index-xynt7zMk.js";import{c as Q,u as L,b as
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|
|
16
16
|
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/const Se=Q("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);function K({title:t,onClose:r,children:a}){const s=L(),n=h.useRef(null);return me(n,!0),h.useEffect(()=>{const i=o=>{o.key==="Escape"&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[r]),ue.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-black/80","data-testid":"diagram-viewer-modal","data-noswipe":"",role:"dialog","aria-modal":"true","aria-label":t,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 shrink-0",onClick:i=>i.stopPropagation(),children:[e.jsx("h3",{className:"text-body font-bold text-white truncate",children:t}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsx("span",{className:"text-caption text-white/50 hidden sm:inline",children:s("artifact.viewer.hint")}),e.jsx("button",{onClick:r,"data-testid":"diagram-viewer-close","aria-label":s("action.close"),"data-tooltip":s("action.close"),className:"text-white/70 hover:text-white w-9 h-9 flex items-center justify-center rounded-lg hover:bg-white/10 transition-colors",children:e.jsx(Y,{className:"w-5 h-5"})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",onClick:r,children:e.jsx("div",{ref:n,className:"h-full w-full",onClick:i=>i.stopPropagation(),children:a})})]}),document.body)}function T(t,r=13){let a=0;for(const s of t)a+=/[\u2e80-\u9fff\uf900-\ufaff\uff00-\uffef\u3000-\u303f]/.test(s)?r:r*.58;return a}const q=118;function Ee(t){if(T(t)<=q)return[t];const r=[];for(let l=0;l<t.length;l++)/[\s/\-—·]/.test(t[l]??"")&&r.push(l);const a=t.length/2;let s=-1,n=1/0;for(const l of r){const g=Math.abs(l+1-a);g<n&&(n=g,s=l)}let i,o;if(s>=0)i=t.slice(0,s+1).trim(),o=t.slice(s+1).trim();else{let l=0,g=0;for(const w of t)if(l+=T(w),g++,l>=T(t)/2)break;i=t.slice(0,g),o=t.slice(g)}if(T(i)<=q&&T(o)<=q)return[i,o];const c=l=>{let g="";for(const w of l){if(T(g+w+"…")>q)break;g+=w}return g+"…"};return[T(i)>q?c(i):i,T(o)>q?c(o):o]}function ie(t,r){const a=Ee(t),s=r?14:13,n=Math.max(...a.map(l=>T(l,s))),i=r?30:24,o=17,c=r?18:14;return{width:Math.min(r?200:180,Math.max(r?92:76,n+i)),height:c+a.length*o,lines:a}}function ze(t,r,a){const s=new Set(t.map(n=>n.id));if(Array.isArray(a)&&a.length>0){const n=new Set,i=[];for(const o of a){if(!o||typeof o.id!="string"||!o.id)continue;const c=Array.isArray(o.nodeIds)?[...new Set(o.nodeIds.filter(l=>typeof l=="string"&&s.has(l)&&!n.has(l)))]:[];c.length<2||(c.forEach(l=>n.add(l)),i.push({id:o.id,label:typeof o.label=="string"&&o.label?o.label:"分组",nodeIds:c}))}if(i.length>0&&!(i.length===1&&n.size===t.length&&t.length>2))return{groups:i,fallback:!1}}return{groups:$e(t,r),fallback:!0}}function $e(t,r){if(t.length<4)return[];const a=new Map(t.map((m,d)=>[m.id,d])),s=new Map;for(const m of t)s.set(m.id,[]);const n=new Set;for(const m of r){if(!a.has(m.from)||!a.has(m.to)||m.from===m.to)continue;const d=[m.from,m.to].sort().join("→");n.has(d)||(n.add(d),s.get(m.from).push(m.to),s.get(m.to).push(m.from))}const i=[...t].sort((m,d)=>{const f=s.get(m.id).length,N=s.get(d.id).length;return f!==N?N-f:(a.get(m.id)??0)-(a.get(d.id)??0)}),o=Math.min(3,Math.max(1,Math.ceil(t.length/4))),c=i.slice(0,o).filter(m=>{var d;return(((d=s.get(m.id))==null?void 0:d.length)??0)>0});if(c.length===0)return[];const l=new Map;c.forEach((m,d)=>l.set(m.id,d));const g=c.map(m=>m.id);for(;g.length;){const m=g.shift(),d=l.get(m);for(const f of s.get(m)??[])l.has(f)||(l.set(f,d),g.push(f))}const w=[];return c.forEach((m,d)=>{const f=t.filter(N=>l.get(N.id)===d).map(N=>N.id);f.length<2||w.push({id:`grp-${m.id}`,label:m.label.length<=5?`${m.label}相关`:m.label,nodeIds:f})}),w}const W=34;function Ie(t,r,a){var m;const s=new Set(t.map(d=>d.id)),n=new Map;for(const d of t)n.set(d.id,0);const i=new Set,o=[];for(const d of r){if(!s.has(d.from)||!s.has(d.to)||d.from===d.to)continue;const f=[d.from,d.to].sort().join("→");i.has(f)||(i.add(f),o.push(d),n.set(d.from,n.get(d.from)+1),n.set(d.to,n.get(d.to)+1))}let c=((m=t[0])==null?void 0:m.id)??"";for(const d of t)(n.get(d.id)??0)>(n.get(c)??0)&&(c=d.id);const l=new Map;for(const d of a)for(const f of d.nodeIds)s.has(f)&&!l.has(f)&&l.set(f,d.id);const g=d=>{const f=ie(d.label,d.id===c||(n.get(d.id)??0)>=4);return{id:d.id,width:Math.ceil(f.width),height:Math.ceil(f.height)}},w=[];for(const d of a){const f=d.nodeIds.filter(N=>l.get(N)===d.id&&s.has(N));f.length!==0&&w.push({id:`g:${d.id}`,layoutOptions:{"elk.padding":`[top=${W},left=14,bottom=12,right=14]`},children:f.map(N=>g(t.find(p=>p.id===N)))})}for(const d of t)l.has(d.id)||w.push(g(d));return{id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":"34","elk.spacing.edgeNode":"26","elk.spacing.componentComponent":"48","elk.layered.spacing.nodeNodeBetweenLayers":"56"},children:w,edges:o.map((d,f)=>({id:`e${f}`,sources:[d.from],targets:[d.to]}))}}function Te(t){if(t.length===0)return{x:0,y:0};if(t.length===1)return t[0];const r=[];let a=0;for(let n=1;n<t.length;n++){const i=Math.hypot(t[n].x-t[n-1].x,t[n].y-t[n-1].y);r.push(i),a+=i}let s=a/2;for(let n=0;n<r.length;n++){if(s<=r[n]||n===r.length-1){const i=r[n]===0?0:s/r[n];return{x:t[n].x+(t[n+1].x-t[n].x)*i,y:t[n].y+(t[n+1].y-t[n].y)*i}}s-=r[n]}return t[t.length-1]}function Le(t,r,a,s,n,i){var b;const o=new Map(r.map(u=>[u.id,u])),c=new Map;s.forEach((u,x)=>c.set(u.id,x%5));const l=new Map(s.map(u=>[u.id,u])),g=new Map;for(const u of s)for(const x of u.nodeIds)g.has(x)||g.set(x,u.id);const w=[],m=[],d=[],f=new Map([["root",{x:0,y:0}]]),N=[],p=(u,x,y,v)=>{var z;for(const C of u.children??[]){const $=x+(C.x??0),M=y+(C.y??0);if((z=C.children)!=null&&z.length){const k=C.id.startsWith("g:")?C.id.slice(2):C.id,E=l.get(k);m.push({id:k,label:(E==null?void 0:E.label)??"分组",x:$,y:M,w:C.width??0,h:C.height??0,colorIdx:c.get(k)??0}),f.set(C.id,{x:$,y:M}),p(C,$,M,k)}else{const k=o.get(C.id);if(!k)continue;const E=ie(k.label,k.id===i),I=g.get(k.id)??null;w.push({id:k.id,x:$,y:M,w:C.width??Math.ceil(E.width),h:C.height??Math.ceil(E.height),lines:E.lines,hub:k.id===i,groupId:v,colorIdx:I!=null?c.get(I)??0:-1})}}for(const C of u.edges??[])N.push({e:C,fallback:{x,y}})};p(t,0,0,null);for(const{e:u,fallback:x}of N){const y=(b=u.sections)==null?void 0:b[0];if(!y)continue;const v=(u.container!=null?f.get(u.container):void 0)??x,z=[y.startPoint,...y.bendPoints??[],y.endPoint].map(M=>({x:M.x+v.x,y:M.y+v.y})),C=Number(u.id.slice(1)),$=a[C];$&&d.push({from:$.from,to:$.to,label:$.label,pts:z,labelPt:$.label?Te(z):null})}return{width:Math.ceil(t.width??0),height:Math.ceil(t.height??0),nodes:w,groups:m,edges:d,hubId:i,groupsFallback:n}}let ae=null;function _e(){return ae??(ae=J(()=>import("./elk.bundled-CktUbZ7z.js").then(t=>t.e),__vite__mapDeps([0,1,2,3]),import.meta.url).then(t=>{const r=t,a=r.default??r;return new a})),ae}async function qe(t,r,a){const s=ze(t,r,a),n=Ie(t,r,s.groups),i=Re(t,r),c=await(await _e()).layout(n);return Le(c,t,r,s.groups,s.fallback,i)}function Re(t,r){var o;const a=new Set(t.map(c=>c.id)),s=new Map;for(const c of t)s.set(c.id,0);const n=new Set;for(const c of r){if(!a.has(c.from)||!a.has(c.to)||c.from===c.to)continue;const l=[c.from,c.to].sort().join("→");n.has(l)||(n.add(l),s.set(c.from,s.get(c.from)+1),s.set(c.to,s.get(c.to)+1))}let i=((o=t[0])==null?void 0:o.id)??"";for(const c of t)(s.get(c.id)??0)>(s.get(i)??0)&&(i=c.id);return i}const A=.4,V=2.5,P=.2;function Oe(t){return t.map((r,a)=>`${a===0?"M":"L"} ${r.x.toFixed(1)} ${r.y.toFixed(1)}`).join(" ")}function X({layout:t}){return e.jsxs("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,style:{display:"block"},"data-testid":"conceptmap-svg",children:[e.jsx("defs",{children:e.jsx("marker",{id:"cm-arrow",viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:6.5,markerHeight:6.5,orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-ink-faint"})})}),t.groups.map((r,a)=>e.jsxs("g",{className:"cm-enter",style:{animationDelay:`${a*60}ms`},children:[e.jsx("rect",{x:r.x,y:r.y,width:r.w,height:r.h,rx:14,className:"cm-group-box",style:{fill:`var(--cm-c${r.colorIdx}-fill)`,stroke:`var(--cm-c${r.colorIdx}-line)`}}),e.jsx("rect",{x:r.x,y:r.y,width:r.w,height:W,rx:14,className:"cm-group-head",style:{fill:`var(--cm-c${r.colorIdx}-line)`}}),e.jsx("rect",{x:r.x,y:r.y+W/2,width:r.w,height:W/2,className:"cm-group-head",style:{fill:`var(--cm-c${r.colorIdx}-line)`}}),e.jsx("text",{x:r.x+14,y:r.y+22,fontSize:12,fontWeight:600,fill:`var(--cm-c${r.colorIdx}-line)`,"data-testid":"conceptmap-group-label",children:r.label})]},`g-${r.id}`)),t.edges.map((r,a)=>{const s=r.label?{width:T(r.label,12)+16,height:19}:null;return e.jsxs("g",{className:"cm-enter",style:{animationDelay:`${(t.groups.length+1)*60+a*30}ms`},children:[e.jsx("path",{d:Oe(r.pts),className:"fill-none stroke-ink-faint/80",strokeWidth:1.6,markerEnd:"url(#cm-arrow)"}),r.label&&s&&r.labelPt&&e.jsxs("g",{children:[e.jsx("rect",{x:r.labelPt.x-s.width/2,y:r.labelPt.y-s.height/2,width:s.width,height:s.height,rx:s.height/2,className:"fill-surface-0/95 stroke-[var(--border-faint)]",strokeWidth:1}),e.jsx("text",{x:r.labelPt.x,y:r.labelPt.y+3.5,textAnchor:"middle",fontSize:12,className:"fill-ink-muted font-medium",style:{paintOrder:"stroke"},stroke:"var(--surface-0)",strokeWidth:3,children:r.label})]})]},`e-${a}`)}),t.nodes.map((r,a)=>{const s=r.colorIdx>=0?`var(--cm-c${r.colorIdx}-fill)`:"var(--surface-3)",n=r.colorIdx>=0?`var(--cm-c${r.colorIdx}-line)`:"var(--border)",i=r.hub?14:13;return e.jsxs("g",{className:"cm-enter",style:{animationDelay:`${(t.groups.length+2)*60+a*35}ms`},children:[e.jsx("rect",{x:r.x,y:r.y,width:r.w,height:r.h,rx:r.hub?12:10,fill:s,stroke:n,strokeWidth:r.hub?1.8:1.4}),r.lines.map((o,c)=>e.jsx("text",{x:r.x+r.w/2,y:r.y+r.h/2+(c-(r.lines.length-1)/2)*17+4.5,textAnchor:"middle",fontSize:i,className:r.hub?"fill-ink-strong font-bold":"fill-ink",children:o},c))]},r.id)})]})}function Ae({data:t,variant:r="card"}){const a=t,s=L(),n=h.useMemo(()=>JSON.stringify({n:a.nodes,e:a.edges,g:a.groups??null}),[a.nodes,a.edges,a.groups]),[i,o]=h.useState(null);h.useEffect(()=>{let b=!0;return o(null),qe(a.nodes,a.edges,a.groups??null).then(u=>{b&&o(u)}).catch(()=>{}),()=>{b=!1}},[n]);const[c,l]=h.useState(1),[g,w]=h.useState(!1),m=h.useRef(null);h.useEffect(()=>{const b=m.current;if(!b||!i)return;const u=()=>{const y=(b.clientWidth-16)/i.width;y<1&&l(Math.max(A,+y.toFixed(2)))};u();const x=new ResizeObserver(u);return x.observe(b),()=>x.disconnect()},[i==null?void 0:i.width,i]);const d=h.useCallback(()=>l(b=>Math.min(V,+(b+P).toFixed(2))),[]),f=h.useCallback(()=>l(b=>Math.max(A,+(b-P).toFixed(2))),[]),N=h.useCallback(()=>l(1),[]),p=h.useCallback(b=>{if(!b.ctrlKey&&!b.metaKey)return;b.preventDefault();const u=b.deltaY>0?-P:P;l(x=>Math.min(V,Math.max(A,+(x+u).toFixed(2))))},[]);return r==="canvas"?e.jsx("div",{"data-testid":"conceptmap-canvas-content",children:i?e.jsx(X,{layout:i}):e.jsx("div",{style:{minWidth:320,minHeight:160}})}):e.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-concept-map",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx(he,{className:"w-4 h-4 text-ink-muted shrink-0"}),e.jsx("h3",{className:"text-body font-bold text-ink truncate",children:a.title})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-1","data-testid":"conceptmap-zoom-controls",children:[e.jsx("button",{onClick:f,disabled:c<=A,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:s("artifact.zoomOut"),children:"−"}),e.jsxs("button",{onClick:N,className:"px-1.5 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 text-caption font-bold tabular-nums",title:s("artifact.zoomReset"),children:[Math.round(c*100),"%"]}),e.jsx("button",{onClick:d,disabled:c>=V,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:s("artifact.zoomIn"),children:"+"})]}),e.jsx("button",{onClick:()=>w(!0),"data-testid":"conceptmap-expand","aria-label":s("artifact.viewer.open"),"data-tooltip":s("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center",children:e.jsx(H,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{ref:m,onClick:()=>w(!0),onWheel:p,className:"bg-surface-0/40 rounded-lg p-2 overflow-auto min-h-[160px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"conceptmap-render-area","data-noswipe":"",children:i?e.jsx("div",{style:{width:i.width*c,height:i.height*c,margin:"0 auto"},children:e.jsx("div",{style:{transform:`scale(${c})`,transformOrigin:"top left",width:i.width,height:i.height},children:e.jsx(X,{layout:i})})}):e.jsx("div",{className:"h-[152px] flex items-center justify-center text-caption text-ink-muted","data-testid":"conceptmap-loading",children:"…"})}),e.jsx("div",{className:"mt-1.5 flex items-center justify-between text-caption text-ink-muted",children:e.jsx("span",{children:s("artifact.conceptmap.stats",{nodes:a.nodes.length,edges:a.edges.length})})}),a.warnings&&a.warnings.length>0&&e.jsxs("div",{className:"mt-1 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[e.jsx(R,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),e.jsx("span",{children:a.warnings.join("; ")})]}),g&&e.jsx(K,{title:a.title,onClose:()=>w(!1),children:e.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:e.jsx(F,{testid:"conceptmap-modal-stage",children:i?e.jsx(X,{layout:i}):e.jsx("div",{className:"min-w-[320px] min-h-[160px]"})})})})]})}function Pe(t,r){const{correct:a,total:s}=t,n=s>0&&a===s,i=s>0&&a<s,o=r!=null&&r>=fe,c=r!=null&&r>=xe;return i?[{id:"explain-wrong"},{id:"retry"}]:n&&o?[{id:"next-topic"},{id:"go-deeper"}]:n&&c?[{id:"mark-mastered",advancesMastery:!0},{id:"next-topic"},{id:"go-deeper"}]:[{id:"go-deeper"},{id:"retry"}]}const Be="ls-quiz-progress:";function We(t){const r=t.questions.map(s=>`${s.prompt}|${(s.options??[]).join("/")}#${s.answer??""}`).join(`
|
|
17
|
+
*/const Se=Q("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);function K({title:t,onClose:r,children:a}){const s=L(),n=h.useRef(null);return me(n,!0),h.useEffect(()=>{const i=o=>{o.key==="Escape"&&r()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[r]),ue.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-black/80","data-testid":"diagram-viewer-modal","data-noswipe":"",role:"dialog","aria-modal":"true","aria-label":t,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 shrink-0",onClick:i=>i.stopPropagation(),children:[e.jsx("h3",{className:"text-body font-bold text-white truncate",children:t}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsx("span",{className:"text-caption text-white/50 hidden sm:inline",children:s("artifact.viewer.hint")}),e.jsx("button",{onClick:r,"data-testid":"diagram-viewer-close","aria-label":s("action.close"),"data-tooltip":s("action.close"),className:"text-white/70 hover:text-white w-9 h-9 flex items-center justify-center rounded-lg hover:bg-white/10 transition-colors",children:e.jsx(Y,{className:"w-5 h-5"})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-2 pb-2",onClick:r,children:e.jsx("div",{ref:n,className:"h-full w-full",onClick:i=>i.stopPropagation(),children:a})})]}),document.body)}function T(t,r=13){let a=0;for(const s of t)a+=/[\u2e80-\u9fff\uf900-\ufaff\uff00-\uffef\u3000-\u303f]/.test(s)?r:r*.58;return a}const q=118;function Ee(t){if(T(t)<=q)return[t];const r=[];for(let l=0;l<t.length;l++)/[\s/\-—·]/.test(t[l]??"")&&r.push(l);const a=t.length/2;let s=-1,n=1/0;for(const l of r){const g=Math.abs(l+1-a);g<n&&(n=g,s=l)}let i,o;if(s>=0)i=t.slice(0,s+1).trim(),o=t.slice(s+1).trim();else{let l=0,g=0;for(const w of t)if(l+=T(w),g++,l>=T(t)/2)break;i=t.slice(0,g),o=t.slice(g)}if(T(i)<=q&&T(o)<=q)return[i,o];const c=l=>{let g="";for(const w of l){if(T(g+w+"…")>q)break;g+=w}return g+"…"};return[T(i)>q?c(i):i,T(o)>q?c(o):o]}function ie(t,r){const a=Ee(t),s=r?14:13,n=Math.max(...a.map(l=>T(l,s))),i=r?30:24,o=17,c=r?18:14;return{width:Math.min(r?200:180,Math.max(r?92:76,n+i)),height:c+a.length*o,lines:a}}function ze(t,r,a){const s=new Set(t.map(n=>n.id));if(Array.isArray(a)&&a.length>0){const n=new Set,i=[];for(const o of a){if(!o||typeof o.id!="string"||!o.id)continue;const c=Array.isArray(o.nodeIds)?[...new Set(o.nodeIds.filter(l=>typeof l=="string"&&s.has(l)&&!n.has(l)))]:[];c.length<2||(c.forEach(l=>n.add(l)),i.push({id:o.id,label:typeof o.label=="string"&&o.label?o.label:"分组",nodeIds:c}))}if(i.length>0&&!(i.length===1&&n.size===t.length&&t.length>2))return{groups:i,fallback:!1}}return{groups:$e(t,r),fallback:!0}}function $e(t,r){if(t.length<4)return[];const a=new Map(t.map((m,d)=>[m.id,d])),s=new Map;for(const m of t)s.set(m.id,[]);const n=new Set;for(const m of r){if(!a.has(m.from)||!a.has(m.to)||m.from===m.to)continue;const d=[m.from,m.to].sort().join("→");n.has(d)||(n.add(d),s.get(m.from).push(m.to),s.get(m.to).push(m.from))}const i=[...t].sort((m,d)=>{const f=s.get(m.id).length,N=s.get(d.id).length;return f!==N?N-f:(a.get(m.id)??0)-(a.get(d.id)??0)}),o=Math.min(3,Math.max(1,Math.ceil(t.length/4))),c=i.slice(0,o).filter(m=>{var d;return(((d=s.get(m.id))==null?void 0:d.length)??0)>0});if(c.length===0)return[];const l=new Map;c.forEach((m,d)=>l.set(m.id,d));const g=c.map(m=>m.id);for(;g.length;){const m=g.shift(),d=l.get(m);for(const f of s.get(m)??[])l.has(f)||(l.set(f,d),g.push(f))}const w=[];return c.forEach((m,d)=>{const f=t.filter(N=>l.get(N.id)===d).map(N=>N.id);f.length<2||w.push({id:`grp-${m.id}`,label:m.label.length<=5?`${m.label}相关`:m.label,nodeIds:f})}),w}const W=34;function Ie(t,r,a){var m;const s=new Set(t.map(d=>d.id)),n=new Map;for(const d of t)n.set(d.id,0);const i=new Set,o=[];for(const d of r){if(!s.has(d.from)||!s.has(d.to)||d.from===d.to)continue;const f=[d.from,d.to].sort().join("→");i.has(f)||(i.add(f),o.push(d),n.set(d.from,n.get(d.from)+1),n.set(d.to,n.get(d.to)+1))}let c=((m=t[0])==null?void 0:m.id)??"";for(const d of t)(n.get(d.id)??0)>(n.get(c)??0)&&(c=d.id);const l=new Map;for(const d of a)for(const f of d.nodeIds)s.has(f)&&!l.has(f)&&l.set(f,d.id);const g=d=>{const f=ie(d.label,d.id===c||(n.get(d.id)??0)>=4);return{id:d.id,width:Math.ceil(f.width),height:Math.ceil(f.height)}},w=[];for(const d of a){const f=d.nodeIds.filter(N=>l.get(N)===d.id&&s.has(N));f.length!==0&&w.push({id:`g:${d.id}`,layoutOptions:{"elk.padding":`[top=${W},left=14,bottom=12,right=14]`},children:f.map(N=>g(t.find(p=>p.id===N)))})}for(const d of t)l.has(d.id)||w.push(g(d));return{id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.hierarchyHandling":"INCLUDE_CHILDREN","elk.spacing.nodeNode":"34","elk.spacing.edgeNode":"26","elk.spacing.componentComponent":"48","elk.layered.spacing.nodeNodeBetweenLayers":"56"},children:w,edges:o.map((d,f)=>({id:`e${f}`,sources:[d.from],targets:[d.to]}))}}function Te(t){if(t.length===0)return{x:0,y:0};if(t.length===1)return t[0];const r=[];let a=0;for(let n=1;n<t.length;n++){const i=Math.hypot(t[n].x-t[n-1].x,t[n].y-t[n-1].y);r.push(i),a+=i}let s=a/2;for(let n=0;n<r.length;n++){if(s<=r[n]||n===r.length-1){const i=r[n]===0?0:s/r[n];return{x:t[n].x+(t[n+1].x-t[n].x)*i,y:t[n].y+(t[n+1].y-t[n].y)*i}}s-=r[n]}return t[t.length-1]}function Le(t,r,a,s,n,i){var b;const o=new Map(r.map(u=>[u.id,u])),c=new Map;s.forEach((u,x)=>c.set(u.id,x%5));const l=new Map(s.map(u=>[u.id,u])),g=new Map;for(const u of s)for(const x of u.nodeIds)g.has(x)||g.set(x,u.id);const w=[],m=[],d=[],f=new Map([["root",{x:0,y:0}]]),N=[],p=(u,x,y,v)=>{var z;for(const C of u.children??[]){const $=x+(C.x??0),M=y+(C.y??0);if((z=C.children)!=null&&z.length){const k=C.id.startsWith("g:")?C.id.slice(2):C.id,E=l.get(k);m.push({id:k,label:(E==null?void 0:E.label)??"分组",x:$,y:M,w:C.width??0,h:C.height??0,colorIdx:c.get(k)??0}),f.set(C.id,{x:$,y:M}),p(C,$,M,k)}else{const k=o.get(C.id);if(!k)continue;const E=ie(k.label,k.id===i),I=g.get(k.id)??null;w.push({id:k.id,x:$,y:M,w:C.width??Math.ceil(E.width),h:C.height??Math.ceil(E.height),lines:E.lines,hub:k.id===i,groupId:v,colorIdx:I!=null?c.get(I)??0:-1})}}for(const C of u.edges??[])N.push({e:C,fallback:{x,y}})};p(t,0,0,null);for(const{e:u,fallback:x}of N){const y=(b=u.sections)==null?void 0:b[0];if(!y)continue;const v=(u.container!=null?f.get(u.container):void 0)??x,z=[y.startPoint,...y.bendPoints??[],y.endPoint].map(M=>({x:M.x+v.x,y:M.y+v.y})),C=Number(u.id.slice(1)),$=a[C];$&&d.push({from:$.from,to:$.to,label:$.label,pts:z,labelPt:$.label?Te(z):null})}return{width:Math.ceil(t.width??0),height:Math.ceil(t.height??0),nodes:w,groups:m,edges:d,hubId:i,groupsFallback:n}}let ae=null;function _e(){return ae??(ae=J(()=>import("./elk.bundled-DP5Rghza.js").then(t=>t.e),__vite__mapDeps([0,1,2,3]),import.meta.url).then(t=>{const r=t,a=r.default??r;return new a})),ae}async function qe(t,r,a){const s=ze(t,r,a),n=Ie(t,r,s.groups),i=Re(t,r),c=await(await _e()).layout(n);return Le(c,t,r,s.groups,s.fallback,i)}function Re(t,r){var o;const a=new Set(t.map(c=>c.id)),s=new Map;for(const c of t)s.set(c.id,0);const n=new Set;for(const c of r){if(!a.has(c.from)||!a.has(c.to)||c.from===c.to)continue;const l=[c.from,c.to].sort().join("→");n.has(l)||(n.add(l),s.set(c.from,s.get(c.from)+1),s.set(c.to,s.get(c.to)+1))}let i=((o=t[0])==null?void 0:o.id)??"";for(const c of t)(s.get(c.id)??0)>(s.get(i)??0)&&(i=c.id);return i}const A=.4,V=2.5,P=.2;function Oe(t){return t.map((r,a)=>`${a===0?"M":"L"} ${r.x.toFixed(1)} ${r.y.toFixed(1)}`).join(" ")}function X({layout:t}){return e.jsxs("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,style:{display:"block"},"data-testid":"conceptmap-svg",children:[e.jsx("defs",{children:e.jsx("marker",{id:"cm-arrow",viewBox:"0 0 10 10",refX:9,refY:5,markerWidth:6.5,markerHeight:6.5,orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-ink-faint"})})}),t.groups.map((r,a)=>e.jsxs("g",{className:"cm-enter",style:{animationDelay:`${a*60}ms`},children:[e.jsx("rect",{x:r.x,y:r.y,width:r.w,height:r.h,rx:14,className:"cm-group-box",style:{fill:`var(--cm-c${r.colorIdx}-fill)`,stroke:`var(--cm-c${r.colorIdx}-line)`}}),e.jsx("rect",{x:r.x,y:r.y,width:r.w,height:W,rx:14,className:"cm-group-head",style:{fill:`var(--cm-c${r.colorIdx}-line)`}}),e.jsx("rect",{x:r.x,y:r.y+W/2,width:r.w,height:W/2,className:"cm-group-head",style:{fill:`var(--cm-c${r.colorIdx}-line)`}}),e.jsx("text",{x:r.x+14,y:r.y+22,fontSize:12,fontWeight:600,fill:`var(--cm-c${r.colorIdx}-line)`,"data-testid":"conceptmap-group-label",children:r.label})]},`g-${r.id}`)),t.edges.map((r,a)=>{const s=r.label?{width:T(r.label,12)+16,height:19}:null;return e.jsxs("g",{className:"cm-enter",style:{animationDelay:`${(t.groups.length+1)*60+a*30}ms`},children:[e.jsx("path",{d:Oe(r.pts),className:"fill-none stroke-ink-faint/80",strokeWidth:1.6,markerEnd:"url(#cm-arrow)"}),r.label&&s&&r.labelPt&&e.jsxs("g",{children:[e.jsx("rect",{x:r.labelPt.x-s.width/2,y:r.labelPt.y-s.height/2,width:s.width,height:s.height,rx:s.height/2,className:"fill-surface-0/95 stroke-[var(--border-faint)]",strokeWidth:1}),e.jsx("text",{x:r.labelPt.x,y:r.labelPt.y+3.5,textAnchor:"middle",fontSize:12,className:"fill-ink-muted font-medium",style:{paintOrder:"stroke"},stroke:"var(--surface-0)",strokeWidth:3,children:r.label})]})]},`e-${a}`)}),t.nodes.map((r,a)=>{const s=r.colorIdx>=0?`var(--cm-c${r.colorIdx}-fill)`:"var(--surface-3)",n=r.colorIdx>=0?`var(--cm-c${r.colorIdx}-line)`:"var(--border)",i=r.hub?14:13;return e.jsxs("g",{className:"cm-enter",style:{animationDelay:`${(t.groups.length+2)*60+a*35}ms`},children:[e.jsx("rect",{x:r.x,y:r.y,width:r.w,height:r.h,rx:r.hub?12:10,fill:s,stroke:n,strokeWidth:r.hub?1.8:1.4}),r.lines.map((o,c)=>e.jsx("text",{x:r.x+r.w/2,y:r.y+r.h/2+(c-(r.lines.length-1)/2)*17+4.5,textAnchor:"middle",fontSize:i,className:r.hub?"fill-ink-strong font-bold":"fill-ink",children:o},c))]},r.id)})]})}function Ae({data:t,variant:r="card"}){const a=t,s=L(),n=h.useMemo(()=>JSON.stringify({n:a.nodes,e:a.edges,g:a.groups??null}),[a.nodes,a.edges,a.groups]),[i,o]=h.useState(null);h.useEffect(()=>{let b=!0;return o(null),qe(a.nodes,a.edges,a.groups??null).then(u=>{b&&o(u)}).catch(()=>{}),()=>{b=!1}},[n]);const[c,l]=h.useState(1),[g,w]=h.useState(!1),m=h.useRef(null);h.useEffect(()=>{const b=m.current;if(!b||!i)return;const u=()=>{const y=(b.clientWidth-16)/i.width;y<1&&l(Math.max(A,+y.toFixed(2)))};u();const x=new ResizeObserver(u);return x.observe(b),()=>x.disconnect()},[i==null?void 0:i.width,i]);const d=h.useCallback(()=>l(b=>Math.min(V,+(b+P).toFixed(2))),[]),f=h.useCallback(()=>l(b=>Math.max(A,+(b-P).toFixed(2))),[]),N=h.useCallback(()=>l(1),[]),p=h.useCallback(b=>{if(!b.ctrlKey&&!b.metaKey)return;b.preventDefault();const u=b.deltaY>0?-P:P;l(x=>Math.min(V,Math.max(A,+(x+u).toFixed(2))))},[]);return r==="canvas"?e.jsx("div",{"data-testid":"conceptmap-canvas-content",children:i?e.jsx(X,{layout:i}):e.jsx("div",{style:{minWidth:320,minHeight:160}})}):e.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-concept-map",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx(he,{className:"w-4 h-4 text-ink-muted shrink-0"}),e.jsx("h3",{className:"text-body font-bold text-ink truncate",children:a.title})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-1","data-testid":"conceptmap-zoom-controls",children:[e.jsx("button",{onClick:f,disabled:c<=A,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:s("artifact.zoomOut"),children:"−"}),e.jsxs("button",{onClick:N,className:"px-1.5 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 text-caption font-bold tabular-nums",title:s("artifact.zoomReset"),children:[Math.round(c*100),"%"]}),e.jsx("button",{onClick:d,disabled:c>=V,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:s("artifact.zoomIn"),children:"+"})]}),e.jsx("button",{onClick:()=>w(!0),"data-testid":"conceptmap-expand","aria-label":s("artifact.viewer.open"),"data-tooltip":s("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center",children:e.jsx(H,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{ref:m,onClick:()=>w(!0),onWheel:p,className:"bg-surface-0/40 rounded-lg p-2 overflow-auto min-h-[160px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"conceptmap-render-area","data-noswipe":"",children:i?e.jsx("div",{style:{width:i.width*c,height:i.height*c,margin:"0 auto"},children:e.jsx("div",{style:{transform:`scale(${c})`,transformOrigin:"top left",width:i.width,height:i.height},children:e.jsx(X,{layout:i})})}):e.jsx("div",{className:"h-[152px] flex items-center justify-center text-caption text-ink-muted","data-testid":"conceptmap-loading",children:"…"})}),e.jsx("div",{className:"mt-1.5 flex items-center justify-between text-caption text-ink-muted",children:e.jsx("span",{children:s("artifact.conceptmap.stats",{nodes:a.nodes.length,edges:a.edges.length})})}),a.warnings&&a.warnings.length>0&&e.jsxs("div",{className:"mt-1 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[e.jsx(R,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),e.jsx("span",{children:a.warnings.join("; ")})]}),g&&e.jsx(K,{title:a.title,onClose:()=>w(!1),children:e.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:e.jsx(F,{testid:"conceptmap-modal-stage",children:i?e.jsx(X,{layout:i}):e.jsx("div",{className:"min-w-[320px] min-h-[160px]"})})})})]})}function Pe(t,r){const{correct:a,total:s}=t,n=s>0&&a===s,i=s>0&&a<s,o=r!=null&&r>=fe,c=r!=null&&r>=xe;return i?[{id:"explain-wrong"},{id:"retry"}]:n&&o?[{id:"next-topic"},{id:"go-deeper"}]:n&&c?[{id:"mark-mastered",advancesMastery:!0},{id:"next-topic"},{id:"go-deeper"}]:[{id:"go-deeper"},{id:"retry"}]}const Be="ls-quiz-progress:";function We(t){const r=t.questions.map(s=>`${s.prompt}|${(s.options??[]).join("/")}#${s.answer??""}`).join(`
|
|
18
18
|
`);let a=2166136261;for(let s=0;s<r.length;s++)a^=r.charCodeAt(s),a=Math.imul(a,16777619);return`${Be}${(a>>>0).toString(36)}`}function De(t){var r,a;try{const s=localStorage.getItem(t);if(!s)return null;const n=JSON.parse(s);return typeof(n==null?void 0:n.current)=="number"&&n.current>=0&&typeof((r=n==null?void 0:n.score)==null?void 0:r.correct)=="number"&&typeof((a=n==null?void 0:n.score)==null?void 0:a.total)=="number"?n:null}catch{return null}}function He(t,r){try{localStorage.setItem(t,JSON.stringify(r))}catch{}}const Fe={"explain-wrong":{icon:Ce,labelKey:"quiz.action.explainWrong",message:"我刚才有题答错了,帮我讲讲为什么错、正确的思路是什么。"},retry:{icon:Ne,labelKey:"quiz.action.retry",message:"再来一组类似的题巩固一下。"},"go-deeper":{icon:be,labelKey:"quiz.action.goDeeper",message:"这组我答得不错,帮我深入讲讲背后的原理和容易混淆的地方。"},"mark-mastered":{icon:ge,labelKey:"quiz.action.markMastered",message:"这课我觉得掌握了,帮我确认一下——出个综合题检验,通过了就标记为掌握。"},"next-topic":{icon:ve,labelKey:"quiz.action.nextTopic",message:"进入下一个知识点。"}};function Ke({data:t,onAnswered:r,quizMastery:a,onPickAction:s,onQuizCompleted:n}){const i=t,o=L(),c=h.useMemo(()=>We(i),[i]),l=h.useMemo(()=>De(c),[c]),[g,w]=h.useState((l==null?void 0:l.current)??0),[m,d]=h.useState(null),[f,N]=h.useState(!1),[p,b]=h.useState((l==null?void 0:l.score)??{correct:0,total:0}),u=h.useRef([]);h.useEffect(()=>{He(c,{current:g,score:p})},[c,g,p]);const[x,y]=h.useState(!1);if(g>=i.questions.length){const M=!!s&&!n;if(n)return e.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[e.jsx("div",{className:"text-2xl mb-2",children:p.correct===p.total?"🎉":"📚"}),e.jsx("div",{className:"text-body font-bold text-ink",children:o("quiz.scoreSummary",{correct:p.correct,total:p.total})}),x?e.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"quiz-hook-sent",children:o("quiz.hook.sent")}):e.jsx("button",{onClick:()=>{y(!0),n({title:i.title??"",correct:p.correct,total:p.total,detail:[...u.current]})},"data-testid":"quiz-hook-finish",className:"btn-3d-brand mt-3 px-5 py-2 text-body",children:o("quiz.hook.finish")})]});const k=M?Pe(p,a??null):[];return e.jsxs("div",{className:"surface-card p-4 text-center","data-testid":"artifact-quiz-done",children:[e.jsx("div",{className:"text-2xl mb-2",children:p.correct===p.total?"🎉":"📚"}),e.jsx("div",{className:"text-body font-bold text-ink",children:o("quiz.scoreSummary",{correct:p.correct,total:p.total})}),e.jsx("div",{className:"text-label text-ink-muted mt-1",children:p.correct===p.total?o("quiz.allCorrectHint"):o("quiz.tryAgainHint")}),k.length>0&&e.jsxs("div",{className:"mt-3 space-y-2 text-left","data-testid":"quiz-next-actions",children:[e.jsx("div",{className:"text-label text-ink-muted",children:o("quiz.action.nextPrompt")}),k.map((E,I)=>{const j=Fe[E.id],S=j.icon;return e.jsxs("button",{onClick:()=>s==null?void 0:s(j.message),"data-testid":`quiz-action-${E.id}`,className:`${I===0?"btn-3d-brand":"btn-3d-neutral"} w-full py-2 text-body flex items-center justify-center gap-1.5`,children:[e.jsx(S,{className:"w-4 h-4"}),o(j.labelKey)]},E.id)})]})]})}const v=i.questions[g],z=f&&m===v.answer,C=()=>{if(m===null)return;N(!0);const M=m===v.answer;b(k=>({correct:k.correct+(M?1:0),total:k.total+1})),r==null||r(v,m,M),u.current.push({prompt:v.prompt,chosen:v.options[m]??"?",answerText:v.options[v.answer]??"?",correct:M}),de(M?"correct":"wrong")},$=()=>{g===i.questions.length-1&&n&&!x&&(y(!0),n({title:i.title??"",correct:p.correct,total:p.total,detail:[...u.current]})),w(M=>M+1),d(null),N(!1)};return e.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-quiz",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{className:"w-4 h-4 text-brand"}),e.jsx("span",{className:"text-label font-bold text-brand",children:o("quiz.questionProgress",{cur:g+1,total:i.questions.length})})]}),e.jsx("span",{className:"text-label text-ink-muted",children:o("quiz.answeredCorrect",{n:p.correct})})]}),e.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:v.prompt}),e.jsx("div",{className:"space-y-2 mb-3",children:v.options.map((M,k)=>{const E=m===k,I=f&&k===v.answer,j=f&&E&&!I;return e.jsxs("button",{onClick:()=>!f&&d(k),disabled:f,"data-testid":`quiz-option-${k}`,className:`w-full text-left text-body p-2.5 rounded-lg border-2 font-medium transition-colors ${I?"border-brand bg-brand/10 text-brand animate-answer-correct":j?"border-warning bg-warning/10 text-warning animate-answer-wrong":E?"border-accent bg-accent/10 text-accent":"border-[var(--border)] text-ink-muted hover:border-[var(--border)]"} ${f?"cursor-default":"cursor-pointer"}`,children:[e.jsx("span",{className:"font-bold mr-2",children:String.fromCharCode(65+k)}),M,I&&e.jsx("span",{className:"float-right",children:e.jsx(U,{className:"w-4 h-4 inline-block"})}),j&&e.jsx("span",{className:"float-right",children:e.jsx(Y,{className:"w-4 h-4 inline-block"})})]},k)})}),f&&e.jsxs("div",{className:`rounded-lg p-3 mb-3 text-body leading-relaxed animate-artifact-render ${z?"bg-brand/10 border border-brand/30 text-brand":"bg-warning/10 border border-warning/30 text-warning"}`,"data-testid":"quiz-explanation",children:[e.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[z?e.jsx(U,{className:"w-4 h-4"}):e.jsx(Y,{className:"w-4 h-4"}),e.jsx("span",{children:o(z?"quiz.correct":"quiz.wrong")})]}),e.jsx("div",{className:"text-ink-muted",children:v.explanation})]}),f?e.jsx("button",{onClick:$,"data-testid":"quiz-next",className:"btn-3d-brand w-full py-2 text-body",children:g+1<i.questions.length?o("exercise.next"):o("quiz.finish")}):e.jsx("button",{onClick:C,disabled:m===null,"data-testid":"quiz-submit",className:"btn-3d-brand w-full py-2 text-body disabled:opacity-40",children:o("exercise.submit")}),i.warnings&&i.warnings.length>0&&e.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[e.jsx(R,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),e.jsx("span",{children:i.warnings.join("; ")})]})]})}function oe({data:t,variant:r="card"}){const a=t,s=L(),[n,i]=h.useState(!1),o=e.jsxs("table",{className:"text-body",style:{width:"max-content",minWidth:"100%"},children:[e.jsx("thead",{children:e.jsx("tr",{className:"bg-surface-3/60",children:a.headers.map((c,l)=>e.jsx("th",{className:`px-3 py-2.5 text-left font-bold border-b border-[var(--border)] ${l===0?"text-ink-strong":"text-ink"}`,children:c},l))})}),e.jsx("tbody",{children:a.rows.map((c,l)=>e.jsx("tr",{className:l%2===0?"bg-surface-0/40":"",children:c.map((g,w)=>e.jsx("td",{className:`px-3 py-2.5 border-b border-[var(--border-faint)] align-top leading-relaxed ${w===0?"font-bold text-ink-strong whitespace-nowrap bg-surface-1/40":"text-ink-muted"}`,style:w===0?void 0:{maxWidth:260,overflowWrap:"anywhere"},children:g},w))},l))})]});return r==="canvas"?e.jsx("div",{className:"w-fit","data-testid":"comparetable-canvas-content",children:o}):e.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-compare-table",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(we,{className:"w-4 h-4 text-ink-muted shrink-0"}),e.jsx("h3",{className:"text-body font-bold text-ink truncate",children:a.title})]}),e.jsx("button",{onClick:()=>i(!0),"data-testid":"comparetable-expand","aria-label":s("artifact.viewer.open"),"data-tooltip":s("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center shrink-0",children:e.jsx(H,{className:"w-3.5 h-3.5"})})]}),e.jsx("div",{className:"overflow-x-auto rounded-lg border border-[var(--border-faint)]",onClick:()=>i(!0),style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:o}),a.warnings&&a.warnings.length>0&&e.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[e.jsx(R,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),e.jsx("span",{children:a.warnings.join("; ")})]}),n&&e.jsx(K,{title:a.title,onClose:()=>i(!1),children:e.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:e.jsx(F,{testid:"comparetable-modal-stage",children:e.jsx("div",{className:"p-2 surface-card",children:e.jsx(oe,{data:t,variant:"canvas"})})})})})]})}function Ve(t){const r=t.split(`
|
|
19
19
|
`);for(let a=0;a<r.length;a++){const s=r[a]??"",n=s.trim();if(!(!n||n.startsWith("%%")))return/^flowchart-elk\b/i.test(n)?t:/^(flowchart|graph)\b/i.test(n)?(r[a]=s.replace(/^(\s*)(flowchart|graph)\b/i,"$1flowchart-elk"),r.join(`
|
|
20
|
-
`)):t}return t}let D=null;function Xe(){return D||(D=J(()=>import("./mermaid.core-BD32Za4p.js").then(t=>t.aW),__vite__mapDeps([4,5,1,2,6,7,8]),import.meta.url).then(async t=>{const r=t.default,{default:a}=await J(async()=>{const{default:s}=await import("./mermaid-layout-elk.core-BUAJJUsd.js").then(n=>n.m);return{default:s}},__vite__mapDeps([9,5,1,2,6]),import.meta.url);return r.registerLayoutLoaders(a),r.initialize({startOnLoad:!1,theme:"base",securityLevel:"loose",themeVariables:Ge(),flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis",nodeSpacing:42,rankSpacing:54,padding:10},sequence:{useMaxWidth:!0,boxMargin:8,noteMargin:8,messageMargin:32}}),r})),D}function Ge(){const t=(a,s)=>{if(typeof document>"u")return s;const n=getComputedStyle(document.documentElement).getPropertyValue(a).trim();return n?`rgb(${n})`:s};return{background:"transparent",fontFamily:typeof document<"u"&&getComputedStyle(document.body).fontFamily||"ui-sans-serif, system-ui, sans-serif",fontSize:"14px",primaryColor:t("--surface-3-rgb","rgb(42 43 46)"),primaryBorderColor:t("--border-rgb","rgb(37 38 41)"),primaryTextColor:t("--ink-strong-rgb","rgb(250 250 250)"),secondaryColor:t("--surface-2-rgb","rgb(32 33 36)"),secondaryBorderColor:t("--border-faint-rgb","rgb(26 26 29)"),secondaryTextColor:t("--ink-rgb","rgb(245 245 250)"),tertiaryColor:t("--surface-1-rgb","rgb(24 25 27)"),tertiaryBorderColor:t("--border-faint-rgb","rgb(26 26 29)"),tertiaryTextColor:t("--ink-rgb","rgb(245 245 250)"),lineColor:t("--ink-faint-rgb","rgb(117 117 126)"),textColor:t("--ink-rgb","rgb(245 245 250)"),edgeLabelBackground:t("--surface-0-rgb","rgb(12 13 15)"),clusterBkg:t("--surface-1-rgb","rgb(24 25 27)"),clusterBorder:t("--border-faint-rgb","rgb(26 26 29)"),nodeBorder:t("--border-rgb","rgb(37 38 41)"),mainBkg:t("--surface-3-rgb","rgb(42 43 46)"),nodeTextColor:t("--ink-rgb","rgb(245 245 250)"),arrowheadColor:t("--ink-faint-rgb","rgb(117 117 126)"),actorBkg:t("--surface-3-rgb","rgb(42 43 46)"),actorBorder:t("--border-rgb","rgb(37 38 41)"),actorTextColor:t("--ink-strong-rgb","rgb(250 250 250)"),activationBkgColor:t("--surface-3-rgb","rgb(42 43 46)"),activationBorderColor:t("--border-rgb","rgb(37 38 41)"),signalColor:t("--ink-rgb","rgb(245 245 250)"),signalTextColor:t("--ink-rgb","rgb(245 245 250)"),labelBoxBkgColor:t("--surface-2-rgb","rgb(32 33 36)"),labelBoxBorderColor:t("--border-rgb","rgb(37 38 41)"),labelTextColor:t("--ink-rgb","rgb(245 245 250)"),loopTextColor:t("--ink-strong-rgb","rgb(250 250 250)"),noteBkgColor:"rgb(255 200 0 / 0.12)",noteBorderColor:"rgb(255 200 0 / 0.4)",noteTextColor:t("--ink-rgb","rgb(245 245 250)")}}typeof window<"u"&&window.addEventListener("theme-changed",()=>{D=null});async function Ze(t,r){const a=await Xe(),s=Ve(r);try{await a.parse(s)}catch(i){throw new Error(`mermaid 语法校验失败: ${i instanceof Error?i.message:String(i)}`)}const{svg:n}=await a.render(t,s);if(n.includes('aria-roledescription="error"')||n.includes('class="error-text"')||n.includes("Syntax error"))throw new Error("mermaid 渲染失败(语法错误或节点 label 含未转义特殊字符)");return n}function se(t){let r=5381;for(let a=0;a<t.length;a++)r=(r<<5)+r+t.charCodeAt(a)>>>0;return r.toString(36)}const G=.3,Z=3,B=.2;function ce({data:t,variant:r="card"}){const a=t,s=L(),n={flowchart:s("artifact.diagram.flowchart"),sequence:s("artifact.diagram.sequence"),state:s("artifact.diagram.state")},i=h.useId().replace(/[:]/g,"_"),[o,c]=h.useState({status:"loading"}),[l,g]=h.useState(()=>{try{return sessionStorage.getItem(`mmdfix:${a.mermaid.length}:${se(a.mermaid)}`)??a.mermaid}catch{return a.mermaid}}),[w,m]=h.useState(!1),[d,f]=h.useState(!1),[N,p]=h.useState(0);h.useEffect(()=>{const j=()=>p(S=>S+1);return window.addEventListener("theme-changed",j),()=>window.removeEventListener("theme-changed",j)},[]);const[b,u]=h.useState(null),[x,y]=h.useState(1),[v,z]=h.useState(!1);h.useEffect(()=>{let j=!1;return c({status:"loading"}),u(null),Ze(`mmd-${i}`,l).then(S=>{if(!j&&(c({status:"rendered",svg:S}),l!==a.mermaid))try{sessionStorage.setItem(`mmdfix:${a.mermaid.length}:${se(a.mermaid)}`,l)}catch{}}).catch(S=>{j||(console.error("[MermaidArtifact] render failed:",S),c({status:"error",message:S instanceof Error?S.message:String(S)}))}),()=>{j=!0}},[l,i,N,a.mermaid]),h.useEffect(()=>{var j;o.status!=="error"||w||(m(!0),l===a.mermaid&&(j=window.api)!=null&&j.repairMermaidDiagram&&(f(!0),window.api.repairMermaidDiagram({mermaid:l,errorMessage:o.message,diagramType:a.diagramType}).then(S=>{S.ok&&S.mermaid.trim()&&g(S.mermaid)}).catch(()=>{}).finally(()=>f(!1))))},[o,w,l,a.mermaid,a.diagramType]);const C=`https://mermaid.live/edit#${encodeURIComponent(l)}`,$=h.useCallback(()=>y(j=>Math.min(Z,+(j+B).toFixed(2))),[]),M=h.useCallback(()=>y(j=>Math.max(G,+(j-B).toFixed(2))),[]),k=h.useCallback(()=>y(1),[]),E=h.useCallback(j=>{if(!j.ctrlKey&&!j.metaKey)return;j.preventDefault();const S=j.deltaY>0?-B:B;y(O=>Math.min(Z,Math.max(G,+(O+S).toFixed(2))))},[]),I=o.status==="rendered"?e.jsx("div",{ref:j=>{var S;if(j&&!b){const O=j.querySelector("svg");if(O){const ee=O.getBoundingClientRect(),_=(S=O.viewBox)==null?void 0:S.baseVal,te=_&&_.width?_.width:ee.width,re=_&&_.height?_.height:ee.height;te>0&&re>0&&u({width:te,height:re})}}},style:{width:(b==null?void 0:b.width)??void 0,height:(b==null?void 0:b.height)??void 0},dangerouslySetInnerHTML:{__html:o.svg},"data-testid":"mermaid-svg"}):null;return r==="canvas"?e.jsx("div",{"data-testid":"mermaid-canvas-content",children:I}):e.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-mermaid",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx(Se,{className:"w-4 h-4 text-ink-muted shrink-0"}),e.jsx("h3",{className:"text-body font-bold text-ink truncate",children:a.title}),e.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded bg-accent/15 text-accent shrink-0",children:n[a.diagramType]??a.diagramType})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[o.status==="rendered"&&e.jsxs("div",{className:"flex items-center gap-1","data-testid":"mermaid-zoom-controls",children:[e.jsx("button",{onClick:M,disabled:x<=G,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:s("artifact.zoomOut"),"data-testid":"mermaid-zoom-out",children:"−"}),e.jsxs("button",{onClick:k,className:"px-1.5 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 text-caption font-bold tabular-nums",title:s("artifact.zoomReset"),"data-testid":"mermaid-zoom-reset",children:[Math.round(x*100),"%"]}),e.jsx("button",{onClick:$,disabled:x>=Z,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:s("artifact.zoomIn"),"data-testid":"mermaid-zoom-in",children:"+"})]}),o.status==="rendered"&&e.jsx("button",{onClick:()=>z(!0),"data-testid":"mermaid-expand","aria-label":s("artifact.viewer.open"),"data-tooltip":s("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center",children:e.jsx(H,{className:"w-3.5 h-3.5"})})]}),e.jsx("button",{onClick:()=>window.open(C,"_blank"),className:"text-caption text-accent hover:underline font-bold shrink-0","data-testid":"mermaid-open-live",title:s("artifact.mermaid.openLive"),children:"mermaid.live ↗"})]}),e.jsxs("div",{onClick:()=>{o.status==="rendered"&&z(!0)},onWheel:E,className:"bg-surface-0/40 rounded-lg p-3 overflow-auto min-h-[120px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"mermaid-render-area","data-noswipe":"",children:[o.status==="loading"&&e.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-loading",children:[e.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),e.jsx("span",{children:s("artifact.mermaid.rendering")})]}),o.status==="rendered"&&e.jsx("div",{style:{width:b?b.width*x:"auto",height:b?b.height*x:"auto",margin:"0 auto"},children:e.jsx("div",{style:{transform:`scale(${x})`,transformOrigin:"top left"},children:I})}),o.status==="error"&&d&&e.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-repairing",children:[e.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),e.jsx("span",{children:s("artifact.mermaid.repairing")})]}),o.status==="error"&&!d&&e.jsxs("div",{className:"w-full text-center my-4","data-testid":"mermaid-fallback",children:[e.jsxs("div",{className:"text-body text-warning mb-2 flex items-center justify-center gap-1.5",children:[e.jsx(R,{className:"w-4 h-4 shrink-0"}),e.jsx("span",{children:s("artifact.mermaid.renderFailed")})]}),e.jsx("pre",{className:"text-label bg-surface-1/60 rounded p-2 overflow-x-auto text-ink-muted font-mono text-left",children:l}),e.jsx("div",{className:"text-caption text-ink-muted mt-2",children:s("artifact.mermaid.errorPrefix",{msg:o.message})})]})]}),o.status==="rendered"&&e.jsx("div",{className:"mt-1.5 text-caption text-ink-muted flex items-center gap-2",children:e.jsx("span",{children:s("artifact.mermaid.hint")})}),v&&o.status==="rendered"&&e.jsx(K,{title:a.title,onClose:()=>z(!1),children:e.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:e.jsx(F,{testid:"mermaid-modal-stage",children:e.jsx(ce,{data:t,variant:"canvas"})})})}),a.warnings&&a.warnings.length>0&&e.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[e.jsx(R,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),e.jsx("span",{children:a.warnings.join("; ")})]})]})}function le({data:t,variant:r="card"}){const a=t,s=L(),[n,i]=h.useState(null),[o,c]=h.useState(!1),l=h.useRef([]),g=h.useRef([]),w=a.code.split(`
|
|
20
|
+
`)):t}return t}let D=null;function Xe(){return D||(D=J(()=>import("./mermaid.core-BVbO1Vp8.js").then(t=>t.aW),__vite__mapDeps([4,5,1,2,6,7,8]),import.meta.url).then(async t=>{const r=t.default,{default:a}=await J(async()=>{const{default:s}=await import("./mermaid-layout-elk.core-KBAfwQxu.js").then(n=>n.m);return{default:s}},__vite__mapDeps([9,5,1,2,6]),import.meta.url);return r.registerLayoutLoaders(a),r.initialize({startOnLoad:!1,theme:"base",securityLevel:"loose",themeVariables:Ge(),flowchart:{useMaxWidth:!0,htmlLabels:!0,curve:"basis",nodeSpacing:42,rankSpacing:54,padding:10},sequence:{useMaxWidth:!0,boxMargin:8,noteMargin:8,messageMargin:32}}),r})),D}function Ge(){const t=(a,s)=>{if(typeof document>"u")return s;const n=getComputedStyle(document.documentElement).getPropertyValue(a).trim();return n?`rgb(${n})`:s};return{background:"transparent",fontFamily:typeof document<"u"&&getComputedStyle(document.body).fontFamily||"ui-sans-serif, system-ui, sans-serif",fontSize:"14px",primaryColor:t("--surface-3-rgb","rgb(42 43 46)"),primaryBorderColor:t("--border-rgb","rgb(37 38 41)"),primaryTextColor:t("--ink-strong-rgb","rgb(250 250 250)"),secondaryColor:t("--surface-2-rgb","rgb(32 33 36)"),secondaryBorderColor:t("--border-faint-rgb","rgb(26 26 29)"),secondaryTextColor:t("--ink-rgb","rgb(245 245 250)"),tertiaryColor:t("--surface-1-rgb","rgb(24 25 27)"),tertiaryBorderColor:t("--border-faint-rgb","rgb(26 26 29)"),tertiaryTextColor:t("--ink-rgb","rgb(245 245 250)"),lineColor:t("--ink-faint-rgb","rgb(117 117 126)"),textColor:t("--ink-rgb","rgb(245 245 250)"),edgeLabelBackground:t("--surface-0-rgb","rgb(12 13 15)"),clusterBkg:t("--surface-1-rgb","rgb(24 25 27)"),clusterBorder:t("--border-faint-rgb","rgb(26 26 29)"),nodeBorder:t("--border-rgb","rgb(37 38 41)"),mainBkg:t("--surface-3-rgb","rgb(42 43 46)"),nodeTextColor:t("--ink-rgb","rgb(245 245 250)"),arrowheadColor:t("--ink-faint-rgb","rgb(117 117 126)"),actorBkg:t("--surface-3-rgb","rgb(42 43 46)"),actorBorder:t("--border-rgb","rgb(37 38 41)"),actorTextColor:t("--ink-strong-rgb","rgb(250 250 250)"),activationBkgColor:t("--surface-3-rgb","rgb(42 43 46)"),activationBorderColor:t("--border-rgb","rgb(37 38 41)"),signalColor:t("--ink-rgb","rgb(245 245 250)"),signalTextColor:t("--ink-rgb","rgb(245 245 250)"),labelBoxBkgColor:t("--surface-2-rgb","rgb(32 33 36)"),labelBoxBorderColor:t("--border-rgb","rgb(37 38 41)"),labelTextColor:t("--ink-rgb","rgb(245 245 250)"),loopTextColor:t("--ink-strong-rgb","rgb(250 250 250)"),noteBkgColor:"rgb(255 200 0 / 0.12)",noteBorderColor:"rgb(255 200 0 / 0.4)",noteTextColor:t("--ink-rgb","rgb(245 245 250)")}}typeof window<"u"&&window.addEventListener("theme-changed",()=>{D=null});async function Ze(t,r){const a=await Xe(),s=Ve(r);try{await a.parse(s)}catch(i){throw new Error(`mermaid 语法校验失败: ${i instanceof Error?i.message:String(i)}`)}const{svg:n}=await a.render(t,s);if(n.includes('aria-roledescription="error"')||n.includes('class="error-text"')||n.includes("Syntax error"))throw new Error("mermaid 渲染失败(语法错误或节点 label 含未转义特殊字符)");return n}function se(t){let r=5381;for(let a=0;a<t.length;a++)r=(r<<5)+r+t.charCodeAt(a)>>>0;return r.toString(36)}const G=.3,Z=3,B=.2;function ce({data:t,variant:r="card"}){const a=t,s=L(),n={flowchart:s("artifact.diagram.flowchart"),sequence:s("artifact.diagram.sequence"),state:s("artifact.diagram.state")},i=h.useId().replace(/[:]/g,"_"),[o,c]=h.useState({status:"loading"}),[l,g]=h.useState(()=>{try{return sessionStorage.getItem(`mmdfix:${a.mermaid.length}:${se(a.mermaid)}`)??a.mermaid}catch{return a.mermaid}}),[w,m]=h.useState(!1),[d,f]=h.useState(!1),[N,p]=h.useState(0);h.useEffect(()=>{const j=()=>p(S=>S+1);return window.addEventListener("theme-changed",j),()=>window.removeEventListener("theme-changed",j)},[]);const[b,u]=h.useState(null),[x,y]=h.useState(1),[v,z]=h.useState(!1);h.useEffect(()=>{let j=!1;return c({status:"loading"}),u(null),Ze(`mmd-${i}`,l).then(S=>{if(!j&&(c({status:"rendered",svg:S}),l!==a.mermaid))try{sessionStorage.setItem(`mmdfix:${a.mermaid.length}:${se(a.mermaid)}`,l)}catch{}}).catch(S=>{j||(console.error("[MermaidArtifact] render failed:",S),c({status:"error",message:S instanceof Error?S.message:String(S)}))}),()=>{j=!0}},[l,i,N,a.mermaid]),h.useEffect(()=>{var j;o.status!=="error"||w||(m(!0),l===a.mermaid&&(j=window.api)!=null&&j.repairMermaidDiagram&&(f(!0),window.api.repairMermaidDiagram({mermaid:l,errorMessage:o.message,diagramType:a.diagramType}).then(S=>{S.ok&&S.mermaid.trim()&&g(S.mermaid)}).catch(()=>{}).finally(()=>f(!1))))},[o,w,l,a.mermaid,a.diagramType]);const C=`https://mermaid.live/edit#${encodeURIComponent(l)}`,$=h.useCallback(()=>y(j=>Math.min(Z,+(j+B).toFixed(2))),[]),M=h.useCallback(()=>y(j=>Math.max(G,+(j-B).toFixed(2))),[]),k=h.useCallback(()=>y(1),[]),E=h.useCallback(j=>{if(!j.ctrlKey&&!j.metaKey)return;j.preventDefault();const S=j.deltaY>0?-B:B;y(O=>Math.min(Z,Math.max(G,+(O+S).toFixed(2))))},[]),I=o.status==="rendered"?e.jsx("div",{ref:j=>{var S;if(j&&!b){const O=j.querySelector("svg");if(O){const ee=O.getBoundingClientRect(),_=(S=O.viewBox)==null?void 0:S.baseVal,te=_&&_.width?_.width:ee.width,re=_&&_.height?_.height:ee.height;te>0&&re>0&&u({width:te,height:re})}}},style:{width:(b==null?void 0:b.width)??void 0,height:(b==null?void 0:b.height)??void 0},dangerouslySetInnerHTML:{__html:o.svg},"data-testid":"mermaid-svg"}):null;return r==="canvas"?e.jsx("div",{"data-testid":"mermaid-canvas-content",children:I}):e.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-mermaid",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[e.jsx(Se,{className:"w-4 h-4 text-ink-muted shrink-0"}),e.jsx("h3",{className:"text-body font-bold text-ink truncate",children:a.title}),e.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded bg-accent/15 text-accent shrink-0",children:n[a.diagramType]??a.diagramType})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[o.status==="rendered"&&e.jsxs("div",{className:"flex items-center gap-1","data-testid":"mermaid-zoom-controls",children:[e.jsx("button",{onClick:M,disabled:x<=G,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:s("artifact.zoomOut"),"data-testid":"mermaid-zoom-out",children:"−"}),e.jsxs("button",{onClick:k,className:"px-1.5 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 text-caption font-bold tabular-nums",title:s("artifact.zoomReset"),"data-testid":"mermaid-zoom-reset",children:[Math.round(x*100),"%"]}),e.jsx("button",{onClick:$,disabled:x>=Z,className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-1 hover:bg-surface-3 disabled:opacity-30 text-label font-bold flex items-center justify-center",title:s("artifact.zoomIn"),"data-testid":"mermaid-zoom-in",children:"+"})]}),o.status==="rendered"&&e.jsx("button",{onClick:()=>z(!0),"data-testid":"mermaid-expand","aria-label":s("artifact.viewer.open"),"data-tooltip":s("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center",children:e.jsx(H,{className:"w-3.5 h-3.5"})})]}),e.jsx("button",{onClick:()=>window.open(C,"_blank"),className:"text-caption text-accent hover:underline font-bold shrink-0","data-testid":"mermaid-open-live",title:s("artifact.mermaid.openLive"),children:"mermaid.live ↗"})]}),e.jsxs("div",{onClick:()=>{o.status==="rendered"&&z(!0)},onWheel:E,className:"bg-surface-0/40 rounded-lg p-3 overflow-auto min-h-[120px] max-h-[500px] select-none",style:{touchAction:"pan-x pan-y"},"data-testid":"mermaid-render-area","data-noswipe":"",children:[o.status==="loading"&&e.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-loading",children:[e.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),e.jsx("span",{children:s("artifact.mermaid.rendering")})]}),o.status==="rendered"&&e.jsx("div",{style:{width:b?b.width*x:"auto",height:b?b.height*x:"auto",margin:"0 auto"},children:e.jsx("div",{style:{transform:`scale(${x})`,transformOrigin:"top left"},children:I})}),o.status==="error"&&d&&e.jsxs("div",{className:"flex items-center gap-2 text-body text-ink-muted my-8 justify-center","data-testid":"mermaid-repairing",children:[e.jsx("span",{className:"typing-dot w-1.5 h-1.5 bg-accent rounded-full inline-block"}),e.jsx("span",{children:s("artifact.mermaid.repairing")})]}),o.status==="error"&&!d&&e.jsxs("div",{className:"w-full text-center my-4","data-testid":"mermaid-fallback",children:[e.jsxs("div",{className:"text-body text-warning mb-2 flex items-center justify-center gap-1.5",children:[e.jsx(R,{className:"w-4 h-4 shrink-0"}),e.jsx("span",{children:s("artifact.mermaid.renderFailed")})]}),e.jsx("pre",{className:"text-label bg-surface-1/60 rounded p-2 overflow-x-auto text-ink-muted font-mono text-left",children:l}),e.jsx("div",{className:"text-caption text-ink-muted mt-2",children:s("artifact.mermaid.errorPrefix",{msg:o.message})})]})]}),o.status==="rendered"&&e.jsx("div",{className:"mt-1.5 text-caption text-ink-muted flex items-center gap-2",children:e.jsx("span",{children:s("artifact.mermaid.hint")})}),v&&o.status==="rendered"&&e.jsx(K,{title:a.title,onClose:()=>z(!1),children:e.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:e.jsx(F,{testid:"mermaid-modal-stage",children:e.jsx(ce,{data:t,variant:"canvas"})})})}),a.warnings&&a.warnings.length>0&&e.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[e.jsx(R,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),e.jsx("span",{children:a.warnings.join("; ")})]})]})}function le({data:t,variant:r="card"}){const a=t,s=L(),[n,i]=h.useState(null),[o,c]=h.useState(!1),l=h.useRef([]),g=h.useRef([]),w=a.code.split(`
|
|
21
21
|
`),[m,d]=h.useState(null);h.useEffect(()=>{let u=!0;return je(a.code,a.language).then(x=>{u&&x&&d(x)}),()=>{u=!1}},[a.code,a.language]);const f=u=>{if(n===null)return!1;const x=a.annotations[n];return x&&u>=x.lineStart&&u<=x.lineEnd},N=u=>{const x=n===u?null:u;if(i(x),x!==null){const y=a.annotations[x],v=(o?g:l).current[y.lineStart-1];v==null||v.scrollIntoView({behavior:"smooth",block:"center"})}},p=u=>e.jsx("div",{className:"bg-neutral-950 rounded-lg overflow-hidden border border-neutral-800 max-h-[420px] overflow-y-auto",children:e.jsx("pre",{className:"text-label font-mono leading-relaxed overflow-x-auto",children:e.jsx("code",{children:w.map((x,y)=>{const v=y+1;return e.jsxs("div",{ref:z=>{u.current[y]=z},className:`flex ${f(v)?"bg-brand/15":""}`,children:[e.jsx("span",{className:"select-none text-neutral-600 pr-3 pl-3 text-right w-10 shrink-0 border-r border-neutral-800 tabular-nums",children:v}),m&&m[y]!=null?e.jsx("span",{className:"pl-3 whitespace-pre text-neutral-200","data-testid":"walk-shiki-line",dangerouslySetInnerHTML:{__html:m[y]||" "}}):e.jsx("span",{className:"text-neutral-200 pl-3 whitespace-pre",children:x||" "})]},y)})})})}),b=e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-caption font-bold text-ink-muted",children:s("artifact.codewalk.sectionLabel")}),a.annotations.map((u,x)=>e.jsxs("button",{onClick:()=>N(x),"data-testid":`annotation-${x}`,className:`w-full text-left p-2.5 rounded-lg border transition-colors ${n===x?"border-brand bg-brand/10":"border-[var(--border-faint)] hover:border-[var(--border)]"}`,children:[e.jsx("div",{className:"text-caption font-bold text-brand mb-0.5",children:u.lineEnd!==u.lineStart?s("artifact.codewalk.lineRange",{a:u.lineStart,b:u.lineEnd}):s("artifact.codewalk.lineSingle",{n:u.lineStart})}),e.jsx("div",{className:"text-body text-ink-muted leading-relaxed",children:u.note})]},x))]});return r==="canvas"?e.jsx("div",{className:"w-fit","data-testid":"codewalk-canvas-content",children:p(g)}):e.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-code-walkthrough",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ye,{className:"w-4 h-4 text-ink-muted shrink-0"}),e.jsx("h3",{className:"text-body font-bold text-ink truncate",children:a.title}),e.jsx("span",{className:"text-caption font-bold px-1.5 py-0.5 rounded bg-surface-3 text-ink-muted font-mono shrink-0",children:a.language})]}),e.jsx("button",{onClick:()=>c(!0),"data-testid":"codewalk-expand","aria-label":s("artifact.viewer.open"),"data-tooltip":s("artifact.viewer.open"),className:"w-6 h-6 rounded border border-[var(--border)] text-ink-muted hover:bg-surface-3 flex items-center justify-center shrink-0",children:e.jsx(H,{className:"w-3.5 h-3.5"})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:[e.jsx("div",{onClick:()=>{o||c(!0)},style:{touchAction:"pan-x pan-y"},"data-noswipe":"",children:p(l)}),b]}),a.warnings&&a.warnings.length>0&&e.jsxs("div",{className:"mt-2 text-caption text-warning flex items-start gap-1","data-testid":"artifact-warnings",children:[e.jsx(R,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),e.jsx("span",{children:a.warnings.join("; ")})]}),o&&e.jsx(K,{title:a.title,onClose:()=>c(!1),children:e.jsx("div",{className:"h-full w-full rounded-xl overflow-hidden bg-surface-0/60",children:e.jsx(F,{testid:"codewalk-modal-stage",children:e.jsx(le,{data:t,variant:"canvas"})})})})]})}function Ye({data:t,onPickAction:r}){const a=t,s=L(),[n,i]=h.useState(null),o=c=>{n||(i(c.id),r==null||r(`${s("guess.pickedPrefix")}${c.label}`))};return e.jsxs("div",{className:"surface-card p-4","data-testid":"artifact-guess",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Me,{className:"w-4 h-4 text-accent"}),e.jsx("span",{className:"text-label font-bold text-accent",children:s("guess.header")})]}),e.jsx("div",{className:"text-body text-ink font-medium mb-3 leading-relaxed",children:a.prompt}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 mb-2",children:a.options.map(c=>{const l=n===c.id,g=n!==null;return e.jsxs("button",{onClick:()=>o(c),disabled:g,"data-testid":`guess-option-${c.id}`,className:`text-body p-2.5 rounded-lg border-2 font-medium transition-colors text-left flex items-center justify-between gap-2 ${l?"border-accent bg-accent/10 text-accent":g?"border-[var(--border-faint)] text-ink-faint cursor-default":"border-[var(--border)] text-ink-muted hover:border-accent hover:text-accent cursor-pointer"}`,children:[e.jsx("span",{children:c.label}),l&&e.jsx(U,{className:"w-4 h-4 shrink-0"})]},c.id)})}),n&&e.jsx("div",{className:"text-label text-ink-muted mt-1","data-testid":"guess-picked-hint",children:s("guess.waitReveal")}),a.warnings&&a.warnings.length>0&&e.jsx("div",{className:"mt-2 text-caption text-warning","data-testid":"artifact-warnings",children:a.warnings.join("; ")})]})}function rt({data:t,onQuizAnswered:r,quizMastery:a,onPickAction:s,onQuizCompleted:n,variant:i="card"}){const o=t;if(!o||!o.artifactType)return e.jsx(ne,{data:t});switch(o.artifactType){case"concept_map":return e.jsx(Ae,{data:t,variant:i});case"quiz":return e.jsx(Ke,{data:t,onAnswered:r,quizMastery:a,onPickAction:s,onQuizCompleted:n});case"compare_table":return e.jsx(oe,{data:t,variant:i});case"diagram":return e.jsx(ce,{data:t,variant:i});case"code_walkthrough":return e.jsx(le,{data:t,variant:i});case"guess":return e.jsx(Ye,{data:t,onPickAction:s});default:return e.jsx(ne,{data:t})}}function ne({data:t}){var a;const r=L();return e.jsxs("div",{className:"surface-card p-4 text-body text-ink-muted","data-testid":"artifact-unknown",children:[e.jsxs("div",{className:"font-bold mb-1 flex items-center gap-1.5",children:[e.jsx(ke,{className:"w-4 h-4"}),r("artifact.unknownHeader")]}),e.jsx("pre",{className:"text-caption overflow-x-auto text-ink-muted",children:(a=JSON.stringify(t,null,2))==null?void 0:a.slice(0,200)})]})}export{rt as ArtifactRenderer,le as CodeWalkthroughArtifact,oe as CompareTableArtifact,Ae as ConceptMapArtifact,Ye as GuessArtifact,ce as MermaidArtifact,Ke as QuizArtifact};
|
|
@@ -50,4 +50,4 @@ Error generating stack: `+a.message+`
|
|
|
50
50
|
L${(100+Math.cos(x)*D).toFixed(1)},${(135+Math.sin(x)*D).toFixed(1)}
|
|
51
51
|
L${(100+Math.cos((x+T)/2)*(D-1)).toFixed(1)},${(135+Math.sin((x+T)/2)*(D-1)).toFixed(1)}
|
|
52
52
|
L${(100+Math.cos(T)*D).toFixed(1)},${(135+Math.sin(T)*D).toFixed(1)}
|
|
53
|
-
L${(100+Math.cos(T)*U).toFixed(1)},${(135+Math.sin(T)*U).toFixed(1)} Z`};return i.jsxs("g",{children:[i.jsx("path",{d:"M100,117 L114,135 L100,153 L86,135 Z",fill:lh,stroke:ol,strokeWidth:"4",strokeLinejoin:"round"}),Array.from({length:6},(p,x)=>i.jsx("path",{d:r(x),fill:x<d?Xa:_y,stroke:ol,strokeWidth:"1.4",strokeLinejoin:"round",opacity:x<d?1:.55},x)),i.jsx("circle",{cx:"100",cy:"135",r:"3.2",fill:d>=6?ka:Xa,stroke:ol,strokeWidth:"1.6"}),i.jsx("path",{d:"M94,124 L98,119",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round",opacity:"0.8"}),i.jsx("rect",{x:"0",y:"0",width:"0",height:"0",fill:"none","data-uid":s})]})}function Oy(f,s){switch(f){case"A":return i.jsx("path",{d:"M92,74.5 L108,74.5 L113,78.5 L108,85.5 L92,85.5 L87,78.5 Z M95,77.5 L105,77.5 L105,83.5 L95,83.5 Z",fill:s.ink,fillRule:"evenodd"});case"E":return i.jsx("path",{d:"M90,76.5 L110,76.5 L113,80 L110,83.5 L90,83.5 L87,80 Z",fill:s.ink});case"I":return i.jsx("path",{d:"M90,79 L110,79 L111.5,80.8 L110,82.6 L90,82.6 L88.5,80.8 Z",fill:s.ink});case"O":return i.jsx("path",{d:"M100,73.5 L106,80.5 L100,86 L94,80.5 Z M100,77.5 L102.8,80.5 L100,83.4 L97.2,80.5 Z",fill:s.ink,fillRule:"evenodd"});case"U":return i.jsx("path",{d:"M100,74 L104,80.5 L100,85.5 L96,80.5 Z M100,78 L101.8,80.5 L100,83 L98.2,80.5 Z",fill:s.ink,fillRule:"evenodd"});case"SS":return i.jsxs("g",{children:[i.jsx("path",{d:"M86,76 L114,76 L112.5,82.6 L87.5,82.6 Z",fill:s.ink}),i.jsx("path",{d:"M90,76.4 L95.4,76.4 L94.4,82.2 L91.2,82.2 Z",fill:"#FFFFFF"}),i.jsx("path",{d:"M98,76.4 L103,76.4 L102.2,82.2 L99,82.2 Z",fill:"#FFFFFF",opacity:"0.9"}),i.jsx("path",{d:"M105.6,76.4 L110.4,76.4 L109.4,82.2 L106.4,82.2 Z",fill:"#FFFFFF",opacity:"0.75"})]});case"L":return i.jsxs("g",{children:[i.jsx("path",{d:"M92,74.5 L108,74.5 L113,78.5 L108,85.5 L92,85.5 L87,78.5 Z M95,77.5 L105,77.5 L105,83.5 L95,83.5 Z",fill:s.ink,fillRule:"evenodd"}),i.jsx("rect",{x:"96",y:"78",width:"8",height:"3.2",rx:"1.6",fill:s.pupil}),i.jsx("rect",{x:"98",y:"78.8",width:"4",height:"1.6",rx:"0.8",fill:"#FFFFFF",opacity:"0.9"})]});case"FV":return i.jsxs("g",{children:[i.jsx("path",{d:"M92,74.5 L108,74.5 L112,78 L108,84.5 L92,84.5 L88,78 Z",fill:s.ink}),i.jsx("path",{d:"M93.5,76.2 L106.5,76.2 L105.8,79.4 L94.2,79.4 Z",fill:"#FFFFFF"}),i.jsx("rect",{x:"95.5",y:"80.6",width:"9",height:"2.6",rx:"1.3",fill:s.pupil})]});default:return i.jsx("path",{d:"M92,79.5 L100,83.5 L108,79.5",fill:"none",stroke:s.ink,strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round"})}}function Ny({uid:f,refs:s,expression:d,viseme:r,openScale:p,energyRatio:x,streakLit:T}){const U=tu(d);return i.jsxs(i.Fragment,{children:[i.jsxs("defs",{children:[i.jsx("clipPath",{id:`${f}-body`,children:i.jsx("path",{d:"M70,110 L130,110 L142,122 L138,156 L62,156 L58,122 Z"})}),i.jsx("clipPath",{id:`${f}-helm`,children:i.jsx("path",{d:"M54,40 L76,26 L124,26 L146,40 L150,64 L142,96 L58,96 L50,64 Z"})}),i.jsx("clipPath",{id:`${f}-scr`,children:i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"6"})})]}),i.jsxs("g",{ref:s.bot,className:"cp-bot",children:[i.jsxs("g",{className:"cp-thrust",children:[i.jsx("ellipse",{cx:"100",cy:"177",rx:"11",ry:"8",fill:T?ka:Xa,opacity:"0.35"}),i.jsx("ellipse",{cx:"100",cy:"176",rx:"7",ry:"5",fill:T?ka:Xa})]}),i.jsx("path",{d:"M90,158 L110,158 L104,171 L96,171 Z",fill:"#2E3A4A",stroke:ol,strokeWidth:"4",strokeLinejoin:"round"}),i.jsxs("g",{className:"cp-body",children:[i.jsxs("g",{clipPath:`url(#${f}-body)`,children:[i.jsx("path",{d:"M70,110 L130,110 L142,122 L138,156 L62,156 L58,122 Z",fill:rs}),i.jsx("path",{d:"M70,110 L130,110 L142,122 L138,156 L62,156 L58,122 Z",fill:os,transform:"translate(-5 -5)"})]}),i.jsx("path",{d:"M70,110 L130,110 L142,122 L138,156 L62,156 L58,122 Z",fill:"none",stroke:ol,strokeWidth:"5",strokeLinejoin:"round"}),i.jsx(Ml,{id:`${f}-body`,x:58,y:110,w:84,h:46,t:4,light:"rgba(255,255,255,0.6)",dark:"rgba(24,58,82,0.4)"}),i.jsx(Dy,{energyRatio:x,uid:f}),i.jsx("circle",{cx:"74",cy:"150",r:"1.5",fill:ol,opacity:"0.45"}),i.jsx("circle",{cx:"126",cy:"150",r:"1.5",fill:ol,opacity:"0.45"})]}),i.jsxs("g",{ref:s.head,className:"cp-head",children:[i.jsxs("g",{className:"cp-antenna",children:[i.jsx("path",{d:"M40,58 L36,38 L44,50 Z",fill:T?ka:Xa,stroke:ol,strokeWidth:"3.5",strokeLinejoin:"round"}),i.jsx("path",{d:"M46,56 L46,42 L52,52 Z",fill:T?ka:os,stroke:ol,strokeWidth:"3",strokeLinejoin:"round"}),T&&i.jsx("path",{d:"M28,34 l3,-3 m-1,7 l3,-3 m-9,-1 l3,-3",stroke:ka,strokeWidth:"2.2",strokeLinecap:"round"}),!T&&i.jsx("circle",{cx:"40",cy:"38",r:"8",fill:Xa,opacity:"0.22",className:"cp-ant-glow"})]}),i.jsx("path",{d:"M42,60 L42,84 L48,88 L54,84 L54,60 L48,56 Z",fill:hs,stroke:ol,strokeWidth:"4",strokeLinejoin:"round"}),i.jsx("path",{d:"M146,60 L146,84 L152,88 L158,84 L158,60 L152,56 Z",fill:hs,stroke:ol,strokeWidth:"4",strokeLinejoin:"round"}),i.jsxs("g",{clipPath:`url(#${f}-helm)`,children:[i.jsx("path",{d:"M54,40 L76,26 L124,26 L146,40 L150,64 L142,96 L58,96 L50,64 Z",fill:rs}),i.jsx("path",{d:"M54,40 L76,26 L124,26 L146,40 L150,64 L142,96 L58,96 L50,64 Z",fill:os,transform:"translate(-5 -5)"}),i.jsx("path",{d:"M60,34 L74,28 M132,28 L146,34",stroke:"#FFFFFF",strokeWidth:"2.4",strokeLinecap:"round",opacity:"0.75"})]}),i.jsx("path",{d:"M54,40 L76,26 L124,26 L146,40 L150,64 L142,96 L58,96 L50,64 Z",fill:"none",stroke:ol,strokeWidth:"5",strokeLinejoin:"round"}),i.jsx(Ml,{id:`${f}-helm`,x:50,y:26,w:100,h:70,t:4,light:"rgba(255,255,255,0.55)",dark:"rgba(24,58,82,0.38)"}),i.jsx("path",{d:"M58,36 L96,36 L90,45 L54,45 Z",fill:"#FFFFFF",opacity:"0.9"}),i.jsx("path",{d:"M104,36 L118,36 L112,45 L102,45 Z",fill:"#FFFFFF",opacity:"0.5"}),i.jsx("path",{d:"M58,48 h84 a8,8 0 0 1 8,8 v30 a8,8 0 0 1 -8,8 h-84 a8,8 0 0 1 -8,-8 v-30 a8,8 0 0 1 8,-8 Z",fill:lh,stroke:ol,strokeWidth:"4.5"}),i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"6",fill:Ly}),i.jsxs("g",{clipPath:`url(#${f}-scr)`,children:[i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",fill:hs,transform:"translate(0 15)"}),i.jsx("path",{d:"M118,54 L136,54 L108,88 L90,88 Z",fill:"#FFFFFF",opacity:"0.18"})]}),i.jsxs("g",{className:"cp-scr-face",clipPath:`url(#${f}-scr)`,children:[i.jsx(lu,{expression:d,flags:U,refs:s,p:ss,viseme:r,openScale:p,renderMouth:Oy}),i.jsx(eu,{flags:U,refs:s,p:ss})]})]}),U.proud&&i.jsx(au,{p:ss}),i.jsx(nu,{refs:s,armFill:rs,out:ol})]})]})}const ds={out:"#2A3326",ink:"#2F5D3A",pupil:"#9BEFA9",wave:"#8FDBA0",crown:"#FFC800",crownD:"#D9A400"},ie="#9BEFA9",ys="#57BD74",Ms="#3E8E55",Uy="#F4FBE8",eh="#D7F0C8",ah="#3A4A34",ms="#FFC800",Jt="#2A3326";function Cy({energyRatio:f}){const s=Math.min(1,Math.max(0,f)),d=10+s*30,r=2+s*6;return i.jsxs("g",{children:[i.jsx("circle",{cx:"100",cy:"135",r:"16.5",fill:ah,stroke:Jt,strokeWidth:"4.5"}),i.jsx("circle",{cx:"100",cy:"135",r:"12.5",fill:eh}),i.jsx("path",{d:`M100,141 Q${100-s*2},${135-r} 100,${129-r}`,fill:"none",stroke:Ms,strokeWidth:"3",strokeLinecap:"round"}),i.jsx("g",{transform:`rotate(${-d} 100 133)`,children:i.jsx("path",{d:"M100,133 C95,127 87,127 85,131 C88,136 96,137 100,133 Z",fill:ie,stroke:Jt,strokeWidth:"2.6",strokeLinejoin:"round"})}),i.jsx("g",{transform:`rotate(${d} 100 133)`,children:i.jsx("path",{d:"M100,133 C105,127 113,127 115,131 C112,136 104,137 100,133 Z",fill:ie,stroke:Jt,strokeWidth:"2.6",strokeLinejoin:"round"})}),i.jsx("ellipse",{cx:"100",cy:"140",rx:"5.5",ry:"4",fill:"#7A5A3A",stroke:Jt,strokeWidth:"2.4"}),i.jsx("path",{d:"M95,130.5 Q97,128.5 99.5,129",stroke:"#FFFFFF",strokeWidth:"1.8",fill:"none",strokeLinecap:"round",opacity:"0.7"})]})}function wy(f,s){switch(f){case"A":return i.jsx("path",{d:"M92,74 Q100,71 108,74 Q110,83 100,86 Q90,83 92,74 Z M96,76 Q100,78 104,76 Q103,80 100,81.5 Q97,80 96,76 Z",fill:s.ink,fillRule:"evenodd"});case"E":return i.jsx("path",{d:"M91,76.5 Q100,74 109,76.5 Q109,82 100,83 Q91,82 91,76.5 Z",fill:s.ink});case"I":return i.jsx("path",{d:"M91,78.5 Q100,77 109,78.5 Q109,81.5 100,82.2 Q91,81.5 91,78.5 Z",fill:s.ink});case"O":return i.jsx("path",{d:"M100,72.5 C105,72.5 107.5,77 107.5,80 C107.5,83.5 104.5,86.5 100,86.5 C95.5,86.5 92.5,83.5 92.5,80 C92.5,77 95,72.5 100,72.5 Z M100,77 C102.5,77 104,78.5 104,80.5 C104,82.5 102.3,83.8 100,83.8 C97.7,83.8 96,82.5 96,80.5 C96,78.5 97.5,77 100,77 Z",fill:s.ink,fillRule:"evenodd"});case"U":return i.jsx("path",{d:"M100,73 C103,73 105,76.5 105,80 C105,83.3 103,86 100,86 C97,86 95,83.3 95,80 C95,76.5 97,73 100,73 Z M100,76.8 C101.3,76.8 102.2,78.3 102.2,80.3 C102.2,82.3 101.3,83.6 100,83.6 C98.7,83.6 97.8,82.3 97.8,80.3 C97.8,78.3 98.7,76.8 100,76.8 Z",fill:s.ink,fillRule:"evenodd"});case"SS":return i.jsxs("g",{children:[i.jsx("path",{d:"M87,77 Q100,75 113,77 Q113.5,82.5 100,83 Q86.5,82.5 87,77 Z",fill:s.ink}),i.jsx("rect",{x:"90.5",y:"77.8",width:"1.8",height:"3.2",rx:"0.9",fill:"#FFFFFF"}),i.jsx("rect",{x:"96.5",y:"77.7",width:"1.8",height:"3.4",rx:"0.9",fill:"#FFFFFF",opacity:"0.92"}),i.jsx("rect",{x:"102.5",y:"77.8",width:"1.8",height:"3.2",rx:"0.9",fill:"#FFFFFF",opacity:"0.84"}),i.jsx("rect",{x:"108",y:"77.9",width:"1.8",height:"3",rx:"0.9",fill:"#FFFFFF",opacity:"0.72"})]});case"L":return i.jsxs("g",{children:[i.jsx("path",{d:"M92,74 Q100,71 108,74 Q110,83 100,86 Q90,83 92,74 Z M96,76 Q100,78 104,76 Q103,80 100,81.5 Q97,80 96,76 Z",fill:s.ink,fillRule:"evenodd"}),i.jsx("rect",{x:"96",y:"76.6",width:"8",height:"3.2",rx:"1.6",fill:s.pupil}),i.jsx("rect",{x:"98",y:"77.4",width:"4",height:"1.6",rx:"0.8",fill:"#FFFFFF",opacity:"0.9"})]});case"FV":return i.jsxs("g",{children:[i.jsx("path",{d:"M93.5,77 Q100,74.5 106.5,77 Q107,82.5 100,83.8 Q93,82.5 93.5,77 Z",fill:s.ink}),i.jsx("rect",{x:"94.5",y:"77.2",width:"11",height:"2.4",rx:"1.2",fill:"#FFFFFF"}),i.jsx("rect",{x:"95.5",y:"80.4",width:"9",height:"2.6",rx:"1.3",fill:s.pupil})]});default:return i.jsx("path",{d:"M92,79.5 Q100,85.5 108,79.5",fill:"none",stroke:s.ink,strokeWidth:"3.5",strokeLinecap:"round"})}}function Ry({uid:f,refs:s,expression:d,viseme:r,openScale:p,energyRatio:x,streakLit:T}){const U=tu(d);return i.jsxs(i.Fragment,{children:[i.jsxs("defs",{children:[i.jsx("clipPath",{id:`${f}-body`,children:i.jsx("rect",{x:"64",y:"110",width:"72",height:"50",rx:"22"})}),i.jsx("clipPath",{id:`${f}-helm`,children:i.jsx("ellipse",{cx:"100",cy:"69",rx:"56",ry:"42"})}),i.jsx("clipPath",{id:`${f}-scr`,children:i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"12"})})]}),i.jsxs("g",{ref:s.bot,className:"cp-bot",children:[i.jsxs("g",{className:"cp-thrust",children:[i.jsx("ellipse",{cx:"100",cy:"177",rx:"11",ry:"8",fill:T?ms:ie,opacity:"0.3"}),i.jsx("ellipse",{cx:"100",cy:"176",rx:"7",ry:"5",fill:T?ms:ie})]}),i.jsx("path",{d:"M88,158 Q100,152 112,158 L106,171 Q100,174 94,171 Z",fill:"#3A4A34",stroke:Jt,strokeWidth:"4",strokeLinejoin:"round"}),i.jsxs("g",{className:"cp-body",children:[i.jsxs("g",{clipPath:`url(#${f}-body)`,children:[i.jsx("rect",{x:"64",y:"110",width:"72",height:"50",rx:"22",fill:ys}),i.jsx("rect",{x:"64",y:"110",width:"72",height:"50",rx:"22",fill:ie,transform:"translate(-4 -4)"})]}),i.jsx("rect",{x:"64",y:"110",width:"72",height:"50",rx:"22",fill:"none",stroke:Jt,strokeWidth:"5"}),i.jsx(Ml,{id:`${f}-body`,x:64,y:110,w:72,h:50,t:4,light:"rgba(255,255,255,0.42)",dark:"rgba(38,74,46,0.4)"}),i.jsx(Cy,{energyRatio:x}),i.jsx("circle",{cx:"73",cy:"150",r:"1.6",fill:Jt,opacity:"0.45"}),i.jsx("circle",{cx:"127",cy:"150",r:"1.6",fill:Jt,opacity:"0.45"})]}),i.jsxs("g",{ref:s.head,className:"cp-head",children:[i.jsxs("g",{className:"cp-antenna",children:[i.jsx("path",{d:"M43,60 Q40,50 44,42",fill:"none",stroke:Jt,strokeWidth:"4",strokeLinecap:"round"}),T?i.jsxs("g",{children:[Array.from({length:5},(D,M)=>i.jsx("ellipse",{cx:"44",cy:"33",rx:"4",ry:"7.5",fill:ms,stroke:Jt,strokeWidth:"2",transform:`rotate(${M*72} 44 40)`},M)),i.jsx("circle",{cx:"44",cy:"40",r:"4.5",fill:"#FFF3C4",stroke:Jt,strokeWidth:"2"})]}):i.jsxs("g",{children:[i.jsx("ellipse",{cx:"44",cy:"39",rx:"5.5",ry:"7",fill:ie,stroke:Jt,strokeWidth:"3"}),i.jsx("path",{d:"M44,33 Q46.5,39 44,45",fill:"none",stroke:Ms,strokeWidth:"1.8"})]})]}),i.jsx("path",{d:"M48,62 C36,56 30,62 32,70 C38,76 48,74 48,62 Z",fill:ie,stroke:Jt,strokeWidth:"4",strokeLinejoin:"round"}),i.jsx("path",{d:"M152,62 C164,56 170,62 168,70 C162,76 152,74 152,62 Z",fill:ie,stroke:Jt,strokeWidth:"4",strokeLinejoin:"round"}),i.jsx("path",{d:"M36,62 Q42,66 46,68 M164,62 Q158,66 154,68",stroke:Ms,strokeWidth:"1.8",fill:"none",strokeLinecap:"round"}),i.jsxs("g",{clipPath:`url(#${f}-helm)`,children:[i.jsx("ellipse",{cx:"100",cy:"69",rx:"56",ry:"42",fill:ys}),i.jsx("ellipse",{cx:"100",cy:"69",rx:"56",ry:"42",fill:ie,transform:"translate(-5 -5)"})]}),i.jsx("ellipse",{cx:"100",cy:"69",rx:"56",ry:"42",fill:"none",stroke:Jt,strokeWidth:"5"}),i.jsx(Ml,{id:`${f}-helm`,x:44,y:27,w:112,h:84,t:4,light:"rgba(255,255,255,0.36)",dark:"rgba(38,74,46,0.36)"}),i.jsx("path",{d:"M58,37 Q86,31 104,38 L96,47 Q68,46 58,37 Z",fill:"#FFFFFF",opacity:"0.88"}),i.jsx("circle",{cx:"118",cy:"41",r:"4",fill:"#FFFFFF",opacity:"0.55"}),i.jsx("rect",{x:"58",y:"48",width:"84",height:"46",rx:"16",fill:ah,stroke:Jt,strokeWidth:"4.5"}),i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"12",fill:Uy}),i.jsxs("g",{clipPath:`url(#${f}-scr)`,children:[i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",fill:eh,transform:"translate(0 15)"}),i.jsx("path",{d:"M120,54 L136,54 L106,88 L90,88 Z",fill:"#FFFFFF",opacity:"0.2"})]}),i.jsxs("g",{className:"cp-scr-face",clipPath:`url(#${f}-scr)`,children:[i.jsx(lu,{expression:d,flags:U,refs:s,p:ds,viseme:r,openScale:p,renderMouth:wy}),i.jsx(eu,{flags:U,refs:s,p:ds})]})]}),U.proud&&i.jsx(au,{p:ds}),i.jsx(nu,{refs:s,armFill:ys,out:Jt})]})]})}const gs={out:"#221C38",ink:"#FFEFC2",pupil:"#8B7BF0",wave:"#B7ACFF",crown:"#FFD75E",crownD:"#D9A400"},Za="#8B7BF0",ps="#5D4FD1",Hy="#241E4E",nh="#3A2F6E",Ya="#1A1440",Vn="#FFEFC2",Ba="#FFD75E",jl="#221C38";function Zy({energyRatio:f,uid:s}){const d=Math.min(1,Math.max(0,f)),r=(1-d)*26;return i.jsxs("g",{children:[i.jsx("circle",{cx:"100",cy:"135",r:"16.5",fill:Ya,stroke:jl,strokeWidth:"4.5"}),i.jsx("circle",{cx:"100",cy:"135",r:"12.5",fill:nh}),i.jsxs("g",{clipPath:`url(#${s}-moon)`,children:[i.jsx("circle",{cx:"100",cy:"135",r:"11.5",fill:Vn}),i.jsx("circle",{cx:100-r,cy:"135",r:"12.5",fill:Ya})]}),i.jsx("circle",{cx:"100",cy:"135",r:"12.5",fill:"none",stroke:jl,strokeWidth:"2"}),i.jsxs("g",{opacity:.35*d,children:[i.jsx("circle",{cx:"96",cy:"131",r:"2",fill:Ya}),i.jsx("circle",{cx:"104",cy:"138",r:"1.5",fill:Ya}),i.jsx("circle",{cx:"99",cy:"140",r:"1.1",fill:Ya})]})]})}function By(f,s){switch(f){case"A":return i.jsx("path",{d:"M91,74.5 h18 a5,5 0 0 1 5,5 v2.6 a5,5 0 0 1 -5,5 h-18 a5,5 0 0 1 -5,-5 v-2.6 a5,5 0 0 1 5,-5 Z M95,77.5 h10 v5.6 h-10 Z",fill:s.ink,fillRule:"evenodd"});case"E":return i.jsx("path",{d:"M90,77 h20 a3.2,3.2 0 0 1 0,6.4 h-20 a3.2,3.2 0 0 1 0,-6.4 Z",fill:s.ink});case"I":return i.jsx("path",{d:"M90,79.5 h20 a1.9,1.9 0 0 1 0,3.8 h-20 a1.9,1.9 0 0 1 0,-3.8 Z",fill:s.ink});case"O":return i.jsxs("g",{fill:"none",children:[i.jsx("circle",{cx:"100",cy:"79.5",r:"6.4",stroke:s.ink,strokeWidth:"4"}),i.jsx("circle",{cx:"100",cy:"79.5",r:"1.6",fill:s.ink,stroke:"none"})]});case"U":return i.jsx("g",{fill:"none",children:i.jsx("circle",{cx:"100",cy:"79.5",r:"4.4",stroke:s.ink,strokeWidth:"3.6"})});case"SS":return i.jsxs("g",{children:[i.jsx("path",{d:"M87,76.5 h26 a2.4,2.4 0 0 1 2.4,2.4 v1.2 a2.4,2.4 0 0 1 -2.4,2.4 h-26 a2.4,2.4 0 0 1 -2.4,-2.4 v-1.2 a2.4,2.4 0 0 1 2.4,-2.4 Z",fill:s.ink}),i.jsx("rect",{x:"90.5",y:"78.1",width:"1.8",height:"3.2",rx:"0.9",fill:"#FFFFFF"}),i.jsx("rect",{x:"96.5",y:"78.1",width:"1.8",height:"3.2",rx:"0.9",fill:"#FFFFFF",opacity:"0.92"}),i.jsx("rect",{x:"102.5",y:"78.1",width:"1.8",height:"3.2",rx:"0.9",fill:"#FFFFFF",opacity:"0.84"}),i.jsx("rect",{x:"108",y:"78.1",width:"1.8",height:"3",rx:"0.9",fill:"#FFFFFF",opacity:"0.72"})]});case"L":return i.jsxs("g",{children:[i.jsx("path",{d:"M91,74.5 h18 a5,5 0 0 1 5,5 v2.6 a5,5 0 0 1 -5,5 h-18 a5,5 0 0 1 -5,-5 v-2.6 a5,5 0 0 1 5,-5 Z M95,77.5 h10 v5.6 h-10 Z",fill:s.ink,fillRule:"evenodd"}),i.jsx("rect",{x:"96",y:"77.2",width:"8",height:"3.2",rx:"1.6",fill:s.pupil}),i.jsx("rect",{x:"98",y:"78",width:"4",height:"1.6",rx:"0.8",fill:"#FFFFFF",opacity:"0.9"})]});case"FV":return i.jsxs("g",{children:[i.jsx("path",{d:"M92,74.8 h16 a5,5 0 0 1 5,5 v2.4 a5,5 0 0 1 -5,5 h-16 a5,5 0 0 1 -5,-5 v-2.4 a5,5 0 0 1 5,-5 Z",fill:s.ink}),i.jsx("rect",{x:"93.5",y:"76.6",width:"13",height:"2.4",rx:"1.2",fill:"#FFFFFF"}),i.jsx("rect",{x:"95.5",y:"79.6",width:"9",height:"2.6",rx:"1.3",fill:s.pupil})]});default:return i.jsx("path",{d:"M92,79.5 Q100,85 108,79.5",fill:"none",stroke:s.ink,strokeWidth:"3.5",strokeLinecap:"round"})}}function Fy({uid:f,refs:s,expression:d,viseme:r,openScale:p,energyRatio:x,streakLit:T}){const U=tu(d);return i.jsxs(i.Fragment,{children:[i.jsxs("defs",{children:[i.jsx("clipPath",{id:`${f}-body`,children:i.jsx("rect",{x:"66",y:"110",width:"68",height:"50",rx:"20"})}),i.jsx("clipPath",{id:`${f}-helm`,children:i.jsx("path",{d:"M48,96 L48,62 Q48,26 100,26 Q152,26 152,62 L152,96 Z"})}),i.jsx("clipPath",{id:`${f}-scr`,children:i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"9"})}),i.jsx("clipPath",{id:`${f}-moon`,children:i.jsx("circle",{cx:"100",cy:"135",r:"12.5"})})]}),i.jsxs("g",{ref:s.bot,className:"cp-bot",children:[i.jsxs("g",{className:"cp-thrust",children:[i.jsx("ellipse",{cx:"100",cy:"177",rx:"11",ry:"8",fill:T?Ba:Za,opacity:"0.38"}),i.jsx("ellipse",{cx:"100",cy:"176",rx:"7",ry:"5",fill:T?Ba:Za})]}),i.jsx("path",{d:"M88,158 L112,158 L106,171 L94,171 Z",fill:"#2A2248",stroke:jl,strokeWidth:"4",strokeLinejoin:"round"}),i.jsxs("g",{className:"cp-body",children:[i.jsxs("g",{clipPath:`url(#${f}-body)`,children:[i.jsx("rect",{x:"66",y:"110",width:"68",height:"50",rx:"20",fill:ps}),i.jsx("rect",{x:"66",y:"110",width:"68",height:"50",rx:"20",fill:Za,transform:"translate(-4 -4)"})]}),i.jsx("rect",{x:"66",y:"110",width:"68",height:"50",rx:"20",fill:"none",stroke:jl,strokeWidth:"5"}),i.jsx(Ml,{id:`${f}-body`,x:66,y:110,w:68,h:50,t:4,light:"rgba(196,181,255,0.34)",dark:"rgba(10,6,32,0.5)"}),i.jsx(Zy,{energyRatio:x,uid:f}),i.jsx("circle",{cx:"76",cy:"150",r:"1.5",fill:jl,opacity:"0.5"}),i.jsx("circle",{cx:"124",cy:"150",r:"1.5",fill:jl,opacity:"0.5"})]}),i.jsxs("g",{ref:s.head,className:"cp-head",children:[i.jsxs("g",{className:"cp-antenna",children:[i.jsx("ellipse",{cx:"42",cy:"44",rx:"13",ry:"5.5",fill:"none",stroke:jl,strokeWidth:"3.5",transform:"rotate(-24 42 44)"}),i.jsx("circle",{cx:"49",cy:"39",r:"5",fill:T?Ba:Vn,stroke:jl,strokeWidth:"3"}),T&&i.jsx("path",{d:"M56,34 L68,26 M57,41 L71,38 M52,30 L58,20",stroke:Ba,strokeWidth:"2.4",strokeLinecap:"round"})]}),i.jsx("circle",{cx:"44",cy:"72",r:"8",fill:Za,stroke:jl,strokeWidth:"4"}),i.jsx("ellipse",{cx:"44",cy:"72",rx:"13",ry:"4.5",fill:"none",stroke:Ba,strokeWidth:"2.4",transform:"rotate(-18 44 72)"}),i.jsx("circle",{cx:"156",cy:"72",r:"8",fill:Za,stroke:jl,strokeWidth:"4"}),i.jsx("ellipse",{cx:"156",cy:"72",rx:"13",ry:"4.5",fill:"none",stroke:Ba,strokeWidth:"2.4",transform:"rotate(18 156 72)"}),i.jsxs("g",{clipPath:`url(#${f}-helm)`,children:[i.jsx("path",{d:"M48,96 L48,62 Q48,26 100,26 Q152,26 152,62 L152,96 Z",fill:ps}),i.jsx("path",{d:"M48,96 L48,62 Q48,26 100,26 Q152,26 152,62 L152,96 Z",fill:Za,transform:"translate(-5 -5)"}),i.jsx("circle",{cx:"66",cy:"42",r:"1.6",fill:"#FFFFFF",opacity:"0.9"}),i.jsx("circle",{cx:"82",cy:"33",r:"1.2",fill:"#FFFFFF",opacity:"0.75"}),i.jsx("circle",{cx:"130",cy:"36",r:"1.7",fill:"#FFFFFF",opacity:"0.9"}),i.jsx("circle",{cx:"118",cy:"30",r:"1",fill:"#FFFFFF",opacity:"0.6"}),i.jsx("path",{d:"M94,28 l1.6,3.2 3.4,0.5 -2.5,2.4 0.6,3.4 -3.1,-1.7 -3.1,1.7 0.6,-3.4 -2.5,-2.4 3.4,-0.5 Z",fill:"#FFFFFF",opacity:"0.85"})]}),i.jsx("path",{d:"M48,96 L48,62 Q48,26 100,26 Q152,26 152,62 L152,96 Z",fill:"none",stroke:jl,strokeWidth:"5"}),i.jsx(Ml,{id:`${f}-helm`,x:48,y:26,w:104,h:70,t:4,light:"rgba(196,181,255,0.3)",dark:"rgba(10,6,32,0.45)"}),i.jsx("path",{d:"M56,40 Q88,28 110,34 L102,44 Q72,40 56,46 Z",fill:"#FFFFFF",opacity:"0.8"}),i.jsx("rect",{x:"58",y:"48",width:"84",height:"46",rx:"12",fill:Ya,stroke:jl,strokeWidth:"4.5"}),i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"9",fill:Hy}),i.jsxs("g",{clipPath:`url(#${f}-scr)`,children:[i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",fill:nh,transform:"translate(0 15)"}),i.jsx("circle",{cx:"74",cy:"60",r:"1",fill:Vn,opacity:"0.8"}),i.jsx("circle",{cx:"128",cy:"82",r:"1.2",fill:Vn,opacity:"0.6"}),i.jsx("circle",{cx:"86",cy:"84",r:"0.8",fill:Vn,opacity:"0.5"}),i.jsx("path",{d:"M118,54 L136,54 L106,88 L92,88 Z",fill:"#FFFFFF",opacity:"0.08"})]}),i.jsxs("g",{className:"cp-scr-face",clipPath:`url(#${f}-scr)`,children:[i.jsx(lu,{expression:d,flags:U,refs:s,p:gs,viseme:r,openScale:p,renderMouth:By}),i.jsx(eu,{flags:U,refs:s,p:gs})]})]}),U.proud&&i.jsx(au,{p:gs}),i.jsx(nu,{refs:s,armFill:ps,out:jl})]})]})}const xs={out:"#2F2A22",ink:"#2B2B2B",pupil:"#F7F2E6",wave:"#8FB8C9",crown:"#FFC800",crownD:"#D9A400"},Ti="#F7F2E6",Li="#DCD2B8",Qy="#FBF7EC",Fa="#EFE7D2",_i="#4A4234",Kn="#E8543F",uh="#B8392A",Es="#3A342A",Ui="#FFC800",Hl="#2F2A22";function qy({energyRatio:f,streakLit:s}){const d=Math.min(1,Math.max(0,f)),p=146-d*22;return i.jsxs("g",{children:[i.jsx("path",{d:"M82,120 h36 a6,6 0 0 1 6,6 v16 a8,8 0 0 1 -8,8 h-32 a8,8 0 0 1 -8,-8 v-16 a6,6 0 0 1 6,-6 Z",fill:_i,stroke:Hl,strokeWidth:"4.5"}),i.jsx("path",{d:"M86,124 h28 a4,4 0 0 1 4,4 v14 a5,5 0 0 1 -5,5 h-26 a5,5 0 0 1 -5,-5 v-14 a4,4 0 0 1 4,-4 Z",fill:Li}),i.jsxs("g",{children:[i.jsx("rect",{x:"82",y:p,width:"36",height:150-p,rx:"3",fill:s?"#4A4034":Es}),i.jsx("ellipse",{cx:"100",cy:p,rx:"18",ry:"2.6",fill:d>=.999?Ui:"#57503F"}),d>=.999&&i.jsx("path",{d:"M90,144 q5,-4 10,0 q5,4 10,0",fill:"none",stroke:Ui,strokeWidth:"2",strokeLinecap:"round",opacity:"0.8"})]}),i.jsx("path",{d:"M88,126.5 q12,-2.5 24,0",fill:"none",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round",opacity:"0.6"}),i.jsx("rect",{x:"122",y:"121",width:"11",height:"11",rx:"2.5",fill:Kn,stroke:uh,strokeWidth:"1.8"}),i.jsx("path",{d:"M125.5,124.5 h4 M125.5,127.5 h4 M127.5,124 v6",stroke:Ti,strokeWidth:"1.5",strokeLinecap:"round"})]})}function ky(f,s){switch(f){case"A":return i.jsx("path",{d:"M91,74 Q100,71.5 109,74 Q111,83 100,86.5 Q89,83 91,74 Z M96,76.5 Q100,78.5 104,76.5 Q103,81 100,82.5 Q97,81 96,76.5 Z",fill:s.ink,fillRule:"evenodd"});case"E":return i.jsx("path",{d:"M90,76 Q100,73.8 110,76 Q110.8,82.2 100,83.4 Q89.2,82.2 90,76 Z",fill:s.ink});case"I":return i.jsx("path",{d:"M90.5,78.4 Q100,77 109.5,78.4 Q110,81.8 100,82.4 Q90,81.8 90.5,78.4 Z",fill:s.ink});case"O":return i.jsx("path",{d:"M100,72.5 C105.5,72.5 108,77 108,80 C108,83.6 104.8,86.6 100,86.6 C95.2,86.6 92,83.6 92,80 C92,77 94.5,72.5 100,72.5 Z M100,77 C102.6,77 104.2,78.5 104.2,80.5 C104.2,82.5 102.5,83.7 100,83.7 C97.5,83.7 95.8,82.5 95.8,80.5 C95.8,78.5 97.4,77 100,77 Z",fill:s.ink,fillRule:"evenodd"});case"U":return i.jsx("path",{d:"M100,73 C103.2,73 105.2,76.6 105.2,80 C105.2,83.4 103.2,86 100,86 C96.8,86 94.8,83.4 94.8,80 C94.8,76.6 96.8,73 100,73 Z M100,76.8 C101.4,76.8 102.3,78.3 102.3,80.3 C102.3,82.3 101.4,83.5 100,83.5 C98.6,83.5 97.7,82.3 97.7,80.3 C97.7,78.3 98.6,76.8 100,76.8 Z",fill:s.ink,fillRule:"evenodd"});case"SS":return i.jsxs("g",{children:[i.jsx("path",{d:"M88,77.2 Q100,75.6 112,77.2 Q112.6,82.8 100,83.4 Q87.4,82.8 88,77.2 Z",fill:s.ink}),i.jsx("path",{d:"M91.5,77.8 L96.3,77.6 L95.7,81.6 L92.1,81.5 Z",fill:"#F7F2E6"}),i.jsx("path",{d:"M99,77.6 L104.3,77.6 L103.8,81.7 L99.3,81.6 Z",fill:"#F7F2E6",opacity:"0.9"}),i.jsx("path",{d:"M107,77.7 L110.3,77.9 L109.7,81.5 L107.3,81.4 Z",fill:"#F7F2E6",opacity:"0.72"})]});case"L":return i.jsxs("g",{children:[i.jsx("path",{d:"M91,74 Q100,71.5 109,74 Q111,83 100,86.5 Q89,83 91,74 Z M96,76.5 Q100,78.5 104,76.5 Q103,81 100,82.5 Q97,81 96,76.5 Z",fill:s.ink,fillRule:"evenodd"}),i.jsx("rect",{x:"96.2",y:"77.2",width:"7.6",height:"3",rx:"1.5",fill:s.pupil}),i.jsx("rect",{x:"98",y:"77.9",width:"4",height:"1.6",rx:"0.8",fill:"#FFFFFF",opacity:"0.9"})]});case"FV":return i.jsxs("g",{children:[i.jsx("path",{d:"M93.5,77 Q100,74.6 106.5,77 Q107,82.6 100,83.4 Q93,82.6 93.5,77 Z",fill:s.ink}),i.jsx("path",{d:"M94,76.6 Q100,74.8 106,76.6 L105.4,79.6 Q100,80.6 94.6,79.6 Z",fill:"#3A342A"}),i.jsx("rect",{x:"95.5",y:"80.6",width:"9",height:"2.5",rx:"1.25",fill:s.pupil})]});default:return i.jsx("path",{d:"M91,78.8 Q100,85.6 109,78.4",fill:"none",stroke:s.ink,strokeWidth:"4.2",strokeLinecap:"round"})}}function Yy({uid:f,refs:s,expression:d,viseme:r,openScale:p,energyRatio:x,streakLit:T}){const U=tu(d);return i.jsxs(i.Fragment,{children:[i.jsxs("defs",{children:[i.jsx("clipPath",{id:`${f}-body`,children:i.jsx("rect",{x:"62",y:"110",width:"76",height:"50",rx:"10"})}),i.jsx("clipPath",{id:`${f}-helm`,children:i.jsx("path",{d:"M54,44 L100,30 L146,44 L150,72 L142,96 L58,96 L50,72 Z"})}),i.jsx("clipPath",{id:`${f}-scr`,children:i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"5"})})]}),i.jsxs("g",{ref:s.bot,className:"cp-bot",children:[i.jsxs("g",{className:"cp-thrust",children:[i.jsx("ellipse",{cx:"100",cy:"177",rx:"11",ry:"8",fill:T?Ui:Fa,opacity:"0.4"}),i.jsx("ellipse",{cx:"100",cy:"176",rx:"7",ry:"5",fill:T?Ui:Fa})]}),i.jsx("path",{d:"M88,158 L112,158 L106,171 L94,171 Z",fill:Es,stroke:Hl,strokeWidth:"4",strokeLinejoin:"round"}),i.jsxs("g",{className:"cp-body",children:[i.jsxs("g",{clipPath:`url(#${f}-body)`,children:[i.jsx("rect",{x:"62",y:"110",width:"76",height:"50",rx:"10",fill:Li}),i.jsx("rect",{x:"62",y:"110",width:"76",height:"50",rx:"10",fill:Ti,transform:"translate(-4 -4)"})]}),i.jsx("rect",{x:"62",y:"110",width:"76",height:"50",rx:"10",fill:"none",stroke:Hl,strokeWidth:"5"}),i.jsx(Ml,{id:`${f}-body`,x:62,y:110,w:76,h:50,t:4,light:"rgba(255,255,255,0.5)",dark:"rgba(58,52,42,0.32)"}),i.jsx(qy,{energyRatio:x,streakLit:T})]}),i.jsxs("g",{ref:s.head,className:"cp-head",children:[i.jsxs("g",{className:"cp-antenna",children:[i.jsx("rect",{x:"38",y:"42",width:"5",height:"20",rx:"2.5",fill:Ti,stroke:Hl,strokeWidth:"3",transform:"rotate(14 40 52)"}),i.jsx("path",{d:"M41,56 Q43,62 40,66 Q37,62 39,56 Z",fill:T?Kn:Es,stroke:Hl,strokeWidth:"2.6",strokeLinejoin:"round",transform:"rotate(14 40 60)"}),T&&i.jsx("circle",{cx:"38",cy:"68",r:"3.4",fill:Kn,stroke:uh,strokeWidth:"2"})]}),i.jsx("rect",{x:"38",y:"58",width:"13",height:"26",rx:"3",fill:_i,stroke:Hl,strokeWidth:"4"}),i.jsx("path",{d:"M44.5,60 v22",stroke:Fa,strokeWidth:"2",strokeLinecap:"round"}),i.jsx("rect",{x:"149",y:"58",width:"13",height:"26",rx:"3",fill:_i,stroke:Hl,strokeWidth:"4"}),i.jsx("path",{d:"M155.5,60 v22",stroke:Fa,strokeWidth:"2",strokeLinecap:"round"}),i.jsxs("g",{clipPath:`url(#${f}-helm)`,children:[i.jsx("path",{d:"M54,44 L100,30 L146,44 L150,72 L142,96 L58,96 L50,72 Z",fill:Li}),i.jsx("path",{d:"M54,44 L100,30 L146,44 L150,72 L142,96 L58,96 L50,72 Z",fill:Ti,transform:"translate(-4 -4)"}),i.jsx("path",{d:"M100,30 L100,44",stroke:Hl,strokeWidth:"2.6"})]}),i.jsx("path",{d:"M54,44 L100,30 L146,44 L150,72 L142,96 L58,96 L50,72 Z",fill:"none",stroke:Hl,strokeWidth:"5",strokeLinejoin:"round"}),i.jsx(Ml,{id:`${f}-helm`,x:50,y:30,w:100,h:66,t:4,light:"rgba(255,255,255,0.46)",dark:"rgba(58,52,42,0.3)"}),i.jsx("path",{d:"M62,38 Q90,32 104,36 L98,44 Q74,42 62,46 Z",fill:Kn,opacity:"0.85"}),i.jsx("path",{d:"M112,36 L124,38 L118,45 L108,44 Z",fill:Kn,opacity:"0.45"}),i.jsx("rect",{x:"58",y:"48",width:"84",height:"46",rx:"8",fill:_i,stroke:Hl,strokeWidth:"4.5"}),i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"5",fill:Qy}),i.jsxs("g",{clipPath:`url(#${f}-scr)`,children:[i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",fill:Fa,transform:"translate(0 15)"}),i.jsx("path",{d:"M70,56 v30 M78,56 v30 M122,56 v30 M130,56 v30",stroke:Fa,strokeWidth:"1.2",opacity:"0.7"}),i.jsx("path",{d:"M118,54 L136,54 L108,88 L92,88 Z",fill:"#FFFFFF",opacity:"0.22"})]}),i.jsxs("g",{className:"cp-scr-face",clipPath:`url(#${f}-scr)`,children:[i.jsx(lu,{expression:d,flags:U,refs:s,p:xs,viseme:r,openScale:p,renderMouth:ky}),i.jsx(eu,{flags:U,refs:s,p:xs})]})]}),U.proud&&i.jsx(au,{p:xs}),i.jsx(nu,{refs:s,armFill:Li,out:Hl})]})]})}const Gy={ember:Ty,frost:Ny,moss:Ry,astro:Fy,ink:Yy};function Hm({form:f,expression:s,pose:d,viseme:r="closed",openScale:p=0,energyRatio:x=0,streakLit:T=!1,size:U=96,interactive:D=!1,ariaLabel:M,testid:Z,onPoke:O,onGrab:Y,keySeq:jt=0,keyFlash:Et=!1,keySide:dt=1,screenKey:gt=null,coreLit:pt=!1,noteTick:Lt=!1,crownBadge:Ut=!1,haloBadge:Bt=!1}){const it="cp"+bl.useId().replace(/[^a-zA-Z0-9]/g,""),k=Ey(),Mt=Ts(f),At={bot:bl.useRef(null),head:bl.useRef(null),armL:bl.useRef(null),armR:bl.useRef(null),eyes:bl.useRef(null),pupils:bl.useRef(null),waves:bl.useRef(null)},ce=At.bot;bl.useEffect(()=>{if(k||jt<=0)return;const yt=dt===-1?At.armL.current:At.armR.current,_t=dt===-1?-44:44;yt==null||yt.animate([{transform:"rotate(0deg)"},{transform:`rotate(${_t}deg)`,offset:.38},{transform:"rotate(0deg)"}],{duration:185,easing:"cubic-bezier(0.2, 1.5, 0.4, 1)",composite:"add"});const xt=At.bot.current;xt&&(xt.style.transformBox="fill-box",xt.style.transformOrigin="50% 62%",xt.animate([{transform:"translateY(0px) scale(1, 1)"},{transform:"translateY(2.5px) scale(1.045, 0.93)",offset:.42},{transform:"translateY(0px) scale(1, 1)"}],{duration:185,easing:"ease-out",composite:"add"}))},[jt,dt,k]);const el=s==="listening";bl.useEffect(()=>{if(!el||k)return;let yt=0;const _t=()=>{const xt=vy(),E=At.waves.current;E&&(E.style.opacity=xt<=0?"0":"1",E.setAttribute("transform",`translate(174 72) scale(${(.55+.45*xt).toFixed(3)}) translate(-174 -72)`)),yt=requestAnimationFrame(_t)};return yt=requestAnimationFrame(_t),()=>cancelAnimationFrame(yt)},[el,k]),bl.useEffect(()=>{if(k)return;let yt=0,_t,xt={x:0,y:0},E={x:0,y:0},C=performance.now(),F=1,et=performance.now()+4200;const nt=()=>{const N=At.eyes.current;N&&(N.style.transform="scaleY(0.14)",setTimeout(()=>{N&&(N.style.transform="")},120)),_t=setTimeout(nt,2400+Math.random()*2600)};_t=setTimeout(nt,1500+Math.random()*1500);const m=N=>{const w=ce.current;if(!w)return;const Q=w.getBoundingClientRect();E=cy(N.clientX,N.clientY,Q.left+Q.width/2,Q.top+Q.height*.35,Math.max(140,Q.width)),C=performance.now()};window.addEventListener("pointermove",m,{passive:!0});const _=()=>{var Q;const N=performance.now();N-C>4e3&&N>=et&&(E=fy(F++),et=N+2200+F%3*450),xt={x:X1(xt.x,E.x,.1),y:X1(xt.y,E.y,.1)};const w=zs(xt.x,xt.y);(Q=At.pupils.current)==null||Q.setAttribute("transform",`translate(${(w.x*5).toFixed(2)} ${(w.y*3).toFixed(2)})`),yt=requestAnimationFrame(_)};return yt=requestAnimationFrame(_),()=>{clearTimeout(_t),cancelAnimationFrame(yt),window.removeEventListener("pointermove",m)}},[k]);const Wt=Gy[Mt];return i.jsxs("svg",{viewBox:"0 0 200 200",className:`cp-mascot cp-form-${Mt} cp-pose-${d} cp-expr-${s}`,"data-testid":Z,"data-form":Mt,style:{width:U,height:U,transition:"width 0.9s cubic-bezier(0.3, 1.3, 0.4, 1), height 0.9s cubic-bezier(0.3, 1.3, 0.4, 1)",...D?{touchAction:"none",cursor:Y?"grab":"pointer"}:{}},...D?{role:"button","aria-label":M,onClick:O,...Y?{onPointerDown:yt=>{yt.button===0&&Y(yt.clientX,yt.clientY)}}:{}}:{"aria-hidden":!0},children:[i.jsx("defs",{children:i.jsx("clipPath",{id:`${it}-keyclip`,children:i.jsx("circle",{cx:"100",cy:"135",r:"11.6"})})}),i.jsxs("g",{className:"cp-beacons","aria-hidden":"true",children:[i.jsx("circle",{cx:"52",cy:"86",r:"3",className:"cp-beacon-l"}),i.jsx("circle",{cx:"148",cy:"86",r:"3",className:"cp-beacon-r"})]}),i.jsxs("g",{className:"cp-thruster","aria-hidden":"true",children:[i.jsx("circle",{cx:"100",cy:"187",r:"5.2"}),i.jsx("circle",{cx:"91.5",cy:"198",r:"3.8"}),i.jsx("circle",{cx:"108.5",cy:"196.5",r:"3"})]}),Bt&&i.jsx("ellipse",{cx:"100",cy:"104",rx:"86",ry:"60",fill:"none",stroke:"#FFC800",strokeWidth:"2.5",opacity:"0.4",strokeDasharray:"10 7",className:"cp-halo"}),i.jsx(Wt,{uid:it,refs:At,expression:s,viseme:r,openScale:p,energyRatio:x,streakLit:T}),pt&&i.jsx("circle",{cx:"100",cy:"135",r:"21",fill:"none",stroke:"#FFC800",strokeWidth:"3",className:"cp-core-lit","aria-hidden":"true"}),gt&&i.jsxs("g",{"aria-hidden":"true",children:[i.jsx("g",{className:"cp-key-scope",clipPath:`url(#${it}-keyclip)`,children:K2(jt).map((yt,_t)=>i.jsx("rect",{x:86.8+_t*4.4,y:140-yt.h,width:"2.6",height:yt.h,rx:"1.1",className:"cp-scope-bar",style:{animationDelay:`${yt.d}ms`}},_t))}),i.jsx("text",{x:"100",y:"140",textAnchor:"middle",className:`cp-screen-key${Et?" cp-screen-key-flash":""}`,children:gt===" "?"␣":gt.toUpperCase()})]},`k${jt}`),el&&!gt&&i.jsxs("g",{className:"cp-screen-wave","aria-hidden":"true",children:[i.jsx("rect",{x:"88.6",y:"130",width:"3.2",height:"10",rx:"1.6"}),i.jsx("rect",{x:"93.6",y:"127",width:"3.2",height:"16",rx:"1.6"}),i.jsx("rect",{x:"98.6",y:"125",width:"3.2",height:"20",rx:"1.6"}),i.jsx("rect",{x:"103.6",y:"127",width:"3.2",height:"16",rx:"1.6"}),i.jsx("rect",{x:"108.6",y:"130",width:"3.2",height:"10",rx:"1.6"})]}),d==="writing"&&i.jsxs("g",{className:"cp-writing","aria-hidden":"true",children:[i.jsxs("g",{transform:"rotate(-8 100 150)",children:[i.jsx("path",{d:"M78,140 L99,145 L99,166 L78,161 Z",fill:"#F7F3E8",stroke:"#2B2530",strokeWidth:"3",strokeLinejoin:"round"}),i.jsx("path",{d:"M120,140 L99,145 L99,166 L120,161 Z",fill:"#EFE8D8",stroke:"#2B2530",strokeWidth:"3",strokeLinejoin:"round"}),i.jsx("path",{d:"M83,146 L95,149 M83,151 L95,154 M83,156 L95,159",stroke:"#9AA7B8",strokeWidth:"1.6",strokeLinecap:"round"}),i.jsx("path",{d:"M115,146 L103,149 M115,151 L103,154",stroke:"#9AA7B8",strokeWidth:"1.6",strokeLinecap:"round"})]}),Lt&&i.jsx("path",{className:"cp-note-tick",d:"M104,146 L108,152 L117,141",fill:"none",stroke:"#FFC800",strokeWidth:"4.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsxs("g",{className:"cp-pen",transform:"rotate(24 100 128)",children:[i.jsx("rect",{x:"96",y:"106",width:"7",height:"26",rx:"2.5",fill:"#FFC568",stroke:"#2B2530",strokeWidth:"2.6"}),i.jsx("path",{d:"M96,132 L103,132 L99.5,141 Z",fill:"#F7F3E8",stroke:"#2B2530",strokeWidth:"2",strokeLinejoin:"round"}),i.jsx("path",{d:"M98.4,138.5 L100.6,138.5 L99.5,141 Z",fill:"#173047"}),i.jsx("rect",{x:"95",y:"101",width:"9",height:"6",rx:"2",fill:"#E8563F",stroke:"#2B2530",strokeWidth:"2.4"})]})]}),Ut&&i.jsx("g",{className:"cp-crown-badge","aria-hidden":"true",children:i.jsx("path",{d:"M84,26 L92,36 L100,24 L108,36 L116,26 L114,44 L86,44 Z",fill:"#FFC800",stroke:"#E8A400",strokeWidth:"2",strokeLinejoin:"round"})})]})}export{nm as $,bm as A,ym as B,my as C,pm as D,gm as E,Y1 as F,Iy as G,$y as H,Dm as I,_m as J,hm as K,Lm as L,Hm as M,Nm as N,xm as O,cm as P,sm as Q,lm as R,tm as S,Sm as T,im as U,uy as V,fm as W,Um as X,wm as Y,Py as Z,em as _,Xy as a,am as a0,B2 as a1,Wy as a2,mm as a3,Tm as a4,Ky as a5,Vy as a6,ny as b,Jy as c,um as d,Z2 as e,Ts as f,I1 as g,rm as h,ly as i,i as j,Em as k,w2 as l,Om as m,Rm as n,Cm as o,jm as p,Mm as q,bl as r,om as s,Am as t,Ey as u,zm as v,iy as w,G1 as x,dm as y,vm as z};
|
|
53
|
+
L${(100+Math.cos(T)*U).toFixed(1)},${(135+Math.sin(T)*U).toFixed(1)} Z`};return i.jsxs("g",{children:[i.jsx("path",{d:"M100,117 L114,135 L100,153 L86,135 Z",fill:lh,stroke:ol,strokeWidth:"4",strokeLinejoin:"round"}),Array.from({length:6},(p,x)=>i.jsx("path",{d:r(x),fill:x<d?Xa:_y,stroke:ol,strokeWidth:"1.4",strokeLinejoin:"round",opacity:x<d?1:.55},x)),i.jsx("circle",{cx:"100",cy:"135",r:"3.2",fill:d>=6?ka:Xa,stroke:ol,strokeWidth:"1.6"}),i.jsx("path",{d:"M94,124 L98,119",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round",opacity:"0.8"}),i.jsx("rect",{x:"0",y:"0",width:"0",height:"0",fill:"none","data-uid":s})]})}function Oy(f,s){switch(f){case"A":return i.jsx("path",{d:"M92,74.5 L108,74.5 L113,78.5 L108,85.5 L92,85.5 L87,78.5 Z M95,77.5 L105,77.5 L105,83.5 L95,83.5 Z",fill:s.ink,fillRule:"evenodd"});case"E":return i.jsx("path",{d:"M90,76.5 L110,76.5 L113,80 L110,83.5 L90,83.5 L87,80 Z",fill:s.ink});case"I":return i.jsx("path",{d:"M90,79 L110,79 L111.5,80.8 L110,82.6 L90,82.6 L88.5,80.8 Z",fill:s.ink});case"O":return i.jsx("path",{d:"M100,73.5 L106,80.5 L100,86 L94,80.5 Z M100,77.5 L102.8,80.5 L100,83.4 L97.2,80.5 Z",fill:s.ink,fillRule:"evenodd"});case"U":return i.jsx("path",{d:"M100,74 L104,80.5 L100,85.5 L96,80.5 Z M100,78 L101.8,80.5 L100,83 L98.2,80.5 Z",fill:s.ink,fillRule:"evenodd"});case"SS":return i.jsxs("g",{children:[i.jsx("path",{d:"M86,76 L114,76 L112.5,82.6 L87.5,82.6 Z",fill:s.ink}),i.jsx("path",{d:"M90,76.4 L95.4,76.4 L94.4,82.2 L91.2,82.2 Z",fill:"#FFFFFF"}),i.jsx("path",{d:"M98,76.4 L103,76.4 L102.2,82.2 L99,82.2 Z",fill:"#FFFFFF",opacity:"0.9"}),i.jsx("path",{d:"M105.6,76.4 L110.4,76.4 L109.4,82.2 L106.4,82.2 Z",fill:"#FFFFFF",opacity:"0.75"})]});case"L":return i.jsxs("g",{children:[i.jsx("path",{d:"M92,74.5 L108,74.5 L113,78.5 L108,85.5 L92,85.5 L87,78.5 Z M95,77.5 L105,77.5 L105,83.5 L95,83.5 Z",fill:s.ink,fillRule:"evenodd"}),i.jsx("rect",{x:"96",y:"78",width:"8",height:"3.2",rx:"1.6",fill:s.pupil}),i.jsx("rect",{x:"98",y:"78.8",width:"4",height:"1.6",rx:"0.8",fill:"#FFFFFF",opacity:"0.9"})]});case"FV":return i.jsxs("g",{children:[i.jsx("path",{d:"M92,74.5 L108,74.5 L112,78 L108,84.5 L92,84.5 L88,78 Z",fill:s.ink}),i.jsx("path",{d:"M93.5,76.2 L106.5,76.2 L105.8,79.4 L94.2,79.4 Z",fill:"#FFFFFF"}),i.jsx("rect",{x:"95.5",y:"80.6",width:"9",height:"2.6",rx:"1.3",fill:s.pupil})]});default:return i.jsx("path",{d:"M92,79.5 L100,83.5 L108,79.5",fill:"none",stroke:s.ink,strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round"})}}function Ny({uid:f,refs:s,expression:d,viseme:r,openScale:p,energyRatio:x,streakLit:T}){const U=tu(d);return i.jsxs(i.Fragment,{children:[i.jsxs("defs",{children:[i.jsx("clipPath",{id:`${f}-body`,children:i.jsx("path",{d:"M70,110 L130,110 L142,122 L138,156 L62,156 L58,122 Z"})}),i.jsx("clipPath",{id:`${f}-helm`,children:i.jsx("path",{d:"M54,40 L76,26 L124,26 L146,40 L150,64 L142,96 L58,96 L50,64 Z"})}),i.jsx("clipPath",{id:`${f}-scr`,children:i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"6"})})]}),i.jsxs("g",{ref:s.bot,className:"cp-bot",children:[i.jsxs("g",{className:"cp-thrust",children:[i.jsx("ellipse",{cx:"100",cy:"177",rx:"11",ry:"8",fill:T?ka:Xa,opacity:"0.35"}),i.jsx("ellipse",{cx:"100",cy:"176",rx:"7",ry:"5",fill:T?ka:Xa})]}),i.jsx("path",{d:"M90,158 L110,158 L104,171 L96,171 Z",fill:"#2E3A4A",stroke:ol,strokeWidth:"4",strokeLinejoin:"round"}),i.jsxs("g",{className:"cp-body",children:[i.jsxs("g",{clipPath:`url(#${f}-body)`,children:[i.jsx("path",{d:"M70,110 L130,110 L142,122 L138,156 L62,156 L58,122 Z",fill:rs}),i.jsx("path",{d:"M70,110 L130,110 L142,122 L138,156 L62,156 L58,122 Z",fill:os,transform:"translate(-5 -5)"})]}),i.jsx("path",{d:"M70,110 L130,110 L142,122 L138,156 L62,156 L58,122 Z",fill:"none",stroke:ol,strokeWidth:"5",strokeLinejoin:"round"}),i.jsx(Ml,{id:`${f}-body`,x:58,y:110,w:84,h:46,t:4,light:"rgba(255,255,255,0.6)",dark:"rgba(24,58,82,0.4)"}),i.jsx(Dy,{energyRatio:x,uid:f}),i.jsx("circle",{cx:"74",cy:"150",r:"1.5",fill:ol,opacity:"0.45"}),i.jsx("circle",{cx:"126",cy:"150",r:"1.5",fill:ol,opacity:"0.45"})]}),i.jsxs("g",{ref:s.head,className:"cp-head",children:[i.jsxs("g",{className:"cp-antenna",children:[i.jsx("path",{d:"M40,58 L36,38 L44,50 Z",fill:T?ka:Xa,stroke:ol,strokeWidth:"3.5",strokeLinejoin:"round"}),i.jsx("path",{d:"M46,56 L46,42 L52,52 Z",fill:T?ka:os,stroke:ol,strokeWidth:"3",strokeLinejoin:"round"}),T&&i.jsx("path",{d:"M28,34 l3,-3 m-1,7 l3,-3 m-9,-1 l3,-3",stroke:ka,strokeWidth:"2.2",strokeLinecap:"round"}),!T&&i.jsx("circle",{cx:"40",cy:"38",r:"8",fill:Xa,opacity:"0.22",className:"cp-ant-glow"})]}),i.jsx("path",{d:"M42,60 L42,84 L48,88 L54,84 L54,60 L48,56 Z",fill:hs,stroke:ol,strokeWidth:"4",strokeLinejoin:"round"}),i.jsx("path",{d:"M146,60 L146,84 L152,88 L158,84 L158,60 L152,56 Z",fill:hs,stroke:ol,strokeWidth:"4",strokeLinejoin:"round"}),i.jsxs("g",{clipPath:`url(#${f}-helm)`,children:[i.jsx("path",{d:"M54,40 L76,26 L124,26 L146,40 L150,64 L142,96 L58,96 L50,64 Z",fill:rs}),i.jsx("path",{d:"M54,40 L76,26 L124,26 L146,40 L150,64 L142,96 L58,96 L50,64 Z",fill:os,transform:"translate(-5 -5)"}),i.jsx("path",{d:"M60,34 L74,28 M132,28 L146,34",stroke:"#FFFFFF",strokeWidth:"2.4",strokeLinecap:"round",opacity:"0.75"})]}),i.jsx("path",{d:"M54,40 L76,26 L124,26 L146,40 L150,64 L142,96 L58,96 L50,64 Z",fill:"none",stroke:ol,strokeWidth:"5",strokeLinejoin:"round"}),i.jsx(Ml,{id:`${f}-helm`,x:50,y:26,w:100,h:70,t:4,light:"rgba(255,255,255,0.55)",dark:"rgba(24,58,82,0.38)"}),i.jsx("path",{d:"M58,36 L96,36 L90,45 L54,45 Z",fill:"#FFFFFF",opacity:"0.9"}),i.jsx("path",{d:"M104,36 L118,36 L112,45 L102,45 Z",fill:"#FFFFFF",opacity:"0.5"}),i.jsx("path",{d:"M58,48 h84 a8,8 0 0 1 8,8 v30 a8,8 0 0 1 -8,8 h-84 a8,8 0 0 1 -8,-8 v-30 a8,8 0 0 1 8,-8 Z",fill:lh,stroke:ol,strokeWidth:"4.5"}),i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"6",fill:Ly}),i.jsxs("g",{clipPath:`url(#${f}-scr)`,children:[i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",fill:hs,transform:"translate(0 15)"}),i.jsx("path",{d:"M118,54 L136,54 L108,88 L90,88 Z",fill:"#FFFFFF",opacity:"0.18"})]}),i.jsxs("g",{className:"cp-scr-face",clipPath:`url(#${f}-scr)`,children:[i.jsx(lu,{expression:d,flags:U,refs:s,p:ss,viseme:r,openScale:p,renderMouth:Oy}),i.jsx(eu,{flags:U,refs:s,p:ss})]})]}),U.proud&&i.jsx(au,{p:ss}),i.jsx(nu,{refs:s,armFill:rs,out:ol})]})]})}const ds={out:"#2A3326",ink:"#2F5D3A",pupil:"#9BEFA9",wave:"#8FDBA0",crown:"#FFC800",crownD:"#D9A400"},ie="#9BEFA9",ys="#57BD74",Ms="#3E8E55",Uy="#F4FBE8",eh="#D7F0C8",ah="#3A4A34",ms="#FFC800",Jt="#2A3326";function Cy({energyRatio:f}){const s=Math.min(1,Math.max(0,f)),d=10+s*30,r=2+s*6;return i.jsxs("g",{children:[i.jsx("circle",{cx:"100",cy:"135",r:"16.5",fill:ah,stroke:Jt,strokeWidth:"4.5"}),i.jsx("circle",{cx:"100",cy:"135",r:"12.5",fill:eh}),i.jsx("path",{d:`M100,141 Q${100-s*2},${135-r} 100,${129-r}`,fill:"none",stroke:Ms,strokeWidth:"3",strokeLinecap:"round"}),i.jsx("g",{transform:`rotate(${-d} 100 133)`,children:i.jsx("path",{d:"M100,133 C95,127 87,127 85,131 C88,136 96,137 100,133 Z",fill:ie,stroke:Jt,strokeWidth:"2.6",strokeLinejoin:"round"})}),i.jsx("g",{transform:`rotate(${d} 100 133)`,children:i.jsx("path",{d:"M100,133 C105,127 113,127 115,131 C112,136 104,137 100,133 Z",fill:ie,stroke:Jt,strokeWidth:"2.6",strokeLinejoin:"round"})}),i.jsx("ellipse",{cx:"100",cy:"140",rx:"5.5",ry:"4",fill:"#7A5A3A",stroke:Jt,strokeWidth:"2.4"}),i.jsx("path",{d:"M95,130.5 Q97,128.5 99.5,129",stroke:"#FFFFFF",strokeWidth:"1.8",fill:"none",strokeLinecap:"round",opacity:"0.7"})]})}function wy(f,s){switch(f){case"A":return i.jsx("path",{d:"M92,74 Q100,71 108,74 Q110,83 100,86 Q90,83 92,74 Z M96,76 Q100,78 104,76 Q103,80 100,81.5 Q97,80 96,76 Z",fill:s.ink,fillRule:"evenodd"});case"E":return i.jsx("path",{d:"M91,76.5 Q100,74 109,76.5 Q109,82 100,83 Q91,82 91,76.5 Z",fill:s.ink});case"I":return i.jsx("path",{d:"M91,78.5 Q100,77 109,78.5 Q109,81.5 100,82.2 Q91,81.5 91,78.5 Z",fill:s.ink});case"O":return i.jsx("path",{d:"M100,72.5 C105,72.5 107.5,77 107.5,80 C107.5,83.5 104.5,86.5 100,86.5 C95.5,86.5 92.5,83.5 92.5,80 C92.5,77 95,72.5 100,72.5 Z M100,77 C102.5,77 104,78.5 104,80.5 C104,82.5 102.3,83.8 100,83.8 C97.7,83.8 96,82.5 96,80.5 C96,78.5 97.5,77 100,77 Z",fill:s.ink,fillRule:"evenodd"});case"U":return i.jsx("path",{d:"M100,73 C103,73 105,76.5 105,80 C105,83.3 103,86 100,86 C97,86 95,83.3 95,80 C95,76.5 97,73 100,73 Z M100,76.8 C101.3,76.8 102.2,78.3 102.2,80.3 C102.2,82.3 101.3,83.6 100,83.6 C98.7,83.6 97.8,82.3 97.8,80.3 C97.8,78.3 98.7,76.8 100,76.8 Z",fill:s.ink,fillRule:"evenodd"});case"SS":return i.jsxs("g",{children:[i.jsx("path",{d:"M87,77 Q100,75 113,77 Q113.5,82.5 100,83 Q86.5,82.5 87,77 Z",fill:s.ink}),i.jsx("rect",{x:"90.5",y:"77.8",width:"1.8",height:"3.2",rx:"0.9",fill:"#FFFFFF"}),i.jsx("rect",{x:"96.5",y:"77.7",width:"1.8",height:"3.4",rx:"0.9",fill:"#FFFFFF",opacity:"0.92"}),i.jsx("rect",{x:"102.5",y:"77.8",width:"1.8",height:"3.2",rx:"0.9",fill:"#FFFFFF",opacity:"0.84"}),i.jsx("rect",{x:"108",y:"77.9",width:"1.8",height:"3",rx:"0.9",fill:"#FFFFFF",opacity:"0.72"})]});case"L":return i.jsxs("g",{children:[i.jsx("path",{d:"M92,74 Q100,71 108,74 Q110,83 100,86 Q90,83 92,74 Z M96,76 Q100,78 104,76 Q103,80 100,81.5 Q97,80 96,76 Z",fill:s.ink,fillRule:"evenodd"}),i.jsx("rect",{x:"96",y:"76.6",width:"8",height:"3.2",rx:"1.6",fill:s.pupil}),i.jsx("rect",{x:"98",y:"77.4",width:"4",height:"1.6",rx:"0.8",fill:"#FFFFFF",opacity:"0.9"})]});case"FV":return i.jsxs("g",{children:[i.jsx("path",{d:"M93.5,77 Q100,74.5 106.5,77 Q107,82.5 100,83.8 Q93,82.5 93.5,77 Z",fill:s.ink}),i.jsx("rect",{x:"94.5",y:"77.2",width:"11",height:"2.4",rx:"1.2",fill:"#FFFFFF"}),i.jsx("rect",{x:"95.5",y:"80.4",width:"9",height:"2.6",rx:"1.3",fill:s.pupil})]});default:return i.jsx("path",{d:"M92,79.5 Q100,85.5 108,79.5",fill:"none",stroke:s.ink,strokeWidth:"3.5",strokeLinecap:"round"})}}function Ry({uid:f,refs:s,expression:d,viseme:r,openScale:p,energyRatio:x,streakLit:T}){const U=tu(d);return i.jsxs(i.Fragment,{children:[i.jsxs("defs",{children:[i.jsx("clipPath",{id:`${f}-body`,children:i.jsx("rect",{x:"64",y:"110",width:"72",height:"50",rx:"22"})}),i.jsx("clipPath",{id:`${f}-helm`,children:i.jsx("ellipse",{cx:"100",cy:"69",rx:"56",ry:"42"})}),i.jsx("clipPath",{id:`${f}-scr`,children:i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"12"})})]}),i.jsxs("g",{ref:s.bot,className:"cp-bot",children:[i.jsxs("g",{className:"cp-thrust",children:[i.jsx("ellipse",{cx:"100",cy:"177",rx:"11",ry:"8",fill:T?ms:ie,opacity:"0.3"}),i.jsx("ellipse",{cx:"100",cy:"176",rx:"7",ry:"5",fill:T?ms:ie})]}),i.jsx("path",{d:"M88,158 Q100,152 112,158 L106,171 Q100,174 94,171 Z",fill:"#3A4A34",stroke:Jt,strokeWidth:"4",strokeLinejoin:"round"}),i.jsxs("g",{className:"cp-body",children:[i.jsxs("g",{clipPath:`url(#${f}-body)`,children:[i.jsx("rect",{x:"64",y:"110",width:"72",height:"50",rx:"22",fill:ys}),i.jsx("rect",{x:"64",y:"110",width:"72",height:"50",rx:"22",fill:ie,transform:"translate(-4 -4)"})]}),i.jsx("rect",{x:"64",y:"110",width:"72",height:"50",rx:"22",fill:"none",stroke:Jt,strokeWidth:"5"}),i.jsx(Ml,{id:`${f}-body`,x:64,y:110,w:72,h:50,t:4,light:"rgba(255,255,255,0.42)",dark:"rgba(38,74,46,0.4)"}),i.jsx(Cy,{energyRatio:x}),i.jsx("circle",{cx:"73",cy:"150",r:"1.6",fill:Jt,opacity:"0.45"}),i.jsx("circle",{cx:"127",cy:"150",r:"1.6",fill:Jt,opacity:"0.45"})]}),i.jsxs("g",{ref:s.head,className:"cp-head",children:[i.jsxs("g",{className:"cp-antenna",children:[i.jsx("path",{d:"M43,60 Q40,50 44,42",fill:"none",stroke:Jt,strokeWidth:"4",strokeLinecap:"round"}),T?i.jsxs("g",{children:[Array.from({length:5},(D,M)=>i.jsx("ellipse",{cx:"44",cy:"33",rx:"4",ry:"7.5",fill:ms,stroke:Jt,strokeWidth:"2",transform:`rotate(${M*72} 44 40)`},M)),i.jsx("circle",{cx:"44",cy:"40",r:"4.5",fill:"#FFF3C4",stroke:Jt,strokeWidth:"2"})]}):i.jsxs("g",{children:[i.jsx("ellipse",{cx:"44",cy:"39",rx:"5.5",ry:"7",fill:ie,stroke:Jt,strokeWidth:"3"}),i.jsx("path",{d:"M44,33 Q46.5,39 44,45",fill:"none",stroke:Ms,strokeWidth:"1.8"})]})]}),i.jsx("path",{d:"M48,62 C36,56 30,62 32,70 C38,76 48,74 48,62 Z",fill:ie,stroke:Jt,strokeWidth:"4",strokeLinejoin:"round"}),i.jsx("path",{d:"M152,62 C164,56 170,62 168,70 C162,76 152,74 152,62 Z",fill:ie,stroke:Jt,strokeWidth:"4",strokeLinejoin:"round"}),i.jsx("path",{d:"M36,62 Q42,66 46,68 M164,62 Q158,66 154,68",stroke:Ms,strokeWidth:"1.8",fill:"none",strokeLinecap:"round"}),i.jsxs("g",{clipPath:`url(#${f}-helm)`,children:[i.jsx("ellipse",{cx:"100",cy:"69",rx:"56",ry:"42",fill:ys}),i.jsx("ellipse",{cx:"100",cy:"69",rx:"56",ry:"42",fill:ie,transform:"translate(-5 -5)"})]}),i.jsx("ellipse",{cx:"100",cy:"69",rx:"56",ry:"42",fill:"none",stroke:Jt,strokeWidth:"5"}),i.jsx(Ml,{id:`${f}-helm`,x:44,y:27,w:112,h:84,t:4,light:"rgba(255,255,255,0.36)",dark:"rgba(38,74,46,0.36)"}),i.jsx("path",{d:"M58,37 Q86,31 104,38 L96,47 Q68,46 58,37 Z",fill:"#FFFFFF",opacity:"0.88"}),i.jsx("circle",{cx:"118",cy:"41",r:"4",fill:"#FFFFFF",opacity:"0.55"}),i.jsx("rect",{x:"58",y:"48",width:"84",height:"46",rx:"16",fill:ah,stroke:Jt,strokeWidth:"4.5"}),i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"12",fill:Uy}),i.jsxs("g",{clipPath:`url(#${f}-scr)`,children:[i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",fill:eh,transform:"translate(0 15)"}),i.jsx("path",{d:"M120,54 L136,54 L106,88 L90,88 Z",fill:"#FFFFFF",opacity:"0.2"})]}),i.jsxs("g",{className:"cp-scr-face",clipPath:`url(#${f}-scr)`,children:[i.jsx(lu,{expression:d,flags:U,refs:s,p:ds,viseme:r,openScale:p,renderMouth:wy}),i.jsx(eu,{flags:U,refs:s,p:ds})]})]}),U.proud&&i.jsx(au,{p:ds}),i.jsx(nu,{refs:s,armFill:ys,out:Jt})]})]})}const gs={out:"#221C38",ink:"#FFEFC2",pupil:"#8B7BF0",wave:"#B7ACFF",crown:"#FFD75E",crownD:"#D9A400"},Za="#8B7BF0",ps="#5D4FD1",Hy="#241E4E",nh="#3A2F6E",Ya="#1A1440",Vn="#FFEFC2",Ba="#FFD75E",jl="#221C38";function Zy({energyRatio:f,uid:s}){const d=Math.min(1,Math.max(0,f)),r=(1-d)*26;return i.jsxs("g",{children:[i.jsx("circle",{cx:"100",cy:"135",r:"16.5",fill:Ya,stroke:jl,strokeWidth:"4.5"}),i.jsx("circle",{cx:"100",cy:"135",r:"12.5",fill:nh}),i.jsxs("g",{clipPath:`url(#${s}-moon)`,children:[i.jsx("circle",{cx:"100",cy:"135",r:"11.5",fill:Vn}),i.jsx("circle",{cx:100-r,cy:"135",r:"12.5",fill:Ya})]}),i.jsx("circle",{cx:"100",cy:"135",r:"12.5",fill:"none",stroke:jl,strokeWidth:"2"}),i.jsxs("g",{opacity:.35*d,children:[i.jsx("circle",{cx:"96",cy:"131",r:"2",fill:Ya}),i.jsx("circle",{cx:"104",cy:"138",r:"1.5",fill:Ya}),i.jsx("circle",{cx:"99",cy:"140",r:"1.1",fill:Ya})]})]})}function By(f,s){switch(f){case"A":return i.jsx("path",{d:"M91,74.5 h18 a5,5 0 0 1 5,5 v2.6 a5,5 0 0 1 -5,5 h-18 a5,5 0 0 1 -5,-5 v-2.6 a5,5 0 0 1 5,-5 Z M95,77.5 h10 v5.6 h-10 Z",fill:s.ink,fillRule:"evenodd"});case"E":return i.jsx("path",{d:"M90,77 h20 a3.2,3.2 0 0 1 0,6.4 h-20 a3.2,3.2 0 0 1 0,-6.4 Z",fill:s.ink});case"I":return i.jsx("path",{d:"M90,79.5 h20 a1.9,1.9 0 0 1 0,3.8 h-20 a1.9,1.9 0 0 1 0,-3.8 Z",fill:s.ink});case"O":return i.jsxs("g",{fill:"none",children:[i.jsx("circle",{cx:"100",cy:"79.5",r:"6.4",stroke:s.ink,strokeWidth:"4"}),i.jsx("circle",{cx:"100",cy:"79.5",r:"1.6",fill:s.ink,stroke:"none"})]});case"U":return i.jsx("g",{fill:"none",children:i.jsx("circle",{cx:"100",cy:"79.5",r:"4.4",stroke:s.ink,strokeWidth:"3.6"})});case"SS":return i.jsxs("g",{children:[i.jsx("path",{d:"M87,76.5 h26 a2.4,2.4 0 0 1 2.4,2.4 v1.2 a2.4,2.4 0 0 1 -2.4,2.4 h-26 a2.4,2.4 0 0 1 -2.4,-2.4 v-1.2 a2.4,2.4 0 0 1 2.4,-2.4 Z",fill:s.ink}),i.jsx("rect",{x:"90.5",y:"78.1",width:"1.8",height:"3.2",rx:"0.9",fill:"#FFFFFF"}),i.jsx("rect",{x:"96.5",y:"78.1",width:"1.8",height:"3.2",rx:"0.9",fill:"#FFFFFF",opacity:"0.92"}),i.jsx("rect",{x:"102.5",y:"78.1",width:"1.8",height:"3.2",rx:"0.9",fill:"#FFFFFF",opacity:"0.84"}),i.jsx("rect",{x:"108",y:"78.1",width:"1.8",height:"3",rx:"0.9",fill:"#FFFFFF",opacity:"0.72"})]});case"L":return i.jsxs("g",{children:[i.jsx("path",{d:"M91,74.5 h18 a5,5 0 0 1 5,5 v2.6 a5,5 0 0 1 -5,5 h-18 a5,5 0 0 1 -5,-5 v-2.6 a5,5 0 0 1 5,-5 Z M95,77.5 h10 v5.6 h-10 Z",fill:s.ink,fillRule:"evenodd"}),i.jsx("rect",{x:"96",y:"77.2",width:"8",height:"3.2",rx:"1.6",fill:s.pupil}),i.jsx("rect",{x:"98",y:"78",width:"4",height:"1.6",rx:"0.8",fill:"#FFFFFF",opacity:"0.9"})]});case"FV":return i.jsxs("g",{children:[i.jsx("path",{d:"M92,74.8 h16 a5,5 0 0 1 5,5 v2.4 a5,5 0 0 1 -5,5 h-16 a5,5 0 0 1 -5,-5 v-2.4 a5,5 0 0 1 5,-5 Z",fill:s.ink}),i.jsx("rect",{x:"93.5",y:"76.6",width:"13",height:"2.4",rx:"1.2",fill:"#FFFFFF"}),i.jsx("rect",{x:"95.5",y:"79.6",width:"9",height:"2.6",rx:"1.3",fill:s.pupil})]});default:return i.jsx("path",{d:"M92,79.5 Q100,85 108,79.5",fill:"none",stroke:s.ink,strokeWidth:"3.5",strokeLinecap:"round"})}}function Fy({uid:f,refs:s,expression:d,viseme:r,openScale:p,energyRatio:x,streakLit:T}){const U=tu(d);return i.jsxs(i.Fragment,{children:[i.jsxs("defs",{children:[i.jsx("clipPath",{id:`${f}-body`,children:i.jsx("rect",{x:"66",y:"110",width:"68",height:"50",rx:"20"})}),i.jsx("clipPath",{id:`${f}-helm`,children:i.jsx("path",{d:"M48,96 L48,62 Q48,26 100,26 Q152,26 152,62 L152,96 Z"})}),i.jsx("clipPath",{id:`${f}-scr`,children:i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"9"})}),i.jsx("clipPath",{id:`${f}-moon`,children:i.jsx("circle",{cx:"100",cy:"135",r:"12.5"})})]}),i.jsxs("g",{ref:s.bot,className:"cp-bot",children:[i.jsxs("g",{className:"cp-thrust",children:[i.jsx("ellipse",{cx:"100",cy:"177",rx:"11",ry:"8",fill:T?Ba:Za,opacity:"0.38"}),i.jsx("ellipse",{cx:"100",cy:"176",rx:"7",ry:"5",fill:T?Ba:Za})]}),i.jsx("path",{d:"M88,158 L112,158 L106,171 L94,171 Z",fill:"#2A2248",stroke:jl,strokeWidth:"4",strokeLinejoin:"round"}),i.jsxs("g",{className:"cp-body",children:[i.jsxs("g",{clipPath:`url(#${f}-body)`,children:[i.jsx("rect",{x:"66",y:"110",width:"68",height:"50",rx:"20",fill:ps}),i.jsx("rect",{x:"66",y:"110",width:"68",height:"50",rx:"20",fill:Za,transform:"translate(-4 -4)"})]}),i.jsx("rect",{x:"66",y:"110",width:"68",height:"50",rx:"20",fill:"none",stroke:jl,strokeWidth:"5"}),i.jsx(Ml,{id:`${f}-body`,x:66,y:110,w:68,h:50,t:4,light:"rgba(196,181,255,0.34)",dark:"rgba(10,6,32,0.5)"}),i.jsx(Zy,{energyRatio:x,uid:f}),i.jsx("circle",{cx:"76",cy:"150",r:"1.5",fill:jl,opacity:"0.5"}),i.jsx("circle",{cx:"124",cy:"150",r:"1.5",fill:jl,opacity:"0.5"})]}),i.jsxs("g",{ref:s.head,className:"cp-head",children:[i.jsxs("g",{className:"cp-antenna",children:[i.jsx("ellipse",{cx:"42",cy:"44",rx:"13",ry:"5.5",fill:"none",stroke:jl,strokeWidth:"3.5",transform:"rotate(-24 42 44)"}),i.jsx("circle",{cx:"49",cy:"39",r:"5",fill:T?Ba:Vn,stroke:jl,strokeWidth:"3"}),T&&i.jsx("path",{d:"M56,34 L68,26 M57,41 L71,38 M52,30 L58,20",stroke:Ba,strokeWidth:"2.4",strokeLinecap:"round"})]}),i.jsx("circle",{cx:"44",cy:"72",r:"8",fill:Za,stroke:jl,strokeWidth:"4"}),i.jsx("ellipse",{cx:"44",cy:"72",rx:"13",ry:"4.5",fill:"none",stroke:Ba,strokeWidth:"2.4",transform:"rotate(-18 44 72)"}),i.jsx("circle",{cx:"156",cy:"72",r:"8",fill:Za,stroke:jl,strokeWidth:"4"}),i.jsx("ellipse",{cx:"156",cy:"72",rx:"13",ry:"4.5",fill:"none",stroke:Ba,strokeWidth:"2.4",transform:"rotate(18 156 72)"}),i.jsxs("g",{clipPath:`url(#${f}-helm)`,children:[i.jsx("path",{d:"M48,96 L48,62 Q48,26 100,26 Q152,26 152,62 L152,96 Z",fill:ps}),i.jsx("path",{d:"M48,96 L48,62 Q48,26 100,26 Q152,26 152,62 L152,96 Z",fill:Za,transform:"translate(-5 -5)"}),i.jsx("circle",{cx:"66",cy:"42",r:"1.6",fill:"#FFFFFF",opacity:"0.9"}),i.jsx("circle",{cx:"82",cy:"33",r:"1.2",fill:"#FFFFFF",opacity:"0.75"}),i.jsx("circle",{cx:"130",cy:"36",r:"1.7",fill:"#FFFFFF",opacity:"0.9"}),i.jsx("circle",{cx:"118",cy:"30",r:"1",fill:"#FFFFFF",opacity:"0.6"}),i.jsx("path",{d:"M94,28 l1.6,3.2 3.4,0.5 -2.5,2.4 0.6,3.4 -3.1,-1.7 -3.1,1.7 0.6,-3.4 -2.5,-2.4 3.4,-0.5 Z",fill:"#FFFFFF",opacity:"0.85"})]}),i.jsx("path",{d:"M48,96 L48,62 Q48,26 100,26 Q152,26 152,62 L152,96 Z",fill:"none",stroke:jl,strokeWidth:"5"}),i.jsx(Ml,{id:`${f}-helm`,x:48,y:26,w:104,h:70,t:4,light:"rgba(196,181,255,0.3)",dark:"rgba(10,6,32,0.45)"}),i.jsx("path",{d:"M56,40 Q88,28 110,34 L102,44 Q72,40 56,46 Z",fill:"#FFFFFF",opacity:"0.8"}),i.jsx("rect",{x:"58",y:"48",width:"84",height:"46",rx:"12",fill:Ya,stroke:jl,strokeWidth:"4.5"}),i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"9",fill:Hy}),i.jsxs("g",{clipPath:`url(#${f}-scr)`,children:[i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",fill:nh,transform:"translate(0 15)"}),i.jsx("circle",{cx:"74",cy:"60",r:"1",fill:Vn,opacity:"0.8"}),i.jsx("circle",{cx:"128",cy:"82",r:"1.2",fill:Vn,opacity:"0.6"}),i.jsx("circle",{cx:"86",cy:"84",r:"0.8",fill:Vn,opacity:"0.5"}),i.jsx("path",{d:"M118,54 L136,54 L106,88 L92,88 Z",fill:"#FFFFFF",opacity:"0.08"})]}),i.jsxs("g",{className:"cp-scr-face",clipPath:`url(#${f}-scr)`,children:[i.jsx(lu,{expression:d,flags:U,refs:s,p:gs,viseme:r,openScale:p,renderMouth:By}),i.jsx(eu,{flags:U,refs:s,p:gs})]})]}),U.proud&&i.jsx(au,{p:gs}),i.jsx(nu,{refs:s,armFill:ps,out:jl})]})]})}const xs={out:"#2F2A22",ink:"#2B2B2B",pupil:"#F7F2E6",wave:"#8FB8C9",crown:"#FFC800",crownD:"#D9A400"},Ti="#F7F2E6",Li="#DCD2B8",Qy="#FBF7EC",Fa="#EFE7D2",_i="#4A4234",Kn="#E8543F",uh="#B8392A",Es="#3A342A",Ui="#FFC800",Hl="#2F2A22";function qy({energyRatio:f,streakLit:s}){const d=Math.min(1,Math.max(0,f)),p=146-d*22;return i.jsxs("g",{children:[i.jsx("path",{d:"M82,120 h36 a6,6 0 0 1 6,6 v16 a8,8 0 0 1 -8,8 h-32 a8,8 0 0 1 -8,-8 v-16 a6,6 0 0 1 6,-6 Z",fill:_i,stroke:Hl,strokeWidth:"4.5"}),i.jsx("path",{d:"M86,124 h28 a4,4 0 0 1 4,4 v14 a5,5 0 0 1 -5,5 h-26 a5,5 0 0 1 -5,-5 v-14 a4,4 0 0 1 4,-4 Z",fill:Li}),i.jsxs("g",{children:[i.jsx("rect",{x:"82",y:p,width:"36",height:150-p,rx:"3",fill:s?"#4A4034":Es}),i.jsx("ellipse",{cx:"100",cy:p,rx:"18",ry:"2.6",fill:d>=.999?Ui:"#57503F"}),d>=.999&&i.jsx("path",{d:"M90,144 q5,-4 10,0 q5,4 10,0",fill:"none",stroke:Ui,strokeWidth:"2",strokeLinecap:"round",opacity:"0.8"})]}),i.jsx("path",{d:"M88,126.5 q12,-2.5 24,0",fill:"none",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round",opacity:"0.6"}),i.jsx("rect",{x:"122",y:"121",width:"11",height:"11",rx:"2.5",fill:Kn,stroke:uh,strokeWidth:"1.8"}),i.jsx("path",{d:"M125.5,124.5 h4 M125.5,127.5 h4 M127.5,124 v6",stroke:Ti,strokeWidth:"1.5",strokeLinecap:"round"})]})}function ky(f,s){switch(f){case"A":return i.jsx("path",{d:"M91,74 Q100,71.5 109,74 Q111,83 100,86.5 Q89,83 91,74 Z M96,76.5 Q100,78.5 104,76.5 Q103,81 100,82.5 Q97,81 96,76.5 Z",fill:s.ink,fillRule:"evenodd"});case"E":return i.jsx("path",{d:"M90,76 Q100,73.8 110,76 Q110.8,82.2 100,83.4 Q89.2,82.2 90,76 Z",fill:s.ink});case"I":return i.jsx("path",{d:"M90.5,78.4 Q100,77 109.5,78.4 Q110,81.8 100,82.4 Q90,81.8 90.5,78.4 Z",fill:s.ink});case"O":return i.jsx("path",{d:"M100,72.5 C105.5,72.5 108,77 108,80 C108,83.6 104.8,86.6 100,86.6 C95.2,86.6 92,83.6 92,80 C92,77 94.5,72.5 100,72.5 Z M100,77 C102.6,77 104.2,78.5 104.2,80.5 C104.2,82.5 102.5,83.7 100,83.7 C97.5,83.7 95.8,82.5 95.8,80.5 C95.8,78.5 97.4,77 100,77 Z",fill:s.ink,fillRule:"evenodd"});case"U":return i.jsx("path",{d:"M100,73 C103.2,73 105.2,76.6 105.2,80 C105.2,83.4 103.2,86 100,86 C96.8,86 94.8,83.4 94.8,80 C94.8,76.6 96.8,73 100,73 Z M100,76.8 C101.4,76.8 102.3,78.3 102.3,80.3 C102.3,82.3 101.4,83.5 100,83.5 C98.6,83.5 97.7,82.3 97.7,80.3 C97.7,78.3 98.6,76.8 100,76.8 Z",fill:s.ink,fillRule:"evenodd"});case"SS":return i.jsxs("g",{children:[i.jsx("path",{d:"M88,77.2 Q100,75.6 112,77.2 Q112.6,82.8 100,83.4 Q87.4,82.8 88,77.2 Z",fill:s.ink}),i.jsx("path",{d:"M91.5,77.8 L96.3,77.6 L95.7,81.6 L92.1,81.5 Z",fill:"#F7F2E6"}),i.jsx("path",{d:"M99,77.6 L104.3,77.6 L103.8,81.7 L99.3,81.6 Z",fill:"#F7F2E6",opacity:"0.9"}),i.jsx("path",{d:"M107,77.7 L110.3,77.9 L109.7,81.5 L107.3,81.4 Z",fill:"#F7F2E6",opacity:"0.72"})]});case"L":return i.jsxs("g",{children:[i.jsx("path",{d:"M91,74 Q100,71.5 109,74 Q111,83 100,86.5 Q89,83 91,74 Z M96,76.5 Q100,78.5 104,76.5 Q103,81 100,82.5 Q97,81 96,76.5 Z",fill:s.ink,fillRule:"evenodd"}),i.jsx("rect",{x:"96.2",y:"77.2",width:"7.6",height:"3",rx:"1.5",fill:s.pupil}),i.jsx("rect",{x:"98",y:"77.9",width:"4",height:"1.6",rx:"0.8",fill:"#FFFFFF",opacity:"0.9"})]});case"FV":return i.jsxs("g",{children:[i.jsx("path",{d:"M93.5,77 Q100,74.6 106.5,77 Q107,82.6 100,83.4 Q93,82.6 93.5,77 Z",fill:s.ink}),i.jsx("path",{d:"M94,76.6 Q100,74.8 106,76.6 L105.4,79.6 Q100,80.6 94.6,79.6 Z",fill:"#3A342A"}),i.jsx("rect",{x:"95.5",y:"80.6",width:"9",height:"2.5",rx:"1.25",fill:s.pupil})]});default:return i.jsx("path",{d:"M91,78.8 Q100,85.6 109,78.4",fill:"none",stroke:s.ink,strokeWidth:"4.2",strokeLinecap:"round"})}}function Yy({uid:f,refs:s,expression:d,viseme:r,openScale:p,energyRatio:x,streakLit:T}){const U=tu(d);return i.jsxs(i.Fragment,{children:[i.jsxs("defs",{children:[i.jsx("clipPath",{id:`${f}-body`,children:i.jsx("rect",{x:"62",y:"110",width:"76",height:"50",rx:"10"})}),i.jsx("clipPath",{id:`${f}-helm`,children:i.jsx("path",{d:"M54,44 L100,30 L146,44 L150,72 L142,96 L58,96 L50,72 Z"})}),i.jsx("clipPath",{id:`${f}-scr`,children:i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"5"})})]}),i.jsxs("g",{ref:s.bot,className:"cp-bot",children:[i.jsxs("g",{className:"cp-thrust",children:[i.jsx("ellipse",{cx:"100",cy:"177",rx:"11",ry:"8",fill:T?Ui:Fa,opacity:"0.4"}),i.jsx("ellipse",{cx:"100",cy:"176",rx:"7",ry:"5",fill:T?Ui:Fa})]}),i.jsx("path",{d:"M88,158 L112,158 L106,171 L94,171 Z",fill:Es,stroke:Hl,strokeWidth:"4",strokeLinejoin:"round"}),i.jsxs("g",{className:"cp-body",children:[i.jsxs("g",{clipPath:`url(#${f}-body)`,children:[i.jsx("rect",{x:"62",y:"110",width:"76",height:"50",rx:"10",fill:Li}),i.jsx("rect",{x:"62",y:"110",width:"76",height:"50",rx:"10",fill:Ti,transform:"translate(-4 -4)"})]}),i.jsx("rect",{x:"62",y:"110",width:"76",height:"50",rx:"10",fill:"none",stroke:Hl,strokeWidth:"5"}),i.jsx(Ml,{id:`${f}-body`,x:62,y:110,w:76,h:50,t:4,light:"rgba(255,255,255,0.5)",dark:"rgba(58,52,42,0.32)"}),i.jsx(qy,{energyRatio:x,streakLit:T})]}),i.jsxs("g",{ref:s.head,className:"cp-head",children:[i.jsxs("g",{className:"cp-antenna",children:[i.jsx("rect",{x:"38",y:"42",width:"5",height:"20",rx:"2.5",fill:Ti,stroke:Hl,strokeWidth:"3",transform:"rotate(14 40 52)"}),i.jsx("path",{d:"M41,56 Q43,62 40,66 Q37,62 39,56 Z",fill:T?Kn:Es,stroke:Hl,strokeWidth:"2.6",strokeLinejoin:"round",transform:"rotate(14 40 60)"}),T&&i.jsx("circle",{cx:"38",cy:"68",r:"3.4",fill:Kn,stroke:uh,strokeWidth:"2"})]}),i.jsx("rect",{x:"38",y:"58",width:"13",height:"26",rx:"3",fill:_i,stroke:Hl,strokeWidth:"4"}),i.jsx("path",{d:"M44.5,60 v22",stroke:Fa,strokeWidth:"2",strokeLinecap:"round"}),i.jsx("rect",{x:"149",y:"58",width:"13",height:"26",rx:"3",fill:_i,stroke:Hl,strokeWidth:"4"}),i.jsx("path",{d:"M155.5,60 v22",stroke:Fa,strokeWidth:"2",strokeLinecap:"round"}),i.jsxs("g",{clipPath:`url(#${f}-helm)`,children:[i.jsx("path",{d:"M54,44 L100,30 L146,44 L150,72 L142,96 L58,96 L50,72 Z",fill:Li}),i.jsx("path",{d:"M54,44 L100,30 L146,44 L150,72 L142,96 L58,96 L50,72 Z",fill:Ti,transform:"translate(-4 -4)"}),i.jsx("path",{d:"M100,30 L100,44",stroke:Hl,strokeWidth:"2.6"})]}),i.jsx("path",{d:"M54,44 L100,30 L146,44 L150,72 L142,96 L58,96 L50,72 Z",fill:"none",stroke:Hl,strokeWidth:"5",strokeLinejoin:"round"}),i.jsx(Ml,{id:`${f}-helm`,x:50,y:30,w:100,h:66,t:4,light:"rgba(255,255,255,0.46)",dark:"rgba(58,52,42,0.3)"}),i.jsx("path",{d:"M62,38 Q90,32 104,36 L98,44 Q74,42 62,46 Z",fill:Kn,opacity:"0.85"}),i.jsx("path",{d:"M112,36 L124,38 L118,45 L108,44 Z",fill:Kn,opacity:"0.45"}),i.jsx("rect",{x:"58",y:"48",width:"84",height:"46",rx:"8",fill:_i,stroke:Hl,strokeWidth:"4.5"}),i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",rx:"5",fill:Qy}),i.jsxs("g",{clipPath:`url(#${f}-scr)`,children:[i.jsx("rect",{x:"64",y:"54",width:"72",height:"34",fill:Fa,transform:"translate(0 15)"}),i.jsx("path",{d:"M70,56 v30 M78,56 v30 M122,56 v30 M130,56 v30",stroke:Fa,strokeWidth:"1.2",opacity:"0.7"}),i.jsx("path",{d:"M118,54 L136,54 L108,88 L92,88 Z",fill:"#FFFFFF",opacity:"0.22"})]}),i.jsxs("g",{className:"cp-scr-face",clipPath:`url(#${f}-scr)`,children:[i.jsx(lu,{expression:d,flags:U,refs:s,p:xs,viseme:r,openScale:p,renderMouth:ky}),i.jsx(eu,{flags:U,refs:s,p:xs})]})]}),U.proud&&i.jsx(au,{p:xs}),i.jsx(nu,{refs:s,armFill:Li,out:Hl})]})]})}const Gy={ember:Ty,frost:Ny,moss:Ry,astro:Fy,ink:Yy};function Hm({form:f,expression:s,pose:d,viseme:r="closed",openScale:p=0,energyRatio:x=0,streakLit:T=!1,size:U=96,interactive:D=!1,ariaLabel:M,testid:Z,onPoke:O,onGrab:Y,keySeq:jt=0,keyFlash:Et=!1,keySide:dt=1,screenKey:gt=null,coreLit:pt=!1,noteTick:Lt=!1,crownBadge:Ut=!1,haloBadge:Bt=!1}){const it="cp"+bl.useId().replace(/[^a-zA-Z0-9]/g,""),k=Ey(),Mt=Ts(f),At={bot:bl.useRef(null),head:bl.useRef(null),armL:bl.useRef(null),armR:bl.useRef(null),eyes:bl.useRef(null),pupils:bl.useRef(null),waves:bl.useRef(null)},ce=At.bot;bl.useEffect(()=>{if(k||jt<=0)return;const yt=dt===-1?At.armL.current:At.armR.current,_t=dt===-1?-44:44;yt==null||yt.animate([{transform:"rotate(0deg)"},{transform:`rotate(${_t}deg)`,offset:.38},{transform:"rotate(0deg)"}],{duration:185,easing:"cubic-bezier(0.2, 1.5, 0.4, 1)",composite:"add"});const xt=At.bot.current;xt&&(xt.style.transformBox="fill-box",xt.style.transformOrigin="50% 62%",xt.animate([{transform:"translateY(0px) scale(1, 1)"},{transform:"translateY(2.5px) scale(1.045, 0.93)",offset:.42},{transform:"translateY(0px) scale(1, 1)"}],{duration:185,easing:"ease-out",composite:"add"}))},[jt,dt,k]);const el=s==="listening";bl.useEffect(()=>{if(!el||k)return;let yt=0;const _t=()=>{const xt=vy(),E=At.waves.current;E&&(E.style.opacity=xt<=0?"0":"1",E.setAttribute("transform",`translate(174 72) scale(${(.55+.45*xt).toFixed(3)}) translate(-174 -72)`)),yt=requestAnimationFrame(_t)};return yt=requestAnimationFrame(_t),()=>cancelAnimationFrame(yt)},[el,k]),bl.useEffect(()=>{if(k)return;let yt=0,_t,xt={x:0,y:0},E={x:0,y:0},C=performance.now(),F=1,et=performance.now()+4200;const nt=()=>{const N=At.eyes.current;N&&(N.style.transform="scaleY(0.14)",setTimeout(()=>{N&&(N.style.transform="")},120)),_t=setTimeout(nt,2400+Math.random()*2600)};_t=setTimeout(nt,1500+Math.random()*1500);const m=N=>{const w=ce.current;if(!w)return;const Q=w.getBoundingClientRect();E=cy(N.clientX,N.clientY,Q.left+Q.width/2,Q.top+Q.height*.35,Math.max(140,Q.width)),C=performance.now()};window.addEventListener("pointermove",m,{passive:!0});const _=()=>{var Q;const N=performance.now();N-C>4e3&&N>=et&&(E=fy(F++),et=N+2200+F%3*450),xt={x:X1(xt.x,E.x,.1),y:X1(xt.y,E.y,.1)};const w=zs(xt.x,xt.y);(Q=At.pupils.current)==null||Q.setAttribute("transform",`translate(${(w.x*5).toFixed(2)} ${(w.y*3).toFixed(2)})`),yt=requestAnimationFrame(_)};return yt=requestAnimationFrame(_),()=>{clearTimeout(_t),cancelAnimationFrame(yt),window.removeEventListener("pointermove",m)}},[k]);const Wt=Gy[Mt];return i.jsxs("svg",{viewBox:"0 0 200 200",className:`cp-mascot cp-form-${Mt} cp-pose-${d} cp-expr-${s}`,"data-testid":Z,"data-form":Mt,style:{width:U,height:U,transition:"width 0.9s cubic-bezier(0.3, 1.3, 0.4, 1), height 0.9s cubic-bezier(0.3, 1.3, 0.4, 1)",...D?{touchAction:"none",cursor:Y?"grab":"pointer"}:{}},...D?{role:"button","aria-label":M,onClick:O,...Y?{onPointerDown:yt=>{yt.button===0&&Y(yt.clientX,yt.clientY)}}:{}}:{"aria-hidden":!0},children:[i.jsx("defs",{children:i.jsx("clipPath",{id:`${it}-keyclip`,children:i.jsx("circle",{cx:"100",cy:"135",r:"11.6"})})}),i.jsxs("g",{className:"cp-beacons","aria-hidden":"true",children:[i.jsx("circle",{cx:"52",cy:"86",r:"3",className:"cp-beacon-l"}),i.jsx("circle",{cx:"148",cy:"86",r:"3",className:"cp-beacon-r"})]}),i.jsxs("g",{className:"cp-thruster","aria-hidden":"true",children:[i.jsx("circle",{cx:"100",cy:"187",r:"5.2"}),i.jsx("circle",{cx:"91.5",cy:"198",r:"3.8"}),i.jsx("circle",{cx:"108.5",cy:"196.5",r:"3"})]}),Bt&&i.jsx("ellipse",{cx:"100",cy:"104",rx:"86",ry:"60",fill:"none",stroke:"#FFC800",strokeWidth:"2.5",opacity:"0.4",strokeDasharray:"10 7",className:"cp-halo"}),i.jsx(Wt,{uid:it,refs:At,expression:s,viseme:r,openScale:p,energyRatio:x,streakLit:T}),pt&&i.jsx("circle",{cx:"100",cy:"135",r:"21",fill:"none",stroke:"#FFC800",strokeWidth:"3",className:"cp-core-lit","aria-hidden":"true"}),gt&&i.jsxs("g",{"aria-hidden":"true",children:[i.jsx("g",{className:"cp-key-scope",clipPath:`url(#${it}-keyclip)`,children:K2(jt).map((yt,_t)=>i.jsx("rect",{x:86.8+_t*4.4,y:140-yt.h,width:"2.6",height:yt.h,rx:"1.1",className:"cp-scope-bar",style:{animationDelay:`${yt.d}ms`}},_t))}),i.jsx("text",{x:"100",y:"140",textAnchor:"middle",className:`cp-screen-key${Et?" cp-screen-key-flash":""}`,children:gt===" "?"␣":gt.toUpperCase()})]},`k${jt}`),el&&!gt&&i.jsxs("g",{className:"cp-screen-wave","aria-hidden":"true",children:[i.jsx("rect",{x:"88.6",y:"130",width:"3.2",height:"10",rx:"1.6"}),i.jsx("rect",{x:"93.6",y:"127",width:"3.2",height:"16",rx:"1.6"}),i.jsx("rect",{x:"98.6",y:"125",width:"3.2",height:"20",rx:"1.6"}),i.jsx("rect",{x:"103.6",y:"127",width:"3.2",height:"16",rx:"1.6"}),i.jsx("rect",{x:"108.6",y:"130",width:"3.2",height:"10",rx:"1.6"})]}),d==="writing"&&i.jsxs("g",{className:"cp-writing","aria-hidden":"true",children:[i.jsxs("g",{transform:"rotate(-8 100 150)",children:[i.jsx("path",{d:"M78,140 L99,145 L99,166 L78,161 Z",fill:"#F7F3E8",stroke:"#2B2530",strokeWidth:"3",strokeLinejoin:"round"}),i.jsx("path",{d:"M120,140 L99,145 L99,166 L120,161 Z",fill:"#EFE8D8",stroke:"#2B2530",strokeWidth:"3",strokeLinejoin:"round"}),i.jsx("path",{d:"M83,146 L95,149 M83,151 L95,154 M83,156 L95,159",stroke:"#9AA7B8",strokeWidth:"1.6",strokeLinecap:"round"}),i.jsx("path",{d:"M115,146 L103,149 M115,151 L103,154",stroke:"#9AA7B8",strokeWidth:"1.6",strokeLinecap:"round"})]}),Lt&&i.jsx("path",{className:"cp-note-tick",d:"M104,146 L108,152 L117,141",fill:"none",stroke:"#FFC800",strokeWidth:"4.5",strokeLinecap:"round",strokeLinejoin:"round"}),i.jsxs("g",{className:"cp-pen",transform:"rotate(24 100 128)",children:[i.jsx("rect",{x:"96",y:"106",width:"7",height:"26",rx:"2.5",fill:"#FFC568",stroke:"#2B2530",strokeWidth:"2.6"}),i.jsx("path",{d:"M96,132 L103,132 L99.5,141 Z",fill:"#F7F3E8",stroke:"#2B2530",strokeWidth:"2",strokeLinejoin:"round"}),i.jsx("path",{d:"M98.4,138.5 L100.6,138.5 L99.5,141 Z",fill:"#173047"}),i.jsx("rect",{x:"95",y:"101",width:"9",height:"6",rx:"2",fill:"#E8563F",stroke:"#2B2530",strokeWidth:"2.4"})]})]}),Ut&&i.jsx("g",{className:"cp-crown-badge","aria-hidden":"true",children:i.jsx("path",{d:"M84,26 L92,36 L100,24 L108,36 L116,26 L114,44 L86,44 Z",fill:"#FFC800",stroke:"#E8A400",strokeWidth:"2",strokeLinejoin:"round"})})]})}export{nm as $,bm as A,ym as B,my as C,pm as D,gm as E,Y1 as F,Iy as G,$y as H,Dm as I,_m as J,hm as K,Lm as L,Hm as M,Nm as N,xm as O,cm as P,sm as Q,lm as R,tm as S,Sm as T,im as U,uy as V,fm as W,Um as X,wm as Y,Py as Z,em as _,Xy as a,am as a0,B2 as a1,Wy as a2,mm as a3,Tm as a4,Ky as a5,Vy as a6,ny as b,Jy as c,um as d,Z2 as e,Ts as f,I1 as g,Em as h,ly as i,i as j,rm as k,w2 as l,Om as m,Rm as n,Cm as o,jm as p,Mm as q,bl as r,om as s,Am as t,Ey as u,zm as v,iy as w,G1 as x,dm as y,vm as z};
|