@hona/openeval 0.5.0 → 0.5.1
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/README.md +2 -2
- package/VERIFICATION.md +6 -1
- package/package.json +1 -1
- package/src/app/input-fingerprints.ts +22 -18
- package/src/app/plan-benchmark.ts +17 -0
- package/src/app/retry-run.ts +4 -1
- package/viewer/assets/{abnfDiagram-VCTEODGH-tXaAmCdr.js → abnfDiagram-VCTEODGH-4dcAM__t.js} +1 -1
- package/viewer/assets/{angular-html-CNhJPCRr.js → angular-html-DCa1K9Q5.js} +1 -1
- package/viewer/assets/{angular-ts-BnGgGecY.js → angular-ts-BwOaP4mi.js} +1 -1
- package/viewer/assets/{apl-ZOvmk1hE.js → apl-BDVbqe8d.js} +1 -1
- package/viewer/assets/{arc-BalFY-0o.js → arc-vf_TPbdA.js} +1 -1
- package/viewer/assets/architecture-7GRP2DOG-ClUScBK0.js +1 -0
- package/viewer/assets/{architectureDiagram-5GKGNRK7-DpSDAEgb.js → architectureDiagram-5GKGNRK7-D9I5g97H.js} +1 -1
- package/viewer/assets/{astro-BJzTFZ3R.js → astro-C4AVO9I1.js} +1 -1
- package/viewer/assets/{blade-CvS8_w1j.js → blade-1K2d7b5P.js} +1 -1
- package/viewer/assets/{blockDiagram-I7D4REHJ-BY3upSR4.js → blockDiagram-I7D4REHJ-CnebaxAP.js} +1 -1
- package/viewer/assets/{c-D5ZSBtUG.js → c-CrFxx71c.js} +1 -1
- package/viewer/assets/{c4Diagram-7LVT6UL2-CA9keRc2.js → c4Diagram-7LVT6UL2-CZv4bp92.js} +1 -1
- package/viewer/assets/channel-DOp5Ibzq.js +1 -0
- package/viewer/assets/{chapel-1aYDxJri.js → chapel-CaV_aD0h.js} +1 -1
- package/viewer/assets/{chunk-4HAMMTFA-B0uITxv4.js → chunk-4HAMMTFA-1oAN0Hqj.js} +1 -1
- package/viewer/assets/{chunk-75Z2AOVW-CbTHx8Lz.js → chunk-75Z2AOVW-DG-4lG9j.js} +1 -1
- package/viewer/assets/{chunk-DU6HZSFF-C7mZpnch.js → chunk-DU6HZSFF-K8r4K98Q.js} +1 -1
- package/viewer/assets/{chunk-F27PBJKO-iUZG9l9x.js → chunk-F27PBJKO-DOLcDIe-.js} +1 -1
- package/viewer/assets/{chunk-GMAD6QVW-BYg8qa71.js → chunk-GMAD6QVW-fbOr8e3A.js} +1 -1
- package/viewer/assets/{chunk-GVQU2GXP-rnsdTI4Q.js → chunk-GVQU2GXP-DGskHf86.js} +1 -1
- package/viewer/assets/{chunk-IMKFNOWR-D0e2NIBw.js → chunk-IMKFNOWR-BkiL77Of.js} +1 -1
- package/viewer/assets/{chunk-L3NEJ4N5-Itlw7HBQ.js → chunk-L3NEJ4N5-rHC84FEy.js} +1 -1
- package/viewer/assets/{chunk-OSK3NFVY-DjAAQhPw.js → chunk-OSK3NFVY-CDEFeiSo.js} +1 -1
- package/viewer/assets/{chunk-P2QGCYS3-XOxrUS-o.js → chunk-P2QGCYS3-BHNuVs3t.js} +1 -1
- package/viewer/assets/{chunk-POPQ4Y6H-SHuwgciA.js → chunk-POPQ4Y6H-8IU6HL0N.js} +1 -1
- package/viewer/assets/{chunk-PWAF6VOD-BtrRW-Sl.js → chunk-PWAF6VOD--FR_J-_V.js} +1 -1
- package/viewer/assets/{chunk-SHT3W25Y-6Pacfssp.js → chunk-SHT3W25Y-DHfu0YQd.js} +1 -1
- package/viewer/assets/{chunk-SVP7TREG-eTVS9a20.js → chunk-SVP7TREG-CZxnTp0N.js} +1 -1
- package/viewer/assets/{chunk-TICWLB2K-CPnAfOZj.js → chunk-TICWLB2K-DeYv6m7z.js} +1 -1
- package/viewer/assets/{chunk-XXDRQBXY-ciXhM2Hb.js → chunk-XXDRQBXY-B-stp2Jg.js} +1 -1
- package/viewer/assets/classDiagram-ZZMXUADV-fi0_kah3.js +1 -0
- package/viewer/assets/classDiagram-v2-VYDZK3BY-fi0_kah3.js +1 -0
- package/viewer/assets/{cobol-CEoq_5kf.js → cobol-Dfqw6e9L.js} +1 -1
- package/viewer/assets/{coffee-CZTWsTxw.js → coffee-B0VyEiZ_.js} +1 -1
- package/viewer/assets/{cose-bilkent-JH36ORCC-NCkOcFkY.js → cose-bilkent-JH36ORCC-DwO-FoMO.js} +1 -1
- package/viewer/assets/{cpp-Hh-o0ivR.js → cpp-DtAnLTpm.js} +1 -1
- package/viewer/assets/{crystal-CL_KTsac.js → crystal-DR276aYT.js} +1 -1
- package/viewer/assets/{css-9neLgVLd.js → css-jcQdyKCB.js} +1 -1
- package/viewer/assets/{cynefin-OW5HDTMX-Ba1tlgBB.js → cynefin-OW5HDTMX-CkCcLfFW.js} +1 -1
- package/viewer/assets/{cynefinDiagram-5FMLGOSQ-CMrzWo3p.js → cynefinDiagram-5FMLGOSQ-Btlq2-ol.js} +1 -1
- package/viewer/assets/{dagre-GXQ25YYZ-DwjOnUDD.js → dagre-GXQ25YYZ-BtEJZ3id.js} +1 -1
- package/viewer/assets/{diagram-S7CK7UJ4-DA0PXsM6.js → diagram-S7CK7UJ4-BdLily-u.js} +1 -1
- package/viewer/assets/{diagram-UQ7AKVKN-C5BBFVvO.js → diagram-UQ7AKVKN-DBfD46yQ.js} +1 -1
- package/viewer/assets/{diagram-VSXAHHWV-COgLeOyi.js → diagram-VSXAHHWV-BJuAmu9T.js} +1 -1
- package/viewer/assets/{diagram-VX7I27RA-CEu-Pm3B.js → diagram-VX7I27RA-BVEEYjj-.js} +1 -1
- package/viewer/assets/{diagram-Z3DM3KII-BGq1_7BE.js → diagram-Z3DM3KII-DqYpuagj.js} +1 -1
- package/viewer/assets/{dist-CX8-lyNa.js → dist-B0PK9u1q.js} +1 -1
- package/viewer/assets/{ebnfDiagram-PWID7BFC-CGoEp9fJ.js → ebnfDiagram-PWID7BFC-DafUAY97.js} +1 -1
- package/viewer/assets/{edge-CTz4kCIs.js → edge-CMwzwqao.js} +1 -1
- package/viewer/assets/{elixir-Bi8YL7XX.js → elixir-D0m0fb5e.js} +1 -1
- package/viewer/assets/{elm-C-UxMmSh.js → elm-Dm3Vhwyo.js} +1 -1
- package/viewer/assets/{erDiagram-RLTQ6QDP-Bb0ICmqZ.js → erDiagram-RLTQ6QDP-BjTQFP-n.js} +1 -1
- package/viewer/assets/{erb-ZSq62Y_u.js → erb-BWrVRqIb.js} +1 -1
- package/viewer/assets/eventmodeling-NTZA5JFV-QswxRol8.js +1 -0
- package/viewer/assets/flowDiagram-HODETNUW-DolIsASs.js +1 -0
- package/viewer/assets/{ganttDiagram-EL5Y4UJY-B4KN9ny5.js → ganttDiagram-EL5Y4UJY-cvpUkVwQ.js} +1 -1
- package/viewer/assets/{git-rebase-Cw9GoTpw.js → git-rebase-Bx9WSw2T.js} +1 -1
- package/viewer/assets/{gitGraph-4MIJSDKK-CI3xWhLt.js → gitGraph-4MIJSDKK-YF9cEiQc.js} +1 -1
- package/viewer/assets/{gitGraphDiagram-WWUBYQGX-CPv8-MbI.js → gitGraphDiagram-WWUBYQGX-Cf7LUlAN.js} +1 -1
- package/viewer/assets/{glimmer-js-Bb_1emHy.js → glimmer-js-jJ5_T2M9.js} +1 -1
- package/viewer/assets/{glimmer-ts-D2kOXMB0.js → glimmer-ts-DqUZ7xnF.js} +1 -1
- package/viewer/assets/{glsl-DEqjHGFr.js → glsl-DHzsK5Yf.js} +1 -1
- package/viewer/assets/{graphql-Bi0OE4k4.js → graphql-TivQ3Vbm.js} +1 -1
- package/viewer/assets/{hack-aU4VRzRW.js → hack-CXzUKlVo.js} +1 -1
- package/viewer/assets/{haml-B-2wwgyn.js → haml-DB9hsLVR.js} +1 -1
- package/viewer/assets/{handlebars-Bmq7hbFI.js → handlebars-Dfxd-Vhz.js} +1 -1
- package/viewer/assets/{html-BBsNbpya.js → html-CwO_HZk6.js} +1 -1
- package/viewer/assets/{html-derivative-CkVRX-vn.js → html-derivative-Da9QhqUr.js} +1 -1
- package/viewer/assets/{http-cQ-nDL4L.js → http-DaNELgRt.js} +1 -1
- package/viewer/assets/{hurl-D5phPwZN.js → hurl-DCibLrD6.js} +1 -1
- package/viewer/assets/index-Cc4pf8mQ.js +795 -0
- package/viewer/assets/{index-DdaXmlLv.css → index-DVYWRkK6.css} +1 -1
- package/viewer/assets/{info-A6RAGUB7-CRDxOY87.js → info-A6RAGUB7-B7Ru1Oky.js} +1 -1
- package/viewer/assets/{infoDiagram-27XIBGKW-D6y32CfO.js → infoDiagram-27XIBGKW-RlWd2kYA.js} +1 -1
- package/viewer/assets/{ishikawaDiagram-5VMMS53U-BWFBTCh5.js → ishikawaDiagram-5VMMS53U-CS2-lnGi.js} +1 -1
- package/viewer/assets/{java-CT3DXSYV.js → java-D2z6ozlO.js} +1 -1
- package/viewer/assets/{javascript-BPmsAXaP.js → javascript-CxVsIZNi.js} +1 -1
- package/viewer/assets/{jinja-Ct_36dEc.js → jinja-BSUcBlS_.js} +1 -1
- package/viewer/assets/{jison-BYrmy85c.js → jison-qcnqXcSy.js} +1 -1
- package/viewer/assets/{journeyDiagram-3NMN7TZE-6XCObBEx.js → journeyDiagram-3NMN7TZE-DqPSRu4-.js} +1 -1
- package/viewer/assets/{json-BCFP8udh.js → json-eiyev3x0.js} +1 -1
- package/viewer/assets/{jsx-Dgzhn0Dq.js → jsx-rDHm7tH3.js} +1 -1
- package/viewer/assets/{julia-DIddcjVY.js → julia-cFfLusXt.js} +1 -1
- package/viewer/assets/{just-C5t963St.js → just-D6wClmab.js} +1 -1
- package/viewer/assets/{kanban-definition-UXKFOSKX-DU1B45HL.js → kanban-definition-UXKFOSKX-BI_a5cRc.js} +1 -1
- package/viewer/assets/{latex-BKZooW5w.js → latex-BvnFBRMG.js} +1 -1
- package/viewer/assets/{line-lYgs1iW7.js → line-ChPI9Rz5.js} +1 -1
- package/viewer/assets/{linear-sHqbNFGm.js → linear-CBr5H_et.js} +1 -1
- package/viewer/assets/{liquid-_PLVu-8C.js → liquid-CIOCL1uY.js} +1 -1
- package/viewer/assets/{lua-BWNAOGrF.js → lua-Dq6WuAHP.js} +1 -1
- package/viewer/assets/{marko-DC7qz2de.js → marko-Nl8_Nklj.js} +1 -1
- package/viewer/assets/{mdc-Bn_2wB99.js → mdc-obW39E44.js} +1 -1
- package/viewer/assets/{mermaid-parser.core-jzj7JZTj.js → mermaid-parser.core-BFOx64cQ.js} +3 -3
- package/viewer/assets/{mermaid.core-DpRyWAPv.js → mermaid.core-BDe6Tfbh.js} +4 -4
- package/viewer/assets/{mindmap-definition-YA3MSWOX-CIZjqKbE.js → mindmap-definition-YA3MSWOX-CjzA1VTL.js} +1 -1
- package/viewer/assets/{nginx-Ce7JLwNg.js → nginx-Czz1mxQD.js} +1 -1
- package/viewer/assets/{nim-CP_MVph6.js → nim-Boz13cJ3.js} +1 -1
- package/viewer/assets/{org-BVKft-Jg.js → org-BOlhXpYw.js} +1 -1
- package/viewer/assets/{packet-AYTQ26CC-BwRTCCV1.js → packet-AYTQ26CC-MMkKPhzF.js} +1 -1
- package/viewer/assets/{pegDiagram-XKGWAZYB-3nilNfrm.js → pegDiagram-XKGWAZYB-q1Rf8_Y9.js} +1 -1
- package/viewer/assets/{perl-DRhmHTw_.js → perl-BA7VmyiG.js} +1 -1
- package/viewer/assets/{php-CrnivzIK.js → php-dYlaksWx.js} +1 -1
- package/viewer/assets/{pie-WAS4IAKB-Dn0ztV-V.js → pie-WAS4IAKB-CLljEA6l.js} +1 -1
- package/viewer/assets/{pieDiagram-E7YTZNPT-BFj69QcO.js → pieDiagram-E7YTZNPT-DqzGIO9H.js} +1 -1
- package/viewer/assets/{pug-BfP-YwOD.js → pug-WDsqiRUK.js} +1 -1
- package/viewer/assets/{qml-BHf9C17M.js → qml-B5P0chYn.js} +1 -1
- package/viewer/assets/{quadrantDiagram-AXDQQJYC-2t5I-_4_.js → quadrantDiagram-AXDQQJYC-JV3sYNXt.js} +1 -1
- package/viewer/assets/{r-DjPtVJdp.js → r-DmZfBDub.js} +1 -1
- package/viewer/assets/{radar-RG4KPBEZ-D14Z-9c0.js → radar-RG4KPBEZ-DH4HiGh1.js} +1 -1
- package/viewer/assets/{railroad-74A4TZTK-BuxyK73P.js → railroad-74A4TZTK-BwJg41V9.js} +1 -1
- package/viewer/assets/railroad-abnf-HS5TGJTU-Byryy4k9.js +1 -0
- package/viewer/assets/railroad-ebnf-LZEXJU2U-BABBdJeJ.js +1 -0
- package/viewer/assets/railroad-peg-WCYAUIDC-C7YNbOxe.js +1 -0
- package/viewer/assets/{railroadDiagram-O6MQD6OU-Dm2mv6N0.js → railroadDiagram-O6MQD6OU-CrclSzRj.js} +1 -1
- package/viewer/assets/{razor-BH3XX51e.js → razor-BLQfBppW.js} +1 -1
- package/viewer/assets/{regexp-DPzTmgy2.js → regexp-CePe_vV5.js} +1 -1
- package/viewer/assets/{requirementDiagram-BXWQKSXE-BJTZ8ml9.js → requirementDiagram-BXWQKSXE-5QlkAVAN.js} +1 -1
- package/viewer/assets/{rst-DQbfRM9X.js → rst-D9pCulha.js} +1 -1
- package/viewer/assets/{ruby-DxybHg9D.js → ruby-r3EAH5Rz.js} +1 -1
- package/viewer/assets/{sankeyDiagram-P5KCCOFB-eBLIKN_A.js → sankeyDiagram-P5KCCOFB-BJzQ5vkn.js} +1 -1
- package/viewer/assets/{sas-DoUzRWOs.js → sas-Dxc2YEvn.js} +1 -1
- package/viewer/assets/{scss-BSqQF9Aq.js → scss-rZd3d-ZI.js} +1 -1
- package/viewer/assets/{sequenceDiagram-WJ2MYXX4-BxHxbxqV.js → sequenceDiagram-WJ2MYXX4--tS5gMY4.js} +1 -1
- package/viewer/assets/{shellscript-DkZJ1HjW.js → shellscript-B-b5xnkP.js} +1 -1
- package/viewer/assets/{shellsession-ykUTtcwM.js → shellsession-DlWXnhiW.js} +1 -1
- package/viewer/assets/{soy-4rmF0gor.js → soy-DXWgq6qD.js} +1 -1
- package/viewer/assets/{sql-wJX-vNm_.js → sql-5vPpIo1-.js} +1 -1
- package/viewer/assets/{src-IhQtBUXO.js → src-eDHFRM9C.js} +1 -1
- package/viewer/assets/{stata-Bjw5vh7C.js → stata-BPQLlmzg.js} +1 -1
- package/viewer/assets/{stateDiagram-D77RDMKH-DNPBpLlw.js → stateDiagram-D77RDMKH-xapk0kUZ.js} +1 -1
- package/viewer/assets/stateDiagram-v2-MP3YSRHH-Cb8zYuMi.js +1 -0
- package/viewer/assets/{surrealql-B-cZs35d.js → surrealql-CTEIAZfm.js} +1 -1
- package/viewer/assets/{svelte-BtYh0aTf.js → svelte-B6EVsDV1.js} +1 -1
- package/viewer/assets/{swimlanes-42K2YHIH-CnHbZ76W.js → swimlanes-42K2YHIH-BLyG_o3-.js} +1 -1
- package/viewer/assets/swimlanesDiagram-VR7AAH4N-RLMdNA3S.js +8 -0
- package/viewer/assets/{templ-eYWdvrUr.js → templ-Bu4quHqE.js} +1 -1
- package/viewer/assets/{tex-DQ-rt_Oj.js → tex-Dv_54fPG.js} +1 -1
- package/viewer/assets/{timeline-definition-24CTP7MA-vOTFZgf6.js → timeline-definition-24CTP7MA-DBaZM3qq.js} +1 -1
- package/viewer/assets/{treeView-Q6P3EWNA-CU_mSunf.js → treeView-Q6P3EWNA-C3zH0Rwt.js} +1 -1
- package/viewer/assets/{treemap-WGGIJYW6-BbLri-XL.js → treemap-WGGIJYW6-BTho8OjG.js} +1 -1
- package/viewer/assets/{ts-tags-CspMWJ3s.js → ts-tags-0DHV6Smm.js} +1 -1
- package/viewer/assets/{tsx-CXUmELmz.js → tsx-CmZ6PB1U.js} +1 -1
- package/viewer/assets/{twig-B0yioFX1.js → twig-u99yWuG6.js} +1 -1
- package/viewer/assets/{typescript-vMN-etbi.js → typescript-WF79ZIBQ.js} +1 -1
- package/viewer/assets/{typst-Cvk0bEbK.js → typst-DQ7XxvRZ.js} +1 -1
- package/viewer/assets/{vennDiagram-4TSXK5OY-PBkXHE6T.js → vennDiagram-4TSXK5OY-B5Cb69qm.js} +1 -1
- package/viewer/assets/{vue-Ce21QNcM.js → vue-DXac3mhj.js} +1 -1
- package/viewer/assets/{vue-html-DsNf3O2s.js → vue-html-FSSTYK94.js} +1 -1
- package/viewer/assets/{vue-vine-BsGtGXV3.js → vue-vine-BDF8epqI.js} +1 -1
- package/viewer/assets/{wardley-WFR3VGLG-kwPRtpGA.js → wardley-WFR3VGLG-DswcXSmz.js} +1 -1
- package/viewer/assets/{wardleyDiagram-VM6X3IG4-BacMGxmX.js → wardleyDiagram-VM6X3IG4-BPgNi0Kp.js} +1 -1
- package/viewer/assets/{xml-BmjAaPhA.js → xml-HI856iuk.js} +1 -1
- package/viewer/assets/{xsl-CtfA1v1E.js → xsl-Ck-aKGwi.js} +1 -1
- package/viewer/assets/{xychartDiagram-S5SC5T6Z-BDIbR1Lm.js → xychartDiagram-S5SC5T6Z-B8UAJr6c.js} +1 -1
- package/viewer/assets/{yaml-A9EbijaD.js → yaml-DrPyW5uV.js} +1 -1
- package/viewer/index.html +2 -2
- package/viewer/assets/architecture-7GRP2DOG-Dwn_SxkP.js +0 -1
- package/viewer/assets/channel-CgM1_6P7.js +0 -1
- package/viewer/assets/classDiagram-ZZMXUADV-BtFc7wo5.js +0 -1
- package/viewer/assets/classDiagram-v2-VYDZK3BY-BtFc7wo5.js +0 -1
- package/viewer/assets/eventmodeling-NTZA5JFV-BCWgnTvv.js +0 -1
- package/viewer/assets/flowDiagram-HODETNUW-B4hhZ1QN.js +0 -1
- package/viewer/assets/index-Dhnl4xDm.js +0 -795
- package/viewer/assets/railroad-abnf-HS5TGJTU-BM7gtNXd.js +0 -1
- package/viewer/assets/railroad-ebnf-LZEXJU2U-DPlBcoln.js +0 -1
- package/viewer/assets/railroad-peg-WCYAUIDC-B6tOGY79.js +0 -1
- package/viewer/assets/stateDiagram-v2-MP3YSRHH-sLT-i9tN.js +0 -1
- package/viewer/assets/swimlanesDiagram-VR7AAH4N-DIpLefsN.js +0 -8
|
@@ -0,0 +1,795 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DCa1K9Q5.js","assets/html-CwO_HZk6.js","assets/javascript-CxVsIZNi.js","assets/css-jcQdyKCB.js","assets/angular-ts-BwOaP4mi.js","assets/scss-rZd3d-ZI.js","assets/apl-BDVbqe8d.js","assets/xml-HI856iuk.js","assets/java-D2z6ozlO.js","assets/json-eiyev3x0.js","assets/astro-C4AVO9I1.js","assets/typescript-WF79ZIBQ.js","assets/postcss-BXeXVLqQ.js","assets/tsx-CmZ6PB1U.js","assets/blade-1K2d7b5P.js","assets/html-derivative-Da9QhqUr.js","assets/sql-5vPpIo1-.js","assets/bsl-_VjlB9mv.js","assets/sdbl-bTVj8UrX.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/chapel-CaV_aD0h.js","assets/c-CrFxx71c.js","assets/cobol-Dfqw6e9L.js","assets/coffee-B0VyEiZ_.js","assets/cpp-DtAnLTpm.js","assets/regexp-CePe_vV5.js","assets/glsl-DHzsK5Yf.js","assets/crystal-DR276aYT.js","assets/shellscript-B-b5xnkP.js","assets/edge-CMwzwqao.js","assets/elixir-D0m0fb5e.js","assets/elm-Dm3Vhwyo.js","assets/erb-BWrVRqIb.js","assets/ruby-r3EAH5Rz.js","assets/haml-DB9hsLVR.js","assets/graphql-TivQ3Vbm.js","assets/jsx-rDHm7tH3.js","assets/lua-Dq6WuAHP.js","assets/yaml-DrPyW5uV.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-xMC7jr7x.js","assets/gdshader-CBce3t8t.js","assets/gdscript-DYvRD3hg.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-Bx9WSw2T.js","assets/glimmer-js-jJ5_T2M9.js","assets/glimmer-ts-DqUZ7xnF.js","assets/hack-CXzUKlVo.js","assets/handlebars-Dfxd-Vhz.js","assets/http-DaNELgRt.js","assets/hurl-DCibLrD6.js","assets/csv-Dx-8-gkx.js","assets/hxml-Dcm88srW.js","assets/haxe-C8oCnwJJ.js","assets/jinja-BSUcBlS_.js","assets/jison-qcnqXcSy.js","assets/julia-cFfLusXt.js","assets/r-DmZfBDub.js","assets/just-D6wClmab.js","assets/perl-BA7VmyiG.js","assets/latex-BvnFBRMG.js","assets/tex-Dv_54fPG.js","assets/liquid-CIOCL1uY.js","assets/marko-Nl8_Nklj.js","assets/less-DVTAwKKz.js","assets/mdc-obW39E44.js","assets/nextflow-BJtWHP5T.js","assets/nextflow-groovy-DJMQeKeT.js","assets/nginx-Czz1mxQD.js","assets/nim-Boz13cJ3.js","assets/org-BOlhXpYw.js","assets/clojure-DqKBuwfJ.js","assets/csharp-oqKa8noW.js","assets/dart-CnvKMtbv.js","assets/docker-IyjqRm3v.js","assets/go-rLFTqkRN.js","assets/groovy-CacY0gHj.js","assets/ini-B5eOa1yu.js","assets/make-Dixweg8N.js","assets/objective-c-D1A_Heim.js","assets/ocaml-O90oeIOV.js","assets/php-dYlaksWx.js","assets/vb-DOwzaHZ0.js","assets/raku-B3gFvitq.js","assets/rust-Cfkwpbl8.js","assets/scala-BiFt_7mu.js","assets/zig-CMLA9XwU.js","assets/xsl-Ck-aKGwi.js","assets/pug-WDsqiRUK.js","assets/qml-B5P0chYn.js","assets/razor-BLQfBppW.js","assets/rst-D9pCulha.js","assets/cmake-Bj61d0ZC.js","assets/sas-Dxc2YEvn.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-DlWXnhiW.js","assets/soy-DXWgq6qD.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-BPQLlmzg.js","assets/surrealql-CTEIAZfm.js","assets/svelte-B6EVsDV1.js","assets/templ-Bu4quHqE.js","assets/ts-tags-0DHV6Smm.js","assets/twig-u99yWuG6.js","assets/typst-DQ7XxvRZ.js","assets/bat-qdxAdBWQ.js","assets/bibtex-Ci_nEsc7.js","assets/jsonc-CYpm1nAK.js","assets/log-BNLmms1o.js","assets/powershell-CCSX75yM.js","assets/swift-CyEgAFGc.js","assets/system-verilog-Dh5ihWbf.js","assets/verilog-B2gwz-sJ.js","assets/vue-DXac3mhj.js","assets/vue-html-FSSTYK94.js","assets/vue-vine-BDF8epqI.js","assets/stylus-B6D30XZt.js","assets/mermaid.core-BDe6Tfbh.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-eDHFRM9C.js","assets/chunk-DU6HZSFF-K8r4K98Q.js","assets/chunk-75Z2AOVW-DG-4lG9j.js","assets/dist-B0PK9u1q.js","assets/chunk-PWAF6VOD--FR_J-_V.js","assets/chunk-GMAD6QVW-fbOr8e3A.js","assets/chunk-P2QGCYS3-BHNuVs3t.js","assets/chunk-4HAMMTFA-1oAN0Hqj.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-GVQU2GXP-DGskHf86.js","assets/chunk-OSK3NFVY-CDEFeiSo.js","assets/line-ChPI9Rz5.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/graphlib-DS17s2tU.js","assets/chunk-L3NEJ4N5-rHC84FEy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return d(this.context.count)},getNextContextId(){return d(this.context.count++)}};function d(e){let t=String(e),n=t.length-1;return u.context.id+(n?String.fromCharCode(96+n):``)+t}function f(e){u.context=e}var p=(e,t)=>e===t,m=Symbol(`solid-proxy`),h=typeof Proxy==`function`,g=Symbol(`solid-track`),_={equals:p},v=null,y=we,b=1,x=2,S={owned:null,cleanups:null,context:null,owner:null},C={},w=null,T=null,E=null,D=null,O=null,k=0;function ee(e,t){let n=E,r=w,i=e.length===0,a=t===void 0?r:t,o=i?S:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>ae(()=>Oe(o)));w=o,E=null;try{return Se(s,!0)}finally{E=n,w=r}}function A(e,t){t=t?Object.assign({},_,t):_;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[ge.bind(n),e=>(typeof e==`function`&&(e=T&&T.running&&T.sources.has(n)?e(n.tValue):e(n.value)),_e(n,e))]}function te(e,t,n){ve(be(e,t,!0,b))}function j(e,t,n){ve(be(e,t,!1,b))}function M(e,t,n){y=Te;let r=be(e,t,!1,b),i=he&&L(he);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),O?O.push(r):ve(r)}function N(e,t,n){n=n?Object.assign({},_,n):_;let r=be(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ve(r),ge.bind(r)}function ne(e){return e&&typeof e==`object`&&`then`in e}function re(e,t,n){let r,i,a;typeof t==`function`?(r=e,i=t,a=n||{}):(r=!0,i=e,a=t||{});let o=null,s=C,c=null,l=!1,d=!1,f=`initialValue`in a,p=typeof r==`function`&&N(r),m=new Set,[h,g]=(a.storage||A)(a.initialValue),[_,v]=A(void 0),[y,b]=A(void 0,{equals:!1}),[x,S]=A(f?`ready`:`unresolved`);w&&P(()=>{for(let e of m.keys())e.decrement();m.clear(),T&&o&&T.promises.delete(o),o=null}),u.context&&(c=u.getNextContextId(),a.ssrLoadFrom===`initial`?s=a.initialValue:u.load&&u.has(c)&&(s=u.load(c)));function D(e,t,n,r){return o===e&&(o=null,r!==void 0&&(f=!0),(e===s||t===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(r,{value:t})),s=C,T&&e&&l?(T.promises.delete(e),l=!1,Se(()=>{T.running=!0,O(t,n)},!1)):O(t,n)),t}function O(e,t){Se(()=>{t===void 0&&g(()=>e),S(t===void 0?f?`ready`:`unresolved`:`errored`),v(t);for(let e of m.keys())e.decrement();m.clear()},!1)}function k(){let e=he&&L(he),t=h(),n=_();if(n!==void 0&&!o)throw n;return E&&!E.user&&e&&te(()=>{y(),o&&(e.resolved&&T&&l?T.promises.add(o):m.has(e)||(e.increment(),m.add(e)))}),t}function ee(e=!0){if(e!==!1&&d)return;d=!1;let t=p?p():r;if(l=T&&T.running,t==null||t===!1){D(o,ae(h));return}T&&o&&T.promises.delete(o);let n,a=s===C?ae(()=>{try{return i(t,{value:h(),refetching:e})}catch(e){n=e}}):s;if(n!==void 0){D(o,void 0,Ae(n),t);return}return ne(a)?(o=a,`v`in a?(a.s===1?D(o,a.v,void 0,t):D(o,void 0,Ae(a.v),t),a):(d=!0,queueMicrotask(()=>d=!1),Se(()=>{S(f?`refreshing`:`pending`),b()},!1),a.then(e=>D(a,e,void 0,t),e=>D(a,void 0,Ae(e),t)))):(D(o,a,void 0,t),a)}Object.defineProperties(k,{state:{get:()=>x()},error:{get:()=>_()},loading:{get(){let e=x();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return k();let e=_();if(e&&!o)throw e;return h()}}});let j=w;return p?te(()=>(j=w,ee(!1))):ee(!1),[k,{refetch:e=>de(j,()=>ee(e)),mutate:g}]}function ie(e){return Se(e,!1)}function ae(e){if(E===null)return e();let t=E;E=null;try{return e()}finally{E=t}}function oe(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=ae(()=>t(o,i,n));return i=o,s}}function se(e){M(()=>ae(e))}function P(e){return w===null||(w.cleanups===null?w.cleanups=[e]:w.cleanups.push(e)),e}function ce(e,t){v||=Symbol(`error`),w=be(void 0,void 0,!0),w.context={...w.context,[v]:[t]},T&&T.running&&T.sources.add(w);try{return e()}catch(e){Me(e)}finally{w=w.owner}}function le(){return E}function ue(){return w}function de(e,t){let n=w,r=E;w=e,E=null;try{return Se(t,!0)}catch(e){Me(e)}finally{w=n,E=r}}function fe(e){if(T&&T.running)return e(),T.done;let t=E,n=w;return Promise.resolve().then(()=>{E=t,w=n;let r;return he&&(r=T||={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0},r.done||(r.done=new Promise(e=>r.resolve=e)),r.running=!0),Se(e,!1),E=w=null,r?r.done:void 0})}var[pe,F]=A(!1);function I(e,t){let n=Symbol(`context`);return{id:n,Provider:Pe(n),defaultValue:e}}function L(e){let t;return w&&w.context&&(t=w.context[e.id])!==void 0?t:e.defaultValue}function me(e){let t=N(e),n=N(()=>Ne(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var he;function ge(){let e=T&&T.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===b)ve(this);else{let e=D;D=null,Se(()=>Ee(this),!1),D=e}}if(E){let e=this.observers;if(!e||e[e.length-1]!==E){let t=e?e.length:0;E.sources?(E.sources.push(this),E.sourceSlots.push(t)):(E.sources=[this],E.sourceSlots=[t]),e?(e.push(E),this.observerSlots.push(E.sources.length-1)):(this.observers=[E],this.observerSlots=[E.sources.length-1])}}return e&&T.sources.has(this)?this.tValue:this.value}function _e(e,t,n){let r=T&&T.running&&T.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(T){let r=T.running;(r||!n&&T.sources.has(e))&&(T.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&Se(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=T&&T.running;r&&T.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?D.push(n):O.push(n),n.observers&&De(n)),r?n.tState=b:n.state=b)}if(D.length>1e6)throw D=[],Error()},!1)}return t}function ve(e){if(!e.fn)return;Oe(e);let t=k;ye(e,T&&T.running&&T.sources.has(e)?e.tValue:e.value,t),T&&!T.running&&T.sources.has(e)&&queueMicrotask(()=>{Se(()=>{T&&(T.running=!0),E=w=e,ye(e,e.tValue,t),E=w=null},!1)})}function ye(e,t,n){let r,i=w,a=E;E=w=e;try{r=e.fn(t)}catch(t){return e.pure&&(T&&T.running?(e.tState=b,e.tOwned&&e.tOwned.forEach(Oe),e.tOwned=void 0):(e.state=b,e.owned&&e.owned.forEach(Oe),e.owned=null)),e.updatedAt=n+1,Me(t)}finally{E=a,w=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?_e(e,r,!0):T&&T.running&&e.pure?(T.sources.has(e)||(e.value=r),T.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function be(e,t,n,r=b,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:w,context:w?w.context:null,pure:n};return T&&T.running&&(a.state=0,a.tState=r),w===null||w!==S&&(T&&T.running&&w.pure?w.tOwned?w.tOwned.push(a):w.tOwned=[a]:w.owned?w.owned.push(a):w.owned=[a]),a}function xe(e){let t=T&&T.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===x)return Ee(e);if(e.suspense&&ae(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<k);){if(t&&T.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(T.disposed.has(t))return}if((t?e.tState:e.state)===b)ve(e);else if((t?e.tState:e.state)===x){let t=D;D=null,Se(()=>Ee(e,n[0]),!1),D=t}}}function Se(e,t){if(D)return e();let n=!1;t||(D=[]),O?n=!0:O=[],k++;try{let t=e();return Ce(n),t}catch(e){n||(O=null),D=null,Me(e)}}function Ce(e){if(D&&=(we(D),null),e)return;let t;if(T){if(!T.promises.size&&!T.queue.size){let e=T.sources,n=T.disposed;O.push.apply(O,T.effects),t=T.resolve;for(let e of O)`tState`in e&&(e.state=e.tState),delete e.tState;T=null,Se(()=>{for(let e of n)Oe(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)Oe(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}F(!1)},!1)}else if(T.running){T.running=!1,T.effects.push.apply(T.effects,O),O=null,F(!0);return}}let n=O;O=null,n.length&&Se(()=>y(n),!1),t&&t()}function we(e){for(let t=0;t<e.length;t++)xe(e[t])}function Te(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:xe(r)}if(u.context){if(u.count){u.effects||=[],u.effects.push(...e.slice(0,n));return}f()}for(u.effects&&(u.done||!u.count)&&(e=[...u.effects,...e],n+=u.effects.length,delete u.effects),t=0;t<n;t++)xe(e[t])}function Ee(e,t){let n=T&&T.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===b?i!==t&&(!i.updatedAt||i.updatedAt<k)&&xe(i):e===x&&Ee(i,t)}}}function De(e){let t=T&&T.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=x:r.state=x,r.pure?D.push(r):O.push(r),r.observers&&De(r))}}function Oe(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Oe(e.tOwned[t]);delete e.tOwned}if(T&&T.running&&e.pure)ke(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Oe(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}T&&T.running?e.tState=0:e.state=0}function ke(e,t){if(t||(e.tState=0,T.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)ke(e.owned[t])}function Ae(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function je(e,t,n){try{for(let n of t)n(e)}catch(e){Me(e,n&&n.owner||null)}}function Me(e,t=w){let n=v&&t&&t.context&&t.context[v],r=Ae(e);if(!n)throw r;O?O.push({fn(){je(r,n,t)},state:b}):je(r,n,t)}function Ne(e){if(typeof e==`function`&&!e.length)return Ne(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=Ne(e[n]);if(Array.isArray(r)){if(r.length<32768)t.push.apply(t,r);else for(let e=0;e<r.length;e++)t.push(r[e])}else t.push(r)}return t}return e}function Pe(e,t){return function(t){let n;return j(()=>n=ae(()=>(w.context={...w.context,[e]:t.value},me(()=>t.children))),void 0),n}}var Fe=Symbol(`fallback`);function Ie(e){for(let t=0;t<e.length;t++)e[t]()}function Le(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return P(()=>Ie(a)),()=>{let c=e()||[],l=c.length,u,d;return c[g],ae(()=>{let e,t,p,m,h,g,_,v,y;if(l===0)o!==0&&(Ie(a),a=[],r=[],i=[],o=0,s&&=[]),n.fallback&&(r=[Fe],i[0]=ee(e=>(a[0]=e,n.fallback())),o=1);else if(o===0){for(i=Array(l),d=0;d<l;d++)r[d]=c[d],i[d]=ee(f);o=l}else{for(p=Array(l),m=Array(l),s&&(h=Array(l)),g=0,_=Math.min(o,l);g<_&&r[g]===c[g];g++);for(_=o-1,v=l-1;_>=g&&v>=g&&r[_]===c[v];_--,v--)p[v]=i[_],m[v]=a[_],s&&(h[v]=s[_]);for(e=new Map,t=Array(v+1),d=v;d>=g;d--)y=c[d],u=e.get(y),t[d]=u===void 0?-1:u,e.set(y,d);for(u=g;u<=_;u++)y=r[u],d=e.get(y),d!==void 0&&d!==-1?(p[d]=i[u],m[d]=a[u],s&&(h[d]=s[u]),d=t[d],e.set(y,d)):a[u]();for(d=g;d<l;d++)d in p?(i[d]=p[d],a[d]=m[d],s&&(s[d]=h[d],s[d](d))):i[d]=ee(f);i=i.slice(0,o=l),r=c.slice(0)}return i});function f(e){if(a[d]=e,s){let[e,n]=A(d);return s[d]=n,t(c[d],e)}return t(c[d])}}}function Re(e,t,n={}){let r=[],i=[],a=[],o=[],s=0,c;return P(()=>Ie(a)),()=>{let l=e()||[],u=l.length;return l[g],ae(()=>{if(u===0)return s!==0&&(Ie(a),a=[],r=[],i=[],s=0,o=[]),n.fallback&&(r=[Fe],i[0]=ee(e=>(a[0]=e,n.fallback())),s=1),i;for(r[0]===Fe&&(a[0](),a=[],r=[],i=[],s=0),c=0;c<u;c++)c<r.length&&r[c]!==l[c]?o[c](()=>l[c]):c>=r.length&&(i[c]=ee(d));for(;c<r.length;c++)a[c]();return s=o.length=a.length=u,r=l.slice(0),i=i.slice(0,s)});function d(e){a[c]=e;let[n,r]=A(l[c]);return o[c]=r,t(n,c)}}}function R(e,t){return ae(()=>e(t||{}))}function ze(){return!0}var Be={get(e,t,n){return t===m?n:e.get(t)},has(e,t){return t===m||e.has(t)},set:ze,deleteProperty:ze,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:ze,deleteProperty:ze}},ownKeys(e){return e.keys()}};function Ve(e){return(e=typeof e==`function`?e():e)?e:{}}function He(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function z(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&m in r,e[n]=typeof r==`function`?(t=!0,N(r)):r}if(h&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=Ve(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in Ve(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(Ve(e[n])));return[...new Set(t)]}},Be);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:He.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let i={},a=Object.keys(r);for(let e=a.length-1;e>=0;e--){let t=a[e],n=r[t];n&&n.get?Object.defineProperty(i,t,n):i[t]=n?n.value:void 0}return i}function B(e,...t){let n=t.length;if(h&&m in e){let r=n>1?t.flat():t[0],i=new Set,a=t.map(t=>{let n=t.filter(e=>!i.has(e)&&(i.add(e),!0));return new Proxy({get(t){return n.includes(t)?e[t]:void 0},has(t){return n.includes(t)&&t in e},keys(){return n.filter(t=>t in e)}},Be)});return a.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Be)),a}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}var Ue=0;function We(){return u.context?u.getNextContextId():`cl-${Ue++}`}var Ge=e=>`Stale read from <${e}>.`;function V(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return N(Le(()=>e.each,e.children,t||void 0))}function Ke(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return N(Re(()=>e.each,e.children,t||void 0))}function H(e){let t=e.keyed,n=N(()=>e.when,void 0,void 0),r=t?n:N(n,void 0,{equals:(e,t)=>!e==!t});return N(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?ae(()=>a(t?i:()=>{if(!ae(r))throw Ge(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function qe(e){let t=me(()=>e.children),n=N(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=N(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:N(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return N(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?ae(()=>o(a.keyed?i():()=>{if(ae(n)()?.[0]!==r)throw Ge(`Match`);return i()})):o},void 0,void 0)}function Je(e){return e}var Ye;function Xe(e){let t;u.context&&u.load&&(t=u.load(u.getContextId()));let[n,r]=A(t,void 0);return Ye||=new Set,Ye.add(r),P(()=>Ye.delete(r)),N(()=>{let t;if(t=n()){let n=e.fallback;return typeof n==`function`&&n.length?ae(()=>n(t,()=>r())):n}return ce(()=>e.children,r)},void 0,void 0)}var Ze=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),Qe=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),$e=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),et=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function tt(e,t){let n=et[e];return typeof n==`object`?n[t]?n.$:void 0:n}var nt=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),rt=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),it={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},U=e=>N(()=>e());function at(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var ot=`_$DX_DELEGATE`;function st(e,t,n,r={}){let i;return ee(r=>{i=r,t===document?e():K(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function W(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>ae(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function ct(e,t=window.document){let n=t[ot]||(t[ot]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,wt))}}function G(e,t,n){bt(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function lt(e,t,n,r){bt(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function ut(e,t,n){bt(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function dt(e,t){bt(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function ft(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function pt(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];r&&r!==`undefined`&&!t[r]&&(St(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];i&&i!==`undefined`&&n[i]!==o&&o&&(St(e,i,!0),n[i]=o)}return n}function mt(e,t,n){if(!t)return n?G(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function ht(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function gt(e,t={},n,r){let i={};return r||j(()=>i.children=Tt(e,t.children,i.children)),j(()=>typeof t.ref==`function`&&_t(t.ref,e)),j(()=>vt(e,t,n,!0,i,!0)),i}function _t(e,t,n){return ae(()=>e(t,n))}function K(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Tt(e,t,r,n);j(r=>Tt(e,t(),r,n),r)}function vt(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=Ct(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||Tt(e,t.children);continue}let s=t[o];i[o]=Ct(e,o,s,i[o],n,a,t)}}function yt(e){let t,n;return!bt()||!(t=u.registry.get(n=kt()))?e():(u.completed&&u.completed.add(t),u.registry.delete(n),t)}function bt(e){return!!u.context&&!u.done&&(!e||e.isConnected)}function xt(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function St(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function Ct(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return mt(e,n,r);if(t===`classList`)return pt(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=nt.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(ft(e,i,n,a),a&&ct([i]))}else if(t.slice(0,5)===`attr:`)G(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)ut(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=Qe.has(t))||!i&&((u=tt(t,e.tagName))||(c=Ze.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(bt(e))return n;t===`class`||t===`className`?dt(e,n):s&&!c&&!l?e[xt(t)]=n:(t===`value`||t===`defaultValue`)&&(e.nodeName===`INPUT`||e.nodeName===`TEXTAREA`)?e[u||t]=n??``:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&it[t.split(`:`)[0]];r?lt(e,r,t,n):G(e,$e[t]||t,n)}return n}function wt(e){if(u.registry&&u.events&&u.events.find(([t,n])=>n===e))return;let t=e.target,n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=t=>Object.defineProperty(e,"target",{configurable:!0,value:t}),o=()=>{let r=t[n];if(r&&!t.disabled){let i=t[`${n}Data`];if(i===void 0?r.call(t,e):r.call(t,i,e),e.cancelBubble)return}return t.host&&typeof t.host!=`string`&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),u.registry&&!u.done&&(u.done=_$HY.done=!0),e.composedPath){let n=e.composedPath();a(n[0]);for(let e=0;e<n.length-2&&(t=n[e],o());e++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function Tt(e,t,n,r,i){let a=bt(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Ot(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Ot(e,n,r)}else if(o===`function`)return j(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Tt(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(Et(o,t,n,i))return j(()=>n=Tt(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Ot(e,n,r),s)return n}else c?n.length===0?Dt(e,o,r):at(e,n,o):(n&&Ot(e),Dt(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Ot(e,n,r,t);Ot(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function Et(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=Et(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=Et(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function Dt(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Ot(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function kt(){return u.getNextContextId()}var At=`http://www.w3.org/2000/svg`;function jt(e,t=!1,n=void 0){return t?document.createElementNS(At,e):document.createElement(e,{is:n})}function Mt(e){let{useShadow:t}=e,n=document.createTextNode(``),r=()=>e.mount||document.body,i=ue(),a,o=!!u.context;return M(()=>{o&&(ue().user=o=!1),a||=de(i,()=>N(()=>e.children));let s=r();if(s instanceof HTMLHeadElement){let[e,t]=A(!1);ee(t=>K(s,()=>e()?t():a(),null)),P(()=>t(!0))}else{let r=jt(e.isSVG?`g`:`div`,e.isSVG),i=t&&r.attachShadow?r.attachShadow({mode:`open`}):r;Object.defineProperty(r,"_$host",{get(){return n.parentNode},configurable:!0}),K(i,a),s.appendChild(r),e.ref&&e.ref(r),P(()=>s.contains(r)&&s.removeChild(r))}},void 0,{render:!o}),n}function Nt(e,t){let n=N(e);return N(()=>{let e=n();switch(typeof e){case`function`:return ae(()=>e(t));case`string`:let n=rt.has(e),r=u.context?yt():jt(e,n,ae(()=>t.is));return gt(r,t,n),r}})}function Pt(e){let[,t]=B(e,[`component`]);return Nt(()=>e.component,t)}var Ft=Symbol(`store-raw`),It=Symbol(`store-node`),Lt=Symbol(`store-has`),Rt=Symbol(`store-self`);function zt(e){let t=e[m];if(!t&&(Object.defineProperty(e,m,{value:t=new Proxy(e,qt)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),i=Object.getPrototypeOf(e),a=i!==null&&typeof e==`object`&&!!e&&!Array.isArray(e)&&i!==Object.prototype;if(a){let e=Object.getOwnPropertyDescriptors(i);n.push(...Object.keys(e)),Object.assign(r,e)}for(let i=0,o=n.length;i<o;i++){let o=n[i];a&&o===`constructor`||r[o].get&&Object.defineProperty(e,o,{configurable:!0,enumerable:r[o].enumerable,get:r[o].get.bind(t)})}}return t}function Bt(e){let t;return typeof e==`object`&&!!e&&(e[m]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function Vt(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[Ft])return n;if(!Bt(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=Vt(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=Vt(i,t))!==i&&(e[a]=r))}return e}function Ht(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Ut(e,t,n){if(e[t])return e[t];let[r,i]=A(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function Wt(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===m||t===It?n:(delete n.value,delete n.writable,n.get=()=>e[m][t],n)}function Gt(e){le()&&Ut(Ht(e,It),Rt)()}function Kt(e){return Gt(e),Reflect.ownKeys(e)}var qt={get(e,t,n){if(t===Ft)return e;if(t===m)return n;if(t===g)return Gt(e),n;let r=Ht(e,It),i=r[t],a=i?i():e[t];if(t===It||t===Lt||t===`__proto__`)return a;if(!i){let n=Object.getOwnPropertyDescriptor(e,t);le()&&(typeof a!=`function`||Object.prototype.hasOwnProperty.call(e,t))&&!(n&&n.get)&&(a=Ut(r,t,a)())}return Bt(a)?zt(a):a},has(e,t){return t===Ft||t===m||t===g||t===It||t===Lt||t===`__proto__`||(le()&&Ut(Ht(e,Lt),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:Kt,getOwnPropertyDescriptor:Wt};function Jt(e,t,n,r=!1){if(t===`__proto__`||!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[Lt]&&e[Lt][t]&&i!==void 0&&e[Lt][t].$()):(e[t]=n,e[Lt]&&e[Lt][t]&&i===void 0&&e[Lt][t].$());let o=Ht(e,It),s;if((s=Ut(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=Ut(o,`length`,a))&&s.$(e.length)}(s=o[Rt])&&s.$()}function Yt(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];Xt(i)||Jt(e,i,t[i])}}function Xt(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function Zt(e,t){if(typeof t==`function`&&(t=t(e)),t=Vt(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&Jt(e,n,r)}Jt(e,`length`,r)}else Yt(e,t)}function Qt(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(a===`string`&&(r===`__proto__`||t.length>1&&Xt(r)))return;if(Array.isArray(r)){for(let i=0;i<r.length;i++)Qt(e,[r[i]].concat(t),n);return}if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&Qt(e,[i].concat(t),n);return}if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)Qt(e,[r].concat(t),n);return}if(t.length>1){Qt(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||(r!==void 0||a!=null)&&(a=Vt(a),r===void 0||Bt(i)&&Bt(a)&&!Array.isArray(a)?Yt(i,a):Jt(e,r,a))}function $t(...[e,t]){let n=Vt(e||{}),r=Array.isArray(n),i=zt(n);function a(...e){ie(()=>{r&&e.length===1?Zt(n,e[0]):Qt(n,e)})}return[i,a]}var en=Symbol(`store-root`);function tn(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function nn(e,t,n,r,i){if(tn(n))return;let a=t[n];if(e===a)return;let o=Array.isArray(e);if(n!==en&&(!Bt(e)||!Bt(a)||o!==Array.isArray(a)||i&&e[i]!==a[i])){Jt(t,n,e);return}if(o){if(e.length&&a.length&&(!r||i&&e[0]&&e[0][i]!=null)){let t,n,o,s,c,l,u,d;for(o=0,s=Math.min(a.length,e.length);o<s&&(a[o]===e[o]||i&&a[o]&&e[o]&&a[o][i]&&a[o][i]===e[o][i]);o++)nn(e[o],a,o,r,i);let f=Array(e.length),p=new Map;for(s=a.length-1,c=e.length-1;s>=o&&c>=o&&(a[s]===e[c]||i&&a[s]&&e[c]&&a[s][i]&&a[s][i]===e[c][i]);s--,c--)f[c]=a[s];if(o>c||o>s){for(n=o;n<=c;n++)Jt(a,n,e[n]);for(;n<e.length;n++)Jt(a,n,f[n]),nn(e[n],a,n,r,i);a.length>e.length&&Jt(a,`length`,e.length);return}for(u=Array(c+1),n=c;n>=o;n--)l=e[n],d=i&&l?l[i]:l,t=p.get(d),u[n]=t===void 0?-1:t,p.set(d,n);for(t=o;t<=s;t++)l=a[t],d=i&&l?l[i]:l,n=p.get(d),n!==void 0&&n!==-1&&(f[n]=a[t],n=u[n],p.set(d,n));for(n=o;n<e.length;n++)n in f?(Jt(a,n,f[n]),nn(e[n],a,n,r,i)):Jt(a,n,e[n])}else for(let t=0,n=e.length;t<n;t++)nn(e[t],a,t,r,i);a.length>e.length&&Jt(a,`length`,e.length);return}let s=Object.keys(e);for(let t=0,n=s.length;t<n;t++)tn(s[t])||nn(e[s[t]],a,s[t],r,i);let c=Object.keys(a);for(let t=0,n=c.length;t<n;t++)e[c[t]]===void 0&&Jt(a,c[t],void 0)}function rn(e,t={}){let{merge:n,key:r=`id`}=t,i=Vt(e);return e=>{if(!Bt(e)||!Bt(i))return i;let t=nn(i,{[en]:e},en,n,r);return t===void 0?e:t}}var an=e=>e!=null,on=e=>e.filter(an);function sn(e){return(...t)=>{for(let n of e)n&&n(...t)}}var q=e=>typeof e==`function`&&!e.length?e():e,cn=e=>Array.isArray(e)?e:e?[e]:[];function ln(e,...t){return typeof e==`function`?e(...t):e}var un=P;function dn(e,t,n){if(u.context){let[r,i]=A(e,n);return se(()=>i(()=>t())),[r,i]}return A(t(),n)}function fn(e,t,n,r){let i=e.length,a=t.length,o=0;if(!a){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<a;o++)r(t[o]);return}for(;o<a&&t[o]===e[o];o++);let s,c;t=t.slice(o),e=e.slice(o);for(s of t)e.includes(s)||r(s);for(c of e)t.includes(c)||n(c)}function pn(e,t,n,r){return e.addEventListener(t,n,r),un(e.removeEventListener.bind(e,t,n,r))}function mn(e,t,n,r){let i=()=>{cn(q(e)).forEach(e=>{e&&cn(q(t)).forEach(t=>pn(e,t,n,r))})};typeof e==`function`?M(i):j(i)}function hn(e){let t=I();return{provider:n=>{let r=e.init(n);if(!(e.gate??!0))return R(t.Provider,{value:r,get children(){return n.children}});let i=N(()=>{let e=r.ready;return e===void 0||(typeof e==`function`?e():e)});return R(H,{get when(){return i()},get children(){return R(t.Provider,{value:r,get children(){return n.children}})}})},use(){let n=L(t);if(!n)throw Error(`${e.name} context must be used within a context provider`);return n}}}var gn=s({$schema:()=>_n,dark:()=>xn,default:()=>Sn,id:()=>yn,light:()=>bn,name:()=>vn}),_n=`https://opencode.ai/desktop-theme.json`,vn=`OC-2`,yn=`oc-2`,bn={palette:{neutral:`#f7f7f7`,ink:`#171311`,primary:`#dcde8d`,success:`#12c905`,warning:`#ffdc17`,error:`#fc533a`,info:`#a753ae`,interactive:`#034cff`,diffAdd:`#9ff29a`,diffDelete:`#fc533a`},overrides:{"text-strong":`#171717`,"text-base":`#6F6F6F`,"text-weak":`#8F8F8F`,"text-weaker":`#C7C7C7`,"text-diff-add-base":`var(--v2-state-fg-success)`,"text-diff-delete-base":`var(--v2-state-fg-danger)`,"border-weak-base":`#DBDBDB`,"border-weaker-base":`#E8E8E8`,"icon-base":`#8F8F8F`,"icon-weak-base":`C7C7C7`,"surface-raised-base":`#F3F3F3`,"surface-raised-base-hover":`#EDEDED`,"surface-base":`#F8F8F8`,"surface-base-hover":`#0000000A`,"surface-interactive-weak":`#F5FAFF`,"icon-success-base":`#0ABE00`,"surface-success-base":`#E6FFE5`,"syntax-comment":`var(--v2-text-text-muted)`,"syntax-keyword":`var(--v2-pink-800)`,"syntax-string":`var(--v2-green-800)`,"syntax-primitive":`var(--v2-pink-800)`,"syntax-property":`var(--v2-orange-800)`,"syntax-type":`var(--v2-purple-800)`,"syntax-constant":`#007b80`,"syntax-critical":`var(--v2-red-800)`,"syntax-diff-add":`var(--v2-state-fg-success)`,"syntax-diff-delete":`var(--v2-state-fg-danger)`,"syntax-diff-unknown":`#a753ae`,"surface-critical-base":`#FFF2F0`},v2Overrides:{"v2-grey-50":`#ffffffff`,"v2-grey-100":`#fafafaff`,"v2-grey-200":`#f2f2f2ff`,"v2-grey-300":`#eeeeeeff`,"v2-grey-400":`#dbdbdbff`,"v2-grey-500":`#aeaeaeff`,"v2-grey-600":`#808080ff`,"v2-grey-700":`#5c5c5cff`,"v2-grey-800":`#3a3a3aff`,"v2-grey-900":`#2e2e2eff`,"v2-grey-1000":`#242424ff`,"v2-grey-1100":`#161616ff`,"v2-grey-1200":`#080808ff`,"v2-red-100":`#fcecebff`,"v2-red-200":`#f6d5d3ff`,"v2-red-300":`#f2bbb7ff`,"v2-red-400":`#f29b96ff`,"v2-red-500":`#f17471ff`,"v2-red-600":`#f1484fff`,"v2-red-700":`#d92e3cff`,"v2-red-800":`#b82d35ff`,"v2-red-900":`#97252bff`,"v2-red-1000":`#7a1f23ff`,"v2-red-1100":`#5f1a1cff`,"v2-red-1200":`#461516ff`,"v2-orange-100":`#fdf2edff`,"v2-orange-200":`#ffe7dcff`,"v2-orange-300":`#ffd8c6ff`,"v2-orange-400":`#ffc1a4ff`,"v2-orange-500":`#ffa478ff`,"v2-orange-600":`#ff8648ff`,"v2-orange-700":`#ee7330ff`,"v2-orange-800":`#d16427ff`,"v2-orange-900":`#b35624ff`,"v2-orange-1000":`#954c27ff`,"v2-orange-1100":`#723d22ff`,"v2-orange-1200":`#5a2c14ff`,"v2-yellow-100":`#fefaecff`,"v2-yellow-200":`#fcefd0ff`,"v2-yellow-300":`#f7e5b5ff`,"v2-yellow-400":`#f3da9bff`,"v2-yellow-500":`#f2cf76ff`,"v2-yellow-600":`#f6c251ff`,"v2-yellow-700":`#e7af36ff`,"v2-yellow-800":`#cb9f34ff`,"v2-yellow-900":`#ac8833ff`,"v2-yellow-1000":`#8e7231ff`,"v2-yellow-1100":`#68552bff`,"v2-yellow-1200":`#4b4025ff`,"v2-green-100":`#e7f9eaff`,"v2-green-200":`#d0f0d5ff`,"v2-green-300":`#b8e9c1ff`,"v2-green-400":`#96e3a6ff`,"v2-green-500":`#6bd586ff`,"v2-green-600":`#49c970ff`,"v2-green-700":`#2eaf5aff`,"v2-green-800":`#198b43ff`,"v2-green-900":`#1d783cff`,"v2-green-1000":`#196130ff`,"v2-green-1100":`#164c26ff`,"v2-green-1200":`#14361dff`,"v2-cyan-100":`#e2f7fbff`,"v2-cyan-200":`#c4edf4ff`,"v2-cyan-300":`#a3e4efff`,"v2-cyan-400":`#65d9ebff`,"v2-cyan-500":`#00c5dfff`,"v2-cyan-600":`#00abcfff`,"v2-cyan-700":`#0096b8ff`,"v2-cyan-800":`#007d9bff`,"v2-cyan-900":`#006c85ff`,"v2-cyan-1000":`#005a6eff`,"v2-cyan-1100":`#004756ff`,"v2-cyan-1200":`#00353fff`,"v2-blue-100":`#f5f8ffff`,"v2-blue-200":`#ecf1feff`,"v2-blue-300":`#c3d4fdff`,"v2-blue-400":`#a2bcffff`,"v2-blue-500":`#7698fdff`,"v2-blue-600":`#3b5cf6ff`,"v2-blue-700":`#0b34f4ff`,"v2-blue-800":`#3250dfff`,"v2-blue-900":`#2c47c8ff`,"v2-blue-1000":`#263fa9ff`,"v2-blue-1100":`#22388fff`,"v2-blue-1200":`#021945ff`,"v2-purple-100":`#ebecfeff`,"v2-purple-200":`#d5d5fcff`,"v2-purple-300":`#b9b8f5ff`,"v2-purple-400":`#9e99f7ff`,"v2-purple-500":`#8271f8ff`,"v2-purple-600":`#7152f4ff`,"v2-purple-700":`#623be2ff`,"v2-purple-800":`#5230c2ff`,"v2-purple-900":`#442aa1ff`,"v2-purple-1000":`#361f83ff`,"v2-purple-1100":`#2b1b6aff`,"v2-purple-1200":`#221358ff`,"v2-pink-100":`#fdecf3ff`,"v2-pink-200":`#f7d5e4ff`,"v2-pink-300":`#fabcd8ff`,"v2-pink-400":`#f799c6ff`,"v2-pink-500":`#f26cb2ff`,"v2-pink-600":`#f64aabff`,"v2-pink-700":`#e4429eff`,"v2-pink-800":`#c83d8bff`,"v2-pink-900":`#aa3576ff`,"v2-pink-1000":`#8c2d61ff`,"v2-pink-1100":`#6f284fff`,"v2-pink-1200":`#5c1d3fff`,"v2-background-bg-base":`var(--v2-grey-50)`,"v2-background-bg-deep":`var(--v2-grey-100)`,"v2-background-bg-layer-01":`var(--v2-grey-100)`,"v2-background-bg-layer-02":`var(--v2-grey-200)`,"v2-background-bg-layer-03":`var(--v2-grey-300)`,"v2-background-bg-layer-04":`var(--v2-grey-400)`,"v2-background-bg-inverse":`var(--v2-grey-1100)`,"v2-background-bg-contrast":`var(--v2-grey-1000)`,"v2-background-bg-icon-button-contrast":`var(--v2-background-bg-contrast)`,"v2-background-bg-button-neutral":`var(--v2-grey-50)`,"v2-background-bg-accent":`var(--v2-blue-600)`,"v2-background-bg-code-path":`var(--v2-cyan-100)`,"v2-text-text-base":`var(--v2-grey-1100)`,"v2-text-text-muted":`var(--v2-grey-700)`,"v2-text-text-faint":`var(--v2-grey-600)`,"v2-text-text-inverse":`var(--v2-grey-50)`,"v2-text-text-contrast":`var(--v2-grey-50)`,"v2-text-text-accent":`var(--v2-blue-600)`,"v2-text-text-accent-hover":`var(--v2-blue-700)`,"v2-text-text-code-accent":`var(--v2-blue-900)`,"v2-text-text-code-path":`var(--v2-blue-900)`,"v2-icon-icon-base":`var(--v2-grey-800)`,"v2-icon-icon-muted":`var(--v2-grey-600)`,"v2-icon-icon-faint":`var(--v2-grey-500)`,"v2-icon-icon-inverse":`var(--v2-grey-50)`,"v2-icon-icon-contrast":`var(--v2-grey-100)`,"v2-icon-icon-accent":`var(--v2-blue-600)`,"v2-icon-icon-accent-hover":`var(--v2-blue-700)`,"v2-border-border-muted":`var(--v2-alpha-dark-8)`,"v2-border-border-base":`var(--v2-alpha-dark-10)`,"v2-border-border-strong":`var(--v2-alpha-dark-20)`,"v2-border-border-inverse":`var(--v2-grey-1000)`,"v2-border-border-focus":`var(--v2-blue-500)`,"v2-overlay-simple-overlay-hover":`var(--v2-alpha-dark-4)`,"v2-overlay-simple-overlay-pressed":`var(--v2-alpha-dark-8)`,"v2-overlay-simple-overlay-contrast-hover":`var(--v2-alpha-light-12)`,"v2-overlay-simple-overlay-contrast-pressed":`var(--v2-alpha-light-24)`,"v2-overlay-simple-overlay-scrim":`var(--v2-alpha-dark-40)`,"v2-overlay-gradient-depth-overlay-depth-top":`var(--v2-alpha-light-100)`,"v2-overlay-gradient-depth-overlay-depth-bot":`var(--v2-alpha-light-0)`,"v2-overlay-simple-tab-active-scrim":`#fafafa00`,"v2-overlay-simple-tab-hover-scrim":`#eeeeee00`,"v2-overlay-simple-tab-scrim":`#fafafa00`,"v2-state-bg-success":`var(--v2-green-100)`,"v2-state-fg-success":`var(--v2-green-800)`,"v2-state-border-success":`var(--v2-green-300)`,"v2-state-bg-warning":`var(--v2-yellow-100)`,"v2-state-fg-warning":`var(--v2-yellow-800)`,"v2-state-border-warning":`var(--v2-yellow-300)`,"v2-state-bg-danger":`var(--v2-red-100)`,"v2-state-fg-danger":`var(--v2-red-800)`,"v2-state-border-danger":`var(--v2-red-300)`,"v2-state-bg-info":`var(--v2-blue-200)`,"v2-state-fg-info":`var(--v2-blue-800)`,"v2-state-border-info":`var(--v2-blue-300)`,"v2-agent-plan-solid":`var(--v2-pink-800)`,"v2-agent-plan-border":`rgba(200, 61, 139, 0.2)`,"v2-agent-plan-background":`rgba(253, 236, 243, 0.1)`,"v2-agent-build-solid":`var(--v2-blue-800)`,"v2-agent-build-border":`rgba(44, 71, 200, 0.1)`,"v2-agent-build-background":`rgba(236, 241, 254, 0.1)`,"v2-agent-explore-solid":`var(--v2-yellow-900)`,"v2-agent-explore-border":`rgba(203, 159, 52, 0.2)`,"v2-agent-explore-background":`rgba(254, 250, 236, 0.1)`,"v2-agent-review-solid":`var(--v2-green-800)`,"v2-agent-writer-solid":`var(--v2-purple-700)`,"v2-avatar-bg-orange":`#ee7330ff`,"v2-avatar-border-orange":`#d16427ff`,"v2-avatar-bg-yellow":`#e7af36ff`,"v2-avatar-border-yellow":`#cb9f34ff`,"v2-avatar-bg-cyan":`#0096b8ff`,"v2-avatar-border-cyan":`#007d9bff`,"v2-avatar-bg-green":`#2eaf5aff`,"v2-avatar-border-green":`#198b43ff`,"v2-avatar-bg-red":`#d92e3cff`,"v2-avatar-border-red":`#b82d35ff`,"v2-avatar-bg-pink":`#e4429eff`,"v2-avatar-border-pink":`#c83d8bff`,"v2-avatar-bg-blue":`#3250dfff`,"v2-avatar-border-blue":`#2c47c8ff`,"v2-avatar-bg-purple":`#623be2ff`,"v2-avatar-border-purple":`#5230c2ff`,"v2-avatar-bg-gray":`#5c5c5cff`,"v2-avatar-border-gray":`#3a3a3aff`,"v2-elevation-raised":`0px 2px 4px 0px var(--v2-alpha-dark-4), 0px 1px 2px -1px var(--v2-alpha-dark-8), 0px 0px 0px 0.5px var(--v2-alpha-dark-12), 0px 0px 0px 0px var(--v2-alpha-dark-0)`,"v2-elevation-floating":`0px 8px 16px 0px var(--v2-alpha-dark-4), 0px 4px 8px 0px var(--v2-alpha-dark-8), 0px 0px 0px 0.5px var(--v2-alpha-dark-12), 0px 0px 0px 0px var(--v2-alpha-dark-0)`,"v2-elevation-overlay":`0px 16px 32px 0px var(--v2-alpha-dark-4), 0px 8px 16px 0px var(--v2-alpha-dark-8), 0px 0px 0px 0.5px var(--v2-alpha-dark-12), 0px 0px 0px 0px var(--v2-alpha-dark-0)`,"v2-elevation-button-neutral":`0px 1px 1.5px 0px var(--v2-alpha-dark-10), 0px 0px 0px 0.5px var(--v2-alpha-dark-14), 0px 0px 0px 0px var(--v2-alpha-dark-0)`,"v2-elevation-button-contrast":`0px 1px 1.5px 0px var(--v2-alpha-dark-20), 0px 0px 0px 0.5px var(--v2-grey-800), inset 0px 1px 2px 0px var(--v2-alpha-light-14), inset 0px -1px 2px 0px var(--v2-alpha-dark-6), 0px 0px 0px 0px var(--v2-alpha-dark-0)`,"v2-elevation-elements":`0px 0.5px 0.5px 0px var(--v2-alpha-dark-40)`,"v2-elevation-switch-off":`inset 0px 1px 1px 0px var(--v2-alpha-dark-8), inset 0px 0.5px 0.5px 0px var(--v2-alpha-dark-8), inset 0px 0px 0px 0.5px var(--v2-alpha-dark-10)`,"v2-elevation-switch-on":`inset 0px 2px 2px 0px var(--v2-alpha-dark-10), inset 0px 1px 1px 0px var(--v2-alpha-dark-10), inset 0px 0px 0px 0.5px var(--v2-alpha-dark-20)`,"v2-illustration-illustration-layer-01":`var(--v2-grey-300)`,"v2-illustration-illustration-layer-02":`var(--v2-grey-400)`,"v2-illustration-illustration-layer-03":`var(--v2-grey-500)`,"v2-font-family-code":`var(--font-family-mono)`}},xn={palette:{neutral:`#1f1f1f`,ink:`#f1ece8`,primary:`#fab283`,success:`#12c905`,warning:`#fcd53a`,error:`#fc533a`,info:`#edb2f1`,interactive:`#034cff`,diffAdd:`#c8ffc4`,diffDelete:`#fc533a`},overrides:{"text-strong":`#EDEDED`,"text-base":`#A0A0A0`,"text-weak":`#707070`,"text-weaker":`#505050`,"text-diff-add-base":`var(--v2-state-fg-success)`,"text-diff-delete-base":`var(--v2-state-fg-danger)`,"border-weak-base":`#282828`,"border-weaker-base":`#232323`,"icon-base":`#7E7E7E`,"icon-weak-base":`#343434`,"surface-raised-base":`#232323`,"surface-raised-base-hover":`#282828`,"surface-base":`#1C1C1C`,"surface-base-hover":`#FFFFFF0D`,"surface-interactive-weak":`#0D172B`,"surface-success-base":`#022B00`,"syntax-comment":`var(--v2-text-text-muted)`,"syntax-keyword":`var(--v2-pink-400)`,"syntax-string":`var(--v2-green-400)`,"syntax-primitive":`var(--v2-pink-400)`,"syntax-property":`var(--v2-orange-400)`,"syntax-type":`var(--v2-purple-400)`,"syntax-constant":`#93e9f6`,"syntax-critical":`var(--v2-red-400)`,"syntax-diff-add":`var(--v2-state-fg-success)`,"syntax-diff-delete":`var(--v2-state-fg-danger)`,"syntax-diff-unknown":`#edb2f1`,"surface-critical-base":`#1F0603`},v2Overrides:{"v2-grey-50":`#ffffffff`,"v2-grey-100":`#fafafaff`,"v2-grey-200":`#f2f2f2ff`,"v2-grey-300":`#eeeeeeff`,"v2-grey-400":`#dbdbdbff`,"v2-grey-500":`#aeaeaeff`,"v2-grey-600":`#808080ff`,"v2-grey-700":`#5c5c5cff`,"v2-grey-800":`#3a3a3aff`,"v2-grey-900":`#2e2e2eff`,"v2-grey-1000":`#242424ff`,"v2-grey-1100":`#161616ff`,"v2-grey-1200":`#080808ff`,"v2-red-100":`#fcecebff`,"v2-red-200":`#f6d5d3ff`,"v2-red-300":`#f2bbb7ff`,"v2-red-400":`#f29b96ff`,"v2-red-500":`#f17471ff`,"v2-red-600":`#f1484fff`,"v2-red-700":`#d92e3cff`,"v2-red-800":`#b82d35ff`,"v2-red-900":`#97252bff`,"v2-red-1000":`#7a1f23ff`,"v2-red-1100":`#5f1a1cff`,"v2-red-1200":`#461516ff`,"v2-orange-100":`#fdf2edff`,"v2-orange-200":`#ffe7dcff`,"v2-orange-300":`#ffd8c6ff`,"v2-orange-400":`#ffc1a4ff`,"v2-orange-500":`#ffa478ff`,"v2-orange-600":`#ff8648ff`,"v2-orange-700":`#ee7330ff`,"v2-orange-800":`#d16427ff`,"v2-orange-900":`#b35624ff`,"v2-orange-1000":`#954c27ff`,"v2-orange-1100":`#723d22ff`,"v2-orange-1200":`#5a2c14ff`,"v2-yellow-100":`#fefaecff`,"v2-yellow-200":`#fcefd0ff`,"v2-yellow-300":`#f7e5b5ff`,"v2-yellow-400":`#f3da9bff`,"v2-yellow-500":`#f2cf76ff`,"v2-yellow-600":`#f6c251ff`,"v2-yellow-700":`#e7af36ff`,"v2-yellow-800":`#cb9f34ff`,"v2-yellow-900":`#ac8833ff`,"v2-yellow-1000":`#8e7231ff`,"v2-yellow-1100":`#68552bff`,"v2-yellow-1200":`#4b4025ff`,"v2-green-100":`#e7f9eaff`,"v2-green-200":`#d0f0d5ff`,"v2-green-300":`#b8e9c1ff`,"v2-green-400":`#96e3a6ff`,"v2-green-500":`#6bd586ff`,"v2-green-600":`#49c970ff`,"v2-green-700":`#2eaf5aff`,"v2-green-800":`#198b43ff`,"v2-green-900":`#1d783cff`,"v2-green-1000":`#196130ff`,"v2-green-1100":`#164c26ff`,"v2-green-1200":`#14361dff`,"v2-cyan-100":`#e2f7fbff`,"v2-cyan-200":`#c4edf4ff`,"v2-cyan-300":`#a3e4efff`,"v2-cyan-400":`#65d9ebff`,"v2-cyan-500":`#00c5dfff`,"v2-cyan-600":`#00abcfff`,"v2-cyan-700":`#0096b8ff`,"v2-cyan-800":`#007d9bff`,"v2-cyan-900":`#006c85ff`,"v2-cyan-1000":`#005a6eff`,"v2-cyan-1100":`#004756ff`,"v2-cyan-1200":`#00353fff`,"v2-blue-100":`#f5f8ffff`,"v2-blue-200":`#ecf1feff`,"v2-blue-300":`#c3d4fdff`,"v2-blue-400":`#a2bcffff`,"v2-blue-500":`#7698fdff`,"v2-blue-600":`#3b5cf6ff`,"v2-blue-700":`#0b34f4ff`,"v2-blue-800":`#3250dfff`,"v2-blue-900":`#2c47c8ff`,"v2-blue-1000":`#263fa9ff`,"v2-blue-1100":`#22388fff`,"v2-blue-1200":`#021945ff`,"v2-purple-100":`#ebecfeff`,"v2-purple-200":`#d5d5fcff`,"v2-purple-300":`#b9b8f5ff`,"v2-purple-400":`#9e99f7ff`,"v2-purple-500":`#8271f8ff`,"v2-purple-600":`#7152f4ff`,"v2-purple-700":`#623be2ff`,"v2-purple-800":`#5230c2ff`,"v2-purple-900":`#442aa1ff`,"v2-purple-1000":`#361f83ff`,"v2-purple-1100":`#2b1b6aff`,"v2-purple-1200":`#221358ff`,"v2-pink-100":`#fdecf3ff`,"v2-pink-200":`#f7d5e4ff`,"v2-pink-300":`#fabcd8ff`,"v2-pink-400":`#f799c6ff`,"v2-pink-500":`#f26cb2ff`,"v2-pink-600":`#f64aabff`,"v2-pink-700":`#e4429eff`,"v2-pink-800":`#c83d8bff`,"v2-pink-900":`#aa3576ff`,"v2-pink-1000":`#8c2d61ff`,"v2-pink-1100":`#6f284fff`,"v2-pink-1200":`#5c1d3fff`,"v2-background-bg-base":`var(--v2-grey-1100)`,"v2-background-bg-deep":`var(--v2-grey-1200)`,"v2-background-bg-layer-01":`var(--v2-grey-1000)`,"v2-background-bg-layer-02":`var(--v2-grey-900)`,"v2-background-bg-layer-03":`var(--v2-grey-800)`,"v2-background-bg-layer-04":`var(--v2-grey-700)`,"v2-background-bg-inverse":`var(--v2-grey-50)`,"v2-background-bg-contrast":`var(--v2-grey-700)`,"v2-background-bg-icon-button-contrast":`var(--v2-grey-400)`,"v2-background-bg-button-neutral":`var(--v2-alpha-light-6)`,"v2-background-bg-accent":`var(--v2-blue-600)`,"v2-background-bg-code-path":`var(--v2-cyan-1200)`,"v2-text-text-base":`var(--v2-grey-100)`,"v2-text-text-muted":`var(--v2-grey-500)`,"v2-text-text-faint":`var(--v2-grey-600)`,"v2-text-text-inverse":`var(--v2-grey-1100)`,"v2-text-text-contrast":`var(--v2-grey-50)`,"v2-text-text-accent":`var(--v2-blue-400)`,"v2-text-text-accent-hover":`var(--v2-blue-300)`,"v2-text-text-code-accent":`var(--v2-blue-400)`,"v2-text-text-code-path":`var(--v2-blue-300)`,"v2-icon-icon-base":`var(--v2-grey-400)`,"v2-icon-icon-muted":`var(--v2-grey-600)`,"v2-icon-icon-faint":`var(--v2-grey-700)`,"v2-icon-icon-inverse":`var(--v2-grey-1100)`,"v2-icon-icon-contrast":`var(--v2-grey-100)`,"v2-icon-icon-accent":`var(--v2-blue-400)`,"v2-icon-icon-accent-hover":`var(--v2-blue-300)`,"v2-border-border-muted":`var(--v2-alpha-light-8)`,"v2-border-border-base":`var(--v2-alpha-light-10)`,"v2-border-border-strong":`var(--v2-alpha-light-20)`,"v2-border-border-inverse":`var(--v2-grey-100)`,"v2-border-border-focus":`var(--v2-blue-500)`,"v2-overlay-simple-overlay-hover":`var(--v2-alpha-light-6)`,"v2-overlay-simple-overlay-pressed":`var(--v2-alpha-light-10)`,"v2-overlay-simple-overlay-contrast-hover":`var(--v2-alpha-dark-24)`,"v2-overlay-simple-overlay-contrast-pressed":`var(--v2-alpha-dark-40)`,"v2-overlay-simple-overlay-scrim":`var(--v2-alpha-dark-60)`,"v2-overlay-gradient-depth-overlay-depth-top":`var(--v2-alpha-light-100)`,"v2-overlay-gradient-depth-overlay-depth-bot":`var(--v2-alpha-light-0)`,"v2-overlay-simple-tab-active-scrim":`#24242400`,"v2-overlay-simple-tab-hover-scrim":`#3a3a3a00`,"v2-overlay-simple-tab-scrim":`#08080800`,"v2-state-bg-success":`var(--v2-green-1200)`,"v2-state-fg-success":`var(--v2-green-500)`,"v2-state-border-success":`var(--v2-green-900)`,"v2-state-bg-warning":`var(--v2-yellow-1200)`,"v2-state-fg-warning":`var(--v2-yellow-500)`,"v2-state-border-warning":`var(--v2-yellow-900)`,"v2-state-bg-danger":`var(--v2-red-1200)`,"v2-state-fg-danger":`var(--v2-red-500)`,"v2-state-border-danger":`var(--v2-red-900)`,"v2-state-bg-info":`var(--v2-blue-1200)`,"v2-state-fg-info":`var(--v2-blue-500)`,"v2-state-border-info":`var(--v2-blue-900)`,"v2-agent-plan-solid":`var(--v2-pink-400)`,"v2-agent-plan-border":`rgba(247, 153, 198, 0.2)`,"v2-agent-plan-background":`rgba(170, 53, 118, 0.05)`,"v2-agent-build-solid":`var(--v2-blue-300)`,"v2-agent-build-border":`rgba(162, 188, 255, 0.2)`,"v2-agent-build-background":`rgba(38, 63, 169, 0.05)`,"v2-agent-explore-solid":`var(--v2-yellow-300)`,"v2-agent-explore-border":`rgba(243, 218, 155, 0.2)`,"v2-agent-explore-background":`rgba(172, 136, 51, 0.05)`,"v2-agent-review-solid":`var(--v2-green-300)`,"v2-agent-writer-solid":`var(--v2-purple-400)`,"v2-avatar-bg-orange":`#723d22ff`,"v2-avatar-border-orange":`#ff8648ff`,"v2-avatar-bg-yellow":`#68552bff`,"v2-avatar-border-yellow":`#e7af36ff`,"v2-avatar-bg-cyan":`#005a6eff`,"v2-avatar-border-cyan":`#0096b8ff`,"v2-avatar-bg-green":`#196130ff`,"v2-avatar-border-green":`#49c970ff`,"v2-avatar-bg-red":`#7a1f23ff`,"v2-avatar-border-red":`#d92e3cff`,"v2-avatar-bg-pink":`#8c2d61ff`,"v2-avatar-border-pink":`#e4429eff`,"v2-avatar-bg-blue":`#263fa9ff`,"v2-avatar-border-blue":`#7698fdff`,"v2-avatar-bg-purple":`#361f83ff`,"v2-avatar-border-purple":`#7152f4ff`,"v2-avatar-bg-gray":`#5c5c5cff`,"v2-avatar-border-gray":`#aeaeaeff`,"v2-elevation-raised":`0px 2px 4px 0px var(--v2-alpha-dark-30), 0px 1px 2px 0px var(--v2-alpha-dark-30), 0px 0px 0px 0.5px var(--v2-alpha-light-16), 0px -0.5px 0px 0px var(--v2-alpha-light-6)`,"v2-elevation-floating":`0px 8px 16px 0px var(--v2-alpha-dark-30), 0px 4px 8px 0px var(--v2-alpha-dark-30), 0px 0px 0px 0.5px var(--v2-alpha-light-16), 0px -0.5px 0px 0px var(--v2-alpha-light-6)`,"v2-elevation-overlay":`0px 16px 32px 0px var(--v2-alpha-dark-30), 0px 8px 16px 0px var(--v2-alpha-dark-30), 0px 0px 0px 0.5px var(--v2-alpha-light-16), 0px -0.5px 0px 0px var(--v2-alpha-light-6)`,"v2-elevation-button-neutral":`0px 1px 2px 0px var(--v2-alpha-dark-40), 0px 0px 0px 0.5px var(--v2-alpha-light-20), 0px -0.5px 0px 0px var(--v2-alpha-light-10)`,"v2-elevation-button-contrast":`0px 1px 2px 0px var(--v2-alpha-dark-40), 0px 0px 0px 0.5px var(--v2-alpha-light-40), inset 0px 0px 0px 0px var(--v2-alpha-light-0), inset 0px 0px 0px 0px var(--v2-alpha-light-0), 0px -0.5px 0px 0px var(--v2-alpha-light-30)`,"v2-elevation-elements":`0px 0.5px 0.5px 0px var(--v2-alpha-dark-40)`,"v2-elevation-switch-off":`inset 0px -0.5px 0px 0px var(--v2-alpha-light-10), inset 0px 0px 0px 0px var(--v2-alpha-light-0), inset 0px 0px 0px 0.5px var(--v2-alpha-light-16)`,"v2-elevation-switch-on":`inset 0px -0.5px 0px 0px var(--v2-alpha-light-10), inset 0px 0px 0px 0px var(--v2-alpha-light-0), inset 0px 0px 0px 0.5px var(--v2-alpha-light-16)`,"v2-illustration-illustration-layer-01":`var(--v2-grey-900)`,"v2-illustration-illustration-layer-02":`var(--v2-grey-800)`,"v2-illustration-illustration-layer-03":`var(--v2-grey-700)`}},Sn={$schema:_n,name:vn,id:yn,light:bn,dark:xn};function Cn(e,t,n){return Math.max(t,Math.min(n,e))}function wn(e){return(e%360+360)%360}function Tn(e){let t=e.replace(`#`,``),n=t.length===3||t.length===4?t.split(``).map(e=>e+e).join(``):t,r=n.length===8?n.slice(0,6):n,i=parseInt(r,16);return{r:(i>>16&255)/255,g:(i>>8&255)/255,b:(i&255)/255}}function En(e,t,n){let r=e=>{let t=Cn(e,0,1);return Math.round(t*255).toString(16).padStart(2,`0`)};return`#${r(e)}${r(t)}${r(n)}`}function Dn(e){return e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055}function On(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function kn(e,t,n){let r=On(e),i=On(t),a=On(n),o=.4122214708*r+.5363325363*i+.0514459929*a,s=.2119034982*r+.6806995451*i+.1073969566*a,c=.0883024619*r+.2817188376*i+.6299787005*a,l=Math.cbrt(o),u=Math.cbrt(s),d=Math.cbrt(c),f=.2104542553*l+.793617785*u-.0040720468*d,p=1.9779984951*l-2.428592205*u+.4505937099*d,m=.0259040371*l+.7827717662*u-.808675766*d,h=Math.sqrt(p*p+m*m),g=180/Math.PI*Math.atan2(m,p);return g<0&&(g+=360),{l:f,c:h,h:g}}function An(e){let{l:t,c:n,h:r}=e,i=n*Math.cos(r*Math.PI/180),a=n*Math.sin(r*Math.PI/180),o=t+.3963377774*i+.2158037573*a,s=t-.1055613458*i-.0638541728*a,c=t-.0894841775*i-1.291485548*a,l=o*o*o,u=s*s*s,d=c*c*c,f=4.0767416621*l-3.3077115913*u+.2309699292*d,p=-1.2684380046*l+2.6097574011*u-.3413193965*d,m=-.0041960863*l-.7034186147*u+1.707614701*d;return{r:Dn(f),g:Dn(p),b:Dn(m)}}function jn(e){let{r:t,g:n,b:r}=Tn(e);return kn(t,n,r)}function Mn(e){let t={l:Cn(e.l,0,1),c:Math.max(0,e.c),h:wn(e.h)},n=An(t);if(n.r>=0&&n.r<=1&&n.g>=0&&n.g<=1&&n.b>=0&&n.b<=1)return t;let r=t.c;for(let e=0;e<24;e++){r*=.9;let e={...t,c:r},n=An(e);if(n.r>=0&&n.r<=1&&n.g>=0&&n.g<=1&&n.b>=0&&n.b<=1)return e}return{...t,c:0}}function Nn(e){let{r:t,g:n,b:r}=An(Mn(e));return En(t,n,r)}function Pn(e,t){let n=jn(e),r=[],i=t?[.118,.138,.167,.202,.246,.304,.378,.468,Cn(n.l*.825,.53,.705),Cn(n.l*.89,.61,.79),Cn(n.l+.033,.868,.943),.984]:[.993,.983,.962,.936,.906,.866,.811,.74,n.l,Math.max(0,n.l-.036),.49,.27],a=t?[.52,.68,.86,1.02,1.14,1.24,1.36,1.48,1.56,1.64,1.62,1.15]:[.12,.24,.46,.68,.84,.98,1.08,1.16,1.22,1.26,1.18,.98];for(let e=0;e<12;e++)r.push(Nn({l:i[e],c:n.c*a[e],h:n.h}));return r}function Fn(e,t,n){if(n){let r=jn(e),i=e=>Nn({l:r.l+(1-r.l)*e,c:r.c*Math.max(0,1-e),h:r.h}),a=t?(e=>Nn({l:r.l*(1-e),c:r.c*Math.max(0,1-e*(t?.12:.3)),h:r.h}))(Cn(.19+Math.max(0,r.l-.12)*.33+r.c*1.95,.17,.27)):r.l<.82?i(.86):i(Cn(.1+r.c*3.2+Math.max(0,.95-r.l)*.35,.1,.28));return(t?[0,.018,.039,.064,.097,.143,.212,.31,.46,.649,.845,.984]:[0,.022,.042,.068,.102,.146,.208,.296,.432,.61,.81,.965]).map(e=>In(a,n,e))}let r=jn(e),i=[],a=Math.min(r.c,t?.068:.04),o=t?[.138,.156,.178,.202,.232,.272,.326,.404,Cn(r.l*.83,.43,.55),.596,.719,.956]:[.991,.979,.964,.946,.931,.913,.891,.83,r.l,.617,.542,.205];for(let e=0;e<12;e++)i.push(Nn({l:o[e],c:a,h:r.h}));return i}function In(e,t,n){let r=jn(e),i=jn(t),a=((i.h-r.h)%360+540)%360-180;return Nn({l:r.l+(i.l-r.l)*n,c:r.c+(i.c-r.c)*n,h:r.h+a*n})}function Ln(e,t){let n=jn(e);return Nn({l:n.l+(t.l??0),c:n.c*(t.c??1),h:n.h+(t.h??0)})}function Rn(e,t){let n=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4,r=e=>{let{r:t,g:r,b:i}=Tn(e);return .2126*n(t)+.587*n(r)+.0722*n(i)},i=r(e),a=r(t),o=Math.max(i,a),s=Math.min(i,a);return(o+.05)/(s+.05)}function zn(e,t,n){let r=Tn(e),i=Tn(t);return En(r.r*n+i.r*(1-n),r.g*n+i.g*(1-n),r.b*n+i.b*(1-n))}function Bn(e,t){let{r:n,g:r,b:i}=Tn(e);return`rgba(${Math.round(n*255)}, ${Math.round(r*255)}, ${Math.round(i*255)}, ${t})`}function Vn(e,t){let n=Hn(e),{overrides:r={}}=e,i=Fn(n.neutral,t,n.ink),a=Pn(n.primary,t),o=Pn(n.accent,t),s=Pn(n.success,t),c=Pn(n.warning,t),l=Pn(n.error,t),u=Pn(n.info,t),d=Pn(n.interactive,t),f=Pn(Ln(n.warning,t?{h:-16,l:-.058,c:1.14}:{h:-22,l:-.082,c:.94}),t),p=Pn(Ln(n.interactive,{h:-12,l:.128,c:1.12}),t),m=Pn(n.diffAdd??Ln(n.success,{c:t?.7:.55,l:t?-.18:.14}),t),h=Pn(n.diffDelete??Ln(n.error,{c:t?.82:.7,l:t?-.08:.08}),t),g=n.ink??n.neutral,_=n.compact?jn(g):void 0,v=_?Ln(g,{l:t?Math.max(0,.88-_.l)*.4:-Math.max(0,_.l-.18)*.24,c:t?1.04:1.02}):void 0,y=r[`background-base`],b=Wn(y),x=!!y&&!b,S=(e,n)=>{let r=jn(e);return Ln(t&&r.l>.84?Ln(e,{c:1.18}):n[10],{l:t?.034:-.024,c:t?1.3:1.18})},C=()=>{if(!n.compact)return t?`#ffba92`:`#FF8C00`;let e=jn(n.warning).h,r=jn(n.diffDelete??n.error).h;return Math.abs(((r-e)%360+540)%360-180)<48?t?`#ffba92`:`#FF8C00`:S(n.warning,c)},w=(e,t)=>({base:E(e,t.base),weak:E(e,t.weak),weaker:E(e,t.weaker),strong:E(e,t.strong),stronger:E(e,t.stronger)}),T=b??i[0],E=(e,t)=>x?Bn(e,t):zn(e,T,t),D=(e,r)=>E(g,t?Math.min(1,r+.024+(n.compact?.08:0)):Math.min(1,e+.024)),O=w(t?Ln(n.interactive,{c:.55,l:0}):Ln(n.interactive,{c:.45,l:.08}),t?{base:.14,weak:.08,weaker:.18,strong:.26,stronger:.42}:{base:.12,weak:.08,weaker:.16,strong:.24,stronger:.36}),k=Un(i,t),ee=a[8],A=a[9],te=d[t?6:4],j=d[t?7:5],M=d[t?5:3],N=s[t?6:4],ne=s[t?5:3],re=s[10],ie=c[t?6:4],ae=c[t?5:3],oe=c[10],se=l[t?6:4],P=l[t?5:3],ce=l[10],le=u[t?6:4],ue=u[t?5:3],de=u[10],fe=e=>{let t=Tn(e),n=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;return .2126*n(t.r)+.7152*n(t.g)+.0722*n(t.b)},pe=(e,t)=>{let n=fe(e),r=fe(t),i=Math.max(n,r),a=Math.min(n,r);return(i+.05)/(a+.05)},F=e=>{let t=`#ffffff`,n=`#000000`;return pe(t,e)>pe(n,e)?t:n},I={};I[`background-base`]=i[0],I[`background-weak`]=i[2],I[`background-strong`]=i[0],I[`background-stronger`]=t?i[1]:`#fcfcfc`,I[`surface-base`]=k[1],I.base=k[1],I[`surface-base-hover`]=k[2],I[`surface-base-active`]=k[2],I[`surface-base-interactive-active`]=Bn(d[2],.3),I.base2=k[1],I.base3=k[1],I[`surface-inset-base`]=k[1],I[`surface-inset-base-hover`]=k[2],I[`surface-inset-strong`]=t?Bn(i[0],.5):Bn(i[3],.09),I[`surface-inset-strong-hover`]=I[`surface-inset-strong`],I[`surface-raised-base`]=k[0],I[`surface-float-base`]=t?i[1]:i[11],I[`surface-float-base-hover`]=t?i[2]:i[10],I[`surface-raised-base-hover`]=k[1],I[`surface-raised-base-active`]=k[2],I[`surface-raised-strong`]=t?k[3]:i[0],I[`surface-raised-strong-hover`]=t?k[5]:`#ffffff`,I[`surface-raised-stronger`]=t?k[5]:`#ffffff`,I[`surface-raised-stronger-hover`]=t?k[6]:`#ffffff`,I[`surface-weak`]=k[2],I[`surface-weaker`]=k[3],I[`surface-strong`]=t?k[6]:`#ffffff`,I[`surface-raised-stronger-non-alpha`]=t?i[2]:`#ffffff`,I[`surface-brand-base`]=ee,I[`surface-brand-hover`]=A,I[`surface-interactive-base`]=te,I[`surface-interactive-hover`]=j,I[`surface-interactive-weak`]=M,I[`surface-interactive-weak-hover`]=te,I[`surface-success-base`]=N,I[`surface-success-weak`]=ne,I[`surface-success-strong`]=re,I[`surface-warning-base`]=ie,I[`surface-warning-weak`]=ae,I[`surface-warning-strong`]=oe,I[`surface-critical-base`]=se,I[`surface-critical-weak`]=P,I[`surface-critical-strong`]=ce,I[`surface-info-base`]=le,I[`surface-info-weak`]=ue,I[`surface-info-strong`]=de,I[`surface-diff-unchanged-base`]=t?i[0]:`#ffffff00`,I[`surface-diff-skip-base`]=t?k[0]:i[1],I[`surface-diff-hidden-base`]=O.base,I[`surface-diff-hidden-weak`]=O.weak,I[`surface-diff-hidden-weaker`]=O.weaker,I[`surface-diff-hidden-strong`]=O.strong,I[`surface-diff-hidden-stronger`]=O.stronger,I[`surface-diff-add-base`]=m[2],I[`surface-diff-add-weak`]=m[t?3:1],I[`surface-diff-add-weaker`]=m[t?2:0],I[`surface-diff-add-strong`]=m[4],I[`surface-diff-add-stronger`]=m[t?10:8],I[`surface-diff-delete-base`]=h[2],I[`surface-diff-delete-weak`]=h[t?3:1],I[`surface-diff-delete-weaker`]=h[t?2:0],I[`surface-diff-delete-strong`]=h[t?4:5],I[`surface-diff-delete-stronger`]=h[t?10:8],I[`input-base`]=t?i[1]:i[0],I[`input-hover`]=t?i[2]:i[1],I[`input-active`]=t?d[6]:d[0],I[`input-selected`]=t?d[7]:d[3],I[`input-focus`]=t?d[6]:d[0],I[`input-disabled`]=i[3],I[`text-base`]=n.compact?v:i[10],I[`text-weak`]=n.compact?Ln(v,{l:t?-.11:.11,c:.9}):i[8],I[`text-weaker`]=n.compact?Ln(v,{l:t?-.2:.21,c:t?.78:.72}):i[7],I[`text-strong`]=n.compact?t?zn(`#ffffff`,v,.9):Ln(v,{l:-.07,c:1.04}):i[11],I[`text-invert-base`]=t?i[10]:i[1],I[`text-invert-weak`]=t?i[8]:i[2],I[`text-invert-weaker`]=t?i[7]:i[3],I[`text-invert-strong`]=t?i[11]:i[0],I[`text-interactive-base`]=d[t?10:9],I[`text-on-brand-base`]=F(ee),I[`text-on-interactive-base`]=F(te),I[`text-on-interactive-weak`]=F(te),I[`text-on-success-base`]=F(N),I[`text-on-critical-base`]=F(se),I[`text-on-critical-weak`]=F(se),I[`text-on-critical-strong`]=F(ce),I[`text-on-warning-base`]=F(ie),I[`text-on-info-base`]=F(le),I[`text-diff-add-base`]=m[10],I[`text-diff-delete-base`]=h[9],I[`text-diff-delete-strong`]=h[11],I[`text-diff-add-strong`]=m[t?7:11],I[`text-on-info-weak`]=F(le),I[`text-on-info-strong`]=F(de),I[`text-on-warning-weak`]=F(ie),I[`text-on-warning-strong`]=F(oe),I[`text-on-success-weak`]=F(N),I[`text-on-success-strong`]=F(re),I[`text-on-brand-weak`]=F(ee),I[`text-on-brand-weaker`]=F(ee),I[`text-on-brand-strong`]=F(A),I[`button-primary-base`]=i[11],I[`button-secondary-base`]=t?i[2]:i[0],I[`button-secondary-hover`]=t?i[3]:i[1],I[`button-ghost-hover`]=k[1],I[`button-ghost-hover2`]=k[2],I[`border-base`]=n.compact?D(.22,.16):k[6],I[`border-hover`]=n.compact?D(.28,.2):k[7],I[`border-active`]=n.compact?D(.34,.24):k[8],I[`border-selected`]=Bn(d[8],t?.9:.99),I[`border-disabled`]=n.compact?D(.18,.12):k[7],I[`border-focus`]=n.compact?D(.34,.24):k[8],I[`border-weak-base`]=n.compact?D(.1,.08):k[t?5:4],I[`border-strong-base`]=n.compact?D(.34,.24):k[t?7:6],I[`border-strong-hover`]=n.compact?D(.4,.28):k[7],I[`border-strong-active`]=n.compact?D(.46,.32):k[t?7:6],I[`border-strong-selected`]=Bn(d[5],.6),I[`border-strong-disabled`]=n.compact?D(.14,.1):k[5],I[`border-strong-focus`]=n.compact?D(.46,.32):k[t?7:6],I[`border-weak-hover`]=n.compact?D(.16,.12):k[t?6:5],I[`border-weak-active`]=n.compact?D(.22,.16):k[t?7:6],I[`border-weak-selected`]=Bn(d[4],t?.6:.5),I[`border-weak-disabled`]=n.compact?D(.08,.06):k[5],I[`border-weak-focus`]=n.compact?D(.22,.16):k[t?7:6],I[`border-weaker-base`]=n.compact?D(.06,.04):k[2],I[`border-interactive-base`]=d[6],I[`border-interactive-hover`]=d[7],I[`border-interactive-active`]=d[8],I[`border-interactive-selected`]=d[8],I[`border-interactive-disabled`]=i[7],I[`border-interactive-focus`]=d[8],I[`border-success-base`]=s[6],I[`border-success-hover`]=s[7],I[`border-success-selected`]=s[8],I[`border-warning-base`]=c[6],I[`border-warning-hover`]=c[7],I[`border-warning-selected`]=c[8],I[`border-critical-base`]=l[6],I[`border-critical-hover`]=l[7],I[`border-critical-selected`]=l[8],I[`border-info-base`]=u[6],I[`border-info-hover`]=u[7],I[`border-info-selected`]=u[8],I[`border-color`]=`#ffffff`,I[`icon-base`]=n.compact&&!t?I[`text-weak`]:i[t?9:8],I[`icon-hover`]=n.compact&&!t?I[`text-base`]:i[10],I[`icon-active`]=n.compact&&!t?I[`text-strong`]:i[11],I[`icon-selected`]=n.compact&&!t?I[`text-strong`]:i[11],I[`icon-disabled`]=i[t?6:7],I[`icon-focus`]=n.compact&&!t?I[`text-strong`]:i[11],I[`icon-invert-base`]=t?i[0]:`#ffffff`,I[`icon-weak-base`]=i[t?5:6],I[`icon-weak-hover`]=i[t?11:7],I[`icon-weak-active`]=i[8],I[`icon-weak-selected`]=i[t?8:9],I[`icon-weak-disabled`]=i[t?3:5],I[`icon-weak-focus`]=i[8],I[`icon-strong-base`]=i[11],I[`icon-strong-hover`]=t?`#f6f3f3`:`#151313`,I[`icon-strong-active`]=t?`#fcfcfc`:`#020202`,I[`icon-strong-selected`]=t?`#fdfcfc`:`#020202`,I[`icon-strong-disabled`]=i[7],I[`icon-strong-focus`]=t?`#fdfcfc`:`#020202`,I[`icon-brand-base`]=t?`#ffffff`:i[11],I[`icon-interactive-base`]=d[8],I[`icon-success-base`]=s[t?8:6],I[`icon-success-hover`]=s[9],I[`icon-success-active`]=s[10],I[`icon-warning-base`]=f[t?8:6],I[`icon-warning-hover`]=f[9],I[`icon-warning-active`]=f[10],I[`icon-critical-base`]=l[t?8:9],I[`icon-critical-hover`]=l[9],I[`icon-critical-active`]=l[10],I[`icon-info-base`]=u[t?8:6],I[`icon-info-hover`]=u[t?9:7],I[`icon-info-active`]=u[10],I[`icon-on-brand-base`]=F(ee),I[`icon-on-brand-hover`]=F(A),I[`icon-on-brand-selected`]=F(A),I[`icon-on-interactive-base`]=F(te),I[`icon-agent-plan-base`]=u[8],I[`icon-agent-docs-base`]=f[8],I[`icon-agent-ask-base`]=p[8],I[`icon-agent-build-base`]=d[t?10:8],I[`icon-on-success-base`]=F(N),I[`icon-on-success-hover`]=F(re),I[`icon-on-success-selected`]=F(re),I[`icon-on-warning-base`]=F(ie),I[`icon-on-warning-hover`]=F(oe),I[`icon-on-warning-selected`]=F(oe),I[`icon-on-critical-base`]=F(se),I[`icon-on-critical-hover`]=F(ce),I[`icon-on-critical-selected`]=F(ce),I[`icon-on-info-base`]=F(le),I[`icon-on-info-hover`]=F(de),I[`icon-on-info-selected`]=F(de),I[`icon-diff-add-base`]=m[10],I[`icon-diff-add-hover`]=m[t?9:11],I[`icon-diff-add-active`]=m[t?10:11],I[`icon-diff-delete-base`]=h[9],I[`icon-diff-delete-hover`]=h[10],I[`icon-diff-modified-base`]=C(),n.compact&&(I[`syntax-comment`]=`var(--text-weak)`,I[`syntax-regexp`]=`var(--text-base)`,I[`syntax-string`]=S(n.success,s),I[`syntax-keyword`]=S(n.accent,o),I[`syntax-primitive`]=S(n.primary,a),I[`syntax-operator`]=t?`var(--text-weak)`:`var(--text-base)`,I[`syntax-variable`]=`var(--text-strong)`,I[`syntax-property`]=S(n.info,u),I[`syntax-type`]=S(n.warning,c),I[`syntax-constant`]=S(n.accent,o),I[`syntax-punctuation`]=t?`var(--text-weak)`:`var(--text-base)`,I[`syntax-object`]=`var(--text-strong)`,I[`syntax-success`]=s[10],I[`syntax-warning`]=f[10],I[`syntax-critical`]=l[10],I[`syntax-info`]=S(n.info,u),I[`syntax-diff-add`]=m[10],I[`syntax-diff-delete`]=h[10],I[`syntax-diff-unknown`]=`#ff0000`,I[`markdown-heading`]=S(n.primary,a),I[`markdown-text`]=I[`text-base`],I[`markdown-link`]=S(n.interactive,d),I[`markdown-link-text`]=S(n.info,u),I[`markdown-code`]=S(n.success,s),I[`markdown-block-quote`]=S(n.warning,c),I[`markdown-emph`]=S(n.warning,c),I[`markdown-strong`]=S(n.accent,o),I[`markdown-horizontal-rule`]=I[`border-base`],I[`markdown-list-item`]=S(n.interactive,d),I[`markdown-list-enumeration`]=S(n.info,u),I[`markdown-image`]=S(n.interactive,d),I[`markdown-image-text`]=S(n.info,u),I[`markdown-code-block`]=I[`text-base`]),n.compact||(I[`syntax-comment`]=`var(--text-weak)`,I[`syntax-regexp`]=`var(--text-base)`,I[`syntax-string`]=t?`#00ceb9`:`#006656`,I[`syntax-keyword`]=`var(--text-weak)`,I[`syntax-primitive`]=t?`#ffba92`:`#fb4804`,I[`syntax-operator`]=t?`var(--text-weak)`:`var(--text-base)`,I[`syntax-variable`]=`var(--text-strong)`,I[`syntax-property`]=t?`#ff9ae2`:`#ed6dc8`,I[`syntax-type`]=t?`#ecf58c`:`#596600`,I[`syntax-constant`]=t?`#93e9f6`:`#007b80`,I[`syntax-punctuation`]=t?`var(--text-weak)`:`var(--text-base)`,I[`syntax-object`]=`var(--text-strong)`,I[`syntax-success`]=s[10],I[`syntax-warning`]=f[10],I[`syntax-critical`]=l[10],I[`syntax-info`]=t?`#93e9f6`:`#0092a8`,I[`syntax-diff-add`]=m[10],I[`syntax-diff-delete`]=h[10],I[`syntax-diff-unknown`]=`#ff0000`,I[`markdown-heading`]=t?`#9d7cd8`:`#d68c27`,I[`markdown-text`]=t?`#eeeeee`:`#1a1a1a`,I[`markdown-link`]=t?`#fab283`:`#3b7dd8`,I[`markdown-link-text`]=t?`#56b6c2`:`#318795`,I[`markdown-code`]=t?`#7fd88f`:`#3d9a57`,I[`markdown-block-quote`]=t?`#e5c07b`:`#b0851f`,I[`markdown-emph`]=t?`#e5c07b`:`#b0851f`,I[`markdown-strong`]=t?`#f5a742`:`#d68c27`,I[`markdown-horizontal-rule`]=t?`#808080`:`#8a8a8a`,I[`markdown-list-item`]=t?`#fab283`:`#3b7dd8`,I[`markdown-list-enumeration`]=t?`#56b6c2`:`#318795`,I[`markdown-image`]=t?`#fab283`:`#3b7dd8`,I[`markdown-image-text`]=t?`#56b6c2`:`#318795`,I[`markdown-code-block`]=t?`#eeeeee`:`#1a1a1a`),I[`avatar-background-pink`]=t?`#501b3f`:`#feeef8`,I[`avatar-background-mint`]=t?`#033a34`:`#e1fbf4`,I[`avatar-background-orange`]=t?`#5f2a06`:`#fff1e7`,I[`avatar-background-purple`]=t?`#432155`:`#f9f1fe`,I[`avatar-background-cyan`]=t?`#0f3058`:`#e7f9fb`,I[`avatar-background-lime`]=t?`#2b3711`:`#eefadc`,I[`avatar-text-pink`]=t?`#e34ba9`:`#cd1d8d`,I[`avatar-text-mint`]=t?`#95f3d9`:`#147d6f`,I[`avatar-text-orange`]=t?`#ff802b`:`#ed5f00`,I[`avatar-text-purple`]=t?`#9d5bd2`:`#8445bc`,I[`avatar-text-cyan`]=t?`#369eff`:`#0894b3`,I[`avatar-text-lime`]=t?`#c4f042`:`#5d770d`;for(let[e,t]of Object.entries(r))I[e]=t;if(n.compact&&`text-weak`in r&&!(`text-weaker`in r)){let e=I[`text-weak`];I[`text-weaker`]=e.startsWith(`#`)?Ln(e,{l:t?-.12:.12,c:.75}):e}return n.compact&&(`markdown-text`in r||(I[`markdown-text`]=I[`text-base`]),`markdown-code-block`in r||(I[`markdown-code-block`]=I[`text-base`])),`text-stronger`in r||(I[`text-stronger`]=I[`text-strong`]),I}function Hn(e){let t=e;if(t.palette&&t.seeds)throw Error("Theme variant cannot define both `palette` and `seeds`");if(e.palette)return{compact:!0,neutral:e.palette.neutral,ink:e.palette.ink,primary:e.palette.primary,accent:e.palette.accent??e.palette.info,success:e.palette.success,warning:e.palette.warning,error:e.palette.error,info:e.palette.info,interactive:e.palette.interactive??e.palette.primary,diffAdd:e.palette.diffAdd,diffDelete:e.palette.diffDelete};if(e.seeds)return{compact:!1,neutral:e.seeds.neutral,ink:void 0,primary:e.seeds.primary,accent:e.seeds.info,success:e.seeds.success,warning:e.seeds.warning,error:e.seeds.error,info:e.seeds.info,interactive:e.seeds.interactive,diffAdd:e.seeds.diffAdd,diffDelete:e.seeds.diffDelete};throw Error("Theme variant requires `palette` or `seeds`")}function Un(e,t){return(t?[.038,.066,.1,.142,.19,.252,.334,.446,.58,.718,.854,.985]:[.03,.06,.1,.145,.2,.265,.35,.47,.61,.74,.86,.97]).map(t=>zn(e[11],e[0],t))}function Wn(e){if(e?.startsWith(`#`))return e}function Gn(e){return Object.entries(e).map(([e,t])=>`--${e}: ${t};`).join(`
|
|
3
|
+
`)}var Kn=`#ffffffff`,qn={"v2-avatar-fg":Kn,"v2-avatar-bg-orange":`#ee7330ff`,"v2-avatar-border-orange":`#d16427ff`,"v2-avatar-bg-yellow":`#e7af36ff`,"v2-avatar-border-yellow":`#cb9f34ff`,"v2-avatar-bg-cyan":`#0096b8ff`,"v2-avatar-border-cyan":`#007d9bff`,"v2-avatar-bg-green":`#2eaf5aff`,"v2-avatar-border-green":`#198b43ff`,"v2-avatar-bg-red":`#d92e3cff`,"v2-avatar-border-red":`#b82d35ff`,"v2-avatar-bg-pink":`#e4429eff`,"v2-avatar-border-pink":`#c83d8bff`,"v2-avatar-bg-blue":`#3250dfff`,"v2-avatar-border-blue":`#2c47c8ff`,"v2-avatar-bg-purple":`#623be2ff`,"v2-avatar-border-purple":`#5230c2ff`,"v2-avatar-bg-gray":`#5c5c5cff`,"v2-avatar-border-gray":`#3a3a3aff`},Jn={"v2-avatar-fg":Kn,"v2-avatar-bg-orange":`#723d22ff`,"v2-avatar-border-orange":`#ff8648ff`,"v2-avatar-bg-yellow":`#68552bff`,"v2-avatar-border-yellow":`#e7af36ff`,"v2-avatar-bg-cyan":`#005a6eff`,"v2-avatar-border-cyan":`#0096b8ff`,"v2-avatar-bg-green":`#196130ff`,"v2-avatar-border-green":`#49c970ff`,"v2-avatar-bg-red":`#7a1f23ff`,"v2-avatar-border-red":`#d92e3cff`,"v2-avatar-bg-pink":`#8c2d61ff`,"v2-avatar-border-pink":`#e4429eff`,"v2-avatar-bg-blue":`#263fa9ff`,"v2-avatar-border-blue":`#7698fdff`,"v2-avatar-bg-purple":`#361f83ff`,"v2-avatar-border-purple":`#7152f4ff`,"v2-avatar-bg-gray":`#5c5c5cff`,"v2-avatar-border-gray":`#aeaeaeff`},J=e=>`var(--${e})`,Yn={"v2-agent-plan-solid":J(`v2-pink-800`),"v2-agent-plan-border":`rgba(200, 61, 139, 0.20)`,"v2-agent-plan-background":`rgba(253, 236, 243, 0.10)`,"v2-agent-build-solid":J(`v2-blue-800`),"v2-agent-build-border":`rgba(44, 71, 200, 0.20)`,"v2-agent-build-background":`rgba(236, 241, 254, 0.10)`,"v2-agent-explore-solid":J(`v2-yellow-900`),"v2-agent-explore-border":`rgba(203, 159, 52, 0.20)`,"v2-agent-explore-background":`rgba(254, 250, 236, 0.1)`,"v2-agent-review-solid":J(`v2-green-800`),"v2-agent-writer-solid":J(`v2-purple-700`)},Xn={"v2-agent-plan-solid":J(`v2-pink-400`),"v2-agent-plan-border":`rgba(247, 153, 198, 0.20)`,"v2-agent-plan-background":`rgba(170, 53, 118, 0.05)`,"v2-agent-build-solid":J(`v2-blue-300`),"v2-agent-build-border":`rgba(162, 188, 255, 0.20)`,"v2-agent-build-background":`rgba(38, 63, 169, 0.05)`,"v2-agent-explore-solid":J(`v2-yellow-300`),"v2-agent-explore-border":`rgba(243, 218, 155, 0.20)`,"v2-agent-explore-background":`rgba(172, 136, 51, 0.05)`,"v2-agent-review-solid":J(`v2-green-300`),"v2-agent-writer-solid":J(`v2-purple-400`)},Zn={"v2-background-bg-base":J(`v2-grey-100`),"v2-background-bg-deep":J(`v2-grey-200`),"v2-background-bg-layer-01":J(`v2-grey-300`),"v2-background-bg-layer-02":J(`v2-grey-400`),"v2-background-bg-layer-03":J(`v2-grey-500`),"v2-background-bg-layer-04":J(`v2-grey-600`),"v2-background-bg-inverse":J(`v2-grey-1000`),"v2-background-bg-contrast":J(`v2-grey-900`),"v2-background-bg-icon-button-contrast":J(`v2-background-bg-contrast`),"v2-background-bg-button-neutral":J(`v2-grey-100`),"v2-background-bg-accent":J(`v2-blue-600`),"v2-background-bg-code-path":J(`v2-cyan-100`),"v2-text-text-inverse":J(`v2-grey-100`),"v2-text-text-contrast":J(`v2-grey-100`),"v2-text-text-accent":J(`v2-blue-600`),"v2-text-text-accent-hover":J(`v2-blue-700`),"v2-text-text-code-accent":J(`v2-blue-900`),"v2-text-text-code-path":J(`v2-blue-900`),"v2-border-border-muted":J(`v2-alpha-dark-8`),"v2-border-border-base":J(`v2-alpha-dark-10`),"v2-border-border-strong":J(`v2-alpha-dark-20`),"v2-border-border-inverse":J(`v2-grey-1000`),"v2-border-border-focus":J(`v2-blue-500`),"v2-overlay-simple-overlay-hover":J(`v2-alpha-dark-4`),"v2-overlay-simple-overlay-pressed":J(`v2-alpha-dark-8`),"v2-overlay-simple-overlay-contrast-hover":J(`v2-alpha-light-12`),"v2-overlay-simple-overlay-contrast-pressed":J(`v2-alpha-light-24`),"v2-overlay-simple-overlay-scrim":J(`v2-alpha-dark-40`),"v2-overlay-gradient-depth-overlay-depth-top":J(`v2-alpha-light-100`),"v2-overlay-gradient-depth-overlay-depth-bot":J(`v2-alpha-light-0`),"v2-overlay-simple-tab-active-scrim":`#fafafa00`,"v2-overlay-simple-tab-hover-scrim":`#eeeeee00`,"v2-overlay-simple-tab-scrim":`#fafafa00`,"v2-state-bg-success":J(`v2-green-100`),"v2-state-fg-success":J(`v2-green-800`),"v2-state-border-success":J(`v2-green-300`),"v2-state-bg-warning":J(`v2-yellow-100`),"v2-state-fg-warning":J(`v2-yellow-800`),"v2-state-border-warning":J(`v2-yellow-300`),"v2-state-bg-danger":J(`v2-red-100`),"v2-state-fg-danger":J(`v2-red-800`),"v2-state-border-danger":J(`v2-red-300`),"v2-state-bg-info":J(`v2-blue-200`),"v2-state-fg-info":J(`v2-blue-800`),"v2-state-border-info":J(`v2-blue-300`),...Yn,...qn,"v2-elevation-raised":`0px 2px 4px 0px var(--v2-alpha-dark-4), 0px 1px 2px -1px var(--v2-alpha-dark-8), 0px 0px 0px 0.5px var(--v2-alpha-dark-12), 0px 0px 0px 0px var(--v2-alpha-dark-0)`,"v2-elevation-floating":`0px 8px 16px 0px var(--v2-alpha-dark-4), 0px 4px 8px 0px var(--v2-alpha-dark-8), 0px 0px 0px 0.5px var(--v2-alpha-dark-12), 0px 0px 0px 0px var(--v2-alpha-dark-0)`,"v2-elevation-overlay":`0px 16px 32px 0px var(--v2-alpha-dark-4), 0px 8px 16px 0px var(--v2-alpha-dark-8), 0px 0px 0px 0.5px var(--v2-alpha-dark-12), 0px 0px 0px 0px var(--v2-alpha-dark-0)`,"v2-elevation-button-neutral":`0px 1px 1.5px 0px var(--v2-alpha-dark-10), 0px 0px 0px 0.5px var(--v2-alpha-dark-14), 0px 0px 0px 0px var(--v2-alpha-dark-0)`,"v2-elevation-button-contrast":`0px 1px 1.5px 0px var(--v2-alpha-dark-20), 0px 0px 0px 0.5px var(--v2-grey-800), inset 0px 1px 2px 0px var(--v2-alpha-light-14), inset 0px -1px 2px 0px var(--v2-alpha-dark-6), 0px 0px 0px 0px var(--v2-alpha-dark-0)`,"v2-elevation-elements":`0px 0.5px 0.5px 0px var(--v2-alpha-dark-40)`,"v2-elevation-switch-off":`inset 0px 1px 1px 0px var(--v2-alpha-dark-8), inset 0px 0.5px 0.5px 0px var(--v2-alpha-dark-8), inset 0px 0px 0px 0.5px var(--v2-alpha-dark-10)`,"v2-elevation-switch-on":`inset 0px 2px 2px 0px var(--v2-alpha-dark-10), inset 0px 1px 1px 0px var(--v2-alpha-dark-10), inset 0px 0px 0px 0.5px var(--v2-alpha-dark-20)`,"v2-illustration-illustration-layer-01":J(`v2-grey-300`),"v2-illustration-illustration-layer-02":J(`v2-grey-400`),"v2-illustration-illustration-layer-03":J(`v2-grey-500`)},Qn={"v2-background-bg-base":J(`v2-grey-1000`),"v2-background-bg-deep":J(`v2-grey-1100`),"v2-background-bg-layer-01":J(`v2-grey-800`),"v2-background-bg-layer-02":J(`v2-grey-600`),"v2-background-bg-layer-03":J(`v2-grey-500`),"v2-background-bg-layer-04":J(`v2-grey-400`),"v2-background-bg-inverse":J(`v2-grey-100`),"v2-background-bg-contrast":J(`v2-grey-700`),"v2-background-bg-icon-button-contrast":J(`v2-grey-400`),"v2-background-bg-button-neutral":J(`v2-alpha-light-6`),"v2-background-bg-accent":J(`v2-blue-600`),"v2-background-bg-code-path":J(`v2-cyan-1200`),"v2-text-text-inverse":J(`v2-grey-1000`),"v2-text-text-contrast":J(`v2-grey-100`),"v2-text-text-accent":J(`v2-blue-400`),"v2-text-text-accent-hover":J(`v2-blue-300`),"v2-text-text-code-accent":J(`v2-blue-400`),"v2-text-text-code-path":J(`v2-blue-300`),"v2-border-border-muted":J(`v2-alpha-light-8`),"v2-border-border-base":J(`v2-alpha-light-10`),"v2-border-border-strong":J(`v2-alpha-light-20`),"v2-border-border-inverse":J(`v2-grey-100`),"v2-border-border-focus":J(`v2-blue-500`),"v2-overlay-simple-overlay-hover":J(`v2-alpha-light-6`),"v2-overlay-simple-overlay-pressed":J(`v2-alpha-light-10`),"v2-overlay-simple-overlay-contrast-hover":J(`v2-alpha-dark-24`),"v2-overlay-simple-overlay-contrast-pressed":J(`v2-alpha-dark-40`),"v2-overlay-simple-overlay-scrim":J(`v2-alpha-dark-60`),"v2-overlay-gradient-depth-overlay-depth-top":J(`v2-alpha-light-100`),"v2-overlay-gradient-depth-overlay-depth-bot":J(`v2-alpha-light-0`),"v2-overlay-simple-tab-active-scrim":`#24242400`,"v2-overlay-simple-tab-hover-scrim":`#3a3a3a00`,"v2-overlay-simple-tab-scrim":`#08080800`,"v2-state-bg-success":J(`v2-green-1200`),"v2-state-fg-success":J(`v2-green-500`),"v2-state-border-success":J(`v2-green-900`),"v2-state-bg-warning":J(`v2-yellow-1200`),"v2-state-fg-warning":J(`v2-yellow-500`),"v2-state-border-warning":J(`v2-yellow-900`),"v2-state-bg-danger":J(`v2-red-1200`),"v2-state-fg-danger":J(`v2-red-500`),"v2-state-border-danger":J(`v2-red-900`),"v2-state-bg-info":J(`v2-blue-1200`),"v2-state-fg-info":J(`v2-blue-500`),"v2-state-border-info":J(`v2-blue-900`),...Xn,...Jn,"v2-elevation-raised":`0px 2px 4px 0px var(--v2-alpha-dark-30), 0px 1px 2px 0px var(--v2-alpha-dark-30), 0px 0px 0px 0.5px var(--v2-alpha-light-16), 0px -0.5px 0px 0px var(--v2-alpha-light-6)`,"v2-elevation-floating":`0px 8px 16px 0px var(--v2-alpha-dark-30), 0px 4px 8px 0px var(--v2-alpha-dark-30), 0px 0px 0px 0.5px var(--v2-alpha-light-16), 0px -0.5px 0px 0px var(--v2-alpha-light-6)`,"v2-elevation-overlay":`0px 16px 32px 0px var(--v2-alpha-dark-30), 0px 8px 16px 0px var(--v2-alpha-dark-30), 0px 0px 0px 0.5px var(--v2-alpha-light-16), 0px -0.5px 0px 0px var(--v2-alpha-light-6)`,"v2-elevation-button-neutral":`0px 1px 2px 0px var(--v2-alpha-dark-40), 0px 0px 0px 0.5px var(--v2-alpha-light-20), 0px -0.5px 0px 0px var(--v2-alpha-light-10)`,"v2-elevation-button-contrast":`0px 1px 2px 0px var(--v2-alpha-dark-40), 0px 0px 0px 0.5px var(--v2-alpha-light-40), inset 0px 0px 0px 0px var(--v2-alpha-light-0), inset 0px 0px 0px 0px var(--v2-alpha-light-0), 0px -0.5px 0px 0px var(--v2-alpha-light-30)`,"v2-elevation-elements":`0px 0.5px 0.5px 0px var(--v2-alpha-dark-40)`,"v2-elevation-switch-off":`inset 0px -0.5px 0px 0px var(--v2-alpha-light-10), inset 0px 0px 0px 0px var(--v2-alpha-light-0), inset 0px 0px 0px 0.5px var(--v2-alpha-light-16)`,"v2-elevation-switch-on":`inset 0px -0.5px 0px 0px var(--v2-alpha-light-10), inset 0px 0px 0px 0px var(--v2-alpha-light-0), inset 0px 0px 0px 0.5px var(--v2-alpha-light-16)`,"v2-illustration-illustration-layer-01":J(`v2-grey-900`),"v2-illustration-illustration-layer-02":J(`v2-grey-800`),"v2-illustration-illustration-layer-03":J(`v2-grey-700`)};function $n(e){return e?Qn:Zn}function er(...e){return Object.assign({},...e)}var tr=[100,200,300,400,500,600,700,800,900,1e3,1100,1200],nr=e=>`var(--v2-grey-${e})`;function rr(e,t){let n=e[`v2-grey-${t}`];if(typeof n==`string`&&n.startsWith(`#`))return n}function ir(e,t){let n=e.match(/^var\(--v2-grey-(\d+)\)$/)?.[1];if(!n)throw Error(`Expected grey primitive ref, got ${e}`);let r=rr(t,Number(n));if(!r)throw Error(`Missing grey primitive v2-grey-${n}`);return r}function ar(e,t,n,r){let i=tr.filter(r=>{let i=rr(e,r);return i&&Rn(i,t)>=n});return i.length===0?r:i.reduce((e,t)=>Math.abs(t-r)<Math.abs(e-r)?t:e)}function or(e,t,n,r={}){let i=jn(e),a=Ln(e,{l:t?Math.max(0,.88-i.l)*.4:-Math.max(0,i.l-.18)*.24,c:t?1.04:1.02}),o=$n(t),s=ir(o[`v2-background-bg-base`],n),c=ir(o[`v2-background-bg-contrast`],n),l=ir(o[`v2-background-bg-inverse`],n),u=jn(l).l>.55?1100:rr(n,50)?50:100;return{"v2-text-text-base":t?zn(`#ffffff`,a,.9):Ln(a,{l:-.07,c:1.04}),"v2-text-text-muted":r[`text-weak`]??Ln(a,{l:t?-.11:.11,c:.9}),"v2-text-text-faint":Ln(a,{l:t?-.2:.21,c:t?.78:.72}),"v2-icon-icon-base":nr(ar(n,s,7,t?400:800)),"v2-icon-icon-muted":nr(ar(n,s,3,600)),"v2-icon-icon-faint":nr(ar(n,s,1.5,500)),"v2-icon-icon-inverse":nr(ar(n,l,7,u)),"v2-icon-icon-contrast":nr(ar(n,c,7,100)),"v2-icon-icon-accent":t?`var(--v2-blue-400)`:`var(--v2-blue-600)`,"v2-icon-icon-accent-hover":t?`var(--v2-blue-300)`:`var(--v2-blue-700)`}}var sr={"v2-grey-50":`#ffffffff`,"v2-grey-100":`#fafafaff`,"v2-grey-200":`#f2f2f2ff`,"v2-grey-300":`#eeeeeeff`,"v2-grey-400":`#dbdbdbff`,"v2-grey-500":`#aeaeaeff`,"v2-grey-600":`#808080ff`,"v2-grey-700":`#5c5c5cff`,"v2-grey-800":`#3a3a3aff`,"v2-grey-900":`#2e2e2eff`,"v2-grey-1000":`#242424ff`,"v2-grey-1100":`#161616ff`,"v2-grey-1200":`#080808ff`,"v2-red-100":`#fcecebff`,"v2-red-200":`#f6d5d3ff`,"v2-red-300":`#f2bbb7ff`,"v2-red-400":`#f29b96ff`,"v2-red-500":`#f17471ff`,"v2-red-600":`#f1484fff`,"v2-red-700":`#d92e3cff`,"v2-red-800":`#b82d35ff`,"v2-red-900":`#97252bff`,"v2-red-1000":`#7a1f23ff`,"v2-red-1100":`#5f1a1cff`,"v2-red-1200":`#461516ff`,"v2-orange-100":`#fdf2edff`,"v2-orange-200":`#ffe7dcff`,"v2-orange-300":`#ffd8c6ff`,"v2-orange-400":`#ffc1a4ff`,"v2-orange-500":`#ffa478ff`,"v2-orange-600":`#ff8648ff`,"v2-orange-700":`#ee7330ff`,"v2-orange-800":`#d16427ff`,"v2-orange-900":`#b35624ff`,"v2-orange-1000":`#954c27ff`,"v2-orange-1100":`#723d22ff`,"v2-orange-1200":`#5a2c14ff`,"v2-yellow-100":`#fefaecff`,"v2-yellow-200":`#fcefd0ff`,"v2-yellow-300":`#f7e5b5ff`,"v2-yellow-400":`#f3da9bff`,"v2-yellow-500":`#f2cf76ff`,"v2-yellow-600":`#f6c251ff`,"v2-yellow-700":`#e7af36ff`,"v2-yellow-800":`#cb9f34ff`,"v2-yellow-900":`#ac8833ff`,"v2-yellow-1000":`#8e7231ff`,"v2-yellow-1100":`#68552bff`,"v2-yellow-1200":`#4b4025ff`,"v2-green-100":`#e7f9eaff`,"v2-green-200":`#d0f0d5ff`,"v2-green-300":`#b8e9c1ff`,"v2-green-400":`#96e3a6ff`,"v2-green-500":`#6bd586ff`,"v2-green-600":`#49c970ff`,"v2-green-700":`#2eaf5aff`,"v2-green-800":`#198b43ff`,"v2-green-900":`#1d783cff`,"v2-green-1000":`#196130ff`,"v2-green-1100":`#164c26ff`,"v2-green-1200":`#14361dff`,"v2-cyan-100":`#e2f7fbff`,"v2-cyan-200":`#c4edf4ff`,"v2-cyan-300":`#a3e4efff`,"v2-cyan-400":`#65d9ebff`,"v2-cyan-500":`#00c5dfff`,"v2-cyan-600":`#00abcfff`,"v2-cyan-700":`#0096b8ff`,"v2-cyan-800":`#007d9bff`,"v2-cyan-900":`#006c85ff`,"v2-cyan-1000":`#005a6eff`,"v2-cyan-1100":`#004756ff`,"v2-cyan-1200":`#00353fff`,"v2-blue-100":`#f5f8ffff`,"v2-blue-200":`#ecf1feff`,"v2-blue-300":`#c3d4fdff`,"v2-blue-400":`#a2bcffff`,"v2-blue-500":`#7698fdff`,"v2-blue-600":`#3b5cf6ff`,"v2-blue-700":`#0b34f4ff`,"v2-blue-800":`#3250dfff`,"v2-blue-900":`#2c47c8ff`,"v2-blue-1000":`#263fa9ff`,"v2-blue-1100":`#22388fff`,"v2-blue-1200":`#021945ff`,"v2-purple-100":`#ebecfeff`,"v2-purple-200":`#d5d5fcff`,"v2-purple-300":`#b9b8f5ff`,"v2-purple-400":`#9e99f7ff`,"v2-purple-500":`#8271f8ff`,"v2-purple-600":`#7152f4ff`,"v2-purple-700":`#623be2ff`,"v2-purple-800":`#5230c2ff`,"v2-purple-900":`#442aa1ff`,"v2-purple-1000":`#361f83ff`,"v2-purple-1100":`#2b1b6aff`,"v2-purple-1200":`#221358ff`,"v2-pink-100":`#fdecf3ff`,"v2-pink-200":`#f7d5e4ff`,"v2-pink-300":`#fabcd8ff`,"v2-pink-400":`#f799c6ff`,"v2-pink-500":`#f26cb2ff`,"v2-pink-600":`#f64aabff`,"v2-pink-700":`#e4429eff`,"v2-pink-800":`#c83d8bff`,"v2-pink-900":`#aa3576ff`,"v2-pink-1000":`#8c2d61ff`,"v2-pink-1100":`#6f284fff`,"v2-pink-1200":`#5c1d3fff`},cr=[100,200,300,400,500,600,700,800,900,1e3,1100,1200];function lr(e,t,n){return Math.max(t,Math.min(n,e))}function ur(e,t){let n=jn(e),r=t?1:1.05,i=[.99,.965,.93,.885,.835,lr(n.l,.48,.72),lr(n.l-.07,.4,.64),lr(n.l-.14,.32,.55),lr(n.l-.21,.24,.46),lr(n.l-.28,.17,.38),lr(n.l-.34,.12,.3),lr(n.l-.4,.08,.22)],a=[.28,.48,.68,.86,1.02,1.28,1.34,1.28,1.18,1.08,.98,.88];return i.map((e,t)=>Nn({l:e,c:n.c*a[t]*r,h:n.h}))}function dr(e,t,n){let r=Fn(e,n,t);return n?r.toReversed():r}function fr(e,t){let n={};for(let r=0;r<cr.length;r++)n[`v2-${e}-${cr[r]}`]=t[r];return n}function pr(e){if(`palette`in e&&e.palette){let t=e.palette;return{neutral:t.neutral,ink:t.ink,primary:t.primary,accent:t.accent??t.info,success:t.success,warning:t.warning,error:t.error,info:t.info,interactive:t.interactive??t.primary,diffAdd:t.diffAdd??Ln(t.success,{c:.55,l:.14}),diffDelete:t.diffDelete??t.error}}if(`seeds`in e&&e.seeds){let t=e.seeds;return{neutral:t.neutral,ink:t.neutral,primary:t.primary,accent:t.info,success:t.success,warning:t.warning,error:t.error,info:t.info,interactive:t.interactive,diffAdd:t.diffAdd,diffDelete:t.diffDelete}}throw Error("Theme variant requires `palette` or `seeds`")}function mr(e,t){let n=pr(e),r=dr(n.neutral,n.ink,t),i=ur(n.interactive,t),a=ur(n.success,t),o=ur(n.warning,t),s=ur(n.error,t),c=ur(n.accent,t),l=ur(n.info,t),u=ur(Ln(n.warning,{h:-22,l:-.082,c:.94}),t),d=ur(Ln(n.info,{h:-12,l:.128,c:1.12}),t);return{...sr,...fr(`grey`,r),...fr(`blue`,i),...fr(`green`,a),...fr(`yellow`,o),...fr(`red`,s),...fr(`purple`,c),...fr(`pink`,l),...fr(`orange`,u),...fr(`cyan`,d)}}function hr(e,t){let n=mr(e,t);return er(n,$n(t),or(pr(e).ink,t,n,e.overrides),e.v2Overrides??{})}function gr(e){return Object.entries(e).map(([e,t])=>`--${e}: ${t};`).join(`
|
|
4
|
+
`)}var _r=`modulepreload`,vr=function(e){return`/`+e},yr={},Y=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=vr(t,n),t=s(t),t in yr)return;yr[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:_r,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},br={THEME_ID:`opencode-theme-id`,COLOR_SCHEME:`opencode-color-scheme`,THEME_CSS_LIGHT:`opencode-theme-css-light`,THEME_CSS_DARK:`opencode-theme-css-dark`},xr=`oc-theme`,Sr,Cr,wr;function Tr(){return Sr||(Sr=Object.assign({"./themes/amoled.json":()=>Y(()=>import(`./amoled-DB5yy8ad.js`),[]),"./themes/aura.json":()=>Y(()=>import(`./aura-BpwPh8WE.js`),[]),"./themes/ayu.json":()=>Y(()=>import(`./ayu-BkUPVVqh.js`),[]),"./themes/carbonfox.json":()=>Y(()=>import(`./carbonfox-Bo2FTw5U.js`),[]),"./themes/catppuccin-frappe.json":()=>Y(()=>import(`./catppuccin-frappe-DIKI31zD.js`),[]),"./themes/catppuccin-macchiato.json":()=>Y(()=>import(`./catppuccin-macchiato-DYnJ67qk.js`),[]),"./themes/catppuccin.json":()=>Y(()=>import(`./catppuccin-DK9M8P0P.js`),[]),"./themes/cobalt2.json":()=>Y(()=>import(`./cobalt2-DQbhSfAX.js`),[]),"./themes/cursor.json":()=>Y(()=>import(`./cursor-t2F-UZH_.js`),[]),"./themes/dracula.json":()=>Y(()=>import(`./dracula-C3s659y-.js`),[]),"./themes/everforest.json":()=>Y(()=>import(`./everforest-BEfZxV1e.js`),[]),"./themes/flexoki.json":()=>Y(()=>import(`./flexoki-Dj5gUbwm.js`),[]),"./themes/github.json":()=>Y(()=>import(`./github-DukYz3BY.js`),[]),"./themes/gruvbox.json":()=>Y(()=>import(`./gruvbox-mhPG2W60.js`),[]),"./themes/kanagawa.json":()=>Y(()=>import(`./kanagawa-D0YhNhTs.js`),[]),"./themes/lucent-orng.json":()=>Y(()=>import(`./lucent-orng-DLA2Fg5T.js`),[]),"./themes/material.json":()=>Y(()=>import(`./material-BoIUTXek.js`),[]),"./themes/matrix.json":()=>Y(()=>import(`./matrix-CeUtxxjs.js`),[]),"./themes/mercury.json":()=>Y(()=>import(`./mercury-DIlqACMb.js`),[]),"./themes/monokai.json":()=>Y(()=>import(`./monokai-wFuGqe6w.js`),[]),"./themes/nightowl.json":()=>Y(()=>import(`./nightowl-D5RifUq0.js`),[]),"./themes/nord.json":()=>Y(()=>import(`./nord-BUnqvSkw.js`),[]),"./themes/oc-2.json":()=>Y(()=>Promise.resolve().then(()=>gn),void 0),"./themes/one-dark.json":()=>Y(()=>import(`./one-dark-MycZLZtN.js`),[]),"./themes/onedarkpro.json":()=>Y(()=>import(`./onedarkpro-BWy38d_X.js`),[]),"./themes/opencode.json":()=>Y(()=>import(`./opencode-Cy-bxafp.js`),[]),"./themes/orng.json":()=>Y(()=>import(`./orng-D2APmIHg.js`),[]),"./themes/osaka-jade.json":()=>Y(()=>import(`./osaka-jade-DnfGjKZL.js`),[]),"./themes/palenight.json":()=>Y(()=>import(`./palenight-DG9raf7e.js`),[]),"./themes/rosepine.json":()=>Y(()=>import(`./rosepine-CVx-z9QY.js`),[]),"./themes/shadesofpurple.json":()=>Y(()=>import(`./shadesofpurple-dFPspHnY.js`),[]),"./themes/solarized.json":()=>Y(()=>import(`./solarized-19OwMz-R.js`),[]),"./themes/synthwave84.json":()=>Y(()=>import(`./synthwave84-D5i2TsvP.js`),[]),"./themes/tokyonight.json":()=>Y(()=>import(`./tokyonight-DLjt3AtF.js`),[]),"./themes/vercel.json":()=>Y(()=>import(`./vercel-DiG3Swzk.js`),[]),"./themes/vesper.json":()=>Y(()=>import(`./vesper-BArq_vZH.js`),[]),"./themes/zenburn.json":()=>Y(()=>import(`./zenburn-COSjCZYx.js`),[])}),Sr)}function Er(){return Cr||(Cr=Object.keys(Tr()).map(e=>e.slice(9,-5)).sort(),Cr)}function Dr(){return wr||(wr=new Set(Er()),wr)}var Or={"oc-2":`OC-2`,amoled:`AMOLED`,aura:`Aura`,ayu:`Ayu`,carbonfox:`Carbonfox`,catppuccin:`Catppuccin`,"catppuccin-frappe":`Catppuccin Frappe`,"catppuccin-macchiato":`Catppuccin Macchiato`,cobalt2:`Cobalt2`,cursor:`Cursor`,dracula:`Dracula`,everforest:`Everforest`,flexoki:`Flexoki`,github:`GitHub`,gruvbox:`Gruvbox`,kanagawa:`Kanagawa`,"lucent-orng":`Lucent Orng`,material:`Material`,matrix:`Matrix`,mercury:`Mercury`,monokai:`Monokai`,nightowl:`Night Owl`,nord:`Nord`,"one-dark":`One Dark`,onedarkpro:`One Dark Pro`,opencode:`OpenCode`,orng:`Orng`,"osaka-jade":`Osaka Jade`,palenight:`Palenight`,rosepine:`Rose Pine`,shadesofpurple:`Shades of Purple`,solarized:`Solarized`,synthwave84:`Synthwave '84`,tokyonight:`Tokyonight`,vercel:`Vercel`,vesper:`Vesper`,zenburn:`Zenburn`},kr=Sn;function Ar(e,t){return e===`oc-2`||e&&(Dr().has(e)||t?.[e])?e:`oc-2`}function jr(e){if(typeof localStorage!=`object`)return null;try{return localStorage.getItem(e)}catch{return null}}function Mr(e,t){if(typeof localStorage==`object`)try{localStorage.setItem(e,t)}catch{}}function Nr(e){if(typeof localStorage==`object`)try{localStorage.removeItem(e)}catch{}}function Pr(){Nr(br.THEME_CSS_LIGHT),Nr(br.THEME_CSS_DARK)}function Fr(){let e=document.getElementById(xr);if(e)return e;let t=document.createElement(`style`);return t.id=xr,document.head.appendChild(t),t}function Ir(){return typeof window==`object`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function Lr(e,t,n){let r=n===`dark`,i=r?e.dark:e.light,a=Gn(Vn(i,r)),o=gr(hr(i,r));t!==`oc-2`&&Mr(r?br.THEME_CSS_DARK:br.THEME_CSS_LIGHT,`${a}\n ${o}`);let s=`:root {
|
|
5
|
+
color-scheme: ${n};
|
|
6
|
+
--text-mix-blend-mode: ${r?`plus-lighter`:`multiply`};
|
|
7
|
+
${a}
|
|
8
|
+
${o}
|
|
9
|
+
}`;document.getElementById(`oc-theme-preload`)?.remove(),Fr().textContent=s,document.documentElement.dataset.theme=t,document.documentElement.dataset.colorScheme=n,document.documentElement.style.backgroundColor=r?`#080808`:`#fafafa`;let c=document.querySelector(`meta[name="theme-color"]`);c&&c.setAttribute(`content`,r?`#080808`:`#fafafa`)}function Rr(e,t){if(t!==`oc-2`)for(let t of[`light`,`dark`]){let n=t===`dark`,r=n?e.dark:e.light,i=Gn(Vn(r,n)),a=gr(hr(r,n));Mr(n?br.THEME_CSS_DARK:br.THEME_CSS_LIGHT,`${i}\n ${a}`)}}var{use:zr,provider:Br}=hn({name:`Theme`,init:e=>{let t=jr(br.THEME_ID)??e.defaultTheme,n=Ar(t);t&&t!==n&&(Mr(br.THEME_ID,n),Pr());let r=jr(br.COLOR_SCHEME)??`system`,i=r===`system`?Ir():r,[a,o]=$t({themes:{"oc-2":kr},themeId:n,colorScheme:r,mode:i,previewThemeId:null,previewScheme:null}),s=new Map,c=e=>{let t=e;if(!t)return Promise.resolve(void 0);let n=a.themes[t];if(n)return Promise.resolve(n);let r=s.get(t);if(r)return r;let i=Tr()[`./themes/${t}.json`];if(!i)return Promise.resolve(void 0);let c=i().then(e=>{let n=e.default;return o(`themes`,t,n),n}).finally(()=>{s.delete(t)});return s.set(t,c),c},l=(t,n,r,i)=>{Lr(t,n,r),e.onThemeApplied?.(t,r,i)},u=()=>{let e=Object.keys(a.themes).filter(e=>!Dr().has(e)).sort(),t=Er();return e.length===0?t:[...t,...e]},d=()=>Promise.all(Er().map(c)).then(()=>a.themes),f=e=>{if(e.key===br.THEME_ID&&e.newValue){let t=Ar(e.newValue,a.themes);if(t!==e.newValue&&(Mr(br.THEME_ID,t),Pr()),o(`themeId`,t),t===`oc-2`){Pr();return}c(t).then(e=>{e&&a.themeId===t&&Rr(e,t)})}e.key===br.COLOR_SCHEME&&e.newValue&&(o(`colorScheme`,e.newValue),o(`mode`,e.newValue===`system`?Ir():e.newValue))};se(()=>{pn(window,`storage`,f),pn(window.matchMedia(`(prefers-color-scheme: dark)`),`change`,()=>{a.colorScheme===`system`&&o(`mode`,Ir())});let t=jr(br.THEME_ID)??e.defaultTheme,n=Ar(t,a.themes),r=jr(br.COLOR_SCHEME)??`system`;t&&t!==n&&(Mr(br.THEME_ID,n),Pr()),n!==a.themeId&&o(`themeId`,n),r!==a.colorScheme&&o(`colorScheme`,r),o(`mode`,r===`system`?Ir():r),c(n).then(e=>{e&&a.themeId===n&&Rr(e,n)})}),M(()=>{let e=a.themes[a.themeId];e&&l(e,a.themeId,a.mode,a.colorScheme)});let p=e=>{let t=e;if(!t){console.warn(`Theme "${e}" not found`);return}if(t!==`oc-2`&&!Dr().has(t)&&!a.themes[t]){console.warn(`Theme "${e}" not found`);return}if(o(`themeId`,t),t===`oc-2`){Mr(br.THEME_ID,t),Pr();return}c(t).then(e=>{e&&a.themeId===t&&(Rr(e,t),Mr(br.THEME_ID,t))})},m=e=>{o(`colorScheme`,e),Mr(br.COLOR_SCHEME,e),o(`mode`,e===`system`?Ir():e)};return{themeId:()=>a.themeId,colorScheme:()=>a.colorScheme,mode:()=>a.mode,ids:u,name:e=>a.themes[e]?.name??Or[e]??e,loadThemes:d,themes:()=>a.themes,setTheme:p,setColorScheme:m,registerTheme:e=>o(`themes`,e.id,e),previewTheme:e=>{let t=e;t&&(t===`oc-2`||Dr().has(t)||a.themes[t])&&(o(`previewThemeId`,t),c(t).then(e=>{if(!e||a.previewThemeId!==t)return;let n=a.previewScheme?a.previewScheme===`system`?Ir():a.previewScheme:a.mode;l(e,t,n,a.previewScheme??a.colorScheme)}))},previewColorScheme:e=>{o(`previewScheme`,e);let t=e===`system`?Ir():e,n=a.previewThemeId??a.themeId;c(n).then(r=>{r&&(a.previewThemeId??a.themeId)===n&&a.previewScheme===e&&l(r,n,t,e)})},commitPreview:()=>{a.previewThemeId&&p(a.previewThemeId),a.previewScheme&&m(a.previewScheme),o(`previewThemeId`,null),o(`previewScheme`,null)},cancelPreview:()=>{o(`previewThemeId`,null),o(`previewScheme`,null),c(a.themeId).then(e=>{e&&l(e,a.themeId,a.mode,a.colorScheme)})}}}}),Vr=Symbol(`fallback`);function Hr(e){for(let t of e)t.dispose()}function Ur(e,t,n,r={}){let i=new Map;return P(()=>Hr(i.values())),()=>{let n=e()||[];return n[g],ae(()=>{if(!n.length)return Hr(i.values()),i.clear(),r.fallback?[ee(e=>(i.set(Vr,{dispose:e}),r.fallback()))]:[];let e=Array(n.length),o=i.get(Vr);if(!i.size||o){o?.dispose(),i.delete(Vr);for(let r=0;r<n.length;r++){let i=n[r],o=t(i,r);a(e,i,r,o)}return e}let s=new Set(i.keys());for(let r=0;r<n.length;r++){let o=n[r],c=t(o,r);s.delete(c);let l=i.get(c);l?(e[r]=l.mapped,l.setIndex?.(r),l.setItem(()=>o)):a(e,o,r,c)}for(let e of s)i.get(e)?.dispose(),i.delete(e);return e})};function a(e,t,r,a){ee(o=>{let[s,c]=A(t),l={setItem:c,dispose:o};if(n.length>1){let[e,t]=A(r);l.setIndex=t,l.mapped=n(s,e)}else l.mapped=n(s);i.set(a,l),e[r]=l.mapped})}}function Wr(e){let{by:t}=e;return N(Ur(()=>e.each,typeof t==`function`?t:e=>e[t],e.children,`fallback`in e?{fallback:()=>e.fallback}:void 0))}function Gr(e,t=!1){let n=window.matchMedia(e),[r,i]=dn(t,()=>n.matches);return pn(n,`change`,()=>i(n.matches)),r}function Kr(e){return Gr(`(prefers-color-scheme: dark)`,e)}Kr.bind(void 0,!1);var qr=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function Jr(e){let t={},n;for(;n=qr.exec(e);)t[n[1]]=n[2];return t}function Yr(e,t){if(typeof e==`string`){if(typeof t==`string`)return`${e};${t}`;e=Jr(e)}else typeof t==`string`&&(t=Jr(t));return{...e,...t}}function Xr(...e){return sn(e)}function Zr(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function Qr(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $r(e){return typeof e==`number`}function ei(e){return Object.prototype.toString.call(e)===`[object String]`}function ti(e){return typeof e==`function`}function ni(e){return t=>`${e()}-${t}`}function ri(e,t){return e?e===t||e.contains(t):!1}function ii(e,t=!1){let{activeElement:n}=oi(e);if(!n?.nodeName)return null;if(si(n)&&n.contentDocument)return ii(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=oi(n).getElementById(e);if(t)return t}}return n}function ai(e){return oi(e).defaultView||window}function oi(e){return e?e.ownerDocument||e:document}function si(e){return e.tagName===`IFRAME`}var ci=(e=>(e.Escape=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`,e.Space=` `,e.ArrowDown=`ArrowDown`,e.ArrowLeft=`ArrowLeft`,e.ArrowRight=`ArrowRight`,e.ArrowUp=`ArrowUp`,e.End=`End`,e.Home=`Home`,e.PageDown=`PageDown`,e.PageUp=`PageUp`,e))(ci||{});function li(e){return typeof window>`u`||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function ui(e){return typeof window<`u`&&window.navigator!=null&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function di(){return ui(/^Mac/i)}function fi(){return ui(/^iPhone/i)}function pi(){return ui(/^iPad/i)||di()&&navigator.maxTouchPoints>1}function mi(){return fi()||pi()}function hi(){return di()||mi()}function gi(){return li(/AppleWebKit/i)&&!_i()}function _i(){return li(/Chrome/i)}function X(e,t){return t&&(ti(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function vi(e){return t=>{for(let n of e)X(t,n)}}function yi(e){return di()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function bi(e){if(e){if(Si())e.focus({preventScroll:!0});else{let t=Ci(e);e.focus(),wi(t)}}}var xi=null;function Si(){if(xi==null){xi=!1;try{document.createElement(`div`).focus({get preventScroll(){return xi=!0,!0}})}catch{}}return xi}function Ci(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function wi(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var Ti=[`input:not([type='hidden']):not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`[tabindex]`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable='false'])`],Ei=[...Ti,`[tabindex]:not([tabindex="-1"]):not([disabled])`],Di=`${Ti.join(`:not([hidden]),`)},[tabindex]:not([disabled]):not([hidden])`,Oi=Ei.join(`:not([hidden]):not([tabindex="-1"]),`);function ki(e,t){let n=Array.from(e.querySelectorAll(Di)).filter(Ai);return t&&Ai(e)&&n.unshift(e),n.forEach((e,t)=>{if(si(e)&&e.contentDocument){let r=e.contentDocument.body,i=ki(r,!1);n.splice(t,1,...i)}}),n}function Ai(e){return ji(e)&&!Mi(e)}function ji(e){return e.matches(Di)&&Ni(e)}function Mi(e){return Number.parseInt(e.getAttribute(`tabindex`)||`0`,10)<0}function Ni(e,t){return e.nodeName!==`#comment`&&Pi(e)&&Fi(e,t)&&(!e.parentElement||Ni(e.parentElement,e))}function Pi(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;let{display:t,visibility:n}=e.style,r=t!==`none`&&n!==`hidden`&&n!==`collapse`;if(r){if(!e.ownerDocument.defaultView)return r;let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:i}=t(e);r=n!==`none`&&i!==`hidden`&&i!==`collapse`}return r}function Fi(e,t){return!e.hasAttribute(`hidden`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function Ii(e,t){return t.some(t=>t.contains(e))}function Li(e,t,n){let r=t?.tabbable?Oi:Di,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return t?.from?.contains(e)?NodeFilter.FILTER_REJECT:e.matches(r)&&Ni(e)&&(!n||Ii(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}function Ri(e){let t=e;for(;t&&!zi(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function zi(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Bi(){}function Vi(e){return[e.clientX,e.clientY]}function Hi(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=a,o=0,s=e-1;o<e;s=o++){let[a,c]=t[o],[l,u]=t[s],[,d]=t[s===0?e-1:s-1]||[0,0],f=(c-u)*(n-a)-(a-l)*(r-c);if(u<c){if(r>=u&&r<c){if(f===0)return!0;f>0&&(r===u?r>d&&(i=!i):i=!i)}}else if(c<u){if(r>c&&r<=u){if(f===0)return!0;f<0&&(r===u?r<d&&(i=!i):i=!i)}}else if(r===c&&(n>=l&&n<=a||n>=a&&n<=l))return!0}return i}function Z(e,t){return z(e,t)}var Ui=new Map,Wi=new Set;function Gi(){if(typeof window>`u`||document.body===null)return;let e=e=>{if(!e.target)return;let n=Ui.get(e.target);n||(n=new Set,Ui.set(e.target,n),e.target.addEventListener(`transitioncancel`,t)),n.add(e.propertyName)},t=e=>{if(!e.target)return;let n=Ui.get(e.target);if(n&&(n.delete(e.propertyName),n.size===0&&(e.target.removeEventListener(`transitioncancel`,t),Ui.delete(e.target)),Ui.size===0)){for(let e of Wi)e();Wi.clear()}};document.body.addEventListener(`transitionrun`,e),document.body.addEventListener(`transitionend`,t)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Gi):Gi());function Ki(e,t){let n=qi(e,t,`left`),r=qi(e,t,`top`),i=t.offsetWidth,a=t.offsetHeight,o=e.scrollLeft,s=e.scrollTop,c=o+e.offsetWidth,l=s+e.offsetHeight;n<=o?o=n:n+i>c&&(o+=n+i-c),r<=s?s=r:r+a>l&&(s+=r+a-l),e.scrollLeft=o,e.scrollTop=s}function qi(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function Ji(e,t){if(document.contains(e)){let n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow!==`hidden`){let{left:n,top:r}=e.getBoundingClientRect();e?.scrollIntoView?.({block:`nearest`});let{left:i,top:a}=e.getBoundingClientRect();(Math.abs(n-i)>1||Math.abs(r-a)>1)&&(t?.containingElement?.scrollIntoView?.({block:`center`,inline:`center`}),e.scrollIntoView?.({block:`nearest`}))}else{let t=Ri(e);for(;e&&t&&e!==n&&t!==n;)Ki(t,e),e=t,t=Ri(e)}}}var Yi={border:`0`,clip:`rect(0 0 0 0)`,"clip-path":`inset(50%)`,height:`1px`,margin:`0 -1px -1px 0`,overflow:`hidden`,padding:`0`,position:`absolute`,width:`1px`,"white-space":`nowrap`},Xi=`data-kb-top-layer`,Zi,Qi=!1,$i=[];function ea(e){return $i.findIndex(t=>t.node===e)}function ta(e){return $i[ea(e)]}function na(e){return $i.length>0&&$i[$i.length-1].node===e}function ra(){return $i.filter(e=>e.isPointerBlocking)}function ia(){return[...ra()].slice(-1)[0]}function aa(){return ra().length>0}function oa(e){let t=ea(ia()?.node);return ea(e)<t}function sa(e){$i.push(e)}function ca(e){let t=ea(e);t<0||$i.splice(t,1)}function la(){for(let{node:e}of $i)e.style.pointerEvents=oa(e)?`none`:`auto`}function ua(e){if(aa()&&!Qi){let t=oi(e);Zi=document.body.style.pointerEvents,t.body.style.pointerEvents=`none`,Qi=!0}}function da(e){if(aa())return;let t=oi(e);t.body.style.pointerEvents=Zi,t.body.style.length===0&&t.body.removeAttribute(`style`),Qi=!1}var fa={layers:$i,isTopMostLayer:na,hasPointerBlockingLayer:aa,isBelowPointerBlockingLayer:oa,addLayer:sa,removeLayer:ca,indexOf:ea,find:ta,assignPointerEventToLayers:la,disableBodyPointerEvents:ua,restoreBodyPointerEvents:da},pa=`focusScope.autoFocusOnMount`,ma=`focusScope.autoFocusOnUnmount`,ha={bubbles:!1,cancelable:!0},ga={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=Qr(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=Qr(this.stack,e),this.active()?.resume()}};function _a(e,t){let[n,r]=A(!1),i={pause(){r(!0)},resume(){r(!1)}},a=null,o=t=>e.onMountAutoFocus?.(t),s=t=>e.onUnmountAutoFocus?.(t),c=()=>oi(t()),l=()=>{let e=c().createElement(`span`);return e.setAttribute(`data-focus-trap`,``),e.tabIndex=0,Object.assign(e.style,Yi),e},u=()=>{let e=t();return e?ki(e,!0).filter(e=>!e.hasAttribute(`data-focus-trap`)):[]},d=()=>{let e=u();return e.length>0?e[0]:null},f=()=>{let e=u();return e.length>0?e[e.length-1]:null},p=()=>{let e=t();if(!e)return!1;let n=ii(e);return!n||ri(e,n)?!1:ji(n)};M(()=>{let e=t();if(!e)return;ga.add(i);let n=ii(e);if(!ri(e,n)){let t=new CustomEvent(pa,ha);e.addEventListener(pa,o),e.dispatchEvent(t),t.defaultPrevented||setTimeout(()=>{bi(d()),ii(e)===n&&bi(e)},0)}P(()=>{e.removeEventListener(pa,o),setTimeout(()=>{let t=new CustomEvent(ma,ha);p()&&t.preventDefault(),e.addEventListener(ma,s),e.dispatchEvent(t),t.defaultPrevented||bi(n??c().body),e.removeEventListener(ma,s),ga.remove(i)},0)})}),M(()=>{let r=t();if(!r||!q(e.trapFocus)||n())return;let i=e=>{let t=e.target;t?.closest(`[data-kb-top-layer]`)||(ri(r,t)?a=t:bi(a))},o=e=>{let t=e.relatedTarget??ii(r);t?.closest(`[data-kb-top-layer]`)||ri(r,t)||bi(a)};c().addEventListener(`focusin`,i),c().addEventListener(`focusout`,o),P(()=>{c().removeEventListener(`focusin`,i),c().removeEventListener(`focusout`,o)})}),M(()=>{let r=t();if(!r||!q(e.trapFocus)||n())return;let i=l();r.insertAdjacentElement(`afterbegin`,i);let a=l();r.insertAdjacentElement(`beforeend`,a);function o(e){let t=d(),n=f();e.relatedTarget===t?bi(n):bi(t)}i.addEventListener(`focusin`,o),a.addEventListener(`focusin`,o);let s=new MutationObserver(e=>{for(let t of e)t.previousSibling===a&&(a.remove(),r.insertAdjacentElement(`beforeend`,a)),t.nextSibling===i&&(i.remove(),r.insertAdjacentElement(`afterbegin`,i))});s.observe(r,{childList:!0,subtree:!1}),P(()=>{i.removeEventListener(`focusin`,o),a.removeEventListener(`focusin`,o),i.remove(),a.remove(),s.disconnect()})})}var va=`data-live-announcer`;function ya(e){M(()=>{q(e.isDisabled)||P(Sa(q(e.targets),q(e.root)))})}var ba=new WeakMap,xa=[];function Sa(e,t=document.body){let n=new Set(e),r=new Set,i=e=>{for(let t of e.querySelectorAll(`[${va}], [${Xi}]`))n.add(t);let t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&e.parentElement.getAttribute(`role`)!==`row`)return NodeFilter.FILTER_REJECT;for(let t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),o=t(e);if(o===NodeFilter.FILTER_ACCEPT&&a(e),o!==NodeFilter.FILTER_REJECT){let e=i.nextNode();for(;e!=null;)a(e),e=i.nextNode()}},a=e=>{let t=ba.get(e)??0;(e.getAttribute(`aria-hidden`)!==`true`||t!==0)&&(t===0&&setTimeout(()=>requestAnimationFrame(()=>e.setAttribute(`aria-hidden`,`true`))),r.add(e),ba.set(e,t+1))};xa.length&&xa[xa.length-1].disconnect(),i(t);let o=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`&&t.addedNodes.length!==0&&![...n,...r].some(e=>e.contains(t.target))){for(let e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&(e.dataset.liveAnnouncer===`true`||e.dataset.reactAriaTopLayer===`true`)?n.add(e):e instanceof Element&&i(e)}});o.observe(t,{childList:!0,subtree:!0});let s={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return xa.push(s),()=>{o.disconnect();for(let e of r){let t=ba.get(e);if(t==null)return;t===1?(setTimeout(()=>requestAnimationFrame(()=>e.removeAttribute(`aria-hidden`))),ba.delete(e)):ba.set(e,t-1)}s===xa[xa.length-1]?(xa.pop(),xa.length&&xa[xa.length-1].observe()):xa.splice(xa.indexOf(s),1)}}function Ca(e){let t=t=>{t.key===ci.Escape&&e.onEscapeKeyDown?.(t)};M(()=>{if(q(e.isDisabled))return;let n=e.ownerDocument?.()??oi();n.addEventListener(`keydown`,t),P(()=>{n.removeEventListener(`keydown`,t)})})}var wa=`interactOutside.pointerDownOutside`,Ta=`interactOutside.focusOutside`;function Ea(e,t){let n,r=Bi,i=()=>oi(t()),a=t=>e.onPointerDownOutside?.(t),o=t=>e.onFocusOutside?.(t),s=t=>e.onInteractOutside?.(t),c=n=>{let r=n.target;return!(r instanceof Element)||r.closest(`[data-kb-top-layer]`)||!ri(i(),r)||ri(t(),r)?!1:!e.shouldExcludeElement?.(r)},l=e=>{function n(){let n=t(),r=e.target;if(!n||!r||!c(e))return;let i=vi([a,s]);r.addEventListener(wa,i,{once:!0});let o=new CustomEvent(wa,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:e.button===2||yi(e)&&e.button===0}});r.dispatchEvent(o)}e.pointerType===`touch`?(i().removeEventListener(`click`,n),r=n,i().addEventListener(`click`,n,{once:!0})):n()},u=e=>{let n=t(),r=e.target;if(!n||!r||!c(e))return;let i=vi([o,s]);r.addEventListener(Ta,i,{once:!0});let a=new CustomEvent(Ta,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(a)};M(()=>{q(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener(`pointerdown`,l,!0)},0),i().addEventListener(`focusin`,u,!0),P(()=>{window.clearTimeout(n),i().removeEventListener(`click`,r),i().removeEventListener(`pointerdown`,l,!0),i().removeEventListener(`focusin`,u,!0)}))})}function Da(e){let[t,n]=B(e,[`as`]);if(!t.as)throw Error("[kobalte]: Polymorphic is missing the required `as` prop.");return R(Pt,z(n,{get component(){return t.as}}))}var Oa=I();function ka(){return L(Oa)}function Aa(e){let t,n=ka(),[r,i]=B(e,[`ref`,`disableOutsidePointerEvents`,`excludedElements`,`onEscapeKeyDown`,`onPointerDownOutside`,`onFocusOutside`,`onInteractOutside`,`onDismiss`,`bypassTopMostLayerCheck`]),a=new Set([]),o=e=>{a.add(e);let t=n?.registerNestedLayer(e);return()=>{a.delete(e),t?.()}};Ea({shouldExcludeElement:e=>t?r.excludedElements?.some(t=>ri(t(),e))||[...a].some(t=>ri(t,e)):!1,onPointerDownOutside:e=>{t&&!fa.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||fa.isTopMostLayer(t))&&(r.onPointerDownOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.())},onFocusOutside:e=>{r.onFocusOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.()}},()=>t),Ca({ownerDocument:()=>oi(t),onEscapeKeyDown:e=>{t&&fa.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),se(()=>{if(!t)return;fa.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});let e=n?.registerNestedLayer(t);fa.assignPointerEventToLayers(),fa.disableBodyPointerEvents(t),P(()=>{t&&(fa.removeLayer(t),e?.(),fa.assignPointerEventToLayers(),fa.restoreBodyPointerEvents(t))})}),M(oe([()=>t,()=>r.disableOutsidePointerEvents],([e,t])=>{if(!e)return;let n=fa.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,fa.assignPointerEventToLayers()),t&&fa.disableBodyPointerEvents(e),P(()=>{fa.restoreBodyPointerEvents(e)})},{defer:!0}));let s={registerNestedLayer:o};return R(Oa.Provider,{value:s,get children(){return R(Da,z({as:`div`,ref(e){var n=Xr(e=>t=e,r.ref);typeof n==`function`&&n(e)}},i))}})}function ja(e){let[t,n]=A(e.defaultValue?.()),r=N(()=>e.value?.()!==void 0),i=N(()=>r()?e.value?.():t());return[i,t=>{ae(()=>{let a=ln(t,i());return Object.is(a,i())||(r()||n(a),e.onChange?.(a)),a})}]}function Ma(e){let[t,n]=ja(e);return[()=>t()??!1,n]}function Na(e){let[t,n]=ja(e);return[()=>t()??[],n]}function Pa(e={}){let[t,n]=Ma({value:()=>q(e.open),defaultValue:()=>!!q(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}function Fa(e,t){let[n,r]=A(Ia(t?.()));return M(()=>{r(e()?.tagName.toLowerCase()||Ia(t?.()))}),n}function Ia(e){return ei(e)?e:void 0}var La=Object.defineProperty,Ra=(e,t)=>{for(var n in t)La(e,n,{get:t[n],enumerable:!0})};Ra({},{Button:()=>Ha,Root:()=>Va});var za=[`button`,`color`,`file`,`image`,`reset`,`submit`];function Ba(e){let t=e.tagName.toLowerCase();return t===`button`?!0:t===`input`&&e.type?za.indexOf(e.type)!==-1:!1}function Va(e){let t,[n,r]=B(Z({type:`button`},e),[`ref`,`type`,`disabled`]),i=Fa(()=>t,()=>`button`),a=N(()=>{let e=i();return e!=null&&Ba({tagName:e,type:n.type})}),o=N(()=>i()===`input`),s=N(()=>i()===`a`&&t?.getAttribute(`href`)!=null);return R(Da,z({as:`button`,ref(e){var r=Xr(e=>t=e,n.ref);typeof r==`function`&&r(e)},get type(){return U(()=>!!(a()||o()))()?n.type:void 0},get role(){return!a()&&!s()?`button`:void 0},get tabIndex(){return!a()&&!s()&&!n.disabled?0:void 0},get disabled(){return U(()=>!!(a()||o()))()?n.disabled:void 0},get"aria-disabled"(){return!a()&&!o()&&n.disabled?!0:void 0},get"data-disabled"(){return n.disabled?``:void 0}},r))}var Ha=Va;function Ua(e){return t=>(e(t),()=>e(void 0))}var Wa=e=>typeof e==`function`?e():e,Ga=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Ka=new Map,qa=e=>{M(()=>{let t=Wa(e.style)??{},n=Wa(e.properties)??[],r={};for(let n in t)r[n]=e.element.style[n];let i=Ka.get(e.key);i?i.activeCount++:Ka.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(e=>e.key)}),Object.assign(e.element.style,e.style);for(let t of n)e.element.style.setProperty(t.key,t.value);P(()=>{let t=Ka.get(e.key);if(t){if(t.activeCount!==1){t.activeCount--;return}Ka.delete(e.key);for(let[n,r]of Object.entries(t.originalStyles))e.element.style[n]=r;for(let n of t.properties)e.element.style.removeProperty(n);e.element.style.length===0&&e.element.removeAttribute(`style`),e.cleanup?.()}})})},Ja=(e,t)=>{switch(t){case`x`:return[e.clientWidth,e.scrollLeft,e.scrollWidth];case`y`:return[e.clientHeight,e.scrollTop,e.scrollHeight]}},Ya=(e,t)=>{let n=getComputedStyle(e),r=t===`x`?n.overflowX:n.overflowY;return r===`auto`||r===`scroll`||e.tagName===`HTML`&&r===`visible`},Xa=(e,t,n)=>{let r=t===`x`&&window.getComputedStyle(e).direction===`rtl`?-1:1,i=e,a=0,o=0,s=!1;do{let[e,c,l]=Ja(i,t),u=l-e-r*c;(c!==0||u!==0)&&Ya(i,t)&&(a+=u,o+=c),i===(n??document.documentElement)?s=!0:i=i._$host??i.parentElement}while(i&&!s);return[a,o]},[Za,Qa]=A([]),$a=e=>Za().indexOf(e)===Za().length-1,eo=e=>{let t=z({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:`padding`,restoreScrollPosition:!0,allowPinchZoom:!1},e),n=We(),r=[0,0],i=null,a=null;M(()=>{Wa(t.enabled)&&(Qa(e=>[...e,n]),P(()=>{Qa(e=>e.filter(e=>e!==n))}))}),M(()=>{if(!Wa(t.enabled)||!Wa(t.hideScrollbar))return;let{documentElement:e}=document,n=window.innerWidth-e.clientWidth;if(Wa(t.preventScrollbarShift)){let r={overflow:`hidden`},i=[];n>0&&(Wa(t.preventScrollbarShiftMode)===`padding`?r.paddingRight=`calc(${window.getComputedStyle(e).paddingRight} + ${n}px)`:r.marginRight=`calc(${window.getComputedStyle(e).marginRight} + ${n}px)`,i.push({key:`--scrollbar-width`,value:`${n}px`}));let a=window.scrollY,o=window.scrollX;qa({key:`prevent-scroll`,element:e,style:r,properties:i,cleanup:()=>{Wa(t.restoreScrollPosition)&&n>0&&window.scrollTo(o,a)}})}else qa({key:`prevent-scroll`,element:e,style:{overflow:`hidden`}})}),M(()=>{$a(n)&&Wa(t.enabled)&&(document.addEventListener(`wheel`,s,{passive:!1}),document.addEventListener(`touchstart`,o,{passive:!1}),document.addEventListener(`touchmove`,c,{passive:!1}),P(()=>{document.removeEventListener(`wheel`,s),document.removeEventListener(`touchstart`,o),document.removeEventListener(`touchmove`,c)}))});let o=e=>{r=no(e),i=null,a=null},s=e=>{let n=e.target,r=Wa(t.element),i=to(e),a=Math.abs(i[0])>Math.abs(i[1])?`x`:`y`,o=ro(n,a,a===`x`?i[0]:i[1],r),s;s=r&&Ga(r,n)?!o:!0,s&&e.cancelable&&e.preventDefault()},c=e=>{let n=Wa(t.element),o=e.target,s;if(e.touches.length===2)s=!Wa(t.allowPinchZoom);else{if(i==null||a===null){let t=no(e).map((e,t)=>r[t]-e),n=Math.abs(t[0])>Math.abs(t[1])?`x`:`y`;i=n,a=n===`x`?t[0]:t[1]}if(o.type===`range`)s=!1;else{let e=ro(o,i,a,n);s=n&&Ga(n,o)?!e:!0}}s&&e.cancelable&&e.preventDefault()}},to=e=>[e.deltaX,e.deltaY],no=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],ro=(e,t,n,r)=>{let[i,a]=Xa(e,t,r!==null&&Ga(r,e)?r:void 0);return!(n>0&&Math.abs(i)<=1||n<0&&Math.abs(a)<1)},io=eo,ao=e=>{let t=N(()=>{let t=Wa(e.element);if(t)return getComputedStyle(t)}),n=()=>t()?.animationName??`none`,[r,i]=A(Wa(e.show)?`present`:`hidden`),a=t=>{i(t),e.onStateChange?.(t)},o=`none`;return M(r=>{let i=Wa(e.show);return ae(()=>{if(r===i)return i;let e=o,s=n();i?a(`present`):s===`none`||t()?.display===`none`?a(`hidden`):a(r===!0&&e!==s?`hiding`:`hidden`)}),i},Wa(e.show)),M(()=>{let t=Wa(e.element);if(!t)return;let i=e=>{e.target===t&&(o=n())},s=e=>{let i=n().includes(e.animationName);e.target===t&&i&&r()===`hiding`&&a(`hidden`)};t.addEventListener(`animationstart`,i),t.addEventListener(`animationcancel`,s),t.addEventListener(`animationend`,s),P(()=>{t.removeEventListener(`animationstart`,i),t.removeEventListener(`animationcancel`,s),t.removeEventListener(`animationend`,s)})}),{present:()=>r()===`present`||r()===`hiding`,state:r}};Ra({},{CloseButton:()=>co,Content:()=>lo,Description:()=>uo,Dialog:()=>vo,Overlay:()=>fo,Portal:()=>po,Root:()=>ho,Title:()=>go,Trigger:()=>_o,useDialogContext:()=>so});var oo=I();function so(){let e=L(oo);if(e===void 0)throw Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function co(e){let t=so(),[n,r]=B(e,[`aria-label`,`onClick`]);return R(Va,z({get"aria-label"(){return n[`aria-label`]||t.translations().dismiss},onClick:e=>{X(e,n.onClick),t.close()}},r))}function lo(e){let t,n=so(),[r,i]=B(Z({id:n.generateId(`content`)},e),[`ref`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onPointerDownOutside`,`onFocusOutside`,`onInteractOutside`]),a=!1,o=!1,s=e=>{r.onPointerDownOutside?.(e),n.modal()&&e.detail.isContextMenu&&e.preventDefault()},c=e=>{r.onFocusOutside?.(e),n.modal()&&e.preventDefault()},l=e=>{r.onInteractOutside?.(e),!n.modal()&&(e.defaultPrevented||(a=!0,e.detail.originalEvent.type===`pointerdown`&&(o=!0)),ri(n.triggerRef(),e.target)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&o&&e.preventDefault())};return ya({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),io({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),_a({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:r.onOpenAutoFocus,onUnmountAutoFocus:e=>{r.onCloseAutoFocus?.(e),n.modal()?(e.preventDefault(),bi(n.triggerRef())):(e.defaultPrevented||(a||bi(n.triggerRef()),e.preventDefault()),a=!1,o=!1)}},()=>t),M(()=>P(n.registerContentId(i.id))),R(H,{get when(){return n.contentPresent()},get children(){return R(Aa,z({ref(e){var i=Xr(e=>{n.setContentRef(e),t=e},r.ref);typeof i==`function`&&i(e)},role:`dialog`,tabIndex:-1,get disableOutsidePointerEvents(){return U(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?``:void 0},get"data-closed"(){return n.isOpen()?void 0:``},onPointerDownOutside:s,onFocusOutside:c,onInteractOutside:l,get onDismiss(){return n.close}},i))}})}function uo(e){let t=so(),[n,r]=B(Z({id:t.generateId(`description`)},e),[`id`]);return M(()=>P(t.registerDescriptionId(n.id))),R(Da,z({as:`p`,get id(){return n.id}},r))}function fo(e){let t=so(),[n,r]=B(e,[`ref`,`style`,`onPointerDown`]),i=e=>{X(e,n.onPointerDown),e.target===e.currentTarget&&e.preventDefault()};return R(H,{get when(){return t.overlayPresent()},get children(){return R(Da,z({as:`div`,ref(e){var r=Xr(t.setOverlayRef,n.ref);typeof r==`function`&&r(e)},get style(){return Yr({"pointer-events":`auto`},n.style)},get"data-expanded"(){return t.isOpen()?``:void 0},get"data-closed"(){return t.isOpen()?void 0:``},onPointerDown:i},r))}})}function po(e){let t=so();return R(H,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return R(Mt,e)}})}var mo={dismiss:`Dismiss`};function ho(e){let t=Z({id:`dialog-${We()}`,modal:!0,translations:mo},e),[n,r]=A(),[i,a]=A(),[o,s]=A(),[c,l]=A(),[u,d]=A(),[f,p]=A(),m=Pa({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:e=>t.onOpenChange?.(e)}),h=()=>t.forceMount||m.isOpen(),{present:g}=ao({show:h,element:()=>c()??null}),{present:_}=ao({show:h,element:()=>u()??null}),v={translations:()=>t.translations??mo,isOpen:m.isOpen,modal:()=>t.modal??!0,preventScroll:()=>t.preventScroll??v.modal(),contentId:n,titleId:i,descriptionId:o,triggerRef:f,overlayRef:c,setOverlayRef:l,contentRef:u,setContentRef:d,overlayPresent:g,contentPresent:_,close:m.close,toggle:m.toggle,setTriggerRef:p,generateId:ni(()=>t.id),registerContentId:Ua(r),registerTitleId:Ua(a),registerDescriptionId:Ua(s)};return R(oo.Provider,{value:v,get children(){return t.children}})}function go(e){let t=so(),[n,r]=B(Z({id:t.generateId(`title`)},e),[`id`]);return M(()=>P(t.registerTitleId(n.id))),R(Da,z({as:`h2`,get id(){return n.id}},r))}function _o(e){let t=so(),[n,r]=B(e,[`ref`,`onClick`]);return R(Va,z({ref(e){var r=Xr(t.setTriggerRef,n.ref);typeof r==`function`&&r(e)},"aria-haspopup":`dialog`,get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return U(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?``:void 0},get"data-closed"(){return t.isOpen()?void 0:``},onClick:e=>{X(e,n.onClick),t.toggle()}},r))}var vo=Object.assign(ho,{CloseButton:co,Content:lo,Description:uo,Overlay:fo,Portal:po,Title:go,Trigger:_o}),yo=W(`<div style=position:fixed;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none>`),bo=W(`<div data-component=dialog-stack>`),xo=I();function So(){let[e,t]=A([]),n={current:void 0},r={value:!1};P(()=>{n.current!==void 0&&(clearTimeout(n.current),n.current=void 0)});let i=i=>{let a=e(),o=i?a.find(e=>e.id===i):a.at(-1);if(!o||r.value)return;r.value=!0,o.onClose?.(),o.setClosing(!0);let s=o.id;n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),n.current=setTimeout(()=>{n.current=void 0,o.dispose(),t(e=>e.filter(e=>e.id!==s)),r.value=!1},100)};M(()=>{e().length!==0&&pn(window,`keydown`,e=>{e.key===`Escape`&&(i(),e.preventDefault(),e.stopPropagation())},{capture:!0})});let a=(n,r,a,o)=>{let s=Math.random().toString(36).slice(2),c=50+o*10,l,u,d=de(r,()=>ee(t=>{l=t;let[r,a]=A(!1);return u=a,R(vo,{get modal(){return e().at(-1)?.id===s},get open(){return!r()},onOpenChange:t=>{t||e().at(-1)?.id!==s||i(s)},get children(){return R(vo.Portal,{get children(){return[R(vo.Overlay,{"data-component":`dialog-overlay`,get style(){return{"z-index":String(c)}},onClick:()=>i(s)}),(()=>{var e=yo();return G(e,`data-dialog-layer`,o),K(e,n),j(t=>ht(e,`z-index`,String(c))),e})()]}})}})}));if(!l||!u)return;let f={id:s,node:d,dispose:l,owner:r,onClose:a,setClosing:u};t(e=>[...e,f])};return{stack:e,close:i,show:(i,o,s)=>{for(let t of e())t.dispose();t([]),n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),r.value=!1,a(i,o,s,0)},push:(t,i,o)=>{n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),r.value=!1,a(t,i,o,e().length)}}}function Co(e){let t=So();return R(xo.Provider,{value:t,get children(){return[U(()=>e.children),(()=>{var e=bo();return K(e,R(V,{get each(){return t.stack()},children:e=>e.node})),e})()]}})}function wo(){let e=L(xo),t=ue();if(!t||!e)throw Error(`useDialog must be used within a DialogProvider`);return{get active(){return e.stack().at(-1)},show(n,r){let i=e.stack().at(-1)?.owner??t;return fe(()=>e.show(n,i,r))},push(n,r){let i=e.stack().at(-1)?.owner??t;return fe(()=>e.push(n,i,r))},close(){e.close()}}}var To={"align-right":`<path d="M12.292 6.04167L16.2503 9.99998L12.292 13.9583M2.91699 9.99998H15.6253M17.0837 3.75V16.25" stroke="currentColor" stroke-linecap="square"/>`,"arrow-up":`<path fill-rule="evenodd" clip-rule="evenodd" d="M9.99991 2.24121L16.0921 8.33343L15.2083 9.21731L10.6249 4.63397V17.5001H9.37492V4.63398L4.7916 9.21731L3.90771 8.33343L9.99991 2.24121Z" fill="currentColor"/>`,"arrow-left":`<path d="M8.33464 4.58398L2.91797 10.0007L8.33464 15.4173M3.33464 10.0007H17.0846" stroke="currentColor" stroke-linecap="square"/>`,"arrow-right":`<path d="M11.6654 4.58398L17.082 10.0007L11.6654 15.4173M16.6654 10.0007H2.91536" stroke="currentColor" stroke-linecap="square"/>`,archive:`<path d="M16.8747 6.24935H17.3747V5.74935H16.8747V6.24935ZM16.8747 16.8743V17.3743H17.3747V16.8743H16.8747ZM3.12467 16.8743H2.62467V17.3743H3.12467V16.8743ZM3.12467 6.24935V5.74935H2.62467V6.24935H3.12467ZM2.08301 2.91602V2.41602H1.58301V2.91602H2.08301ZM17.9163 2.91602H18.4163V2.41602H17.9163V2.91602ZM17.9163 6.24935V6.74935H18.4163V6.24935H17.9163ZM2.08301 6.24935H1.58301V6.74935H2.08301V6.24935ZM8.33301 9.08268H7.83301V10.0827H8.33301V9.58268V9.08268ZM11.6663 10.0827H12.1663V9.08268H11.6663V9.58268V10.0827ZM16.8747 6.24935H16.3747V16.8743H16.8747H17.3747V6.24935H16.8747ZM16.8747 16.8743V16.3743H3.12467V16.8743V17.3743H16.8747V16.8743ZM3.12467 16.8743H3.62467V6.24935H3.12467H2.62467V16.8743H3.12467ZM3.12467 6.24935V6.74935H16.8747V6.24935V5.74935H3.12467V6.24935ZM2.08301 2.91602V3.41602H17.9163V2.91602V2.41602H2.08301V2.91602ZM17.9163 2.91602H17.4163V6.24935H17.9163H18.4163V2.91602H17.9163ZM17.9163 6.24935V5.74935H2.08301V6.24935V6.74935H17.9163V6.24935ZM2.08301 6.24935H2.58301V2.91602H2.08301H1.58301V6.24935H2.08301ZM8.33301 9.58268V10.0827H11.6663V9.58268V9.08268H8.33301V9.58268Z" fill="currentColor"/>`,"bubble-5":`<path d="M18.3327 9.99935C18.3327 5.57227 15.0919 2.91602 9.99935 2.91602C4.90676 2.91602 1.66602 5.57227 1.66602 9.99935C1.66602 11.1487 2.45505 13.1006 2.57637 13.3939C2.58707 13.4197 2.59766 13.4434 2.60729 13.4697C2.69121 13.6987 3.04209 14.9354 1.66602 16.7674C3.51787 17.6528 5.48453 16.1973 5.48453 16.1973C6.84518 16.9193 8.46417 17.0827 9.99935 17.0827C15.0919 17.0827 18.3327 14.4264 18.3327 9.99935Z" stroke="currentColor" stroke-linecap="square"/>`,prompt:`<path d="M14.5841 12.0807H17.9193V2.91406H5.6276V6.2474M14.5859 6.2474H2.08594V15.4141H5.0026V17.4974L8.7526 15.4141H14.5859V6.2474Z" stroke="currentColor" stroke-linecap="square"/>`,brain:`<path d="M13.332 8.7487C11.4911 8.7487 9.9987 7.25631 9.9987 5.41536M6.66536 11.2487C8.50631 11.2487 9.9987 12.7411 9.9987 14.582M9.9987 2.78209L9.9987 17.0658M16.004 15.0475C17.1255 14.5876 17.9154 13.4849 17.9154 12.1978C17.9154 11.3363 17.5615 10.5575 16.9913 9.9987C17.5615 9.43991 17.9154 8.66108 17.9154 7.79962C17.9154 6.21199 16.7136 4.90504 15.1702 4.73878C14.7858 3.21216 13.4039 2.08203 11.758 2.08203C11.1171 2.08203 10.5162 2.25337 9.9987 2.55275C9.48117 2.25337 8.88032 2.08203 8.23944 2.08203C6.59353 2.08203 5.21157 3.21216 4.82722 4.73878C3.28377 4.90504 2.08203 6.21199 2.08203 7.79962C2.08203 8.66108 2.43585 9.43991 3.00609 9.9987C2.43585 10.5575 2.08203 11.3363 2.08203 12.1978C2.08203 13.4849 2.87191 14.5876 3.99339 15.0475C4.46688 16.7033 5.9917 17.9154 7.79962 17.9154C8.61335 17.9154 9.36972 17.6698 9.9987 17.2488C10.6277 17.6698 11.384 17.9154 12.1978 17.9154C14.0057 17.9154 15.5305 16.7033 16.004 15.0475Z" stroke="currentColor"/>`,fork:`<path d="M2.91602 7.91406L2.91602 2.91406H7.91602M12.0827 2.91406H17.0827L17.0827 7.91406M9.99935 9.9974L9.99935 17.0807M9.99935 9.9974L3.33268 3.33073M9.99935 9.9974L16.666 3.33073" stroke="currentColor" stroke-linecap="square"/>`,"workspace-isolated":`<g transform="translate(2 2)"><path d="M10.5 10.5V5.5H5.5V10.5H10.5Z" fill="currentColor"/><rect x="2.5" y="2.5" width="11" height="11" stroke="currentColor"/></g>`,"bullet-list":`<path d="M9.58329 13.7497H17.0833M9.58329 6.24967H17.0833M6.24996 6.24967C6.24996 7.17015 5.50377 7.91634 4.58329 7.91634C3.66282 7.91634 2.91663 7.17015 2.91663 6.24967C2.91663 5.3292 3.66282 4.58301 4.58329 4.58301C5.50377 4.58301 6.24996 5.3292 6.24996 6.24967ZM6.24996 13.7497C6.24996 14.6701 5.50377 15.4163 4.58329 15.4163C3.66282 15.4163 2.91663 14.6701 2.91663 13.7497C2.91663 12.8292 3.66282 12.083 4.58329 12.083C5.50377 12.083 6.24996 12.8292 6.24996 13.7497Z" stroke="currentColor" stroke-linecap="square"/>`,"check-small":`<path d="M6.5 11.4412L8.97059 13.5L13.5 6.5" stroke="currentColor" stroke-linecap="square"/>`,"chevron-down":`<path d="M6.6665 8.33325L9.99984 11.6666L13.3332 8.33325" stroke="currentColor" stroke-linecap="square"/>`,"chevron-left":`<path d="M12 15L7 10L12 5" stroke="currentColor" stroke-linecap="square"/>`,"chevron-right":`<path d="M8 15L13 10L8 5" stroke="currentColor" stroke-linecap="square"/>`,"chevron-grabber-vertical":`<path d="M6.66675 12.4998L10.0001 15.8332L13.3334 12.4998M6.66675 7.49984L10.0001 4.1665L13.3334 7.49984" stroke="currentColor" stroke-linecap="square"/>`,"chevron-double-right":`<path d="M11.6654 13.3346L14.9987 10.0013L11.6654 6.66797M5.83203 13.3346L9.16536 10.0013L5.83203 6.66797" stroke="currentColor" stroke-linecap="square"/>`,"circle-x":`<path fill-rule="evenodd" clip-rule="evenodd" d="M1.6665 10.0003C1.6665 5.39795 5.39746 1.66699 9.99984 1.66699C14.6022 1.66699 18.3332 5.39795 18.3332 10.0003C18.3332 14.6027 14.6022 18.3337 9.99984 18.3337C5.39746 18.3337 1.6665 14.6027 1.6665 10.0003ZM7.49984 6.91107L6.91058 7.50033L9.41058 10.0003L6.91058 12.5003L7.49984 13.0896L9.99984 10.5896L12.4998 13.0896L13.0891 12.5003L10.5891 10.0003L13.0891 7.50033L12.4998 6.91107L9.99984 9.41107L7.49984 6.91107Z" fill="currentColor"/>`,close:`<path d="M3.75 3.75L16.25 16.25M16.25 3.75L3.75 16.25" stroke="currentColor" stroke-linecap="square"/>`,"close-small":`<path d="M6 6L14 14M14 6L6 14" stroke="currentColor" stroke-linecap="square"/>`,checklist:`<path d="M9.58342 13.7498H17.0834M9.58342 6.24984H17.0834M2.91675 6.6665L4.58341 7.9165L7.08341 4.1665M2.91675 14.1665L4.58341 15.4165L7.08341 11.6665" stroke="currentColor" stroke-linecap="square"/>`,console:`<path d="M3.75 5.4165L8.33333 9.99984L3.75 14.5832M10.4167 14.5832H16.25" stroke="currentColor" stroke-linecap="square"/>`,terminal:`<path d="M6.5 8L8.64286 10L6.5 12M10.9286 12H13.5M2 18H18V2H2V18Z" stroke="currentColor" stroke-linecap="square"/>`,"terminal-active":`<path d="M2 18H18V2H2V18Z" fill="currentColor" fill-opacity="0.1"/>
|
|
10
|
+
<path d="M6.5 8L8.64286 10L6.5 12M10.9286 12H13.5M2 18H18V2H2V18Z" stroke="currentColor" stroke-linecap="square"/>`,review:`<path d="M7 14.5H13M7 7.99512H10.0049M10.0049 7.99512H13M10.0049 7.99512V5M10.0049 7.99512V11M18 18V2L2 2L2 18H18Z" stroke="currentColor"/>`,"review-active":`<path d="M18 18V2L2 2L2 18H18Z" fill="currentColor" fill-opacity="0.1"/>
|
|
11
|
+
<path d="M7 14.5H13M7 7.99512H10.0049M10.0049 7.99512H13M10.0049 7.99512V5M10.0049 7.99512V11M18 18V2L2 2L2 18H18Z" stroke="currentColor"/>`,expand:`<path d="M4.58301 10.4163V15.4163H9.58301M10.4163 4.58301H15.4163V9.58301" stroke="currentColor" stroke-linecap="square"/>`,collapse:`<path d="M16.666 8.33398H11.666V3.33398" stroke="currentColor" stroke-linecap="square"/><path d="M8.33398 16.666V11.666H3.33398" stroke="currentColor" stroke-linecap="square"/>`,code:`<path d="M8.7513 7.5013L6.2513 10.0013L8.7513 12.5013M11.2513 7.5013L13.7513 10.0013L11.2513 12.5013M2.91797 2.91797H17.0846V17.0846H2.91797V2.91797Z" stroke="currentColor"/>`,"code-lines":`<path d="M2.08325 3.75H11.2499M14.5833 3.75H17.9166M2.08325 10L7.08325 10M10.4166 10L17.9166 10M2.08325 16.25L8.74992 16.25M12.0833 16.25L17.9166 16.25" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>`,"circle-ban-sign":`<path d="M15.3675 4.63087L4.55742 15.441M17.9163 9.9987C17.9163 14.371 14.3719 17.9154 9.99967 17.9154C7.81355 17.9154 5.83438 17.0293 4.40175 15.5966C2.96911 14.164 2.08301 12.1848 2.08301 9.9987C2.08301 5.62644 5.62742 2.08203 9.99967 2.08203C12.1858 2.08203 14.165 2.96813 15.5976 4.40077C17.0302 5.8334 17.9163 7.81257 17.9163 9.9987Z" stroke="currentColor" stroke-linecap="round"/>`,"edit-small-2":`<path d="M17.0834 17.0833V17.5833H17.5834V17.0833H17.0834ZM2.91675 17.0833H2.41675V17.5833H2.91675V17.0833ZM2.91675 2.91659V2.41659H2.41675V2.91659H2.91675ZM9.58341 3.41659H10.0834V2.41659H9.58341V2.91659V3.41659ZM17.5834 10.4166V9.91659H16.5834V10.4166H17.0834H17.5834ZM10.4167 7.08325L10.0632 6.7297L9.91675 6.87615V7.08325H10.4167ZM10.4167 9.58325H9.91675V10.0833H10.4167V9.58325ZM12.9167 9.58325V10.0833H13.1239L13.2703 9.93681L12.9167 9.58325ZM15.4167 2.08325L15.7703 1.7297L15.4167 1.37615L15.0632 1.7297L15.4167 2.08325ZM17.9167 4.58325L18.2703 4.93681L18.6239 4.58325L18.2703 4.2297L17.9167 4.58325ZM17.0834 17.0833V16.5833H2.91675V17.0833V17.5833H17.0834V17.0833ZM2.91675 17.0833H3.41675V2.91659H2.91675H2.41675V17.0833H2.91675ZM2.91675 2.91659V3.41659H9.58341V2.91659V2.41659H2.91675V2.91659ZM17.0834 10.4166H16.5834V17.0833H17.0834H17.5834V10.4166H17.0834ZM10.4167 7.08325H9.91675V9.58325H10.4167H10.9167V7.08325H10.4167ZM10.4167 9.58325V10.0833H12.9167V9.58325V9.08325H10.4167V9.58325ZM10.4167 7.08325L10.7703 7.43681L15.7703 2.43681L15.4167 2.08325L15.0632 1.7297L10.0632 6.7297L10.4167 7.08325ZM15.4167 2.08325L15.0632 2.43681L17.5632 4.93681L17.9167 4.58325L18.2703 4.2297L15.7703 1.7297L15.4167 2.08325ZM17.9167 4.58325L17.5632 4.2297L12.5632 9.2297L12.9167 9.58325L13.2703 9.93681L18.2703 4.93681L17.9167 4.58325Z" fill="currentColor"/>`,eye:`<path d="M10 4.58325C5.83333 4.58325 2.5 9.99992 2.5 9.99992C2.5 9.99992 5.83333 15.4166 10 15.4166C14.1667 15.4166 17.5 9.99992 17.5 9.99992C17.5 9.99992 14.1667 4.58325 10 4.58325Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/>`,enter:`<path d="M5.83333 15.8334L2.5 12.5L5.83333 9.16671M3.33333 12.5H17.9167V4.58337H10" stroke="currentColor" stroke-linecap="square"/>`,folder:`<path d="M2.08301 2.91675V16.2501H17.9163V5.41675H9.99967L8.33301 2.91675H2.08301Z" stroke="currentColor" stroke-linecap="round"/>`,"file-tree":`<path d="M18 18V5H9.5L7.5 2H2L2 18H5M18 18H5M18 18V8.5H5V18" stroke="currentColor" stroke-linecap="square"/>`,"file-tree-active":`<path d="M2 2L2 18H5L6.5 8.5H18V5H9.5L7.5 2H2Z" fill="currentColor" fill-opacity="0.1"/>
|
|
12
|
+
<path d="M5 18H18L19.5 8.5H18M5 18H2L2 2H7.5L9.5 5H18V8.5M5 18L6.5 8.5H18" stroke="currentColor" stroke-linecap="square"/>`,"magnifying-glass":`<path d="M13 13L10.6418 10.6418M11.9552 7.47761C11.9552 9.95053 9.95053 11.9552 7.47761 11.9552C5.0047 11.9552 3 9.95053 3 7.47761C3 5.0047 5.0047 3 7.47761 3C9.95053 3 11.9552 5.0047 11.9552 7.47761Z" stroke="currentColor" stroke-linecap="square" vector-effect="non-scaling-stroke"/>`,"plus-small":`<path d="M9.99984 5.41699V10.0003M9.99984 10.0003V14.5837M9.99984 10.0003H5.4165M9.99984 10.0003H14.5832" stroke="currentColor" stroke-linecap="square"/>`,plus:`<path d="M9.9987 2.20703V9.9987M9.9987 9.9987V17.7904M9.9987 9.9987H2.20703M9.9987 9.9987H17.7904" stroke="currentColor" stroke-linecap="square"/>`,"new-session":`<path d="M12 2H2V18H18V8M6 11.3818V14H8.61818L18 4.61818L15.3818 2L6 11.3818Z" stroke="currentColor"/>`,"new-session-active":`<path d="M6 11.3818V14H8.61818L18 4.61818L15.3818 2L6 11.3818Z" fill="currentColor" fill-opacity="0.1"/>
|
|
13
|
+
<path d="M12 2H2V18H18V8M6 11.3818V14H8.61818L18 4.61818L15.3818 2L6 11.3818Z" stroke="currentColor"/>`,"pencil-line":`<path d="M9.58301 17.9166H17.9163M17.9163 5.83325L14.1663 2.08325L2.08301 14.1666V17.9166H5.83301L17.9163 5.83325Z" stroke="currentColor" stroke-linecap="square"/>`,mcp:`<g><path d="M0.972656 9.37176L9.5214 1.60019C10.7018 0.527151 12.6155 0.527151 13.7957 1.60019C14.9761 2.67321 14.9761 4.41295 13.7957 5.48599L7.3397 11.3552" stroke="currentColor" stroke-linecap="round"/><path d="M7.42871 11.2747L13.7957 5.48643C14.9761 4.41338 16.8898 4.41338 18.0702 5.48643L18.1147 5.52688C19.2951 6.59993 19.2951 8.33966 18.1147 9.4127L10.3831 16.4414C9.98966 16.7991 9.98966 17.379 10.3831 17.7366L11.9707 19.1799" stroke="currentColor" stroke-linecap="round"/><path d="M11.6587 3.54346L5.33619 9.29119C4.15584 10.3642 4.15584 12.1039 5.33619 13.177C6.51649 14.25 8.43019 14.25 9.61054 13.177L15.9331 7.42923" stroke="currentColor" stroke-linecap="round"/></g>`,glasses:`<path d="M0.416626 7.91667H1.66663M19.5833 7.91667H18.3333M11.866 7.57987C11.3165 7.26398 10.6793 7.08333 9.99996 7.08333C9.32061 7.08333 8.68344 7.26398 8.13389 7.57987M8.74996 10C8.74996 12.0711 7.07103 13.75 4.99996 13.75C2.92889 13.75 1.24996 12.0711 1.24996 10C1.24996 7.92893 2.92889 6.25 4.99996 6.25C7.07103 6.25 8.74996 7.92893 8.74996 10ZM18.75 10C18.75 12.0711 17.071 13.75 15 13.75C12.9289 13.75 11.25 12.0711 11.25 10C11.25 7.92893 12.9289 6.25 15 6.25C17.071 6.25 18.75 7.92893 18.75 10Z" stroke="currentColor" stroke-linecap="square"/>`,"magnifying-glass-menu":`<path d="M2.08325 10.0002H4.58325M2.08325 5.41683H5.41659M2.08325 14.5835H5.41659M16.4583 13.9585L18.7499 16.2502M17.9166 10.0002C17.9166 12.9917 15.4915 15.4168 12.4999 15.4168C9.50838 15.4168 7.08325 12.9917 7.08325 10.0002C7.08325 7.00862 9.50838 4.5835 12.4999 4.5835C15.4915 4.5835 17.9166 7.00862 17.9166 10.0002Z" stroke="currentColor" stroke-linecap="square"/>`,"window-cursor":`<path d="M17.5 10.4167V3.75H2.5V17.0833H10.4166M17.9166 13.5897L11.6666 11.6667L13.5897 17.9167L15.032 15.0321L17.9166 13.5897Z" stroke="currentColor" stroke-linecap="square"/><path d="M5.41675 6.125C5.71576 6.12518 5.95777 6.36795 5.95777 6.66699C5.95759 6.96589 5.71565 7.20783 5.41675 7.20801C5.11771 7.20801 4.87494 6.966 4.87476 6.66699C4.87476 6.36784 5.1176 6.125 5.41675 6.125ZM8.33276 6.125C8.63191 6.125 8.87476 6.36784 8.87476 6.66699C8.87458 6.966 8.63181 7.20801 8.33276 7.20801C8.03386 7.20783 7.79192 6.96589 7.79175 6.66699C7.79175 6.36795 8.03376 6.12518 8.33276 6.125ZM11.2498 6.125C11.5489 6.125 11.7917 6.36784 11.7917 6.66699C11.7916 6.966 11.5488 7.20801 11.2498 7.20801C10.9507 7.20801 10.7079 6.966 10.7078 6.66699C10.7078 6.36784 10.9506 6.125 11.2498 6.125Z" fill="currentColor" stroke="currentColor" stroke-width="0.25" stroke-linecap="square"/>`,task:`<path d="M9.99992 2.0835V17.9168M7.08325 3.75016H2.08325V16.2502H7.08325M12.9166 16.2502H17.9166V3.75016H12.9166" stroke="currentColor" stroke-linecap="square"/>`,subagent:`<path d="M4.5 5C4.5 4.72386 4.72386 4.5 5 4.5H11C11.2761 4.5 11.5 4.72386 11.5 5V11C11.5 11.2761 11.2761 11.5 11 11.5H5C4.72386 11.5 4.5 11.2761 4.5 11V5Z" fill="currentColor"/><path d="M13.5 2C13.7761 2 14 2.22386 14 2.5V13.5C14 13.7761 13.7761 14 13.5 14H2.5C2.22386 14 2 13.7761 2 13.5V2.5C2 2.22386 2.22386 2 2.5 2H13.5ZM3 13H13V3H3V13Z" fill="currentColor"/>`,stop:`<rect x="5" y="5" width="10" height="10" fill="currentColor"/>`,status:`<path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`,"status-active":`<path d="M18 2H2V10H18V2Z" fill="currentColor" fill-opacity="0.1"/>
|
|
14
|
+
<path d="M2 18H18V10H2V18Z" fill="currentColor" fill-opacity="0.1"/>
|
|
15
|
+
<path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`,sidebar:`<path d="M7.86667 2H5.2H2V18H5.2H7.86667M7.86667 2H18V18H7.86667M7.86667 2V18" stroke="currentColor"/>`,"sidebar-active":`<path d="M2 2V18H5.2H7.86667V2H5.2H2Z" fill="currentColor" fill-opacity="0.1"/>
|
|
16
|
+
<path d="M7.86667 2H5.2H2V18H5.2H7.86667M7.86667 2H18V18H7.86667M7.86667 2V18" stroke="currentColor"/>`,"layout-left":`<path d="M2.91675 2.91699L2.91675 2.41699L2.41675 2.41699L2.41675 2.91699L2.91675 2.91699ZM17.0834 2.91699L17.5834 2.91699L17.5834 2.41699L17.0834 2.41699L17.0834 2.91699ZM17.0834 17.0837L17.0834 17.5837L17.5834 17.5837L17.5834 17.0837L17.0834 17.0837ZM2.91675 17.0837L2.41675 17.0837L2.41675 17.5837L2.91675 17.5837L2.91675 17.0837ZM7.41674 17.0837L7.41674 17.5837L8.41674 17.5837L8.41674 17.0837L7.91674 17.0837L7.41674 17.0837ZM8.41674 2.91699L8.41674 2.41699L7.41674 2.41699L7.41674 2.91699L7.91674 2.91699L8.41674 2.91699ZM2.91675 2.91699L2.91675 3.41699L17.0834 3.41699L17.0834 2.91699L17.0834 2.41699L2.91675 2.41699L2.91675 2.91699ZM17.0834 2.91699L16.5834 2.91699L16.5834 17.0837L17.0834 17.0837L17.5834 17.0837L17.5834 2.91699L17.0834 2.91699ZM17.0834 17.0837L17.0834 16.5837L2.91675 16.5837L2.91675 17.0837L2.91675 17.5837L17.0834 17.5837L17.0834 17.0837ZM2.91675 17.0837L3.41675 17.0837L3.41675 2.91699L2.91675 2.91699L2.41675 2.91699L2.41675 17.0837L2.91675 17.0837ZM7.91674 17.0837L8.41674 17.0837L8.41674 2.91699L7.91674 2.91699L7.41674 2.91699L7.41674 17.0837L7.91674 17.0837Z" fill="currentColor"/>`,"layout-left-partial":`<path d="M2.91732 2.91602L7.91732 2.91602L7.91732 17.0827H2.91732L2.91732 2.91602Z" fill="currentColor" fill-opacity="16%" /><path d="M2.91732 2.91602L17.084 2.91602M2.91732 2.91602L2.91732 17.0827M2.91732 2.91602L7.91732 2.91602M17.084 2.91602L17.084 17.0827M17.084 2.91602L7.91732 2.91602M17.084 17.0827L2.91732 17.0827M17.084 17.0827L7.91732 17.0827M2.91732 17.0827H7.91732M7.91732 17.0827L7.91732 2.91602" stroke="currentColor" stroke-linecap="square"/>`,"layout-left-full":`<path d="M2.91732 2.91602L7.91732 2.91602L7.91732 17.0827H2.91732L2.91732 2.91602Z" fill="currentColor"/><path d="M2.91732 2.91602L17.084 2.91602M2.91732 2.91602L2.91732 17.0827M2.91732 2.91602L7.91732 2.91602M17.084 2.91602L17.084 17.0827M17.084 2.91602L7.91732 2.91602M17.084 17.0827L2.91732 17.0827M17.084 17.0827L7.91732 17.0827M2.91732 17.0827H7.91732M7.91732 17.0827L7.91732 2.91602" stroke="currentColor" stroke-linecap="square"/>`,"layout-right":`<path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor"/>`,"layout-right-partial":`<path d="M17.082 17.0807L6.9987 17.0807V2.91406H17.082V17.0807Z" fill="currentColor" fill-opacity="16%" /><path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor" />`,"layout-right-full":`<path d="M17.082 17.0807L6.9987 17.0807V2.91406H17.082V17.0807Z" fill="currentColor" /><path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor" />`,"square-arrow-top-right":`<path d="M7.91675 2.9165H2.91675V17.0832H17.0834V12.0832M12.0834 2.9165H17.0834V7.9165M9.58342 10.4165L16.6667 3.33317" stroke="currentColor" stroke-linecap="square"/>`,"open-file":`<path d="M7.91602 2.91406H2.91602V17.0807H17.0827V12.0807M12.0827 2.91406H17.0827V7.91406M9.58268 10.4141L16.666 3.33073" stroke="currentColor" stroke-linecap="square"/>`,"speech-bubble":`<path d="M18.3334 10.0003C18.3334 5.57324 15.0927 2.91699 10.0001 2.91699C4.90749 2.91699 1.66675 5.57324 1.66675 10.0003C1.66675 11.1497 2.45578 13.1016 2.5771 13.3949C2.5878 13.4207 2.59839 13.4444 2.60802 13.4706C2.69194 13.6996 3.04282 14.9364 1.66675 16.7684C3.5186 17.6538 5.48526 16.1982 5.48526 16.1982C6.84592 16.9202 8.46491 17.0837 10.0001 17.0837C15.0927 17.0837 18.3334 14.4274 18.3334 10.0003Z" stroke="currentColor" stroke-linecap="square"/>`,comment:`<path d="M16.25 3.75H3.75V16.25L6.875 14.4643H16.25V3.75Z" stroke="currentColor" stroke-linecap="square"/>`,"folder-add-left":`<path d="M2.08333 9.58268V2.91602H8.33333L10 5.41602H17.9167V16.2493H8.75M3.75 12.0827V14.5827M3.75 14.5827V17.0827M3.75 14.5827H1.25M3.75 14.5827H6.25" stroke="currentColor" stroke-linecap="square"/>`,github:`<path d="M10.0001 1.62549C14.6042 1.62549 18.3334 5.35465 18.3334 9.95882C18.333 11.7049 17.785 13.4068 16.7666 14.8251C15.7482 16.2434 14.3107 17.3066 12.6563 17.8651C12.2397 17.9484 12.0834 17.688 12.0834 17.4692C12.0834 17.188 12.0938 16.2922 12.0938 15.1776C12.0938 14.3963 11.8334 13.8963 11.5313 13.6359C13.3855 13.4276 15.3334 12.7192 15.3334 9.52132C15.3334 8.60465 15.0105 7.86507 14.4792 7.28174C14.5626 7.0734 14.8542 6.21924 14.3959 5.0734C14.3959 5.0734 13.698 4.84424 12.1042 5.92757C11.4376 5.74007 10.7292 5.64632 10.0209 5.64632C9.31258 5.64632 8.60425 5.74007 7.93758 5.92757C6.34383 4.85465 5.64592 5.0734 5.64592 5.0734C5.18758 6.21924 5.47925 7.0734 5.56258 7.28174C5.03133 7.86507 4.70842 8.61507 4.70842 9.52132C4.70842 12.7088 6.64592 13.4276 8.50008 13.6359C8.2605 13.8442 8.04175 14.2088 7.96883 14.7505C7.48967 14.9692 6.29175 15.3234 5.54175 14.063C5.3855 13.813 4.91675 13.1984 4.2605 13.2088C3.56258 13.2192 3.97925 13.6047 4.27092 13.7609C4.62508 13.9588 5.03133 14.6984 5.12508 14.938C5.29175 15.4067 5.83342 16.3026 7.92717 15.9172C7.92717 16.6151 7.93758 17.2713 7.93758 17.4692C7.93758 17.688 7.78133 17.938 7.36467 17.8651C5.70491 17.3126 4.26126 16.2515 3.23851 14.8324C2.21576 13.4133 1.66583 11.7081 1.66675 9.95882C1.66675 5.35465 5.39592 1.62549 10.0001 1.62549Z" fill="currentColor"/>`,discord:`<path d="M16.0742 4.45014C14.9244 3.92097 13.7106 3.54556 12.4638 3.3335C12.2932 3.64011 12.1388 3.95557 12.0013 4.27856C10.6732 4.07738 9.32261 4.07738 7.99451 4.27856C7.85694 3.9556 7.70257 3.64014 7.53203 3.3335C6.28441 3.54735 5.06981 3.92365 3.91889 4.45291C1.63401 7.85128 1.01462 11.1652 1.32431 14.4322C2.6624 15.426 4.16009 16.1819 5.7523 16.6668C6.11082 16.1821 6.42806 15.6678 6.70066 15.1295C6.18289 14.9351 5.68315 14.6953 5.20723 14.4128C5.33249 14.3215 5.45499 14.2274 5.57336 14.136C6.95819 14.7907 8.46965 15.1302 9.99997 15.1302C11.5303 15.1302 13.0418 14.7907 14.4266 14.136C14.5463 14.2343 14.6688 14.3284 14.7927 14.4128C14.3159 14.6957 13.8152 14.9361 13.2965 15.1309C13.5688 15.669 13.8861 16.1828 14.2449 16.6668C15.8385 16.1838 17.3373 15.4283 18.6756 14.4335C19.039 10.645 18.0549 7.36145 16.0742 4.45014ZM7.09294 12.423C6.22992 12.423 5.51693 11.6357 5.51693 10.6671C5.51693 9.69852 6.20514 8.90427 7.09019 8.90427C7.97524 8.90427 8.68272 9.69852 8.66758 10.6671C8.65244 11.6357 7.97248 12.423 7.09294 12.423ZM12.907 12.423C12.0426 12.423 11.3324 11.6357 11.3324 10.6671C11.3324 9.69852 12.0206 8.90427 12.907 8.90427C13.7934 8.90427 14.4954 9.69852 14.4803 10.6671C14.4651 11.6357 13.7865 12.423 12.907 12.423Z" fill="currentColor"/>`,"layout-bottom":`<path d="M2.91699 17.0832L2.41699 17.0832L2.41699 17.5832L2.91699 17.5832L2.91699 17.0832ZM2.91699 2.91653L2.91699 2.41653L2.41699 2.41653L2.41699 2.91653L2.91699 2.91653ZM17.0837 2.91653L17.5837 2.91653L17.5837 2.41653L17.0837 2.41653L17.0837 2.91653ZM17.0837 17.0832L17.5837 17.0832L17.5837 17.5832L17.0837 17.5832L17.0837 17.0832ZM17.0837 12.5827L17.5837 12.5827L17.5837 11.5827L17.0837 11.5827L17.0837 12.0827L17.0837 12.5827ZM2.91699 11.5827L2.41699 11.5827L2.41699 12.5827L2.91699 12.5827L2.91699 12.0827L2.91699 11.5827ZM2.91699 17.0832L3.41699 17.0832L3.41699 2.91653L2.91699 2.91653L2.41699 2.91653L2.41699 17.0832L2.91699 17.0832ZM2.91699 2.91653L2.91699 3.41653L17.0837 3.41653L17.0837 2.91653L17.0837 2.41653L2.91699 2.41653L2.91699 2.91653ZM17.0837 2.91653L16.5837 2.91653L16.5837 17.0832L17.0837 17.0832L17.5837 17.0832L17.5837 2.91653L17.0837 2.91653ZM17.0837 17.0832L17.0837 16.5832L2.91699 16.5832L2.91699 17.0832L2.91699 17.5832L17.0837 17.5832L17.0837 17.0832ZM17.0837 12.0827L17.0837 11.5827L2.91699 11.5827L2.91699 12.0827L2.91699 12.5827L17.0837 12.5827L17.0837 12.0827Z" fill="currentColor"/>`,"layout-bottom-partial":`<path d="M2.91732 12.0827L17.084 12.0827L17.084 17.0827H2.91732L2.91732 12.0827Z" fill="currentColor" fill-opacity="16%" /><path d="M2.91732 2.91602L17.084 2.91602M2.91732 2.91602L2.91732 17.0827M17.084 2.91602L17.084 17.0827M17.084 17.0827L2.91732 17.0827M2.91732 12.0827L17.084 12.0827" stroke="currentColor" stroke-linecap="square"/>`,"layout-bottom-full":`<path d="M2.91732 12.0827L17.084 12.0827L17.084 17.0827H2.91732L2.91732 12.0827Z" fill="currentColor"/><path d="M2.91732 2.91602L17.084 2.91602M2.91732 2.91602L2.91732 17.0827M17.084 2.91602L17.084 17.0827M17.084 17.0827L2.91732 17.0827M2.91732 12.0827L17.084 12.0827" stroke="currentColor" stroke-linecap="square"/>`,"dot-grid":`<path d="M2.08398 9.16602H3.75065V10.8327H2.08398V9.16602Z" fill="currentColor"/><path d="M10.834 9.16602H9.16732V10.8327H10.834V9.16602Z" fill="currentColor"/><path d="M16.2507 9.16602H17.9173V10.8327H16.2507V9.16602Z" fill="currentColor"/><path d="M2.08398 9.16602H3.75065V10.8327H2.08398V9.16602Z" stroke="currentColor"/><path d="M10.834 9.16602H9.16732V10.8327H10.834V9.16602Z" stroke="currentColor"/><path d="M16.2507 9.16602H17.9173V10.8327H16.2507V9.16602Z" stroke="currentColor"/>`,"circle-check":`<path d="M12.4987 7.91732L8.7487 12.5007L7.08203 10.834M17.9154 10.0007C17.9154 14.3729 14.371 17.9173 9.9987 17.9173C5.62644 17.9173 2.08203 14.3729 2.08203 10.0007C2.08203 5.6284 5.62644 2.08398 9.9987 2.08398C14.371 2.08398 17.9154 5.6284 17.9154 10.0007Z" stroke="currentColor" stroke-linecap="square"/>`,copy:`<path d="M6.2513 6.24935V2.91602H17.0846V13.7493H13.7513M13.7513 6.24935V17.0827H2.91797V6.24935H13.7513Z" stroke="currentColor" stroke-linecap="round"/>`,check:`<path d="M5 11.9657L8.37838 14.7529L15 5.83398" stroke="currentColor" stroke-linecap="square"/>`,photo:`<path d="M16.6665 16.6666L11.6665 11.6666L9.99984 13.3333L6.6665 9.99996L3.08317 13.5833M2.9165 2.91663H17.0832V17.0833H2.9165V2.91663ZM13.3332 7.49996C13.3332 8.30537 12.6803 8.95829 11.8748 8.95829C11.0694 8.95829 10.4165 8.30537 10.4165 7.49996C10.4165 6.69454 11.0694 6.04163 11.8748 6.04163C12.6803 6.04163 13.3332 6.69454 13.3332 7.49996Z" stroke="currentColor" stroke-linecap="square"/>`,share:`<path d="M10.0013 12.0846L10.0013 3.33464M13.7513 6.66797L10.0013 2.91797L6.2513 6.66797M17.0846 10.418V17.0846H2.91797V10.418" stroke="currentColor" stroke-linecap="square"/>`,shield:`<path d="M7.49935 9.3737L9.16602 11.0404L12.4994 7.70703M9.99935 2.08203L17.0827 4.3737V9.92565C17.0827 14.0694 13.3327 16.2487 9.99935 18.047C6.66602 16.2487 2.91602 14.0694 2.91602 9.92565V4.3737L9.99935 2.08203Z" stroke="currentColor" stroke-linecap="square"/>`,download:`<path d="M13.9583 10.6257L10 14.584L6.04167 10.6257M10 2.08398V13.959M16.25 17.9173H3.75" stroke="currentColor" stroke-linecap="square"/>`,menu:`<path d="M2.5 5H17.5M2.5 10H17.5M2.5 15H17.5" stroke="currentColor" stroke-linecap="square"/>`,server:`<rect x="3.35547" y="1.92969" width="13.2857" height="16.1429" stroke="currentColor"/><rect x="3.35547" y="11.9297" width="13.2857" height="6.14286" stroke="currentColor"/><rect x="12.8555" y="14.2852" width="1.42857" height="1.42857" fill="currentColor"/><rect x="10" y="14.2852" width="1.42857" height="1.42857" fill="currentColor"/>`,branch:`<path d="M14.2036 7.19987L14.2079 6.69989L13.2079 6.69132L13.2036 7.1913L13.7036 7.19559L14.2036 7.19987ZM8.14804 5.09032H7.64804C7.64804 5.75797 7.06861 6.34471 6.29619 6.34471V6.84471V7.34471C7.56926 7.34471 8.64804 6.36051 8.64804 5.09032H8.14804ZM6.29619 6.84471V6.34471C5.52376 6.34471 4.94434 5.75797 4.94434 5.09032H4.44434H3.94434C3.94434 6.36051 5.02311 7.34471 6.29619 7.34471V6.84471ZM4.44434 5.09032H4.94434C4.94434 4.42267 5.52376 3.83594 6.29619 3.83594V3.33594V2.83594C5.02311 2.83594 3.94434 3.82013 3.94434 5.09032H4.44434ZM6.29619 3.33594V3.83594C7.06861 3.83594 7.64804 4.42267 7.64804 5.09032H8.14804H8.64804C8.64804 3.82013 7.56926 2.83594 6.29619 2.83594V3.33594ZM8.14804 14.9149H7.64804C7.64804 15.5825 7.06861 16.1693 6.29619 16.1693V16.6693V17.1693C7.56926 17.1693 8.64804 16.1851 8.64804 14.9149H8.14804ZM6.29619 16.6693V16.1693C5.52376 16.1693 4.94434 15.5825 4.94434 14.9149H4.44434H3.94434C3.94434 16.1851 5.02311 17.1693 6.29619 17.1693V16.6693ZM4.44434 14.9149H4.94434C4.94434 14.2472 5.52376 13.6605 6.29619 13.6605V13.1605V12.6605C5.02311 12.6605 3.94434 13.6447 3.94434 14.9149H4.44434ZM6.29619 13.1605V13.6605C7.06861 13.6605 7.64804 14.2472 7.64804 14.9149H8.14804H8.64804C8.64804 13.6447 7.56926 12.6605 6.29619 12.6605V13.1605ZM15.5554 5.09032H15.0554C15.0554 5.75797 14.476 6.34471 13.7036 6.34471V6.84471V7.34471C14.9767 7.34471 16.0554 6.36051 16.0554 5.09032H15.5554ZM13.7036 6.84471V6.34471C12.9312 6.34471 12.3517 5.75797 12.3517 5.09032H11.8517H11.3517C11.3517 6.36051 12.4305 7.34471 13.7036 7.34471V6.84471ZM11.8517 5.09032H12.3517C12.3517 4.42267 12.9312 3.83594 13.7036 3.83594V3.33594V2.83594C12.4305 2.83594 11.3517 3.82013 11.3517 5.09032H11.8517ZM13.7036 3.33594V3.83594C14.476 3.83594 15.0554 4.42267 15.0554 5.09032H15.5554H16.0554C16.0554 3.82013 14.9767 2.83594 13.7036 2.83594V3.33594ZM13.7036 7.19559L13.2036 7.1913L13.1544 12.9277L13.6544 12.932L14.1544 12.9363L14.2036 7.19987L13.7036 7.19559ZM6.29619 6.84471H5.79619V13.1605H6.29619H6.79619V6.84471H6.29619ZM11.6545 14.9149V14.4149H8.14804V14.9149V15.4149H11.6545V14.9149ZM13.6544 12.932L13.1544 12.9277C13.1474 13.7511 12.4779 14.4149 11.6545 14.4149V14.9149V15.4149C13.0269 15.4149 14.1426 14.3086 14.1544 12.9363L13.6544 12.932Z" fill="currentColor"/>`,edit:`<path d="M17.0832 17.0807V17.5807H17.5832V17.0807H17.0832ZM2.9165 17.0807H2.4165V17.5807H2.9165V17.0807ZM2.9165 2.91406V2.41406H2.4165V2.91406H2.9165ZM9.58317 3.41406H10.0832V2.41406H9.58317V2.91406V3.41406ZM17.5832 10.4141V9.91406H16.5832V10.4141H17.0832H17.5832ZM6.24984 11.2474L5.89628 10.8938L5.74984 11.0403V11.2474H6.24984ZM6.24984 13.7474H5.74984V14.2474H6.24984V13.7474ZM8.74984 13.7474V14.2474H8.95694L9.10339 14.101L8.74984 13.7474ZM15.2082 2.28906L15.5617 1.93551L15.2082 1.58196L14.8546 1.93551L15.2082 2.28906ZM17.7082 4.78906L18.0617 5.14262L18.4153 4.78906L18.0617 4.43551L17.7082 4.78906ZM17.0832 17.0807V16.5807H2.9165V17.0807V17.5807H17.0832V17.0807ZM2.9165 17.0807H3.4165V2.91406H2.9165H2.4165V17.0807H2.9165ZM2.9165 2.91406V3.41406H9.58317V2.91406V2.41406H2.9165V2.91406ZM17.0832 10.4141H16.5832V17.0807H17.0832H17.5832V10.4141H17.0832ZM6.24984 11.2474H5.74984V13.7474H6.24984H6.74984V11.2474H6.24984ZM6.24984 13.7474V14.2474H8.74984V13.7474V13.2474H6.24984V13.7474ZM6.24984 11.2474L6.60339 11.6009L15.5617 2.64262L15.2082 2.28906L14.8546 1.93551L5.89628 10.8938L6.24984 11.2474ZM15.2082 2.28906L14.8546 2.64262L17.3546 5.14262L17.7082 4.78906L18.0617 4.43551L15.5617 1.93551L15.2082 2.28906ZM17.7082 4.78906L17.3546 4.43551L8.39628 13.3938L8.74984 13.7474L9.10339 14.101L18.0617 5.14262L17.7082 4.78906Z" fill="currentColor"/>`,help:`<path d="M7.91683 7.91927V6.2526H12.0835V8.7526L10.0002 10.0026V12.0859M10.0002 13.7526V13.7609M17.9168 10.0026C17.9168 14.3749 14.3724 17.9193 10.0002 17.9193C5.62791 17.9193 2.0835 14.3749 2.0835 10.0026C2.0835 5.63035 5.62791 2.08594 10.0002 2.08594C14.3724 2.08594 17.9168 5.63035 17.9168 10.0026Z" stroke="currentColor" stroke-linecap="square"/>`,"settings-gear":`<path d="M7.62516 4.46094L5.05225 3.86719L3.86475 5.05469L4.4585 7.6276L2.0835 9.21094V10.7943L4.4585 12.3776L3.86475 14.9505L5.05225 16.138L7.62516 15.5443L9.2085 17.9193H10.7918L12.3752 15.5443L14.9481 16.138L16.1356 14.9505L15.5418 12.3776L17.9168 10.7943V9.21094L15.5418 7.6276L16.1356 5.05469L14.9481 3.86719L12.3752 4.46094L10.7918 2.08594H9.2085L7.62516 4.46094Z" stroke="currentColor"/><path d="M12.5002 10.0026C12.5002 11.3833 11.3809 12.5026 10.0002 12.5026C8.61945 12.5026 7.50016 11.3833 7.50016 10.0026C7.50016 8.62189 8.61945 7.5026 10.0002 7.5026C11.3809 7.5026 12.5002 8.62189 12.5002 10.0026Z" stroke="currentColor"/>`,dash:`<rect x="5" y="9.5" width="10" height="1" fill="currentColor"/>`,"cloud-upload":`<path d="M12.0833 16.25H15C17.0711 16.25 18.75 14.5711 18.75 12.5C18.75 10.5649 17.2843 8.97217 15.4025 8.77133C15.2 6.13103 12.8586 4.08333 10 4.08333C7.71532 4.08333 5.76101 5.49781 4.96501 7.49881C2.84892 7.90461 1.25 9.76559 1.25 11.6667C1.25 13.9813 3.30203 16.25 5.83333 16.25H7.91667M10 16.25V10.4167M12.0833 11.875L10 9.79167L7.91667 11.875" stroke="currentColor" stroke-linecap="square"/>`,trash:`<path d="M4.58342 17.9134L4.58369 17.4134L4.22787 17.5384L4.22766 18.0384H4.58342V17.9134ZM15.4167 17.9134V18.0384H15.7725L15.7723 17.5384L15.4167 17.9134ZM2.08342 3.95508V3.45508H1.58342V3.95508H2.08342V4.45508V3.95508ZM17.9167 4.45508V4.95508H18.4167V4.45508H17.9167V3.95508V4.45508ZM4.16677 4.58008L3.66701 4.5996L4.22816 17.5379L4.72792 17.4934L5.22767 17.4489L4.66652 4.54055L4.16677 4.58008ZM4.58342 18.0384V17.9134H15.4167V18.0384V18.5384H4.58342V18.0384ZM15.4167 17.9134L15.8332 17.5379L16.2498 4.5996L15.7501 4.58008L15.2503 4.56055L14.8337 17.4989L15.4167 17.9134ZM15.8334 4.58008V4.08008H4.16677V4.58008V5.08008H15.8334V4.58008ZM2.08342 4.45508V4.95508H4.16677V4.58008V4.08008H2.08342V4.45508ZM15.8334 4.58008V5.08008H17.9167V4.45508V3.95508H15.8334V4.58008ZM6.83951 4.35149L7.432 4.55047C7.79251 3.47701 8.80699 2.70508 10.0001 2.70508V2.20508V1.70508C8.25392 1.70508 6.77335 2.83539 6.24702 4.15251L6.83951 4.35149ZM10.0001 2.20508V2.70508C11.1932 2.70508 12.2077 3.47701 12.5682 4.55047L13.1607 4.35149L13.7532 4.15251C13.2269 2.83539 11.7463 1.70508 10.0001 1.70508V2.20508Z" fill="currentColor"/>`,sliders:`<path d="M11.7778 4.66797H14.4444M11.7778 4.66797C11.7778 5.77254 10.8823 6.66797 9.77776 6.66797C8.67319 6.66797 7.77776 5.77254 7.77776 4.66797M11.7778 4.66797C11.7778 3.5634 10.8823 2.66797 9.77776 2.66797C8.67319 2.66797 7.77776 3.5634 7.77776 4.66797M1.55554 4.66797H7.77776M4.22221 11.3346H1.55554M4.22221 11.3346C4.22221 12.4392 5.11764 13.3346 6.22221 13.3346C7.32678 13.3346 8.22221 12.4392 8.22221 11.3346M4.22221 11.3346C4.22221 10.2301 5.11764 9.33464 6.22221 9.33464C7.32678 9.33464 8.22221 10.2301 8.22221 11.3346M14.4444 11.3346H8.22221" stroke="currentColor"/>`,keyboard:`<path d="M5.125 7.375V4.375H14.875V2.875M8.3125 13.9375H11.6875M8.125 13.9375H11.875M2.125 7.375H17.875V17.125H2.125V7.375ZM5.5 10.375H5.125V10.75H5.5V10.375ZM8.5 10.375H8.125V10.75H8.5V10.375ZM11.875 10.375H11.5V10.75H11.875V10.375ZM14.875 10.375H14.5V10.75H14.875V10.375ZM14.875 13.75H14.5V14.125H14.875V13.75ZM5.5 13.75H5.125V14.125H5.5V13.75Z" stroke="currentColor" stroke-linecap="square"/>`,selector:`<path d="M6.66626 12.5033L9.99959 15.8366L13.3329 12.5033M6.66626 7.50326L9.99959 4.16992L13.3329 7.50326" stroke="currentColor" stroke-linecap="square"/>`,"arrow-down-to-line":`<path d="M15.2083 11.6667L10 16.875L4.79167 11.6667M10 16.25V3.125" stroke="currentColor" stroke-width="1.25" stroke-linecap="square"/>`,warning:`<path d="M10 7.91667V11.6667M10 13.7417V13.75M10 2.5L1.875 16.25H18.125L10 2.5Z" stroke="currentColor" stroke-linecap="square"/>`,reset:`<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`,link:`<path d="M2.08334 12.0833L1.72979 11.7298L1.37624 12.0833L1.72979 12.4369L2.08334 12.0833ZM7.91668 17.9167L7.56312 18.2702L7.91668 18.6238L8.27023 18.2702L7.91668 17.9167ZM17.9167 7.91666L18.2702 8.27022L18.6238 7.91666L18.2702 7.56311L17.9167 7.91666ZM12.0833 2.08333L12.4369 1.72977L12.0833 1.37622L11.7298 1.72977L12.0833 2.08333ZM8.39646 5.06311L8.0429 5.41666L8.75001 6.12377L9.10356 5.77021L8.75001 5.41666L8.39646 5.06311ZM5.77023 9.10355L6.12378 8.74999L5.41668 8.04289L5.06312 8.39644L5.41668 8.74999L5.77023 9.10355ZM14.2298 10.8964L13.8762 11.25L14.5833 11.9571L14.9369 11.6035L14.5833 11.25L14.2298 10.8964ZM11.6036 14.9369L11.9571 14.5833L11.25 13.8762L10.8965 14.2298L11.25 14.5833L11.6036 14.9369ZM7.14646 12.1464L6.7929 12.5L7.50001 13.2071L7.85356 12.8535L7.50001 12.5L7.14646 12.1464ZM12.8536 7.85355L13.2071 7.49999L12.5 6.79289L12.1465 7.14644L12.5 7.49999L12.8536 7.85355ZM2.08334 12.0833L1.72979 12.4369L7.56312 18.2702L7.91668 17.9167L8.27023 17.5631L2.4369 11.7298L2.08334 12.0833ZM17.9167 7.91666L18.2702 7.56311L12.4369 1.72977L12.0833 2.08333L11.7298 2.43688L17.5631 8.27022L17.9167 7.91666ZM12.0833 2.08333L11.7298 1.72977L8.39646 5.06311L8.75001 5.41666L9.10356 5.77021L12.4369 2.43688L12.0833 2.08333ZM5.41668 8.74999L5.06312 8.39644L1.72979 11.7298L2.08334 12.0833L2.4369 12.4369L5.77023 9.10355L5.41668 8.74999ZM14.5833 11.25L14.9369 11.6035L18.2702 8.27022L17.9167 7.91666L17.5631 7.56311L14.2298 10.8964L14.5833 11.25ZM7.91668 17.9167L8.27023 18.2702L11.6036 14.9369L11.25 14.5833L10.8965 14.2298L7.56312 17.5631L7.91668 17.9167ZM7.50001 12.5L7.85356 12.8535L12.8536 7.85355L12.5 7.49999L12.1465 7.14644L7.14646 12.1464L7.50001 12.5Z" fill="currentColor"/>`,providers:`<path d="M5.11115 3.33252H10.8889M5.11115 3.33252L3.33337 3.33254V12.6658H5.11115M5.11115 3.33252L5.11108 1.55469M10.8889 3.33252L12.6667 3.33252V12.6658H10.8889M10.8889 3.33252L10.8889 1.55469M10.8889 12.6658H5.11115M10.8889 12.6658L10.8889 14.4435M5.11115 12.6658L5.11108 14.4435M8 1.55469V3.33247M14.4444 7.99915H12.6666M14.4444 5.11023H12.6666M14.4444 10.8881H12.6666M8 14.4435V12.6658M1.55554 7.99915H3.33332M1.55554 10.8881H3.33332M1.55554 5.11023H3.33332M6 9.99915V5.99915H10V9.99915H6Z" stroke="currentColor"/>`,models:`<path fill-rule="evenodd" clip-rule="evenodd" d="M14 8C9.83336 8 8 9.83336 8 14C8 9.83336 6.16666 8 2 8C6.16666 8 8 6.16666 8 2C8 6.16666 9.83336 8 14 8Z" stroke="currentColor"/>`,appearance:`<path d="M2.00012 13.9997L13.9998 2" stroke="currentColor" stroke-linecap="square"/><path d="M2.00012 8.35278L8.3529 2" stroke="currentColor" stroke-linecap="square"/><path d="M2.00012 2.70586L2.70599 2" stroke="currentColor" stroke-linecap="square"/><path d="M7.64722 14.0012L14 7.64844" stroke="currentColor" stroke-linecap="square"/><path d="M13.2935 13.9988L13.9993 13.293" stroke="currentColor" stroke-linecap="square"/>`,notifications:`<path d="M14.8889 6.77778V9.11112C14.8889 10.093 14.8889 10.8889 14.8889 10.8889H11.3334M5.55558 10.8889H2C2 10.8889 2.00001 10.093 2.00001 9.11112V3.77778C2.00001 2.79594 2.00009 2 2.00009 2H9.44531M5.55558 10.8889V13.1111H8.44447H11.3334V10.8889M5.55558 10.8889H11.3334" stroke="currentColor"/><path d="M13 5C14.1046 5 15 4.10457 15 3C15 1.89543 14.1046 1 13 1C11.8954 1 11 1.89543 11 3C11 4.10457 11.8954 5 13 5Z" stroke="currentColor"/>`,extensions:`<path d="M8 6.75047V9.25047M10.668 6.75047V9.25047M5.33398 6.75047V9.25047M1.33398 2.44531V13.5553H14.6673V2.44531H1.33398Z" stroke="currentColor" stroke-linecap="square"/>`,cube:`<path d="M10 2.5L16.5 6.25V13.75L10 17.5L3.5 13.75V6.25L10 2.5Z" stroke="currentColor"/><path d="M10 10L16.5 6.25M10 10V17.5M10 10L3.5 6.25" stroke="currentColor"/>`,"post-skill":`<rect x="2.5" y="3.5" width="15" height="13" rx="1.5" stroke="currentColor"/><path d="M5.5 7.5H10.5M5.5 10.5H14.5" stroke="currentColor"/>`,"arrow-undo-down":`<path d="M4.08333 11.0859L1.75 8.7526L4.08333 6.41927M2.33333 8.7526L12.5417 8.7526L12.5417 3.21094L7 3.21094" stroke="currentColor" stroke-width="1" stroke-linecap="square"/>`};function Eo(e){return e===`magnifying-glass`||e===`arrow-undo-down`||e===`subagent`||e===`notifications`||e===`appearance`||e===`extensions`||e===`sliders`||e===`providers`||e===`models`?`0 0 16 16`:`0 0 20 20`}var Do=W(`<svg><use>`),Oo={lock:{viewBox:`0 0 16 16`,body:`<rect x="3.5" y="7" width="9" height="7" rx="1" stroke="currentColor"/><path d="M5 7V5a3 3 0 0 1 6 0v2M8 10v1" stroke="currentColor" stroke-linecap="round"/>`},globe:{viewBox:`0 0 16 16`,body:`<circle cx="8" cy="8" r="6" stroke="currentColor"/><ellipse cx="8" cy="8" rx="2.5" ry="6" stroke="currentColor"/><path d="M2 8h12" stroke="currentColor"/>`},flask:{viewBox:`0 0 16 16`,body:`<path d="M5.5 2H10.5M6 2V6L2.5 12C2 13 2.5 14 3.5 14H12.5C13.5 14 14 13 13.5 12L10 6V2M4.25 9H11.75" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>`},edit:{viewBox:`0 0 16 16`,body:`<path d="M13.5556 8.21529V13.5556H2.44446L2.44446 2.44445H7.78474M6.00002 8.16216V10H7.83786L14 3.83784L12.1622 2L6.00002 8.16216Z" stroke="currentColor"/>`},"folder-add-left":{viewBox:`0 0 16 16`,body:`<path d="M7.5 13.3333H1.5V2H6.83333L8.83333 4H14.8333V6M10.1667 11.3333H15.5M12.8333 8.66667V14" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`},folder:{viewBox:`0 0 16 16`,body:`<path d="M1.33337 2V13.3333H14.6667V4H8.66671L6.66671 2H1.33337Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`},branch:{viewBox:`0 0 16 16`,body:`<path d="M5.118 5.686V10.314M5.118 5.686C5.97 5.686 6.661 4.995 6.661 4.143C6.661 3.291 5.97 2.6 5.118 2.6C4.266 2.6 3.575 3.291 3.575 4.143C3.575 4.995 4.266 5.686 5.118 5.686ZM5.118 10.314C4.266 10.314 3.575 11.005 3.575 11.857C3.575 12.709 4.266 13.4 5.118 13.4C5.97 13.4 6.661 12.709 6.661 11.857M5.118 10.314C5.97 10.314 6.661 11.005 6.661 11.857M10.882 5.686C11.734 5.686 12.425 4.995 12.425 4.143C12.425 3.291 11.734 2.6 10.882 2.6C10.03 2.6 9.339 3.291 9.339 4.143C9.339 4.995 10.03 5.686 10.882 5.686ZM10.882 5.686V9.457C10.882 10.783 9.807 11.857 8.482 11.857H6.661" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>`},"branch-out":{viewBox:`0 0 16 16`,body:`<path d="M10.4225 3.35355L12.9024 5.83344L10.4225 8.31333" stroke="currentColor"/><path d="M1 12.2852H4.23042C4.89912 12.2852 5.52359 11.951 5.89452 11.3946L9.00783 6.72462C8.37877 6.16823 10.0032 5.83402 10.6719 5.83402H12.9024" stroke="currentColor"/><path d="M8.5 12.2852H14" stroke="currentColor" stroke-linejoin="round"/>`},"grid-plus":{viewBox:`0 0 16 16`,body:`<path d="M13.9948 11.668H9.32812M11.6641 9.33203V13.9987M6.66667 9.33203V13.9987H2V9.33203H6.66667ZM6.66667 2V6.66667H2V2H6.66667ZM13.9948 2V6.66667H9.32812V2H13.9948Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`},help:{viewBox:`0 0 16 16`,body:`<path d="M6.33345 6.33349V5.00015H9.66679V7.00015L8.00015 8.00015V9.66679M8.27485 11.6819H7.71897M14.4446 8.00011C14.4446 11.5593 11.5593 14.4446 8.00011 14.4446C4.44094 14.4446 1.55566 11.5593 1.55566 8.00011C1.55566 4.44094 4.44094 1.55566 8.00011 1.55566C11.5593 1.55566 14.4446 4.44094 14.4446 8.00011Z" stroke="currentColor" stroke-linecap="square"/>`},info:{viewBox:`0 0 16 16`,body:`<g transform="translate(2 2)"><path d="M12 12H0V0H12V12ZM1 1V11H11V1H1ZM6.5791 4.81641V9.37207H5.5791V5.81641H4.46777V4.81641H6.5791ZM6.85645 2.62891V3.62891H5.30078V2.62891H6.85645Z" fill="currentColor"/></g>`},"circle-exclamation":{viewBox:`0 0 16 16`,body:`<path d="M8.75 11.75H7.25V10.25H8.75V11.75Z" fill="currentColor"/><path d="M8.75 9.25H7.25V4.25H8.75V9.25Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M8 1C9.93286 1 11.684 1.7836 12.9502 3.0498C14.2164 4.31601 15 6.06714 15 8C15 11.866 11.866 15 8 15C6.06714 15 4.31601 14.2164 3.0498 12.9502C1.7836 11.684 1 9.93286 1 8C1 4.13401 4.13401 1 8 1ZM8 2C4.68629 2 2 4.68629 2 8C2 9.65699 2.67148 11.1559 3.75781 12.2422C4.84415 13.3285 6.34301 14 8 14C11.3137 14 14 11.3137 14 8C14 6.34301 13.3285 4.84415 12.2422 3.75781C11.1559 2.67148 9.65699 2 8 2Z" fill="currentColor"/>`},"circle-xmark":{viewBox:`0 0 16 16`,body:`<path fill-rule="evenodd" clip-rule="evenodd" d="M1.33334 8.00016C1.33334 4.31826 4.31811 1.3335 8.00001 1.3335C11.6819 1.3335 14.6667 4.31826 14.6667 8.00016C14.6667 11.6821 11.6819 14.6668 8.00001 14.6668C4.31811 14.6668 1.33334 11.6821 1.33334 8.00016ZM6.00001 5.29306L5.2929 6.00016L7.2929 8.00016L5.2929 10.0002L6.00001 10.7073L8.00001 8.70727L10 10.7073L10.7071 10.0002L8.70712 8.00016L10.7071 6.00016L10 5.29306L8.00001 7.29306L6.00001 5.29306Z" fill="currentColor"/>`},"sidebar-right":{viewBox:`0 0 20 20`,body:`<path d="M2.91536 2.91406H2.36536V2.36406H2.91536V2.91406ZM2.91536 17.0807V17.6307H2.36536V17.0807H2.91536ZM17.082 17.0807H17.632V17.6307H17.082V17.0807ZM17.082 2.91406V2.36406H17.632V2.91406H17.082ZM6.9987 2.91406H6.4487V2.36406H6.9987V2.91406ZM6.9987 17.0807V17.6307H6.4487V17.0807H6.9987ZM2.91536 2.91406H3.46536V17.0807H2.91536H2.36536V2.91406H2.91536ZM2.91536 17.0807V16.5307H17.082V17.0807V17.6307H2.91536V17.0807ZM17.082 17.0807H16.532V2.91406H17.082H17.632V17.0807H17.082ZM17.082 2.91406V3.46406H2.91536V2.91406V2.36406H17.082V2.91406ZM6.9987 2.91406H7.5487V17.0807H6.9987H6.4487V2.91406H6.9987ZM17.082 17.0807L17.082 17.6307L6.9987 17.6307V17.0807V16.5307L17.082 16.5307L17.082 17.0807ZM6.9987 2.91406V2.36406H17.082V2.91406V3.46406H6.9987V2.91406Z" fill="currentColor"/>`},status:{viewBox:`0 0 20 20`,body:`<path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`},"status-active":{viewBox:`0 0 20 20`,body:`<path d="M18 2H2V10H18V2Z" fill="currentColor" fill-opacity="0.1"/><path d="M2 18H18V10H2V18Z" fill="currentColor" fill-opacity="0.1"/><path d="M2 10V18H18V10M2 10V2H18V10M2 10H18M5 6H9M5 14H9" stroke="currentColor"/>`},"magnifying-glass":{viewBox:`0 0 16 16`,body:`<path d="M14 14L10.3454 10.3454M6.88889 11.7778C9.58889 11.7778 11.7778 9.58889 11.7778 6.88889C11.7778 4.18889 9.58889 2 6.88889 2C4.18889 2 2 4.18889 2 6.88889C2 9.58889 4.18889 11.7778 6.88889 11.7778Z" stroke="currentColor"/>`},menu:{viewBox:`0 0 16 16`,body:`<path d="M2 8H14M2 4.664H14M2 11.336H14" stroke="currentColor"/>`},plus:{viewBox:`0 0 16 16`,body:`<path d="M8 2.88867V13.1109" stroke="currentColor" stroke-linejoin="round"/><path d="M2.88867 8H13.1109" stroke="currentColor" stroke-linejoin="round"/>`},"settings-gear":{viewBox:`0 0 16 16`,body:`<path d="M7.99998 1.3335L14 4.66683V11.3335L7.99998 14.6668L2 11.3335V4.66683L7.99998 1.3335Z" stroke="currentColor"/><path d="M9.99998 8.00016C9.99998 9.10476 9.10458 10.0002 7.99998 10.0002C6.89538 10.0002 5.99998 9.10476 5.99998 8.00016C5.99998 6.89556 6.89538 6.00016 7.99998 6.00016C9.10458 6.00016 9.99998 6.89556 9.99998 8.00016Z" stroke="currentColor"/>`},"chevron-down":{viewBox:`0 0 16 16`,body:`<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`},collapse:{viewBox:`0 0 16 16`,body:`<path d="M8 1V6M11 3L8 6L5 3" stroke="currentColor"/><path d="M8 15V10M11 13L8 10L5 13" stroke="currentColor"/><path d="M4 8H6" stroke="currentColor"/><path d="M7 8H9" stroke="currentColor"/><path d="M10 8H12" stroke="currentColor"/>`},check:{viewBox:`0 0 16 16`,body:`<path d="M3.53613 8.17857L6.39328 11.75L12.4647 4.25" stroke="currentColor"/>`},monitor:{viewBox:`0 0 16 16`,body:`<path d="M4.05559 9.38889H0.500007C0.500007 9.38889 0.500017 8.59298 0.500017 7.61112V2.27778C0.500017 1.29594 0.500102 0.5 0.500102 0.5H13.3889C13.3889 0.5 13.3889 1.29594 13.3889 2.27778V7.61112C13.3889 8.59298 13.3889 9.38889 13.3889 9.38889H9.83336M4.05559 9.38889V11.6111H6.94448H9.83336V9.38889M4.05559 9.38889H9.83336" transform="translate(1.05556 1.94444)" stroke="currentColor"/>`},"workspace-new":{viewBox:`0 0 16 16`,body:`<path d="M2 10.7578V14.0011H5.24324M13.9991 5.24324V2H10.7559M13.9991 10.7578V14.0011H10.7559M2 5.24324V2H5.24324" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/><path d="M8 4.5V11.5M4.5 8H11.5" stroke="currentColor" stroke-linejoin="round"/>`},"workspace-isolated":{viewBox:`0 0 16 16`,body:`<path d="M10.5 10.5V5.5H5.5V10.5H10.5Z" fill="currentColor"/><rect x="2.5" y="2.5" width="11" height="11" stroke="currentColor"/>`},workspace:{viewBox:`0 0 16 16`,body:`<path d="M2 10.668V14.0013H10.6667M13.9974 10.6667V2H2.66406M13.9974 10.668V14.0013H10.6641M2 10V2H5.33333" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/><path d="M10.6693 10.6654V5.33203H5.33594V10.6654H10.6693Z" fill="currentColor"/>`},"outline-worktree":{viewBox:`0 0 16 16`,body:`<path d="M12 3.11133L14.3885 5.49977L12 7.88822M14.5 5.49972H10.058L5.13456 11.8139M14.5 11.6606L8.5 11.6606M5.50012 11.6597H1.5" stroke="currentColor"/>`},"outline-trash":{viewBox:`0 0 16 16`,body:`<path d="M2.44434 4.22224H13.5554M5.99994 4.22224V2.44446C5.99994 1.95557 5.99992 1.55557 5.99992 1.55557H9.99989C9.99989 1.55557 9.99994 1.95557 9.99994 2.44446V4.22224M6.55545 7.77779L6.7485 11.7778M9.44437 7.77779L9.2513 11.7778M12.1756 6.88891L11.8666 12.7556C11.8168 13.7068 11.7748 14.4445 11.7748 14.4445H4.22511C4.22511 14.4445 4.18392 13.7067 4.13414 12.7556L3.82509 6.88891" stroke="currentColor"/>`},close:{viewBox:`0 0 20 20`,body:`<path d="M14.4446 5.55566L5.55566 14.4446M5.55566 5.55566L14.4446 14.4446" stroke="currentColor" stroke-linejoin="round"/>`},"xmark-small":{viewBox:`0 0 16 16`,body:`<path d="M4.25 11.75L11.75 4.25M11.75 11.75L4.25 4.25" stroke="currentColor"/>`},"outline-xmark":{viewBox:`0 0 16 16`,body:`<path fill-rule="evenodd" clip-rule="evenodd" d="M4.99487 5.70186L7.29297 7.99995L4.99487 10.2981L5.70198 11.0052L8.00008 8.70706L10.2982 11.0052L11.0053 10.2981L8.70718 7.99995L11.0053 5.70186L10.2982 4.99475L8.00008 7.29285L5.70198 4.99475L4.99487 5.70186Z" fill="currentColor"/>`},"outline-chevron-down":{viewBox:`0 0 16 16`,body:`<path d="M5 6.5L8 9.5L11 6.5" stroke="currentColor"/>`},"outline-dots":{viewBox:`0 0 16 16`,body:`<path d="M2.5 7.5H3.5V8.5H2.5V7.5Z" stroke="currentColor"/><path d="M7.5 7.5H8.5V8.5H7.5V7.5Z" stroke="currentColor"/><path d="M12.5 7.5H13.5V8.5H12.5V7.5Z" stroke="currentColor"/>`},expand:{viewBox:`0 0 16 16`,body:`<path d="M8.25 6.17773V1.17773M11.25 4.17773L8.25 1.17773L5.25 4.17773" stroke="currentColor"/><path d="M8.25 9.17773V14.1777M11.25 11.1777L8.25 14.1777L5.25 11.1777" stroke="currentColor"/><path d="M4.25 7.67773H12.25" stroke="currentColor"/>`},filetree:{viewBox:`0 0 16 16`,body:`<path d="M2.5 1.5V12.2484H6.75M2.5 4.74838H6.75" stroke="currentColor"/><rect x="8.5" y="3.2168" width="6" height="3" fill="none" stroke="currentColor"/><rect x="8.5" y="10.75" width="6" height="3" fill="none" stroke="currentColor"/>`},split:{viewBox:`0 0 16 16`,body:`<path d="M1 14H15L15 2H1V14Z" stroke="currentColor"/><rect x="3" y="4" width="4" height="8" fill="currentColor" fill-opacity="0.5"/><rect x="9" y="4" width="4" height="8" fill="currentColor" fill-opacity="0.5"/>`},unified:{viewBox:`0 0 16 16`,body:`<path d="M3.00001 4.00045L12.9998 4L13 6.99955L3 7L3.00001 4.00045Z" fill="currentColor" fill-opacity="0.5"/><path d="M3.0001 9H13L12.9999 12H3L3.0001 9Z" fill="currentColor" fill-opacity="0.5"/><path d="M1 14H15L15 2H1V14Z" stroke="currentColor"/>`},review:{viewBox:`0 0 20 20`,body:`<path d="M7 14.5H13M7 7.99512H10.0049M10.0049 7.99512H13M10.0049 7.99512V5M10.0049 7.99512V11M18 18V2L2 2L2 18H18Z" stroke="currentColor"/>`},"window-analytics":{viewBox:`0 0 16 16`,body:`<path d="M14.5 9.8333V13.5H1.5V2.5H7.1667M9.5 2.5V7.5H14.5V2.5H9.5Z" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="square"/>`},"graduation-cap":{viewBox:`0 0 16 16`,body:`<path d="M12.3327 7.50065V11.0007L7.99935 13.6673L3.66602 11.0007V7.50065M14.3327 9.83398V6.16732M7.99935 2.33398L1.66602 6.00065L7.99935 10.0007L14.3327 6.00065L7.99935 2.33398Z" stroke="currentColor" stroke-linecap="square"/>`},"code-slash":{viewBox:`0 0 16 16`,body:`<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0812 2.10803L6.55974 14.0809L5.92016 13.8928L9.44161 1.91992L10.0812 2.10803ZM4.13793 4.97275L1.44666 8.00045L4.13793 11.0281L3.63966 11.471L0.554688 8.00045L3.63966 4.52984L4.13793 4.97275ZM12.3617 4.52984L15.4467 8.00045L12.3617 11.471L11.8634 11.0281L14.5547 8.00045L11.8634 4.97275L12.3617 4.52984Z" fill="currentColor"/>`},trash:{viewBox:`0 0 20 20`,body:`<path d="M4.58342 17.9134L4.58369 17.4134L4.22787 17.5384L4.22766 18.0384H4.58342V17.9134ZM15.4167 17.9134V18.0384H15.7725L15.7723 17.5384L15.4167 17.9134ZM2.08342 3.95508V3.45508H1.58342V3.95508H2.08342V4.45508V3.95508ZM17.9167 4.45508V4.95508H18.4167V4.45508H17.9167V3.95508V4.45508ZM4.16677 4.58008L3.66701 4.5996L4.22816 17.5379L4.72792 17.4934L5.22767 17.4489L4.66652 4.54055L4.16677 4.58008ZM4.58342 18.0384V17.9134H15.4167V18.0384V18.5384H4.58342V18.0384ZM15.4167 17.9134L15.8332 17.5379L16.2498 4.5996L15.7501 4.58008L15.2503 4.56055L14.8337 17.4989L15.4167 17.9134ZM15.8334 4.58008V4.08008H4.16677V4.58008V5.08008H15.8334V4.58008ZM2.08342 4.45508V4.95508H4.16677V4.58008V4.08008H2.08342V4.45508ZM15.8334 4.58008V5.08008H17.9167V4.45508V3.95508H15.8334V4.58008ZM6.83951 4.35149L7.432 4.55047C7.79251 3.47701 8.80699 2.70508 10.0001 2.70508V2.20508V1.70508C8.25392 1.70508 6.77335 2.83539 6.24702 4.15251L6.83951 4.35149ZM10.0001 2.20508V2.70508C11.1932 2.70508 12.2077 3.47701 12.5682 4.55047L13.1607 4.35149L13.7532 4.15251C13.2269 2.83539 11.7463 1.70508 10.0001 1.70508V2.20508Z" fill="currentColor"/>`},"outline-sliders":{viewBox:`0 0 16 16`,body:`<path d="M11.7779 4.66675H14.4446M11.7779 4.66675C11.7779 5.77132 10.8825 6.66675 9.77789 6.66675C8.67332 6.66675 7.77789 5.77132 7.77789 4.66675M11.7779 4.66675C11.7779 3.56218 10.8825 2.66675 9.77789 2.66675C8.67332 2.66675 7.77789 3.56218 7.77789 4.66675M1.55566 4.66675H7.77789M4.22233 11.3334H1.55566M4.22233 11.3334C4.22233 12.438 5.11776 13.3334 6.22233 13.3334C7.3269 13.3334 8.22233 12.438 8.22233 11.3334M4.22233 11.3334C4.22233 10.2288 5.11776 9.33341 6.22233 9.33341C7.3269 9.33341 8.22233 10.2288 8.22233 11.3334M14.4446 11.3334H8.22233" stroke="currentColor"/>`},"outline-copy":{viewBox:`0 0 16 16`,body:`<path d="M4.14908 11.0081H1.76282V1.51758H9.1038V2.55588M14.2225 4.99681H6.75397V14.4873H14.2225V4.99681Z" stroke="currentColor"/>`},"arrow-up-right":{viewBox:`0 0 16 16`,body:`<path d="M11 9.56V5H6.44M11 5L5 11" stroke="currentColor"/>`},"outline-square-arrow":{viewBox:`0 0 16 16`,body:`<path d="M13.5555 6.66656V2.44434H9.33326M13.5555 2.44434L7.99993 7.99989M13.5555 9.33324V13.5555C13.5555 13.5555 12.7599 13.5555 11.7777 13.5555H2.44438C2.44438 13.5555 2.44438 12.7599 2.44438 11.7777V4.22213C2.44438 3.2399 2.44434 2.44435 2.44434 2.44435H6.66661" stroke="currentColor"/>`},"outline-arrow-to-corner-top-right":{viewBox:`0 0 16 16`,body:`<path d="M2 8.5V2H14V14H8M5 5.66667H10.3333V11M3.66797 12.333L9.94292 6.05806" stroke="currentColor" stroke-linecap="square"/>`},"outline-hexagonal-warning":{viewBox:`0 0 16 16`,body:`<path d="M10.6667 1.33325H5.33272L1.33334 5.33325L1.33342 10.6917L5.3327 14.691L10.6667 14.6909L14.6911 10.6917V5.33255L10.6667 1.33325Z" stroke="currentColor"/><path d="M8 10.6667H8.00667" stroke="currentColor" stroke-linecap="square"/><path d="M8 7.99992V5.33325" stroke="currentColor" stroke-linecap="square"/>`},"outline-share":{viewBox:`0 0 16 16`,body:`<path d="M13.5554 10.4445V13.5556C13.5554 13.5556 12.7599 13.5556 11.7777 13.5556H4.22211C3.23989 13.5556 2.44434 13.5556 2.44434 13.5556V10.4445M4.88878 5.55557L7.99989 2.44446L11.111 5.55557M7.99989 2.44446L7.99989 9.11112" stroke="currentColor"/>`},"outline-eye":{viewBox:`0 0 20 20`,body:`<path d="M2.5 10s3.33-5.42 7.5-5.42S17.5 10 17.5 10s-3.33 5.42-7.5 5.42S2.5 10 2.5 10Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/>`},"outline-eye-slash":{viewBox:`0 0 20 20`,body:`<path d="M2.5 10s3.33-5.42 7.5-5.42S17.5 10 17.5 10s-3.33 5.42-7.5 5.42S2.5 10 2.5 10Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><circle cx="10" cy="10" r="2.5" stroke="currentColor"/><path d="M3 3 17 17" stroke="currentColor" stroke-linecap="round"/>`},refresh:{viewBox:`0 0 20 20`,body:`<path d="M16.25 7.5A6.5 6.5 0 1 0 16.5 11M16.25 3.5v4h-4" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>`},reset:{viewBox:`0 0 20 20`,body:`<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`},"outline-reset":{viewBox:`0 0 20 20`,body:`<path d="M5.83333 4.16406L2.5 7.4974L5.83333 10.8307M3.33333 7.4974H17.9167V15.4141H10" stroke="currentColor" stroke-linecap="square"/>`},"fill-triangle-down":{viewBox:`0 0 16 16`,body:`<path d="M5.37624 6.75194C5.18184 6.41861 5.42224 6 5.80814 6H10.1921C10.578 6 10.8184 6.41861 10.624 6.75194L8.43203 10.5096C8.23909 10.8404 7.76119 10.8404 7.56825 10.5096L5.37624 6.75194Z" fill="currentColor"/>`},archive:{viewBox:`0 0 16 16`,body:`<path d="M13.1112 13.5555V14.0555H13.6112V13.5555H13.1112ZM2.889 13.5555H2.389L2.389 14.0555H2.889V13.5555ZM3.38901 5.55546L3.38901 5.05546L2.38901 5.05546L2.38901 5.55546L2.88901 5.55546L3.38901 5.55546ZM14.4446 2.44434H14.9446V1.94434L14.4446 1.94434L14.4446 2.44434ZM14.4446 5.55545L14.4446 6.05545L14.9446 6.05545V5.55545H14.4446ZM1.55566 5.55546L1.05566 5.55545L1.05566 6.05546L1.55566 6.05546L1.55566 5.55546ZM1.5557 2.44436L1.5557 1.94436L1.05571 1.94436L1.0557 2.44435L1.5557 2.44436ZM13.1112 5.55546H12.6112V13.5555H13.1112H13.6112V5.55546H13.1112ZM2.889 13.5555H3.389L3.38901 5.55546L2.88901 5.55546L2.38901 5.55546L2.389 13.5555H2.889ZM14.4446 2.44434H13.9446V5.55545H14.4446H14.9446V2.44434H14.4446ZM1.55566 5.55546L2.05566 5.55547L2.0557 2.44436L1.5557 2.44436L1.0557 2.44435L1.05566 5.55545L1.55566 5.55546ZM6.22234 8.22213V8.72213H9.7779V8.22213V7.72213H6.22234V8.22213ZM13.1112 13.5555V13.0555H2.889V13.5555V14.0555H13.1112V13.5555ZM1.5557 2.44436L1.5557 2.94436L14.4446 2.94434L14.4446 2.44434L14.4446 1.94434L1.5557 1.94436L1.5557 2.44436ZM14.4446 5.55545L14.4446 5.05545L1.55566 5.05546L1.55566 5.55546L1.55566 6.05546L14.4446 6.05545L14.4446 5.55545Z" fill="currentColor"/>`}},ko=`opencode-v2-icon-sprite`,Ao=e=>`opencode-v2-icon-${e}`,jo=!1;function Mo(e){return Oo[e]||{body:To[e],viewBox:Eo(e)}}function No(){return Array.from(new Set([...Object.keys(To),...Object.keys(Oo)])).map(e=>`<symbol id="${Ao(e)}" viewBox="${Mo(e).viewBox}">${Mo(e).body}</symbol>`).join(``)}function Po(){if(jo||typeof document>`u`)return;let e=document.getElementById(ko);if(e){e.innerHTML=No(),jo=!0;return}let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);t.id=ko,t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`width`,`0`),t.setAttribute(`height`,`0`),t.style.position=`absolute`,t.style.overflow=`hidden`,t.innerHTML=No(),document.body.insertBefore(t,document.body.firstChild),jo=!0}function Fo(e){let[t,n]=B(e,[`name`,`size`]),r=()=>Oo[t.name]||To[t.name]?t.name:`plus`,i=()=>Mo(r()),a=t.size===`small`?14:t.size===`large`?20:16;return se(Po),(()=>{var e=Do(),t=e.firstChild;return gt(e,z(n,{"data-slot":`icon-svg`,get"data-directional"(){return r()===`arrow-left`||r()===`arrow-right`||r()===`chevron-left`||r()===`chevron-right`?``:void 0},width:a,height:a,get viewBox(){return i().viewBox},fill:`none`,xmlns:`http://www.w3.org/2000/svg`,get"aria-hidden"(){return n[`aria-hidden`]??`true`}}),!0,!0),j(()=>G(t,`href`,`#${Ao(r())}`)),e})()}function Io(e){let[t,n]=B(e,[`variant`,`size`,`icon`,`class`,`classList`]);return R(Va,z(n,{"data-component":`button-v2`,get"data-size"(){return t.size||`normal`},get"data-variant"(){return t.variant||`neutral`},get"data-icon"(){return t.icon},get classList(){return{...t.classList,[t.class??``]:!!t.class}},get children(){return[R(H,{get when(){return t.icon},children:e=>R(Fo,{get name(){return e()}})}),U(()=>e.children)]}}))}var Lo=W(`<span>`);function Ro(e){let[t,n]=B(e,[`class`,`classList`,`children`,`appearance`,`variant`]);return(()=>{var e=Lo();return gt(e,z(n,{"data-component":`tag`,get"data-appearance"(){return t.appearance??`compact`},get"data-variant"(){return t.variant??`neutral`},get classList(){return{...t.classList,[t.class??``]:!!t.class}}}),!1,!0),K(e,()=>t.children),e})()}function zo(e){let[t,n]=B(e,[`variant`,`size`,`icon`,`class`,`classList`,`state`]);return R(Va,z(n,{"data-component":`icon-button-v2`,get"data-size"(){return t.size||`normal`},get"data-variant"(){return t.variant||`neutral`},get"data-state"(){return t.state},get classList(){return{...t.classList,[t.class??``]:!!t.class}},get children(){return t.icon}}))}var Bo=new Set([`Avst`,`Arab`,`Armi`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),Vo=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]);function Ho(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize().script??``;return Bo.has(t)}let t=e.split(`-`)[0];return Vo.has(t)}function Uo(e){return Ho(e)?`rtl`:`ltr`}function Wo(){let e=typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=`en-US`}return{locale:e,direction:Uo(e)}}var Go=Wo(),Ko=new Set;function qo(){Go=Wo();for(let e of Ko)e(Go)}function Jo(){let[e,t]=A(Go),n=N(()=>e());return se(()=>{Ko.size===0&&window.addEventListener(`languagechange`,qo),Ko.add(t),P(()=>{Ko.delete(t),Ko.size===0&&window.removeEventListener(`languagechange`,qo)})}),{locale:()=>n().locale,direction:()=>n().direction}}var Yo=I();function Xo(){let e=Jo();return L(Yo)||e}var Zo=new Map;function Qo(e){let{locale:t}=Xo(),n=N(()=>t()+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():``));return N(()=>{let r=n(),i;return Zo.has(r)&&(i=Zo.get(r)),i||(i=new Intl.Collator(t(),e),Zo.set(r,i)),i})}var $o=[`top`,`right`,`bottom`,`left`],es=Math.min,ts=Math.max,ns=Math.round,rs=Math.floor,is=e=>({x:e,y:e}),as={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function os(e,t,n){return ts(e,es(t,n))}function ss(e,t){return typeof e==`function`?e(t):e}function cs(e){return e.split(`-`)[0]}function ls(e){return e.split(`-`)[1]}function us(e){return e===`x`?`y`:`x`}function ds(e){return e===`y`?`height`:`width`}function fs(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ps(e){return us(fs(e))}function ms(e,t,n){n===void 0&&(n=!1);let r=ls(e),i=ps(e),a=ds(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Cs(o)),[o,Cs(o)]}function hs(e){let t=Cs(e);return[gs(e),t,gs(t)]}function gs(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var _s=[`left`,`right`],vs=[`right`,`left`],ys=[`top`,`bottom`],bs=[`bottom`,`top`];function xs(e,t,n){switch(e){case`top`:case`bottom`:return n?t?vs:_s:t?_s:vs;case`left`:case`right`:return t?ys:bs;default:return[]}}function Ss(e,t,n,r){let i=ls(e),a=xs(cs(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(gs)))),a}function Cs(e){let t=cs(e);return as[t]+e.slice(t.length)}function ws(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Ts(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ws(e)}function Es(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ds(e,t,n){let{reference:r,floating:i}=e,a=fs(t),o=ps(t),s=ds(o),c=cs(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ls(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Os(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ss(t,e),p=Ts(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Es(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Es(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ks=50,As=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Os},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ds(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ks&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ds(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},js=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ss(e,t)||{};if(l==null)return{};let d=Ts(u),f={x:n,y:r},p=ps(i),m=ds(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=es(d[_],T),D=es(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=os(E,k,O),A=!c.arrow&&ls(i)!=null&&k!==ee&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,te=A?k<E?k-E:k-O:0;return{[p]:f[p]+te,data:{[p]:ee,centerOffset:k-ee-te,...A&&{alignmentOffset:te}},reset:A}}}),Ms=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ss(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=cs(r),_=fs(o),v=cs(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Cs(o)]:hs(o)),x=p!==`none`;!d&&x&&b.push(...Ss(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ms(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===fs(t)||T.every(e=>fs(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=fs(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ns(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ps(e){return $o.some(t=>e[t]>=0)}var Fs=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ss(e,t);switch(i){case`referenceHidden`:{let e=Ns(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ps(e)}}}case`escaped`:{let e=Ns(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ps(e)}}}default:return{}}}}},Is=new Set([`left`,`top`]);async function Ls(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=cs(n),s=ls(n),c=fs(n)===`y`,l=Is.has(o)?-1:1,u=a&&c?-1:1,d=ss(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Rs=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ls(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},zs=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ss(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=fs(i),p=us(f),m=u[p],h=u[f],g=(e,t)=>os(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Bs=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ss(e,t),c=await i.detectOverflow(t,s),l=cs(n),u=ls(n),d=fs(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=es(p-c[m],g),y=es(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*ts(c.left,c.right):S=p-2*ts(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Vs(){return typeof window<`u`}function Hs(e){return Gs(e)?(e.nodeName||``).toLowerCase():`#document`}function Us(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ws(e){return((Gs(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Gs(e){return Vs()?e instanceof Node||e instanceof Us(e).Node:!1}function Ks(e){return Vs()?e instanceof Element||e instanceof Us(e).Element:!1}function qs(e){return Vs()?e instanceof HTMLElement||e instanceof Us(e).HTMLElement:!1}function Js(e){return!Vs()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Us(e).ShadowRoot}function Ys(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=oc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Xs(e){return/^(table|td|th)$/.test(Hs(e))}function Zs(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Qs=/transform|translate|scale|rotate|perspective|filter/,$s=/paint|layout|strict|content/,ec=e=>!!e&&e!==`none`,tc;function nc(e){let t=Ks(e)?oc(e):e;return ec(t.transform)||ec(t.translate)||ec(t.scale)||ec(t.rotate)||ec(t.perspective)||!ic()&&(ec(t.backdropFilter)||ec(t.filter))||Qs.test(t.willChange||``)||$s.test(t.contain||``)}function rc(e){let t=cc(e);for(;qs(t)&&!ac(t);){if(nc(t))return t;if(Zs(t))return null;t=cc(t)}return null}function ic(){return tc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),tc}function ac(e){return/^(html|body|#document)$/.test(Hs(e))}function oc(e){return Us(e).getComputedStyle(e)}function sc(e){return Ks(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cc(e){if(Hs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Js(e)&&e.host||Ws(e);return Js(t)?t.host:t}function lc(e){let t=cc(e);return ac(t)?(e.ownerDocument||e).body:qs(t)&&Ys(t)?t:lc(t)}function uc(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=lc(e),i=r===e.ownerDocument?.body,a=Us(r);if(i){let e=dc(a);return t.concat(a,a.visualViewport||[],Ys(r)?r:[],e&&n?uc(e):[])}return t.concat(r,uc(r,[],n))}function dc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fc(e){let t=oc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=qs(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ns(n)!==a||ns(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function pc(e){return Ks(e)?e:e.contextElement}function mc(e){let t=pc(e);if(!qs(t))return is(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=fc(t),o=(a?ns(n.width):n.width)/r,s=(a?ns(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var hc=is(0);function gc(e){let t=Us(e);return!ic()||!t.visualViewport?hc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _c(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Us(e)}function vc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=pc(e),o=is(1);t&&(r?Ks(r)&&(o=mc(r)):o=mc(e));let s=_c(a,n,r)?gc(a):is(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Us(a),t=Ks(r)?Us(r):r,n=e,i=dc(n);for(;i&&t!==n;){let e=mc(i),t=i.getBoundingClientRect(),r=oc(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Us(i),i=dc(n)}}return Es({width:u,height:d,x:c,y:l})}function yc(e,t){let n=sc(e).scrollLeft;return t?t.left+n:vc(Ws(e)).left+n}function bc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-yc(e,n),y:n.top+t.scrollTop}}function xc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ws(r),s=t?Zs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=is(1),u=is(0),d=qs(r);if((d||!a)&&((Hs(r)!==`body`||Ys(o))&&(c=sc(r)),d)){let e=vc(r);l=mc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?bc(o,c):is(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Sc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Cc(e){let t=sc(e),n=e.ownerDocument.body,r=ts(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ts(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+yc(e),o=-t.scrollTop;return oc(n).direction===`rtl`&&(a+=ts(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var wc=25;function Tc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Us(e),a=Ws(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ic()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(yc(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=wc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ec(e,t){let n=vc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=mc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Dc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Tc(e,n,t);else if(t===`document`)r=Cc(Ws(e));else if(Ks(t))r=Ec(t,n);else{let n=gc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Es(r)}function Oc(e,t){let n=t.get(e);if(n)return n;let r=uc(e,[],!1).filter(e=>Ks(e)&&Hs(e)!==`body`),i=null,a=oc(e).position===`fixed`,o=a?cc(e):e;for(;Ks(o)&&!ac(o);){let e=oc(o),t=nc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=cc(o)}return t.set(e,r),r}function kc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Zs(t)?[]:Oc(t,this._c):[].concat(n),r],o=Dc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Dc(t,a[e],i);s=ts(n.top,s),c=es(n.right,c),l=es(n.bottom,l),u=ts(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ac(e){let{width:t,height:n}=fc(e);return{width:t,height:n}}function jc(e,t,n){let r=qs(t),i=Ws(t),a=n===`fixed`,o=vc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=is(0);if((r||!a)&&((Hs(t)!==`body`||Ys(i))&&(s=sc(t)),r)){let e=vc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=yc(i));let l=i&&!r&&!a?bc(i,s):is(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Mc(e){return oc(e).position===`static`}function Nc(e,t){if(!qs(e)||oc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ws(e)===n&&(n=n.ownerDocument.body),n}function Pc(e,t){let n=Us(e);if(Zs(e))return n;if(!qs(e)){let t=cc(e);for(;t&&!ac(t);){if(Ks(t)&&!Mc(t))return t;t=cc(t)}return n}let r=Nc(e,t);for(;r&&Xs(r)&&Mc(r);)r=Nc(r,t);return r&&ac(r)&&Mc(r)&&!nc(r)?n:r||rc(e)||n}var Fc=async function(e){let t=this.getOffsetParent||Pc,n=this.getDimensions,r=await n(e.floating);return{reference:jc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ic(e){return oc(e).direction===`rtl`}var Lc={convertOffsetParentRelativeRectToViewportRelativeRect:xc,getDocumentElement:Ws,getClippingRect:kc,getOffsetParent:Pc,getElementRects:Fc,getClientRects:Sc,getDimensions:Ac,getScale:mc,isElement:Ks,isRTL:Ic};function Rc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zc(e,t,n){let r=null,i,a=Ws(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=rs(d),h=rs(a.clientWidth-(u+f)),g=rs(a.clientHeight-(d+p)),_=rs(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ts(0,es(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Rc(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Us(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Bc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=pc(e),u=i||a?[...l?uc(l):[],...t?uc(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?zc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?vc(e):null;c&&g();function g(){let t=vc(e);h&&!Rc(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Vc=Rs,Hc=zs,Uc=Ms,Wc=Bs,Gc=Fs,Kc=js,qc=(e,t,n)=>{let r=new Map,i=n??{},a={...Lc,...i.platform,_c:r};return As(e,t,{...i,platform:a})},Jc=W(`<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>`),Yc=I();function Xc(){let e=L(Yc);if(e===void 0)throw Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var Zc=30,Qc=Zc/2,$c={top:180,right:-90,bottom:0,left:90};function el(e){let t=Xc(),[n,r]=B(Z({size:Zc},e),[`ref`,`style`,`size`]),i=()=>t.currentPlacement().split(`-`)[0],a=tl(t.contentRef),o=()=>a()?.getPropertyValue(`background-color`)||`none`,s=()=>a()?.getPropertyValue(`border-${i()}-color`)||`none`,c=()=>a()?.getPropertyValue(`border-${i()}-width`)||`0px`,l=()=>Number.parseInt(c())*2*(Zc/n.size),u=()=>`rotate(${$c[i()]} ${Qc} ${Qc}) translate(0 2)`;return R(Da,z({as:`div`,ref(e){var r=Xr(t.setArrowRef,n.ref);typeof r==`function`&&r(e)},"aria-hidden":`true`,get style(){return Yr({position:`absolute`,"font-size":`${n.size}px`,width:`1em`,height:`1em`,"pointer-events":`none`,fill:o(),stroke:s(),"stroke-width":l()},n.style)}},r,{get children(){var e=Jc(),t=e.firstChild;return t.firstChild.nextSibling,j(()=>G(t,`transform`,u())),e}}))}function tl(e){let[t,n]=A();return M(()=>{let t=e();t&&n(ai(t).getComputedStyle(t))}),t}function nl(e){let t=Xc(),[n,r]=B(e,[`ref`,`style`]);return R(Da,z({as:`div`,ref(e){var r=Xr(t.setPositionerRef,n.ref);typeof r==`function`&&r(e)},"data-popper-positioner":``,get style(){return Yr({position:`absolute`,top:0,left:0,"min-width":`max-content`},n.style)}},r))}function rl(e){let{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect==`function`)return new DOMRect(t,n,r,i);let a={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...a,toJSON:()=>a}}function il(e,t){return{contextElement:e,getBoundingClientRect:()=>{let n=t(e);return n?rl(n):e?e.getBoundingClientRect():rl()}}}function al(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var ol={top:`bottom`,right:`left`,bottom:`top`,left:`right`};function sl(e,t){let[n,r]=e.split(`-`),i=ol[n];return r?n===`left`||n===`right`?`${i} ${r===`start`?`top`:`bottom`}`:r===`start`?`${i} ${t===`rtl`?`right`:`left`}`:`${i} ${t===`rtl`?`left`:`right`}`:`${i} center`}function cl(e){let t=Z({getAnchorRect:e=>e?.getBoundingClientRect(),placement:`bottom`,gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=A(),[i,a]=A(),[o,s]=A(t.placement),c=()=>il(t.anchorRef?.(),t.getAnchorRect),{direction:l}=Xo();async function u(){let e=c(),r=n(),a=i();if(!e||!r)return;let o=(a?.clientHeight||0)/2,u=typeof t.gutter==`number`?t.gutter+o:t.gutter??o;r.style.setProperty(`--kb-popper-content-overflow-padding`,`${t.overflowPadding}px`),e.getBoundingClientRect();let d=[Vc(({placement:e})=>{let n=!!e.split(`-`)[1];return{mainAxis:u,crossAxis:n?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){let e=typeof t.flip==`string`?t.flip.split(` `):void 0;if(e!==void 0&&!e.every(al))throw Error("`flip` expects a spaced-delimited list of placements");d.push(Uc({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(Hc({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(Wc({padding:t.overflowPadding,apply({availableWidth:e,availableHeight:n,rects:i}){let a=Math.round(i.reference.width);e=Math.floor(e),n=Math.floor(n),r.style.setProperty(`--kb-popper-anchor-width`,`${a}px`),r.style.setProperty(`--kb-popper-content-available-width`,`${e}px`),r.style.setProperty(`--kb-popper-content-available-height`,`${n}px`),t.sameWidth&&(r.style.width=`${a}px`),t.fitViewport&&(r.style.maxWidth=`${e}px`,r.style.maxHeight=`${n}px`)}})),t.hideWhenDetached&&d.push(Gc({padding:t.detachedPadding})),a&&d.push(Kc({element:a,padding:t.arrowPadding}));let f=await qc(e,r,{placement:t.placement,strategy:`absolute`,middleware:d,platform:{...Lc,isRTL:()=>l()===`rtl`}});if(s(f.placement),t.onCurrentPlacementChange?.(f.placement),!r)return;r.style.setProperty(`--kb-popper-content-transform-origin`,sl(f.placement,l()));let p=Math.round(f.x),m=Math.round(f.y),h;if(t.hideWhenDetached&&(h=f.middlewareData.hide?.referenceHidden?`hidden`:`visible`),Object.assign(r.style,{top:`0`,left:`0`,transform:`translate3d(${p}px, ${m}px, 0)`,visibility:h}),a&&f.middlewareData.arrow){let{x:e,y:t}=f.middlewareData.arrow,n=f.placement.split(`-`)[0];Object.assign(a.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,[n]:`100%`})}}M(()=>{let e=c(),t=n();e&&t&&P(Bc(e,t,u,{elementResize:typeof ResizeObserver==`function`}))}),M(()=>{let e=n(),r=t.contentRef?.();e&&r&&queueMicrotask(()=>{e.style.zIndex=getComputedStyle(r).zIndex})});let d={currentPlacement:o,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:a};return R(Yc.Provider,{value:d,get children(){return t.children}})}var ll=Object.assign(cl,{Arrow:el,Context:Yc,usePopperContext:Xc,Positioner:nl});Ra({},{Arrow:()=>el,Content:()=>fl,Portal:()=>pl,Root:()=>xl,Tooltip:()=>Cl,Trigger:()=>Sl,useTooltipContext:()=>dl});var ul=I();function dl(){let e=L(ul);if(e===void 0)throw Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function fl(e){let t=dl(),[n,r]=B(Z({id:t.generateId(`content`)},e),[`ref`,`style`]);return M(()=>P(t.registerContentId(r.id))),R(H,{get when(){return t.contentPresent()},get children(){return R(ll.Positioner,{get children(){return R(Aa,z({ref(e){var r=Xr(e=>{t.setContentRef(e)},n.ref);typeof r==`function`&&r(e)},role:`tooltip`,disableOutsidePointerEvents:!1,get style(){return Yr({"--kb-tooltip-content-transform-origin":`var(--kb-popper-content-transform-origin)`,position:`relative`},n.style)},onFocusOutside:e=>e.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),r))}})}})}function pl(e){let t=dl();return R(H,{get when(){return t.contentPresent()},get children(){return R(Mt,e)}})}function ml(e,t,n){let r=e.split(`-`)[0],i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=[],s=i.left+i.width/2,c=i.top+i.height/2;switch(r){case`top`:o.push([i.left,c]),o.push([a.left,a.bottom]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([i.right,c]);break;case`right`:o.push([s,i.top]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([a.left,a.bottom]),o.push([s,i.bottom]);break;case`bottom`:o.push([i.left,c]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([a.right,a.top]),o.push([i.right,c]);break;case`left`:o.push([s,i.top]),o.push([a.right,a.top]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([s,i.bottom])}return o}var hl={},gl=0,_l=!1,vl,yl,bl;function xl(e){let t=`tooltip-${We()}`,n=`${++gl}`,r=Z({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[i,a]=B(r,[`id`,`open`,`defaultOpen`,`onOpenChange`,`disabled`,`triggerOnFocusOnly`,`openDelay`,`closeDelay`,`skipDelayDuration`,`ignoreSafeArea`,`forceMount`,`onCurrentPlacementChange`]),o,[s,c]=A(),[l,u]=A(),[d,f]=A(),[p,m]=A(a.placement),h=Pa({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:e=>i.onOpenChange?.(e)}),{present:g}=ao({show:()=>i.forceMount||h.isOpen(),element:()=>d()??null}),_=()=>{hl[n]=y},v=()=>{for(let e in hl)e!==n&&(hl[e](!0),delete hl[e])},y=(e=!1)=>{e||i.closeDelay&&i.closeDelay<=0?(window.clearTimeout(o),o=void 0,h.close()):o||=window.setTimeout(()=>{o=void 0,h.close()},i.closeDelay),window.clearTimeout(vl),vl=void 0,i.skipDelayDuration&&i.skipDelayDuration>=0&&(bl=window.setTimeout(()=>{window.clearTimeout(bl),bl=void 0},i.skipDelayDuration)),_l&&(window.clearTimeout(yl),yl=window.setTimeout(()=>{delete hl[n],yl=void 0,_l=!1},i.closeDelay))},b=()=>{clearTimeout(o),o=void 0,v(),_(),_l=!0,h.open(),window.clearTimeout(vl),vl=void 0,window.clearTimeout(yl),yl=void 0,window.clearTimeout(bl),bl=void 0},x=()=>{v(),_(),!h.isOpen()&&!vl&&!_l?vl=window.setTimeout(()=>{vl=void 0,_l=!0,b()},i.openDelay):h.isOpen()||b()},S=(e=!1)=>{!e&&i.openDelay&&i.openDelay>0&&!o&&!bl?x():b()},C=()=>{window.clearTimeout(vl),vl=void 0,_l=!1},w=()=>{window.clearTimeout(o),o=void 0},T=e=>ri(l(),e)||ri(d(),e),E=e=>{let t=l(),n=d();if(t&&n)return ml(e,t,n)},D=e=>{let t=e.target;if(T(t)){w();return}if(!i.ignoreSafeArea){let t=E(p());if(t&&Hi(Vi(e),t)){w();return}}o||y()};M(()=>{if(!h.isOpen())return;let e=oi();e.addEventListener(`pointermove`,D,!0),P(()=>{e.removeEventListener(`pointermove`,D,!0)})}),M(()=>{let e=l();if(!e||!h.isOpen())return;let t=t=>{let n=t.target;ri(n,e)&&y(!0)},n=ai();n.addEventListener(`scroll`,t,{capture:!0}),P(()=>{n.removeEventListener(`scroll`,t,{capture:!0})})}),P(()=>{clearTimeout(o),hl[n]&&delete hl[n]});let O={dataset:N(()=>({"data-expanded":h.isOpen()?``:void 0,"data-closed":h.isOpen()?void 0:``})),isOpen:h.isOpen,isDisabled:()=>i.disabled??!1,triggerOnFocusOnly:()=>i.triggerOnFocusOnly??!1,contentId:s,contentPresent:g,openTooltip:S,hideTooltip:y,cancelOpening:C,generateId:ni(()=>r.id),registerContentId:Ua(c),isTargetOnTooltip:T,setTriggerRef:u,setContentRef:f};return R(ul.Provider,{value:O,get children(){return R(ll,z({anchorRef:l,contentRef:d,onCurrentPlacementChange:e=>{m(e),i.onCurrentPlacementChange?.(e)}},a))}})}function Sl(e){let t,n=dl(),[r,i]=B(e,[`ref`,`onPointerEnter`,`onPointerLeave`,`onPointerDown`,`onClick`,`onFocus`,`onBlur`]),a=!1,o=!1,s=!1,c=()=>{a=!1},l=()=>{!n.isOpen()&&(o||s)&&n.openTooltip(s)},u=e=>{n.isOpen()&&!o&&!s&&n.hideTooltip(e)};return P(()=>{oi(t).removeEventListener(`pointerup`,c)}),R(Da,z({as:`button`,ref(e){var i=Xr(e=>{n.setTriggerRef(e),t=e},r.ref);typeof i==`function`&&i(e)},get"aria-describedby"(){return U(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:e=>{X(e,r.onPointerEnter),!(e.pointerType===`touch`||n.triggerOnFocusOnly()||n.isDisabled()||e.defaultPrevented)&&(o=!0,l())},onPointerLeave:e=>{X(e,r.onPointerLeave),e.pointerType!==`touch`&&(o=!1,s=!1,n.isOpen()?u():n.cancelOpening())},onPointerDown:e=>{X(e,r.onPointerDown),a=!0,oi(t).addEventListener(`pointerup`,c,{once:!0})},onClick:e=>{X(e,r.onClick),o=!1,s=!1,u(!0)},onFocus:e=>{X(e,r.onFocus),!(n.isDisabled()||e.defaultPrevented||a)&&(s=!0,l())},onBlur:e=>{X(e,r.onBlur);let t=e.relatedTarget;n.isTargetOnTooltip(t)||(o=!1,s=!1,u(!0))},type:`button`},()=>n.dataset(),i))}var Cl=Object.assign(xl,{Arrow:el,Content:fl,Portal:pl,Trigger:Sl});function wl(e){let t,[n,r]=$t({open:!1,block:!1,expand:!1}),[i,a]=B(e,[`children`,`appearance`,`class`,`contentClass`,`contentStyle`,`inactive`,`forceOpen`,`triggerTabIndex`,`ignoreSafeArea`,`value`]),o=()=>r(`open`,!1),s=()=>i.forceOpen!==void 0,c=()=>{let e=document.activeElement;return!t||!e?!1:t.contains(e)},l=(e=n.expand)=>{!e&&n.block&&(t?.matches(`:hover`)||c()||r(`block`,!1))},u=()=>{let e=!!t?.querySelector(`[aria-expanded="true"], [data-expanded]`);if(r(`expand`,e),e){r(`block`,!0),o();return}l(e)},d=()=>{r(`block`,!0),o()},f=()=>{c()||o(),l()};M(()=>{if(!t)return;ae(u);let e=new MutationObserver(u);e.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`aria-expanded`,`data-expanded`]}),P(()=>e.disconnect())});let p=!1;return R(qe,{get children(){return[R(Je,{get when(){return i.inactive},get children(){return i.children}}),R(Je,{when:!0,get children(){return R(xl,z({gutter:4,openDelay:400,skipDelayDuration:300},a,{closeDelay:0,get ignoreSafeArea(){return i.ignoreSafeArea??!0},get open(){return U(()=>!!s())()?i.forceOpen:n.open},onOpenChange:e=>{if(!s()&&!(n.block&&e)){if(p){p=!1;return}r(`open`,e)}},get children(){return[R(Sl,{ref(e){var n=t;typeof n==`function`?n(e):t=e},as:`div`,get tabIndex(){return i.triggerTabIndex},"data-component":`tooltip-v2-trigger`,get class(){return i.class},onPointerDownCapture:d,onKeyDownCapture:e=>{(e.key===`Enter`||e.key===` `)&&d()},onPointerLeave:f,onFocusOut:()=>requestAnimationFrame(()=>l()),get children(){return i.children}}),R(pl,{get children(){return R(fl,{ref:e=>{let n=t?.closest(`[data-theme]`)?.getAttribute(`data-theme`);n&&e.setAttribute(`data-theme`,n)},"data-component":`tooltip-v2`,get"data-appearance"(){return i.appearance??`compact`},get"data-placement"(){return e.placement},get"data-force-open"(){return i.forceOpen},get class(){return i.contentClass},get style(){return i.contentStyle},onPointerDownOutside:e=>{(t===e.target||e.target instanceof Node&&t?.contains(e.target))&&(p=!0),e.preventDefault()},get children(){return i.value}})}})]}}))}})]}})}var Tl={"ui.sessionReview.title":`Session changes`,"ui.sessionReview.title.git":`Git changes`,"ui.sessionReview.title.branch":`Branch changes`,"ui.sessionReview.title.lastTurn":`Last turn changes`,"ui.sessionReview.diffStyle.unified":`Unified`,"ui.sessionReview.diffStyle.split":`Split`,"ui.sessionReview.expandAll":`Expand all`,"ui.sessionReview.collapseAll":`Collapse all`,"ui.sessionReview.change.added":`Added`,"ui.sessionReview.change.removed":`Removed`,"ui.sessionReview.change.modified":`Modified`,"ui.sessionReview.image.loading":`Loading…`,"ui.sessionReview.image.placeholder":`Image`,"ui.sessionReview.largeDiff.title":`Diff too large to render`,"ui.sessionReview.largeDiff.meta":`Limit: {{limit}} changed lines. Current: {{current}} changed lines.`,"ui.sessionReview.largeDiff.renderAnyway":`Render anyway`,"ui.sessionReviewV2.expandMode":`Expand or collapse diff`,"ui.sessionReviewV2.filterFiles":`Filter files`,"ui.sessionReviewV2.toggleSidebar":`Toggle file tree`,"ui.sessionReviewV2.showAllLines":`Show all lines`,"ui.sessionReviewV2.hideNonDiffLines":`Hide non-diff lines`,"ui.sessionReviewV2.unifiedDiff":`Unified diff`,"ui.sessionReviewV2.splitDiff":`Split diff`,"ui.sessionReviewV2.previousFile":`Previous file`,"ui.sessionReviewV2.nextFile":`Next file`,"ui.sessionReviewV2.diffView":`Diff view`,"ui.sessionReviewV2.empty.noGit.title":`No tracked changes`,"ui.sessionReviewV2.empty.noGit.description":`Track, review, and undo changes in this project`,"ui.sessionReviewV2.empty.noGit.action":`Create Git repository`,"ui.sessionReviewV2.empty.noGit.actionLoading":`Creating Git repository…`,"ui.sessionReviewV2.empty.changes.title":`No file changes yet`,"ui.sessionReviewV2.empty.changes.description":`Project changes will appear here`,"ui.sessionReview.openFile":`Open file`,"ui.sessionReview.selection.line":`line {{line}}`,"ui.sessionReview.selection.lines":`lines {{start}}-{{end}}`,"ui.fileMedia.kind.image":`image`,"ui.fileMedia.kind.audio":`audio`,"ui.fileMedia.state.removed":`Removed {{kind}} file.`,"ui.fileMedia.state.loading":`Loading {{kind}}…`,"ui.fileMedia.state.error":`Unable to load {{kind}}.`,"ui.fileMedia.state.unavailable":`{{kind}} preview unavailable.`,"ui.fileMedia.binary.title":`Binary file`,"ui.fileMedia.binary.description.path":`{{path}} is binary.`,"ui.fileMedia.binary.description.default":`Binary content`,"ui.lineComment.label.prefix":`Comment on `,"ui.lineComment.label.suffix":``,"ui.lineComment.editorLabel.prefix":`Commenting on `,"ui.lineComment.editorLabel.suffix":``,"ui.lineComment.placeholder":`Add comment`,"ui.lineComment.contextPlaceholder":`Add context for this change`,"ui.lineComment.submit":`Comment`,"ui.lineComment.cancel":`Cancel`,"ui.sessionTurn.steps.show":`Show steps`,"ui.sessionTurn.steps.hide":`Hide steps`,"ui.sessionTurn.summary.response":`Response`,"ui.sessionTurn.diff.showMore":`Show more changes ({{count}})`,"ui.sessionTurn.diffs.changed.one":`{{count}} Changed file`,"ui.sessionTurn.diffs.changed.other":`{{count}} Changed files`,"ui.sessionTurn.diffs.showAll":`Show all`,"ui.sessionTurn.diffs.showLess":`Show less`,"ui.sessionTurn.diffs.more":`+{{count}} more files`,"ui.sessionTurn.retry.retrying":`retrying`,"ui.sessionTurn.retry.inSeconds":`in {{seconds}}s`,"ui.sessionTurn.retry.attempt":`attempt #{{attempt}}`,"ui.sessionTurn.retry.attemptLine":`{{line}} - attempt #{{attempt}}`,"ui.sessionTurn.retry.attemptLabel":`Attempt {{attempt}}`,"ui.sessionTurn.retry.attemptRetrying":`Attempt {{attempt}} - {{line}}`,"ui.sessionTurn.retry.geminiHot":`gemini is way too hot right now`,"ui.sessionTurn.error.freeUsageExceeded":`Free usage exceeded`,"ui.sessionTurn.error.addCredits":`Add credits`,"dialog.usageExceeded.freeTier.title":`Free limit reached`,"dialog.usageExceeded.freeTier.description":`Subscribe to OpenCode Go for reliable access to the best open-source models, starting at $5/month.`,"dialog.usageExceeded.freeTier.actionLabel":`Subscribe`,"dialog.usageExceeded.accountRateLimit.title":`Go limit reached`,"dialog.usageExceeded.accountRateLimit.description":`Usage limit reached. To continue using this model now, enable usage from your available balance`,"dialog.usageExceeded.accountRateLimit.actionLabel":`Open settings`,"ui.sessionTurn.status.delegating":`Delegating work`,"ui.sessionTurn.status.planning":`Planning next steps`,"ui.sessionTurn.status.gatheringContext":`Exploring`,"ui.sessionTurn.status.gatheredContext":`Explored`,"ui.sessionTurn.status.searchingCodebase":`Searching the codebase`,"ui.sessionTurn.status.searchingWeb":`Searching the web`,"ui.sessionTurn.status.makingEdits":`Making edits`,"ui.sessionTurn.status.runningCommands":`Running commands`,"ui.sessionTurn.status.thinking":`Thinking`,"ui.sessionTurn.status.thinkingWithTopic":`Thinking - {{topic}}`,"ui.sessionTurn.status.gatheringThoughts":`Gathering thoughts`,"ui.sessionTurn.status.consideringNextSteps":`Considering next steps`,"ui.messagePart.diagnostic.error":`Error`,"ui.messagePart.title.edit":`Edit`,"ui.messagePart.title.write":`Write`,"ui.messagePart.option.typeOwnAnswer":`Type your own answer`,"ui.messagePart.review.title":`Review your answers`,"ui.messagePart.questions.dismissed":`Questions dismissed`,"ui.messagePart.compaction":`Session compacted`,"ui.messagePart.compaction.started":`Session compaction started`,"ui.messagePart.compaction.running":`Compacting`,"ui.messagePart.compaction.failed":`Session compaction failed`,"ui.messagePart.compaction.cancelled":`Session compaction cancelled`,"ui.messagePart.compaction.interrupted":`Session compaction interrupted`,"ui.messagePart.providerCompaction":`Session compacted by provider`,"ui.messagePart.compaction.usage":`{{input}} in · {{output}} out`,"ui.messagePart.context.details":`Details`,"ui.messagePart.context.read.one":`{{count}} read`,"ui.messagePart.context.read.other":`{{count}} reads`,"ui.messagePart.context.search.one":`{{count}} search`,"ui.messagePart.context.search.other":`{{count}} searches`,"ui.messagePart.context.list.one":`{{count}} list`,"ui.messagePart.context.list.other":`{{count}} lists`,"ui.messagePart.context.notice.one":`{{count}} Notice`,"ui.messagePart.context.notice.other":`{{count}} Notices`,"ui.messagePart.context.thought.one":`Thought`,"ui.messagePart.context.thought.other":`Thoughts`,"ui.messagePart.context.match.one":`({{count}} match)`,"ui.messagePart.context.match.other":`({{count}} matches)`,"ui.messagePart.tools.used.one":`Used {{count}} {{tools}}`,"ui.messagePart.tools.used.other":`Used {{count}} {{tools}}`,"ui.list.loading":`Loading`,"ui.list.empty":`No results`,"ui.list.clearFilter":`Clear filter`,"ui.list.emptyWithFilter.prefix":`No results for`,"ui.list.emptyWithFilter.suffix":``,"ui.fileSearch.placeholder":`Find`,"ui.fileSearch.previousMatch":`Previous match`,"ui.fileSearch.nextMatch":`Next match`,"ui.fileSearch.close":`Close search`,"ui.messageNav.newMessage":`New message`,"ui.promptInput.noMatchingItems":`No matching items`,"ui.promptInput.commands":`Commands`,"ui.promptInput.dropFiles":`Drop files to add`,"ui.promptInput.dropFiles.image":`Drop images or files to add`,"ui.promptInput.dropFiles.pdf":`Drop PDFs or files to add`,"ui.promptInput.dropFiles.imagePdf":`Drop images, PDFs, or files to add`,"ui.promptInput.removeAttachment":`Remove attachment`,"ui.promptInput.label":`Prompt`,"ui.promptInput.placeholder.shell":`Enter shell command…`,"ui.promptInput.placeholder.normal":`Ask anything, {{slash}} for commands, {{at}} for context…`,"ui.promptInput.placeholder.followUp":`Add follow-up, {{slash}} for commands, {{at}} for context…`,"ui.promptInput.add":`Add images and files`,"ui.promptInput.attachments":`Images and files`,"ui.promptInput.context":`Context`,"ui.promptInput.shell":`Shell command`,"ui.promptInput.chooseAgent":`Choose agent`,"ui.promptInput.chooseModel":`Choose model`,"ui.promptInput.chooseVariant":`Choose model variant`,"ui.promptInput.send":`Send`,"ui.promptInput.stop":`Stop`,"ui.promptInput.exitShell":`Exit`,"ui.promptInput.steer":`Steer`,"ui.promptInput.queue":`Queue`,"ui.promptInput.steerHint":`Send without interrupting`,"ui.tabs.close":`Close tab`,"ui.textField.copyToClipboard":`Copy to clipboard`,"ui.textField.copyLink":`Copy link`,"ui.textField.copied":`Copied`,"ui.imagePreview.alt":`Image preview`,"ui.scrollView.ariaLabel":`scrollable content`,"ui.tool.read":`Read`,"ui.tool.loaded":`Loaded`,"ui.tool.loadedFile":`Loaded {{path}}`,"ui.tool.loadedSkill":`Loaded {{name}} skill`,"ui.tool.loadedSkills.one":`Loaded {{name}} skill`,"ui.tool.loadedSkills.other":`Loaded {{name}} skills`,"ui.tool.list":`List`,"ui.tool.glob":`Glob`,"ui.tool.grep":`Grep`,"ui.tool.task":`Task`,"ui.tool.browser":`Browser`,"ui.tool.webfetch":`Webfetch`,"ui.tool.websearch":`Web Search`,"ui.tool.websearch.provider":`{{provider}} Web Search`,"ui.tool.shell":`Shell`,"ui.tool.shell.writingCommand":`Writing command…`,"ui.tool.shell.exit":`Command exited with code {{code}}`,"ui.tool.shell.timeout":`Command timed out`,"ui.tool.shell.cancelled":`Command cancelled`,"ui.tool.execute":`Execute`,"ui.tool.patch":`Patch`,"ui.tool.questions":`Questions`,"ui.tool.questions.numbered":`Questions {{number}}`,"ui.tool.agent":`{{type}} Agent`,"ui.tool.agent.default":`Agent`,"ui.tool.agent.delegating":`Delegating agent…`,"ui.tool.skill":`Skill`,"ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":`Failed`,"ui.toolErrorCard.copyError":`Copy error`,"ui.common.file.one":`file`,"ui.common.file.other":`files`,"ui.common.question.one":`question`,"ui.common.question.other":`questions`,"ui.common.add":`Add`,"ui.common.clear":`Clear`,"ui.common.file":`File`,"ui.common.back":`Back`,"ui.common.cancel":`Cancel`,"ui.common.confirm":`Confirm`,"ui.common.dismiss":`Dismiss`,"ui.common.close":`Close`,"ui.common.next":`Next`,"ui.common.submit":`Submit`,"ui.common.showMore":`Show more`,"ui.common.moreCount.one":`+{{count}} more`,"ui.common.moreCount.other":`+{{count}} more`,"ui.permission.deny":`Deny`,"ui.permission.allowAlways":`Allow always`,"ui.permission.allowOnce":`Allow once`,"ui.message.expand":`Expand message`,"ui.message.collapse":`Collapse message`,"ui.message.copy":`Copy`,"ui.message.copyMessage":`Copy message`,"ui.message.forkMessage":`Fork to new session`,"ui.message.revertMessage":`Revert message`,"ui.message.copyResponse":`Copy response`,"ui.message.copied":`Copied`,"ui.message.thought":`Thought`,"ui.message.duration.seconds":`{{count}}s`,"ui.message.duration.minutesSeconds":`{{minutes}}m {{seconds}}s`,"ui.message.interrupted":`Interrupted`,"ui.sessionTimeline.notice.model":`Model`,"ui.sessionTimeline.notice.modelSwitched":`Switched to {{model}}`,"ui.sessionTimeline.notice.agentChanged":`Agent changed`,"ui.sessionTimeline.notice.movedTo":`Moved to`,"ui.sessionTimeline.notice.movedTooltip":`Session working directory changed`,"ui.sessionTimeline.notice.failed":`{{actor}} failed`,"ui.sessionTimeline.notice.cancelled":`{{actor}} cancelled`,"ui.sessionTimeline.notice.finished":`{{actor}} finished`,"ui.sessionTimeline.notice.instructionsUpdated":`Instructions updated`,"ui.message.queued":`Queued`,"ui.message.attachment.alt":`attachment`,"ui.patch.action.deleted":`Deleted`,"ui.patch.action.created":`Created`,"ui.patch.action.moved":`Moved`,"ui.patch.action.patched":`Patched`,"ui.question.subtitle.answered":`{{count}} answered`,"ui.question.answer.none":`(no answer)`,"ui.question.review.notAnswered":`(not answered)`,"ui.question.multiHint":`Select all answers that apply`,"ui.question.singleHint":`Select one answer`,"ui.question.custom.placeholder":`Type your answer…`},El=new Map;function Dl(e,t){let n=El.get(e);if(n)return n.select(t);let r=new Intl.PluralRules(e);return El.size>=32&&El.delete(El.keys().next().value),El.set(e,r),r.select(t)}function Ol(e,t){return`${e}.${t}`}function kl(e,t){return t?e.replace(/{{\s*([^}]+?)\s*}}/g,(e,n)=>{let r=t[String(n)];return r===void 0?``:String(r)}):e}var Al={locale:()=>`en`,t:(e,t)=>kl(Tl[e]??String(e),t),plural:(e,t,n)=>Al.pluralForm(e,Dl(Al.locale(),t),{...n,count:t}),pluralForm:(e,t,n)=>{let r=Tl;return kl(r[Ol(e,t)]??r[`${e}.other`]??`${e}.other`,n)}},jl=I(Al);function Ml(){return L(jl)}var Nl=W(`<span data-slot=text-input-v2-leading-icon>`),Pl=W(`<button type=button data-slot=text-input-v2-icon-button>`),Fl=W(`<div data-component=text-input-v2><div data-slot=text-input-v2-value><input>`);function Il(e){let t=Ml(),[n,r]=B(e,[`class`,`classList`,`leadingIcon`,`showCopyButton`,`showClearButton`,`clearIcon`,`copyLabel`,`clearLabel`,`onCopyClick`,`onClearClick`,`numeric`,`invalid`,`appearance`,`disabled`]);return(()=>{var e=Fl(),i=e.firstChild,a=i.firstChild;return K(i,R(H,{get when(){return n.leadingIcon},get children(){var e=Nl();return K(e,()=>n.leadingIcon),e}}),a),gt(a,z(r,{get type(){return r.type??`text`},get disabled(){return n.disabled},get"aria-invalid"(){return n.invalid?!0:void 0},"data-slot":`text-input-v2-input`}),!1,!1),K(e,R(H,{get when(){return n.showClearButton||n.showCopyButton},get children(){var e=Pl();return e.$$click=e=>{if(n.showClearButton){n.onClearClick?.(e);return}n.onCopyClick?.(e)},e.$$mousedown=e=>{n.showClearButton&&e.preventDefault()},K(e,R(Fo,{get name(){return U(()=>!!n.showClearButton)()?n.clearIcon??`xmark-small`:`copy`}})),j(r=>{var i=n.showClearButton?`clear`:`copy`,a=n.showClearButton?n.clearLabel??t.t(`ui.common.clear`):n.copyLabel??t.t(`ui.message.copy`),o=n.disabled;return i!==r.e&&G(e,`data-variant`,r.e=i),a!==r.t&&G(e,`aria-label`,r.t=a),o!==r.a&&(e.disabled=r.a=o),r},{e:void 0,t:void 0,a:void 0}),e}}),null),j(t=>{var r=n.disabled?``:void 0,i=n.invalid?``:void 0,a=n.numeric?``:void 0,o=n.appearance??`base`,s=n.leadingIcon?``:void 0,c={...n.classList,[n.class??``]:!!n.class};return r!==t.e&&G(e,`data-disabled`,t.e=r),i!==t.t&&G(e,`data-invalid`,t.t=i),a!==t.a&&G(e,`data-numeric`,t.a=a),o!==t.o&&G(e,`data-appearance`,t.o=o),s!==t.i&&G(e,`data-leading-icon`,t.i=s),t.n=pt(e,c,t.n),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),e})()}ct([`mousedown`,`click`]);var Ll=class{collection;direction;orientation;constructor(e,t,n){this.collection=e,this.direction=t,this.orientation=n}flipDirection(){return this.direction()===`rtl`&&this.orientation()===`horizontal`}getKeyLeftOf(e){if(this.flipDirection())return this.getNextKey(e);if(this.orientation()===`horizontal`)return this.getPreviousKey(e)}getKeyRightOf(e){if(this.flipDirection())return this.getPreviousKey(e);if(this.orientation()===`horizontal`)return this.getNextKey(e)}getKeyAbove(e){if(this.orientation()===`vertical`)return this.getPreviousKey(e)}getKeyBelow(e){if(this.orientation()===`vertical`)return this.getNextKey(e)}getFirstKey(){let e=this.collection().getFirstKey();if(e!=null)return this.collection().getItem(e)?.disabled&&(e=this.getNextKey(e)),e}getLastKey(){let e=this.collection().getLastKey();if(e!=null)return this.collection().getItem(e)?.disabled&&(e=this.getPreviousKey(e)),e}getNextKey(e){let t=e,n;do if(t=this.collection().getKeyAfter(t)??this.collection().getFirstKey(),t==null||(n=this.collection().getItem(t),n==null))return;while(n.disabled);return t}getPreviousKey(e){let t=e,n;do if(t=this.collection().getKeyBefore(t)??this.collection().getLastKey(),t==null||(n=this.collection().getItem(t),n==null))return;while(n.disabled);return t}};function Rl(e){let t=e.startIndex??0,n=e.startLevel??0,r=[],i=t=>{if(t==null)return``;let n=e.getKey??`key`,r=ei(n)?t[n]:n(t);return r==null?``:String(r)},a=t=>{if(t==null)return``;let n=e.getTextValue??`textValue`,r=ei(n)?t[n]:n(t);return r==null?``:String(r)},o=t=>{if(t==null)return!1;let n=e.getDisabled??`disabled`;return(ei(n)?t[n]:n(t))??!1},s=t=>{if(t!=null)return ei(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(let c of e.dataSource){if(ei(c)||$r(c)){r.push({type:`item`,rawValue:c,key:String(c),textValue:String(c),disabled:o(c),level:n,index:t}),t++;continue}if(s(c)!=null){r.push({type:`section`,rawValue:c,key:``,textValue:``,disabled:!1,level:n,index:t}),t++;let i=s(c)??[];if(i.length>0){let a=Rl({dataSource:i,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...a),t+=a.length}}else r.push({type:`item`,rawValue:c,key:i(c),textValue:a(c),disabled:o(c),level:n,index:t}),t++}return r}function zl(e,t=[]){return N(()=>{let n=Rl({dataSource:q(e.dataSource),getKey:q(e.getKey),getTextValue:q(e.getTextValue),getDisabled:q(e.getDisabled),getSectionChildren:q(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)})}var Bl=class e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function Vl(e){let[t,n]=ja(e);return[()=>t()??new Bl,n]}function Hl(e){return hi()?e.altKey:e.ctrlKey}function Ul(e){return di()?e.metaKey:e.ctrlKey}function Wl(e){return new Bl(e)}function Gl(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Kl(e){let t=Z({selectionMode:`none`,selectionBehavior:`toggle`},e),[n,r]=A(!1),[i,a]=A(),[o,s]=Vl({value:N(()=>{let e=q(t.selectedKeys);return e==null?e:Wl(e)}),defaultValue:N(()=>{let e=q(t.defaultSelectedKeys);return e==null?new Bl:Wl(e)}),onChange:e=>t.onSelectionChange?.(e)}),[c,l]=A(q(t.selectionBehavior));return M(()=>{let e=o();q(t.selectionBehavior)===`replace`&&c()===`toggle`&&typeof e==`object`&&e.size===0&&l(`replace`)}),M(()=>{l(q(t.selectionBehavior)??`toggle`)}),{selectionMode:()=>q(t.selectionMode),disallowEmptySelection:()=>q(t.disallowEmptySelection)??!1,selectionBehavior:c,setSelectionBehavior:l,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:a,selectedKeys:o,setSelectedKeys:e=>{(q(t.allowDuplicateSelectionEvents)||!Gl(e,o()))&&s(e)}}}function ql(e){let[t,n]=A(``),[r,i]=A(-1);return{typeSelectHandlers:{onKeyDown:a=>{if(q(e.isDisabled))return;let o=q(e.keyboardDelegate),s=q(e.selectionManager);if(!o.getKeyForSearch)return;let c=Jl(a.key);if(!c||a.ctrlKey||a.metaKey)return;c===` `&&t().trim().length>0&&(a.preventDefault(),a.stopPropagation());let l=n(e=>e+c),u=o.getKeyForSearch(l,s.focusedKey())??o.getKeyForSearch(l);u==null&&Yl(l)&&(l=l[0],u=o.getKeyForSearch(l,s.focusedKey())??o.getKeyForSearch(l)),u!=null&&(s.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),i(window.setTimeout(()=>n(``),500))}}}}function Jl(e){return e.length===1||!/^[A-Z]/i.test(e)?e:``}function Yl(e){return e.split(``).every(t=>t===e[0])}function Xl(e,t,n){let r=z({selectOnFocus:()=>q(e.selectionManager).selectionBehavior()===`replace`},e),i=()=>n?.()??t(),{direction:a}=Xo(),o={top:0,left:0};mn(()=>q(r.isVirtualized)?void 0:i(),`scroll`,()=>{let e=i();e&&(o={top:e.scrollTop,left:e.scrollLeft})});let{typeSelectHandlers:s}=ql({isDisabled:()=>q(r.disallowTypeAhead),keyboardDelegate:()=>q(r.keyboardDelegate),selectionManager:()=>q(r.selectionManager)}),c=()=>q(r.orientation)??`vertical`,l=e=>{X(e,s.onKeyDown),e.altKey&&e.key===`Tab`&&e.preventDefault();let n=t();if(!n?.contains(e.target))return;let i=q(r.selectionManager),o=q(r.selectOnFocus),l=t=>{t!=null&&(i.setFocusedKey(t),e.shiftKey&&i.selectionMode()===`multiple`?i.extendSelection(t):o&&!Hl(e)&&i.replaceSelection(t))},u=q(r.keyboardDelegate),d=q(r.shouldFocusWrap),f=i.focusedKey();switch(e.key){case c()===`vertical`?`ArrowDown`:`ArrowRight`:if(u.getKeyBelow){e.preventDefault();let t;t=f==null?u.getFirstKey?.():u.getKeyBelow(f),t==null&&d&&(t=u.getFirstKey?.(f)),l(t)}break;case c()===`vertical`?`ArrowUp`:`ArrowLeft`:if(u.getKeyAbove){e.preventDefault();let t;t=f==null?u.getLastKey?.():u.getKeyAbove(f),t==null&&d&&(t=u.getLastKey?.(f)),l(t)}break;case c()===`vertical`?`ArrowLeft`:`ArrowUp`:if(u.getKeyLeftOf){e.preventDefault();let t=a()===`rtl`,n;n=f==null?t?u.getFirstKey?.():u.getLastKey?.():u.getKeyLeftOf(f),l(n)}break;case c()===`vertical`?`ArrowRight`:`ArrowDown`:if(u.getKeyRightOf){e.preventDefault();let t=a()===`rtl`,n;n=f==null?t?u.getLastKey?.():u.getFirstKey?.():u.getKeyRightOf(f),l(n)}break;case`Home`:if(u.getFirstKey){e.preventDefault();let t=u.getFirstKey(f,Ul(e));t!=null&&(i.setFocusedKey(t),Ul(e)&&e.shiftKey&&i.selectionMode()===`multiple`?i.extendSelection(t):o&&i.replaceSelection(t))}break;case`End`:if(u.getLastKey){e.preventDefault();let t=u.getLastKey(f,Ul(e));t!=null&&(i.setFocusedKey(t),Ul(e)&&e.shiftKey&&i.selectionMode()===`multiple`?i.extendSelection(t):o&&i.replaceSelection(t))}break;case`PageDown`:u.getKeyPageBelow&&f!=null&&(e.preventDefault(),l(u.getKeyPageBelow(f)));break;case`PageUp`:u.getKeyPageAbove&&f!=null&&(e.preventDefault(),l(u.getKeyPageAbove(f)));break;case`a`:Ul(e)&&i.selectionMode()===`multiple`&&q(r.disallowSelectAll)!==!0&&(e.preventDefault(),i.selectAll());break;case`Escape`:!e.defaultPrevented&&!q(r.disallowEmptySelection)&&(e.preventDefault(),i.clearSelection());break;case`Tab`:if(!q(r.allowsTabNavigation)){if(e.shiftKey)n.focus();else{let e=Li(n,{tabbable:!0}),t,r;do r=e.lastChild(),r&&(t=r);while(r);t&&!t.contains(document.activeElement)&&bi(t)}break}}},u=e=>{let t=q(r.selectionManager),n=q(r.keyboardDelegate),a=q(r.selectOnFocus);if(t.isFocused()){e.currentTarget.contains(e.target)||t.setFocused(!1);return}if(e.currentTarget.contains(e.target)){if(t.setFocused(!0),t.focusedKey()==null){let r=e=>{e!=null&&(t.setFocusedKey(e),a&&t.replaceSelection(e))},i=e.relatedTarget;i&&e.currentTarget.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?r(t.lastSelectedKey()??n.getLastKey?.()):r(t.firstSelectedKey()??n.getFirstKey?.())}else if(!q(r.isVirtualized)){let e=i();if(e){e.scrollTop=o.top,e.scrollLeft=o.left;let n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(bi(n),Ki(e,n))}}}},d=e=>{let t=q(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)},f=e=>{i()===e.target&&e.preventDefault()},p=()=>{let e=q(r.autoFocus);if(!e)return;let n=q(r.selectionManager),i=q(r.keyboardDelegate),a;e===`first`&&(a=i.getFirstKey?.()),e===`last`&&(a=i.getLastKey?.());let o=n.selectedKeys();o.size&&(a=o.values().next().value),n.setFocused(!0),n.setFocusedKey(a);let s=t();s&&a==null&&!q(r.shouldUseVirtualFocus)&&bi(s)};return se(()=>{r.deferAutoFocus?setTimeout(p,0):p()}),M(oe([i,()=>q(r.isVirtualized),()=>q(r.selectionManager).focusedKey()],e=>{let[t,n,i]=e;if(n)i&&r.scrollToKey?.(i);else if(i&&t){let e=t.querySelector(`[data-key="${i}"]`);e&&Ki(t,e)}})),{tabIndex:N(()=>{if(!q(r.shouldUseVirtualFocus))return q(r.selectionManager).focusedKey()==null?0:-1}),onKeyDown:l,onMouseDown:f,onFocusIn:u,onFocusOut:d}}function Zl(e,t){let n=()=>q(e.selectionManager),r=()=>q(e.key),i=()=>q(e.shouldUseVirtualFocus),a=e=>{n().selectionMode()!==`none`&&(n().selectionMode()===`single`?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):e?.shiftKey?n().extendSelection(r()):n().selectionBehavior()===`toggle`||Ul(e)||`pointerType`in e&&e.pointerType===`touch`?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),s=()=>q(e.disabled)||n().isDisabled(r()),c=()=>!s()&&n().canSelectItem(r()),l=null,u=t=>{c()&&(l=t.pointerType,t.pointerType===`mouse`&&t.button===0&&!q(e.shouldSelectOnPressUp)&&a(t))},d=t=>{c()&&t.pointerType===`mouse`&&t.button===0&&q(e.shouldSelectOnPressUp)&&q(e.allowsDifferentPressOrigin)&&a(t)},f=t=>{c()&&(q(e.shouldSelectOnPressUp)&&!q(e.allowsDifferentPressOrigin)||l!==`mouse`)&&a(t)},p=e=>{c()&&[`Enter`,` `].includes(e.key)&&(Hl(e)?n().toggleSelection(r()):a(e))},m=e=>{s()&&e.preventDefault()},h=e=>{let a=t();i()||s()||!a||e.target===a&&n().setFocusedKey(r())},g=N(()=>{if(!(i()||s()))return r()===n().focusedKey()?0:-1}),_=N(()=>q(e.virtualized)?void 0:r());return M(oe([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([t,n,r,i,a])=>{t&&n===i&&a&&!r&&document.activeElement!==t&&(e.focus?e.focus():bi(t))})),{isSelected:o,isDisabled:s,allowsSelection:c,tabIndex:g,dataKey:_,onPointerDown:u,onPointerUp:d,onClick:f,onKeyDown:p,onMouseDown:m,onFocus:h}}var Ql=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()===`none`)return!1;let t=this.getKey(e);return t!=null&&this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;let e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(let t of this.state.selectedKeys()){let n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index<e.index;(!e||r)&&(e=n)}return e?.key}lastSelectedKey(){let e;for(let t of this.state.selectedKeys()){let n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index>e.index;(!e||r)&&(e=n)}return e?.key}extendSelection(e){if(this.selectionMode()===`none`)return;if(this.selectionMode()===`single`){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Bl(n,r,t);for(let e of this.getKeyRange(r,n.currentKey||t))i.delete(e);for(let e of this.getKeyRange(t,r))this.canSelectItem(e)&&i.add(e);this.state.setSelectedKeys(i)}getKeyRange(e,t){let n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){let n=[],r=e;for(;r!=null;){let e=this.collection().getItem(r);if(e&&e.type===`item`&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){let t=this.collection().getItem(e);return t?!t||t.type!==`item`?null:t.key:e}toggleSelection(e){if(this.selectionMode()===`none`)return;if(this.selectionMode()===`single`&&!this.isSelected(e)){this.replaceSelection(e);return}let t=this.getKey(e);if(t==null)return;let n=new Bl(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()===`none`)return;let t=this.getKey(e);if(t==null)return;let n=this.canSelectItem(t)?new Bl([t],t,t):new Bl;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()===`none`)return;let t=new Bl;for(let n of e){let e=this.getKey(n);if(e!=null&&(t.add(e),this.selectionMode()===`single`))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()===`multiple`&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){let e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Bl)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!==`none`&&(this.selectionMode()===`single`?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()===`toggle`||t&&t.pointerType===`touch`?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;let t=this.selectedKeys();if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;for(let n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()===`none`)return!1;let t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){let t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){let e=[];return(t=>{for(;t!=null;){if(this.canSelectItem(t)){let n=this.collection().getItem(t);if(!n)continue;n.type===`item`&&e.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),e}},$l=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(let t of e)this.keyMap.set(t.key,t);if(this.keyMap.size===0)return;let t,n=0;for(let[e,r]of this.keyMap)t?(t.nextKey=e,r.prevKey=t.key):(this.firstKey=e,r.prevKey=void 0),r.type===`item`&&(r.index=n++),t=r,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){let t=[...this.getKeys()];return this.getItem(t[e])}};function eu(e){let t=Kl(e),n=zl({dataSource:()=>q(e.dataSource),getKey:()=>q(e.getKey),getTextValue:()=>q(e.getTextValue),getDisabled:()=>q(e.getDisabled),getSectionChildren:()=>q(e.getSectionChildren),factory:t=>e.filter?new $l(e.filter(t)):new $l(t)},[()=>e.filter]),r=new Ql(n,t);return te(()=>{let e=t.focusedKey();e!=null&&!n().getItem(e)&&t.setFocusedKey(void 0)}),{collection:n,selectionManager:()=>r}}var tu=I();function nu(){return L(tu)}function ru(){let e=nu();if(e===void 0)throw Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function iu(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function au(e,t){let n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){let t=e[r]?.ref();if(t&&iu(t,n))return r+1}return 0}function ou(e){let t=e.map((e,t)=>[t,e]),n=!1;return t.sort(([e,t],[r,i])=>{let a=t.ref(),o=i.ref();return a===o||!a||!o?0:iu(a,o)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1)}),n?t.map(([e,t])=>t):e}function su(e,t){let n=ou(e);e!==n&&t(n)}function cu(e){let t=e[0],n=e[e.length-1]?.ref(),r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return oi(r).body}function lu(e,t){M(()=>{let n=setTimeout(()=>{su(e(),t)});P(()=>clearTimeout(n))})}function uu(e,t){if(typeof IntersectionObserver!=`function`){lu(e,t);return}let n=[];M(()=>{let r=()=>{let r=!!n.length;n=e(),r&&su(e(),t)},i=cu(e()),a=new IntersectionObserver(r,{root:i});for(let t of e()){let e=t.ref();e&&a.observe(e)}P(()=>a.disconnect())})}function du(e={}){let[t,n]=Na({value:()=>q(e.items),onChange:t=>e.onItemsChange?.(t)});uu(t,n);let r=e=>(n(t=>Zr(t,e,au(t,e))),()=>{n(t=>{let n=t.filter(t=>t.ref()!==e.ref());return t.length===n.length?t:n})});return{DomCollectionProvider:e=>R(tu.Provider,{value:{registerItem:r},get children(){return e.children}})}}function fu(e){let t=ru(),n=Z({shouldRegisterItem:!0},e);M(()=>{n.shouldRegisterItem&&P(t.registerItem(n.getItem()))})}function pu(e,t){let n=new ResizeObserver(e);return P(n.disconnect.bind(n)),{observe:e=>n.observe(e,t),unobserve:n.unobserve.bind(n)}}function mu(e,t,n){let r=new WeakMap,{observe:i,unobserve:a}=pu(e=>{for(let n of e){let{contentRect:e,target:i}=n,a=Math.round(e.width),o=Math.round(e.height),s=r.get(i);(!s||s.width!==a||s.height!==o)&&(t(e,i,n),r.set(i,{width:a,height:o}))}},n);M(t=>{let n=on(cn(q(e)));return fn(n,t,i,a),n},[])}Ra({},{Content:()=>_u,Indicator:()=>vu,List:()=>yu,Root:()=>xu,Tabs:()=>Cu,Trigger:()=>Su,useTabsContext:()=>gu});var hu=I();function gu(){let e=L(hu);if(e===void 0)throw Error("[kobalte]: `useTabsContext` must be used within a `Tabs` component");return e}function _u(e){let[t,n]=A(),r=gu(),[i,a]=B(e,[`ref`,`id`,`value`,`forceMount`]),[o,s]=A(0),c=()=>i.id??r.generateContentId(i.value),l=()=>r.listState().selectedKey()===i.value,{present:u}=ao({show:()=>i.forceMount||l(),element:()=>t()??null});return M(oe([()=>t(),()=>u()],([e,t])=>{if(e==null||!t)return;let n=()=>{let t=Li(e,{tabbable:!0});s(t.nextNode()?void 0:0)};n();let r=new MutationObserver(n);r.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`tabindex`,`disabled`]}),P(()=>{r.disconnect()})})),M(oe([()=>i.value,c],([e,t])=>{r.contentIdsMap().set(e,t)})),R(H,{get when(){return u()},get children(){return R(Da,z({as:`div`,ref(e){var t=Xr(n,i.ref);typeof t==`function`&&t(e)},get id(){return c()},role:`tabpanel`,get tabIndex(){return o()},get"aria-labelledby"(){return r.triggerIdsMap().get(i.value)},get"data-orientation"(){return r.orientation()},get"data-selected"(){return l()?``:void 0}},a))}})}function vu(e){let t=gu(),[n,r]=B(e,[`style`]),[i,a]=A(),{direction:o}=Xo(),s=()=>{let e=t.selectedTab();if(e==null||e.getClientRects().length===0)return;let n={transform:void 0,width:void 0,height:void 0,transition:i()==null?`none`:void 0},r=o()===`rtl`?-1*(e.offsetParent?.offsetWidth-e.offsetWidth-e.offsetLeft):e.offsetLeft;n.transform=t.orientation()===`vertical`?`translateY(${e.offsetTop}px)`:`translateX(${r}px)`,t.orientation()===`horizontal`?n.width=`${e.offsetWidth}px`:n.height=`${e.offsetHeight}px`,a(n)};M(oe([t.selectedTab,t.orientation,o],()=>{i()!=null&&s()},{defer:!0}));let[c,l]=A(!1),u=null,d=null;return mu(t.selectedTab,(e,t)=>{if(d!==t){d=t,s();return}l(!0),u&&clearTimeout(u),u=setTimeout(()=>{u=null,l(!1)},1),s()}),R(Da,z({as:`div`,role:`presentation`,get style(){return Yr(i()??{visibility:`hidden`},n.style)},get"data-orientation"(){return t.orientation()},get"data-resizing"(){return c()}},r))}function yu(e){let t,n=gu(),[r,i]=B(e,[`ref`,`onKeyDown`,`onMouseDown`,`onFocusIn`,`onFocusOut`]),{direction:a}=Xo(),o=new Ll(()=>n.listState().collection(),a,n.orientation),s=Xl({selectionManager:()=>n.listState().selectionManager(),keyboardDelegate:()=>o,selectOnFocus:()=>n.activationMode()===`automatic`,shouldFocusWrap:!1,disallowEmptySelection:!0},()=>t);return M(()=>{if(t==null)return;let e=t.querySelector(`[data-key="${n.listState().selectedKey()}"]`);e!=null&&n.setSelectedTab(e)}),R(Da,z({as:`div`,ref(e){var n=Xr(e=>t=e,r.ref);typeof n==`function`&&n(e)},role:`tablist`,get"aria-orientation"(){return n.orientation()},get"data-orientation"(){return n.orientation()},get onKeyDown(){return vi([r.onKeyDown,s.onKeyDown])},get onMouseDown(){return vi([r.onMouseDown,s.onMouseDown])},get onFocusIn(){return vi([r.onFocusIn,s.onFocusIn])},get onFocusOut(){return vi([r.onFocusOut,s.onFocusOut])}},i))}function bu(e){let[t,n]=ja({value:()=>q(e.selectedKey),defaultValue:()=>q(e.defaultSelectedKey),onChange:t=>e.onSelectionChange?.(t)}),r=N(()=>{let e=t();return e==null?[]:[e]}),[,i]=B(e,[`onSelectionChange`]),{collection:a,selectionManager:o}=eu(z(i,{selectionMode:`single`,disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:r,onSelectionChange:r=>{let i=r.values().next().value;i!==void 0&&(i===t()&&e.onSelectionChange?.(i),n(i))}}));return{collection:a,selectionManager:o,selectedKey:t,setSelectedKey:n,selectedItem:N(()=>{let e=t();return e==null?void 0:a().getItem(e)})}}function xu(e){let[t,n]=B(Z({id:`tabs-${We()}`,orientation:`horizontal`,activationMode:`automatic`},e),[`value`,`defaultValue`,`onChange`,`orientation`,`activationMode`,`disabled`]),[r,i]=A([]),[a,o]=A(),{DomCollectionProvider:s}=du({items:r,onItemsChange:i}),c=bu({selectedKey:()=>t.value,defaultSelectedKey:()=>t.defaultValue,onSelectionChange:e=>t.onChange?.(String(e)),dataSource:r}),l=c.selectedKey();M(oe([()=>c.selectionManager(),()=>c.collection(),()=>c.selectedKey()],([e,t,n])=>{let r=n;if(e.isEmpty()||r==null||!t.getItem(r)){r=t.getFirstKey();let n=r==null?void 0:t.getItem(r);for(;n?.disabled&&n.key!==t.getLastKey();)r=t.getKeyAfter(n.key),n=r==null?void 0:t.getItem(r);n?.disabled&&r===t.getLastKey()&&(r=t.getFirstKey()),r!=null&&e.setSelectedKeys([r])}(e.focusedKey()==null||!e.isFocused()&&r!==l)&&e.setFocusedKey(r),l=r}));let u=new Map,d=new Map,f={isDisabled:()=>t.disabled??!1,orientation:()=>t.orientation,activationMode:()=>t.activationMode,triggerIdsMap:()=>u,contentIdsMap:()=>d,listState:()=>c,selectedTab:a,setSelectedTab:o,generateTriggerId:e=>`${n.id}-trigger-${e}`,generateContentId:e=>`${n.id}-content-${e}`};return R(s,{get children(){return R(hu.Provider,{value:f,get children(){return R(Da,z({as:`div`,get"data-orientation"(){return f.orientation()}},n))}})}})}function Su(e){let t,n=gu(),[r,i]=B(Z({type:`button`},e),[`ref`,`id`,`value`,`disabled`,`onPointerDown`,`onPointerUp`,`onClick`,`onKeyDown`,`onMouseDown`,`onFocus`]),a=()=>r.id??n.generateTriggerId(r.value),o=()=>n.listState().selectionManager().focusedKey()===r.value,s=()=>r.disabled||n.isDisabled(),c=()=>n.contentIdsMap().get(r.value);fu({getItem:()=>({ref:()=>t,type:`item`,key:r.value,textValue:``,disabled:s()})});let l=Zl({key:()=>r.value,selectionManager:()=>n.listState().selectionManager(),disabled:s},()=>t),u=e=>{gi()&&bi(e.currentTarget)};return M(oe([()=>r.value,a],([e,t])=>{n.triggerIdsMap().set(e,t)})),R(Da,z({as:`button`,ref(e){var n=Xr(e=>t=e,r.ref);typeof n==`function`&&n(e)},get id(){return a()},role:`tab`,get tabIndex(){return U(()=>!s())()?l.tabIndex():void 0},get disabled(){return s()},get"aria-selected"(){return l.isSelected()},get"aria-disabled"(){return s()||void 0},get"aria-controls"(){return U(()=>!!l.isSelected())()?c():void 0},get"data-key"(){return l.dataKey()},get"data-orientation"(){return n.orientation()},get"data-selected"(){return l.isSelected()?``:void 0},get"data-highlighted"(){return o()?``:void 0},get"data-disabled"(){return s()?``:void 0},get onPointerDown(){return vi([r.onPointerDown,l.onPointerDown])},get onPointerUp(){return vi([r.onPointerUp,l.onPointerUp])},get onClick(){return vi([r.onClick,l.onClick,u])},get onKeyDown(){return vi([r.onKeyDown,l.onKeyDown])},get onMouseDown(){return vi([r.onMouseDown,l.onMouseDown])},get onFocus(){return vi([r.onFocus,l.onFocus])}},i))}var Cu=Object.assign(xu,{Content:_u,Indicator:vu,List:yu,Trigger:Su}),wu=W(`<span class="inline-flex items-center gap-2"data-slot=tabs-v2-trigger-content>`),Tu=W(`<div>`),Eu=W(`<span data-slot=tabs-v2-subtext class="ms-2 text-xs text-text-weak">`),Du=W(`<button type=button><svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg aria-hidden=true><path d="M10.8889 3.11108L3.11108 10.8889"stroke=currentColor stroke-linejoin=round></path><path d="M3.11108 3.11108L10.8889 10.8889"stroke=currentColor stroke-linejoin=round>`),Ou=I({current:()=>!1});function ku(e){let[t,n]=B(e,[`class`,`classList`,`variant`,`orientation`,`children`]),r=()=>t.variant??`panel`,i=()=>r()===`line`||r()===`pill`||r()===`settings`,a=()=>r()===`panel`||r()===`line`?`normal`:r()===`underline`?`alt`:r()===`surface`?`pill`:r();return R(Ou.Provider,{value:{current:i},get children(){return R(xu,z(n,{get orientation(){return t.orientation},get"data-component"(){return i()?`tabs-v2`:`tabs`},get"data-variant"(){return a()},get"data-orientation"(){return t.orientation||`horizontal`},get classList(){return{...t.classList,[t.class??``]:!!t.class}},get children(){return t.children}}))}})}function Au(e){let t=L(Ou),[n,r]=B(e,[`class`,`classList`]);return R(yu,z(r,{get"data-slot"(){return t.current()?`tabs-v2-list`:`tabs-list`},get classList(){return{...n.classList,[n.class??``]:!!n.class}}}))}function ju(e){let t=L(Ou),[n,r]=B(e,[`class`,`classList`,`classes`,`children`,`closeButton`,`hideCloseButton`,`onMiddleClick`,`subtext`,`dir`]),i=()=>t.current()?`tabs-v2-trigger-wrapper`:`tabs-trigger-wrapper`,a=()=>t.current()?`tabs-v2-trigger`:`tabs-trigger`,o=()=>t.current()?`tabs-v2-trigger-close-button`:`tabs-trigger-close-button`;return(()=>{var s=Tu();return s.addEventListener(`auxclick`,e=>{e.button===1&&n.onMiddleClick&&(e.preventDefault(),n.onMiddleClick())}),s.$$mousedown=e=>{e.button===1&&n.onMiddleClick&&e.preventDefault()},K(s,R(Su,z(r,{get dir(){return n.dir??`auto`},get"data-slot"(){return a()},get"data-value"(){return e.value},get classList(){return{[n.classes?.button??``]:!!n.classes?.button}},get children(){return R(H,{get when(){return t.current()},get fallback(){return n.children},get children(){var e=wu();return K(e,()=>n.children,null),K(e,R(H,{get when(){return n.subtext},children:e=>(()=>{var t=Eu();return K(t,e),t})()}),null),e}})}})),null),K(s,R(H,{get when(){return n.closeButton},children:e=>(()=>{var t=Tu();return K(t,e),j(e=>{var r=o(),i=n.hideCloseButton?``:void 0;return r!==e.e&&G(t,`data-slot`,e.e=r),i!==e.t&&G(t,`data-hidden`,e.t=i),e},{e:void 0,t:void 0}),t})()}),null),j(t=>{var r=i(),a=e.value,o={...n.classList,[n.class??``]:!!n.class};return r!==t.e&&G(s,`data-slot`,t.e=r),a!==t.t&&G(s,`data-value`,t.t=a),t.a=pt(s,o,t.a),t},{e:void 0,t:void 0,a:void 0}),s})()}function Mu(e){let t=Ml(),[n,r]=B(e,[`class`,`classList`,`onClick`,`onPointerDown`,`aria-label`]);return(()=>{var e=Du();return gt(e,z(r,{get"aria-label"(){return n[`aria-label`]??t.t(`ui.tabs.close`)},"data-slot":`tabs-close-button`,get classList(){return{[n.class??``]:!!n.class,...n.classList}},onPointerDown:e=>{e.stopPropagation(),typeof n.onPointerDown==`function`&&n.onPointerDown(e)},onClick:e=>{e.preventDefault(),e.stopPropagation(),typeof n.onClick==`function`&&n.onClick(e)}}),!1,!0),e})()}function Nu(e){let t=L(Ou),[n,r]=B(e,[`class`,`classList`,`children`]);return R(_u,z(r,{get"data-slot"(){return t.current()?`tabs-v2-content`:`tabs-content`},get classList(){return{...n.classList,[n.class??``]:!!n.class}},get children(){return n.children}}))}var Pu=Object.assign(ku,{List:Au,Trigger:ju,CloseButton:Mu,Content:Nu,SectionTitle:e=>{let t=L(Ou);return(()=>{var n=Tu();return K(n,()=>e.children),j(()=>G(n,`data-slot`,t.current()?`tabs-v2-section-title`:`tabs-section-title`)),n})()}});ct([`mousedown`]);var Fu=[`id`,`name`,`validationState`,`required`,`disabled`,`readOnly`];function Iu(e){let t=Z({id:`form-control-${We()}`},e),[n,r]=A(),[i,a]=A(),[o,s]=A(),[c,l]=A();return{formControlContext:{name:()=>q(t.name)??q(t.id),dataset:N(()=>({"data-valid":q(t.validationState)===`valid`?``:void 0,"data-invalid":q(t.validationState)===`invalid`?``:void 0,"data-required":q(t.required)?``:void 0,"data-disabled":q(t.disabled)?``:void 0,"data-readonly":q(t.readOnly)?``:void 0})),validationState:()=>q(t.validationState),isRequired:()=>q(t.required),isDisabled:()=>q(t.disabled),isReadOnly:()=>q(t.readOnly),labelId:n,fieldId:i,descriptionId:o,errorMessageId:c,getAriaLabelledBy:(e,t,r)=>{let i=r!=null||n()!=null;return[r,n(),i&&t!=null?e:void 0].filter(Boolean).join(` `)||void 0},getAriaDescribedBy:e=>[o(),c(),e].filter(Boolean).join(` `)||void 0,generateId:ni(()=>q(t.id)),registerLabel:Ua(r),registerField:Ua(a),registerDescription:Ua(s),registerErrorMessage:Ua(l)}}}var Lu=I();function Ru(){let e=L(Lu);if(e===void 0)throw Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function zu(e){let t=Ru(),n=Z({id:t.generateId(`description`)},e);return M(()=>P(t.registerDescription(n.id))),R(Da,z({as:`div`},()=>t.dataset(),n))}var Bu=W(`<option>`),Vu=W(`<div aria-hidden=true><input type=text style=font-size:16px><select tabindex=-1><option>`);function Hu(e){let t,[n,r]=B(e,[`ref`,`onChange`,`collection`,`selectionManager`,`isOpen`,`isMultiple`,`isVirtualized`,`focusTrigger`]),i=Ru(),[a,o]=A(!1),s=e=>{let t=n.collection.getItem(e);return R(H,{get when(){return t?.type===`item`},get children(){var r=Bu();return r.value=e,K(r,()=>t?.textValue),j(()=>r.selected=n.selectionManager.isSelected(e)),r}})};return M(oe(()=>n.selectionManager.selectedKeys(),(e,n)=>{n&&Gl(e,n)||(o(!0),t?.dispatchEvent(new Event(`input`,{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event(`change`,{bubbles:!0,cancelable:!0})))},{defer:!0})),(()=>{var e=Vu(),c=e.firstChild,l=c.nextSibling;l.firstChild,c.addEventListener(`focus`,()=>n.focusTrigger()),l.addEventListener(`change`,e=>{X(e,n.onChange),a()||n.selectionManager.setSelectedKeys(new Set([e.target.value])),o(!1)});var u=Xr(e=>t=e,n.ref);return typeof u==`function`&&_t(u,l),gt(l,z({get multiple(){return n.isMultiple},get name(){return i.name()},get required(){return i.isRequired()},get disabled(){return i.isDisabled()},get size(){return n.collection.getSize()},get value(){return n.selectionManager.firstSelectedKey()??``}},r),!1,!0),K(l,R(H,{get when(){return n.isVirtualized},get fallback(){return R(V,{get each(){return[...n.collection.getKeys()]},children:s})},get children(){return R(V,{get each(){return[...n.selectionManager.selectedKeys()]},children:s})}}),null),j(t=>{var r=Yi,a=n.selectionManager.isFocused()||n.isOpen?-1:0,o=i.isRequired(),s=i.isDisabled(),l=i.isReadOnly();return t.e=mt(e,r,t.e),a!==t.t&&G(c,`tabindex`,t.t=a),o!==t.a&&(c.required=t.a=o),s!==t.o&&(c.disabled=t.o=s),l!==t.i&&(c.readOnly=t.i=l),t},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e})()}var Uu=new WeakMap;function Wu(e){let t=Uu.get(e);if(t!=null)return t;t=0;for(let n of e)n.type===`item`&&t++;return Uu.set(e,t),t}var Gu=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){let e=this.collection().getItem(t);if(e&&e.type===`item`&&!e.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){let e=this.collection().getItem(t);if(e&&e.type===`item`&&!e.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){let t=this.collection().getItem(e);if(t&&t.type===`item`&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){let t=this.collection().getItem(e);if(t&&t.type===`item`&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){let t=this.ref?.(),n=this.getItem(e);if(!t||!n)return;let r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight),i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i==null?null:this.getItem(i);return i}getKeyPageBelow(e){let t=this.ref?.(),n=this.getItem(e);if(!t||!n)return;let r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight),i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i==null?null:this.getItem(i);return i}getKeyForSearch(e,t){let n=this.collator?.();if(!n)return;let r=t==null?this.getFirstKey():this.getKeyBelow(t);for(;r!=null;){let t=this.collection().getItem(r);if(t){let i=t.textValue.slice(0,e.length);if(t.textValue&&n.compare(i,e)===0)return r}r=this.getKeyBelow(r)}}};function Ku(e,t,n){let r=Qo({usage:`search`,sensitivity:`base`});return Xl({selectionManager:()=>q(e.selectionManager),keyboardDelegate:N(()=>q(e.keyboardDelegate)||new Gu(e.collection,t,r)),autoFocus:()=>q(e.autoFocus),deferAutoFocus:()=>q(e.deferAutoFocus),shouldFocusWrap:()=>q(e.shouldFocusWrap),disallowEmptySelection:()=>q(e.disallowEmptySelection),selectOnFocus:()=>q(e.selectOnFocus),disallowTypeAhead:()=>q(e.disallowTypeAhead),shouldUseVirtualFocus:()=>q(e.shouldUseVirtualFocus),allowsTabNavigation:()=>q(e.allowsTabNavigation),isVirtualized:()=>q(e.isVirtualized),scrollToKey:t=>q(e.scrollToKey)?.(t),orientation:()=>q(e.orientation)},t,n)}Ra({},{Item:()=>Zu,ItemDescription:()=>Qu,ItemIndicator:()=>$u,ItemLabel:()=>ed,Listbox:()=>rd,Root:()=>td,Section:()=>nd,useListboxContext:()=>Ju});var qu=I();function Ju(){let e=L(qu);if(e===void 0)throw Error("[kobalte]: `useListboxContext` must be used within a `Listbox` component");return e}var Yu=I();function Xu(){let e=L(Yu);if(e===void 0)throw Error("[kobalte]: `useListboxItemContext` must be used within a `Listbox.Item` component");return e}function Zu(e){let t,n=Ju(),[r,i]=B(Z({id:`${n.generateId(`item`)}-${We()}`},e),[`ref`,`item`,`aria-label`,`aria-labelledby`,`aria-describedby`,`onPointerMove`,`onPointerDown`,`onPointerUp`,`onClick`,`onKeyDown`,`onMouseDown`,`onFocus`]),[a,o]=A(),[s,c]=A(),l=()=>n.listState().selectionManager(),u=()=>l().focusedKey()===r.item.key,d=Zl({key:()=>r.item.key,selectionManager:l,shouldSelectOnPressUp:n.shouldSelectOnPressUp,allowsDifferentPressOrigin:()=>n.shouldSelectOnPressUp()&&n.shouldFocusOnHover(),shouldUseVirtualFocus:n.shouldUseVirtualFocus,disabled:()=>r.item.disabled},()=>t),f=()=>{if(l().selectionMode()!==`none`)return d.isSelected()},p=N(()=>!(di()&&gi())),m=()=>p()?r[`aria-label`]:void 0,h=()=>p()?a():void 0,g=()=>p()?s():void 0,_=()=>{if(!n.isVirtualized())return;let e=n.listState().collection().getItem(r.item.key)?.index;return e==null?void 0:e+1},v=()=>{if(n.isVirtualized())return Wu(n.listState().collection())},y=e=>{X(e,r.onPointerMove),e.pointerType===`mouse`&&!d.isDisabled()&&n.shouldFocusOnHover()&&(bi(e.currentTarget),l().setFocused(!0),l().setFocusedKey(r.item.key))},b=N(()=>({"data-disabled":d.isDisabled()?``:void 0,"data-selected":d.isSelected()?``:void 0,"data-highlighted":u()?``:void 0})),x={isSelected:d.isSelected,dataset:b,generateId:ni(()=>i.id),registerLabelId:Ua(o),registerDescriptionId:Ua(c)};return R(Yu.Provider,{value:x,get children(){return R(Da,z({as:`li`,ref(e){var n=Xr(e=>t=e,r.ref);typeof n==`function`&&n(e)},role:`option`,get tabIndex(){return d.tabIndex()},get"aria-disabled"(){return d.isDisabled()},get"aria-selected"(){return f()},get"aria-label"(){return m()},get"aria-labelledby"(){return h()},get"aria-describedby"(){return g()},get"aria-posinset"(){return _()},get"aria-setsize"(){return v()},get"data-key"(){return d.dataKey()},get onPointerDown(){return vi([r.onPointerDown,d.onPointerDown])},get onPointerUp(){return vi([r.onPointerUp,d.onPointerUp])},get onClick(){return vi([r.onClick,d.onClick])},get onKeyDown(){return vi([r.onKeyDown,d.onKeyDown])},get onMouseDown(){return vi([r.onMouseDown,d.onMouseDown])},get onFocus(){return vi([r.onFocus,d.onFocus])},onPointerMove:y},b,i))}})}function Qu(e){let t=Xu(),n=Z({id:t.generateId(`description`)},e);return M(()=>P(t.registerDescriptionId(n.id))),R(Da,z({as:`div`},()=>t.dataset(),n))}function $u(e){let t=Xu(),[n,r]=B(Z({id:t.generateId(`indicator`)},e),[`forceMount`]);return R(H,{get when(){return n.forceMount||t.isSelected()},get children(){return R(Da,z({as:`div`,"aria-hidden":`true`},()=>t.dataset(),r))}})}function ed(e){let t=Xu(),n=Z({id:t.generateId(`label`)},e);return M(()=>P(t.registerLabelId(n.id))),R(Da,z({as:`div`},()=>t.dataset(),n))}function td(e){let t,n=Z({id:`listbox-${We()}`,selectionMode:`single`,virtualized:!1},e),[r,i]=B(n,`ref.children.renderItem.renderSection.value.defaultValue.onChange.options.optionValue.optionTextValue.optionDisabled.optionGroupChildren.state.keyboardDelegate.autoFocus.selectionMode.shouldFocusWrap.shouldUseVirtualFocus.shouldSelectOnPressUp.shouldFocusOnHover.allowDuplicateSelectionEvents.disallowEmptySelection.selectionBehavior.selectOnFocus.disallowTypeAhead.allowsTabNavigation.virtualized.scrollToItem.scrollRef.onKeyDown.onMouseDown.onFocusIn.onFocusOut`.split(`.`)),a=N(()=>r.state?r.state:eu({selectedKeys:()=>r.value,defaultSelectedKeys:()=>r.defaultValue,onSelectionChange:r.onChange,allowDuplicateSelectionEvents:()=>q(r.allowDuplicateSelectionEvents),disallowEmptySelection:()=>q(r.disallowEmptySelection),selectionBehavior:()=>q(r.selectionBehavior),selectionMode:()=>q(r.selectionMode),dataSource:()=>r.options??[],getKey:()=>r.optionValue,getTextValue:()=>r.optionTextValue,getDisabled:()=>r.optionDisabled,getSectionChildren:()=>r.optionGroupChildren})),o=Ku({selectionManager:()=>a().selectionManager(),collection:()=>a().collection(),autoFocus:()=>q(r.autoFocus),shouldFocusWrap:()=>q(r.shouldFocusWrap),keyboardDelegate:()=>r.keyboardDelegate,disallowEmptySelection:()=>q(r.disallowEmptySelection),selectOnFocus:()=>q(r.selectOnFocus),disallowTypeAhead:()=>q(r.disallowTypeAhead),shouldUseVirtualFocus:()=>q(r.shouldUseVirtualFocus),allowsTabNavigation:()=>q(r.allowsTabNavigation),isVirtualized:()=>r.virtualized,scrollToKey:()=>r.scrollToItem},()=>t,()=>r.scrollRef?.()),s={listState:a,generateId:ni(()=>i.id),shouldUseVirtualFocus:()=>n.shouldUseVirtualFocus,shouldSelectOnPressUp:()=>n.shouldSelectOnPressUp,shouldFocusOnHover:()=>n.shouldFocusOnHover,isVirtualized:()=>r.virtualized};return R(qu.Provider,{value:s,get children(){return R(Da,z({as:`ul`,ref(e){var n=Xr(e=>t=e,r.ref);typeof n==`function`&&n(e)},role:`listbox`,get tabIndex(){return o.tabIndex()},get"aria-multiselectable"(){return a().selectionManager().selectionMode()===`multiple`||void 0},get onKeyDown(){return vi([r.onKeyDown,o.onKeyDown])},get onMouseDown(){return vi([r.onMouseDown,o.onMouseDown])},get onFocusIn(){return vi([r.onFocusIn,o.onFocusIn])},get onFocusOut(){return vi([r.onFocusOut,o.onFocusOut])}},i,{get children(){return R(H,{get when(){return!r.virtualized},get fallback(){return r.children?.(a().collection)},get children(){return R(Wr,{get each(){return[...a().collection()]},by:`key`,children:e=>R(qe,{get children(){return[R(Je,{get when(){return e().type===`section`},get children(){return r.renderSection?.(e())}}),R(Je,{get when(){return e().type===`item`},get children(){return r.renderItem?.(e())}})]}})})}})}}))}})}function nd(e){return R(Da,z({as:`li`,role:`presentation`},e))}var rd=Object.assign(td,{Item:Zu,ItemDescription:Qu,ItemIndicator:$u,ItemLabel:ed,Section:nd}),id=[`id`,`aria-label`,`aria-labelledby`,`aria-describedby`];function ad(e){let t=Ru(),n=Z({id:t.generateId(`field`)},e);return j(()=>P(t.registerField(q(n.id)))),{fieldProps:{id:()=>q(n.id),ariaLabel:()=>q(n[`aria-label`]),ariaLabelledBy:()=>t.getAriaLabelledBy(q(n.id),q(n[`aria-label`]),q(n[`aria-labelledby`])),ariaDescribedBy:()=>t.getAriaDescribedBy(q(n[`aria-describedby`]))}}}function od(e){let t,n=Ru(),[r,i]=B(Z({id:n.generateId(`label`)},e),[`ref`]),a=Fa(()=>t,()=>`label`);return M(()=>P(n.registerLabel(i.id))),R(Da,z({as:`label`,ref(e){var n=Xr(e=>t=e,r.ref);typeof n==`function`&&n(e)},get for(){return U(()=>a()===`label`)()?n.fieldId():void 0}},()=>n.dataset(),i))}function sd(e,t){M(oe(e,e=>{if(e==null)return;let n=cd(e);n!=null&&(n.addEventListener(`reset`,t,{passive:!0}),P(()=>{n.removeEventListener(`reset`,t)}))}))}function cd(e){return ld(e)?e.form:e.closest(`form`)}function ld(e){return e.matches(`textarea, input, select, button`)}function ud(e){let t=Ru(),[n,r]=B(Z({id:t.generateId(`error-message`)},e),[`forceMount`]),i=()=>t.validationState()===`invalid`;return M(()=>{i()&&P(t.registerErrorMessage(r.id))}),R(H,{get when(){return n.forceMount||i()},get children(){return R(Da,z({as:`div`},()=>t.dataset(),r))}})}Ra({},{Arrow:()=>el,Content:()=>pd,Description:()=>zu,ErrorMessage:()=>ud,HiddenSelect:()=>md,Icon:()=>hd,Item:()=>Zu,ItemDescription:()=>Qu,ItemIndicator:()=>$u,ItemLabel:()=>ed,Label:()=>gd,Listbox:()=>_d,Portal:()=>vd,Root:()=>bd,Section:()=>nd,Select:()=>wd,Trigger:()=>xd,Value:()=>Sd,useSelectContext:()=>fd});var dd=I();function fd(){let e=L(dd);if(e===void 0)throw Error("[kobalte]: `useSelectContext` must be used within a `Select` component");return e}function pd(e){let t,n=fd(),[r,i]=B(e,[`ref`,`style`,`onCloseAutoFocus`,`onFocusOutside`]),a=e=>{n.close()},o=e=>{r.onFocusOutside?.(e),n.isOpen()&&n.isModal()&&e.preventDefault()};return ya({isDisabled:()=>!(n.isOpen()&&n.isModal()),targets:()=>t?[t]:[]}),io({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),_a({trapFocus:()=>n.isOpen()&&n.isModal(),onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:e=>{r.onCloseAutoFocus?.(e),e.defaultPrevented||(bi(n.triggerRef()),e.preventDefault())}},()=>t),R(H,{get when(){return n.contentPresent()},get children(){return R(ll.Positioner,{get children(){return R(Aa,z({ref(e){var i=Xr(e=>{n.setContentRef(e),t=e},r.ref);typeof i==`function`&&i(e)},get disableOutsidePointerEvents(){return U(()=>!!n.isModal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get style(){return Yr({"--kb-select-content-transform-origin":`var(--kb-popper-content-transform-origin)`,position:`relative`},r.style)},onEscapeKeyDown:a,onFocusOutside:o,get onDismiss(){return n.close}},()=>n.dataset(),i))}})}})}function md(e){let t=fd();return R(Hu,z({get collection(){return t.listState().collection()},get selectionManager(){return t.listState().selectionManager()},get isOpen(){return t.isOpen()},get isMultiple(){return t.isMultiple()},get isVirtualized(){return t.isVirtualized()},focusTrigger:()=>t.triggerRef()?.focus()},e))}function hd(e){let t=fd();return R(Da,z({as:`span`,"aria-hidden":`true`},()=>t.dataset(),Z({children:`▼`},e)))}function gd(e){let t=fd(),[n,r]=B(e,[`onClick`]);return R(od,z({as:`span`,onClick:e=>{X(e,n.onClick),t.isDisabled()||t.triggerRef()?.focus()}},r))}function _d(e){let t=fd(),[n,r]=B(Z({id:t.generateId(`listbox`)},e),[`ref`,`id`,`onKeyDown`]);return M(()=>P(t.registerListboxId(n.id))),R(td,z({ref(e){var r=Xr(t.setListboxRef,n.ref);typeof r==`function`&&r(e)},get id(){return n.id},get state(){return t.listState()},get virtualized(){return t.isVirtualized()},get autoFocus(){return t.autoFocus()},shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,get shouldFocusWrap(){return t.shouldFocusWrap()},get disallowTypeAhead(){return t.disallowTypeAhead()},get"aria-labelledby"(){return t.listboxAriaLabelledBy()},get renderItem(){return t.renderItem},get renderSection(){return t.renderSection},onKeyDown:e=>{X(e,n.onKeyDown),e.key===`Escape`&&e.preventDefault()}},r))}function vd(e){let t=fd();return R(H,{get when(){return t.contentPresent()},get children(){return R(Mt,e)}})}function yd(e){let[t,n,r,i]=B(Z({id:`select-${We()}`,selectionMode:`single`,disallowEmptySelection:!1,closeOnSelection:e.selectionMode===`single`,allowDuplicateSelectionEvents:!0,gutter:8,sameWidth:!0,modal:!1},e),`itemComponent.sectionComponent.open.defaultOpen.onOpenChange.value.defaultValue.onChange.placeholder.options.optionValue.optionTextValue.optionDisabled.optionGroupChildren.keyboardDelegate.allowDuplicateSelectionEvents.disallowEmptySelection.closeOnSelection.disallowTypeAhead.shouldFocusWrap.selectionBehavior.selectionMode.virtualized.modal.preventScroll.forceMount`.split(`.`),[`getAnchorRect`,`placement`,`gutter`,`shift`,`flip`,`slide`,`overlap`,`sameWidth`,`fitViewport`,`hideWhenDetached`,`detachedPadding`,`arrowPadding`,`overflowPadding`],Fu),[a,o]=A(),[s,c]=A(),[l,u]=A(),[d,f]=A(),[p,m]=A(),[h,g]=A(),[_,v]=A(),[y,b]=A(!0),x=e=>{let n=t.optionValue;return String(n==null?e:ti(n)?n(e):e[n])},S=N(()=>{let e=t.optionGroupChildren;return e==null?t.options:t.options.flatMap(t=>t[e]??t)}),C=N(()=>S().map(e=>x(e))),w=e=>[...e].map(e=>S().find(t=>x(t)===e)).filter(e=>e!=null),T=Pa({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:e=>t.onOpenChange?.(e)}),E=eu({selectedKeys:()=>t.value==null?t.value:t.value.map(x),defaultSelectedKeys:()=>t.defaultValue==null?t.defaultValue:t.defaultValue.map(x),onSelectionChange:e=>{t.onChange?.(w(e)),t.closeOnSelection&&j()},allowDuplicateSelectionEvents:()=>q(t.allowDuplicateSelectionEvents),disallowEmptySelection:()=>q(t.disallowEmptySelection),selectionBehavior:()=>q(t.selectionBehavior),selectionMode:()=>t.selectionMode,dataSource:()=>t.options??[],getKey:()=>t.optionValue,getTextValue:()=>t.optionTextValue,getDisabled:()=>t.optionDisabled,getSectionChildren:()=>t.optionGroupChildren}),D=N(()=>w(E.selectionManager().selectedKeys())),O=e=>{E.selectionManager().toggleSelection(x(e))},{present:k}=ao({show:()=>t.forceMount||T.isOpen(),element:()=>p()??null}),ee=()=>{let e=h();e&&bi(e)},te=e=>{if(t.options.length<=0)return;b(e),T.open();let n=E.selectionManager().firstSelectedKey();n??(e===`first`?n=E.collection().getFirstKey():e===`last`&&(n=E.collection().getLastKey())),ee(),E.selectionManager().setFocused(!0),E.selectionManager().setFocusedKey(n)},j=()=>{T.close(),E.selectionManager().setFocused(!1),E.selectionManager().setFocusedKey(void 0)},ne=e=>{T.isOpen()?j():te(e)},{formControlContext:re}=Iu(r);sd(d,()=>{let e=t.defaultValue?[...t.defaultValue].map(x):new Bl;E.selectionManager().setSelectedKeys(e)});let ie=Qo({usage:`search`,sensitivity:`base`}),ae=N(()=>q(t.keyboardDelegate)||new Gu(E.collection,void 0,ie)),se=e=>t.itemComponent?.({item:e}),P=e=>t.sectionComponent?.({section:e});M(oe([C],([e])=>{let t=[...E.selectionManager().selectedKeys()].filter(t=>e.includes(t));E.selectionManager().setSelectedKeys(t)},{defer:!0}));let ce=N(()=>({"data-expanded":T.isOpen()?``:void 0,"data-closed":T.isOpen()?void 0:``})),le={dataset:ce,isOpen:T.isOpen,isDisabled:()=>re.isDisabled()??!1,isMultiple:()=>q(t.selectionMode)===`multiple`,isVirtualized:()=>t.virtualized??!1,isModal:()=>t.modal??!1,preventScroll:()=>t.preventScroll??le.isModal(),disallowTypeAhead:()=>t.disallowTypeAhead??!1,shouldFocusWrap:()=>t.shouldFocusWrap??!1,selectedOptions:D,contentPresent:k,autoFocus:y,triggerRef:d,listState:()=>E,keyboardDelegate:ae,triggerId:a,valueId:s,listboxId:l,listboxAriaLabelledBy:_,setListboxAriaLabelledBy:v,setTriggerRef:f,setContentRef:m,setListboxRef:g,open:te,close:j,toggle:ne,placeholder:()=>t.placeholder,renderItem:se,renderSection:P,removeOptionFromSelection:O,generateId:ni(()=>q(r.id)),registerTriggerId:Ua(o),registerValueId:Ua(c),registerListboxId:Ua(u)};return R(Lu.Provider,{value:re,get children(){return R(dd.Provider,{value:le,get children(){return R(ll,z({anchorRef:d,contentRef:p},n,{get children(){return R(Da,z({as:`div`,role:`group`,get id(){return q(r.id)}},()=>re.dataset(),ce,i))}}))}})}})}function bd(e){let[t,n]=B(e,[`value`,`defaultValue`,`onChange`,`multiple`]),r=N(()=>t.value==null||t.multiple?t.value:[t.value]),i=N(()=>t.defaultValue==null||t.multiple?t.defaultValue:[t.defaultValue]);return R(yd,z({get value(){return r()},get defaultValue(){return i()},onChange:e=>{e!==r()&&(t.multiple?t.onChange?.(e??[]):t.onChange?.(e[0]??null))},get selectionMode(){return t.multiple?`multiple`:`single`}},n))}function xd(e){let t=Ru(),n=fd(),[r,i,a]=B(Z({id:n.generateId(`trigger`)},e),[`ref`,`disabled`,`onPointerDown`,`onClick`,`onKeyDown`,`onFocus`,`onBlur`],id),o=()=>n.listState().selectionManager(),s=()=>n.keyboardDelegate(),c=()=>r.disabled||n.isDisabled(),{fieldProps:l}=ad(i),{typeSelectHandlers:u}=ql({keyboardDelegate:s,selectionManager:o,onTypeSelect:e=>o().select(e)}),d=()=>[n.listboxAriaLabelledBy(),n.valueId()].filter(Boolean).join(` `)||void 0;return M(()=>P(n.registerTriggerId(l.id()))),M(()=>{n.setListboxAriaLabelledBy([l.ariaLabelledBy(),l.ariaLabel()&&!l.ariaLabelledBy()?l.id():null].filter(Boolean).join(` `)||void 0)}),R(Va,z({ref(e){var t=Xr(n.setTriggerRef,r.ref);typeof t==`function`&&t(e)},get id(){return l.id()},get disabled(){return c()},"aria-haspopup":`listbox`,get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return U(()=>!!n.isOpen())()?n.listboxId():void 0},get"aria-label"(){return l.ariaLabel()},get"aria-labelledby"(){return d()},get"aria-describedby"(){return l.ariaDescribedBy()},onPointerDown:e=>{X(e,r.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,!c()&&e.pointerType!==`touch`&&e.button===0&&(e.preventDefault(),n.toggle(!0))},onClick:e=>{X(e,r.onClick),!c()&&e.currentTarget.dataset.pointerType===`touch`&&n.toggle(!0)},onKeyDown:e=>{if(X(e,r.onKeyDown),!c())switch(X(e,u.onKeyDown),e.key){case`Enter`:case` `:case`ArrowDown`:e.stopPropagation(),e.preventDefault(),n.toggle(`first`);break;case`ArrowUp`:e.stopPropagation(),e.preventDefault(),n.toggle(`last`);break;case`ArrowLeft`:{if(e.preventDefault(),n.isMultiple())return;let t=o().firstSelectedKey(),r=t==null?s().getFirstKey?.():s().getKeyAbove?.(t);r!=null&&o().select(r);break}case`ArrowRight`:{if(e.preventDefault(),n.isMultiple())return;let t=o().firstSelectedKey(),r=t==null?s().getFirstKey?.():s().getKeyBelow?.(t);r!=null&&o().select(r);break}}},onFocus:e=>{X(e,r.onFocus),!o().isFocused()&&o().setFocused(!0)},onBlur:e=>{X(e,r.onBlur),!n.isOpen()&&o().setFocused(!1)}},()=>n.dataset(),()=>t.dataset(),a))}function Sd(e){let t=Ru(),n=fd(),[r,i]=B(Z({id:n.generateId(`value`)},e),[`id`,`children`]),a=()=>n.listState().selectionManager(),o=()=>{let e=a().selectedKeys();return e.size===1&&e.has(``)?!0:a().isEmpty()};return M(()=>P(n.registerValueId(r.id))),R(Da,z({as:`span`,get id(){return r.id},get"data-placeholder-shown"(){return o()?``:void 0}},()=>t.dataset(),i,{get children(){return R(H,{get when(){return!o()},get fallback(){return n.placeholder()},get children(){return R(Cd,{state:{selectedOption:()=>n.selectedOptions()[0],selectedOptions:()=>n.selectedOptions(),remove:e=>n.removeOptionFromSelection(e),clear:()=>a().clearSelection()},get children(){return r.children}})}})}}))}function Cd(e){return U(me(()=>{let t=e.children;return ti(t)?t(e.state):t}))}var wd=Object.assign(bd,{Arrow:el,Content:pd,Description:zu,ErrorMessage:ud,HiddenSelect:md,Icon:hd,Item:Zu,ItemDescription:Qu,ItemIndicator:$u,ItemLabel:ed,Label:gd,Listbox:_d,Portal:vd,Section:nd,Trigger:xd,Value:Sd}),Td=W(`<svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg aria-hidden=true><path d="M11 9.5L8 6.5L5 9.5"stroke=currentColor stroke-width=1 stroke-linecap=round stroke-linejoin=round>`),Ed=W(`<svg width=14 height=14 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg aria-hidden=true><path d="M3.53564 8.17857L6.39279 11.75L12.4642 4.25"stroke=currentColor stroke-width=1 stroke-linecap=round stroke-linejoin=round>`),Dd=W(`<div data-slot=select-v2-value>`),Od=W(`<span data-slot=select-v2-chevron aria-hidden=true>`),kd=W(`<div data-slot=menu-v2-group-label>`);function Ad(e,t){if(!t)return[{category:``,options:e}];let n=new Map;for(let r of e){let e=t(r),i=n.get(e);i?i.push(r):n.set(e,[r])}return[...n.entries()].map(([e,t])=>({category:e,options:t}))}var jd=()=>Td(),Md=()=>Ed();function Nd(e){let[t,n]=B(e,[`class`,`classList`,`placeholder`,`options`,`current`,`value`,`label`,`groupBy`,`onSelect`,`onHighlight`,`onOpenChange`,`children`,`invalid`,`numeric`,`disabled`,`valueClass`,`contentClass`,`placement`,`gutter`,`sameWidth`,`flip`,`slide`,`fitViewport`]),r={},i=()=>{r.cleanup?.(),r.cleanup=void 0,r.key=void 0},a=e=>t.value?t.value(e):String(e),o=e=>{if(!t.onHighlight)return;if(!e){i();return}let n=a(e);r.key!==n&&(r.cleanup?.(),r.cleanup=t.onHighlight(e),r.key=n)};P(i);let s=N(()=>Ad(t.options,t.groupBy));return R(bd,z(n,{multiple:!1,allowDuplicateSelectionEvents:!1,get disabled(){return t.disabled},"data-component":`select-v2-root`,get placement(){return t.placement??`bottom-end`},get gutter(){return t.gutter??4},get sameWidth(){return t.sameWidth??!1},get flip(){return t.flip??!0},get slide(){return t.slide??!0},get fitViewport(){return t.fitViewport??!1},get value(){return t.current},get options(){return s()},optionValue:e=>t.value?t.value(e):String(e),optionTextValue:e=>t.label?t.label(e):String(e),optionGroupChildren:`options`,get placeholder(){return t.placeholder},sectionComponent:e=>R(nd,{get children(){return R(H,{get when(){return e.section.rawValue.category},get children(){var t=kd();return K(t,()=>e.section.rawValue.category),t}})}}),itemComponent:e=>R(Zu,z(e,{"data-component":`menu-v2-item`,onPointerEnter:()=>o(e.item.rawValue),onPointerMove:()=>o(e.item.rawValue),onFocus:()=>o(e.item.rawValue),get children(){return[R(ed,{"data-slot":`menu-v2-item-content`,as:`span`,get children(){return U(()=>!!t.children)()?t.children(e.item.rawValue):U(()=>!!t.label)()?t.label(e.item.rawValue):String(e.item.rawValue)}}),R($u,{"data-slot":`menu-v2-item-indicator`,forceMount:!0,get children(){return R(Md,{})}})]}})),onChange:e=>{let n=e==null?null:Array.isArray(e)?e[0]??null:e;t.onSelect?.(n),i()},onOpenChange:e=>{t.onOpenChange?.(e),e||i()},get children(){return[R(xd,{as:`div`,get"aria-label"(){return e[`aria-label`]},get"aria-labelledby"(){return e[`aria-labelledby`]},"data-component":`select-v2`,"data-appearance":`inline`,get"data-invalid"(){return t.invalid?``:void 0},get"data-numeric"(){return t.numeric?``:void 0},get disabled(){return t.disabled},get"data-disabled"(){return t.disabled?``:void 0},get classList(){return{...t.classList,[t.class??``]:!!t.class}},get children(){return[(()=>{var e=Dd();return K(e,R(Sd,{"data-slot":`select-v2-value-text`,get class(){return t.valueClass},children:e=>{let n=e.selectedOption();return t.label&&n!=null?t.label(n):n??``}})),e})(),(()=>{var e=Od();return K(e,R(jd,{})),e})()]}}),R(vd,{get children(){return R(pd,{get class(){return t.contentClass},"data-component":`menu-v2-content`,"data-slot":`select-v2-content`,get children(){return R(_d,{"data-slot":`select-v2-listbox`})}})}})]}}))}Ra({},{Root:()=>Pd,Separator:()=>Fd});function Pd(e){let t,[n,r]=B(Z({orientation:`horizontal`},e),[`ref`,`orientation`]),i=Fa(()=>t,()=>`hr`);return R(Da,z({as:`hr`,ref(e){var r=Xr(e=>t=e,n.ref);typeof r==`function`&&r(e)},get role(){return i()===`hr`?void 0:`separator`},get"aria-orientation"(){return n.orientation===`vertical`?`vertical`:void 0},get"data-orientation"(){return n.orientation}},r))}var Fd=Pd;function Id(e={}){let[t,n]=Ma({value:()=>q(e.isSelected),defaultValue:()=>!!q(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{!q(e.isReadOnly)&&!q(e.isDisabled)&&n(t)},toggle:()=>{!q(e.isReadOnly)&&!q(e.isDisabled)&&n(!t())}}}var Ld=I();function Rd(){return L(Ld)}var zd=I();function Bd(){return L(zd)}var Vd=I();function Hd(){return L(Vd)}function Ud(){let e=Hd();if(e===void 0)throw Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var Wd=I();function Gd(){let e=L(Wd);if(e===void 0)throw Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function Kd(e,t,n){let r=e.split(`-`)[0],i=n.getBoundingClientRect(),a=[],o=t.clientX,s=t.clientY;switch(r){case`top`:a.push([o,s+5]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]);break;case`right`:a.push([o-5,s]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]);break;case`bottom`:a.push([o,s-5]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]);break;case`left`:a.push([o+5,s]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top])}return a}function qd(e,t){return t?Hi([e.clientX,e.clientY],t):!1}function Jd(e){let t=Gd(),n=nu(),r=Hd(),i=Rd(),a=Bd(),[o,s]=B(Z({placement:t.orientation()===`horizontal`?`bottom-start`:`right-start`},e),[`open`,`defaultOpen`,`onOpenChange`]),c=0,l=null,u=`right`,[d,f]=A(),[p,m]=A(),[h,g]=A(),[_,v]=A(),[y,b]=A(!0),[x,S]=A(s.placement),[C,w]=A([]),[T,E]=A([]),{DomCollectionProvider:D}=du({items:T,onItemsChange:E}),O=Pa({open:()=>o.open,defaultOpen:()=>o.defaultOpen,onOpenChange:e=>o.onOpenChange?.(e)}),{present:k}=ao({show:()=>t.forceMount()||O.isOpen(),element:()=>_()??null}),ee=eu({selectionMode:`none`,dataSource:T}),te=e=>{b(e),O.open()},j=(e=!1)=>{O.close(),e&&r&&r.close(!0)},ne=e=>{b(e),O.toggle()},re=()=>{let e=_();e&&(bi(e),ee.selectionManager().setFocused(!0),ee.selectionManager().setFocusedKey(void 0))},ie=()=>{a==null?re():setTimeout(()=>re())},ae=e=>{w(t=>[...t,e]);let t=r?.registerNestedMenu(e);return()=>{w(t=>Qr(t,e)),t?.()}},oe=e=>u===l?.side&&qd(e,l?.area),se=e=>{oe(e)&&e.preventDefault()},ce=e=>{oe(e)||ie()},le=e=>{oe(e)&&e.preventDefault()};ya({isDisabled:()=>!(r==null&&O.isOpen()&&t.isModal()),targets:()=>[_(),...C()].filter(Boolean)}),M(()=>{let e=_();if(!e||!r)return;let t=r.registerNestedMenu(e);P(()=>{t()})}),M(()=>{r===void 0&&i?.registerMenu(t.value(),[_(),...C()])}),M(()=>{r===void 0&&i!==void 0&&(i.value()===t.value()?(h()?.focus(),i.autoFocusMenu()&&te(!0)):j())}),M(()=>{r===void 0&&i!==void 0&&O.isOpen()&&i.setValue(t.value())}),P(()=>{r===void 0&&i?.unregisterMenu(t.value())});let ue={dataset:N(()=>({"data-expanded":O.isOpen()?``:void 0,"data-closed":O.isOpen()?void 0:``})),isOpen:O.isOpen,contentPresent:k,nestedMenus:C,currentPlacement:x,pointerGraceTimeoutId:()=>c,autoFocus:y,listState:()=>ee,parentMenuContext:()=>r,triggerRef:h,contentRef:_,triggerId:d,contentId:p,setTriggerRef:g,setContentRef:v,open:te,close:j,toggle:ne,focusContent:ie,onItemEnter:se,onItemLeave:ce,onTriggerLeave:le,setPointerDir:e=>u=e,setPointerGraceTimeoutId:e=>c=e,setPointerGraceIntent:e=>l=e,registerNestedMenu:ae,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:Ua(f),registerContentId:Ua(m)};return R(D,{get children(){return R(Vd.Provider,{value:ue,get children(){return R(H,{when:a===void 0,get fallback(){return s.children},get children(){return R(ll,z({anchorRef:h,contentRef:_,onCurrentPlacementChange:S},s))}})}})}})}var Yd=I();function Xd(){let e=L(Yd);if(e===void 0)throw Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}function Zd(e){let t,n=Gd(),r=Ud(),[i,a]=B(Z({id:n.generateId(`item-${We()}`)},e),[`ref`,`textValue`,`disabled`,`closeOnSelect`,`checked`,`indeterminate`,`onSelect`,`onPointerMove`,`onPointerLeave`,`onPointerDown`,`onPointerUp`,`onClick`,`onKeyDown`,`onMouseDown`,`onFocus`]),[o,s]=A(),[c,l]=A(),[u,d]=A(),f=()=>r.listState().selectionManager(),p=()=>a.id,m=()=>f().focusedKey()===p(),h=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout(()=>{r.close(!0)},1)};fu({getItem:()=>({ref:()=>t,type:`item`,key:p(),textValue:i.textValue??u()?.textContent??t?.textContent??``,disabled:i.disabled??!1})});let g=Zl({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),_=e=>{X(e,i.onPointerMove),e.pointerType===`mouse`&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||(bi(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},v=e=>{X(e,i.onPointerLeave),e.pointerType===`mouse`&&r.onItemLeave(e)},y=e=>{X(e,i.onPointerUp),!i.disabled&&e.button===0&&h()},b=e=>{if(X(e,i.onKeyDown),!e.repeat&&!i.disabled)switch(e.key){case`Enter`:case` `:h()}},x=N(()=>{if(i.indeterminate)return`mixed`;if(i.checked!=null)return i.checked}),S=N(()=>({"data-indeterminate":i.indeterminate?``:void 0,"data-checked":i.checked&&!i.indeterminate?``:void 0,"data-disabled":i.disabled?``:void 0,"data-highlighted":m()?``:void 0})),C={isChecked:()=>i.checked,dataset:S,setLabelRef:d,generateId:ni(()=>a.id),registerLabel:Ua(s),registerDescription:Ua(l)};return R(Yd.Provider,{value:C,get children(){return R(Da,z({as:`div`,ref(e){var n=Xr(e=>t=e,i.ref);typeof n==`function`&&n(e)},get tabIndex(){return g.tabIndex()},get"aria-checked"(){return x()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return o()},get"aria-describedby"(){return c()},get"data-key"(){return g.dataKey()},get onPointerDown(){return vi([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return vi([y,g.onPointerUp])},get onClick(){return vi([i.onClick,g.onClick])},get onKeyDown(){return vi([b,g.onKeyDown])},get onMouseDown(){return vi([i.onMouseDown,g.onMouseDown])},get onFocus(){return vi([i.onFocus,g.onFocus])},onPointerMove:_,onPointerLeave:v},S,a))}})}function Qd(e){let[t,n]=B(Z({closeOnSelect:!1},e),[`checked`,`defaultChecked`,`onChange`,`onSelect`]),r=Id({isSelected:()=>t.checked,defaultIsSelected:()=>t.defaultChecked,onSelectedChange:e=>t.onChange?.(e),isDisabled:()=>n.disabled});return R(Zd,z({role:`menuitemcheckbox`,get checked(){return r.isSelected()},onSelect:()=>{t.onSelect?.(),r.toggle()}},n))}var $d={next:(e,t)=>e===`ltr`?t===`horizontal`?`ArrowRight`:`ArrowDown`:t===`horizontal`?`ArrowLeft`:`ArrowUp`,previous:(e,t)=>$d.next(e===`ltr`?`rtl`:`ltr`,t)},ef={first:e=>e===`horizontal`?`ArrowDown`:`ArrowRight`,last:e=>e===`horizontal`?`ArrowUp`:`ArrowLeft`};function tf(e){let t=Gd(),n=Ud(),r=Rd(),{direction:i}=Xo(),[a,o]=B(Z({id:t.generateId(`trigger`)},e),[`ref`,`id`,`disabled`,`onPointerDown`,`onClick`,`onKeyDown`,`onMouseOver`,`onFocus`]),s=()=>t.value();r!==void 0&&(s=()=>t.value()??a.id,r.lastValue()===void 0&&r.setLastValue(s));let c=Fa(()=>n.triggerRef(),()=>`button`),l=N(()=>c()===`a`&&n.triggerRef()?.getAttribute(`href`)!=null);M(oe(()=>r?.value(),e=>{l()&&e===s()&&n.triggerRef()?.focus()}));let u=()=>{r===void 0?n.toggle(!0):n.isOpen()?r.value()===s()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1))};return M(()=>P(n.registerTriggerId(a.id))),R(Va,z({ref(e){var t=Xr(n.setTriggerRef,a.ref);typeof t==`function`&&t(e)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return a.id},get disabled(){return a.disabled},"aria-haspopup":`true`,get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return U(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return s()!==void 0&&r?.value()===s()||void 0},get tabIndex(){return r===void 0?void 0:r.value()===s()||r.lastValue()===s()?0:-1},onPointerDown:e=>{X(e,a.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,!a.disabled&&e.pointerType!==`touch`&&e.button===0&&u()},onMouseOver:e=>{X(e,a.onMouseOver),n.triggerRef()?.dataset.pointerType!==`touch`&&!a.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(s)},onClick:e=>{X(e,a.onClick),a.disabled||e.currentTarget.dataset.pointerType===`touch`&&u()},onKeyDown:e=>{if(X(e,a.onKeyDown),!a.disabled){if(l())switch(e.key){case`Enter`:case` `:return}switch(e.key){case`Enter`:case` `:case ef.first(t.orientation()):e.stopPropagation(),e.preventDefault(),Ji(e.currentTarget),n.open(`first`),r?.setAutoFocusMenu(!0),r?.setValue(s);break;case ef.last(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open(`last`);break;case $d.next(i(),t.orientation()):if(r===void 0)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case $d.previous(i(),t.orientation()):if(r===void 0)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{X(e,a.onFocus),r!==void 0&&e.currentTarget.dataset.pointerType!==`touch`&&r.setValue(s)},role:r===void 0?void 0:`menuitem`},()=>n.dataset(),o))}function nf(e){let t,n=Gd(),r=Ud(),i=Rd(),a=Bd(),{direction:o}=Xo(),[s,c]=B(Z({id:n.generateId(`content-${We()}`)},e),[`ref`,`id`,`style`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onEscapeKeyDown`,`onFocusOutside`,`onPointerEnter`,`onPointerMove`,`onKeyDown`,`onMouseDown`,`onFocusIn`,`onFocusOut`]),l=0,u=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),d=Ku({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()===`horizontal`?`vertical`:`horizontal`},()=>t);_a({trapFocus:()=>u()&&r.isOpen(),onMountAutoFocus:e=>{i===void 0&&s.onOpenAutoFocus?.(e)},onUnmountAutoFocus:s.onCloseAutoFocus},()=>t);let f=e=>{if(ri(e.currentTarget,e.target)&&(e.key===`Tab`&&r.isOpen()&&e.preventDefault(),i!==void 0&&e.currentTarget.getAttribute(`aria-haspopup`)!==`true`))switch(e.key){case $d.next(o(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case $d.previous(o(),n.orientation()):if(e.currentTarget.hasAttribute(`data-closed`))break;e.stopPropagation(),e.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu()}},p=e=>{s.onEscapeKeyDown?.(e),i?.setAutoFocusMenu(!1),r.close(!0)},m=e=>{s.onFocusOutside?.(e),n.isModal()&&e.preventDefault()},h=e=>{X(e,s.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},g=e=>{if(X(e,s.onPointerMove),e.pointerType!==`mouse`)return;let t=e.target,n=l!==e.clientX;ri(e.currentTarget,t)&&n&&(r.setPointerDir(e.clientX>l?`right`:`left`),l=e.clientX)};M(()=>P(r.registerContentId(s.id))),P(()=>r.setContentRef(void 0));let _={ref:Xr(e=>{r.setContentRef(e),t=e},s.ref),role:`menu`,get id(){return s.id},get tabIndex(){return d.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:vi([s.onKeyDown,d.onKeyDown,f]),onMouseDown:vi([s.onMouseDown,d.onMouseDown]),onFocusIn:vi([s.onFocusIn,d.onFocusIn]),onFocusOut:vi([s.onFocusOut,d.onFocusOut]),onPointerEnter:h,onPointerMove:g,get"data-orientation"(){return n.orientation()}};return R(H,{get when(){return r.contentPresent()},get children(){return R(H,{get when(){return a===void 0||r.parentMenuContext()!=null},get fallback(){return R(Da,z({as:`div`},()=>r.dataset(),_,c))},get children(){return R(ll.Positioner,{get children(){return R(Aa,z({get disableOutsidePointerEvents(){return U(()=>!!u())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Yr({"--kb-menu-content-transform-origin":`var(--kb-popper-content-transform-origin)`,position:`relative`},s.style)},onEscapeKeyDown:p,onFocusOutside:m,get onDismiss(){return r.close}},()=>r.dataset(),_,c))}})}})}})}function rf(e){let t,n=Gd(),r=Ud(),[i,a]=B(e,[`ref`]);return io({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),R(nf,z({ref(e){var n=Xr(e=>{t=e},i.ref);typeof n==`function`&&n(e)}},a))}var af=I();function of(){let e=L(af);if(e===void 0)throw Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function sf(e){let t=Z({id:Gd().generateId(`group-${We()}`)},e),[n,r]=A(),i={generateId:ni(()=>t.id),registerLabelId:Ua(r)};return R(af.Provider,{value:i,get children(){return R(Da,z({as:`div`,role:`group`,get"aria-labelledby"(){return n()}},t))}})}function cf(e){let t=of(),[n,r]=B(Z({id:t.generateId(`label`)},e),[`id`]);return M(()=>P(t.registerLabelId(n.id))),R(Da,z({as:`span`,get id(){return n.id},"aria-hidden":`true`},r))}function lf(e){let t=Ud();return R(Da,z({as:`span`,"aria-hidden":`true`},()=>t.dataset(),Z({children:`▼`},e)))}function uf(e){return R(Zd,z({role:`menuitem`,closeOnSelect:!0},e))}function df(e){let t=Xd(),[n,r]=B(Z({id:t.generateId(`description`)},e),[`id`]);return M(()=>P(t.registerDescription(n.id))),R(Da,z({as:`div`,get id(){return n.id}},()=>t.dataset(),r))}function ff(e){let t=Xd(),[n,r]=B(Z({id:t.generateId(`indicator`)},e),[`forceMount`]);return R(H,{get when(){return n.forceMount||t.isChecked()},get children(){return R(Da,z({as:`div`},()=>t.dataset(),r))}})}function pf(e){let t=Xd(),[n,r]=B(Z({id:t.generateId(`label`)},e),[`ref`,`id`]);return M(()=>P(t.registerLabel(n.id))),R(Da,z({as:`div`,ref(e){var r=Xr(t.setLabelRef,n.ref);typeof r==`function`&&r(e)},get id(){return n.id}},()=>t.dataset(),r))}function mf(e){let t=Ud();return R(H,{get when(){return t.contentPresent()},get children(){return R(Mt,e)}})}var hf=I();function gf(){let e=L(hf);if(e===void 0)throw Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function _f(e){let[t,n]=B(Z({id:Gd().generateId(`radiogroup-${We()}`)},e),[`value`,`defaultValue`,`onChange`,`disabled`]),[r,i]=ja({value:()=>t.value,defaultValue:()=>t.defaultValue,onChange:e=>t.onChange?.(e)});return R(hf.Provider,{value:{isDisabled:()=>t.disabled,isSelectedValue:e=>e===r(),setSelectedValue:e=>i(e)},get children(){return R(sf,n)}})}function vf(e){let t=gf(),[n,r]=B(Z({closeOnSelect:!1},e),[`value`,`onSelect`]);return R(Zd,z({role:`menuitemradio`,get checked(){return t.isSelectedValue(n.value)},onSelect:()=>{n.onSelect?.(),t.setSelectedValue(n.value)}},r))}function yf(e){let t=Rd(),[n,r]=B(Z({id:`menu-${We()}`,modal:!0},e),[`id`,`modal`,`preventScroll`,`forceMount`,`open`,`defaultOpen`,`onOpenChange`,`value`,`orientation`]),i=Pa({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:e=>n.onOpenChange?.(e)}),a={isModal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??a.isModal(),forceMount:()=>n.forceMount??!1,generateId:ni(()=>n.id),value:()=>n.value,orientation:()=>n.orientation??t?.orientation()??`horizontal`};return R(Wd.Provider,{value:a,get children(){return R(Jd,z({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},r))}})}function bf(e){let{direction:t}=Xo();return R(Jd,z({get placement(){return t()===`rtl`?`left-start`:`right-start`},flip:!0},e))}var xf={close:(e,t)=>e===`ltr`?[t===`horizontal`?`ArrowLeft`:`ArrowUp`]:[t===`horizontal`?`ArrowRight`:`ArrowDown`]};function Sf(e){let t=Ud(),n=Gd(),[r,i]=B(e,[`onFocusOutside`,`onKeyDown`]),{direction:a}=Xo();return R(nf,z({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{r.onFocusOutside?.(e);let n=e.target;ri(t.triggerRef(),n)||t.close()},onKeyDown:e=>{X(e,r.onKeyDown);let i=ri(e.currentTarget,e.target),o=xf.close(a(),n.orientation()).includes(e.key),s=t.parentMenuContext()!=null;i&&o&&s&&(t.close(),bi(t.triggerRef()))}},i))}var Cf=[`Enter`,` `],wf={open:(e,t)=>e===`ltr`?[...Cf,t===`horizontal`?`ArrowRight`:`ArrowDown`]:[...Cf,t===`horizontal`?`ArrowLeft`:`ArrowUp`]};function Tf(e){let t,n=Gd(),r=Ud(),[i,a]=B(Z({id:n.generateId(`sub-trigger-${We()}`)},e),[`ref`,`id`,`textValue`,`disabled`,`onPointerMove`,`onPointerLeave`,`onPointerDown`,`onPointerUp`,`onClick`,`onKeyDown`,`onMouseDown`,`onFocus`]),o=null,s=()=>{o&&window.clearTimeout(o),o=null},{direction:c}=Xo(),l=()=>i.id,u=()=>{let e=r.parentMenuContext();if(e==null)throw Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return e.listState().selectionManager()},d=()=>r.listState().collection(),f=()=>u().focusedKey()===l(),p=Zl({key:l,selectionManager:u,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},()=>t),m=e=>{X(e,i.onClick),!r.isOpen()&&!i.disabled&&r.open(!0)},h=e=>{if(X(e,i.onPointerMove),e.pointerType!==`mouse`)return;let t=r.parentMenuContext();if(t?.onItemEnter(e),!e.defaultPrevented){if(i.disabled){t?.onItemLeave(e);return}!r.isOpen()&&!o&&(r.parentMenuContext()?.setPointerGraceIntent(null),o=window.setTimeout(()=>{r.open(!1),s()},100)),t?.onItemEnter(e),e.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),bi(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(l()))}},g=e=>{if(X(e,i.onPointerLeave),e.pointerType!==`mouse`)return;s();let t=r.parentMenuContext(),n=r.contentRef();if(n){t?.setPointerGraceIntent({area:Kd(r.currentPlacement(),e,n),side:r.currentPlacement().split(`-`)[0]}),window.clearTimeout(t?.pointerGraceTimeoutId());let i=window.setTimeout(()=>{t?.setPointerGraceIntent(null)},300);t?.setPointerGraceTimeoutId(i)}else{if(t?.onTriggerLeave(e),e.defaultPrevented)return;t?.setPointerGraceIntent(null)}t?.onItemLeave(e)},_=e=>{X(e,i.onKeyDown),!e.repeat&&(i.disabled||wf.open(c(),n.orientation()).includes(e.key)&&(e.stopPropagation(),e.preventDefault(),u().setFocused(!1),u().setFocusedKey(void 0),r.isOpen()||r.open(`first`),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(d().getFirstKey())))};return M(()=>{if(r.registerItemToParentDomCollection==null)throw Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");P(r.registerItemToParentDomCollection({ref:()=>t,type:`item`,key:l(),textValue:i.textValue??t?.textContent??``,disabled:i.disabled??!1}))}),M(oe(()=>r.parentMenuContext()?.pointerGraceTimeoutId(),e=>{P(()=>{window.clearTimeout(e),r.parentMenuContext()?.setPointerGraceIntent(null)})})),M(()=>P(r.registerTriggerId(i.id))),P(()=>{s()}),R(Da,z({as:`div`,ref(e){var n=Xr(e=>{r.setTriggerRef(e),t=e},i.ref);typeof n==`function`&&n(e)},get id(){return i.id},role:`menuitem`,get tabIndex(){return p.tabIndex()},"aria-haspopup":`true`,get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return U(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return p.dataKey()},get"data-highlighted"(){return f()?``:void 0},get"data-disabled"(){return i.disabled?``:void 0},get onPointerDown(){return vi([i.onPointerDown,p.onPointerDown])},get onPointerUp(){return vi([i.onPointerUp,p.onPointerUp])},get onClick(){return vi([m,p.onClick])},get onKeyDown(){return vi([_,p.onKeyDown])},get onMouseDown(){return vi([i.onMouseDown,p.onMouseDown])},get onFocus(){return vi([i.onFocus,p.onFocus])},onPointerMove:h,onPointerLeave:g},()=>r.dataset(),a))}Ra({},{Arrow:()=>el,CheckboxItem:()=>Qd,Content:()=>Ef,DropdownMenu:()=>Of,Group:()=>sf,GroupLabel:()=>cf,Icon:()=>lf,Item:()=>uf,ItemDescription:()=>df,ItemIndicator:()=>ff,ItemLabel:()=>pf,Portal:()=>mf,RadioGroup:()=>_f,RadioItem:()=>vf,Root:()=>Df,Separator:()=>Pd,Sub:()=>bf,SubContent:()=>Sf,SubTrigger:()=>Tf,Trigger:()=>tf});function Ef(e){let t=Gd(),n=Ud(),[r,i]=B(e,[`onCloseAutoFocus`,`onInteractOutside`]),a=!1;return R(rf,z({onCloseAutoFocus:e=>{r.onCloseAutoFocus?.(e),a||bi(n.triggerRef()),a=!1,e.preventDefault()},onInteractOutside:e=>{r.onInteractOutside?.(e),(!t.isModal()||e.detail.isContextMenu)&&(a=!0)}},i))}function Df(e){return R(yf,Z({id:`dropdownmenu-${We()}`},e))}var Of=Object.assign(Df,{Arrow:el,CheckboxItem:Qd,Content:Ef,Group:sf,GroupLabel:cf,Icon:lf,Item:uf,ItemDescription:df,ItemIndicator:ff,ItemLabel:pf,Portal:mf,RadioGroup:_f,RadioItem:vf,Separator:Pd,Sub:bf,SubContent:Sf,SubTrigger:Tf,Trigger:tf});Ra({},{Arrow:()=>el,CheckboxItem:()=>Qd,Content:()=>kf,ContextMenu:()=>Ff,Group:()=>sf,GroupLabel:()=>cf,Icon:()=>lf,Item:()=>uf,ItemDescription:()=>df,ItemIndicator:()=>ff,ItemLabel:()=>pf,Portal:()=>mf,RadioGroup:()=>_f,RadioItem:()=>vf,Root:()=>Nf,Separator:()=>Pd,Sub:()=>bf,SubContent:()=>Sf,SubTrigger:()=>Tf,Trigger:()=>Pf,useContextMenuContext:()=>Mf});function kf(e){let t=Gd(),[n,r]=B(e,[`onCloseAutoFocus`,`onInteractOutside`]),i=!1;return R(rf,z({onCloseAutoFocus:e=>{n.onCloseAutoFocus?.(e),!e.defaultPrevented&&i&&e.preventDefault(),i=!1},onInteractOutside:e=>{n.onInteractOutside?.(e),!e.defaultPrevented&&!t.isModal()&&(i=!0)}},r))}var Af=I();function jf(){return L(Af)}function Mf(){let e=jf();if(e===void 0)throw Error("[kobalte]: `useContextMenuContext` must be used within a `ContextMenu` component");return e}function Nf(e){let t=`contextmenu-${We()}`,{direction:n}=Xo(),[r,i]=B(Z({id:t,placement:n()===`rtl`?`left-start`:`right-start`,gutter:2,shift:2},e),[`onOpenChange`]),[a,o]=A({x:0,y:0}),s=Pa({defaultOpen:!1,onOpenChange:e=>r.onOpenChange?.(e)}),c={setAnchorRect:o};return R(Af.Provider,{value:c,get children(){return R(yf,z({get open(){return s.isOpen()},get onOpenChange(){return s.setIsOpen},getAnchorRect:a},i))}})}function Pf(e){let t=Gd(),n=Ud(),r=Mf(),[i,a]=B(Z({id:t.generateId(`trigger`)},e),[`ref`,`style`,`disabled`,`onContextMenu`,`onPointerDown`,`onPointerMove`,`onPointerCancel`,`onPointerUp`]),o=0,s=()=>{window.clearTimeout(o)};P(()=>{s()});let c=e=>{X(e,i.onContextMenu),!i.disabled&&(e.defaultPrevented||(s(),e.preventDefault(),e.stopPropagation(),r.setAnchorRect({x:e.clientX,y:e.clientY}),n.isOpen()?n.focusContent():n.open(!0)))},l=e=>e.pointerType===`touch`||e.pointerType===`pen`;return R(Da,z({as:`div`,ref(e){var t=Xr(n.setTriggerRef,i.ref);typeof t==`function`&&t(e)},get style(){return Yr({"-webkit-touch-callout":`none`},i.style)},get"data-disabled"(){return i.disabled?``:void 0},onContextMenu:c,onPointerDown:e=>{X(e,i.onPointerDown),!i.disabled&&l(e)&&(s(),r.setAnchorRect({x:e.clientX,y:e.clientY}),o=window.setTimeout(()=>n.open(!1),700))},onPointerMove:e=>{X(e,i.onPointerMove),!i.disabled&&l(e)&&s()},onPointerCancel:e=>{X(e,i.onPointerCancel),!i.disabled&&l(e)&&s()},onPointerUp:e=>{X(e,i.onPointerUp),!i.disabled&&l(e)&&s()}},()=>n.dataset(),a))}var Ff=Object.assign(Nf,{Arrow:el,CheckboxItem:Qd,Content:kf,Group:sf,GroupLabel:cf,Icon:lf,Item:uf,ItemDescription:df,ItemIndicator:ff,ItemLabel:pf,Portal:mf,RadioGroup:_f,RadioItem:vf,Separator:Pd,Sub:bf,SubContent:Sf,SubTrigger:Tf,Trigger:Pf}),If=W(`<svg data-slot=menu-v2-item-chevron width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg aria-hidden=true><path d="M6 4L10 8L6 12V4Z"fill=currentColor>`),Lf=W(`<svg width=14 height=14 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg aria-hidden=true><path d="M3.53564 8.17857L6.39279 11.75L12.4642 4.25"stroke=currentColor stroke-width=1 stroke-linecap=round stroke-linejoin=round>`),Rf=W(`<span data-slot=menu-v2-item-content>`),zf=W(`<span data-slot=menu-v2-item-shortcut>`),Bf=W(`<span data-slot=menu-v2-item-badge>`),Vf=()=>If(),Hf=()=>Lf(),Uf=I({appearance:()=>`compact`});function Wf(){let e=L(Uf);if(!e)throw Error(`Menu components must be used inside Menu or Menu.Context`);return e}function Gf(e){return[(()=>{var t=Rf();return K(t,()=>e.children),t})(),R(H,{get when(){return e.shortcut},children:e=>(()=>{var t=zf();return K(t,e),t})()}),R(H,{get when(){return e.badge},children:e=>(()=>{var t=Bf();return K(t,e),t})()}),U(()=>e.trailing)]}function Kf(e){let t=Wf(),[n,r]=B(e,[`class`,`classList`,`children`,`shortcut`,`badge`]);return R(Of.Item,z(r,{"data-component":`menu-v2-item`,get"data-appearance"(){return t.appearance()},get classList(){return{...n.classList,[n.class??``]:!!n.class}},get children(){return R(Gf,{get shortcut(){return n.shortcut},get badge(){return n.badge},get children(){return n.children}})}}))}function qf(e){let t=Wf(),[n,r]=B(e,[`class`,`classList`,`children`,`shortcut`,`badge`]);return R(Of.CheckboxItem,z(r,{"data-component":`menu-v2-item`,get"data-appearance"(){return t.appearance()},get classList(){return{...n.classList,[n.class??``]:!!n.class}},get children(){return R(Gf,{get shortcut(){return n.shortcut},get badge(){return n.badge},get trailing(){return R(Of.ItemIndicator,{"data-slot":`menu-v2-item-indicator`,forceMount:!0,get children(){return R(Hf,{})}})},get children(){return n.children}})}}))}function Jf(e){let t=Wf(),[n,r]=B(e,[`class`,`classList`,`children`,`shortcut`,`badge`]);return R(Of.RadioItem,z(r,{"data-component":`menu-v2-item`,get"data-appearance"(){return t.appearance()},get classList(){return{...n.classList,[n.class??``]:!!n.class}},get children(){return R(Gf,{get shortcut(){return n.shortcut},get badge(){return n.badge},get trailing(){return R(Of.ItemIndicator,{"data-slot":`menu-v2-item-indicator`,forceMount:!0,get children(){return R(Hf,{})}})},get children(){return n.children}})}}))}function Yf(e){let t=Wf(),[n,r]=B(e,[`class`,`classList`,`children`,`shortcut`,`badge`]);return R(Of.SubTrigger,z(r,{"data-component":`menu-v2-item`,get"data-appearance"(){return t.appearance()},get classList(){return{...n.classList,[n.class??``]:!!n.class}},get children(){return R(Gf,{get shortcut(){return n.shortcut},get badge(){return n.badge},get trailing(){return R(Vf,{})},get children(){return n.children}})}}))}function Xf(e){let t=Wf(),[n,r]=B(e,[`class`,`classList`]);return R(Of.SubContent,z(r,{"data-component":`menu-v2-content`,get"data-appearance"(){return t.appearance()},get classList(){return{...n.classList,[n.class??``]:!!n.class}}}))}function Zf(e){let t=Wf(),[n,r]=B(e,[`class`,`classList`]);return R(Of.GroupLabel,z(r,{"data-slot":`menu-v2-group-label`,get"data-appearance"(){return t.appearance()},get classList(){return{...n.classList,[n.class??``]:!!n.class}}}))}function Qf(e){let t=Wf(),[n,r]=B(e,[`class`,`classList`]);return R(Of.Separator,z(r,{"data-slot":`menu-v2-separator`,get"data-appearance"(){return t.appearance()},get classList(){return{...n.classList,[n.class??``]:!!n.class}}}))}function $f(e){let t=Wf(),[n,r]=B(e,[`class`,`classList`]);return R(Of.Content,z(r,{"data-component":`menu-v2-content`,get"data-appearance"(){return t.appearance()},get classList(){return{...n.classList,[n.class??``]:!!n.class}}}))}function ep(e){let[t,n]=B(e,[`appearance`,`children`]);return R(Uf.Provider,{value:{appearance:()=>t.appearance??`compact`},get children(){return R(Of,z(n,{get children(){return t.children}}))}})}function tp(e){let[t,n]=B(e,[`appearance`,`children`]);return R(Uf.Provider,{value:{appearance:()=>t.appearance??`compact`},get children(){return R(Ff,z(n,{get children(){return t.children}}))}})}function np(e){let t=Wf(),[n,r]=B(e,[`class`,`classList`]);return R(Ff.Content,z(r,{"data-component":`menu-v2-content`,get"data-appearance"(){return t.appearance()},get classList(){return{...n.classList,[n.class??``]:!!n.class}}}))}var rp=Object.assign(tp,{Trigger:Ff.Trigger,Portal:Ff.Portal,Content:np}),ip=Object.assign(ep,{Trigger:Of.Trigger,Portal:Of.Portal,Content:$f,Item:Kf,CheckboxItem:qf,RadioGroup:Of.RadioGroup,RadioItem:Jf,Group:Of.Group,GroupLabel:Zf,Separator:Qf,Sub:Of.Sub,SubTrigger:Yf,SubContent:Xf,Context:rp}),ap=`/assets/sprite-B9ixRF_T.svg`,op=`zhipuai.zhipuai-coding-plan.zenmux.zai.zai-coding-plan.xiaomi.xai.wandb.vultr.vivgrid.vercel.venice.v0.upstage.togetherai.synthetic.submodel.stepfun.stackit.siliconflow.siliconflow-cn.scaleway.sap-ai-core.requesty.qiniu-ai.qihang-ai.privatemode-ai.poe.perplexity.ovhcloud.openrouter.llmgateway.opencode.opencode-go.openai.ollama-cloud.nvidia.novita-ai.nova.nebius.nano-gpt.morph.moonshotai.moonshotai-cn.modelscope.moark.mistral.minimax.minimax-coding-plan.minimax-cn.minimax-cn-coding-plan.meganova.lucidquery.lmstudio.llama.kuae-cloud-coding-plan.kimi-for-coding.kilo.jiekou.io-net.inference.inception.iflowcn.huggingface.helicone.groq.google.google-vertex.google-vertex-anthropic.gitlab.github-models.github-copilot.friendli.firmware.fireworks-ai.fastrouter.evroc.digitalocean.deepseek.deepinfra.cortecs.cohere.cloudflare-workers-ai.cloudflare-ai-gateway.cloudferro-sherlock.chutes.cerebras.berget.baseten.bailing.azure.azure-cognitive-services.anthropic.amazon-bedrock.alibaba.alibaba-cn.aihubmix.abacus.302ai`.split(`.`),sp=W(`<svg data-component=provider-icon><use>`),cp=e=>{let[t,n]=B(e,[`id`,`class`,`classList`]),r=N(()=>op.includes(t.id)?t.id:`synthetic`);return(()=>{var e=sp(),i=e.firstChild;return gt(e,z(n,{get classList(){return{...t.classList,[t.class??``]:!!t.class}}}),!0,!0),j(()=>G(i,`href`,`${ap}#${r()}`)),e})()};function lp(e){let t=e.filter(e=>Number.isFinite(e.start)&&(e.end===void 0||Number.isFinite(e.end)&&e.end>=e.start)).map(e=>({...e})).sort((e,t)=>e.start-t.start),n=[];for(let e of t){let t=n.at(-1);!t||e.start>(t.end??1/0)?n.push(e):t.end=t.end===void 0||e.end===void 0?void 0:Math.max(t.end,e.end)}return n}var up=(e,t)=>lp(e).reduce((e,n)=>e+Math.max(0,Math.min(n.end??t,t)-n.start),0),dp=e=>{let t=e===void 0?NaN:Date.parse(e);return Number.isFinite(t)?t:void 0};function fp(e,t,n=!0){let r=typeof t==`number`?Number.isFinite(t)?t:void 0:dp(t);return r!==void 0&&(!n||e-r>3e4)?Math.min(e,r):e}var pp=e=>e.trim().toLowerCase(),mp=(e,t)=>!!e.categories?.some(e=>t.includes(pp(e)));function hp(e,t,n=[...new Set(t.map(e=>e.eval))],r=[]){let i=[...new Set(n)],a=i.filter(e=>r.includes(e)||!t.some(t=>t.eval===e)),o=t.length&&!a.length&&t.every(e=>e.value!==null)?i.reduce((e,n)=>{let r=t.filter(e=>e.eval===n);return e+r.reduce((e,t)=>e+t.value,0)/r.length},0):null,s=o===null?null:100*o/i.length;return{model:e,components:t,unscoredEvals:a,earned:o,maximum:i.length,percentage:s,bounds:s===null?vp(t,i,a):{lower:s,upper:s,coverage:100}}}var gp=e=>e.bounds;function _p(e,t){let n=e.components.filter(e=>mp(e,t)),r=[...new Set(n.map(e=>e.eval))];return hp(e.model,n,r,e.unscoredEvals.filter(e=>r.includes(e)))}function vp(e,t,n){if(!t.length)return{lower:0,upper:100,coverage:0};let r=0,i=n.length,a=0;for(let t of e){if(n.includes(t.eval))continue;let o=1/e.filter(e=>e.eval===t.eval).length;if(!t.expected){i+=o;continue}r+=o*t.scoredSum/t.expected,i+=o*(t.scoredSum+t.expected-t.scored)/t.expected,a+=o*t.scored/t.expected}let o=100/t.length;return{lower:r*o,upper:i*o,coverage:a*o}}var yp=e=>{let t=e.reduce((e,t)=>e+(t?.reportedUSD??0),0),n=e.every(e=>e?.complete===!0);return{reportedUSD:t,complete:n,usd:n?t:null}},bp=(e,t)=>up(e.runtime,t),[xp,Sp]=A({}),Cp=e=>Sp(e??{}),wp=e=>e.slice(e.indexOf(`/`)+1).split(`#`)[0].replace(/^omen-alpha$/i,`Omen Alpha`).replace(/^big-pickle$/i,`Big Pickle`).replace(/^gpt-/i,`GPT-`).replace(/^gemini-/,`Gemini `).replace(/^grok-/,`Grok `).replace(/^deepseek-v(\d+)-pro-(\d+)$/,`DeepSeek V$1 Pro $2`).replace(/^deepseek-v(\d+(?:\.\d+)?)-flash(?:-expires-on-\d+)?$/,`DeepSeek V$1 Flash`).replace(/^glm-/,`GLM-`).replace(/^muse-spark-/,`Muse Spark `).replace(/^claude-fable-(\d+)-(\d+)$/,`Claude Fable $1.$2`).replace(/-astra$/,` Astra`).replace(/-luna$/,` Luna`).replace(/-pro-preview$/,` Pro Preview`).replace(/-flash$/,` Flash`),Tp=e=>xp()[e.split(`#`)[0]]??wp(e),Ep=e=>/deepseek/.test(e)?`deepseek`:/glm/.test(e)?`zai`:/grok/.test(e)?`xai`:/gpt|o[134]-/.test(e)?`openai`:/gemini/.test(e)?`google`:/claude/.test(e)?`anthropic`:/muse|llama/.test(e)?`llama`:e.split(`/`)[0],Dp=e=>e.split(`#`)[1]??`default`,Op=e=>{let t=e.slice(e.indexOf(`/`)+1).split(`#`)[0].toLowerCase(),n=[[/^big-pickle$/,`OpenCode Zen`,`Big Pickle`],[/^omen-/,`OpenCode Go`,`Omen`],[/^gemini-/,`Google`,`Gemini`],[/^gpt-/,`OpenAI`,`GPT`],[/^o\d(?:-|$)/,`OpenAI`,`o-series`],[/^claude-/,`Anthropic`,`Claude`],[/^muse-/,`Meta`,`Muse`],[/^llama-/,`Meta`,`Llama`],[/^deepseek-/,`DeepSeek`,`DeepSeek`],[/^glm-/,`Z.ai`,`GLM`],[/^grok-/,`xAI`,`Grok`],[/^qwen/,`Alibaba`,`Qwen`],[/^kimi/,`Moonshot AI`,`Kimi`],[/^(?:mistral|devstral|codestral|magistral)/,`Mistral AI`,`Mistral`],[/^minimax/,`MiniMax`,`MiniMax`]].find(([e])=>e.test(t));return{lab:n?.[1]??e.split(`/`)[0],family:n?.[2]??t.split(`-`)[0]}},kp=(e,t)=>{if(!t.length)return!0;let n=Op(e);return t.includes(`lab:${n.lab}`)||t.includes(`family:${n.family}`)},Ap=e=>e===null?`—`:Number(e.toFixed(2)).toString(),jp=e=>e===null?`Pending`:`${Ap(e)}%`,Mp=e=>e==null?`—`:new Intl.NumberFormat(`en-US`,{style:`currency`,currency:`USD`,minimumFractionDigits:2,maximumFractionDigits:4}).format(e),Np=e=>new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),Pp=e=>{let t=Math.round(e/1e3);return t<60?`${(e/1e3).toFixed(1)}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:`${Math.floor(t/3600)}h ${Math.floor(t/60)%60}m ${t%60}s`},Fp=e=>({waiting:`Waiting`,watching:`Watching evidence`,stopped:`Stopped early`,blocked:`Blocked`,timed_out:`Timed out`,queued:`Queued`,in_progress:`In progress`,completed:`Completed`,failed:`Failed`,cancelled:`Cancelled`,interrupted:`Interrupted`})[e]??e,Ip=W(`<div class=criterion-legend><span></span><ol aria-label="Criteria in bar order">`),Lp=W(`<div class=score-chart role=group aria-label="Model scores from zero to one hundred percent"><div class=chart-scale><span>Model</span><div></div><span>Score`),Rp=W(`<span class=category-chips>`),zp=W(`<li>`),Bp=W(`<span class=category-chip>`),Vp=W(`<span>%`),Hp=W(`<div class=chart-range>`),Up=W(`<span class=chart-points>`),Wp=W(`<div class=chart-model><button class=chart-row><div class=model-identity><span class=provider-mark></span><div><strong></strong><small></small></div></div><div class=chart-track aria-hidden=true><div class=chart-grid></div><div class=chart-bar></div></div><div class=chart-score><span>`),Gp=W(`<i>`),Kp=W(`<button class="chart-row criterion-row"><div class=chart-track aria-hidden=true><div class=chart-bar></div></div><span class=criterion-score>`);function qp(e){let t=N(()=>e.criteria?e.scores[0]?.components??[]:[]),n=()=>[...e.scores].sort((e,t)=>gp(t).lower-gp(e).lower),r=e=>{let t=e.components.reduce((e,t)=>e+t.expected,0),n=e.components.reduce((e,t)=>e+t.scored,0);return t?new Set(e.components.map(e=>e.eval)).size>1?`${n}/${t} checks scored`:n===t&&e.components.every(e=>e.passed!==void 0)?`${e.components.reduce((e,t)=>e+t.passed,0)}/${t} passed`:`${e.components.every(e=>e.passed!==void 0)?`${e.components.reduce((e,t)=>e+t.passed,0)} passed · `:``}${n}/${t} scored`:``},i=e=>{let t=gp(e);return t.upper-t.lower>1e-6?`${Ap(t.lower)}–${jp(t.upper)}`:jp(t.lower)};return(()=>{var a=Lp(),o=a.firstChild,s=o.firstChild.nextSibling;return K(a,R(H,{get when(){return t().length},get children(){var e=Ip(),n=e.firstChild,r=n.nextSibling;return K(n,()=>t().length>1?`Criteria · top to bottom`:`Criterion`),K(r,R(V,{get each(){return t()},children:e=>(()=>{var t=zp();return K(t,()=>e.name??e.criterion,null),K(t,R(H,{get when(){return e.categories?.length},get children(){var t=Rp();return K(t,R(V,{get each(){return e.categories},children:e=>(()=>{var t=Bp();return K(t,e),t})()})),t}}),null),t})()})),e}}),o),K(s,R(V,{each:[0,25,50,75,100],children:e=>(()=>{var t=Vp(),n=t.firstChild;return K(t,e,n),t})()})),K(a,R(V,{get each(){return n()},children:t=>(()=>{var n=Wp(),a=n.firstChild,o=a.firstChild,s=o.firstChild,c=s.nextSibling.firstChild,l=c.nextSibling,u=o.nextSibling,d=u.firstChild,f=d.nextSibling,p=u.nextSibling,m=p.firstChild;return a.$$click=()=>e.onSelect?.(t.model),K(s,R(cp,{get id(){return Ep(t.model)}})),K(c,()=>Tp(t.model)),K(l,()=>Dp(t.model)),K(d,R(V,{each:[0,25,50,75,100],children:e=>(()=>{var t=Gp();return ht(t,`left`,`${e}%`),t})()})),K(u,R(H,{get when(){return gp(t).upper>gp(t).lower+1e-6},get children(){var e=Hp();return j(n=>{var r=`${gp(t).lower}%`,i=`${gp(t).upper-gp(t).lower}%`;return r!==n.e&&ht(e,`left`,n.e=r),i!==n.t&&ht(e,`width`,n.t=i),n},{e:void 0,t:void 0}),e}}),null),K(u,R(H,{get when(){return!e.public},get children(){var e=Up();return K(e,()=>r(t)),e}}),null),K(m,()=>i(t)),K(p,R(H,{get when(){return e.onSelect},get children(){return R(Fo,{name:`chevron-right`})}}),null),K(n,R(H,{get when(){return U(()=>!!e.criteria)()&&t.components.length>1},get children(){return R(V,{get each(){return t.components},children:(n,a)=>{let o=()=>hp(t.model,[n]),s=()=>`${a()+1}. ${n.name??n.criterion}: ${i(o())}${e.public?``:`, ${r(o())}`}`;return(()=>{var n=Kp(),r=n.firstChild,a=r.firstChild,c=r.nextSibling;return n.$$click=()=>e.onSelect?.(t.model),K(r,R(H,{get when(){return gp(o()).upper>gp(o()).lower+1e-6},get children(){var e=Hp();return j(t=>{var n=`${gp(o()).lower}%`,r=`${gp(o()).upper-gp(o()).lower}%`;return n!==t.e&&ht(e,`left`,t.e=n),r!==t.t&&ht(e,`width`,t.t=r),t},{e:void 0,t:void 0}),e}}),null),K(c,()=>i(o())),j(r=>{var i=!e.onSelect,c=`${Tp(t.model)}, ${s()}`,l=s(),u=`${gp(o()).lower}%`;return i!==r.e&&(n.disabled=r.e=i),c!==r.t&&G(n,`aria-label`,r.t=c),l!==r.a&&G(n,`title`,r.a=l),u!==r.o&&ht(a,`width`,r.o=u),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()}})}}),null),j(n=>{var o=`chart:${t.model}`,s=!!e.onSelect,c=!e.onSelect,l=`${Tp(t.model)}, ${i(t)}${e.public?``:`, ${r(t)}`}${e.onSelect?`, inspect eval run`:``}`,u=`Earned ${jp(gp(t).lower)}. Possible final score ${i(t)}.`,d=`${gp(t).lower}%`,m=t.percentage===null;return o!==n.e&&G(a,`data-run-key`,n.e=o),s!==n.t&&a.classList.toggle(`inspectable`,n.t=s),c!==n.a&&(a.disabled=n.a=c),l!==n.o&&G(a,`aria-label`,n.o=l),u!==n.i&&G(a,`title`,n.i=u),d!==n.n&&ht(f,`width`,n.n=d),m!==n.s&&p.classList.toggle(`range`,n.s=m),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),n})()}),null),a})()}ct([`click`]);var Jp=hn({name:`FileComponent`,init:e=>e.component}),Yp=Jp.provider,Xp=Jp.use;function Zp(e){if(!e)return;let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Qp(e,t=5e5){if(!e)return;if(e.length<=t)return Zp(e);let n=4096;return`${e.length}:${[0,Math.floor(e.length*.25),Math.floor(e.length*.5),Math.floor(e.length*.75),e.length-n].map(t=>{let r=Math.max(0,Math.min(e.length-n,t-2048));return Zp(e.slice(r,r+n))??``}).join(`:`)}`}var $p=`diffs-container`,em=/(?=^From [a-f0-9]+ .+$)/m,tm=/(?=^diff --git)/gm,nm=/(?<=\n)/,rm=/^(---|\+\+\+)\s+([^\t\r\n]+)/,im=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,am=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,om=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,sm=`header-prefix`,cm=`header-metadata`,lm=`header-custom`,um={dark:`pierre-dark`,light:`pierre-light`},dm=`data-theme-css`,fm=`data-unsafe-css`,pm=`data-diffs-scrollbar-measure`,mm=`--diffs-scrollbar-gutter-measured`,hm=1e5,gm={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...gm});var _m=Object.freeze({fromStart:0,fromEnd:0}),vm={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},ym={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},bm=new Set,xm=null;function Sm(e){bm.add(e),xm??=requestAnimationFrame(Cm)}function Cm(e){let t=new Set(bm);bm.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}xm=bm.size>0?requestAnimationFrame(Cm):null}function wm(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function Tm(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Em(e,t){let n=e?.theme??um,r=t?.theme??um,i=Dm(e),a=Dm(t);return Tm(n,r)&&wm(e,t,[`theme`,`parseDiffOptions`])&&wm(i,a)}function Dm(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function Om(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function km({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function Am(e){return{type:`text`,value:e}}function jm({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function Mm({name:e,width:t=16,height:n=16,properties:r}){return jm({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[jm({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function Nm(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function Pm(e){return jm({tagName:`div`,properties:{"data-gutter":``},children:e})}function Fm(e,t,n,r={}){return jm({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[jm({tagName:`span`,properties:{"data-line-number-content":``},children:[Am(`${t}`)]})]})}function Im(e,t,n){return jm({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Lm(){return jm({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[Mm({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function Rm(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}var zm=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],Bm=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Bm.prototype.normal={},Bm.prototype.property={},Bm.prototype.space=void 0;function Vm(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Bm(n,r,t)}function Hm(e){return e.toLowerCase()}var Um=class{constructor(e,t){this.attribute=t,this.property=e}};Um.prototype.attribute=``,Um.prototype.booleanish=!1,Um.prototype.boolean=!1,Um.prototype.commaOrSpaceSeparated=!1,Um.prototype.commaSeparated=!1,Um.prototype.defined=!1,Um.prototype.mustUseProperty=!1,Um.prototype.number=!1,Um.prototype.overloadedBoolean=!1,Um.prototype.property=``,Um.prototype.spaceSeparated=!1,Um.prototype.space=void 0;var Wm=s({boolean:()=>Km,booleanish:()=>qm,commaOrSpaceSeparated:()=>Zm,commaSeparated:()=>Xm,number:()=>Q,overloadedBoolean:()=>Jm,spaceSeparated:()=>Ym}),Gm=0,Km=Qm(),qm=Qm(),Jm=Qm(),Q=Qm(),Ym=Qm(),Xm=Qm(),Zm=Qm();function Qm(){return 2**++Gm}var $m=Object.keys(Wm),eh=class extends Um{constructor(e,t,n,r){let i=-1;if(super(e,t),th(this,`space`,r),typeof n==`number`)for(;++i<$m.length;){let e=$m[i];th(this,$m[i],(n&Wm[e])===Wm[e])}}};eh.prototype.defined=!0;function th(e,t,n){n&&(e[t]=n)}function nh(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new eh(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Hm(r)]=r,n[Hm(a.attribute)]=r}return new Bm(t,n,e.space)}var rh=nh({properties:{ariaActiveDescendant:null,ariaAtomic:qm,ariaAutoComplete:null,ariaBusy:qm,ariaChecked:qm,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:Ym,ariaCurrent:null,ariaDescribedBy:Ym,ariaDetails:null,ariaDisabled:qm,ariaDropEffect:Ym,ariaErrorMessage:null,ariaExpanded:qm,ariaFlowTo:Ym,ariaGrabbed:qm,ariaHasPopup:null,ariaHidden:qm,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ym,ariaLevel:Q,ariaLive:null,ariaModal:qm,ariaMultiLine:qm,ariaMultiSelectable:qm,ariaOrientation:null,ariaOwns:Ym,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:qm,ariaReadOnly:qm,ariaRelevant:null,ariaRequired:qm,ariaRoleDescription:Ym,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:qm,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ih(e,t){return t in e?e[t]:t}function ah(e,t){return ih(e,t.toLowerCase())}var oh=nh({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Xm,acceptCharset:Ym,accessKey:Ym,action:null,allow:null,allowFullScreen:Km,allowPaymentRequest:Km,allowUserMedia:Km,alpha:Km,alt:null,as:null,async:Km,autoCapitalize:null,autoComplete:Ym,autoFocus:Km,autoPlay:Km,blocking:Ym,capture:null,charSet:null,checked:Km,cite:null,className:Ym,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:qm,controls:Km,controlsList:Ym,coords:Q|Xm,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Km,defer:Km,dir:null,dirName:null,disabled:Km,download:Jm,draggable:qm,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Km,formTarget:null,headers:Ym,height:Q,hidden:Jm,high:Q,href:null,hrefLang:null,htmlFor:Ym,httpEquiv:Ym,id:null,imageSizes:null,imageSrcSet:null,inert:Km,inputMode:null,integrity:null,is:null,isMap:Km,itemId:null,itemProp:Ym,itemRef:Ym,itemScope:Km,itemType:Ym,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Km,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Km,muted:Km,name:null,nonce:null,noModule:Km,noValidate:Km,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Km,optimum:Q,pattern:null,ping:Ym,placeholder:null,playsInline:Km,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Km,referrerPolicy:null,rel:Ym,required:Km,reversed:Km,rows:Q,rowSpan:Q,sandbox:Ym,scope:null,scoped:Km,seamless:Km,selected:Km,shadowRootClonable:Km,shadowRootCustomElementRegistry:Km,shadowRootDelegatesFocus:Km,shadowRootMode:null,shadowRootSerializable:Km,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:qm,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Km,useMap:null,value:qm,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ym,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Km,declare:Km,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Km,noHref:Km,noShade:Km,noWrap:Km,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:qm,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Km,disablePictureInPicture:Km,disableRemotePlayback:Km,exportParts:Xm,part:Ym,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:ah}),sh=nh({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Zm,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:Ym,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Km,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Xm,g2:Xm,glyphName:Xm,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:Zm,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ym,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Zm,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Zm,rev:Zm,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Zm,requiredFeatures:Zm,requiredFonts:Zm,requiredFormats:Zm,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:Zm,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Zm,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Zm,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ih}),ch=nh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),lh=nh({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ah}),uh=nh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),dh=/[A-Z]/g,fh=/-[a-z]/g,ph=/^data[-\w.:]+$/i;function mh(e,t){let n=Hm(t),r=t,i=Um;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ph.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(fh,gh);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!fh.test(e)){let n=e.replace(dh,hh);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=eh}return new i(r,t)}function hh(e){return`-`+e.toLowerCase()}function gh(e){return e.charAt(1).toUpperCase()}var _h=Vm([rh,oh,ch,lh,uh],`html`),vh=Vm([rh,sh,ch,lh,uh],`svg`),yh={}.hasOwnProperty;function bh(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&yh.call(t,e)){let n=String(t[e]);i=yh.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var xh=/["&'<>`]/g,Sh=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ch=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,wh=/[|\\{}()[\]^$+*?.]/g,Th=new WeakMap;function Eh(e,t){if(e=e.replace(t.subset?Dh(t.subset):xh,r),t.subset||t.escapeOnly)return e;return e.replace(Sh,n).replace(Ch,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Dh(e){let t=Th.get(e);return t||(t=Oh(e),Th.set(e,t)),t}function Oh(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(wh,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var kh=/[\dA-Fa-f]/;function Ah(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!kh.test(String.fromCharCode(t))?r:r+`;`}var jh=/\d/;function Mh(e,t,n){let r=`&#`+String(e);return n&&t&&!jh.test(String.fromCharCode(t))?r:r+`;`}var Nh=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Ph={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:``,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},Fh=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Ih={}.hasOwnProperty,Lh={},Rh;for(Rh in Ph)Ih.call(Ph,Rh)&&(Lh[Ph[Rh]]=Rh);var zh=/[^\dA-Za-z]/;function Bh(e,t,n,r){let i=String.fromCharCode(e);if(Ih.call(Lh,i)){let e=Lh[i],a=`&`+e;return n&&Nh.includes(e)&&!Fh.includes(e)&&(!r||t&&t!==61&&zh.test(String.fromCharCode(t)))?a:a+`;`}return``}function Vh(e,t,n){let r=Ah(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Bh(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Mh(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Hh(e,t){return Eh(e,Object.assign({format:Vh},t))}var Uh=/^>|^->|<!--|-->|--!>|<!-$/g,Wh=[`>`],Gh=[`<`,`>`];function Kh(e,t,n,r){return r.settings.bogusComments?`<?`+Hh(e.value,Object.assign({},r.settings.characterReferences,{subset:Wh}))+`>`:`<!--`+e.value.replace(Uh,i)+`-->`;function i(e){return Hh(e,Object.assign({},r.settings.characterReferences,{subset:Gh}))}}function qh(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function Jh(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Yh(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function Xh(e){return e.join(` `).trim()}var Zh=/[ \t\n\f\r]/g;function Qh(e){return typeof e==`object`?e.type===`text`&&$h(e.value):$h(e)}function $h(e){return e.replace(Zh,``)===``}var eg=rg(1),tg=rg(-1),ng=[];function rg(e){return t;function t(t,n,r){let i=t?t.children:ng,a=(n||0)+e,o=i[a];if(!r)for(;o&&Qh(o);)a+=e,o=i[a];return o}}var ig={}.hasOwnProperty;function ag(e){return t;function t(t,n,r){return ig.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var og=ag({body:lg,caption:sg,colgroup:sg,dd:pg,dt:fg,head:sg,html:cg,li:dg,optgroup:hg,option:gg,p:ug,rp:mg,rt:mg,tbody:vg,td:xg,tfoot:yg,th:xg,thead:_g,tr:bg});function sg(e,t,n){let r=eg(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&Qh(r.value.charAt(0)))}function cg(e,t,n){let r=eg(n,t);return!r||r.type!==`comment`}function lg(e,t,n){let r=eg(n,t);return!r||r.type!==`comment`}function ug(e,t,n){let r=eg(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function dg(e,t,n){let r=eg(n,t);return!r||r.type===`element`&&r.tagName===`li`}function fg(e,t,n){let r=eg(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function pg(e,t,n){let r=eg(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function mg(e,t,n){let r=eg(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function hg(e,t,n){let r=eg(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function gg(e,t,n){let r=eg(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function _g(e,t,n){let r=eg(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function vg(e,t,n){let r=eg(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function yg(e,t,n){return!eg(n,t)}function bg(e,t,n){let r=eg(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function xg(e,t,n){let r=eg(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Sg=ag({body:Tg,colgroup:Eg,head:wg,html:Cg,tbody:Dg});function Cg(e){let t=eg(e,-1);return!t||t.type!==`comment`}function wg(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Tg(e){let t=eg(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&Qh(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Eg(e,t,n){let r=tg(n,t),i=eg(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&og(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Dg(e,t,n){let r=tg(n,t),i=eg(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&og(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Og={name:[[`
|
|
17
|
+
\f\r &/=>`.split(``),`
|
|
18
|
+
\f\r "&'/=>\``.split(``)],[`\0
|
|
19
|
+
\f\r "&'/<=>`.split(``),`\0
|
|
20
|
+
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
|
|
21
|
+
\f\r &>`.split(``),`\0
|
|
22
|
+
\f\r "&'<=>\``.split(``)],[`\0
|
|
23
|
+
\f\r "&'<=>\``.split(``),`\0
|
|
24
|
+
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function kg(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=vh);let l=Ag(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Sg(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!og(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Ag(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=jg(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function jg(e,t,n){let r=mh(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=Hh(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Og.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Yh:Xh)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Hh(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Og.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Jh(n,o)>Jh(n,e.alternative)&&(o=e.alternative),s=o+Hh(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Og.single:Og.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Mg=[`<`,`&`];function Ng(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Hh(e.value,Object.assign({},r.settings.characterReferences,{subset:Mg}))}function Pg(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Ng(e,t,n,r)}function Fg(e,t,n,r){return r.all(e)}var Ig=bh(`type`,{invalid:Lg,unknown:Rg,handlers:{comment:Kh,doctype:qh,element:kg,raw:Pg,root:Fg,text:Ng}});function Lg(e){throw Error("Expected node, not `"+e+"`")}function Rg(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var zg={},Bg={},Vg=[];function Hg(e,t){let n=t||zg,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Ug,all:Wg,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||zm,characterReferences:n.characterReferences||Bg,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?vh:_h,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Ug(e,t,n){return Ig(e,t,n,this)}function Wg(e){let t=[],n=e&&e.children||Vg,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var Gg=class{hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){let n=!(e===this.selectedRange||Om(e??void 0,this.selectedRange??void 0));(this.isSelectionDirty()||n)&&(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&c_(e.composedPath())||(l_(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;(t!==`disabled`||o||n!=null||r!=null||i!=null||a!=null)&&(l_(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(l_(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){l_(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();l_(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);l_(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=Xg(i)&&this.hoveredLine?.lineElement===i.lineElement;Yg(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),Yg(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Xg(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(Qg(i)&&p!=null){p(i);break}if(Zg(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!Xg(i))break;Yg(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,l_(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),l_(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),l_(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();c_(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;e.preventDefault();let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;let r=this.currentSelectionEnds(),i=r?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),a=r?.top??i;i!=null&&a!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:a,current:i},t&&(this.selectionAnchor={lineNumber:a.lineNumber,side:a.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{let{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let n=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(Rm(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(this.pointerSession.current=r,t&&this.updateSelection(r.lineNumber,r.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=Hg(Lm());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);Jg(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(t_(t));if(Jg(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(Jg(n)&&(!t||n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(Jg(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&c_(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=t_(e);if(t&&c_(n))return;let r=n_(e);return r==null?this.pathFromAnnotationSlot(e):t_(r)}pathFromAnnotationSlot(e){let t=i_(r_(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n==null?void 0:t_(n.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=a_(t)?t:a_(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}Om(r??void 0,i??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;let e=this.pre.querySelectorAll(`[data-selected-line]`);for(let t of e)t.removeAttribute(`data-selected-line`);if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;let{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let n=this.pre.getAttribute(`data-diff-type`)===`split`,r=this.getIndexesFromSelection(this.selectedRange,n);if(r==null)throw console.error({rowRange:r,selectedRange:this.selectedRange}),Error(`InteractionManager.renderSelection: No valid rowRange`);let i=r.start===r.end,a=Math.min(r.start,r.end),o=Math.max(r.start,r.end);for(let e of t){let[t,r]=e.children,s=r.children.length;if(s!==t.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);for(let e=0;e<s;e++){let s=r.children[e],c=t.children[e];if(!(s instanceof HTMLElement)||!(c instanceof HTMLElement))continue;let l=this.parseLineIndex(s,n);if((l??0)>o)break;if(l==null||l<a)continue;let u=i?`single`:l===a?`first`:l===o?`last`:``;s.setAttribute(`data-selected-line`,u),c.setAttribute(`data-selected-line`,u),c.nextSibling instanceof HTMLElement&&s.nextSibling instanceof HTMLElement&&(s.nextSibling.hasAttribute(`data-line-annotation`)||s.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(i?(u=`last`,s.setAttribute(`data-selected-line`,`first`)):l===a?u=``:l===o&&s.setAttribute(`data-selected-line`,``),s.nextSibling.setAttribute(`data-selected-line`,u),c.nextSibling.setAttribute(`data-selected-line`,u))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.getCurrentSelectionRange()??null)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);$g(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=s_(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=s_(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:e_(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:e_(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:o_(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:o_(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Kg({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:qg({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function qg({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function Jg(e){return e!=null&&`kind`in e&&e.kind===`line`}function Yg(e){return e!=null&&`kind`in e&&e.kind===`token`}function Xg(e){return Jg(e)||Yg(e)}function Zg(e){return`type`in e&&e.type===`line-info`}function Qg(e){return`kind`in e&&e.kind===`merge-conflict-action`}function $g(e){return e===`current`||e===`incoming`||e===`both`}function e_(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function t_(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function n_(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function r_(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function i_(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(Number.isFinite(n))return{lineNumber:n,side:t[1]}}function a_(e){return e!=null&&typeof e.elementFromPoint==`function`}function o_(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function s_(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function c_(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}function l_(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var u_=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,t){let n=new Set,r=0,i=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(r===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;r++;let n=i.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let a=e.firstElementChild;a instanceof HTMLElement||(a=null),n==null?(n={type:`code`,codeElement:e,numberElement:a,codeWidth:`auto`,numberWidth:0},this.observedNodes.set(e,n),this.observe(e),a!=null&&(this.observedNodes.set(a,n),this.observe(a))):(this.observedNodes.set(e,n),i.delete(e),n.numberElement===a?n.numberElement==null?n.numberWidth=0:(i.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),i.delete(n.numberElement)),a!=null&&(this.observe(a),i.delete(a),this.observedNodes.set(a,n)),n.numberElement=a,n.numberWidth=0))}if(r>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),r=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^\d+,\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let n=r.get(t);n??(n=[],r.set(t,n)),n.push(e)}for(let[e,t]of r){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[r,a]=t,o=r.firstElementChild,s=a.firstElementChild;if(!(r instanceof HTMLElement)||!(a instanceof HTMLElement)||!(o instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=i.get(o);if(c!=null){this.observedNodes.set(o,c),this.observedNodes.set(s,c),i.delete(o),i.delete(s);continue}let l=o.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:r,child:o,childHeight:l},column2:{container:a,child:s,childHeight:u},currentHeight:`auto`},n.add({child1:o,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of n)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);n.clear()}for(let[e,t]of i)this.unobserve(e),t.type===`code`?p_(t):m_(t);i.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:d_(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:f_(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;if((i||a)&&(t.codeWidth=e,t.numberWidth=r,i&&t.codeElement.style.setProperty(`--diffs-column-width`,`${typeof e==`number`?`${e}px`:`auto`}`),a&&t.codeElement.style.setProperty(`--diffs-column-number-width`,`${r===0?`auto`:`${r}px`}`),i||a&&e!==`auto`)){let n=typeof e==`number`?Math.max(e-r,0):0;t.codeElement.style.setProperty(`--diffs-column-content-width`,`${n>0?`${n}px`:`auto`}`)}}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function d_(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function f_(e){return Math.max(Math.ceil(e),0)}function p_(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`))}function m_(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}var h_=new Map,g_=new Map,__=new Map,v_=new Set;function y_(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!v_.has(t))return!1;return!0}function b_(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(v_.has(n.name))continue;let e=h_.get(n.name);e??(e=n,h_.set(n.name,e)),v_.add(e.name),t.loadLanguageSync(e.data)}}function x_(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var S_=Object.defineProperty,C_=Object.getOwnPropertyDescriptor,w_=Object.getOwnPropertyNames,T_=Object.prototype.hasOwnProperty,E_=(e,t)=>{let n={};for(var r in e)S_(n,r,{get:e[r],enumerable:!0});return t||S_(n,Symbol.toStringTag,{value:`Module`}),n},D_=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=w_(t),a=0,o=i.length,s;a<o;a++)s=i[a],!T_.call(e,s)&&s!==n&&S_(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=C_(t,s))||r.enumerable});return e},O_=(e,t,n)=>(D_(e,t,`default`),n&&D_(n,t,`default`)),k_=[{id:`abap`,name:`ABAP`,import:(()=>Y(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`],import:(()=>Y(()=>import(`./actionscript-3-Cs6JJXT5.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>Y(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`],import:(()=>Y(()=>import(`./ahk-CA9gdOdF.js`),[]))},{id:`ahk2`,name:`AutoHotkey2`,import:(()=>Y(()=>import(`./ahk2-_6rzW9BS.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>Y(()=>import(`./angular-html-DCa1K9Q5.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>Y(()=>import(`./angular-ts-BwOaP4mi.js`),__vite__mapDeps([4,0,1,2,3,5])))},{id:`apache`,name:`Apache Conf`,import:(()=>Y(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>Y(()=>import(`./apex-KFGFyKwG.js`),[]))},{id:`apl`,name:`APL`,import:(()=>Y(()=>import(`./apl-BDVbqe8d.js`),__vite__mapDeps([6,2,3,1,7,8,9])))},{id:`applescript`,name:`AppleScript`,import:(()=>Y(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>Y(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>Y(()=>import(`./asciidoc-SCjQUq34.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>Y(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>Y(()=>import(`./astro-C4AVO9I1.js`),__vite__mapDeps([10,2,3,9,11,12,13])))},{id:`awk`,name:`AWK`,import:(()=>Y(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>Y(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`],import:(()=>Y(()=>import(`./bat-qdxAdBWQ.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>Y(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>Y(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>Y(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>Y(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>Y(()=>import(`./bird2-CYIUgYqB.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>Y(()=>import(`./blade-1K2d7b5P.js`),__vite__mapDeps([14,2,3,1,7,8,9,15,16])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>Y(()=>import(`./bsl-_VjlB9mv.js`),__vite__mapDeps([17,18])))},{id:`c`,name:`C`,import:(()=>Y(()=>import(`./c-CrFxx71c.js`).then(e=>e.n),[]))},{id:`c3`,name:`C3`,import:(()=>Y(()=>import(`./c3-D0apG41V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>Y(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>Y(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([19,20])))},{id:`chapel`,name:`Chapel`,aliases:[`chpl`],import:(()=>Y(()=>import(`./chapel-CaV_aD0h.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>Y(()=>import(`./clarity-CtfBBspg.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>Y(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>Y(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>Y(()=>import(`./cobol-Dfqw6e9L.js`),__vite__mapDeps([23,1,2,3,8])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>Y(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>Y(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>Y(()=>import(`./coffee-B0VyEiZ_.js`),__vite__mapDeps([24,2])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>Y(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Rocq`,import:(()=>Y(()=>import(`./coq-DuBRPxYg.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>Y(()=>import(`./cpp-DtAnLTpm.js`).then(e=>e.n),__vite__mapDeps([25,26,27,22])))},{id:`crystal`,name:`Crystal`,import:(()=>Y(()=>import(`./crystal-DR276aYT.js`),__vite__mapDeps([28,2,3,1,16,22,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>Y(()=>import(`./csharp-oqKa8noW.js`),[]))},{id:`css`,name:`CSS`,import:(()=>Y(()=>import(`./css-jcQdyKCB.js`).then(e=>e.n),[]))},{id:`csv`,name:`CSV`,import:(()=>Y(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>Y(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>Y(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>Y(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>Y(()=>import(`./dart-CnvKMtbv.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>Y(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>Y(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>Y(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>Y(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>Y(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>Y(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>Y(()=>import(`./edge-CMwzwqao.js`),__vite__mapDeps([30,1,2,3,11,15])))},{id:`elixir`,name:`Elixir`,import:(()=>Y(()=>import(`./elixir-D0m0fb5e.js`),__vite__mapDeps([31,1,2,3])))},{id:`elm`,name:`Elm`,import:(()=>Y(()=>import(`./elm-Dm3Vhwyo.js`),__vite__mapDeps([32,27,22])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>Y(()=>import(`./emacs-lisp-c_oH4hRZ.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>Y(()=>import(`./erb-BWrVRqIb.js`),__vite__mapDeps([33,1,2,3,34,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>Y(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>Y(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>Y(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>Y(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>Y(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>Y(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>Y(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>Y(()=>import(`./gdresource-xMC7jr7x.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>Y(()=>import(`./gdscript-DYvRD3hg.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>Y(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>Y(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>Y(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>Y(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>Y(()=>import(`./git-rebase-Bx9WSw2T.js`),__vite__mapDeps([50,29])))},{id:`gleam`,name:`Gleam`,import:(()=>Y(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>Y(()=>import(`./glimmer-js-jJ5_T2M9.js`),__vite__mapDeps([51,2,3,1,11])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>Y(()=>import(`./glimmer-ts-DqUZ7xnF.js`),__vite__mapDeps([52,2,3,1,11])))},{id:`glsl`,name:`GLSL`,import:(()=>Y(()=>import(`./glsl-DHzsK5Yf.js`).then(e=>e.n),__vite__mapDeps([27,22])))},{id:`gn`,name:`GN`,import:(()=>Y(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>Y(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>Y(()=>import(`./go-rLFTqkRN.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>Y(()=>import(`./graphql-TivQ3Vbm.js`).then(e=>e.n),__vite__mapDeps([36,2,11,13,37])))},{id:`groovy`,name:`Groovy`,import:(()=>Y(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>Y(()=>import(`./hack-CXzUKlVo.js`),__vite__mapDeps([53,1,2,3,16])))},{id:`haml`,name:`Ruby Haml`,import:(()=>Y(()=>import(`./haml-DB9hsLVR.js`).then(e=>e.n),__vite__mapDeps([35,2,3])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>Y(()=>import(`./handlebars-Dfxd-Vhz.js`),__vite__mapDeps([54,2,3,1,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>Y(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>Y(()=>import(`./haxe-C8oCnwJJ.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>Y(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>Y(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>Y(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>Y(()=>import(`./html-CwO_HZk6.js`).then(e=>e.n),__vite__mapDeps([1,2,3])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>Y(()=>import(`./html-derivative-Da9QhqUr.js`),__vite__mapDeps([15,1,2,3])))},{id:`http`,name:`HTTP`,import:(()=>Y(()=>import(`./http-DaNELgRt.js`),__vite__mapDeps([55,7,8,9,29,36,2,11,13,37])))},{id:`hurl`,name:`Hurl`,import:(()=>Y(()=>import(`./hurl-DCibLrD6.js`),__vite__mapDeps([56,7,8,57,36,2,11,13,37])))},{id:`hxml`,name:`HXML`,import:(()=>Y(()=>import(`./hxml-Dcm88srW.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>Y(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>Y(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>Y(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>Y(()=>import(`./java-D2z6ozlO.js`).then(e=>e.n),[]))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>Y(()=>import(`./javascript-CxVsIZNi.js`).then(e=>e.n),[]))},{id:`jinja`,name:`Jinja`,import:(()=>Y(()=>import(`./jinja-BSUcBlS_.js`),__vite__mapDeps([60,1,2,3])))},{id:`jison`,name:`Jison`,import:(()=>Y(()=>import(`./jison-qcnqXcSy.js`),__vite__mapDeps([61,2])))},{id:`json`,name:`JSON`,import:(()=>Y(()=>import(`./json-eiyev3x0.js`).then(e=>e.n),[]))},{id:`json5`,name:`JSON5`,import:(()=>Y(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>Y(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>Y(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>Y(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>Y(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>Y(()=>import(`./jsx-rDHm7tH3.js`).then(e=>e.n),[]))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>Y(()=>import(`./julia-cFfLusXt.js`),__vite__mapDeps([62,2,16,20,25,26,27,22,63])))},{id:`just`,name:`Just`,aliases:[`justfile`],import:(()=>Y(()=>import(`./just-D6wClmab.js`),__vite__mapDeps([64,2,11,20,29,34,3,1,7,8,16,22,25,26,27,35,36,13,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>Y(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>Y(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>Y(()=>import(`./kusto-C7mF5XQf.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>Y(()=>import(`./latex-BvnFBRMG.js`),__vite__mapDeps([66,67,63])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>Y(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>Y(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>Y(()=>import(`./liquid-CIOCL1uY.js`),__vite__mapDeps([68,2,3,1,9])))},{id:`llvm`,name:`LLVM IR`,import:(()=>Y(()=>import(`./llvm-DqHOMS-s.js`),[]))},{id:`log`,name:`Log file`,import:(()=>Y(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>Y(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>Y(()=>import(`./lua-Dq6WuAHP.js`).then(e=>e.n),__vite__mapDeps([38,22])))},{id:`luau`,name:`Luau`,import:(()=>Y(()=>import(`./luau-C2pBCSgt.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>Y(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>Y(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>Y(()=>import(`./marko-Nl8_Nklj.js`),__vite__mapDeps([69,3,5,11,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>Y(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>Y(()=>import(`./mdc-obW39E44.js`),__vite__mapDeps([71,15,1,2,3,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>Y(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>Y(()=>import(`./mermaid-BxpfTIzt.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>Y(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>Y(()=>import(`./mojo-fg40_ntQ.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>Y(()=>import(`./moonbit-DgjMoLWr.js`),[]))},{id:`move`,name:`Move`,import:(()=>Y(()=>import(`./move-BYnGhZoM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>Y(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>Y(()=>import(`./nextflow-BJtWHP5T.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>Y(()=>import(`./nextflow-groovy-DJMQeKeT.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>Y(()=>import(`./nginx-Czz1mxQD.js`),__vite__mapDeps([74,38,22])))},{id:`nim`,name:`Nim`,import:(()=>Y(()=>import(`./nim-Boz13cJ3.js`),__vite__mapDeps([75,2,3,1,7,8,22,27,41])))},{id:`nix`,name:`Nix`,import:(()=>Y(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nsis`,name:`NSIS`,import:(()=>Y(()=>import(`./nsis-CjNLYCLg.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>Y(()=>import(`./nushell-DHYfO66s.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>Y(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>Y(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>Y(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>Y(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>Y(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`org`,name:`Org Markup`,import:(()=>Y(()=>import(`./org-BOlhXpYw.js`),__vite__mapDeps([76,2,3,1,5,8,7,9,11,13,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,48,50,81,82,83,63,65,66,67,70,84,75,85,86,87,88,89,90,91,92,93])))},{id:`pascal`,name:`Pascal`,import:(()=>Y(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>Y(()=>import(`./perl-BA7VmyiG.js`),__vite__mapDeps([65,2,3,1,7,8,16])))},{id:`php`,name:`PHP`,import:(()=>Y(()=>import(`./php-dYlaksWx.js`),__vite__mapDeps([87,2,3,1,7,8,9,16])))},{id:`pkl`,name:`Pkl`,import:(()=>Y(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>Y(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>Y(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>Y(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>Y(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>Y(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`],import:(()=>Y(()=>import(`./powershell-CCSX75yM.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>Y(()=>import(`./prisma-DMgNhnYS.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>Y(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>Y(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>Y(()=>import(`./pug-WDsqiRUK.js`),__vite__mapDeps([94,2,3,1])))},{id:`puppet`,name:`Puppet`,import:(()=>Y(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>Y(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>Y(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>Y(()=>import(`./qml-B5P0chYn.js`),__vite__mapDeps([95,2])))},{id:`qmldir`,name:`QML Directory`,import:(()=>Y(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>Y(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>Y(()=>import(`./r-DmZfBDub.js`).then(e=>e.n),[]))},{id:`racket`,name:`Racket`,import:(()=>Y(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>Y(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>Y(()=>import(`./razor-BLQfBppW.js`),__vite__mapDeps([96,1,2,3,78])))},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`],import:(()=>Y(()=>import(`./rbs-C0MpOrj4.js`),[]))},{id:`reg`,name:`Windows Registry Script`,import:(()=>Y(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>Y(()=>import(`./regexp-CePe_vV5.js`).then(e=>e.n),[]))},{id:`rel`,name:`Rel`,import:(()=>Y(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>Y(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>Y(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>Y(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>Y(()=>import(`./rst-D9pCulha.js`),__vite__mapDeps([97,2,15,1,3,20,98,25,26,27,22,29,39,34,7,8,16,35,36,11,13,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>Y(()=>import(`./ruby-r3EAH5Rz.js`),__vite__mapDeps([34,2,3,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>Y(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>Y(()=>import(`./sas-Dxc2YEvn.js`),__vite__mapDeps([99,16])))},{id:`sass`,name:`Sass`,import:(()=>Y(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>Y(()=>import(`./scala-BiFt_7mu.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>Y(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>Y(()=>import(`./scss-rZd3d-ZI.js`).then(e=>e.n),__vite__mapDeps([5,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>Y(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>Y(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([100,101])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>Y(()=>import(`./shellscript-B-b5xnkP.js`).then(e=>e.n),[]))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>Y(()=>import(`./shellsession-DlWXnhiW.js`),__vite__mapDeps([102,29])))},{id:`smalltalk`,name:`GNU Smalltalk`,import:(()=>Y(()=>import(`./smalltalk-BHpQb5nM.js`),[]))},{id:`smithy`,name:`Smithy`,import:(()=>Y(()=>import(`./smithy-Dgaz7aur.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>Y(()=>import(`./solidity-Bj7E1mRn.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>Y(()=>import(`./soy-DXWgq6qD.js`),__vite__mapDeps([103,1,2,3])))},{id:`sparql`,name:`SPARQL`,import:(()=>Y(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([104,105])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>Y(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>Y(()=>import(`./sql-5vPpIo1-.js`).then(e=>e.n),[]))},{id:`ssh-config`,name:`SSH Config`,import:(()=>Y(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>Y(()=>import(`./stata-BPQLlmzg.js`),__vite__mapDeps([106,16])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>Y(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>Y(()=>import(`./surrealql-CTEIAZfm.js`),__vite__mapDeps([107,2])))},{id:`svelte`,name:`Svelte`,import:(()=>Y(()=>import(`./svelte-B6EVsDV1.js`),__vite__mapDeps([108,2,3,11,12])))},{id:`swift`,name:`Swift`,import:(()=>Y(()=>import(`./swift-CyEgAFGc.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>Y(()=>import(`./system-verilog-Dh5ihWbf.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>Y(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>Y(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>Y(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>Y(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>Y(()=>import(`./templ-Bu4quHqE.js`),__vite__mapDeps([109,2,3,81])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>Y(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>Y(()=>import(`./tex-Dv_54fPG.js`).then(e=>e.n),__vite__mapDeps([67,63])))},{id:`toml`,name:`TOML`,import:(()=>Y(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>Y(()=>import(`./ts-tags-0DHV6Smm.js`),__vite__mapDeps([110,2,3,1,7,8,11,16,27,22])))},{id:`tsv`,name:`TSV`,import:(()=>Y(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>Y(()=>import(`./tsx-CmZ6PB1U.js`).then(e=>e.n),[]))},{id:`turtle`,name:`Turtle`,import:(()=>Y(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>Y(()=>import(`./twig-u99yWuG6.js`),__vite__mapDeps([111,2,3,5,20,34,1,7,8,16,22,25,26,27,29,35,36,11,13,37,38,39,87,9])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>Y(()=>import(`./typescript-WF79ZIBQ.js`).then(e=>e.n),[]))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>Y(()=>import(`./typespec-BRdr0IET.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>Y(()=>import(`./typst-DQ7XxvRZ.js`),__vite__mapDeps([112,2,3,1,5,8,7,9,11,13,113,114,16,22,20,77,24,26,25,27,29,78,79,49,80,31,38,39,34,35,36,37,41,40,44,48,50,81,82,54,83,115,63,62,65,66,67,70,116,84,85,87,88,89,90,91,93,117,94,118,119,111,120])))},{id:`v`,name:`V`,import:(()=>Y(()=>import(`./v-DBj4K9d_.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>Y(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,import:(()=>Y(()=>import(`./vb-DOwzaHZ0.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>Y(()=>import(`./verilog-B2gwz-sJ.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>Y(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>Y(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>Y(()=>import(`./vue-DXac3mhj.js`),__vite__mapDeps([121,2,3,1,9,11,15])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>Y(()=>import(`./vue-html-FSSTYK94.js`),__vite__mapDeps([122,2])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>Y(()=>import(`./vue-vine-BDF8epqI.js`),__vite__mapDeps([123,2,3,5,12,70,124])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>Y(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>Y(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>Y(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>Y(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>Y(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>Y(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>Y(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>Y(()=>import(`./xml-HI856iuk.js`).then(e=>e.n),__vite__mapDeps([7,8])))},{id:`xsl`,name:`XSL`,import:(()=>Y(()=>import(`./xsl-Ck-aKGwi.js`),__vite__mapDeps([93,7,8])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>Y(()=>import(`./yaml-DrPyW5uV.js`).then(e=>e.n),[]))},{id:`zenscript`,name:`ZenScript`,import:(()=>Y(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>Y(()=>import(`./zig-CMLA9XwU.js`),[]))}],A_=Object.fromEntries(k_.map(e=>[e.id,e.import])),j_=Object.fromEntries(k_.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),M_={...A_,...j_},N_=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>Y(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>Y(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>Y(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>Y(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>Y(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>Y(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>Y(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>Y(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>Y(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>Y(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>Y(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>Y(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>Y(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>Y(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>Y(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>Y(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>Y(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>Y(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>Y(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>Y(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>Y(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>Y(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>Y(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>Y(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>Y(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>Y(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>Y(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>Y(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>Y(()=>import(`./horizon-bright-DSNQnXHK.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>Y(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>Y(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>Y(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>Y(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>Y(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>Y(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>Y(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>Y(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>Y(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>Y(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>Y(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>Y(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>Y(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>Y(()=>import(`./monokai-B_bV9PQ9.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>Y(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>Y(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>Y(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>Y(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>Y(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>Y(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>Y(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>Y(()=>import(`./red-DX1BQOs8.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>Y(()=>import(`./rose-pine-aMsaMD1D.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>Y(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>Y(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>Y(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>Y(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>Y(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>Y(()=>import(`./solarized-dark-UdsmMDCL.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>Y(()=>import(`./solarized-light-C1IUL_tW.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>Y(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>Y(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>Y(()=>import(`./vesper-DdrHHSXu.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>Y(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>Y(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>Y(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),P_=s({createOnigurumaEngine:()=>cv,getDefaultWasmLoader:()=>sv,loadWasm:()=>tv,setDefaultWasmLoader:()=>ov}),F_=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function I_(){return 2147483648}function L_(){return typeof performance<`u`?performance.now():Date.now()}var R_=(e,t)=>e+(t-e%t)%t;async function z_(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=I_();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,R_(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:L_,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var B_=Object.defineProperty,V_=(e,t,n)=>t in e?B_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,H_=(e,t,n)=>V_(e,typeof t==`symbol`?t:t+``,n),U_=null;function W_(e){throw new F_(e.UTF8ToString(e.getLastOnigError()))}var G_=class e{constructor(t){H_(this,`utf16Length`),H_(this,`utf8Length`),H_(this,`utf16Value`),H_(this,`utf8Value`),H_(this,`utf16OffsetToUtf8`),H_(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},K_=class e{constructor(t){if(H_(this,`id`,++e.LAST_ID),H_(this,`_onigBinding`),H_(this,`content`),H_(this,`utf16Length`),H_(this,`utf8Length`),H_(this,`utf16OffsetToUtf8`),H_(this,`utf8OffsetToUtf16`),H_(this,`ptr`),!U_)throw new F_(`Must invoke loadWasm first.`);this._onigBinding=U_,this.content=t;let n=new G_(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=U_.omalloc(1e4),e._sharedPtrInUse=!0,U_.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(U_)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};H_(K_,`LAST_ID`,0),H_(K_,`_sharedPtr`,0),H_(K_,`_sharedPtrInUse`,!1);var q_=K_,J_=class{constructor(e){if(H_(this,`_onigBinding`),H_(this,`_ptr`),!U_)throw new F_(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new G_(e[r]);t[r]=i.createString(U_),n[r]=i.utf8Length}let r=U_.omalloc(4*e.length);U_.HEAPU32.set(t,r/4);let i=U_.omalloc(4*e.length);U_.HEAPU32.set(n,i/4);let a=U_.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)U_.ofree(t[n]);U_.ofree(i),U_.ofree(r),a===0&&W_(U_),this._onigBinding=U_,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new q_(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function Y_(e){return typeof e.instantiator==`function`}function X_(e){return typeof e.default==`function`}function Z_(e){return e.data!==void 0}function Q_(e){return typeof Response<`u`&&e instanceof Response}function $_(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var ev;function tv(e){if(ev)return ev;async function t(){U_=await z_(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Y_(n)?n=await n.instantiator(t):X_(n)?n=await n.default(t):(Z_(n)&&(n=n.data),Q_(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await rv(n)(t):await iv(n)(t):$_(n)||n instanceof WebAssembly.Module?n=await nv(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await nv(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return ev=t(),ev}function nv(e){return t=>WebAssembly.instantiate(e,t)}function rv(e){return t=>WebAssembly.instantiateStreaming(e,t)}function iv(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var av;function ov(e){av=e}function sv(){return av}async function cv(e){return e&&await tv(e),{createScanner(e){return new J_(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new q_(e)}}}var lv=E_({});O_(lv,P_);var uv=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function dv(e){return fv(e)}function fv(e){return Array.isArray(e)?pv(e):e instanceof RegExp?e:typeof e==`object`?mv(e):e}function pv(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=fv(e[n]);return t}function mv(e){let t={};for(let n in e)t[n]=fv(e[n]);return t}function hv(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function gv(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?gv(e.substring(0,e.length-1)):e.substr(~t+1)}var _v=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,vv=class{static hasCaptures(e){return e!==null&&(_v.lastIndex=0,_v.test(e))}static replaceCaptures(e,t,n){return e.replace(_v,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function yv(e,t){return e<t?-1:+(e>t)}function bv(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=yv(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function xv(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Sv(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Cv=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},wv=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(kv(e),t)}static createFromParsedTheme(e,t){return Mv(e,t)}_cachedMatchRoot=new Cv(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Ev(e.parent,t.parentScopes));return n?new Ov(n.fontStyle,n.foreground,n.background):null}},Tv=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Ev(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!Dv(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Dv(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Ov=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function kv(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&xv(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&xv(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Av(l,u,e,o,s,c)}}return n}var Av=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},jv=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(jv||{});function Mv(e,t){e.sort((e,t)=>{let n=yv(e.scope,t.scope);return n!==0||(n=bv(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Nv(t),o=new Ov(n,a.getId(r),a.getId(i)),s=new Iv(new Fv(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new wv(a,o,s)}var Nv=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Pv=Object.freeze([]),Fv=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||Pv,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Iv=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Fv.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(bv(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Fv(e,t,n,r,i))}},Lv=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=zv(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Rv(e){return e}function zv(e){return e}function Bv(e,t){let n=[],r=Hv(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Vv(i)){let e=[];do e.push(i),i=r.next();while(Vv(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Vv(e){return!!e&&!!e.match(/[\w\.:]+/)}function Hv(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Uv(e){typeof e.dispose==`function`&&e.dispose()}var Wv=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Gv=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Kv=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},qv=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Wv(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Kv;for(let n of e)Jv(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Wv){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Jv(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Wv?Xv({baseGrammar:a,selfGrammar:i},r):Yv(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Wv(e))}function Yv(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Zv([r],t,n)}}function Xv(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Zv(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Zv(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Zv(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?hv({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Zv(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=ry(i);switch(a.kind){case 0:Xv({...t,selfGrammar:t.baseGrammar},n);break;case 1:Xv(t,n);break;case 2:Yv(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Yv(a.ruleName,i,n):Xv(i,n)}else a.kind===4?n.add(new Gv(a.scopeName,a.ruleName)):n.add(new Wv(a.scopeName))}}}var Qv=class{kind=0},$v=class{kind=1},ey=class{constructor(e){this.ruleName=e}kind=2},ty=class{constructor(e){this.scopeName=e}kind=3},ny=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function ry(e){if(e===`$base`)return new Qv;if(e===`$self`)return new $v;let t=e.indexOf(`#`);return t===-1?new ty(e):t===0?new ey(e.substring(1)):new ny(e.substring(0,t),e.substring(t+1))}var iy=/\\(\d+)/,ay=/\\(\d+)/g,oy=-1,sy=-2;function cy(e){return e}function ly(e){return e}var uy=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=vv.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=vv.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${gv(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:vv.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:vv.replaceCaptures(this._contentName,e,t)}},dy=class extends uy{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},fy=class extends uy{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new _y(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new vy,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},py=class extends uy{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new vy,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},my=class extends uy{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new _y(i,this.id),this.beginCaptures=a,this._end=new _y(o||``,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new vy;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},hy=class extends uy{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new _y(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new _y(o,sy),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new vy;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new vy,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||``),this._cachedCompiledWhilePatterns}},gy=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new dy(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new fy(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=hv({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new py(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new hy(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new my(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=ry(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof py||e instanceof my||e instanceof hy)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},_y=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&iy.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return ay.lastIndex=0,this.source.replace(ay,(e,t)=>Sv(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=``,t[i+1]=``,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=``,t[i+1]=`G`,n[i+1]=``,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},vy=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new yy(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new yy(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},yy=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
|
|
25
|
+
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},by=class{constructor(e,t){this.languageId=e,this.tokenType=t}},xy=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new by(e,8),this._embeddedLanguagesMatcher=new Sy(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new by(0,0);_getBasicScopeAttributes=new Cv(e=>new by(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Sy=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Sv(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Cy=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function wy(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Ty(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Cy(i,!0);f()}return new Cy(i,!1);function f(){let o=Ey(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===oy){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),jy(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof my){let r=o;jy(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof hy){let r=o;jy(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(jy(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Ty(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof hy&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Ay(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==sy){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),jy(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Ey(e,t,n,r,i,a){let o=Dy(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Oy(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function Dy(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=ky(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Oy(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=ky(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function ky(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Ay(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function jy(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));wy(e,p,n&&d.start===0,d.start,f,i,!1,0),Uv(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new My(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var My=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Ny(e,t,n,r,i,a,o,s){return new Ly(e,t,n,r,i,a,o,s)}function Py(e,t,n,r,i){let a=Bv(t,Fy),o=gy.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function Fy(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Iy(t[r],e))return n=r+1,!0;return!1})}function Iy(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Ly=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new xy(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ry(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=Bv(e,Fy);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Py(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Py(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(cy(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[ly(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Ry(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=gy.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===By.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Lv.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?zy.createRootAndLookUpScopeName(a,r,this):zy.createRoot(`unknown`,r),t=new By(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
|
|
26
|
+
`;let a=this.createOnigString(e),o=a.content.length,s=new Hy(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=wy(this,a,i,0,t,s,!0,r);return Uv(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Ry(e,t){return e=dv(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var zy=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Tv.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Tv(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Tv(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Lv.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},By=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?zy.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:ly(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=zy.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,cy(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,zy.fromExtension(r,n.contentNameScopesList))}},Vy=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Bv(e,Fy).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Bv(e,Fy).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Hy=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Lv.set(n,0,Rv(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Lv.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Uy=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,Ny(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Wy=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Uy(wv.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(wv.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Vy(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new qv(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Gy=By.NULL;function Ky(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function qy(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Jy(e){return Array.isArray(e)?e:[e]}async function Yy(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Xy(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Zy(e){return e===`ansi`||Xy(e)}function Qy(e){return e===`none`}function $y(e){return Qy(e)}var eb=/(\r?\n)/g;function tb(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(eb),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var nb={light:`#333333`,dark:`#bbbbbb`},rb={light:`#fffffe`,dark:`#1e1e1e`},ib=`__shiki_resolved`;function ab(e){if(e?.[ib])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?nb.light:nb.dark,n||=t.type===`light`?rb.light:rb.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,ib,{enumerable:!1,writable:!1,value:!0}),t}async function ob(e){return[...new Set((await Promise.all(e.filter(e=>!Zy(e)).map(async e=>await Yy(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function sb(e){return(await Promise.all(e.map(async e=>$y(e)?null:ab(await Yy(e))))).filter(e=>!!e)}function cb(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new uv(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var lb=class extends Wy{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=ab(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=wv.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=cb(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new uv(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},ub=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},db=0;function fb(e){db+=1,e.warnings!==!1&&db>=10&&db%10==0&&console.warn(`[Shiki] ${db} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new uv("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(ab),i=new lb(new ub(e.engine,n),r,n,e.langAlias),a;function o(t){return cb(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new uv(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new uv(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await ob(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await sb(e))}function g(){if(t)throw new uv(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--db)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function pb(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([sb(e.themes||[]),ob(e.langs||[]),e.engine]);return fb({...e,themes:t,langs:n,engine:r})}var mb=new WeakMap;function hb(e,t){mb.set(e,t)}function gb(e){return mb.get(e)}var _b=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(Jy(n).map(e=>[e,Gy])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return vb(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function vb(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function yb(e,t){if(!(e instanceof _b))throw new uv(`Invalid grammar state`);return e.getInternalStack(t)}var bb=/,/,xb=/ /;function Sb(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Xy(e.resolveLangAlias(n.lang||`text`))||Qy(r))return tb(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new uv(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new uv(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return wb(t,o,i,a,n)}function Cb(...e){if(e.length===2)return gb(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Xy(i)||Qy(a))throw new uv(`Plain language does not have grammar state`);if(i===`ansi`)throw new uv(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new _b(Tb(n,c,o,s,r).stateStack,c.name,o.name)}function wb(e,t,n,r,i){let a=Tb(e,t,n,r,i),o=new _b(a.stateStack,t.name,n.name);return hb(a.tokens,o),a.tokens}function Tb(e,t,n,r,i){let a=Ky(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=tb(e),u=i.grammarState?yb(i.grammarState,n.name)??Gy:i.grammarContextCode==null?Gy:Tb(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=qy(r[Lv.getForeground(s)],a),u=Lv.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=Lv.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(bb).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(xb))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Eb(t.scopes):Db(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Eb(e){return e.map(e=>({scopeName:e}))}function Db(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:Ab(e,i,t.slice(0,r))}}return n}function Ob(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function kb(e,t,n){if(!Ob(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Ob(e[r],n[i])&&--r,--i;return r===-1}function Ab(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(kb(e,t,n)){r.push(a);break}return r}function jb(e,t,n,r=Sb){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:gb(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=Mb(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new _b(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&hb(s,c),s}function Mb(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var Nb=/\s+/g;function Pb(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(Nb)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(Nb);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}var Fb=/:?lang=["']([^"']+)["']/g,Ib=/(?:```|~~~)([\w-]+)/g,Lb=/\\begin\{([\w-]+)\}/g,Rb=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,zb=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function Bb(e){let t=tb(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function Vb(e,t,n){let r=new Set;for(let t of e.matchAll(Fb)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(Ib)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(Lb)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(Rb)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(zb.test(e)&&r.add(`yaml`),!n)return[...r];let i=n.getBundledLanguages();return[...r].filter(e=>e&&i[e])}var Hb=[`color`,`background-color`];function Ub(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Wb(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function Gb(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=Wb(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return Ub(e,a)})):e}function Kb(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>qb(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&Hb.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new uv('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function qb(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&jv.Italic&&(t[`font-style`]=`italic`),e.fontStyle&jv.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&jv.Underline&&n.push(`underline`),e.fontStyle&jv.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Jb(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function Yb(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=Bb(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new uv(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new uv(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new uv(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));Xb(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Gb(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new uv(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Zb(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new uv(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new uv(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&Pb(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Xb(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new uv(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new uv(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Zb(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Zb).join(``):``}var Qb=[Yb()];function $b(e){let t=ex(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Qb]}function ex(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var tx=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],nx={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function rx(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function ix(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function ax(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)nx[r]&&t.push({type:`setDecoration`,value:nx[r]});else if(r<=29){let e=nx[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:tx[r-30]}});else if(r===38){let n=ix(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:tx[r-40]}});else if(r===48){let n=ix(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:tx[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:tx[r-100+8]}})}}return t}function ox(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=rx(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=ax(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var sx={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function cx(e=sx){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<tx.length;e++)r.push(t(tx[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var lx=/#([0-9a-f]{3,8})/i,ux=/var\((--[\w-]+-ansi-[\w-]+)\)/,dx={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function fx(e,t,n){let r=Ky(e,n),i=tb(t),a=cx(Object.fromEntries(tx.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||dx[t]]}))),o=ox();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=qy(i,r),o=qy(o,r),n.decorations.has(`dim`)&&(i=px(i));let s=jv.None;return n.decorations.has(`bold`)&&(s|=jv.Bold),n.decorations.has(`italic`)&&(s|=jv.Italic),n.decorations.has(`underline`)&&(s|=jv.Underline),n.decorations.has(`strikethrough`)&&(s|=jv.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function px(e){let t=e.match(lx);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(ux);return n?`var(${n[1]}-dim)`:e}function mx(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!Xy(r)&&!Qy(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return fx(r,t,n)}return Sb(e,t,n)}function hx(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new uv("`themes` option must not be empty");let p=jb(e,t,n,mx);if(c=gb(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new uv(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Kb(e,h,u,l,d))),c&&hb(a,c);let g=f.map(e=>Ky(e.theme,n));i=gx(f,m,g,u,l,`fg`,d),r=gx(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=Ky(n.theme,n);a=mx(e,t,n);let l=e.getTheme(n.theme);r=qy(l.bg,s),i=qy(l.fg,s),o=l.name,c=gb(a)}else throw new uv("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function gx(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=qy(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new uv('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${qy(t[r][a],n[r])||`inherit`}, ${qy(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var _x=/^\s+$/,vx=/^(\s*)(.*?)(\s*)$/;function yx(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>yx(e,t,n),codeToTokens:(t,n)=>hx(e,t,n)}){let i=t;for(let e of $b(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=hx(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=xx(a):d===`never`&&(a=Sx(a)),f&&(a=Cx(a));let p={...r,get source(){return i}};for(let e of $b(n))a=e.tokens?.call(p,a)||a;return bx(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function bx(e,t,n,r=gb(e)){let i=$b(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:Pb,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
|
|
27
|
+
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Jb(a.htmlStyle||qb(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&hb(m,r),m}function xx(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&jv.Underline||i.fontStyle&jv.Strikethrough));o&&_x.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function Sx(e){return e.map(e=>e.flatMap(e=>{if(_x.test(e.content))return e;let t=e.content.match(vx);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Cx(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Jb(e.htmlStyle||qb(e)),i=Jb(n.htmlStyle||qb(n)),a=e.fontStyle&&(e.fontStyle&jv.Underline||e.fontStyle&jv.Strikethrough),o=n.fontStyle&&(n.fontStyle&jv.Underline||n.fontStyle&jv.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var wx=Hg;function Tx(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>yx(e,t,n),codeToTokens:(t,n)=>hx(e,t,n)},i=wx(yx(e,t,n,r));for(let e of $b(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Ex(e){let t=await pb(e);return{getLastGrammarState:(...e)=>Cb(t,...e),codeToTokensBase:(e,n)=>mx(t,e,n),codeToTokensWithThemes:(e,n)=>jb(t,e,n),codeToTokens:(e,n)=>hx(t,e,n),codeToHast:(e,n)=>yx(t,e,n),codeToHtml:(e,n)=>Tx(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Dx(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Zy(n))return[];let r=t[n];if(!r)throw new uv(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if($y(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new uv(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Ex({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Ox(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function kx(e,t){let n=Ox(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var Ax=Dx({langs:M_,themes:N_,engine:()=>(0,lv.createOnigurumaEngine)(Y(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:jx,codeToHast:Mx,codeToTokens:Nx,codeToTokensBase:Px,codeToTokensWithThemes:Fx,getSingletonHighlighter:Ix,getLastGrammarState:Lx}=kx(Ax,{guessEmbeddedLanguages:Vb}),Rx=4294967295,zx=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:Rx,end:Rx,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function Bx(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Vx(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Hx=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),Ux=String.raw;function Wx(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Gx=Ux`\[\^?`,Kx=`c.? | C(?:-.?)?|${Ux`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Ux`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Ux`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Ux`o\{[^\}]*\}?`}|${Ux`\d{1,3}`}`,qx=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Jx=new RegExp(Ux`
|
|
28
|
+
\\ (?:
|
|
29
|
+
${Kx}
|
|
30
|
+
| [gk]<[^>]*>?
|
|
31
|
+
| [gk]'[^']*'?
|
|
32
|
+
| .
|
|
33
|
+
)
|
|
34
|
+
| \( (?:
|
|
35
|
+
\? (?:
|
|
36
|
+
[:=!>({]
|
|
37
|
+
| <[=!]
|
|
38
|
+
| <[^>]*>
|
|
39
|
+
| '[^']*'
|
|
40
|
+
| ~\|?
|
|
41
|
+
| #(?:[^)\\]|\\.?)*
|
|
42
|
+
| [^:)]*[:)]
|
|
43
|
+
)?
|
|
44
|
+
| \*[^\)]*\)?
|
|
45
|
+
)?
|
|
46
|
+
| (?:${qx.source})+
|
|
47
|
+
| ${Gx}
|
|
48
|
+
| .
|
|
49
|
+
`.replace(/\s+/g,``),`gsu`),Yx=new RegExp(Ux`
|
|
50
|
+
\\ (?:
|
|
51
|
+
${Kx}
|
|
52
|
+
| .
|
|
53
|
+
)
|
|
54
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
55
|
+
| ${Gx}
|
|
56
|
+
| &&
|
|
57
|
+
| .
|
|
58
|
+
`.replace(/\s+/g,``),`gsu`);function Xx(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=ES(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(Jx.lastIndex=0;s=Jx.exec(e);){let t=Zx(a,e,s[0],Jx.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(Jx.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?OS(e,u):e).flat(),flags:r}}function Zx(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Qx(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:nS(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:gS(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:rS(n)}}if(a===`K`)return{token:uS(`keep`,n)};if(a===`N`||a===`R`)return{token:lS(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:lS(`any`,n)};if(a===`X`)return{token:lS(`text_segment`,n)};let e=eS(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:xS(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:bS(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:pS(`group`,n)};if(n===`(?>`)return{token:pS(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:pS(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:pS(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:pS(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:fS(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
|
|
59
|
+
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:lS(`dot`,n)}:n===`^`||n===`$`?{token:nS(e.singleline?{"^":Ux`\A`,$:Ux`\Z`}[n]:n,n)}:n===`|`?{token:tS(n)}:qx.test(n)?{tokens:kS(n)}:{token:iS(Bx(n),n)}}function Qx(e,t,n){let r=[cS(t[1]===`^`,t)],i=1,a;for(Yx.lastIndex=n;a=Yx.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(cS(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(iS(93,e));else if(i--,r.push(aS(e)),!i)break}else{let t=$x(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:Yx.lastIndex||e.length}}function $x(e){if(e[0]===`\\`)return eS(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Hx.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return lS(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?oS(e):e===`&&`?sS(e):iS(Bx(e),e)}function eS(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return yS(e);if(`dDhHsSwW`.includes(n))return CS(e);if(e.startsWith(Ux`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return wS(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return iS(Bx(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return iS(DS(e),e);if(vS.has(n))return iS(vS.get(n),e);if(/\d/.test(n))return dS(t,e);if(e===`\\`)throw Error(Ux`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return iS(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function tS(e){return{type:`Alternator`,raw:e}}function nS(e,t){return{type:`Assertion`,kind:e,raw:t}}function rS(e){return{type:`Backreference`,raw:e}}function iS(e,t){return{type:`Character`,value:e,raw:t}}function aS(e){return{type:`CharacterClassClose`,raw:e}}function oS(e){return{type:`CharacterClassHyphen`,raw:e}}function sS(e){return{type:`CharacterClassIntersector`,raw:e}}function cS(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function lS(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function uS(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:Wx(n.flags),raw:t}}function dS(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function fS(e){return{type:`GroupClose`,raw:e}}function pS(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function mS(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function hS(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function gS(e){return{type:`Subroutine`,raw:e}}var _S=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),vS=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function yS(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return iS(Bx(t.toUpperCase())-64,e)}function bS(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=TS(n),o=TS(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),uS(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,pS(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function xS(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=_S.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return mS(l,r??null,i?.split(`,`)??null,e)}function SS(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return hS(t,n,r,e)}function CS(e){let t=e[1].toLowerCase();return lS({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function wS(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return lS(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function TS(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function ES(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function DS(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function OS(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[rS(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(Ux`Octal encoded byte above 177 unsupported "${n}"`)}else r=Bx(t);a.push(iS(r,(e===0?`\\`:``)+t))}return a}function kS(e){let t=[],n=new RegExp(qx,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(SS(e.slice(0,-1)));continue}}}t.push(SS(e))}return t}function AS(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function jS(e){return MS.has(e.type)}var MS=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function NS(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Xx(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return US();case`Assertion`:return PS(n);case`Backreference`:return FS(n,a);case`Character`:return qS(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return IS(n,a,t);case`CharacterClassOpen`:return LS(n,a,t);case`CharacterSet`:return RS(n,a);case`Directive`:return ZS(n.kind,{flags:n.flags});case`GroupOpen`:return zS(n,a,t);case`NamedCallout`:return tC(n.kind,n.tag,n.arguments);case`Quantifier`:return BS(n,a);case`Subroutine`:return VS(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=iC(QS(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(Ux`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(Ux`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function PS({kind:e}){return WS(Wx({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===Ux`\B`||e===Ux`\Y`})}function FS({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,GS(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return GS(r)}return i(+r)}function IS(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),YS(o,e);throw Error(`Invalid character class range`)}return qS(Bx(`-`))}function LS({negate:e},t,n){let{tokens:r,walk:i}=t,a=[JS()],o=r[t.nextIndex],s=hC(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(JS()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=hC(r[t.nextIndex],o)}let c=JS({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function RS({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=mC(n);if(Hx.has(r)&&!o?.has(r))e=`posix`,n=r;else return oC(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?nC(n,{negate:t}):XS(e,{negate:t})}function zS(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=sC(e),l=c.type===`AbsenceFunction`,u=dC(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&Vx(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=gC(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(US()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(uC(t)||t.type===`CapturingGroup`)throw Error(e)}else if(uC(t)||dC(t)&&t.negate)throw Error(e)}}f=gC(r[t.nextIndex])}return t.nextIndex++,c}function BS({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!jS(a))throw Error(`Quantifier requires a repeatable token`);let o=rC(e,t,n,a);return i.body.pop(),o}function VS({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=aC(i);return r.push(o),o}function HS(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:cC(t?.body)}}function US(e){return{type:`Alternative`,body:lC(e?.body)}}function WS(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function GS(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function KS(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!fC(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:cC(t?.body)}}function qS(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function JS(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:lC(e?.body)}}function YS(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function XS(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function ZS(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:Wx(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function QS(e){return{type:`Flags`,...e}}function $S(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:cC(e?.body)}}function eC(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:cC(e?.body)}}function tC(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function nC(e,t){let n=!!t?.negate;if(!Hx.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function rC(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function iC(e,t){return{type:`Regex`,body:cC(t?.body),flags:e}}function aC(e){return{type:`Subroutine`,ref:e}}function oC(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(mC(e));if(!r){if(n.normalizeUnknownPropertyNames)r=pC(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(Ux`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function sC({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return HS(`repeater`);case`atomic`:return $S({atomic:!0});case`capturing`:return KS(i,{name:n});case`group`:return $S({flags:e});case`lookahead`:case`lookbehind`:return eC({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function cC(e){if(e===void 0)e=[US()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function lC(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function uC(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function dC(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function fC(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function pC(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function mC(e){return e.replace(/[- _]+/g,``).toLowerCase()}function hC(e,t){let n=t;return Wx(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function gC(e){return Wx(e,`Unclosed group`)}function _C(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){vC(c).splice(Math.max(0,yC(s)+l),1),l--,u=!0},removeAllNextSiblings(){return vC(c).splice(yC(s)+1)},removeAllPrevSiblings(){let e=yC(s)+l;return l-=e,vC(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,yC(s)+l)]=e:Wx(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(vC(c).splice(Math.max(0,yC(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,yC(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function vC(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function yC(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var bC=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function xC(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function SC(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var CC=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function wC(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===CC.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?CC.CHAR_CLASS:CC.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function TC(e,t,n,r){wC(e,t,n,r)}function EC(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===CC.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function DC(e,t,n){return!!EC(e,t,0,n)}function OC(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var kC=new RegExp(String.raw`(?<noncapturingStart>${bC})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function AC(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(kC.lastIndex=Number.isNaN(c)?0:c+7;f=kC.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),xC(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=wC(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},CC.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var jC=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,MC=new RegExp(String.raw`
|
|
60
|
+
\\(?: \d+
|
|
61
|
+
| c[A-Za-z]
|
|
62
|
+
| [gk]<[^>]+>
|
|
63
|
+
| [pPu]\{[^\}]+\}
|
|
64
|
+
| u[A-Fa-f\d]{4}
|
|
65
|
+
| x[A-Fa-f\d]{2}
|
|
66
|
+
)
|
|
67
|
+
| \((?: \? (?: [:=!>]
|
|
68
|
+
| <(?:[=!]|[^>]+>)
|
|
69
|
+
| [A-Za-z\-]+:
|
|
70
|
+
| \(DEFINE\)
|
|
71
|
+
))?
|
|
72
|
+
| (?<qBase>${jC})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
73
|
+
| \\?.
|
|
74
|
+
`.replace(/\s+/g,``),`gsu`);function NC(e){if(!RegExp(`${jC}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(MC.lastIndex=0;o=MC.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=SC(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}MC.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var PC=String.raw,FC=PC`\(\?R=(?<rDepth>[^\)]+)\)|${PC`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,IC=PC`\(\?<(?![=!])(?<captureName>[^>]+)>`,LC=PC`${IC}|(?<unnamed>\()(?!\?)`,RC=new RegExp(PC`${IC}|${FC}|\(\?|\\?.`,`gsu`),zC=`Cannot use multiple overlapping recursions`;function BC(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(FC,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&DC(e,PC`\(\?\(DEFINE\)`,CC.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=DC(e,PC`\\[1-9]`,CC.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(RC.lastIndex=0;f=RC.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(VC(m),l)throw Error(zC);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(RC.lastIndex);if(DC(s,FC,CC.DEFAULT))throw Error(zC);let c=m-1;e=HC(t,s,c,!1,n,a,d),i=GC(i,t,c,a.length,0,d);break}if(h){VC(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(zC);break}if(!u)throw Error(PC`Recursive \g cannot be used outside the referenced group "${r===`external`?h:PC`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=OC(e,p);if(o&&DC(m,PC`${IC}|\((?!\?)`,CC.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=HC(_,v,b,!0,n,a,d);i=GC(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,RC.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),RC.lastIndex),s.set(p,RC.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),RC.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function VC(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function HC(e,t,n,r,i,a,o){let s=new Set;r&&TC(e+t,IC,({groups:{captureName:e}})=>{s.add(e)},CC.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${UC(`(?:${e}`,`forward`,...c)}(?:)${UC(`${t})`,`backward`,...c)}${t}`}function UC(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=wC(e,PC`${LC}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),WC(i,n),s?e:`(?<${t}${l}>`}return PC`\k<${c}${l}>`},CC.DEFAULT)}return c}function WC(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function GC(e,t,n,r,i,a){if(e.size&&r){let o=0;TC(t,LC,()=>o++,CC.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var KC=String.fromCodePoint,qC=String.raw,JC={},YC=globalThis.RegExp;JC.flagGroups=(()=>{try{new YC(`(?i:)`)}catch{return!1}return!0})(),JC.unicodeSets=(()=>{try{new YC(`[[]]`,`v`)}catch{return!1}return!0})(),JC.bugFlagVLiteralHyphenIsRange=JC.unicodeSets?(()=>{try{new YC(qC`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,JC.bugNestedClassIgnoresNegation=JC.unicodeSets&&new YC(`[[^a]]`,`v`).test(`a`);function XC(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function ZC(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function QC(e,t){return ew[e]>=ew[t]}function $C(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ew={ES2025:2025,ES2024:2024,ES2018:2018},tw={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function nw(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!tw[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=JC.flagGroups?`ES2025`:JC.unicodeSets?`ES2024`:`ES2018`),t}var rw=`[ -\r ]`,iw=new Set([KC(304),KC(305)]),aw=qC`[\p{L}\p{M}\p{N}\p{Pc}]`;function ow(e){if(iw.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=uw.get(n),a=cw.get(n),o=lw.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var sw=new Map(`C Other
|
|
75
|
+
Cc Control cntrl
|
|
76
|
+
Cf Format
|
|
77
|
+
Cn Unassigned
|
|
78
|
+
Co Private_Use
|
|
79
|
+
Cs Surrogate
|
|
80
|
+
L Letter
|
|
81
|
+
LC Cased_Letter
|
|
82
|
+
Ll Lowercase_Letter
|
|
83
|
+
Lm Modifier_Letter
|
|
84
|
+
Lo Other_Letter
|
|
85
|
+
Lt Titlecase_Letter
|
|
86
|
+
Lu Uppercase_Letter
|
|
87
|
+
M Mark Combining_Mark
|
|
88
|
+
Mc Spacing_Mark
|
|
89
|
+
Me Enclosing_Mark
|
|
90
|
+
Mn Nonspacing_Mark
|
|
91
|
+
N Number
|
|
92
|
+
Nd Decimal_Number digit
|
|
93
|
+
Nl Letter_Number
|
|
94
|
+
No Other_Number
|
|
95
|
+
P Punctuation punct
|
|
96
|
+
Pc Connector_Punctuation
|
|
97
|
+
Pd Dash_Punctuation
|
|
98
|
+
Pe Close_Punctuation
|
|
99
|
+
Pf Final_Punctuation
|
|
100
|
+
Pi Initial_Punctuation
|
|
101
|
+
Po Other_Punctuation
|
|
102
|
+
Ps Open_Punctuation
|
|
103
|
+
S Symbol
|
|
104
|
+
Sc Currency_Symbol
|
|
105
|
+
Sk Modifier_Symbol
|
|
106
|
+
Sm Math_Symbol
|
|
107
|
+
So Other_Symbol
|
|
108
|
+
Z Separator
|
|
109
|
+
Zl Line_Separator
|
|
110
|
+
Zp Paragraph_Separator
|
|
111
|
+
Zs Space_Separator
|
|
112
|
+
ASCII
|
|
113
|
+
ASCII_Hex_Digit AHex
|
|
114
|
+
Alphabetic Alpha
|
|
115
|
+
Any
|
|
116
|
+
Assigned
|
|
117
|
+
Bidi_Control Bidi_C
|
|
118
|
+
Bidi_Mirrored Bidi_M
|
|
119
|
+
Case_Ignorable CI
|
|
120
|
+
Cased
|
|
121
|
+
Changes_When_Casefolded CWCF
|
|
122
|
+
Changes_When_Casemapped CWCM
|
|
123
|
+
Changes_When_Lowercased CWL
|
|
124
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
125
|
+
Changes_When_Titlecased CWT
|
|
126
|
+
Changes_When_Uppercased CWU
|
|
127
|
+
Dash
|
|
128
|
+
Default_Ignorable_Code_Point DI
|
|
129
|
+
Deprecated Dep
|
|
130
|
+
Diacritic Dia
|
|
131
|
+
Emoji
|
|
132
|
+
Emoji_Component EComp
|
|
133
|
+
Emoji_Modifier EMod
|
|
134
|
+
Emoji_Modifier_Base EBase
|
|
135
|
+
Emoji_Presentation EPres
|
|
136
|
+
Extended_Pictographic ExtPict
|
|
137
|
+
Extender Ext
|
|
138
|
+
Grapheme_Base Gr_Base
|
|
139
|
+
Grapheme_Extend Gr_Ext
|
|
140
|
+
Hex_Digit Hex
|
|
141
|
+
IDS_Binary_Operator IDSB
|
|
142
|
+
IDS_Trinary_Operator IDST
|
|
143
|
+
ID_Continue IDC
|
|
144
|
+
ID_Start IDS
|
|
145
|
+
Ideographic Ideo
|
|
146
|
+
Join_Control Join_C
|
|
147
|
+
Logical_Order_Exception LOE
|
|
148
|
+
Lowercase Lower
|
|
149
|
+
Math
|
|
150
|
+
Noncharacter_Code_Point NChar
|
|
151
|
+
Pattern_Syntax Pat_Syn
|
|
152
|
+
Pattern_White_Space Pat_WS
|
|
153
|
+
Quotation_Mark QMark
|
|
154
|
+
Radical
|
|
155
|
+
Regional_Indicator RI
|
|
156
|
+
Sentence_Terminal STerm
|
|
157
|
+
Soft_Dotted SD
|
|
158
|
+
Terminal_Punctuation Term
|
|
159
|
+
Unified_Ideograph UIdeo
|
|
160
|
+
Uppercase Upper
|
|
161
|
+
Variation_Selector VS
|
|
162
|
+
White_Space space
|
|
163
|
+
XID_Continue XIDC
|
|
164
|
+
XID_Start XIDS`.split(/\s/).map(e=>[mC(e),e])),cw=new Map([[`s`,KC(383)],[KC(383),`s`]]),lw=new Map([[KC(223),KC(7838)],[KC(107),KC(8490)],[KC(229),KC(8491)],[KC(969),KC(8486)]]),uw=new Map([pw(453),pw(456),pw(459),pw(498),...mw(8072,8079),...mw(8088,8095),...mw(8104,8111),pw(8124),pw(8140),pw(8188)]),dw=new Map([[`alnum`,qC`[\p{Alpha}\p{Nd}]`],[`alpha`,qC`\p{Alpha}`],[`ascii`,qC`\p{ASCII}`],[`blank`,qC`[\p{Zs}\t]`],[`cntrl`,qC`\p{Cc}`],[`digit`,qC`\p{Nd}`],[`graph`,qC`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,qC`\p{Lower}`],[`print`,qC`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,qC`[\p{P}\p{S}]`],[`space`,qC`\p{space}`],[`upper`,qC`\p{Upper}`],[`word`,qC`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,qC`\p{AHex}`]]);function fw(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function pw(e){let t=KC(e);return[t.toLowerCase(),t]}function mw(e,t){return fw(e,t).map(e=>pw(e))}var hw=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function gw(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};bw(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:QC(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};_C(e,_w,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return _C(e,vw,a),_C(e,yw,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var _w={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=$S();e.body[0].body.push(eC({negate:!0,body:r}),oC(`Any`));let i=$S();i.body[0].body.push(rC(`greedy`,0,1/0,e)),n(zw(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];ZC(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Dw(t.get(e));if(n){let t=$S({flags:n});t.body[0].body=e.body,e.body=[zw(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(zw(eC({body:[US({body:[WS(`string_end`)]}),US({body:[qS(10)]})]}),t));else if(c===`line_start`)o(zw(Iw(qC`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&Nw(e))o(zw(eC({negate:!0}),t));else if(d)throw Error(qC`Uses "\G" in a way that requires a subclass`);else o(Rw(WS(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(zw(Iw(qC`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${aw})(?!${aw})|(?<!${aw})(?=${aw}))`,n=`(?:(?<=${aw})(?=${aw})|(?<!${aw})(?!${aw}))`;o(zw(Iw(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Fw(n)&&(n=Ew(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Fw(r)&&(r=Ew(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(zw(JS({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(Rw(XS(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(zw(Lw(Iw(rw),l),t));return}if(s&&(c===`word`||u===`word`)){n(Rw(XS(`word`,{negate:l}),t));return}if(c===`any`)n(Rw(oC(`Any`),t));else if(c===`digit`)n(Rw(oC(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(qC`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=qC`\p{RI}{2}|${e}(?:\u200D${e})*`;n(zw(Iw(qC`(?>\r\n|${i?qC`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(Rw(oC(`AHex`,{negate:l}),t));else if(c===`newline`)n(zw(Iw(l?`[^
|
|
165
|
+
]`:`(?>\r
|
|
166
|
+
?|[
|
|
167
|
+
\v\f
\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${KC(e.codePointAt(0)-1)}${KC(e.codePointAt(2)+1)}-\u{10FFFF}`),n(zw(Iw(`[${e}]`),t))}else n(zw(Lw(Iw(dw.get(u)),l),t))}else if(c===`property`)sw.has(mC(u))||(e.key=`sc`);else if(c===`space`)n(Rw(oC(`space`,{negate:l}),t));else if(c===`word`)n(zw(Lw(Iw(aw),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=$S({flags:c});e.body[0].body=o(),i(zw(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&AS(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(qC`Uses "\K" in a way that's unsupported`);let o=eC({behind:!0});o.body[0].body=a(),i(zw(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(zw(eC({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=$S();t.body[0].body.push(e.body),e.body=zw(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=Aw(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(qC`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Fw(n)&&(n=Ew(n,t),e.ref=n)}},vw={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=Rw(ww(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&ZC(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=ZC(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=XC(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?ww(0):Cw(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Dw(Tw(o,e=>e.type===`Group`&&!!e.flags)),t=e?XC(r.globalFlags,e):r.globalFlags;xw(t,r.currentFlags)||(l=$S({flags:Ow(t)}),l.body[0].body.push(c))}n(zw(l,t),{traverse:!s})}},yw={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>Sw(t,e));i.length?i.length>1?n(zw($S({atomic:!0,body:i.reverse().map(e=>US({body:[GS(e.number)]}))}),t)):e.ref=i[0].number:n(zw(eC({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=KS();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&e.ref!==0&&(e.ref=t.reffedNodesByReferencer.get(e).number)}};function bw(e){_C(e,{"*"({node:e,parent:t}){e.parent=t}})}function xw(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Sw(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=kw(n.parent);for(let r of t){if(r===n)break;if(r===e||jw(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Cw(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Cw(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function ww(e){let t=aC(e);return t.isRecursive=!0,t}function Tw(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Ew(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Dw(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Ow({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function kw(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Aw(e){let t=e.find(e=>e.kind===`search_start`||Pw(e,{negate:!1})||!Mw(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=Aw(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function jw(e,t){let n=kw(e)??[];for(let e of n)if(e===t||jw(e,t))return!0;return!1}function Mw({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function Nw(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Pw(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&AS(e.body[0],{type:`Assertion`,kind:`search_start`})}function Fw(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Iw(e,t){let n=NS(e,{...t,unicodePropertyMap:sw}).body;return n.length>1||n[0].body.length>1?$S({body:n}):n[0].body[0]}function Lw(e,t){return e.negate=t,e}function Rw(e,t){return e.parent=t,e}function zw(e,t){return bw(e),e.parent=t,e}function Bw(e,t){let n=nw(t),r=QC(n.target,`ES2024`),i=QC(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];_C(e,Vw,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!(!e.flags.ignoreCase&&!o||s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,$C(Hw[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&ZC(f._captureTransfers,e.transferTo,[]).push(t)}),f}var Vw={"*":{enter({node:e},t){if(eT(e)){let n=t.getCurrentModI();t.pushModI(e.flags?XC({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){eT(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Jw(KC(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Yw(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&hw.has(e.value)&&t.setHasCasedChar()}},Hw={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?qC`\B`:qC`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=KC(e),r=Xw(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Jw(n)){let e=ow(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);JC.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(nT)&&(o=[qS(45),...o.filter(e=>!nT(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||JC.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=$S(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=US({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(JC.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=Xw(n,i),o=Xw(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Zw(Yw(e)).forEach(e=>{s.add(Array.isArray(e)?`${Xw(e[0],i)}-${Xw(e[1],i)}`:Xw(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:qC`[^\n]`;if(e===`digit`)return t?qC`\D`:qC`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&hw.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?qC`\P`:qC`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?qC`\W`:qC`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=XC(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${Qw(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+$w(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:qC`\g<${t}&R=${r}>`}},Uw=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),Ww=new Set([`-`,`\\`,`]`,`^`,`[`]),Gw=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),Kw=new Map([[9,qC`\t`],[10,qC`\n`],[11,qC`\v`],[12,qC`\f`],[13,qC`\r`],[8232,qC`\u2028`],[8233,qC`\u2029`],[65279,qC`\uFEFF`]]),qw=/^\p{Cased}$/u;function Jw(e){return qw.test(e)}function Yw(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=KC(e);if(!Jw(t))continue;let o=ow(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function Xw(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Kw.has(e))return Kw.get(e);if(e<32||e>126&&e<160||e>262143||t&&tT(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?Gw:Ww:Uw,a=KC(e);return(i.has(a)?`\\`:``)+a}function Zw(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function Qw(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function $w({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function eT({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function tT(e){return e>47&&e<58}function nT({type:e,value:t}){return e===`Character`&&t===45}var rT=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=aT(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(iT(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=oT(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function iT(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function aT(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)ZC(n,t,{}).transferTo=e;return n}function oT(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function sT(e,t){let n=cT(e,t);return n.options?new rT(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function cT(e,t){let n=nw(t),r=gw(NS(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:sw}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=Bw(r,n),a=BC(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=AC(NC(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function lT(e,t){return sT(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function uT(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>lT(e,{target:t.target}),{createScanner(e){return new zx(e,t)},createString(e){return{content:e}}}}async function dT(e){if(x_())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=g_.get(e);if(t!=null)return t;try{let t=__.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(M_,e)&&(t=M_[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return h_.has(e)||h_.set(e,n),n});return g_.set(e,n),await n}finally{g_.delete(e)}}function fT(e){return h_.get(e)??dT(e)}var pT=new Set;function mT(e){let t=[],n=new Set;for(let r of hT(e.themes)){let e=vT(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return mT({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return mT({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function hT(e){return gT(e)?[e]:e}function gT(e){return vT(e)||_T(e)}function _T(e){return typeof e.name==`string`&&typeof e.load==`function`}function vT(e){return typeof e.getThemes==`function`}function yT(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var bT=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},xT=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},ST=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function CT(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new bT(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new xT(i));let c=r,l=s().then(e=>{let a=yT(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new ST(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var wT=CT();function TT(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=wT.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,wT.getResolvedTheme(n)??wT.seedResolvedTheme(n,e);pT.has(n)||(pT.add(n),t.loadThemeSync(e))}}function ET({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:DT(t)}}function DT(e){return async()=>ab(yT(await e()))}var OT=`pierre`,kT=[`pierre-light`,`pierre-light-soft`],AT=[`pierre-dark`,`pierre-dark-soft`],jT=[...kT,...AT],MT=new Set(kT);function NT(e){return MT.has(e)?`light`:`dark`}var PT={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`},FT={"pierre-dark":()=>Y(()=>import(`./pierre-dark-sU4Zdns8.js`),[]),"pierre-dark-soft":()=>Y(()=>import(`./pierre-dark-soft-HXgun5vs.js`),[]),"pierre-dark-vibrant":()=>Y(()=>import(`./pierre-dark-vibrant-D4RhcSIK.js`),[]),"pierre-light":()=>Y(()=>import(`./pierre-light-DWBk51d8.js`),[]),"pierre-light-soft":()=>Y(()=>import(`./pierre-light-soft-CodEzPxf.js`),[]),"pierre-light-vibrant":()=>Y(()=>import(`./pierre-light-vibrant-B76X7i5Y.js`),[])};function IT(e){return async()=>({...(await FT[e]()).default,name:e})}function LT(e){return ET({name:e,collection:OT,colorScheme:NT(e),displayName:PT[e],load:IT(e)})}var RT=mT({themes:jT.map(e=>LT(e))}),zT=`shiki`,BT=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],VT=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),HT=new Set(BT);function UT(e){return HT.has(e)?`light`:`dark`}var WT={andromeeda:()=>Y(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>Y(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>Y(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>Y(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>Y(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>Y(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]),"catppuccin-latte":()=>Y(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>Y(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]),"catppuccin-mocha":()=>Y(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]),"dark-plus":()=>Y(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>Y(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>Y(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>Y(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>Y(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>Y(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>Y(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>Y(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>Y(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>Y(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>Y(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>Y(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>Y(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>Y(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>Y(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>Y(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>Y(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>Y(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>Y(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>Y(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>Y(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>Y(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]),"kanagawa-lotus":()=>Y(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]),"kanagawa-wave":()=>Y(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]),laserwave:()=>Y(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>Y(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>Y(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>Y(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>Y(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>Y(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>Y(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>Y(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>Y(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>Y(()=>import(`./monokai-B_bV9PQ9.js`),[]),"night-owl":()=>Y(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>Y(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>Y(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>Y(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]),"one-light":()=>Y(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>Y(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>Y(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>Y(()=>import(`./red-DX1BQOs8.js`),[]),"rose-pine":()=>Y(()=>import(`./rose-pine-aMsaMD1D.js`),[]),"rose-pine-dawn":()=>Y(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]),"rose-pine-moon":()=>Y(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]),"slack-dark":()=>Y(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>Y(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>Y(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>Y(()=>import(`./solarized-dark-UdsmMDCL.js`),[]),"solarized-light":()=>Y(()=>import(`./solarized-light-C1IUL_tW.js`),[]),"synthwave-84":()=>Y(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>Y(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>Y(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>Y(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>Y(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>Y(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function GT(e){return ET({name:e,collection:zT,colorScheme:UT(e),load:WT[e]})}var KT=mT({themes:Object.freeze([...BT.map(e=>GT(e)),...VT.map(e=>GT(e))])});function qT(e){if(x_())throw Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(wT.hasRegisteredTheme(e))return;let t=KT.getTheme(e);if(t!=null){wT.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function JT(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function YT(e){qT(e);let t=await wT.resolveTheme(e);return JT(e,t),t}function XT(e){return wT.getResolvedTheme(e)??YT(e)}var ZT;async function QT({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){ZT??=Ax({themes:[],langs:[`text`],engine:n===`shiki-wasm`?cv(Y(()=>import(`./wasm-BnjxR4X6.js`),[])):uT()});let r=eE(ZT)?await ZT:ZT;ZT=r;let i=[];for(let e of t){if(e===`text`||e===`ansi`)continue;let t=fT(e);`then`in t?i.push(t):b_(t,r)}let a=[];for(let t of e){let e=XT(t);`then`in e?a.push(e):TT(e,ZT)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{b_(e,r)}),Promise.all(a).then(e=>{TT(e,r)})]),r}function $T(){if(ZT!=null&&!(`then`in ZT))return ZT}function eE(e=ZT){return e!=null&&`then`in e}for(let e of RT.getThemes())wT.registerThemeIfAbsent(e.name,e.load);function tE(e=um){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function nE(e){for(let t of tE(e))if(!pT.has(t))return!1;return!0}function rE(e){return wT.hasResolvedThemes(e)}function iE(e,t){return Tm(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function aE(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function oE(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function sE(e){return jm({tagName:`div`,children:[jm({tagName:`div`,children:e.annotations?.map(e=>jm({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function cE(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function lE({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return jm({tagName:`div`,children:[t===`custom`?jm({tagName:`slot`,properties:{name:lm}}):uE({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[dE(r)]],properties:i})}function uE({name:e,prevName:t,iconType:n}){let r=[jm({tagName:`slot`,properties:{name:sm}}),Mm({name:cE(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(jm({tagName:`div`,children:[jm({tagName:`bdi`,children:[Am(t)]})],properties:{"data-prev-name":``}})),r.push(Mm({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(jm({tagName:`div`,children:[jm({tagName:`bdi`,children:[Am(e)]})],properties:{"data-title":``}})),jm({tagName:`div`,children:r,properties:{"data-header-content":``}})}function dE(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(jm({tagName:`span`,children:[Am(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(jm({tagName:`span`,children:[Am(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(jm({tagName:`slot`,properties:{name:cm}})),jm({tagName:`div`,children:t,properties:{"data-metadata":``}})}function fE(e){return jm({tagName:`pre`,properties:pE(e)})}function pE({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,tabIndex:0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var mE=new Map,hE=0,gE={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function _E(e){if(mE.has(e))return mE.get(e)??`text`;if(gE[e]!=null)return gE[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(mE.has(t[1]))return mE.get(t[1])??`text`;if(gE[t[1]]!=null)return gE[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return mE.has(n)?mE.get(n)??`text`:gE[n]??`text`}function vE(){return hE}function yE(){return Object.fromEntries(mE)}function bE(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:[e??`text`],themes:tE(t),preferredHighlighter:n}}function xE(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function SE(e){return e.replace(/\n$|\r\n$/,``)}function CE(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(Am(`
|
|
168
|
+
`)),e}var wE=Symbol(`no-token`),TE=Symbol(`multiple-tokens`);function EE(e){let t=DE(e);if(t!=null)return t;let n=wE,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){kE(e,a);for(let t of e.children)OE(t)}else OE(e);r.push(e),i=[],a=void 0;return}for(let e of i)OE(e);r.push(jm({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==wE){if(e===TE){n=TE;return}if(n===wE){n=e;return}n!==e&&(n=TE)}};for(let t of e.children){let e=t.type===`element`?EE(t):wE;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function DE(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function OE(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)OE(t)}}function kE(e,t){e.properties[`data-char`]=t}function AE(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=typeof e==`string`?e:a(e),s=t+jE(o)+n;return s=r(s),i.has(s)||i.set(s,typeof e==`string`?e:{...e}),s}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function jE(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function ME(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=Nm(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&EE(a),i.push(CE(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(PE,NE),{state:n,transformers:r,toClass:NE}}var NE=AE({classPrefix:`hl-`}),PE={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function FE(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var IE=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,LE=/^0(?:\.0+)?%?$/;function RE(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function zE(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function BE(e){if(e==null)return null;let t=zE(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function VE(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||IE.test(t))return!0;let n=RE(t);return n!=null&&LE.test(n)}function HE(e,t,n){if(t==null||n==null)return!1;let r=BE(e),i=BE(t),a=BE(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var UE=new WeakMap;function WE(e){let t=UE.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;GE(r,`editor.background`,i),GE(r,`editor.foreground`,a),GE(r,`sideBar.background`,o),GE(r,`sideBar.foreground`,s),GE(r,`input.background`,n[`input.background`]??o),GE(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),GE(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),GE(r,`gitDecoration.addedResourceForeground`,KE(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),GE(r,`gitDecoration.modifiedResourceForeground`,KE(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),GE(r,`gitDecoration.deletedResourceForeground`,KE(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(VE(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(VE(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(qE(l,o)||HE(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return UE.set(e,u),u}function GE(e,t,n){n!=null&&n!==``&&(e[t]=n)}function KE(...e){for(let t of e)if(t!=null&&t!==``)return t}function qE(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function JE({theme:e=um,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=WE(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${FE(`global`)}fg:${a.fg};`,r+=`${FE(`global`)}bg:${a.bg};`,r+=YE(i,n)}else{let n=t.getTheme(e.dark),i=WE(n);r+=`${FE(`global`)}dark:${i.fg};`,r+=`${FE(`global`)}dark-bg:${i.bg};`,r+=YE(n,`dark`),n=t.getTheme(e.light),i=WE(n),r+=`${FE(`global`)}light:${i.fg};`,r+=`${FE(`global`)}light-bg:${i.bg};`,r+=YE(n,`light`)}return r}function YE(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${FE(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${FE(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${FE(`global`)}${t}modified-color:${a};`),n}function XE(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function ZE({lines:e,startingLine:t=0,totalLines:n=1/0,callback:r}){let i=Math.min(t+n,e.length),a=(()=>{let t=e.at(-1);return t===``||t===`
|
|
169
|
+
`||t===`\r
|
|
170
|
+
`||t===`\r`?Math.max(0,e.length-2):e.length-1})();for(let n=t;n<i;n++){let t=n===a;if(r({lineIndex:n,lineNumber:n+1,content:e[n],isLastLine:t})===!0||t)break}}function QE(e){return e===``?[]:e.split(nm)}var $E={forcePlainText:!1};function eD(e,t,{theme:n=um,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,startingLine:o,totalLines:s,lines:c}=$E){a?(o??=0,s??=1/0):(o=0,s=1/0);let l=o>0||s<1/0,{state:u,transformers:d}=ME(i),f=a?`text`:e.lang??_E(e.name),p=typeof n==`string`?t.getTheme(n).type:void 0,m=JE({theme:n,highlighter:t});u.lineInfo=e=>({type:`context`,lineIndex:e-1+o,lineNumber:e+o});let h=typeof n==`string`?{lang:f,theme:n,transformers:d,defaultColor:!1,cssVariablePrefix:FE(`token`),tokenizeMaxLineLength:r}:{lang:f,themes:n,transformers:d,defaultColor:!1,cssVariablePrefix:FE(`token`),tokenizeMaxLineLength:r},g=XE(t.codeToHast(l?tD(c??QE(e.contents),o,s):SE(e.contents),h)),_=l?Array(o):g;return l&&_.push(...g),{code:_,themeStyles:m,baseThemeType:p}}function tD(e,t,n){let r=``;return ZE({lines:e,startingLine:t,totalLines:n,callback({content:e}){r+=e}}),r}function nD(e,t){return jm({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}function rD(e){return(e.lang??_E(e.name))===`text`}function iD(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}var aD=-1,oD=class{__id=`file-renderer:${++aD}`;highlighter;renderCache;computedLang=`text`;lineAnnotations={};lineCache;constructor(e={theme:um},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=nE(e.theme??um)?$T():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(let t of e){let e=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=e,e.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0}clearRenderCache(){this.renderCache=void 0}hydrate(e){let{options:t}=this.getRenderOptions(e),n=sD(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength()),r=this.workerManager?.getFileResultCache(e);r!=null&&!iE(t,r.options)&&(r=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!rD(e),result:n?void 0:r?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter??(this.computedLang=e.lang??_E(e.name),this.initializeHighlighter())}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();let{theme:e=um,tokenizeMaxLineLength:t=1e3}=this.options;return{theme:e,useTokenTransformer:iD(this.options),tokenizeMaxLineLength:t}})(),{renderCache:n}=this;return n?.result==null||!aE(e,n.file)||!iE(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,QE(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:QE(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,t=vm){if(e==null)return;let{options:n,forceHighlight:r}=this.getRenderOptions(e),i=this.getMatchingWorkerResultCache(e,n);i!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...i},r=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};let a=this.getOrCreateLineCache(e),o=e.contents.length>0,s=!o||rD(e)||sD(a.length,this.getTokenizeMaxLength()),c=!aE(e,this.renderCache.file),l=!oE(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(s||this.renderCache.result==null||!this.renderCache.highlighted&&(c||l))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||c||l||r)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,a)),this.renderCache.renderRange=t),!s&&o&&(!this.renderCache.highlighted||r)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??_E(e.name);let t=this.highlighter!=null&&nE(n.theme),i=this.highlighter!=null&&y_(this.computedLang),a=!s&&i;if(this.highlighter!=null&&t&&(r||s||!this.renderCache.highlighted&&a||this.renderCache.result==null)){let{result:t,options:n}=this.renderFileWithHighlighter(e,this.highlighter,s||!i);this.renderCache={file:e,options:n,highlighted:a,result:t,renderRange:void 0}}(!t||!s&&!i)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n,!s)})}return this.renderCache.result==null?void 0:this.processFileResult(this.renderCache.file,t,this.renderCache.result)}async asyncRender(e,t=vm){let{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){let t=sD(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??_E(e.name);let n=this.highlighter!=null&&rE(tE(this.options.theme)),r=t||this.highlighter!=null&&y_(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e);return{result:eD(e,t,r,{forcePlainText:n}),options:r}}processFileResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{disableFileHeader:a=!1}=this.options,o=[],s=Pm(),c=this.getOrCreateLineCache(e),l=0;return ZE({lines:c,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:t,lineNumber:r})=>{let i=n[t];if(i==null){let n=`FileRenderer.processFileResult: Line doesnt exist`;throw console.error(n,{name:e.name,lineIndex:t,lineNumber:r,lines:c}),Error(n)}if(i!=null){s.children.push(Fm(`context`,r,`${t}`)),o.push(i),l++;let e=this.lineAnnotations[r];e!=null&&(s.children.push(Im(`context`,`annotation`,1)),o.push(sE({type:`annotation`,hunkIndex:0,lineIndex:r,annotations:e.map(e=>xE(e))})),l++)}}}),s.properties.style=`grid-row: span ${l}`,{gutterAST:s.children??[],contentAST:o,preAST:this.createPreElement(c.length),headerAST:a?void 0:this.renderHeader(e),totalLines:c.length,rowCount:l,themeStyles:r,baseThemeType:i,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderHeader(e){let{headerRenderMode:t=`default`,stickyHeader:n=!1}=this.options;return lE({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return Hg(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(jm({tagName:`code`,children:this.renderCodeAST(e),properties:{"data-code":``}})),{...e.preAST,children:t}}renderCodeAST(e){let t=Pm();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,nD(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return Hg(t?jm({tagName:`code`,children:e,properties:{"data-code":``}}):e)}async initializeHighlighter(){return this.highlighter=await QT(bE(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n,r=!0){if(this.renderCache==null)return;let i=!aE(e,this.renderCache.file)||!this.renderCache.highlighted||!iE(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){let n=this.workerManager?.getFileResultCache(e);if(n!=null&&iE(t,n.options))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&aE(e,n.file)&&iE(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){let{disableLineNumbers:t=!1,overflow:n=`scroll`}=this.options;return fE({type:`file`,diffIndicators:`none`,disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function sD(e,t){return e>t}var cD=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
171
|
+
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
172
|
+
<path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
|
|
173
|
+
</symbol>
|
|
174
|
+
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
175
|
+
<path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
|
|
176
|
+
</symbol>
|
|
177
|
+
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
178
|
+
<path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
|
|
179
|
+
</symbol>
|
|
180
|
+
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
181
|
+
<path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
|
|
182
|
+
</symbol>
|
|
183
|
+
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
184
|
+
<path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
|
|
185
|
+
</symbol>
|
|
186
|
+
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
187
|
+
<path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
|
|
188
|
+
</symbol>
|
|
189
|
+
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
190
|
+
<path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
|
|
191
|
+
</symbol>
|
|
192
|
+
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
193
|
+
<path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
|
|
194
|
+
</symbol>
|
|
195
|
+
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
196
|
+
<path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
|
|
197
|
+
</symbol>
|
|
198
|
+
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
199
|
+
<path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
|
|
200
|
+
</symbol>
|
|
201
|
+
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
202
|
+
<path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
203
|
+
</symbol>
|
|
204
|
+
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
205
|
+
<path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
|
|
206
|
+
</symbol>
|
|
207
|
+
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
208
|
+
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
|
|
209
|
+
</symbol>
|
|
210
|
+
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
211
|
+
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
|
|
212
|
+
</symbol>
|
|
213
|
+
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
214
|
+
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
|
|
215
|
+
</symbol>
|
|
216
|
+
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
217
|
+
<path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
|
|
218
|
+
</symbol>
|
|
219
|
+
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
220
|
+
<path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
|
|
221
|
+
</symbol>
|
|
222
|
+
</svg>`;function lD(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function uD(e,t){return e==null||t==null?e===t:fD(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}var dD={};function fD(e=dD,t=dD){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function pD(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function mD(){let e=document.createElement(`div`);return e.slot=`gutter-utility-slot`,e.style.position=`absolute`,e.style.top=`0`,e.style.bottom=`0`,e.style.textAlign=`center`,e.style.whiteSpace=`normal`,e.style.touchAction=`none`,e}function hD(){let e=document.createElement(`style`);return e.setAttribute(fm,``),e}var gD=`@layer base,theme,rendered,unsafe;@layer base{:host{--diffs-font-fallback:"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace;--diffs-header-font-fallback:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;--diffs-mixer:light-dark(#000,#fff);--diffs-gap-fallback:8px;--diffs-scrollbar-gutter-fallback:6px;--diffs-scrollbar-gutter:var(--diffs-scrollbar-gutter-override,var(--diffs-scrollbar-gutter-measured,var(--diffs-scrollbar-gutter-fallback)));--diffs-added-light:#0dbe4e;--diffs-added-dark:#5ecc71;--diffs-modified-light:#009fff;--diffs-modified-dark:#69b1ff;--diffs-deleted-light:#ff2e3f;--diffs-deleted-dark:#ff6762;color-scheme:light dark;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));font-size:var(--diffs-font-size,13px);line-height:var(--diffs-line-height,20px);font-feature-settings:var(--diffs-font-features);--diffs-bg:light-dark(var(--diffs-light-bg,#fff),var(--diffs-dark-bg,#000));--diffs-bg-buffer:var(--diffs-bg-buffer-override,light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));--diffs-bg-context:var(--diffs-bg-context-override,light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));--diffs-bg-context-gutter:var(--diffs-bg-context-gutter-override,light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)),color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));--diffs-bg-separator:var(--diffs-bg-separator-override,light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));--diffs-fg:light-dark(var(--diffs-light,#000),var(--diffs-dark,#fff));--diffs-fg-number:var(--diffs-fg-number-override,light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)),color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));--diffs-fg-conflict-marker:var(--diffs-fg-conflict-marker-override,var(--diffs-fg-number));--diffs-deletion-base:var(--diffs-deletion-color-override,light-dark(var(--diffs-light-deletion-color,var(--diffs-deletion-color,var(--diffs-deleted-light))),var(--diffs-dark-deletion-color,var(--diffs-deletion-color,var(--diffs-deleted-dark)))));--diffs-addition-base:var(--diffs-addition-color-override,light-dark(var(--diffs-light-addition-color,var(--diffs-addition-color,var(--diffs-added-light))),var(--diffs-dark-addition-color,var(--diffs-addition-color,var(--diffs-added-dark)))));--diffs-modified-base:var(--diffs-modified-color-override,light-dark(var(--diffs-light-modified-color,var(--diffs-modified-color,var(--diffs-modified-light))),var(--diffs-dark-modified-color,var(--diffs-modified-color,var(--diffs-modified-dark)))));--diffs-bg-deletion:var(--diffs-bg-deletion-override,light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)),color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));--diffs-bg-deletion-emphasis:var(--diffs-bg-deletion-emphasis-override,light-dark(rgb(from var(--diffs-deletion-base) r g b / .15),rgb(from var(--diffs-deletion-base) r g b / .2)));--diffs-bg-addition:var(--diffs-bg-addition-override,light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)),color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));--diffs-bg-addition-emphasis:var(--diffs-bg-addition-emphasis-override,light-dark(rgb(from var(--diffs-addition-base) r g b / .15),rgb(from var(--diffs-addition-base) r g b / .2)));--diffs-selection-base:var(--diffs-modified-base);--diffs-selection-number-fg:light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));background-color:var(--diffs-bg);color:var(--diffs-fg);display:block}pre,code,[data-error-wrapper]{isolation:isolate;font-family:var(--diffs-font-family,var(--diffs-font-fallback));outline:none;margin:0;padding:0;display:block}pre,code{background-color:var(--diffs-bg)}code{contain:content}*,:before,:after{box-sizing:border-box}[data-icon-sprite]{display:none}[data-diffs-header],[data-separator]{font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback))}[data-diffs-header][data-sticky]{z-index:1;background-color:var(--diffs-bg);position:sticky;top:0}[data-file-info]{color:var(--fg);background-color:color-mix(in lab, var(--bg) 98%, var(--fg));border-block:1px solid color-mix(in lab, var(--bg) 95%, var(--fg));padding:10px;font-weight:700}[data-diff],[data-file]{--diffs-grid-number-column-width:minmax(min-content, max-content);--diffs-code-grid:var(--diffs-grid-number-column-width) 1fr}[data-dehydrated]:is([data-diff],[data-file]){--diffs-code-grid:var(--diffs-grid-number-column-width) minmax(0, 1fr)}:is([data-diff],[data-file]):hover [data-code]::-webkit-scrollbar-thumb{background-color:var(--diffs-bg-context)}@supports (-webkit-touch-callout:none){:host{--diffs-scrollbar-gutter-fallback:0px}}[data-line] span{color:light-dark(var(--diffs-token-light,var(--diffs-light)),var(--diffs-token-dark,var(--diffs-dark)));background-color:light-dark(var(--diffs-token-light-bg,inherit),var(--diffs-token-dark-bg,inherit));font-weight:light-dark(var(--diffs-token-light-font-weight,inherit),var(--diffs-token-dark-font-weight,inherit));font-style:light-dark(var(--diffs-token-light-font-style,inherit),var(--diffs-token-dark-font-style,inherit));-webkit-text-decoration:light-dark(var(--diffs-token-light-text-decoration,inherit),var(--diffs-token-dark-text-decoration,inherit));text-decoration:light-dark(var(--diffs-token-light-text-decoration,inherit),var(--diffs-token-dark-text-decoration,inherit))}[data-line],[data-gutter-buffer],[data-column-number],[data-line-annotation],[data-no-newline],[data-merge-conflict],[data-merge-conflict-actions]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-computed-diff-line-bg:var(--diffs-bg);--diffs-computed-selected-line-bg:var(--diffs-bg);color:var(--diffs-fg);background-color:var(--diffs-line-bg,var(--diffs-bg))}@media (pointer:fine){:is([data-line],[data-gutter-buffer],[data-column-number],[data-line-annotation],[data-no-newline],[data-merge-conflict],[data-merge-conflict-actions]):where([data-hovered]){--diffs-computed-hovered-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-selected-line-bg) 97%, var(--diffs-bg-hover-override,var(--diffs-mixer))),color-mix(in lab, var(--diffs-computed-selected-line-bg) 91%, var(--diffs-bg-hover-override,var(--diffs-mixer))));--diffs-line-bg:var(--diffs-computed-hovered-line-bg,inherit)}}[data-decoration-bg]:is([data-line],[data-no-newline]){--mix-deco-light:92%;--mix-deco-dark:85%}[data-decoration-bg][data-decoration-bg-depth="2"]:is([data-line],[data-no-newline]){--mix-deco-light:88%;--mix-deco-dark:80%}[data-decoration-bg][data-decoration-bg-depth="3"]:is([data-line],[data-no-newline]){--mix-deco-light:85%;--mix-deco-dark:78%}@media (pointer:fine){[data-decoration-bg][data-hovered]:is([data-line],[data-no-newline]):not([data-selected-line]){--mix-deco-light:85%;--mix-deco-dark:85%}[data-decoration-bg][data-hovered][data-decoration-bg-depth="2"]:is([data-line],[data-no-newline]):not([data-selected-line]){--mix-deco-light:83%;--mix-deco-dark:83%}[data-decoration-bg][data-hovered][data-decoration-bg-depth="3"]:is([data-line],[data-no-newline]):not([data-selected-line]){--mix-deco-light:81%;--mix-deco-dark:81%}}[data-decoration-bg]:is([data-line],[data-no-newline]){--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) var(--mix-deco-light), var(--diffs-decoration-bg)),color-mix(in lab, var(--diffs-bg) var(--mix-deco-dark), var(--diffs-decoration-bg)));--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-decoration-bg);--diffs-line-bg:var(--diffs-computed-decoration-bg)}[data-line-annotation],[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context);--diffs-computed-decoration-bg:var(--diffs-annotation-bg);--diffs-computed-diff-line-bg:var(--diffs-annotation-bg);--diffs-computed-selected-line-bg:var(--diffs-annotation-bg);--diffs-line-bg:var(--diffs-annotation-bg)}[data-merge-conflict-actions],[data-gutter-buffer=merge-conflict-action],[data-gutter-buffer=merge-conflict-marker-base],[data-gutter-buffer=merge-conflict-marker-separator],[data-merge-conflict=marker-base],[data-merge-conflict=marker-separator]{--diffs-computed-decoration-bg:var(--diffs-bg-context);--diffs-computed-diff-line-bg:var(--diffs-bg-context);--diffs-computed-selected-line-bg:var(--diffs-bg-context);--diffs-line-bg:var(--diffs-bg-context)}[data-gutter-buffer=merge-conflict-marker-start],[data-merge-conflict=marker-start]{--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) 78%, var(--conflict-bg-current-header-override,var(--diffs-addition-base))),color-mix(in lab, var(--diffs-bg) 68%, var(--conflict-bg-current-header-override,var(--diffs-addition-base))));--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-decoration-bg);--diffs-line-bg:var(--diffs-computed-decoration-bg)}[data-gutter-buffer=merge-conflict-marker-end],[data-merge-conflict=marker-end]{--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) 78%, var(--conflict-bg-incoming-header-override,var(--diffs-modified-base))),color-mix(in lab, var(--diffs-bg) 68%, var(--conflict-bg-incoming-header-override,var(--diffs-modified-base))));--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-decoration-bg);--diffs-line-bg:var(--diffs-computed-decoration-bg)}[data-has-merge-conflict] [data-line-annotation],[data-has-merge-conflict] [data-gutter-buffer=annotation]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-computed-diff-line-bg:var(--diffs-bg);--diffs-computed-selected-line-bg:var(--diffs-bg);--diffs-line-bg:var(--diffs-bg)}:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number]{--mix-light:91%;--mix-dark:85%}:where([data-background]) [data-line],:where([data-background]) [data-no-newline]{--mix-light:88%;--mix-dark:80%}:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]{--diffs-diff-line-mix-target:var(--diffs-bg)}[data-line-type=change-deletion]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--diffs-bg-deletion-override,var(--diffs-deletion-base))}@media (pointer:fine){[data-line-type=change-deletion][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:75%}}[data-line-type=change-deletion]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-deletion-override,var(--diffs-deletion-base));--diffs-diff-line-mix-target:var(--diffs-bg-deletion-number-override,var(--diffs-deletion-base))}[data-line-type=change-deletion]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-line-type=change-addition]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--diffs-bg-addition-override,var(--diffs-addition-base))}@media (pointer:fine){[data-line-type=change-addition][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:70%}}[data-line-type=change-addition]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-addition-override,var(--diffs-addition-base));--diffs-diff-line-mix-target:var(--diffs-bg-addition-number-override,var(--diffs-addition-base))}[data-line-type=change-addition]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-merge-conflict=current]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--conflict-bg-current-override,var(--diffs-addition-base))}[data-merge-conflict=current]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-addition-override,var(--diffs-addition-base));--diffs-diff-line-mix-target:var(--conflict-bg-current-number-override,var(--diffs-addition-base))}@media (pointer:fine){[data-merge-conflict=current][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:70%}}[data-merge-conflict=current]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-merge-conflict=incoming]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--conflict-bg-incoming-override,var(--diffs-modified-base))}[data-merge-conflict=incoming]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):where([data-gutter-buffer],[data-column-number]){color:var(--diffs-modified-base);--diffs-diff-line-mix-target:var(--conflict-bg-incoming-number-override,var(--diffs-modified-base))}@media (pointer:fine){[data-merge-conflict=incoming][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:70%}}[data-merge-conflict=incoming]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]{--diffs-selection-mix-target:var(--diffs-bg-selection-override,var(--diffs-selection-base))}[data-selected-line]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]){--mix-selection-light:82%;--mix-selection-dark:75%}@media (pointer:fine){[data-selected-line][data-hovered]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):not([data-merge-conflict],[data-line-type=change-addition],[data-line-type=change-deletion]){--mix-selection-light:75%;--mix-selection-dark:70%}}[data-selected-line]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-gutter-buffer],[data-column-number]){--mix-selection-light:75%;--mix-selection-dark:60%;--diffs-selection-mix-target:var(--diffs-bg-selection-number-override,var(--diffs-selection-base))}@media (pointer:fine){[data-selected-line][data-hovered]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-gutter-buffer],[data-column-number]):not([data-merge-conflict],[data-line-type=change-addition],[data-line-type=change-deletion]){--mix-selection-light:70%;--mix-selection-dark:55%}}[data-selected-line]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]){--diffs-computed-selected-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-diff-line-bg) var(--mix-selection-light), var(--diffs-selection-mix-target)),color-mix(in lab, var(--diffs-computed-diff-line-bg) var(--mix-selection-dark), var(--diffs-selection-mix-target)));--diffs-line-bg:var(--diffs-computed-selected-line-bg,inherit)}[data-selected-line]:is([data-gutter-buffer],[data-column-number]){color:var(--diffs-selection-number-fg)}[data-no-newline]{-webkit-user-select:none;user-select:none}[data-no-newline] span{opacity:.6}[data-diff-type=split][data-overflow=scroll]{grid-template-columns:1fr 1fr;display:grid}[data-diff-type=split][data-overflow=scroll] [data-additions]{border-left:1px solid var(--diffs-bg)}[data-diff-type=split][data-overflow=scroll] [data-deletions]{border-right:1px solid var(--diffs-bg)}[data-code]{grid-auto-flow:dense;grid-template-columns:var(--diffs-code-grid);overflow:var(--diffs-overflow-override,scroll) clip;overscroll-behavior-x:none;tab-size:var(--diffs-tab-size,2);padding-top:var(--diffs-gap-block,var(--diffs-gap-fallback));padding-bottom:max(0px, calc(var(--diffs-gap-block,var(--diffs-gap-fallback)) - var(--diffs-scrollbar-gutter)));scrollbar-gutter:stable;align-self:flex-start;display:grid}[data-diffs-scrollbar-measure]{opacity:0;pointer-events:none;scrollbar-gutter:auto;grid-template-columns:none;width:100px;height:100px;padding:0;position:absolute;top:-200px;left:-200px}[data-container-size]{container-type:inline-size}[data-code]::-webkit-scrollbar{width:0;height:var(--diffs-scrollbar-gutter)}[data-code]::-webkit-scrollbar-track{background:0 0}[data-code]::-webkit-scrollbar-thumb{background-color:#0000;background-clip:content-box;border:1px solid #0000;border-radius:3px}[data-code]::-webkit-scrollbar-corner{background-color:#0000}@supports ((-moz-appearance:none)){[data-code]{scrollbar-width:thin;scrollbar-color:var(--diffs-bg-context) transparent;padding-bottom:var(--diffs-gap-block,var(--diffs-gap-fallback))}}:is([data-diffs-header]~[data-diff],[data-diffs-header]~[data-file]) [data-code],[data-overflow=wrap]:is([data-diffs-header]~[data-diff],[data-diffs-header]~[data-file]){padding-top:0}[data-gutter]{grid-template-rows:subgrid;grid-template-columns:subgrid;z-index:3;background-color:var(--diffs-bg);grid-column:1;display:grid;position:relative}[data-gutter] [data-gutter-buffer],[data-gutter] [data-column-number]{border-right:var(--diffs-gap-style,2px solid var(--diffs-bg))}[data-content]{grid-template-rows:subgrid;grid-template-columns:subgrid;background-color:var(--diffs-bg);grid-column:2;min-width:0;display:grid}[data-diff-type=split][data-overflow=wrap]{grid-auto-flow:dense;grid-template-columns:repeat(2, var(--diffs-code-grid));padding-block:var(--diffs-gap-block,var(--diffs-gap-fallback));display:grid}[data-diff-type=split][data-overflow=wrap] [data-deletions]{display:contents}:is([data-diff-type=split][data-overflow=wrap] [data-deletions]) [data-gutter]{grid-column:1}:is([data-diff-type=split][data-overflow=wrap] [data-deletions]) [data-content]{border-right:1px solid var(--diffs-bg);grid-column:2}[data-diff-type=split][data-overflow=wrap] [data-additions]{display:contents}:is([data-diff-type=split][data-overflow=wrap] [data-additions]) [data-gutter]{border-left:1px solid var(--diffs-bg);grid-column:3}:is([data-diff-type=split][data-overflow=wrap] [data-additions]) [data-content]{grid-column:4}[data-overflow=scroll] [data-gutter]{position:sticky;left:0}[data-interactive-lines] [data-line]{cursor:pointer}[data-interactive-line-numbers] [data-column-number]{cursor:pointer;touch-action:none}[data-content-buffer],[data-gutter-buffer]{-webkit-user-select:none;user-select:none;min-height:1lh;position:relative}[data-gutter-buffer]{padding-left:2ch;padding-right:1ch}[data-gutter-buffer]:before{content:"";min-width:var(--diffs-min-number-column-width,var(--diffs-min-number-column-width-default,3ch));display:block}[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context-gutter);min-height:0}[data-gutter-buffer=buffer]{--diffs-line-bg:var(--diffs-bg-context-gutter)}[data-content-buffer]{background-position:5px 0;background-size:8px 8px;background-origin:border-box;background-image:repeating-linear-gradient(-45deg, transparent, transparent 4.242px, var(--diffs-bg-buffer) 4.242px, var(--diffs-bg-buffer) 5.656px);grid-column:1}[data-separator]{box-sizing:content-box;background-color:var(--diffs-bg)}[data-separator=simple]{min-height:4px}[data-separator=line-info],[data-separator=line-info-basic],[data-separator=metadata],[data-separator=simple]{background-color:var(--diffs-bg-separator)}[data-separator=line-info],[data-separator=line-info-basic],[data-separator=metadata]{height:32px;position:relative}[data-separator-wrapper]{-webkit-user-select:none;user-select:none;fill:currentColor;background-color:var(--diffs-bg);align-items:center;height:100%;display:flex;position:absolute;inset-inline:0}[data-content] [data-separator-wrapper]{display:none}[data-separator=metadata] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);height:100%;color:var(--diffs-fg-number);white-space:nowrap;text-overflow:ellipsis;min-width:min-content;padding-inline:1ch;inset-inline:100% auto;overflow:hidden}[data-separator=line-info]{margin-block:var(--diffs-gap-block,var(--diffs-gap-fallback))}[data-separator=line-info] [data-separator-wrapper]{min-width:16px}[data-separator=line-info-basic],[data-separator=metadata]{margin-block:0}[data-separator=line-info][data-separator-first]{margin-top:0}[data-separator=line-info][data-separator-last]{margin-bottom:0}[data-expand-index] [data-separator-wrapper]{grid-template-columns:32px auto;display:grid}[data-expand-index] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:32px 32px auto}[data-expand-button],[data-separator-content]{background-color:var(--diffs-bg-separator);flex:none;align-items:center;display:flex}[data-expand-index] [data-separator-content]:hover{cursor:pointer;text-decoration:underline}[data-expand-button]{cursor:pointer;min-width:32px;color:var(--diffs-fg-number);border-right:2px solid var(--diffs-bg);flex-shrink:0;justify-content:center;align-self:stretch}[data-expand-button]:hover{color:var(--diffs-fg)}[data-expand-button][data-expand-all-button]{display:none}[data-expand-down] [data-icon]{transform:scaleY(-1)}[data-separator-content]{height:100%;color:var(--diffs-fg-number);flex:auto;justify-content:flex-start;padding:0 1ch;overflow:hidden}:is([data-separator=line-info],[data-separator=line-info-basic]) [data-separator-content]{-webkit-user-select:none;user-select:none;height:100%;overflow:clip}[data-unmodified-lines]{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;display:block;overflow:hidden}@supports (width:1cqi){[data-unified] [data-separator=line-info] [data-separator-wrapper]{padding-inline:var(--diffs-gap-inline,var(--diffs-gap-fallback));width:100cqi}:is([data-unified] [data-separator=line-info] [data-separator-wrapper]) [data-separator-content]{border-radius:6px}[data-unified] [data-separator=line-info][data-expand-index] [data-separator-wrapper] [data-separator-content]{border-top-left-radius:unset;border-bottom-left-radius:unset}[data-gutter] [data-separator=line-info] [data-separator-wrapper]{padding-left:var(--diffs-gap-inline,var(--diffs-gap-fallback))}[data-gutter] [data-separator=line-info] [data-separator-content]{border-top-left-radius:6px;border-bottom-left-radius:6px}[data-gutter] [data-separator=line-info][data-expand-index] [data-separator-content]{border-top-left-radius:unset;border-bottom-left-radius:unset}[data-additions] [data-content] [data-separator=line-info]{background-color:var(--diffs-bg)}:is([data-additions] [data-content] [data-separator=line-info]) [data-separator-wrapper]{display:none}[data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);border-top-right-radius:6px;border-bottom-right-radius:6px;height:100%;display:block}:is([data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]) [data-separator-content],:is([data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]) [data-expand-button]{display:none}[data-overflow=scroll] [data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]{width:calc(100cqi - var(--diffs-gap-inline,var(--diffs-gap-fallback)))}[data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);height:100%;margin-right:var(--diffs-gap-inline,var(--diffs-gap-fallback));border-top-right-radius:6px;border-bottom-right-radius:6px;display:block}:is([data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]) [data-separator-content],:is([data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]) [data-expand-button]{display:none}:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-both],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-down],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}@media (pointer:fine){[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:unset}[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-down]{border-bottom-left-radius:6px;border-top-left-radius:unset}}}@media (pointer:coarse){[data-separator=line-info-basic] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:34px 34px auto}:is([data-separator=line-info-basic] [data-separator-wrapper][data-separator-multi-button]) [data-separator-content]{grid-column:unset;grid-row:unset}@supports (width:1cqi){:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-both],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-down],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up],[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-down]{border-bottom-left-radius:unset;border-top-left-radius:unset}}}@media (pointer:fine){[data-separator-wrapper][data-separator-multi-button]{grid-template-rows:50% 50%;display:grid}[data-separator-wrapper][data-separator-multi-button] [data-separator-content]{grid-area:1/2/-1;min-width:min-content}[data-separator-wrapper][data-separator-multi-button] [data-expand-button]{grid-column:1}[data-separator=line-info] [data-separator-wrapper],[data-separator=line-info] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:34px auto}[data-separator=line-info-basic][data-expand-index] [data-separator-wrapper]{grid-template-columns:100% auto}:is(:is([data-separator=line-info],[data-separator=line-info-basic]) [data-separator-multi-button]) [data-expand-up]{border-bottom:1px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg)}:is(:is([data-separator=line-info],[data-separator=line-info-basic]) [data-separator-multi-button]) [data-expand-down]{border-top:1px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg)}}[data-additions] [data-gutter] [data-separator-wrapper],[data-additions] [data-separator=line-info-basic] [data-separator-wrapper],[data-content] [data-separator-wrapper]{display:none}[data-line-annotation]{min-height:var(--diffs-annotation-min-height,0);z-index:2}[data-merge-conflict-actions]{z-index:2}[data-separator=custom]{grid-template-columns:subgrid;display:grid}[data-line],[data-column-number],[data-no-newline]{padding-inline:1ch;position:relative}[data-indicators=classic] [data-line]{padding-inline-start:2ch}:is([data-no-newline]:is([data-indicators=classic] [data-line-type=change-addition],[data-indicators=classic] [data-line-type=change-deletion]),[data-line]:is([data-indicators=classic] [data-line-type=change-addition],[data-indicators=classic] [data-line-type=change-deletion])):before{-webkit-user-select:none;user-select:none;width:1ch;height:1lh;display:inline-block;position:absolute;top:0;left:0}:is([data-line]:is([data-indicators=classic] [data-line-type=change-addition]),[data-no-newline]:is([data-indicators=classic] [data-line-type=change-addition])):before{content:"+";color:var(--diffs-addition-base)}:is([data-line]:is([data-indicators=classic] [data-line-type=change-deletion]),[data-no-newline]:is([data-indicators=classic] [data-line-type=change-deletion])):before{content:"-";color:var(--diffs-deletion-base)}[data-column-number]:is([data-indicators=bars] [data-line-type=change-deletion],[data-indicators=bars] [data-line-type=change-addition]):before{content:"";-webkit-user-select:none;user-select:none;contain:strict;width:4px;height:100%;display:block;position:absolute;top:0;left:0}[data-column-number]:is([data-indicators=bars] [data-line-type=change-deletion]):before{background-image:linear-gradient(0deg, var(--diffs-bg-deletion) 50%, var(--diffs-deletion-base) 50%);background-repeat:repeat;background-size:2px 2px;background-size:calc(1lh/round(1lh / 2px)) calc(1lh/round(1lh / 2px))}[data-column-number]:is([data-indicators=bars] [data-line-type=change-addition]):before{background-color:var(--diffs-addition-base)}[data-overflow=wrap] [data-line],[data-overflow=wrap] [data-annotation-content]{white-space:pre-wrap;word-break:break-word}[data-overflow=scroll] [data-line]{white-space:pre;min-height:1lh}[data-column-number]{box-sizing:content-box;text-align:right;-webkit-user-select:none;user-select:none;color:var(--diffs-fg-number);padding-left:2ch}[data-line-number-content]{min-width:var(--diffs-min-number-column-width,var(--diffs-min-number-column-width-default,3ch));z-index:1;display:inline-block;position:relative}[data-disable-line-numbers] [data-gutter-buffer],[data-disable-line-numbers] [data-column-number]{min-width:4px;padding:0}:is([data-disable-line-numbers] [data-gutter-buffer],[data-disable-line-numbers] [data-column-number]):before{min-width:0}[data-disable-line-numbers] [data-line-number-content]{display:none}[data-disable-line-numbers] [data-gutter-utility-slot]{right:unset;justify-content:flex-start;left:0}[data-disable-line-numbers][data-indicators=bars] [data-gutter-utility-slot]{left:6px}[data-file][data-disable-line-numbers] [data-gutter-buffer],[data-file][data-disable-line-numbers] [data-column-number]{border-right:0;min-width:0}[data-diff-span]{-webkit-box-decoration-break:clone;box-decoration-break:clone;border-radius:3px}[data-line-type=change-addition] [data-diff-span]{background-color:var(--diffs-bg-addition-emphasis)}[data-line-type=change-deletion] [data-diff-span]{background-color:var(--diffs-bg-deletion-emphasis)}[data-merge-conflict=marker-start],[data-merge-conflict=marker-base],[data-merge-conflict=marker-separator],[data-merge-conflict=marker-end]{color:var(--diffs-fg);padding-left:1ch}[data-merge-conflict=marker-start],[data-merge-conflict=marker-end]{align-items:center;display:flex}:is([data-merge-conflict=marker-start],[data-merge-conflict=marker-end]):after{color:var(--diffs-fg-conflict-marker);font-size:.75rem;font-style:normal;line-height:1.25rem;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));padding-left:1ch}[data-merge-conflict=marker-start]:after{content:"(Current Change)"}[data-merge-conflict=marker-end]:after{content:"(Incoming Change)"}[data-merge-conflict-actions-content]{min-height:1.75rem;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));color:var(--diffs-fg);align-items:center;gap:.25rem;padding-inline:.5rem;font-size:.75rem;line-height:1.2;display:flex}[data-merge-conflict-action]{appearance:none;color:var(--diffs-fg-number);font:inherit;cursor:pointer;background:0 0;border:0;padding:0;font-style:normal}[data-merge-conflict-action]:hover{color:var(--diffs-fg)}[data-merge-conflict-action=current]:hover{color:var(--diffs-addition-base)}[data-merge-conflict-action=incoming]:hover{color:var(--diffs-modified-base)}[data-merge-conflict-action-separator]{color:var(--diffs-fg-number);opacity:.6;-webkit-user-select:none;user-select:none}[data-diffs-header=default]{background-color:var(--diffs-bg);justify-content:space-between;align-items:center;gap:var(--diffs-gap-inline,var(--diffs-gap-fallback));min-height:calc(1lh + var(--diffs-gap-block,var(--diffs-gap-fallback))*3);z-index:2;flex-direction:row;padding-inline:16px;display:flex;position:relative;top:0}[data-header-content]{align-items:center;gap:var(--diffs-gap-inline,var(--diffs-gap-fallback));white-space:nowrap;flex-direction:row;min-width:0;display:flex}[data-header-content] [data-prev-name],[data-header-content] [data-title]{text-overflow:ellipsis;white-space:nowrap;direction:rtl;min-width:0;overflow:hidden}[data-prev-name]{opacity:.7}[data-rename-icon]{fill:currentColor;flex-grow:0;flex-shrink:0}[data-diffs-header=default] [data-metadata]{white-space:nowrap;align-items:center;gap:1ch;display:flex}[data-diffs-header=default] [data-additions-count]{font-family:var(--diffs-font-family,var(--diffs-font-fallback));color:var(--diffs-addition-base)}[data-diffs-header=default] [data-deletions-count]{font-family:var(--diffs-font-family,var(--diffs-font-fallback));color:var(--diffs-deletion-base)}[data-change-icon]{fill:currentColor;flex-shrink:0}[data-change-icon=change],[data-change-icon=rename-pure],[data-change-icon=rename-changed]{color:var(--diffs-modified-base)}[data-change-icon=new]{color:var(--diffs-addition-base)}[data-change-icon=deleted]{color:var(--diffs-deletion-base)}[data-change-icon=file]{opacity:.6}[data-annotation-content]{z-index:2;isolation:isolate;align-self:flex-start;min-width:0;display:flow-root;position:relative}[data-overflow=scroll] [data-annotation-content],[data-overflow=scroll] [data-merge-conflict-actions-content]{width:var(--diffs-column-content-width,auto);left:var(--diffs-column-number-width,0);position:sticky}[data-annotation-slot]{text-wrap-mode:wrap;word-break:normal;white-space-collapse:collapse}[data-gutter-utility-slot]{touch-action:none;justify-content:flex-end;display:flex;position:absolute;top:0;bottom:0;right:0}[data-utility-button]{appearance:none;cursor:pointer;width:1lh;height:1lh;font-size:var(--diffs-font-size,13px);line-height:var(--diffs-line-height,20px);background-color:var(--diffs-modified-base);color:var(--diffs-bg);fill:currentColor;z-index:4;touch-action:none;border:none;border-radius:4px;justify-content:center;align-items:center;margin-right:calc(1ch - 1lh);padding:0;display:flex;position:relative}[data-utility-button]:before{content:"";display:block;position:absolute;inset:0 0 0 -4px}[data-decoration-bar-stack]{pointer-events:none;isolation:isolate;z-index:1;background-color:var(--diffs-decoration-bar-color,transparent);box-sizing:content-box;border-left:2px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg);width:6px;position:absolute;top:0;bottom:0;right:-2px}[data-decoration-bar-depth="1"] [data-decoration-bar-stack]{background-color:color-mix(in lab, var(--diffs-bg) 20%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="2"] [data-decoration-bar-stack]{background-color:color-mix(in lab, var(--diffs-bg) 45%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="3"] [data-decoration-bar-stack]{background-color:color-mix(in lab, var(--diffs-bg) 65%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-start] [data-decoration-bar-stack]{border-top-left-radius:5px;border-top-right-radius:5px}[data-decoration-bar-end] [data-decoration-bar-stack]{z-index:3;border-bottom-right-radius:5px;border-bottom-left-radius:5px}[data-placeholder]{contain:strict}[data-error-wrapper]{padding:var(--diffs-gap-block,var(--diffs-gap-fallback)) var(--diffs-gap-inline,var(--diffs-gap-fallback));scrollbar-width:none;max-height:400px;overflow:auto}[data-error-wrapper] [data-error-message]{color:var(--diffs-deletion-base);font-size:18px;font-weight:700}[data-error-wrapper] [data-error-stack]{color:var(--diffs-fg-number)}}@layer theme,rendered,unsafe;`,_D;function vD(e){if(_D!=null)return _D;let t=e.host;if(typeof HTMLElement<`u`&&t instanceof HTMLElement&&!t.isConnected)return;let n=document.createElement(`div`);n.setAttribute(`data-code`,``),n.setAttribute(pm,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),_D=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),_D}function yD(e){return`${mm}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var bD=`@layer base, theme, rendered, unsafe;`,xD=RegExp(`${TD(mm)}\\s*:\\s*[^;]+;`);function SD(e){return`${bD}
|
|
223
|
+
@layer unsafe {
|
|
224
|
+
${e}
|
|
225
|
+
}`}function CD(e,t=`system`,n){return`${bD}
|
|
226
|
+
@layer rendered {
|
|
227
|
+
:host {${t===`system`?``:`
|
|
228
|
+
color-scheme: ${t};`}
|
|
229
|
+
${yD(n)}
|
|
230
|
+
${e}
|
|
231
|
+
}
|
|
232
|
+
}`}function wD(e,t){let n=yD(t);return e.replace(xD,n)}function TD(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ED({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function DD(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function OD(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.tabIndex=0,e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}function kD(e){if(typeof HTMLStyleElement<`u`&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==`string`&&t.toLowerCase()===`style`}function AD(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}function jD({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=MD(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function MD(){let e=document.createElement(`style`);return e.setAttribute(dm,``),e}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(gD)),t.adoptedStyleSheets=[e]}connectedCallback(){vD(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define($p,t)}var ND=[],PD=-1,FD=class{static LoadedCustomComponent=!0;__id=`file:${++PD}`;type=`file`;fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;constructor(e={theme:um},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new oD(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new u_,this.interactionManager=new Gg(`file`,Kg(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){this.enabled&&this.file!=null&&this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Kg(this.options))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Tm(this.appliedThemeCSS.theme,this.options.theme??um)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{overflow:e=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,e===`wrap`),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,this.lineAnnotations=[],this.annotationCache.clear(),this.pre=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder=void 0,this.unsafeCSSStyle=void 0,e?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,file:i,lineAnnotations:a}=e;this.hydrateElements(t,n),ID(this.pre,i,this.options.collapsed)||LD(this.headerElement,i,this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({file:i,lineAnnotations:a}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),DD(e,t);for(let t of Array.from(e.shadowRoot?.children??[])){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t,this.appliedPreAttributes=void 0;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}if(`diffsHeader`in t.dataset){this.headerElement=t,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions(AD(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(e=this.file){return e==null?ND:this.fileRenderer.getOrCreateLineCache(e)}render({file:e,fileContainer:t,forceRender:n=!1,preventEmit:r=!1,containerWrapper:i,deferManagers:a=!1,lineAnnotations:o,renderRange:s}){let{collapsed:c=!1,themeType:l=`system`}=this.options;if(!this.enabled)throw Error(`File.render: attempting to call render after cleaned up`);let u=c?void 0:s,d=this.renderRange,f=this.hasThemeChanged(),p=o!=null&&(o.length>0||this.lineAnnotations.length>0)&&o!==this.lineAnnotations,m=!aE(this.file,e);if(!c&&!n&&oE(u,this.renderRange)&&!m&&!p&&!f)return this.applyCachedThemeState(l);this.renderRange=u,m&&(this.cachedHeaderHTML=void 0),this.file=e,this.fileRenderer.setOptions(AD(this.options)),this.syncInteractionOptions(),o!=null&&this.setLineAnnotations(o),this.fileRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:h=!1,disableFileHeader:g=!1}=this.options;if(g&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),t=this.getOrCreateFileContainerNode(t,i),this.applyCachedThemeState(l),c){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let n=this.fileRenderer.renderFile(e,ym);n!=null&&this.applyThemeState(t,n.themeStyles,l,n.baseThemeType),n?.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t),this.injectUnsafeCSS()}catch(e){if(h)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return r||this.emitPostRender(),!0}try{let r=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(n,p,m||f)||!this.applyPartialRender(d,u)){let n=this.fileRenderer.renderFile(e,u);if(n==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(t,n.themeStyles,l,n.baseThemeType),n.headerAST!=null&&this.applyHeaderToDOM(n.headerAST,t),this.applyFullRender(n,r)}this.applyBuffers(r,u),this.injectUnsafeCSS(),this.managersDirty=!0,a||this.flushManagers(),this.renderAnnotations(),this.renderGutterUtility()}catch(e){if(h)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,t)}return r||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;n?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){return!(e||t||n)}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}primeHighlightCache(){let{file:e,workerManager:t}=this;e==null||e.cacheKey==null||t==null||rD(e)||this.fileRenderer.getOrCreateLineCache(e).length>(this.options.tokenizeMaxLength??1e5)||t.primeFileHighlightCache(e)}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${xE(r)}`,a=this.annotationCache.get(i);if(a==null||!lD(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:pD(xE(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=mD();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=hD(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=SD(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??um,s=typeof o==`string`?o:{...o},c=vD(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=jD({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:CD(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=wD(this.themeCSSStyle.textContent??``,vD(e)))}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e),this.code=ED({code:this.code}),this.code.innerHTML=this.fileRenderer.renderPartialHTML(this.fileRenderer.renderCodeAST(e)),t.replaceChildren(this.code),this.lastRowCount=e.rowCount}applyPartialRender(e,t){if(e==null||t==null)return!1;let{file:n,code:r}=this,i=r==null?void 0:this.getColumns(r);if(n==null||r==null||i==null)return!1;let a=e.startingLine,o=t.startingLine,s=e.totalLines===1/0?1/0:a+e.totalLines,c=t.totalLines===1/0?1/0:o+t.totalLines,l=Math.max(a,o),u=Math.min(s,c);if(u<=l||!this.trimDOMToOverlap(i.gutter,l,u)||!this.trimDOMToOverlap(i.content,l,u))return!1;let{length:d}=i.content.children,f=(e,t)=>{if(!(t<=0))return this.fileRenderer.renderFile(n,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},p=o<l?f(o,l-o):void 0;if(p===void 0&&o<l)return!1;let m=c===1/0?1/0:Math.max(0,c-u),h=c>u?f(u,m):void 0;return h===void 0&&c>u?!1:(this.cleanupErrorWrapper(),p!=null&&(i.gutter.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.gutterAST)),i.content.insertAdjacentHTML(`afterbegin`,this.fileRenderer.renderPartialHTML(p.contentAST)),d+=p.rowCount),h!=null&&(i.gutter.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.gutterAST)),i.content.insertAdjacentHTML(`beforeend`,this.fileRenderer.renderPartialHTML(h.contentAST)),d+=h.rowCount),this.lastRowCount!==d&&(i.gutter.style.setProperty(`grid-row`,`span ${d}`),i.content.style.setProperty(`grid-row`,`span ${d}`),this.lastRowCount=d),!0)}getColumns(e){let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&t.dataset.gutter!=null&&n.dataset.content!=null)return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){let r=this.getDOMBoundaryIndices(e,[t,n]),i=r.get(t)??e.children.length,a=r.get(n)??e.children.length;if(i>a)return!1;for(let t=e.children.length-1;t>=a;--t)e.children[t]?.remove();for(let t=i-1;t>=0;--t)e.children[t]?.remove();return!0}getDOMBoundaryIndices(e,t){let n=[...new Set(t)].sort((e,t)=>e-t),r=new Map;if(n.length===0)return r;let i=0,a=n[i],{children:o}=e;for(let e=0;e<o.length;e+=1){let t=o[e];if(!(t instanceof HTMLElement))continue;let s=this.getLineIndexFromDOMNode(t);if(s!=null){for(;a!=null&&s>=a;)r.set(a,e),i+=1,a=n[i];if(i>=n.length)break}}for(let e of n)r.has(e)||r.set(e,o.length);return r}getLineIndexFromDOMNode(e){let t=e.dataset.lineIndex;if(t==null)return;let n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(e,t){let{file:n}=this;if(n==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let r=this.cachedHeaderHTML??Hg(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged)return;let{renderHeaderPrefix:i,renderCustomHeader:a,renderHeaderMetadata:o}=this.options;if(a!=null){let e=a(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,lm,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0}else{let e=i?.(n)??void 0,r=o?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,sm,e),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,cm,r),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}getOrCreateFileContainerNode(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:kD(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):kD(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=cD;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(let t of Array.from(e.children))if(t instanceof HTMLElement&&t.hasAttribute(`data-code`)){this.code=t;return}}applyPreNodeAttributes(e,{totalLines:t}){let{overflow:n=`scroll`,disableLineNumbers:r=!1}=this.options,i={type:`file`,split:!1,overflow:n,disableLineNumbers:r,diffIndicators:`none`,disableBackground:!0,totalLines:t};uD(i,this.appliedPreAttributes)||(OD(e,i),this.appliedPreAttributes=i)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function ID(e,t,n=!1){return!n&&e==null&&t!=null}function LD(e,t,n=!1){return e==null&&t!=null&&!n}function RD(e){return{...gm,...e}}function zD(e,t){let n=BD(e,t);return t?n:e.diffHeaderHeight+n}function BD(e,t){return e.paddingTop??(t?e.spacing:0)}function VD(e){return e.paddingBottom??e.spacing}function HD(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}var UD=5e3,WD=-1;function GD(e,t){return(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS}var KD=class extends FD{__id=`virtualized-file:${++WD}`;top;height=0;cache={heights:new Map,checkpoints:[]};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=gm,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){(t||!wm(this.metrics,e))&&(this.metrics=e,this.resetLayoutCache())}getLineHeight(e,t=!1){let n=this.cache.heights.get(e);if(n!=null)return n;let r=t?2:1;return this.metrics.lineHeight*r}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!Em(t,e),r=GD(t,e);super.setOptions(e),r&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache(e=!1){this.layoutDirty=!0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.file==null)return this.height!==0&&(e=!0),this.height=0,e;let{overflow:t=`scroll`}=this.options;if(this.top=this.getVirtualizedTop(),t===`scroll`&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled()||this.code==null)return e;let n=this.code.children[1];if(!(n instanceof HTMLElement))return e;for(let t of n.children){if(!(t instanceof HTMLElement))continue;let n=t.dataset.lineIndex;if(n==null)continue;let r=Number(n),i=t.getBoundingClientRect().height,a=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(a=!0),i+=t.nextElementSibling.getBoundingClientRect().height);let o=this.getLineHeight(r,a);i!==o&&(e=!0,i===this.metrics.lineHeight*(a?2:1)?this.cache.heights.delete(r):this.cache.heights.set(r,i))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));prepareCodeViewItem(e,t,n){let r=n?.resetFileLayoutCache===!0;n?.metrics!=null&&(this.metrics=n.metrics,r=!0);let{collapsed:i=!1}=this.options;return this.currentCollapsed!==i&&(this.currentCollapsed=i,r=!0),r&&this.resetLayoutCache(),this.file!==e&&(this.layoutDirty=!0),this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null)return;let{disableFileHeader:t=!1,collapsed:n=!1}=this.options,r=qD(this.getOrCreateLineCache(this.file)),i=zD(this.metrics,t);if(n||r<0)return{top:i,height:0};let a=Math.min(Math.max(e-1,0),r),{overflow:o=`scroll`}=this.options,{lineHeight:s}=this.metrics;if(o===`scroll`&&this.lineAnnotations.length===0)return{top:i+a*s,height:s};let c=this.getLayoutCheckpointBeforeLineIndex(a);i=c?.top??i;for(let e=c?.lineIndex??0;e<a;e++)i+=this.getLineHeight(e,!1);return{top:i,height:this.getLineHeight(a,!1)}}getNumericScrollAnchor(e){if(this.file==null||this.renderRange==null)return;let{disableFileHeader:t=!1,collapsed:n=!1,overflow:r=`scroll`}=this.options;if(n||this.renderRange.totalLines<=0)return;let i=qD(this.getOrCreateLineCache(this.file));if(i<0)return;let a=zD(this.metrics,t),o=Math.min(this.renderRange.startingLine,i),s=Math.min(o+this.renderRange.totalLines-1,i);if(s<o)return;if(r===`scroll`&&this.lineAnnotations.length===0){let{lineHeight:t}=this.metrics,n=a+this.renderRange.bufferBefore,r=o+Math.max(Math.ceil((e-n)/t),0);return r>s?void 0:{lineNumber:r+1,top:a+r*t}}let c=a+this.renderRange.bufferBefore;for(let t=o;t<=s;t++){if(c>=e)return{lineNumber:t+1,top:c};c+=this.getLineHeight(t)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.file==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let t=e==null?this.renderRange:this.computeRenderRangeFromWindow(this.file,this.top,e);if(t==null)return;let{bufferBefore:n,bufferAfter:r,totalLines:i}=t,a=0;if(i===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(a=r)}return{topOffset:this.top+n+a,height:this.height-(n+r)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.layoutDirty=!0),this.isSetup=!1,super.cleanUp(e)}computeApproximateSize(e=!1){let t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;let n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.file==null){this.layoutDirty=!1;return}let{disableFileHeader:r=!1,collapsed:i=!1,overflow:a=`scroll`}=this.options,{lineHeight:o}=this.metrics,s=this.getOrCreateLineCache(this.file),c=zD(this.metrics,r),l=VD(this.metrics);if(this.height+=c,i){this.layoutDirty=!1;return}if(a===`scroll`&&this.lineAnnotations.length===0?this.height+=this.getOrCreateLineCache(this.file).length*o:ZE({lines:s,callback:({lineIndex:e})=>{this.addLayoutCheckpoint(e,this.height),this.height+=this.getLineHeight(e,!1)}}),s.length>0&&(this.height+=l),this.fileContainer!=null&&t&&!n){let e=this.fileContainer.getBoundingClientRect();e.height===this.height?console.log(`VirtualizedFile.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFile.computeApproximateSize: computed height doesnt match`,{name:this.file.name,elementHeight:e.height,computedHeight:this.height})}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){this.enabled&&this.file!=null&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}render({fileContainer:e,file:t,forceRender:n=!1,...r}){let{forceRenderOverride:i,isSetup:a}=this;if(this.forceRenderOverride=void 0,this.file??=t,e=this.getOrCreateFileContainerNode(e),this.file==null)return console.error(`VirtualizedFile.render: attempting to virtually render when we dont have file`),!1;if(a)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFile.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);let o=this.virtualizer.getWindowSpecs(),s=this.top??0,c=this.computeRenderRangeFromWindow(this.file,s,o);return super.render({file:this.file,fileContainer:e,renderRange:c,forceRender:i??n,...r})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}addLayoutCheckpoint(e,t){e%UD===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFile: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFile: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFile: invalid checkpoint index`);if(n.lineIndex%t===0)return n}}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,overflow:a=`scroll`}=this.options,{hunkLineCount:o,lineHeight:s}=this.metrics,c=this.getOrCreateLineCache(e),l=c.length,u=this.height,d=zD(this.metrics,i),f=l>0?VD(this.metrics):0;if(t<n-u||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:u-d-f};if(l<=o)return{startingLine:0,totalLines:o,bufferBefore:0,bufferAfter:0};let p=Math.ceil(Math.max(r-n,0)/s),m=Math.ceil(p/o)*o+o*2,h=m/o,g=(n+r)/2;if(a===`scroll`&&this.lineAnnotations.length===0){let e=Math.floor((g-(t+d))/s),n=Math.floor(e/o)-Math.floor(h/2),r=Math.ceil(l/o),i=Math.max(0,Math.min(n,r))*o,a=n<0?m+n*o:m,c=i*s,u=Math.min(a,l-i);return{startingLine:i,totalLines:a,bufferBefore:c,bufferAfter:Math.max(0,(l-i-u)*s)}}let _=h,v=[],y=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-m*s*2),o),b=t+(y?.top??d),x=y?.lineIndex??0,S,C,w;if(ZE({lines:c,startingLine:y?.lineIndex??0,callback:({lineIndex:e})=>{let i=x%o===0,a=Math.floor(x/o);if(i&&(v[a]=b-(t+d),w!=null)){if(w<=0)return!0;w--}let s=this.getLineHeight(e,!1);return b>n-s&&b<r&&(S??=a),b+s>g&&(C??=a),w==null&&b>=r&&i&&(w=_),x++,b+=s,!1}}),S==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:u-d-f};C??=S;let T=Math.round(C-h/2),E=Math.max(0,Math.ceil(l/o)-h),D=Math.max(0,Math.min(T,E)),O=D*o,k=T<0?m+T*o:m,ee=v[D]??0,A=D+k/o;return{startingLine:O,totalLines:k,bufferBefore:ee,bufferAfter:A<v.length?u-d-v[A]-f:u-(b-t)-f}}};function qD(e){let t=e.at(-1);return t==null||t===``||t===`
|
|
233
|
+
`||t===`\r
|
|
234
|
+
`||t===`\r`?e.length-2:e.length-1}function JD(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}var YD=new TextEncoder,XD=new TextDecoder(`utf-8`,{ignoreBOM:!0}),ZD=/[\uD800-\uDFFF]/,QD=1024,$D=new Uint8Array(QD);function eO(){$D.length!==QD&&($D=new Uint8Array(QD))}function tO(e){if(e.length===0)return e;if(ZD.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;$D.length<t&&($D=new Uint8Array(t));let{written:n}=YD.encodeInto(e,$D);return XD.decode($D.subarray(0,n))}function nO(e,t,n){try{return rO(e,t,n)}finally{eO()}}function rO(e,t,n=!1){let r=xO(e),i=r?uO(e):dO(e),a,o=[];for(let e of i){if(r&&!tm.test(e)){if(a==null)a=tO(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}if(!r&&!fO(e)){if(a==null)a=tO(e);else if(n)throw Error(`parsePatchContent: unknown file blob`);else console.error(`parsePatchContent: unknown file blob:`,e);continue}let i=aO(e,{cacheKey:t==null?void 0:`${t}-${o.length}`,isGitDiff:r,throwOnError:n});i!=null&&o.push(i)}return{patchMetadata:a,files:o}}function iO(e,t){try{return aO(e,t)}finally{eO()}}function aO(e,{cacheKey:t,isGitDiff:n=tm.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=SO(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=lO(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=vO(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?cO(i.contents):[],deletionLines:!l&&r!=null&&i!=null?cO(r.contents):[],cacheKey:wO(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(am),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(n==null||r==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}c.name=tO(r.trim()),n!==r&&(c.prevName=tO(n.trim()));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(n?im:rm):null;if(t!=null){let[,e,n]=t;if(e===`---`&&n!==`/dev/null`){let e=tO(n.trim());c.prevName=e,c.name=e}else e===`+++`&&n!==`/dev/null`&&(c.name=tO(n.trim()))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=tO(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=tO(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=tO(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=tO(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(om)??[];t!=null&&(c.prevObjectId=tO(t)),n!=null&&(c.newObjectId=tO(n)),r!=null&&(c.mode=tO(r))}e.startsWith(`rename from `)&&(c.prevName=tO(e.slice(12).trim())),e.startsWith(`rename to `)&&(c.name=tO(e.slice(10).trim()))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
|
|
235
|
+
`||s[s.length-1]===`\r`||s[s.length-1]===`\r
|
|
236
|
+
`||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:wO(p.hunkContext),hunkSpecs:tO(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(a&&gO(t)&&!_O(t))throw Error(`parsePatchContent: hunk has more lines than expected`);break}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=TO(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=EO(t);(g==null||g.type!==`change`)&&(g=DO(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=EO(t);(g==null||g.type!==`change`)&&(g=DO(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=EO(t);(g==null||g.type!==`context`)&&(g=DO(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=SE(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=SE(c.deletionLines[e]))}}}if(a&&(x!==b.additionCount||S!==b.deletionCount))throw Error(`parsePatchContent: hunk line count mismatch`);b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max(b.additionStart-1-o,0),c.hunks.push(b),o=b.additionStart+b.additionCount-1;for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=e.additionStart+e.additionCount-1,n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),c}}function oO(e,t,n=!1){let r=[],i=sO(e)?e.split(em):[e];for(let e of i)try{r.push(nO(e,t==null?void 0:`${t}-${r.length}`,n))}catch(e){if(n)throw e;console.error(e)}return r}function sO(e){return e.startsWith(`From `)||e.includes(`
|
|
237
|
+
From `)}function cO(e){let t=lO(e);for(let e=0;e<t.length;e++)t[e]=tO(t[e]);return t}function lO(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
|
|
238
|
+
`,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function uO(e){return SO(e,`diff --git`)}function dO(e){if(e.length===0)return[``];let t=[],n=0,r=0,i=0,a=0,o=!1;for(;r<e.length;){let s=hO(e,r);if(i<=0&&a<=0){if(pO(e,r)){r>n&&t.push(e.slice(n,r)),n=r,o=!0,r=hO(e,s);continue}if(o&&e.startsWith(`@@ -`,r)){let t=vO(e.slice(r,s));t!=null&&(i=t.deletionCount,a=t.additionCount)}r=s;continue}let c=e[r];if(c===`\\`){r=s;continue}c===` `?(i=Math.max(i-1,0),a=Math.max(a-1,0)):c===`-`?i=Math.max(i-1,0):c===`+`&&(a=Math.max(a-1,0)),r=s}return t.push(e.slice(n)),t}function fO(e){return pO(e,0)}function pO(e,t){let n=hO(e,t);return mO(e,t,`---`)&&mO(e,n,`+++`)}function mO(e,t,n){if(!e.startsWith(n,t))return!1;let r=e[t+n.length];if(r!==` `&&r!==` `)return!1;for(let r=t+n.length+1;r<e.length;r++){let t=e[r];if(t===`
|
|
239
|
+
`||t===`\r`)break;if(t!==` `&&t!==` `)return!0}return!1}function hO(e,t){let n=e.indexOf(`
|
|
240
|
+
`,t);return n===-1?e.length:n+1}function gO(e){let t=e[0];return t===`+`||t===`-`||t===` `}function _O(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
|
|
241
|
+
`&&n!==`\r`)return!1}return!0}function vO(e){if(!e.startsWith(`@@ -`))return;let t=4,n=yO(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=yO(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=yO(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=yO(e,t+1);if(n==null)return;s=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`@`||e[t+2]!==`@`)return;let c,l=t+3;return e[l]===` `&&(c=bO(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function yO(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=r*10+t}if(n!==t)return{value:r,endIndex:n}}function bO(e){return e.endsWith(`\r
|
|
242
|
+
`)?e.slice(0,-2):e.endsWith(`
|
|
243
|
+
`)?e.slice(0,-1):e}function xO(e){return e.startsWith(`diff --git`)||e.includes(`
|
|
244
|
+
diff --git`)}function SO(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:CO(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=CO(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function CO(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function wO(e){return e==null?e:tO(e)}function TO(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function EO(e){let t=e.slice(1);return tO(t===``?`
|
|
245
|
+
`:t)}function DO(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}var OO=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},kO=new class extends OO{};function AO(e,t,n){return kO.diff(e,t,n)}function jO(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function MO(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function NO(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function PO(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function FO(e,t){return NO(e,t,``)}function IO(e,t){return PO(e,t,``)}function LO(e,t){return t.slice(0,RO(e,t))}function RO(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function zO(e){let t;for(t=e.length-1;t>=0&&e[t].match(/\s/);t--);return e.substring(t+1)}function BO(e){let t=e.match(/^\s*/);return t?t[0]:``}var VO=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,HO=RegExp(`[${VO}]+|\\s+|[^${VO}]`,`ug`);new class extends OO{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=[];for(let t of Array.from(r.segment(e))){let e=t.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}}else n=e.match(HO)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&UO(n,i,r,e),n=e,r=null,i=null)}),(r||i)&&UO(n,i,r,null),e}};function UO(e,t,n,r){if(t&&n){let i=BO(t.value),a=zO(t.value),o=BO(n.value),s=zO(n.value);if(e){let r=jO(i,o);e.value=PO(e.value,o,r),t.value=FO(t.value,r),n.value=FO(n.value,r)}if(r){let e=MO(a,s);r.value=NO(r.value,s,e),t.value=IO(t.value,e),n.value=IO(n.value,e)}}else if(n){if(e){let e=BO(n.value);n.value=n.value.substring(e.length)}if(r){let e=BO(r.value);r.value=r.value.substring(e.length)}}else if(e&&r){let n=BO(r.value),i=BO(t.value),a=zO(t.value),o=jO(n,i);t.value=FO(t.value,o);let s=MO(FO(n,o),a);t.value=IO(t.value,s),r.value=NO(r.value,n,s),e.value=PO(e.value,n,n.slice(0,n.length-s.length))}else if(r){let e=BO(r.value),n=LO(zO(t.value),e);t.value=IO(t.value,n)}else if(e){let n=LO(zO(e.value),BO(t.value));t.value=FO(t.value,n)}}var WO=new class extends OO{tokenize(e){let t=RegExp(`(\\r?\\n)|[${VO}]+|[^\\S\\n\\r]+|[^${VO}]`,`ug`);return e.match(t)||[]}};function GO(e,t,n){return WO.diff(e,t,n)}var KO=new class extends OO{constructor(){super(...arguments),this.tokenize=JO}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
246
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
247
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
248
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
249
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function qO(e,t,n){return KO.diff(e,t,n)}function JO(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
250
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function YO(e){return e==`.`||e==`!`||e==`?`}new class extends OO{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(YO(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends OO{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends OO{constructor(){super(...arguments),this.tokenize=JO}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(XO(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function XO(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=XO(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=XO(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends OO{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var ZO={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function QO(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;qO(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(qO(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||tk(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s){if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
|
|
251
|
+
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function $O(e,t){if(t||=ZO,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>$O(e,t)).join(`
|
|
252
|
+
`)}let n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`),t.includeFileHeaders&&(n.push(`--- `+e.oldFileName+(e.oldHeader===void 0?``:` `+e.oldHeader)),n.push(`+++ `+e.newFileName+(e.newHeader===void 0?``:` `+e.newHeader)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t];r.oldLines===0&&--r.oldStart,r.newLines===0&&--r.newStart,n.push(`@@ -`+r.oldStart+`,`+r.oldLines+` +`+r.newStart+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
|
|
253
|
+
`)+`
|
|
254
|
+
`}function ek(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;QO(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?$O(e,o.headerOptions):void 0)}}))}else{let s=QO(e,t,n,r,i,a,o);return s?$O(s,o?.headerOptions):void 0}}function tk(e){let t=e.endsWith(`
|
|
255
|
+
`),n=e.split(`
|
|
256
|
+
`).map(e=>e+`
|
|
257
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function nk(e,t,n,r=!1){let i=iO(ek(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:r});if(i==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);return t.lang!=null&&(i.lang=t.lang),i}var rk=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function ik(e,t){return Tm(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function ak(e){return jm({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function ok(e){return jm({tagName:`div`,children:[jm({tagName:`span`,children:[Am(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function sk(e){return jm({tagName:`div`,children:[Mm({name:e===`both`?`diffs-icon-expand-all`:`diffs-icon-expand`,properties:{"data-icon":``}})],properties:{role:`button`,"data-expand-button":``,"data-expand-both":e===`both`?``:void 0,"data-expand-up":e===`up`?``:void 0,"data-expand-down":e===`down`?``:void 0}})}function ck({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push(jm({tagName:`div`,children:[Am(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(sk(`up`)),s++),o||(e.push(sk(`down`)),s++)):(e.push(sk(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push(jm({tagName:`div`,children:[jm({tagName:`span`,children:[Am(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push(jm({tagName:`div`,children:[Am(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push(jm({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push(jm({tagName:`slot`,properties:{name:i}})),jm({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function lk(e,t){return`hunk-separator-${e}-${t}`}function uk(e){let t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function dk(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function fk({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":``},alwaysWrap:!0}}function pk({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}function mk({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function hk({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-(n.additionLineIndex+n.additionCount),i=e.deletionLines.length-(n.deletionLineIndex+n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function gk({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=hk({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function _k({type:e,metrics:t}){return t.hunkSeparatorHeight??HD(e)}function vk({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function yk({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case`simple`:return t>0;case`metadata`:return n!=null;case`line-info`:case`line-info-basic`:case`custom`:return!0}}function bk(e){return e!==`simple`&&e!==`metadata`}function xk({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!yk({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=_k({type:e,metrics:t}),a=vk({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function Sk({type:e,metrics:t}){if(!bk(e))return;let n=_k({type:e,metrics:t}),r=vk({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function Ck({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=wk({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=c.unifiedCount+e<n,a=c.splitCount+r<n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=mk({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),s=n===c.finalHunkIndex?gk({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,l=o.fromStart+o.fromEnd;function u(e,n){return s==null||s.collapsedLines<=0||s.fromStart+s.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?s.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?s.collapsedLines:0}let d=o.collapsedLines===0;function f(){return d?0:(d=!0,o.collapsedLines)}if(c.shouldSkip(l,l))c.incrementCounts(l,l),f();else{let e=r.unifiedLineStart-o.rangeSize,i=r.splitLineStart-o.rangeSize,a=r.deletionLineIndex-o.rangeSize,s=r.additionLineIndex-o.rangeSize,l=r.deletionStart-o.rangeSize,u=r.additionStart-o.rangeSize;if(Dk(c,o.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:l+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:s+t,lineNumber:u+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-o.fromEnd,i=r.splitLineStart-o.fromEnd,a=r.deletionLineIndex-o.fromEnd,s=r.additionLineIndex-o.fromEnd,l=r.deletionStart-o.fromEnd,u=r.additionStart-o.fromEnd,Dk(c,o.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:l+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:s+t,lineNumber:u+t,noEOFCR:!1}}),()=>{f()})))break hunkIterator}let p=r.unifiedLineStart,m=r.splitLineStart,h=r.deletionLineIndex,g=r.additionLineIndex,_=r.deletionStart,v=r.additionStart,y=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===y;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),f();else if(Dk(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=p+t,s=m+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:u(o,s),type:`context`,deletionLine:{lineNumber:_+t,lineIndex:h+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:g+t,lineNumber:v+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{f()}))break hunkIterator;p+=e.lines,m+=e.lines,h+=e.lines,g+=e.lines,_+=e.lines,v+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=Ok(c,e,t);(s[0]?.[0]??0)>0&&f();for(let[l,d]of s)for(let s=l;s<d;s++){let l=u(p+s,t===`unified`?m+(s<e.deletions?s:s-e.deletions):m+s);if(c.emit(kk({hunkIndex:n,hunk:r,collapsedBefore:f(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:p,splitLineIndex:m,additionLineIndex:g,deletionLineIndex:h,additionLineNumber:v,deletionLineNumber:_,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}f(),c.incrementCounts(o,a),p+=o,m+=a,h+=e.deletions,g+=e.additions,_+=e.deletions,v+=e.additions}}if(s!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=s,a=r+i;if(Dk(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:_+t,lineIndex:h+t,noEOFCR:!1,unifiedLineIndex:p+t,splitLineIndex:m+t},additionLine:{unifiedLineIndex:p+t,splitLineIndex:m+t,lineIndex:g+t,lineNumber:v+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function wk({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=Tk({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function Tk({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=mk({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?gk({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function Ek(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function Dk(e,t,n,r,i,a){let[o,s]=Ek(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function Ok(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function kk({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,T=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,E=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(T==null&&E!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:E};if(T!=null&&E==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:void 0};if(T==null||E==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:T,additionLine:E}}var Ak={forcePlainText:!1};function jk(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=Ak){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=JE({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??Nk();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}Ck({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&Mk({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=Pk({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else f.deletionLines.push(...s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else f.additionLines.push(...c)}return{code:f,themeStyles:u,baseThemeType:l}}function Mk({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=SE(e),t=SE(t),e.length>s||t.length>s))return;let c=o===`char`?AO(e,t):GO(e,t),l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(pk({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),pk({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?pk({item:e,arr:l,enableJoin:d,isLastItem:t}):pk({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(fk({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(fk({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function Nk(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function Pk({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c=um,...l}}){let u=s??_E(e.name),d=s??_E(t.name),{state:f,transformers:p}=ME(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:FE(`token`)}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:FE(`token`)};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,XE(i.codeToHast(SE(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,XE(i.codeToHast(SE(t.contents),m)))}}function Fk(e){let t=e.lang??_E(e.name),n=e.lang??(e.prevName==null?`text`:_E(e.prevName));return t===`text`&&n===`text`}var Ik=-1,Lk=class{__id=`diff-hunks-renderer:${++Ik}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang=`text`;renderCache;constructor(e={theme:um},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=nE(e.theme??um)?$T():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this)}clearRenderCache(){this.renderCache=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??_m}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return t===`change`?{gutterLineType:e===`deletions`?`change-deletion`:`change-addition`}:{gutterLineType:t}}createAnnotationElement(e){return sE(e)}getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=um,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=hm,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await QT(bE(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=Wk(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!ik(t,r.options)&&(r=void 0),this.renderCache??={diff:e,highlighted:!n&&!Fk(e),options:t,result:n?void 0:r?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLang=e.lang??_E(e.name),this.initializeHighlighter())}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:iD(this.options),tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!JD(e,n.diff)||!ik(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=vm){if(e==null)return;let{expandUnchanged:n=!1,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getMatchingWorkerResultCache(e,i);o!=null&&!this.hasHighlightedRenderCache(e,i)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...o},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||Fk(e)||Wk(e,this.getTokenizeMaxLength()),l=!JD(e,this.renderCache.diff),u=!oE(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(c||this.renderCache.result==null||!this.renderCache.highlighted&&(l||u))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||l||u||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,dk(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??_E(e.name);let t=this.highlighter!=null&&nE(i.theme),n=this.highlighter!=null&&y_(this.computedLang),r=!c&&n;if(this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=vm){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return fE({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=Wk(e,this.getTokenizeMaxLength());this.computedLang=t?`text`:e.lang??_E(e.name);let n=this.highlighter!=null&&nE(this.options.theme??um),r=t||this.highlighter!=null&&y_(this.computedLang);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults();return{result:jk(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i}),options:r}}onHighlightSuccess(e,t,n,r=!0){if(this.renderCache==null)return;let i=!this.renderCache.highlighted||!ik(this.renderCache.options,n)||!JD(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:r,result:t,renderRange:void 0},i&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){let n=this.workerManager?.getDiffResultCache(e);if(n!=null&&ik(t,n.options))return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&JD(e,n.diff)&&ik(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults();this.diff=e;let d=a===`unified`,f=[],p=[],m=[],h=[],{additionLines:g,deletionLines:_}=n,v={rowCount:0,hunkSeparators:u,additionsContentAST:f,deletionsContentAST:p,unifiedContentAST:m,unifiedGutterAST:Pm(),deletionsGutterAST:Pm(),additionsGutterAST:Pm(),expansionLineCount:c,hunkData:h,incrementRowCount(e=1){v.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:v.unifiedGutterAST.children.push(t);break;case`deletions`:v.deletionsGutterAST.children.push(t);break;case`additions`:v.additionsGutterAST.children.push(t)}}},y=hk({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),b={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(v.pushToGutter(`additions`,Im(void 0,`buffer`,this.size)),f?.push(ak(this.size))):(v.pushToGutter(`deletions`,Im(void 0,`buffer`,this.size)),p?.push(ak(this.size))),this.size=0,this.side=void 0}}},x=(e,t,n,r,i)=>{v.pushToGutter(e,Fm(t,n,r,i))};function S(e){b.flush(),a===`unified`?Hk(`unified`,e,v):(Hk(`deletions`,e,v),Hk(`additions`,e,v))}Ck({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,d=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&b.flush(),r>0&&S({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:!e.isPartial});let f=a===`unified`?d:l,p={type:c,hunkIndex:t,lineIndex:f,unifiedLineIndex:d,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(p);n?.before!=null&&zk(n.before,v);let r=s==null?void 0:_[s.lineIndex],i=o==null?void 0:g[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});x(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${d},${l}`,u.gutterProperties),i==null?r!=null&&(r=Uk(r,u.contentProperties)):i=Uk(i,u.contentProperties),Vk({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,f),createAnnotationElement:e=>this.createAnnotationElement(e),context:v}),n?.after!=null&&zk(n.after,v)}else{let n=this.getSplitInjectedRowsForLine?.(p);n?.before!=null&&Bk(n.before,v,b);let r=s==null?void 0:_[s.lineIndex],i=o==null?void 0:g[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let d=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();if(d!=null){if(b.side!=null&&b.side!==d)throw Error(`DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits`);b.side=d,b.increment()}let m=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,f);if(m!=null&&b.size>0&&b.flush(),s!=null){let e=Uk(r,a.contentProperties);x(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=Uk(i,u.contentProperties);x(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}Vk({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...m,createAnnotationElement:e=>this.createAnnotationElement(e),context:v}),n?.after!=null&&Bk(n.after,v,b)}let m=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,h=m?n.noEOFCRDeletions:!1,C=m?n.noEOFCRAdditions:!1,w=(s?.noEOFCR??!1)||h,T=(o?.noEOFCR??!1)||C;if(T||w){if(a===`split`&&b.flush(),w){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(v.unifiedContentAST.push(ok(e)),v.pushToGutter(`unified`,Im(e,`metadata`,1))):(v.deletionsContentAST.push(ok(e)),v.pushToGutter(`deletions`,Im(e,`metadata`,1)),T||(v.pushToGutter(`additions`,Im(void 0,`buffer`,1)),v.additionsContentAST.push(ak(1))))}if(T){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(v.unifiedContentAST.push(ok(e)),v.pushToGutter(`unified`,Im(e,`metadata`,1))):(v.additionsContentAST.push(ok(e)),v.pushToGutter(`additions`,Im(e,`metadata`,1)),w||(v.pushToGutter(`deletions`,Im(void 0,`buffer`,1)),v.deletionsContentAST.push(ak(1))))}v.incrementRowCount(1)}i>0&&u!==`simple`&&S({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:i,rangeSize:y,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),v.incrementRowCount(1)}}),a===`split`&&b.flush();let C=Math.max(uk(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),w=t.bufferBefore>0||t.bufferAfter>0,T=!d&&e.type!==`deleted`,E=!d&&e.type!==`new`,D=v.rowCount>0||w;f=T&&D?f:void 0,p=E&&D?p:void 0,m=d&&D?m:void 0;let O=this.createPreElement(p!=null&&f!=null,C);return{unifiedGutterAST:d&&D?v.unifiedGutterAST.children:void 0,unifiedContentAST:m,deletionsGutterAST:E&&D?v.deletionsGutterAST.children:void 0,deletionsContentAST:p,additionsGutterAST:T&&D?v.additionsGutterAST.children:void 0,additionsContentAST:f,hunkData:h,preNode:O,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(this.diff),totalLines:C,rowCount:v.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=Pm(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,nD(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push(jm({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push(jm({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push(jm({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Hg(this.renderFullAST(e,t))}renderPartialHTML(e,t){return Hg(t==null?e:jm({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(xE(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(xE(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(o.annotations.length!==0||a.annotations.length!==0)return{deletionSpan:a,additionSpan:o}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return lE({fileOrDiff:e,mode:t,stickyHeader:n})}};function Rk(e){return`${e} unmodified line${e>1?`s`:``}`}function zk(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function Bk(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function Vk({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,Im(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,Im(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,Im(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function Hk(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,ck({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(ck({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,ck({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(ck({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=lk(e,t),d=r>c.expansionLineCount,f=s?t:void 0;c.pushToGutter(e,ck({type:c.hunkSeparators,content:Rk(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(ck({type:c.hunkSeparators,content:Rk(n),expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:n,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function Uk(e,t){return e==null||e.type!==`element`||t==null?e:{...e,properties:{...e.properties,...t}}}function Wk(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Gk(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Kk(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function qk(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators==`function`?`custom`:e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader==null?`default`:`custom`}}var Jk=-1,Yk=class{static LoadedCustomComponent=!0;__id=`file-diff:${++Jk}`;type=`file-diff`;fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;constructor(e={theme:um},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new u_,this.scrollSyncManager=new rk,this.interactionManager=new Gg(`diff`,Kg(e,typeof e.hunkSeparators==`function`||(e.hunkSeparators??`line-info`)===`line-info`||e.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getHunksRendererOptions(e){return qk(e)}createHunksRenderer(e){return new Lk(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>{if(this.fileDiff==null)return;let n=this.fileDiff.hunks.at(-1),r,i;hunkIterator:for(let a of this.fileDiff.hunks){let o=t===`deletions`?a.deletionStart:a.additionStart,s=t===`deletions`?a.deletionCount:a.additionCount,c=a.splitLineStart,l=a.unifiedLineStart;if(e<o){let t=o-e;r=Math.max(l-t,0),i=Math.max(c-t,0);break hunkIterator}if(e>=o+s){if(a===n){let t=e-(o+s);r=l+a.unifiedLineCount+t,i=c+a.splitLineCount+t;break hunkIterator}continue}for(let n of a.hunkContent)if(n.type===`context`){if(e<o+n.lines){let t=e-o;i=c+t,r=l+t;break hunkIterator}o+=n.lines,c+=n.lines,l+=n.lines}else{let a=t===`deletions`?n.deletions:n.additions;if(e<o+a){let a=e-o;r=l+(t===`additions`?n.deletions:0)+a,i=c+a;break hunkIterator}o+=a,c+=Math.max(n.deletions,n.additions),l+=n.deletions+n.additions}break hunkIterator}if(r!=null&&i!=null)return[r,i]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Kg(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Tm(this.appliedThemeCSS.theme,this.options.theme??um)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e=`split`,overflow:t=`scroll`}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,t===`wrap`),t===`scroll`&&e===`split`?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,this.lineAnnotations=[],this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:r=!1,lineAnnotations:i,oldFile:a,newFile:o,fileDiff:s}=e;this.hydrateElements(t,n),Qk(this.pre,Xk({fileDiff:s,oldFile:a,newFile:o}),this.options.collapsed)||$k(this.headerElement,Zk({fileDiff:s,oldFile:a,newFile:o}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:s,oldFile:a,newFile:o,lineAnnotations:i}),r||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),DD(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)e instanceof HTMLElement&&e.tagName.toLowerCase()===`code`&&(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?nk(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,deferManagers:r=!1,forceRender:i=!1,preventEmit:a=!1,lineAnnotations:o,fileContainer:s,containerWrapper:c,renderRange:l}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let{collapsed:u=!1,themeType:d=`system`}=this.options,f=u?void 0:l,p=this.hasThemeChanged(),m=e!=null&&t!=null&&(!aE(e,this.deletionFile)||!aE(t,this.additionFile)),h=n!=null&&n!==this.fileDiff,g=o!=null&&(o.length>0||this.lineAnnotations.length>0)&&o!==this.lineAnnotations;if(!u&&oE(f,this.renderRange)&&!i&&!g&&!p&&(n!=null&&n===this.fileDiff||n==null&&!m))return this.applyCachedThemeState(d);let{renderRange:_}=this;if(this.renderRange=f,this.deletionFile=e,this.additionFile=t,n==null?e!=null&&t!=null&&m&&(h=!0,this.fileDiff=nk(e,t,this.options.parseDiffOptions)):this.fileDiff=n,h&&(this.cachedHeaderHTML=void 0),o!=null&&this.setLineAnnotations(o),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:v=!1,disableFileHeader:y=!1}=this.options;if(y&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),s=this.getOrCreateFileContainer(s,c),this.applyCachedThemeState(d),u){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(this.fileDiff,ym);e!=null&&this.applyThemeState(s,e.themeStyles,d,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,s),this.renderSeparators([]),this.injectUnsafeCSS()}catch(e){if(v)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return a||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(s);if(!(this.canPartiallyRender(i,g,m||h||p)&&this.applyPartialRender({previousRenderRange:_,renderRange:f}))){let t=this.hunksRenderer.renderDiff(this.fileDiff,f);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(s,t.themeStyles,d,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,s),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData)}this.applyBuffers(e,f),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,r||this.flushManagers()}catch(e){if(v)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,s)}return a||this.emitPostRender(),!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty(`height`,`${e}px`),!0}primeHighlightCache(){let{fileDiff:e,workerManager:t}=this;if(e==null||t==null||Fk(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||t.primeDiffHighlightCache(e)}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!Kk(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options;if(t!=null&&this.lineAnnotations.length>0)for(let[n,r]of this.lineAnnotations.entries()){let i=`${n}-${xE(r)}`,a=this.annotationCache.get(i);if(a==null||!Gk(r,a.annotation)){a?.element.remove();let e=t(r);if(e==null)continue;a={element:pD(xE(r)),annotation:r},a.element.appendChild(e),this.fileContainer.appendChild(a.element),this.annotationCache.set(i,a)}e.delete(i)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=mD();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:kD(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):kD(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=cD;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,r=this.cachedHeaderHTML??Hg(e);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){let e=document.createElement(`div`);e.innerHTML=r;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:i,renderHeaderPrefix:a,renderHeaderMetadata:o}=this.options;if(i!=null){let e=i(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,lm,e),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}let s=a?.(n)??void 0,c=o?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,sm,s),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,cm,c),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=hD(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=SD(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.options.theme??um,s=typeof o==`string`?o:{...o},c=vD(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=jD({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:CD(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=wD(this.themeCSSStyle.textContent??``,vD(e)))}applyHunksToDOM(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=ED({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=ED({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=ED({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:a,options:{diffStyle:o=`split`}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let s=this.getCodeColumns(o,r,a,i);if(s==null)return!1;let c=e.startingLine,l=t.startingLine,u=c+e.totalLines,d=l+t.totalLines,f=Math.max(c,l),p=Math.min(u,d);if(p<=f)return!1;let m=Math.max(0,f-c),h=Math.max(0,u-p),g=this.trimColumns({columns:s,trimStart:m,trimEnd:h,previousStart:c,overlapStart:f,overlapEnd:p,diffStyle:o});if(g<0)throw Error(`applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<g)throw Error(`applyPartialRender: trimmed beyond DOM row count`);let _=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(l,Math.max(f-l,0));if(y==null&&l<f)return!1;let b=v(p,Math.max(d-p,0));if(b==null&&d>p)return!1;let x=(e,t)=>{if(e!=null){if(o===`unified`&&!Array.isArray(s))this.insertPartialHTML(o,s,e,t);else if(o===`split`&&Array.isArray(s))this.insertPartialHTML(o,s,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);_+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,`afterbegin`),x(b,`beforeend`),this.lastRowCount!==_&&(this.applyRowSpan(o,s,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=eA(t[0]),i=eA(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}throw console.error({diffStyle:t,columns:e}),Error(`FileDiff.trimColumns: Invalid columns for diffType`)}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??``,10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty(`grid-row`,`span ${t}`),e.style.setProperty(`min-height`,`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,r){function i(e){if(e==null)return;let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&t.dataset.gutter!=null&&n.dataset.content!=null)return{gutter:t,content:n}}if(e===`unified`)return i(t);{let e=i(n),t=i(r);return e!=null||t!=null?[e,t]:void 0}}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};uD(u,this.appliedPreAttributes)||(OD(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Xk({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Zk({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function Qk(e,t,n=!1){return!n&&e==null&&t}function $k(e,t,n=!1){return e==null&&t&&!n}function eA(e){if(e!=null&&e.type===`element`)return e.children??[]}function tA({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o}){let s=zD(t,n),c=s,l=i?!0:a,u=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=mk({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:l,hunkIndex:n,collapsedContextThreshold:o}),d=(a.fromStart+a.fromEnd)*t.lineHeight;if(s+=d,c+=d,a.collapsedLines>0){let e=xk({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;s+=e,c+=e}s+=i.splitLineCount*t.lineHeight,c+=i.unifiedLineCount*t.lineHeight;let f=nA(i);s+=f.split*t.lineHeight,c+=f.unified*t.lineHeight;let p=n===u?gk({fileDiff:e,hunkIndex:n,expandedHunks:l,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(p!=null){let e=(p.fromStart+p.fromEnd)*t.lineHeight;if(s+=e,c+=e,p.collapsedLines>0){let e=Sk({type:r,metrics:t})?.totalHeight??0;s+=e,c+=e}}}if(e.hunks.length>0){let e=VD(t);s+=e,c+=e}return{splitHeight:s,unifiedHeight:c}}function nA(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type===`context`){let e=+(t.lines>0);return{split:e,unified:e}}return rA(e,t)}function rA(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}var iA=5e3,aA=-1,oA=class extends Yk{__id=`little-virtualized-file-diff:${++aA}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=RD(n)}setMetrics(e,t=!1){let n=RD(e);(t||!wm(this.metrics,n))&&(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){let t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!Em(t,e),r=n&&pA(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:mA(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1}={}){this.layoutDirty=!0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1,{overflow:t=`scroll`}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),t===`scroll`&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;let n=this.getDiffStyle(),r=n===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];for(let t of r){if(t==null)continue;let r=t.children[1];if(r instanceof HTMLElement)for(let t of r.children){if(!(t instanceof HTMLElement))continue;let r=t.dataset.lineIndex;if(r==null)continue;let i=gA(r,n),a=t.getBoundingClientRect().height,o=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(o=!0),a+=t.nextElementSibling.getBoundingClientRect().height);let s=this.getEstimatedLineHeight(o),c=this.cache.heightDeltas.get(i)??0,l=a-s;l!==c&&(e=!0,this.cache.measuredHeightDeltaTotal+=l-c,l===0?this.cache.heightDeltas.delete(i):this.cache.heightDeltas.set(i,l))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer!=null&&(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n){let r=!JD(this.fileDiff,e),i=n?.resetDiffLayoutCache===!0||r,a=r||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=RD(n.metrics),i=!0,a=!0);let{collapsed:o=!1}=this.options;return this.currentCollapsed!==o&&(this.currentCollapsed=o,i=!0),i&&this.resetLayoutCache({includeEstimatedHeights:a}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t=`additions`){if(this.fileDiff==null)return;let n=this.getLineIndex(e,t);if(n==null)return;let{disableFileHeader:r=!1,expandUnchanged:i=!1,collapsed:a=!1,collapsedContextThreshold:o=1}=this.options,s=this.getDiffStyle(),c=this.getHunkSeparatorType(),l=s===`split`?n[1]:n[0];this.approximateLayoutCheckpoints();let u=this.getLayoutCheckpointBeforeLineIndex(l),d=u?.top??zD(this.metrics,r);if(a)return{top:d,height:0};let f;return Ck({diff:this.fileDiff,diffStyle:s,startingLine:u?.renderedLineIndex??0,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:e,hunk:t,collapsedBefore:n,collapsedAfter:r,deletionLine:i,additionLine:a})=>{let o=s===`split`?a?.splitLineIndex??i?.splitLineIndex:a?.unifiedLineIndex??i?.unifiedLineIndex;if(o==null)throw Error(`VirtualizedFileDiff.getLinePosition: missing line index data`);if(n>0){let r=xk({type:c,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(r!=null){if(d+=r.gapBefore,l>=o-n&&l<o)return f={top:d,height:r.height},!0;d+=r.height+r.gapAfter}}let u=this.getLineHeight(o,(a?.noEOFCR??!1)||(i?.noEOFCR??!1));if(o===l)return f={top:d,height:u},!0;if(d+=u,r>0){let e=Sk({type:c,metrics:this.metrics});if(e!=null){if(l>o&&l<=o+r)return f={top:d+e.gapBefore,height:e.height},!0;d+=e.totalHeight}}return!1}}),f}getNumericScrollAnchor(e){if(this.fileDiff==null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:i=1}=this.options;if(r)return;let a=this.getDiffStyle(),o=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();let s=this.getLayoutCheckpointBeforeTop(e),c=s?.top??zD(this.metrics,t),l;return Ck({diff:this.fileDiff,diffStyle:a,startingLine:s?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,deletionLine:s,additionLine:u})=>{let d=a===`split`?u?.splitLineIndex??s?.splitLineIndex:u?.unifiedLineIndex??s?.unifiedLineIndex;if(d==null)throw Error(`VirtualizedFileDiff.getNumericScrollAnchor: missing line index data`);if(r>0){let e=xk({type:o,metrics:this.metrics,hunkIndex:t,hunkSpecs:n?.hunkSpecs});e!=null&&(c+=e.totalHeight)}if(c>=e&&(s==null?u!=null&&(l={lineNumber:u.lineNumber,side:`additions`,top:c}):l={lineNumber:s.lineNumber,side:`deletions`,top:c},l!=null))return!0;let f=this.getLineHeight(d,(u?.noEOFCR??!1)||(s?.noEOFCR??!1));if(c+=f,i>0){let e=Sk({type:o,metrics:this.metrics});e!=null&&(c+=e.totalHeight)}return!1}}),l}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let t=e==null?this.renderRange:this.computeRenderRangeFromWindow(this.fileDiff,this.top,e);if(t==null)return;let{bufferBefore:n,bufferAfter:r,totalLines:i}=t,a=0;if(i===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(a=r)}return{topOffset:this.top+n+a,height:this.height-(n+r)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSimpleMode()&&this.computeApproximateSize(),this.virtualizer.instanceChanged(this,!0)};setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}computeApproximateSize(e=!1){let t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;let n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,this.fileDiff==null){this.layoutDirty=!1;return}let{disableFileHeader:r=!1,collapsed:i=!1}=this.options,a=zD(this.metrics,r);if(this.height+=a,i){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight()+this.cache.measuredHeightDeltaTotal,t&&!n&&this.validateComputedHeight(),this.layoutDirty=!1}getActiveEstimatedHeight(){this.ensureEstimatedDiffHeights();let e=this.getDiffStyle()===`split`?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(e==null)throw Error(`VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height`);return e}ensureEstimatedDiffHeights(){if(this.fileDiff==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:r,unifiedHeight:i}=tA({fileDiff:this.fileDiff,metrics:this.metrics,disableFileHeader:e,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:t,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n});this.cache.estimatedSplitHeight=r,this.cache.estimatedUnifiedHeight=i}validateComputedHeight(){if(this.fileContainer==null||this.fileDiff==null)return;let e=this.fileContainer.getBoundingClientRect();e.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height})}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,forceRender:i=!1,...a}={}){let{forceRenderOverride:o,isSetup:s}=this;if(this.forceRenderOverride=void 0,this.fileDiff??=r??(t!=null&&n!=null?nk(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;if(s)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);let c=this.virtualizer.getWindowSpecs(),l=this.top??0,u=this.computeRenderRangeFromWindow(this.fileDiff,l,c);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:u,oldFile:t,newFile:n,forceRender:o??i,...a})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type===`simple`}isAdvancedMode(){return this.virtualizer.type===`advanced`}getVirtualizedTop(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??`split`}getHunkSeparatorType(){return hA(this.options.hunkSeparators)}approximateLayoutCheckpoints(){if(this.cache.checkpoints.length>0||this.fileDiff==null||this.fileDiff.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,r=this.fileDiff.hunks.length-1,i=this.getDiffStyle(),a=this.getHunkSeparatorType(),o=t?!0:this.hunksRenderer.getExpandedHunksMap(),s=sA(this.cache.heightDeltas),c=zD(this.metrics,e),l=0,u=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=l,o=l+e,u=uA(a);for(;u<o;){let e=u-a,r=c+(e>0?n:0)+e*this.metrics.lineHeight+dA(i,e)*this.metrics.lineHeight+cA(s,t,t+e);this.cache.checkpoints.push({renderedLineIndex:u,lineIndex:t+e,top:r}),u+=iA}c+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+cA(s,t,t+e)+r,l=o};for(let e=0;e<this.fileDiff.hunks.length;e++){let t=this.fileDiff.hunks[e];if(t==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let s=mk({isPartial:this.fileDiff.isPartial,rangeSize:t.collapsedBefore,expandedHunks:o,hunkIndex:e,collapsedContextThreshold:n}),c=s.collapsedLines>0?xk({type:a,metrics:this.metrics,hunkIndex:e,hunkSpecs:t.hunkSpecs})?.totalHeight??0:0;u({rowCount:s.fromStart,startLineIndex:(i===`split`?t.splitLineStart:t.unifiedLineStart)-s.rangeSize});let l=c;u({rowCount:s.fromEnd,startLineIndex:(i===`split`?t.splitLineStart:t.unifiedLineStart)-s.fromEnd,preSeparatorHeight:l}),s.fromEnd>0&&(l=0);let d=e===r?gk({fileDiff:this.fileDiff,hunkIndex:e,expandedHunks:o,collapsedContextThreshold:n,errorPrefix:`VirtualizedFileDiff`}):void 0,f=d!=null&&d.collapsedLines>0?Sk({type:a,metrics:this.metrics})?.totalHeight??0:0,p=d==null?0:d.fromStart+d.fromEnd,m=i===`split`?t.splitLineCount:t.unifiedLineCount,h=i===`split`?t.splitLineStart:t.unifiedLineStart;u({rowCount:m,startLineIndex:h,preSeparatorHeight:l,postSeparatorHeight:p===0?f:0,metadataOffsets:fA({diffStyle:i,hunk:t,rowCount:m})}),d!=null&&p>0&&u({rowCount:p,startLineIndex:h+m,postSeparatorHeight:f})}this.cache.totalLines=l}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=mk({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=gk({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=this.height,f=this.cache.totalLines>0?this.cache.totalLines:this.getExpandedLineCount(e,l),p=zD(this.metrics,i),m=e.hunks.length>0?VD(this.metrics):0;if(t<n-d||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-p-m};if(f<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(),f=this.cache.totalLines>0?this.cache.totalLines:f;let h=Math.ceil(Math.max(r-n,0)/c),g=Math.ceil(h/s)*s+s,_=g/s,v=_,y=[],b=(n+r)/2,x=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-g*c*2),s),S=t+(x?.top??p),C=x?.renderedLineIndex??0,w,T,E;if(Ck({diff:e,diffStyle:l,startingLine:x?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:e,hunk:i,collapsedBefore:a,collapsedAfter:o,deletionLine:c,additionLine:d})=>{let f=d==null?c.splitLineIndex:d.splitLineIndex,m=d==null?c.unifiedLineIndex:d.unifiedLineIndex,h=(d?.noEOFCR??!1)||(c?.noEOFCR??!1),g=(a>0?xk({type:u,metrics:this.metrics,hunkIndex:e,hunkSpecs:i?.hunkSpecs}):void 0)?.totalHeight??0;S+=g;let _=C%s===0,x=Math.floor(C/s);if(_&&(y[x]=S-(t+p+g),E!=null)){if(E<=0)return!0;E--}let D=this.getLineHeight(l===`split`?f:m,h);return S>n-D&&S<r&&(w??=x),T==null&&S+D>b&&(T=x),E==null&&S>=r&&_&&(E=v),C++,S+=D,o>0&&(S+=Sk({type:u,metrics:this.metrics})?.totalHeight??0),!1}}),w==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-p-m};T??=w;let D=Math.round(T-_/2),O=Math.max(0,Math.ceil(f/s)-_),k=Math.max(0,Math.min(D,O)),ee=k*s,A=D<0?g+D*s:g,te=y[k]??0,j=k+A/s;return{startingLine:ee,totalLines:A,bufferBefore:te,bufferAfter:j<y.length?d-p-y[j]-m:d-(S-t)-m}}};function sA(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,a]of t)n.push(e),i+=a,r.push(i);return{lineIndexes:n,prefixTotals:r}}function cA({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=lA(e,n);return(t[lA(e,r)]??0)-(t[i]??0)}function lA(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,a=e[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid prefix index`);a<t?n=i+1:r=i}return n}function uA(e){return Math.ceil(e/iA)*iA}function dA(e,t){let n=0;for(let r of e)r<t&&n++;return n}function fA({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(r==null)return[];if(r.type===`context`)return[n-1];let i=Math.max(r.deletions,r.additions),a=r.deletions+r.additions;if(e===`split`)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let o=[],s=n-a;return r.deletions>0&&t.noEOFCRDeletions&&o.push(s+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&o.push(n-1),o}function pA(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function mA(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function hA(e){return typeof e==`function`?`custom`:e??`line-info`}function gA(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function _A(e,t){return e==null||t==null?e===t:e.top===t.top&&e.bottom===t.bottom}var vA=1e3,yA=vA*4,bA=[0,1e-6,.99999,1],xA={overscrollSize:vA,intersectionObserverMargin:yA,resizeDebugging:!1},SA=0,CA=-1,wA=class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++CA}`;config;type=`simple`;intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...xA,...e}}setup(t,n){if(this.root==null){this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:bA,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),Sm(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)};for(let[e,t]of this.connectQueue.entries())this.connect(e,t);this.connectQueue.clear(),this.markDOMDirty(),Sm(this.computeRenderRangeAndEmit)}}instanceChanged(e,t){this.instancesChanged.add(e),t&&this.markDOMDirty(),Sm(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=km({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(e,t){let n=this.getScrollTop(),r=this.getHeight(),i=this.config.intersectionObserverMargin,a=n-i,o=n+r+i;return!(e<a-t||e>o)}handleContainerResize=e=>{if(this.root==null)return;let t=!1;for(let n of e){let e=n.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: content size change`,this.__id,{sizeChange:e-SA,newSize:e}),SA=e)):n.target===this.root?e!==this.height&&(this.heightDirty=!0,t=!0):n.target===this.contentContainer&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: scroller size change`,this.__id,{sizeChange:e-SA,newSize:e}),SA=e))}t&&Sm(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw Error(`Virtualizer.setupWindow: Invalid setup method`);window.addEventListener(`scroll`,this.handleWindowScroll,{passive:!0}),window.addEventListener(`resize`,this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(e){if(this.root==null||this.root instanceof Document)throw Error(`Virtualizer.setupElement: Invalid setup method`);this.root.addEventListener(`scroll`,this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),e??=this.root.firstElementChild??void 0,e instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleElementScroll),window.removeEventListener(`scroll`,this.handleWindowScroll),window.removeEventListener(`resize`,this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(e){return this.getScrollTop()+TA(e,this.getScrollContainerElement())}connect(e,t){if(this.observers.has(e))throw Error(`Virtualizer.connect: instance is already connected...`);return this.intersectionObserver==null?this.connectQueue.set(e,t):(this.intersectionObserver.observe(e),this.observers.set(e,t),this.instancesChanged.add(t),this.markDOMDirty(),Sm(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let t=this.observers.get(e);this.connectQueue.delete(e),t!=null&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),Sm(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,Sm(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{!e.__STOP&&this.root!=null&&this.root instanceof Document&&(this.scrollDirty=!0,Sm(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,Sm(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let t=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;let n=this.instancesChanged.size>0;if(this.instancesChanged.size===0){let e=km({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!t&&_A(this.windowSpecs,e)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let r=this.getScrollAnchor(this.height),i=new Set;for(let e of t?this.observers.values():this.visibleInstances.values())e.onRender(t)&&i.add(e);for(let e of this.instancesChanged)i.has(e)||e.onRender(t)&&i.add(e);this.scrollFix(r);for(let e of i)e.reconcileHeights();n||=this.instancesChanged.size>0,n&&this.markDOMDirty(),(n||t)&&Sm(this.computeRenderRangeAndEmit),i.clear(),this.instancesChanged.clear()};scrollFix(e){if(e==null)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:r,fileElement:i,fileOffset:a,fileTypeOffset:o}=e;if(n!=null&&r!=null){let e=i.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=TA(e,t);if(n!==r){let e=n-r;this.applyScrollFix(e)}return}}let s=TA(i,t);if(o===`top`)s!==a&&this.applyScrollFix(s-a);else{let e=s+i.getBoundingClientRect().height;e!==a&&this.applyScrollFix(e-a)}}applyScrollFix(e){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:`instant`}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:`instant`}),this.markDOMDirty()}getScrollAnchor(e){let t=this.getScrollContainerElement(),n;for(let[r]of this.visibleInstances.entries()){let i=TA(r,t),a=i+r.offsetHeight,o,s;a<=0?(o=a,s=`bottom`):(o=i,s=`top`);let c,l;if(a>0&&i<e)for(let e of r.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`)??[]){if(!(e instanceof HTMLElement))continue;let n=e.dataset.lineIndex;if(n==null)continue;let r=TA(e,t);if(!(r<0)){c=n,l=r;break}}if(n?.lineOffset!=null&&l==null)continue;let u=!1;(n==null||l!=null&&(n.lineOffset==null||l<n.lineOffset)||l==null&&n.lineOffset==null&&(o>=0&&(n.fileOffset<0||o<n.fileOffset)||o<0&&n.fileOffset<0&&o>n.fileOffset))&&(u=!0),u&&(n={fileElement:r,fileTypeOffset:s,fileOffset:o,lineIndex:c,lineOffset:l})}return n}handleIntersectionChange=e=>{this.scrollDirty=!0;for(let{target:t,isIntersecting:n}of e){if(!(t instanceof HTMLElement))throw Error(`Virtualizer.handleIntersectionChange: target not an HTMLElement`);let e=this.observers.get(t);e!=null&&(n&&!this.visibleInstances.has(t)?(e.setVisibility(!0),this.visibleInstances.set(t,e),this.visibleInstancesDirty=!0):!n&&this.visibleInstances.has(t)&&(e.setVisibility(!1),this.visibleInstances.delete(t),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&Sm(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight())),this.scrollTop=e,e}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function TA(e,t){let n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}function EA(e){let t=[];for(let n of e){let e=h_.get(n);if(e==null)throw Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(e)}return t}function DA(e){for(let t of Array.isArray(e)?e:[e])if(!h_.has(t))return!1;return!0}async function OA(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=fT(r)??dT(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}function kA(e){return wT.getResolvedThemes(e)}function AA(e,t){try{let n=ET({name:e,load:t});wT.registerTheme(n.name,n.load)}catch(t){if(t instanceof bT){console.error(`SharedHighlight.registerCustomTheme: theme name already registered`,e);return}throw t}}async function jA(e){for(let t of e)qT(t);let t=await wT.resolveThemes(e);for(let n=0;n<e.length;n++)JT(e[n],t[n]);return t}var MA=`
|
|
258
|
+
:host {
|
|
259
|
+
--diffs-bg: var(--opencode-diffs-bg, var(--color-background-stronger));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
[data-diff],
|
|
263
|
+
[data-file] {
|
|
264
|
+
/* Pierre 1.2 mixes these override targets at 12% in light mode and 20% in dark mode. */
|
|
265
|
+
--diffs-bg-deletion-override: light-dark(
|
|
266
|
+
color-mix(in lab, var(--diffs-bg) 33.333%, var(--diffs-deletion-base)),
|
|
267
|
+
color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-deletion-base))
|
|
268
|
+
);
|
|
269
|
+
--diffs-bg-deletion-number-override: var(--diffs-bg-deletion-override);
|
|
270
|
+
--diffs-bg-addition-override: light-dark(
|
|
271
|
+
color-mix(in lab, var(--diffs-bg) 33.333%, var(--diffs-addition-base)),
|
|
272
|
+
color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-addition-base))
|
|
273
|
+
);
|
|
274
|
+
--diffs-bg-addition-number-override: var(--diffs-bg-addition-override);
|
|
275
|
+
--diffs-selection-base: var(--v2-background-bg-accent);
|
|
276
|
+
--diffs-selection-number-fg: var(--v2-text-text-accent);
|
|
277
|
+
--diffs-comment-bg: rgb(from var(--v2-background-bg-accent) r g b / 0.06);
|
|
278
|
+
/* Use explicit alpha instead of color-mix(..., transparent) to avoid Safari's non-premultiplied interpolation bugs. */
|
|
279
|
+
--diffs-bg-selection: var(--diffs-bg-selection-override, rgb(from var(--diffs-selection-base) r g b / 0.2));
|
|
280
|
+
--diffs-bg-selection-number: var(--diffs-bg-selection-number-override, var(--diffs-bg-selection));
|
|
281
|
+
--diffs-bg-selection-text: rgb(from var(--diffs-selection-base) r g b / 0.2);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
[data-diff] ::selection,
|
|
285
|
+
[data-file] ::selection {
|
|
286
|
+
background-color: var(--diffs-bg-selection-text);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
[data-indicators='bars'] [data-column-number][data-line-type='change-addition']::before,
|
|
290
|
+
[data-indicators='bars'] [data-column-number][data-line-type='change-deletion']::before {
|
|
291
|
+
width: 2px;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
[data-indicators='bars'] [data-column-number][data-line-type='change-deletion']::before {
|
|
295
|
+
background-image: none;
|
|
296
|
+
background-color: var(--diffs-deletion-base);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
[data-background] [data-column-number] {
|
|
300
|
+
--mix-light: 88%;
|
|
301
|
+
--mix-dark: 80%;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
[data-diff-type='split'] [data-additions],
|
|
305
|
+
[data-diff-type='split'] [data-additions] [data-gutter],
|
|
306
|
+
[data-diff-type='split'] [data-deletions],
|
|
307
|
+
[data-diff-type='split'] [data-deletions] [data-content] {
|
|
308
|
+
border-left: 0;
|
|
309
|
+
border-right: 0;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
[data-content-buffer] {
|
|
313
|
+
background-image: none;
|
|
314
|
+
background-color: var(--diffs-bg-context-gutter);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
::highlight(opencode-find) {
|
|
318
|
+
background-color: rgb(from var(--surface-warning-base) r g b / 0.35);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
::highlight(opencode-find-current) {
|
|
322
|
+
background-color: rgb(from var(--surface-warning-strong) r g b / 0.55);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
[data-diff] [data-line][data-comment-selected]:not([data-selected-line]) {
|
|
326
|
+
box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
[data-file] [data-line][data-comment-selected]:not([data-selected-line]) {
|
|
330
|
+
box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
[data-diff] [data-column-number][data-comment-selected]:not([data-selected-line]) {
|
|
334
|
+
box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection-number);
|
|
335
|
+
color: var(--diffs-selection-number-fg);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
[data-file] [data-column-number][data-comment-selected]:not([data-selected-line]) {
|
|
339
|
+
box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection-number);
|
|
340
|
+
color: var(--diffs-selection-number-fg);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
[data-diff] [data-line-annotation],
|
|
344
|
+
[data-diff] [data-gutter-buffer='annotation'],
|
|
345
|
+
[data-file] [data-line-annotation],
|
|
346
|
+
[data-file] [data-gutter-buffer='annotation'] {
|
|
347
|
+
--diffs-annotation-bg: var(--diffs-comment-bg);
|
|
348
|
+
--diffs-computed-decoration-bg: var(--diffs-comment-bg);
|
|
349
|
+
--diffs-computed-diff-line-bg: var(--diffs-comment-bg);
|
|
350
|
+
--diffs-computed-selected-line-bg: var(--diffs-comment-bg);
|
|
351
|
+
--diffs-line-bg: var(--diffs-comment-bg);
|
|
352
|
+
background-color: var(--diffs-comment-bg);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
[data-diff] [data-line][data-selected-line] {
|
|
356
|
+
background-color: var(--diffs-bg-selection);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
[data-file] [data-line][data-selected-line] {
|
|
360
|
+
background-color: var(--diffs-bg-selection);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
[data-diff] [data-column-number][data-selected-line] {
|
|
364
|
+
background-color: var(--diffs-bg-selection-number);
|
|
365
|
+
color: var(--diffs-selection-number-fg);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
[data-file] [data-column-number][data-selected-line] {
|
|
369
|
+
background-color: var(--diffs-bg-selection-number);
|
|
370
|
+
color: var(--diffs-selection-number-fg);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
[data-diff] [data-column-number][data-line-type='context'][data-selected-line],
|
|
374
|
+
[data-diff] [data-column-number][data-line-type='context-expanded'][data-selected-line],
|
|
375
|
+
[data-diff] [data-column-number][data-line-type='change-addition'][data-selected-line],
|
|
376
|
+
[data-diff] [data-column-number][data-line-type='change-deletion'][data-selected-line] {
|
|
377
|
+
color: var(--diffs-selection-number-fg);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
@media (max-width: 767px) {
|
|
381
|
+
/* File annotations share the code column; reclaim the measured number gutter. */
|
|
382
|
+
[data-file] [data-line-annotation] {
|
|
383
|
+
margin-inline-start: calc(-1 * var(--diffs-column-number-width, 0px));
|
|
384
|
+
z-index: 4;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
[data-file] [data-annotation-content] {
|
|
388
|
+
width: var(--diffs-column-width, auto);
|
|
389
|
+
inset-inline-start: 0;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
@media (pointer: fine) {
|
|
394
|
+
[data-gutter-utility-slot] {
|
|
395
|
+
opacity: 0;
|
|
396
|
+
pointer-events: none;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
[data-column-number][data-hovered] [data-gutter-utility-slot],
|
|
400
|
+
[data-gutter-utility-slot]:focus-within {
|
|
401
|
+
opacity: 1;
|
|
402
|
+
pointer-events: auto;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/* The deletion word-diff emphasis is stronger than additions; soften it while selected so the selection highlight reads consistently. */
|
|
407
|
+
[data-diff] [data-line][data-line-type='change-deletion'][data-selected-line] {
|
|
408
|
+
--diffs-bg-deletion-emphasis: light-dark(
|
|
409
|
+
rgb(from var(--diffs-deletion-base) r g b / 0.07),
|
|
410
|
+
rgb(from var(--diffs-deletion-base) r g b / 0.1)
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
[data-diff-header],
|
|
415
|
+
[data-diff],
|
|
416
|
+
[data-file] {
|
|
417
|
+
[data-separator] {
|
|
418
|
+
height: 24px;
|
|
419
|
+
}
|
|
420
|
+
[data-column-number] {
|
|
421
|
+
cursor: default !important;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
&[data-interactive-line-numbers] [data-column-number] {
|
|
425
|
+
cursor: default !important;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
&[data-interactive-lines] [data-line] {
|
|
429
|
+
cursor: auto !important;
|
|
430
|
+
}
|
|
431
|
+
[data-code] {
|
|
432
|
+
overflow-x: auto !important;
|
|
433
|
+
overflow-y: clip !important;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
[data-annotation-slot] {
|
|
439
|
+
padding: 12px;
|
|
440
|
+
box-sizing: border-box;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
[data-component="line-comment"] {
|
|
444
|
+
position: absolute;
|
|
445
|
+
right: 24px;
|
|
446
|
+
z-index: var(--line-comment-z, 30);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
[data-component="line-comment"][data-inline] {
|
|
450
|
+
position: relative;
|
|
451
|
+
right: auto;
|
|
452
|
+
display: flex;
|
|
453
|
+
width: 100%;
|
|
454
|
+
min-width: 0;
|
|
455
|
+
align-items: flex-start;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
[data-component="line-comment"][data-open] {
|
|
459
|
+
z-index: var(--line-comment-open-z, 100);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
[data-component="line-comment"] [data-slot="line-comment-button"] {
|
|
463
|
+
width: 20px;
|
|
464
|
+
height: 20px;
|
|
465
|
+
border-radius: var(--radius-md);
|
|
466
|
+
display: flex;
|
|
467
|
+
align-items: center;
|
|
468
|
+
justify-content: center;
|
|
469
|
+
background: var(--icon-interactive-base);
|
|
470
|
+
box-shadow: var(--shadow-xs);
|
|
471
|
+
cursor: default;
|
|
472
|
+
border: none;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
[data-component="line-comment"] [data-slot="icon-svg"] {
|
|
476
|
+
color: var(--white);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
[data-component="line-comment"] [data-slot="line-comment-icon"] {
|
|
480
|
+
width: 12px;
|
|
481
|
+
height: 12px;
|
|
482
|
+
color: var(--white);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
[data-component="line-comment"] [data-slot="line-comment-button"]:focus {
|
|
486
|
+
outline: none;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
[data-component="line-comment"] [data-slot="line-comment-button"]:focus-visible {
|
|
490
|
+
box-shadow: var(--shadow-xs-border-focus);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
[data-component="line-comment"] [data-slot="line-comment-popover"] {
|
|
494
|
+
position: absolute;
|
|
495
|
+
top: calc(100% + 4px);
|
|
496
|
+
right: -8px;
|
|
497
|
+
z-index: var(--line-comment-popover-z, 40);
|
|
498
|
+
min-width: 200px;
|
|
499
|
+
max-width: none;
|
|
500
|
+
box-sizing: border-box;
|
|
501
|
+
border-radius: 8px;
|
|
502
|
+
background: var(--surface-raised-stronger-non-alpha);
|
|
503
|
+
box-shadow: var(--shadow-xxs-border);
|
|
504
|
+
padding: 12px;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
[data-component="line-comment"][data-inline] [data-slot="line-comment-popover"] {
|
|
508
|
+
position: relative;
|
|
509
|
+
top: auto;
|
|
510
|
+
right: auto;
|
|
511
|
+
margin-left: 8px;
|
|
512
|
+
flex: 1 1 0%;
|
|
513
|
+
width: auto;
|
|
514
|
+
max-width: 100%;
|
|
515
|
+
min-width: 0;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
[data-component="line-comment"][data-inline] [data-slot="line-comment-popover"][data-inline-body] {
|
|
519
|
+
margin-left: 0;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
[data-component="line-comment"][data-inline][data-variant="default"] [data-slot="line-comment-popover"][data-inline-body] {
|
|
523
|
+
cursor: pointer;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
[data-component="line-comment"][data-variant="editor"] [data-slot="line-comment-popover"] {
|
|
527
|
+
width: 380px;
|
|
528
|
+
max-width: none;
|
|
529
|
+
padding: 8px;
|
|
530
|
+
border-radius: 14px;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
[data-component="line-comment"][data-inline][data-variant="editor"] [data-slot="line-comment-popover"] {
|
|
534
|
+
width: 100%;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
[data-component="line-comment"] [data-slot="line-comment-content"] {
|
|
538
|
+
display: flex;
|
|
539
|
+
flex-direction: column;
|
|
540
|
+
gap: 6px;
|
|
541
|
+
width: 100%;
|
|
542
|
+
min-width: 0;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
[data-component="line-comment"] [data-slot="line-comment-head"] {
|
|
546
|
+
display: flex;
|
|
547
|
+
align-items: flex-start;
|
|
548
|
+
gap: 8px;
|
|
549
|
+
min-width: 0;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
[data-component="line-comment"] [data-slot="line-comment-text"] {
|
|
553
|
+
flex: 1;
|
|
554
|
+
min-width: 0;
|
|
555
|
+
font-family: var(--font-family-sans);
|
|
556
|
+
font-size: var(--font-size-base);
|
|
557
|
+
font-weight: var(--font-weight-regular);
|
|
558
|
+
line-height: var(--line-height-x-large);
|
|
559
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
560
|
+
color: var(--text-strong);
|
|
561
|
+
white-space: pre-wrap;
|
|
562
|
+
overflow-wrap: anywhere;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
[data-component="line-comment"] [data-slot="line-comment-tools"] {
|
|
566
|
+
flex: 0 0 auto;
|
|
567
|
+
display: flex;
|
|
568
|
+
align-items: center;
|
|
569
|
+
justify-content: flex-end;
|
|
570
|
+
min-width: 0;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
[data-component="line-comment"] [data-slot="line-comment-label"],
|
|
574
|
+
[data-component="line-comment"] [data-slot="line-comment-editor-label"] {
|
|
575
|
+
font-family: var(--font-family-sans);
|
|
576
|
+
font-size: var(--font-size-small);
|
|
577
|
+
font-weight: var(--font-weight-medium);
|
|
578
|
+
line-height: var(--line-height-large);
|
|
579
|
+
letter-spacing: var(--letter-spacing-normal);
|
|
580
|
+
color: var(--text-weak);
|
|
581
|
+
min-width: 0;
|
|
582
|
+
white-space: normal;
|
|
583
|
+
overflow-wrap: anywhere;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
[data-component="line-comment"] [data-slot="line-comment-editor"] {
|
|
587
|
+
display: flex;
|
|
588
|
+
flex-direction: column;
|
|
589
|
+
gap: 8px;
|
|
590
|
+
width: 100%;
|
|
591
|
+
min-width: 0;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
[data-component="line-comment"] [data-slot="line-comment-textarea"] {
|
|
595
|
+
width: 100%;
|
|
596
|
+
box-sizing: border-box;
|
|
597
|
+
resize: vertical;
|
|
598
|
+
padding: 8px;
|
|
599
|
+
border-radius: var(--radius-md);
|
|
600
|
+
background: var(--surface-base);
|
|
601
|
+
border: 1px solid var(--border-base);
|
|
602
|
+
color: var(--text-strong);
|
|
603
|
+
font-family: var(--font-family-sans);
|
|
604
|
+
font-size: var(--font-size-small);
|
|
605
|
+
line-height: var(--line-height-large);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
[data-component="line-comment"] [data-slot="line-comment-textarea"]:focus {
|
|
609
|
+
outline: none;
|
|
610
|
+
box-shadow: var(--shadow-xs-border-select);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
[data-component="line-comment"] [data-slot="line-comment-mention-list"] {
|
|
614
|
+
display: flex;
|
|
615
|
+
flex-direction: column;
|
|
616
|
+
gap: 4px;
|
|
617
|
+
max-height: 180px;
|
|
618
|
+
overflow: auto;
|
|
619
|
+
padding: 4px;
|
|
620
|
+
border: 1px solid var(--border-base);
|
|
621
|
+
border-radius: var(--radius-md);
|
|
622
|
+
background: var(--surface-base);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
[data-component="line-comment"] [data-slot="line-comment-mention-item"] {
|
|
626
|
+
display: flex;
|
|
627
|
+
align-items: center;
|
|
628
|
+
gap: 8px;
|
|
629
|
+
width: 100%;
|
|
630
|
+
min-width: 0;
|
|
631
|
+
padding: 6px 8px;
|
|
632
|
+
border: 0;
|
|
633
|
+
border-radius: var(--radius-sm);
|
|
634
|
+
background: transparent;
|
|
635
|
+
color: var(--text-strong);
|
|
636
|
+
text-align: left;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
[data-component="line-comment"] [data-slot="line-comment-mention-item"][data-active] {
|
|
640
|
+
background: var(--surface-raised-base-hover);
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
[data-component="line-comment"] [data-slot="line-comment-mention-path"] {
|
|
644
|
+
display: flex;
|
|
645
|
+
align-items: center;
|
|
646
|
+
min-width: 0;
|
|
647
|
+
font-family: var(--font-family-sans);
|
|
648
|
+
font-size: var(--font-size-small);
|
|
649
|
+
line-height: var(--line-height-large);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
[data-component="line-comment"] [data-slot="line-comment-mention-dir"] {
|
|
653
|
+
min-width: 0;
|
|
654
|
+
color: var(--text-weak);
|
|
655
|
+
white-space: nowrap;
|
|
656
|
+
overflow: hidden;
|
|
657
|
+
text-overflow: ellipsis;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
[data-component="line-comment"] [data-slot="line-comment-mention-file"] {
|
|
661
|
+
color: var(--text-strong);
|
|
662
|
+
white-space: nowrap;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
[data-component="line-comment"] [data-slot="line-comment-actions"] {
|
|
666
|
+
display: flex;
|
|
667
|
+
align-items: center;
|
|
668
|
+
flex-wrap: wrap;
|
|
669
|
+
gap: 8px;
|
|
670
|
+
padding-left: 8px;
|
|
671
|
+
min-width: 0;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
[data-component="line-comment"] [data-slot="line-comment-editor-label"] {
|
|
675
|
+
flex: 1 1 220px;
|
|
676
|
+
margin-right: auto;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
[data-component="line-comment"] [data-slot="line-comment-action"] {
|
|
680
|
+
border: 1px solid var(--border-base);
|
|
681
|
+
background: var(--surface-base);
|
|
682
|
+
color: var(--text-strong);
|
|
683
|
+
border-radius: var(--radius-md);
|
|
684
|
+
height: 28px;
|
|
685
|
+
padding: 0 10px;
|
|
686
|
+
font-family: var(--font-family-sans);
|
|
687
|
+
font-size: var(--font-size-small);
|
|
688
|
+
font-weight: var(--font-weight-medium);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
[data-component="line-comment"] [data-slot="line-comment-action"][data-variant="ghost"] {
|
|
692
|
+
background: transparent;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
[data-component="line-comment"] [data-slot="line-comment-action"][data-variant="primary"] {
|
|
696
|
+
background: var(--text-strong);
|
|
697
|
+
border-color: var(--text-strong);
|
|
698
|
+
color: var(--background-base);
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
[data-component="line-comment"] [data-slot="line-comment-action"]:disabled {
|
|
702
|
+
opacity: 0.5;
|
|
703
|
+
pointer-events: none;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
`;function NA(e){return{theme:`OpenCode`,themeType:`system`,disableLineNumbers:!1,overflow:`wrap`,diffStyle:e??`unified`,diffIndicators:`bars`,lineHoverHighlight:`both`,disableBackground:!1,expansionLineCount:20,hunkSeparators:`line-info-basic`,lineDiffType:`word-alt`,maxLineDiffLength:1e3,maxLineLengthForHighlighting:1e3,disableFileHeader:!0,unsafeCSS:MA}}var PA={"--diffs-font-family":`var(--font-family-mono)`,"--diffs-font-size":`var(--font-size-small)`,"--diffs-line-height":`24px`,"--diffs-tab-size":2,"--diffs-font-features":`var(--font-family-mono--font-feature-settings)`,"--diffs-header-font-family":`var(--font-family-sans)`,"--diffs-gap-block":0,"--diffs-gap-style":0,"--diffs-min-number-column-width":`3ch`};function FA(e){let t=e.closest(`[data-line], [data-alt-line]`);if(t instanceof HTMLElement){let e=t.dataset.lineType;if(e===`change-deletion`)return`deletions`;if(e===`change-addition`||e===`change-additions`)return`additions`}let n=e.closest(`[data-code]`);return n instanceof HTMLElement&&n.hasAttribute(`data-deletions`)?`deletions`:`additions`}function IA(e,t){let n=t.dataset.lineIndex;if(!n)return;let r=n.split(`,`).map(e=>parseInt(e,10)).filter(e=>!Number.isNaN(e));if(r.length!==0)return e&&r.length===2?r[1]:r[0]}function LA(e,t,n,r){let i=Array.from(e.querySelectorAll(`[data-line="${n}"], [data-alt-line="${n}"]`)).filter(e=>e instanceof HTMLElement);if(i.length===0)return;let a=r??`additions`;for(let e of i)if(FA(e)===a||parseInt(e.dataset.altLine??``,10)===n)return IA(t,e)}function RA(e,t){if(!t)return t;if(!e)return;let n=e.querySelector(`[data-diff]`);if(!(n instanceof HTMLElement))return;let r=n.dataset.diffType===`split`,i=LA(e,r,t.start,t.side),a=LA(e,r,t.end,t.endSide??t.side);if(i===void 0||a===void 0)return e.querySelector(`[data-line], [data-alt-line]`)==null?void 0:null;if(i<=a)return t;let o=t.endSide??t.side,s={start:t.end,end:t.start};return o&&(s.side=o),t.endSide&&t.side&&(s.endSide=t.side),s}function zA(e){let t=e.dataset.lineAnnotation?.split(`,`)[1];if(!t)return;let n=parseInt(t,10);if(!Number.isNaN(n))return n}function BA(e){let t=Array.from(e.querySelectorAll(`[data-comment-selected]`));for(let e of t)e instanceof HTMLElement&&e.removeAttribute(`data-comment-selected`)}function VA(e,t){BA(e);let n=e.querySelector(`[data-diff]`);if(!(n instanceof HTMLElement))return;let r=n.dataset.diffType===`split`,i=Array.from(n.querySelectorAll(`[data-line-index]`)).filter(e=>e instanceof HTMLElement);if(i.length===0)return;let a=Array.from(n.querySelectorAll(`[data-line-annotation]`)).filter(e=>e instanceof HTMLElement);for(let n of t){let t=LA(e,r,n.start,n.side);if(t===void 0)continue;let o=n.end===n.start&&(n.endSide==null||n.endSide===n.side)?t:LA(e,r,n.end,n.endSide??n.side);if(o===void 0)continue;let s=Math.min(t,o),c=Math.max(t,o);for(let e of i){let t=IA(r,e);t===void 0||t<s||t>c||e.setAttribute(`data-comment-selected`,``)}for(let e of a){let t=zA(e);t===void 0||t<s||t>c||e.setAttribute(`data-comment-selected`,``)}}}function HA(e,t){BA(e);let n=Array.from(e.querySelectorAll(`[data-line-annotation]`)).filter(e=>e instanceof HTMLElement);for(let r of t){let t=Math.max(1,Math.min(r.start,r.end)),i=Math.max(r.start,r.end);for(let n=t;n<=i;n++){let t=Array.from(e.querySelectorAll(`[data-line="${n}"], [data-column-number="${n}"]`));for(let e of t)e instanceof HTMLElement&&e.setAttribute(`data-comment-selected`,``)}for(let e of n){let n=zA(e);n===void 0||n<t||n>i||e.setAttribute(`data-comment-selected`,``)}}}var UA=new Set,WA,GA,KA=!1;function qA(e){return e instanceof HTMLElement?e.closest(`[data-prevent-autofocus]`)||e.isContentEditable?!0:/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(e.tagName):!1}function JA(e){if(e instanceof Node)for(let t of UA){let n=t.element();if(n&&n.isConnected&&n.contains(e))return t}}function YA(){KA||typeof window>`u`||(KA=!0,window.addEventListener(`keydown`,e=>{if(e.defaultPrevented||qA(e.target)||!(e.metaKey||e.ctrlKey))return;let t=e.key.toLowerCase();if(t===`g`){let t=GA;if(!t||!t.isOpen())return;e.preventDefault(),e.stopPropagation(),t.next(e.shiftKey?-1:1);return}if(t!==`f`)return;let n=GA;if(n&&n.isOpen()){e.preventDefault(),e.stopPropagation(),n.open();return}let r=JA(document.activeElement)??JA(e.target)??WA??Array.from(UA)[0];r&&(e.preventDefault(),e.stopPropagation(),r.open())},{capture:!0}))}function XA(){let e=globalThis.CSS?.highlights;e&&(e.delete(`opencode-find`),e.delete(`opencode-find-current`))}function ZA(){let e=globalThis;return typeof e.Highlight==`function`&&e.CSS?.highlights!=null}function QA(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);if(e.overflowY===`auto`||e.overflowY===`scroll`)return t;t=t.parentElement}}function $A(e){let t,n,r=`overlay`,i=[],[a,o]=A([]),[s,c]=$t({open:!1,query:``,index:0,count:0,pos:{top:8,right:8}}),l=()=>s.open,u=()=>s.query,d=()=>s.index,f=()=>s.count,p=()=>s.pos,m=()=>{o([])},h=()=>{let t=e.overlay();t&&(n!==void 0&&(cancelAnimationFrame(n),n=void 0),t.innerHTML=``)},g=()=>{if(r!==`overlay`){h();return}let t=e.wrapper(),n=e.overlay();if(!t||!n||(h(),i.length===0))return;let a=t.getBoundingClientRect(),o=d(),s=document.createDocumentFragment();for(let e=0;e<i.length;e++){let t=i[e],n=e===o;for(let e of Array.from(t.getClientRects())){if(!e.width||!e.height)continue;let t=document.createElement(`div`);t.style.position=`absolute`,t.style.left=`${Math.round(e.left-a.left)}px`,t.style.top=`${Math.round(e.top-a.top)}px`,t.style.width=`${Math.round(e.width)}px`,t.style.height=`${Math.round(e.height)}px`,t.style.borderRadius=`2px`,t.style.backgroundColor=n?`var(--surface-warning-strong)`:`var(--surface-warning-base)`,t.style.opacity=n?`0.55`:`0.35`,n&&(t.style.boxShadow=`inset 0 0 0 1px var(--border-warning-base)`),s.appendChild(t)}}n.appendChild(s)};function _(){r===`overlay`&&l()&&n===void 0&&(n=requestAnimationFrame(()=>{n=void 0,g()}))}let v=()=>{if(r!==`overlay`)return;let t=e.getRoot(),n=t?Array.from(t.querySelectorAll(`[data-code]`)).filter(e=>e instanceof HTMLElement):[],i=a();n.length===i.length&&n.every((e,t)=>e===i[t])||(m(),o(n))},y=()=>{XA(),h(),m(),i=[],c(`count`,0),c(`index`,0)},b=()=>{if(typeof window>`u`)return;let t=e.wrapper();if(!t)return;let n=QA(t)??t,r=n.getBoundingClientRect(),i=parseFloat(getComputedStyle(n).getPropertyValue(`--session-title-height`)),a=Number.isNaN(i)?0:i;c(`pos`,{top:Math.round(r.top)+a-4,right:Math.round(window.innerWidth-r.right)+8})},x=(e,t)=>{let n=t.toLowerCase(),r=[],i=Array.from(e.querySelectorAll(`[data-content] [data-line], [data-column-content]`)).filter(e=>e instanceof HTMLElement);for(let e of i){let i=e.textContent;if(!i)continue;let a=i.toLowerCase(),o=a.indexOf(n);if(o===-1)continue;let s=[],c=[],l=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),u=l.nextNode(),d=0;for(;u;)u instanceof Text&&(d+=u.data.length,s.push(u),c.push(d)),u=l.nextNode();if(s.length===0)continue;let f=e=>{let t=0,n=c.length-1;for(;t<n;){let r=t+n>>1;c[r]>=e?n=r:t=r+1}let r=t===0?0:c[t-1];return{node:s[t],offset:e-r}};for(;o!==-1;){let e=f(o),i=f(o+t.length),s=document.createRange();s.setStart(e.node,e.offset),s.setEnd(i.node,i.offset),r.push(s),o=a.indexOf(n,o+t.length)}}return r},S=e=>{let t=e.startContainer;(t instanceof Element?t:t.parentElement)?.scrollIntoView({block:`center`,inline:`center`})},C=(e,t)=>{let n=globalThis,r=n.CSS?.highlights,i=n.Highlight;if(!r||typeof i!=`function`)return!1;r.delete(`opencode-find`),r.delete(`opencode-find-current`);let a=e[t];a&&r.set(`opencode-find-current`,new i(a));let o=e.filter((e,n)=>n!==t);return o.length>0&&r.set(`opencode-find`,new i(...o)),!0},w=t=>{if(!l())return;let n=u().trim();if(!n){y();return}let a=e.getRoot();if(!a)return;r=ZA()?`highlights`:`overlay`;let o=x(a,n),s=o.length,f=t?.reset?0:d(),p=s?Math.min(f,s-1):0;i=o,c(`count`,s),c(`index`,p);let g=o[p];if(r===`highlights`){h(),m(),C(o,p)||(r=`overlay`,XA(),v(),_()),t?.scroll&&g&&S(g);return}XA(),v(),t?.scroll&&g&&S(g),_()},T=()=>{c(`open`,!1),c(`query`,``),y(),GA===O&&(GA=void 0)},E=()=>{GA&&GA!==O&&GA.close(),GA=O,WA=O,l()||c(`open`,!0),requestAnimationFrame(()=>{w({scroll:!0}),t?.focus(),t?.select()})},D=e=>{if(!l())return;let t=f();if(t<=0)return;let n=(d()+e+t)%t;c(`index`,n);let a=i[n];if(a){if(r===`highlights`){if(!C(i,n)){r=`overlay`,w({reset:!0,scroll:!0});return}S(a);return}XA(),v(),S(a),_()}},O={element:e.wrapper,isOpen:()=>l(),next:D,open:E,close:T};return M(()=>{for(let e of a())pn(e,`scroll`,_,{passive:!0})}),se(()=>{r=ZA()?`highlights`:`overlay`,YA(),UA.add(O),WA||=O,P(()=>{UA.delete(O),GA===O&&(GA=void 0,XA()),WA===O&&(WA=void 0)})}),M(()=>{if(!l())return;let t=()=>b();requestAnimationFrame(t),pn(window,`resize`,t,{passive:!0});let n=e.wrapper();n&&mu(QA(n)??n,t)}),P(()=>{m(),h(),GA===O&&(GA=void 0,XA())}),{open:l,query:u,count:f,index:d,pos:p,setInput:e=>{t=e},setQuery:e=>{c(`query`,e),c(`index`,0),w({reset:!0,scroll:!0})},focus:E,close:T,next:D,refresh:e=>w(e),onPointerDown:()=>{WA=O,e.wrapper()?.focus({preventScroll:!0})},onFocus:()=>{WA=O},onInputKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),T();return}e.key===`Enter`&&(e.preventDefault(),D(e.shiftKey?-1:1))}}}function ej(){return{token:0}}function tj(e){e.observer?.disconnect(),e.observer=void 0}function nj(e){if(!e)return;let t=e.querySelector(`diffs-container`);if(t instanceof HTMLElement)return t}function rj(e){return nj(e)?.shadowRoot??void 0}function ij(e){if(!e||typeof document>`u`)return;let t=document.documentElement.dataset.colorScheme;if(t===`dark`||t===`light`){e.dataset.colorScheme=t;return}e.removeAttribute(`data-color-scheme`)}function aj(e){if(typeof document>`u`||(ij(e()),typeof MutationObserver>`u`))return()=>{};let t=document.documentElement,n=new MutationObserver(()=>ij(e()));return n.observe(t,{attributes:!0,attributeFilter:[`data-color-scheme`]}),()=>n.disconnect()}function oj(e){tj(e.state),e.state.token+=1;let t=e.state.token,n=Math.max(0,e.settleFrames??0),r=()=>{let r=n=>{if(t===e.state.token){if(n<=0){e.onReady();return}requestAnimationFrame(()=>r(n-1))}};requestAnimationFrame(()=>r(n))},i=n=>{if(e.isReady(n)){r();return}typeof MutationObserver>`u`||(tj(e.state),e.state.observer=new MutationObserver(()=>{t===e.state.token&&e.isReady(n)&&(tj(e.state),r())}),e.state.observer.observe(n,{childList:!0,subtree:!0}))},a=e.getRoot();if(!a){if(typeof MutationObserver>`u`)return;e.state.observer=new MutationObserver(()=>{if(t!==e.state.token)return;let n=e.getRoot();n&&i(n)}),e.state.observer.observe(e.container,{childList:!0,subtree:!0});return}i(a)}function sj(e){return e?e.start===e.end&&(e.endSide==null||e.endSide===e.side):!1}function cj(e){if(e instanceof Range)return e;let t=new Range;return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t}function lj(e,t){e&&t&&requestAnimationFrame(()=>{let n=e.getSelection?.()??window.getSelection();if(n)try{n.removeAllRanges(),n.addRange(t)}catch{}})}function uj(){let e=`none`,t,n=!1,r=!1,i=()=>{e=`none`,t=void 0,n=!1};return{begin(r,i){if(!r){e=`text`;return}e=`numbers`,t=i,n=!1},track(r,a){return e===`numbers`?r&1?(a!==void 0&&t!==void 0&&a!==t&&(n=!0),!0):(i(),!0):!1},finish(){let t=e;return r=t===`numbers`&&n,i(),t},consume(e){let t=r&&!sj(e);return r=!1,t},reset(){r=!1,i()}}}function dj(e){if(e)return e instanceof HTMLElement?e:e.parentElement??void 0}function fj(e){let t=dj(e);if(!t)return;let n=t.closest(`[data-line]`);if(!(n instanceof HTMLElement))return;let r=parseInt(n.dataset.line??``,10);if(!Number.isNaN(r))return r}function pj(e){let t=dj(e);if(!t)return;let n=t.closest(`[data-line], [data-alt-line]`);if(!(n instanceof HTMLElement))return;let r=parseInt(n.dataset.line??``,10);if(!Number.isNaN(r))return r;let i=parseInt(n.dataset.altLine??``,10);if(!Number.isNaN(i))return i}function mj(e){let t=dj(e);if(!t)return;let n=t.closest(`[data-code]`);if(n instanceof HTMLElement)return n.hasAttribute(`data-deletions`)?`deletions`:`additions`}function hj(e){let t=e.root.getSelection?.()??window.getSelection();if(!t||t.isCollapsed)return;let n=t.getComposedRanges?.({shadowRoots:[e.root]})?.[0]??(t.rangeCount>0?t.getRangeAt(0):void 0),r=n?.startContainer??t.anchorNode,i=n?.endContainer??t.focusNode;if(!r||!i||!e.root.contains(r)||!e.root.contains(i))return;let a=e.lineForNode(r),o=e.lineForNode(i);if(a===void 0||o===void 0)return;let s=e.sideForNode?.(r),c=e.sideForNode?.(i),l=s??c,u={start:a,end:o};return l&&(u.side=l),c&&l&&c!==l&&(u.endSide=c),{range:u,text:e.preserveTextSelection&&n?cj(n).cloneRange():void 0}}var gj=new WeakMap,_j={lineHeight:24,hunkSeparatorHeight:24,spacing:0};function vj(e){return e===`auto`||e===`scroll`||e===`overlay`}function yj(e){let t=e.parentElement;for(;t;){if(vj(getComputedStyle(t).overflowY))return t;t=t.parentElement}}function bj(e){if(typeof document>`u`)return;let t=e.closest(`[data-component='session-review']`);if(t instanceof HTMLElement){let n=yj(e)??t,r=t.querySelector(`[data-slot='session-review-container']`);return{key:t,root:n,content:r instanceof HTMLElement?r:void 0}}let n=yj(e);if(n){let e=n.querySelector(`[role='log']`);return{key:n,root:n,content:e instanceof HTMLElement?e:void 0}}return{key:document,root:document,content:void 0}}function xj(e){let t=bj(e);if(!t)return;let n=gj.get(t.key);if(!n){let e=new wA;e.setup(t.root,t.content),n={virtualizer:e,refs:0},gj.set(t.key,n)}n.refs+=1;let r=!1;return{virtualizer:n.virtualizer,release(){if(r)return;r=!0;let e=gj.get(t.key);e&&(--e.refs,!(e.refs>0)&&(e.virtualizer.cleanUp(),gj.delete(t.key)))}}}var Sj=l(o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):r((n||=self).lru_map=n.lru_map||{})})(e,function(e){let t=Symbol(`newer`),n=Symbol(`older`);class r{constructor(e,t){typeof e!=`number`&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[t]&&(e===this.oldest&&(this.oldest=e[t]),e[t][n]=e[n]),e[n]&&(e[n][t]=e[t]),e[t]=void 0,e[n]=this.newest,this.newest&&(this.newest[t]=e),this.newest=e)}assign(e){let r,a=this.limit||Number.MAX_VALUE;this._keymap.clear();let o=e[Symbol.iterator]();for(let e=o.next();!e.done;e=o.next()){let o=new i(e.value[0],e.value[1]);if(this._keymap.set(o.key,o),r?(r[t]=o,o[n]=r):this.oldest=o,r=o,a--==0)throw Error(`overflow`)}this.newest=r,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);return t?(this._markEntryAsUsed(t),t.value):void 0}set(e,r){var a=this._keymap.get(e);return a?(a.value=r,this._markEntryAsUsed(a),this):(this._keymap.set(e,a=new i(e,r)),this.newest?(this.newest[t]=a,a[n]=this.newest):this.oldest=a,this.newest=a,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var e=this.oldest;if(e)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),e[t]=e[n]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var r=this._keymap.get(e);return r?(this._keymap.delete(r.key),r[t]&&r[n]?(r[n][t]=r[t],r[t][n]=r[n]):r[t]?(r[t][n]=void 0,this.oldest=r[t]):r[n]?(r[n][t]=void 0,this.newest=r[n]):this.oldest=this.newest=void 0,this.size--,r.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new o(this.oldest)}values(){return new s(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(e,n){typeof n!=`object`&&(n=this);let r=this.oldest;for(;r;)e.call(n,r.value,r.key,this),r=r[t]}toJSON(){for(var e=Array(this.size),n=0,r=this.oldest;r;)e[n++]={key:r.key,value:r.value},r=r[t];return e}toString(){for(var e=``,n=this.oldest;n;)e+=String(n.key)+`:`+n.value,n=n[t],n&&(e+=` < `);return e}}e.LRUMap=r;function i(e,r){this.key=e,this.value=r,this[t]=void 0,this[n]=void 0}function a(e){this.entry=e}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}};function o(e){this.entry=e}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}};function s(e){this.entry=e}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}}})}))(),1),Cj=Symbol(`IGNORE_RESPONSE`),wj=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled because the pool terminated`)}},Tj=class{highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=um,useTokenTransformer:r=!1,lineDiffType:i=`word-alt`,maxLineDiffLength:a=1e3,tokenizeMaxLineLength:o=1e3,preferredHighlighter:s=`shiki-js`}){this.options=e,this.preferredHighlighter=s,this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:i,maxLineDiffLength:a,tokenizeMaxLineLength:o},this.fileCache=new Sj.default.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new Sj.default.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey==null?void 0:this.fileCache.get(e.cacheKey)}getDiffResultCache(e){return e.cacheKey==null?void 0:this.diffCache.get(e.cacheKey)}inspectCaches(){let{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??um,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??`word-alt`,maxLineDiffLength:r=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:i=this.renderOptions.tokenizeMaxLineLength??1e3}){let{lifecycleGeneration:a}=this,o=++this.renderOptionsRequestVersion,s=()=>this.isCurrentLifecycle(a)&&this.renderOptionsRequestVersion===o;try{let a={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:r,tokenizeMaxLineLength:i};if(this.isInitialized()||await this.initialize(),!s()||ik(a,this.renderOptions))return;let o=tE(e),c=[];if(Tm(a.theme,this.renderOptions.theme)||(c=rE(o)?kA(o):await jA(o)),!s())return;if(this.highlighter!=null)TT(c,this.highlighter);else{let e=await QT({themes:o,langs:[`text`],preferredHighlighter:this.preferredHighlighter});if(!s())return;this.highlighter=e}let l=this.setRenderOptionsOnWorkers(a,c);this.renderOptions=a,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(let e of this.themeSubscribers)e.onThemeChange();await l}catch(e){if(e instanceof wj||!s())return;throw e}}getFileRenderOptions(){let{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();let n=[];for(let r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),Error(`setRenderOptionsOnWorkers: Somehow we have an uninitialized worker`);n.push(new Promise((n,i)=>{let a=this.generateRequestId(),o={type:`set-render-options`,id:a,request:{type:`set-render-options`,id:a,renderOptions:e,resolvedThemes:t},resolve:n,reject:i,requestStart:Date.now()};this.activeTaskById.set(a,o),r.pendingSetupRequestId=a,r.worker.postMessage(o.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast??=requestAnimationFrame(this._broadcastStateChanges)}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);let e=this.getStats();for(let t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);let t=this.activeRequestByInstance.get(e);if(t!=null){let n=this.activeTaskById.get(t);Oj(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0){if(this.initialized===!1){let{lifecycleGeneration:t}=this;this.initialized=new Promise((n,r)=>{(async()=>{try{let r=tE(this.renderOptions.theme),i=[];if(i=rE(r)?kA(r):await jA(r),!this.isCurrentLifecycle(t)){n();return}let a=[];if(a=DA(e)?EA(e):await OA(e),!this.isCurrentLifecycle(t)){n();return}let[o]=await Promise.all([QT({themes:r,langs:[`text`,...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(i,a)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(e){if(e instanceof wj||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),r(e)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}}async initializeWorkers(e,t){this.workersFailed=!1;let n=[],r=vE(),i=r>0?yE():void 0;this.workers.length>0&&this.terminateWorkers();for(let a=0;a<(this.options.poolSize??8);a++){let a=this.options.workerFactory(),o={worker:a,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set([`text`,...t.map(({name:e})=>e)]),customExtensionsVersion:0};a.addEventListener(`message`,e=>{this.handleWorkerMessage(o,e.data)}),a.addEventListener(`error`,e=>console.error(`Worker error:`,e,o)),this.workers.push(o),n.push(new Promise((n,a)=>{let s=this.generateRequestId(),c={type:`initialize`,id:s,request:{type:`initialize`,id:s,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:i==null?void 0:r,customExtensionMap:i},resolve(){o.initialized=!0,n()},reject:a,requestStart:Date.now()};this.activeTaskById.set(s,c),this.executeTask(o,c)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,this.initialized===!0&&this.queuedTasks.length!==0){for(let e=0;e<this.queuedTasks.length;){let t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}let n=Dj(t),r=this.getAvailableWorker(n);if(r==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){let n=this.getFileResultCache(t);rD(t)||n!=null&&iE(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:`file`,file:t})}primeFileHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}let t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||rD(e)||t!=null&&iE(t.options,this.getFileRenderOptions()))return;let r=this.getTaskByHighlightKey(n);r==null?this.submitCacheTask({type:`file`,file:e},n):r.primeCache=!0}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.queueInitialization();return}return eD(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){let n=this.getDiffResultCache(t);Fk(t)||n!=null&&ik(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:`diff`,diff:t})}primeDiffHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}let t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||Fk(e)||t!=null&&ik(t.options,this.getDiffRenderOptions()))return;let r=this.getTaskByHighlightKey(n);r==null?this.submitCacheTask({type:`diff`,diff:e},n):r.primeCache=!0}getPlainDiffAST(e,t,n,r,i){return this.highlighter==null?void 0:jk(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i})}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(e=>{console.error(e)})}cancelActiveWorkerTasks(){let e=new wj;for(let t of this.activeTaskById.values())`reject`in t&&t.reject(e)}terminateWorkers(){for(let e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?`waiting`:this.initialized===!0?`initialized`:`initializing`,totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.getHighlightKeyForRequest(t),r=n==null?void 0:this.getTaskByHighlightKey(n);if(r!=null){this.detachInstanceFromQueuedTasks(e,r),this.addInstanceToTask(r,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);let i=this.generateRequestId(),a=Date.now(),{renderOptionsVersion:o}=this,s=(()=>{switch(t.type){case`file`:return{type:`file`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:o,requestStart:a};case`diff`:return{type:`diff`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:o,requestStart:a}}})();this.enqueueRenderTask(s,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();let n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:i}=this,a=(()=>{switch(e.type){case`file`:return{type:`file`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:i,requestStart:r};case`diff`:return{type:`diff`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:i,requestStart:r}}})();this.enqueueRenderTask(a)}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{let r=n.filter(t=>!e.langs.has(t));if(r.length>0&&(DA(r)?t.request.resolvedLanguages=EA(r):t.request.resolvedLanguages=await OA(r)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch{this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){let n=this.activeTaskById.get(t.id);try{if(n==null)throw Cj;if(t.type===`error`){let e=Error(t.error);if(t.stack&&(e.stack=t.stack),`reject`in n)n.reject(e);else if(Oj(n))this.notifyHighlightError(n,e);else throw Error(`handleWorkerMessage: unknown task type`);throw e}switch(t.requestType){case`initialize`:if(n.type!==`initialize`)throw Error(`handleWorkerMessage: task/response dont match`);this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case`set-render-options`:if(n.type!==`set-render-options`)throw Error(`handleWorkerMessage: task/response dont match`);n.resolve();break;case`file`:{if(n.type!==`file`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!iE(i,this.getFileRenderOptions()))throw Cj;let{request:a}=n;this.syncCustomExtensionVersion(e,a),a.file.cacheKey!=null&&this.fileCache.set(a.file.cacheKey,{result:r,options:i}),this.notifyFileInstances(n,r,i);break}case`diff`:{if(n.type!==`diff`)throw Error(`handleWorkerMessage: task/response dont match`);let{result:r,options:i}=t;if(!this.isCurrentRenderTask(n)||!ik(i,this.getDiffRenderOptions()))throw Cj;let{request:a}=n;this.syncCustomExtensionVersion(e,a),a.diff.cacheKey!=null&&this.diffCache.set(a.diff.cacheKey,{result:r,options:i}),this.notifyDiffInstances(n,r,i);break}}}catch(e){e!==Cj&&console.error(e,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain??(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,Oj(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(Oj(t)&&(this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){Ej(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(let n of Dj(t))e.langs.add(n);try{e.worker.postMessage(t.request)}catch(n){console.error(`Failed to post message to worker:`,n),Oj(t)?this.notifyHighlightError(t,n):`reject`in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;let n=vE();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=yE())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(let n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(let t of e)if(!n.langs.has(t)){r=!1;break}if(r)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case`file`:return this.getFileHighlightKey(e.file);case`diff`:return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(let t of kj(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){let n=this.queuedTaskByInstance.get(e);n!=null&&n!==t&&(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){let t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){let t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(let e of Array.from(this.activeTaskById.values()))Oj(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(let t of kj(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(let t of kj(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(let t of kj(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(let n of kj(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`file`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&aE(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`diff`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&JD(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){let t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(let e of this.queuedTasks)yield e;for(let e of this.activeTaskById.values())Oj(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function Ej(e){return e.type===`initialize`||e.type===`file`||e.type===`diff`}function Dj(e){let t=new Set;if(e.type===`initialize`||e.type===`set-render-options`)return[];switch(e.type){case`file`:t.add(e.request.file.lang??_E(e.request.file.name));break;case`diff`:t.add(e.request.diff.lang??_E(e.request.diff.name)),t.add(e.request.diff.lang??_E(e.request.diff.prevName??`-`))}return t.delete(`text`),Array.from(t)}function Oj(e){return e?.type===`file`||e?.type===`diff`}function kj(e){return e.instances}var Aj=`/assets/worker-DDDBDFQT.js`,jj={name:`OpenCode`,bg:`var(--color-background-stronger)`,fg:`var(--text-base)`,colors:{"editor.background":`var(--color-background-stronger)`,"editor.foreground":`var(--text-base)`,"gitDecoration.addedResourceForeground":`var(--syntax-diff-add)`,"gitDecoration.deletedResourceForeground":`var(--syntax-diff-delete)`,"gitDecoration.modifiedResourceForeground":`var(--syntax-diff-unknown)`},tokenColors:[{scope:[`comment`,`punctuation.definition.comment`,`string.comment`],settings:{foreground:`var(--syntax-comment)`}},{scope:[`entity.other.attribute-name`],settings:{foreground:`var(--syntax-property)`}},{scope:[`constant`,`entity.name.constant`,`variable.other.constant`,`variable.language`,`entity`],settings:{foreground:`var(--syntax-constant)`}},{scope:[`entity.name`,`meta.export.default`,`meta.definition.variable`],settings:{foreground:`var(--syntax-type)`}},{scope:[`meta.object.member`],settings:{foreground:`var(--syntax-primitive)`}},{scope:[`variable.parameter.function`,`meta.jsx.children`,`meta.block`,`meta.tag.attributes`,`entity.name.constant`,`meta.embedded.expression`,`meta.template.expression`,`string.other.begin.yaml`,`string.other.end.yaml`],settings:{foreground:`var(--syntax-punctuation)`}},{scope:[`entity.name.function`,`support.type.primitive`],settings:{foreground:`var(--syntax-primitive)`}},{scope:[`support.class.component`],settings:{foreground:`var(--syntax-type)`}},{scope:`keyword`,settings:{foreground:`var(--syntax-keyword)`}},{scope:[`keyword.operator`,`storage.type.function.arrow`,`punctuation.separator.key-value.css`,`entity.name.tag.yaml`,`punctuation.separator.key-value.mapping.yaml`],settings:{foreground:`var(--syntax-operator)`}},{scope:[`storage`,`storage.type`],settings:{foreground:`var(--syntax-keyword)`}},{scope:[`storage.modifier.package`,`storage.modifier.import`,`storage.type.java`],settings:{foreground:`var(--syntax-primitive)`}},{scope:[`string`,`punctuation.definition.string`,`string punctuation.section.embedded source`,`entity.name.tag`],settings:{foreground:`var(--syntax-string)`}},{scope:`support`,settings:{foreground:`var(--syntax-primitive)`}},{scope:[`support.type.object.module`,`variable.other.object`,`support.type.property-name.css`],settings:{foreground:`var(--syntax-object)`}},{scope:`meta.property-name`,settings:{foreground:`var(--syntax-property)`}},{scope:`variable`,settings:{foreground:`var(--syntax-variable)`}},{scope:`variable.other`,settings:{foreground:`var(--syntax-variable)`}},{scope:[`invalid.broken`,`invalid.illegal`,`invalid.unimplemented`,`invalid.deprecated`,`message.error`,`markup.deleted`,`meta.diff.header.from-file`,`punctuation.definition.deleted`,`brackethighlighter.unmatched`,`token.error-token`],settings:{foreground:`var(--syntax-critical)`}},{scope:`carriage-return`,settings:{foreground:`var(--syntax-keyword)`}},{scope:`string source`,settings:{foreground:`var(--syntax-variable)`}},{scope:`string variable`,settings:{foreground:`var(--syntax-constant)`}},{scope:[`source.regexp`,`string.regexp`,`string.regexp.character-class`,`string.regexp constant.character.escape`,`string.regexp source.ruby.embedded`,`string.regexp string.regexp.arbitrary-repitition`,`string.regexp constant.character.escape`],settings:{foreground:`var(--syntax-regexp)`}},{scope:`support.constant`,settings:{foreground:`var(--syntax-primitive)`}},{scope:`support.variable`,settings:{foreground:`var(--syntax-variable)`}},{scope:`meta.module-reference`,settings:{foreground:`var(--syntax-info)`}},{scope:`punctuation.definition.list.begin.markdown`,settings:{foreground:`var(--syntax-punctuation)`}},{scope:[`markup.heading`,`markup.heading entity.name`],settings:{fontStyle:`bold`,foreground:`var(--syntax-info)`}},{scope:`markup.quote`,settings:{foreground:`var(--syntax-info)`}},{scope:`markup.italic`,settings:{fontStyle:`italic`}},{scope:`markup.bold`,settings:{fontStyle:`bold`,foreground:`var(--text-strong)`}},{scope:[`markup.raw`,`markup.inserted`,`meta.diff.header.to-file`,`punctuation.definition.inserted`,`markup.changed`,`punctuation.definition.changed`,`markup.ignored`,`markup.untracked`],settings:{foreground:`var(--text-base)`}},{scope:`meta.diff.range`,settings:{fontStyle:`bold`,foreground:`var(--syntax-unknown)`}},{scope:`meta.diff.header`,settings:{foreground:`var(--syntax-unknown)`}},{scope:`meta.separator`,settings:{fontStyle:`bold`,foreground:`var(--syntax-unknown)`}},{scope:`meta.output`,settings:{foreground:`var(--syntax-unknown)`}},{scope:`meta.export.default`,settings:{foreground:`var(--syntax-unknown)`}},{scope:[`brackethighlighter.tag`,`brackethighlighter.curly`,`brackethighlighter.round`,`brackethighlighter.square`,`brackethighlighter.angle`,`brackethighlighter.quote`],settings:{foreground:`var(--syntax-unknown)`}},{scope:[`constant.other.reference.link`,`string.other.link`],settings:{fontStyle:`underline`,foreground:`var(--syntax-unknown)`}},{scope:`token.info-token`,settings:{foreground:`var(--syntax-info)`}},{scope:`token.warn-token`,settings:{foreground:`var(--syntax-warning)`}},{scope:`token.debug-token`,settings:{foreground:`var(--syntax-info)`}}],semanticTokenColors:{comment:`var(--syntax-comment)`,string:`var(--syntax-string)`,number:`var(--syntax-constant)`,regexp:`var(--syntax-regexp)`,keyword:`var(--syntax-keyword)`,variable:`var(--syntax-variable)`,parameter:`var(--syntax-variable)`,property:`var(--syntax-property)`,function:`var(--syntax-primitive)`,method:`var(--syntax-primitive)`,type:`var(--syntax-type)`,class:`var(--syntax-type)`,namespace:`var(--syntax-type)`,enumMember:`var(--syntax-primitive)`,"variable.constant":`var(--syntax-constant)`,"variable.defaultLibrary":`var(--syntax-unknown)`}},Mj=!1;function Nj(){Mj||(Mj=!0,AA(`OpenCode`,()=>Promise.resolve(jj)))}Nj();function Pj(){return new Worker(Aj,{type:`module`})}function Fj(e){let t=new Tj({workerFactory:Pj,poolSize:2},{theme:`OpenCode`,lineDiffType:e,...e===`none`&&{maxLineDiffLength:0,tokenizeMaxLineLength:1},preferredHighlighter:`shiki-wasm`});return t.initialize(),t}var Ij,Lj;function Rj(e=`word-alt`){if(!(typeof window>`u`))return e===`none`?(Ij||=Fj(`none`),Ij):(Lj||=Fj(`word-alt`),Lj)}var zj=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`avif`,`bmp`,`ico`,`tif`,`tiff`,`heic`]),Bj=new Set([`mp3`,`wav`,`ogg`,`m4a`,`aac`,`flac`,`opus`]);function Vj(e){if(e&&typeof e==`object`)return e}function Hj(e){if(!e)return;let t=e.split(`;`,1)[0]?.trim().toLowerCase();if(t)return t===`audio/x-aac`?`audio/aac`:t===`audio/x-m4a`?`audio/mp4`:t}function Uj(e){if(!e)return``;let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()}function Wj(e){let t=Uj(e);if(t===`svg`)return`svg`;if(zj.has(t))return`image`;if(Bj.has(t))return`audio`}function Gj(e){return Vj(e)?.type===`binary`}function Kj(e,t){if(t===`svg`)return e.startsWith(`data:image/svg+xml`)?e:void 0;if(t===`image`)return e.startsWith(`data:image/`)?e:void 0;if(e.startsWith(`data:audio/x-aac;`))return e.replace(`data:audio/x-aac;`,`data:audio/aac;`);if(e.startsWith(`data:audio/x-m4a;`))return e.replace(`data:audio/x-m4a;`,`data:audio/mp4;`);if(e.startsWith(`data:audio/`))return e}function qj(e,t){if(!e)return;if(typeof e==`string`)return Kj(e,t);let n=Vj(e);if(!n||typeof n.content!=`string`)return;let r=Hj(typeof n.mimeType==`string`?n.mimeType:void 0);if(r){if(t===`svg`)return r===`image/svg+xml`?n.encoding===`base64`?`data:image/svg+xml;base64,${n.content}`:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n.content)}`:void 0;if((t!==`image`||r.startsWith(`image/`))&&(t!==`audio`||r.startsWith(`audio/`))&&n.encoding===`base64`)return`data:${r};base64,${n.content}`}}function Jj(e){if(typeof atob==`function`)try{let t=atob(e),n=Uint8Array.from(t,e=>e.charCodeAt(0));return typeof TextDecoder==`function`?new TextDecoder().decode(n):t}catch{}}function Yj(e){let t=Vj(e);if(t&&typeof t.content==`string`&&Hj(typeof t.mimeType==`string`?t.mimeType:void 0)===`image/svg+xml`)return t.encoding===`base64`?Jj(t.content):t.content}function Xj(e){if(typeof e==`string`)return e.length>0;let t=Vj(e);return t?typeof t.content==`string`&&t.content.length>0:!1}var Zj=W(`<div class="flex min-h-56 flex-col items-center justify-center gap-2 px-6 py-10 text-center"><div class="text-14-semibold text-text-strong"></div><div class="text-14-regular text-text-weak">`),Qj=W(`<div class="flex min-h-40 items-center justify-center px-6 py-4 text-center text-text-weak">`),$j=W(`<div class="flex justify-center bg-background-stronger px-6 py-4"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">`),eM=W(`<div class="flex justify-center bg-background-stronger px-6 py-4"><audio class="w-full max-w-xl"controls preload=metadata><source>`),tM=W(`<div class="flex flex-col gap-4 px-6 py-4">`),nM=W(`<div class="flex justify-center"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">`);function rM(e,t){return e.current===void 0?e.after??e.before:e.current}function iM(e){let t=Ml(),[n,r]=$t({}),i=()=>e.media,a=N(()=>{let e=i();if(e&&e.mode!==`off`)return Wj(e.path)}),o=N(()=>{let e=i();return!e||e.mode===`off`||a()?!1:Gj(e.current)}),s=()=>e.media?.onLoad?.(),c=N(()=>{let e=i(),t=a();return!e||!t?!1:e.deleted?!0:t===`svg`||e.current!==void 0?!1:!Xj(e.after)&&Xj(e.before)}),l=N(()=>{let e=i(),t=a();if(!(!e||t!==`image`&&t!==`audio`))return qj(rM(e,t),t)}),u=N(()=>{let e=i(),t=a();if(!(!e||t!==`image`&&t!==`audio`)&&e.current===void 0&&!c()&&!l()&&e.path&&e.readFile)return{key:`${t}:${e.path}`,kind:t,path:e.path,readFile:e.readFile,onError:e.onError}});M(()=>{let e=u();if(!e){r({key:void 0,loading:!1,error:!1,src:void 0,mime:void 0});return}let t=!0;ae(()=>n.key)===e.key?r({loading:!0,error:!1}):r({key:e.key,loading:!0,error:!1,src:void 0,mime:void 0}),e.readFile(e.path).then(n=>{if(!t)return;let i=qj(n,e.kind);if(!i){e.onError?.({kind:e.kind}),r({key:e.key,loading:!1,error:!0,src:void 0,mime:void 0});return}r({key:e.key,loading:!1,error:!1,src:i,mime:e.kind===`audio`?Hj(n?.mimeType):void 0})},()=>{t&&(e.onError?.({kind:e.kind}),r({key:e.key,loading:!1,error:!0,src:void 0,mime:void 0}))}),P(()=>{t=!1})});let d=N(()=>{let e=u();return!e||n.key!==e.key||n.error?l():l()??n.src}),f=N(()=>{if(l())return`ready`;let e=u();return e?n.key!==e.key||n.loading?`loading`:n.error?`error`:d()?`ready`:`idle`:`idle`}),p=N(()=>{let e=u();if(e&&n.key===e.key)return n.mime}),m=N(()=>{let e=i();if(e&&a()===`svg`)return Yj(e.current)}),h=N(()=>{let e=i();if(e&&a()===`svg`)return qj(e.current,`svg`)});M(oe(N(()=>{let e=i();if(e&&a()===`svg`&&m()===void 0&&Xj(e.current))return[e.path,e.current]}),e=>{e&&i()?.onError?.({kind:`svg`})},{defer:!0}));let g=e=>t.t(e===`image`?`ui.fileMedia.kind.image`:`ui.fileMedia.kind.audio`);return R(qe,{get children(){return[R(Je,{get when(){return a()===`image`||a()===`audio`},get children(){return R(H,{get when(){return d()},get fallback(){let n=i(),r=a();if(!n||r!==`image`&&r!==`audio`)return e.fallback();let o=g(r);return c()?(()=>{var e=Qj();return K(e,()=>t.t(`ui.fileMedia.state.removed`,{kind:o})),e})():f()===`loading`?(()=>{var e=Qj();return K(e,()=>t.t(`ui.fileMedia.state.loading`,{kind:o})),e})():f()===`error`?(()=>{var e=Qj();return K(e,()=>t.t(`ui.fileMedia.state.error`,{kind:o})),e})():(()=>{var e=Qj();return K(e,()=>t.t(`ui.fileMedia.state.unavailable`,{kind:o})),e})()},children:t=>{let n=a();return n!==`image`&&n!==`audio`?e.fallback():n===`image`?(()=>{var e=$j(),n=e.firstChild;return n.addEventListener(`load`,s),j(e=>{var r=t(),a=i()?.path;return r!==e.e&&G(n,`src`,e.e=r),a!==e.t&&G(n,`alt`,e.t=a),e},{e:void 0,t:void 0}),e})():(()=>{var e=eM(),n=e.firstChild,r=n.firstChild;return n.addEventListener(`loadedmetadata`,s),j(e=>{var n=t(),i=p();return n!==e.e&&G(r,`src`,e.e=n),i!==e.t&&G(r,`type`,e.t=i),e},{e:void 0,t:void 0}),e})()}})}}),R(Je,{get when(){return a()===`svg`},get children(){return m()===void 0&&h()==null?e.fallback():(()=>{var t=tM();return K(t,R(H,{get when(){return m()!==void 0},get children(){return e.fallback()}}),null),K(t,R(H,{get when(){return h()},children:e=>(()=>{var t=nM(),n=t.firstChild;return n.addEventListener(`load`,s),j(t=>{var r=e(),a=i()?.path;return r!==t.e&&G(n,`src`,t.e=r),a!==t.t&&G(n,`alt`,t.t=a),t},{e:void 0,t:void 0}),t})()}),null),t})()}}),R(Je,{get when(){return o()},get children(){var e=Zj(),n=e.firstChild,r=n.nextSibling;return K(n,()=>i()?.path?.split(`/`).pop()??t.t(`ui.fileMedia.binary.title`)),K(r,()=>{let e=i()?.path;return e?t.t(`ui.fileMedia.binary.description.path`,{path:e}):t.t(`ui.fileMedia.binary.description.default`)}),e}}),R(Je,{when:!0,get children(){return e.fallback()}})]}})}var aM=W(`<div class="fixed z-50 flex h-8 items-center gap-2 rounded-md border border-border-base bg-background-base px-3 shadow-md"><input class="w-40 bg-transparent outline-none text-14-regular text-text-strong placeholder:text-text-weak"><div class="shrink-0 text-12-regular text-text-weak tabular-nums text-right"style=width:10ch></div><div class="flex items-center"><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong disabled:opacity-40 disabled:pointer-events-none"></button><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong disabled:opacity-40 disabled:pointer-events-none"></button></div><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong">`);function oM(e){let t=Ml();return R(Mt,{get children(){var n=aM(),r=n.firstChild,i=r.nextSibling,a=i.nextSibling,o=a.firstChild,s=o.nextSibling,c=a.nextSibling;n.$$pointerdown=e=>e.stopPropagation(),K(n,R(Fo,{name:`magnifying-glass`,size:`small`,class:`text-text-weak shrink-0`}),r),r.$$keydown=t=>e.onKeyDown(t),r.$$input=t=>e.onInput(t.currentTarget.value);var l=e.setInput;return typeof l==`function`?_t(l,r):e.setInput=r,K(i,(()=>{var t=U(()=>!!e.count);return()=>t()?`${e.index+1}/${e.count}`:`0/0`})()),ft(o,`click`,e.onPrev,!0),K(o,R(Fo,{name:`chevron-down`,size:`small`,class:`rotate-180`})),ft(s,`click`,e.onNext,!0),K(s,R(Fo,{name:`chevron-down`,size:`small`})),ft(c,`click`,e.onClose,!0),K(c,R(Fo,{name:`close-small`,size:`small`})),j(i=>{var a=`${e.pos.top}px`,l=`${e.pos.right}px`,u=t.t(`ui.fileSearch.placeholder`),d=e.count===0,f=t.t(`ui.fileSearch.previousMatch`),p=e.count===0,m=t.t(`ui.fileSearch.nextMatch`),h=t.t(`ui.fileSearch.close`);return a!==i.e&&ht(n,`top`,i.e=a),l!==i.t&&ht(n,`right`,i.t=l),u!==i.a&&G(r,`placeholder`,i.a=u),d!==i.o&&(o.disabled=i.o=d),f!==i.i&&G(o,`aria-label`,i.i=f),p!==i.n&&(s.disabled=i.n=p),m!==i.s&&G(s,`aria-label`,i.s=m),h!==i.h&&G(c,`aria-label`,i.h=h),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),j(()=>r.value=e.query),n}})}ct([`pointerdown`,`input`,`keydown`,`click`]);var sM=W(`<div data-component=file dir=ltr class="relative select-text outline-none"tabindex=0><div></div><div class="pointer-events-none absolute inset-0 z-0">`),cM=5e5,lM={...gm,lineHeight:24,spacing:0},uM=[`mode`,`media`,`class`,`classList`,`annotations`,`selectedLines`,`commentedLines`,`search`,`onLineSelected`,`onLineSelectionEnd`,`onLineNumberSelectionEnd`,`onRendered`,`preloadedDiff`],dM=[`file`,...uM],fM=[`fileDiff`,`before`,`after`,`virtualize`,...uM];function pM(e){let t,n,r,i,a,o,s,c=!1,l=null,u=!1,d=ej(),f=uj(),[p,m]=A(0),h=()=>rj(n),g=()=>nj(n),_=$A({wrapper:()=>t,overlay:()=>r,getRoot:h}),v=()=>{i===void 0&&(i=requestAnimationFrame(()=>{i=void 0;let t=u;e.updateSelection(t),u&&(u=!1,e.onLineSelectionEnd(l))}))},y=()=>{a===void 0&&(a=requestAnimationFrame(()=>{a=void 0;let t=e.buildDragSelection();t&&e.setSelectedLines(t)}))},b=t=>{if(!e.enableLineSelection()||t.button!==0)return;let n=e.lineFromMouseEvent(t);if(n.numberColumn){f.begin(!0,n.line);return}n.line!==void 0&&(f.begin(!1,n.line),o=n.line,s=n.line,c=!1,e.onDragStart(n))},x=t=>{if(!e.enableLineSelection())return;let n=e.lineFromMouseEvent(t);if(!f.track(t.buttons,n.line)&&o!==void 0){if(!(t.buttons&1)){o=void 0,s=void 0,c=!1,e.onDragReset(),f.finish();return}n.line!==void 0&&(s=n.line,c=!0,e.onDragMove(n),y())}},S=()=>{if(e.enableLineSelection()&&f.finish()!==`numbers`&&o!==void 0){if(!c){u=!1;let t=e.buildClickSelection(),n=t&&l?.start===t.start&&l.end===t.end&&l.side===t.side&&(l.endSide??l.side)===(t.endSide??t.side)?null:t;n!==void 0&&e.setSelectedLines(n),e.onLineSelectionEnd(n===void 0?l:n),o=void 0,s=void 0,c=!1,e.onDragReset();return}u=!0,y(),v(),o=void 0,s=void 0,c=!1,e.onDragReset()}},C=()=>{if(!e.enableLineSelection()||o===void 0)return;let t=window.getSelection();t&&!t.isCollapsed&&v()};return se(()=>{P(aj(g))}),M(()=>{p();let t=e.commentedLines(),n=h();if(!n)return;if(t.length===0){e.markCommented(n,t);return}let r,i=()=>{r!==void 0&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{r=void 0,e.markCommented(n,t)})},a=new MutationObserver(i);a.observe(n,{childList:!0,subtree:!0}),i(),P(()=>{a.disconnect(),r!==void 0&&cancelAnimationFrame(r)})}),M(()=>{e.setSelectedLines(e.selectedLines()??null)}),M(()=>{e.enableLineSelection()&&(pn(n,`mousedown`,b),pn(n,`mousemove`,x),pn(window,`mouseup`,S),pn(document,`selectionchange`,C))}),P(()=>{tj(d),i!==void 0&&cancelAnimationFrame(i),a!==void 0&&cancelAnimationFrame(a),i=void 0,a=void 0,o=void 0,s=void 0,c=!1,f.reset(),l=null,u=!1}),{get wrapper(){return t},set wrapper(e){t=e},get container(){return n},set container(e){n=e},get overlay(){return r},set overlay(e){r=e},get dragStart(){return o},get dragEnd(){return s},get lastSelection(){return l},set lastSelection(e){l=e},ready:d,bridge:f,rendered:p,setRendered:m,getRoot:h,getHost:g,find:_,scheduleSelectionUpdate:v}}function mM(e,t){return pM({enableLineSelection:e.enableLineSelection,selectedLines:e.selectedLines,commentedLines:()=>e.commentedLines()??[],onLineSelectionEnd:e.onLineSelectionEnd,...t})}function hM(e){M(()=>{let t=e.search();t&&(t.register({focus:()=>e.find.focus()}),P(()=>t.register(null)))})}function gM(e){let t=t=>{if(!e.normalize)return t;let n=e.normalize(t);return n===void 0?t:n};return{onLineSelected:n=>{let r=t(n);e.viewer.lastSelection=r,e.onLineSelected?.(r)},onLineSelectionEnd:n=>{let r=t(n);e.viewer.lastSelection=r,e.onLineSelectionEnd?.(r),e.viewer.bridge.consume(r)&&requestAnimationFrame(()=>e.onLineNumberSelectionEnd?.(r))}}}function _M(e){let t=new WeakSet;M(()=>{e.viewer.rendered();let n=e.current();if(!n)return;let r=e.annotations();(r.length!==0||t.has(n))&&(r.length===0?t.delete(n):t.add(n),n.setLineAnnotations(r),n.rerender(),requestAnimationFrame(()=>e.viewer.find.refresh({reset:!0})))})}function vM(e){oj({state:e.viewer.ready,container:e.viewer.container,getRoot:e.viewer.getRoot,isReady:e.isReady,settleFrames:e.settleFrames,onReady:e.onReady})}function yM(e){tj(e.viewer.ready);let t=e.reset===!0&&e.current!==void 0;t&&e.current?.cleanUp();let n=t||!e.current?e.create():e.current;t||!e.current?(e.viewer.container.innerHTML=``,e.assign(n)):e.update?.(n),e.draw(n),ij(e.viewer.getHost()),e.viewer.setRendered(e=>e+1),e.onReady()}function bM(e){let t=xM(e.wrapper);if(!t)return()=>{};let n=e.container.getBoundingClientRect().height;if(!n)return()=>{};let r=e.wrapper.getBoundingClientRect().top-t.getBoundingClientRect().top,i=e.container.style.minHeight;e.container.style.minHeight=`${Math.ceil(n)}px`;let a=!1;return()=>{if(a)return;a=!0,e.container.style.minHeight=i;let n=e.wrapper.getBoundingClientRect().top-t.getBoundingClientRect().top-r;n&&(t.scrollTop+=n)}}function xM(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);if(e.overflowY===`auto`||e.overflowY===`scroll`)return t;t=t.parentElement}}function SM(e,t){let n,r,i=()=>{n?.cleanUp(),n=void 0,r=void 0};return{get:()=>{if(!t()){i();return}if(typeof document>`u`)return;let a=e();if(!a)return;let o=xM(a)??document;return n&&r===o?n:(i(),n=new wA,r=o,n.setup(o,o instanceof Document?void 0:a),n)},cleanup:i}}function CM(e,t){let n,r=()=>{n?.release(),n=void 0};return{get:()=>{if(!t()){r();return}if(n)return n.virtualizer;let i=e();if(!i)return;let a=xj(i);if(a)return n=a,a.virtualizer},cleanup:r}}function wM(e){if(!e.dataset.line)return;let t=parseInt(e.dataset.line,10);if(!Number.isNaN(t))return t}function TM(e,t,n){let r=e.composedPath(),i=!1,a,o;for(let e of r)if(e instanceof HTMLElement&&(i||=e.dataset.columnNumber!=null,a===void 0&&(a=t(e)),o===void 0&&n&&(o=n(e)),i&&a!==void 0&&(n==null||o!==void 0)))break;return{line:a,numberColumn:i,side:o}}function EM(e){let t=e.dataset.lineType;if(t===`change-deletion`)return`deletions`;if(t===`change-addition`||t===`change-additions`)return`additions`;if(e.dataset.code!=null)return e.hasAttribute(`data-deletions`)?`deletions`:`additions`}function DM(e){let t=dj(e);if(t)return FA(t)}function OM(e){return(()=>{var t=sM(),n=t.firstChild,r=n.nextSibling;return ft(t,`focus`,e.viewer.find.onFocus),ft(t,`pointerdown`,e.viewer.find.onPointerDown,!0),_t(t=>e.viewer.wrapper=t,t),K(t,R(H,{get when(){return e.viewer.find.open()},get children(){return R(oM,{get pos(){return e.viewer.find.pos()},get query(){return e.viewer.find.query()},get count(){return e.viewer.find.count()},get index(){return e.viewer.find.index()},get setInput(){return e.viewer.find.setInput},get onInput(){return e.viewer.find.setQuery},get onKeyDown(){return e.viewer.find.onInputKeyDown},get onClose(){return e.viewer.find.close},onPrev:()=>e.viewer.find.next(-1),onNext:()=>e.viewer.find.next(1)})}}),n),_t(t=>e.viewer.container=t,n),_t(t=>e.viewer.overlay=t,r),j(n=>{var r=e.mode,i=PA,a={...e.classList,[e.class??``]:!!e.class};return r!==n.e&&G(t,`data-mode`,n.e=r),n.t=mt(t,i,n.t),n.a=pt(t,a,n.a),n},{e:void 0,t:void 0,a:void 0}),t})()}function kM(e){let t,n,[r,i]=B(e,dM),a=()=>{let e=r.file.contents;return typeof e==`string`?e:Array.isArray(e)?e.join(`
|
|
708
|
+
`):e==null?``:String(e)},o=()=>{let e=a(),t=e.split(`
|
|
709
|
+
`).length-+!!e.endsWith(`
|
|
710
|
+
`);return Math.max(1,t)},s=N(()=>{let e=r.file.contents;return typeof e==`string`?e.length:Array.isArray(e)?e.reduce((e,t)=>e+(typeof t==`string`?t.length+1:String(t).length+1),0):e==null?0:String(e).length}),c=N(()=>s()>cM),l=SM(()=>n.wrapper,c),u=e=>TM(e,wM),d=e=>{let r=t;if(!r)return!1;if(c())return r.setSelectedLines(e),!0;let i=n.getRoot();if(!i)return!1;let a=o();if(i.querySelectorAll(`[data-line]`).length<a)return!1;if(!e)return r.setSelectedLines(null),!0;let s=Math.min(e.start,e.end),l=Math.max(e.start,e.end);if(s<1||l>a||!i.querySelector(`[data-line="${s}"]`)||!i.querySelector(`[data-line="${l}"]`))return r.setSelectedLines(null),!0;let u=e.endSide==null&&(e.side!==`deletions`||i.querySelector(`[data-deletions]`)!=null)?e:{start:e.start,end:e.end};return r.setSelectedLines(u),!0},f=e=>{n.lastSelection=e,d(e)};n=mM({enableLineSelection:()=>e.enableLineSelection===!0,selectedLines:()=>r.selectedLines,commentedLines:()=>r.commentedLines,onLineSelectionEnd:e=>r.onLineSelectionEnd?.(e)},{lineFromMouseEvent:u,setSelectedLines:f,updateSelection:e=>{let t=n.getRoot();if(!t)return;let r=hj({root:t,lineForNode:fj,sideForNode:mj,preserveTextSelection:e});r&&(f(r.range),e&&r.text&&lj(t,r.text))},buildDragSelection:()=>{if(n.dragStart!==void 0&&n.dragEnd!==void 0)return{start:Math.min(n.dragStart,n.dragEnd),end:Math.max(n.dragStart,n.dragEnd)}},buildClickSelection:()=>{if(n.dragStart!==void 0)return{start:n.dragStart,end:n.dragStart}},onDragStart:()=>{},onDragMove:()=>{},onDragReset:()=>{},markCommented:HA});let p=gM({viewer:n,onLineSelected:e=>r.onLineSelected?.(e),onLineSelectionEnd:e=>r.onLineSelectionEnd?.(e),onLineNumberSelectionEnd:e=>r.onLineNumberSelectionEnd?.(e)}),m=N(()=>({...NA(`unified`),...i,...p})),h=()=>{vM({viewer:n,isReady:e=>c()?e.querySelector(`[data-line]`)!=null:e.querySelectorAll(`[data-line]`).length>=o(),onReady:()=>{d(n.lastSelection),n.find.refresh({reset:!0}),r.onRendered?.()}})};return hM({search:()=>r.search,find:n.find}),M(()=>{let e=m(),i=Rj(),o=l.get();yM({viewer:n,current:t,reset:t!==void 0,create:()=>o?new KD(e,o,lM,i):new FD(e,i),assign:e=>{t=e},draw:e=>{let t=a();e.render({file:typeof r.file.contents==`string`?r.file:{...r.file,contents:t},lineAnnotations:[],containerWrapper:n.container})},onReady:h})}),_M({viewer:n,current:()=>t,annotations:()=>r.annotations??[]}),P(()=>{t?.cleanUp(),t=void 0,l.cleanup()}),R(OM,{mode:`text`,viewer:n,get class(){return r.class},get classList(){return r.classList}})}function AM(e){let t,n,r,i,a,o,s,c,l,u,[d,f]=B(e,fM),p=Gr(`(max-width: 640px)`),m=e=>TM(e,pj,EM),h=(e,n)=>{let r=t;if(!r)return;let i=RA(u.getRoot(),e);if(i===void 0){u.lastSelection=e;return}u.lastSelection=i,r.setSelectedLines(i),lj(n?.root,n?.text)};u=mM({enableLineSelection:()=>e.enableLineSelection===!0,selectedLines:()=>d.selectedLines,commentedLines:()=>d.commentedLines,onLineSelectionEnd:e=>d.onLineSelectionEnd?.(e)},{lineFromMouseEvent:m,setSelectedLines:h,updateSelection:e=>{let t=u.getRoot();if(!t)return;let n=hj({root:t,lineForNode:pj,sideForNode:DM,preserveTextSelection:e});if(n){if(n.text){h(n.range,{root:t,text:n.text});return}h(n.range)}},buildDragSelection:()=>{if(u.dragStart===void 0||u.dragEnd===void 0)return;let e={start:u.dragStart,end:u.dragEnd};return c&&(e.side=c),l&&c&&l!==c&&(e.endSide=l),e},buildClickSelection:()=>{if(u.dragStart===void 0)return;let e={start:u.dragStart,end:u.dragStart};return c&&(e.side=c),e},onDragStart:e=>{c=e.side,l=e.side},onDragMove:e=>{l=e.side},onDragReset:()=>{c=void 0,l=void 0},markCommented:VA});let g=CM(()=>u.container,()=>d.virtualize!==!1),_=N(()=>{if(d.fileDiff){let e=d.fileDiff.deletionLines.join(``),t=d.fileDiff.additionLines.join(``);return Math.max(e.length,t.length)>5e5}let e=typeof d.before?.contents==`string`?d.before.contents:``,t=typeof d.after?.contents==`string`?d.after.contents:``;return Math.max(e.length,t.length)>5e5}),v={lineDiffType:`none`,maxLineDiffLength:0,tokenizeMaxLineLength:1},y=gM({viewer:u,normalize:e=>RA(u.getRoot(),e),onLineSelected:e=>d.onLineSelected?.(e),onLineSelectionEnd:e=>d.onLineSelectionEnd?.(e),onLineNumberSelectionEnd:e=>d.onLineNumberSelectionEnd?.(e)}),b=N(()=>{let t={...NA(e.diffStyle),...f,...y},n=_()?{...t,...v}:t;return p()?{...n,disableLineNumbers:e.disableLineNumbers??!0}:n}),x=e=>{vM({viewer:u,isReady:e=>e.querySelector(`[data-line]`)!=null,settleFrames:1,onReady:()=>{e?.(),h(u.lastSelection),u.find.refresh({reset:!0}),d.onRendered?.()}})};return hM({search:()=>d.search,find:u.find}),M(()=>{let e=b(),c=Rj(_()?`none`:`word-alt`),l=g.get(),f=typeof d.before?.contents==`string`?d.before.contents:``,p=typeof d.after?.contents==`string`?d.after.contents:``,m=bM(u);P(m);let h=e=>_()?Qp(e):Qp(e,e.length),v=d.before?{...d.before,contents:f,cacheKey:h(f)}:void 0,y=d.after?{...d.after,contents:p,cacheKey:h(p)}:void 0,S=d.fileDiff===void 0?a!==void 0||v===void 0||y===void 0||o===void 0||s===void 0||!aE(o,v)||!aE(s,y):a!==d.fileDiff,C=t!==void 0&&(n!==l||r!==c||l!==void 0&&(i!==e.hunkSeparators||S)),w=!C&&t!==void 0&&!Em(t.options,e);yM({viewer:u,current:t,reset:C,create:()=>l?new oA(e,l,_j,c):new Yk(e,c),update:t=>t.setOptions(e),assign:u=>{t=u,n=l,r=c,i=l?e.hunkSeparators:void 0,a=d.fileDiff,o=v,s=y},draw:e=>{if(d.fileDiff){e.render({fileDiff:d.fileDiff,forceRender:w,lineAnnotations:[],containerWrapper:u.container});return}v&&y&&e.render({oldFile:v,newFile:y,forceRender:w,lineAnnotations:[],containerWrapper:u.container})},onReady:()=>x(m)})}),_M({viewer:u,current:()=>t,annotations:()=>d.annotations??[]}),P(()=>{t?.cleanUp(),t=void 0,n=void 0,r=void 0,i=void 0,a=void 0,o=void 0,s=void 0,g.cleanup(),c=void 0,l=void 0}),R(OM,{mode:`diff`,viewer:u,get class(){return d.class},get classList(){return d.classList}})}function jM(e){return e.mode===`text`?R(iM,{get media(){return e.media},fallback:()=>kM(e)}):R(iM,{get media(){return e.media},fallback:()=>AM(e)})}ct([`pointerdown`]);var{use:MM,provider:NM}=hn({name:`Data`,init:e=>({get store(){return e.data},get directory(){return e.directory},get sessionID(){return e.sessionID},navigateToSession:e.onNavigateToSession,sessionHref:e.onSessionHref,shellRunning:e.shellRunning,shellOutput:e.shellOutput})}),PM=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},FM={pipe(){return PM(this,arguments)}},IM=function(){function e(){}return e.prototype=FM,e}(),LM=function(e,t){if(typeof e==`function`)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},RM=e=>e,zM=(e=>()=>e)(void 0),BM=zM;function VM(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function HM(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),t.set(i,i),i}}var UM=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},WM=new WeakSet;function GM(e){return typeof e==`string`}function KM(e){return typeof e==`number`}function qM(e){return typeof e==`symbol`}function JM(e){return GM(e)||KM(e)||qM(e)}function YM(e){return typeof e==`function`}function XM(e){return e!=null}function ZM(e){return!0}function QM(e){return typeof e==`object`&&!!e||YM(e)}var $M=LM(2,(e,t)=>QM(e)&&t in e),eN=`~effect/interfaces/Hash`,tN=e=>{switch(typeof e){case`number`:return oN(e);case`bigint`:return sN(e.toString(10));case`boolean`:return sN(String(e));case`symbol`:return sN(String(e));case`string`:return sN(e);case`undefined`:return sN(`undefined`);case`function`:case`object`:if(e===null)return sN(`null`);if(e instanceof Date)return Number.isNaN(e.getTime())?sN(`Invalid Date`):sN(e.toISOString());if(e instanceof RegExp)return sN(e.toString());{if(WM.has(e))return nN(e);if(hN.has(e))return hN.get(e);let t=_N(e,()=>aN(e)?e[eN]():typeof e==`function`?nN(e):e instanceof DataView?dN(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Array.isArray(e)||ArrayBuffer.isView(e)?dN(e):e instanceof Map?fN(e):e instanceof Set?pN(e):lN(e));return hN.set(e,t),t}default:throw Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},nN=e=>(mN.has(e)||mN.set(e,oN(Math.floor(Math.random()*(2**53-1)))),mN.get(e)),rN=LM(2,(e,t)=>e*53^t),iN=e=>e&3221225471|e>>>1&1073741824,aN=e=>$M(e,eN),oN=e=>{if(e!==e)return sN(`NaN`);if(e===1/0)return sN(`Infinity`);if(e===-1/0)return sN(`-Infinity`);let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return iN(t)},sN=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return iN(t)},cN=(e,t)=>{let n=12289;for(let r of t)n^=rN(tN(r),tN(e[r]));return iN(n)},lN=e=>cN(e,UM(e)),uN=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return iN(r)},dN=uN(6151,tN),fN=uN(sN(`Map`),([e,t])=>rN(tN(e),tN(t))),pN=uN(sN(`Set`),tN),mN=new WeakMap,hN=new WeakMap,gN=new WeakSet;function _N(e,t){if(gN.has(e))return sN(`[Circular]`);gN.add(e);let n=t();return gN.delete(e),n}var vN=`~effect/interfaces/Equal`;function yN(){return arguments.length===1?e=>bN(e,arguments[0]):bN(arguments[0],arguments[1])}function bN(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||WM.has(e)||WM.has(t)?!1:TN(e,t,wN):!1}function xN(e,t,n){let r=SN.has(e),i=CN.has(t);if(r&&i)return!0;if(r||i)return!1;SN.add(e),CN.add(t);let a=n();return SN.delete(e),CN.delete(t),a}var SN=new WeakSet,CN=new WeakSet;function wN(e,t){if(tN(e)!==tN(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=PN(e),r=PN(t);if(n!==r)return!1;let i=n&&r;return typeof e==`function`&&!i?!1:xN(e,t,()=>{if(i)return e[vN](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:DN(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;if(!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView)return!1;if(n){let n=t;return ON(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}return ON(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:jN(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:NN(e,t):kN(e,t)})}function TN(e,t,n){let r=EN.get(e);if(!r)r=new WeakMap,EN.set(e,r);else if(r.has(t))return r.get(t);let i=n(e,t);r.set(t,i);let a=EN.get(t);return a||(a=new WeakMap,EN.set(t,a)),a.set(e,i),i}var EN=new WeakMap;function DN(e,t){for(let n=0;n<e.length;n++)if(!bN(e[n],t[n]))return!1;return!0}function ON(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function kN(e,t){let n=UM(e),r=UM(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!bN(e[i],t[i]))return!1;return!0}function AN(e,t){return function(n,r){let i=Array.from(r);for(let[r,a]of n){let n=!1;for(let o=0;o<i.length;o++){let[s,c]=i[o];if(e(r,s)&&t(a,c)){i[o]=i[i.length-1],i.pop(),n=!0;break}}if(!n)return!1}return!0}}var jN=AN(bN,bN);function MN(e){return function(t,n){let r=Array.from(n);for(let n of t){let t=!1;for(let i=0;i<r.length;i++){let a=r[i];if(e(n,a)){r[i]=r[r.length-1],r.pop(),t=!0;break}}if(!t)return!1}return!0}}var NN=MN(bN),PN=e=>$M(e,vN),FN=e=>(t,n)=>t===n||e(t,n),IN=e=>e.length>0;function LN(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function RN(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&LN(e,n,t[n])}var zN=Symbol.for(`~effect/Redactable`),BN=e=>$M(e,zN);function VN(e){return BN(e)?HN(e):e}function HN(e){return e[zN](globalThis[`~effect/Fiber/currentFiber`]?.context??GN)}var UN=`~effect/Fiber/currentFiber`,WN=new Map,GN={"~effect/Context":{},base:WN,depth:0,mapUnsafe:WN,pipe(){return PM(this,arguments)}};function KN(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return qN;r.add(e);let l;if(zN in e)l=c(HN(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
|
|
711
|
+
`+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=YN(e);else if(!t?.ignoreToString&&$M(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=XN(e);l=e instanceof Error&&e.cause?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${JN(t)}:${c(e[t],n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${JN(t)}: ${c(e[t],n+1)}`).join(`,
|
|
712
|
+
`)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var qN=`[Circular]`;function JN(e){return typeof e==`string`?JSON.stringify(e):String(e)}function YN(e){try{return e.toISOString()}catch{return`Invalid Date`}}function XN(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}var ZN=Symbol.for(`nodejs.util.inspect.custom`),QN=e=>{try{return e=VN(e),$M(e,`toJSON`)&&YM(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(QN):e}catch{return`[toJSON threw]`}},$N=class e{called=!1;self;constructor(e){this.self=e}next(e){return this.called?{value:e,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new e(this.self)}},eP=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),tP=`~effect/Effect`,nP=`~effect/Exit`,rP={_A:RM,_E:RM,_R:RM},iP=`${tP}/identifier`,aP=`${tP}/args`,oP=`${tP}/evaluate`,sP=`${tP}/successCont`,cP=`${tP}/failureCont`,lP=`${tP}/ensureCont`,uP=Symbol.for(`effect/Effect/Yield`),dP={pipe(){return PM(this,arguments)},toJSON(){return{...this}},toString(){return KN(this.toJSON(),{ignoreToString:!0,space:2})},[ZN](){return this.toJSON()}},fP={[tP]:rP,...dP,[Symbol.iterator](){return new $N(this)},toJSON(){return{_id:`Effect`,op:this[iP],...aP in this?{args:this[aP]}:void 0}}},pP=e=>$M(e,nP),mP=`~effect/Cause`,hP=`~effect/Cause/Reason`,gP=e=>$M(e,mP),_P=class{[mP];reasons;constructor(e){this[mP]=mP,this.reasons=e}pipe(){return PM(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${KN(this.reasons)})`}[ZN](){return this.toJSON()}[vN](e){return gP(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>yN(t,e.reasons[n]))}[eN](){return dN(this.reasons)}},vP=new WeakMap,yP=class{[hP];annotations;_tag;constructor(e,t,n){if(this[hP]=hP,this._tag=e,t!==bP&&typeof n==`object`&&n&&t.size>0){let e=vP.get(n);e&&(t=new Map([...e,...t])),vP.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return PM(this,arguments)}toString(){return KN(this)}[ZN](){return this.toString()}},bP=new Map,xP=class extends yP{error;constructor(e,t=bP){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${KN(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[vN](e){return DP(e)&&yN(this.error,e.error)&&yN(this.annotations,e.annotations)}[eN](){return rN(sN(this._tag))(rN(tN(this.error))(tN(this.annotations)))}},SP=e=>new _P(e),CP=e=>new _P([new xP(e)]),wP=class extends yP{defect;constructor(e,t=bP){super(`Die`,t,e),this.defect=e}toString(){return`Die(${KN(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[vN](e){return OP(e)&&yN(this.defect,e.defect)&&yN(this.annotations,e.annotations)}[eN](){return rN(sN(this._tag))(rN(tN(this.defect))(tN(this.annotations)))}},TP=e=>new _P([new wP(e)]),EP=LM(e=>gP(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new _P(e.reasons.map(e=>e.annotate(t,n)))),DP=e=>e._tag===`Fail`,OP=e=>e._tag===`Die`,kP=e=>e._tag===`Interrupt`;function AP(e){return zP(`Effect.evaluate: Not implemented`)}var jP=e=>({...fP,[iP]:e.op,[oP]:e[oP]??AP,[sP]:e[sP],[cP]:e[cP],[lP]:e[lP]}),MP=e=>{let t=jP(e);return function(){let n=Object.create(t);return n[aP]=e.single===!1?arguments:arguments[0],n}},NP=e=>{let t={[nP]:nP,_tag:e.op,get[e.prop](){return this[aP]},...jP(e),toString(){return`${e.op}(${KN(this[aP])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[aP]}},[vN](e){return pP(e)&&e._tag===this._tag&&yN(this[aP],e[aP])},[eN](){return rN(sN(e.op),tN(this[aP]))}};return function(e){let n=Object.create(t);return n[aP]=e,n}},PP=NP({op:`Success`,prop:`value`,[oP](e){let t=e.getCont(sP);return t?t[sP](this[aP],e,this):e.yieldWith(this)}}),FP={key:`effect/Cause/StackTrace`},IP={key:`effect/Cause/InterruptorStackTrace`},LP=NP({op:`Failure`,prop:`cause`,[oP](e){let t=this[aP],n=!1;e.currentStackFrame&&(t=EP(t,{mapUnsafe:new Map([[FP.key,e.currentStackFrame]])}),n=!0);let r=e.getCont(cP);for(;e.interruptible&&e._interruptedCause&&r;)r=e.getCont(cP);return r?r[cP](t,e,n?void 0:this):e.yieldWith(n?LP(t):this)}}),RP=e=>LP(CP(e)),zP=e=>LP(TP(e)),BP=MP({op:`WithFiber`,[oP](e){return this[aP](e)}}),VP=function(){class e extends globalThis.Error{}let t=jP({op:`YieldableError`,[oP](){return RP(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),HP=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends VP{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(RN(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),UP=e=>{class t extends HP{_tag=e}return t.prototype.name=e,t},WP=`~effect/data/Option`,GP={[WP]:{_A:e=>e},...dP,[Symbol.iterator](){return new $N(this)}},KP=Object.defineProperty(Object.assign(Object.create(GP),{_tag:`Some`,_op:`Some`,[vN](e){return YP(e)&&ZP(e)&&yN(this.value,e.value)},[eN](){return rN(tN(this._tag))(tN(this.value))},toString(){return`some(${KN(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:QN(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),qP=tN(`None`),JP=Object.assign(Object.create(GP),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[vN](e){return YP(e)&&XP(e)},[eN](){return qP},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),YP=e=>$M(e,WP),XP=e=>e._tag===`None`,ZP=e=>e._tag===`Some`,QP=Object.create(JP),$P=e=>{let t=Object.create(KP);return t.value=e,t},eF=`~effect/data/Result`;({...dP});var tF=()=>QP,nF=$P,rF=XP,iF=LM(2,(e,t)=>rF(e)?t():e.value),aF=iF(zM),oF=LM(2,(e,t)=>rF(e)?tF():nF(t(e.value))),sF=globalThis.Array,cF=e=>sF.isArray(e)?e:sF.from(e),lF=LM(2,(e,t)=>[...e,t]),uF=LM(2,(e,t)=>cF(e).concat(cF(t)));sF.isArray;var dF=IN,fF=IN,pF=(e,t)=>{let n=tN(t),r=e.get(n);if(r===void 0)return e.set(n,[t]),!0;for(let e of r)if(yN(e,t))return!1;return r.push(t),!0},mF=LM(2,(e,t)=>{let n=cF(e),r=cF(t);return fF(n)?fF(r)?_F(uF(n,r)):n:r}),hF=()=>[],gF=LM(2,(e,t)=>e.map(t)),_F=e=>{let t=cF(e);if(t.length<2)return[...t];let n=new Map,r=[];for(let e of t)pF(n,e)&&r.push(e);return r},vF=`~effect/BigDecimal`,yF={[vF]:vF,[eN](){let e=EF(this);return rN(tN(e.value),oN(e.scale))},[vN](e){return bF(e)&&AF(this,e)},toString(){return`BigDecimal(${jF(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[ZN](){return this.toJSON()},pipe(){return PM(this,arguments)}},bF=e=>$M(e,vF),xF=(e,t)=>{let n=Object.create(yF);return n.value=e,n.scale=t,n},SF=(e,t)=>{if(e!==CF&&e%wF===CF)throw RangeError(`Value must be normalized`);let n=xF(e,t);return n.normalized=n,n},CF=BigInt(0),wF=BigInt(10),TF=SF(CF,0),EF=e=>{if(e.normalized===void 0){if(e.value===CF)e.normalized=TF;else{let t=`${e.value}`,n=0;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)n++;n===0&&(e.normalized=e),e.normalized=SF(BigInt(t.substring(0,t.length-n)),e.scale-n)}}return e.normalized},DF=LM(2,(e,t)=>t>e.scale?xF(e.value*wF**BigInt(t-e.scale),t):t<e.scale?xF(e.value/wF**BigInt(e.scale-t),t):e),OF=e=>e.value<CF?xF(-e.value,e.scale):e,kF=FN((e,t)=>e.scale>t.scale?DF(t,e.scale).value===e.value:e.scale<t.scale?DF(e,t.scale).value===t.value:e.value===t.value),AF=LM(2,(e,t)=>kF(e,t)),jF=e=>{let t=EF(e);if(Math.abs(t.scale)>=16)return MF(t);let n=t.value<CF,r=n?`${t.value}`.substring(1):`${t.value}`,i,a;if(t.scale>=r.length)i=`0`,a=`0`.repeat(t.scale-r.length)+r;else{let e=r.length-t.scale;if(e>r.length){let t=e-r.length;i=`${r}${`0`.repeat(t)}`,a=``}else a=r.slice(e),i=r.slice(0,e)}let o=a===``?i:`${i}.${a}`;return n?`-${o}`:o},MF=e=>{if(NF(e))return`0e+0`;let t=EF(e),n=`${OF(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${PF(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},NF=e=>e.value===CF,PF=e=>e.value<CF,FF=e=>jP({op:e.label,[oP]:e.evaluate}),IF=`~effect/Context/Service`,LF=function(){function e(){}let t=e;Object.setPrototypeOf(t,RF);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[BF]=BF,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&zF.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},RF={[IF]:IF,...FF({label:`Service`,evaluate(e){return PP(oI(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return nI(this,e)},use(e){return BP(t=>e(oI(t.context,this)))},useSync(e){return BP(t=>PP(e(oI(t.context,this))))}},zF=new Set,BF=`~effect/Context/Reference`,VF=`~effect/Context`,HF=8,UF=8,WF=(e,t,n,r)=>{let i=Object.create(XF);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},GF=(e,t)=>{t&&(GF(e,t.parent),e.set(t.key,t.value))},KF=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return GF(t,e.overlay),e._flat=t},qF=Symbol(),JF=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?qF:(n.overlay&&++n.baseHits>=UF&&(n.base=KF(n),n.overlay=void 0,n.depth=0),r)},YF=e=>WF(void 0,e,void 0,0),XF={get mapUnsafe(){return KF(this)},...dP,[VF]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[vN](e){if(!QF(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!yN(r,n.get(e)))return!1;return!0},[eN](){return oN(this.mapUnsafe.size)}},ZF=(e,t)=>e.cacheRoot===t.cacheRoot,QF=e=>$M(e,VF),$F=e=>!!e[BF],eI=()=>tI,tI=YF(new Map),nI=(e,t)=>YF(new Map([[e.key,t]])),rI=LM(3,(e,t,n)=>iI(e,t.key,n)),iI=(e,t,n)=>{let r=e,i=zF.has(t)?void 0:r.cacheRoot;if(r.depth>=HF){let e=new Map(r.mapUnsafe);return e.set(t,n),WF(i,e,void 0,0)}return WF(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},aI=(e,t)=>{let n=JF(e,t);return n===qF?void 0:n},oI=LM(2,(e,t)=>{let n=JF(e,t.key);if(n===qF){if($F(t))return cI(t);throw lI(t)}return n}),sI=`~effect/Context/defaultValue`,cI=e=>sI in e?e[sI]:e[sI]=e.defaultValue(),lI=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
|
|
713
|
+
`);e.splice(1,3),t.stack=e.join(`
|
|
714
|
+
`)}return t},uI=LF,dI=uI(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new hI}),fI=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},pI=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},mI=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},hI=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?pI:fI)}shouldYield(e){return e.currentOpCount>=e.maxOpsBeforeYield}makeDispatcher(){return new gI(this.setImmediate)}},gI=class{tasks=new mI;running=void 0;setImmediate;constructor(e=fI){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},_I=uI(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),vI=uI(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),yI=class extends IM{constructor(e){super(),e&&RN(this,e)}},bI=e=>class extends yI{_tag=e},xI=[];for(let e=0;e<256;e++)xI.push(e.toString(16).padStart(2,`0`));var SI=`effect/Tracer/ParentSpan`,CI=`effect/Tracer`,wI=`effect/observability/Metric/FiberRuntimeMetricsKey`,TI=uI(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:zM}),EI=uI(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),DI=uI(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),OI=class extends yP{fiberId;constructor(e,t=bP){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[vN](e){return kP(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[eN](){return rN(sN(`${this._tag}:${this.fiberId}`))(nN(this.annotations))}},kI=e=>new _P([new OI(e)]),AI=e=>e.reasons.some(kP),jI=LM(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new _P(mF(e.reasons,t.reasons));return yN(e,n)?e:n}),MI=LM(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>DP(e)?(n=!0,new xP(t(e.error),e.annotations)):e);return n?SP(r):e}),NI=`~effect/Fiber`,PI={_A:RM,_E:RM},FI={id:0},II=()=>globalThis[UN],LI=class{constructor(e,t=!0){this[NI]=PI,this.setContext(e),this.id=++FI.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this.runtimeMetrics?.recordFiberStart(this.context)}[NI];id;interruptible;currentOpCount;_stack;_observers;_exit;_children;_interruptedCause;_yielded;_running;_deferredInterrupt;context;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(e){return oI(this.context,e)}addObserver(e){return this._exit?(e(this._exit),BM):(this._observers.push(e),()=>{if(this._exit)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)})}interruptUnsafe(e,t){if(this._exit)return;let n=kI(e);this.currentStackFrame&&(n=EP(n,nI(FP,this.currentStackFrame))),t&&(n=EP(n,t)),this._interruptedCause=this._interruptedCause?jI(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(WI(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===uP)return;let n=zI.interruptChildren&&zI.interruptChildren(this);if(n!==void 0)return this.evaluate(cL(n,()=>t));this._exit=t,this.runtimeMetrics?.recordFiberEnd(this.context,this._exit);for(let e=0;e<this._observers.length;e++)this._observers[e](t);this._observers.length=0,this._stack.length=0,this._children=void 0,this.context=eI()}runLoop(e){let t=globalThis[UN];globalThis[UN]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;){if(this._deferredInterrupt&&(this._deferredInterrupt=!1,i=WI(this._interruptedCause)),this.currentOpCount++,!r&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){r=!0;let e=i;i=cL(JI,()=>e)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[oP](this),i===uP){let e=this._yielded;if(nP in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return uP}}}catch(e){return $M(i,oP)?this.runLoop(zP(e)):zP(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{this._running=n,globalThis[UN]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,RI;for(;;){let t=this._stack.pop();if(!t)return;let n=t[lP]&&t[lP](this);if(n)return n[e]=n,n;if(t[e])return t}}yieldWith(e){return this._yielded=e,uP}children(){return this._children??=new Set}pipe(){return PM(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&ZF(t,e))return;let n=this.getRef(dI);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=aI(e,SI),this.currentLogLevel=this.getRef(EI),this.minimumLogLevel=this.getRef(DI),this.currentStackFrame=this.getRef(TI),this.maxOpsBeforeYield=this.getRef(_I),this.currentPreventYield=this.getRef(vI),this.runtimeMetrics=aI(e,wI);let r=aI(e,CI);this.currentTracerContext=r?r.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag===`Span`?this.currentSpan:void 0}},RI={[sP](e,t){return WI(t._interruptedCause)},[cP](e,t){return WI(t._interruptedCause)}},zI={interruptChildren:void 0},BI=e=>{if(!e.currentStackFrame)return;let t=new Map;return t.set(IP.key,e.currentStackFrame),YF(t)},VI=e=>nL(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;){if(e.value._exit){r.push(e.value._exit),e=n.next();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(UI(r))}return a(),KI(()=>i?.())}),HI=e=>BP(t=>{let n=BI(t),r=hF();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return sL(VI(r))}),UI=PP,WI=LP,GI=RP,KI=MP({op:`Sync`,[oP](e){let t=this[aP](),n=e.getCont(sP);return n?n[sP](t,e):e.yieldWith(PP(t))}}),qI=MP({op:`Suspend`,[oP](e){return this[aP]()}}),JI=MP({op:`Yield`,[oP](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(hL)},this[aP]??0),e.yieldWith(()=>{t=!0})}})(0),YI=UI(tF()),XI=e=>qI(()=>WI(eP(e))),ZI=e=>zP(e),QI=UI(void 0),$I=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new jL(e,`An error occurred in Effect.try`):e.catch;return qI(()=>{try{return UI(eP(t))}catch(e){return GI(eP(()=>n(e)))}})},eL=MP({op:`Async`,single:!1,[oP](e){let t=eP(()=>this[aP][0].bind(e.currentScheduler)),n=!1,r=!1,i=this[aP][1]?new AbortController:void 0,a=t(t=>{n||(n=!0,r?e.evaluate(t):r=t)},i?.signal);return r===!1?(r=!0,e._yielded=()=>{n=!0},i===void 0&&a===void 0||e._stack.push(tL(()=>(n=!0,i?.abort(),a??hL))),uP):r}}),tL=MP({op:`AsyncFinalizer`,[lP](e){e.interruptible&&(e.interruptible=!1,e._stack.push(SL))},[cP](e,t){return AI(e)?cL(this[aP](),()=>WI(e)):WI(e)}}),nL=e=>eL(e,e.length>=2),rL=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),iL=(e,...t)=>rL(e.length,t.length===0?function(){return aL(()=>e.apply(this,arguments))}:function(){let n=aL(()=>e.apply(this,arguments));for(let e of t)n=e(n);return n}),aL=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return UI(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return qI(()=>n?(n=!1,cL(r.value,e=>oL(t,e))):qI(()=>oL(e())))}}}catch(e){return ZI(e)}},oL=MP({op:`Iterator`,single:!1,[sP](e,t){let n=this[aP][0];for(;;){let r=n.next(e);if(r.done)return UI(r.value);if(!uL(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[oP](e){return this[sP](this[aP][1],e)}}),sL=e=>cL(e,e=>hL),cL=LM(2,(e,t)=>{let n=Object.create(lL);return n[aP]=e,n[sP]=t.length===1?t:e=>t(e),n}),lL=jP({op:`OnSuccess`,[oP](e){return e._stack.push(this),this[aP]}}),uL=e=>nP in e,dL=LM(2,(e,t)=>uL(e)?e._tag===`Success`?t(e.value):e:cL(e,t)),fL=LM(2,(e,t)=>cL(e,e=>UI(eP(()=>t(e))))),pL=LM(2,(e,t)=>uL(e)?gL(e,t):fL(e,t)),mL=e=>e._tag===`Success`,hL=PP(void 0),gL=LM(2,(e,t)=>e._tag===`Success`?PP(t(e.value)):e),_L=LM(2,(e,t)=>{let n=Object.create(vL);return n[aP]=e,n[cP]=t.length===1?t:e=>t(e),n}),vL=jP({op:`OnFailure`,[oP](e){return e._stack.push(this),this[aP]}}),yL=e=>uL(e)?PP(e):bL(e),bL=MP({op:`Exit`,[oP](e){return e._stack.push(this),this[aP]},[sP](e,t,n){return UI(n??PP(e))},[cP](e,t,n){return UI(n??LP(e))}}),xL=e=>BP(t=>t.interruptible?(t.interruptible=!1,t._stack.push(SL),e):e),SL=MP({op:`SetInterruptible`,[lP](e){if(e.interruptible=this[aP],e._interruptedCause&&e.interruptible)return()=>WI(e._interruptedCause)}})(!0),CL=e=>{let t=e.onItem,n=e.step,r=(e,i,a,o)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!uL(c))return cL(yL(c),t=>n(e,s,t,a)??r(e,i,a+1,o)??QI);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return(e,i,a)=>{let o=0,s=a?.end??i.length,c=a?.concurrency??1;if(c===1)return r(e,i,0,s);let l=a?.orderedStep===!0,u=!1,d,f,p,m=!1,h,g,_=o,v=l?Array(s):void 0,y=e=>{let t=zP(e);return h=t,u=!0,m=!0,f&&f.size>0?cL(xL(HI(Array.from(f))),()=>t):t},b=(t,r,a)=>{if(!l)return n(e,t,r,a);if(h)return h;for(v[a]=r;_<s;){let t=v[_];if(t===void 0)return;v[_]=void 0;let r=_++,a=n(e,i[r],t,r);if(a)return a}},x=()=>{let n=!1;for(;!h&&o<s;o++){let r=i[o],a=g??t(e,r,o);if(uL(a)){if(h=b(r,a,o),h)break}else if(d){g=void 0;let e=TL(d,a,!0,!0,`inherit`);if(e._exit){if(h=b(r,e._exit,o),h)break;continue}f.add(e);let t=o;if(e.addObserver(i=>{f.delete(e);try{if(h){if(!m&&i._tag===`Failure`)for(let e of i.cause.reasons)if(e._tag===`Interrupt`)continue;else h._tag===`Failure`?h.cause.reasons.push(e):h=LP(SP([e]))}else{let e=b(r,i,t);e&&(h=e._tag===`Failure`?LP(SP(e.cause.reasons.slice())):e,x())}if(n){let e=x();e&&p(e)}else u&&f.size===0&&p(h??QI)}catch(e){p(y(e))}}),f.size<c)continue;n=!0,o++;return}else return nL(e=>{d=II(),f=new Set,g=a,p=e;let t;try{t=x()}catch(t){return e(y(t))}return t?e(t):qI(()=>(h=hL,m=!0,f?HI(f):QI))})}if(u=!0,h){if(f&&f.size>0){let e=BI(d);f.forEach(t=>t.interruptUnsafe(d.id,e));return}if(p||h._tag===`Failure`)return h}else if(p){if(f)f.size===0&&p(QI);else return hL}};return x()}},wL=()=>CL,TL=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new LI(a.context,o);return n?s.evaluate(t):a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0),!r&&!s._exit&&(a.children().add(s),s.addObserver(()=>a._children.delete(s))),s},EL=e=>(t,n)=>{let r=new LI(n?.scheduler?rI(e,dI,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},DL=(e=>{let t=EL(e);return e=>{if(uL(e))return e;let n=new hI(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??zP(new kL(r))}})(eI()),OL=`~effect/Cause/AsyncFiberError`,kL=class extends UP(`AsyncFiberError`){[OL]=OL;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},AL=`~effect/Cause/UnknownError`,jL=class extends UP(`UnknownError`){[AL]=AL;constructor(e,t){super({message:t,cause:e})}},ML={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};ML.gray,ML.blue,ML.green,ML.yellow,ML.red,ML.bgBrightRed,ML.black;var NL=DP,PL=MI,FL=PP,IL=LP,LL=RP,RL=hL,zL=mL,BL=`~effect/time/DateTime`,VL=`~effect/time/DateTime/TimeZone`,HL={[BL]:BL,pipe(){return PM(this,arguments)},[ZN](){return this.toString()},toJSON(){return WL(this).toJSON()}};({...HL}),{...HL};var UL={[VL]:VL,[ZN](){return this.toString()}};({...UL}),{...UL};var WL=e=>new Date(e.epochMilliseconds),GL=UI,KL=YI,qL=GI,JL=XI,YL=ZI,XL=$I,ZL=cL,QL=yL,$L=_L,eR=DL,tR=pL,nR=dL,rR=iL,iR=`~sentinels`,aR=`~constructor`,oR=Symbol(),sR=FL,cR=sR(oR),lR=sR(oR),uR=e=>e===oR?tF():nF(e),dR=e=>e._tag===`None`?cR:sR(e.value),fR=`~effect/SchemaIssue/Issue`;function pR(e){return $M(e,fR)&&e[fR]===fR}var mR=class{[fR]=fR;constructor(e,t){t?.reportInput===!0&&e!==oR&&(this.input=e)}},hR=class extends mR{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},gR=class extends mR{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},_R=class extends mR{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},vR=class extends mR{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},yR=class extends mR{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},bR=class extends mR{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},xR=class extends mR{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},SR=class extends mR{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},CR=class extends mR{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},wR=class extends mR{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function TR(e,t,n){if(pR(e))return e;if(typeof e==`string`)return new SR({message:e},t,n);let r=typeof e.issue==`string`?new SR({message:e.issue},t,n):e.issue;return new _R(e.path,r)}function ER(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new SR(void 0,t,n):TR(e,t,n)}function DR(e,t,n,r){return Array.isArray(t)?fF(t)?t.length===1?TR(t[0],n,r):new bR(e,gF(t,e=>TR(e,n,r)),n,r):void 0:ER(t,n,r)}function OR(e){let t;for(let n of e.reasons){if(!NL(n)||!pR(n.error))return;t??=n.error}return t}function kR(e,t){let n=OR(e);if(n===void 0)throw Error(t,{cause:e});return n}var AR=class e extends IM{run;constructor(e){super(),this.run=e}map(t){return new e((e,n)=>this.run(e,n).pipe(tR(oF(t))))}compose(t){return MR(this)?t:MR(t)?this:new e((e,n)=>this.run(e,n).pipe(nR(e=>t.run(e,n))))}},jR=new AR(GL);function MR(e){return e.run===jR.run}function NR(){return jR}function PR(e){return new AR((t,n)=>rF(t)?KL:e(t.value,n))}function FR(e){return IR(oF(e))}function IR(e){return new AR(t=>GL(e(t)))}function LR(){return FR(globalThis.String)}function RR(){return FR(globalThis.Number)}function zR(e){return PR((t,n)=>XL({try:()=>nF(JSON.parse(t,e?.reviver)),catch:()=>new SR({expected:`a valid JSON string`},t,n)}))}function BR(e){return PR((t,n)=>XL({try:()=>{let n=JSON.stringify(t,e?.replacer,e?.space);if(n===void 0)throw TypeError(`Value cannot be represented as JSON`);return nF(n)},catch:()=>new SR({expected:`a JSON-serializable value`},t,n)}))}var VR=`~effect/SchemaTransformation/Transformation`,HR=class e{[VR]=VR;_tag=`Transformation`;decode;encode;constructor(e,t){this.decode=e,this.encode=t}flip(){return new e(this.encode,this.decode)}compose(t){return new e(this.decode.compose(t.decode),t.encode.compose(this.encode))}};function UR(e){return $M(e,VR)&&e[VR]===VR}var WR=e=>UR(e)?e:new HR(e.decode,e.encode),GR=new HR(NR(),NR());function KR(){return GR}var qR=new HR(RR(),LR());function JR(e){return new HR(zR(e??{}),BR(e))}function YR(e){return t=>t._tag===e}var XR=YR(`Declaration`),ZR=YR(`Never`),QR=YR(`Literal`),$R=YR(`UniqueSymbol`),ez=YR(`Arrays`),tz=YR(`Objects`),nz=YR(`Suspend`),rz=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},iz={},az=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},oz=`~effect/Schema`,sz=class{[oz]=oz;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},cz=new class extends sz{_tag=`Unknown`;getParser(){return yB(this,ZM)}getExpected(){return`unknown`}},lz=class extends sz{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${KN(e)}`);this.literal=e}getParser(){return vB(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?uz(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:uz(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function uz(e){let t=globalThis.String(e.literal);return Xz(e,[new rz(new lz(t),new HR(FR(()=>e.literal),FR(()=>t)))])}var dz=new class extends sz{_tag=`String`;getParser(){return yB(this,GM)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&DB(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},fz=class extends sz{_tag=`Number`;getParser(){return yB(this,KM)}matchKey(e,t){return this._match(SB,e,t)}matchPart(e,t){return this._match(xB,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:DB(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(pz(this.checks,`effect/schema/isFinite`)||pz(this.checks,`effect/schema/isInt`))?this:Xz(this,[Gz])}toCodecStringTree(){return this.toCodecJson()===this?Xz(this,[TB]):Xz(this,[EB])}getExpected(){return`number`}};function pz(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&pz(e.checks,t))}var mz=new fz,hz=e=>(e=e===`unbounded`?1/0:e??1,e>1?{concurrency:e}:void 0),gz=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=OR(r.cause);if(i===void 0)return IL(PL(r.cause,r=>new bR(t,[new _R([n],r)],e.input,e.options)));let a=new _R([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return LL(new bR(t,[a],e.input,e.options))},_z=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function vz(e,t,n=iz){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(bB(mB(t)))}var yz=class{name;type;constructor(e,t){this.name=e,this.type=t}};function bz(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(bz);default:return!1}}function xz(e){return bz(e)&&bz(mB(e))}var Sz=class{parameter;type;constructor(e,t){if(!xz(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,uB(t)&&!_B(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Cz=class e extends sz{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o;let s=e.map(e=>e.name).filter((e,t,n)=>n.indexOf(e)!==t);if(s.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(s)}. ts(2300)`)}getParser(e,t=e){let n=this,r=[];for(let e of n.propertySignatures)r.push(e.name);let i=r.length,a=n.indexSignatures.length,o=i&&a?new Set(r):void 0;if(!i&&!a)return yB(n,XM);let s,c,l=(e,t,r,a,s)=>{if(s._tag===`Failure`)return gz(e,n,t,s)??RL;let c=s===lR?a:s[aP];if(r!==oR&&c!==oR){if(i&&(o.has(t)||o.has(r)))return RL;LN(e.out,r,c)}return RL},u=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!uL(n))return ZL(QL(n),n=>u(e,t,r,n));i=n}if(i._tag===`Failure`)return gz(e,n,t,i)??RL;let a=i===lR?t:i[aP],o=e.input[t],s=r.parserValue(o,e.options);return uL(s)?l(e,t,a,o,s):ZL(QL(s),n=>l(e,t,a,o,n))},d=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return uL(i)?l(e,t,t,r,i):ZL(QL(i),n=>l(e,t,t,r,n))},f=a?wL()({onItem:(e,[t,n])=>u(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0,p=()=>(s||(s=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),c=a?n.indexSignatures.map(n=>({is:n,parserKey:e(bB(n.parameter)),parserValue:t(n.type)})):void 0),s),m=rR(function*(e,t){if(e===oR)return oR;if(typeof e!=`object`||!e||Array.isArray(e))return yield*qL(new xR(n,e,t));p();let l=e,m={},h={ast:n,input:l,out:m,issues:void 0,options:t},g=t.errors===`all`,_=t.onExcessProperty===`error`,v=t.onExcessProperty===`preserve`,y;if(!a&&(_||v)){o??=new Set(r),y=Reflect.ownKeys(l);for(let r=0;r<y.length;r++){let i=y[r];if(!o.has(i)){if(_){let r=new yR(n,l[i],t),a=new _R([i],r);if(g){h.issues?h.issues.push(a):h.issues=[a];continue}return yield*qL(new bR(n,[a],e,t))}LN(m,i,l[i])}}}let b=hz(t?.concurrency);if(i){let e=Tz(h,s,b);e&&(yield*e)}if(a&&!b)for(let e=0;e<a;e++){let n=c[e],r=n.is.parameter===dz?d:u,i=n.is.parameter===dz?Object.keys(l):vz(l,n.is.parameter,t);for(let e=0;e<i.length;e++){let t=r(h,i[e],n);if(!uL(t))yield*t;else if(t._tag===`Failure`)return yield*t}}else if(f){let e=hF();for(let n=0;n<a;n++){let r=c[n],i=vz(l,r.is.parameter,t);for(let t=0;t<i.length;t++)e.push([i[t],r])}let n=f(h,e,b);n&&(yield*n)}if(h.issues)return yield*qL(new bR(n,h.issues,e,t));if(t.propertyOrder===`original`){let e=(y??Reflect.ownKeys(l)).concat(r),t={};for(let n of e)Object.hasOwn(m,n)&&LN(t,n,m[n]);return t}return m});if(a)return m;let h=(e,t,n)=>{let r=s[t];return ZL(QL(n),n=>{let i=wz(e,r,n);if(i)return i;let a=()=>sR(e.out),o=Tz(e,s.slice(t+1));return o?nR(o,a):a()})};return(e,t)=>{if(e===oR)return cR;if(t.errors===`all`||t.onExcessProperty!==void 0||t.propertyOrder===`original`||t.concurrency!==void 0)return m(e,t);if(typeof e!=`object`||!e||Array.isArray(e))return qL(new xR(n,e,t));let r=p(),i=e,a={},o={ast:n,input:i,out:a,issues:void 0,options:t};try{for(let e=0;e<r.length;e++){let n=r[e],s=n.name,c=Object.hasOwn(i,s),l=c?i[s]:oR,u=n.parser(l,t);if(!uL(u))return h(o,e,u);if(u===lR){c&&LN(a,s,l);continue}let d=wz(o,n,u);if(d)return d}}catch(e){return YL(e)}return sR(a)}}_rebuild(t,n,r,i){let a=aB(this.propertySignatures,e=>{let n=t(e.type);return n===e.type?e:new yz(e.name,n)}),o=aB(this.indexSignatures,e=>{let r=n(e.parameter),i=t(e.type);return r===e.parameter&&i===e.type?e:new Sz(r,i)});return a===this.propertySignatures&&o===this.indexSignatures&&r===this.checks&&i===this.encodingChecks?this:new e(a,o,this.annotations,r,void 0,this.context,i)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function wz(e,t,n){if(n._tag===`Failure`)return gz(e,e.ast,t.name,n);if(n===lR)return;let r=n[aP];if(r!==oR){LN(e.out,t.name,r);return}if(delete e.out[t.name],!uB(t.type)){let n=new _R([t.name],new vR(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return LL(new bR(e.ast,[n],e.input,e.options))}}var Tz=wL()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(oR,e.options);let n=e.input[t.name];return LN(e.out,t.name,n),t.parser(n,e.options)},step:wz});function Ez(e,t){return e?t?[...e,...t]:e:t}var Dz=HM(e=>{for(;;){if(nz(e))return cz;let t=e.encoding;if(!t)return e.recur?.(Dz,RM)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==RM))return cz;e=t[t.length-1].to}});function Oz(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(Oz)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function kz(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[iR];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!uB(t)){if(QR(t))return[{key:e.name,literal:t.literal}];if($R(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!uB(e)){if(QR(e))return[{key:t,literal:e.literal}];if($R(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>kz(Dz(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return kz(e.thunk())}}var Az=new WeakMap,jz=Object.freeze([]);function Mz(e){let t=Az.get(e);if(t)return t;let n,r=0,i,a,o=!0;for(let t=0;t<e.length;t++){let s=e[t],c=Dz(s);if(ZR(c))continue;if(o){if(QR(c)||$R(c)){a??=new Map;let e=QR(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1}let l=kz(c);if(l.length){n??=new Map,r++;for(let{key:e,literal:r}of l){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=Oz(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??jz;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=i;for(let[t,n]of i)a.set(t,Object.freeze(Array.from(n,t=>e[t])));t=(t,n)=>{if(QM(t)){let i=Object.hasOwn(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??jz;if(n)return e}return jz}}else if(n){let a;for(let e of n)(!a||e[1][0].size>a[1][0].size)&&e[1][1].size===r&&(a=e);t=(t,r)=>{let o=i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??jz;if(!QM(t))return o.map(t=>e[t]);let s=new Set(o),c;if(a){let[n,[i]]=a,l=Object.hasOwn(t,n),u=l?t[n]:void 0;if(l&&(!r||u!==void 0)){let t=i.get(u);if(!t)return o.map(t=>e[t]);for(let e of t)s.add(e);c=n}}if(c===void 0)for(let[e,[i,a]]of n){let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);if(e)for(let t of e)s.add(t)}else if(r)for(let e of a)s.add(e)}for(let[e,[i,a]]of n){if(e===c)continue;let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);for(let t of s)a.has(t)&&!e?.has(t)&&s.delete(t)}}return Array.from(s).sort((e,t)=>e-t).map(t=>e[t])}}else t=t=>(i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??jz).map(t=>e[t]).filter(Nz(t));return Az.set(e,t),t}function Nz(e){return t=>{let n=Dz(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function Pz(e,t,n=!1){return Mz(t)(e,n)}var Fz=class e extends sz{_tag=`Union`;types;mode;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.mode=t,this.encodingChecks=o}getParser(e,t){let n=this;return(r,i)=>{if(r===oR)return cR;let a=Pz(r,n.types,t!==void 0);if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:uL(t)?Iz(n,t.cause,r,i):$L(t,e=>Iz(n,e,r,i))}let o={ast:n,compile:e,input:r,out:void 0,successes:n.mode===`oneOf`?[]:void 0,issues:void 0,options:i},s=hz(i?.concurrency),c=Lz(o,a,s?{...s,orderedStep:!0}:void 0);return c?nR(c,e=>o.out===lR?GL(r):o.out?o.out:qL(new CR(n,o.issues??[],r,i))):o.out?o.out:qL(new CR(n,o.issues??[],r,i))}}_rebuild(t,n,r){let i=aB(this.types,t);return i===this.types&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.mode,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=mB(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(QR);if(t.length>0)return`${zz(n.isMutable)}[ ${t.map(t=>e(t)+Bz(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>QR(e.type));if(t.length>0)return`{ ${t.map(t=>`${zz(t.type.context?.isMutable)}${JN(t.name)}${Bz(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function Iz(e,t,n,r){let i=OR(t);return i?LL(new CR(e,[i],n,r)):IL(t)}var Lz=wL()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=OR(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(t),LL(new wR(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return RL}}}),Rz=new Fz([new lz(`Infinity`),new lz(`-Infinity`),new lz(`NaN`)],`anyOf`);function zz(e){return e?``:`readonly `}function Bz(e){return e?`?`:``}var Vz=class e extends IM{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(t){return new e(this.run,{...this.annotations,...t},this.aborted)}abort(){return new e(this.run,this.annotations,!0)}and(e,t){return new Hz([this,e],t)}},Hz=class e extends IM{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(t){return new e(this.checks,{...this.annotations,...t})}and(t,n){return new e([this,t],n)}};function Uz(e,t,n=!1){return new Vz((t,n,r)=>DR(n,e(t,n,r),t,r),t,n)}function Wz(e){return Uz(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...e})}var Gz=new rz(new Fz([eB(mz,[Wz()]),Rz],`anyOf`),new HR(RR(),FR(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function Kz(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return Uz(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n}`,representation:{id:`effect/schema/isPattern`,payload:{source:n,flags:e.flags}},toJsonSchema:()=>({pattern:n}),arbitrary:{constraint:{patterns:[e.source]}},...t})}function qz(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}var Jz=new WeakMap;function Yz(e){return Jz.get(e)??e}function Xz(e,t){return e.encoding===t?e:qz(e,e=>{e.encoding.value=t})}function Zz(e,t){if(e.context===t)return e;let n=Yz(e);if(n.context===t)return n;let r=qz(e,e=>{e.context.value=t});return Jz.set(r,n),r}function Qz(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return $z(e,lF(e.checks.slice(0,-1),n.annotate(t)))}return qz(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function $z(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:qz(e,e=>{e.checks.value=t})}function eB(e,t){return $z(e,Ez(e.checks,t))}function tB(e,t){let n=t(e.to);return n===e.to?e:new rz(n,e.transformation)}function nB(e,t){let n=e,r=n[n.length-1],i=tB(r,t);return i===r?e:lF(e.slice(0,e.length-1),i)}function rB(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:Xz(r,nB(r.encoding,n))}return e(r)}return HM(n)}function iB(e,t,n){let r=new rz(e,t);return Xz(n,n.encoding?[...n.encoding,r]:[r])}function aB(e,t){let n=!1,r=Array(e.length);for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}function oB(e,t){return Zz(e,e.context?new az(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new az(!1,!1,void 0,t))}function sB(e,t,n){return iB(e,n,t)}function cB(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:JM(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function lB(e,t){let{literals:n,parameters:r}=cB(e);return new Cz(n.map(e=>new yz(e,t)),r.map(e=>new Sz(e,t)))}function uB(e){return e.context?.isOptional??!1}function dB(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(dB)}function fB(e){function t(e){return dB(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return dF(n)?n:void 0}var pB=HM(e=>{if(e.encoding)return pB(Xz(e,void 0));let t=e,n=t.recur?.(pB)??t,r=n.encodingChecks;if(r){let t=n===e?r:ez(n)||tz(n)||XR(n)&&n.typeParameters.length>0?fB(r):void 0;return qz(n,e=>{e.encodingChecks.value=void 0,e.checks.value=Ez(n.checks,t)})}return n}),mB=HM(e=>pB(gB(e)));function hB(e,t){let n=t,r=n.length,i=n[r-1],a=[new rz(gB(Xz(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new rz(gB(n[e-1].to),n[e].transformation.flip()));let o=gB(i.to);return o.encoding?Xz(o,[...o.encoding,...a]):Xz(o,a)}var gB=VM(e=>{if(e.encoding)return hB(e,e.encoding);let t=e;return t.flip?.(gB)??t.recur?.(gB)??t});function _B(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(_B);default:return!1}}function vB(e,t){let n=sR(t);return(r,i)=>r===oR?cR:r===t?n:qL(new xR(e,r,i))}function yB(e,t){return(n,r)=>n===oR?cR:t(n)?lR:qL(new xR(e,n,r))}var bB=rB(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(bB)}}),xB=new globalThis.RegExp(`^${_z}$`),SB=new globalThis.RegExp(`^(?:${_z}|Infinity|-Infinity|NaN)$`);function CB(e){return Kz(xB,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:xB.source}),...e})}var wB=eB(dz,[CB()]),TB=new rz(wB,qR),EB=new rz(new Fz([wB,Rz],`anyOf`),qR);function DB(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=DB(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new hR(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function OB(e){if(!XR(e))return;let t=e.annotations?.[aR];return YM(t)?t(e.typeParameters):void 0}function kB(e){let t=LB(VB,pB(e.ast));return(e,n)=>t(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function AB(e){let t=kB(e);return(e,n)=>{let r=eR(t(e,n));return zL(r)?nF(r.value):(kR(r.cause,`Option adapter can only return none for schema issues`),tF())}}function jB(e){let t=kB(e);return(e,n)=>{let r=eR(t(e,n));if(zL(r))return r.value;let i=kR(r.cause,`Constructor adapter can only throw schema issues`);throw Error(`Schema validation failed`,{cause:i})}}function MB(e,t){let n=IB(e.ast);return t===void 0?n:(e,r)=>n(e,PB(t,r))}function NB(e,t){return zB(MB(e,t))}var PB=(e,t)=>t?{...e,...t}:e,FB=e=>e===oR?qL(new SR):GL(e);function IB(e){return LB(BB,e)}function LB(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??iz);return a===lR?GL(r):uL(a)?a[aP]===oR?FB(oR):a:nR(a,FB)}}function RB(e){return(t,n)=>eR(e(t,n))}function zB(e){let t=RB(e);return(e,n)=>{let r=t(e,n);return zL(r)?nF(r.value):(kR(r.cause,`Option adapter can only return none for schema issues`),tF())}}var BB=VM(e=>KB(e,BB)),VB=VM(e=>KB(e,VB,UB)),HB=VM(e=>KB(e,VB,UB,e.context?.constructorDefault));function UB(e){return e.context?.constructorDefault?HB(e):VB(e)}function WB(e,t,n,r){let i;if(uL(e)&&e._tag===`Success`){let a=uR(e===lR?t:e[aP]);i=n._tag===`Transformation`?n.decode.run(a,r):n.decode(sR(a),r)}else i=n._tag===`Transformation`?nR(e,e=>n.decode.run(uR(e),r)):n.decode(tR(e,uR),r);return uL(i)&&i._tag===`Success`?dR(i[aP]):nR(i,dR)}function GB(e,t){let n;return(r,i)=>r===oR?cR:e.isConstructed(r)?lR:WB((n??=t(e.link.to))(r,i),r,e.link.transformation,i)}function KB(e,t,n,r){let i=n?OB(e):void 0,a=i?GB(i,t):e.getParser(t,n),o=e.checks,s=r?e.encoding?[...e.encoding,r]:[r]:e.encoding,c=e.encodingChecks,l=(o?o[o.length-1].annotations:e.annotations)?.parseOptions;if(!s&&!o&&!c)return l?(e,t)=>a(e,PB(t,l)):a;let u,d=(t,n)=>{let r=a(t,n);if(c&&!n.disableChecks){if(uL(r)){if(r._tag===`Success`){let i=r===lR?t:r[aP];if(t!==oR&&i!==oR){let i=DB(c,t,void 0,e,n);i&&(r=qL(new bR(e,i,t,n)))}}}else r=ZL(r,r=>{if(t!==oR&&r!==oR){let r=DB(c,t,void 0,e,n);if(r)return qL(new bR(e,r,t,n))}return GL(r)})}if(o&&!n.disableChecks){if(uL(r)){if(r._tag===`Success`){let i=r===lR?t:r[aP];if(i===oR)return r;let a=DB(o,i,void 0,e,n);a&&(r=qL(new bR(e,a,i,n)))}}else r=ZL(r,t=>{if(t!==oR){let r=DB(o,t,void 0,e,n);if(r)return qL(new bR(e,r,t,n))}return GL(t)})}return r};return s?(n,r)=>{l&&(r=PB(r,l));let i=u??=s.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=s.length-1;e>=0;e--)if(o=WB(o,a,s[e].transformation,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[aP],o=t(a,r)):o=nR(o,e=>{let n=t(e,r);return n===lR?sR(e):n})}if(o._tag===`Success`){let e=o[aP],t=d(e,r);return t===lR?o:t}return o=$L(o,t=>JL(()=>PL(t,t=>new gR(e,t,n,r)))),nR(o,e=>{let t=d(e,r);return t===lR?sR(e):t})}:l?(e,t)=>d(e,PB(t,l)):d}var qB=`~effect/Schema/Schema`,JB={[qB]:qB,pipe(){return PM(this,arguments)},annotate(e){return this.rebuild(Qz(this.ast,e))},annotateKey(e){return this.rebuild(oB(this.ast,e))},check(...e){return this.rebuild(eB(this.ast,e))}};function YB(e,t){function n(){}let r=Object.defineProperties(Object.setPrototypeOf(n,JB),Object.getOwnPropertyDescriptors({...t}));return r.ast=e,r.rebuild=e=>YB(e,t),r.makeEffect=kB(r),r.make=jB(r),r.makeOption=AB(r),r}var XB=NB,ZB=YB,QB=ZB(cz),$B=ZB(dz);function eV(e,t){return ZB(lB(e.ast,t.ast),{key:e,value:t})}function tV(e,t){return n=>ZB(sB(n.ast,e.ast,t?WR(t):KR()),{from:n,to:e})}globalThis.RegExp,globalThis.URL;var nV=$B.annotate({expected:`a string that will be decoded as JSON`,contentMediaType:`application/json`});function rV(e,t){return nV.pipe(tV(e,JR(t)))}globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;var iV=XB(rV(eV($B,QB))),aV={};function oV(e){return e.state.status===`streaming`?iF(iV(e.state.input),()=>aV):e.state.input}function sV(e){return`metadata`in e.state?e.state.metadata??aV:aV}function cV(e){if(e.state.status===`running`){let t=e.state.metadata.output;return typeof t==`string`?t:void 0}if(`content`in e.state&&e.state.content)return e.state.content.flatMap(e=>e.type===`text`?[e.text]:[]).join(`
|
|
715
|
+
`)||void 0}function lV(e){if(e.state.status===`error`)return e.state.error.message}function uV(e){return e.state.status===`error`||e.name===`execute`&&fV(sV(e))||e.name===`shell`&&e.state.status===`completed`&&dV(sV(e))}function dV(e){return e.timeout===!0||typeof e.exit==`number`&&e.exit!==0}function fV(e){let t=e.toolCalls;return e.error===!0||Array.isArray(t)&&t.some(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`status`in e&&e.status===`error`)}function pV(e){if(e.name!==`read`||e.state.status!==`completed`)return!1;let t=e.state.metadata?.loaded;return Array.isArray(t)&&t.some(e=>typeof e==`string`)}function mV(e,t,n){if(e.type!==`tool`)return;if(e.state.status===`error`)return!1;if(e.name===`shell`||e.name===`execute`)return t;if(e.name===`patch`)return n;if(e.name!==`edit`&&e.name!==`write`)return;if(!n)return!1;let r=sV(e).files;return!Array.isArray(r)||r.length===0||!r.every(e=>!!e&&typeof e==`object`&&`status`in e&&e.status===`deleted`)}var hV;(function(e){class t extends bI(`TurnGap`){}e.TurnGap=t;class n extends bI(`UserMessage`){}e.UserMessage=n;class r extends bI(`Shell`){}e.Shell=r;class i extends bI(`Notice`){}e.Notice=i;class a extends bI(`TurnDivider`){}e.TurnDivider=a;class o extends bI(`AssistantPart`){}e.AssistantPart=o;class s extends bI(`Thinking`){}e.Thinking=s;class c extends bI(`Error`){}e.Error=c;class l extends bI(`Retry`){}e.Retry=l,e.key=e=>{switch(e._tag){case`TurnGap`:return`turn-gap:${e.userMessageID}`;case`UserMessage`:return`user-message:${e.userMessageID}`;case`Shell`:return`shell:${e.messageID}`;case`Notice`:return`notice:${e.messageID}`;case`TurnDivider`:return`turn-divider:${e.userMessageID}`;case`AssistantPart`:return`assistant-part:${e.group.type}:${e.group.key}`;case`Thinking`:return`thinking:${e.userMessageID}`;case`Error`:return`error:${e.userMessageID}`;case`Retry`:return`retry:${e.userMessageID}`}return e};function u(e,t){return yN(e,t)}e.equals=u})(hV||={});var gV=[{id:`everything`,value:{shell:{placement:`separate`,details:`expanded`},edit:{placement:`separate`,details:`expanded`},thinking:{placement:`separate`,details:`expanded`},subagents:{placement:`separate`},notices:{placement:`separate`},tools:{placement:`separate`}}},{id:`detailed`,value:{shell:{placement:`separate`,details:`expanded`},edit:{placement:`separate`,details:`expanded`},thinking:{placement:`grouped`,details:`collapsed`},subagents:{placement:`separate`},notices:{placement:`grouped`},tools:{placement:`grouped`}}},{id:`compact`,value:{shell:{placement:`grouped`,details:`collapsed`},edit:{placement:`grouped`,details:`collapsed`},thinking:{placement:`grouped`,details:`collapsed`},subagents:{placement:`grouped`},notices:{placement:`grouped`},tools:{placement:`grouped`}}},{id:`quiet`,value:{shell:{placement:`hidden`,details:`collapsed`},edit:{placement:`grouped`,details:`collapsed`},thinking:{placement:`hidden`,details:`collapsed`},subagents:{placement:`grouped`},notices:{placement:`hidden`},tools:{placement:`hidden`}}},{id:`text-only`,value:{shell:{placement:`hidden`,details:`collapsed`},edit:{placement:`hidden`,details:`collapsed`},thinking:{placement:`hidden`,details:`collapsed`},subagents:{placement:`hidden`},notices:{placement:`hidden`},tools:{placement:`hidden`}}}];function _V(e){if(e.type!==`text`)return e.type===`reasoning`?`thinking`:[`shell`,`execute`,`bash`].includes(e.name)?`shell`:[`edit`,`write`,`patch`,`apply_patch`].includes(e.name)?`edit`:[`subagent`,`task`].includes(e.name)?`subagents`:`tools`}function vV(e){if(e.type===`compaction`)return e.status!==`completed`;if(e.type!==`synthetic`)return!1;let t=e.metadata;return t?.state===`error`||t?.source===`shell`&&t.state===`completed`&&dV(t)}var yV=XB(rV(QB));function bV(e){let t=N(()=>new Map(e.sessionMessages().map(e=>[e.id,e]))),n=N(()=>EV(e.sessionMessages())),r=N(()=>DV(e.sessionMessages())),i=Le(()=>e.sessionMessages().flatMap(e=>e.type===`assistant`?e.content.filter(e=>e.type!==`tool`):[]),e=>[e,N(()=>!!e.text.trim())]),a=N(()=>new Map(i())),o=N(()=>xV.constructSessionMessageRows(e.sessionMessages(),e.reasoningMode()!==`hidden`,e.status(),e.pendingUserMessageIDs?.(),e.shellToolDefaultOpen?.()??!1,e.editToolDefaultOpen?.()??!1,(e,t,n)=>e.type===`tool`?AV(e,t,n):(e.type===`text`||(n?n.thinking.placement!==`hidden`:t))&&a().get(e)(),e.timelineDetail?.())),s=N(()=>o().activeMessageID),c=N(e=>TV(e,o().rows)),l=N(()=>new Map(c().map(e=>[hV.key(e),e]))),u=N(()=>{let e=new Map;return c().forEach((t,n)=>{e.has(t.userMessageID)||e.set(t.userMessageID,n)}),e}),d=N(()=>{let e=new Map;return c().forEach((t,n)=>e.set(t.userMessageID,n)),e});return{activeMessageID:s,assistantMessagesByParent:r,lastAssistantGroupKey:N(()=>{let e=new Map;return c().forEach(t=>{t._tag===`AssistantPart`&&e.set(t.userMessageID,t.group.key)}),e}),messageByID:t,messageRowIndex:u,messageLastRowIndex:d,rowByKey:l,rows:c,sessionMessageByID:t,userContextByID:n}}var xV;(function(e){function t(e,t,r,i,a=!1,o=!1,s=AV,c){let l=[],u=new Map,d=[],f;e.forEach(e=>{if(LV(e)){f&&f.entries.push({type:`notice`,message:e}),f||d.push(e);return}if(e.type===`shell`){let t={id:e.id,time:e.time,shell:e,entries:[]};l.push(t),f=t;return}if(e.type===`user`){if(u.has(e.id))return;let t={id:e.id,time:e.time,user:e,entries:[]};l.push(t),u.set(e.id,t),f=t;return}if(e.type!==`assistant`)return;let t=f?.user?f:void 0;if(t?.user){t.entries.push({type:`assistant`,message:e}),f=t;return}if(f&&!f.user&&!f.shell){f.entries.push({type:`assistant`,message:e});return}let n={id:e.id,time:e.time,entries:[{type:`assistant`,message:e}]};l.push(n),f=n});let p=l.findLast(e=>!i?.has(e.id))?.id??l.at(-1)?.id,m=e=>!c||c.notices.placement!==`hidden`||vV(e),h=c?l.filter(e=>e.user||e.shell&&(c.shell.placement!==`hidden`||CV(e.shell))?!0:e.entries.some(e=>e.type===`notice`?m(e.message):!!e.message.error||!!e.message.retry||e.message.content.some(e=>s(e,t,c)))):l,g=[...d.filter(m).map(e=>new hV.Notice({userMessageID:l[0]?.id??e.id,messageID:e.id})),...h.flatMap((e,i)=>e.shell?[...i>0?[new hV.TurnGap({userMessageID:e.id})]:[],...!c||c.shell.placement!==`hidden`||CV(e.shell)?[new hV.Shell({userMessageID:e.id,messageID:e.shell.id})]:[],...e.entries.flatMap(t=>t.type===`notice`&&m(t.message)?[new hV.Notice({userMessageID:e.id,messageID:t.message.id})]:[])]:n(e.user,e.id,e.entries,i,t,r,e.id===p,a,o,s,c))];return{activeMessageID:p,rows:c?wV(g,c,new Set(e.filter(e=>e.type===`compaction`&&vV(e)).map(e=>e.id))):g}}e.constructSessionMessageRows=t;function n(e,t,n,r,a,o,s,c=!1,l=!1,u=AV,d){let f=[],p=n.flatMap(e=>e.type===`assistant`?[e.message]:[]).at(-1),m=r>0,h=n.some(e=>e.type===`notice`&&e.message.type===`compaction`),g=p?.content.at(-1),_=(d?d.thinking.placement===`separate`:a)&&s&&o.type===`busy`&&p?.time.completed===void 0&&!p?.error&&!p?.retry&&g?.type===`reasoning`&&g.time?.completed===void 0;m&&f.push(new hV.TurnGap({userMessageID:t})),e&&f.push(new hV.UserMessage({userMessageID:t}));let v=0,y=!1,b=e=>{let n=e.flatMap((e,t)=>i(e).filter(e=>u(e.content,a,d)&&!(_&&e.content===g)).map(n=>({messageID:e.id,messageIndex:t,partID:n.id,content:n.content}))),r=e.findIndex(e=>SV(e.error)),o=r<0?n:n.filter(e=>e.messageIndex<=r),m=r<0?[]:n.filter(e=>e.messageIndex>r),b=e=>{let n=0;jV(e,c,l,d).forEach(r=>{let i=r.type!==`part`||e[n]?.content.type!==`text`;n+=r.type===`part`?1:r.refs.length,f.push(new hV.AssistantPart({userMessageID:t,group:r,previousAssistantPart:v>0,spacing:v>0?y&&i?`tool`:`content`:void 0})),v+=1,y=i})};b(o),r>=0&&(!h&&d?.notices.placement!==`hidden`&&f.push(new hV.TurnDivider({userMessageID:t})),b(m)),e.at(-1)===p&&(s&&p?.retry?f.push(new hV.Retry({userMessageID:t})):p?.error&&!SV(p.error)&&f.push(new hV.Error({userMessageID:t,text:FV(p.error.message)})))},x=[];return n.forEach(e=>{switch(e.type){case`assistant`:x.push(e.message);return;case`notice`:if(d?.notices.placement===`hidden`&&!vV(e.message))return;b(x),x=[],f.push(new hV.Notice({userMessageID:t,messageID:e.message.id}))}}),b(x),_&&p&&f.push(new hV.Thinking({userMessageID:t,ref:{messageID:p.id,partID:i(p).at(-1).id}})),f}e.constructMessageRows=n;function r(e,t){if(e?.type!==`assistant`)return;let n={text:0,reasoning:0};for(let r of e.content)if((r.type===`tool`?r.id:`${e.id}:${r.type}:${n[r.type]++}`)===t)return r}e.resolveContent=r;function i(e){let t={text:0,reasoning:0};return e.content.map(n=>({id:n.type===`tool`?n.id:`${e.id}:${n.type}:${t[n.type]++}`,content:n}))}e.contentEntries=i})(xV||={});function SV(e){return e?.type.toLowerCase().includes(`abort`)||e?.type.toLowerCase().includes(`interrupt`)}function CV(e){return e.status===`timeout`||e.status===`exited`&&e.exit!==void 0&&e.exit!==0}function wV(e,t,n){return e.reduce((e,r)=>{let i=e.at(-1),a=(r._tag===`Notice`&&t.notices.placement===`grouped`||r._tag===`Shell`&&t.shell.placement===`grouped`)&&!n.has(r.messageID)?new hV.AssistantPart({userMessageID:r.userMessageID,previousAssistantPart:i?._tag===`AssistantPart`,spacing:i?._tag===`AssistantPart`?`tool`:void 0,group:{type:`context`,key:`message:${r.messageID}`,refs:[{messageID:r.messageID,partID:r.messageID}]}}):r;return i?._tag===`AssistantPart`&&i.group.type===`context`&&a._tag===`AssistantPart`&&a.group.type===`context`&&i.userMessageID===a.userMessageID?(e[e.length-1]=new hV.AssistantPart({...i,group:{...i.group,refs:[...i.group.refs,...a.group.refs]}}),e):(e.push(a),e)},[])}function TV(e,t){if(!e?.length)return t;let n=new Map(e.map(e=>[hV.key(e),e])),r=new Map;e.forEach((e,t)=>{e._tag===`AssistantPart`&&e.group.type!==`part`&&e.group.refs.forEach(n=>r.set(kV(n),{index:t,row:e}))});let i=new Map;t.forEach((e,t)=>{if(e._tag!==`AssistantPart`||e.group.type===`part`)return;let r=hV.key(e);n.has(r)&&!i.has(r)&&i.set(r,t)});let a=new Set,o=t.map((e,t)=>{let o=OV(r,i,e,t,a),s=n.get(hV.key(o));return s&&hV.equals(s,o)?s:o});return e.length===o.length&&e.every((e,t)=>e===o[t])?e:o}function EV(e){let t=new Map,n=``,r={id:``,providerID:``},i;return e.forEach(e=>{if(e.type===`agent-switched`&&(n=e.agent),e.type===`model-switched`&&(r=e.model),e.type===`user`){i=e.id;let a=e.metadata,o=typeof a?.agent==`string`?a.agent:n,s=a?.model,c=s&&typeof s==`object`&&!Array.isArray(s)?typeof s.id==`string`?s.id:typeof s.modelID==`string`?s.modelID:void 0:void 0;t.set(e.id,{agent:o,model:s&&typeof s==`object`&&!Array.isArray(s)&&c&&typeof s.providerID==`string`?{id:c,providerID:s.providerID,variant:typeof s.variant==`string`?s.variant:void 0}:r})}e.type===`shell`&&(i=void 0),e.type===`assistant`&&(n=e.agent,r=e.model,i&&t.set(i,{agent:n,model:r}))}),t}function DV(e){let t=new Map,n;return e.forEach(e=>{if(e.type===`user`&&(n=e.id),e.type===`shell`&&(n=void 0),e.type!==`assistant`)return;n||=e.id;let r=t.get(n);if(r){r.push(e);return}t.set(n,[e])}),t}function OV(e,t,n,r,i){if(n._tag!==`AssistantPart`||n.group.type===`part`)return n;let a=n.group.refs.reduce((n,a)=>{let o=e.get(kV(a));if(!o)return n;let s=hV.key(o.row);if(i.has(s))return n;let c=t.get(s);return c!==void 0&&c!==r?n:!n||o.index<n.index?o:n},void 0);if(!a)return n;let o=hV.key(a.row);return i.add(o),n.group.key===a.row.group.key?n:new hV.AssistantPart({userMessageID:n.userMessageID,previousAssistantPart:n.previousAssistantPart,spacing:n.spacing,group:{...n.group,key:a.row.group.key}})}function kV(e){return`${e.messageID}:${e.partID}`}function AV(e,t,n){return e.type===`text`?!!e.text.trim():e.type===`reasoning`?(n?n.thinking.placement!==`hidden`:t)&&!!e.text.trim():n&&uV(e)?!0:e.name===`todowrite`?!1:e.name===`question`?e.state.status!==`streaming`&&e.state.status!==`running`:!(n&&n[_V(e)].placement===`hidden`)}function jV(e,t,n,r){let i=[],a,o=()=>{let e=a,t=e?.refs[0];if(t){if(!e.tools&&!r){i.push(...e.refs.map(e=>({type:`part`,key:`part:${e.messageID}:${e.partID}`,ref:e}))),a=void 0;return}i.push({type:e.type===`context`?`context`:`file`,key:e.type===`context`?`context:${t.messageID}:${t.partID}`:`part:${t.messageID}:${t.partID}`,refs:e.refs}),a=void 0}};return e.forEach(e=>{let s=e.content.type===`tool`?MV(e.content,t,n,a?.type===`context`&&a.tools,r):e.content.type===`reasoning`?r&&r.thinking.placement!==`grouped`?void 0:`context`:void 0;if(s){a?.type!==s&&o(),a??={type:s,refs:[],tools:!1},a.tools||=e.content.type===`tool`,a.refs.push({messageID:e.messageID,partID:e.partID});return}o(),i.push({type:`part`,key:`part:${e.messageID}:${e.partID}`,ref:{messageID:e.messageID,partID:e.partID}})}),o(),i}function MV(e,t,n,r,i){if(i)return e.name===`question`&&!uV(e)?void 0:i[_V(e)].placement===`grouped`?`context`:uV(e)?void 0:e.name===`patch`?`patch`:e.name===`edit`?`edit`:void 0;if(!(e.name===`question`||pV(e))){if(e.state.status===`error`)return(e.name===`shell`||e.name===`execute`)&&t||(e.name===`edit`||e.name===`write`||e.name===`patch`)&&n?void 0:`context`;if(!(!r&&(e.state.status!==`completed`||`metadata`in e.state&&e.state.metadata?.status===`running`)&&(e.name===`shell`||e.name===`execute`||e.name===`subagent`))){if(mV(e,t,n)!==!0)return`context`;if(e.name===`patch`)return`patch`;if(e.name===`edit`)return`edit`}}}function NV(e){let t=e.replace(/\r\n?/g,`
|
|
716
|
+
`),n=t.match(/<h[1-6][^>]*>([\s\S]*?)<\/h[1-6]>/i);if(n?.[1]){let e=PV(n[1].replace(/<[^>]+>/g,` `));if(e)return e}let r=t.match(/^\s{0,3}#{1,6}[ \t]+(.+?)(?:[ \t]+#+[ \t]*)?$/m);if(r?.[1]){let e=PV(r[1]);if(e)return e}let i=t.match(/^([^\n]+)\n(?:=+|-+)\s*$/m);if(i?.[1]){let e=PV(i[1]);if(e)return e}let a=t.match(/^\s*(?:\*\*|__)(.+?)(?:\*\*|__)\s*$/m);if(a?.[1]){let e=PV(a[1]);if(e)return e}}function PV(e){return e.replace(/`([^`]+)`/g,`$1`).replace(/\[([^\]]+)\]\([^)]+\)/g,`$1`).replace(/[*_~]+/g,``).trim()}function FV(e){let t=e.replace(/^Error:\s*/,``).trim(),n=e=>aF(yV(e)),r=e=>{let t=n(e);return typeof t==`string`?n(t.trim()):t},i=r(t);if(i===void 0){let e=t.indexOf(`{`),n=t.lastIndexOf(`}`);e!==-1&&n>e&&(i=r(t.slice(e,n+1)))}if(!IV(i))return e;let a=IV(i.error)?i.error:void 0;if(a){let e=typeof a.type==`string`?a.type:void 0,t=typeof a.message==`string`?a.message:void 0;if(e&&t)return`${e}: ${t}`;if(t)return t;if(e)return e;let n=typeof a.code==`string`?a.code:void 0;if(n)return n}return(typeof i.message==`string`?i.message:void 0)||(typeof i.error==`string`?i.error:void 0)||e}function IV(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function LV(e){return e.type===`user`||e.type===`assistant`||e.type===`shell`?!1:e.type!==`synthetic`||!!e.description?.trim()||vV(e)}var RV=W(`<div class="flex h-8 w-full items-center gap-3 text-v2-text-text-faint"><span class="h-px min-w-0 flex-1 bg-v2-border-border-strong"></span><span class="flex min-w-0 items-center gap-1 text-[13px] font-[440] leading-text-compact tracking-[-0.04px]"><span class="flex min-w-0 items-center gap-1.5"><bdi dir=auto class=truncate></bdi></span></span><span class="h-px min-w-0 flex-1 bg-v2-border-border-strong">`),zV=W(`<span class="flex size-1.5 shrink-0 items-center justify-center"aria-hidden=true><span class="size-[2.25px] rounded-full bg-current">`),BV=W(`<span data-slot=session-timeline-notice-variant class="shrink-0 capitalize">`);function VV(e){return(()=>{var t=RV(),n=t.firstChild.nextSibling,r=n.firstChild,i=r.firstChild;return K(n,R(H,{get when(){return e.providerID},children:e=>R(cp,{get id(){return e()},class:`text-v2-icon-icon-faint`,"aria-hidden":`true`})}),r),K(i,()=>e.label),K(r,R(H,{get when(){return U(()=>!!(e.variant&&e.variant!=="default"))()?e.variant:void 0},children:e=>[zV(),(()=>{var t=BV();return K(t,e),t})()]}),null),j(()=>G(i,`title`,e.label)),t})()}function HV(e){return{text:e,blocks:[{raw:e,src:e,mode:`full`}]}}function UV(e,t){return!e||e.mode!==t.mode?!1:t.mode===`code`||t.mode===`live`?t.raw.startsWith(e.raw):e.raw===t.raw}function WV(e,t,n){return e&&t===n}function GV(e,t,n,r){return`${e}:${t?`${t}:${n}:${r}`:`block:${n}`}`}function KV(e,t){return e&&t.id<=e.id?e:{id:t.id,generation:(e?.generation??0)+ +!!t.reset,language:t.language,stable:t.reset?t.stable:[...e?.stable??[],...t.stable],unstable:t.unstable}}function qV(e){let t=new Map,n=new Map;return{send(r){if(!t.has(r.key)){t.set(r.key,r),e.post(r);return}let i=n.get(r.key);i&&e.supersede(i),n.set(r.key,r)},complete(r,i){if(t.get(r)?.id!==i)return;t.delete(r);let a=n.get(r);a&&(n.delete(r),t.set(r,a),e.post(a))},dispose(r){t.delete(r);let i=n.get(r);i&&e.supersede(i),n.delete(r)},reset(){n.forEach(e.supersede),n.clear(),t.clear()},queued:()=>n.size}}var JV,YV,XV=0,ZV=new Map,QV=new Map,$V=new Map,eH=new Map,tH=new Set,nH=new Map,rH=qV({post:e=>JV.postMessage(e),supersede:e=>{let t=ZV.get(e.id);t&&(ZV.delete(e.id),t.reject(new dH))}}),iH=qV({post:e=>JV.postMessage(e),supersede:e=>{let t=QV.get(e.id);t&&(QV.delete(e.id),t.reject(new dH))}});function aH(e,t){if(t.aborted)return Promise.reject(new uH);let n=pH(),r=++XV,i=()=>{$V.get(r)?.reject(new uH),$V.delete(r)};return new Promise((a,o)=>{$V.set(r,{resolve:a,reject:o}),t.addEventListener(`abort`,i,{once:!0}),n.postMessage({type:`parse`,id:r,text:e})}).finally(()=>{t.removeEventListener(`abort`,i),$V.delete(r)})}function oH(e,t,n){pH();let r=++XV;return new Promise((i,a)=>{QV.set(r,{key:e,resolve:i,reject:a}),iH.send({type:`project`,id:r,key:e,text:t,live:n})})}function sH(e){iH.dispose(e),QV.forEach((t,n)=>{t.key===e&&(QV.delete(n),t.reject(new uH))}),JV?.postMessage({type:`dispose`,key:e})}function cH(e,t,n,r=!1){pH();let i=++XV;return nH.set(e,i),tH.delete(e),tH.add(e),tH.size>200&&lH(tH.values().next().value),new Promise((a,o)=>{ZV.set(i,{key:e,complete:r,resolve:a,reject:o}),rH.send({type:`highlight`,id:i,key:e,text:t,language:n,complete:r})})}function lH(e){tH.delete(e),nH.delete(e),eH.delete(e),rH.dispose(e),ZV.forEach((t,n)=>{t.key===e&&(ZV.delete(n),t.reject(new uH))}),JV?.postMessage({type:`dispose`,key:e})}var uH=class extends Error{},dH=class extends Error{},fH=class extends Error{};function pH(){if(JV)return JV;if(YV)throw new fH(YV.message);try{JV=new Worker(new URL(`/assets/markdown.worker-DqWDoHOY.js`,``+import.meta.url),{type:`module`})}catch(e){throw YV=e instanceof Error?e:Error(String(e)),new fH(YV.message)}JV.onmessage=e=>{if(e.data.type===`parse`){let t=$V.get(e.data.id);if(!t)return;$V.delete(e.data.id),t.resolve(e.data.html);return}if(e.data.type===`project`){let t=QV.get(e.data.id);if(!t){iH.complete(e.data.key,e.data.id);return}QV.delete(e.data.id),t.resolve(e.data.projection),iH.complete(e.data.key,e.data.id);return}if(e.data.type===`error`){let t=$V.get(e.data.id);if(t){$V.delete(e.data.id),t.reject(Error(e.data.message));return}let n=QV.get(e.data.id);if(n){QV.delete(e.data.id),n.reject(Error(e.data.message)),iH.complete(n.key,e.data.id);return}}if(e.data.type===`superseded`){let t=QV.get(e.data.id);if(t){QV.delete(e.data.id),t.reject(new dH),iH.complete(t.key,e.data.id);return}}let t=e.data.key;if(!t)return;let n=ZV.get(e.data.id);if(!n){rH.complete(t,e.data.id);return}if(ZV.delete(e.data.id),!tH.has(t)){n.reject(new uH),rH.complete(t,e.data.id);return}if(e.data.type===`superseded`){n.reject(new dH),rH.complete(t,e.data.id);return}if(e.data.type===`error`){n.reject(Error(e.data.message)),rH.complete(t,e.data.id);return}let r=KV(eH.get(t),e.data);WV(n.complete,nH.get(t),e.data.id)?(eH.delete(t),tH.delete(t),nH.delete(t)):eH.set(t,r),n.resolve(r),rH.complete(t,e.data.id)};let e=e=>{let t=Error(e);YV=t,rH.reset(),iH.reset(),ZV.forEach(e=>e.reject(t)),QV.forEach(e=>e.reject(t)),$V.forEach(e=>e.reject(t)),ZV.clear(),QV.clear(),$V.clear(),eH.clear(),tH.clear(),nH.clear(),JV?.terminate(),JV=void 0};return JV.onerror=t=>e(t.message||`Markdown highlighting worker failed`),JV.onmessageerror=()=>e(`Markdown worker response failed`),JV}function mH(e,t){return!e||e.language!==t.language||e.generation!==t.generation||t.stableCount<e.stableCount||!t.raw.startsWith(e.raw)}function hH(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var gH=hH();function _H(e){gH=e}var vH={exec:()=>null};function yH(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function bH(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(SH.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var xH=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),SH={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:yH(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:yH(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:yH(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:yH(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:yH(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:yH(e=>RegExp(`^ {0,${e}}>`))},CH=/^(?:[ \t]*(?:\n|$))+/,wH=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,TH=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,EH=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,DH=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,OH=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,kH=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,AH=bH(kH).replace(/bull/g,OH).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),jH=bH(kH).replace(/bull/g,OH).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),MH=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,NH=/^[^\n]+/,PH=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,FH=bH(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,PH).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),IH=bH(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,OH).getRegex(),LH=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,RH=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,zH=bH(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,RH).replace(`tag`,LH).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),BH=e=>bH(MH).replace(`hr`,EH).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,LH).getRegex(),VH=BH(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),HH=BH(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),UH={blockquote:bH(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,HH).getRegex(),code:wH,def:FH,fences:TH,heading:DH,hr:EH,html:zH,lheading:AH,list:IH,newline:CH,paragraph:VH,table:vH,text:NH},WH=bH(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,EH).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,LH).getRegex(),GH={...UH,lheading:jH,table:WH,paragraph:bH(MH).replace(`hr`,EH).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,WH).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,LH).getRegex()},KH={...UH,html:bH(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,RH).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vH,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:bH(MH).replace(`hr`,EH).replace(`heading`,` *#{1,6} *[^
|
|
717
|
+
]`).replace(`lheading`,AH).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},qH=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,JH=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,YH=/^( {2,}|\\)\n(?!\s*$)/,XH=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ZH=/[\p{P}\p{S}]/u,QH=/[\s\p{P}\p{S}]/u,$H=/[^\s\p{P}\p{S}]/u,eU=bH(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,QH).getRegex(),tU=/[\p{Pi}\p{Ps}"']/u,nU=/(?!~)[\p{P}\p{S}]/u,rU=/(?!~)[\s\p{P}\p{S}]/u,iU=/(?:[^\s\p{P}\p{S}]|~)/u,aU=bH(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,xH?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),oU=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,sU=bH(oU,`u`).replace(/punct/g,ZH).getRegex(),cU=bH(oU,`u`).replace(/punct/g,nU).getRegex(),lU=bH(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,tU).replace(/punct/g,ZH).getRegex(),uU=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,dU=bH(uU,`gu`).replace(/notPunctSpace/g,$H).replace(/punctSpace/g,QH).replace(/punct/g,ZH).getRegex(),fU=bH(uU,`gu`).replace(/notPunctSpace/g,iU).replace(/punctSpace/g,rU).replace(/punct/g,nU).getRegex(),pU=bH(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,$H).replace(/punctSpace/g,QH).replace(/punct/g,ZH).getRegex(),mU=bH(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,$H).replace(/punctSpace/g,QH).replace(/punct/g,ZH).getRegex(),hU=bH(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,$H).replace(/punctSpace/g,QH).replace(/punct/g,ZH).getRegex(),gU=bH(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,ZH).getRegex(),_U=bH(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,$H).replace(/punctSpace/g,QH).replace(/punct/g,ZH).getRegex(),vU=bH(/\\(punct)/,`gu`).replace(/punct/g,ZH).getRegex(),yU=bH(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),bU=bH(RH).replace(`(?:-->|$)`,`-->`).getRegex(),xU=bH(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,bU).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),SU=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,CU=bH(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,SU).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wU=bH(/^!?\[(label)\]\[(ref)\]/).replace(`label`,SU).replace(`ref`,PH).getRegex(),TU=bH(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,PH).getRegex(),EU=bH(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,wU).replace(`nolink`,TU).getRegex(),DU=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,OU={_backpedal:vH,anyPunctuation:vU,autolink:yU,blockSkip:aU,br:YH,code:JH,del:vH,delLDelim:vH,delRDelim:vH,emStrongLDelim:sU,emStrongRDelimAst:dU,emStrongRDelimUnd:mU,escape:qH,link:CU,nolink:TU,punctuation:eU,reflink:wU,reflinkSearch:EU,tag:xU,text:XH,url:vH},kU={...OU,emStrongLDelim:lU,emStrongRDelimAst:pU,emStrongRDelimUnd:hU,link:bH(/^!?\[(label)\]\((.*?)\)/).replace(`label`,SU).getRegex(),reflink:bH(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,SU).getRegex()},AU={...OU,emStrongRDelimAst:fU,emStrongLDelim:cU,delLDelim:gU,delRDelim:_U,url:bH(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,DU).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:bH(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,DU).getRegex()},jU={...AU,br:bH(YH).replace(`{2,}`,`*`).getRegex(),text:bH(AU.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},MU={normal:UH,gfm:GH,pedantic:KH},NU={normal:OU,gfm:AU,breaks:jU,pedantic:kU},PU={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},FU=e=>PU[e];function IU(e,t){if(t){if(SH.escapeTest.test(e))return e.replace(SH.escapeReplace,FU)}else if(SH.escapeTestNoEncode.test(e))return e.replace(SH.escapeReplaceNoEncode,FU);return e}function LU(e){try{e=encodeURI(e).replace(SH.percentDecode,`%`)}catch{return null}return e}function RU(e,t){let n=e.replace(SH.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(SH.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(SH.slashPipe,`|`);return n}function zU(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function BU(e){let t=e.split(`
|
|
718
|
+
`),n=t.length-1;for(;n>=0&&SH.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
719
|
+
`)}function VU(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function HU(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function UU(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function WU(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
720
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
721
|
+
`)}var GU=class{options;rules;lexer;constructor(e){this.options=e||gH}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:BU(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=WU(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=zU(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:zU(t[0],`
|
|
722
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:zU(t[0],`
|
|
723
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=zU(t[0],`
|
|
724
|
+
`).split(`
|
|
725
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
726
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
727
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
728
|
+
${s}`:s,r=r?`${r}
|
|
729
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
|
730
|
+
`),o=t.raw+`
|
|
731
|
+
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s,n=`${n}
|
|
732
|
+
${a}`,r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
733
|
+
`+e.join(`
|
|
734
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
735
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=HU(t[2].split(`
|
|
736
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
737
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
738
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
739
|
+
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
740
|
+
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
741
|
+
`+l}u=!l.trim(),r+=p+`
|
|
742
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=BU(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:zU(t[0],`
|
|
743
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=RU(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
744
|
+
`):[],a={type:`table`,raw:zU(t[0],`
|
|
745
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(RU(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:zU(t[0],`
|
|
746
|
+
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
747
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=zU(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=VU(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),UU(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return UU(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},KU=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||gH,this.options.tokenizer=this.options.tokenizer||new GU,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let t={other:SH,block:MU.normal,inline:NU.normal};this.options.pedantic?(t.block=MU.pedantic,t.inline=NU.pedantic):this.options.gfm&&(t.block=MU.gfm,t.inline=this.options.breaks?NU.breaks:NU.gfm),this.tokenizer.rules=t}static get rules(){return{block:MU,inline:NU}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(SH.carriageReturn,`
|
|
748
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(SH.tabCharGlobal,` `).replace(SH.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
749
|
+
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
750
|
+
`)?``:`
|
|
751
|
+
`)+i.raw,n.text+=`
|
|
752
|
+
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
753
|
+
`)?``:`
|
|
754
|
+
`)+i.raw,n.text+=`
|
|
755
|
+
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
756
|
+
`)?``:`
|
|
757
|
+
`)+i.raw,r.text+=`
|
|
758
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
759
|
+
`)?``:`
|
|
760
|
+
`)+i.raw,n.text+=`
|
|
761
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,e.slice(n+1,-1))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,n.slice(r+1,-1)))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},qU=class{options;parser;constructor(e){this.options=e||gH}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(SH.notSpaceStart)?.[0],i=e.replace(SH.endingNewline,``)+`
|
|
762
|
+
`;return r?`<pre><code class="language-`+IU(r)+`">`+(n?i:IU(i,!0))+`</code></pre>
|
|
763
|
+
`:`<pre><code>`+(n?i:IU(i,!0))+`</code></pre>
|
|
764
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
765
|
+
${this.parser.parse(e)}</blockquote>
|
|
766
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
767
|
+
`}hr(e){return`<hr>
|
|
768
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
769
|
+
`+r+`</`+i+`>
|
|
770
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
771
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
772
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
773
|
+
<thead>
|
|
774
|
+
`+t+`</thead>
|
|
775
|
+
`+r+`</table>
|
|
776
|
+
`}tablerow({text:e}){return`<tr>
|
|
777
|
+
${e}</tr>
|
|
778
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
779
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${IU(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=LU(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+IU(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=LU(e);if(i===null)return IU(n);e=i;let a=`<img src="${e}" alt="${IU(n)}"`;return t&&(a+=` title="${IU(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:IU(e.text)}},JU=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},YU=class e{options;renderer;textRenderer;constructor(e){this.options=e||gH,this.options.renderer=this.options.renderer||new qU,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new JU}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},XU=class{options;block;constructor(e){this.options=e||gH}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?KU.lex:KU.lexInline}provideParser(e=this.block){return e?YU.parse:YU.parseInline}},ZU=class{defaults=hH();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=YU;Renderer=qU;TextRenderer=JU;Lexer=KU;Tokenizer=GU;Hooks=XU;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new qU(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new GU(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new XU;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=XU.passThroughHooks.has(n)?e=>{if(this.defaults.async&&XU.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return KU.lex(e,t??this.defaults)}parser(e,t){return YU.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?KU.lex:KU.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?YU.parse:YU.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?KU.lex:KU.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?YU.parse:YU.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
780
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+IU(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},QU=new ZU;function $U(e,t){return QU.parse(e,t)}$U.options=$U.setOptions=function(e){return QU.setOptions(e),$U.defaults=QU.defaults,_H($U.defaults),$U},$U.getDefaults=hH,$U.defaults=gH;function eW(...e){return QU.use(...e),$U.defaults=QU.defaults,_H($U.defaults),$U}$U.use=eW,$U.walkTokens=function(e,t){return QU.walkTokens(e,t)},$U.parseInline=QU.parseInline,$U.Parser=YU,$U.parser=YU.parse,$U.Renderer=qU,$U.TextRenderer=JU,$U.Lexer=KU,$U.lexer=KU.lex,$U.Tokenizer=GU,$U.Hooks=XU,$U.parse=$U,$U.options,$U.setOptions,$U.walkTokens,$U.parseInline,YU.parse,KU.lex;function tW(){return new ZU({renderer:{link({href:e,title:t,text:n}){return`<a href="${e}"${t?` title="${t}"`:``} class="external-link" target="_blank" rel="noopener noreferrer">${n}</a>`}}})}var nW;function rW(e){if(e.length>1024||e.includes(`\\(`)||e.includes(`$$`))return;if(/^[\p{L}\p{N} \t\r\n,.;:!?'"’“”()\-–—…$%]+$/u.test(e)&&!/(?:^|[\r\n])(?:[ \t]|\d|[-])| {2}(?:\r\n?|\n)|www\./.test(e))return e.replace(/\r\n?/g,`
|
|
781
|
+
`).replace(/^\n+|\n+$/g,``).split(/\n{2,}/).filter(Boolean).map(e=>`<p>${e.replace(/["']/g,e=>e===`"`?`"`:`'`)}</p>\n`).join(``);let t=nW??=tW(),n=e.replace(/\r\n?/g,`
|
|
782
|
+
`);if(!/[<|]/.test(n)&&!/^(?:[ \t>\d\[\-=]|#{1,6}(?:[ \t]|$)|[`~]{3}|[+*](?:[ \t]|$)|(?:[*_][ \t]*){3,}$)/m.test(n))return n.replace(/^\n+|\n+$/g,``).split(/\n{2,}/).filter(Boolean).map(e=>`<p>${t.parseInline(e,{async:!1})}</p>\n`).join(``);let r=t.lexer(e),i=!1;if(t.walkTokens(r,e=>{e.type===`code`&&(i=!0)}),!i)return t.parser(r)}function iW(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function aW(e){if(Array.isArray(e))return e}function oW(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function sW(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
783
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cW(e,t){return aW(e)||oW(e,t)||lW(e,t)||sW()}function lW(e,t){if(e){if(typeof e==`string`)return iW(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?iW(e,t):void 0}}var uW=Object.entries,dW=Object.setPrototypeOf,fW=Object.isFrozen,pW=Object.getPrototypeOf,mW=Object.getOwnPropertyDescriptor,hW=Object.freeze,gW=Object.seal,_W=Object.create,vW=typeof Reflect<`u`&&Reflect,yW=vW.apply,bW=vW.construct;hW||=function(e){return e},gW||=function(e){return e},yW||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},bW||=function(e){return new e(...[...arguments].slice(1))};var xW=VW(Array.prototype.forEach),SW=VW(Array.prototype.lastIndexOf),CW=VW(Array.prototype.pop),wW=VW(Array.prototype.push),TW=VW(Array.prototype.splice),EW=Array.isArray,DW=VW(String.prototype.toLowerCase),OW=VW(String.prototype.toString),kW=VW(String.prototype.match),AW=VW(String.prototype.replace),jW=VW(String.prototype.indexOf),MW=VW(String.prototype.trim),NW=VW(Number.prototype.toString),PW=VW(Boolean.prototype.toString),FW=typeof BigInt>`u`?null:VW(BigInt.prototype.toString),IW=typeof Symbol>`u`?null:VW(Symbol.prototype.toString),LW=VW(Object.prototype.hasOwnProperty),RW=VW(Object.prototype.toString),zW=VW(RegExp.prototype.test),BW=HW(TypeError);function VW(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return yW(e,t,n)}}function HW(e){return function(){return bW(e,[...arguments])}}function UW(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:DW;if(dW&&dW(e,null),!EW(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(fW(t)||(t[r]=e),i=e)}e[i]=!0}return e}function WW(e){for(let t=0;t<e.length;t++)LW(e,t)||(e[t]=null);return e}function GW(e){let t=_W(null);for(let r of uW(e)){var n=cW(r,2);let i=n[0],a=n[1];LW(e,i)&&(t[i]=EW(a)?WW(a):a&&typeof a==`object`&&a.constructor===Object?GW(a):a)}return t}function KW(e){switch(typeof e){case`string`:return e;case`number`:return NW(e);case`boolean`:return PW(e);case`bigint`:return FW?FW(e):`0`;case`symbol`:return IW?IW(e):`Symbol()`;case`undefined`:return RW(e);case`function`:case`object`:{if(e===null)return RW(e);let t=e,n=qW(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:RW(e)}return RW(e)}default:return RW(e)}}function qW(e,t){for(;e!==null;){let n=mW(e,t);if(n){if(n.get)return VW(n.get);if(typeof n.value==`function`)return VW(n.value)}e=pW(e)}function n(){return null}return n}function JW(e){try{return zW(e,``),!0}catch{return!1}}var YW=hW(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),XW=hW(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),ZW=hW([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),QW=hW([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),$W=hW(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),eG=hW([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),tG=hW([`#text`]),nG=hW(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),rG=hW(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),iG=hW(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),aG=hW([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),oG=gW(/{{[\w\W]*|^[\w\W]*}}/g),sG=gW(/<%[\w\W]*|^[\w\W]*%>/g),cG=gW(/\${[\w\W]*/g),lG=gW(/^data-[\-\w.\u00B7-\uFFFF]+$/),uG=gW(/^aria-[\-\w]+$/),dG=gW(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fG=gW(/^(?:\w+script|data):/i),pG=gW(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mG=gW(/^html$/i),hG=gW(/^[a-z][.\w]*(-[.\w]+)+$/i),gG=gW(/<[/\w!]/g),_G=gW(/<[/\w]/g),vG=gW(/<\/no(script|embed|frames)/i),yG=gW(/\/>/i),bG={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},xG=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],SG=hW(UW({},xG)),CG=function(){let e={};return xW(xG,t=>{e[t]=gW(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),hW(e)}(),wG=function(){return typeof window>`u`?null:window},TG=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},EG=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},DG=function(e,t,n,r){return LW(e,t)&&EW(e[t])?UW(r.base?GW(r.base):{},e[t],r.transform):n},OG=function(e,t,n){let r=LW(e,t)?e[t]:void 0;return r&&typeof r==`object`?GW(r):n()};function kG(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wG(),t=e=>kG(e);if(t.version=`3.4.14`,t.removed=[],!e||!e.document||e.document.nodeType!==bG.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=qW(d,`cloneNode`),p=qW(d,`remove`),m=qW(d,`nextSibling`),h=qW(d,`childNodes`),g=qW(d,`parentNode`),_=qW(d,`shadowRoot`),v=qW(d,`attributes`),y=o&&o.prototype?qW(o.prototype,`nodeType`):null,b=o&&o.prototype?qW(o.prototype,`nodeName`):null,x=o&&o.prototype?qW(o.prototype,`ownerDocument`):null,S=function(e){return y?y(e):e.nodeType},C=function(e){return b?b(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let w,T=``,E,D=!1,O=0,k=function(){if(O>0)throw BW(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ee=function(e){k(),O++;try{return w.createHTML(e)}finally{O--}},A=function(e){k(),O++;try{return w.createScriptURL(e)}finally{O--}},te=function(){return D||=(E=TG(u,i),!0),E},j=n,M=j.implementation,N=j.createNodeIterator,ne=j.createDocumentFragment,re=j.getElementsByTagName,ie=r.importNode,ae=EG();t.isSupported=typeof uW==`function`&&typeof g==`function`&&M&&M.createHTMLDocument!==void 0;let oe=oG,se=sG,P=cG,ce=lG,le=uG,ue=fG,de=pG,fe=hG,pe=dG,F=null,I=UW({},[...YW,...XW,...ZW,...$W,...tG]),L=null,me=UW({},[...nG,...rG,...iG,...aG]),he=Object.seal(_W(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,_e=null,ve=Object.seal(_W(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ye=!0,be=!0,xe=!1,Se=!0,Ce=!1,we=!0,Te=!1,Ee=!1,De=null,Oe=null,ke=!1,Ae=!1,je=!1,Me=!1,Ne=!0,Pe=!1,Fe=`user-content-`,Ie=!0,Le=!1,Re={},R=null,ze=UW({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Be=null,Ve=UW({},[`audio`,`video`,`img`,`source`,`image`,`track`]),He=null,z=UW({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),B=`http://www.w3.org/1998/Math/MathML`,Ue=`http://www.w3.org/2000/svg`,We=`http://www.w3.org/1999/xhtml`,Ge=We,V=!1,Ke=null,H=UW({},[B,Ue,We],OW),qe=hW([`mi`,`mo`,`mn`,`ms`,`mtext`]),Je=UW({},qe),Ye=hW([`annotation-xml`]),Xe=UW({},Ye),Ze=UW({},[`title`,`style`,`font`,`a`,`script`]),Qe=null,$e=[`application/xhtml+xml`,`text/html`],et=null,tt=null,nt=n.createElement(`form`),rt=function(e){return e instanceof RegExp||e instanceof Function},it=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(tt&&tt===e)return;(!e||typeof e!=`object`)&&(e={}),e=GW(e),Qe=$e.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,et=Qe===`application/xhtml+xml`?OW:DW,F=DG(e,`ALLOWED_TAGS`,I,{transform:et}),L=DG(e,`ALLOWED_ATTR`,me,{transform:et}),Ke=DG(e,`ALLOWED_NAMESPACES`,H,{transform:OW}),He=DG(e,`ADD_URI_SAFE_ATTR`,z,{transform:et,base:z}),Be=DG(e,`ADD_DATA_URI_TAGS`,Ve,{transform:et,base:Ve}),R=DG(e,`FORBID_CONTENTS`,ze,{transform:et}),ge=DG(e,`FORBID_TAGS`,GW({}),{transform:et}),_e=DG(e,`FORBID_ATTR`,GW({}),{transform:et}),Re=LW(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?GW(e.USE_PROFILES):e.USE_PROFILES:!1,ye=e.ALLOW_ARIA_ATTR!==!1,be=e.ALLOW_DATA_ATTR!==!1,xe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=e.SAFE_FOR_TEMPLATES||!1,we=e.SAFE_FOR_XML!==!1,Te=e.WHOLE_DOCUMENT||!1,Ae=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,Me=e.RETURN_TRUSTED_TYPE||!1,ke=e.FORCE_BODY||!1,Ne=e.SANITIZE_DOM!==!1,Pe=e.SANITIZE_NAMED_PROPS||!1,Ie=e.KEEP_CONTENT!==!1,Le=e.IN_PLACE||!1,pe=JW(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:dG,Ge=typeof e.NAMESPACE==`string`?e.NAMESPACE:We,Je=OG(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>UW({},qe)),Xe=OG(e,`HTML_INTEGRATION_POINTS`,()=>UW({},Ye));let t=OG(e,`CUSTOM_ELEMENT_HANDLING`,()=>_W(null));if(he=_W(null),LW(t,`tagNameCheck`)&&rt(t.tagNameCheck)&&(he.tagNameCheck=t.tagNameCheck),LW(t,`attributeNameCheck`)&&rt(t.attributeNameCheck)&&(he.attributeNameCheck=t.attributeNameCheck),LW(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(he.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),gW(he),Ce&&(be=!1),je&&(Ae=!0),Re&&(F=UW({},tG),L=_W(null),Re.html===!0&&(UW(F,YW),UW(L,nG)),Re.svg===!0&&(UW(F,XW),UW(L,rG),UW(L,aG)),Re.svgFilters===!0&&(UW(F,ZW),UW(L,rG),UW(L,aG)),Re.mathMl===!0&&(UW(F,$W),UW(L,iG),UW(L,aG))),ve.tagCheck=null,ve.attributeCheck=null,LW(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ve.tagCheck=e.ADD_TAGS:EW(e.ADD_TAGS)&&(F===I&&(F=GW(F)),UW(F,e.ADD_TAGS,et))),LW(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ve.attributeCheck=e.ADD_ATTR:EW(e.ADD_ATTR)&&(L===me&&(L=GW(L)),UW(L,e.ADD_ATTR,et))),LW(e,`ADD_FORBID_CONTENTS`)&&EW(e.ADD_FORBID_CONTENTS)&&(R===ze&&(R=GW(R)),UW(R,e.ADD_FORBID_CONTENTS,et)),Ie&&(F[`#text`]=!0),Te&&UW(F,[`html`,`head`,`body`]),F.table&&(UW(F,[`tbody`]),delete ge.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw BW(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw BW(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=w;w=e.TRUSTED_TYPES_POLICY;try{T=ee(``)}catch(e){throw w=t,e}}else e.TRUSTED_TYPES_POLICY===null?(w=void 0,T=``):(w===void 0&&(w=te()),w&&typeof T==`string`&&(T=ee(``)));hW&&hW(e),tt=e},U=UW({},[...XW,...ZW,...QW]),at=UW({},[...$W,...eG]),ot=function(e,t,n){return t.namespaceURI===We?e===`svg`:t.namespaceURI===B?e===`svg`&&(n===`annotation-xml`||Je[n]):!!U[e]},st=function(e,t,n){return t.namespaceURI===We?e===`math`:t.namespaceURI===Ue?e===`math`&&Xe[n]:!!at[e]},W=function(e,t,n){return t.namespaceURI===Ue&&!Xe[n]||t.namespaceURI===B&&!Je[n]?!1:!at[e]&&(Ze[e]||!U[e])},ct=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:Ge,tagName:`template`});let n=DW(e.tagName),r=DW(t.tagName);return Ke[e.namespaceURI]?e.namespaceURI===Ue?ot(n,t,r):e.namespaceURI===B?st(n,t,r):e.namespaceURI===We?W(n,t,r):!!(Qe===`application/xhtml+xml`&&Ke[e.namespaceURI]):!1},G=function(e){wW(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw BW(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},lt=function(e,t,n){try{e.removeAttributeNode(t)}catch{try{e.removeAttribute(n)}catch{}}},ut=function(e){pt(e);let t=h(e);if(t){let e=[];xW(t,t=>{wW(e,t)}),xW(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&<(e,r,i)}},dt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}wW(t.removed,{attribute:r||null,from:n});try{r?n.removeAttributeNode(r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Ae||je)try{G(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},ft=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||L[et(i)]||lt(e,r,i)}},pt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();S(e)===bG.element&&ft(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},mt=function(e,t){return we?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},ht=function(e){if(!we)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=S(e);if(n===bG.processingInstruction||n===bG.comment&&zW(_G,e.data)){try{p(e)}catch{}continue}if(n===bG.element){let t=e,n=et(C(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&mt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=h(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},gt=function(e){let t=null,r=null;if(ke)e=`<remove></remove>`+e;else{let t=kW(e,/^[\r\n\t ]+/);r=t&&t[0]}Qe===`application/xhtml+xml`&&Ge===We&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=w?ee(e):e;if(Ge===We)try{t=new l().parseFromString(i,Qe)}catch{}if(!t||!t.documentElement){t=M.createDocument(Ge,`template`,null);try{t.documentElement.innerHTML=V?T:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ge===We?re.call(t,Te?`html`:`body`)[0]:Te?t.documentElement:a},_t=function(e){let t=x?x(e):e.ownerDocument;return N.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},K=function(e){return e=AW(e,oe,` `),e=AW(e,se,` `),e=AW(e,P,` `),e},vt=function(e){e.normalize();let t=x?x(e):e.ownerDocument,n=N.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=K(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&xW(i,e=>{bt(e.content)&&vt(e.content)})},yt=function(e){let t=b?b(e):null;return typeof t!=`string`||et(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},bt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===bG.documentFragment}catch{return!1}},xt=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function St(e,n,r){e.length!==0&&xW(e,e=>{e.call(t,n,r,tt)})}let Ct=function(e,t){return!!(we&&e.hasChildNodes()&&!xt(e.firstElementChild)&&zW(gG,e.textContent)&&zW(gG,e.innerHTML)||we&&e.namespaceURI===We&&SG[t]&&(xt(e.firstElementChild)||typeof e.textContent==`string`&&zW(CG[t],e.textContent))||e.nodeType===bG.processingInstruction||we&&e.nodeType===bG.comment&&zW(_G,e.data))},wt=function(e,t){return e instanceof RegExp?zW(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Tt=function(e,t,n){if(!ge[t]&&jt(t)&&wt(he.tagNameCheck,t))return!1;if(Ie&&!R[t]){let t=g(e),r=h(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,m(e))}}}return G(e),!0},Et=function(e,t,n,r){return e.length===0?t:t===n||t===r?GW(t):t},Dt=function(e,t){return e===t||g(e)!==null?!1:(Le&&pt(e),!0)},Ot=function(e,n){if(St(ae.beforeSanitizeElements,e,null),Dt(e,n))return!0;if(yt(e))return G(e),!0;let r=et(C(e));if(F=Et(ae.uponSanitizeElement,F,I,De),St(ae.uponSanitizeElement,e,{tagName:r,allowedTags:F}),Dt(e,n))return!0;if(Ct(e,r))return G(e),!0;if(ge[r]||!(ve.tagCheck instanceof Function&&ve.tagCheck(r))&&!F[r]){let t=Tt(e,r,n);return t===!1&&St(ae.afterSanitizeElements,e,null),t}if(S(e)===bG.element&&!ct(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&zW(vG,e.innerHTML))return G(e),!0;if(Ce&&e.nodeType===bG.text){let n=K(e.textContent);e.textContent!==n&&(wW(t.removed,{element:e.cloneNode()}),e.textContent=n)}return St(ae.afterSanitizeElements,e,null),!1},kt=function(e,t,r){if(_e[t]||mt(t,e)||Ne&&(t===`id`||t===`name`)&&(r in n||r in nt))return!1;let i=L[t]||ve.attributeCheck instanceof Function&&ve.attributeCheck(t,e);return be&&zW(ce,t)||ye&&zW(le,t)?!0:i?He[t]||zW(pe,AW(r,de,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&jW(r,`data:`)===0&&Be[e]||xe&&!zW(ue,AW(r,de,``))?!0:!r:jt(e)&&wt(he.tagNameCheck,e)&&wt(he.attributeNameCheck,t,e)||t===`is`&&he.allowCustomizedBuiltInElements&&wt(he.tagNameCheck,r)},At=UW({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),jt=function(e){return!At[DW(e)]&&zW(fe,e)},Mt=function(e,t,n,r){if(w&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ee(r);case`TrustedScriptURL`:return A(r)}return r},Nt=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),yt(e)?G(e):CW(t.removed)}catch{dt(n,e)}},Pt=function(e){St(ae.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||yt(e))return;L=Et(ae.uponSanitizeAttribute,L,me,Oe);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0},r=t.length,i=et(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=et(o),u=c,d=o===`value`?u:MW(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,St(ae.uponSanitizeAttribute,e,n),d=n.attrValue,Pe&&(l===`id`||l===`name`)&&jW(d,Fe)!==0&&(dt(o,e,a),d=Fe+d),we&&zW(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){dt(o,e,a);continue}if(l===`attributename`&&kW(d,`href`)){dt(o,e,a);continue}if(!n.forceKeepAttr){if(!n.keepAttr){dt(o,e,a);continue}if(!Se&&zW(yG,d)){dt(o,e,a);continue}if(Ce&&(d=K(d)),!kt(i,l,d)){dt(o,e,a);continue}d=Mt(i,l,s,d),d!==u&&Nt(e,o,s,d)}}St(ae.afterSanitizeAttributes,e,null)},Ft=function(e){let t=null,n=_t(e);for(St(ae.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(St(ae.uponSanitizeShadowNode,t,null),Ot(t,e),Pt(t),bt(t.content)&&Ft(t.content),S(t)===bG.element){let e=_(t);bt(e)&&(It(e),Ft(e))}St(ae.afterSanitizeShadowDOM,e,null)},It=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Ft(e.shadow);continue}let n=e.node,r=S(n)===bG.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&et(e)===`template`){let e=n.content;bt(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);bt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(V=!e,V&&(e=`<!-->`),typeof e!=`string`&&!xt(e)&&(e=KW(e),typeof e!=`string`))throw BW(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ee?(F=De,L=Oe):it(n),(ae.uponSanitizeElement.length>0||ae.uponSanitizeAttribute.length>0)&&(F=GW(F)),ae.uponSanitizeAttribute.length>0&&(L=GW(L)),t.removed=[];let c=Le&&typeof e!=`string`&&xt(e);if(c){ht(e);let t=C(e);if(typeof t==`string`){let n=et(t);if(!F[n]||ge[n])throw ut(e),BW(`root node is forbidden and cannot be sanitized in-place`)}if(yt(e))throw ut(e),BW(`root node is clobbered and cannot be sanitized in-place`);try{It(e)}catch(t){throw ut(e),t}}else if(xt(e))i=gt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===bG.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),It(a);else{if(!Ae&&!Ce&&!Te&&e.indexOf(`<`)===-1)return w&&Me?ee(e):e;if(i=gt(e),!i)return Ae?null:Me?T:``}i&&ke&&G(i.firstChild);let l=c?e:i;try{let e=_t(l);for(;o=e.nextNode();)Ot(o,l),Pt(o),bt(o.content)&&Ft(o.content)}catch(n){throw c&&(ut(e),xW(t.removed,e=>{e.element&&pt(e.element)})),n}if(c)return xW(t.removed,e=>{e.element&&pt(e.element)}),Ce&&vt(e),e;if(Ae){if(Ce&&vt(i),je)for(s=ne.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(L.shadowroot||L.shadowrootmode)&&(s=ie.call(r,s,!0)),s}let u=Te?i.outerHTML:i.innerHTML;return Te&&F[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&zW(mG,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
784
|
+
`+u),Ce&&(u=K(u)),w&&Me?ee(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};it(e),Ee=!0,De=F,Oe=L},t.clearConfig=function(){tt=null,Ee=!1,De=null,Oe=null,w=E,T=``},t.isValidAttribute=function(e,t,n){tt||it({});let r=et(e),i=et(t);return kt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&LW(ae,e)&&wW(ae[e],t)},t.removeHook=function(e,t){if(LW(ae,e)){if(t!==void 0){let n=SW(ae[e],t);return n===-1?void 0:TW(ae[e],n,1)[0]}return CW(ae[e])}},t.removeHooks=function(e){LW(ae,e)&&(ae[e]=[])},t.removeAllHooks=function(){ae=EG()},t}var AG=kG();function jG(e){let t=e.trim().replaceAll(`\\`,`/`);if(!(!t||/[\u0000-\u001f\u007f]/.test(t)||t.startsWith(`//`))){if(/^file:/i.test(t)){if(!URL.canParse(t))return;let e=new URL(t);return e.hostname&&e.hostname!==`localhost`?void 0:MG(e.pathname.replace(/^\/([a-z]:\/)/i,`$1`))}if(!/^[a-z][a-z\d+.-]*:/i.test(t)||/^[a-z]:\//i.test(t))return MG(t)}}function MG(e){try{let t=decodeURIComponent(e);return/[\u0000-\u001f\u007f]/.test(t)||t.startsWith(`//`)||t.startsWith(`\\\\`)?void 0:t}catch{return}}function NG(e){let t=new Map;return{update(n){let r=Array.from(n.querySelectorAll(`img[data-local-image]`)),i=new Set(r.map(e=>e.dataset.localImage));t.forEach((e,n)=>{i.has(n)||(e.controller.abort(),e.url&&URL.revokeObjectURL(e.url),t.delete(n))}),r.forEach(r=>{let i=r.dataset.localImage;if(!i)return;let a=t.get(i),o=a??{controller:new AbortController,result:Promise.resolve(void 0),url:void 0};a||(t.set(i,o),o.result=e(i,o.controller.signal).then(async e=>{if(e&&!o.controller.signal.aborted)return e.type===`image/svg+xml`?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(await e.text())}`:(o.url=URL.createObjectURL(e),o.url)}).catch(()=>void 0)),o.result.then(e=>{e&&!o.controller.signal.aborted&&n.contains(r)&&r.dataset.localImage===i&&(r.src=e)})})},dispose(){t.forEach(e=>{e.controller.abort(),e.url&&URL.revokeObjectURL(e.url)}),t.clear()}}}var PG=200,FG=new Map,IG=new Map,LG=typeof window<`u`?AG(window):AG,RG={USE_PROFILES:{html:!0,mathMl:!0},SANITIZE_NAMED_PROPS:!0,FORBID_TAGS:[`style`],FORBID_CONTENTS:[`style`,`script`],ADD_TAGS:[`svg`,`path`],ADD_ATTR:[`d`,`viewBox`,`preserveAspectRatio`,`xmlns`,`target`]};typeof window<`u`&&LG.isSupported&&(LG.addHook(`beforeSanitizeAttributes`,e=>{if(!(e instanceof HTMLImageElement))return;e.removeAttribute(`data-local-image`);let t=jG(e.getAttribute(`src`)??``);t&&(e.setAttribute(`data-local-image`,t),e.removeAttribute(`src`),e.removeAttribute(`srcset`))}),LG.addHook(`afterSanitizeAttributes`,e=>{if(!(e instanceof HTMLAnchorElement)||e.target!==`_blank`)return;let t=e.getAttribute(`rel`)??``,n=new Set(t.split(/\s+/).filter(Boolean));n.add(`noopener`),n.add(`noreferrer`),e.setAttribute(`rel`,Array.from(n).join(` `))}));function zG(e){return LG.isSupported?LG.sanitize(e,RG):``}function BG(e){return FG.get(e)}function VG(e,t){if(FG.delete(e),FG.set(e,t),FG.size<=PG)return;let n=FG.keys().next().value;n&&FG.delete(n)}function HG(e,t){let n=t?BG(t):void 0;if(t&&n?.raw===e.raw)return IG.delete(t),VG(t,n),n;if(LG.isSupported)try{let n=rW(e.src);if(n===void 0)return;let r=Zp(e.raw),i={raw:e.raw,hash:r??``,html:zG(n)};return t&&r&&(IG.delete(t),VG(t,i)),i}catch{return}}async function UG(e,t,n){if(n?.aborted)throw new uH;let r=t?BG(t):void 0;if(t&&r?.raw===e.raw)return IG.delete(t),VG(t,r),r;let i=t?IG.get(t):void 0,a=i?.raw===e.raw?i:WG(e,t),o=Symbol();return a.consumers.add(o),new Promise((e,r)=>{let i=()=>{n?.removeEventListener(`abort`,s),!(!a.consumers.delete(o)||a.consumers.size>0)&&(a.controller.abort(),t&&IG.get(t)===a&&IG.delete(t))},s=()=>{i(),r(new uH)};n?.addEventListener(`abort`,s,{once:!0}),a.promise.then(e,r).finally(i)})}function WG(e,t){let n=new AbortController,r=aH(e.src,n.signal).then(i=>{if(n.signal.aborted)throw new uH;let a=Zp(e.raw),o={raw:e.raw,hash:a??``,html:zG(i)};return t&&a&&IG.get(t)?.promise===r&&VG(t,o),o}).finally(()=>{t&&IG.get(t)?.promise===r&&IG.delete(t)}),i={raw:e.raw,promise:r,controller:n,consumers:new Set};return t&&IG.set(t,i),i}var GG=new Set(`a51,abap,abnf,action,ada,adb,adml,admx,ado,adoc,adp,ads,afm,agc,agda,ahk,ahkl,aidl,aj,ak,al,alg,als,ampl,angelscript,anim,ant,antlers.html,antlers.php,antlers.xml,apacheconf,apex,apib,apl,app,app.src,applescript,arc,arpa,arr,as,asax,asc,asciidoc,ascx,asd,asddls,ash,ashx,asl,asm,asmx,asn,asn1,asp,aspx,asset,astro,asy,au3,aug,auk,aux,avdl,avsc,aw,awk,axaml,axd,axi,axi.erb,axml,axs,axs.erb,b,bal,baml,bas,bash,bat,bats,bb,bbappend,bbclass,bbx,bdf,bdy,be,befunge,bf,bi,bib,bibtex,bicep,bicepparam,bison,blade,blade.php,blp,bmx,bones,boo,boot,bpl,bqn,brd,bro,brs,bru,bs,bsl,bst,bsv,builder,builds,bzl,c,c++,c++-objdump,c++objdump,c-objdump,c3,cabal,caddyfile,cairo,cake,capnp,carbon,cats,cbl,cbx,cc,ccp,ccproj,ccxml,cdc,cdf,cds,ceylon,cfc,cfg,cfm,cfml,cgi,cginc,ch,chem,chpl,chs,cil,circom,cirru,cj,cjs,cjsx,ck,cl,cl2,clar,click,clixml,clj,cljc,cljs,cljs.hl,cljscm,cljx,clp,cls,clue,clw,cmake,cmake.in,cmd,cmp,cnc,cnf,cob,cobol,cocci,code-snippets,code-workspace,coffee,coffee.md,com,command,conll,conllu,container,containerfile,cook,coq,cp,cpp,cpp-objdump,cppm,cppobjdump,cproject,cps,cpy,cql,cr,crc32,creole,cs,cs.pp,csc,cscfg,csd,csdef,csh,cshtml,csl,cson,csproj,css,csv,csx,ct,ctl,ctp,cts,cu,cue,cuh,curry,cw,cwl,cxx,cxx-objdump,cy,cylc,cyp,cypher,d,d-objdump,d2,dae,darcspatch,dart,das,dats,db2,dcl,ddl,decls,depproj,desktop,desktop.in,dfm,dfy,dhall,di,diff,dircolors,dita,ditamap,ditaval,djs,dll.config,dlm,dm,do,dockerfile,dof,doh,dot,dotsettings,dpatch,dpr,druby,dsc,dsl,dsp,dsr,dtx,duby,dwl,dyalog,dyl,dylan,dzn,e,eam.fs,eb,ebnf,ebuild,ec,ecl,eclass,eclxml,ecr,ect,edc,edge,edgeql,editorconfig,edn,eh,ejs,ejs.t,el,eliom,eliomi,elm,elv,em,emacs,emacs.desktop,emberscript,eml,env,epj,eps,epsi,eq,erb,erb.deface,erl,es,es6,escript,esdl,ex,exs,eye,f,f03,f08,f77,f90,f95,factor,fan,fancypack,fbs,fcgi,fea,feature,filters,fir,fish,flex,flf,flix,flux,fnc,fnl,for,forth,fp,fpp,fr,frag,frg,frm,frt,fs,fsh,fshader,fsi,fsproj,fst,fsti,fsx,fth,ftl,ftlh,fun,fut,fx,fxh,fxml,fy,g,g4,gaml,gap,gawk,gbl,gbo,gbp,gbr,gbs,gco,gcode,gd,gdb,gdbinit,gdnlib,gdns,gdshader,gdshaderinc,ged,gemspec,geo,geojson,geom,gf,gi,gitconfig,gitignore,gjs,gko,glade,gleam,glf,glsl,glslf,glslv,gltf,glyphs,gmi,gml,gms,gmx,gn,gni,gnu,gnuplot,go,god,gohtml,golo,gotmpl,gp,gpb,gpt,gpx,gql,grace,gradle,gradle.kts,graphql,graphqls,groovy,grt,grxml,gs,gsc,gsh,gshader,gsp,gst,gsx,gtkrc,gtl,gto,gtp,gtpl,gts,gv,gvy,gyp,gypi,h,h++,h.in,ha,hack,haml,haml.deface,handlebars,har,hats,hb,hbs,hc,hcl,heex,hh,hhi,hic,hip,hlean,hlsl,hlsli,hocon,hoon,hpp,hqf,hql,hrl,hs,hs-boot,hsc,hta,htm,html,html.eex,html.hl,html.tmpl,http,hurl,hx,hxml,hxsl,hxx,hy,hzp,i,i3,i7x,ical,ice,iced,icl,icls,ics,idc,idr,ig,ihlp,ijm,ijs,ik,il,ily,imba,iml,inc,ini,ink,inl,ino,ins,intr,io,iol,ipf,ipp,ipynb,irclog,isl,ispc,iss,iuml,ivy,ixx,j,j2,jac,jade,jai,jake,janet,jav,java,javascript,jbuilder,jcl,jelly,jflex,jinja,jinja2,jison,jisonlex,jl,jq,js,js.erb,jsb,jscad,jsfl,jsh,jslib,jsm,json,json-tmlanguage,json.example,json5,jsonc,jsonl,jsonld,jsonnet,jsp,jspre,jsproj,jss,jst,jsx,jte,just,k,kak,kdl,kicad_mod,kicad_pcb,kicad_sch,kicad_sym,kicad_wks,kid,kit,kk,kml,kojo,kql,krl,ks,ksh,ksy,kt,ktm,kts,kv,l,lagda,langium,lark,las,lasso,lasso8,lasso9,latte,launch,lbx,ld,lds,lean,leex,lektorproject,leo,less,lex,lfe,lgt,lhs,libsonnet,lid,lidr,ligo,linq,liq,liquid,lisp,litcoffee,livecodescript,livemd,lkml,ll,lmi,lock,lockb,logtalk,lol,lookml,lp,lpr,ls,lsl,lslp,lsp,ltx,lua,luau,lvclass,lvlib,lvproj,ly,m,m2,m3,m3u,m3u8,m4,ma,mak,make,makefile,mako,man,mao,markdown,marko,mask,mat,mata,matah,mathematica,matlab,mawk,maxhelp,maxpat,maxproj,mbox,mbt,mc,mcfunction,mch,mcmeta,mcr,md,md2,md4,md5,mdoc,mdown,mdpolicy,mdwn,mdx,me,mediawiki,mermaid,meta,metal,metta,mg,minid,mint,mir,mirah,mjml,mjs,mk,mkd,mkdn,mkdown,mkfile,mkii,mkiv,mkvi,ml,ml4,mli,mligo,mlir,mll,mly,mm,mmd,mmk,mms,mo,mod,mojo,monkey,monkey2,moo,moon,mount,move,mpl,mps,mq4,mq5,mqh,mrc,ms,msd,msg,mspec,mss,mt,mtl,mtml,mts,mu,mud,muf,mumps,muse,mustache,mxml,mxt,mysql,myt,mzn,n,nanorc,nas,nasl,nasm,natvis,nawk,nb,nbp,nc,ncl,ndproj,ne,nearley,ned,neon,network,nf,nginx,nginxconf,ni,nim,nim.cfg,nimble,nimrod,nims,ninja,nit,nix,njk,njs,nl,nlogo,no,nomad,nproj,nqp,nr,nse,nsh,nsi,nss,nu,numpy,numpyw,numsc,nuspec,nut,ny,ob2,obj,objdump,odd,odin,ol,omgrofl,ooc,opa,opal,opencl,opy,orc,org,os,osm,outjob,overpassql,owl,ox,oxh,oxo,oxygene,oz,p,p4,p6,p6l,p6m,p8,pac,pact,pan,parrot,pas,pascal,pasm,pat,patch,pb,pbi,pbt,pbtxt,pc,pc.in,pcbdoc,pck,pcss,pd,pd_lua,pddl,pde,peggy,pegjs,pep,per,perl,pfa,pgsql,ph,php,php3,php4,php5,phps,phpt,phtml,pic,pig,pike,pir,pkb,pkgproj,pkl,pks,pl,pl6,plantuml,plb,plist,plot,pls,plsql,plt,pluginspec,plx,pm,pm6,pml,pmod,po,pod,pod6,podsl,podspec,pogo,polar,pony,por,postcss,pot,pov,pp,pprx,pq,praat,prawn,prc,prefab,prefs,prg,pri,prisma,prjpcb,pro,proj,prolog,properties,props,proto,prw,ps,ps1,ps1xml,psc,psc1,psd1,psgi,psm1,pt,pub,pubxml,pug,puml,purs,pwn,pxd,pxi,py,py3,pyde,pyi,pyp,pyt,pytb,pyw,pyx,q,qasm,qbs,qc,qhelp,ql,qll,qmd,qml,qnt,qs,r,r2,r3,rabl,rake,raku,rakumod,raml,rascript,raw,razor,rb,rbbas,rbfrm,rbi,rbmnu,rbres,rbs,rbtbar,rbuild,rbuistate,rbw,rbx,rbxs,rchit,rd,rdf,rdoc,re,reb,rebol,red,reds,reek,reg,regex,regexp,rego,rei,religo,res,resi,resource,rest,rest.txt,resx,rex,rexx,rg,rhtml,ring,riot,rkt,rktd,rktl,rl,rmd,rmiss,rnh,rno,rnw,robot,roc,rockspec,roff,ron,ronn,rpgle,rpy,rq,rs,rs.in,rsc,rsh,rss,rst,rst.txt,rsx,rtf,ru,ruby,rviz,s,sage,sagews,sail,sarif,sas,sass,sats,sbatch,sbt,sc,scad,scala,scaml,scd,sce,scenic,sch,schdoc,sci,scm,sco,scpt,scrbl,scss,scxml,sdc,sed,self,service,sexp,sfd,sfproj,sfv,sh,sh-session,sh.in,sha1,sha2,sha224,sha256,sha256sum,sha3,sha384,sha512,shader,shen,shproj,sieve,sig,sj,sjs,sl,slang,sld,slim,slint,sln,slnlaunch,slnx,sls,slurm,sma,smali,smithy,smk,sml,smt,smt2,snakefile,snap,snip,snippet,snippets,socket,sol,soy,sp,sparql,spc,spec,spin,sps,sqf,sql,sqlrpgle,sra,srdf,srt,sru,srv,srw,ss,ssjs,sss,st,stan,star,sthlp,stl,ston,story,storyboard,sttheme,sty,styl,sublime-build,sublime-color-scheme,sublime-commands,sublime-completions,sublime-keymap,sublime-macro,sublime-menu,sublime-mousemap,sublime-project,sublime-settings,sublime-snippet,sublime-syntax,sublime-theme,sublime-workspace,sublime_metrics,sublime_session,sum,surql,sv,svelte,svg,svh,svx,sw,swg,swift,swig,syntax,t,tab,tac,tact,tag,talon,target,targets,tcc,tcl,tcl.in,tcsh,te,tea,templ,tesc,tese,tex,texi,texinfo,textgrid,textile,textproto,tf,tfstate,tfstate.backup,tftpl,tfvars,thor,thrift,thy,timer,tl,tla,tlv,tm,tmac,tmcommand,tmdl,tml,tmlanguage,tmpl,tmpreferences,tmsnippet,tmtheme,tmux,toc,tofu,toit,toml,toml.example,tool,topojson,tpb,tpl,tpp,tps,tres,trg,trigger,ts,tscn,tsconfig.json,tsp,tst,tsv,tsx,ttl,tu,twig,txi,txl,txt,txtpb,txx,typ,uc,udf,udo,ui,unity,uno,upc,uplc,ur,urdf,url,urs,ux,v,vala,vapi,vark,vb,vba,vbhtml,vbproj,vbs,vcf,vcl,vcxproj,vdf,veo,vert,vh,vhd,vhdl,vhf,vhi,vho,vhost,vhs,vht,vhw,vim,vimrc,viw,vmb,vmf,volt,vrx,vs,vsh,vshader,vsixmanifest,vssettings,vstemplate,vtl,vto,vtt,vue,vw,vxml,vy,w,wast,wat,watchr,wdl,webapp,webidl,webmanifest,weechatlog,wgsl,whiley,wiki,wikitext,wisp,wit,wixproj,wl,wlk,wls,wlt,wlua,workbook,workflow,wren,ws,wsdl,wsf,wsgi,wxi,wxl,wxs,x,x10,x3d,x68,xacro,xaml,xbm,xc,xdc,xht,xhtml,xi,xib,xlf,xliff,xm,xmi,xml,xml.dist,xmp,xojo_code,xojo_menu,xojo_report,xojo_script,xojo_toolbar,xojo_window,xpl,xpm,xproc,xproj,xpy,xq,xql,xqm,xquery,xqy,xrl,xs,xsd,xsh,xsjs,xsjslib,xsl,xslt,xsp-config,xsp.metadata,xspec,xtend,xul,xzap,y,yacc,yaml,yaml-tmlanguage,yaml.sed,yang,yap,yar,yara,yasnippet,yml,yml.mysql,yrl,yul,yy,yyp,z3,zap,zcml,zed,zeek,zep,zig,zig.zon,zil,zimpl,zmodel,zmpl,zone,zpl,zs,zsh,zsh-theme`.split(`,`)),KG=new Set(`.abbrev_defs,.ackrc,.all-contributorsrc,.arcconfig,.atomignore,.auto-changelog,.babelignore,.babelrc,.bash_aliases,.bash_functions,.bash_history,.bash_logout,.bash_profile,.bashrc,.browserslistrc,.buckconfig,.bzrignore,.c8rc,.ckignore,.clang-format,.clang-tidy,.clangd,.classpath,.coffeelintignore,.coveragerc,.cshrc,.curlrc,.cvsignore,.dir_colors,.dockerignore,.easignore,.eleventyignore,.env.ci,.env.dev,.env.development,.env.development.local,.env.example,.env.local,.env.prod,.env.production,.env.sample,.env.staging,.env.template,.env.test,.env.testing,.envrc,.eslint-ignore,.eslintignore,.exrc,.factor-boot-rc,.factor-rc,.flake8,.flaskenv,.gclient,.gemrc,.git-blame-ignore-revs,.gitattributes,.gitmodules,.gnus,.gvimrc,.htaccess,.htmlhintrc,.ignore,.imgbotconfig,.inputrc,.irbrc,.jscsrc,.jshintrc,.jslintrc,.justfile,.kshrc,.latexmkrc,.login,.luacheckrc,.markdownlintignore,.nodemonignore,.npmignore,.npmrc,.nvimrc,.nycrc,.php_cs,.php_cs.dist,.prettierignore,.profile,.project,.pryrc,.pylintrc,.rgignore,.rprofile,.rspec,.scalafix.conf,.scalafmt.conf,.shellcheckrc,.simplecov,.spacemacs,.stylelintignore,.swcrc,.tern-config,.tern-project,.tgitconfig,.tm_properties,.tmux.conf,.vercelignore,.viper,.vscodeignore,.watchmanconfig,.wgetrc,.xcompose,.xinitrc,.xsession,.yardopts,.zlogin,.zlogout,.zprofile,.zshenv,.zshrc,9fs,_curlrc,_dir_colors,_dircolors,_emacs,_redirects,_vimrc,abbrev_defs,ack,ackrc,android.bp,apache2.conf,apkbuild,app.config,appraisals,bash_aliases,bash_logout,bash_profile,bashrc,berksfile,brewfile,browserslist,bsdmakefile,buck,build,build.bazel,buildfile,cabal.config,cabal.project,caddyfile,cakefile,capfile,cargo.toml.orig,cask,citation,citation.cff,citations,cksums,codeowners,commit_editmsg,config.worktree,configure.ac,containerfile,contents.lr,copying,cpanfile,crontab,cshrc,dangerfile,deliverfile,deps,dir_colors,dockerfile,dune-project,earthfile,eask,emakefile,encodings.dir,eqnrc,expr-dist,fakefile,fastfile,file_contexts,firestore.rules,fontlog,fonts.alias,fonts.dir,fonts.scale,fp-lib-table,gemfile,genfs_contexts,gitignore-global,gitignore_global,gnumakefile,go.work,gradlew,gtkrc,gtkrc-2.0,guardfile,gvimrc,hosts,httpd.conf,initial_sids,inputrc,install,jakefile,jarfile,jenkinsfile,justfile,kakrc,kbuild,kshrc,latexmkrc,ld.script,license,login,m3makefile,m3overrides,makefile,makefile.am,makefile.in,man,manifest.mf,mavenfile,mcmod.info,md5sums,meson.build,mkfile,mmn,mmt,mocha.opts,module.bazel,modulefile,mvnw,nanorc,news,nextflow.config,nginx.conf,notebook,nuget.config,nukefile,nvimrc,owh,package.resolved,packages.config,phakefile,pipfile,pkgbuild,podfile,port_contexts,procfile,profile,project.ede,project.godot,puppetfile,pylintrc,rakefile,readme.1st,rebar.config,rexfile,riemann.config,root,sconscript,sconstruct,security_classes,settings.stylecop,sha1sums,sha256sums,sha512sums,singularity,slakefile,snakefile,snapfile,ssh-config,ssh_config,sshconfig,sshd-config,sshd_config,starfield,steepfile,suite.rc,thorfile,tiltfile,tmux.conf,torrc,troffrc,troffrc-end,vagrantfile,vimrc,vlcrc,web.config,web.debug.config,web.release.config,workspace,workspace.bazel,workspace.bzlmod,wscript,xcompose,xinitrc,xsession,zlogin,zlogout,zprofile,zshenv,zshrc`.split(`,`)),qG=new Set(`9fs._curlrc._dir_colors._dircolors._emacs._redirects._vimrc.abbrev_defs.ack.ackrc.apkbuild.appraisals.bash_aliases.bash_logout.bash_profile.bashrc.berksfile.brewfile.browserslist.bsdmakefile.buck.build.buildfile.caddyfile.cakefile.capfile.cask.citation.citations.cksums.codeowners.commit_editmsg.containerfile.copying.cpanfile.crontab.cshrc.dangerfile.deliverfile.deps.dir_colors.dockerfile.dune-project.earthfile.eask.emakefile.eqnrc.expr-dist.fakefile.fastfile.file_contexts.fontlog.fp-lib-table.gemfile.genfs_contexts.gitignore-global.gitignore_global.gnumakefile.gradlew.gtkrc.guardfile.gvimrc.hosts.initial_sids.inputrc.install.jakefile.jarfile.jenkinsfile.justfile.kakrc.kbuild.kshrc.latexmkrc.license.login.m3makefile.m3overrides.makefile.man.mavenfile.md5sums.mkfile.mmn.mmt.modulefile.mvnw.nanorc.news.notebook.nukefile.nvimrc.owh.phakefile.pipfile.pkgbuild.podfile.port_contexts.procfile.profile.puppetfile.pylintrc.rakefile.rexfile.root.sconscript.sconstruct.security_classes.sha1sums.sha256sums.sha512sums.singularity.slakefile.snakefile.snapfile.ssh-config.ssh_config.sshconfig.sshd-config.sshd_config.starfield.steepfile.thorfile.tiltfile.torrc.troffrc.troffrc-end.vagrantfile.vimrc.vlcrc.workspace.wscript.xcompose.xinitrc.xsession.zlogin.zlogout.zprofile.zshenv.zshrc`.split(`.`));function JG(e){if(/^https?:\/\//i.test(e))return`url`;if(!/^[a-z][a-z0-9+.-]*:\/\//i.test(e)&&e!==`/`&&!/^\/[a-z][a-z0-9-]*$/i.test(e)&&!/\s/.test(e)&&!/[()\[\]{}*+=<>|&^"';]/.test(e)&&(/[/\\]/.test(e)||/^\.\.?[/\\]/.test(e)||YG(e)||XG(e)))return`path`}function YG(e){let t=e.toLowerCase();if(t.endsWith(`.d.ts`))return!0;let n=t.lastIndexOf(`.`);return n!==-1&&GG.has(t.slice(n+1))}function XG(e){let t=e.toLowerCase();if(KG.has(t))return!0;let n=t.indexOf(`.`);return n!==-1&&qG.has(t.slice(0,n))}var ZG,QG=0;async function $G(e){let t=await(ZG??=eK());if(await t.parse(e,{suppressErrors:!0}))return(await t.render(`markdown-mermaid-${QG++}`,e)).svg}async function eK(){let{default:e}=await Y(async()=>{let{default:e}=await import(`./mermaid.core-BDe6Tfbh.js`);return{default:e}},__vite__mapDeps([125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142]));return e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:document.documentElement.dataset.colorScheme===`light`?`default`:`dark`,flowchart:{htmlLabels:!1}}),e}var tK=W(`<span data-markdown-word>`);function nK(e,t,n){let[r,i]=$t(iK(t,n)),a=!1,o=st(()=>R(V,{each:r,children:e=>R(rK,{node:e,animate:()=>a})}),e);return a=!0,{update(e,t,n=!0){i(rn(iK(e,t,n),{key:`key`}))},dispose:o}}function rK(e){let t=e.node;if(t.type===`text`)return t.text;if(t.type===`word`){let n;return se(()=>{e.animate()&&t.animate&&n?.setAttribute(`data-markdown-enter`,``)}),(()=>{var e=tK(),r=n;return typeof r==`function`?_t(r,e):n=e,K(e,()=>t.text),e})()}return R(Pt,z({get component(){return t.tag}},()=>t.attributes,{get children(){return R(V,{get each(){return t.children},children:t=>R(rK,{node:t,get animate(){return e.animate}})})}}))}function iK(e,t,n=!1){let r=document.createElement(`template`);return r.innerHTML=e,Array.from(r.content.childNodes).flatMap((e,r)=>aK(e,`${r}`,t,n))}function aK(e,t,n,r){return e instanceof Text?n?e.data.split(/(\s+)/).flatMap((e,n)=>e?/^\s+$/.test(e)?[{key:`${t}:${n}`,type:`text`,text:e}]:[{key:`${t}:${n}`,type:`word`,text:e,...r?{animate:!0}:{}}]:[]):[{key:t,type:`text`,text:e.data}]:e instanceof Element?[{key:t,type:`element`,tag:e.tagName.toLowerCase(),attributes:Object.fromEntries(Array.from(e.attributes).map(e=>[e.name,e.value])),children:Array.from(e.childNodes).flatMap((e,i)=>aK(e,`${t}.${i}`,n,r))}]:[]}var oK=I(),sK=()=>L(oK),cK=W(`<div data-component=markdown dir=auto>`),lK=new WeakMap,uK=new WeakMap;function dK(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function fK(e){return dK(e).replace(/\r\n?/g,`
|
|
785
|
+
`).replace(/\n/g,`<br>`)}async function pK(e,t,n,r=!1){try{let i=await cH(n,e,t??`text`,r);return{language:i.language,generation:i.generation,stable:i.stable,unstable:i.unstable}}catch(n){return!(n instanceof uH)&&!(n instanceof dH)&&!(n instanceof fH)&&console.error(`Markdown highlighting worker failed`,n),{language:t??`text`,generation:0,stable:[],unstable:[[e,``]]}}}var mK=new WeakMap,hK=/^https?:\/\/[^\s<>()`"']+$/;function gK(e){let t=e.trim().replace(/[),.;!?]+$/,``);if(hK.test(t))try{return new URL(t).toString()}catch{return}}function _K(e){let t=document.createElement(`div`);t.setAttribute(`data-slot`,`markdown-copy-button`);let n={};return n.dispose=st(()=>{let[t,r]=A(e,{equals:!1}),[i,a]=A(!1);return n.setLabels=r,n.setCopied=a,R(vK,{get labels(){return t()},get copied(){return i()}})},t),mK.set(t,n),t}function vK(e){let t=()=>e.copied?e.labels.copied:e.labels.copy;return R(wl,{placement:`top`,get value(){return t()},get children(){return R(zo,{type:`button`,size:`normal`,variant:`ghost-muted`,get"aria-label"(){return t()},get icon(){return[R(Fo,{name:`outline-copy`,"data-copy-icon":!0}),R(Fo,{name:`check`,"data-check-icon":!0})]}})}})}function yK(e,t,n){let r=mK.get(e);if(r?.setLabels(t),r?.setCopied(n),n){e.setAttribute(`data-copied`,`true`);return}e.removeAttribute(`data-copied`)}function bK(e){mK.get(e)?.dispose(),mK.delete(e)}function xK(e){[...e instanceof HTMLElement&&e.getAttribute(`data-slot`)===`markdown-copy-button`?[e]:[],...Array.from(e.querySelectorAll(`[data-slot="markdown-copy-button"]`)).filter(e=>e instanceof HTMLElement)].forEach(bK)}function SK(e){[...e instanceof HTMLDivElement&&e.hasAttribute(`data-markdown-block`)?[e]:[],...Array.from(e.querySelectorAll(`[data-markdown-block]`))].forEach(e=>{uK.get(e)?.renderer.dispose(),uK.delete(e)})}var CK=new Set([`bash`,`sh`,`shell`,`zsh`,`fish`,`console`,`terminal`]);function wK(e){let t=e?.toLowerCase();if(t&&CK.has(t))return`shell`}function TK(e,t){t?e.dataset.language=t:delete e.dataset.language;let n=wK(t);n?e.dataset.codeKind=n:delete e.dataset.codeKind}function EK(e,t,n){if(!t.classList.contains(`language-mermaid`)){DK(e);return}let r=t.textContent??``;if(!r)return;let i=e.querySelector(`[data-component="markdown-mermaid"]`)??document.createElement(`div`);i.setAttribute(`data-component`,`markdown-mermaid`),i.parentElement||e.appendChild(i),e.dataset.mermaidPending=`true`;let a=n?r:r.slice(0,r.lastIndexOf(`
|
|
786
|
+
`)+1);if(!a)return;let o=`${n?`complete`:`streaming`}:${a.length}`;e.dataset.mermaidAttempt!==o&&(e.dataset.mermaidAttempt=o,$G(a).then(o=>{if(!o){n&&t.textContent===r&&DK(e);return}(t.textContent??``).startsWith(a)&&(i.innerHTML=o,delete e.dataset.mermaidPending,e.dataset.mermaidReady=`true`)}).catch(()=>{n&&t.textContent===r&&DK(e)}))}function DK(e){delete e.dataset.mermaidAttempt,delete e.dataset.mermaidPending,delete e.dataset.mermaidReady,e.querySelector(`[data-component="markdown-mermaid"]`)?.remove()}function OK(e){let t=Array.from(e.querySelectorAll(`:not(pre) > code`));for(let e of t){let t=gK(e.textContent??``),n=e.parentElement instanceof HTMLAnchorElement&&e.parentElement.classList.contains(`external-link`)?e.parentElement:null;if(!t){n&&n.replaceWith(e);continue}if(n){n.href=t;continue}let r=document.createElement(`a`);r.href=t,r.className=`external-link`,r.target=`_blank`,r.rel=`noopener noreferrer`,e.parentNode?.replaceChild(r,e),r.appendChild(e)}}function kK(e){let t=Array.from(e.querySelectorAll(`:not(pre) > code`));for(let e of t){if(!(e instanceof HTMLElement))continue;delete e.dataset.inlineCodeKind;let t=JG(e.textContent??``);t&&(e.dataset.inlineCodeKind=t)}}function AK(e,t){let n=new Map,r=e=>{yK(e,t(),e.getAttribute(`data-copied`)===`true`)},i=async e=>{let r=e.target;if(!(r instanceof Element))return;let i=r.closest(`[data-slot="markdown-copy-button"]`);if(!(i instanceof HTMLElement))return;let a=i.closest(`[data-component="markdown-code"]`)?.querySelector(`code`)?.textContent??``;if(!a)return;let o=navigator?.clipboard;if(!o)return;await o.writeText(a);let s=t();yK(i,s,!0);let c=n.get(i);c&&clearTimeout(c);let l=setTimeout(()=>yK(i,s,!1),2e3);n.set(i,l)},a=Array.from(e.querySelectorAll(`[data-slot="markdown-copy-button"]`));for(let e of a)e instanceof HTMLElement&&r(e);return e.addEventListener(`click`,i),()=>{e.removeEventListener(`click`,i);for(let e of n.values())clearTimeout(e);xK(e)}}function jK(e,t,n,r,i){if(!e)return{text:e,blocks:[],ready:!0};let a=t??Zp(e);if(a){let t=n.blocks.flatMap((e,t)=>{if(e.mode===`code`)return[];let n=`${a}:${t}:${e.mode}`,i=e.mode===`full`?HG(e,n):BG(n);return i?.raw===e.raw?(e.mode!==`full`&&VG(n,i),[{key:`${r}:${n}`,mode:e.mode,...i}]):[]});if(t.length===n.blocks.length)return{text:e,blocks:t,ready:!0}}return i?{text:e,blocks:[],ready:!1}:{text:e,ready:!1,blocks:[{key:`initial`,mode:`full`,raw:e,hash:Zp(e)??``,html:fK(e)}]}}function MK(e){return{text:e,blocks:e?[{raw:e,src:e,mode:`live`}]:[]}}function NK(e){let[t,n]=B(e,[`text`,`cacheKey`,`streaming`,`deferUntilReady`,`class`,`classList`]),r=Ml(),i=sK(),[a,o]=A(),s=We(),c=new AbortController,l=new Set,u=new Map,d=!1,[f]=re(()=>{let e=t.streaming??!1;if(e&&(d=!0),e||d)return{key:s,text:t.text,live:e}},e=>oH(e.key,e.text,e.live),{initialValue:MK(``)}),p=()=>{if(!(t.streaming??!1)&&!d)return HV(t.text);let e=f.latest;return e?.text===t.text||e?.text?e:MK(t.text)},m=jK(t.text,t.cacheKey,t.streaming?MK(t.text):HV(t.text),s,t.deferUntilReady),[h]=re(()=>{let e=!(t.streaming??!1)&&!d?HV(t.text):f.latest;if(e&&e.text===t.text)return{text:t.text,key:t.cacheKey,projection:e}},e=>{if(!e.text)return{text:e.text,blocks:[],ready:!0};if(!d&&m.ready&&m.text===e.text)return m;let t=e.key??Zp(e.text);return Promise.all(e.projection.blocks.map(async(n,r)=>{let i=t?`${t}:${r}:${n.mode}`:void 0,a=GV(s,e.key,r,n.mode);if(n.mode===`code`){let e=u.get(a);if(n.complete&&e?.raw===n.raw)return e;let t=await pK(n.src,n.language,a,n.complete),r={key:a,mode:n.mode,raw:n.raw,hash:String(n.raw.length),complete:!!n.complete,...t};return n.complete&&u.set(a,r),r}let o=n.mode===`full`?HG(n,i):void 0;return{key:a,mode:n.mode,...o??await UG(n,i,c.signal)}})).then(t=>({text:e.text,blocks:t,ready:!0})).catch(()=>c.signal.aborted?{text:e.text,blocks:[],ready:!1}:{text:e.text,ready:!0,blocks:[{key:t??`fallback`,mode:`full`,raw:e.text,hash:Zp(e.text)??``,html:fK(e.text)}]})},{initialValue:m}),g,_,v;return M(()=>{let e=a(),n=h.latest??h(),o=p(),c=t.text?PK(n,o,t.cacheKey,s,t.deferUntilReady):[];if(!e)return;if(_!==i?.readImage&&(v?.dispose(),_=i?.readImage,v=_?NG(_):void 0),delete e.dataset.markdownReady,c.length===0){xK(e),SK(e),e.innerHTML=``,v?.update(e),n?.ready&&n.text===t.text&&(e.dataset.markdownReady=``);return}let u={copy:r.t(`ui.message.copy`),copied:r.t(`ui.message.copied`)},d=new Set(c.filter(e=>e.mode===`code`).map(e=>e.key));for(l.forEach(e=>{d.has(e)||FK(e)}),l.clear(),d.forEach(e=>l.add(e)),c.forEach((t,n)=>IK(e,n,t,u));e.children.length>c.length;){let t=e.lastElementChild;if(!t)break;xK(t),SK(t),t.remove()}v?.update(e),e.querySelectorAll(`[data-slot="markdown-copy-button"]`).forEach(e=>yK(e,u,e.dataset.copied===`true`)),g||=AK(e,()=>({copy:r.t(`ui.message.copy`),copied:r.t(`ui.message.copied`)})),n?.ready&&n.text===t.text&&(e.dataset.markdownReady=``)}),P(()=>{c.abort(),v?.dispose(),g&&g();let e=a();e&&SK(e),d&&sH(s),l.forEach(FK),u.clear()}),(()=>{var e=cK();return _t(o,e),gt(e,z({get classList(){return{...t.classList,[t.class??``]:!!t.class}}},n),!1,!1),e})()}function PK(e,t,n,r,i){if(!e)return[];if(!t||e.text===t.text||i)return e.blocks;let a=e.blocks.length===1&&e.blocks[0]?.key===`initial`;return t.blocks.map((t,i)=>{let o=a?void 0:e.blocks[i];if(o&&UV(o,t))return o;let s=GV(r,n,i,t.mode);return t.mode===`code`?{key:s,mode:t.mode,raw:t.raw,hash:String(t.raw.length),language:t.language??`text`,complete:!!t.complete,stable:[],generation:0,unstable:[[t.src,``]]}:{key:s,mode:t.mode,raw:t.raw,hash:String(t.raw.length),html:fK(t.src)}})}function FK(e){lH(e)}function IK(e,t,n,r){let i=e.children[t];if(n.mode===`code`){LK(e,i,n,r);return}let a=i instanceof HTMLDivElement&&i.dataset.markdownKey===n.key&&!lK.has(i)?i:void 0;if(a?.dataset.markdownHash===n.hash)return;let o=a??document.createElement(`div`);o.dataset.markdownBlock=``,o.dataset.markdownKey=n.key,o.dataset.markdownHash=n.hash,o.style.display=`contents`;let s=uK.get(o),c=s||n.mode===`live`?document.createElement(`div`):o;if(c===o&&xK(o),c.innerHTML=n.html,kK(c),OK(c),s){s.renderer.update(c.innerHTML,n.mode===`live`,s.raw!==n.raw),s.raw=n.raw;return}if(n.mode===`live`&&(o.replaceChildren(),uK.set(o,{renderer:nK(o,c.innerHTML,!0),raw:n.raw})),n.mode!==`live`&&o.querySelectorAll(`pre > code`).forEach(e=>{let t=e.parentElement,n=document.createElement(`div`);n.dataset.component=`markdown-code`,TK(n,Array.from(e.classList).find(e=>e.startsWith(`language-`))?.slice(9)),t.replaceWith(n),n.appendChild(t),n.appendChild(_K(r)),EK(n,e,!0)}),!a){if(!i){e.appendChild(o);return}xK(i),SK(i),i.replaceWith(o)}}function LK(e,t,n,r){let i=t instanceof HTMLDivElement&&t.dataset.markdownKey===n.key&&lK.has(t)?t:void 0,a=i??document.createElement(`div`);a.dataset.markdownBlock=``,a.dataset.markdownKey=n.key,a.dataset.markdownHash=n.hash,a.dataset.markdownComplete=n.complete?`true`:`false`,a.style.display=`contents`;let o=i?.querySelector(`code`);if(o instanceof HTMLElement){let e=o.closest(`[data-component="markdown-code"]`);e instanceof HTMLElement&&TK(e,n.language),o.className=`language-${n.language}`;let t=lK.get(a),r=mH(t,{language:n.language,generation:n.generation,stableCount:n.stable.length,raw:n.raw}),i=r?0:t.stableCount,s=[...n.stable.slice(i),...n.unstable],c=r?[]:t.unstable,l=c.findIndex((e,t)=>!RK(e,s[t])),u=i+(l<0?Math.min(c.length,s.length):l);for(;o.children.length>u;)o.lastElementChild?.remove();s.slice(u-i).map(zK).forEach(e=>o.appendChild(e)),lK.set(a,{language:n.language,generation:n.generation,stableCount:n.stable.length,unstable:n.unstable,raw:n.raw}),e instanceof HTMLElement&&EK(e,o,n.complete);return}let s=document.createElement(`div`);s.setAttribute(`data-component`,`markdown-code`),TK(s,n.language);let c=document.createElement(`pre`);c.className=`shiki OpenCode`;let l=document.createElement(`code`);if(l.className=`language-${n.language}`,[...n.stable,...n.unstable].map(zK).forEach(e=>l.appendChild(e)),c.appendChild(l),s.appendChild(c),s.appendChild(_K(r)),EK(s,l,n.complete),a.appendChild(s),lK.set(a,{language:n.language,generation:n.generation,stableCount:n.stable.length,unstable:n.unstable,raw:n.raw}),t){xK(t),SK(t),t.replaceWith(a);return}e.appendChild(a)}function RK(e,t){return!!t&&e[0]===t[0]&&e[1]===t[1]}function zK(e){let t=document.createElement(`span`);return t.setAttribute(`style`,e[1]),t.textContent=e[0],t}var BK=W(`<div data-slot=image-preview-header>`),VK=W(`<div data-slot=image-preview-body><img data-slot=image-preview-image>`),HK=W(`<div data-component=image-preview><div data-slot=image-preview-container>`);function UK(e){let t=Ml();return(()=>{var n=HK(),r=n.firstChild;return K(r,R(vo.Content,{"data-slot":`image-preview-content`,get children(){return[(()=>{var e=BK();return K(e,R(vo.CloseButton,{"data-slot":`image-preview-close`,as:zo,get icon(){return R(Fo,{name:`close`})},variant:`ghost`,get"aria-label"(){return t.t(`ui.common.close`)}})),e})(),(()=>{var n=VK(),r=n.firstChild;return j(n=>{var i=e.src,a=e.alt??t.t(`ui.imagePreview.alt`);return i!==n.e&&G(r,`src`,n.e=i),a!==n.t&&G(r,`alt`,n.t=a),n},{e:void 0,t:void 0}),n})()]}})),n})()}function WK(e){if(!e)return``;let t=e.replace(/[/\\]+$/,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return t.slice(n+1)}function GK(e){if(!e)return``;let t=e.replace(/[/\\]+$/,``).split(/[/\\]/);return t.slice(0,t.length-1).join(`/`)+`/`}function KK(e,t=20){let n=WK(e);if(n.length<=t)return n;let r=n.lastIndexOf(`.`),i=r<=0?``:n.slice(r),a=t-i.length-1;return a<=0?n.slice(0,t-1)+`…`:n.slice(0,a)+`…`+i}var qK=W(`<div data-component=attachment-card><span data-slot=attachment-card-title></span><span data-slot=attachment-card-subtitle>`);function JK(e){return(()=>{var t=qK(),n=t.firstChild,r=n.nextSibling;return t.$$click=()=>e.onClick?.(),_t(t=>e.titleRef?.(t),n),K(n,()=>e.title),K(r,()=>e.children),j(n=>{var r=e.active?`true`:void 0,i=e.clickable?`true`:void 0,a=e.wide?`true`:void 0,o=e.surface,s=e.hover;return r!==n.e&&G(t,`data-active`,n.e=r),i!==n.t&&G(t,`data-clickable`,n.t=i),a!==n.a&&G(t,`data-wide`,n.a=a),o!==n.o&&G(t,`data-surface`,n.o=o),s!==n.i&&G(t,`title`,n.i=s),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),t})()}ct([`click`]);var YK=`/assets/sprite-Fb-TFjRY.svg`,XK=W(`<svg><defs><mask mask-type=alpha><use></svg>`,!1,!0,!1),ZK=W(`<svg><rect width=100% height=100% fill=currentColor></svg>`,!1,!0,!1),QK=W(`<svg data-component=file-icon>`),$K=W(`<svg><use></svg>`,!1,!0,!1),eq=e=>{let[t,n]=B(e,[`node`,`class`,`classList`,`expanded`,`mono`]),r=N(()=>oq(t.node.path,t.node.type,t.expanded||!1)),i=`file-icon-mono-${We()}`;return(()=>{var e=QK();return gt(e,z(n,{get classList(){return{...t.classList,[t.class??``]:!!t.class}}}),!0,!0),K(e,R(H,{get when(){return t.mono},get fallback(){return(()=>{var e=$K();return j(()=>G(e,`href`,`${YK}#${r()}`)),e})()},get children(){return[(()=>{var e=XK(),t=e.firstChild,n=t.firstChild;return G(t,`id`,i),j(()=>G(n,`href`,`${YK}#${r()}`)),e})(),(()=>{var e=ZK();return G(e,`mask`,`url(#${i})`),e})()]}})),e})()},tq={fileNames:{"readme.md":`Readme`,"changelog.md":`Changelog`,"contributing.md":`Contributing`,"conduct.md":`Conduct`,license:`Certificate`,authors:`Authors`,credits:`Credits`,install:`Installation`,"package.json":`Nodejs`,"package-lock.json":`Nodejs`,"yarn.lock":`Yarn`,"pnpm-lock.yaml":`Pnpm`,"bun.lock":`Bun`,"bun.lockb":`Bun`,"bunfig.toml":`Bun`,".nvmrc":`Nodejs`,".node-version":`Nodejs`,dockerfile:`Docker`,"docker-compose.yml":`Docker`,"docker-compose.yaml":`Docker`,".dockerignore":`Docker`,"jest.config.js":`Jest`,"jest.config.ts":`Jest`,"jest.config.mjs":`Jest`,"vitest.config.js":`Vitest`,"vitest.config.ts":`Vitest`,"tailwind.config.js":`Tailwindcss`,"tailwind.config.ts":`Tailwindcss`,"turbo.json":`Turborepo`,"tsconfig.json":`Tsconfig`,"jsconfig.json":`Jsconfig`,".eslintrc":`Eslint`,".eslintrc.js":`Eslint`,".eslintrc.json":`Eslint`,".prettierrc":`Prettier`,".prettierrc.js":`Prettier`,".prettierrc.json":`Prettier`,"vite.config.js":`Vite`,"vite.config.ts":`Vite`,"webpack.config.js":`Webpack`,"rollup.config.js":`Rollup`,"astro.config.mjs":`AstroConfig`,"astro.config.js":`AstroConfig`,"next.config.js":`Next`,"next.config.mjs":`Next`,"nuxt.config.js":`Nuxt`,"nuxt.config.ts":`Nuxt`,"svelte.config.js":`Svelte`,"gatsby-config.js":`Gatsby`,"remix.config.js":`Remix`,"prisma.schema":`Prisma`,".gitignore":`Git`,".gitattributes":`Git`,makefile:`Makefile`,cmake:`Cmake`,"cargo.toml":`Rust`,"go.mod":`GoMod`,"go.sum":`GoMod`,"requirements.txt":`Python`,"pyproject.toml":`Python`,pipfile:`Python`,"poetry.lock":`Poetry`,gemfile:`Gemfile`,rakefile:`Ruby`,"composer.json":`Php`,"build.gradle":`Gradle`,"pom.xml":`Maven`,"deno.json":`Deno`,"deno.jsonc":`Deno`,"vercel.json":`Vercel`,"netlify.toml":`Netlify`,".env":`Tune`,".env.local":`Tune`,".env.development":`Tune`,".env.production":`Tune`,".env.example":`Tune`,".editorconfig":`Editorconfig`,"robots.txt":`Robots`,"favicon.ico":`Favicon`,browserlist:`Browserlist`,".babelrc":`Babel`,"babel.config.js":`Babel`,"gulpfile.js":`Gulp`,"gruntfile.js":`Grunt`,"capacitor.config.json":`Capacitor`,"ionic.config.json":`Ionic`,"angular.json":`Angular`,".storybook":`Storybook`,"storybook.config.js":`Storybook`,"cypress.config.js":`Cypress`,"playwright.config.js":`Playwright`,"puppeteer.config.js":`Puppeteer`,"wrangler.toml":`Wrangler`,"firebase.json":`Firebase`,supabase:`Supabase`,terraform:`Terraform`,kubernetes:`Kubernetes`,".gitpod.yml":`Gitpod`,".devcontainer":`Vscode`,"travis.yml":`Travis`,"appveyor.yml":`Appveyor`,".circleci":`Circleci`,"renovate.json":`Renovate`,"dependabot.yml":`Dependabot`,"lerna.json":`Lerna`,"nx.json":`Nx`},fileExtensions:{"spec.ts":`TestTs`,"test.ts":`TestTs`,"spec.tsx":`TestJsx`,"test.tsx":`TestJsx`,"spec.js":`TestJs`,"test.js":`TestJs`,"spec.jsx":`TestJsx`,"test.jsx":`TestJsx`,"js.map":`JavascriptMap`,"d.ts":`TypescriptDef`,ts:`Typescript`,tsx:`React_ts`,js:`Javascript`,jsx:`React`,mjs:`Javascript`,cjs:`Javascript`,html:`Html`,htm:`Html`,css:`Css`,scss:`Sass`,sass:`Sass`,less:`Less`,styl:`Stylus`,json:`Json`,xml:`Xml`,yml:`Yaml`,yaml:`Yaml`,toml:`Toml`,hjson:`Hjson`,md:`Markdown`,mdx:`Mdx`,tex:`Tex`,py:`Python`,pyx:`Python`,pyw:`Python`,rs:`Rust`,go:`Go`,java:`Java`,kt:`Kotlin`,scala:`Scala`,php:`Php`,rb:`Ruby`,cs:`Csharp`,vb:`Visualstudio`,cpp:`Cpp`,cc:`Cpp`,cxx:`Cpp`,c:`C`,h:`H`,hpp:`Hpp`,swift:`Swift`,m:`ObjectiveC`,mm:`ObjectiveCpp`,dart:`Dart`,lua:`Lua`,pl:`Perl`,r:`R`,jl:`Julia`,hs:`Haskell`,elm:`Elm`,ml:`Ocaml`,clj:`Clojure`,cljs:`Clojure`,erl:`Erlang`,ex:`Elixir`,exs:`Elixir`,nim:`Nim`,zig:`Zig`,v:`Vlang`,odin:`Odin`,gleam:`Gleam`,grain:`Grain`,roc:`Rocket`,fs:`Fsharp`,sh:`Console`,bash:`Console`,zsh:`Console`,fish:`Console`,ps1:`Powershell`,cfg:`Settings`,ini:`Settings`,conf:`Settings`,properties:`Settings`,svg:`Svg`,png:`Image`,jpg:`Image`,jpeg:`Image`,gif:`Image`,webp:`Image`,bmp:`Image`,ico:`Favicon`,mp4:`Video`,mov:`Video`,avi:`Video`,webm:`Video`,mp3:`Audio`,wav:`Audio`,flac:`Audio`,zip:`Zip`,tar:`Zip`,gz:`Zip`,rar:`Zip`,"7z":`Zip`,pdf:`Pdf`,doc:`Word`,docx:`Word`,ppt:`Powerpoint`,pptx:`Powerpoint`,xls:`Document`,xlsx:`Document`,sql:`Database`,db:`Database`,sqlite:`Database`,env:`Tune`,log:`Log`,lock:`Lock`,key:`Key`,pem:`Certificate`,crt:`Certificate`,proto:`Proto`,graphql:`Graphql`,gql:`Graphql`,wasm:`Webassembly`,dockerfile:`Docker`},folderNames:{src:`FolderSrc`,source:`FolderSrc`,lib:`FolderLib`,libs:`FolderLib`,test:`FolderTest`,tests:`FolderTest`,testing:`FolderTest`,spec:`FolderTest`,specs:`FolderTest`,__tests__:`FolderTest`,e2e:`FolderTest`,integration:`FolderTest`,unit:`FolderTest`,cypress:`FolderCypress`,node_modules:`FolderNode`,vendor:`FolderPackages`,packages:`FolderPackages`,deps:`FolderPackages`,build:`FolderBuildkite`,dist:`FolderDist`,out:`FolderDist`,output:`FolderDist`,target:`FolderTarget`,config:`FolderConfig`,configs:`FolderConfig`,configuration:`FolderConfig`,settings:`FolderConfig`,env:`FolderEnvironment`,environments:`FolderEnvironment`,docker:`FolderDocker`,dockerfiles:`FolderDocker`,containers:`FolderDocker`,docs:`FolderDocs`,doc:`FolderDocs`,documentation:`FolderDocs`,readme:`FolderDocs`,public:`FolderPublic`,static:`FolderPublic`,assets:`FolderImages`,images:`FolderImages`,img:`FolderImages`,icons:`FolderImages`,media:`FolderImages`,fonts:`FolderFont`,styles:`FolderCss`,stylesheets:`FolderCss`,css:`FolderCss`,sass:`FolderSass`,scss:`FolderSass`,less:`FolderLess`,scripts:`FolderScripts`,script:`FolderScripts`,tools:`FolderTools`,utils:`FolderUtils`,utilities:`FolderUtils`,helpers:`FolderHelper`,components:`FolderComponents`,component:`FolderComponents`,views:`FolderViews`,view:`FolderViews`,layouts:`FolderLayout`,layout:`FolderLayout`,templates:`FolderTemplate`,template:`FolderTemplate`,hooks:`FolderHook`,hook:`FolderHook`,store:`FolderStore`,stores:`FolderStore`,state:`FolderNgrxStore`,reducers:`FolderReduxReducer`,reducer:`FolderReduxReducer`,services:`FolderApi`,service:`FolderApi`,api:`FolderApi`,apis:`FolderApi`,routes:`FolderRoutes`,route:`FolderRoutes`,routing:`FolderRoutes`,middleware:`FolderMiddleware`,middlewares:`FolderMiddleware`,controllers:`FolderController`,controller:`FolderController`,models:`FolderDatabase`,model:`FolderDatabase`,schemas:`FolderDatabase`,schema:`FolderDatabase`,migrations:`FolderDatabase`,migration:`FolderDatabase`,seeders:`FolderSeeders`,seeder:`FolderSeeders`,types:`FolderTypescript`,typing:`FolderTypescript`,typings:`FolderTypescript`,"@types":`FolderTypescript`,interfaces:`FolderInterface`,interface:`FolderInterface`,android:`FolderAndroid`,ios:`FolderIos`,mobile:`FolderMobile`,flutter:`FolderFlutter`,kubernetes:`FolderKubernetes`,k8s:`FolderKubernetes`,terraform:`FolderTerraform`,aws:`FolderAws`,azure:`FolderAzurePipelines`,firebase:`FolderFirebase`,supabase:`FolderSupabase`,vercel:`FolderVercel`,netlify:`FolderNetlify`,".github":`FolderGithub`,".gitlab":`FolderGitlab`,".circleci":`FolderCircleci`,ci:`FolderCi`,".ci":`FolderCi`,workflows:`FolderGhWorkflows`,".git":`FolderGit`,".vscode":`FolderVscode`,".idea":`FolderIntellij`,".cursor":`FolderCursor`,".devcontainer":`FolderContainer`,".storybook":`FolderStorybook`,i18n:`FolderI18n`,locales:`FolderI18n`,locale:`FolderI18n`,lang:`FolderI18n`,languages:`FolderI18n`,temp:`FolderTemp`,tmp:`FolderTemp`,logs:`FolderLog`,log:`FolderLog`,backup:`FolderBackup`,backups:`FolderBackup`,examples:`FolderExamples`,example:`FolderExamples`,demo:`FolderExamples`,demos:`FolderExamples`,samples:`FolderExamples`,sample:`FolderExamples`,fixtures:`FolderTest`,mocks:`FolderMock`,mock:`FolderMock`,data:`FolderDatabase`,database:`FolderDatabase`,db:`FolderDatabase`,sql:`FolderDatabase`,prisma:`FolderPrisma`,drizzle:`FolderDrizzle`,security:`FolderSecure`,auth:`FolderSecure`,authentication:`FolderSecure`,authorization:`FolderSecure`,keys:`FolderKeys`,certs:`FolderKeys`,certificates:`FolderKeys`,content:`FolderContent`,posts:`FolderContent`,articles:`FolderContent`,blog:`FolderContent`,functions:`FolderFunctions`,function:`FolderFunctions`,lambda:`FolderFunctions`,lambdas:`FolderFunctions`,serverless:`FolderServerless`,jobs:`FolderJob`,job:`FolderJob`,tasks:`FolderTasks`,task:`FolderTasks`,cron:`FolderTasks`,queue:`FolderQueue`,queues:`FolderQueue`,desktop:`FolderDesktop`,windows:`FolderWindows`,macos:`FolderMacos`,linux:`FolderLinux`},defaults:{file:`Document`,folder:`Folder`,folderOpen:`FolderOpen`}},nq=e=>e.startsWith(`Folder`)?e.endsWith(`_light`)?e.replace(`_light`,`Open_light`):e.endsWith(`Open`)?e:e+`Open`:e,rq=e=>e.split(`\\`).join(`/`).split(`/`).filter(Boolean).pop()??``,iq=e=>{let t=e.toLowerCase();return[t,`.${t}`,`_${t}`,`__${t}__`]},aq=e=>{let t=e.toLowerCase(),n=[];for(let e=0;e<t.length;e++)t[e]===`.`&&n.push(e);let r=new Set;r.add(t);for(let e of n)e+1<t.length&&r.add(t.slice(e+1));return Array.from(r).sort((e,t)=>t.length-e.length)};function oq(e,t,n){let r=rq(e).toLowerCase();if(t===`directory`){for(let e of iq(r)){let t=tq.folderNames[e];if(t)return n?nq(t):t}return n?tq.defaults.folderOpen:tq.defaults.folder}let i=tq.fileNames[r];if(i)return i;for(let e of aq(r)){let t=tq.fileExtensions[e];if(t)return t}return tq.defaults.file}var sq=W(`<span>`);function cq(e){let t,[n,r]=A(!1);return se(()=>{let e=t;if(!e)return;let n=()=>r(e.scrollWidth>e.clientWidth),i=()=>requestAnimationFrame(n),a=new ResizeObserver(n);a.observe(e),i(),document.fonts?.ready.then(i),P(()=>a.disconnect())}),R(wl,{placement:`top`,openDelay:1e3,get value(){return e.title??e.comment},get disabled(){return!e.tooltip||!n()},get class(){return e.wide?`w-full`:void 0},contentStyle:{"max-width":`320px`,"white-space":`pre-wrap`},get children(){return R(JK,{get title(){return e.comment},get active(){return e.active},get clickable(){return!!e.onClick},get wide(){return e.wide},surface:`base`,titleRef:e=>{t=e},get onClick(){return e.onClick},get children(){return[R(eq,{get node(){return{path:e.path,type:`file`}}}),(()=>{var t=sq();return K(t,()=>KK(e.path,14),null),K(t,R(H,{get when(){return e.selection},children:e=>e().startLine===e().endLine?`:${e().startLine}`:`:${e().startLine}-${e().endLine}`}),null),t})()]}})}})}var lq=W(`<span data-component=text-reveal><span data-slot=text-reveal-track><span data-slot=text-reveal-entering></span><span data-slot=text-reveal-leaving>`),uq=(e,t)=>typeof e==`number`?`${e}px`:typeof e==`string`?e:`${t}px`,dq=(e,t)=>typeof e==`number`?`${e}ms`:typeof e==`string`?e:`${t}ms`,fq=(e,t)=>`${e??t}%`;function pq(e){let[t,n]=$t({cur:e.text,old:void 0,width:`auto`,ready:!1,swapping:!1}),r=()=>t.cur,i=()=>t.old,a=()=>t.width,o=()=>t.ready,s=()=>t.swapping,c,l,u,d,f=()=>c?.scrollWidth??0,p=()=>l?.scrollWidth??0,m=t=>{if(!(t<=0)){if(e.growOnly??!0){let e=Number.parseFloat(a());if(Number.isFinite(e)&&t<=e)return}n(`width`,`${t}px`)}};return M(oe(()=>e.text,(e,t)=>{if(e!==t){if(typeof e==`string`&&typeof t==`string`&&e.startsWith(t)){n(`cur`,e),m(f());return}if(n(`swapping`,!0),n(`old`,t),n(`cur`,e),typeof requestAnimationFrame!=`function`){m(Math.max(f(),p())),u?.offsetHeight,n(`swapping`,!1);return}d!==void 0&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(d),d=requestAnimationFrame(()=>{m(Math.max(f(),p())),u?.offsetHeight,n(`swapping`,!1),d=void 0})}})),se(()=>{m(f());let e=typeof document<`u`?document.fonts:void 0;if(typeof requestAnimationFrame!=`function`){n(`ready`,!0);return}if(!e){requestAnimationFrame(()=>n(`ready`,!0));return}e.ready.finally(()=>{m(f()),requestAnimationFrame(()=>n(`ready`,!0))})}),P(()=>{d!==void 0&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(d)}),(()=>{var t=lq(),n=t.firstChild,d=n.firstChild,f=d.nextSibling,p=u;typeof p==`function`?_t(p,t):u=t;var m=c;typeof m==`function`?_t(m,d):c=d,K(d,()=>r()??`\xA0`);var h=l;return typeof h==`function`?_t(h,f):l=f,K(f,()=>i()??`\xA0`),j(r=>{var i=o()?`true`:`false`,c=s()?`true`:`false`,l=e.truncate?`true`:`false`,u=e.class,d=e.text??``,f=dq(e.duration,450),p=fq(e.edge,17),m=uq(e.travel,0),h=e.spring??`cubic-bezier(0.34, 1.08, 0.64, 1)`,g=e.springSoft??`cubic-bezier(0.34, 1, 0.64, 1)`,_=e.truncate?`100%`:a();return i!==r.e&&G(t,`data-ready`,r.e=i),c!==r.t&&G(t,`data-swapping`,r.t=c),l!==r.a&&G(t,`data-truncate`,r.a=l),u!==r.o&&dt(t,r.o=u),d!==r.i&&G(t,`aria-label`,r.i=d),f!==r.n&&ht(t,`--text-reveal-duration`,r.n=f),p!==r.s&&ht(t,`--text-reveal-edge`,r.s=p),m!==r.h&&ht(t,`--text-reveal-travel`,r.h=m),h!==r.r&&ht(t,`--text-reveal-spring`,r.r=h),g!==r.d&&ht(t,`--text-reveal-spring-soft`,r.d=g),_!==r.l&&ht(n,`width`,r.l=_),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),t})()}var mq=W(`<span data-slot=text-shimmer-char><span data-slot=text-shimmer-char-base aria-hidden=true></span><span data-slot=text-shimmer-char-shimmer aria-hidden=true>`),hq=e=>{let t=N(()=>e.text??``),n=N(()=>e.active??!0),r=N(()=>e.offset??0),[i,a]=A(n()),o;return M(()=>{if(o&&=(clearTimeout(o),void 0),n()){a(!0);return}o=setTimeout(()=>{o=void 0,a(!1)},220)}),P(()=>{o&&clearTimeout(o)}),R(Pt,{get component(){return e.as??`span`},"data-component":`text-shimmer`,get"data-active"(){return n()?`true`:`false`},get class(){return e.class},get"aria-label"(){return t()},get style(){return{"--text-shimmer-swap":`220ms`,"--text-shimmer-index":`${r()}`}},get children(){var e=mq(),n=e.firstChild,r=n.nextSibling;return K(n,t),K(r,t),j(()=>G(r,`data-run`,i()?`true`:`false`)),e}})};function gq(e,t){e.indexOf(t)===-1&&e.push(t)}function _q(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var vq=(e,t,n)=>n>t?t:n<e?e:n,yq={},bq=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),xq=e=>typeof e==`object`&&!!e,Sq=e=>/^0[^.\s]+$/u.test(e);function Cq(e){let t;return()=>(t===void 0&&(t=e()),t)}var wq=e=>e,Tq=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Eq=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Dq=class{constructor(){this.subscriptions=[]}add(e){return gq(this.subscriptions,e),()=>_q(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Oq=e=>e*1e3,kq=e=>e/1e3,Aq=(e,t)=>t?1e3/t*e:0,jq=(e,t,n)=>{let r=t-e;return((n-e)%r+r)%r+e},Mq=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Nq=1e-7,Pq=12;function Fq(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Mq(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>Nq&&++s<Pq);return o}function Iq(e,t,n,r){if(e===t&&n===r)return wq;let i=t=>Fq(t,0,1,e,n);return e=>e===0||e===1?e:Mq(i(e),t,r)}var Lq=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Rq=e=>t=>1-e(1-t),zq=Iq(.33,1.53,.69,.99),Bq=Rq(zq),Vq=Lq(Bq),Hq=e=>e>=1?1:(e*=2)<1?.5*Bq(e):.5*(2-2**(-10*(e-1))),Uq=e=>1-Math.sin(Math.acos(e)),Wq=Rq(Uq),Gq=Lq(Uq),Kq=Iq(.42,0,1,1),qq=Iq(0,0,.58,1),Jq=Iq(.42,0,.58,1),Yq=e=>Array.isArray(e)&&typeof e[0]!=`number`;function Xq(e,t){return Yq(e)?e[jq(0,e.length,t)]:e}var Zq=e=>Array.isArray(e)&&typeof e[0]==`number`,Qq={linear:wq,easeIn:Kq,easeInOut:Jq,easeOut:qq,circIn:Uq,circInOut:Gq,circOut:Wq,backIn:Bq,backInOut:Vq,backOut:zq,anticipate:Hq},$q=e=>typeof e==`string`,eJ=e=>{if(Zq(e)){e.length;let[t,n,r,i]=e;return Iq(t,n,r,i)}return $q(e)?(Qq[e],`${e}`,Qq[e]):e},tJ=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function nJ(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var rJ=40;function iJ(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=tJ.reduce((e,t)=>(e[t]=nJ(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=yq.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,rJ),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:tJ.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<tJ.length;t++)o[tJ[t]].cancel(e)},state:i,steps:o}}var{schedule:aJ,cancel:oJ,state:sJ,steps:cJ}=iJ(typeof requestAnimationFrame<`u`?requestAnimationFrame:wq,!0),lJ;function uJ(){lJ=void 0}var dJ={now:()=>(lJ===void 0&&dJ.set(sJ.isProcessing||yq.useManualTiming?sJ.timestamp:performance.now()),lJ),set:e=>{lJ=e,queueMicrotask(uJ)}},fJ=e=>t=>typeof t==`string`&&t.startsWith(e),pJ=fJ(`--`),mJ=fJ(`var(--`),hJ=e=>mJ(e)?gJ.test(e.split(`/*`)[0].trim()):!1,gJ=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function _J(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var vJ={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},yJ={...vJ,transform:e=>vq(0,1,e)},bJ={...vJ,default:1},xJ=e=>Math.round(e*1e5)/1e5,SJ=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function CJ(e){return e==null}var wJ=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,TJ=(e,t)=>n=>!!(typeof n==`string`&&wJ.test(n)&&n.startsWith(e)||t&&!CJ(n)&&Object.prototype.hasOwnProperty.call(n,t)),EJ=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(SJ);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},DJ=e=>vq(0,255,e),OJ={...vJ,transform:e=>Math.round(DJ(e))},kJ={test:TJ(`rgb`,`red`),parse:EJ(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+OJ.transform(e)+`, `+OJ.transform(t)+`, `+OJ.transform(n)+`, `+xJ(yJ.transform(r))+`)`};function AJ(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var jJ={test:TJ(`#`),parse:AJ,transform:kJ.transform},MJ=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),NJ=MJ(`deg`),PJ=MJ(`%`),$=MJ(`px`),FJ=MJ(`vh`),IJ=MJ(`vw`),LJ={...PJ,parse:e=>PJ.parse(e)/100,transform:e=>PJ.transform(e*100)},RJ={test:TJ(`hsl`,`hue`),parse:EJ(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+PJ.transform(xJ(t))+`, `+PJ.transform(xJ(n))+`, `+xJ(yJ.transform(r))+`)`},zJ={test:e=>kJ.test(e)||jJ.test(e)||RJ.test(e),parse:e=>kJ.test(e)?kJ.parse(e):RJ.test(e)?RJ.parse(e):jJ.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?kJ.transform(e):RJ.transform(e),getAnimatableNone:e=>{let t=zJ.parse(e);return t.alpha=0,zJ.transform(t)}},BJ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function VJ(e){return isNaN(e)&&typeof e==`string`&&(e.match(SJ)?.length||0)+(e.match(BJ)?.length||0)>0}var HJ=`number`,UJ=`color`,WJ=`var`,GJ=`var(`,KJ="${}",qJ=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function JJ(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(qJ,e=>(zJ.test(e)?(r.color.push(a),i.push(UJ),n.push(zJ.parse(e))):e.startsWith(GJ)?(r.var.push(a),i.push(WJ),n.push(e)):(r.number.push(a),i.push(HJ),n.push(parseFloat(e))),++a,KJ)).split(KJ),indexes:r,types:i}}function YJ(e){return JJ(e).values}function XJ({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===HJ?xJ(r[a]):e===UJ?zJ.transform(r[a]):r[a]}return i}}function ZJ(e){return XJ(JJ(e))}var QJ=e=>typeof e==`number`?0:zJ.test(e)?zJ.getAnimatableNone(e):e,$J=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:QJ(e);function eY(e){let t=JJ(e);return XJ(t)(t.values.map((e,n)=>$J(e,t.split[n])))}var tY={test:VJ,parse:YJ,createTransformer:ZJ,getAnimatableNone:eY};function nY(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function rY({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=nY(s,r,e+1/3),a=nY(s,r,e),o=nY(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function iY(e,t){return n=>n>0?t:e}var aY=(e,t,n)=>e+(t-e)*n,oY=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},sY=[jJ,kJ,RJ],cY=e=>sY.find(t=>t.test(e));function lY(e){let t=cY(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===RJ&&(n=rY(n)),n}var uY=(e,t)=>{let n=lY(e),r=lY(t);if(!n||!r)return iY(e,t);let i={...n};return e=>(i.red=oY(n.red,r.red,e),i.green=oY(n.green,r.green,e),i.blue=oY(n.blue,r.blue,e),i.alpha=aY(n.alpha,r.alpha,e),kJ.transform(i))},dY=new Set([`none`,`hidden`]);function fY(e,t){return dY.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function pY(e,t){return n=>aY(e,t,n)}function mY(e){return typeof e==`number`?pY:typeof e==`string`?hJ(e)?iY:zJ.test(e)?uY:vY:Array.isArray(e)?hY:typeof e==`object`?zJ.test(e)?uY:gY:iY}function hY(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>mY(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function gY(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=mY(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function _Y(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var vY=(e,t)=>{let n=tY.createTransformer(t),r=JJ(e),i=JJ(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?dY.has(e)&&!i.values.length||dY.has(t)&&!r.values.length?fY(e,t):Tq(hY(_Y(r,i),i.values),n):(`${e}${t}`,iY(e,t))};function yY(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?aY(e,t,n):mY(e)(e,t)}var bY=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>aJ.update(t,e),stop:()=>oJ(t),now:()=>sJ.isProcessing?sJ.timestamp:dJ.now()}},xY=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},SY=2e4;function CY(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function wY(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(CY(r),SY);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:kq(i)}}var TY={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function EY(e,t){return e*Math.sqrt(1-t*t)}var DY=12;function OY(e,t,n){let r=n;for(let n=1;n<DY;n++)r-=e(r)/t(r);return r}var kY=.001;function AY({duration:e=TY.duration,bounce:t=TY.bounce,velocity:n=TY.velocity,mass:r=TY.mass}){let i,a;TY.maxDuration;let o=1-t;o=vq(TY.minDamping,TY.maxDamping,o),e=vq(TY.minDuration,TY.maxDuration,kq(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=EY(t,o),c=Math.exp(-i);return kY-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=EY(t**2,o);return(-i(t)+kY>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=OY(i,a,s);if(e=Oq(e),isNaN(c))return{stiffness:TY.stiffness,damping:TY.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var jY=[`duration`,`bounce`],MY=[`stiffness`,`damping`,`mass`];function NY(e,t){return t.some(t=>e[t]!==void 0)}function PY(e){let t={velocity:TY.velocity,stiffness:TY.stiffness,damping:TY.damping,mass:TY.mass,isResolvedFromDuration:!1,...e};if(!NY(e,MY)&&NY(e,jY)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*vq(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:TY.mass,stiffness:i,damping:a}}else{let n=AY({...e,velocity:0});t={...t,...n,mass:TY.mass},t.isResolvedFromDuration=!0}}return t}function FY(e=TY.visualDuration,t=TY.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=PY({...n,velocity:-kq(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=kq(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?TY.restSpeed.granular:TY.restSpeed.default,i||=v?TY.restDelta.granular:TY.restDelta.default;let y,b,x,S,C,w;if(h<1)x=EY(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>Oq(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=Oq(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=Oq(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(CY(T),SY),t=xY(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}FY.applyToOptions=e=>{let t=wY(e,100,FY);return e.ease=t.ease,e.duration=Oq(t.duration),e.type=`keyframes`,e};var IY=5;function LY(e,t,n){let r=Math.max(t-IY,0);return Aq(n-e(r),t-r)}function RY({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=FY({keyframes:[f.value,m(f.value)],velocity:LY(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function zY(e,t,n){let r=[],i=n||yq.mix||yY,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Tq(Array.isArray(t)?t[n]||wq:t,a)),r.push(a)}return r}function BY(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=zY(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Eq(e[r],e[r+1],n);return s[r](i)};return n?t=>l(vq(e[0],e[a-1],t)):l}function VY(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Eq(0,t,r);e.push(aY(n,1,i))}}function HY(e){let t=[0];return VY(t,e.length-1),t}function UY(e,t){return e.map(e=>e*t)}function WY(e,t){return e.map(()=>t||Jq).splice(0,e.length-1)}function GY({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Yq(r)?r.map(eJ):eJ(r),a={done:!1,value:t[0]},o=BY(UY(n&&n.length===t.length?n:HY(t),e),t,{ease:Array.isArray(i)?i:WY(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var KY=e=>e!==null;function qY(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(KY),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var JY={decay:RY,inertia:RY,tween:GY,keyframes:GY,spring:FY};function YY(e){typeof e.type==`string`&&(e.type=JY[e.type])}var XY=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},ZY=e=>e/100,QY=class extends XY{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==dJ.now()&&this.tick(dJ.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;YY(e);let{type:t=GY,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||GY;s!==GY&&typeof o[0]!=`number`&&(this.mixKeyframes=Tq(ZY,yY(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=CY(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=vq(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==RY&&(b.value=qY(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return kq(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+kq(e)}get time(){return kq(this.currentTime)}set time(e){e=Oq(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return LY(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(dJ.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=kq(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=bY,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(dJ.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function $Y(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var eX=e=>e*180/Math.PI,tX=e=>rX(eX(Math.atan2(e[1],e[0]))),nX={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:tX,rotateZ:tX,skewX:e=>eX(Math.atan(e[1])),skewY:e=>eX(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},rX=e=>(e%=360,e<0&&(e+=360),e),iX=tX,aX=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),oX=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),sX={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:aX,scaleY:oX,scale:e=>(aX(e)+oX(e))/2,rotateX:e=>rX(eX(Math.atan2(e[6],e[5]))),rotateY:e=>rX(eX(Math.atan2(-e[2],e[0]))),rotateZ:iX,rotate:iX,skewX:e=>eX(Math.atan(e[4])),skewY:e=>eX(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function cX(e){return+!!e.includes(`scale`)}function lX(e,t){if(!e||e===`none`)return cX(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=sX,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=nX,i=t}if(!i)return cX(t);let a=r[t],o=i[1].split(`,`).map(dX);return typeof a==`function`?a(o):o[a]}var uX=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return lX(n,t)};function dX(e){return parseFloat(e.trim())}var fX=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],pX=new Set([...fX,`pathRotation`]),mX=e=>e===vJ||e===$,hX=new Set([`x`,`y`,`z`]),gX=fX.filter(e=>!hX.has(e));function _X(e){let t=[];return gX.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var vX={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>lX(t,`x`),y:(e,{transform:t})=>lX(t,`y`)};vX.translateX=vX.x,vX.translateY=vX.y;var yX=new Set,bX=!1,xX=!1,SX=!1;function CX(){if(xX){let e=Array.from(yX).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=_X(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}xX=!1,bX=!1,yX.forEach(e=>e.complete(SX)),yX.clear()}function wX(){yX.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xX=!0)})}function TX(){SX=!0,wX(),CX(),SX=!1}var EX=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(yX.add(this),bX||(bX=!0,aJ.read(wX),aJ.resolveKeyframes(CX))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}$Y(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yX.delete(this)}cancel(){this.state===`scheduled`&&(yX.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},DX=e=>e.startsWith(`--`);function OX(e,t,n){DX(t)?e.style.setProperty(t,n):e.style[t]=n}var kX={};function AX(e,t){let n=Cq(e);return()=>kX[t]??n()}var jX=AX(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),MX=AX(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),NX=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,PX={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:NX([0,.65,.55,1]),circOut:NX([.55,0,1,.45]),backIn:NX([.31,.01,.66,-.59]),backOut:NX([.33,1.53,.69,.99])};function FX(e,t){if(e)return typeof e==`function`?MX()?xY(e,t):`ease-out`:Zq(e)?NX(e):Array.isArray(e)?e.map(e=>FX(e,t)||PX.easeOut):PX[e]}function IX(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=FX(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function LX(e){return typeof e==`function`&&`applyToOptions`in e}function RX({type:e,...t}){return LX(e)&&MX()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var zX=class extends XY{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=RX(e);this.animation=IX(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=qY(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),OX(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return kq(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+kq(e)}get time(){return kq(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Oq(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&jX()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),wq):r(this)}},BX={anticipate:Hq,backInOut:Vq,circInOut:Gq};function VX(e){return e in BX}function HX(e){typeof e.ease==`string`&&VX(e.ease)&&(e.ease=BX[e.ease])}var UX=10,WX=class extends zX{constructor(e){HX(e),YY(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new QY({...a,autoplay:!1}),s=Math.max(UX,dJ.now()-this.startTime),c=vq(0,UX,s-UX),l=o.sample(s).value,{name:u}=this.options;i&&u&&OX(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},GX=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(tY.test(e)||e===`0`)&&!e.startsWith(`url(`));function KX(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function qX(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=GX(i,t),s=GX(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:KX(e)||(n===`spring`||LX(n))&&r}function JX(e){e.duration=0,e.type=`keyframes`}var YX=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),XX=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ZX(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&XX.test(e[t]))return!0;return!1}var QX=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),$X=Cq(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function eZ(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return $X()&&n&&(YX.has(n)||QX.has(n)&&ZX(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var tZ=40,nZ=class extends XY{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=dJ.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||EX;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=dJ.now();let u=!0;qX(e,i,a,o)||(u=!1,(yq.instantAnimations||!s)&&l?.(qY(e,n,t)),e[0]=e[e.length-1],JX(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>tZ?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&eZ(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new WX({...d,element:p})}catch{m=new QY(d)}else m=new QY(d);m.finished.then(()=>{this.notifyFinished()}).catch(wq),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),TX()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}},rZ=class{constructor(e){this.stop=()=>this.runAll(`stop`),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e){let t=this.animations.map(t=>t.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll(`time`)}set time(e){this.setAll(`time`,e)}get speed(){return this.getAll(`speed`)}set speed(e){this.setAll(`speed`,e)}get state(){return this.getAll(`state`)}get startTime(){return this.getAll(`startTime`)}get duration(){return iZ(this.animations,`duration`)}get iterationDuration(){return iZ(this.animations,`iterationDuration`)}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll(`play`)}pause(){this.runAll(`pause`)}cancel(){this.runAll(`cancel`)}complete(){this.runAll(`complete`)}};function iZ(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r][t];i!==null&&i>n&&(n=i)}return n}var aZ=class extends rZ{then(e,t){return this.finished.finally(e).then(()=>{})}},oZ=30,sZ=e=>!isNaN(parseFloat(e)),cZ={current:void 0},lZ=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=dJ.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=dJ.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=sZ(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Dq);let n=this.events[e].add(t);return e===`change`?()=>{n(),aJ.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return cZ.current&&cZ.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=dJ.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>oZ)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,oZ);return Aq(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function uZ(e,t){return new lZ(e,t)}function dZ(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function fZ(e,t){let n=e?.[t]??e?.default??e;return n===e?n:dZ(n,e)}var pZ={type:`spring`,stiffness:500,damping:25,restSpeed:10},mZ=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),hZ={type:`keyframes`,duration:.8},gZ={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},_Z=(e,{keyframes:t})=>t.length>2?hZ:pX.has(e)?e.startsWith(`scale`)?mZ(t[1]):pZ:gZ,vZ=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function yZ(e){for(let t in e)if(!vZ.has(t))return!0;return!1}var bZ=(e,t,n,r={},i,a)=>o=>{let s=fZ(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Oq(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};yZ(s)||Object.assign(u,_Z(e,u)),u.duration&&=Oq(u.duration),u.repeatDelay&&=Oq(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(JX(u),u.delay===0&&(d=!0)),(yq.instantAnimations||yq.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,JX(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=qY(u.keyframes,s);if(e!==void 0){aJ.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new QY(u):new nZ(u)},xZ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function SZ(e){let t=xZ.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function CZ(e,t,n=1){`${e}`;let[r,i]=SZ(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return bq(e)?parseFloat(e):e}return hJ(i)?CZ(i,t,n+1):i}function wZ(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function TZ(e,t,n,r){if(typeof t==`function`){let[i,a]=wZ(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=wZ(r);t=t(n===void 0?e.custom:n,i,a)}return t}function EZ(e,t,n){let r=e.getProps();return TZ(r,t,n===void 0?r.custom:n,e)}var DZ=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...fX]),OZ=e=>Array.isArray(e);function kZ(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,uZ(n))}function AZ(e){return OZ(e)?e[e.length-1]||0:e}function jZ(e,t){let{transitionEnd:n={},transition:r={},...i}=EZ(e,t)||{};i={...i,...n};for(let t in i)kZ(e,t,AZ(i[t]))}var MZ=e=>!!(e&&e.getVelocity);function NZ(e){return!!(MZ(e)&&e.add)}function PZ(e,t){let n=e.getValue(`willChange`);if(NZ(n))return n.add(t);if(!n&&yq.WillChange){let n=new yq.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function FZ(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var IZ=`data-`+FZ(`framerAppearId`);function LZ(e){return e.props[IZ]}function RZ({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function zZ(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?dZ(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&RZ(f,t))continue;let o={delay:n,...fZ(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){aJ.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=LZ(e);if(n){let e=window.MotionHandoffAnimation(n,t,aJ);e!==null&&(o.startTime=e,p=!0)}}PZ(e,t);let m=l??e.shouldReduceMotion;r.start(bZ(t,r,i,m&&DZ.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>aJ.update(()=>{o&&jZ(e,o)});d.length?Promise.all(d).then(t):t()}return d}var BZ={test:e=>e===`auto`,parse:e=>e},VZ=e=>t=>t.test(e),HZ=[vJ,$,PJ,NJ,IJ,FJ,BZ],UZ=e=>HZ.find(VZ(e));function WZ(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Sq(e)}var GZ=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function KZ(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(SJ)||[];if(!r)return e;let i=n.replace(r,``),a=+!!GZ.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var qZ=/\b([a-z-]*)\(.*?\)/gu,JZ={...tY,getAnimatableNone:e=>{let t=e.match(qZ);return t?t.map(KZ).join(` `):e}},YZ={...tY,getAnimatableNone:e=>{let t=tY.parse(e);return tY.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},XZ={...vJ,transform:Math.round},ZZ={borderWidth:$,borderTopWidth:$,borderRightWidth:$,borderBottomWidth:$,borderLeftWidth:$,borderRadius:$,borderTopLeftRadius:$,borderTopRightRadius:$,borderBottomRightRadius:$,borderBottomLeftRadius:$,width:$,maxWidth:$,height:$,maxHeight:$,top:$,right:$,bottom:$,left:$,inset:$,insetBlock:$,insetBlockStart:$,insetBlockEnd:$,insetInline:$,insetInlineStart:$,insetInlineEnd:$,padding:$,paddingTop:$,paddingRight:$,paddingBottom:$,paddingLeft:$,paddingBlock:$,paddingBlockStart:$,paddingBlockEnd:$,paddingInline:$,paddingInlineStart:$,paddingInlineEnd:$,margin:$,marginTop:$,marginRight:$,marginBottom:$,marginLeft:$,marginBlock:$,marginBlockStart:$,marginBlockEnd:$,marginInline:$,marginInlineStart:$,marginInlineEnd:$,fontSize:$,backgroundPositionX:$,backgroundPositionY:$,rotate:NJ,pathRotation:NJ,rotateX:NJ,rotateY:NJ,rotateZ:NJ,scale:bJ,scaleX:bJ,scaleY:bJ,scaleZ:bJ,skew:NJ,skewX:NJ,skewY:NJ,distance:$,translateX:$,translateY:$,translateZ:$,x:$,y:$,z:$,perspective:$,transformPerspective:$,opacity:yJ,originX:LJ,originY:LJ,originZ:$,zIndex:XZ,fillOpacity:yJ,strokeOpacity:yJ,numOctaves:XZ},QZ={...ZZ,color:zJ,backgroundColor:zJ,outlineColor:zJ,fill:zJ,stroke:zJ,borderColor:zJ,borderTopColor:zJ,borderRightColor:zJ,borderBottomColor:zJ,borderLeftColor:zJ,filter:JZ,WebkitFilter:JZ,mask:YZ,WebkitMask:YZ},$Z=e=>QZ[e],eQ=new Set([JZ,YZ]);function tQ(e,t){let n=$Z(e);return eQ.has(n)||(n=tY),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var nQ=new Set([`auto`,`none`,`0`]);function rQ(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!nQ.has(t)&&JJ(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=tQ(n,i)}var iQ=class extends EX{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),hJ(r))){let i=CZ(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!DZ.has(n)||e.length!==2)return;let[r,i]=e,a=UZ(r),o=UZ(i);if(_J(r)!==_J(i)&&vX[n]){this.needsMeasurement=!0;return}if(a!==o){if(mX(a)&&mX(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else vX[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||WZ(e[t]))&&n.push(t);n.length&&rQ(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=vX[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=vX[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},aQ=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function oQ(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var sQ=(e,t)=>t&&typeof e==`number`?t.transform(e):e,{schedule:cQ,cancel:lQ}=iJ(queueMicrotask,!1);function uQ(e){return xq(e)&&`ownerSVGElement`in e}function dQ(e){return uQ(e)&&e.tagName===`svg`}var fQ=[...HZ,zJ,tY],pQ=e=>fQ.find(VZ(e)),mQ=()=>({min:0,max:0}),hQ=()=>({x:mQ(),y:mQ()}),gQ=new WeakMap;function _Q(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function vQ(e){return typeof e==`string`||Array.isArray(e)}var yQ=[`initial`,`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`];function bQ(e){return _Q(e.animate)||yQ.some(t=>vQ(e[t]))}function xQ(e){return!!(bQ(e)||e.variants)}function SQ(e,t,n){for(let r in t){let i=t[r],a=n[r];if(MZ(i))e.addValue(r,i);else if(MZ(a))e.addValue(r,uZ(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,uZ(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var CQ={current:null},wQ={current:!1},TQ=typeof window<`u`;function EQ(){if(wQ.current=!0,TQ){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>CQ.current=e.matches;e.addEventListener(`change`,t),t()}else CQ.current=!1}}var DQ=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],OQ={},kQ=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=EX,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=dJ.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,aJ.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=bQ(t),this.isVariantNode=xQ(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&MZ(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,gQ.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(wQ.current||EQ(),this.shouldReduceMotion=CQ.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),oJ(this.notifyUpdate),oJ(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&YX.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new zX({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Oq(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=pX.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&aJ.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in OQ){let t=OQ[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):hQ()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<DQ.length;t++){let n=DQ[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=SQ(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=uZ(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(bq(n)||Sq(n))?n=parseFloat(n):!pQ(n)&&tY.test(t)&&(n=tQ(e,t)),this.setBaseTarget(e,MZ(n)?n.get():n)),MZ(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=TZ(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!MZ(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Dq),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){cQ.render(this.render)}},AQ=class extends kQ{constructor(){super(...arguments),this.KeyframeResolver=iQ}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;MZ(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}};function jQ({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function MQ(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function NQ(e,t){return jQ(MQ(e.getBoundingClientRect(),t))}var PQ={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},FQ=fX.length;function IQ(e,t,n){let r=``,i=!0;for(let a=0;a<FQ;a++){let o=fX[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=sQ(s,ZZ[o]);if(!c){i=!1;let t=PQ[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${sQ(a,ZZ.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function LQ(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(pX.has(e)){o=!0;continue}if(pJ(e)){i[e]=n;continue}{let t=sQ(n,ZZ[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=IQ(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function RQ(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function zQ(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var BQ={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if($.test(e))e=parseFloat(e);else return e}return`${zQ(e,t.target.x)}% ${zQ(e,t.target.y)}%`}},VQ={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=tY.parse(e);if(i.length>5)return r;let a=tY.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=aY(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},HQ={borderRadius:{...BQ,applyTo:[...aQ]},borderTopLeftRadius:BQ,borderTopRightRadius:BQ,borderBottomLeftRadius:BQ,borderBottomRightRadius:BQ,boxShadow:VQ};function UQ(e,{layout:t,layoutId:n}){return pX.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!HQ[e]||e===`opacity`)}function WQ(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(MZ(r[t])||i&&MZ(i[t])||UQ(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function GQ(e){return window.getComputedStyle(e)}var KQ=class extends AQ{constructor(){super(...arguments),this.type=`html`,this.renderInstance=RQ}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(pX.has(t))return this.projection?.isProjecting?cX(t):uX(e,t);{let n=GQ(e),r=(pJ(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return NQ(e,t)}build(e,t,n){LQ(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return WQ(e,t,n)}};function qQ(e,t){return e in t}var JQ=class extends kQ{constructor(){super(...arguments),this.type=`object`}readValueFromInstance(e,t){if(qQ(t,e)){let n=e[t];if(typeof n==`string`||typeof n==`number`)return n}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return hQ()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}},YQ={offset:`stroke-dashoffset`,array:`stroke-dasharray`},XQ={offset:`strokeDashoffset`,array:`strokeDasharray`};function ZQ(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?YQ:XQ;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var QQ=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function $Q(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(LQ(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of QQ)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&ZQ(d,i,a,o,!1)}var e$=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),t$=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function n$(e,t,n,r){RQ(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(e$.has(n)?n:FZ(n),t.attrs[n])}function r$(e,t,n){let r=WQ(e,t,n);for(let n in e)if(MZ(e[n])||MZ(t[n])){let t=fX.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var i$=class extends AQ{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=hQ}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(pX.has(t)){let e=$Z(t);return e&&e.default||0}return t=e$.has(t)?t:FZ(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return r$(e,t,n)}build(e,t,n){$Q(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){n$(e,t,n,r)}mount(e){this.isSVGTag=t$(e.tagName),super.mount(e)}};function a$(e,t,n){let r=MZ(e)?e:uZ(e);return r.start(bZ(``,r,t,n)),r.animation}function o$(e){return typeof e==`object`&&!Array.isArray(e)}function s$(e,t,n,r){return e==null?[]:typeof e==`string`&&o$(t)?oQ(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>e!=null):[e]}function c$(e,t,n){return e*(t+1)+n*t}function l$(e,t,n,r){return typeof t==`number`?t:t.startsWith(`-`)||t.startsWith(`+`)?Math.max(0,e+parseFloat(t)):t===`<`?n:t.startsWith(`<`)?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function u$(e,t,n){for(let r=0;r<e.length;r++){let i=e[r];i.at>t&&i.at<n&&(_q(e,i),r--)}}function d$(e,t,n,r,i,a){u$(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:aY(i,a,r[o]),easing:Xq(n,o)})}function f$(e,t,n=0){let r=t+1+t*n;for(let t=0;t<e.length;t++)e[t]=e[t]/r}function p$(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}var m$=`easeInOut`,h$=20;function g$(e,{defaultTransition:t={},...n}={},r,i){let a=t.duration||.3,o=new Map,s=new Map,c={},l=new Map,u=0,d=0,f=0;for(let n=0;n<e.length;n++){let o=e[n];if(typeof o==`string`){l.set(o,d);continue}if(!Array.isArray(o)){l.set(o.name,l$(d,o.at,u,l));continue}let[p,m,h={}]=o;h.at!==void 0&&(d=l$(d,h.at,u,l));let g=0,_=(e,n,r,o=0,s=0)=>{let c=y$(e),{delay:l=0,times:u=HY(c),type:p=t.type||`keyframes`,repeat:m,repeatType:h,repeatDelay:_=0,...v}=n,{ease:y=t.ease||`easeOut`,duration:b}=n,x=typeof l==`function`?l(o,s):l,S=c.length,C=LX(p)?p:i?.[p||`keyframes`];if(S<=2&&C){let e=100;if(S===2&&S$(c)){let t=c[1]-c[0];e=Math.abs(t)}let n={...t,...v};b!==void 0&&(n.duration=Oq(b));let r=wY(n,e,C);y=r.ease,b=r.duration}b??=a;let w=d+x;u.length===1&&u[0]===0&&(u[1]=1);let T=u.length-c.length;if(T>0&&VY(u,T),c.length===1&&c.unshift(null),m&&`${m}${h$}`,m&&m<h$){let e=b>0?_/b:0;b=c$(b,m,_);let t=[...c],n=[...u];y=Array.isArray(y)?[...y]:[y];let r=[...y],i=h===`reverse`||h===`mirror`,a=t,o=r;i&&(a=[...t].reverse(),h===`reverse`&&(o=[...r].reverse().map(e=>typeof e==`function`?Rq(e):e)));for(let s=0;s<m;s++){let l=i&&s%2==0,d=l?a:t,f=l?o:r,p=(s+1)*(1+e);e>0&&(c.push(c[c.length-1]),u.push(p),y.push(`linear`)),c.push(...d);for(let e=0;e<d.length;e++)u.push(n[e]+p),y.push(e===0?`linear`:Xq(f,e-1))}f$(u,m,e)}let E=w+b;d$(r,c,y,u,w,E),g=Math.max(x+b,g),f=Math.max(E,f)};if(MZ(p)){let e=_$(p,s);_(m,h,v$(`default`,e))}else{let e=s$(p,m,r,c),t=e.length;for(let n=0;n<t;n++){m=m,h=h;let r=e[n],i=_$(r,s);for(let e in m)_(m[e],b$(h,e),v$(e,i),n,t)}}u=d,d+=g}return s.forEach((e,r)=>{for(let i in e){let a=e[i];a.sort(p$);let s=[],c=[],l=[];for(let e=0;e<a.length;e++){let{at:t,value:n,easing:r}=a[e];s.push(n),c.push(Eq(0,f,t)),l.push(r||`easeOut`)}c[0]!==0&&(c.unshift(0),s.unshift(s[0]),l.unshift(m$)),c[c.length-1]!==1&&(c.push(1),s.push(null)),o.has(r)||o.set(r,{keyframes:{},transition:{}});let u=o.get(r);u.keyframes[i]=s;let{type:d,...p}=t;u.transition[i]={...p,duration:f,ease:l,times:c,...n}}}),o}function _$(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function v$(e,t){return t[e]||(t[e]=[]),t[e]}function y$(e){return Array.isArray(e)?e:[e]}function b$(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}var x$=e=>typeof e==`number`,S$=e=>e.every(x$);function C$(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=uQ(e)&&!dQ(e)?new i$(t):new KQ(t);n.mount(e),gQ.set(e,n)}function w$(e){let t=new JQ({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),gQ.set(e,t)}function T$(e,t){return MZ(e)||typeof e==`number`||typeof e==`string`&&!o$(t)}function E$(e,t,n,r){let i=[];if(T$(e,t))i.push(a$(e,o$(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;let a=s$(e,t,r),o=a.length;for(let e=0;e<o;e++){let r=a[e],s=r instanceof Element?C$:w$;gQ.has(r)||s(r);let c=gQ.get(r),l={...n};`delay`in l&&typeof l.delay==`function`&&(l.delay=l.delay(e,o)),i.push(...zZ(c,{...t,transition:l},{}))}}return i}function D$(e,t,n){let r=[];return g$(e.map(e=>{if(Array.isArray(e)&&typeof e[0]==`function`){let t=e[0],n=uZ(0);return n.on(`change`,t),e.length===1?[n,[0,1]]:e.length===2?[n,[0,1],e[1]]:[n,e[1],e[2]]}return e}),t,n,{spring:FY}).forEach(({keyframes:e,transition:t},n)=>{r.push(...E$(n,e,t))}),r}function O$(e){return Array.isArray(e)&&e.some(Array.isArray)}function k$(e={}){let{scope:t,reduceMotion:n,skipAnimations:r}=e;function i(e,i,a){let o=[],s,c={};if(n!==void 0&&(c.reduceMotion=n),r!==void 0&&(c.skipAnimations=r),O$(e)){let{onComplete:n,...r}=i||{};typeof n==`function`&&(s=n),o=D$(e,{...c,...r},t)}else{let{onComplete:n,...r}=a||{};typeof n==`function`&&(s=n),o=E$(e,i,{...c,...r},t)}let l=new aZ(o);return s&&l.finished.then(s),t&&(t.animations.push(l),l.finished.then(()=>{_q(t.animations,l)})),l}return i}var A$=k$();Ra({},{Collapsible:()=>I$,Content:()=>N$,Root:()=>P$,Trigger:()=>F$,useCollapsibleContext:()=>M$});var j$=I();function M$(){let e=L(j$);if(e===void 0)throw Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function N$(e){let[t,n]=A(),r=M$(),[i,a]=B(Z({id:r.generateId(`content`)},e),[`ref`,`id`,`style`]),{present:o}=ao({show:r.shouldMount,element:()=>t()??null}),[s,c]=A(0),[l,u]=A(0),d=r.isOpen()||o();return se(()=>{let e=requestAnimationFrame(()=>{d=!1});P(()=>{cancelAnimationFrame(e)})}),M(oe(o,()=>{if(!t())return;t().style.transitionDuration=`0s`,t().style.animationName=`none`;let e=t().getBoundingClientRect();c(e.height),u(e.width),d||(t().style.transitionDuration=``,t().style.animationName=``)})),M(oe(r.isOpen,e=>{!e&&t()&&(t().style.transitionDuration=``,t().style.animationName=``)},{defer:!0})),M(()=>P(r.registerContentId(i.id))),R(H,{get when(){return o()},get children(){return R(Da,z({as:`div`,ref(e){var t=Xr(n,i.ref);typeof t==`function`&&t(e)},get id(){return i.id},get style(){return Yr({"--kb-collapsible-content-height":s()?`${s()}px`:void 0,"--kb-collapsible-content-width":l()?`${l()}px`:void 0},i.style)}},()=>r.dataset(),a))}})}function P$(e){let[t,n]=B(Z({id:`collapsible-${We()}`},e),[`open`,`defaultOpen`,`onOpenChange`,`disabled`,`forceMount`]),[r,i]=A(),a=Pa({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:e=>t.onOpenChange?.(e)}),o=N(()=>({"data-expanded":a.isOpen()?``:void 0,"data-closed":a.isOpen()?void 0:``,"data-disabled":t.disabled?``:void 0})),s={dataset:o,isOpen:a.isOpen,disabled:()=>t.disabled??!1,shouldMount:()=>t.forceMount||a.isOpen(),contentId:r,toggle:a.toggle,generateId:ni(()=>n.id),registerContentId:Ua(i)};return R(j$.Provider,{value:s,get children(){return R(Da,z({as:`div`},o,n))}})}function F$(e){let t=M$(),[n,r]=B(e,[`onClick`]);return R(Va,z({get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return U(()=>!!t.isOpen())()?t.contentId():void 0},get disabled(){return t.disabled()},onClick:e=>{X(e,n.onClick),t.toggle()}},()=>t.dataset(),r))}var I$=Object.assign(P$,{Content:N$,Trigger:F$}),L$=W(`<div data-slot=collapsible-arrow><span data-slot=collapsible-arrow-icon>`);function R$(e){let[t,n]=B(e,[`class`,`classList`,`variant`]);return R(I$,z({"data-component":`collapsible`,get"data-variant"(){return t.variant||`normal`},get classList(){return{...t.classList,[t.class??``]:!!t.class}}},n))}function z$(e){return R(I$.Trigger,z({"data-slot":`collapsible-trigger`},e))}function B$(e){return R(I$.Content,z({"data-slot":`collapsible-content`},e))}function V$(e){return(()=>{var t=L$(),n=t.firstChild;return gt(t,e||{},!1,!0),K(n,R(Fo,{name:`fill-triangle-down`,size:`small`})),t})()}var H$=Object.assign(R$,{Arrow:V$,Trigger:z$,Content:B$}),U$=W(`<div data-component=tool-trigger><div data-slot=basic-tool-tool-trigger-content><div data-slot=basic-tool-tool-info>`),W$=W(`<span data-slot=basic-tool-tool-subtitle>`),G$=W(`<span data-slot=basic-tool-tool-action>`),K$=W(`<div data-slot=basic-tool-tool-info-structured><div data-slot=basic-tool-tool-info-main><span data-slot=basic-tool-tool-title>`),q$=W(`<span data-slot=basic-tool-tool-arg>`),J$=W(`<div data-slot=collapsible-content data-animated>`),Y$=W(`<div data-slot=collapsible-trigger data-locked>`),X$=e=>typeof e!=`object`||!e||typeof Node<`u`&&e instanceof Node?!1:`title`in e&&typeof e.title==`string`,Z$={type:`spring`,visualDuration:.35,bounce:0},Q$=[],$$;function e1(){for(;Q$.length>0;){let e=Q$.pop();if(e.active){$$=Q$.length>0?requestAnimationFrame(e1):void 0,e.fn();return}}$$=void 0}function t1(){$$===void 0&&($$=requestAnimationFrame(()=>{$$=requestAnimationFrame(e1)}))}function n1(e){let t={active:!0,fn:e};return Q$.push(t),t1(),()=>{t.active=!1}}function r1(e){let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)}function i1(e){let[t,n]=$t({open:e.defaultOpen??!1,ready:!e.defer&&(e.defaultOpen??!1)}),r=()=>e.open??t.open,i=()=>t.ready,a=()=>e.status===`streaming`||e.status===`running`,o=()=>e.hasContent??(e.defer?`children`in e:e.children),s=N(()=>{let t=e.trigger;return typeof t==`function`?t(r):t}),c=N(()=>{let e=s();return X$(e)?e:void 0}),l,u=()=>{l?.(),l=void 0},d=(e=!1)=>{u(),l=(e?n1:r1)(()=>{l=void 0,r()&&n(`ready`,!0)})};P(u),se(()=>{e.defer&&r()&&d(!0)});let f=t=>{e.open===void 0&&n(`open`,t),e.onOpenChange?.(t)};M(()=>{e.forceOpen&&(r()||f(!0))}),M(oe(r,t=>{if(e.defer){if(!t){u(),n(`ready`,!1);return}d()}},{defer:!0}));let p,m,h=r();M(oe(r,t=>{e.animated&&p&&(m?.stop(),t?(p.style.overflow=`hidden`,m=A$(p,{height:`auto`},Z$),m.finished.then(()=>{p&&r()&&(p.style.overflow=`visible`,p.style.height=`auto`)})):(p.style.overflow=`hidden`,m=A$(p,{height:`0px`},Z$)))},{defer:!0})),P(()=>{m?.stop()});let g=t=>{(!a()||e.allowOpenWhilePending)&&(!e.locked||t)&&f(t)},_=()=>(()=>{var t=U$(),n=t.firstChild.firstChild;return K(n,R(qe,{get children(){return[R(Je,{get when(){return c()},children:t=>(()=>{var n=K$(),r=n.firstChild,i=r.firstChild;return K(i,R(hq,{get text(){return t().title},get active(){return a()}})),K(r,R(H,{get when(){return!a()||t().subtitle||t().args?.length},get children(){return[R(H,{get when(){return t().subtitle},get children(){var n=W$();return n.$$click=t=>{e.onSubtitleClick&&(t.stopPropagation(),e.onSubtitleClick())},K(n,()=>t().subtitle),j(r=>pt(n,{[t().subtitleClass??``]:!!t().subtitleClass,clickable:!!e.onSubtitleClick},r)),n}}),R(H,{get when(){return t().args?.length},get children(){return R(V,{get each(){return t().args},children:e=>(()=>{var n=q$();return K(n,e),j(e=>pt(n,{[t().argsClass??``]:!!t().argsClass},e)),n})()})}})]}}),null),K(n,R(H,{get when(){return U(()=>!a())()&&t().action},get children(){var e=G$();return K(e,()=>t().action),e}}),null),j(e=>pt(i,{[t().titleClass??``]:!!t().titleClass},e)),n})()}),R(Je,{when:!0,get children(){return s()}})]}})),K(t,R(H,{get when(){return U(()=>!(!o()||e.hideDetails||e.locked))()&&(!a()||e.allowOpenWhilePending)},get children(){return R(H$.Arrow,{})}}),null),j(n=>{var r=e.clickable?`true`:void 0,i=e.hideDetails?`true`:void 0;return r!==n.e&&G(t,`data-clickable`,n.e=r),i!==n.t&&G(t,`data-hide-details`,n.t=i),n},{e:void 0,t:void 0}),t})();return R(H$,{get open(){return r()},get onOpenChange(){return e.locked?void 0:g},class:`tool-collapsible`,get"data-compact"(){return e.compact?`true`:void 0},get"data-rail"(){return e.rail===!1?`false`:void 0},get children(){return[R(H,{get when(){return U(()=>!e.locked)()&&(e.triggerAsLink||e.triggerHref)},get fallback(){return R(H,{get when(){return!e.locked},get fallback(){return(()=>{var t=Y$();return K(t,_),j(()=>G(t,`data-hide-details`,e.hideDetails?`true`:void 0)),t})()},get children(){return R(H$.Trigger,{get"data-hide-details"(){return e.hideDetails?`true`:void 0},get onClick(){return e.onTriggerClick},get children(){return _()}})}})},get children(){return R(H$.Trigger,{as:`a`,get href(){return e.triggerHref},get role(){return!e.triggerHref&&e.clickable?`button`:void 0},get tabIndex(){return!e.triggerHref&&e.clickable?0:void 0},get"data-hide-details"(){return e.hideDetails?`true`:void 0},get onClick(){return e.onTriggerClick},get onKeyDown(){return e.onTriggerKeyDown},get children(){return _()}})}}),R(H,{get when(){return U(()=>!!(e.animated&&o()))()&&!e.hideDetails},get children(){var t=J$(),n=p;return typeof n==`function`?_t(n,t):p=t,ht(t,`height`,h?`auto`:`0px`),ht(t,`overflow`,h?`visible`:`hidden`),K(t,R(H,{get when(){return!e.defer||i()},get children(){return e.children}})),t}}),R(H,{get when(){return U(()=>!(e.animated||!o()))()&&!e.hideDetails},get children(){return R(H$.Content,{get children(){return R(H,{get when(){return!e.defer||i()},get children(){return e.children}})}})}})]}})}function a1(e){return[`description`,`query`,`url`,`path`,`pattern`,`name`].map(t=>e?.[t]).find(e=>typeof e==`string`&&e.length>0)}function o1(e){if(!e)return[];let t=new Set([`description`,`query`,`url`,`path`,`pattern`,`name`]);return Object.entries(e).filter(([e])=>!t.has(e)).flatMap(([e,t])=>typeof t==`string`||typeof t==`number`||typeof t==`boolean`?[`${e}=${t}`]:[]).slice(0,3)}function s1(e){let t=Ml();return R(i1,{icon:`mcp`,get status(){return e.status},get trigger(){return{title:t.t(`ui.basicTool.called`,{tool:e.tool}),subtitle:a1(e.input),args:o1(e.input)}},get hideDetails(){return e.hideDetails}})}ct([`click`]);var c1=W(`<div>`);function l1(e,t){return t?e?typeof e==`string`?`${e};--card-accent:${t};`:{...e,"--card-accent":t}:{"--card-accent":t}:e}function u1(e){let[t,n]=B(e,[`variant`,`style`,`class`,`classList`]),r=()=>t.variant??`normal`,i=()=>{let e=r();if(e===`error`)return`var(--v2-state-fg-danger)`;if(e===`warning`)return`var(--icon-warning-active)`;if(e===`success`)return`var(--icon-success-active)`;if(e===`info`)return`var(--icon-info-active)`};return(()=>{var a=c1();return gt(a,z(n,{"data-component":`card`,get"data-variant"(){return r()},get style(){return l1(t.style,i())},get classList(){return{...t.classList,[t.class??``]:!!t.class}}}),!1,!0),K(a,()=>e.children),a})()}function d1(e){let[t,n]=B(e,[`class`,`classList`,`children`]);return(()=>{var e=c1();return gt(e,z(n,{"data-slot":`card-description`,get classList(){return{...t.classList,[t.class??``]:!!t.class}}}),!1,!0),K(e,()=>t.children),e})()}var f1=new Map(k_.flatMap(e=>[e.id,...e.aliases??[]].map(t=>[t,e.name])));function p1(e,t,n){if(t===`application/pdf`)return`PDF`;let r=WK(e),i=r.lastIndexOf(`.`),a=i<=0?``:r.slice(i+1).toLowerCase();return a?f1.get(a)??a.toUpperCase():n}var m1=W(`<div data-slot=user-message-comments>`),h1=W(`<div data-slot=user-message-attachments>`),g1=W(`<div data-slot=user-message-attachment data-type=image data-clickable=true><img data-slot=user-message-attachment-image>`),_1=W(`<div data-slot=user-message-body><div data-slot=user-message-text dir=auto>`),v1=W(`<span data-slot=user-message-meta class="text-12-regular text-text-weak cursor-default">`),y1=W(`<span data-slot=user-message-meta-sep class="text-12-regular text-text-weak cursor-default">\xA0·\xA0`),b1=W(`<div data-slot=user-message-copy-wrapper><span data-slot=user-message-meta-wrap><span data-slot=user-message-meta-tail class="text-12-regular text-text-weak cursor-default">`),x1=W(`<div data-component=user-message>`),S1=W(`<span>`),C1=W(`<div data-component=text-part><div data-slot=text-part-body>`),w1=W(`<div data-component=session-compaction-message><div class=py-2>`),T1=W(`<span data-slot=text-part-meta class="text-12-regular text-text-weak cursor-default">`),E1=W(`<div data-slot=text-part-copy-wrapper>`),D1=W(`<div data-component=reasoning-part>`),O1=W(`<span data-slot=basic-tool-tool-subtitle>`),k1=W(`<div data-slot=basic-tool-tool-info-structured><div data-slot=basic-tool-tool-info-main><span data-slot=basic-tool-tool-title>`);async function A1(e){let t=typeof document>`u`?void 0:document.body;if(t){let n=document.createElement(`textarea`);n.value=e,n.setAttribute(`readonly`,``),n.style.position=`fixed`,n.style.opacity=`0`,n.style.pointerEvents=`none`,t.appendChild(n),n.select();let r=document.execCommand(`copy`);if(t.removeChild(n),r)return!0}let n=typeof navigator>`u`?void 0:navigator.clipboard;return n?.writeText?n.writeText(e).then(()=>!0,()=>!1):!1}function j1(e){let t=()=>e.icon===`copy`?`outline-copy`:e.icon;return R(wl,{appearance:`compact`,get value(){return e.label},placement:`top`,gutter:4,get children(){return R(zo,{get icon(){return R(Fo,{get name(){return t()},size:`small`})},size:`normal`,variant:`ghost-muted`,get disabled(){return e.disabled},get onMouseDown(){return e.onMouseDown},get onClick(){return e.onClick},get"aria-label"(){return e[`aria-label`]}})}})}var M1=24,N1=512,P1=/[\s.,!?;:)\]]/;function F1(e){return e<=12?2:e<=48?4:e<=96?8:Math.min(256,Math.ceil(e/4))}function I1(e,t){let n=Math.min(e.length,t+F1(e.length-t)),r=Math.min(e.length,n+8);for(let t=n;t<r;t++)if(P1.test(e[t]??``))return t+1;return n}function L1(e,t){let[n,r]=A(e()),i=e(),a,o=()=>{a&&=(clearTimeout(a),void 0)},s=e=>{i=e,r(e)},c=()=>{a=void 0;let n=e();if(!t?.()){s(n);return}if(!n.startsWith(i)||n.length<=i.length){s(n);return}if(n.length-i.length<=N1){s(n);return}let r=I1(n,i.length);s(n.slice(0,r)),r<n.length&&(a=setTimeout(c,M1))};return M(()=>{let n=e();if(!t?.()){o(),s(n);return}if(!n.startsWith(i)||n.length<i.length){o(),s(n);return}if(n.length-i.length<=N1){o(),s(n);return}n.length===i.length||a||(a=setTimeout(c,M1))}),P(()=>{o()}),n}function R1(e){let t=L1(()=>e.text,()=>e.streaming);return R(H,{get when(){return t()},get children(){return R(NK,{get text(){return t()},get cacheKey(){return e.cacheKey},get streaming(){return e.streaming},deferUntilReady:!0})}})}function z1(e){let t=Ml(),[n,r]=$t({expanded:!1}),i=N(()=>e.bounded&&!n.expanded?e.comments.slice(0,5):e.comments);return(()=>{var a=m1();return K(a,R(V,{get each(){return i()},children:e=>R(cq,{get comment(){return e.comment},get path(){return e.path},get selection(){return e.selection},get title(){return e.comment},tooltip:!0,wide:!0})}),null),K(a,R(H,{get when(){return U(()=>!!(e.bounded&&e.comments.length>5))()&&!n.expanded},get children(){return R(Io,{size:`small`,variant:`ghost-muted`,onClick:()=>r(`expanded`,!0),get children(){return t.t(`ui.common.showMore`)}})}}),null),j(()=>G(a,`data-bounded`,e.bounded?`true`:void 0)),a})()}function B1(e){let t=MM(),n=wo(),r=Ml(),[i,a]=$t({copied:!1,reverting:!1}),o=N(()=>(e.message.files??[]).filter(e=>!e.mention)),s=N(()=>(e.message.files??[]).filter(e=>!!e.mention)),c=N(()=>e.message.agents??[]),l=N(()=>e.comments??[]),u=N(()=>(t.store.provider?.all?.get(e.model.providerID))?.models?.[e.model.id]?.name??e.model.id),d=N(()=>new Intl.DateTimeFormat(r.locale(),{timeStyle:`short`})),f=N(()=>{let t=e.agent;return[t?t[0]?.toUpperCase()+t.slice(1):``,u()].filter(Boolean).join(`\xA0·\xA0`)}),p=N(()=>d().format(e.message.time.created)),m=async()=>{e.text&&await A1(e.text)&&(a(`copied`,!0),setTimeout(()=>a(`copied`,!1),2e3))},h=async()=>{if(e.actions?.revert&&!i.reverting){a(`reverting`,!0);try{await e.actions.revert({sessionID:e.sessionID,messageID:e.message.id})}finally{a(`reverting`,!1)}}},g=()=>R(H,{get when(){return o().length>0},get children(){var t=h1();return K(t,R(V,{get each(){return o()},children:t=>{let i=()=>t.source.type===`uri`?t.source.uri:`data:${t.mime};base64,${t.data}`,a=()=>t.name??r.t(`ui.message.attachment.alt`),o=()=>t.mime.startsWith(`image/`);return R(H,{get when(){return!o()},get fallback(){return(()=>{var e=g1(),t=e.firstChild;return e.$$click=()=>n.show(()=>R(UK,{get src(){return i()},get alt(){return a()}})),j(e=>{var n=i(),r=a();return n!==e.e&&G(t,`src`,e.e=n),r!==e.t&&G(t,`alt`,e.t=r),e},{e:void 0,t:void 0}),e})()},get children(){return R(JK,{get title(){return WK(a())},get hover(){return a()},get clickable(){return!!e.actions?.openAttachment},onClick:()=>e.actions?.openAttachment?.(t),get children(){return p1(a(),t.mime,r.t(`ui.common.file`))}})}})}})),t}});return(()=>{var t=x1();return K(t,R(H,{get when(){return e.text},get fallback(){return R(H,{get when(){return l().length>0},get children(){return R(z1,{get comments(){return l()},bounded:!1})}})},get children(){var t=_1(),n=t.firstChild;return K(n,R(V1,{get text(){return e.text},get files(){return s()},get agents(){return c()}}),null),K(n,R(H,{get when(){return l().length>0},get children(){return R(z1,{get comments(){return l()},bounded:!0})}}),null),j(()=>G(n,`data-comments`,l().length>0?`true`:void 0)),t}}),null),K(t,g,null),K(t,R(H,{get when(){return e.text||l().length>0},get children(){var t=b1(),n=t.firstChild,a=n.firstChild;return K(n,R(H,{get when(){return f()},get children(){var e=v1();return K(e,f),e}}),a),K(n,R(H,{get when(){return U(()=>!!f())()&&p()},get children(){return y1()}}),a),K(a,p),K(t,R(H,{get when(){return e.actions?.revert},get children(){return R(j1,{icon:`reset`,get label(){return r.t(`ui.message.revertMessage`)},get disabled(){return i.reverting},onMouseDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation(),h()},get"aria-label"(){return r.t(`ui.message.revertMessage`)}})}}),null),K(t,R(H,{get when(){return e.text},get children(){return R(j1,{get icon(){return i.copied?`check`:`copy`},get label(){return U(()=>!!i.copied)()?r.t(`ui.message.copied`):r.t(`ui.message.copyMessage`)},onMouseDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation(),m()},get"aria-label"(){return U(()=>!!i.copied)()?r.t(`ui.message.copied`):r.t(`ui.message.copyMessage`)}})}}),null),t}}),null),j(()=>G(t,`data-timeline-part-id`,e.text?`${e.message.id}:text:0`:void 0)),t})()}function V1(e){let t=N(()=>{let t=[...e.files.flatMap(e=>e.mention?[{start:e.mention.start,end:e.mention.end,type:`file`}]:[]),...e.agents.flatMap(e=>e.mention?[{start:e.mention.start,end:e.mention.end,type:`agent`}]:[])].sort((e,t)=>e.start-t.start),n=[],r=0;return t.forEach(t=>{t.start<r||(t.start>r&&n.push({text:e.text.slice(r,t.start)}),n.push({text:e.text.slice(t.start,t.end),type:t.type}),r=t.end)}),r<e.text.length&&n.push({text:e.text.slice(r)}),n});return R(V,{get each(){return t()},children:e=>(()=>{var t=S1();return K(t,()=>e.text),j(()=>G(t,`data-highlight`,e.type)),t})()})}function H1(e){let t=Ml(),n=()=>e.message.status===`failed`?``:e.message.summary,r=()=>e.message.status!==`failed`||e.message.error.type===`aborted`?``:e.error;return(()=>{var i=w1(),a=i.firstChild;return K(a,R(VV,{get label(){return t.t(`ui.messagePart.compaction`)}})),K(i,R(H,{get when(){return n().trim()},get children(){var t=C1(),r=t.firstChild;return K(r,R(R1,{get text(){return n()},get cacheKey(){return e.message.id},get streaming(){return e.message.status===`running`}})),j(()=>G(t,`data-timeline-part-id`,e.message.id)),t}}),null),K(i,R(H,{get when(){return r()},get children(){return R(u1,{variant:`error`,class:`error-card`,get children(){return r()}})}}),null),i})()}function U1(e){let t=MM(),n=Ml(),r=N(()=>new Intl.NumberFormat(n.locale())),i=()=>{let t=e.message.error?.type.toLowerCase();return!!t&&(t.includes(`abort`)||t.includes(`interrupt`))},a=N(()=>(t.store.provider?.all?.get(e.message.model.providerID))?.models?.[e.message.model.id]?.name??e.message.model.id),o=N(()=>{let t=e.message.time.completed,i=e.turnDurationMs===null?-1:typeof e.turnDurationMs==`number`?e.turnDurationMs:typeof t==`number`?t-e.message.time.created:-1;if(!(i>=0))return``;let a=Math.round(i/1e3);return a<60?n.t(`ui.message.duration.seconds`,{count:r().format(a)}):n.t(`ui.message.duration.minutesSeconds`,{minutes:r().format(Math.floor(a/60)),seconds:r().format(a%60)})}),s=N(()=>{let t=e.message.agent;return[t?t[0]?.toUpperCase()+t.slice(1):``,a(),o(),i()?n.t(`ui.message.interrupted`):``].filter(Boolean).join(` · `)}),[c,l]=A(!1),u=async()=>{await A1(e.text)&&(l(!0),setTimeout(()=>l(!1),2e3))};return R(H,{get when(){return e.text},get children(){var t=C1(),r=t.firstChild;return K(r,R(R1,{get text(){return e.text},get cacheKey(){return e.id},get streaming(){return typeof e.message.time.completed!=`number`}})),K(t,R(H,{get when(){return e.showCopy},get children(){var e=E1();return K(e,R(j1,{get icon(){return c()?`check`:`copy`},get label(){return U(()=>!!c())()?n.t(`ui.message.copied`):n.t(`ui.message.copyResponse`)},onMouseDown:e=>e.preventDefault(),onClick:u,get"aria-label"(){return U(()=>!!c())()?n.t(`ui.message.copied`):n.t(`ui.message.copyResponse`)}}),null),K(e,R(H,{get when(){return s()},get children(){var e=T1();return K(e,s),e}}),null),j(()=>G(e,`data-interrupted`,i()?``:void 0)),e}}),null),j(()=>G(t,`data-timeline-part-id`,e.id)),t}})}function W1(e){let t=Ml(),[n,r]=$t({}),i=()=>e.open??n.open??e.defaultOpen??!1,a=N(()=>e.streaming?NV(e.content.text):``),o=N(()=>{let n=e.content.time;if(n?.completed===void 0)return;let r=Math.max(0,Math.round((n.completed-n.created)/1e3)),i=new Intl.NumberFormat(t.locale());return r<60?t.t(`ui.message.duration.seconds`,{count:i.format(r)}):t.t(`ui.message.duration.minutesSeconds`,{minutes:i.format(Math.floor(r/60)),seconds:i.format(r%60)})});return(()=>{var n=D1();return K(n,R(i1,{icon:`mcp`,get status(){return e.streaming?`running`:`completed`},compact:!0,hasContent:!0,allowOpenWhilePending:!0,get hideDetails(){return!e.content.text.trim()},get open(){return i()},onOpenChange:t=>{r(`open`,t),e.onOpenChange?.(t),e.onContentRendered?.()},get trigger(){return(()=>{var n=k1(),r=n.firstChild,s=r.firstChild;return K(s,R(hq,{get text(){return t.t(e.streaming?`ui.sessionTurn.status.thinking`:`ui.message.thought`)},get active(){return e.streaming}})),K(r,R(H,{get when(){return U(()=>!!e.streaming)()&&!i()},get fallback(){return R(H,{get when(){return U(()=>!e.streaming)()&&o()},children:e=>(()=>{var t=O1();return K(t,e),t})()})},get children(){var e=O1();return K(e,R(pq,{get text(){return a()}})),e}}),null),n})()},get children(){return R(R1,{get text(){return e.content.text},get cacheKey(){return e.id},get streaming(){return e.streaming}})}})),j(()=>G(n,`data-timeline-part-id`,e.id)),n})()}ct([`click`]);function G1({onlyFirst:e=!1}={}){return RegExp(`(?:\\u001B\\][^\\u0007\\u001B\\u009C]*(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`,e?void 0:`g`)}var K1=G1();function q1(e){if(typeof e!=`string`)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(K1,``)}Ra({},{Accordion:()=>r0,Content:()=>X1,Header:()=>Z1,Item:()=>e0,Root:()=>t0,Trigger:()=>n0,useAccordionContext:()=>$1});var J1=I();function Y1(){let e=L(J1);if(e===void 0)throw Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function X1(e){let t=Y1(),[n,r]=B(Z({id:t.generateId(`content`)},e),[`id`,`style`]);return M(()=>P(t.registerContentId(n.id))),R(N$,z({role:`region`,get"aria-labelledby"(){return t.triggerId()},get style(){return Yr({"--kb-accordion-content-height":`var(--kb-collapsible-content-height)`,"--kb-accordion-content-width":`var(--kb-collapsible-content-width)`},n.style)}},r))}function Z1(e){let t=M$();return R(Da,z({as:`h3`},()=>t.dataset(),e))}var Q1=I();function $1(){let e=L(Q1);if(e===void 0)throw Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function e0(e){let t=$1(),[n,r]=B(Z({id:`${t.generateId(`item`)}-${We()}`},e),[`value`,`disabled`]),[i,a]=A(),[o,s]=A(),c=()=>t.listState().selectionManager(),l=()=>c().isSelected(n.value),u={value:()=>n.value,triggerId:i,contentId:o,generateId:ni(()=>r.id),registerTriggerId:Ua(a),registerContentId:Ua(s)};return R(J1.Provider,{value:u,get children(){return R(P$,z({get open(){return l()},get disabled(){return n.disabled}},r))}})}function t0(e){let t,[n,r]=B(Z({id:`accordion-${We()}`,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[`id`,`ref`,`value`,`defaultValue`,`onChange`,`multiple`,`collapsible`,`shouldFocusWrap`,`onKeyDown`,`onMouseDown`,`onFocusIn`,`onFocusOut`]),[i,a]=A([]),{DomCollectionProvider:o}=du({items:i,onItemsChange:a}),s=eu({selectedKeys:()=>n.value,defaultSelectedKeys:()=>n.defaultValue,onSelectionChange:e=>n.onChange?.(Array.from(e)),disallowEmptySelection:()=>!n.multiple&&!n.collapsible,selectionMode:()=>n.multiple?`multiple`:`single`,dataSource:i});s.selectionManager().setFocusedKey(`item-1`);let c=Ku({selectionManager:()=>s.selectionManager(),collection:()=>s.collection(),disallowEmptySelection:()=>s.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>n.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>t),l={listState:()=>s,generateId:ni(()=>n.id)};return R(o,{get children(){return R(Q1.Provider,{value:l,get children(){return R(Da,z({as:`div`,get id(){return n.id},ref(e){var r=Xr(e=>t=e,n.ref);typeof r==`function`&&r(e)},get onKeyDown(){return vi([n.onKeyDown,c.onKeyDown])},get onMouseDown(){return vi([n.onMouseDown,c.onMouseDown])},get onFocusIn(){return vi([n.onFocusIn])},get onFocusOut(){return vi([n.onFocusOut,c.onFocusOut])}},r))}})}})}function n0(e){let t,n=$1(),r=Y1(),i=M$(),[a,o]=B(Z({id:r.generateId(`trigger`)},e),[`ref`,`onPointerDown`,`onPointerUp`,`onClick`,`onKeyDown`,`onMouseDown`,`onFocus`]);fu({getItem:()=>({ref:()=>t,type:`item`,key:r.value(),textValue:``,disabled:i.disabled()})});let s=Zl({key:()=>r.value(),selectionManager:()=>n.listState().selectionManager(),disabled:()=>i.disabled(),shouldSelectOnPressUp:!0},()=>t);return M(()=>P(r.registerTriggerId(o.id))),R(F$,z({ref(e){var n=Xr(e=>t=e,a.ref);typeof n==`function`&&n(e)},get"data-key"(){return s.dataKey()},get onPointerDown(){return vi([a.onPointerDown,s.onPointerDown])},get onPointerUp(){return vi([a.onPointerUp,s.onPointerUp])},get onClick(){return vi([a.onClick,s.onClick])},onKeyDown:e=>{[`Enter`,` `].includes(e.key)&&e.preventDefault(),X(e,a.onKeyDown),X(e,s.onKeyDown)},get onMouseDown(){return vi([a.onMouseDown,s.onMouseDown])},get onFocus(){return vi([a.onFocus,s.onFocus])}},o))}var r0=Object.assign(t0,{Content:X1,Header:Z1,Item:e0,Trigger:n0});function i0(e){let[t,n]=B(e,[`class`,`classList`]);return R(t0,z(n,{"data-component":`accordion`,get classList(){return{...t.classList,[t.class??``]:!!t.class}}}))}function a0(e){let[t,n]=B(e,[`class`,`classList`]);return R(e0,z(n,{"data-slot":`accordion-item`,get classList(){return{...t.classList,[t.class??``]:!!t.class}}}))}function o0(e){let[t,n]=B(e,[`class`,`classList`,`children`]);return R(Z1,z(n,{"data-slot":`accordion-header`,get classList(){return{...t.classList,[t.class??``]:!!t.class}},get children(){return t.children}}))}function s0(e){let[t,n]=B(e,[`class`,`classList`,`children`]);return R(n0,z(n,{"data-slot":`accordion-trigger`,get classList(){return{...t.classList,[t.class??``]:!!t.class}},get children(){return t.children}}))}function c0(e){let[t,n]=B(e,[`class`,`classList`,`children`]);return R(X1,z(n,{"data-slot":`accordion-content`,get classList(){return{...t.classList,[t.class??``]:!!t.class}},get children(){return t.children}}))}var l0=Object.assign(i0,{Item:a0,Header:o0,Trigger:s0,Content:c0});function u0(e){return R(l0.Header,{"data-component":`sticky-accordion-header`,get classList(){return{...e.classList,[e.class??``]:!!e.class}},get children(){return e.children}})}var d0=W(`<a data-slot=basic-tool-tool-subtitle class="clickable subagent-link">`),f0=W(`<div data-component=tool-trigger><div data-slot=basic-tool-tool-trigger-content><span data-slot=basic-tool-tool-indicator data-component=tool-error-card-icon></span><div data-slot=basic-tool-tool-info><div data-slot=basic-tool-tool-info-structured><div data-slot=basic-tool-tool-info-main><span data-slot=basic-tool-tool-title></span><span data-slot=tool-error-card-summary>`),p0=W(`<div data-slot=tool-error-card-copy>`),m0=W(`<div data-slot=tool-error-card-content>`),h0=W(`<span data-slot=basic-tool-tool-subtitle>`);function g0(e){let t=Ml(),[n,r]=$t({open:e.defaultOpen??!1,copied:!1}),i=()=>e.open??n.open,a=()=>n.copied,[o,s]=B(e,[`tool`,`error`,`title`,`defaultOpen`,`open`,`onOpenChange`,`subtitle`,`href`,`onSubtitleClick`]),c=t=>{e.open===void 0&&r(`open`,t),e.onOpenChange?.(t)},l=N(()=>{if(o.title)return o.title;let e={read:`ui.tool.read`,list:`ui.tool.list`,glob:`ui.tool.glob`,grep:`ui.tool.grep`,subagent:`ui.tool.agent.default`,webfetch:`ui.tool.webfetch`,websearch:`ui.tool.websearch`,shell:`ui.tool.shell`,execute:`ui.tool.execute`,patch:`ui.tool.patch`,question:`ui.tool.questions`}[o.tool];return e?e.includes(`.`)?t.t(e):e:o.tool}),u=N(()=>o.error.replace(/^Error:\s*/,``).trim()),d=N(()=>{let e=u(),t=`${o.tool} `;return e.startsWith(t)?e.slice(t.length):e}),f=N(()=>{let e=(d().split(`: `)[0]??``).trim();return e?e[0].toUpperCase()+e.slice(1):t.t(`ui.toolErrorCard.failed`)}),p=N(()=>{let e=d().split(`: `);return e.length<=1?``:e.slice(1).join(`: `).trim()}),m=async()=>{let e=u();e&&(await navigator.clipboard.writeText(e),r(`copied`,!0),setTimeout(()=>r(`copied`,!1),2e3))};return R(u1,z(s,{"data-kind":`tool-error-card`,get"data-open"(){return i()?`true`:`false`},variant:`error`,get children(){return R(H$,{class:`tool-collapsible`,get"data-open"(){return i()?`true`:`false`},get open(){return i()},onOpenChange:c,get children(){return[R(H$.Trigger,{get children(){var e=f0(),t=e.firstChild.firstChild,n=t.nextSibling.firstChild.firstChild,r=n.firstChild,i=r.nextSibling;return K(t,R(Fo,{name:`outline-hexagonal-warning`})),K(r,l),K(n,R(H,{get when(){return o.subtitle},get children(){return R(H,{get when(){return o.href},get fallback(){return(()=>{var e=h0();return K(e,()=>o.subtitle),e})()},get children(){var e=d0();return e.$$click=e=>{e.stopPropagation(),o.onSubtitleClick?.(e)},K(e,()=>o.subtitle),j(()=>G(e,`href`,o.href)),e}})}}),i),K(i,f),K(e,R(H$.Arrow,{}),null),e}}),R(H,{get when(){return p()},get children(){return R(H$.Content,{get children(){var e=m0();return K(e,R(H,{get when(){return i()},get children(){var e=p0();return K(e,R(wl,{appearance:`standard`,get value(){return U(()=>!!a())()?t.t(`ui.message.copied`):t.t(`ui.toolErrorCard.copyError`)},placement:`top`,gutter:4,get children(){return R(zo,{get icon(){return R(Fo,{get name(){return a()?`check`:`copy`}})},size:`normal`,variant:`ghost`,onMouseDown:e=>e.preventDefault(),onClick:e=>{e.stopPropagation(),m()},get"aria-label"(){return U(()=>!!a())()?t.t(`ui.message.copied`):t.t(`ui.toolErrorCard.copyError`)}})}})),e}}),null),K(e,R(d1,{get children(){return p()}}),null),e}})}})]}})}}))}ct([`click`]);var _0=W(`<div data-component=diff-changes><span data-slot=diff-changes-additions></span><span data-slot=diff-changes-deletions>`);function v0(e){let t=N(()=>Array.isArray(e.changes)?e.changes.reduce((e,t)=>e+(t.additions??0),0):e.changes.additions),n=N(()=>Array.isArray(e.changes)?e.changes.reduce((e,t)=>e+(t.deletions??0),0):e.changes.deletions),r=N(()=>(t()??0)+(n()??0));return R(H,{get when(){return r()>0},get children(){var r=_0(),i=r.firstChild,a=i.nextSibling;return K(i,()=>`+${t()}`),K(a,()=>`-${n()}`),j(t=>{var n=e.appearance??`compact`,i={[e.class??``]:!0};return n!==t.e&&G(r,`data-appearance`,t.e=n),t.t=pt(r,i,t.t),t},{e:void 0,t:void 0}),r}})}var y0=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends y0{};function b0(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function x0(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function S0(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function C0(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function w0(e,t){return S0(e,t,``)}function T0(e,t){return C0(e,t,``)}function E0(e,t){return t.slice(0,D0(e,t))}function D0(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function O0(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function k0(e,t){if(t)return j0(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function A0(e,t){if(t)return j0(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function j0(e,t){if(!t)return[A0(e),k0(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=O0(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var M0=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,N0=RegExp(`[${M0}]+|\\s+|[^${M0}]`,`ug`);new class extends y0{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=O0(e,r)}else n=e.match(N0)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&P0(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&P0(n,i,r,null,t.intlSegmenter),e}};function P0(e,t,n,r,i){if(t&&n){let[a,o]=j0(t.value,i),[s,c]=j0(n.value,i);if(e){let r=b0(a,s);e.value=C0(e.value,s,r),t.value=w0(t.value,r),n.value=w0(n.value,r)}if(r){let e=x0(o,c);r.value=S0(r.value,c,e),t.value=T0(t.value,e),n.value=T0(n.value,e)}}else if(n){if(e){let e=A0(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=A0(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=A0(r.value,i),[a,o]=j0(t.value,i),s=b0(n,a);t.value=w0(t.value,s);let c=x0(w0(n,s),o);t.value=T0(t.value,c),r.value=S0(r.value,n,c),e.value=C0(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=A0(r.value,i),n=E0(k0(t.value,i),e);t.value=T0(t.value,n)}else if(e){let n=E0(k0(e.value,i),A0(t.value,i));t.value=w0(t.value,n)}}new class extends y0{tokenize(e){let t=RegExp(`(\\r?\\n)|[${M0}]+|[^\\S\\n\\r]+|[^${M0}]`,`ug`);return e.match(t)||[]}},new class extends y0{constructor(){super(...arguments),this.tokenize=F0}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
787
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
788
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
789
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
790
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function F0(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
791
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function I0(e){return e==`.`||e==`!`||e==`?`}new class extends y0{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(I0(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends y0{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends y0{constructor(){super(...arguments),this.tokenize=F0}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(L0(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function L0(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=L0(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=L0(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends y0{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function R0(e){let t=e.split(/\n/),n=[],r=0;function i(){let e={};for(n.push(e);r<t.length;){let n=t[r];if(/^(---|\+\+\+|@@)\s/.test(n))break;let i=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(n);i&&(e.index=n.substring(i[0].length).trim()),r++}for(a(e),a(e),e.hunks=[];r<t.length;){let n=t[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(n))break;if(/^@@/.test(n))e.hunks.push(o());else if(n)throw Error(`Unknown line `+(r+1)+` `+JSON.stringify(n));else r++}}function a(e){let n=/^(---|\+\+\+)\s+/.exec(t[r]);if(n){let i=n[1],a=t[r].substring(3).trim().split(` `,2),o=(a[1]||``).trim(),s=a[0].replace(/\\\\/g,`\\`);s.startsWith(`"`)&&s.endsWith(`"`)&&(s=s.substr(1,s.length-2)),i===`---`?(e.oldFileName=s,e.oldHeader=o):(e.newFileName=s,e.newHeader=o),r++}}function o(){let e=r,n=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),i={oldStart:+n[1],oldLines:n[2]===void 0?1:+n[2],newStart:+n[3],newLines:n[4]===void 0?1:+n[4],lines:[]};i.oldLines===0&&(i.oldStart+=1),i.newLines===0&&(i.newStart+=1);let a=0,o=0;for(;r<t.length&&(o<i.oldLines||a<i.newLines||t[r]?.startsWith(`\\`));r++){let n=t[r].length==0&&r!=t.length-1?` `:t[r][0];if(n===`+`||n===`-`||n===` `||n===`\\`)i.lines.push(t[r]),n===`+`?a++:n===`-`?o++:n===` `&&(a++,o++);else throw Error(`Hunk at line ${e+1} contained invalid line ${t[r]}`)}if(!a&&i.newLines===1&&(i.newLines=0),!o&&i.oldLines===1&&(i.oldLines=0),a!==i.newLines)throw Error(`Added line count did not match for hunk at line `+(e+1));if(o!==i.oldLines)throw Error(`Removed line count did not match for hunk at line `+(e+1));return i}for(;r<t.length;)i();return n}var z0=16,B0=new Map;function V0(e){return typeof e.patch==`string`?U0(e.file,e.patch):K0(e.file,typeof e.before==`string`?e.before:``,typeof e.after==`string`?e.after:``)}function H0(e){return{file:e.file,additions:e.additions,deletions:e.deletions,status:e.status,fileDiff:V0(e)}}function U0(e,t){let n=`${e}\0${t}`,r=B0.get(n);if(r)return B0.delete(n),B0.set(n,r),r;let i=W0(t),a=i?void 0:G0(e,t),o=i?K0(e,i.before,i.after):(a?oO(a)[0]?.files[0]:void 0)??J0(e);for(o.cacheKey??=q0(n),B0.set(n,o);B0.size>z0;)B0.delete(B0.keys().next().value);return o}function W0(e){try{let t=R0(e)[0];if(!t||!t.index&&!t.oldFileName&&!t.newFileName||!e.startsWith(`diff --git `)&&!/^--- [^\n]*\t\r?\n\+\+\+ [^\n]*\t(?:\r?\n|$)/m.test(e)||t.hunks.length!==1)return;let n=t.hunks[0];if(!n||n.oldStart>1||n.newStart>1)return;let r=[],i=[],a;for(let e of n.lines){if(e.startsWith(`\\`)){if(a===`-`||a===` `){let e=r.at(-1);e&&(e.newline=!1)}if(a===`+`||a===` `){let e=i.at(-1);e&&(e.newline=!1)}continue}if(e.startsWith(`-`)){r.push({text:e.slice(1),newline:!0}),a=`-`;continue}if(e.startsWith(`+`)){i.push({text:e.slice(1),newline:!0}),a=`+`;continue}if(!e.startsWith(` `))return;r.push({text:e.slice(1),newline:!0}),i.push({text:e.slice(1),newline:!0}),a=` `}let o=e=>e.map(e=>e.text+(e.newline?`
|
|
792
|
+
`:``)).join(``);return{before:o(r),after:o(i)}}catch{return}}function G0(e,t){try{let n=R0(t)[0];return n?n.index||n.oldFileName||n.newFileName?t:n.hunks.length?`Index: ${e}\n===================================================================\n--- ${e}\t\n+++ ${e}\t\n${t}`:void 0:void 0}catch{return}}function K0(e,t,n){if(!t&&!n)return J0(e);let r=nk({name:e,contents:t},{name:e,contents:n});return r.cacheKey=q0(`${e}\0${t}\0${n}`),r}function q0(e){return`${e.length}:${Zp(e)??0}`}function J0(e){return nk({name:e,contents:``},{name:e,contents:``})}function Y0(e){return!e||typeof e!=`object`||!(`file`in e)||typeof e.file!=`string`||!(`patch`in e)||typeof e.patch!=`string`||!(`additions`in e)||typeof e.additions!=`number`||!(`deletions`in e)||typeof e.deletions!=`number`||!(`status`in e)||e.status!==`added`&&e.status!==`deleted`&&e.status!==`modified`?!1:e.additions>0||e.deletions>0}function X0(e){if(!Y0(e))return;let t;return{path:e.file,type:e.status===`added`?`add`:e.status===`deleted`?`delete`:`update`,additions:e.additions,deletions:e.deletions,get view(){return t??=H0(e)},contents:W0(e.patch)}}function Z0(e){return Array.isArray(e)?e.map(X0).filter(e=>!!e):[]}function Q0(e){return[...Z0(e).reduce((e,t)=>{let n=e.get(t.path);return n&&n.push(t),n||e.set(t.path,[t]),e},new Map)].map(([e,t])=>{let n=t[0],r=t.at(-1),i=r.type===`delete`?`delete`:n.type===`add`?`add`:`update`;if(!t.every((e,n)=>!!e.contents&&(n===0||t[n-1]?.contents?.after===e.contents.before)))return{path:e,type:i,additions:t.reduce((e,t)=>e+t.additions,0),deletions:t.reduce((e,t)=>e+t.deletions,0),views:t.map(e=>e.view)};let a=t.length===1?n.view:H0({file:e,before:n.contents.before,after:r.contents.after,status:i===`add`?`added`:i===`delete`?`deleted`:`modified`,additions:0,deletions:0}),o=a.fileDiff.hunks.reduce((e,t)=>({additions:e.additions+t.additionLines,deletions:e.deletions+t.deletionLines}),{additions:0,deletions:0});return{path:e,type:i,...o,views:[{...a,...o}]}})}var $0=W(`<svg><defs><filter filterUnits=userSpaceOnUse x=0 y=0 width=16 height=16><feFlood flood-color=currentColor result=color></feFlood><feComposite in=color in2=SourceAlpha operator=in></feComposite></filter><clipPath><path></path></clipPath></defs><image data-frame-content x=0 y=0 width=16 height=16></image><rect data-reduced-motion x=7.5 y=7.5 width=2 height=2>`),e2=new URL(`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACGFjVEwAAAAkAAAAAL0MSdQAAAAaZmNUTAAAAAAAAAAQAAAAEAAAAAAAAAAAAAEAHgAAeGnEiQAAAChJREFUeNpjYKAG+P//vzG5eNQAOhiADIaBAfVIeIgasB8Jww0beAMAAcvtF7z+xvIAAAAaZmNUTAAAAAEAAAAQAAAAEAAAAAAAAAAAAAEAHgAA4xouXQAAADlmZEFUAAAAAnjaY2CgBvj//78xuXjUADoYgAyGkAEVSPglEk5DwoPQAGRNyUj4ChKegIThhg28AQCHCO3v9vSM9QAAABpmY1RMAAAAAwAAABAAAAAQAAAAAAAAAAAAAQAeAAAOjP20AAAAOWZkQVQAAAAEeNpjYKAG+P//vzG5eNQAOhiADIaQAZuQ8HUkHICEB6EByJq6kPAGJJyBhOGGDbwBAME/7ogd07A4AAAAGmZjVEwAAAAFAAAAEAAAABAAAAAAAAAAAAABAB4AAONGj84AAAA5ZmRBVAAAAAZ42mNgoAb4//+/Mbl41AA6GIAMhpAB95HwSSRsj4QHoQHImlYi4clI2BMJww0beAMAtN7u/Yo3jeUAAAAaZmNUTAAAAAcAAAAQAAAAEAAAAAAAAAAAAAEAHgAADtBcJwAAADlmZEFUAAAACHjaY2CgBvj//78xuXjUADoYgAyGkAG/kfBBJGyKhAehAcia9iDhJiRshoThhg28AQBd9e9gN/7mcAAAABpmY1RMAAAACQAAABAAAAAQAAAAAAAAAAAAAQAeAADjo217AAAANWZkQVQAAAAKeNpjYKAG+P//vzG5eNQAKhoQjgMjg0FugA8SfoGElyHhQW4ALk1FSHiQGgAAlc/u64UC44QAAAAaZmNUTAAAAAsAAAAQAAAAEAAAAAAAAAAAAAEAHgAADjW+kgAAADVmZEFUAAAADHjaY2CgBvj//78xuXjUACoaMB0HRgaD3IByJHwQCVcj4UFuAC5NUUh4kBoAAF9m7lIeWdi1AAAAGmZjVEwAAAANAAAAEAAAABAAAAAAAAAAAAABAB4AAOP/zOgAAAA1ZmRBVAAAAA542mNgoAb4//+/Mbl41AAqGnAKB0YGg9yA2Uh4ARIOR8KD3ABcmtyR8CA1AADbGe2n0LJXAwAAABpmY1RMAAAADwAAABAAAAAQAAAAAAAAAAAAAQAeAAAOaR8BAAAANWZkQVQAAAAQeNpjYKAG+P//vzG5eNQAKhrwAQdGBoPcgK1IuBMJ2yHhQW4ALk2WSHiQGgAAWnvtX1kT8yQAAAAaZmNUTAAAABEAAAAQAAAAEAAAAAAAAAAAAAEAHgAA4mioEQAAADBmZEFUAAAAEnjaY2CgBvj//78xuXjUACoaQAwY5AbsR8L1SJjoMBh4A0jSNLgMAACaJe0XdM6fPgAAABpmY1RMAAAAEwAAABAAAAAQAAAAAAAAAAAAAQAeAAAP/nv4AAAAPmZkQVQAAAAUeNpjYKAG+P//fwUSNiYFDx4DkpEwSYYNHgOuIOGXSBgZDHIDJiDhNCRMdBgMvAEkaRpcBgAAVrTt7/r/V2YAAAAaZmNUTAAAABUAAAAQAAAAEAAAAAAAAAAAAAEAHgAA4jQJggAAAD5mZEFUAAAAFnjaY2CgBvj///8mJGxMCh48BnQhYZIMGzwGbEDC15EwMhjkBmQg4QAkTHQYDLwBJGkaXAYAAAoz7ojYXBW3AAAAGmZjVEwAAAAXAAAAEAAAABAAAAAAAAAAAAABAB4AAA+i2msAAAA+ZmRBVAAAABh42mNgoAb4////fSRsTAoePAasRMIkGTZ4DJiMhE8iYWQwyA3wRML2SJjoMBh4A0jSNLgMAACRCO798w7XFgAAABpmY1RMAAAAGQAAABAAAAAQAAAAAAAAAAAAAQAeAADi0es3AAAAPmZkQVQAAAAaeNpjYKAG+P///28kbEwKHjwG7EHCJBk2eAxoQsIHkTAyGOQGmCFhUyRMdBgMvAEkaRpcBgAAY5fvYHjnWwYAAAAaZmNUTAAAABsAAAAQAAAAEAAAAAAAAAAAAAEAHgAAD0c43gAAADpmZEFUAAAAHHjaY2CgBvj///8LJOyDhMORsDE2PHgMWIaEkQ0bQgYUIWFkw5DBIDfAmFw8agAVDAAAo7bu644KyeIAAAAaZmNUTAAAAB0AAAAQAAAAEAAAAAAAAAAAAAEAHgAA4o1KpAAAADpmZEFUAAAAHnjaY2CgBvj///9BJFyOhKcjYWNsePAYUI2EkQ0bQgZEIWFkw5DBIDfAmFw8agAVDAAAQZ7uUlrM3IIAAAAaZmNUTAAAAB8AAAAQAAAAEAAAAAAAAAAAAAEAHgAADxuZTQAAADpmZEFUAAAAIHjaY2CgBvj///8CJDwbCZ9CwsbY8OAxIBwJIxs2hAxwR8LIhiGDQW6AMbl41AAqGAAADzPtp1TcBaQAAAAaZmNUTAAAACEAAAAQAAAAEAAAAAAAAAAAAAEAHgAA4f8ixQAAADpmZEFUAAAAInjaY2CgBvj//38nEt6KhD8gYWNsePAYYIeEkQ0bQgZYImFkw5DBIDfAmFw8agAVDAAANyLtX/RrDIEAAAAaZmNUTAAAACMAAAAQAAAAEAAAAAAAAAAAAAEAHgAADGnxLAAAADJmZEFUAAAAJHjaY2CgBvj//389Et6PhJGBMTY8eAxAFkQ2bIgagIyHgQEE8agBVDAAADge7RendZX+AAAAGmZjVEwAAAAlAAAAEAAAABAAAAAAAAAAAAABAB4AAOGjg1YAAABBZmRBVAAAACZ42mNgoAb4//9/GhKegISvIOFkJFwBw4PHAGMkjGzYSyRcgYTh6genAcgYGWBVM/gNIIhHDaCCAQDjv+3vdQR+4gAAABpmY1RMAAAAJwAAABAAAAAQAAAAAAAAAAAAAQAeAAAMNVC/AAAAQWZkQVQAAAAoeNpjYKAG+P//fwASzkDCG5BwFxLeBMODxwBjJIxs2HUkvAkJw9UPTgOQMTLAqmbwG0AQjxpABQMA7C7uiK2dJ18AAAAaZmNUTAAAACkAAAAQAAAAEAAAAAAAAAAAAAEAHgAA4UZh4wAAAEJmZEFUAAAAKnjaY2CgBvj//789EvZEwpOR8EokfB+GB48BxkgY2bCTSPg+EoarH5wGIGNkgFXN4DeAIB41gAoGAACzFe79C/hS/gAAABpmY1RMAAAAKwAAABAAAAAQAAAAAAAAAAAAAQAeAAAM0LIKAAAAQWZkQVQAAAAseNpjYKAG+P//vykSNkPCTUh4DxL+DcODxwBjJIxs2EEk/BsJw9UPTgOQMTLAqmbwG0AQjxpABQMAgHTvYDK8McMAAAAaZmNUTAAAAC0AAAAQAAAAEAAAAAAAAAAAAAEAHgAA4RrAcAAAADlmZEFUAAAALnjaY2CgBvj//78xDlyEhJch4RcwPPgNQNb0BQn7wPDgNwAZhGPDg98AgnjUACoYAACnh+9Xt0fS2AAAABpmY1RMAAAALwAAABAAAAAQAAAAAAAAAAAAAQAeAAAMjBOZAAAAOWZkQVQAAAAweNpjYKAG+P//vzEOHIWEq5HwQRge/AYga3qAhMthePAbgAymY8OD3wCCeNQAKhgAAFjx72k7d0QkAAAAGmZjVEwAAAAxAAAAEAAAABAAAAAAAAAAAAABAB4AAOCNpIkAAAA5ZmRBVAAAADJ42mNgoAb4//+/MQ7sjoTDkfACGB78BiBruoCEZ8Pw4DcAGZzChge/AQTxqAFUMAAA5SvvVy2nfzsAAAAaZmNUTAAAADMAAAAQAAAAEAAAAAAAAAAAAAEAHgAADRt3YAAAADlmZEFUAAAANHjaY2CgBvj//78xDmyJhO2QcCcMD34DkDUdQcJbYXjwG4AMPmDDg98AgnjUACoYAABXie9yJzS1EAAAABpmY1RMAAAANQAAABAAAAAQAAAAAAAAAAAAAQAeAADg0QUaAAAALGZkQVQAAAA2eNpjYKAG+P//vzGJuB6Gh5YB+7HhwW8AQTD4DSCIRw2gggEAfM/vV+aCsd4AAAAaZmNUTAAAADcAAAAQAAAAEAAAAAAAAAAAAAEAHgAADUfW8wAAADRmZEFUAAAAOHjaY2CgBvj//78xiTgNhoeWAROw4cFvAEEw+A1AxsnY8NAyABn7wvDAGwAA23vvcr83e3EAAAAaZmNUTAAAADkAAAAQAAAAEAAAAAAAAAAAAAEAHgAA4DTnrwAAADRmZEFUAAAAOnjaY2CgBvj//78xiTgAhoeWARnY8OA3gCAY/AYg4y5seGgZgIyTYXjgDQAAI+vvYKC9wpMAAAAaZmNUTAAAADsAAAAQAAAAEAAAAAAAAAAAAAEAHgAADaI0RgAAADRmZEFUAAAAPHjaY2CgBvj//78xidgehoeWAZ7Y8OA3gCAY/AYg45XY8NAyABmXwPDAGwAA/1HvYKNC9mMAAAAaZmNUTAAAAD0AAAAQAAAAEAAAAAAAAAAAAAEAHgAA4GhGPAAAADRmZEFUAAAAPnjaY2CgBvj//78xidgUhoeWAWbY8OA3gCAY/AYg4z3Y8NAyABnXwfDAGwAA4+jvYGU9ydgAAAAaZmNUTAAAAD8AAAAQAAAAEAAAAAAAAAAAAAEAHgAADf6V1QAAADVmZEFUAAAAQHjaY2CgBvj//78xuXjUADoYgAxuY8OD34BwJLwFCS+D4aFlgA8SboDhgTcAAJfG7v2dtCjJAAAAGmZjVEwAAABBAAAAEAAAABAAAAAAAAAAAAABAB4AAObQN20AAAA1ZmRBVAAAAEJ42mNgoAb4//+/Mbl41AA6GIAMZmPDg9+A6Uh4ARKuhuGhZUA5Em6A4YE3AADstO5J4rYdbgAAABpmY1RMAAAAQwAAABAAAAAQAAAAAAAAAAAAAQAeAAALRuSEAAAANWZkQVQAAABEeNpjYKAG+P//vzG5eNQAOhiADDKw4cFvwCkkPAEJh8Pw0DJgNhJugOGBNwAAkKbtudOlpwsAAAAaZmNUTAAAAEUAAAAQAAAAEAAAAAAAAAAAAAEAHgAA5oyW/gAAADVmZEFUAAAARnjaY2CgBvj//78xuXjUADoYgAycsOHBb8AHJNyChO1geGgZsBUJN8DwwBsAAKAr7VaKiqTBAAAAAElFTkSuQmCC`,``+import.meta.url).href,t2=Array.from({length:25},(e,t)=>`M${1.5+t%5*3} ${1.5+Math.floor(t/5)*3}h2v2h-2z`).join(``);function n2(e){let[t,n]=B(e,[`class`,`classList`,`width`,`height`]),r=We(),i=`session-progress-indicator-filter-${r}`,a=`session-progress-indicator-clip-${r}`;return(()=>{var e=$0(),r=e.firstChild,o=r.firstChild,s=o.nextSibling,c=s.firstChild,l=r.nextSibling;return gt(e,z(n,{get class(){return t.class},get classList(){return t.classList},get width(){return t.width??16},get height(){return t.height??16},viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"data-component":`session-progress-indicator-v2`,get"aria-hidden"(){return n[`aria-hidden`]??`true`}}),!0,!0),G(o,`id`,i),G(s,`id`,a),G(c,`d`,t2),G(l,`href`,e2),G(l,`filter`,`url(#${i})`),G(l,`clip-path`,`url(#${a})`),e})()}var r2=W(`<span data-component=shell-submessage dir=ltr><span data-slot=shell-submessage-width><span data-slot=basic-tool-tool-subtitle><span data-slot=shell-submessage-value>`),i2=W(`<div data-component=diagnostics>`),a2=W(`<div data-slot=diagnostic><span data-slot=diagnostic-label></span><span data-slot=diagnostic-location>[<!>:<!>]</span><span data-slot=diagnostic-message>`),o2=W(`<button type=button data-slot=exa-tool-more>`),s2=W(`<div data-component=exa-tool-output><div data-slot=exa-tool-links>`),c2=W(`<a data-slot=exa-tool-link class=webfetch-link target=_blank rel="noopener noreferrer"><span data-slot=webfetch-link-text>`),l2=W(`<div data-component=context-tool-group-list>`),u2=W(`<div data-component=collapsed-tool-group>`),d2=W(`<div data-component=context-tool-group-trigger><span data-slot=context-tool-group-title><span data-slot=basic-tool-tool-title>`),f2=W(`<span data-slot=context-tool-group-prefix>`),p2=W(`<div data-slot=context-tool-group-item>`),m2=W(`<div data-component=tool-trigger><div data-slot=basic-tool-tool-trigger-content><div data-slot=basic-tool-tool-info><div data-slot=basic-tool-tool-info-structured><div data-slot=basic-tool-tool-info-main><span data-slot=basic-tool-tool-title>`),h2=W(`<div data-component=tool-loaded-item><span data-slot=tool-loaded-label aria-hidden=true></span><span data-slot=tool-loaded-value aria-hidden=true>`),g2=W(`<span data-slot=tool-loaded-kind aria-hidden=true>`),_2=W(`<span data-slot=basic-tool-tool-subtitle>`),v2=W(`<span data-slot=basic-tool-tool-arg>`),y2=W(`<span data-slot=context-tool-group-dot>`),b2=W(`<span data-slot=context-tool-group-matches>`),x2=W(`<div data-component=tool-part-wrapper>`),S2=W(`<span data-slot=apply-patch-directory>`),C2=W(`<div data-slot=apply-patch-trigger-content><div data-slot=apply-patch-file-info><div data-slot=apply-patch-file-name-container><span data-slot=apply-patch-filename></span></div></div><div data-slot=apply-patch-trigger-actions>`),w2=W(`<div style=width:100%;display:flex;justify-content:flex-end><span class="text-13-regular text-text-weak cursor-default">`),T2=W(`<div data-component=read-image><img>`),E2=W(`<div data-component=tool-output data-scrollable tabindex=0 role=region>`),D2=W(`<a data-slot=basic-tool-tool-subtitle class=webfetch-link target=_blank rel="noopener noreferrer"><span data-slot=webfetch-link-text>`),O2=W(`<div data-slot=basic-tool-tool-info-structured><div data-slot=basic-tool-tool-info-main><span data-slot=basic-tool-tool-title>`),k2=W(`<span data-component=task-tool-spinner>`),A2=W(`<div data-component=task-tool-action>`),j2=W(`<div data-component=task-tool-card><div data-component=task-tool-surface><div data-slot=basic-tool-tool-info-structured><div data-slot=basic-tool-tool-info-main><span data-component=task-tool-title>`),M2=W(`<span data-component=task-tool-icon>`),N2=W(`<div data-component=task-tool-delegating class="flex h-9 w-fit max-w-full items-center gap-2 rounded-[8px] bg-v2-background-bg-layer-02 p-2.5 text-[13px] font-[530] leading-text-compact tracking-[-0.04px]">`),P2=W(`<div data-component=bash-output dir=ltr><div data-slot=bash-copy></div><div data-slot=bash-scroll data-scrollable tabindex=0 role=region><pre data-slot=bash-pre><code>`),F2=W(`<span data-slot=bash-command>`),I2=W(`<span data-slot=bash-result>`),L2=W(`<div data-component=session-shell-message>`),R2=W(`<div data-component=edit-content>`),z2=W(`<div data-component=edit-tool>`),B2=W(`<div data-component=write-content>`),V2=W(`<div data-component=write-tool>`),H2=W(`<div data-component=apply-patch-tool>`),U2=W(`<span data-slot=apply-patch-change data-type=added>`),W2=W(`<span data-slot=apply-patch-change data-type=removed>`),G2=W(`<div data-component=apply-patch-file-diff>`),K2=W(`<div data-component=question-answers>`),q2=W(`<div data-slot=question-answer-item><div data-slot=question-text></div><div data-slot=answer-text>`);function J2(e){let t,n;return se(()=>{e.animate&&requestAnimationFrame(()=>{t&&A$(t,{width:`auto`},{type:`spring`,visualDuration:.25,bounce:0}),n&&A$(n,{opacity:1,filter:`blur(0px)`},{duration:.32,ease:[.16,1,.3,1]})})}),(()=>{var r=r2(),i=r.firstChild,a=i.firstChild.firstChild,o=t;typeof o==`function`?_t(o,i):t=i;var s=n;return typeof s==`function`?_t(s,a):n=a,K(a,()=>e.text),j(t=>{var n=e.animate?`0px`:void 0,r=e.animate?{opacity:0,filter:`blur(2px)`}:void 0;return n!==t.e&&ht(i,`width`,t.e=n),t.t=mt(a,r,t.t),t},{e:void 0,t:void 0}),r})()}function Y2(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function X2(e){return Y2(e)&&typeof e.question==`string`}function Z2(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Q2(e){return!e||typeof e!=`object`||!(`message`in e)||typeof e.message!=`string`||!(`range`in e)||!e.range||typeof e.range!=`object`?!1:`start`in e.range&&!!e.range.start&&typeof e.range.start==`object`}function $2(e,t){if(!Y2(e)||!t)return[];let n=e[t];return Array.isArray(n)?n.filter(Q2).filter(e=>e.severity===1).slice(0,3):[]}function e4(e){let t=Ml();return R(H,{get when(){return e.diagnostics.length>0},get children(){var n=i2();return K(n,R(V,{get each(){return e.diagnostics},children:e=>(()=>{var n=a2(),r=n.firstChild,i=r.nextSibling,a=i.firstChild.nextSibling,o=a.nextSibling.nextSibling;o.nextSibling;var s=i.nextSibling;return K(r,()=>t.t(`ui.messagePart.diagnostic.error`)),K(i,()=>e.range.start.line+1,a),K(i,()=>e.range.start.character+1,o),K(s,()=>e.message),n})()})),n}})}function t4(e,t){if(!e)return``;if(!t||t===`/`||t===`\\`)return e;if(e===t)return``;let n=t.includes(`\\`)?`\\`:`/`,r=t.endsWith(n)?t:t+n;return e.startsWith(r)?e.slice(t.length):e}function n4(e){let t=MM();return t4(GK(e),t.directory)}function r4(e,t){return t?e.t(`ui.tool.agent`,{type:t}):e.t(`ui.tool.agent.default`)}var i4={ask:`var(--icon-agent-ask-base)`,build:`var(--icon-agent-build-base)`,docs:`var(--icon-agent-docs-base)`,plan:`var(--icon-agent-plan-base)`},a4={build:`var(--v2-agent-build-solid)`,explore:`var(--v2-agent-explore-solid)`,plan:`var(--v2-agent-plan-solid)`,review:`var(--v2-agent-review-solid)`,writer:`var(--v2-agent-writer-solid)`},o4={primary:`var(--text-interactive-base)`,secondary:`var(--text-base)`,accent:`var(--icon-info-base)`,success:`var(--icon-success-base)`,warning:`var(--icon-warning-base)`,error:`var(--icon-critical-base)`,info:`var(--icon-info-base)`},s4={primary:`var(--v2-text-text-accent)`,secondary:`var(--v2-text-text-muted)`,accent:`var(--v2-icon-icon-accent)`,success:`var(--v2-state-fg-success)`,warning:`var(--v2-state-fg-warning)`,error:`var(--v2-state-fg-danger)`,info:`var(--v2-state-fg-info)`},c4=[`var(--icon-agent-ask-base)`,`var(--icon-agent-build-base)`,`var(--icon-agent-docs-base)`,`var(--icon-agent-plan-base)`,`var(--syntax-info)`,`var(--syntax-success)`,`var(--syntax-warning)`,`var(--syntax-property)`,`var(--syntax-constant)`,`var(--text-diff-add-base)`,`var(--text-diff-delete-base)`,`var(--icon-warning-base)`];function l4(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)>>>0;return c4[t%c4.length]}function u4(e,t){if(typeof e!=`string`||!e)return{};let n=e.toLowerCase(),r=t?.find(t=>t.name===e||t.name.toLowerCase()===n),i=r?.color?void 0:a4[n],a=d4(r?.color,o4)??i4[n]??l4(n),o=d4(r?.color,s4)??i??a;return{name:r?.name??`${e[0].toUpperCase()}${e.slice(1)}`,color:a,v2Color:o}}function d4(e,t){if(e)return t[e]??e}function f4(e,t){let n=e===`parallel`?`Parallel`:e===`exa`?`Exa`:e===`firecrawl`?`Firecrawl`:e===`tavily`?`Tavily`:void 0;return n?t.t(`ui.tool.websearch.provider`,{provider:n}):t.t(`ui.tool.websearch`)}function p4(e){if(typeof e.path==`string`)return e.path}function m4(e){let t=p4(e);if(t&&/\.(png|jpe?g|gif|webp|svg|avif|bmp|ico)$/i.test(t))return t.replaceAll(`\\`,`/`)}function h4(e,t){if(typeof t?.name==`string`)return t.name;if(typeof e.id==`string`)return e.id;if(typeof e.name==`string`)return e.name}function g4(e,t={},n={}){let r=Ml();switch(e){case`read`:{let e=p4(t);return{icon:`glasses`,title:r.t(`ui.tool.read`),subtitle:e?WK(e):void 0}}case`list`:return{icon:`bullet-list`,title:r.t(`ui.tool.list`),subtitle:typeof t.path==`string`?WK(t.path):void 0};case`glob`:return{icon:`magnifying-glass-menu`,title:r.t(`ui.tool.glob`),subtitle:typeof t.pattern==`string`?t.pattern:void 0};case`grep`:return{icon:`magnifying-glass-menu`,title:r.t(`ui.tool.grep`),subtitle:typeof t.pattern==`string`?t.pattern:void 0};case`webfetch`:return{icon:`window-cursor`,title:r.t(`ui.tool.webfetch`),subtitle:typeof t.url==`string`?t.url:void 0};case`websearch`:return{icon:`window-cursor`,title:f4(n?.provider,r),subtitle:typeof t.query==`string`?t.query:void 0};case`subagent`:{let e=t.agent;return{icon:`task`,title:r4(r,typeof e==`string`&&e?e[0].toUpperCase()+e.slice(1):void 0),subtitle:typeof t.description==`string`?t.description:void 0}}case`shell`:return{icon:`console`,title:r.t(`ui.tool.shell`),subtitle:typeof t.command==`string`?t.command:void 0};case`execute`:return{icon:`console`,title:r.t(`ui.tool.execute`),subtitle:typeof t.code==`string`?t.code:void 0};case`edit`:return{icon:`code-lines`,title:r.t(`ui.messagePart.title.edit`),subtitle:typeof t.path==`string`?WK(t.path):void 0};case`write`:return{icon:`code-lines`,title:r.t(`ui.messagePart.title.write`),subtitle:typeof t.path==`string`?WK(t.path):void 0};case`patch`:return{icon:`code-lines`,title:r.t(`ui.tool.patch`),subtitle:Array.isArray(t.files)&&t.files.length?`${t.files.length} ${r.plural(`ui.common.file`,t.files.length)}`:void 0};case`todowrite`:return{icon:`checklist`,title:r.t(`ui.tool.todos`)};case`question`:return{icon:`bubble-5`,title:r.t(`ui.tool.questions`)};case`skill`:return{icon:`brain`,title:h4(t,n)||r.t(`ui.tool.skill`)};default:return{icon:`mcp`,title:e}}}function _4(e){if(!e)return[];let t=new Set;return[...e.matchAll(/https?:\/\/[^\s<>"'`)\]]+/g)].map(e=>e[0].replace(/[),.;:!?]+$/g,``)).filter(e=>!t.has(e)&&(t.add(e),!0))}function v4(e,t){if(e)return t?.(e)}function y4(e,t,n){if(!t)return;let r=typeof e.description==`string`?e.description:``;return(n??[]).filter(e=>e.parentID===t&&!e.time?.archived).filter(e=>!r||e.title?.startsWith(r)).sort((e,t)=>(t.time.created??0)-(e.time.created??0))[0]?.id}function b4(e){let t=Ml(),[n,r]=A(!1),i,a=N(()=>_4(e.output)),o=N(()=>{let e=a();return n()||e.length<=10?e:e.slice(0,10)}),s=N(()=>Math.max(0,a().length-10)),c=e=>{e.stopPropagation(),r(!0),requestAnimationFrame(()=>{i?.focus()})};return R(H,{get when(){return a().length>0},get children(){var e=s2(),r=e.firstChild;return K(r,R(V,{get each(){return o()},children:(e,t)=>(()=>{var n=c2(),r=n.firstChild;return n.$$click=e=>e.stopPropagation(),_t(e=>{t()===10&&(i=e)},n),G(n,`href`,e),K(r,e),K(n,R(Fo,{name:`outline-square-arrow`,class:`webfetch-link-icon`}),null),n})()}),null),K(r,R(H,{get when(){return U(()=>!n())()&&s()>0},get children(){var e=o2();return e.$$click=c,K(e,()=>t.plural(`ui.common.moreCount`,s())),e}}),null),e}})}function x4(e){let t=Ml(),n=N(()=>e.parts.filter(e=>e.type===`tool`)),r=N(()=>e.busy||n().some(e=>e.state.status===`streaming`||e.state.status===`running`)),i=N(()=>[...new Set(e.parts.flatMap(e=>e.type!==`tool`&&e.type!==`shell`?[]:[e.type===`tool`?e.name===`skill`?t.t(`ui.tool.skill`):e.name===`subagent`?t.t(`ui.tool.agent.default`):g4(e.name,void 0,e.name===`websearch`?sV(e):void 0).title:t.t(`ui.tool.shell`)]))].join(`, `)),a=N(()=>{let n=e.parts.filter(e=>e.type===`reasoning`).length;if(!i()&&!n){let e=t.t(`ui.messagePart.context.details`);return{text:e,title:e,before:``,after:``}}let r=i()||t.plural(`ui.messagePart.context.thought`,n),a=e.parts.filter(e=>e.type===`tool`||e.type===`shell`).length||n,o=t.plural(`ui.messagePart.tools.used`,a,{tools:r}),s=o.indexOf(r);return{text:o,title:r,before:o.slice(0,s).trim(),after:o.slice(s+r.length).trim()}}),o=N(()=>e.parts.reduce((e,t)=>{if(t.type!==`tool`)return e.push(t),e;let n=e.at(-1);return t.name===`patch`&&t.state.status!==`error`&&Array.isArray(n)&&n?.[0]?.name===`patch`&&n[0].state.status!==`error`||t.name===`skill`&&t.state.status!==`error`&&h4(oV(t),sV(t))&&Array.isArray(n)&&n?.[0]?.name===`skill`&&n[0].state.status!==`error`&&h4(oV(n[0]),sV(n[0]))?(n.push(t),e):(e.push([t]),e)},[])),s=N(()=>{let t=new Map;return o().forEach(n=>{if(!Array.isArray(n)||n[0]?.name!==`patch`||n[0].state.status===`error`)return;let r=e.patchGroupKey?.(n)??n[0].id;n.forEach(e=>t.set(e,r))}),t}),c=t=>{e.onOpenChange(t),e.onSizeChange?.()};return(()=>{var n=u2();return K(n,R(i1,{icon:`glasses`,get status(){return r()?`running`:`completed`},compact:!0,hasContent:!0,allowOpenWhilePending:!0,get open(){return e.open},onOpenChange:c,get trigger(){return(()=>{var e=d2(),t=e.firstChild,n=t.firstChild;return K(t,R(H,{get when(){return a().before},children:e=>(()=>{var t=f2();return K(t,e),t})()}),n),K(n,()=>a().title),K(t,R(H,{get when(){return a().after},children:e=>(()=>{var t=f2();return K(t,e),t})()}),null),j(()=>G(e,`aria-label`,a().text)),e})()},get children(){var n=l2();return K(n,R(Ke,{get each(){return o()},children:n=>{let r=N(()=>{let e=n();return Array.isArray(e)?e:void 0}),i=N(()=>{let e=n();return!Array.isArray(e)&&e.type===`reasoning`?e:void 0}),a=N(()=>{let e=n();return!Array.isArray(e)&&(e.type===`notice`||e.type===`shell`)?e:void 0});return R(H,{get when(){return r()},get fallback(){return R(H,{get when(){return i()},get fallback(){return R(H,{get when(){return a()},children:e=>(()=>{var t=p2();return K(t,()=>e().render()),t})()})},children:t=>(()=>{var n=p2();return K(n,R(W1,{get id(){return t().id},get content(){return t()},get streaming(){return t().streaming??!1},get defaultOpen(){return e.reasoningDefaultOpen},get open(){return e.reasoningOpen?.(t().id)},onOpenChange:n=>e.onReasoningOpenChange?.(t().id,n),get onContentRendered(){return e.onSizeChange}})),n})()})},children:n=>{let r=N(()=>n()[0]),i=N(()=>w4(r(),t)),a=N(()=>n().flatMap(e=>{let t=h4(oV(e),sV(e));return t?[t]:[]})),o=`__OPENCODE_LOADED_SKILL__`,c=N(()=>t.plural(`ui.tool.loadedSkills`,a().length,{name:o}));return(()=>{var l=p2();return K(l,R(H,{get when(){return U(()=>!(r().state.status===`error`||![`read`,`glob`,`grep`,`list`].includes(r().name)||r().name===`read`&&m4(oV(r()))))()&&!pV(r())},get fallback(){return R(H,{get when(){return U(()=>r().name===`skill`&&n().length>1)()&&a().length===n().length},get fallback(){return R(H,{get when(){return U(()=>r().name===`patch`)()&&r().state.status!==`error`},get fallback(){return R(j4,{get id(){return r().id},get tool(){return r().name},get input(){return oV(r())},get metadata(){return sV(r())},get output(){return cV(r())},get error(){return lV(r())},get status(){return r().state.status},get defaultOpen(){return e.toolDefaultOpen?.(r())??!1},get open(){return e.toolOpen?.(r().id)??e.toolDefaultOpen?.(r())},onOpenChange:t=>e.onToolOpenChange?.(r().id,t),deferContent:!0,virtualizeDiff:!1,get onContentRendered(){return e.onSizeChange}})},get children(){return R(S4,{get tools(){return n()},get fileOpen(){return e.fileOpen&&(t=>e.fileOpen?.(`${s().get(r())}:${t}`))},get onFileOpenChange(){return e.onFileOpenChange&&((t,n)=>e.onFileOpenChange?.(`${s().get(r())}:${t}`,n))},get onSizeChange(){return e.onSizeChange}})}})},get children(){var e=h2(),r=e.firstChild,i=r.nextSibling;return K(r,()=>c().split(o)[0]?.trim()),K(i,R(V,{get each(){return a()},children:(e,t)=>[R(H,{get when(){return t()>0},children:`, `}),R(hq,{as:`span`,text:e,get active(){return[`streaming`,`running`].includes(n()[t()].state.status)}})]})),K(e,R(H,{get when(){return c().split(o)[1]?.trim()},children:e=>(()=>{var t=g2();return K(t,e),t})()}),null),j(r=>{var i=n().map(e=>e.id).join(`,`),o=t.plural(`ui.tool.loadedSkills`,a().length,{name:a().join(`, `)});return i!==r.e&&G(e,`data-timeline-part-ids`,r.e=i),o!==r.t&&G(e,`aria-label`,r.t=o),r},{e:void 0,t:void 0}),e}})},get children(){var e=m2(),t=e.firstChild.firstChild.firstChild,n=t.firstChild,a=n.firstChild;return K(a,R(hq,{get text(){return i().title},get active(){return r().state.status===`streaming`||r().state.status===`running`}})),K(n,R(H,{get when(){return i().subtitle},children:e=>(()=>{var t=_2();return K(t,e),t})()}),null),K(n,R(V,{get each(){return i().args},children:e=>(()=>{var t=v2();return K(t,e),t})()}),null),K(t,R(H,{get when(){return i().matches},children:e=>[y2(),(()=>{var t=b2();return K(t,e),t})()]}),null),e}})),l})()}})}})),n}})),j(()=>G(n,`data-timeline-part-ids`,e.parts.map(e=>e.id).join(`,`))),n})()}function S4(e){let t=N(t=>{let n=e.tools.flatMap(e=>{let t=sV(e).files;return Array.isArray(t)?t.map((t,n)=>({key:`${e.id}:${n}`,toolID:e.id,value:t})):[]}),r=new Map(n.map(e=>[e.key,e.value])),i=new Set(t.map(e=>e.key)),a=new Set(e.tools.map(e=>e.id)),o=[...t.filter(e=>a.has(e.toolID)).map(e=>{if(!r.has(e.key))return e;let t=r.get(e.key);return C4(t,e.value)?e:{...e,value:t}}),...n.filter(e=>!i.has(e.key))];return o.length===t.length&&o.every((e,n)=>e===t[n])?t:o},[]),n=N(()=>({files:t().map(e=>e.value)})),r=N(()=>e.tools.some(e=>e.state.status===`streaming`||e.state.status===`running`)),i=O4.render(`patch`)??s1,a=N(()=>e.tools[0]?.name===`edit`?`edit`:`patch`);return(()=>{var t=x2();return K(t,R(Pt,{component:i,get tool(){return a()},input:{},get metadata(){return n()},get status(){return r()?`running`:`completed`},get fileOpen(){return e.fileOpen},get onFileOpenChange(){return e.onFileOpenChange},deferContent:!0,virtualizeDiff:!1,get onContentRendered(){return e.onSizeChange}})),j(n=>{var r=e.tools.length===1?e.tools[0]?.id:void 0,i=e.tools.length>1?e.tools.map(e=>e.id).join(`,`):void 0;return r!==n.e&&G(t,`data-timeline-part-id`,n.e=r),i!==n.t&&G(t,`data-timeline-part-ids`,n.t=i),n},{e:void 0,t:void 0}),t})()}function C4(e,t){return e===t?!0:!Y2(e)||!Y2(t)?!1:e.file===t.file&&e.patch===t.patch&&e.additions===t.additions&&e.deletions===t.deletions&&e.status===t.status}function w4(e,t){let n=oV(e),r=sV(e),i=typeof n.path==`string`?n.path:`/`,a=typeof n.pattern==`string`?n.pattern:void 0,o=typeof n.include==`string`?n.include:void 0,s=e.name===`glob`?r.count:e.name===`grep`?r.matches:void 0,c=typeof s==`number`&&Number.isFinite(s)&&s!==0?t.plural(`ui.messagePart.context.match`,s):void 0;if(e.name===`read`){let e=[...typeof n.offset==`number`?[`offset=${n.offset}`]:[],...typeof n.limit==`number`?[`limit=${n.limit}`]:[]];return{title:t.t(`ui.tool.read`),subtitle:WK(i),args:e,matches:void 0}}return e.name===`list`?{title:t.t(`ui.tool.list`),subtitle:n4(i),args:[],matches:void 0}:e.name===`glob`?{title:t.t(`ui.tool.glob`),subtitle:n4(i),args:a?[`pattern=${a}`]:[],matches:c}:{title:t.t(`ui.tool.grep`),subtitle:n4(i),args:[...a?[`pattern=${a}`]:[],...o?[`include=${o}`]:[]],matches:c}}var T4={};function E4(e){return T4[e.name]=e,e}function D4(e){return T4[e]?.render}var O4={register:E4,render:D4};function k4(e){let t=Ml();return R(i1,z(e,{open:!0,onOpenChange:void 0,locked:!0,icon:`code-lines`,defer:!1,rail:!1,get trigger(){return{title:e.title,subtitle:e.count>0?`${e.count} ${t.plural(`ui.common.file`,e.count)}`:``}},get children(){return e.children}}))}function A4(e){let t=N(()=>e.path||`tool-file`),[n,r]=A(e.defaultOpen??!1),[i,a]=A(!1),o=()=>e.open??n(),s=t=>{e.open===void 0&&r(t),e.onOpenChange?.(t)};return M(()=>{e.forceOpen&&!o()&&s(!0)}),M(()=>{if(!o()){a(!1);return}let e=requestAnimationFrame(()=>a(!0));P(()=>cancelAnimationFrame(e))}),R(l0,{multiple:!0,"data-scope":`apply-patch`,style:{"--sticky-accordion-offset":`calc(32px + var(--tool-content-gap))`},get value(){return U(()=>!!o())()?[t()]:[]},onChange:e=>s(e.includes(t())),get children(){return R(l0.Item,{get value(){return t()},get children(){return[R(u0,{get children(){return R(l0.Trigger,{get children(){var t=C2(),n=t.firstChild,r=n.firstChild,i=r.firstChild,a=n.nextSibling;return K(n,R(eq,{get node(){return{path:e.path,type:`file`}}}),r),K(r,R(H,{get when(){return e.path.includes(`/`)},get children(){var t=S2();return K(t,()=>`\u202A${n4(e.path)}\u202C`),t}}),i),K(i,()=>WK(e.path)),K(a,()=>e.actions,null),K(a,R(Fo,{name:`chevron-grabber-vertical`,size:`small`}),null),t}})}}),R(l0.Content,{get children(){return R(H,{get when(){return!e.defer||i()},get children(){return e.children}})}})]}})}})}function j4(e){let t=MM(),n=Ml();if(e.tool===`todowrite`)return null;let r=()=>e.tool===`question`&&(e.status===`streaming`||e.status===`running`),i=N(()=>{if(e.tool!==`subagent`)return;let t=e.metadata.sessionID;if(typeof t==`string`&&t)return t}),a=N(()=>v4(i(),t.sessionHref)),o=N(()=>{if(e.tool!==`subagent`)return;let t=e.input.description;return typeof t==`string`&&t?t:i()}),s=N(()=>M4(e,n)),c=N(()=>N4(e,n.t(`ui.toolErrorCard.failed`))),l=N(()=>O4.render(e.tool)??s1);return R(H,{get when(){return!r()},get children(){var r=x2();return K(r,R(qe,{get children(){return[R(Je,{get when(){return c()},children:r=>{let c=r().replace(`Error: `,``);return e.tool===`question`&&c.includes(`dismissed this question`)?(()=>{var e=w2(),t=e.firstChild;return K(t,()=>n.t(`ui.messagePart.questions.dismissed`)),e})():R(g0,{get tool(){return e.tool},get error(){return r()},get title(){return U(()=>e.tool===`websearch`)()?f4(e.metadata.provider,n):void 0},get defaultOpen(){return e.defaultOpen},get open(){return e.open},get onOpenChange(){return e.onOpenChange},get subtitle(){return o()??s()},get href(){return a()},onSubtitleClick:e=>{if(!t.navigateToSession||e.button!==0||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let n=i();n&&(e.preventDefault(),t.navigateToSession(n))}})}}),R(Je,{when:!0,get children(){return R(Pt,z({get component(){return l()}},e))}})]}})),j(()=>G(r,`data-timeline-part-id`,e.id)),r}})}function M4(e,t){let n=e=>typeof e==`string`&&e?e:void 0;if(e.tool===`shell`)return n(e.input.command)??n(e.metadata.command);if(e.tool===`execute`)return n(e.input.code);if(e.tool===`read`)return WK(p4(e.input)??``);if(e.tool===`edit`||e.tool===`write`)return WK(n(e.input.path)??``);if(e.tool===`list`||e.tool===`glob`||e.tool===`grep`)return n4(n(e.input.path)??`/`);if(e.tool===`webfetch`)return n(e.input.url);if(e.tool===`websearch`)return n(e.input.query);if(e.tool===`skill`)return h4(e.input,e.metadata);if(e.tool===`patch`){let n=new Set(Array.isArray(e.metadata.files)?e.metadata.files.filter(Y0).map(e=>e.file):[]).size;return n===0?void 0:`${n} ${t.plural(`ui.common.file`,n)}`}if(e.tool===`question`){let n=Array.isArray(e.input.questions)?e.input.questions.filter(X2).length:0;return n===0?void 0:`${n} ${t.plural(`ui.common.question`,n)}`}}function N4(e,t){if(e.status===`error`)return e.error;if(e.tool===`execute`&&fV(e.metadata))return typeof e.output==`string`&&e.output?e.output:t}O4.register({name:`read`,render(e){let t=MM(),n=Ml(),r=N(()=>e.status===`completed`?m4(e.input):void 0),i=[];typeof e.input.offset==`number`&&i.push(`offset=`+e.input.offset),typeof e.input.limit==`number`&&i.push(`limit=`+e.input.limit);let a=N(()=>{if(e.status!==`completed`)return[];let t=e.metadata.loaded;return!t||!Array.isArray(t)?[]:t.filter(e=>typeof e==`string`)}),o=N(()=>a().map(e=>{let n=t4(e,t.directory);return n===e?n:n.replace(/^[/\\]/,``)})),s=`__OPENCODE_LOADED_PATH__`,c=N(()=>n.t(`ui.tool.loadedFile`,{path:s}).split(s));return[R(i1,z(e,{icon:`glasses`,get hasContent(){return!!r()},defer:!0,onOpenChange:t=>{e.onOpenChange?.(t),e.onContentRendered?.()},get trigger(){return{title:n.t(`ui.tool.read`),subtitle:WK(p4(e.input)??``),args:i}},get children(){return R(H,{get when(){return r()},keyed:!0,children:t=>R(P4,{path:t,get onContentRendered(){return e.onContentRendered}})})}})),R(H,{get when(){return o().length>0},get children(){var e=h2(),t=e.firstChild,r=t.nextSibling;return K(t,()=>c()[0]?.trim()),K(r,()=>o().join(`, `)),K(e,R(H,{get when(){return c()[1]?.trim()},children:e=>(()=>{var t=g2();return K(t,e),t})()}),null),j(()=>G(e,`aria-label`,n.t(`ui.tool.loadedFile`,{path:o().join(`, `)}))),e}})]}});function P4(e){let t=sK(),n;return M(()=>{if(!t?.readImage)return;let e=NG(t.readImage);e.update(n),P(()=>e.dispose())}),se(()=>e.onContentRendered?.()),(()=>{var t=T2(),r=t.firstChild,i=n;return typeof i==`function`?_t(i,t):n=t,r.addEventListener(`error`,()=>e.onContentRendered?.()),r.addEventListener(`load`,()=>e.onContentRendered?.()),j(t=>{var n=e.path,i=WK(e.path);return n!==t.e&&G(r,`data-local-image`,t.e=n),i!==t.t&&G(r,`alt`,t.t=i),t},{e:void 0,t:void 0}),t})()}O4.register({name:`list`,render(e){let t=Ml();return R(i1,z(e,{icon:`bullet-list`,get trigger(){return{title:t.t(`ui.tool.list`),subtitle:n4(typeof e.input.path==`string`?e.input.path:`/`)}},get children(){return R(H,{get when(){return e.output},get children(){var n=E2();return K(n,R(NK,{get text(){return e.output}})),j(()=>G(n,`aria-label`,t.t(`ui.scrollView.ariaLabel`))),n}})}}))}}),O4.register({name:`glob`,render(e){let t=Ml();return R(i1,z(e,{icon:`magnifying-glass-menu`,get trigger(){return{title:t.t(`ui.tool.glob`),subtitle:n4(typeof e.input.path==`string`?e.input.path:`/`),args:typeof e.input.pattern==`string`?[`pattern=`+e.input.pattern]:[]}},get children(){return R(H,{get when(){return e.output},get children(){var n=E2();return K(n,R(NK,{get text(){return e.output}})),j(()=>G(n,`aria-label`,t.t(`ui.scrollView.ariaLabel`))),n}})}}))}}),O4.register({name:`grep`,render(e){let t=Ml(),n=[];return typeof e.input.pattern==`string`&&n.push(`pattern=`+e.input.pattern),typeof e.input.include==`string`&&n.push(`include=`+e.input.include),R(i1,z(e,{icon:`magnifying-glass-menu`,get trigger(){return{title:t.t(`ui.tool.grep`),subtitle:n4(typeof e.input.path==`string`?e.input.path:`/`),args:n}},get children(){return R(H,{get when(){return e.output},get children(){var n=E2();return K(n,R(NK,{get text(){return e.output}})),j(()=>G(n,`aria-label`,t.t(`ui.scrollView.ariaLabel`))),n}})}}))}}),O4.register({name:`webfetch`,render(e){let t=Ml(),n=N(()=>e.status===`streaming`||e.status===`running`),r=N(()=>{let t=e.input.url;return typeof t==`string`?t:``});return R(i1,z(e,{hideDetails:!0,icon:`window-cursor`,get trigger(){return(()=>{var e=O2(),i=e.firstChild,a=i.firstChild;return K(a,R(hq,{get text(){return t.t(`ui.tool.webfetch`)},get active(){return n()}})),K(i,R(H,{get when(){return U(()=>!n())()&&r()},get children(){var e=D2(),t=e.firstChild;return e.$$click=e=>e.stopPropagation(),K(t,r),K(e,R(Fo,{name:`outline-square-arrow`,class:`webfetch-link-icon`}),null),j(()=>G(e,`href`,r())),e}}),null),e})()}}))}}),O4.register({name:`websearch`,render(e){let t=Ml(),n=N(()=>{let t=e.input.query;return typeof t==`string`?t:``}),r=N(()=>f4(e.metadata.provider,t));return R(i1,z(e,{icon:`window-cursor`,get trigger(){return{title:r(),subtitle:n(),subtitleClass:`exa-tool-query`}},get children(){return R(b4,{get output(){return e.output}})}}))}}),O4.register({name:`subagent`,render(e){let t=MM(),n=Ml(),r=()=>e.status===`streaming`,i=N(()=>{let n=e.metadata.sessionID;return typeof n==`string`&&n?n:y4(e.input,t.sessionID,t.store.session)}),a=N(()=>u4(e.input.agent,t.store.agent)),o=N(()=>a().name??n.t(`ui.tool.agent.default`)),s=N(()=>a().color),c=N(()=>a().v2Color),l=N(()=>e.metadata.background===!0||e.status===`completed`&&e.metadata.status===`running`),u=N(()=>{let t=typeof e.input.description==`string`&&e.input.description?e.input.description:i();return t&&(l()?`${t} (background)`:t)}),d=N(()=>{if(e.status===`streaming`||e.status===`running`)return!0;let n=i();return n?(t.store.session_status[n]?.type??`idle`)!==`idle`:!1}),f=N(()=>v4(i(),t.sessionHref)),p=N(()=>!!(i()&&(t.navigateToSession||f()))),m=()=>{let e=i();e&&t.navigateToSession?.(e)},h=e=>{t.navigateToSession&&(e.button!==0||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(e.preventDefault(),m()))},g=e=>{p()&&!f()&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),m())},_=()=>(()=>{var e=j2(),t=e.firstChild.firstChild,n=t.firstChild,r=n.firstChild;return K(n,R(H,{get when(){return d()},get fallback(){return(()=>{var e=M2();return K(e,R(Fo,{name:`subagent`,size:`small`})),e})()},get children(){var e=k2();return K(e,R(n2,{get style(){return{color:c()??`light-dark(var(--v2-text-text-base), #ffffff)`}}})),j(t=>ht(e,`color`,s()??`var(--icon-interactive-base)`)),e}}),r),K(r,o),K(n,R(H,{get when(){return u()},get children(){var e=_2();return K(e,u),e}}),null),K(t,R(H,{get when(){return p()},get children(){var e=A2();return K(e,R(Fo,{name:`chevron-right`,size:`normal`})),e}}),null),j(t=>{var n=c(),r=s();return n!==t.e&&ht(e,`--task-agent-color`,t.e=n),r!==t.t&&ht(e,`--task-agent-color-fallback`,t.t=r),t},{e:void 0,t:void 0}),e})();return R(H,{get when(){return r()},get fallback(){return R(i1,{icon:`task`,get status(){return e.status},get trigger(){return _()},hideDetails:!0,triggerAsLink:!0,get triggerHref(){return f()},get clickable(){return p()},onTriggerClick:h,onTriggerKeyDown:g})},get children(){var e=N2();return K(e,R(Fo,{name:`subagent`,size:`small`,class:`shrink-0 text-v2-icon-icon-faint`}),null),K(e,R(hq,{get text(){return n.t(`ui.tool.agent.delegating`)},class:`min-w-0 truncate`}),null),e}})}});function F4(e){let t=Ml(),[n,r]=A(!1),i=async()=>{e.copy&&await A1(e.copy)&&(r(!0),setTimeout(()=>r(!1),2e3))};return(()=>{var r=P2(),a=r.firstChild,o=a.nextSibling,s=o.firstChild.firstChild;return K(a,R(wl,{get value(){return U(()=>!!n())()?t.t(`ui.message.copied`):t.t(`ui.message.copy`)},placement:`top`,get children(){return R(zo,{get icon(){return R(Fo,{get name(){return n()?`check`:`outline-copy`},size:`small`})},size:`normal`,variant:`ghost-muted`,onMouseDown:e=>e.preventDefault(),onClick:i,get"aria-label"(){return U(()=>!!n())()?t.t(`ui.message.copied`):t.t(`ui.message.copy`)}})}})),K(s,()=>e.children),j(n=>{var i=e.variant,a=t.t(`ui.scrollView.ariaLabel`);return i!==n.e&&G(r,`data-variant`,n.e=i),a!==n.t&&G(o,`aria-label`,n.t=a),n},{e:void 0,t:void 0}),r})()}O4.register({name:`execute`,render(e){let t=Ml(),n=()=>e.status===`streaming`||e.status===`running`,r=N(()=>typeof e.input.code==`string`?e.input.code:``),i=N(()=>q1(e.output??``).replace(/\r\n?/g,`
|
|
793
|
+
`)),a=n();return R(i1,z(e,{icon:`console`,rail:!1,compact:!0,allowOpenWhilePending:!0,trigger:e=>(()=>{var i=O2(),o=i.firstChild,s=o.firstChild;return K(s,R(hq,{get text(){return t.t(`ui.tool.execute`)},get active(){return n()}})),K(o,R(H,{get when(){return U(()=>!e())()&&r()},get children(){return R(J2,{get text(){return r().split(`
|
|
794
|
+
`)[0]},animate:a})}}),null),i})(),get children(){return R(F4,{get copy(){return r()},variant:`shell`,get children(){return[(()=>{var e=F2();return K(e,r),e})(),R(H,{get when(){return i()},children:e=>(()=>{var t=I2();return K(t,e),t})()})]}})}}))}}),O4.register({name:`shell`,render(e){let t=Ml(),n=MM(),r=()=>e.status===`streaming`,i=()=>r()||e.status===`running`||typeof e.metadata.shellID==`string`&&n.shellRunning?.(e.metadata.shellID)===!0,a=r(),[o,s]=A(``),c=N(()=>e.metadata.status===`exited`||e.metadata.status===`timeout`||e.metadata.status===`killed`?e.output:void 0);M(()=>{if(c()!==void 0)return;let t=e.metadata.shellID,r=n.shellOutput;if(typeof t!=`string`||!r)return;let a=n.directory,o=i(),l=0,u=!1,d=!1,f=async()=>{if(!u){u=!0;do{let e=await r({id:t,location:{directory:a},cursor:l}).catch(()=>void 0);if(d||!e||(s(t=>l===0?e.data.output:t+e.data.output),e.data.cursor<=l)||(l=e.data.cursor,o||l>=e.data.size))break}while(!d);u=!1}};f();let p=o?setInterval(()=>void f(),1e3):void 0;P(()=>{d=!0,clearInterval(p)})});let l=()=>typeof e.input.command==`string`?e.input.command:typeof e.metadata.command==`string`?e.metadata.command:``,u=N(()=>q1(c()??(typeof e.metadata.shellID==`string`&&o()||e.output||``)).replace(/\r\n?/g,`
|
|
795
|
+
`));return R(i1,z(e,{icon:`console`,rail:!1,compact:!0,allowOpenWhilePending:!0,trigger:e=>(()=>{var n=O2(),o=n.firstChild,s=o.firstChild;return K(s,R(hq,{get text(){return t.t(`ui.tool.shell`)},get active(){return i()}})),K(o,R(H,{get when(){return!e()},get children(){return R(H,{get when(){return l()},get fallback(){return R(H,{get when(){return r()},get children(){var e=_2();return K(e,()=>t.t(`ui.tool.shell.writingCommand`)),e}})},children:e=>R(J2,{get text(){return e()},animate:a})})}}),null),n})(),get children(){return R(F4,{get copy(){return l()},variant:`shell`,get children(){return[(()=>{var e=F2();return K(e,l),e})(),R(H,{get when(){return u()},children:e=>(()=>{var t=I2();return K(t,e),t})()})]}})}}))}});function I4(e){let t=Ml(),n=O4.render(`shell`)??s1,r=N(()=>{let n=e.message;if(n.status===`timeout`)return t.t(`ui.tool.shell.timeout`);if(n.status===`killed`)return t.t(`ui.tool.shell.cancelled`);if(n.status===`exited`&&n.exit!==void 0&&n.exit!==0)return t.t(`ui.tool.shell.exit`,{code:n.exit})});return(()=>{var t=L2();return K(t,R(Pt,{component:n,tool:`shell`,get input(){return{command:e.message.command}},get metadata(){return{shellID:e.message.shellID,status:e.message.status,exit:e.message.exit,truncated:e.message.output?.truncated}},get output(){return e.message.output?.output},get status(){return e.message.status===`running`?`running`:`completed`},get defaultOpen(){return e.defaultOpen},get open(){return e.open},get onOpenChange(){return e.onOpenChange}}),null),K(t,R(H,{get when(){return r()},children:t=>R(g0,{tool:`shell`,get error(){return t()},get subtitle(){return e.message.command}})}),null),j(()=>G(t,`data-timeline-part-id`,e.message.id)),t})()}O4.register({name:`edit`,render(e){let t=Ml(),n=Xp(),r=()=>typeof e.input.path==`string`?e.input.path:``,i=N(()=>{let t=e.metadata.files;if(Array.isArray(t))return t.find(Y0)}),a=N(()=>$2(e.metadata.diagnostics,r())),o=N(()=>{let e=i();return typeof e?.file==`string`?e.file:r()}),s=()=>e.status===`streaming`||e.status===`running`,c=N(()=>{let e=i();if(e)return{file:typeof e.file==`string`?e.file:r(),patch:typeof e.patch==`string`?e.patch:void 0}},void 0,{equals:(e,t)=>e?.file===t?.file&&e?.patch===t?.patch}),l=N(()=>{try{let e=c();if(e){let t=V0(e);if(t)return{fileDiff:t,hunkSeparators:t.isPartial?`simple`:`line-info-basic`}}}catch{}return{before:{name:o(),contents:typeof e.input.oldString==`string`?e.input.oldString:``},after:{name:o(),contents:typeof e.input.newString==`string`?e.input.newString:``}}});return(()=>{var r=z2();return K(r,R(k4,z(e,{get title(){return t.t(`ui.messagePart.title.edit`)},get count(){return+!!o()},get children(){return[R(H,{get when(){return o()},get children(){return R(A4,{get path(){return o()},get defaultOpen(){return e.defaultOpen},get open(){return e.open},get onOpenChange(){return e.onOpenChange},get forceOpen(){return e.forceOpen},get defer(){return e.deferContent!==!1},get actions(){return R(H,{get when(){return U(()=>!s())()?i():void 0},children:e=>R(v0,{appearance:`standard`,get changes(){return e()}})})},get children(){var t=R2();return K(t,R(Pt,z({component:n,mode:`diff`,get virtualize(){return e.virtualizeDiff},get onRendered(){return e.onContentRendered}},l))),t}})}}),R(e4,{get diagnostics(){return a()}})]}}))),r})()}}),O4.register({name:`write`,render(e){let t=Ml(),n=Xp(),r=N(()=>typeof e.input.path==`string`?e.input.path:``),i=N(()=>typeof e.input.content==`string`?e.input.content:``),a=N(()=>$2(e.metadata.diagnostics,r()));return(()=>{var o=V2();return K(o,R(k4,z(e,{get title(){return t.t(`ui.messagePart.title.write`)},get count(){return+!!r()},get children(){return[R(H,{get when(){return r()},get children(){return R(A4,{get path(){return r()},get defaultOpen(){return e.defaultOpen},get open(){return e.open},get onOpenChange(){return e.onOpenChange},get forceOpen(){return e.forceOpen},get defer(){return e.deferContent!==!1},get children(){var t=B2();return K(t,R(Pt,{component:n,mode:`text`,get file(){return{name:r(),contents:i(),cacheKey:Zp(i())}},overflow:`scroll`,get onRendered(){return e.onContentRendered}})),t}})}}),R(e4,{get diagnostics(){return a()}})]}}))),o})()}}),O4.register({name:`patch`,render(e){let t=Ml(),n=Xp(),r=N(()=>Q0(e.metadata.files)),[i,a]=A([]),o=N(()=>e.tool===`edit`?t.t(`ui.messagePart.title.edit`):t.t(`ui.tool.patch`)),s=N(()=>e.fileOpen?r().flatMap(t=>e.fileOpen?.(t.path)===!0?[t.path]:[]):i()),c=t=>{let n=Array.isArray(t)?t:t?[t]:[];if(!e.onFileOpenChange){a(n);return}r().forEach(t=>e.onFileOpenChange?.(t.path,n.includes(t.path)))};return(()=>{var i=H2();return K(i,R(k4,z(e,{get title(){return o()},get count(){return r().length},get children(){return R(H,{get when(){return r().length>0},get children(){return R(l0,{multiple:!0,"data-scope":`apply-patch`,style:{"--sticky-accordion-offset":`calc(32px + var(--tool-content-gap))`},get value(){return s()},onChange:c,get children(){return R(Ke,{get each(){return r()},children:r=>{let i=()=>r().path,a=N(()=>s().includes(i())),[o,c]=A(!1);return M(()=>{if(!a()){c(!1);return}requestAnimationFrame(()=>{a()&&c(!0)})}),R(l0.Item,{get value(){return i()},get"data-type"(){return r().type},get children(){return[R(u0,{get children(){return R(l0.Trigger,{get children(){var e=C2(),n=e.firstChild,i=n.firstChild,a=i.firstChild,o=n.nextSibling;return K(n,R(eq,{get node(){return{path:r().path,type:`file`}}}),i),K(i,R(H,{get when(){return r().path.includes(`/`)},get children(){var e=S2();return K(e,()=>`\u202A${n4(r().path)}\u202C`),e}}),a),K(a,()=>WK(r().path)),K(o,R(qe,{get children(){return[R(Je,{get when(){return r().type===`add`},get children(){var e=U2();return K(e,()=>t.t(`ui.patch.action.created`)),e}}),R(Je,{get when(){return r().type===`delete`},get children(){var e=W2();return K(e,()=>t.t(`ui.patch.action.deleted`)),e}}),R(Je,{when:!0,get children(){return R(v0,{appearance:`standard`,get changes(){return{additions:r().additions,deletions:r().deletions}}})}})]}}),null),K(o,R(Fo,{name:`chevron-grabber-vertical`,size:`small`}),null),e}})}}),R(l0.Content,{get children(){return R(H,{get when(){return e.deferContent===!1||o()},get children(){return R(V,{get each(){return r().views},children:t=>(()=>{var r=G2();return K(r,R(Pt,{component:n,mode:`diff`,get virtualize(){return e.virtualizeDiff},get fileDiff(){return t.fileDiff},get hunkSeparators(){return t.fileDiff.isPartial?`simple`:`line-info-basic`},get onRendered(){return e.onContentRendered}})),r})()})}})}})]}})}})}})}})}}))),i})()}}),O4.register({name:`question`,render(e){let t=Ml(),n=N(()=>Array.isArray(e.input.questions)?e.input.questions.filter(X2):[]),r=N(()=>Array.isArray(e.metadata.answers)?e.metadata.answers.filter(Z2):[]),i=N(()=>r().length>0),a=N(()=>{let e=n().length;return e===0?``:i()?t.t(`ui.question.subtitle.answered`,{count:e}):`${e} ${t.plural(`ui.common.question`,e)}`});return R(i1,z(e,{get defaultOpen(){return i()},icon:`bubble-5`,get trigger(){return{title:t.t(`ui.tool.questions`),subtitle:a()}},get children(){return R(H,{get when(){return i()},get children(){var e=K2();return K(e,R(V,{get each(){return n()},children:(e,n)=>{let i=()=>r()[n()]??[];return(()=>{var n=q2(),r=n.firstChild,a=r.nextSibling;return K(r,()=>e.question),K(a,()=>i().join(`, `)||t.t(`ui.question.answer.none`)),n})()}})),e}})}}))}}),O4.register({name:`skill`,render(e){let t=Ml(),n=N(()=>h4(e.input,e.metadata)),r=N(()=>e.status===`streaming`||e.status===`running`),i=`__OPENCODE_LOADED_SKILL__`,a=N(()=>t.t(`ui.tool.loadedSkill`,{name:i}).split(i));return R(H,{get when(){return n()},get fallback(){return R(hq,{get text(){return t.t(`ui.tool.skill`)},get active(){return r()}})},children:e=>(()=>{var n=h2(),i=n.firstChild,o=i.nextSibling;return K(i,()=>a()[0].trim()),K(o,R(hq,{as:`span`,get text(){return e()},get active(){return r()}})),K(n,R(H,{get when(){return a()[1]?.trim()},children:e=>(()=>{var t=g2();return K(t,e),t})()}),null),j(()=>G(n,`aria-label`,t.t(`ui.tool.loadedSkill`,{name:e()}))),n})()})}}),ct([`click`]);function L4(e){return R(B1,{get sessionID(){return e.sessionID},get message(){return e.message},get text(){return e.displayText??e.message.text},get comments(){return e.comments},get agent(){return e.historicalAgent},get model(){return e.historicalModel},get actions(){return e.actions}})}function R4(e){return R(qe,{get children(){return[R(Je,{get when(){return U(()=>e.content.type===`text`)()?e.content:void 0},children:t=>R(U1,{get id(){return e.contentID},get text(){return t().text},get message(){return e.message},get showCopy(){return e.showAssistantCopyPartID===e.contentID},get turnDurationMs(){return e.turnDurationMs}})}),R(Je,{get when(){return U(()=>e.content.type===`reasoning`)()?e.content:void 0},children:t=>R(W1,{get id(){return e.contentID},get content(){return t()},streaming:!1,get defaultOpen(){return e.reasoningDefaultOpen},get open(){return e.toolOpen},get onOpenChange(){return e.onToolOpenChange},get onContentRendered(){return e.onContentRendered}})}),R(Je,{get when(){return U(()=>e.content.type===`tool`)()?e.content:void 0},children:t=>R(j4,{get id(){return e.contentID},get tool(){return t().name},get input(){return oV(t())},get metadata(){return sV(t())},get output(){return cV(t())},get status(){return t().state.status},get error(){return lV(t())},get defaultOpen(){return e.defaultOpen},get open(){return e.toolOpen},get onOpenChange(){return e.onToolOpenChange},deferContent:!0,virtualizeDiff:!1,get onContentRendered(){return e.onContentRendered}})})]}})}function z4(e){return R(x4,e)}function B4(e){return R(S4,{get tools(){return e.tools},get fileOpen(){return e.fileOpen},get onFileOpenChange(){return e.onFileOpenChange},get onSizeChange(){return e.onSizeChange}})}var V4=W(`<strong class=font-[530]>`),H4=W(`<div class="flex w-full min-w-0 items-center gap-2"><div class=min-w-0>`);function U4(e){let t=N(()=>{let t=e.message.indexOf(`:`);return t===-1?{detail:e.message}:{title:e.message.slice(0,t+1),detail:e.message.slice(t+1)}});return[R(H,{get when(){return t().title},children:e=>(()=>{var t=V4();return K(t,e),t})()}),U(()=>t().detail)]}function W4(e){return R(u1,{variant:`error`,class:`error-card`,"data-kind":`session-error-card`,get children(){var t=H4(),n=t.firstChild;return K(t,R(Fo,{name:`outline-hexagonal-warning`,class:`shrink-0 text-v2-state-fg-danger`}),n),K(n,R(U4,{get message(){return e.message}})),t}})}var G4=W(`<div data-slot=session-turn-retry-message class="cursor-help truncate">`),K4=W(`<div class="flex w-full items-start gap-2"><div class="min-w-0 flex-1">`),q4=W(`<div data-slot=session-turn-retry class="w-full min-w-0">`),J4=W(`<div data-slot=session-turn-retry-info>`);function Y4(e){let t=Ml(),n=N(()=>{if(e.status.type===`retry`)return e.status}),[r,i]=A(0);M(oe(n,e=>{if(!e)return;let t=()=>{let e=n()?.next;e&&i(Math.round((e-Date.now())/1e3))};t();let r=setInterval(t,1e3);P(()=>clearInterval(r))}));let a=N(()=>{let e=n();return e?e.message.includes(`exceeded your current quota`)&&e.message.includes(`gemini`)?t.t(`ui.sessionTurn.retry.geminiHot`):e.message.length>80?e.message.slice(0,80)+`…`:e.message:``}),o=N(()=>{let e=n();if(!e)return``;let i=Math.max(0,r()),a=i>0?t.t(`ui.sessionTurn.retry.inSeconds`,{seconds:i}):``,o=[t.t(`ui.sessionTurn.retry.retrying`),a].filter(Boolean).join(` `);return o?t.t(`ui.sessionTurn.retry.attemptRetrying`,{line:o,attempt:e.attempt}):t.t(`ui.sessionTurn.retry.attemptLabel`,{attempt:e.attempt})});return R(H,{get when(){return U(()=>!!n())()&&(e.show??!0)},get children(){var e=q4();return K(e,R(u1,{variant:`error`,class:`error-card`,"data-kind":`session-retry-card`,get children(){var e=K4(),t=e.firstChild;return K(e,R(Fo,{name:`outline-hexagonal-warning`,class:`mt-0.5 shrink-0 text-v2-state-fg-danger`}),t),K(t,R(wl,{appearance:`standard`,get value(){return n()?.message??``},placement:`top`,get children(){var e=G4();return K(e,R(U4,{get message(){return a()}})),e}}),null),K(t,R(H,{get when(){return o()},children:e=>(()=>{var t=J4();return K(t,R(hq,{get text(){return e()},active:!0})),t})()}),null),e}})),e}})}var X4=W(`<div><div data-component=session-turn class="min-w-0 w-full relative"style=height:auto>`),Z4=W(`<div data-slot=session-turn-message-container><div data-slot=session-turn-compaction>`),Q4=W(`<div data-slot=session-timeline-notice><div class="flex min-h-5 min-w-0 items-center gap-2 overflow-hidden"><bdi dir=auto class="shrink-0 text-[13px] font-[530] leading-text-compact tracking-[-0.04px] text-v2-text-text-faint">`),$4=W(`<div data-slot=session-timeline-notice><bdi dir=auto class=font-[530]>`),e3=W(`<span><bdi dir=auto>`),t3=W(`<bdi dir=auto class="min-w-0 truncate text-[13px] font-[440] leading-text-compact tracking-[-0.04px] text-v2-text-text-faint">`),n3=W(`<div data-slot=session-timeline-notice data-type=model-switched>`),r3=W(`<bdi data-slot=session-timeline-notice-label dir=auto class=font-[530]>`),i3=W(`<div data-slot=session-timeline-notice data-type=location-switched> <bdi data-slot=session-timeline-notice-value dir=ltr class="min-w-0 truncate font-[440]">`),a3=W(`<div data-slot=session-turn-message-container>`),o3=W(`<div data-timeline-row=TurnGap aria-hidden=true class=h-6>`),s3=W(`<div data-slot=session-turn-message-container><div data-slot=session-turn-message-content aria-live=off>`),c3=W(`<div data-slot=session-turn-message-container><div data-slot=session-turn-compaction><div class=py-2>`),l3=W(`<div data-slot=session-turn-message-container><div data-slot=session-turn-assistant-content>`),u3=W(`<div data-slot=session-turn-message-container><div data-slot=session-turn-thinking-row>`),d3=[];function f3(e){let t=Ml(),n=MM(),r=e.disclosure.patchGroupKeys??new Map,i=new WeakMap,a=N(()=>{let t=new Map;return e.projection.rows().forEach(n=>{n._tag===`AssistantPart`&&n.group.type===`context`&&n.group.refs.forEach(n=>{let i=xV.resolveContent(e.projection.messageByID().get(n.messageID),n.partID);if(i?.type!==`tool`||i.name!==`patch`||i.state.status===`error`)return;let a=`${n.messageID}:${n.partID}`,o=r.get(a);o&&!t.has(o)&&t.set(o,a)})}),t}),o=t=>e.status().type!==`idle`&&e.projection.activeMessageID()===t,s=t=>{let n=e.projection.messageByID().get(t);if(n?.type!==`user`)return null;let r=(e.projection.assistantMessagesByParent().get(t)??d3).reduce((e,t)=>t.time.completed===void 0?e:e===void 0?t.time.completed:Math.max(e,t.time.completed),void 0);if(!(r===void 0||r<n.time.created))return r-n.time.created},c=t=>o(t)?null:(e.projection.assistantMessagesByParent().get(t)??d3).toReversed().flatMap(e=>xV.contentEntries(e).toReversed()).find(e=>e.content.type===`text`&&!!e.content.text.trim())?.id,l=()=>e.padding?.()??`px-4 md:px-5`,u=t=>{let n=new Map;return t.forEach(t=>{if(n.has(t.messageID))return;let r=new Map,i=e.projection.messageByID().get(t.messageID);i?.type===`assistant`&&xV.contentEntries(i).forEach(e=>{r.has(e.id)||r.set(e.id,e.content)}),n.set(t.messageID,r)}),n},d=(t,n)=>{if(t().group.type===`context`){let s=N(()=>{let n=t().group;if(n.type!==`context`)return[];let r=u(n.refs),a=e.projection.assistantMessagesByParent().get(t().userMessageID)?.at(-1);return n.refs.flatMap(n=>{let s=r.get(n.messageID)?.get(n.partID);if(s?.type===`tool`)return i.set(s,`${n.messageID}:${n.partID}`),[s];if(s?.type===`reasoning`)return[{...s,id:n.partID,streaming:o(t().userMessageID)&&e.status().type===`busy`&&a?.id===n.messageID&&a.time.completed===void 0&&!a.error&&!a.retry&&a.content.at(-1)===s&&s.time?.completed===void 0}];let c=e.projection.messageByID().get(n.messageID);return n.messageID!==n.partID||!c?[]:c.type===`shell`?[{type:`shell`,id:n.partID,render:()=>R(g,{get messageID(){return n.messageID},grouped:!0})}]:c.type!==`assistant`&&c.type!==`user`?[{type:`notice`,id:n.partID,render:()=>R(h,{get messageID(){return n.messageID},grouped:!0})}]:[]})}),c=()=>`context:${t().group.key}`;return R(z4,{get parts(){return s()},patchGroupKey:e=>{let t=e.map(e=>i.get(e)),n=t.map(e=>r.get(e)).find(e=>e!==void 0&&t.includes(a().get(e)))??t[0];return t.forEach(e=>r.set(e,n)),n},get reasoningDefaultOpen(){return U(()=>!!e.timelineDetail)()?e.timelineDetail().thinking.details===`expanded`:e.reasoningMode()===`full`},reasoningOpen:t=>e.disclosure.value(t),onReasoningOpenChange:(t,n)=>e.disclosure.set(t,n),toolDefaultOpen:t=>e.timelineDetail?f(t):!1,toolOpen:n=>e.disclosure.value(`${t().group.key}:tool:${n}`),onToolOpenChange:(n,r)=>e.disclosure.set(`${t().group.key}:tool:${n}`,r),fileOpen:t=>e.disclosure.value(`patch:${t}`)??e.timelineDetail?.().edit.details===`expanded`,onFileOpenChange:(t,n)=>e.disclosure.set(`patch:${t}`,n),get open(){return e.disclosure.value(c())===!0},get busy(){return U(()=>!!o(t().userMessageID))()&&e.projection.lastAssistantGroupKey().get(t().userMessageID)===t().group.key},onOpenChange:t=>e.disclosure.set(c(),t),onSizeChange:n})}if(t().group.type===`file`){let r=N(()=>{let e=t().group;if(e.type!==`file`)return[];let n=u(e.refs);return e.refs.flatMap(e=>{let t=n.get(e.messageID)?.get(e.partID);return t?.type===`tool`?[t]:[]})}),i=N(()=>{let e=r()[0];if(!e||!(`metadata`in e.state))return;let t=e.state.metadata?.files;if(!Array.isArray(t))return;let n=t[0];return n&&typeof n==`object`&&`file`in n&&typeof n.file==`string`?n.file:void 0});return R(B4,{get tools(){return r()},fileOpen:n=>{let a=e.disclosure.value(`${t().group.key}:file:${n}`);return a===void 0?e.timelineDetail?e.timelineDetail().edit.details===`expanded`:r()[0]?.name!==`edit`||n!==i()?!1:e.disclosure.value(t().group.key)??e.editToolDefaultOpen():a},onFileOpenChange:(n,r)=>e.disclosure.set(`${t().group.key}:file:${n}`,r),onSizeChange:n})}let l=N(()=>{let e=t().group;return e.type===`part`?e.ref:void 0}),d=N(()=>{let t=l(),n=t?e.projection.messageByID().get(t.messageID):void 0;return n?.type===`assistant`?n:void 0}),p=N(()=>{let e=l();return e?xV.resolveContent(d(),e.partID):void 0}),m=N(()=>{let e=p();return e?f(e):void 0}),_=()=>p()?.type===`reasoning`?l().partID:t().group.key;return R(H,{get when(){return d()},children:r=>R(H,{get when(){return p()},children:i=>R(R4,{get message(){return r()},get content(){return i()},get contentID(){return l().partID},get showAssistantCopyPartID(){return c(t().userMessageID)},get turnDurationMs(){return s(t().userMessageID)},get defaultOpen(){return m()},get toolOpen(){return e.disclosure.value(_())??m()},onToolOpenChange:t=>e.disclosure.set(_(),t),onContentRendered:n})})})};function f(t){if(e.timelineDetail){let n=_V(t);if(n&&e.timelineDetail()[n].placement===`hidden`&&t.type===`tool`&&uV(t))return!0;if(n===`shell`||n===`edit`||n===`thinking`)return e.timelineDetail()[n].details===`expanded`}return t.type===`reasoning`?e.reasoningMode()===`full`:mV(t,e.shellToolDefaultOpen(),e.editToolDefaultOpen())}let p=e=>{if(e.type===`agent-switched`)return{label:t.t(`ui.sessionTimeline.notice.agentChanged`),data:e.previous?`${p3(e.previous)} → ${p3(e.agent)}`:p3(e.agent)};if(e.type===`model-switched`)return;if(e.type===`skill`)return{label:t.t(`ui.tool.skill`),data:e.name};if(e.type===`system`){if(e.description?.startsWith(`Instructions updated: `)){let n=e.description.slice(22).split(`,`).map(e=>e.trim()).filter(Boolean);return{label:t.t(`ui.sessionTimeline.notice.instructionsUpdated`),items:n}}return{label:e.description??e.text}}if(e.type!==`synthetic`)return;if(e.description===`Continuing after restart`)return{label:e.description};let n=typeof e.metadata?.source==`string`?e.metadata.source:void 0,r=typeof e.metadata?.state==`string`?e.metadata.state:void 0;if(n===`subagent`||n===`shell`){let i=typeof e.metadata?.agent==`string`?e.metadata.agent:void 0,a=n===`shell`?t.t(`ui.tool.shell`):i??t.t(`ui.tool.agent.default`);return{label:t.t(r===`error`?`ui.sessionTimeline.notice.failed`:r===`cancelled`?`ui.sessionTimeline.notice.cancelled`:`ui.sessionTimeline.notice.finished`,{actor:a}),data:e.description}}return{label:e.description??e.text}},m=t=>(()=>{var n=X4(),r=n.firstChild;return K(r,()=>t.children),j(r=>{var i=t.row._tag===`UserMessage`?e.anchor?.(t.row.userMessageID):void 0,a=t.row.userMessageID,o=t.row._tag,s=t.row._tag===`AssistantPart`?t.row.spacing:void 0,c={"min-w-0 w-full max-w-full":!0,"md:max-w-[1000px] md:mx-auto":e.centered?.(),"pt-2":t.row._tag===`AssistantPart`&&t.row.spacing===`tool`,"pt-4":t.row._tag===`AssistantPart`&&t.row.spacing===`content`};return i!==r.e&&G(n,`id`,r.e=i),a!==r.t&&G(n,`data-message-id`,r.t=a),o!==r.a&&G(n,`data-timeline-row`,r.a=o),s!==r.o&&G(n,`data-timeline-spacing`,r.o=s),r.i=pt(n,c,r.i),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})();function h(r){let i=()=>r.grouped?``:l(),a=N(()=>e.projection.messageByID().get(r.messageID)),o=N(()=>{let e=a();return e?.type===`compaction`?e:void 0}),s=N(()=>{let e=o();return e?.status===`failed`?FV(e.error.message):``}),c=N(()=>{let e=a();return e?.type===`location-switched`?e:void 0}),u=N(()=>{let e=a();if(e?.type!==`model-switched`)return;let r=n.store.provider?.all?.get(e.model.providerID);return{providerID:e.model.providerID,variant:e.model.variant,label:t.t(`ui.sessionTimeline.notice.modelSwitched`,{model:r?.models?.[e.model.id]?.name??e.model.id})}}),d=N(()=>{let e=a();return e?p(e):void 0});return[R(H,{get when(){return o()},children:e=>(()=>{var t=Z4(),n=t.firstChild;return K(n,R(H1,{get message(){return e()},get error(){return s()}})),j(()=>dt(t,`w-full ${i()}`)),t})()}),R(H,{get when(){return c()},get fallback(){return R(H,{get when(){return u()},get fallback(){return R(H,{get when(){return d()},children:e=>R(H,{get when(){return e().items?.length},get fallback(){return(()=>{var t=$4(),n=t.firstChild;return K(n,()=>e().label),K(t,R(H,{get when(){return e().data},children:e=>(()=>{var t=e3(),n=t.firstChild;return K(t,R(H,{get when(){return a()?.type!==`agent-switched`},children:` · `}),n),K(n,e),j(()=>t.classList.toggle(`ms-2`,a()?.type===`agent-switched`)),t})()}),null),j(e=>{var o=`w-full truncate ${r.grouped?`py-1`:`pt-3 pb-1`} text-13-regular leading-text-compact text-text-weak ${i()}`,s=a()?.type===`agent-switched`;return o!==e.e&&dt(t,e.e=o),s!==e.t&&n.classList.toggle(`text-v2-text-text-faint`,e.t=s),e},{e:void 0,t:void 0}),t})()},get children(){var t=Q4(),n=t.firstChild,r=n.firstChild;return K(r,()=>e().label),K(n,R(V,{get each(){return e().items},children:e=>(()=>{var t=t3();return K(t,e),t})()}),null),j(()=>dt(t,`w-full py-1 ${i()}`)),t}})})},children:e=>(()=>{var t=n3();return K(t,R(VV,{get label(){return e().label},get providerID(){return e().providerID},get variant(){return e().variant}})),j(()=>dt(t,`w-full py-2 ${i()}`)),t})()})},children:e=>(()=>{var n=i3(),r=n.firstChild,a=r.nextSibling;return K(n,R(wl,{appearance:`compact`,placement:`top`,get value(){return t.t(`ui.sessionTimeline.notice.movedTooltip`)},class:`shrink-0`,triggerTabIndex:0,get children(){var e=r3();return K(e,()=>t.t(`ui.sessionTimeline.notice.movedTo`)),e}}),r),K(a,()=>e().location.directory),j(()=>dt(n,`flex h-7 w-full min-w-0 items-center gap-2 py-1 text-[13px] leading-text-compact tracking-[-0.04px] text-v2-text-text-faint ${i()}`)),n})()})]}function g(t){let n=N(()=>{let n=e.projection.messageByID().get(t.messageID);return n?.type===`shell`?n:void 0}),r=N(()=>{if(!e.timelineDetail)return e.shellToolDefaultOpen();let t=n();return e.timelineDetail().shell.details===`expanded`||e.timelineDetail().shell.placement===`hidden`&&(t?.status===`timeout`||t?.status===`exited`&&t.exit!==void 0&&t.exit!==0)});return R(H,{get when(){return n()},children:n=>(()=>{var i=a3();return K(i,R(I4,{get message(){return n()},get defaultOpen(){return r()},get open(){return e.disclosure.value(n().id)??(e.timelineDetail?r():void 0)},onOpenChange:t=>e.disclosure.set(n().id,t)})),j(()=>dt(i,`w-full ${t.grouped?``:l()}`)),i})()})}let _=(n,r)=>{if(n()._tag===`TurnGap`)return o3();if(n()._tag===`UserMessage`){let t=()=>{let e=n();if(e._tag!==`UserMessage`)throw Error(`Expected a user-message timeline row`);return e},r=N(()=>{let n=e.projection.messageByID().get(t().userMessageID);return n?.type===`user`?n:void 0}),i=N(()=>e.projection.userContextByID().get(t().userMessageID));return R(m,{get row(){return t()},get children(){return R(H,{get when(){return r()},children:t=>{let n=()=>e.presentation(t());return(()=>{var r=s3(),a=r.firstChild;return K(a,R(L4,{get sessionID(){return e.sessionID()},get message(){return t()},get displayText(){return n()?.displayText},get comments(){return n()?.comments},get historicalAgent(){return i()?.agent??``},get historicalModel(){return i()?.model??{id:``,providerID:``}},get actions(){return e.actions}})),j(()=>dt(r,`w-full ${l()}`)),r})()}})}})}if(n()._tag===`Shell`){let e=()=>{let e=n();if(e._tag!==`Shell`)throw Error(`Expected a shell timeline row`);return e};return R(m,{get row(){return e()},get children(){return R(g,{get messageID(){return e().messageID}})}})}if(n()._tag===`Notice`){let e=()=>{let e=n();if(e._tag!==`Notice`)throw Error(`Expected a notice timeline row`);return e};return R(m,{get row(){return e()},get children(){return R(h,{get messageID(){return e().messageID}})}})}if(n()._tag===`TurnDivider`){let e=()=>{let e=n();if(e._tag!==`TurnDivider`)throw Error(`Expected a turn-divider timeline row`);return e};return R(m,{get row(){return e()},get children(){var e=c3(),n=e.firstChild.firstChild;return K(n,R(VV,{get label(){return t.t(`ui.message.interrupted`)}})),j(()=>dt(e,`w-full ${l()}`)),e}})}if(n()._tag===`AssistantPart`){let e=()=>{let e=n();if(e._tag!==`AssistantPart`)throw Error(`Expected an assistant-part timeline row`);return e},t=d(e,r);return R(m,{get row(){return e()},get children(){var n=l3(),r=n.firstChild;return K(r,t),j(t=>{var i=`w-full ${l()}`,a=o(e().userMessageID);return i!==t.e&&dt(n,t.e=i),a!==t.t&&G(r,`aria-hidden`,t.t=a),t},{e:void 0,t:void 0}),n}})}if(n()._tag===`Thinking`){let t=()=>{let e=n();if(e._tag!==`Thinking`)throw Error(`Expected a thinking timeline row`);return e},i=N(()=>{let n=t().ref,r=xV.resolveContent(e.projection.messageByID().get(n.messageID),n.partID);return r?.type===`reasoning`?r:void 0});return R(m,{get row(){return t()},get children(){var n=u3(),a=n.firstChild;return K(a,R(H,{get when(){return i()},children:n=>R(W1,{get id(){return t().ref.partID},get content(){return n()},streaming:!0,get defaultOpen(){return U(()=>!!e.timelineDetail)()?e.timelineDetail().thinking.details===`expanded`:e.reasoningMode()===`full`},get open(){return e.disclosure.value(t().ref.partID)??(e.timelineDetail?e.timelineDetail().thinking.details===`expanded`:void 0)},onOpenChange:n=>e.disclosure.set(t().ref.partID,n),onContentRendered:r})})),j(()=>dt(n,`w-full ${l()}`)),n}})}if(n()._tag===`Retry`){let t=()=>{let e=n();if(e._tag!==`Retry`)throw Error(`Expected a retry timeline row`);return e},r=N(()=>{let n=(e.projection.assistantMessagesByParent().get(t().userMessageID)??d3).at(-1)?.retry;return n?{type:`retry`,attempt:n.attempt,message:n.error.message,next:n.at}:e.status()});return R(m,{get row(){return t()},get children(){var n=a3();return K(n,R(Y4,{get status(){return r()},get show(){return e.projection.activeMessageID()===t().userMessageID}})),j(()=>dt(n,`w-full ${l()}`)),n}})}let i=()=>{let e=n();if(e._tag!==`Error`)throw Error(`Expected an error timeline row`);return e};return R(m,{get row(){return i()},get children(){var e=a3();return K(e,R(W4,{get message(){return i().text}})),j(()=>dt(e,`w-full ${l()}`)),e}})};function v(e){return R(H,{get when(){return hV.key(e.row())},keyed:!0,children:t=>_(e.row,e.onSizeChange)})}return{Row:v}}function p3(e){return e.slice(0,1).toUpperCase()+e.slice(1)}var m3=W(`<div data-component=session-timeline>`),h3=W(`<div class=native-transcript data-workspace-session>`),g3=W(`<p class=empty-inline>`),_3=gV.find(e=>e.id===`compact`).value;function v3(e){let t=bV({sessionMessages:()=>e.session.messages,status:()=>e.status,reasoningMode:()=>`compact`,timelineDetail:()=>_3,shellToolDefaultOpen:()=>!1,editToolDefaultOpen:()=>!1}),[n,r]=$t({}),i=f3({sessionID:()=>e.session.sessionID,status:()=>e.status,projection:t,presentation:()=>void 0,reasoningMode:()=>`compact`,timelineDetail:()=>_3,shellToolDefaultOpen:()=>!1,editToolDefaultOpen:()=>!1,padding:()=>``,disclosure:{value:e=>n[e],set:(e,t)=>r(e,t)}}),a=N(()=>t.rows().map(hV.key));function o(e){let n=t.rowByKey().get(e.rowKey),r=N(()=>t.rowByKey().get(e.rowKey)??n);return R(i.Row,{row:r})}return(()=>{var e=m3();return K(e,R(V,{get each(){return a()},children:e=>R(o,{rowKey:e})})),e})()}function y3(e){let[t,n]=A(``),r=()=>e.stage.sessions.find(e=>!e.parentID)??e.stage.sessions[0],i=()=>e.stage.sessions.find(e=>e.sessionID===t())??r(),a=t=>e.running?t.status:{type:`idle`},o=N(()=>{let t=new Map;for(let n of e.stage.sessions){let e=[n.model,...n.messages.flatMap(e=>e.type===`assistant`?[e.model]:[])];for(let n of e)t.has(n.providerID)||t.set(n.providerID,{models:{}}),t.get(n.providerID).models[n.id]={name:Tp(`${n.providerID}/${n.id}`)}}return{all:t,connected:[...t.keys()],default:{}}});return(()=>{var t=h3();return K(t,R(H,{get when(){return U(()=>!!i())()&&i()!==r()},get children(){return R(Io,{size:`small`,variant:`ghost-muted`,icon:`arrow-left`,onClick:()=>n(``),children:`Parent session`})}}),null),K(t,R(H,{get when(){return i()?.sessionID},keyed:!0,get fallback(){return(()=>{var t=g3();return K(t,()=>e.pending?`Waiting for session activity…`:`No session was recorded.`),t})()},children:t=>R(NM,{directory:`/workspace`,sessionID:t,get data(){return{agent:[...new Set(e.stage.sessions.map(e=>e.agent))].map(e=>({name:e})),provider:o(),session:e.stage.sessions.map(e=>({id:e.sessionID,parentID:e.parentID,title:e.title,time:{created:e.created,updated:e.created}})),session_status:Object.fromEntries(e.stage.sessions.map(e=>[e.sessionID,a(e)])),session_diff:{}}},onNavigateToSession:t=>{e.stage.sessions.some(e=>e.sessionID===t)&&n(t)},get children(){return R(Yp,{component:jM,get children(){return R(v3,{get session(){return i()},get status(){return a(i())}})}})}})}),null),t})()}var b3=()=>({prompt:``,model:``,sessions:[]}),x3=e=>{let[t,n]=e.split(`#`),r=t.indexOf(`/`);return{providerID:r<0?`recorded`:t.slice(0,r),id:r<0?t:t.slice(r+1),variant:n}},S3=e=>e&&typeof e==`object`&&!Array.isArray(e)?e:{},C3=e=>{let t=(Array.isArray(e)?e:[]).filter(e=>!!e&&typeof e==`object`&&(e.type===`text`&&typeof e.text==`string`||e.type===`file`&&typeof e.uri==`string`&&typeof e.mime==`string`));return t.length?t:[{type:`text`,text:typeof e==`string`?e:JSON.stringify(e??``)}]},w3=e=>{let t=S3(e);return{type:typeof t.type==`string`?t.type:`RecordedError`,message:typeof t.message==`string`?t.message:String(e??`Unknown error`)}};function T3(e,t){if(!(`data`in t.event))return;let n=t.event,r=n.data,i=Date.parse(t.time);if(typeof r.sessionID!=`string`)return;let a=e.sessions.find(e=>e.sessionID===r.sessionID);if(a||(a={sessionID:r.sessionID,title:``,created:i,model:x3(e.model),agent:`build`,messages:[],diffs:[],status:{type:`idle`},parts:{}},e.sessions.push(a)),n.type===`session.created`&&(typeof r.parentID==`string`&&(a.parentID=r.parentID),typeof r.agent==`string`&&(a.agent=r.agent),typeof r.title==`string`&&(a.title=r.title),r.model&&typeof r.model==`object`&&(a.model=r.model)),n.type===`session.renamed`&&typeof r.title==`string`&&(a.title=r.title),n.type===`session.execution.started`&&(a.status={type:`busy`}),[`session.execution.succeeded`,`session.execution.failed`,`session.execution.interrupted`].includes(n.type)&&(a.status={type:`idle`}),n.type===`session.inbox.enqueued`){let e=r.item;e?.type===`user`&&typeof e.payload?.text==`string`&&!a.messages.some(e=>e.id===r.inboxID)&&a.messages.push({type:`user`,id:String(r.inboxID),text:e.payload.text,time:{created:i}})}if(typeof r.assistantMessageID!=`string`)return;let o=a.messages.find(e=>e.type===`assistant`&&e.id===r.assistantMessageID);o||(o={type:`assistant`,id:r.assistantMessageID,time:{created:i},agent:a.agent,model:a.model,content:[]},a.messages.push(o)),n.type===`session.step.started`&&(o.agent=typeof r.agent==`string`?r.agent:a.agent,o.model=r.model&&typeof r.model==`object`?r.model:a.model),n.type===`session.step.streamed`&&(o.time.streamed=i),n.type===`session.step.ended`&&(o.time.completed=i,o.finish=r.finish);let s=/^session\.(text|reasoning)\.(started|delta|ended)$/.exec(n.type);if(s){let e=s[1],t=`${o.id}:${e}:${r.ordinal}`,n=a.parts[t];n||(n={messageID:o.id,index:o.content.length,complete:!1},a.parts[t]=n,o.content.push(e===`reasoning`?{type:e,text:``,time:{created:i}}:{type:e,text:``}));let c=o.content[n.index];if(c.type===`tool`)return;s[2]===`delta`&&!n.complete&&(c.text+=String(r.delta??``)),s[2]===`ended`&&(c.text=String(r.text??c.text),n.complete=!0,c.type===`reasoning`&&(c.time={created:c.time?.created??i,completed:i}))}if(!n.type.startsWith(`session.tool.`)||typeof r.id!=`string`)return;let c=o.content.find(e=>e.type===`tool`&&e.id===r.id);if(c||(c={type:`tool`,id:r.id,name:String(r.name??`tool`),time:{created:i},state:{status:`streaming`,input:``}},o.content.push(c)),typeof r.name==`string`&&(c.name=r.name),n.type===`session.tool.input.delta`&&c.state.status===`streaming`&&(c.state.input+=String(r.delta??``)),n.type===`session.tool.input.ended`&&c.state.status===`streaming`&&(c.state.input=String(r.text??``)),n.type===`session.tool.called`&&(c.state={status:`running`,input:S3(r.input),metadata:{}},c.time.ran=i),n.type===`session.tool.progress`&&c.state.status!==`streaming`&&(c.state.metadata=S3(r.metadata)),n.type===`session.tool.success`||n.type===`session.tool.failed`){let e=c.state.status===`streaming`?{}:c.state.input,t=r.metadata?S3(r.metadata):c.state.status===`streaming`?{}:c.state.metadata;c.state=n.type===`session.tool.success`?{status:`completed`,input:e,metadata:t,content:C3(r.content)}:{status:`error`,input:e,metadata:t,error:w3(r.error),...r.content?{content:C3(r.content)}:{}},c.time.completed=i}typeof r.executed==`boolean`&&(c.executed=r.executed)}var E3=new Map;function D3(e){let[t,n]=$t(b3()),[r,i]=A(),[a,o]=A(`Connecting…`),[s,c]=A(0);M(oe(N(()=>`${e.benchmark()}:${e.execution()}`),t=>{let r=b3(),a=E3.get(t);if(ie(()=>{n(rn(structuredClone(a?.document??r))),i(void 0),o(a?`Session saved`:`Connecting…`),c(e=>e+1)}),a)return;if(!e.execution()){o(`Waiting for session`);return}let s=new EventSource(`/api/session?benchmark=${encodeURIComponent(e.benchmark())}&execution=${encodeURIComponent(e.execution())}`);s.onopen=()=>o(`Streaming`),s.onerror=()=>o(`Reconnecting…`),s.addEventListener(`snapshot`,e=>{r=JSON.parse(e.data).document,ie(()=>{n(rn(structuredClone(r))),c(e=>e+1)})}),s.addEventListener(`records`,e=>{let t=JSON.parse(e.data);for(let e of t)T3(r,e);ie(()=>{n(rn(structuredClone(r))),c(e=>e+1)})}),s.addEventListener(`state`,e=>i(JSON.parse(e.data))),s.addEventListener(`done`,()=>{E3.delete(t),E3.set(t,{document:structuredClone(r)}),E3.size>8&&E3.delete(E3.keys().next().value),o(`Session saved`),s.close()}),s.addEventListener(`session-error`,()=>{o(`Session unavailable`),s.close()}),P(()=>s.close())}));let l=b3();return{state:r,connection:a,revision:s,stage:n=>n===e.stage()?t:l}}var O3=W(`<span class=eval-name>`),k3=`openeval.top-secret`,[A3,j3]=A((()=>{try{return localStorage.getItem(k3)===`true`}catch{return!1}})());function M3(){return R(wl,{get value(){return A3()?`Click to show eval names and enable traces`:`Click to blur eval names and disable traces`},get children(){return R(zo,{size:`small`,variant:`ghost`,get icon(){return R(Fo,{name:`glasses`})},class:`secret-toggle`,"aria-label":`Top secret`,get"aria-pressed"(){return A3()},onClick:()=>j3(!A3())})}})}function N3(e){return(()=>{var t=O3();return K(t,()=>e.children),j(n=>{var r=!!(A3()&&e.sensitive!==!1),i=A3()&&e.sensitive!==!1?!0:void 0;return r!==n.e&&t.classList.toggle(`is-secret`,n.e=r),i!==n.t&&G(t,`aria-hidden`,n.t=i),n},{e:void 0,t:void 0}),t})()}var P3=e=>{let t=e.replaceAll(`_`,` `).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).toLowerCase().trim();return t.charAt(0).toUpperCase()+t.slice(1)};function F3(e){if(!Array.isArray(e)||!e.length||!e.every(e=>e&&typeof e==`object`&&!Array.isArray(e)))return;let t=e,n=[...new Set(t.flatMap(e=>Object.keys(e)))];return{rows:t.slice(0,50),columns:n.slice(0,8),omittedRows:Math.max(0,t.length-50),omittedColumns:Math.max(0,n.length-8)}}var I3=W(`<span class=observation-absent aria-label="Not reported">—`),L3=W(`<ul class=observation-list>`),R3=W(`<li>`),z3=W(`<details><summary>Read details</summary><pre>`),B3=W(`<span>`),V3=W(`<p class=observation-note>More data is retained in the returned JSON (<!> rows, <!> columns not shown here).`),H3=W(`<div class=observation-table-scroll><table class=observation-table><thead><tr></tr></thead><tbody>`),U3=W(`<th scope=col>`),W3=W(`<tr>`),G3=W(`<td>`),K3=W(`<dl class="verification-measurements json-observations">`),q3=W(`<dt>`),J3=W(`<dd>`);function Y3(e){let t=()=>F3(e.value);return R(H,{get when(){return t()},get fallback(){return U(()=>e.value===void 0)()?I3():U(()=>!!Array.isArray(e.value))()?(()=>{var t=L3();return K(t,R(V,{get each(){return e.value.slice(0,50)},children:e=>(()=>{var t=R3();return K(t,()=>typeof e==`object`?JSON.stringify(e):String(e)),t})()})),t})():U(()=>typeof e.value==`object`&&e.value!==null)()?(()=>{var t=z3(),n=t.firstChild.nextSibling;return K(n,()=>JSON.stringify(e.value,null,2)),t})():(()=>{var t=B3();return K(t,(()=>{var t=U(()=>e.value===null);return()=>t()?`Not available`:U(()=>typeof e.value==`boolean`)()?U(()=>e.name===`pass`)()?e.value?`Pass`:`Fail`:e.value?`Yes`:`No`:String(e.value)})()),j(n=>{var r=e.name===`pass`&&e.value===!0,i=e.name===`pass`&&e.value===!1;return r!==n.e&&t.classList.toggle(`observation-pass`,n.e=r),i!==n.t&&t.classList.toggle(`observation-fail`,n.t=i),n},{e:void 0,t:void 0}),t})()},children:e=>(()=>{var t=H3(),n=t.firstChild.firstChild,r=n.firstChild,i=n.nextSibling;return K(r,R(V,{get each(){return e().columns},children:e=>(()=>{var t=U3();return K(t,()=>P3(e)),t})()})),K(i,R(V,{get each(){return e().rows},children:t=>(()=>{var n=W3();return K(n,R(V,{get each(){return e().columns},children:e=>(()=>{var n=G3();return K(n,R(Y3,{get value(){return U(()=>!!Object.hasOwn(t,e))()?t[e]:void 0},name:e})),n})()})),n})()})),K(t,R(H,{get when(){return e().omittedRows||e().omittedColumns},get children(){var t=V3(),n=t.firstChild.nextSibling,r=n.nextSibling.nextSibling;return r.nextSibling,K(t,()=>e().omittedRows,n),K(t,()=>e().omittedColumns,r),t}}),null),t})()})}function X3(e){return(()=>{var t=K3();return K(t,R(V,{get each(){return Object.entries(e.values)},children:([e,t])=>[(()=>{var t=q3();return K(t,()=>P3(e)),t})(),(()=>{var e=J3();return K(e,R(Y3,{value:t})),e})()]})),t})()}var Z3=W(`<p class=error-banner>Could not load judging checkpoints.`),Q3=W(`<p class=error-banner>`),$3=W(`<details class=recorded-metrics><summary>Recorded metrics · candidate only</summary><pre class=checkpoint-content>`),e6=W(`<button>Next page`),t6=W(`<div class=judge-check-detail><pre class=checkpoint-content>`),n6=W(`<div class=judge-history>`),r6=W(`<p class=judge-audit-warning>Monitoring ended <!>: <!>. Final grading uses the saved work.`),i6=W(`<p class=judge-audit-warning>. The candidate continues normally; final grading uses its completed evidence.`),a6=W(`<details class=judge-audit open><summary><strong>Judgment and evidence</strong><span></span></summary><div class=judgment-criteria></div><ol class=judge-checks>`),o6=W(`<article><header><strong></strong><span></span></header><p></p><div class=checkpoint-actions>`),s6=W(`<button>Read `),c6=W(`<a class=judgment-source target=_blank rel=noreferrer>`),l6=W(`<details><summary>Returned JSON</summary><pre class=checkpoint-content>`),u6=W(`<details><summary>Standard output</summary><pre class=checkpoint-content>`),d6=W(`<details><summary>Standard error</summary><pre class=checkpoint-content>`),f6=W(`<section class=code-judgment aria-label="Code judgment"><header><strong>judge.ts</strong><span> · </span></header><details><summary>Frozen source · </summary><pre class=checkpoint-content>`),p6=W(`<p>Logs reached the retention limit.`),m6=W(`<p>Not produced: `),h6=W(`<details class=verification-receipt open><summary>Artifact verification · <!> · </summary><p> workspace · <!> · <!> CPUs · <!> MiB · no network</p><div class=checkpoint-actions><button>Read receipt</button><button>Standard output</button><button>Standard error`),g6=W(`<div class=verification-command><code></code><span>exit <!> · `),_6=W(`<a target=_blank rel=noreferrer>Open `),v6=W(`<p class=judge-check-stop>Stop requested `),y6=W(`<dt>Evidence cutoff`),b6=W(`<dd>`),x6=W(`<dt>Boundary event`),S6=W(`<dt>Native cursors`),C6=W(`<p class=checkpoint-status>Loading evidence…`),w6=W(`<div class=checkpoint-items>`),T6=W(`<button>Back`),E6=W(`<div class=checkpoint-actions>`),D6=W(`<div class=judge-check-detail><details class=checkpoint-identity><summary>Evidence identity <code></code></summary><dl><dt>Check</dt><dd></dd><dt>Evidence SHA-256</dt><dd></dd><dt>Judge events</dt><dd>–</dd><dt>Duration</dt><dd></dd></dl></details><nav aria-label="Checkpoint evidence"class=checkpoint-actions>`),O6=W(`<li><button class=judge-check-heading><span class=judge-check-number></span><strong></strong><span></span><time></time></button><p class=judge-check-reason>`),k6=W(`<button>`),A6=W(`<pre class=checkpoint-content>`),j6=W(`<p>`),M6=W(`<button><strong></strong><span>`);async function N6(e){let t=await fetch(e);if(!t.ok)throw Error(await t.text());return t.json()}function P6(e){let[t,n]=re(()=>!A3()&&`${e.benchmarkId}:${e.judgeId}`,()=>N6(`/api/judge-checks?${new URLSearchParams({benchmark:e.benchmarkId,judge:e.judgeId})}`)),[r,i]=A(``),[a,o]=A({action:`summary`}),[s,c]=A([]),[l]=re(()=>!A3()&&r()?{check:r(),...a()}:!1,n=>{let r=new URLSearchParams({benchmark:e.benchmarkId,judge:e.judgeId,check:n.check===`judgment`?t()?.judge.decisionCheckId??``:n.check,action:n.action});return n.id!==void 0&&r.set(`id`,n.id),n.offset!==void 0&&r.set(`offset`,String(n.offset)),n.path&&r.set(`path`,n.path),n.revision&&r.set(`revision`,n.revision),n.metric&&r.set(`metric`,n.metric),n.action===`verification`?(r.delete(`check`),r.delete(`action`),fetch(`/api/verification?${r}`).then(async e=>{if(!e.ok)throw Error(await e.text());return n.path?{text:await e.text()}:e.json()})):N6(`/api/check-evidence?${r}`)});M(()=>{e.judgeId,i(``),o({action:`summary`}),c([])});let u=setInterval(()=>{!A3()&&t()?.judge.state===`running`&&!t.loading&&n.refetch()},2e3);P(()=>clearInterval(u));let d=e=>{i(r()===e?``:e),o({action:`summary`}),c([])},f=e=>{c([...s(),a()]),o(e)},p=()=>Array.isArray(l()?.items)?l().items:void 0,m=e=>e.state===`completed`?e.decision?.kind===`continue`?`Continue`:e.decision?.judgment.value===1?`Pass`:e.decision?.judgment.value===0?`Fail`:typeof e.decision?.judgment.value==`number`?`${Math.round(e.decision.judgment.value*100)}%`:`Unknown`:Fp(e.state);return R(H,{get when(){return U(()=>!A3())()&&(t()?.checks.length||Object.keys(t()?.judge.judgment?.scores??{}).length||t()?.judge.code||t()?.judge.error||t()?.metrics||t()?.judge.monitorError||t()?.judge.monitorLimit||(t()?.history.length??0)>1||t.error)},get children(){var n=a6(),u=n.firstChild,h=u.firstChild,g=h.nextSibling,_=u.nextSibling,v=_.nextSibling;return K(u,R(Fo,{name:`shield`}),h),K(g,(()=>{var e=U(()=>!!t()?.checks.length);return()=>e()?`${t().checks.length} checkpoint checks`:`Final judgment`})()),K(n,R(H,{get when(){return t.error},get children(){return Z3()}}),_),K(n,R(H,{get when(){return t()?.judge.error},get children(){var e=Q3();return K(e,()=>t().judge.error),e}}),_),K(_,R(V,{get each(){return Object.entries(t()?.judge.judgment?.scores??{})},children:([e,n])=>(()=>{var r=o6(),a=r.firstChild,s=a.firstChild,l=s.nextSibling,u=a.nextSibling,d=u.nextSibling;return K(s,()=>t()?.criteria.find(t=>t.id===e)?.name??e),K(l,(()=>{var e=U(()=>n.value===null);return()=>e()?`Unknown`:U(()=>n.value===1)()?`Pass`:U(()=>n.value===0)()?`Fail`:jp(n.value*100)})()),K(u,()=>n.reason),K(r,R(H,{get when(){return n.measurements},get children(){return R(X3,{get values(){return n.measurements}})}}),d),K(d,R(V,{get each(){return n.evidence},children:e=>(()=>{var t=s6();return t.firstChild,t.$$click=()=>{i(`judgment`),c([]),o({action:e.kind===`recording`?`summary`:e.kind===`metric`?`metrics`:e.kind,...e.kind===`metric`?{metric:e.id}:{},...`id`in e?{id:e.id}:{},...`path`in e?{path:e.path,...`revision`in e?{revision:e.revision}:{}}:{},offset:e.offset})},K(t,()=>e.kind,null),K(t,(()=>{var t=U(()=>`path`in e);return()=>t()?`: ${e.path}`:``})(),null),t})()})),K(r,R(V,{get each(){return n.sources},children:e=>(()=>{var t=c6();return G(t,`href`,e),K(t,e),t})()}),null),r})()})),K(n,R(H,{get when(){return t()?.judge.code},children:n=>(()=>{var r=f6(),a=r.firstChild,s=a.firstChild.nextSibling,l=s.firstChild,u=a.nextSibling,d=u.firstChild;d.firstChild;var f=d.nextSibling;return K(s,()=>Fp(n().state),l),K(s,()=>Pp(n().elapsedMs),null),K(r,R(H,{get when(){return n().output!==void 0},get children(){var e=l6(),t=e.firstChild.nextSibling;return K(t,()=>JSON.stringify(n().output,null,2)),e}}),u),K(r,R(V,{get each(){return n().verifications},children:t=>{let n=n=>`/api/verification?${new URLSearchParams({benchmark:e.benchmarkId,judge:e.judgeId,id:t.id,...n?{path:n}:{}})}`,r=e=>{i(`judgment`),c([]),o({action:`verification`,id:t.id,...e?{path:e}:{}})};return(()=>{var e=h6(),i=e.firstChild,a=i.firstChild.nextSibling;a.nextSibling;var o=i.nextSibling,s=o.firstChild,c=s.nextSibling,l=c.nextSibling.nextSibling,u=l.nextSibling.nextSibling;u.nextSibling;var d=o.nextSibling,f=d.firstChild,p=f.nextSibling,m=p.nextSibling;return K(i,(()=>{var e=U(()=>t.state===`timed_out`);return()=>e()?`Timed out`:`exit ${t.exitCode}`})(),a),K(i,()=>Pp(t.elapsedMs),null),K(o,()=>t.revision,s),K(o,()=>t.environment.image,c),K(o,()=>t.environment.cpus,l),K(o,()=>t.environment.memoryMiB,u),K(e,R(V,{get each(){return t.commands},children:e=>(()=>{var t=g6(),n=t.firstChild,r=n.nextSibling,i=r.firstChild.nextSibling;return i.nextSibling,K(n,()=>e.argv.join(` `)),K(r,()=>e.exitCode??`unknown`,i),K(r,()=>Pp(e.elapsedMs),null),t})()}),d),f.$$click=()=>r(),p.$$click=()=>r(`stdout`),m.$$click=()=>r(`stderr`),K(d,R(V,{get each(){return t.artifacts},children:e=>(()=>{var t=_6();return t.firstChild,K(t,()=>e.path,null),j(()=>G(t,`href`,n(e.path))),t})()}),null),K(e,R(H,{get when(){return t.logsTruncated},get children(){return p6()}}),null),K(e,R(H,{get when(){return t.missingArtifacts.length},get children(){var e=m6();return e.firstChild,K(e,()=>t.missingArtifacts.join(`, `),null),e}}),null),e})()}}),u),K(d,()=>n().sourceHash.slice(0,12),null),K(f,()=>t()?.codeSource),K(r,R(H,{get when(){return t()?.codeStdout},get children(){var e=u6(),n=e.firstChild.nextSibling;return K(n,()=>t()?.codeStdout),e}}),null),K(r,R(H,{get when(){return t()?.codeStderr},get children(){var e=d6(),n=e.firstChild.nextSibling;return K(n,()=>t()?.codeStderr),e}}),null),r})()}),v),K(n,R(H,{get when(){return t()?.metrics},get children(){var e=$3(),n=e.firstChild.nextSibling;return K(n,()=>JSON.stringify(t()?.metrics,null,2)),e}}),v),K(n,R(H,{get when(){return r()===`judgment`},get children(){var e=t6(),t=e.firstChild;return K(e,R(H,{get when(){return l.error},get children(){var e=Q3();return K(e,()=>String(l.error)),e}}),t),K(t,(()=>{var e=U(()=>!!l.loading);return()=>e()?`Loading evidence…`:U(()=>typeof l()?.text==`string`)()?l().text:JSON.stringify(l(),null,2)})()),K(e,R(H,{get when(){return typeof l()?.next==`number`},get children(){var e=e6();return e.$$click=()=>o({...a(),offset:l().next}),e}}),null),e}}),v),K(n,R(H,{get when(){return(t()?.history.length??0)>1},get children(){var n=n6();return K(n,R(Nd,{"aria-label":`Judging history`,get options(){return t().history.map(e=>e.id)},get current(){return e.judgeId},label:e=>{let n=t().history.find(t=>t.id===e);return`${n.mode===`monitor`?`Monitoring`:`Final judge`} · ${new Date(n.startedAt).toLocaleTimeString()} · ${Fp(n.state)}`},onSelect:t=>{t&&e.onSelectJudge(t)}})),n}}),v),K(n,R(H,{get when(){return t()?.judge.monitorError},get children(){var e=r6(),n=e.firstChild.nextSibling,r=n.nextSibling.nextSibling;return r.nextSibling,K(e,(()=>{var e=U(()=>!!t().judge.monitorErrorAt);return()=>e()?`at ${new Date(t().judge.monitorErrorAt).toLocaleTimeString()}`:``})(),n),K(e,()=>t().judge.monitorError,r),e}}),v),K(n,R(H,{get when(){return t()?.judge.monitorLimit},get children(){var e=i6(),n=e.firstChild;return K(e,()=>t().judge.monitorLimit,n),e}}),v),K(v,R(V,{get each(){return t()?.checks},children:(e,n)=>(()=>{var i=O6(),u=i.firstChild,h=u.firstChild,g=h.nextSibling,_=g.nextSibling,v=_.nextSibling,y=u.nextSibling;return u.$$click=()=>d(e.id),K(h,()=>String(n()+1).padStart(2,`0`)),K(g,()=>m(e)),K(_,(()=>{var t=U(()=>e.purpose===`final`);return()=>t()?`Final archive`:`Through event #${e.checkpoint.through}`})()),K(v,()=>new Date(e.startedAt).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})),K(u,R(Fo,{get name(){return r()===e.id?`chevron-down`:`chevron-right`}}),null),K(y,(()=>{var t=U(()=>e.decision?.kind===`continue`);return()=>t()?e.decision.reason:e.decision?.judgment.reason??e.error??`Waiting for the judge`})()),K(i,R(H,{get when(){return t()?.stop?.checkId===e.id},get children(){var e=v6();return e.firstChild,K(e,()=>new Date(t().stop.requestedAt).toLocaleTimeString(),null),K(e,(()=>{var e=U(()=>t().stop.applied===void 0);return()=>e()?` · Awaiting interruption`:t().stop.applied?` · Session stopped early`:` · Session had already ended`})(),null),e}}),null),K(i,R(H,{get when(){return r()===e.id},get children(){var t=D6(),n=t.firstChild,r=n.firstChild,i=r.firstChild.nextSibling,u=r.nextSibling,d=u.firstChild.nextSibling,m=d.nextSibling.nextSibling,h=m.nextSibling.nextSibling,g=h.firstChild,_=h.nextSibling,v=_.nextSibling,y=n.nextSibling;return K(i,()=>e.checkpoint.hash.slice(0,12)),K(d,()=>e.id),K(m,()=>e.checkpoint.hash),K(h,()=>e.events.after+1,g),K(h,()=>e.events.through??`live`,null),K(u,R(H,{get when(){return e.checkpoint.cutoffAt!==void 0},get children(){return[y6(),(()=>{var t=b6();return K(t,()=>new Date(e.checkpoint.cutoffAt).toISOString()),t})(),x6(),(()=>{var t=b6();return K(t,()=>e.checkpoint.boundaryEventId),t})(),S6(),(()=>{var t=b6();return K(t,()=>JSON.stringify(e.checkpoint.cursors)),t})()]}}),_),K(v,(()=>{var t=U(()=>e.runtimeMs!==void 0);return()=>t()?Pp(e.runtimeMs):`—`})()),K(y,R(V,{each:[`summary`,`messages`,`tools`,`events`,`response`],children:e=>(()=>{var t=k6();return t.$$click=()=>{o({action:e}),c([])},K(t,e),j(()=>t.classList.toggle(`selected`,a().action===e)),t})()})),K(t,R(H,{get when(){return l.loading},get children(){return C6()}}),null),K(t,R(H,{get when(){return l.error},get children(){var e=Q3();return K(e,()=>String(l.error)),e}}),null),K(t,R(H,{get when(){return U(()=>!l.loading)()&&l()},get children(){return[R(H,{get when(){return p()},get fallback(){return(()=>{var e=A6();return K(e,(()=>{var e=U(()=>typeof l().text==`string`);return()=>e()?l().text:JSON.stringify(l(),null,2)})()),e})()},get children(){var e=w6();return K(e,R(V,{get each(){return p()},children:e=>(()=>{var t=M6(),n=t.firstChild,r=n.nextSibling;return t.$$click=()=>f({action:a().action===`events`?`event`:a().action===`tools`?`tool`:`message`,id:String(e.id??e.sequence)}),K(n,()=>String(e.name??e.type??e.role??`Item`)),K(r,()=>String(e.id??`#${e.sequence}`)),K(t,R(H,{get when(){return e.preview},get children(){var t=j6();return K(t,()=>String(e.preview)),t}}),null),t})()})),e}}),(()=>{var e=E6();return K(e,R(H,{get when(){return s().length},get children(){var e=T6();return e.$$click=()=>{let e=s();o(e[e.length-1]),c(e.slice(0,-1))},e}}),null),K(e,R(H,{get when(){return typeof l()?.next==`number`},get children(){var e=e6();return e.$$click=()=>f({...a(),offset:l().next}),e}}),null),e})()]}}),null),t}}),null),j(n=>{var a=t()?.judge.decisionCheckId===e.id,o=r()===e.id,s=e.startedAt,c=e.startedAt;return a!==n.e&&i.classList.toggle(`decisive`,n.e=a),o!==n.t&&G(u,`aria-expanded`,n.t=o),s!==n.a&&G(v,`datetime`,n.a=s),c!==n.o&&G(v,`title`,n.o=c),n},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()})),n}})}ct([`click`]);var F6=W(`<div class=session-tab-heading><span class=session-connection role=status>`),I6=W(`<div class=early-stop-note><span> · evidence through #</span><button>View decision`),L6=W(`<div class=early-stop-note><span>Judge session that requested the early stop</span><button>Current judgment`),R6=W(`<div class=session-timeline-scroll>`),z6=W(`<div class=session-inspector>`),B6=W(`<pre class=raw-document>`),V6=W(`<div class=error-banner role=alert>Could not render this recorded timeline. The saved data is available from the code icon.`);function H6(e){let[t,n]=A(e.initialTab??`session`),[r,i]=A(),a=()=>r()??e.judgeId,o=()=>t()===`judge`&&e.state?.judge.kind===`code`;M(oe(()=>e.initialTab,e=>{e&&n(e)},{defer:!0}));let s=D3({benchmark:()=>e.benchmarkId,execution:()=>o()?void 0:t()===`judge`?a():e.candidateId,stage:()=>t()===`judge`?`judge`:`candidate`}),[c,l]=A(!1);M(oe(N(()=>`${e.benchmarkId}:${e.candidateId}`),()=>{l(!1),i(void 0)}));let[u,d]=A(!0),f,p,m=()=>s.state()??e.state;M(()=>{s.revision(),t(),u()&&(p!==void 0&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{f&&u()&&(f.scrollTop=f.scrollHeight)}))}),P(()=>{p!==void 0&&cancelAnimationFrame(p)});let h=t=>e.state?(t===`judge`?e.state.judge:e.state.eval).status===`in_progress`:m()?.status===`in_progress`&&(m()?.stage??`candidate`)===t;return(()=>{var p=z6();return K(p,R(Pu,{variant:`pill`,get value(){return t()},onChange:e=>{n(e),d(!0)},class:`session-tabs`,get children(){return[(()=>{var e=F6(),t=e.firstChild;return K(e,R(Pu.List,{"aria-label":`Eval run sessions`,get children(){return[R(Pu.Trigger,{value:`session`,children:`Session`}),R(Pu.Trigger,{value:`judge`,get children(){return[R(Fo,{name:`shield`}),`Judge`]}})]}}),t),K(t,(()=>{var e=U(()=>!!o());return()=>e()?`Code judgment`:s.connection()})()),K(e,R(H,{get when(){return!o()},get children(){return R(wl,{get value(){return c()?`Show timeline`:`Show raw JSON`},get children(){return R(zo,{size:`small`,variant:`ghost-muted`,get icon(){return R(Fo,{name:`code`})},get"aria-label"(){return c()?`Show timeline`:`Show raw JSON`},get"aria-pressed"(){return c()},onClick:()=>l(!c())})}})}}),null),e})(),R(H,{get when(){return U(()=>t()===`session`)()&&e.state?.stop},get children(){var t=I6(),r=t.firstChild,a=r.firstChild,o=r.nextSibling;return K(t,R(Fo,{name:`shield`}),r),K(r,()=>e.state.stop.applied?`Stopped early`:`Stop requested`,a),K(r,()=>e.state.stop.checkpoint.through,null),o.$$click=()=>{i(e.state.stop.judgeRunId),n(`judge`),d(!1)},t}}),R(H,{get when(){return U(()=>!!(t()===`judge`&&r()))()&&r()!==e.judgeId},get children(){var e=L6(),t=e.firstChild.nextSibling;return t.$$click=()=>i(void 0),e}}),R(H,{get when(){return U(()=>t()===`judge`)()&&a()},get children(){return R(P6,{get benchmarkId(){return e.benchmarkId},get judgeId(){return a()},onSelectJudge:i})}}),R(H,{get when(){return!o()},get children(){var e=R6();e.addEventListener(`scroll`,()=>{f&&f.scrollHeight-f.scrollTop-f.clientHeight<50&&d(!0)}),e.$$keydown=e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)&&d(!1)},e.$$pointerdown=e=>{e.target===f&&d(!1)},e.$$touchstart=()=>d(!1),e.addEventListener(`wheel`,e=>{e.deltaY<0&&d(!1)});var n=f;return typeof n==`function`?_t(n,e):f=e,K(e,R(H,{get when(){return!c()},get fallback(){return(()=>{var e=B6();return K(e,()=>JSON.stringify({stage:t(),document:s.stage(t()===`judge`?`judge`:`candidate`)},null,2)),e})()},get children(){return R(Xe,{get fallback(){return V6()},get children(){return[R(Pu.Content,{value:`session`,get children(){return R(y3,{get stage(){return s.stage(`candidate`)},get running(){return h(`candidate`)},get pending(){return m()?.status===`queued`||m()?.status===`in_progress`}})}}),R(Pu.Content,{value:`judge`,get children(){return R(y3,{get stage(){return s.stage(`judge`)},get running(){return h(`judge`)},get pending(){return m()?.status===`queued`||m()?.status===`in_progress`}})}})]}})}})),e}})]}}),null),K(p,R(H,{get when(){return U(()=>!u())()&&m()?.status===`in_progress`},get children(){return R(Io,{class:`follow-stream`,size:`small`,variant:`outline`,onClick:()=>d(!0),children:`Follow stream`})}}),null),j(e=>{var t=o()?`true`:void 0,n=s.stage(`candidate`).sessions.length,r=s.stage(`judge`).sessions.length;return t!==e.e&&G(p,`data-code-only`,e.e=t),n!==e.t&&G(p,`data-candidate-sessions`,e.t=n),r!==e.a&&G(p,`data-judge-sessions`,e.a=r),e},{e:void 0,t:void 0,a:void 0}),p})()}ct([`click`,`touchstart`,`pointerdown`,`keydown`]);var U6=W(`<div class=error-banner>`),W6=W(`<section class=trace-view><div class=trace-heading><div><h1></h1><p><span>·</span><span>·</span><span>·</span>Cost </p></div><div class=trace-actions>`);function G6(e){return(()=>{var t=W6(),n=t.firstChild.firstChild,r=n.firstChild,i=r.nextSibling,a=i.firstChild,o=a.nextSibling,s=o.nextSibling;s.nextSibling;var c=n.nextSibling;return K(n,R(Io,{size:`small`,variant:`ghost-muted`,icon:`arrow-left`,get onClick(){return e.onBack},children:`Eval results`}),r),K(r,()=>Tp(e.selected.model)),K(i,()=>e.run.eval,a),K(i,()=>e.selected.reasoning,o),K(i,()=>Pp(e.selected.elapsedMs),s),K(i,()=>Mp(e.selected.cost.usd),null),K(c,R(Ro,{get children(){return e.selected.status}}),null),K(c,R(H,{get when(){return e.run.runs.length>1},get children(){return R(Nd,{"aria-label":`Eval run`,get options(){return e.run.runs},get current(){return e.selected},value:e=>e.id,label:e=>`${Tp(e.model)} · ${e.reasoning} · run ${e.repetition}`,onSelect:t=>{t&&e.onRun(t.id)}})}}),null),K(t,R(H,{get when(){return e.selected.message},get children(){var t=U6();return K(t,()=>e.selected.message),t}}),null),K(t,R(H6,{get benchmarkId(){return e.run.benchmarkId},get candidateId(){return e.selected.evalRunId},get judgeId(){return e.selected.judgeRunId},get state(){return e.selected}}),null),t})()}var K6=W(`<div class=session-drawer-actions>`);function q6(e){let t=document.activeElement instanceof HTMLElement?document.activeElement:void 0,n=t?.dataset.runKey;return R(vo,{get open(){return e.open},modal:!0,onOpenChange:t=>{t||e.onClose()},get children(){return R(vo.Portal,{get children(){return[R(vo.Overlay,{class:`session-drawer-backdrop`}),R(vo.Content,{class:`session-drawer`,onCloseAutoFocus:e=>{e.preventDefault(),queueMicrotask(()=>{(t?.isConnected?t:[...document.querySelectorAll(`[data-run-key]`)].find(e=>e.dataset.runKey===n))?.focus({preventScroll:!0})})},get children(){return[R(vo.Title,{class:`sr-only`,get children(){return e.title}}),(()=>{var t=K6();return K(t,R(M3,{}),null),K(t,R(zo,{size:`small`,variant:`ghost-muted`,get icon(){return R(Fo,{name:`close`})},"aria-label":`Close eval run`,get onClick(){return e.onClose}}),null),t})(),U(()=>e.children)]}})]}})}})}var J6=e=>e.status===`completed`||e.status===`failed`,Y6=e=>[`completed`,`stopped`,`failed`,`timed_out`].includes(e.eval.status),X6=e=>typeof e.judge.score==`number`&&e.judge.score>=0&&e.judge.score<=1,Z6=e=>+(e.eval.status===`in_progress`)+ +(e.judge.status===`in_progress`),Q6=e=>+!![`completed`,`stopped`].includes(e.eval.status)+ +!!X6(e),$6=e=>+!![`failed`,`timed_out`,`interrupted`].includes(e.eval.status)+([`failed`,`timed_out`,`interrupted`,`blocked`].includes(e.judge.status)||e.judge.score===null?1:0),e8=e=>JSON.stringify([e.model,e.reasoning]);function t8(e,t){let n=e.some(e=>e.state.status===`running`&&t-Date.parse(e.state.heartbeatAt)<=3e4),r=e.toSorted((e,t)=>e.state.evalOrder-t.state.evalOrder).flatMap(e=>e.state.runs.map(t=>({eval:e.state.eval,run:t,key:`${e.id}:${t.id}`}))),i=[...new Set(r.map(({run:e})=>e8(e)))].map(e=>{let t=r.filter(({run:t})=>e8(t)===e).map(({run:e})=>e);return{key:e,model:t[0].model,reasoning:t[0].reasoning,total:t.length*2,completed:t.reduce((e,t)=>e+Q6(t),0),attention:t.reduce((e,t)=>e+$6(t),0),active:n?t.reduce((e,t)=>e+Z6(t),0):0,scheduled:t.some(e=>e.scheduled),stopped:t.filter(e=>[`cancelled`,`interrupted`].includes(e.status)).length}}),a=r.flatMap(e=>[`eval`,`judge`].flatMap(n=>{let r=e.run[n],i=bp(r,t);return[`completed`,`stopped`].includes(r.status)&&i>0&&Date.parse(r.completedAt)<=t?[{...e,kind:n,duration:i}]:[]})),o=Math.max(1,...e.map(e=>e.state.concurrency)),s=r.filter(({run:e})=>e.scheduled),c=s.filter(({run:e})=>e.eval.status===`queued`),l=up(e.flatMap(e=>{let n=fp(t,e.state.heartbeatAt,e.state.status===`running`);return e.state.runtime.map(e=>({...e,end:e.end??n}))}),t),u=null;if(n&&a.length){let e=(e,t)=>{let n=a.filter(e=>e.kind===t),r=n.filter(t=>t.eval===e.eval&&e8(t.run)===e8(e.run));if(r.length)return r;let i=n.filter(t=>t.eval===e.eval);if(i.length)return i;let o=n.filter(t=>e8(t.run)===e8(e.run));return o.length?o:n},n=e=>e.reduce((e,t)=>e+t,0)/e.length,r=(r,i)=>{let a=bp(r.run[i],t),o=e(r,i).map(e=>e.duration),s=o.filter(e=>e>a);if(o.length)return Math.max(1e3,s.length?n(s)-a:n(o)*.25)},i=[],c=new Map,l=!1;for(let e of s){let t=[`queued`,`in_progress`].includes(e.run.eval.status),n=[`queued`,`in_progress`,`watching`].includes(e.run.judge.status)||e.run.judge.status===`waiting`&&(t||[`completed`,`stopped`,`timed_out`].includes(e.run.eval.status));t||c.set(`${e.key}:eval`,0);for(let a of[`eval`,`judge`]){if(!(a===`eval`?t:n))continue;let o=r(e,a);if(o===void 0){l=!0;continue}let s=e.run[a].status===`in_progress`;i.push({id:`${e.key}:${a}`,kind:a,duration:o,active:s,dependency:a===`judge`&&!s&&t?`${e.key}:eval`:void 0})}}if(!l&&i.length){let e=i.filter(e=>e.active).map(e=>(c.set(e.id,e.duration),e.duration));for(;e.length<o;)e.push(0);let t=i.filter(e=>!e.active);for(;t.length;){let n=e.indexOf(Math.min(...e)),r=t.filter(e=>!e.dependency||c.has(e.dependency)),i=e=>e.dependency?c.get(e.dependency):0,a=r.filter(t=>i(t)<=e[n]),o=a.find(e=>e.kind===`judge`)??a[0]??r.sort((e,t)=>i(e)-i(t))[0];if(!o){l=!0;break}e[n]=Math.max(e[n],i(o))+o.duration,c.set(o.id,e[n]),t.splice(t.indexOf(o),1)}l||(u=Math.max(...e))}}return{models:i,total:r.length,finished:r.filter(({run:e})=>J6(e)).length,evals:r.filter(({run:e})=>Y6(e)).length,scored:r.filter(({run:e})=>X6(e)).length,attention:r.filter(({run:e})=>e.attention).length,active:n?r.reduce((e,{run:t})=>e+Z6(t),0):0,queued:c.length,running:n,samples:a.length,concurrency:o,elapsedMs:l,remainingMs:u,finishAt:u===null?null:t+u}}function n8(e){let t=Math.max(1,Math.ceil(e/6e4));return t<60?`${t} min`:`${Math.floor(t/60)} hr${t%60?` ${t%60} min`:``}`}var r8=W(`<div class=error-banner>`),i8=W(`<section class=live-trace-panel><header class=live-trace-heading><div><h2></h2><p> · run <!> · `);function a8(e){let t=()=>e.stage===`judge`?e.selected.judge:e.selected.eval,n=()=>e.stage===`judge`&&t().status===`completed`?`Judge · ${A8(t())}`:`${e.stage===`judge`?`Judge`:`Eval run`} · ${Fp(t().status)}`;return(()=>{var t=i8(),r=t.firstChild,i=r.firstChild,a=i.firstChild,o=a.nextSibling,s=o.firstChild,c=s.nextSibling;return c.nextSibling,K(r,R(Io,{size:`small`,variant:`ghost-muted`,icon:`arrow-left`,get onClick(){return e.onBack},children:`Queue`}),i),K(a,()=>Tp(e.selected.model)),K(o,()=>e.run.state.eval,s),K(o,()=>e.selected.repetition,c),K(o,()=>e.selected.reasoning,null),K(r,R(Ro,{get children(){return n()}}),null),K(t,R(H,{get when(){return e.selected.attention??e.selected.message},get children(){var t=r8();return K(t,()=>e.selected.attention??e.selected.message),t}}),null),K(t,R(H6,{get benchmarkId(){return e.run.benchmarkId},get candidateId(){return e.selected.evalRunId},get judgeId(){return e.selected.judgeRunId},get state(){return e.selected},get initialTab(){return e.stage===`judge`?`judge`:`session`}}),null),t})()}var o8=W(`<span class=queue-workers>Workers <strong>/`),s8=W(`<span class=queue-eta><span></span><strong>`),c8=W(`<span>Est. finish <strong>`),l8=W(`<span>Elapsed <strong>`),u8=W(`<span>Cost so far <strong>`),d8=W(`<div class=queue-timing>`),f8=W(`<div class=queue-strip>`),p8=W(`<span class=progress-attention><strong></strong> need attention`),m8=W(`<details class=model-race open><summary><span>Model progress</span><small class=progress-summary><span><strong></strong>/<!> eval runs done</span><span><strong></strong>/<!> scored</span></small></summary><div class=model-race-grid>`),h8=W(`<div class=activity-page><header class=activity-heading><h1>Eval run queue</h1></header><div class=activity-workspace><div class=queue-board aria-label="Eval and judge status columns">`),g8=W(`<span>`),_8=W(`<span>/`),v8=W(`<div class=model-race-row><div class=model-race-lane><div class=model-race-label><span class=model-race-name><strong></strong><small></small></span><span class=model-race-count><small></small></span></div><div class=model-race-track role=progressbar aria-valuemin=0><span>`),y8=W(`<small class=queue-waiting-count title="Judges waiting for finalized eval evidence"> waiting`),b8=W(`<small class=queue-waiting-count> not scheduled`),x8=W(`<p class=queue-column-empty>`),S8=W(`<section class=queue-column><header class=queue-column-heading><span aria-hidden=true></span><h2></h2></header><div class=queue-column-list role=region tabindex=0>`),C8=W(`<span class=early-stop-label>Stopped early`),w8=W(`<time class=queue-card-elapsed>`),T8=W(`<button class=queue-card><span class=queue-card-heading><span aria-hidden=true></span><strong></strong><small></small><span class=stage-icon role=img></span></span><span class=queue-card-meta><span class=queue-card-numbers><span>#`),E8=2,D8=2,O8=9,k8=e=>[`queued`,`waiting`,`watching`].includes(e.stage.status)?`queued`:e.stage.status===`in_progress`?`in_progress`:e.stage.status===`completed`||e.stage.status===`stopped`?e.kind===`judge`&&e.stage.score===null?`attention`:`completed`:`attention`,A8=e=>e.score===1?`Pass`:e.score===0?`Fail`:typeof e.score==`number`?`${Math.round(e.score*100)}%`:`Unknown`,j8=e=>e.kind===`judge`&&e.stage.score===null?`unknown`:e.stage.status;function M8(e){let[t,n]=A(``),[r,i]=A(Date.now());se(()=>{let e=setInterval(()=>i(Date.now()),1e3);P(()=>clearInterval(e))});let a=N(()=>[...new Set(e.runs.map(e=>e.benchmarkId))]),o=N(()=>e.runs.find(t=>t.id===e.run));M(()=>{o()?n(o().benchmarkId):!t()&&a().length&&n(a()[0])});let s=N(()=>e.runs.filter(e=>e.benchmarkId===t()).toSorted((e,t)=>e.state.evalOrder-t.state.evalOrder)),c=N(()=>t8(s(),r())),l=N(()=>yp(s().map(e=>e.cost))),u=N(()=>s().flatMap(e=>e.state.runs.map(t=>({key:`${e.id}:${t.id}`,group:e,run:t})))),d=N(()=>u().flatMap(({key:e,group:t,run:n})=>[{key:`${e}:eval`,group:t,run:n,kind:`eval`,stage:n.eval},{key:`${e}:judge`,group:t,run:n,kind:`judge`,stage:n.judge}])),f=[{id:`queued`,label:`Queued`,dot:`queued`},{id:`in_progress`,label:`In progress`,dot:`in_progress`},{id:`completed`,label:`Completed`,dot:`completed`},{id:`attention`,label:`Needs attention`,dot:`failed`}],p=e=>d().filter(t=>k8(t)===e).map(e=>e.key),m=()=>d().filter(e=>e.run.scheduled&&e.stage.status===`queued`).length,h=()=>d().filter(e=>e.run.scheduled&&[`waiting`,`watching`].includes(e.stage.status)).length,g=()=>d().filter(e=>e.run.scheduled===!1&&[`queued`,`waiting`,`watching`].includes(e.stage.status)).length,[_,v]=A({width:0,tick:E8,gap:D8,height:O8}),y=e=>{let t=()=>{let t=window.devicePixelRatio||1,n=e=>Math.max(1,Math.round(e*t))/t;v({width:e.getBoundingClientRect().width,tick:n(E8),gap:n(D8),height:n(O8)})},n=new ResizeObserver(([e])=>{e.contentRect.width!==_().width&&t()});n.observe(e),window.addEventListener(`resize`,t),P(()=>{n.disconnect(),window.removeEventListener(`resize`,t)})},b=N(()=>{let e=[`completed`,`attention`,`in_progress`,`queued`],t=d().map(e=>k8(e)).sort((t,n)=>e.indexOf(t)-e.indexOf(n));if(!t.length)return[];let{width:n,tick:r,gap:i}=_(),a=Math.floor((n+i)/(r+i)),o=Math.max(1,a||t.length);return Array.from({length:o},(e,n)=>{let r=Math.floor(n*t.length/o),i=Math.max(r+1,Math.floor((n+1)*t.length/o)),a=new Map;for(let e of t.slice(r,i))a.set(e,(a.get(e)??0)+1);let[s]=[...a.entries()].sort((e,t)=>t[1]-e[1])[0];return{column:s,title:[...a.entries()].map(([e,t])=>`${t} ${f.find(t=>t.id===e).label.toLowerCase()}`).join(`, `)}})}),x=()=>o()?.state.runs.find(t=>t.id===e.evalRun);return(()=>{var i=h8(),s=i.firstChild;s.firstChild;var v=s.nextSibling,S=v.firstChild;return K(s,R(H,{get when(){return a().length},get children(){return R(Nd,{"aria-label":`Benchmark run`,get options(){return a()},get current(){return t()},label:t=>`Benchmark · ${Np(e.runs.find(e=>e.benchmarkId===t).state.startedAt)}`,onSelect:r=>{r&&r!==t()&&(e.onSelect(``,``),n(r))}})}}),null),K(i,R(H,{get when(){return u().length},get children(){return[(()=>{var e=d8();return K(e,R(wl,{value:`Free workers immediately start ready work. Judges wait for finalized eval evidence.`,get children(){var e=o8(),t=e.firstChild.nextSibling,n=t.firstChild;return K(t,()=>c().active,n),K(t,()=>c().concurrency,null),e}}),null),K(e,R(wl,{get value(){return`Estimated from ${c().samples} completed eval/judge stage runtimes for the current execution scope, using ${c().concurrency} parallel workers. Idle gaps and deferred work are excluded.`},get children(){var e=s8(),t=e.firstChild,n=t.nextSibling;return K(t,()=>c().running?`ETA`:`Run ended`),K(n,(()=>{var e=U(()=>c().remainingMs!==null);return()=>e()?`About ${n8(c().remainingMs)} left`:U(()=>!!c().running)()?`Estimating…`:`${c().finished}/${c().total} finished`})()),e}}),null),K(e,R(H,{get when(){return c().finishAt!==null},get children(){var e=c8(),t=e.firstChild.nextSibling;return K(t,()=>new Date(c().finishAt).toLocaleString([],{...new Date(c().finishAt).toDateString()===new Date(r()).toDateString()?{}:{month:`short`,day:`numeric`},hour:`numeric`,minute:`2-digit`})),e}}),null),K(e,R(wl,{value:`Recorded eval and judge wall-clock runtime across all executions. Overlapping workers count once; idle gaps and passive monitoring are excluded.`,get children(){var e=l8(),t=e.firstChild.nextSibling;return K(t,()=>Pp(c().elapsedMs)),e}}),null),K(e,R(wl,{value:`Reported eval and judge cost, including active-session usage and previous executions.`,get children(){var e=u8(),t=e.firstChild.nextSibling;return K(t,()=>Mp(l().reportedUSD)),e}}),null),e})(),(()=>{var e=f8();return _t(y,e),K(e,R(V,{get each(){return b()},children:e=>(()=>{var t=g8();return j(n=>{var r=e.column,i=e.title;return r!==n.e&&dt(t,n.e=r),i!==n.t&&G(t,`title`,n.t=i),n},{e:void 0,t:void 0}),t})()})),j(t=>{var n=`${_().tick}px`,r=`${_().gap}px`,i=`${_().height}px`,a=`${c().evals} of ${c().total} eval runs done, ${c().scored} scored`;return n!==t.e&&ht(e,`--strip-tick`,t.e=n),r!==t.t&&ht(e,`--strip-gap`,t.t=r),i!==t.a&&ht(e,`--strip-height`,t.a=i),a!==t.o&&G(e,`aria-label`,t.o=a),t},{e:void 0,t:void 0,a:void 0,o:void 0}),e})(),(()=>{var e=m8(),t=e.firstChild,n=t.firstChild.nextSibling,r=n.firstChild,i=r.firstChild,a=i.nextSibling.nextSibling;a.nextSibling;var o=r.nextSibling,s=o.firstChild,l=s.nextSibling.nextSibling;l.nextSibling;var u=t.nextSibling;return K(i,()=>c().evals),K(r,()=>c().total,a),K(s,()=>c().scored),K(o,()=>c().total,l),K(n,R(H,{get when(){return c().attention},get children(){var e=p8(),t=e.firstChild;return K(t,()=>c().attention),e}}),null),K(u,R(V,{get each(){return c().models.map(e=>e.key)},children:e=>{let t=()=>c().models.find(t=>t.key===e);return(()=>{var e=v8(),n=e.firstChild,r=n.firstChild,i=r.firstChild,a=i.firstChild,o=a.nextSibling,s=i.nextSibling,c=s.firstChild,l=r.nextSibling,u=l.firstChild;return K(e,R(cp,{get id(){return Ep(t().model)}}),n),K(a,()=>Tp(t().model)),K(o,()=>t().reasoning),K(c,(()=>{var e=U(()=>!!t().active);return()=>e()?`${t().active} running`:U(()=>!!t().stopped)()?`${t().stopped} stopped`:U(()=>t().completed+t().attention===t().total)()?`Done`:t().scheduled?`Queued`:`Not scheduled`})()),K(s,R(wl,{get value(){return`${t().completed} of ${t().total} eval and judge stages completed${t().attention?`, ${t().attention} need attention`:``}`},get children(){var e=_8(),n=e.firstChild;return K(e,()=>t().completed,n),K(e,()=>t().total,null),e}}),null),j(e=>{var n=`${Tp(t().model)} · ${t().reasoning} completed stages`,r=t().total,i=t().completed,a=`${t().completed/t().total*100}%`;return n!==e.e&&G(l,`aria-label`,e.e=n),r!==e.t&&G(l,`aria-valuemax`,e.t=r),i!==e.a&&G(l,`aria-valuenow`,e.a=i),a!==e.o&&ht(u,`width`,e.o=a),e},{e:void 0,t:void 0,a:void 0,o:void 0}),e})()}})),e})()]}}),v),K(S,R(V,{each:f,children:t=>(()=>{var n=S8(),i=n.firstChild,a=i.firstChild,o=a.nextSibling,s=i.nextSibling;return K(o,()=>t.label),K(i,R(Ro,{get children(){return U(()=>t.id===`queued`)()?`${m()} ready`:p(t.id).length}}),null),K(i,R(H,{get when(){return U(()=>t.id===`queued`)()&&h()},get children(){var e=y8(),t=e.firstChild;return K(e,h,t),e}}),null),K(i,R(H,{get when(){return U(()=>t.id===`queued`)()&&g()},get children(){var e=b8(),t=e.firstChild;return K(e,g,t),e}}),null),K(s,R(V,{get each(){return p(t.id)},children:t=>{let n=()=>d().find(e=>e.key===t),i=()=>e.run===n().group.id&&e.evalRun===n().run.id&&e.stage===n().kind,a=()=>bp(n().stage,fp(r(),n().group.state.heartbeatAt,n().group.state.status===`running`)),o=()=>A3()?`Hidden eval`:n().group.state.eval,s=()=>n().run.scheduled===!1&&[`queued`,`waiting`,`watching`].includes(n().stage.status)?`Not scheduled`:n().kind===`judge`&&n().stage.status===`completed`?A8(n().stage):n().stage.status===`waiting`?`Waiting for eval run`:n().stage.status===`blocked`?`Blocked by eval run`:Fp(n().stage.status);return(()=>{var r=T8(),c=r.firstChild,l=c.firstChild,u=l.nextSibling,d=u.nextSibling,f=d.nextSibling,p=c.nextSibling,m=p.firstChild,h=m.firstChild;return h.firstChild,r.$$click=()=>{A3()||e.onSelect(n().group.id,n().run.id,n().kind)},G(r,`data-run-key`,t),K(u,()=>Tp(n().run.model)),K(d,()=>n().run.reasoning),K(f,R(Fo,{get name(){return n().kind===`eval`?`flask`:`shield`}})),K(p,R(N3,{get children(){return n().group.state.eval}}),m),K(m,R(H,{get when(){return U(()=>n().kind===`eval`)()&&n().stage.status===`stopped`},get children(){var e=C8();return j(()=>G(e,`title`,`Stopped after judge check through evidence event ${n().run.stop?.checkpoint.through??``}`)),e}}),h),K(m,R(H,{get when(){return U(()=>n().stage.status===`in_progress`)()&&a()!==void 0},get children(){var e=w8();return K(e,()=>Pp(a())),e}}),h),K(m,R(H,{get when(){return U(()=>n().kind===`judge`)()&&n().stage.status===`completed`},get children(){var e=g8();return K(e,()=>A8(n().stage)),j(()=>dt(e,`verdict ${A8(n().stage).toLowerCase()}`)),e}}),h),K(h,()=>n().run.repetition,null),j(e=>{var t=n().kind,a=n().stage.status,c=!!i(),u=i(),d=A3(),p=`${n().kind===`eval`?`Eval run`:`Judge`}, ${Tp(n().run.model)}, ${n().run.reasoning}, ${o()}, run ${n().run.repetition}, ${s()}`,m=`status-dot ${j8(n())}`,h=n().kind,g=`${n().kind===`eval`?`Eval run`:`Judge`} · ${s()}`,_=n().kind===`eval`?`Eval run`:`Judge`;return t!==e.e&&G(r,`data-stage`,e.e=t),a!==e.t&&G(r,`data-state`,e.t=a),c!==e.a&&r.classList.toggle(`selected`,e.a=c),u!==e.o&&G(r,`aria-pressed`,e.o=u),d!==e.i&&(r.disabled=e.i=d),p!==e.n&&G(r,`aria-label`,e.n=p),m!==e.s&&dt(l,e.s=m),h!==e.h&&G(f,`data-stage`,e.h=h),g!==e.r&&G(f,`title`,e.r=g),_!==e.d&&G(f,`aria-label`,e.d=_),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),r})()}}),null),K(s,R(H,{get when(){return!p(t.id).length},get children(){var e=x8();return K(e,()=>t.id===`attention`?`Nothing needs attention`:`No eval or judge runs`),e}}),null),j(e=>{var r=`queue-${t.id}`,i=`status-dot ${t.dot}`,c=`queue-${t.id}`,l=`${t.label} eval and judge runs`;return r!==e.e&&G(n,`aria-labelledby`,e.e=r),i!==e.t&&dt(a,e.t=i),c!==e.a&&G(o,`id`,e.a=c),l!==e.o&&G(s,`aria-label`,e.o=l),e},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()})),K(v,R(H,{get when(){return U(()=>!A3())()&&x()},get children(){return R(q6,{open:!0,get title(){return`${Tp(x().model)} ${e.stage===`judge`?`judge`:`eval run`}`},onClose:()=>e.onSelect(``,``),get children(){return R(a8,{get run(){return o()},get selected(){return x()},get stage(){return e.stage},onBack:()=>e.onSelect(``,``)})}})}}),null),i})()}ct([`click`]),Ra({},{Checkbox:()=>U8,Control:()=>F8,Description:()=>I8,ErrorMessage:()=>L8,Indicator:()=>R8,Input:()=>z8,Label:()=>B8,Root:()=>V8,useCheckboxContext:()=>P8});var N8=I();function P8(){let e=L(N8);if(e===void 0)throw Error("[kobalte]: `useCheckboxContext` must be used within a `Checkbox` component");return e}function F8(e){let t=Ru(),n=P8(),[r,i]=B(Z({id:n.generateId(`control`)},e),[`onClick`,`onKeyDown`]);return R(Da,z({as:`div`,onClick:e=>{X(e,r.onClick),n.toggle(),n.inputRef()?.focus({preventScroll:!0})},onKeyDown:e=>{X(e,r.onKeyDown),e.key===ci.Space&&(n.toggle(),n.inputRef()?.focus({preventScroll:!0}))}},()=>t.dataset(),()=>n.dataset(),i))}function I8(e){let t=P8();return R(zu,z(()=>t.dataset(),e))}function L8(e){let t=P8();return R(ud,z(()=>t.dataset(),e))}function R8(e){let t=Ru(),n=P8(),[r,i]=A(),[a,o]=B(Z({id:n.generateId(`indicator`)},e),[`ref`,`forceMount`]),{present:s}=ao({show:()=>a.forceMount||n.indeterminate()||n.checked(),element:()=>r()??null});return R(H,{get when(){return s()},get children(){return R(Da,z({as:`div`,ref(e){var t=Xr(i,a.ref);typeof t==`function`&&t(e)}},()=>t.dataset(),()=>n.dataset(),o))}})}function z8(e){let t,n=Ru(),r=P8(),[i,a,o]=B(Z({id:r.generateId(`input`)},e),[`ref`,`style`,`onChange`,`onFocus`,`onBlur`],id),{fieldProps:s}=ad(a),[c,l]=A(!1);return M(oe([()=>r.checked(),()=>r.value()],()=>{l(!0),t?.dispatchEvent(new Event(`input`,{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event(`change`,{bubbles:!0,cancelable:!0}))},{defer:!0})),M(oe([()=>t,()=>r.indeterminate(),()=>r.checked()],([e,t])=>{e&&(e.indeterminate=t)})),R(Da,z({as:`input`,ref(e){var n=Xr(e=>{r.setInputRef(e),t=e},i.ref);typeof n==`function`&&n(e)},type:`checkbox`,get id(){return s.id()},get name(){return n.name()},get value(){return r.value()},get checked(){return r.checked()},get required(){return n.isRequired()},get disabled(){return n.isDisabled()},get readonly(){return n.isReadOnly()},get style(){return Yr(Yi,i.style)},get"aria-label"(){return s.ariaLabel()},get"aria-labelledby"(){return s.ariaLabelledBy()},get"aria-describedby"(){return s.ariaDescribedBy()},get"aria-invalid"(){return n.validationState()===`invalid`||void 0},get"aria-required"(){return n.isRequired()},get"aria-disabled"(){return n.isDisabled()},get"aria-readonly"(){return n.isReadOnly()},onChange:e=>{if(X(e,i.onChange),e.stopPropagation(),!c()){let t=e.target;r.setIsChecked(t.checked),t.checked=r.checked()}l(!1)},onFocus:e=>{X(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{X(e,i.onBlur),r.setIsFocused(!1)}},()=>n.dataset(),()=>r.dataset(),o))}function B8(e){let t=P8();return R(od,z(()=>t.dataset(),e))}function V8(e){let t,[n,r,i]=B(Z({value:`on`,id:`checkbox-${We()}`},e),[`ref`,`children`,`value`,`checked`,`defaultChecked`,`indeterminate`,`onChange`,`onPointerDown`],Fu),[a,o]=A(),[s,c]=A(!1),{formControlContext:l}=Iu(r),u=Id({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>l.isDisabled(),isReadOnly:()=>l.isReadOnly()});sd(()=>t,()=>u.setIsSelected(n.defaultChecked??!1));let d=e=>{X(e,n.onPointerDown),s()&&e.preventDefault()},f=N(()=>({"data-checked":u.isSelected()?``:void 0,"data-indeterminate":n.indeterminate?``:void 0})),p={value:()=>n.value,dataset:f,checked:()=>u.isSelected(),indeterminate:()=>n.indeterminate??!1,inputRef:a,generateId:ni(()=>q(r.id)),toggle:()=>u.toggle(),setIsChecked:e=>u.setIsSelected(e),setIsFocused:c,setInputRef:o};return R(Lu.Provider,{value:l,get children(){return R(N8.Provider,{value:p,get children(){return R(Da,z({as:`div`,ref(e){var r=Xr(e=>t=e,n.ref);typeof r==`function`&&r(e)},role:`group`,get id(){return q(r.id)},onPointerDown:d},()=>l.dataset(),f,i,{get children(){return R(H8,{state:p,get children(){return n.children}})}}))}})}})}function H8(e){return U(me(()=>{let t=e.children;return ti(t)?t(e.state):t}))}var U8=Object.assign(V8,{Control:F8,Description:I8,ErrorMessage:L8,Indicator:R8,Input:z8,Label:B8}),W8=W(`<div data-slot=checkbox-checkbox-content>`),G8=W(`<svg viewBox="0 0 12 12"fill=none width=10 height=10 xmlns=http://www.w3.org/2000/svg><path d="M3 7.17905L5.02703 8.85135L9 3.5"stroke=currentColor stroke-width=1.5 stroke-linecap=square>`);function K8(e){let[t,n]=B(e,[`children`,`class`,`label`,`hideLabel`,`description`,`icon`]);return R(V8,z(n,{"data-component":`checkbox`,get children(){return[R(z8,{"data-slot":`checkbox-checkbox-input`}),R(F8,{"data-slot":`checkbox-checkbox-control`,get children(){return R(R8,{"data-slot":`checkbox-checkbox-indicator`,get children(){return t.icon||G8()}})}}),(()=>{var n=W8();return K(n,R(H,{get when(){return e.children},get children(){return R(B8,{"data-slot":`checkbox-checkbox-label`,get classList(){return{"sr-only":t.hideLabel}},get children(){return e.children}})}}),null),K(n,R(H,{get when(){return t.description},get children(){return R(I8,{"data-slot":`checkbox-checkbox-description`,get children(){return t.description}})}}),null),K(n,R(L8,{"data-slot":`checkbox-checkbox-error`}),null),n})()]}}))}Ra({},{Anchor:()=>Y8,Arrow:()=>el,CloseButton:()=>X8,Content:()=>Z8,Description:()=>Q8,Popover:()=>i5,Portal:()=>$8,Root:()=>t5,Title:()=>n5,Trigger:()=>r5,usePopoverContext:()=>J8});var q8=I();function J8(){let e=L(q8);if(e===void 0)throw Error("[kobalte]: `usePopoverContext` must be used within a `Popover` component");return e}function Y8(e){let t=J8(),[n,r]=B(e,[`ref`]);return R(Da,z({as:`div`,ref(e){var r=Xr(t.setDefaultAnchorRef,n.ref);typeof r==`function`&&r(e)}},()=>t.dataset(),r))}function X8(e){let t=J8(),[n,r]=B(e,[`aria-label`,`onClick`]);return R(Va,z({get"aria-label"(){return n[`aria-label`]||t.translations().dismiss},onClick:e=>{X(e,n.onClick),t.close()}},()=>t.dataset(),r))}function Z8(e){let t,n=J8(),[r,i]=B(Z({id:n.generateId(`content`)},e),[`ref`,`style`,`onOpenAutoFocus`,`onCloseAutoFocus`,`onPointerDownOutside`,`onFocusOutside`,`onInteractOutside`]),a=!1,o=!1,s=!1,c=e=>{r.onCloseAutoFocus?.(e),n.isModal()?(e.preventDefault(),a||bi(n.triggerRef())):(e.defaultPrevented||(o||bi(n.triggerRef()),e.preventDefault()),o=!1,s=!1)},l=e=>{r.onPointerDownOutside?.(e),n.isModal()&&(a=e.detail.isContextMenu)},u=e=>{r.onFocusOutside?.(e),n.isOpen()&&n.isModal()&&e.preventDefault()},d=e=>{r.onInteractOutside?.(e),!n.isModal()&&(e.defaultPrevented||(o=!0,e.detail.originalEvent.type===`pointerdown`&&(s=!0)),ri(n.triggerRef(),e.target)&&e.preventDefault(),e.detail.originalEvent.type===`focusin`&&s&&e.preventDefault())};return ya({isDisabled:()=>!(n.isOpen()&&n.isModal()),targets:()=>t?[t]:[]}),io({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),_a({trapFocus:()=>n.isOpen()&&n.isModal(),onMountAutoFocus:r.onOpenAutoFocus,onUnmountAutoFocus:c},()=>t),M(()=>P(n.registerContentId(i.id))),R(H,{get when(){return n.contentPresent()},get children(){return R(ll.Positioner,{get children(){return R(Aa,z({ref(e){var i=Xr(e=>{n.setContentRef(e),t=e},r.ref);typeof i==`function`&&i(e)},role:`dialog`,tabIndex:-1,get disableOutsidePointerEvents(){return U(()=>!!n.isOpen())()&&n.isModal()},get excludedElements(){return[n.triggerRef]},get style(){return Yr({"--kb-popover-content-transform-origin":`var(--kb-popper-content-transform-origin)`,position:`relative`},r.style)},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,get onDismiss(){return n.close}},()=>n.dataset(),i))}})}})}function Q8(e){let t=J8(),[n,r]=B(Z({id:t.generateId(`description`)},e),[`id`]);return M(()=>P(t.registerDescriptionId(n.id))),R(Da,z({as:`p`,get id(){return n.id}},()=>t.dataset(),r))}function $8(e){let t=J8();return R(H,{get when(){return t.contentPresent()},get children(){return R(Mt,e)}})}var e5={dismiss:`Dismiss`};function t5(e){let[t,n]=B(Z({id:`popover-${We()}`,modal:!1,translations:e5},e),[`translations`,`id`,`open`,`defaultOpen`,`onOpenChange`,`modal`,`preventScroll`,`forceMount`,`anchorRef`]),[r,i]=A(),[a,o]=A(),[s,c]=A(),[l,u]=A(),[d,f]=A(),[p,m]=A(),h=Pa({open:()=>t.open,defaultOpen:()=>t.defaultOpen,onOpenChange:e=>t.onOpenChange?.(e)}),g=()=>t.anchorRef?.()??r()??a(),{present:_}=ao({show:()=>t.forceMount||h.isOpen(),element:()=>s()??null}),v={translations:()=>t.translations??e5,dataset:N(()=>({"data-expanded":h.isOpen()?``:void 0,"data-closed":h.isOpen()?void 0:``})),isOpen:h.isOpen,isModal:()=>t.modal??!1,preventScroll:()=>t.preventScroll??v.isModal(),contentPresent:_,triggerRef:a,contentId:l,titleId:d,descriptionId:p,setDefaultAnchorRef:i,setTriggerRef:o,setContentRef:c,close:h.close,toggle:h.toggle,generateId:ni(()=>t.id),registerContentId:Ua(u),registerTitleId:Ua(f),registerDescriptionId:Ua(m)};return R(q8.Provider,{value:v,get children(){return R(ll,z({anchorRef:g,contentRef:s},n))}})}function n5(e){let t=J8(),[n,r]=B(Z({id:t.generateId(`title`)},e),[`id`]);return M(()=>P(t.registerTitleId(n.id))),R(Da,z({as:`h2`,get id(){return n.id}},()=>t.dataset(),r))}function r5(e){let t=J8(),[n,r]=B(e,[`ref`,`onClick`,`onPointerDown`]);return R(Va,z({ref(e){var r=Xr(t.setTriggerRef,n.ref);typeof r==`function`&&r(e)},"aria-haspopup":`dialog`,get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return U(()=>!!t.isOpen())()?t.contentId():void 0},onPointerDown:e=>{X(e,n.onPointerDown),e.preventDefault()},onClick:e=>{X(e,n.onClick),t.toggle()}},()=>t.dataset(),r))}var i5=Object.assign(t5,{Anchor:Y8,Arrow:el,CloseButton:X8,Content:Z8,Description:Q8,Portal:$8,Title:n5,Trigger:r5}),a5=W(`<div data-slot=popover-header>`),o5=W(`<div data-slot=popover-body>`);function s5(e){let t=Ml(),[n,r]=B(e,[`trigger`,`triggerAs`,`triggerProps`,`title`,`description`,`class`,`classList`,`style`,`children`,`portal`,`open`,`defaultOpen`,`onOpenChange`,`modal`]),[i,a]=$t({contentRef:void 0,triggerRef:void 0,dismiss:null,uncontrolledOpen:n.defaultOpen??!1}),o=()=>n.open!==void 0,s=()=>o()?n.open??!1:i.uncontrolledOpen,c=e=>{e&&a(`dismiss`,null),n.onOpenChange&&n.onOpenChange(e),!o()&&a(`uncontrolledOpen`,e)};M(()=>{if(!s())return;let e=e=>{if(!e)return!1;let t=i.contentRef;if(t&&t.contains(e))return!0;let n=i.triggerRef;return!!(n&&n.contains(e))},t=e=>{a(`dismiss`,e),c(!1)};pn(window,`keydown`,e=>{e.key===`Escape`&&(t(`escape`),e.preventDefault(),e.stopPropagation())},{capture:!0}),pn(window,`pointerdown`,n=>{let r=n.target;r instanceof Node&&(e(r)||t(`outside`))},{capture:!0}),pn(window,`focusin`,n=>{let r=n.target;r instanceof Node&&(e(r)||t(`outside`))},{capture:!0})});let l=()=>R(i5.Content,{ref:e=>a(`contentRef`,e),"data-component":`popover-content`,get classList(){return{...n.classList,[n.class??``]:!!n.class}},get style(){return n.style},onCloseAutoFocus:e=>{i.dismiss===`outside`&&e.preventDefault(),a(`dismiss`,null)},get children(){return[R(H,{get when(){return n.title},get children(){var e=a5();return K(e,R(i5.Title,{"data-slot":`popover-title`,get children(){return n.title}}),null),K(e,R(i5.CloseButton,{"data-slot":`popover-close-button`,as:zo,get icon(){return R(Fo,{name:`close`})},variant:`ghost`,get"aria-label"(){return t.t(`ui.common.close`)}}),null),e}}),R(H,{get when(){return n.description},get children(){return R(i5.Description,{"data-slot":`popover-description`,get children(){return n.description}})}}),(()=>{var e=o5();return K(e,()=>n.children),e})()]}});return R(i5,z({gutter:4},r,{get open(){return s()},onOpenChange:c,get modal(){return n.modal??!1},get children(){return[R(i5.Trigger,z({ref:e=>a(`triggerRef`,e),get as(){return n.triggerAs??`div`},"data-slot":`popover-trigger`},()=>n.triggerProps,{get children(){return n.trigger}})),R(H,{get when(){return n.portal??!0},get fallback(){return l()},get children(){return R(i5.Portal,{get children(){return l()}})}})]}}))}var c5=W(`<p class=model-filter-hint>Show models matching any selection.`),l5=W(`<div class=model-filter-groups>`),u5=W(`<div class=model-filter-footer><span> of <!> models`),d5=W(`<div class=model-filter>`),f5=W(`<span>`),p5=W(`<fieldset><legend>`),m5=W(`<div class=model-filter-option><span>`);function h5(e){let t=N(()=>[`lab`,`family`].map(t=>{let n=new Map;for(let r of e.models){let e=Op(r)[t];n.set(e,(n.get(e)??0)+1)}return{kind:t,label:t===`lab`?`Labs`:`Model families`,options:[...n].sort(([e],[t])=>e.localeCompare(t)).map(([e,n])=>({key:`${t}:${e}`,label:e,count:n}))}})),n=()=>e.selected.map(e=>e.slice(e.indexOf(`:`)+1)),r=()=>n().length?n().length===1?n()[0]:`${n()[0]} +${n().length-1}`:`All models`,i=(t,n)=>e.onChange(n?[...new Set([...e.selected,t])]:e.selected.filter(e=>e!==t));return(()=>{var a=d5();return K(a,R(s5,{title:`Labs / model families`,placement:`bottom-end`,class:`model-filter-popover`,triggerAs:Io,get triggerProps(){return{size:`small`,variant:`outline`,"aria-label":`Filter labs and model families: ${n().join(`, `)||`All models`}`}},get trigger(){return[(()=>{var e=f5();return K(e,r),e})(),R(Fo,{name:`chevron-down`})]},get children(){return[c5(),(()=>{var n=l5();return K(n,R(V,{get each(){return t()},children:t=>(()=>{var n=p5(),r=n.firstChild;return K(r,()=>t.label),K(n,R(V,{get each(){return t.options},children:t=>(()=>{var n=m5(),r=n.firstChild;return K(n,R(K8,{get checked(){return e.selected.includes(t.key)},onChange:e=>i(t.key,e),get children(){return t.label}}),r),K(r,()=>t.count),j(()=>G(r,`aria-label`,`${t.count} models`)),n})()}),null),n})()})),n})(),(()=>{var t=u5(),n=t.firstChild,r=n.firstChild,i=r.nextSibling;return i.nextSibling,K(n,()=>e.models.filter(t=>kp(t,e.selected)).length,r),K(n,()=>e.models.length,i),K(t,R(Io,{size:`small`,variant:`ghost-muted`,get disabled(){return!e.selected.length},onClick:()=>e.onChange([]),children:`Clear filters`}),null),t})()]}}),null),K(a,R(H,{get when(){return e.selected.length},get children(){return R(Io,{size:`small`,variant:`ghost-muted`,"aria-label":`Clear model filters`,onClick:()=>e.onChange([]),children:`Clear`})}}),null),a})()}var g5=W(`<p class=model-filter-hint>Score only criteria in any selected category.`),_5=W(`<fieldset class=category-filter-options><legend>Categories`),v5=W(`<div class=model-filter-footer><span> of <!> categories`),y5=W(`<div class="model-filter category-filter">`),b5=W(`<span>`),x5=W(`<div class=model-filter-option><span>`),S5=e=>`${e} ${e===1?`criterion`:`criteria`}`;function C5(e){let t=()=>e.categories.filter(t=>e.selected.includes(t.key)).map(e=>e.name),n=()=>t().length?t().length===1?t()[0]:`${t()[0]} +${t().length-1}`:`All categories`,r=(t,n)=>e.onChange(n?e.categories.map(e=>e.key).filter(n=>n===t||e.selected.includes(n)):e.selected.filter(e=>e!==t));return(()=>{var i=y5();return K(i,R(s5,{title:`Categories`,placement:`bottom-end`,class:`model-filter-popover`,triggerAs:Io,get triggerProps(){return{size:`small`,variant:`outline`,"aria-label":`Filter criteria by category: ${t().join(`, `)||`All categories`}`}},get trigger(){return[(()=>{var e=b5();return K(e,n),e})(),R(Fo,{name:`chevron-down`})]},get children(){return[g5(),(()=>{var t=_5();return t.firstChild,K(t,R(V,{get each(){return e.categories},children:t=>(()=>{var n=x5(),i=n.firstChild;return K(n,R(K8,{get checked(){return e.selected.includes(t.key)},onChange:e=>r(t.key,e),get children(){return t.name}}),i),K(i,()=>t.criteria),j(e=>{var n=t.criteria<3,r=S5(t.criteria),a=t.criteria<3?`Low coverage: fewer than 3 criteria`:void 0;return n!==e.e&&i.classList.toggle(`low`,e.e=n),r!==e.t&&G(i,`aria-label`,e.t=r),a!==e.a&&G(i,`title`,e.a=a),e},{e:void 0,t:void 0,a:void 0}),n})()}),null),t})(),(()=>{var t=v5(),n=t.firstChild,r=n.firstChild,i=r.nextSibling;return i.nextSibling,K(n,()=>e.selected.length||e.categories.length,r),K(n,()=>e.categories.length,i),K(t,R(Io,{size:`small`,variant:`ghost-muted`,get disabled(){return!e.selected.length},onClick:()=>e.onChange([]),children:`Clear filters`}),null),t})()]}}),null),K(i,R(H,{get when(){return e.selected.length},get children(){return R(Io,{size:`small`,variant:`ghost-muted`,"aria-label":`Clear category filters`,onClick:()=>e.onChange([]),children:`Clear`})}}),null),i})()}var w5=W(`<svg role=img>`),T5=W(`<div class=category-radar><div class=category-radar-chart><div class=category-radar-modes role=group aria-label="Radar mode"></div><p class=category-radar-note>Solid areas show earned points. Dashed outlines show the possible range for unscored checks. Dashed axes and amber counts mark low coverage: fewer than <!> criteria.</p></div><div class=category-radar-models><span class=category-radar-heading>`),E5=W(`<div class=category-bars><p>Select three or more categories for a radar chart.`),D5=W(`<div class=category-bar-group><span>`),O5=W(`<div class=category-bar><i></i><small>`),k5=W(`<svg><polygon class=radar-ring></svg>`,!1,!0,!1),A5=W(`<svg><text class=radar-tick></svg>`,!1,!0,!1),j5=W(`<svg><g><line class=radar-axis></line><text class=radar-label><tspan class=radar-coverage dy=15></svg>`,!1,!0,!1),M5=W(`<svg><polygon class=radar-upper></svg>`,!1,!0,!1),N5=W(`<svg><g class=radar-series><polygon class=radar-area></svg>`,!1,!0,!1),P5=W(`<svg><circle class=radar-point r=4><title></svg>`,!1,!0,!1),F5=W(`<span class=category-swatch>`),I5=W(`<span class=category-radar-name><small>`),L5=W(`<div class=category-radar-model><span class=category-radar-score>`),R5=[`var(--app-success)`,`var(--v2-state-fg-info, #6aa6ff)`,`var(--v2-state-fg-warning, #f0b45e)`,`var(--app-danger)`],z5=R5.length,B5={width:580,height:450,radius:150,labelGap:20},V5=e=>e.upper-e.lower>1e-6,H5=e=>V5(e)?`${Ap(e.lower)}–${jp(e.upper)}`:jp(e.lower),U5=e=>V5(e)?`${Math.round(e.lower)}–${Math.round(e.upper)}%`:`${Math.round(e.lower)}%`,W5=e=>{let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2};function G5(e){let t=N(()=>[...e.scores].sort((e,t)=>gp(t).lower-gp(e).lower)),[n,r]=A(),[i,a]=A(`compare`),o=()=>(n()??t().map(e=>e.model)).filter(t=>e.scores.some(e=>e.model===t)).slice(0,z5),s=()=>o().slice(0,i()===`median`?1:z5),c=e=>r([e,...o().filter(t=>t!==e)]),l=t=>e.categories.map(e=>gp(_p(t,[e.key]))),u=N(()=>{let t=s().map((t,n)=>{let r=e.scores.find(e=>e.model===t);return{id:t,label:Tp(t),color:R5[n],values:l(r)}});if(i()!==`median`)return t;let n=e.scores.map(l);return[{id:`median`,label:`Field median`,color:`var(--app-muted)`,dashed:!0,values:e.categories.map((e,t)=>{let r=W5(n.map(e=>e[t].lower));return{lower:r,upper:r,coverage:100}})},...t]}),d=(e,t)=>{let n=o();r(t?[...n.filter(t=>t!==e),e].slice(-z5):n.filter(t=>t!==e))},f=t=>-Math.PI/2+2*Math.PI*t/e.categories.length,p=(e,t,n=0)=>{let r=B5.radius*Math.max(0,Math.min(100,t))/100+n;return[B5.width/2+Math.cos(f(e))*r,B5.height/2+Math.sin(f(e))*r]},m=e=>e.map((e,t)=>p(t,e).join(`,`)).join(` `),h=e=>{let t=Math.cos(f(e));return Math.abs(t)<.25?`middle`:t>0?`start`:`end`},g=e=>{let t=Math.sin(f(e)),n=p(e,100,B5.labelGap)[1];return t<-.25?n-14:t>.25?n+4:n-6};return(()=>{var n=T5(),r=n.firstChild,o=r.firstChild,l=o.nextSibling,f=l.firstChild.nextSibling;f.nextSibling;var _=r.nextSibling,v=_.firstChild;return K(o,R(Io,{size:`small`,get variant(){return i()===`compare`?`neutral`:`ghost-muted`},get"aria-pressed"(){return i()===`compare`},onClick:()=>a(`compare`),children:`Compare models`}),null),K(o,R(Io,{size:`small`,get variant(){return i()===`median`?`neutral`:`ghost-muted`},get"aria-pressed"(){return i()===`median`},onClick:()=>a(`median`),children:`Model vs field median`}),null),K(r,R(H,{get when(){return e.categories.length>=3},get fallback(){return(()=>{var t=E5();return t.firstChild,K(t,R(V,{get each(){return e.categories},children:(e,t)=>(()=>{var n=D5(),r=n.firstChild;return K(r,()=>e.name),K(n,R(V,{get each(){return u()},children:n=>(()=>{var r=O5(),i=r.firstChild,a=i.nextSibling;return K(a,()=>H5(n.values[t()])),j(a=>{var o=`${n.label} · ${e.name}: ${H5(n.values[t()])}`,s=`${n.values[t()].lower}%`,c=n.color;return o!==a.e&&G(r,`title`,a.e=o),s!==a.t&&ht(i,`width`,a.t=s),c!==a.a&&ht(i,`background`,a.a=c),a},{e:void 0,t:void 0,a:void 0}),r})()}),null),n})()}),null),t})()},get children(){var t=w5();return K(t,R(V,{each:[25,50,75,100],children:t=>(()=>{var n=k5();return j(()=>G(n,`points`,m(e.categories.map(()=>t)))),n})()}),null),K(t,R(V,{each:[50,100],children:e=>{let[t,n]=p(0,e);return(()=>{var r=A5();return G(r,`x`,t+5),G(r,`y`,n+11),K(r,e),r})()}}),null),K(t,R(V,{get each(){return e.categories},children:(e,t)=>{let n=()=>p(t(),100),r=()=>[p(t(),100,B5.labelGap)[0],g(t())],i=e.criteria<3;return(()=>{var a=j5(),o=a.firstChild,s=o.nextSibling,c=s.firstChild;return o.classList.toggle(`low`,!!i),K(s,()=>e.name,c),c.classList.toggle(`low`,!!i),K(c,()=>S5(e.criteria)),j(e=>{var i=B5.width/2,a=B5.height/2,l=n()[0],u=n()[1],d=r()[0],f=r()[1],p=h(t()),m=r()[0],g=h(t());return i!==e.e&&G(o,`x1`,e.e=i),a!==e.t&&G(o,`y1`,e.t=a),l!==e.a&&G(o,`x2`,e.a=l),u!==e.o&&G(o,`y2`,e.o=u),d!==e.i&&G(s,`x`,e.i=d),f!==e.n&&G(s,`y`,e.n=f),p!==e.s&&G(s,`text-anchor`,e.s=p),m!==e.h&&G(c,`x`,e.h=m),g!==e.r&&G(c,`text-anchor`,e.r=g),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),a})()}}),null),K(t,R(V,{get each(){return u()},children:t=>(()=>{var n=N5(),r=n.firstChild;return K(n,R(H,{get when(){return t.values.some(e=>e.upper>e.lower+1e-6)},get children(){var e=M5();return j(()=>G(e,`points`,m(t.values.map(e=>e.upper)))),e}}),r),K(n,R(V,{get each(){return t.values},children:(n,r)=>{let[i,a]=p(r(),n.lower);return(()=>{var o=P5(),s=o.firstChild;return G(o,`cx`,i),G(o,`cy`,a),K(s,()=>`${t.label} · ${e.categories[r()].name}: ${H5(n)}`),o})()}}),null),j(e=>{var i=t.color,a=!!t.dashed,o=m(t.values.map(e=>e.lower));return i!==e.e&&ht(n,`--series`,e.e=i),a!==e.t&&r.classList.toggle(`dashed`,e.t=a),o!==e.a&&G(r,`points`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),n})()}),null),j(e=>{var n=`0 0 ${B5.width} ${B5.height}`,r=`Category scores for ${u().map(e=>e.label).join(`, `)}`;return n!==e.e&&G(t,`viewBox`,e.e=n),r!==e.t&&G(t,`aria-label`,e.t=r),e},{e:void 0,t:void 0}),t}}),l),K(l,3,f),K(v,()=>i()===`median`?`Pick a model`:`Pick up to ${z5} models`),K(_,R(V,{get each(){return t()},children:e=>{let t=()=>s().indexOf(e.model);return(()=>{var n=L5(),r=n.firstChild;return K(n,R(K8,{get checked(){return t()>=0},onChange:t=>i()===`median`?t&&c(e.model):d(e.model,t),get children(){return[(()=>{var e=F5();return j(n=>ht(e,`background`,t()>=0?R5[i()===`median`?0:t()]:`transparent`)),e})(),(()=>{var t=I5(),n=t.firstChild;return K(t,()=>Tp(e.model),n),K(n,()=>Dp(e.model)),t})()]}}),r),K(r,()=>U5(gp(e))),j(()=>G(r,`title`,H5(gp(e)))),n})()}}),null),n})()}var K5=W(`<button class=category-sort>`),q5=W(`<div class=category-matrix-scroll><table class=category-matrix><thead><tr><th scope=col>Model</th><th scope=col></th></tr></thead><tbody>`),J5=W(`<th scope=col><small>`),Y5=W(`<tr><th scope=row><span class=model-identity><span class=provider-mark></span><span><strong></strong><small></small></span></span></th><td class="category-cell overall"><span>`),X5=W(`<td class=category-cell><button>`),Z5=``,Q5=e=>e.upper-e.lower>1e-6?`${Ap(e.lower)}–${Ap(e.upper)}`:Ap(e.lower);function $5(e){let[t,n]=A(Z5),r=N(()=>e.scores.map(t=>({score:t,overall:gp(t),categories:new Map(e.categories.map(e=>[e.key,gp(_p(t,[e.key]))]))}))),i=(e,t)=>t===Z5?e.overall:e.categories.get(t),a=()=>[...r()].sort((e,n)=>i(n,t()).lower-i(e,t()).lower),o=(e,r)=>(()=>{var i=K5();return i.$$click=()=>n(e),K(i,r),j(n=>{var r=t()===e,a=t()===e?`descending`:void 0;return r!==n.e&&i.classList.toggle(`active`,n.e=r),a!==n.t&&G(i,`aria-sort`,n.t=a),n},{e:void 0,t:void 0}),i})();return(()=>{var t=q5(),n=t.firstChild.firstChild,r=n.firstChild,i=r.firstChild.nextSibling,s=n.nextSibling;return K(i,()=>o(Z5,`Score`)),K(r,R(V,{get each(){return e.categories},children:e=>(()=>{var t=J5(),n=t.firstChild;return K(t,()=>o(e.key,e.name),n),K(n,()=>S5(e.criteria)),j(r=>{var i=`${S5(e.criteria)} in ${e.evals} eval${e.evals===1?``:`s`}${e.criteria<3?` · low coverage`:``}`,a=e.criteria<3;return i!==r.e&&G(t,`title`,r.e=i),a!==r.t&&n.classList.toggle(`low`,r.t=a),r},{e:void 0,t:void 0}),t})()}),null),K(s,R(V,{get each(){return a()},children:t=>(()=>{var n=Y5(),r=n.firstChild,i=r.firstChild.firstChild,a=i.nextSibling.firstChild,o=a.nextSibling,s=r.nextSibling.firstChild;return K(i,R(cp,{get id(){return Ep(t.score.model)}})),K(a,()=>Tp(t.score.model)),K(o,()=>Dp(t.score.model)),K(s,()=>Q5(t.overall)),K(n,R(V,{get each(){return e.categories},children:n=>{let r=()=>t.categories.get(n.key);return(()=>{var i=X5(),a=i.firstChild;return a.$$click=()=>e.onCategory?.(n.key),K(a,()=>Q5(r())),j(o=>{var s=r().upper>r().lower+1e-6,c=`${r().lower}%`,l=!e.onCategory,u=`${Tp(t.score.model)}, ${n.name}: ${Q5(r())}%${e.onCategory?`, show ranking`:``}`;return s!==o.e&&i.classList.toggle(`range`,o.e=s),c!==o.t&&ht(i,`--score`,o.t=c),l!==o.a&&(a.disabled=o.a=l),u!==o.o&&G(a,`aria-label`,o.o=u),o},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()}}),null),n})()})),t})()}ct([`click`]);var e7=1e-6,t7=e=>e.upper-e.lower>e7,n7=e=>t7(e)?`${e.lower.toFixed(1)}–${e.upper.toFixed(1)}%`:`${e.lower.toFixed(1)}%`;function r7(e){let t=e.map((t,n)=>e.length>1&&e.every((e,r)=>r===n||t.lower+e7>=e.upper));return t.every(Boolean)?t.map(()=>!1):t}function i7(e,t,n=`Overall`){let r=[...e].sort((e,t)=>gp(t).lower-gp(e).lower||gp(t).upper-gp(e).upper),i=(e,t)=>{let n=r.map(e=>gp(t(e))),i=r7(n);return{...e,cells:r.map((e,t)=>({model:e.model,bounds:n[t],leader:i[t]}))}},a=r[0]?.components??[];return{models:r.map(e=>e.model),rows:[i({key:``,name:n,criteria:a.length,evals:new Set(a.map(e=>e.eval)).size,overall:!0},e=>e),...t.map(e=>i({key:e.key,name:e.name,criteria:e.criteria,evals:e.evals,overall:!1},t=>_p(t,[e.key])))]}}var a7=W(`<div class=category-matrix-scroll><table class=category-scorecard><thead><tr><th scope=col>Benchmark</th><th scope=col>Category</th></tr></thead><tbody>`),o7=W(`<th scope=col class=scorecard-model><span class=provider-mark></span><strong></strong><small>`),s7=W(`<th scope=rowgroup class=scorecard-benchmark>`),c7=W(`<tr><th scope=row class=scorecard-category><span></span><small> · <!> eval`),l7=W(`<span class=sr-only>, highest`),u7=W(`<td class=category-cell>`);function d7(e){return(()=>{var t=a7(),n=t.firstChild.firstChild,r=n.firstChild;r.firstChild.nextSibling;var i=n.nextSibling;return K(r,R(V,{get each(){return e.card.models},children:e=>(()=>{var t=o7(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling;return K(n,R(cp,{get id(){return Ep(e)}})),K(r,()=>Tp(e)),K(i,()=>Dp(e)),t})()}),null),K(i,R(V,{get each(){return e.card.rows},children:(t,n)=>(()=>{var r=c7(),i=r.firstChild,a=i.firstChild,o=a.nextSibling,s=o.firstChild,c=s.nextSibling;return c.nextSibling,K(r,R(H,{get when(){return n()===0},get children(){var t=s7();return K(t,()=>e.benchmark),j(()=>G(t,`rowspan`,e.card.rows.length)),t}}),i),K(a,()=>t.name),K(o,()=>S5(t.criteria),s),K(o,()=>t.evals,c),K(o,()=>t.evals===1?``:`s`,null),K(r,R(V,{get each(){return t.cells},children:e=>(()=>{var n=u7();return K(n,()=>n7(e.bounds),null),K(n,R(H,{get when(){return e.leader},get children(){return l7()}}),null),j(r=>{var i=!!t.overall,a=!!t7(e.bounds),o=!!e.leader,s=`${e.bounds.lower}%`;return i!==r.e&&n.classList.toggle(`overall`,r.e=i),a!==r.t&&n.classList.toggle(`range`,r.t=a),o!==r.a&&n.classList.toggle(`leader`,r.a=o),s!==r.o&&ht(n,`--score`,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()}),null),j(e=>{var n=!!t.overall,i=!t.overall&&t.criteria<3;return n!==e.e&&r.classList.toggle(`scorecard-overall`,e.e=n),i!==e.t&&o.classList.toggle(`low`,e.t=i),e},{e:void 0,t:void 0}),r})()})),t})()}var f7={width:1600,height:900},p7=e=>{let t=document.createElement(`span`);t.style.color=`var(${e})`,t.hidden=!0,document.body.append(t);let n=getComputedStyle(t).color;return t.remove(),n},m7=e=>{let t=document.createElement(`canvas`);t.width=t.height=1;let n=t.getContext(`2d`,{willReadFrequently:!0});if(!n)return[0,0,0];n.fillStyle=e,n.fillRect(0,0,1,1);let[r,i,a]=n.getImageData(0,0,1,1).data;return[r,i,a]},h7=(e,t,n)=>`rgb(${e.map((e,r)=>Math.round(e*n+t[r]*(1-n))).join(`, `)})`,g7=async(e,t)=>{let n=document.createElement(`div`);n.hidden=!0,document.body.append(n);let r=st(()=>R(V,{each:e,children:e=>R(cp,{id:e})}),n),i=new Map;try{return await Promise.all([...n.querySelectorAll(`use`)].map(async e=>{let n=new URL(e.getAttribute(`href`),location.href),r=n.hash.slice(1);n.hash=``,i.has(n.href)||i.set(n.href,fetch(n).then(async e=>{if(!e.ok)throw Error(`Could not load model icons`);return new DOMParser().parseFromString(await e.text(),`image/svg+xml`)}));let a=(await i.get(n.href)).getElementById(r);if(!a)throw Error(`Missing model icon: ${r}`);let o=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);o.setAttribute(`xmlns`,`http://www.w3.org/2000/svg`),o.setAttribute(`viewBox`,a.getAttribute(`viewBox`)??`0 0 40 40`),o.setAttribute(`width`,`128`),o.setAttribute(`height`,`128`),o.setAttribute(`color`,t);for(let e of a.childNodes)o.append(e.cloneNode(!0));let s=URL.createObjectURL(new Blob([new XMLSerializer().serializeToString(o)],{type:`image/svg+xml`}));try{let e=new Image;return e.src=s,await e.decode(),e}finally{URL.revokeObjectURL(s)}}))}finally{r(),n.remove()}},_7=e=>({text(t,n,r,i,a,o,s=600,c=`left`){e.font=`${s} ${i}px Inter, sans-serif`;let l=e.measureText(t).width;l>a&&(e.font=`${s} ${i*a/l}px Inter, sans-serif`),e.fillStyle=o,e.textAlign=c,e.fillText(t,n,r)},lines(t,n,r,i,a){e.font=`${r} ${n}px Inter, sans-serif`;let o=[];for(let n of t.split(/\s+/).filter(Boolean)){let t=o.at(-1);t!==void 0&&e.measureText(`${t} ${n}`).width<=i?o[o.length-1]=`${t} ${n}`:o.push(n)}return o.length>a?[...o.slice(0,a-1),o.slice(a-1).join(` `)]:o}}),v7=e=>new Promise((t,n)=>e.toBlob(e=>e?t(e):n(Error(`Could not encode the PNG`)),`image/png`));async function y7(e){if(!e.scores.length)throw Error(`No model totals to export`);await document.fonts.load(`600 84px Inter`),await document.fonts.load(`440 24px Inter`);let t=e.scores.map(e=>({...e,percentage:typeof e.percentage==`number`&&Number.isFinite(e.percentage)&&e.percentage>=0&&e.percentage<=100?e.percentage:null})).sort((e,t)=>gp(t).lower-gp(e).lower),n={background:p7(`--app-bg`),text:p7(`--app-text`),muted:p7(`--app-muted`),border:p7(`--app-border`),bar:p7(`--app-success`)},r=[...new Set(t.map(e=>Ep(e.model)))],i=await g7(r,n.text),a=document.createElement(`canvas`);a.width=f7.width,a.height=f7.height;let o=a.getContext(`2d`);if(!o)throw Error(`Image export is unavailable in this browser`);o.fillStyle=n.background,o.fillRect(0,0,a.width,a.height),o.textBaseline=`alphabetic`;let{text:s}=_7(o);s(e.name,40,99,82,1520,n.text);let c=(a.height-145-24)/t.length;return t.forEach((e,t)=>{let a=gp(e),l=145+c*t,u=l+c/2,d=Math.min(72,c*.62),f=Math.min(44,c*.37),p=Math.min(88,c*.76);o.strokeStyle=n.border,o.lineWidth=1,o.beginPath(),o.moveTo(40,l),o.lineTo(1560,l),o.stroke(),o.drawImage(i[r.indexOf(Ep(e.model))],36,u-d/2,d,d),s(Tp(e.model),132,u-1,f,520,n.text),s(Dp(e.model),134,u+Math.min(30,c*.26),Math.min(25,c*.22),510,n.muted,440);let m=Math.min(32,c*.28);if(a.lower>0&&(o.fillStyle=n.bar,o.fillRect(700,u-m/2,510*a.lower/100,m)),a.upper>a.lower+1e-6){let e=700+510*a.lower/100,t=700+510*a.upper/100;o.strokeStyle=n.muted,o.lineWidth=2,o.beginPath(),o.moveTo(e,u),o.lineTo(t,u),o.stroke(),o.lineWidth=3,o.beginPath(),o.moveTo(Math.round(t)+.5,u-10),o.lineTo(Math.round(t)+.5,u+10),o.stroke()}let h=a.upper>a.lower+1e-6?`${Ap(a.lower)}–${Ap(a.upper)}%`:`${Ap(a.lower)}%`;s(h,1560,u+p*.34,p,310,e.percentage===null?n.muted:n.text,600,`right`)}),v7(a)}var b7={margin:48,benchmark:250,category:390,header:176,row:92,footer:84,width:1600};async function x7(e){let{card:t}=e;if(!t.models.length||t.rows.length<2)throw Error(`No category scores to export`);await Promise.all([`700 30px Inter`,`650 28px Inter`,`500 30px Inter`,`440 18px Inter`].map(e=>document.fonts.load(e)));let n={background:p7(`--app-bg`),layer:p7(`--app-layer`),text:p7(`--app-text`),muted:p7(`--app-muted`),faint:p7(`--app-faint`),border:p7(`--app-border`),success:p7(`--app-success`),warning:p7(`--v2-state-fg-warning`)},r=m7(n.success),i=m7(n.background),a=[...new Set(t.models.map(e=>Ep(e)))],o=await g7(a,n.text),{margin:s,benchmark:c,category:l,header:u,row:d,footer:f}=b7,p=Math.max(160,Math.min(240,(b7.width-2*s-c-l)/t.models.length)),m=Math.max(b7.width,2*s+c+l+p*t.models.length),h=document.createElement(`canvas`);h.width=Math.ceil(m);let g=h.getContext(`2d`);if(!g)throw Error(`Image export is unavailable in this browser`);let{text:_,lines:v}=_7(g),y=t.models.map(e=>v(Tp(e),25,600,p-24,2)),b=Math.max(...y.map(e=>e.length)),x=s+u-(2-b)*30,S=x+d*t.rows.length;h.height=S+f,g.fillStyle=n.background,g.fillRect(0,0,h.width,h.height),g.textBaseline=`alphabetic`;let C=(e,t,r)=>{g.strokeStyle=n.border,g.lineWidth=1,g.beginPath(),g.moveTo(e,Math.round(r)+.5),g.lineTo(t,Math.round(r)+.5),g.stroke()},w=s+c,T=w+l;_(`Benchmark`,s,x-22,19,c-20,n.faint,440),_(`Category`,w+14,x-22,19,l-28,n.faint,440);let E=x-128-(b-1)*30;return t.models.forEach((e,t)=>{let r=T+p*t+p/2;g.drawImage(o[a.indexOf(Ep(e))],r-20,E,40,40);let i=y[t];i.forEach((e,t)=>_(e,r,x-52-(i.length-1-t)*30,25,p-24,n.text,600,`center`)),_(Dp(e),r,x-22,18,p-24,n.faint,440,`center`)}),C(s,m-s,x),v(e.name,28,650,c-28,3).forEach((e,t)=>_(e,s,x+46+t*34,28,c-28,n.text,650)),t.rows.forEach((e,t)=>{let a=x+d*t,o=a+d/2;t&&C(w,m-s,a),_(e.name,w+14,o-4,26,l-28,n.text,e.overall?650:520),_(`${S5(e.criteria)} · ${e.evals} eval${e.evals===1?``:`s`}`,w+14,o+22,16,l-28,!e.overall&&e.criteria<3?n.warning:n.faint,440),e.cells.forEach((t,s)=>{let c=T+p*s+5,l=a+7,u=p-10,f=d-14;if(g.beginPath(),g.roundRect(c,l,u,f,8),g.fillStyle=e.overall?n.layer:h7(r,i,Math.min(100,Math.max(0,t.bounds.lower))/100*.55),g.fill(),t7(t.bounds)){g.save(),g.clip(),g.strokeStyle=n.muted,g.globalAlpha=.14,g.lineWidth=1;for(let e=-f;e<u;e+=6)g.beginPath(),g.moveTo(c+e,l+f),g.lineTo(c+e+f,l),g.stroke();g.restore()}g.beginPath(),g.roundRect(c+.5,l+.5,u-1,f-1,8),g.lineWidth=t.leader?2:1,g.strokeStyle=t.leader?n.success:n.border,g.stroke(),_(n7(t.bounds),c+u/2,o+10,t7(t.bounds)?24:30,u-20,n.text,t.leader?700:500,`center`)})}),C(s,m-s,S),_(`Categories rescore only their criteria, with evals weighted equally. Ranges are unresolved checks, not confidence intervals. Bold marks a settled lead.`,s,S+48,18,m-2*s-200,n.muted,440),_(e.startedAt.slice(0,10),m-s,S+48,18,180,n.muted,440,`right`),v7(h)}var S7=(e,t)=>{let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.append(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)},C7=(e,t,n)=>`${e.replace(/[^a-zA-Z0-9_.-]/g,`-`)}-${t.slice(0,10)}-${n}.png`;async function w7(e,t){S7(await y7(e),C7(e.name,t,`results`))}async function T7(e){S7(await x7(e),C7(e.name,e.startedAt,`categories`))}var E7=W(`<button class=history-item><div><span></span><strong></strong></div><small><span> models`),D7=W(`<button class=activity-link><span>Currently running`),O7=W(`<p class=sidebar-empty>No benchmark runs yet.`),k7=W(`<div class=error-banner role=alert>`),A7=W(`<div class=error-banner>`),j7=W(`<div class=app-shell><header class=app-titlebar><div class=app-brand><strong>OpenEval</strong><span class=titlebar-divider></span> <span>Results</span></div><div class=titlebar-actions></div></header><aside class=sidebar><div class=sidebar-heading><span>RUN HISTORY</span></div><div class=history-scroll><div class=history-group><span class=group-label>Benchmark runs</span></div></div><div class=sidebar-footer><span></span></div></aside><main class=main-panel>`),M7=W(`<div class=eval-selector><span id=eval-label>Evaluation`),N7=W(`<section class=chart-panel><div class=panel-heading><div><h2>Category profile</h2><p>Each axis rescores only that category's criteria, weighting evals equally.`),P7=W(`<section class=chart-panel><div class=panel-heading><div><h2>Models × categories</h2><p>Sort by any column. Select a score to rank models in that category.`),F7=W(`<div class=category-chips aria-label="Category filter">`),I7=W(`<p class=category-scope>Scores use <!> of <!> criteria.`),L7=W(`<div class=run-facts><div><span>Models</span><strong></strong></div><div><span>Evaluations</span><strong></strong></div><div><span>Scored checks</span><strong> <small>/ </small></strong></div><div><span></span><strong></strong></div><div><span></span><strong>`),R7=W(`<div class=pending-note><p>`),z7=W(`<section class="chart-panel scorecard-panel"aria-labelledby=category-scorecard-title><div class=panel-heading><div><h2 id=category-scorecard-title>Scores by category</h2><p>Each row rescores only that category's criteria, weighting evals equally. Bold marks a lead that unresolved checks cannot change.`),B7=W(`<p class=section-caption>Opening eval run…`),V7=W(`<div class=results-page><div class=page-heading><div><div class=breadcrumb></div><h1></h1><p><span>·</span></p></div><div class=results-actions></div></div><div class=results-toolbar><div class=toolbar-filters></div></div><section class=chart-panel><div class=panel-heading><div><h2>`),H7=W(`<div class=empty-state><h1></h1><p>Run a benchmark, then its model comparisons will appear here.`),U7=W(`<div class=empty-state>Loading eval run…`),W7=W(`<div class=model-filter-empty><p>No models match these filters.`),G7=W(`<span class=category-chip>`),K7=()=>{if(history.state?.openevalRoute)return{categories:``,...history.state.openevalRoute};let e=new URLSearchParams(location.search);return{id:e.get(`result`)??``,view:e.get(`view`)===`trace`?e.get(`eval`)?`evals`:`results`:[`evals`,`categories`,`activity`].includes(e.get(`view`)??``)?e.get(`view`):`results`,eval:e.get(`eval`)??``,run:e.get(`run`)??``,evalRun:e.get(`evalRun`)??``,stage:e.get(`stage`)===`judge`?`judge`:`eval`,models:e.get(`models`)??``,categories:e.get(`categories`)??``}},q7=async e=>{let t=await fetch(e);if(!t.ok)throw Error((await t.json().catch(()=>({}))).error??`Request failed (${t.status})`);return t.json()},J7=new Map,Y7=new Map,X7=(e,t,n=0)=>{let r=`${e}:${t}`,i=J7.get(r);if(i&&i.entry.updatedAt>=n)return i;let a=Y7.get(r);if(a)return a;let o=q7(`/api/result?id=${encodeURIComponent(e)}&format=${t}`).then(e=>(J7.delete(r),J7.set(r,e),J7.size>8&&J7.delete(J7.keys().next().value),e)).finally(()=>Y7.delete(r));return Y7.set(r,o),o};function Z7(e){let t=!1;return se(()=>{queueMicrotask(()=>{t=!0})}),R(Pu,{variant:`pill`,get value(){return e.value},class:`level-tabs`,onChange:n=>{t&&[`results`,`evals`,`categories`].includes(e.value)&&n!==e.value&&e.onChange(n)},get children(){return R(Pu.List,{get children(){return[R(Pu.Trigger,{value:`results`,children:`Benchmark results`}),R(Pu.Trigger,{value:`evals`,children:`Eval breakdown`}),R(H,{get when(){return e.categories},get children(){return R(Pu.Trigger,{value:`categories`,children:`Categories`})}})]}})}})}function Q7(){let e=zr(),[t,n]=A(K7()),[r,i]=A(``),[a,o]=A(!1),[s,c]=A(``),[l,u]=A(!1),[d,f]=A(Date.now());se(()=>{let e=setInterval(()=>f(Date.now()),1e3);P(()=>clearInterval(e))});let[p,m]=A(!1),[h,g]=re(()=>q7(`/api/results`)),_=()=>h()?.public??!1,[v,y]=re(()=>h()&&!h().public,()=>q7(`/api/activity`)),b=e=>h()?.entries.find(t=>t.id===e.split(`~`)[0])?.updatedAt,x=e=>X7(e,`runs`,b(e)),S=()=>t().view!==`activity`&&!!t().run&&!!t().evalRun&&!_()&&!A3(),[C]=re(()=>!!t().id&&{id:t().id,version:b(t().id)},({id:e,version:t})=>X7(e,`summary`,t)),[w]=re(()=>S()&&!!t().run&&{id:t().run,version:b(t().run)},({id:e,version:t})=>X7(e,`runs`,t)),T=N(()=>C()?.overview);M(()=>Cp(T()?.modelNames));let E=()=>w()?.entry.id===t().run?w():void 0,D=N(()=>T()?.categories??[]),O=N(()=>t().categories.split(`,`).filter(e=>D().some(t=>t.key===e))),k=N(()=>O().length?D().filter(e=>O().includes(e.key)):D()),ee=N(()=>(T()?.evals??[]).filter(e=>!O().length||T().scores[0]?.components.some(t=>t.eval===e&&mp(t,O())))),te=N(()=>ee().includes(t().eval)?t().eval:ee()[0]||t().eval||T()?.evals[0]||``);M(()=>{T()&&t().view===`categories`&&!D().length&&ne({view:`results`},!0)});let ne=(e,r=!1)=>{let i={...t(),...e};n(i);let a=new URLSearchParams;for(let[e,t]of Object.entries({result:A3()?i.id.split(`~`)[0]:i.id,view:i.view===`results`?``:i.view,eval:A3()?``:i.eval,run:A3()?``:i.run,evalRun:A3()?``:i.evalRun,stage:!A3()&&i.evalRun&&i.stage===`judge`?`judge`:``,models:i.models,categories:i.categories}))t&&a.set(e,t);history[r?`replaceState`:`pushState`]({openevalRoute:i},``,`?`+a.toString()),c(``)};M(oe(A3,e=>{try{localStorage.setItem(k3,String(e))}catch{}ne(e?{run:``,evalRun:``}:{},!0)}));let ie=e=>{ne({id:e.id,view:`results`,eval:``,run:``,evalRun:``}),o(!1)},ae=()=>ne({run:``,evalRun:``});M(()=>{let e=h()?.entries;if(e?.length&&!e.some(e=>e.id===t().id.split(`~`)[0])){let t=e.find(e=>e.kind===`benchmark`)??e[0];ne({id:t.id,run:``,evalRun:``},!0)}_()&&t().view!==`results`&&ne({view:`results`,eval:``,run:``,evalRun:``},!0)}),se(()=>{e.setTheme(`oc-2`),e.setColorScheme(`dark`);let t=()=>{let e=K7();A3()?ne({...e,run:``,evalRun:``},!0):n(e)};window.addEventListener(`popstate`,t);let r=()=>{h.loading||g.refetch(),h()&&!h().public&&!v.loading&&y.refetch()},i=new EventSource(`/api/events`);i.addEventListener(`change`,r);let a=setInterval(r,5e3);P(()=>{i.close(),clearInterval(a),window.removeEventListener(`popstate`,t)})});let ce=e=>h()?.entries.filter(t=>t.kind===e&&`${t.name} ${t.startedAt}`.toLowerCase().includes(r().toLowerCase()))??[],le=N(()=>t().models.split(`,`).filter(Boolean)),ue=()=>L().reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.scored,0),0)??0,de=()=>L().reduce((e,t)=>e+t.components.reduce((e,t)=>e+t.expected,0),0),fe=()=>{let e=t().view===`evals`?C()?.related.find(e=>e.eval===te())?.runtime:T()?.runtime,n=e?up(e,fp(d(),C()?.entry.updatedAt,T()?.status===`running`)):void 0;return n===void 0?`—`:Pp(n)},pe=()=>{let e=t().view===`evals`?T()?.evalCosts?.[te()]:T()?.cost;return e?.usd??(T()?.status===`running`?e?.reportedUSD:void 0)},F=N(()=>T()?.scores.map(e=>{let t=e.components.filter(e=>e.eval===te()&&(!O().length||mp(e,O())));return hp(e.model,t)})??[]),I=N(()=>(T()?.scores??[]).map(e=>O().length?_p(e,O()):e)),L=N(()=>(t().view===`evals`?F():I()).filter(e=>kp(e.model,le()))),me=N(()=>I().filter(e=>kp(e.model,le()))),he=N(()=>i7(me(),k(),O().length?`Selected categories`:`Overall`)),ge=()=>!_()&&T()?.kind===`benchmark`&&k().length>0&&me().length>0,_e=()=>L()[0]?.components.length??0,ve=()=>(T()?.scores[0]?.components??[]).filter(e=>t().view!==`evals`||e.eval===te()).length,ye=async e=>{let n=t(),r=C();if(!(!r||_()||A3())){u(!0);try{let i=r.entry.kind===`eval`?r.entry.id:r.related.find(e=>e.eval===te())?.id;if(!i)throw Error(`This eval has not saved its results yet.`);let a=x(i),o=a instanceof Promise?await a:a;if(t()!==n||A3())return;let s=o.runs.find(t=>t.model===e.split(`#`)[0]&&t.reasoning===(e.split(`#`)[1]??`default`));if(!s)throw Error(`No saved eval run for this model yet.`);ne({run:i,evalRun:s.id,eval:o.eval})}catch(e){c(e instanceof Error?e.message:String(e))}finally{u(!1)}}},be=()=>{let e=T();if(!e)return;let t=new Blob([JSON.stringify({benchmark:A3()&&e.kind===`eval`?`Evaluation results`:e.name,startedAt:e.startedAt,filters:le(),categories:k().filter(e=>O().includes(e.key)).map(e=>e.name),scores:L().map(e=>({model:e.model,percentage:e.percentage,bounds:gp(e)}))},null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=window.document.createElement(`a`);r.href=n,r.download=`${A3()&&e.kind===`eval`?`evaluation`:e.name}-totals.json`,r.click(),URL.revokeObjectURL(n)},xe=async e=>{let n=T();if(n&&!p()){m(!0);try{if(e===`categories`){await T7({name:n.name,startedAt:n.startedAt,card:he()});return}await w7({name:A3()&&(t().view===`evals`||n.kind===`eval`)?`Evaluation results`:t().view===`evals`?te():n.name,scores:L().map(e=>({model:e.model,percentage:e.percentage,bounds:gp(e)}))},n.startedAt)}catch(e){c(e instanceof Error?e.message:String(e))}finally{m(!1)}}},Se=e=>(()=>{var n=E7(),r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=r.nextSibling,s=o.firstChild,c=s.firstChild;return n.$$click=()=>ie(e.item),K(a,R(N3,{get sensitive(){return e.item.kind===`eval`},get children(){return e.item.name}})),K(o,()=>Np(e.item.startedAt),s),K(s,()=>e.item.models,c),j(r=>{var a=t().view!==`activity`&&t().id===e.item.id,o=t().view!==`activity`&&t().id===e.item.id?`page`:void 0,s=`status-dot ${e.item.status}`;return a!==r.e&&n.classList.toggle(`active`,r.e=a),o!==r.t&&G(n,`aria-current`,r.t=o),s!==r.a&&dt(i,r.a=s),r},{e:void 0,t:void 0,a:void 0}),n})();return(()=>{var e=j7(),n=e.firstChild,c=n.firstChild,u=c.firstChild,d=c.nextSibling,f=n.nextSibling,m=f.firstChild;m.firstChild;var g=m.nextSibling,y=g.firstChild;y.firstChild;var b=g.nextSibling,x=b.firstChild,w=f.nextSibling;return K(c,R(Io,{size:`small`,variant:`ghost`,icon:`menu`,class:`mobile-menu`,"aria-label":`Toggle run history`,onClick:()=>o(!a())}),u),K(c,R(Fo,{name:`flask`}),u),K(d,R(M3,{})),K(f,R(H,{get when(){return U(()=>!!h())()&&!_()},get children(){var e=D7(),n=e.firstChild;return e.$$click=()=>{ne({view:`activity`,run:``,evalRun:``}),o(!1)},K(e,R(Fo,{name:`flask`}),n),K(e,R(Ro,{get children(){return v()?.reduce((e,t)=>e+t.state.runs.reduce((e,t)=>e+ +(t.eval.status===`in_progress`)+ +(t.judge.status===`in_progress`),0),0)??0}}),null),j(n=>{var r=t().view===`activity`,i=t().view===`activity`?`page`:void 0;return r!==n.e&&e.classList.toggle(`active`,n.e=r),i!==n.t&&G(e,`aria-current`,n.t=i),n},{e:void 0,t:void 0}),e}}),m),K(m,R(Ro,{get children(){return ce(`benchmark`).length}}),null),K(f,R(Il,{"aria-label":`Filter runs`,placeholder:`Find a run…`,get value(){return r()},onInput:e=>i(e.currentTarget.value),get leadingIcon(){return R(Fo,{name:`magnifying-glass`})}}),g),K(y,R(V,{get each(){return ce(`benchmark`)},children:e=>R(Se,{item:e})}),null),K(y,R(H,{get when(){return!ce(`benchmark`).length},get children(){return O7()}}),null),K(b,R(Fo,{name:`folder`}),x),K(x,()=>_()?`Totals only`:`Local results`),K(w,R(H,{get when(){return h.error||C.error},get children(){var e=k7();return K(e,(()=>{var e=U(()=>!!A3());return()=>e()?`Could not load results.`:String(h.error??C.error)})()),e}}),null),K(w,R(H,{get when(){return s()},get children(){var e=k7();return K(e,(()=>{var e=U(()=>!!A3());return()=>e()?`The requested operation could not be completed.`:s()})()),e}}),null),K(w,R(H,{get when(){return U(()=>t().view===`activity`)()&&!_()},get fallback(){return R(H,{get when(){return T()},get fallback(){return(()=>{var e=H7(),t=e.firstChild;return K(e,R(Fo,{name:`flask`}),t),K(t,()=>h.loading?`Loading results…`:`Your results start here`),e})()},get children(){return[R(H,{get when(){return S()},get children(){return R(H,{get when(){return E()},get fallback(){return U7()},children:e=>{let n=()=>e().runs.find(e=>e.id===t().evalRun);return R(H,{get when(){return n()},children:t=>R(q6,{open:!0,title:`Eval run session`,onClose:ae,get children(){return R(G6,{get run(){return e()},get selected(){return t()},onRun:e=>ne({evalRun:e}),onBack:ae})}})})}})}}),(()=>{var e=V7(),n=e.firstChild,r=n.firstChild,i=r.firstChild,a=i.nextSibling,o=a.nextSibling,s=o.firstChild,c=r.nextSibling,u=n.nextSibling,d=u.firstChild,f=u.nextSibling,m=f.firstChild.firstChild,h=m.firstChild;return K(i,()=>T().kind===`benchmark`?`Benchmarks`:`Eval results`,null),K(i,R(Fo,{name:`chevron-right`}),null),K(i,R(N3,{get sensitive(){return T().kind===`eval`},get children(){return T().name}}),null),K(a,R(N3,{get sensitive(){return T().kind===`eval`},get children(){return T().name}})),K(o,()=>Np(T().startedAt),s),K(o,R(Ro,{get children(){return T().status}}),null),K(c,R(H,{get when(){return T().kind===`benchmark`},get children(){return R(wl,{get value(){return p()?`Exporting image…`:`Export image`},get children(){return R(H,{get when(){return ge()},get fallback(){return R(zo,{variant:`neutral`,size:`small`,get icon(){return R(Fo,{name:`photo`})},"aria-label":`Export image`,get"aria-busy"(){return p()},onClick:()=>void xe(`totals`),get disabled(){return p()||!T().scores.length}})},get children(){return R(ip,{get children(){return[R(ip.Trigger,{"data-component":`icon-button-v2`,"data-size":`small`,"data-variant":`neutral`,"aria-label":`Export image`,get"aria-busy"(){return p()},get disabled(){return p()},get children(){return R(Fo,{name:`photo`})}}),R(ip.Portal,{get children(){return R(ip.Content,{get children(){return[R(ip.Item,{onSelect:()=>void xe(`totals`),children:`Totals chart`}),R(ip.Item,{onSelect:()=>void xe(`categories`),children:`Category table`})]}})}})]}})}})}})}}),null),K(c,R(wl,{value:`Export totals`,get children(){return R(zo,{variant:`neutral`,size:`small`,get icon(){return R(Fo,{name:`download`})},"aria-label":`Export totals`,onClick:be})}}),null),K(u,R(H,{get when(){return U(()=>!_())()&&T().kind===`benchmark`},get children(){return R(Z7,{get value(){return t().view},get categories(){return D().length>0},onChange:e=>ne({view:e,eval:te()})})}}),d),K(d,R(H,{get when(){return D().length},get children(){return R(C5,{get categories(){return D()},get selected(){return O()},onChange:e=>ne({categories:e.join(`,`)})})}}),null),K(d,R(h5,{get models(){return T().scores.map(e=>e.model)},get selected(){return le()},onChange:e=>ne({models:e.join(`,`)})}),null),K(e,R(H,{get when(){return U(()=>t().view===`evals`)()&&!_()},get children(){var e=M7();return e.firstChild,K(e,R(Nd,{"aria-labelledby":`eval-label`,get options(){return ee()},get current(){return te()},get valueClass(){return A3()?`eval-name is-secret`:`eval-name`},label:e=>A3()?`Eval ${T().evals.indexOf(e)+1}`:T()?.evalNames?.[e]??e,onSelect:e=>{e&&ne({eval:e})},children:e=>R(N3,{get children(){return T()?.evalNames?.[e]??e}})}),null),e}}),f),K(e,R(H,{get when(){return U(()=>t().view===`categories`)()&&!_()},get children(){return[(()=>{var e=N7();return e.firstChild,K(e,R(H,{get when(){return L().length},get fallback(){return W7()},get children(){return R(G5,{get categories(){return k()},get scores(){return L()}})}}),null),e})(),(()=>{var e=P7();return e.firstChild,K(e,R($5,{get categories(){return k()},get scores(){return L()},onCategory:e=>ne({view:`results`,categories:e})}),null),e})()]}}),f),K(h,R(N3,{get sensitive(){return t().view===`evals`||T().kind===`eval`},get children(){return U(()=>!(t().view!==`evals`||_()))()?T()?.evalNames?.[te()]??te():T().name}})),K(m,R(H,{get when(){return O().length},get children(){return[(()=>{var e=F7();return K(e,R(V,{get each(){return k()},children:e=>(()=>{var t=G7();return K(t,()=>e.name),t})()})),e})(),(()=>{var e=I7(),t=e.firstChild.nextSibling,n=t.nextSibling.nextSibling;return n.nextSibling,K(e,_e,t),K(e,ve,n),e})()]}}),null),K(f,R(H,{get when(){return L().length},get fallback(){return(()=>{var e=W7();return e.firstChild,K(e,R(Io,{size:`small`,variant:`outline`,onClick:()=>ne({models:``}),children:`Clear filters`}),null),e})()},get children(){return R(qp,{get scores(){return L()},get public(){return _()},get incomplete(){return T().status!==`running`},get criteria(){return U(()=>t().view===`evals`||T().kind===`eval`)()&&!A3()},get onSelect(){return!_()&&!A3()&&(t().view===`evals`||T().kind===`eval`)?ye:void 0}})}}),null),K(e,R(H,{get when(){return!_()},get children(){var e=L7(),n=e.firstChild,r=n.firstChild.nextSibling,i=n.nextSibling,a=i.firstChild.nextSibling,o=i.nextSibling,s=o.firstChild.nextSibling,c=s.firstChild,l=c.nextSibling;l.firstChild;var u=o.nextSibling,d=u.firstChild,f=d.nextSibling,p=u.nextSibling.firstChild,m=p.nextSibling;return K(r,()=>L().length),K(a,(()=>{var e=U(()=>t().view===`evals`);return()=>e()?1:T().evals.length})()),K(s,ue,c),K(l,de,null),K(d,()=>le().length?`Run duration`:`Duration`),K(f,fe),K(p,()=>le().length?`Run cost`:`Cost`),K(m,()=>Mp(pe())),e}}),null),K(e,R(H,{get when(){return L().some(e=>e.percentage===null)},get children(){var e=R7(),t=e.firstChild;return K(e,R(Fo,{name:`info`}),t),K(t,()=>T().status===`running`?`Solid bars show earned points. Whiskers show the possible range for unresolved checks.`:`Whiskers show the possible range for unscored checks; graded failures remain known zeros.`),e}}),null),K(e,R(H,{get when(){return U(()=>t().view===`results`)()&&ge()},get children(){var e=z7();return e.firstChild,K(e,R(d7,{get benchmark(){return T().name},get card(){return he()}}),null),e}}),null),K(e,R(H,{get when(){return l()},get children(){return B7()}}),null),j(()=>f.classList.toggle(`hidden`,!(t().view!==`categories`||_()))),e})()]}})},get children(){return[R(H,{get when(){return v.error},get children(){var e=A7();return K(e,(()=>{var e=U(()=>!!A3());return()=>e()?`Could not load activity.`:String(v.error)})()),e}}),R(M8,{get runs(){return v()??[]},get run(){return t().run},get evalRun(){return t().evalRun},get stage(){return t().stage},onSelect:(e,t,n=`eval`)=>{(!A3()||!t)&&ne({view:`activity`,run:e,evalRun:t,stage:n})}})]}}),null),j(()=>f.classList.toggle(`visible`,!!a())),e})()}ct([`click`]),st(()=>R(Br,{defaultTheme:`oc-2`,get children(){return R(Co,{get children(){return R(Q7,{})}})}}),document.getElementById(`root`));export{l as i,o as n,s as r,Y as t};
|