@economic/agents-playground 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/assets/{architectureDiagram-Q4EWVU46-B6GqUS-l.js → architectureDiagram-Q4EWVU46-YqMLsb7j.js} +1 -1
  2. package/dist/assets/{blockDiagram-DXYQGD6D-CigoMMLr.js → blockDiagram-DXYQGD6D-CltV9XBC.js} +1 -1
  3. package/dist/assets/{c4Diagram-AHTNJAMY-CWr1zv4H.js → c4Diagram-AHTNJAMY-CWB837fW.js} +1 -1
  4. package/dist/assets/channel-AqIO9WKZ.js +1 -0
  5. package/dist/assets/{chunk-336JU56O-BJgYnQa4.js → chunk-336JU56O-DL4hldLt.js} +2 -2
  6. package/dist/assets/{chunk-426QAEUC-BudTcDUq.js → chunk-426QAEUC-xf0J0Z4Z.js} +1 -1
  7. package/dist/assets/{chunk-4TB4RGXK-CrR5B6VF.js → chunk-4TB4RGXK-YmzpOfqV.js} +1 -1
  8. package/dist/assets/{chunk-5FUZZQ4R-D52n4iP1.js → chunk-5FUZZQ4R-uEUqWyGT.js} +1 -1
  9. package/dist/assets/{chunk-5PVQY5BW-B3bik6Qs.js → chunk-5PVQY5BW-QAGKzDty.js} +1 -1
  10. package/dist/assets/{chunk-EDXVE4YY-WMeXCGO7.js → chunk-EDXVE4YY-DdpQIdg4.js} +1 -1
  11. package/dist/assets/{chunk-ENJZ2VHE-7eB4zobq.js → chunk-ENJZ2VHE-BcPm3pHg.js} +1 -1
  12. package/dist/assets/{chunk-ICPOFSXX-DPU14nQf.js → chunk-ICPOFSXX-DB7cwCV-.js} +4 -4
  13. package/dist/assets/{chunk-OYMX7WX6-BSCL662h.js → chunk-OYMX7WX6-Czr9tLVQ.js} +1 -1
  14. package/dist/assets/{chunk-U2HBQHQK-kHvr0n9_.js → chunk-U2HBQHQK-BUEDKHge.js} +1 -1
  15. package/dist/assets/{chunk-X2U36JSP-C2t_hmZI.js → chunk-X2U36JSP-8NnX55Y7.js} +1 -1
  16. package/dist/assets/{chunk-YZCP3GAM-BG1b_sfU.js → chunk-YZCP3GAM-BKzzLXtn.js} +1 -1
  17. package/dist/assets/{chunk-ZZ45TVLE-Do5bp_-Y.js → chunk-ZZ45TVLE-BGFsPZSd.js} +1 -1
  18. package/dist/assets/classDiagram-6PBFFD2Q-DB1wrXGP.js +1 -0
  19. package/dist/assets/classDiagram-v2-HSJHXN6E-Bw6ca9pK.js +1 -0
  20. package/dist/assets/clone-DvmUvjwu.js +1 -0
  21. package/dist/assets/{dagre-Ba9vsFs-.js → dagre-BWXdComn.js} +1 -1
  22. package/dist/assets/{dagre-KV5264BT-hvYWIxYK.js → dagre-KV5264BT-Cp2gq40x.js} +1 -1
  23. package/dist/assets/{diagram-5BDNPKRD-BOSFMK4P.js → diagram-5BDNPKRD-GSxbfnJz.js} +1 -1
  24. package/dist/assets/{diagram-G4DWMVQ6-DSxu2KQr.js → diagram-G4DWMVQ6-tp6J6SRd.js} +1 -1
  25. package/dist/assets/{diagram-MMDJMWI5-BqrYMMHf.js → diagram-MMDJMWI5-Gu8Src1V.js} +1 -1
  26. package/dist/assets/{diagram-TYMM5635-stCZ2yN4.js → diagram-TYMM5635-cq8z5oad.js} +1 -1
  27. package/dist/assets/{erDiagram-SMLLAGMA-DyHL3KXD.js → erDiagram-SMLLAGMA-Bx1_Os8W.js} +1 -1
  28. package/dist/assets/{flowDiagram-DWJPFMVM-BuT0EUmC.js → flowDiagram-DWJPFMVM-Bktw281T.js} +1 -1
  29. package/dist/assets/{ganttDiagram-T4ZO3ILL-DwqQPsL3.js → ganttDiagram-T4ZO3ILL-BMXeVYqc.js} +1 -1
  30. package/dist/assets/{gitGraphDiagram-UUTBAWPF-B7Xh4MhX.js → gitGraphDiagram-UUTBAWPF-ChQ9Ghgn.js} +1 -1
  31. package/dist/assets/{graphlib-B6Sx8SxO.js → graphlib-BeGTzsVr.js} +1 -1
  32. package/dist/assets/index-CxJJBMoS.css +2 -0
  33. package/dist/assets/index-EkKJOXDi.js +329 -0
  34. package/dist/assets/{infoDiagram-42DDH7IO-Ubhhvlj2.js → infoDiagram-42DDH7IO-Dsx5n_6C.js} +1 -1
  35. package/dist/assets/{ishikawaDiagram-UXIWVN3A-DwC7bupi.js → ishikawaDiagram-UXIWVN3A-Mp37nJ4d.js} +1 -1
  36. package/dist/assets/{journeyDiagram-VCZTEJTY-zjDAn2hc.js → journeyDiagram-VCZTEJTY-B6vqrNf2.js} +1 -1
  37. package/dist/assets/{kanban-definition-6JOO6SKY-B8tLLKl_.js → kanban-definition-6JOO6SKY-bI4JYf8h.js} +1 -1
  38. package/dist/assets/{line-CTWofckH.js → line-lZvS95XN.js} +1 -1
  39. package/dist/assets/{mindmap-definition-QFDTVHPH-CmmHREAE.js → mindmap-definition-QFDTVHPH-BtXgyix8.js} +1 -1
  40. package/dist/assets/{pieDiagram-DEJITSTG-CY7UzlNA.js → pieDiagram-DEJITSTG-C2vsUYuj.js} +1 -1
  41. package/dist/assets/{quadrantDiagram-34T5L4WZ-CFRhUx6G.js → quadrantDiagram-34T5L4WZ-CwMD-RYU.js} +1 -1
  42. package/dist/assets/{requirementDiagram-MS252O5E-WIOmrMaO.js → requirementDiagram-MS252O5E-J4ulsCM6.js} +1 -1
  43. package/dist/assets/{sankeyDiagram-XADWPNL6-zDEJs1xu.js → sankeyDiagram-XADWPNL6-Bz2ZMHFN.js} +1 -1
  44. package/dist/assets/{sequenceDiagram-FGHM5R23-CUnj4Mqj.js → sequenceDiagram-FGHM5R23-b4aQT_5K.js} +1 -1
  45. package/dist/assets/{stateDiagram-FHFEXIEX-d6co23iE.js → stateDiagram-FHFEXIEX-DDenxAJa.js} +1 -1
  46. package/dist/assets/stateDiagram-v2-QKLJ7IA2-ClBsUbLz.js +1 -0
  47. package/dist/assets/{timeline-definition-GMOUNBTQ-CIKv1Jq0.js → timeline-definition-GMOUNBTQ-57fEq56M.js} +1 -1
  48. package/dist/assets/{vennDiagram-DHZGUBPP-ya7sSZNN.js → vennDiagram-DHZGUBPP-Bvydqbbx.js} +1 -1
  49. package/dist/assets/{wardleyDiagram-NUSXRM2D-E5XtnIim.js → wardleyDiagram-NUSXRM2D-BpjtR_nt.js} +1 -1
  50. package/dist/assets/{xychartDiagram-5P7HB3ND-DFE5v3bE.js → xychartDiagram-5P7HB3ND-DWFCOGcC.js} +1 -1
  51. package/dist/index.html +12 -12
  52. package/package.json +2 -2
  53. package/dist/assets/channel-BDUpd0JR.js +0 -1
  54. package/dist/assets/classDiagram-6PBFFD2Q-DaWLk_uZ.js +0 -1
  55. package/dist/assets/classDiagram-v2-HSJHXN6E-BQhx1y-5.js +0 -1
  56. package/dist/assets/clone-C3fjd0Ta.js +0 -1
  57. package/dist/assets/index-CNPSk-AE.js +0 -340
  58. package/dist/assets/index-PdFUBzlL.css +0 -2
  59. package/dist/assets/stateDiagram-v2-QKLJ7IA2-D2hNK5Wg.js +0 -1
@@ -0,0 +1,329 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-_HwXvSwT.js","assets/chunk-CFjPhJqf.js","assets/html-Cvpf_YOL.js","assets/css-B7Tsta-P.js","assets/javascript-CpnmjKAl.js","assets/angular-ts-C0MdMUxp.js","assets/scss-CzZ1rdcq.js","assets/apl-4QeRDQub.js","assets/json-DKZl9weG.js","assets/xml-BBXp_5Wh.js","assets/java-REBmrI9v.js","assets/astro-BabKmEmb.js","assets/postcss-BgZZjrY8.js","assets/tsx-F9M9wC-q.js","assets/typescript-DTrDmW2l.js","assets/blade-Bu8RXJ0S.js","assets/html-derivative-oVy6yJkw.js","assets/sql-F9n8qBBa.js","assets/bsl-DbC1tprz.js","assets/sdbl-CuMvbO_3.js","assets/c-s_ZxyIK8.js","assets/cairo-bw2LlBny.js","assets/python-BoDrCLWh.js","assets/cobol-CFVNX4pB.js","assets/coffee-B-j1zMpl.js","assets/cpp-BH37dOMC.js","assets/glsl-BEtNaWrS.js","assets/regexp-Boe98dsB.js","assets/crystal-C9FTVoTU.js","assets/shellscript-BdIWhdXD.js","assets/edge-zQ9tv2o7.js","assets/elixir-D01zNC3Z.js","assets/elm-u3p_kDl6.js","assets/erb-Du9uLkX4.js","assets/ruby-e6Q48MT7.js","assets/graphql-Cq3O5Xqa.js","assets/jsx-CZSUqxTg.js","assets/haml-B5A75U37.js","assets/lua-oGz5kt0D.js","assets/yaml-BEergP_M.js","assets/erlang-zz4Xiq1y.js","assets/markdown-De3qwImy.js","assets/fortran-fixed-form-de25IAQL.js","assets/fortran-free-form-BJSYMpiH.js","assets/fsharp-C27rIlvh.js","assets/gdresource-JgzdZtHI.js","assets/gdscript-HNVdFJmW.js","assets/gdshader-BwO0aTPI.js","assets/git-commit-DJWct9wS.js","assets/diff-By5eTuf6.js","assets/git-rebase-lfDZ8skH.js","assets/glimmer-js-CTRBBeAm.js","assets/glimmer-ts-CnIDOVFA.js","assets/hack-BZ3dx1--.js","assets/handlebars-w9cZONbN.js","assets/http-BrKjqtuP.js","assets/hurl-_ZAULsES.js","assets/csv-r5qbRpGD.js","assets/hxml-B8YISzVb.js","assets/haxe-Wo1G3Awf.js","assets/jinja-KiVCDEJo.js","assets/jison-B7y4AqWt.js","assets/julia-3f4tjBxU.js","assets/r-CkDPKduq.js","assets/just-z9y20Tc6.js","assets/perl-Bso7vGwI.js","assets/latex-CcomvWaP.js","assets/tex-BS51bcGt.js","assets/liquid-oC-fo7l1.js","assets/marko-5zZ9G9ce.js","assets/less-DpUZYmN5.js","assets/mdc-B7fvqQ0X.js","assets/nextflow-CnpGqZ74.js","assets/nextflow-groovy-mfiIAXye.js","assets/nginx-CTzOtRsu.js","assets/nim-BJIO_Cd5.js","assets/php-CZEE7un0.js","assets/pug-DjeXSet8.js","assets/qml-QfHyLKVN.js","assets/razor-7wlVG6CD.js","assets/csharp-Dy8WhnQ5.js","assets/rst-DRyPiGBA.js","assets/cmake-jShv_G9x.js","assets/sas-CxE4QqzN.js","assets/shaderlab-kJ264lrP.js","assets/hlsl-Bg-0F0fd.js","assets/shellsession-CCVKJfet.js","assets/soy-TfJ13c8R.js","assets/sparql-0Ag2VZSm.js","assets/turtle-B-HRGjvW.js","assets/stata-Bo09-SYB.js","assets/surrealql-TQdVNqkg.js","assets/svelte-C5Xk7kp7.js","assets/templ-B3XM4bsW.js","assets/go-BprGU5Fu.js","assets/ts-tags-LkJG_bdC.js","assets/twig-Cys-f5X9.js","assets/vue-CAuAJ1hM.js","assets/vue-html-4zOPz6rT.js","assets/vue-vine-cZhCFYnN.js","assets/stylus-BB4kxg9C.js","assets/xsl-DLFc1Cir.js","assets/c4Diagram-AHTNJAMY-CWB837fW.js","assets/dist-BuUGKekm.js","assets/src-Bn-kKzs7.js","assets/chunk-5PVQY5BW-QAGKzDty.js","assets/chunk-ICPOFSXX-DB7cwCV-.js","assets/preload-helper-D4M6sveU.js","assets/identity-dm669Xw2.js","assets/chunk-YZCP3GAM-BKzzLXtn.js","assets/flowDiagram-DWJPFMVM-Bktw281T.js","assets/chunk-U2HBQHQK-BUEDKHge.js","assets/channel-AqIO9WKZ.js","assets/chunk-336JU56O-DL4hldLt.js","assets/chunk-5FUZZQ4R-uEUqWyGT.js","assets/chunk-X2U36JSP-8NnX55Y7.js","assets/chunk-ZZ45TVLE-BGFsPZSd.js","assets/rough.esm-CmtQZpzn.js","assets/chunk-ENJZ2VHE-BcPm3pHg.js","assets/line-lZvS95XN.js","assets/path-DNPd7Py7.js","assets/array-CwG8vNfn.js","assets/chunk-BSJP7CBP-DAOgE-Rh.js","assets/chunk-55IACEB6-Dk2TiG2l.js","assets/chunk-EDXVE4YY-DdpQIdg4.js","assets/chunk-FMBD7UC4-BBxJCaVG.js","assets/chunk-XPW4576I-eo2MXg0i.js","assets/erDiagram-SMLLAGMA-Bx1_Os8W.js","assets/gitGraphDiagram-UUTBAWPF-ChQ9Ghgn.js","assets/mermaid-parser.core-Dm080B6L.js","assets/chunk-K5T4RW27-CdW28-Du.js","assets/isEmpty-DmISAPZC.js","assets/reduce-D_9krJHY.js","assets/flatten-B1JAduaA.js","assets/chunk-2KRD3SAO--jMEQSW8.js","assets/chunk-67CJDMHE-CQZLMTRw.js","assets/chunk-7N4EOEYR-CQ712IZU.js","assets/chunk-AA7GKIK3-3P2ka8yr.js","assets/chunk-CIAEETIT-COMM62En.js","assets/chunk-FOC6F5B3-DWFLlaqY.js","assets/chunk-KGLVRYIC-DnK7tg6E.js","assets/chunk-LIHQZDEY-2eRcWCNn.js","assets/chunk-ORNJ4GCN-D3d5TWZo.js","assets/chunk-4BX2VUAB-DQv4XKcH.js","assets/chunk-QZHKN3VN-Bj4Tv3t6.js","assets/ganttDiagram-T4ZO3ILL-BMXeVYqc.js","assets/linear-BAcLW45z.js","assets/defaultLocale-Dda4OpKy.js","assets/init-D6KNwrax.js","assets/infoDiagram-42DDH7IO-Dsx5n_6C.js","assets/chunk-426QAEUC-xf0J0Z4Z.js","assets/pieDiagram-DEJITSTG-C2vsUYuj.js","assets/ordinal-jM7S0YHN.js","assets/arc-BNQ34IxS.js","assets/quadrantDiagram-34T5L4WZ-CwMD-RYU.js","assets/xychartDiagram-5P7HB3ND-DWFCOGcC.js","assets/requirementDiagram-MS252O5E-J4ulsCM6.js","assets/sequenceDiagram-FGHM5R23-b4aQT_5K.js","assets/classDiagram-6PBFFD2Q-DB1wrXGP.js","assets/chunk-4TB4RGXK-YmzpOfqV.js","assets/classDiagram-v2-HSJHXN6E-Bw6ca9pK.js","assets/stateDiagram-FHFEXIEX-DDenxAJa.js","assets/dagre-BWXdComn.js","assets/graphlib-BeGTzsVr.js","assets/chunk-OYMX7WX6-Czr9tLVQ.js","assets/stateDiagram-v2-QKLJ7IA2-ClBsUbLz.js","assets/journeyDiagram-VCZTEJTY-B6vqrNf2.js","assets/timeline-definition-GMOUNBTQ-57fEq56M.js","assets/mindmap-definition-QFDTVHPH-BtXgyix8.js","assets/kanban-definition-6JOO6SKY-bI4JYf8h.js","assets/sankeyDiagram-XADWPNL6-Bz2ZMHFN.js","assets/diagram-TYMM5635-cq8z5oad.js","assets/diagram-MMDJMWI5-Gu8Src1V.js","assets/blockDiagram-DXYQGD6D-CltV9XBC.js","assets/clone-DvmUvjwu.js","assets/diagram-5BDNPKRD-GSxbfnJz.js","assets/architectureDiagram-Q4EWVU46-YqMLsb7j.js","assets/cytoscape.esm-ZJA_mpb2.js","assets/ishikawaDiagram-UXIWVN3A-Mp37nJ4d.js","assets/vennDiagram-DHZGUBPP-Bvydqbbx.js","assets/diagram-G4DWMVQ6-tp6J6SRd.js","assets/wardleyDiagram-NUSXRM2D-BpjtR_nt.js","assets/angular-html-BNkY0l6I.js","assets/html-Be5Uf2PY.js","assets/css-BwJx5n-d.js","assets/javascript-DMa1awvA.js","assets/angular-ts-BJR7ZmZ4.js","assets/scss-Cs20-D4S.js","assets/apl-Cwj0kSUr.js","assets/json-DTmumXbw.js","assets/xml-C1p67_Oq.js","assets/java-CQxQB19a.js","assets/astro--s34HbNO.js","assets/postcss-Bv7WzijA.js","assets/tsx-CfScc0-T.js","assets/typescript-x0tnfxi7.js","assets/blade-CA0lh7nk.js","assets/html-derivative-DwTv3LQJ.js","assets/sql-2nD5KprC.js","assets/bsl-Bq5qFzpU.js","assets/sdbl-B1EAQWpp.js","assets/c-BwwtBtD9.js","assets/cairo-Cn9-ZKRa.js","assets/python-B758mMeg.js","assets/cobol-DC9HzFj-.js","assets/coffee-BXAFJg0r.js","assets/cpp-DKSsqshA.js","assets/glsl-DBjPQFVZ.js","assets/regexp-oKAhWQ7Q.js","assets/crystal-IeOtgHp5.js","assets/shellscript-FTtRH7a6.js","assets/edge-DvUIs6yL.js","assets/elixir-uf320cNm.js","assets/elm-C0jRU6CE.js","assets/erb-IQLcm3Em.js","assets/ruby-o2UFtTKv.js","assets/graphql-COm4gzYD.js","assets/jsx-CjPAAfVI.js","assets/haml-BDLQGKJ5.js","assets/lua-YdeG1vR1.js","assets/yaml-Dz3CpChp.js","assets/erlang-CzlD_Joo.js","assets/markdown-B7ZTAu7B.js","assets/fortran-fixed-form-CT90EtSp.js","assets/fortran-free-form-amHz32Zw.js","assets/fsharp-LasxezlU.js","assets/gdresource-XqgPdfiE.js","assets/gdscript-t_G6VYpv.js","assets/gdshader-DqZaHh4E.js","assets/git-commit-CZBgPolw.js","assets/diff-aUYk5Qys.js","assets/git-rebase-SvuYB-yx.js","assets/glimmer-js-BRM4xWAn.js","assets/glimmer-ts-q2S6_FNL.js","assets/hack-D776y6TN.js","assets/handlebars-CIxBD-3g.js","assets/http-BoUyJiuw.js","assets/hurl-BrO1xhi5.js","assets/csv-DTSgNSaP.js","assets/hxml-e5uS5jTD.js","assets/haxe-mcKlcxBa.js","assets/jinja-Brxwu6oJ.js","assets/jison-EXcEtIQd.js","assets/julia-ClaFus-7.js","assets/r-C2wIHWmU.js","assets/just-i-NvfbL-.js","assets/perl-BMPsT4bZ.js","assets/latex-CJqFaM_A.js","assets/tex-BBX4cNm_.js","assets/liquid-C-yRtTgD.js","assets/marko-C28Bend9.js","assets/less-BXmcsqcq.js","assets/mdc-D4DkjJGD.js","assets/nextflow-BUrFV5aB.js","assets/nextflow-groovy-CKQWtRkO.js","assets/nginx-BzrYdIS_.js","assets/nim-BAdKQO6U.js","assets/php-0S5_LhYZ.js","assets/pug-DCZyheX4.js","assets/qml-DLa2zzL2.js","assets/razor-CIU_5PCa.js","assets/csharp-BsEjf_Dq.js","assets/rst-Cof_t7QZ.js","assets/cmake-Cf0q7ddg.js","assets/sas-hJL2y9ck.js","assets/shaderlab-Byjk0kH7.js","assets/hlsl-Z0II0KR8.js","assets/shellsession-Dsazo7ie.js","assets/soy-D05E5TYG.js","assets/sparql-CawLnniT.js","assets/turtle-2DYvssFL.js","assets/stata-gi0HO22o.js","assets/surrealql-C1OjlKtP.js","assets/svelte-lCoYOeOH.js","assets/templ-Be5BnDnr.js","assets/go-BA1q0q8h.js","assets/ts-tags-BdYhOUUe.js","assets/twig-DVDO78vU.js","assets/vue-Bm4Rs_rd.js","assets/vue-html-Idq00pHJ.js","assets/vue-vine-DNdsuI61.js","assets/stylus-B2DgJRJw.js","assets/xsl-DcNV5e8y.js"])))=>i.map(i=>d[i]);
2
+ import{a as e,n as t,o as n,r,t as i}from"./chunk-CFjPhJqf.js";import{A as a,C as o,D as s,E as c,M as l,N as u,O as d,P as f,S as p,T as m,_ as h,b as g,c as _,d as v,f as y,g as b,h as x,j as S,l as C,m as w,o as T,p as E,r as D,s as O,u as k,v as A,w as j,x as M,y as ee}from"./chunk-BO2N2NFS-DQjGIfIS.js";import{t as N}from"./preload-helper-D4M6sveU.js";import{t as P}from"./katex-BlCZ14Wi.js";import{_ as F,g as te,h as I,p as ne}from"./src-Bn-kKzs7.js";import{F as re,G as ie,H as L,J as ae,M as R,N as oe,S as se,T as ce,X as le,Y as ue,Z as de,c as fe,f as pe,g as me,h as he,l as ge,n as _e,p as ve,r as ye,t as be,w as xe,x as Se,y as Ce,z as we}from"./chunk-ICPOFSXX-DB7cwCV-.js";import{a as Te,d as Ee,h as De,i as Oe,m as ke,r as Ae}from"./chunk-5PVQY5BW-QAGKzDty.js";import{t as je}from"./chunk-426QAEUC-xf0J0Z4Z.js";import{n as Me,t as Ne}from"./chunk-XPW4576I-eo2MXg0i.js";import"./chunk-BSJP7CBP-DAOgE-Rh.js";import"./chunk-ZZ45TVLE-BGFsPZSd.js";import"./chunk-X2U36JSP-8NnX55Y7.js";import{i as Pe,o as Fe}from"./chunk-U2HBQHQK-BUEDKHge.js";import"./chunk-5FUZZQ4R-uEUqWyGT.js";import"./chunk-ENJZ2VHE-BcPm3pHg.js";import{n as Ie}from"./chunk-336JU56O-DL4hldLt.js";import{t as Le}from"./isEmpty-DmISAPZC.js";(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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Re=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ze=i(((e,t)=>{t.exports=Re()})),Be=i((e=>{var t=ze(),n=f(),r=u();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function j(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var M=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},I=[],ne=-1;function re(e){return{current:e}}function ie(e){0>ne||(e.current=I[ne],I[ne]=null,ne--)}function L(e,t){ne++,I[ne]=e.current,e.current=t}var ae=re(null),R=re(null),oe=re(null),se=re(null);function ce(e,t){switch(L(oe,t),L(R,e),L(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Yd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Yd(t),e=Xd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ie(ae),L(ae,e)}function le(){ie(ae),ie(R),ie(oe)}function ue(e){e.memoizedState!==null&&L(se,e);var t=ae.current,n=Xd(t,e.type);t!==n&&(L(R,e),L(ae,n))}function de(e){R.current===e&&(ie(ae),ie(R)),se.current===e&&(ie(se),op._currentValue=te)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
+ `),l=s.split(`
6
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,we=t.unstable_now,Te=t.unstable_getCurrentPriorityLevel,Ee=t.unstable_ImmediatePriority,De=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,ke=t.unstable_LowPriority,Ae=t.unstable_IdlePriority,je=t.log,Me=t.unstable_setDisableYieldValue,Ne=null,Pe=null;function Fe(e){if(typeof je==`function`&&Me(e),Pe&&typeof Pe.setStrictMode==`function`)try{Pe.setStrictMode(Ne,e)}catch{}}var Ie=Math.clz32?Math.clz32:Be,Le=Math.log,Re=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Le(e)/Re|0)|0}var Ve=256,z=262144,He=4194304;function Ue(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function We(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ue(n))):i=Ue(o):i=Ue(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ue(n))):i=Ue(o)):i=Ue(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function qe(){var e=He;return He<<=1,!(He&62914560)&&(He=4194304),e}function Je(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ye(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ie(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ze(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ze(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ie(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Qe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ie(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function $e(e,t){var n=t&-t;return n=n&42?1:et(n),(n&(e.suspendedLanes|t))===0?n:0}function et(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function nt(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Sp(e.type)):e}function rt(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var it=Math.random().toString(36).slice(2),at=`__reactFiber$`+it,ot=`__reactProps$`+it,st=`__reactContainer$`+it,ct=`__reactEvents$`+it,lt=`__reactListeners$`+it,ut=`__reactHandles$`+it,dt=`__reactResources$`+it,ft=`__reactMarker$`+it;function pt(e){delete e[at],delete e[ot],delete e[ct],delete e[lt],delete e[ut]}function mt(e){var t=e[at];if(t)return t;for(var n=e.parentNode;n;){if(t=n[st]||n[at]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=yf(e);e!==null;){if(n=e[at])return n;e=yf(e)}return t}e=n,n=e.parentNode}return null}function ht(e){if(e=e[at]||e[st]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function _t(e){var t=e[dt];return t||=e[dt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function vt(e){e[ft]=!0}var yt=new Set,bt={};function xt(e,t){St(e,t),St(e+`Capture`,t)}function St(e,t){for(bt[e]=t,e=0;e<t.length;e++)yt.add(t[e])}var Ct=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),wt={},Tt={};function Et(e){return ye.call(Tt,e)?!0:ye.call(wt,e)?!1:Ct.test(e)?Tt[e]=!0:(wt[e]=!0,!1)}function Dt(e,t,n){if(Et(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Ot(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function kt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function At(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function jt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Mt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Nt(e){if(!e._valueTracker){var t=jt(e)?`checked`:`value`;e._valueTracker=Mt(e,t,``+e[t])}}function Pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=jt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Ft(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var It=/[\n"\\]/g;function Lt(e){return e.replace(It,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Rt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+At(t)):e.value!==``+At(t)&&(e.value=``+At(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Bt(e,o,At(n)):Bt(e,o,At(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+At(s):e.removeAttribute(`name`)}function zt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Nt(e);return}n=n==null?``:``+At(n),t=t==null?n:``+At(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Nt(e)}function Bt(e,t,n){t===`number`&&Ft(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Vt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+At(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ht(e,t,n){if(t!=null&&(t=``+At(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+At(n)}function Ut(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(N(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=At(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Nt(e)}function Wt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Kt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Gt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function qt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Kt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Kt(e,o,t[o])}function B(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Jt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`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`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`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`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`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`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Yt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xt(e){return Yt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function V(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=ht(e);if(t&&(e=t.stateNode)){var n=e[ot]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Rt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Lt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ot]||null;if(!a)throw Error(i(90));Rt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Pt(r)}break a;case`textarea`:Ht(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Vt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(Tu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ot]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,`passive`,{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=m({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=m({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(m({},wn,{dataTransfer:0})),Dn=gn(m({},yn,{relatedTarget:0})),On=gn(m({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(m({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=gn(m({},_n,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(m({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ln=gn(m({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(m({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(m({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(m({},wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Vn=gn(m({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=on&&`CompositionEvent`in window,Wn=null;on&&`documentMode`in document&&(Wn=document.documentMode);var Gn=on&&`TextEvent`in window&&!Wn,Kn=on&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function H(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function U(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=fn(),dn=un=ln=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Kn&&t.locale!==`ko`?null:t.data;default:return null}}var Qn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Qn[e.type]:t===`textarea`}function er(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=Nd(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var tr=null,nr=null;function rr(e){Td(e,0)}function ir(e){if(Pt(gt(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(on){var sr;if(on){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){tr&&(tr.detachEvent(`onpropertychange`,dr),nr=tr=null)}function dr(e){if(e.propertyName===`value`&&ir(nr)){var t=[];er(t,nr,e,Qt(e)),rn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),tr=t,nr=n,tr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(nr)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ye.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ft(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ft(e.document)}return t}function Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var wr=on&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==Ft(r)||(r=Tr,`selectionStart`in r&&Cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dr&&vr(Dr,r)||(Dr=r,r=Nd(Er,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};on&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),xt(t,[e])}var Gr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ie(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<gu)throw gu=0,_u=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function oi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Zf(e,n,ae.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=ri(31,n,t,a),e.elementType=O,e.lanes=o,e;case v:return ci(n.children,a,o,t);case y:s=8,a|=24;break;case b:return e=ri(12,n,t,a|2),e.elementType=b,e.lanes=o,e;case w:return e=ri(13,n,t,a),e.elementType=w,e.lanes=o,e;case T:return e=ri(19,n,t,a),e.elementType=T,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case C:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-Ie(r)-1;r&=~(1<<i),n+=1;var a=32-Ie(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-Ie(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,Ai=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw Bi(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[at]=e,t[ot]=r,n){case`dialog`:Ed(`cancel`,t),Ed(`close`,t);break;case`iframe`:case`object`:case`embed`:Ed(`load`,t);break;case`video`:case`audio`:for(n=0;n<Cd.length;n++)Ed(Cd[n],t);break;case`source`:Ed(`error`,t);break;case`img`:case`image`:case`link`:Ed(`error`,t),Ed(`load`,t);break;case`details`:Ed(`toggle`,t);break;case`input`:Ed(`invalid`,t),zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Ed(`invalid`,t);break;case`textarea`:Ed(`invalid`,t),Ut(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||zd(t.textContent,n)?(r.popover!=null&&(Ed(`beforetoggle`,t),Ed(`toggle`,t)),r.onScroll!=null&&Ed(`scroll`,t),r.onScrollEnd!=null&&Ed(`scrollend`,t),r.onClick!=null&&(t.onclick=V),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Oi=Oi.return}}function Li(e){if(e!==Oi)return!1;if(!Ai)return Ii(e),Ai=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Zd(e.type,e.memoizedProps)),n=!n),n&&ki&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=vf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=vf(e)}else t===27?(t=ki,of(e.type)?(e=_f,_f=null,ki=e):ki=t):ki=Oi?gf(e.stateNode.nextSibling):null;return!0}function Ri(){ki=Oi=null,Ai=!1}function zi(){var e=ji;return e!==null&&(nu===null?nu=e:nu.push.apply(nu,e),ji=null),e}function Bi(e){ji===null?ji=[e]:ji.push(e)}var Vi=re(null),Hi=null,Ui=null;function Wi(e,t,n){L(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,ie(Vi)}function Ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ji(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[op]:e.push(op))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=_d(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var pa=P.S;P.S=function(e,t){au=we(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=re(null);function ha(){var e=ma.current;return e===null?Vl.pooledCache:e}function ga(e,t){t===null?L(ma,ma.current):L(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(V,V),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e;default:if(typeof t.status==`string`)t.then(V,V);else{if(e=Vl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e}throw Ta=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ta=e,va):e}}var Ta=null;function Ea(){if(Ta===null)throw Error(i(459));var e=Ta;return Ta=null,e}function Da(e){if(e===va||e===ba)throw Error(i(483))}var Oa=null,ka=0;function Aa(e){var t=ka;return ka+=1,Oa===null&&(Oa=[]),Ca(Oa,e,t)}function ja(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ma(e,t){throw t.$$typeof===h?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Na(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===v?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===D&&wa(i)===t.type)?(t=a(t,n.props),ja(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),ja(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ci(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=si(t.type,t.key,t.props,null,e.mode,n),ja(n,t),n.return=e,n;case _:return t=di(t,e.mode,n),t.return=e,t;case D:return t=wa(t),f(e,t,n)}if(N(t)||j(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Aa(t),n);if(t.$$typeof===S)return f(e,Qi(e,t),n);Ma(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case D:return n=wa(n),p(e,t,n,r)}if(N(n)||j(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Aa(n),r);if(n.$$typeof===S)return p(e,t,Qi(e,n),r);Ma(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=wa(r),m(e,t,n,r,i)}if(N(r)||j(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Aa(r),i);if(r.$$typeof===S)return m(e,t,n,Qi(t,r),i);Ma(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ai&&Ci(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ai&&Ci(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ai&&Ci(i,h),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ai&&Ci(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ai&&Ci(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ai&&Ci(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===v&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===v){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===v?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case _:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=wa(o),b(e,r,o,c)}if(N(o))return h(e,r,o,c);if(j(o)){if(l=j(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===S)return b(e,r,Qi(e,o),c);Ma(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Bl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function Va(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Hl&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ia=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Xl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ka(n[e],t)}var Ja=re(null),Ya=re(0);function Xa(e,t){e=Jl,L(Ya,e),L(Ja,t),Jl=e|t.baseLanes}function Za(){L(Ya,Jl),L(Ja,Ja.current)}function Qa(){Jl=Ya.current,ie(Ja),ie(Ya)}var $a=re(null),eo=null;function to(e){var t=e.alternate;L(oo,oo.current&1),L($a,e),eo===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){L(oo,oo.current),L($a,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(L(oo,oo.current),L($a,e),eo===null&&(eo=e)):io(e)}function io(){L(oo,oo.current),L($a,$a.current)}function ao(e){ie($a),eo===e&&(eo=null),ie(oo)}var oo=re(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pf(n)||mf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var co=0,lo=null,uo=null,fo=null,po=!1,mo=!1,ho=!1,go=0,_o=0,vo=null,yo=0;function bo(){throw Error(i(321))}function xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function So(e,t,n,r,i,a){return co=a,lo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?zs:Bs,ho=!1,a=n(r,i),ho=!1,mo&&(a=wo(t,n,r,i)),Co(e),a}function Co(e){P.H=Rs;var t=uo!==null&&uo.next!==null;if(co=0,fo=uo=lo=null,po=!1,_o=0,vo=null,t)throw Error(i(300));e===null||nc||(e=e.dependencies,e!==null&&Yi(e)&&(nc=!0))}function wo(e,t,n,r){lo=e;var a=0;do{if(mo&&(vo=null),_o=0,mo=!1,25<=a)throw Error(i(301));if(a+=1,fo=uo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Vs,o=t(n,r)}while(mo);return o}function To(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?Mo(t):t,e=e.useState()[0],(uo===null?null:uo.memoizedState)!==e&&(lo.flags|=1024),t}function Eo(){var e=go!==0;return go=0,e}function Do(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Oo(e){if(po){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}po=!1}co=0,fo=uo=lo=null,mo=!1,_o=go=0,vo=null}function ko(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fo===null?lo.memoizedState=fo=e:fo=fo.next=e,fo}function Ao(){if(uo===null){var e=lo.alternate;e=e===null?null:e.memoizedState}else e=uo.next;var t=fo===null?lo.memoizedState:fo.next;if(t!==null)fo=t,uo=e;else{if(e===null)throw lo.alternate===null?Error(i(467)):Error(i(310));uo=e,e={memoizedState:uo.memoizedState,baseState:uo.baseState,baseQueue:uo.baseQueue,queue:uo.queue,next:null},fo===null?lo.memoizedState=fo=e:fo=fo.next=e}return fo}function jo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Mo(e){var t=_o;return _o+=1,vo===null&&(vo=[]),e=Ca(vo,e,t),t=lo,(fo===null?t.memoizedState:fo.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?zs:Bs),e}function No(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Mo(e);if(e.$$typeof===S)return Zi(e)}throw Error(i(438,String(e)))}function Po(e){var t=null,n=lo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=lo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=jo(),lo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function Fo(e,t){return typeof t==`function`?t(e):t}function Io(e){return Lo(Ao(),uo,e)}function Lo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(Hl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ca&&(d=!0);else if((co&p)===p){u=u.next,p===ca&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,lo.lanes|=p,Xl|=p;f=u.action,ho&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,lo.lanes|=f,Xl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&(nc=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ro(e){var t=Ao(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||(nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function zo(e,t,n){var r=lo,a=Ao(),o=Ai;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((uo||a).memoizedState,n);if(s&&(a.memoizedState=n,nc=!0),a=a.queue,us(Ho.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||fo!==null&&fo.memoizedState.tag&1){if(r.flags|=2048,as(9,{destroy:void 0},Vo.bind(null,r,a,n,t),null),Vl===null)throw Error(i(349));o||co&127||Bo(r,t,n)}return n}function Bo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=lo.updateQueue,t===null?(t=jo(),lo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Vo(e,t,n,r){t.value=n,t.getSnapshot=r,Uo(t)&&Wo(e)}function Ho(e,t,n){return n(function(){Uo(t)&&Wo(e)})}function Uo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Wo(e){var t=Qr(e,2);t!==null&&bu(t,e,2)}function Go(e){var t=ko();if(typeof e==`function`){var n=e;if(e=n(),ho){Fe(!0);try{n()}finally{Fe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:e},t}function Ko(e,t,n,r){return e.baseState=n,Lo(e,uo,typeof r==`function`?r:Fo)}function qo(e,t,n,r,a){if(Fs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Jo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Jo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Yo(e,t,s)}catch(n){Zo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Yo(e,t,a)}catch(n){Zo(e,t,n)}}function Yo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Xo(e,t,n)},function(n){return Zo(e,t,n)}):Xo(e,t,n)}function Xo(e,t,n){t.status=`fulfilled`,t.value=n,Qo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Jo(e,n)))}function Zo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Qo(t),t=t.next;while(t!==r)}e.action=null}function Qo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $o(e,t){return t}function es(e,t){if(Ai){var n=Vl.formState;if(n!==null){a:{var r=lo;if(Ai){if(ki){b:{for(var i=ki,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=gf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=gf(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=ko(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$o,lastRenderedState:t},n.queue=r,n=Ms.bind(null,lo,r),r.dispatch=n,r=Go(!1),a=Ps.bind(null,lo,!1,r.queue),r=ko(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=qo.bind(null,lo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ts(e){return ns(Ao(),uo,e)}function ns(e,t,n){if(t=Lo(e,t,$o)[0],e=Io(Fo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Mo(t)}catch(e){throw e===va?ba:e}else r=t;t=Ao();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(lo.flags|=2048,as(9,{destroy:void 0},rs.bind(null,i,n),null)),[r,a,e]}function rs(e,t){e.action=t}function is(e){var t=Ao(),n=uo;if(n!==null)return ns(t,n,e);Ao(),t=t.memoizedState,n=Ao();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function as(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=lo.updateQueue,t===null&&(t=jo(),lo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function os(){return Ao().memoizedState}function ss(e,t,n,r){var i=ko();lo.flags|=e,i.memoizedState=as(1|t,{destroy:void 0},n,r===void 0?null:r)}function cs(e,t,n,r){var i=Ao();r=r===void 0?null:r;var a=i.memoizedState.inst;uo!==null&&r!==null&&xo(r,uo.memoizedState.deps)?i.memoizedState=as(t,a,n,r):(lo.flags|=e,i.memoizedState=as(1|t,a,n,r))}function ls(e,t){ss(8390656,8,e,t)}function us(e,t){cs(2048,8,e,t)}function ds(e){lo.flags|=4;var t=lo.updateQueue;if(t===null)t=jo(),lo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function fs(e){var t=Ao().memoizedState;return ds({ref:t,nextImpl:e}),function(){if(Bl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ps(e,t){return cs(4,2,e,t)}function ms(e,t){return cs(4,4,e,t)}function hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gs(e,t,n){n=n==null?null:n.concat([e]),cs(4,4,hs.bind(null,t,e),n)}function _s(){}function vs(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ys(e,t){var n=Ao();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&xo(t,r[1]))return r[0];if(r=e(),ho){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r}function bs(e,t,n){return n===void 0||co&1073741824&&!(Hl&261930)?e.memoizedState=t:(e.memoizedState=n,e=yu(),lo.lanes|=e,Xl|=e,n)}function xs(e,t,n,r){return _r(n,t)?n:Ja.current===null?!(co&42)||co&1073741824&&!(Hl&261930)?(nc=!0,e.memoizedState=n):(e=yu(),lo.lanes|=e,Xl|=e,t):(e=bs(e,n,r),_r(e,t)||(nc=!0),e)}function Ss(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Ps(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ns(e,t,fa(c,r),vu(e)):Ns(e,t,r,vu(e))}catch(n){Ns(e,t,{then:function(){},status:`rejected`,reason:n},vu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Cs(){}function ws(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ts(e).queue;Ss(e,a,t,te,n===null?Cs:function(){return Es(e),n(r)})}function Ts(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Es(e){var t=Ts(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},vu())}function Ds(){return Zi(op)}function Os(){return Ao().memoizedState}function ks(){return Ao().memoizedState}function As(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=vu();e=za(n);var r=Ba(t,e,n);r!==null&&(bu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=vu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Fs(e)?Is(t,n):(n=Zr(e,t,n,r),n!==null&&(bu(n,e,r),Ls(n,t,r)))}function Ms(e,t,n){Ns(e,t,n,vu())}function Ns(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fs(e))Is(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Xr(e,t,i,0),Vl===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return bu(n,e,r),Ls(n,t,r),!0}return!1}function Ps(e,t,n,r){if(r={lane:2,revertLane:_d(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fs(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&bu(t,e,2)}function Fs(e){var t=e.alternate;return e===lo||t!==null&&t===lo}function Is(e,t){mo=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ls(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qe(e,n)}}var Rs={readContext:Zi,use:No,useCallback:bo,useContext:bo,useEffect:bo,useImperativeHandle:bo,useLayoutEffect:bo,useInsertionEffect:bo,useMemo:bo,useReducer:bo,useRef:bo,useState:bo,useDebugValue:bo,useDeferredValue:bo,useTransition:bo,useSyncExternalStore:bo,useId:bo,useHostTransitionStatus:bo,useFormState:bo,useActionState:bo,useOptimistic:bo,useMemoCache:bo,useCacheRefresh:bo};Rs.useEffectEvent=bo;var zs={readContext:Zi,use:No,useCallback:function(e,t){return ko().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ls,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ss(4194308,4,hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ss(4194308,4,e,t)},useInsertionEffect:function(e,t){ss(4,2,e,t)},useMemo:function(e,t){var n=ko();t=t===void 0?null:t;var r=e();if(ho){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ko();if(n!==void 0){var i=n(t);if(ho){Fe(!0);try{n(t)}finally{Fe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=js.bind(null,lo,e),[r.memoizedState,e]},useRef:function(e){var t=ko();return e={current:e},t.memoizedState=e},useState:function(e){e=Go(e);var t=e.queue,n=Ms.bind(null,lo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:_s,useDeferredValue:function(e,t){return bs(ko(),e,t)},useTransition:function(){var e=Go(!1);return e=Ss.bind(null,lo,e.queue,!0,!1),ko().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=lo,a=ko();if(Ai){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Vl===null)throw Error(i(349));Hl&127||Bo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ls(Ho.bind(null,r,o,e),[e]),r.flags|=2048,as(9,{destroy:void 0},Vo.bind(null,r,o,n,t),null),n},useId:function(){var e=ko(),t=Vl.identifierPrefix;if(Ai){var n=Si,r=xi;n=(r&~(1<<32-Ie(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ds,useFormState:es,useActionState:es,useOptimistic:function(e){var t=ko();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ps.bind(null,lo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Po,useCacheRefresh:function(){return ko().memoizedState=As.bind(null,lo)},useEffectEvent:function(e){var t=ko(),n={impl:e};return t.memoizedState=n,function(){if(Bl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Bs={readContext:Zi,use:No,useCallback:vs,useContext:Zi,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Io,useRef:os,useState:function(){return Io(Fo)},useDebugValue:_s,useDeferredValue:function(e,t){return xs(Ao(),uo.memoizedState,e,t)},useTransition:function(){var e=Io(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Os,useHostTransitionStatus:Ds,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){return Ko(Ao(),uo,e,t)},useMemoCache:Po,useCacheRefresh:ks};Bs.useEffectEvent=fs;var Vs={readContext:Zi,use:No,useCallback:vs,useContext:Zi,useEffect:us,useImperativeHandle:gs,useInsertionEffect:ps,useLayoutEffect:ms,useMemo:ys,useReducer:Ro,useRef:os,useState:function(){return Ro(Fo)},useDebugValue:_s,useDeferredValue:function(e,t){var n=Ao();return uo===null?bs(n,e,t):xs(n,uo.memoizedState,e,t)},useTransition:function(){var e=Ro(Fo)[0],t=Ao().memoizedState;return[typeof e==`boolean`?e:Mo(e),t]},useSyncExternalStore:zo,useId:Os,useHostTransitionStatus:Ds,useFormState:is,useActionState:is,useOptimistic:function(e,t){var n=Ao();return uo===null?(n.baseState=e,[e,n.queue.dispatch]):Ko(n,uo,e,t)},useMemoCache:Po,useCacheRefresh:ks};Vs.useEffectEvent=fs;function W(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=vu(),i=za(r);i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(bu(t,e,r),Va(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=vu(),i=za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(bu(t,e,r),Va(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=vu(),r=za(n);r.tag=2,t!=null&&(r.callback=t),t=Ba(e,r,n),t!==null&&(bu(t,e,n),Va(t,e,n))}};function Us(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(i,a):!0}function Ws(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Hs.enqueueReplaceState(t,t.state,null)}function Gs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ks(e){Gr(e)}function qs(e){console.error(e)}function Js(e){Gr(e)}function Ys(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){return n=za(n),n.tag=3,n.payload={element:null},n.callback=function(){Ys(e,t)},n}function Qs(e){return e=za(e),e.tag=3,e}function $s(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Xs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Xs(t,n,r),typeof i!=`function`&&(cu===null?cu=new Set([this]):cu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ec(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Mu():n.alternate===null&&Yl===0&&(Yl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Zu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Zu(e,r,a)),!1}throw Error(i(435,n.tag))}return Zu(e,r,a),Mu(),!1}if(Ai)return t=$a.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),Bi(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=Zs(e.stateNode,r,a),Ha(e,a),Yl!==4&&(Yl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),Bi(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),tu===null?tu=[o]:tu.push(o),Yl!==4&&(Yl=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Zs(n.stateNode,r,e),Ha(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(cu===null||!cu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Qs(a),$s(a,e,n,r),Ha(n,a),!1}n=n.return}while(n!==null);return!1}var tc=Error(i(461)),nc=!1;function rc(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Xi(t),r=So(e,t,n,o,a,i),s=Eo(),e!==null&&!nc?(Do(e,t,i),Oc(e,t,i)):(Ai&&s&&Ti(t),t.flags|=1,rc(e,t,r,i),t.child)}function ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,oc(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!kc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Oc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function oc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref)if(nc=!1,t.pendingProps=r=a,kc(e,i))e.flags&131072&&(nc=!0);else return t.lanes=e.lanes,Oc(e,t,i)}return mc(e,t,n,r,i)}function sc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),ro(t);else return r=t.lanes=536870912,lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Za(),io(t)):(ga(t,a.cachePool),Xa(t,a),io(t),t.memoizedState=null);return rc(e,t,i,n),t.child}function cc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function lc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Za(),ro(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function uc(e,t){return t=Cc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dc(e,t,n){return Pa(t,e.child,null,n),e=uc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function fc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ai){if(r.mode===`hidden`)return e=uc(t,r),t.lanes=536870912,cc(null,e);if(no(t),(e=ki)?(e=ff(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),a)if(t.flags&256)t.flags&=-257,t=dc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(nc||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,nc||a){if(r=Vl,r!==null&&(s=$e(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),bu(r,e,s),tc;Mu(),t=dc(e,t,n)}else e=o.treeContext,ki=gf(s.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=uc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function pc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function mc(e,t,n,r,i){return Xi(t),n=So(e,t,n,r,void 0,i),r=Eo(),e!==null&&!nc?(Do(e,t,i),Oc(e,t,i)):(Ai&&r&&Ti(t),t.flags|=1,rc(e,t,n,i),t.child)}function hc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=wo(t,r,n,i),Co(e),r=Eo(),e!==null&&!nc?(Do(e,t,a),Oc(e,t,a)):(Ai&&r&&Ti(t),t.flags|=1,rc(e,t,n,a),t.child)}function gc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Hs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},La(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(W(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Hs.enqueueReplaceState(a,a.state,null),Ga(t,r,a,i),Wa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Gs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Zi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ws(t,a,r,o),Ia=!1;var f=t.memoizedState;a.state=f,Ga(t,r,a,i),Wa(),l=t.memoizedState,s||f!==l||Ia?(typeof d==`function`&&(W(t,n,d,r),l=t.memoizedState),(c=Ia||Us(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ra(e,t),o=t.memoizedProps,u=Gs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Zi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ws(t,a,r,c),Ia=!1,f=t.memoizedState,a.state=f,Ga(t,r,a,i),Wa();var p=t.memoizedState;o!==d||f!==p||Ia||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(W(t,n,s,r),p=t.memoizedState),(u=Ia||Us(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,pc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):rc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Oc(e,t,i),e}function _c(e,t,n,r){return Ri(),t.flags|=256,rc(e,t,n,r),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yc(e){return{baseLanes:e,cachePool:_a()}}function bc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=$l),e}function xc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ai){if(a?to(t):io(t),(e=ki)?(e=ff(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return mf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=Cc({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=yc(n),r.childLanes=bc(e,s,n),t.memoizedState=vc,cc(null,r)):(to(t),Sc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=wc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=Cc({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Pa(t,e.child,null,n),r=t.child,r.memoizedState=yc(n),r.childLanes=bc(e,s,n),t.memoizedState=vc,t=cc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),mf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=wc(e,t,n)}else if(nc||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,nc||s){if(s=Vl,s!==null&&(r=$e(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),bu(s,e,r),tc;pf(c)||Mu(),t=wc(e,t,n)}else pf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=gf(c.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=Sc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,cc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=yc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=bc(e,s,n),t.memoizedState=vc,cc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Sc(e,t){return t=Cc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Cc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function wc(e,t,n){return Pa(t,e.child,null,n),e=Sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Ec(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Dc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,L(oo,o),rc(e,t,r,n),r=Ai?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tc(e,n,t);else if(e.tag===19)Tc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ec(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ec(t,!0,n,null,a,r);break;case`together`:Ec(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Oc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Yi(e))):!0}function Ac(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Oc(e,t,n),e===null?null:e.sibling):xc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Dc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),L(oo,oo.current),r)break;return null;case 22:return t.lanes=0,sc(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Oc(e,t,n)}function jc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)nc=!0;else{if(!kc(e,n)&&!(t.flags&128))return nc=!1,Ac(e,t,n);nc=!!(e.flags&131072)}else nc=!1,Ai&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Gs(e,r),t.tag=1,t=gc(null,t,e,r,n)):(t.tag=0,t=mc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===C){t.tag=11,t=ic(null,t,e,r,n);break a}else if(a===E){t.tag=14,t=ac(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return mc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Gs(r,t.pendingProps),gc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ra(e,t),Ga(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Wa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=_c(e,t,r,n);break a}else if(r!==a){a=pi(Error(i(424)),t),Bi(a),t=_c(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ki=gf(e.firstChild),Oi=t,Ai=!0,ji=null,Mi=!0,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===a){t=Oc(e,t,n);break a}rc(e,t,r,n)}t=t.child}return t;case 26:return pc(e,t),e===null?(n=Lf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ai||(n=t.type,e=t.pendingProps,r=Jd(oe.current).createElement(n),r[at]=t,r[ot]=e,Hd(r,n,e),vt(r),t.stateNode=r):t.memoizedState=Lf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&Ai&&(r=t.stateNode=bf(t.type,t.pendingProps,oe.current),Oi=t,Mi=!0,a=ki,of(t.type)?(_f=a,ki=gf(r.firstChild)):ki=a),rc(e,t,t.pendingProps.children,n),pc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ai&&((a=r=ki)&&(r=uf(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,Oi=t,ki=gf(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),ue(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Zd(a,o)?r=null:s!==null&&Zd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=So(e,t,To,null,null,n),op._currentValue=a),pc(e,t),rc(e,t,r,n),t.child;case 6:return e===null&&Ai&&((e=n=ki)&&(n=df(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Pi(t)),null;case 13:return xc(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):rc(e,t,r,n),t.child;case 11:return ic(e,t,t.type,t.pendingProps,n);case 7:return rc(e,t,t.pendingProps,n),t.child;case 8:return rc(e,t,t.pendingProps.children,n),t.child;case 12:return rc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),rc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,rc(e,t,r,n),t.child;case 14:return ac(e,t,t.type,t.pendingProps,n);case 15:return oc(e,t,t.type,t.pendingProps,n);case 19:return Dc(e,t,n);case 31:return fc(e,t,n);case 22:return sc(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=Vl,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},La(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(Ra(e,t),Ga(t,null,null,n),Wa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),rc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Mc(e){e.flags|=4}function Nc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(ku())e.flags|=8192;else throw Ta=xa,ya}else e.flags&=-16777217}function Pc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Qf(t))if(ku())e.flags|=8192;else throw Ta=xa,ya}function Fc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:qe(),e.lanes|=t,eu|=t)}function Ic(e,t){if(!Ai)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Lc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Rc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lc(t),null;case 1:return Lc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?Mc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Lc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Mc(t),o===null?(Lc(t),Nc(t,a,null,r,n)):(Lc(t),Pc(t,o))):o?o===e.memoizedState?(Lc(t),t.flags&=-16777217):(Mc(t),Lc(t),Pc(t,o)):(e=e.memoizedProps,e!==r&&Mc(t),Lc(t),Nc(t,a,e,r,n)),null;case 27:if(de(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Lc(t),null}e=ae.current,Li(t)?Fi(t,e):(e=bf(a,r,n),t.stateNode=e,Mc(t))}return Lc(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Lc(t),null}if(o=ae.current,Li(t))Fi(t,o);else{var s=Jd(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[at]=t,o[ot]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Hd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return Lc(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Oi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||zd(e.nodeValue,n)),e||Pi(t,!0)}else e=Jd(e).createTextNode(r),e[at]=t,t.stateNode=e}return Lc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[at]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Lc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[at]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fc(t,t.updateQueue),Lc(t),null);case 4:return le(),e===null&&kd(t.stateNode.containerInfo),Lc(t),null;case 10:return Gi(t.type),Lc(t),null;case 19:if(ie(oo),r=t.memoizedState,r===null)return Lc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ic(r,!1);else{if(Yl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Ic(r,!1),e=o.updateQueue,t.updateQueue=e,Fc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return L(oo,oo.current&1|2),Ai&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>ou&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Fc(t,e),Ic(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ai)return Lc(t),null}else 2*we()-r.renderingStartTime>ou&&n!==536870912&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Lc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,n=oo.current,L(oo,a?n&1|2:n&1),Ai&&Ci(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Lc(t),t.subtreeFlags&6&&(t.flags|=8192)):Lc(t),n=t.updateQueue,n!==null&&Fc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ie(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Lc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zc(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(oo),null;case 4:return le(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&ie(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function Bc(e,t){switch(Ei(t),t.tag){case 3:Gi(ra),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:ie(oo);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&ie(ma);break;case 24:Gi(ra)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Xu(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Xu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Xu(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Xu(e,e.return,t)}}}function Wc(e,t,n){n.props=Gs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Xu(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Xu(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Xu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Xu(e,t,n)}else n.current=null}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Xu(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;Ud(r,e.type,n,t),r[ot]=t}catch(t){Xu(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&of(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&of(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=V));else if(r!==4&&(r===27&&of(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&of(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Hd(t,r,n),t[at]=e,t[ot]=n}catch(t){Xu(e,e.return,t)}}var el=!1,tl=!1,nl=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,Kd=hp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(qd={focusedElem:e,selectionRange:n},hp=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Gs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Xu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)lf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:lf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,il=e;break}il=t.return}}function ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:xl(e,n),r&4&&Vc(5,n);break;case 1:if(xl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Xu(n,n.return,e)}else{var i=Gs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Xu(n,n.return,e)}}r&64&&Uc(n),r&512&&Gc(n,n.return);break;case 3:if(xl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{qa(e,t)}catch(e){Xu(n,n.return,e)}}break;case 27:t===null&&r&4&&$c(n);case 26:case 5:xl(e,n),t===null&&r&4&&qc(n),r&512&&Gc(n,n.return);break;case 12:xl(e,n);break;case 31:xl(e,n),r&4&&fl(e,n);break;case 13:xl(e,n),r&4&&pl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ed.bind(null,n),hf(e,n))));break;case 22:if(r=n.memoizedState!==null||el,!r){t=t!==null&&t.memoizedState!==null||tl,i=el;var a=tl;el=r,(tl=t)&&!a?Cl(e,n,(n.subtreeFlags&8772)!=0):xl(e,n),el=i,tl=a}break;case 30:break;default:xl(e,n)}}function sl(e){var t=e.alternate;t!==null&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&pt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var cl=null,ll=!1;function ul(e,t,n){for(n=n.child;n!==null;)dl(e,t,n),n=n.sibling}function dl(e,t,n){if(Pe&&typeof Pe.onCommitFiberUnmount==`function`)try{Pe.onCommitFiberUnmount(Ne,n)}catch{}switch(n.tag){case 26:tl||Kc(n,t),ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tl||Kc(n,t);var r=cl,i=ll;of(n.type)&&(cl=n.stateNode,ll=!1),ul(e,t,n),xf(n.stateNode),cl=r,ll=i;break;case 5:tl||Kc(n,t);case 6:if(r=cl,i=ll,cl=null,ul(e,t,n),cl=r,ll=i,cl!==null)if(ll)try{(cl.nodeType===9?cl.body:cl.nodeName===`HTML`?cl.ownerDocument.body:cl).removeChild(n.stateNode)}catch(e){Xu(n,t,e)}else try{cl.removeChild(n.stateNode)}catch(e){Xu(n,t,e)}break;case 18:cl!==null&&(ll?(e=cl,sf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Vp(e)):sf(cl,n.stateNode));break;case 4:r=cl,i=ll,cl=n.stateNode.containerInfo,ll=!0,ul(e,t,n),cl=r,ll=i;break;case 0:case 11:case 14:case 15:Hc(2,n,t),tl||Hc(4,n,t),ul(e,t,n);break;case 1:tl||(Kc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Wc(n,t,r)),ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:tl=(r=tl)||n.memoizedState!==null,ul(e,t,n),tl=r;break;default:ul(e,t,n)}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vp(e)}catch(e){Xu(t,t.return,e)}}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vp(e)}catch(e){Xu(t,t.return,e)}}function ml(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rl),t;default:throw Error(i(435,e.tag))}}function hl(e,t){var n=ml(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=td.bind(null,e,t);t.then(r,r)}})}function gl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(of(c.type)){cl=c.stateNode,ll=!1;break a}break;case 5:cl=c.stateNode,ll=!1;break a;case 3:case 4:cl=c.stateNode.containerInfo,ll=!0;break a}c=c.return}if(cl===null)throw Error(i(160));dl(o,s,a),cl=null,ll=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vl(t,e),t=t.sibling}var _l=null;function vl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gl(t,e),yl(e),r&4&&(Hc(3,e,e.return),Vc(3,e),Hc(5,e,e.return));break;case 1:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&64&&el&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=_l;if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ft]||o[at]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Hd(o,r,n),o[at]=e,vt(o),r=o;break a;case`link`:var s=Yf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Hd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Yf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Hd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[at]=e,vt(o),r=o}e.stateNode=r}else Xf(a,e.type,e.stateNode);else e.stateNode=Wf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Jc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Xf(a,e.type,e.stateNode):Wf(a,r,e.memoizedProps))}break;case 27:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),n!==null&&r&4&&Jc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),e.flags&32){a=e.stateNode;try{Wt(a,``)}catch(t){Xu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Jc(e,a,n===null?a:n.memoizedProps)),r&1024&&(nl=!0);break;case 6:if(gl(t,e),yl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Xu(e,e.return,t)}}break;case 3:if(Jf=null,a=_l,_l=wf(t.containerInfo),gl(t,e),_l=a,yl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vp(t.containerInfo)}catch(t){Xu(e,e.return,t)}nl&&(nl=!1,bl(e));break;case 4:r=_l,_l=wf(e.stateNode.containerInfo),gl(t,e),yl(e),_l=r;break;case 12:gl(t,e),yl(e);break;case 31:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 13:gl(t,e),yl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(iu=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=el,d=tl;if(el=u||a,tl=d||l,gl(t,e),tl=d,el=u,yl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||el||tl||Sl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Xu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Xu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?cf(m,!0):cf(l.stateNode,!1)}catch(e){Xu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,hl(e,n))));break;case 19:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 30:break;case 21:break;default:gl(t,e),yl(e)}}function yl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Yc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Qc(e,Xc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Wt(o,``),n.flags&=-33),Qc(e,Xc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Zc(e,Xc(e),s);break;default:throw Error(i(161))}}catch(t){Xu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ol(e,t.alternate,t),t=t.sibling}function Sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hc(4,t,t.return),Sl(t);break;case 1:Kc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Wc(t,t.return,n),Sl(t);break;case 27:xf(t.stateNode);case 26:case 5:Kc(t,t.return),Sl(t);break;case 22:t.memoizedState===null&&Sl(t);break;case 30:Sl(t);break;default:Sl(t)}e=e.sibling}}function Cl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Cl(i,a,n),Vc(4,a);break;case 1:if(Cl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Xu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ka(c[i],s)}catch(e){Xu(r,r.return,e)}}n&&o&64&&Uc(a),Gc(a,a.return);break;case 27:$c(a);case 26:case 5:Cl(i,a,n),n&&r===null&&o&4&&qc(a),Gc(a,a.return);break;case 12:Cl(i,a,n);break;case 31:Cl(i,a,n),n&&o&4&&fl(i,a);break;case 13:Cl(i,a,n),n&&o&4&&pl(i,a);break;case 22:a.memoizedState===null&&Cl(i,a,n),Gc(a,a.return);break;case 30:break;default:Cl(i,a,n)}t=t.sibling}}function wl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&aa(n))}function Tl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function El(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dl(e,t,n,r),t=t.sibling}function Dl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:El(e,t,n,r),i&2048&&Vc(9,t);break;case 1:El(e,t,n,r);break;case 3:El(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){El(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Xu(t,t.return,e)}}else El(e,t,n,r);break;case 31:El(e,t,n,r);break;case 13:El(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?El(e,t,n,r):(a._visibility|=2,Ol(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?El(e,t,n,r):kl(e,t),i&2048&&wl(o,t);break;case 24:El(e,t,n,r),i&2048&&Tl(t.alternate,t);break;default:El(e,t,n,r)}}function Ol(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ol(a,o,s,c,i),Vc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ol(a,o,s,c,i)):u._visibility&2?Ol(a,o,s,c,i):kl(a,o),i&&l&2048&&wl(o.alternate,o);break;case 24:Ol(a,o,s,c,i),i&&l&2048&&Tl(o.alternate,o);break;default:Ol(a,o,s,c,i)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:kl(n,r),i&2048&&wl(r.alternate,r);break;case 24:kl(n,r),i&2048&&Tl(r.alternate,r);break;default:kl(n,r)}t=t.sibling}}var Al=8192;function jl(e,t,n){if(e.subtreeFlags&Al)for(e=e.child;e!==null;)Ml(e,t,n),e=e.sibling}function Ml(e,t,n){switch(e.tag){case 26:jl(e,t,n),e.flags&Al&&e.memoizedState!==null&&$f(n,_l,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,n);break;case 3:case 4:var r=_l;_l=wf(e.stateNode.containerInfo),jl(e,t,n),_l=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Al,Al=16777216,jl(e,t,n),Al=r):jl(e,t,n));break;default:jl(e,t,n)}}function Nl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Ll(r,e)}Nl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Fl(e),e=e.sibling}function Fl(e){switch(e.tag){case 0:case 11:case 15:Pl(e),e.flags&2048&&Hc(9,e,e.return);break;case 3:Pl(e);break;case 12:Pl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Il(e)):Pl(e);break;default:Pl(e)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Ll(r,e)}Nl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hc(8,t,t.return),Il(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Il(t));break;default:Il(t)}e=e.sibling}}function Ll(e,t){for(;il!==null;){var n=il;switch(n.tag){case 0:case 11:case 15:Hc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,il=r;else a:for(n=e;il!==null;){r=il;var i=r.sibling,a=r.return;if(sl(r),r===n){il=null;break a}if(i!==null){i.return=a,il=i;break a}il=a}}}var Rl={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},zl=typeof WeakMap==`function`?WeakMap:Map,Bl=0,Vl=null,G=null,Hl=0,Ul=0,Wl=null,Gl=!1,Kl=!1,ql=!1,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=0,tu=null,nu=null,ru=!1,iu=0,au=0,ou=1/0,su=null,cu=null,lu=0,uu=null,du=null,fu=0,pu=0,mu=null,hu=null,gu=0,_u=null;function vu(){return Bl&2&&Hl!==0?Hl&-Hl:P.T===null?nt():_d()}function yu(){if($l===0)if(!(Hl&536870912)||Ai){var e=z;z<<=1,!(z&3932160)&&(z=262144),$l=e}else $l=536870912;return e=$a.current,e!==null&&(e.flags|=32),$l}function bu(e,t,n){(e===Vl&&(Ul===2||Ul===9)||e.cancelPendingCommit!==null)&&(Du(e,0),wu(e,Hl,$l,!1)),Ye(e,n),(!(Bl&2)||e!==Vl)&&(e===Vl&&(!(Bl&2)&&(Zl|=n),Yl===4&&wu(e,Hl,$l,!1)),ld(e))}function xu(e,t,n){if(Bl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ge(e,t),a=r?Fu(e,t):Nu(e,t,!0),o=r;do{if(a===0){Kl&&!r&&wu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Cu(n)){a=Nu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=tu;var l=c.current.memoizedState.isDehydrated;if(l&&(Du(c,s).flags|=256),s=Nu(c,s,!1),s!==2){if(ql&&!l){c.errorRecoveryDisabledLanes|=o,Zl|=o,a=4;break a}o=nu,nu=a,o!==null&&(nu===null?nu=o:nu.push.apply(nu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Du(e,0),wu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:wu(r,t,$l,!Gl);break a;case 2:nu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=iu+300-we(),10<a)){if(wu(r,t,$l,!Gl),We(r,0,!0)!==0)break a;fu=t,r.timeoutHandle=ef(Su.bind(null,r,n,nu,su,ru,t,$l,Zl,eu,Gl,o,`Throttled`,-0,0),a);break a}Su(r,n,nu,su,ru,t,$l,Zl,eu,Gl,o,null,-0,0)}}break}while(1);ld(e)}function Su(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:V},Ml(t,a,d);var m=(a&62914560)===a?iu-we():(a&4194048)===a?au-we():0;if(m=tp(d,m),m!==null){fu=a,e.cancelPendingCommit=m(Hu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),wu(e,a,o,!l);return}}Hu(e,t,a,n,r,i,o,s,c)}function Cu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wu(e,t,n,r){t&=~Ql,t&=~Zl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ie(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ze(e,n,t)}function Tu(){return Bl&6?!0:(ud(0,!1),!1)}function Eu(){if(G!==null){if(Ul===0)var e=G.return;else e=G,Ui=Hi=null,Oo(e),Oa=null,ka=0,e=G;for(;e!==null;)Bc(e.alternate,e),e=e.return;G=null}}function Du(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,tf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),fu=0,Eu(),Vl=e,G=n=ai(e.current,null),Hl=t,Ul=0,Wl=null,Gl=!1,Kl=Ge(e,t),ql=!1,eu=$l=Ql=Zl=Xl=Yl=0,nu=tu=null,ru=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ie(r),a=1<<i;t|=e[i],r&=~a}return Jl=t,Yr(),n}function Ou(e,t){lo=null,P.H=Rs,t===va||t===ba?(t=Ea(),Ul=3):t===ya?(t=Ea(),Ul=4):Ul=t===tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Wl=t,G===null&&(Yl=1,Ys(e,pi(t,e.current)))}function ku(){var e=$a.current;return e===null?!0:(Hl&4194048)===Hl?eo===null:(Hl&62914560)===Hl||Hl&536870912?e===eo:!1}function Au(){var e=P.H;return P.H=Rs,e===null?Rs:e}function ju(){var e=P.A;return P.A=Rl,e}function Mu(){Yl=4,Gl||(Hl&4194048)!==Hl&&$a.current!==null||(Kl=!0),!(Xl&134217727)&&!(Zl&134217727)||Vl===null||wu(Vl,Hl,$l,!1)}function Nu(e,t,n){var r=Bl;Bl|=2;var i=Au(),a=ju();(Vl!==e||Hl!==t)&&(su=null,Du(e,t)),t=!1;var o=Yl;a:do try{if(Ul!==0&&G!==null){var s=G,c=Wl;switch(Ul){case 8:Eu(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=Ul;if(Ul=0,Wl=null,zu(e,s,c,l),n&&Kl){o=0;break a}break;default:l=Ul,Ul=0,Wl=null,zu(e,s,c,l)}}Pu(),o=Yl;break}catch(t){Ou(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,Bl=r,P.H=i,P.A=a,G===null&&(Vl=null,Hl=0,Yr()),o}function Pu(){for(;G!==null;)Lu(G)}function Fu(e,t){var n=Bl;Bl|=2;var r=Au(),a=ju();Vl!==e||Hl!==t?(su=null,ou=we()+500,Du(e,t)):Kl=Ge(e,t);a:do try{if(Ul!==0&&G!==null){t=G;var o=Wl;b:switch(Ul){case 1:Ul=0,Wl=null,zu(e,t,o,1);break;case 2:case 9:if(Sa(o)){Ul=0,Wl=null,Ru(t);break}t=function(){Ul!==2&&Ul!==9||Vl!==e||(Ul=7),ld(e)},o.then(t,t);break a;case 3:Ul=7;break a;case 4:Ul=5;break a;case 7:Sa(o)?(Ul=0,Wl=null,Ru(t)):(Ul=0,Wl=null,zu(e,t,o,7));break;case 5:var s=null;switch(G.tag){case 26:s=G.memoizedState;case 5:case 27:var c=G;if(s?Qf(s):c.stateNode.complete){Ul=0,Wl=null;var l=c.sibling;if(l!==null)G=l;else{var u=c.return;u===null?G=null:(G=u,Bu(u))}break b}}Ul=0,Wl=null,zu(e,t,o,5);break;case 6:Ul=0,Wl=null,zu(e,t,o,6);break;case 8:Eu(),Yl=6;break a;default:throw Error(i(462))}}Iu();break}catch(t){Ou(e,t)}while(1);return Ui=Hi=null,P.H=r,P.A=a,Bl=n,G===null?(Vl=null,Hl=0,Yr(),Yl):0}function Iu(){for(;G!==null&&!Se();)Lu(G)}function Lu(e){var t=jc(e.alternate,e,Jl);e.memoizedProps=e.pendingProps,t===null?Bu(e):G=t}function Ru(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=hc(n,t,t.pendingProps,t.type,void 0,Hl);break;case 11:t=hc(n,t,t.pendingProps,t.type.render,t.ref,Hl);break;case 5:Oo(t);default:Bc(n,t),t=G=oi(t,Jl),t=jc(n,t,Jl)}e.memoizedProps=e.pendingProps,t===null?Bu(e):G=t}function zu(e,t,n,r){Ui=Hi=null,Oo(t),Oa=null,ka=0;var i=t.return;try{if(ec(e,i,t,n,Hl)){Yl=1,Ys(e,pi(n,e.current)),G=null;return}}catch(t){if(i!==null)throw G=i,t;Yl=1,Ys(e,pi(n,e.current)),G=null;return}t.flags&32768?(Ai||r===1?e=!0:Kl||Hl&536870912?e=!1:(Gl=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Vu(t,e)):Bu(t)}function Bu(e){var t=e;do{if(t.flags&32768){Vu(t,Gl);return}e=t.return;var n=Rc(t.alternate,t,Jl);if(n!==null){G=n;return}if(t=t.sibling,t!==null){G=t;return}G=t=e}while(t!==null);Yl===0&&(Yl=5)}function Vu(e,t){do{var n=zc(e.alternate,e);if(n!==null){n.flags&=32767,G=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){G=e;return}G=e=n}while(e!==null);Yl=6,G=null}function Hu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do qu();while(lu!==0);if(Bl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,Xe(e,n,o,s,c,l),e===Vl&&(G=Vl=null,Hl=0),du=t,uu=e,fu=n,pu=o,mu=a,hu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,nd(Oe,function(){return Ju(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Bl,Bl|=4;try{al(e,t,n)}finally{Bl=s,F.p=a,P.T=r}}lu=1,Uu(),Wu(),Gu()}}function Uu(){if(lu===1){lu=0;var e=uu,t=du,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Bl;Bl|=4;try{vl(t,e);var a=qd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}hp=!!Kd,qd=Kd=null}finally{Bl=i,F.p=r,P.T=n}}e.current=t,lu=2}}function Wu(){if(lu===2){lu=0;var e=uu,t=du,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Bl;Bl|=4;try{ol(e,t.alternate,t)}finally{Bl=i,F.p=r,P.T=n}}lu=3}}function Gu(){if(lu===4||lu===3){lu=0,Ce();var e=uu,t=du,n=fu,r=hu;t.subtreeFlags&10256||t.flags&10256?lu=5:(lu=0,du=uu=null,Ku(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(cu=null),tt(n),t=t.stateNode,Pe&&typeof Pe.onCommitFiberRoot==`function`)try{Pe.onCommitFiberRoot(Ne,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}fu&3&&qu(),ld(e),i=e.pendingLanes,n&261930&&i&42?e===_u?gu++:(gu=0,_u=e):gu=0,ud(0,!1)}}function Ku(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function qu(){return Uu(),Wu(),Gu(),Ju()}function Ju(){if(lu!==5)return!1;var e=uu,t=pu;pu=0;var n=tt(fu),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=mu,mu=null;var o=uu,s=fu;if(lu=0,du=uu=null,fu=0,Bl&6)throw Error(i(331));var c=Bl;if(Bl|=4,Fl(o.current),Dl(o,o.current,s,n),Bl=c,ud(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot==`function`)try{Pe.onPostCommitFiberRoot(Ne,o)}catch{}return!0}finally{F.p=a,P.T=r,Ku(e,t)}}function Yu(e,t,n){t=pi(n,t),t=Zs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(Ye(e,2),ld(e))}function Xu(e,t,n){if(e.tag===3)Yu(e,e,n);else for(;t!==null;){if(t.tag===3){Yu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(cu===null||!cu.has(r))){e=pi(n,e),n=Qs(2),r=Ba(t,n,2),r!==null&&($s(n,r,t,e),Ye(r,2),ld(r));break}}t=t.return}}function Zu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ql=!0,i.add(n),e=Qu.bind(null,e,t,n),t.then(e,e))}function Qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Vl===e&&(Hl&n)===n&&(Yl===4||Yl===3&&(Hl&62914560)===Hl&&300>we()-iu?!(Bl&2)&&Du(e,0):Ql|=n,eu===Hl&&(eu=0)),ld(e)}function $u(e,t){t===0&&(t=qe()),e=Qr(e,t),e!==null&&(Ye(e,t),ld(e))}function ed(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$u(e,n)}function td(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),$u(e,n)}function nd(e,t){return be(e,t)}var rd=null,id=null,ad=!1,od=!1,sd=!1,cd=0;function ld(e){e!==id&&e.next===null&&(id===null?rd=id=e:id=id.next=e),od=!0,ad||(ad=!0,gd())}function ud(e,t){if(!sd&&od){sd=!0;do for(var n=!1,r=rd;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ie(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,hd(r,a))}else a=Hl,a=We(r,r===Vl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ge(r,a)||(n=!0,hd(r,a));r=r.next}while(n);sd=!1}}function dd(){fd()}function fd(){od=ad=!1;var e=0;cd!==0&&$d()&&(e=cd);for(var t=we(),n=null,r=rd;r!==null;){var i=r.next,a=pd(r,t);a===0?(r.next=null,n===null?rd=i:n.next=i,i===null&&(id=n)):(n=r,(e!==0||a&3)&&(od=!0)),r=i}lu!==0&&lu!==5||ud(e,!1),cd!==0&&(cd=0)}function pd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ie(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ke(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Vl,n=Hl,n=We(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ul===2||Ul===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ge(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),tt(n)){case 2:case 8:n=De;break;case 32:n=Oe;break;case 268435456:n=Ae;break;default:n=Oe}return r=md.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(r),e.callbackPriority=2,e.callbackNode=null,2}function md(e,t){if(lu!==0&&lu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(qu()&&e.callbackNode!==n)return null;var r=Hl;return r=We(e,e===Vl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(xu(e,r,t),pd(e,we()),e.callbackNode!=null&&e.callbackNode===n?md.bind(null,e):null)}function hd(e,t){if(qu())return null;xu(e,t,!0)}function gd(){rf(function(){Bl&6?be(Ee,dd):fd()})}function _d(){if(cd===0){var e=ca;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),cd=e}return cd}function vd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Xt(``+e)}function yd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function bd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=vd((i[ot]||null).action),o=r.submitter;o&&(t=(t=o[ot]||null)?vd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(cd!==0){var e=o?yd(i,o):new FormData(i);ws(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?yd(i,o):new FormData(i),ws(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var xd=0;xd<Ur.length;xd++){var Sd=Ur[xd];Wr(Sd.toLowerCase(),`on`+(Sd[0].toUpperCase()+Sd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),St(`onMouseEnter`,[`mouseout`,`mouseover`]),St(`onMouseLeave`,[`mouseout`,`mouseover`]),St(`onPointerEnter`,[`pointerout`,`pointerover`]),St(`onPointerLeave`,[`pointerout`,`pointerover`]),xt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),xt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),xt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),xt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),xt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Cd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),wd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Cd));function Td(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}}}}function Ed(e,t){var n=t[ct];n===void 0&&(n=t[ct]=new Set);var r=e+`__bubble`;n.has(r)||(Ad(t,e,2,!1),n.add(r))}function Dd(e,t,n){var r=0;t&&(r|=4),Ad(n,e,r,t)}var Od=`_reactListening`+Math.random().toString(36).slice(2);function kd(e){if(!e[Od]){e[Od]=!0,yt.forEach(function(t){t!==`selectionchange`&&(wd.has(t)||Dd(t,!1,e),Dd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Od]||(t[Od]=!0,Dd(`selectionchange`,!1,t))}}function Ad(e,t,n,r){switch(Sp(t)){case 2:var i=gp;break;case 8:i=_p;break;default:i=vp}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function jd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=mt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}rn(function(){var r=a,i=Qt(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=In;break;case`focusin`:u=`focus`,l=Dn;break;case`focusout`:u=`blur`,l=Dn;break;case`beforeblur`:case`afterblur`:l=Dn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Rn;break;case Fr:case Ir:case Lr:l=On;break;case Vr:l=zn;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=Bn;break;case`copy`:case`cut`:case`paste`:l=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Ln;break;case`toggle`:case`beforetoggle`:l=Vn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=an(m,p),g!=null&&d.push(Md(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(mt(u)||u[st]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?mt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Ln,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:gt(l),h=u==null?c:gt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,mt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Pd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Fd(s,c,l,d,!1),u!==null&&f!==null&&Fd(s,f,u,d,!0)}}a:{if(c=r?gt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if($n(c))if(or)v=hr;else{v=pr;var y=fr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&B(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){er(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Bt(c,`number`,c.value)}switch(y=r?gt(r):window,e){case`focusin`:($n(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Un)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Zn=!0)),y=Nd(r,x),0<y.length&&(x=new An(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?H(e,n):U(e,n))&&(x=Nd(r,`onBeforeInput`),0<x.length&&(y=new An(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),bd(s,e,r,n,i)}Td(s,t)})}function Md(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Nd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=an(e,n),i!=null&&r.unshift(Md(e,i,a)),i=an(e,t),i!=null&&r.push(Md(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Pd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Fd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=an(n,a),l!=null&&o.unshift(Md(n,l,c))):i||(l=an(n,a),l!=null&&o.push(Md(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Id=/\r\n?/g,Ld=/\u0000|\uFFFD/g;function Rd(e){return(typeof e==`string`?e:``+e).replace(Id,`
10
+ `).replace(Ld,``)}function zd(e,t){return t=Rd(t),Rd(e)===t}function Bd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Wt(e,``+r);break;case`className`:Ot(e,`class`,r);break;case`tabIndex`:Ot(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ot(e,n,r);break;case`style`:qt(e,r,o);break;case`data`:if(t!==`object`){Ot(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Bd(e,t,`name`,a.name,a,null),Bd(e,t,`formEncType`,a.formEncType,a,null),Bd(e,t,`formMethod`,a.formMethod,a,null),Bd(e,t,`formTarget`,a.formTarget,a,null)):(Bd(e,t,`encType`,a.encType,a,null),Bd(e,t,`method`,a.method,a,null),Bd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=V);break;case`onScroll`:r!=null&&Ed(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ed(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Xt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Ed(`beforetoggle`,e),Ed(`toggle`,e),Dt(e,`popover`,r);break;case`xlinkActuate`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:kt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:kt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Dt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Jt.get(n)||n,Dt(e,n,r))}}function Vd(e,t,n,r,a,o){switch(n){case`style`:qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Wt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Wt(e,``+r);break;case`onScroll`:r!=null&&Ed(`scroll`,e);break;case`onScrollEnd`:r!=null&&Ed(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=V);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ot]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Dt(e,n,r)}}}function Hd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Ed(`error`,e),Ed(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Bd(e,t,o,s,n,null)}}a&&Bd(e,t,`srcSet`,n.srcSet,n,null),r&&Bd(e,t,`src`,n.src,n,null);return;case`input`:Ed(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Bd(e,t,r,d,n,null)}}zt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Ed(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Bd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Vt(e,!!r,n,!0):Vt(e,!!r,t,!1);return;case`textarea`:for(s in Ed(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Bd(e,t,s,c,n,null)}Ut(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Bd(e,t,l,r,n,null)}return;case`dialog`:Ed(`beforetoggle`,e),Ed(`toggle`,e),Ed(`cancel`,e),Ed(`close`,e);break;case`iframe`:case`object`:Ed(`load`,e);break;case`video`:case`audio`:for(r=0;r<Cd.length;r++)Ed(Cd[r],e);break;case`image`:Ed(`error`,e),Ed(`load`,e);break;case`details`:Ed(`toggle`,e);break;case`embed`:case`source`:case`link`:Ed(`error`,e),Ed(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Bd(e,t,u,r,n,null)}return;default:if(B(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Vd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Bd(e,t,c,r,n,null))}function Ud(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Bd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Bd(e,t,p,m,r,f)}}Rt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Bd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Bd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Vt(e,!!n,n?[]:``,!1):Vt(e,!!n,t,!0)):Vt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Bd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Bd(e,t,s,a,r,o)}Ht(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Bd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Bd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Bd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Bd(e,t,u,p,r,m)}return;default:if(B(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Vd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Vd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Bd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Bd(e,t,f,p,r,m)}function Wd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Gd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Wd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Wd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Kd=null,qd=null;function Jd(e){return e.nodeType===9?e:e.ownerDocument}function Yd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Xd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Zd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Qd=null;function $d(){var e=window.event;return e&&e.type===`popstate`?e===Qd?!1:(Qd=e,!0):(Qd=null,!1)}var ef=typeof setTimeout==`function`?setTimeout:void 0,tf=typeof clearTimeout==`function`?clearTimeout:void 0,nf=typeof Promise==`function`?Promise:void 0,rf=typeof queueMicrotask==`function`?queueMicrotask:nf===void 0?ef:function(e){return nf.resolve(null).then(e).catch(af)};function af(e){setTimeout(function(){throw e})}function of(e){return e===`head`}function sf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Vp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)xf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,xf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ft]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&xf(e.ownerDocument.body);n=i}while(n);Vp(t)}function cf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function lf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:lf(n),pt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function uf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ft])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=gf(e.nextSibling),e===null)break}return null}function df(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gf(e.nextSibling),e===null))return null;return e}function ff(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gf(e.nextSibling),e===null))return null;return e}function pf(e){return e.data===`$?`||e.data===`$~`}function mf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function gf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var _f=null;function vf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function yf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function bf(e,t,n){switch(t=Jd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function xf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);pt(e)}var Sf=new Map,Cf=new Set;function wf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Tf=F.d;F.d={f:Ef,r:Df,D:Af,C:jf,L:Mf,m:Nf,X:Ff,S:Pf,M:If};function Ef(){var e=Tf.f(),t=Tu();return e||t}function Df(e){var t=ht(e);t!==null&&t.tag===5&&t.type===`form`?Es(t):Tf.r(e)}var Of=typeof document>`u`?null:document;function kf(e,t,n){var r=Of;if(r&&typeof t==`string`&&t){var i=Lt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Cf.has(i)||(Cf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Hd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Af(e){Tf.D(e),kf(`dns-prefetch`,e,null)}function jf(e,t){Tf.C(e,t),kf(`preconnect`,e,t)}function Mf(e,t,n){Tf.L(e,t,n);var r=Of;if(r&&e&&t){var i=`link[rel="preload"][as="`+Lt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Lt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Lt(n.imageSizes)+`"]`)):i+=`[href="`+Lt(e)+`"]`;var a=i;switch(t){case`style`:a=Rf(e);break;case`script`:a=Hf(e)}Sf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Sf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(zf(a))||t===`script`&&r.querySelector(Uf(a))||(t=r.createElement(`link`),Hd(t,`link`,e),vt(t),r.head.appendChild(t)))}}function Nf(e,t){Tf.m(e,t);var n=Of;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Lt(r)+`"][href="`+Lt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Hf(e)}if(!Sf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Sf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Uf(a)))return}r=n.createElement(`link`),Hd(r,`link`,e),vt(r),n.head.appendChild(r)}}}function Pf(e,t,n){Tf.S(e,t,n);var r=Of;if(r&&e){var i=_t(r).hoistableStyles,a=Rf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(zf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Sf.get(a))&&Kf(e,n);var c=o=r.createElement(`link`);vt(c),Hd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Gf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Ff(e,t){Tf.X(e,t);var n=Of;if(n&&e){var r=_t(n).hoistableScripts,i=Hf(e),a=r.get(i);a||(a=n.querySelector(Uf(i)),a||(e=m({src:e,async:!0},t),(t=Sf.get(i))&&qf(e,t),a=n.createElement(`script`),vt(a),Hd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function If(e,t){Tf.M(e,t);var n=Of;if(n&&e){var r=_t(n).hoistableScripts,i=Hf(e),a=r.get(i);a||(a=n.querySelector(Uf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Sf.get(i))&&qf(e,t),a=n.createElement(`script`),vt(a),Hd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Lf(e,t,n,r){var a=(a=oe.current)?wf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Rf(n.href),n=_t(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Rf(n.href);var o=_t(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(zf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Sf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Sf.set(e,n),o||Vf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Hf(n),n=_t(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Rf(e){return`href="`+Lt(e)+`"`}function zf(e){return`link[rel="stylesheet"][`+e+`]`}function Bf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Vf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Hd(t,`link`,n),vt(t),e.head.appendChild(t))}function Hf(e){return`[src="`+Lt(e)+`"]`}function Uf(e){return`script[async]`+e}function Wf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Lt(n.href)+`"]`);if(r)return t.instance=r,vt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),vt(r),Hd(r,`style`,a),Gf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Rf(n.href);var o=e.querySelector(zf(a));if(o)return t.state.loading|=4,t.instance=o,vt(o),o;r=Bf(n),(a=Sf.get(a))&&Kf(r,a),o=(e.ownerDocument||e).createElement(`link`),vt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Hd(o,`link`,r),t.state.loading|=4,Gf(o,n.precedence,e),t.instance=o;case`script`:return o=Hf(n.src),(a=e.querySelector(Uf(o)))?(t.instance=a,vt(a),a):(r=n,(a=Sf.get(o))&&(r=m({},n),qf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),vt(a),Hd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Gf(r,n.precedence,e));return t.instance}function Gf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Kf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Jf=null;function Yf(e,t,n){if(Jf===null){var r=new Map,i=Jf=new Map;i.set(n,r)}else i=Jf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ft]||a[at]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Xf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Zf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Qf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function $f(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Rf(r.href),a=t.querySelector(zf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=np.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,vt(a);return}a=t.ownerDocument||t,r=Bf(r),(i=Sf.get(i))&&Kf(r,i),a=a.createElement(`link`),vt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Hd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=np.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ep=0;function tp(e,t){return e.stylesheets&&e.count===0&&ip(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ep===0&&(ep=62500*Gd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ip(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ep?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function np(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ip(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var rp=null;function ip(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,rp=new Map,t.forEach(ap,e),rp=null,np.call(e))}function ap(e,t){if(!(t.state.loading&4)){var n=rp.get(e);if(n)var r=n.get(null);else{n=new Map,rp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=np.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var op={$$typeof:S,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function sp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Je(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Je(0),this.hiddenUpdates=Je(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function cp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new sp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function lp(e){return e?(e=ti,e):ti}function up(e,t,n,r,i,a){i=lp(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(bu(n,e,t),Va(n,e,t))}function dp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function fp(e,t){dp(e,t),(e=e.alternate)&&dp(e,t)}function pp(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&bu(t,e,67108864),fp(e,67108864)}}function mp(e){if(e.tag===13||e.tag===31){var t=vu();t=et(t);var n=Qr(e,t);n!==null&&bu(n,e,t),fp(e,t)}}var hp=!0;function gp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,vp(e,t,n,r)}finally{F.p=a,P.T=i}}function _p(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,vp(e,t,n,r)}finally{F.p=a,P.T=i}}function vp(e,t,n,r){if(hp){var i=yp(r);if(i===null)jd(e,t,r,bp,n),jp(e,r);else if(Np(i,e,t,n,r))r.stopPropagation();else if(jp(e,r),t&4&&-1<Ap.indexOf(e)){for(;i!==null;){var a=ht(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ue(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ie(o);s.entanglements[1]|=c,o&=~c}ld(a),!(Bl&6)&&(ou=we()+500,ud(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&bu(s,a,2),Tu(),fp(a,2)}if(a=yp(r),a===null&&jd(e,t,r,bp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else jd(e,t,r,null,n)}}function yp(e){return e=Qt(e),xp(e)}var bp=null;function xp(e){if(bp=null,e=mt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bp=e,null}function Sp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Te()){case Ee:return 2;case De:return 8;case Oe:case ke:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var Cp=!1,wp=null,Tp=null,Ep=null,Dp=new Map,Op=new Map,kp=[],Ap=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function jp(e,t){switch(e){case`focusin`:case`focusout`:wp=null;break;case`dragenter`:case`dragleave`:Tp=null;break;case`mouseover`:case`mouseout`:Ep=null;break;case`pointerover`:case`pointerout`:Dp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Op.delete(t.pointerId)}}function Mp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ht(t),t!==null&&pp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Np(e,t,n,r,i){switch(t){case`focusin`:return wp=Mp(wp,e,t,n,r,i),!0;case`dragenter`:return Tp=Mp(Tp,e,t,n,r,i),!0;case`mouseover`:return Ep=Mp(Ep,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Dp.set(a,Mp(Dp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Op.set(a,Mp(Op.get(a)||null,e,t,n,r,i)),!0}return!1}function Pp(e){var t=mt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,rt(e.priority,function(){mp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,rt(e.priority,function(){mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=yp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=ht(n),t!==null&&pp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ip(e,t,n){Fp(e)&&n.delete(t)}function Lp(){Cp=!1,wp!==null&&Fp(wp)&&(wp=null),Tp!==null&&Fp(Tp)&&(Tp=null),Ep!==null&&Fp(Ep)&&(Ep=null),Dp.forEach(Ip),Op.forEach(Ip)}function Rp(e,n){e.blockedOn===n&&(e.blockedOn=null,Cp||(Cp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lp)))}var zp=null;function Bp(e){zp!==e&&(zp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zp===e&&(zp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(xp(r||n)===null)continue;break}var a=ht(n);a!==null&&(e.splice(t,3),t-=3,ws(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Vp(e){function t(t){return Rp(t,e)}wp!==null&&Rp(wp,e),Tp!==null&&Rp(Tp,e),Ep!==null&&Rp(Ep,e),Dp.forEach(t),Op.forEach(t);for(var n=0;n<kp.length;n++){var r=kp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<kp.length&&(n=kp[0],n.blockedOn===null);)Pp(n),n.blockedOn===null&&kp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ot]||null;if(typeof a==`function`)o||Bp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ot]||null)s=o.formAction;else if(xp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Bp(n)}}}function Hp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Up(e){this._internalRoot=e}Wp.prototype.render=Up.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;up(n,vu(),e,t,null,null)},Wp.prototype.unmount=Up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;up(e.current,2,null,e,null,null),Tu(),t[st]=null}};function Wp(e){this._internalRoot=e}Wp.prototype.unstable_scheduleHydration=function(e){if(e){var t=nt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kp.length&&t!==0&&t<kp[n].priority;n++);kp.splice(n,0,e),n===0&&Pp(e)}};var Gp=n.version;if(Gp!==`19.2.5`)throw Error(i(527,Gp,`19.2.5`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Kp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{Ne=qp.inject(Kp),Pe=qp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ks,s=qs,c=Js;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=cp(e,1,!1,null,null,n,r,null,o,s,c,Hp),e[st]=t.current,kd(e),new Up(t)}})),Ve=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Be()}))(),z=n(f(),1),He=n(u(),1);function Ue(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var We=e=>{switch(e){case`success`:return qe;case`info`:return Ye;case`warning`:return Je;case`error`:return Xe;default:return null}},Ge=Array(12).fill(0),Ke=({visible:e,className:t})=>z.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},z.createElement(`div`,{className:`sonner-spinner`},Ge.map((e,t)=>z.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),qe=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),Je=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Ye=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Xe=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},z.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Ze=z.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},z.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),z.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Qe=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},$e=1,et=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:$e++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],z.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(nt(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!z.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||$e++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},tt=(e,t)=>{let n=t?.id||$e++;return et.addToast({title:e,...t,id:n}),n},nt=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,rt=Object.assign(tt,{success:et.success,info:et.info,warning:et.warning,error:et.error,custom:et.custom,message:et.message,promise:et.promise,dismiss:et.dismiss,loading:et.loading},{getHistory:()=>et.toasts,getToasts:()=>et.getActiveToasts()});Ue(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function it(e){return e.label!==void 0}var at=3,ot=`24px`,st=`16px`,ct=4e3,lt=356,ut=14,dt=45,ft=200;function pt(...e){return e.filter(Boolean).join(` `)}function mt(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var ht=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,D]=z.useState(null),[O,k]=z.useState(null),[A,j]=z.useState(!1),[M,ee]=z.useState(!1),[N,P]=z.useState(!1),[F,te]=z.useState(!1),[I,ne]=z.useState(!1),[re,ie]=z.useState(0),[L,ae]=z.useState(0),R=z.useRef(n.duration||y||ct),oe=z.useRef(null),se=z.useRef(null),ce=c===0,le=c+1<=o,ue=n.type,de=n.dismissible!==!1,fe=n.className||``,pe=n.descriptionClassName||``,me=z.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),he=z.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ge=z.useMemo(()=>n.duration||y||ct,[n.duration,y]),_e=z.useRef(0),ve=z.useRef(0),ye=z.useRef(0),be=z.useRef(null),[xe,Se]=b.split(`-`),Ce=z.useMemo(()=>s.reduce((e,t,n)=>n>=me?e:e+t.height,0),[s,me]),we=Qe(),Te=n.invert||t,Ee=ue===`loading`;ve.current=z.useMemo(()=>me*x+Ce,[me,Ce]),z.useEffect(()=>{R.current=ge},[ge]),z.useEffect(()=>{j(!0)},[]),z.useEffect(()=>{let e=se.current;if(e){let t=e.getBoundingClientRect().height;return ae(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),z.useLayoutEffect(()=>{if(!A)return;let e=se.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,ae(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[A,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let De=z.useCallback(()=>{ee(!0),ie(ve.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},ft)},[n,d,a,ve]);z.useEffect(()=>{if(n.promise&&ue===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||we?(()=>{if(ye.current<_e.current){let e=new Date().getTime()-_e.current;R.current-=e}ye.current=new Date().getTime()})():R.current!==1/0&&(_e.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),De()},R.current)),()=>clearTimeout(e)},[u,i,n,ue,we,De]),z.useEffect(()=>{n.delete&&(De(),n.onDismiss==null||n.onDismiss.call(n,n))},[De,n.delete]);function Oe(){return w?.loading?z.createElement(`div`,{className:pt(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":ue===`loading`},w.loading):z.createElement(Ke,{className:pt(C?.loader,n?.classNames?.loader),visible:ue===`loading`})}let ke=n.icon||w?.[ue]||We(ue);return z.createElement(`li`,{tabIndex:0,ref:se,className:pt(_,fe,C?.toast,n?.classNames?.toast,C?.default,C?.[ue],n?.classNames?.[ue]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":A,"data-promise":!!n.promise,"data-swiped":I,"data-removed":M,"data-visible":le,"data-y-position":xe,"data-x-position":Se,"data-index":c,"data-front":ce,"data-swiping":N,"data-dismissible":de,"data-type":ue,"data-invert":Te,"data-swipe-out":F,"data-swipe-direction":O,"data-expanded":!!(u||S&&A),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${M?re:ve.current}px`,"--initial-height":S?`auto`:`${L}px`,...m,...n.style},onDragEnd:()=>{P(!1),D(null),be.current=null},onPointerDown:e=>{e.button!==2&&(Ee||!de||(oe.current=new Date,ie(ve.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(P(!0),be.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(F||!de)return;be.current=null;let e=Number(se.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(se.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-oe.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=dt||a>.11){ie(ve.current),n.onDismiss==null||n.onDismiss.call(n,n),k(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),De(),te(!0);return}else{var o,s;(o=se.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=se.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ne(!1),P(!1),D(null)},onPointerMove:t=>{var n,r;if(!be.current||!de||window.getSelection()?.toString().length>0)return;let i=t.clientY-be.current.y,a=t.clientX-be.current.x,o=e.swipeDirections??mt(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&D(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ne(!0),(n=se.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=se.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},he&&!n.jsx&&ue!==`loading`?z.createElement(`button`,{"aria-label":T,"data-disabled":Ee,"data-close-button":!0,onClick:Ee||!de?()=>{}:()=>{De(),n.onDismiss==null||n.onDismiss.call(n,n)},className:pt(C?.closeButton,n?.classNames?.closeButton)},w?.close??Ze):null,(ue||n.icon||n.promise)&&n.icon!==null&&(w?.[ue]!==null||n.icon)?z.createElement(`div`,{"data-icon":``,className:pt(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Oe():null,n.type===`loading`?null:ke):null,z.createElement(`div`,{"data-content":``,className:pt(C?.content,n?.classNames?.content)},z.createElement(`div`,{"data-title":``,className:pt(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?z.createElement(`div`,{"data-description":``,className:pt(v,pe,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),z.isValidElement(n.cancel)?n.cancel:n.cancel&&it(n.cancel)?z.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{it(n.cancel)&&de&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),De())},className:pt(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,z.isValidElement(n.action)?n.action:n.action&&it(n.action)?z.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{it(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&De())},className:pt(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function gt(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function _t(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?st:ot;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var vt=z.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=at,toastOptions:g,dir:_=gt(),gap:v=ut,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=z.useState([]),C=z.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=z.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=z.useState([]),[D,O]=z.useState(!1),[k,A]=z.useState(!1),[j,M]=z.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),ee=z.useRef(null),N=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),P=z.useRef(null),F=z.useRef(!1),te=z.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||et.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return z.useEffect(()=>et.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{He.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),z.useEffect(()=>{if(d!==`system`){M(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?M(`dark`):M(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{M(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{M(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),z.useEffect(()=>{x.length<=1&&O(!1)},[x]),z.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=ee.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===ee.current||ee.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),z.useEffect(()=>{if(ee.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,F.current=!1)}},[ee.current]),z.createElement(`section`,{ref:t,"aria-label":`${b} ${N}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?z.createElement(`ol`,{key:t,dir:_===`auto`?gt():_,tabIndex:-1,ref:ee,className:c,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${lt}px`,"--gap":`${v}px`,...m,..._t(l,u)},onBlur:e=>{F.current&&!e.currentTarget.contains(e.relatedTarget)&&(F.current=!1,P.current&&=(P.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||F.current||(F.current=!0,P.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||A(!0)},onPointerUp:()=>A(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>z.createElement(ht,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:te,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:D,swipeDirections:e.swipeDirections}))):null}))});function yt(){return typeof window<`u`}function bt(e){return Ct(e)?(e.nodeName||``).toLowerCase():`#document`}function xt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function St(e){return((Ct(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Ct(e){return yt()?e instanceof Node||e instanceof xt(e).Node:!1}function wt(e){return yt()?e instanceof Element||e instanceof xt(e).Element:!1}function Tt(e){return yt()?e instanceof HTMLElement||e instanceof xt(e).HTMLElement:!1}function Et(e){return!yt()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof xt(e).ShadowRoot}function Dt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ot(e){return/^(table|td|th)$/.test(bt(e))}function kt(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var At=/transform|translate|scale|rotate|perspective|filter/,jt=/paint|layout|strict|content/,Mt=e=>!!e&&e!==`none`,Nt;function Pt(e){let t=wt(e)?Rt(e):e;return Mt(t.transform)||Mt(t.translate)||Mt(t.scale)||Mt(t.rotate)||Mt(t.perspective)||!It()&&(Mt(t.backdropFilter)||Mt(t.filter))||At.test(t.willChange||``)||jt.test(t.contain||``)}function Ft(e){let t=Bt(e);for(;Tt(t)&&!Lt(t);){if(Pt(t))return t;if(kt(t))return null;t=Bt(t)}return null}function It(){return Nt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Nt}function Lt(e){return/^(html|body|#document)$/.test(bt(e))}function Rt(e){return xt(e).getComputedStyle(e)}function zt(e){return wt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bt(e){if(bt(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Et(e)&&e.host||St(e);return Et(t)?t.host:t}function Vt(e){let t=Bt(e);return Lt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Tt(t)&&Dt(t)?t:Vt(t)}function Ht(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Vt(e),i=r===e.ownerDocument?.body,a=xt(r);if(i){let e=Ut(a);return t.concat(a,a.visualViewport||[],Dt(r)?r:[],e&&n?Ht(e):[])}else return t.concat(r,Ht(r,[],n))}function Ut(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Wt={};function Gt(e,t){let n=z.useRef(Wt);return n.current===Wt&&(n.current=e(t)),n}var Kt=z[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],qt=Kt&&Kt!==z.useLayoutEffect?Kt:e=>e();function B(e){let t=Gt(Jt).current;return t.next=e,qt(t.effect),t.trampoline}function Jt(){let e={next:void 0,callback:Yt,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Yt(){}var Xt={...z},V=typeof document<`u`?z.useLayoutEffect:()=>{};function Zt(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var Qt={};function $t(e,t,n,r,i){if(!n&&!r&&!i&&!e)return tn(t);let a=tn(e);return t&&(a=nn(a,t)),n&&(a=nn(a,n)),r&&(a=nn(a,r)),i&&(a=nn(a,i)),a}function en(e){if(e.length===0)return Qt;if(e.length===1)return tn(e[0]);let t=tn(e[0]);for(let n=1;n<e.length;n+=1)t=nn(t,e[n]);return t}function tn(e){return sn(e)?{...cn(e,Qt)}:rn(e)}function nn(e,t){return sn(t)?cn(t,e):an(e,t)}function rn(e){let t={...e};for(let e in t){let n=t[e];on(e,n)&&(t[e]=un(n))}return t}function an(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=Zt(e.style,r);break;case`className`:e[n]=fn(e.className,r);break;default:on(n,r)?e[n]=ln(e[n],r):e[n]=r}}return e}function on(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function sn(e){return typeof e==`function`}function cn(e,t){return sn(e)?e(t):e??Qt}function ln(e,t){return t?e?n=>{if(pn(n)){let r=n;dn(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:un(t):e}function un(e){return e&&(t=>(pn(t)&&dn(t),e(t)))}function dn(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function fn(e,t){return t?e?t+` `+e:t:e}function pn(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function mn(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var hn=mn(`https://base-ui.com/production-error`,`Base UI`),gn=z.createContext(void 0);function _n(e=!1){let t=z.useContext(gn);if(t===void 0&&!e)throw Error(hn(16));return t}function vn(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:z.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function yn(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=z.useRef(null),s=_n(!0),c=a??s!==void 0,{props:l}=vn({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=z.useCallback(()=>{let e=o.current;bn(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return V(u,[u]),{getButtonProps:z.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return $t({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(dn(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=bn(a),l=!i&&xn(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(dn(e),a?.(e),e.target===e.currentTarget&&i&&c&&bn(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?void 0:{role:`button`},l,u)},[t,l,c,i]),buttonRef:B(e=>{o.current=e,u()})}}function bn(e){return Tt(e)&&e.tagName===`BUTTON`}function xn(e){return!!(e?.tagName===`A`&&e?.href)}function Sn(e,t,n,r){let i=Gt(wn).current;return Tn(i,e,t,n,r)&&Dn(i,[e,t,n,r]),i.callback}function Cn(e){let t=Gt(wn).current;return En(t,e)&&Dn(t,e),t.callback}function wn(){return{callback:null,cleanup:null,refs:[]}}function Tn(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function En(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Dn(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var On=19;function kn(e){return On>=e}function An(e){if(!z.isValidElement(e))return null;let t=e,n=t.props;return(kn(19)?n?.ref:t.ref)??null}function jn(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Mn(e,t){return typeof e==`function`?e(t):e}function Nn(e,t){return typeof e==`function`?e(t):e}function Pn(){}var Fn=Object.freeze([]),In=Object.freeze({}),Ln={style:{transition:`none`}},Rn=`data-base-ui-click-trigger`,zn={fallbackAxisSide:`none`},Bn={fallbackAxisSide:`end`},Vn={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function Hn(e,t,n={}){let r=t.render,i=Un(t,n);return n.enabled===!1?null:Kn(e,r,i,n.state??In)}function Un(e,t={}){let{className:n,style:r,render:i}=e,{state:a=In,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Mn(n,a):void 0,d=l?Nn(r,a):void 0,f=l?jn(a,c):In,p=l&&s?Wn(s):void 0,m=l?Zt(f,p)??{}:In;return typeof document<`u`&&(l?Array.isArray(o)?m.ref=Cn([m.ref,An(i),...o]):m.ref=Sn(m.ref,An(i),o):Sn(null,null)),l?(u!==void 0&&(m.className=fn(m.className,u)),d!==void 0&&(m.style=Zt(m.style,d)),m):In}function Wn(e){return Array.isArray(e)?en(e):$t(void 0,e)}var Gn=Symbol.for(`react.lazy`);function Kn(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=$t(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===Gn&&(i=z.Children.toArray(t)[0]),z.cloneElement(i,e)}if(e&&typeof e==`string`)return qn(e,n);throw Error(hn(8))}function qn(e,t){return e===`button`?(0,z.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,z.createElement)(`img`,{alt:``,...t,key:t.key}):z.createElement(e,t)}var Jn=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=yn({disabled:i,focusableWhenDisabled:a,native:o});return Hn(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),Yn=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Xn=l,Zn=(e,t)=>n=>{if(t?.variants==null)return Xn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Yn(t)||Yn(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Xn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function H(...e){return S(l(e))}var U=a(),Qn=Zn(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function $n({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,U.jsx)(Jn,{"data-slot":`button`,className:H(Qn({variant:t,size:n,className:e})),...r})}function er(e){let t=z.useRef(!0);t.current&&(t.current=!1,e())}var tr=[];function nr(e){z.useEffect(e,tr)}var rr=0,ir=class e{static create(){return new e}currentId=rr;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=rr,t()},e)}isStarted(){return this.currentId!==rr}clear=()=>{this.currentId!==rr&&(clearTimeout(this.currentId),this.currentId=rr)};disposeEffect=()=>this.clear};function ar(){let e=Gt(ir.create).current;return nr(e.disposeEffect),e}var or=typeof navigator<`u`,sr=gr(),cr=vr(),lr=_r(),ur=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),dr=sr.platform===`MacIntel`&&sr.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(sr.platform);or&&/firefox/i.test(lr);var fr=or&&/apple/i.test(navigator.vendor);or&&/Edg/i.test(lr);var pr=or&&/android/i.test(cr)||/android/i.test(lr),mr=or&&cr.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,hr=lr.includes(`jsdom/`);function gr(){if(!or)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function _r(){if(!or)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function vr(){if(!or)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}function yr(e){e.preventDefault(),e.stopPropagation()}function br(e){return`nativeEvent`in e}function xr(e){return e.pointerType===``&&e.isTrusted?!0:pr&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Sr(e){return hr?!1:!pr&&e.width===0&&e.height===0||pr&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Cr(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function wr(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Tr(e,t){return t!=null&&!Cr(t)?0:typeof e==`function`?e():e}function Er(e,t,n){let r=Tr(e,n);return typeof r==`number`?r:r?.[t]}function Dr(e){return typeof e==`function`?e():e}function Or(e,t){return t||e===`click`||e===`mousedown`}var kr=`none`,Ar=`trigger-press`,jr=`trigger-hover`,Mr=`trigger-focus`,Nr=`outside-press`,Pr=`item-press`,Fr=`close-press`,Ir=`focus-out`,Lr=`escape-key`,Rr=`list-navigation`,zr=`cancel-open`,Br=`sibling-open`,Vr=`disabled`,Hr=`imperative-action`;function Ur(e,t,n,r){let i=!1,a=!1,o=r??In;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var Wr=z.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new ir,currentIdRef:{current:null},currentContextRef:{current:null}});function Gr(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=z.useRef(n),a=z.useRef(n),o=z.useRef(null),s=z.useRef(null),c=ar();return(0,U.jsx)(Wr.Provider,{value:z.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function Kr(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{open:i}=t,{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=z.useContext(Wr),[f,p]=z.useState(!1);return V(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!i&&a.current===r){if(p(!1),s){let t=r;return d.start(s,()=>{n.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[i,r,a,o,s,c,l,d,n]),V(()=>{if(!i)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:n.setOpen,setIsInstantPhase:p},a.current=r,o.current={open:0,close:Er(c.current,`close`)},t!==null&&t!==r?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Ur(kr))):(p(!1),e?.setIsInstantPhase(!1))},[i,r,n,a,o,s,c,l,d]),V(()=>()=>{l.current=null},[l]),z.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function qr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Jr(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Yr(e){let t=Gt(Xr,e).current;return t.next=e,V(t.effect),t}function Xr(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Zr=null;globalThis.requestAnimationFrame;var Qr=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},$r=class e{static create(){return new e}static request(e){return Qr.request(e)}static cancel(e){return Qr.cancel(e)}currentId=Zr;request(e){this.cancel(),this.currentId=Qr.request(()=>{this.currentId=Zr,e()})}cancel=()=>{this.currentId!==Zr&&(Qr.cancel(this.currentId),this.currentId=Zr)};disposeEffect=()=>this.cancel};function ei(){let e=Gt($r.create).current;return nr(e.disposeEffect),e}function ti(e){return e?.ownerDocument||document}var ni={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},ri={...ni,position:`fixed`,top:0,left:0},ii={...ni,position:`absolute`},ai=z.forwardRef(function(e,t){let[n,r]=z.useState();V(()=>{fr&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,U.jsx)(`span`,{...e,ref:t,style:ri,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})}),oi=`data-base-ui-focusable`,si=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,ci=`ArrowLeft`,li=`ArrowRight`,ui=`ArrowUp`,di=`ArrowDown`;function fi(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function pi(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Et(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function mi(e){return`composedPath`in e?e.composedPath()[0]:e.target}function hi(e,t){if(!wt(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(pi(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function gi(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function _i(e){return e.matches(`html,body`)}function vi(e){return Tt(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function yi(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${si}`)!=null}function bi(e){return e?e.getAttribute(`role`)===`combobox`&&vi(e):!1}function xi(e){if(!e||hr)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Si(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}var Ci=[`top`,`right`,`bottom`,`left`],wi=Math.min,Ti=Math.max,Ei=Math.round,Di=Math.floor,Oi=e=>({x:e,y:e}),ki={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ai(e,t,n){return Ti(e,wi(t,n))}function ji(e,t){return typeof e==`function`?e(t):e}function Mi(e){return e.split(`-`)[0]}function Ni(e){return e.split(`-`)[1]}function Pi(e){return e===`x`?`y`:`x`}function Fi(e){return e===`y`?`height`:`width`}function Ii(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Li(e){return Pi(Ii(e))}function Ri(e,t,n){n===void 0&&(n=!1);let r=Ni(e),i=Li(e),a=Fi(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=qi(o)),[o,qi(o)]}function zi(e){let t=qi(e);return[Bi(e),t,Bi(t)]}function Bi(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Vi=[`left`,`right`],Hi=[`right`,`left`],Ui=[`top`,`bottom`],Wi=[`bottom`,`top`];function Gi(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Hi:Vi:t?Vi:Hi;case`left`:case`right`:return t?Ui:Wi;default:return[]}}function Ki(e,t,n,r){let i=Ni(e),a=Gi(Mi(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Bi)))),a}function qi(e){let t=Mi(e);return ki[t]+e.slice(t.length)}function Ji(e){return{top:0,right:0,bottom:0,left:0,...e}}function Yi(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ji(e)}function Xi(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 Zi(e,t,n){return Math.floor(e/t)!==n}function Qi(e,t){return t<0||t>=e.length}function $i(e,t){return ta(e.current,{disabledIndices:t})}function ea(e,t){return ta(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ta(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&oa(e,a,r));return a}function na(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=e.closest(`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1);o=a[i(t,u,n[o][e]??n[o][0])]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!oa(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Di(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!oa(e,r,s))return r}};d&&yr(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=ta(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=ta(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Qi(e,f)&&(f=u)}if(n===`both`){let n=Di(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&yr(t),u%o===o-1?r&&(f=ta(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=ta(e,{startingIndex:u,disabledIndices:s}),r&&Zi(f,o,n)&&(f=ta(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Zi(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&yr(t),u%o===0?r&&(f=ta(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=ta(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Zi(f,o,n)&&(f=ta(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Zi(f,o,n)&&(f=u));let c=Di(l/o)===n;Qi(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:ta(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function ra(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function ia(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function aa(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function oa(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?sa(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function sa(e){return typeof e.checkVisibility==`function`?e.checkVisibility():Rt(e).display!==`none`}var ca=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function la(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Et(n)?n.host:null}function ua(e){for(let t of Array.from(e.children))if(bt(t)===`summary`)return t;return null}function da(e,t){let n=ua(t);return!!n&&(e===n||pi(n,e))}function fa(e){let t=e?bt(e):``;return e!=null&&e.matches(ca)&&(t!==`summary`||e.parentElement!=null&&bt(e.parentElement)===`details`&&ua(e.parentElement)===e)&&(t!==`details`||ua(e)==null)&&(t!==`input`||e.type!==`hidden`)}function pa(e){if(!fa(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=la(t)){let n=bt(t)===`slot`;if(t.hasAttribute(`inert`)||t!==e&&bt(t)===`details`&&!t.open&&!da(e,t)||t.hasAttribute(`hidden`)||!n&&!sa(t))return!1}return!0}function ma(e){let t=e.tabIndex;if(t<0){let t=bt(e);if(t===`details`||t===`audio`||t===`video`||Tt(e)&&e.isContentEditable)return 0}return t}function ha(e){if(bt(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function ga(e,t){let n=ha(e);if(!n)return!0;let r=t.find(e=>{let t=ha(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=ha(e);return t?.name===n.name&&t.form===n.form})===n}function _a(e){if(Tt(e)&&bt(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Tt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function va(e,t){_a(e).forEach(e=>{fa(e)&&t.push(e),va(e,t)})}function ya(e,t,n){_a(e).forEach(e=>{Tt(e)&&e.matches(t)&&n.push(e),ya(e,t,n)})}function ba(e){return pa(e)&&ma(e)>=0}function xa(e){let t=[];return va(e,t),t.filter(pa)}function Sa(e){let t=xa(e);return t.filter(e=>ma(e)>=0&&ga(e,t))}function Ca(e,t){let n=Sa(e),r=n.length;if(r===0)return;let i=fi(ti(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function wa(e){return Ca(ti(e).body,1)||e}function Ta(e){return Ca(ti(e).body,-1)||e}function Ea(e,t){if(!e)return null;let n=Sa(ti(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function Da(e){return Ea(e,1)}function Oa(e){return Ea(e,-1)}function ka(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!pi(n,r)}function Aa(e){Sa(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ja(e){let t=[];ya(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Ma(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Ma(e,t.id,n)])}function Na(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Pa(e){return`data-base-ui-${e}`}var Fa=0;function Ia(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Fa);let a=()=>e?.focus({preventScroll:n});if(i)return a(),Pn;let o=requestAnimationFrame(a);return Fa=o,()=>{Fa===o&&(cancelAnimationFrame(o),Fa=0)}}var La={inert:new WeakMap,"aria-hidden":new WeakMap},Ra=`data-base-ui-inert`,za={inert:new WeakSet,"aria-hidden":new WeakSet},Ba=new WeakMap,Va=0;function Ha(e){return za[e]}function Ua(e){return e?Et(e)?e.host:Ua(e.parentNode):null}var Wa=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ua(t);return e.contains(n)?n:null}).filter(e=>e!=null),Ga=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Ka=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{bt(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function qa(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=Wa(t,e),u=i?Wa(t,a):[],d=new Set(u),f=i?Ka(t,Ga(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=La[o],n=Ha(o);c=n,s=e;let r=Wa(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);Ka(t,Ga(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(Ba.get(e)||0)+1;Ba.set(e,t),m.push(e),t===1&&e.setAttribute(Ra,``)}),Va+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(Ba.get(e)||0)-1;Ba.set(e,t),t||e.removeAttribute(Ra)}),--Va,Va||(La.inert=new WeakMap,La[`aria-hidden`]=new WeakMap,za.inert=new WeakSet,za[`aria-hidden`]=new WeakSet,Ba=new WeakMap)}}function Ja(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=ti(e[0]).body;return qa(e,o,n,r,{mark:i,markerIgnoreElements:a})}var Ya=0;function Xa(e,t=`mui`){let[n,r]=z.useState(e),i=e||n;return z.useEffect(()=>{n??(Ya+=1,r(`${t}-${Ya}`))},[n,t]),i}var Za=Xt.useId;function Qa(e,t){if(Za!==void 0){let n=Za();return e??(t?`${t}-${n}`:n)}return Xa(e,t)}var $a=z.createContext(null),eo=()=>z.useContext($a),to=Pa(`portal`);function no(e={}){let{ref:t,container:n,componentProps:r=In,elementProps:i}=e,a=Qa(),o=eo()?.portalNode,[s,c]=z.useState(null),[l,u]=z.useState(null),d=B(e=>{e!==null&&u(e)}),f=z.useRef(null);V(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(Ct(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o,a]);let p=Hn(`div`,r,{ref:[t,d],props:[{id:a,[to]:``},i]});return{portalNode:l,portalSubtree:s&&p?He.createPortal(p,s):null}}var ro=z.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,style:s,...c}=e,{portalNode:l,portalSubtree:u}=no({container:r,ref:t,componentProps:e,elementProps:c}),d=z.useRef(null),f=z.useRef(null),p=z.useRef(null),m=z.useRef(null),[h,g]=z.useState(null),_=z.useRef(!1),v=h?.modal,y=h?.open,b=typeof o==`boolean`?o:!!h&&!h.modal&&h.open&&!!l;z.useEffect(()=>{if(!l||v)return;function e(e){l&&e.relatedTarget&&ka(e)&&(e.type===`focusin`?_.current&&=(ja(l),!1):(Aa(l),_.current=!0))}return Jr(qr(l,`focusin`,e,!0),qr(l,`focusout`,e,!0))},[l,v]),z.useEffect(()=>{!l||y!==!1||(ja(l),_.current=!1)},[y,l]);let x=z.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:f,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:g}),[l]);return(0,U.jsxs)(z.Fragment,{children:[u,(0,U.jsxs)($a.Provider,{value:x,children:[b&&l&&(0,U.jsx)(ai,{"data-type":`outside`,ref:d,onFocus:e=>{ka(e,l)?p.current?.focus():Ta(h?h.domReference:null)?.focus()}}),b&&l&&(0,U.jsx)(`span`,{"aria-owns":l.id,style:Vn}),l&&He.createPortal(n,l),b&&l&&(0,U.jsx)(ai,{"data-type":`outside`,ref:f,onFocus:e=>{ka(e,l)?m.current?.focus():(wa(h?h.domReference:null)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,Ur(`focus-out`,e.nativeEvent)))}})]})]})});function io(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var ao=class{nodesRef={current:[]};events=io();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},oo=z.createContext(null),so=z.createContext(null),co=()=>z.useContext(oo)?.id||null,lo=e=>{let t=z.useContext(so);return e??t};function uo(e){let t=Qa(),n=lo(e),r=co();return V(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function fo(e){let{children:t,id:n}=e,r=co();return(0,U.jsx)(oo.Provider,{value:z.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function po(e){let{children:t,externalTree:n}=e,r=Gt(()=>n??new ao).current;return(0,U.jsx)(so.Provider,{value:r,children:t})}function mo(e){return e==null?e:`current`in e?e.current:e}function ho(e,t){let n=xt(mi(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var go=20,_o=[];function vo(){_o=_o.filter(e=>e.deref()?.isConnected)}function yo(e){vo(),e&&bt(e)!==`body`&&(_o.push(new WeakRef(e)),_o.length>go&&(_o=_o.slice(-go)))}function bo(){return vo(),_o[_o.length-1]?.deref()}function xo(e){return e?ba(e)?e:Sa(e)[0]||e:null}function So(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():sa(e)}function Co(e,t){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=xa(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return ba(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),r=e.getAttribute(`tabindex`);t.current.includes(`floating`)||n.length===0?r!==`0`&&e.setAttribute(`tabindex`,`0`):(r!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function wo(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=B(()=>b.current.floatingContext?.nodeId),S=i===!1,C=bi(_)&&S,w=z.useRef([`content`]),T=Yr(i),E=Yr(a),D=Yr(l),O=lo(p),k=eo(),A=z.useRef(!1),j=z.useRef(!1),M=z.useRef(!1),ee=z.useRef(null),N=z.useRef(``),P=z.useRef(``),F=z.useRef(null),te=z.useRef(null),I=Sn(F,f,k?.beforeInsideRef),ne=Sn(te,k?.afterInsideRef),re=ar(),ie=ar(),L=ei(),ae=k!=null,R=Si(v),oe=B((e=R)=>e?Sa(e):[]),se=B(()=>m?.().filter(e=>e!=null)??[]);z.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&pi(R,fi(ti(R)))&&oe().length===0&&!C&&yr(e)}return qr(ti(R),`keydown`,e)},[r,_,R,s,w,C,oe]),z.useEffect(()=>{if(r||!g)return;let e=ti(R);function t(){M.current=!1}function n(e){let t=mi(e),n=se();M.current=!(pi(v,t)||pi(_,t)||pi(k?.portalNode,t)||n.some(e=>e===t||pi(e,t))),P.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0)}function i(){P.current=`keyboard`}return Jr(qr(e,`pointerdown`,n,!0),qr(e,`pointerup`,t,!0),qr(e,`pointercancel`,t,!0),qr(e,`keydown`,i,!0))},[r,v,_,R,g,k,se]),z.useEffect(()=>{if(r||!c)return;let e=ti(R);function t(){j.current=!0,ie.start(0,()=>{j.current=!1})}function n(e){let t=mi(e);ba(t)&&(ee.current=t)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=mi(t);queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=se(),f=n?.hasAttribute(Pa(`focus-guard`))&&[F.current,te.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,mo(d),mo(u)].includes(n),p=!(pi(_,n)||pi(v,n)||pi(n,v)||pi(k?.portalNode,n)||l.some(e=>e===n||pi(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>pi(e,n))||f||O&&(Ma(O.nodesRef.current,a).find(e=>pi(e.context?.elements.floating,n)||pi(e.context?.elements.domReference,n))||Na(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,Si(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&R&&Co(R,w),o&&r!==_&&!So(i)&&fi(e)===e.body){if(Tt(R)&&(R.focus(),o===`popup`)){L.request(()=>{R.focus()});return}let e=oe(),t=ee.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||R;Tt(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!j.current&&(C||n!==bo())&&(A.current=!0,h.setOpen(!1,Ur(Ir,t)))})}function a(){M.current||(b.current.insideReactTree=!0,re.start(0,()=>{b.current.insideReactTree=!1}))}let l=Tt(_)?_:null;if(!(!v&&!l))return Jr(l&&qr(l,`focusout`,i),l&&qr(l,`pointerdown`,t),v&&qr(v,`focusin`,n),v&&qr(v,`focusout`,i),v&&k&&qr(v,`focusout`,a,!0))},[r,_,v,R,s,O,k,h,c,o,oe,C,x,w,b,re,ie,L,u,d,se]),z.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${Pa(`portal`)}]`)||[]),t=(O?Na(O.nodesRef.current,x()):[]).find(e=>bi(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Ja([...[v,...e,F.current,te.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...se()],t,mo(d),mo(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=Ja([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,w,k,C,O,x,u,d,se]),V(()=>{if(!g||r||!Tt(R))return;let e=fi(ti(R));queueMicrotask(()=>{let t=T.current,n=typeof t==`function`?t(D.current||``):t;if(n===void 0||n===!1||pi(R,e))return;let r=null,i=()=>(r??=oe(R),r[0]||R),a;a=n===!0||n===null?i():mo(n),a||=i(),Ia(a,{preventScroll:a===R})})},[r,g,R,S,oe,T,D]),V(()=>{if(r||!R)return;let e=ti(R);yo(fi(e));function t(e){if(e.open||(N.current=ho(e.nativeEvent,P.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`)if(e.nested)A.current=!1;else if(xr(e.nativeEvent)||Sr(e.nativeEvent))A.current=!1;else{let e=!1;ti(R).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}y.on(`openchange`,t);function n(){let e=E.current,t=typeof e==`function`?e(N.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=_||bo();return e&&e.isConnected?e:null}let n=_||bo();return mo(t)||n||null}return()=>{y.off(`openchange`,t);let r=fi(e),i=se(),a=pi(v,r)||i.some(e=>e===r||pi(e,r))||O&&Ma(O.nodesRef.current,x(),!1).some(e=>pi(e.context?.elements.floating,r)),o=E.current,s=n();queueMicrotask(()=>{let t=xo(s),n=typeof o!=`boolean`;o&&!A.current&&Tt(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),A.current=!1})}},[r,v,R,E,b,y,O,_,x,se]),V(()=>{if(!ur||g||!v)return;let e=fi(ti(v));!Tt(e)||!vi(e)||pi(v,e)&&e.blur()},[g,v]),V(()=>{if(!(r||!k))return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),V(()=>{if(!(r||!R))return Co(R,w),()=>{queueMicrotask(vo)}},[r,R,w]);let ce=!r&&(s?!C:!0)&&(ae||s);return(0,U.jsxs)(z.Fragment,{children:[ce&&(0,U.jsx)(ai,{"data-type":`inside`,ref:I,onFocus:e=>{if(s){let e=oe();Ia(e[e.length-1])}else k?.portalNode&&(A.current=!1,ka(e,k.portalNode)?wa(_)?.focus():mo(d??k.beforeOutsideRef)?.focus())}}),n,ce&&(0,U.jsx)(ai,{"data-type":`inside`,ref:ne,onFocus:e=>{s?Ia(oe()[0]):k?.portalNode&&(c&&(A.current=!0),ka(e,k.portalNode)?Ta(_)?.focus():mo(u??k.afterOutsideRef)?.focus())}})]})}function To(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,{enabled:i=!0,event:a=`click`,toggle:o=!0,ignoreMouse:s=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:u=Ar}=t,d=z.useRef(void 0),f=ei(),p=ar(),m=z.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){let t=d.current,i=e.nativeEvent,m=n.select(`open`);if(e.button!==0||a===`click`||Cr(t,!0)&&s)return;let h=r.current.openEvent,g=h?.type,_=n.select(`domReferenceElement`)!==e.currentTarget,v=m&&_||!(m&&o&&(!(h&&c)||g===`click`||g===`mousedown`)),y=mi(i);if(vi(y)){let e=Ur(u,i,y);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e);return}let b=e.currentTarget;f.request(()=>{let e=Ur(u,i,b);v&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,e)}):n.setOpen(v,e)})},onClick(e){if(a===`mousedown-only`)return;let t=d.current;if(a===`mousedown`&&t){d.current=void 0;return}if(Cr(t,!0)&&s)return;let i=n.select(`open`),f=r.current.openEvent,m=n.select(`domReferenceElement`)!==e.currentTarget,h=i&&m||!(i&&o&&(!(f&&c)||wr(f))),g=Ur(u,e.nativeEvent,e.currentTarget);h&&t===`touch`&&l>0?p.start(l,()=>{n.setOpen(!0,g)}):n.setOpen(h,g)},onKeyDown(){d.current=void 0}}),[r,a,s,n,c,o,f,p,l,u]);return z.useMemo(()=>i?{reference:m}:In,[i,m])}function Eo(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function Do(e){return e!=null&&e.clientX!=null}function Oo(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`}=t,l=z.useRef(!1),u=z.useRef(null),[d,f]=z.useState(),[p,m]=z.useState([]),h=B((e,t,r)=>{l.current||o.current.openEvent&&!Do(o.current.openEvent)||n.set(`positionReference`,Eo(r??a,{x:e,y:t,axis:c,dataRef:o,pointerType:d}))}),g=B(e=>{r?u.current||m([]):h(e.clientX,e.clientY,e.currentTarget)}),_=Cr(d)?i:r,v=z.useCallback(()=>{if(!_||!s)return;let e=xt(i);function t(e){pi(i,mi(e))?(u.current?.(),u.current=null):h(e.clientX,e.clientY)}if(!o.current.openEvent||Do(o.current.openEvent))return u.current=qr(e,`mousemove`,t),()=>{u.current?.(),u.current=null};n.set(`positionReference`,a)},[_,s,i,o,a,n,h]);z.useEffect(()=>v(),[v,p]),z.useEffect(()=>{s&&!i&&(l.current=!1)},[s,i]),z.useEffect(()=>{!s&&r&&(l.current=!0)},[s,r]);let y=z.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return z.useMemo(()=>s?{reference:y,trigger:y}:{},[s,y])}var ko={intentional:`onClick`,sloppy:`onPointerDown`};function Ao(){return!1}function jo(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Mo(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),{dataRef:a}=n.context,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`sloppy`,referencePress:u=Ao,referencePressEvent:d=`sloppy`,bubbles:f,externalTree:p}=t,m=lo(p),h=B(typeof c==`function`?c:()=>!1),g=typeof c==`function`?h:c,_=g!==!1,v=B(()=>l),y=z.useRef(!1),b=z.useRef(!1),x=z.useRef(!1),{escapeKey:S,outsidePress:C}=jo(f),w=z.useRef(null),T=ar(),E=ar(),D=B(()=>{E.clear(),a.current.insideReactTree=!1}),O=z.useRef(!1),k=z.useRef(``),A=B(u),j=B(e=>{if(!r||!o||!s||e.key!==`Escape`||O.current)return;let t=a.current.floatingContext?.nodeId,i=m?Ma(m.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let c=Ur(Lr,br(e)?e.nativeEvent:e);n.setOpen(!1,c),!S&&!c.isPropagationAllowed&&e.stopPropagation()}),M=B(()=>{a.current.insideReactTree=!0,E.start(0,D)});z.useEffect(()=>{if(!r||!o)return;a.current.__escapeKeyBubbles=S,a.current.__outsidePressBubbles=C;let e=new ir,t=new ir;function c(){e.clear(),O.current=!0}function l(){e.start(It()?5:0,()=>{O.current=!1})}function u(){x.current=!0,t.start(0,()=>{x.current=!1})}function d(){y.current=!1,b.current=!1}function f(){let e=k.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=a.current.floatingContext?.nodeId,r=m&&Ma(m.nodesRef.current,t).some(t=>gi(e,t.context?.elements.floating));return gi(e,n.select(`floatingElement`))||gi(e,n.select(`domReferenceElement`))||r}function E(e){if(p(e)){D();return}if(a.current.insideReactTree){D();return}let r=mi(e),i=`[${Pa(`inert`)}]`,o=wt(r)?r.getRootNode():null,s=Array.from((Et(o)?o:ti(n.select(`floatingElement`))).querySelectorAll(i)),c=n.context.triggerElements;if(r&&(c.hasElement(r)||c.hasMatchingElement(e=>pi(e,r))))return;let l=wt(r)?r:null;for(;l&&!Lt(l);){let e=Bt(l);if(Lt(e)||!wt(e))break;l=e}if(s.length&&wt(r)&&!_i(r)&&!pi(r,n.select(`floatingElement`))&&s.every(e=>!pi(l,e)))return;if(Tt(r)&&!(`touches`in e)){let t=Lt(r),n=Rt(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}if(h(e))return;if(f()===`intentional`&&x.current){t.clear(),x.current=!1;return}if(typeof g==`function`&&!g(e))return;let u=a.current.floatingContext?.nodeId,d=m?Ma(m.nodesRef.current,u):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Ur(Nr,e)),D()}function A(e){f()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!o||gi(e,n.select(`floatingElement`))||gi(e,n.select(`domReferenceElement`))||E(e)}function M(e){if(f()!==`sloppy`||!n.select(`open`)||!o||gi(e,n.select(`floatingElement`))||gi(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}function ee(e,t){let n=mi(e);if(!n)return;let r=qr(n,e.type,()=>{t(e),r()})}function N(e){k.current=`touch`,ee(e,M)}function P(e){T.clear(),e.type===`pointerdown`&&(k.current=e.pointerType),!(e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)&&ee(e,e=>{e.type===`pointerdown`?A(e):E(e)})}function F(e){if(!y.current)return;let n=b.current;if(d(),f()===`intentional`){if(e.type===`pointercancel`){n&&u();return}if(!h(e)){if(n){u();return}typeof g==`function`&&!g(e)||(t.clear(),x.current=!0,D())}}}function te(e){if(f()!==`sloppy`||!w.current||gi(e,n.select(`floatingElement`))||gi(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(E(e),T.clear(),w.current=null)}function I(e){ee(e,te)}function ne(e){f()!==`sloppy`||!w.current||gi(e,n.select(`floatingElement`))||gi(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&E(e),T.clear(),w.current=null)}function re(e){ee(e,ne)}let ie=ti(i),L=Jr(s&&Jr(qr(ie,`keydown`,j),qr(ie,`compositionstart`,c),qr(ie,`compositionend`,l)),_&&Jr(qr(ie,`click`,P,!0),qr(ie,`pointerdown`,P,!0),qr(ie,`pointerup`,F,!0),qr(ie,`pointercancel`,F,!0),qr(ie,`mousedown`,P,!0),qr(ie,`mouseup`,F,!0),qr(ie,`touchstart`,N,!0),qr(ie,`touchmove`,I,!0),qr(ie,`touchend`,re,!0)));return()=>{L(),e.clear(),t.clear(),d(),x.current=!1}},[a,i,s,_,g,r,o,S,C,j,D,v,m,n,T]),z.useEffect(D,[g,D]);let ee=z.useMemo(()=>({onKeyDown:j,[ko[d]]:e=>{A()&&n.setOpen(!1,Ur(Ar,e.nativeEvent))},...d!==`intentional`&&{onClick(e){A()&&n.setOpen(!1,Ur(`trigger-press`,e.nativeEvent))}}}),[j,n,d,A]),N=B(e=>{if(!r||!o||e.button!==0)return;let t=mi(e.nativeEvent);pi(n.select(`floatingElement`),t)&&(y.current||(y.current=!0,b.current=!1))}),P=B(e=>{!r||!o||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&y.current&&(b.current=!0)}),F=z.useMemo(()=>({onKeyDown:j,onPointerDown:P,onMouseDown:P,onClickCapture:M,onMouseDownCapture(e){M(),N(e)},onPointerDownCapture(e){M(),N(e)},onMouseUpCapture:M,onTouchEndCapture:M,onTouchMoveCapture:M}),[j,M,N,P]);return z.useMemo(()=>o?{reference:ee,floating:F,trigger:ee}:{},[o,ee,F])}function No(e,t,n){let{reference:r,floating:i}=e,a=Ii(t),o=Li(t),s=Fi(o),c=Mi(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}}switch(Ni(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Po(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}=ji(t,e),p=Yi(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Xi(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=Xi(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 Fo=50,Io=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Po},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=No(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<Fo&&(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}=No(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Lo=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}=ji(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Mi(r),_=Ii(o),v=Mi(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[qi(o)]:zi(o)),x=p!==`none`;!d&&x&&b.push(...Ki(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=Ri(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`&&_!==Ii(t))||T.every(e=>Ii(e.placement)===_?e.overflows[0]>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=Ii(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ro(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zo(e){return Ci.some(t=>e[t]>=0)}var Bo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ji(e,t);switch(i){case`referenceHidden`:{let e=Ro(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zo(e)}}}case`escaped`:{let e=Ro(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:zo(e)}}}default:return{}}}}},Vo=new Set([`left`,`top`]);async function Ho(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Mi(n),s=Ni(n),c=Ii(n)===`y`,l=Vo.has(o)?-1:1,u=a&&c?-1:1,d=ji(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 Uo=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 Ho(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}}}}},Wo=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}=ji(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ii(Mi(i)),p=Pi(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ai(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ai(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Go=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ji(e,t),u={x:n,y:r},d=Ii(i),f=Pi(d),p=u[f],m=u[d],h=ji(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Vo.has(Mi(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ko=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ji(e,t),u=await o.detectOverflow(t,l),d=Mi(i),f=Ni(i),p=Ii(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=wi(h-u[g],v),x=wi(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Ti(u.left,0),t=Ti(u.right,0),n=Ti(u.top,0),r=Ti(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Ti(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Ti(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function qo(e){let t=Rt(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Tt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ei(n)!==a||Ei(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Jo(e){return wt(e)?e:e.contextElement}function Yo(e){let t=Jo(e);if(!Tt(t))return Oi(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=qo(t),o=(a?Ei(n.width):n.width)/r,s=(a?Ei(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Xo=Oi(0);function Zo(e){let t=xt(e);return!It()||!t.visualViewport?Xo:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qo(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==xt(e)?!1:t}function $o(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Jo(e),o=Oi(1);t&&(r?wt(r)&&(o=Yo(r)):o=Yo(e));let s=Qo(a,n,r)?Zo(a):Oi(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){let e=xt(a),t=r&&wt(r)?xt(r):r,n=e,i=Ut(n);for(;i&&r&&t!==n;){let e=Yo(i),t=i.getBoundingClientRect(),r=Rt(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=xt(i),i=Ut(n)}}return Xi({width:u,height:d,x:c,y:l})}function es(e,t){let n=zt(e).scrollLeft;return t?t.left+n:$o(St(e)).left+n}function ts(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-es(e,n),y:n.top+t.scrollTop}}function ns(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=St(r),s=t?kt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Oi(1),u=Oi(0),d=Tt(r);if((d||!d&&!a)&&((bt(r)!==`body`||Dt(o))&&(c=zt(r)),d)){let e=$o(r);l=Yo(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ts(o,c):Oi(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 rs(e){return Array.from(e.getClientRects())}function is(e){let t=St(e),n=zt(e),r=e.ownerDocument.body,i=Ti(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Ti(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+es(e),s=-n.scrollTop;return Rt(r).direction===`rtl`&&(o+=Ti(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var as=25;function os(e,t){let n=xt(e),r=St(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=It();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=es(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=as&&(a-=o)}else l<=as&&(a+=l);return{width:a,height:o,x:s,y:c}}function ss(e,t){let n=$o(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Tt(e)?Yo(e):Oi(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function cs(e,t,n){let r;if(t===`viewport`)r=os(e,n);else if(t===`document`)r=is(St(e));else if(wt(t))r=ss(t,n);else{let n=Zo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Xi(r)}function ls(e,t){let n=Bt(e);return n===t||!wt(n)||Lt(n)?!1:Rt(n).position===`fixed`||ls(n,t)}function us(e,t){let n=t.get(e);if(n)return n;let r=Ht(e,[],!1).filter(e=>wt(e)&&bt(e)!==`body`),i=null,a=Rt(e).position===`fixed`,o=a?Bt(e):e;for(;wt(o)&&!Lt(o);){let t=Rt(o),n=Pt(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Dt(o)&&!n&&ls(e,o))?r=r.filter(e=>e!==o):i=t,o=Bt(o)}return t.set(e,r),r}function ds(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?kt(t)?[]:us(t,this._c):[].concat(n),r],o=cs(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=cs(t,a[e],i);s=Ti(n.top,s),c=wi(n.right,c),l=wi(n.bottom,l),u=Ti(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function fs(e){let{width:t,height:n}=qo(e);return{width:t,height:n}}function ps(e,t,n){let r=Tt(t),i=St(t),a=n===`fixed`,o=$o(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Oi(0);function l(){c.x=es(i)}if(r||!r&&!a)if((bt(t)!==`body`||Dt(i))&&(s=zt(t)),r){let e=$o(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?ts(i,s):Oi(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function ms(e){return Rt(e).position===`static`}function hs(e,t){if(!Tt(e)||Rt(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return St(e)===n&&(n=n.ownerDocument.body),n}function gs(e,t){let n=xt(e);if(kt(e))return n;if(!Tt(e)){let t=Bt(e);for(;t&&!Lt(t);){if(wt(t)&&!ms(t))return t;t=Bt(t)}return n}let r=hs(e,t);for(;r&&Ot(r)&&ms(r);)r=hs(r,t);return r&&Lt(r)&&ms(r)&&!Pt(r)?n:r||Ft(e)||n}var _s=async function(e){let t=this.getOffsetParent||gs,n=this.getDimensions,r=await n(e.floating);return{reference:ps(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vs(e){return Rt(e).direction===`rtl`}var ys={convertOffsetParentRelativeRectToViewportRelativeRect:ns,getDocumentElement:St,getClippingRect:ds,getOffsetParent:gs,getElementRects:_s,getClientRects:rs,getDimensions:fs,getScale:Yo,isElement:wt,isRTL:vs};function bs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xs(e,t){let n=null,r,i=St(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Di(d),h=Di(i.clientWidth-(u+f)),g=Di(i.clientHeight-(d+p)),_=Di(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ti(0,wi(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!bs(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ss(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=Jo(e),u=i||a?[...l?Ht(l):[],...t?Ht(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?xs(l,n):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?$o(e):null;c&&g();function g(){let t=$o(e);h&&!bs(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 Cs=Uo,ws=Wo,Ts=Lo,Es=Ko,Ds=Bo,Os=Go,ks=(e,t,n)=>{let r=new Map,i={platform:ys,...n},a={...i.platform,_c:r};return Io(e,t,{...i,platform:a})},As=typeof document<`u`?z.useLayoutEffect:function(){};function js(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!js(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!js(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ms(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ns(e,t){let n=Ms(e);return Math.round(t*n)/n}function Ps(e){let t=z.useRef(e);return As(()=>{t.current=e}),t}function Fs(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);js(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),T=c!=null,E=Ps(c),D=Ps(i),O=Ps(l),k=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),ks(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!js(w.current,t)&&(w.current=t,He.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);As(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=z.useRef(!1);As(()=>(A.current=!0,()=>{A.current=!1}),[]),As(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=z.useMemo(()=>({reference:b,floating:x}),[b,x]),ee=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Ns(M.floating,u.x),r=Ns(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ms(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:ee}),[u,k,j,M,ee])}var Is=(e,t)=>{let n=Cs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ls=(e,t)=>{let n=ws(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rs=(e,t)=>({fn:Os(e).fn,options:[e,t]}),zs=(e,t)=>{let n=Ts(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bs=(e,t)=>{let n=Es(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vs=(e,t)=>{let n=Ds(e);return{name:n.name,fn:n.fn,options:[e,t]}},W=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(hn(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},Hs=i((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Us=i(((e,t)=>{t.exports=Hs()})),Ws=i((e=>{var t=f(),n=Us();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Gs=i(((e,t)=>{t.exports=Ws()})),Ks=[],qs=void 0;function Js(){return qs}function Ys(e){Ks.push(e)}function Xs(e){let t=(t,n)=>{let r=Gt(Qs).current,i;try{qs=r;for(let e of Ks)e.before(r);i=e(t,n);for(let e of Ks)e.after(r);r.didInitialize=!0}finally{qs=void 0}return i};return t.displayName=e.displayName||e.name,t}function Zs(e){return z.forwardRef(Xs(e))}function Qs(){return{didInitialize:!1}}var $s=Us(),ec=Gs(),tc=kn(19)?ic:ac;function nc(e,t,n,r,i){return tc(e,t,n,r,i)}function rc(e,t,n,r,i){let a=z.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,$s.useSyncExternalStore)(e.subscribe,a,a)}Ys({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,$s.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function ic(e,t,n,r,i){let a=Js();if(!a)return rc(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function ac(e,t,n,r,i){return(0,ec.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var oc=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return nc(this,e,t,n,r)}},sc=class extends oc{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){z.useDebugValue(e),V(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;V(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;V(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){z.useDebugValue(e);let n=t!==void 0;V(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return z.useDebugValue(e),nc(this,this.selectors[e],t,n,r)}useContextCallback(e,t){z.useDebugValue(e);let n=B(t??Pn);this.context[e]=n}useStateSetter(e){let t=z.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},cc={open:W(e=>e.open),transitionStatus:W(e=>e.transitionStatus),domReferenceElement:W(e=>e.domReferenceElement),referenceElement:W(e=>e.positionReference??e.referenceElement),floatingElement:W(e=>e.floatingElement),floatingId:W(e=>e.floatingId)},lc=class extends sc{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:io(),nested:n,triggerElements:i},cc),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&wr(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{if(this.syncOnly){this.context.onOpenChange?.(e,t);return}this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function uc(e,t=!1,n=!1){let[r,i]=z.useState(e&&t?`idle`:void 0),[a,o]=z.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),V(()=>{if(!e&&a&&r!==`ending`&&n){let e=$r.request(()=>{i(`ending`)});return()=>{$r.cancel(e)}}},[e,a,r,n]),V(()=>{if(!e||t)return;let n=$r.request(()=>{i(void 0)});return()=>{$r.cancel(n)}},[t,e]),V(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=$r.request(()=>{i(`idle`)});return()=>{$r.cancel(n)}},[t,e,a,r]),{mounted:a,setMounted:o,transitionStatus:r}}var dc=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),fc={[dc.startingStyle]:``},pc={[dc.endingStyle]:``},mc={transitionStatus(e){return e===`starting`?fc:e===`ending`?pc:null}};function hc(e,t=!1,n=!0){let r=ei();return B((i,a=null)=>{r.cancel();let o=mo(e);if(o==null)return;let s=o,c=()=>{He.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()}).catch(()=>{if(n){a?.aborted||c();return}let e=s.getAnimations();!a?.aborted&&e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&l()})}if(t){let e=dc.startingStyle;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0});return}r.request(l)})}function gc(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=B(i),o=hc(r,n,!1);z.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function _c(e,t){let n=z.useRef(null),r=z.useRef(null);return z.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function vc(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=_c(e,n),o=B(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return V(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function yc(e){let t=e.useState(`open`);V(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function bc(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=uc(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=B(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return gc({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var xc=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function Sc(){return new lc({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new xc,floatingId:``,syncOnly:!1,nested:!1,onOpenChange:void 0})}function Cc(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Sc(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:In,inactiveTriggerProps:In,popupProps:In}}var wc=W(e=>e.triggerIdProp??e.activeTriggerId),Tc={open:W(e=>e.openProp??e.open),mounted:W(e=>e.mounted),transitionStatus:W(e=>e.transitionStatus),floatingRootContext:W(e=>e.floatingRootContext),preventUnmountingOnClose:W(e=>e.preventUnmountingOnClose),payload:W(e=>e.payload),activeTriggerId:wc,activeTriggerElement:W(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:W((e,t)=>t!==void 0&&wc(e)===t),isOpenedByTrigger:W((e,t)=>t!==void 0&&wc(e)===t&&e.open),isMountedByTrigger:W((e,t)=>t!==void 0&&wc(e)===t&&e.mounted),triggerProps:W((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:W(e=>e.popupProps),popupElement:W(e=>e.popupElement),positionerElement:W(e=>e.positionerElement)};function Ec(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Qa(),a=co()!=null,o=Gt(()=>new lc({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new xc,floatingId:i,syncOnly:!1,nested:a})).current;return V(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=wt(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function Dc(e={}){let{nodeId:t,externalTree:n}=e,r=Ec(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=z.useState(null),c=z.useRef(null),l=lo(n);V(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=Fs({...e,elements:{...a,...o&&{reference:o}}}),d=z.useCallback(e=>{let t=wt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=z.useState(void 0),[m,h]=z.useState(null);i.useSyncedValue(`referenceElement`,f??null);let g=wt(f)?f:null;i.useSyncedValue(`domReferenceElement`,f===void 0?a.domReference:g),i.useSyncedValue(`floatingElement`,m);let _=z.useCallback(e=>{(wt(e)||e===null)&&(c.current=e,p(e)),(wt(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!wt(e))&&u.refs.setReference(e)},[u.refs,p]),v=z.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),y=z.useMemo(()=>({...u.refs,setReference:_,setFloating:v,setPositionReference:d,domReference:c}),[u.refs,_,v,d]),b=z.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),x=i.useState(`open`),S=i.useState(`floatingId`),C=z.useMemo(()=>({...u,dataRef:i.context.dataRef,open:x,onOpenChange:i.setOpen,events:i.context.events,floatingId:S,refs:y,elements:b,nodeId:t,rootStore:i}),[u,y,b,t,i,x,S]);return V(()=>{i.context.dataRef.current.floatingContext=C;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=C)}),z.useMemo(()=>({...u,context:C,refs:y,elements:b,rootStore:i}),[u,y,b,C,i])}function Oc(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,i=Qa(),a=co()!=null,o=t.useState(`open`),s=t.useState(`activeTriggerElement`),c=t.useState(n?`popupElement`:`positionerElement`),l=t.context.triggerElements,u=Gt(()=>new lc({open:o,transitionStatus:void 0,referenceElement:s,floatingElement:c,triggerElements:l,onOpenChange:r,floatingId:i,syncOnly:!0,nested:a})).current;return V(()=>{let e={open:o,floatingId:i,referenceElement:s,floatingElement:c};wt(s)&&(e.domReferenceElement=s),u.state.positionReference===u.state.referenceElement&&(e.positionReference=s),u.update(e)},[o,i,s,c,u]),u.context.onOpenChange=r,u.context.nested=a,u}var kc=mr&&fr;function Ac(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,delay:o}=t,s=z.useRef(!1),c=z.useRef(null),l=ar(),u=z.useRef(!0);z.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=xt(e);function r(){let e=n.select(`domReferenceElement`);!n.select(`open`)&&Tt(e)&&e===fi(ti(e))&&(s.current=!0)}function i(){u.current=!0}function o(){u.current=!1}return Jr(qr(t,`blur`,r),kc&&qr(t,`keydown`,i,!0),kc&&qr(t,`pointerdown`,o,!0))},[n,a]),z.useEffect(()=>{if(!a)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=n.select(`domReferenceElement`);wt(e)&&(c.current=e,s.current=!0)}}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a,n]);let d=z.useMemo(()=>({onMouseLeave(){s.current=!1,c.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(c.current===t)return;s.current=!1,c.current=null}let r=mi(e.nativeEvent);if(wt(r)){if(kc&&!e.relatedTarget){if(!u.current&&!vi(r))return}else if(!xi(r))return}let i=hi(e.relatedTarget,n.context.triggerElements),{nativeEvent:a,currentTarget:d}=e,f=typeof o==`function`?o():o;if(n.select(`open`)&&i||f===0||f===void 0){n.setOpen(!0,Ur(Mr,a,d));return}l.start(f,()=>{s.current||n.setOpen(!0,Ur(Mr,a,d))})},onBlur(e){s.current=!1,c.current=null;let t=e.relatedTarget,r=e.nativeEvent,a=wt(t)&&t.hasAttribute(Pa(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let e=n.select(`domReferenceElement`),o=fi(ti(e));!t&&o===e||pi(i.current.floatingContext?.refs.floating.current,o)||pi(e,o)||a||hi(t??o,n.context.triggerElements)||n.setOpen(!1,Ur(Mr,r))})}}),[i,n,l,o]);return z.useMemo(()=>a?{reference:d,trigger:d}:{},[a,d])}var jc=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new ir,this.restTimeout=new ir,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Mc=new WeakMap;function Nc(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Mc.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Mc.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Pc(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Mc.get(n);a&&a!==e&&Nc(a),Nc(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Mc.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Fc(e){let t=Gt(jc.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||=t,nr(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function Ic(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0,nodeId:l}=t,u=Fc(n),d=lo(),f=co(),p=B(()=>Or(o.current.openEvent?.type,u.interactedInside)),m=B(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),h=B(e=>hi(e,n.context.triggerElements)),g=z.useCallback(e=>{let t=Er(c,`close`,u.pointerType),r=()=>{n.setOpen(!1,Ur(jr,e)),d?.events.emit(`floating.closed`,e)};t?u.openChangeTimeout.start(t,r):(u.openChangeTimeout.clear(),r())},[c,n,u,d]),_=B(()=>{Nc(u)}),v=B(e=>{let t=mi(e);if(!yi(t)){u.interactedInside=!1;return}u.interactedInside=t?.closest(`[aria-haspopup]`)!=null});V(()=>{r||(u.pointerType=void 0,u.restTimeoutPending=!1,u.interactedInside=!1,_())},[r,u,_]),z.useEffect(()=>_,[_]),V(()=>{if(s&&r&&u.handleCloseOptions?.blockPointerEvents&&m()&&wt(a)&&i){let e=a,t=i,n=ti(i),r=d?.nodesRef.current.find(e=>e.id===f)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),Pc(u,{scopeElement:u.handleCloseOptions?.getScope?.()??u.pointerEventsScopeElement??r??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{_()}}},[s,r,a,i,u,m,d,f,_]);let y=ar();z.useEffect(()=>{if(!s)return;function e(){u.openChangeTimeout.clear(),y.clear(),d?.events.off(`floating.closed`,r),_()}function t(e){if(d&&f&&Ma(d.nodesRef.current,f).length>0){d.events.on(`floating.closed`,r);return}if(h(e.relatedTarget))return;let t=o.current.floatingContext?.nodeId??l,n=e.relatedTarget;if(!(d&&t&&wt(n)&&Ma(d.nodesRef.current,t,!1).some(e=>pi(e.context?.elements.floating,n)))){if(u.handler){u.handler(e);return}_(),p()||g(e)}}function r(e){!d||!f||Ma(d.nodesRef.current,f).length>0||y.start(0,()=>{d.events.off(`floating.closed`,r),n.setOpen(!1,Ur(jr,e)),d.events.emit(`floating.closed`,e)})}let a=i;return Jr(a&&qr(a,`mouseenter`,e),a&&qr(a,`mouseleave`,t),a&&qr(a,`pointerdown`,v,!0),()=>{d?.events.off(`floating.closed`,r)})},[s,i,n,o,l,p,h,g,_,v,u,d,f,y])}var Lc={current:null};function Rc(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=Lc,externalTree:f,isActiveTrigger:p=!0,getHandleCloseContext:m,isClosing:h}=t,g=lo(f),_=Fc(n),v=z.useRef(!1),y=Yr(s),b=Yr(o),x=Yr(l),S=Yr(a),C=Yr(h);p&&(_.handleCloseOptions=y.current?.__options);let w=B(()=>Or(r.current.openEvent?.type,_.interactedInside)),T=B(e=>hi(e,n.context.triggerElements)),E=B((e,t,r)=>{let i=n.context.triggerElements;if(i.hasElement(t))return!e||!pi(e,t);if(!wt(r))return!1;let a=r;return i.hasMatchingElement(e=>pi(e,a))&&(!e||!pi(e,a))}),D=B((e,t=!0)=>{let r=Er(b.current,`close`,_.pointerType);r?_.openChangeTimeout.start(r,()=>{n.setOpen(!1,Ur(jr,e)),g?.events.emit(`floating.closed`,e)}):t&&(_.openChangeTimeout.clear(),n.setOpen(!1,Ur(jr,e)),g?.events.emit(`floating.closed`,e))}),O=B(()=>{_.handler&&=(ti(n.select(`domReferenceElement`)).removeEventListener(`mousemove`,_.handler),void 0)}),k=B(()=>{Nc(_)});return z.useEffect(()=>O,[O]),z.useEffect(()=>{if(!a)return;function e(e){e.open?v.current=!1:(v.current=e.reason===jr,O(),_.openChangeTimeout.clear(),_.restTimeout.clear(),_.blockMouseMove=!0,_.restTimeoutPending=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,_,O]),z.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!wt(e))return;function t(e){if(_.openChangeTimeout.clear(),_.blockMouseMove=!1,c&&!Cr(_.pointerType))return;let t=Dr(x.current),r=Er(b.current,`open`,_.pointerType),i=mi(e),a=e.currentTarget??null,o=n.select(`domReferenceElement`),s=a;if(wt(i)&&!n.context.triggerElements.hasElement(i)){for(let e of n.context.triggerElements.elements())if(pi(e,i)){s=e;break}}wt(a)&&wt(o)&&!n.context.triggerElements.hasElement(a)&&pi(a,o)&&(s=o);let l=s==null?!1:E(o,s,i),u=n.select(`open`),d=C.current?.()??n.select(`transitionStatus`)===`ending`,f=!u&&d&&v.current,p=!l&&wt(s)&&wt(o)&&pi(o,s)&&f,m=t>0&&!r,h=l&&(u||f)||p,g=!u||l;if(h){n.setOpen(!0,Ur(jr,e,s));return}m||(r?_.openChangeTimeout.start(r,()=>{g&&n.setOpen(!0,Ur(jr,e,s))}):g&&n.setOpen(!0,Ur(jr,e,s)))}function i(e){if(w()){k();return}O();let t=ti(n.select(`domReferenceElement`));_.restTimeout.clear(),_.restTimeoutPending=!1;let i=r.current.floatingContext??m?.();if(!T(e.relatedTarget)){if(y.current&&i){n.select(`open`)||_.openChangeTimeout.clear();let r=d.current;_.handler=y.current({...i,tree:g,x:e.clientX,y:e.clientY,onClose(){k(),O(),S.current&&!w()&&r===n.select(`domReferenceElement`)&&D(e,!0)}}),t.addEventListener(`mousemove`,_.handler),_.handler(e);return}(_.pointerType!==`touch`||!pi(n.select(`floatingElement`),e.relatedTarget))&&D(e)}}return u?Jr(qr(e,`mousemove`,t,{once:!0}),qr(e,`mouseenter`,t),qr(e,`mouseleave`,i)):Jr(qr(e,`mouseenter`,t),qr(e,`mouseleave`,i))},[O,k,r,b,D,n,a,y,_,p,E,w,T,c,u,x,d,g,S,m,C]),z.useMemo(()=>{if(!a)return;function e(e){_.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.select(`open`),o=E(i,r,e.target);if(c&&!Cr(_.pointerType))return;if(a&&o&&_.handleCloseOptions?.blockPointerEvents){let e=n.select(`floatingElement`);e&&Pc(_,{scopeElement:_.handleCloseOptions?.getScope?.()??r.ownerDocument.body,referenceElement:r,floatingElement:e})}let s=Dr(x.current);if(a&&!o||s===0||!o&&_.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;_.restTimeout.clear();function l(){if(_.restTimeoutPending=!1,w())return;let e=n.select(`open`);!_.blockMouseMove&&(!e||o)&&n.setOpen(!0,Ur(jr,t,r))}_.pointerType===`touch`?He.flushSync(()=>{l()}):o&&a?l():(_.restTimeoutPending=!0,_.restTimeout.start(s,l))}}},[a,_,w,E,c,n,x])}function zc(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=z.useCallback(t=>Bc(t,e,`reference`),t),o=z.useCallback(t=>Bc(t,e,`floating`),n),s=z.useCallback(t=>Bc(t,e,`item`),r),c=z.useCallback(t=>Bc(t,e,`trigger`),i);return z.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function Bc(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[oi]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&Vc(a,s,i,r)}return Vc(a,e,i,r),a}function Vc(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}function Hc(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var Uc=`Escape`;function Wc(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Gc(e,t){return Wc(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Kc(e,t,n){return Wc(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function qc(e,t,n){return Wc(t,n?e===ci:e===li,e===di)}function Jc(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Uc:Wc(t,n?e===li:e===ci,e===ui)}function Yc(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{listRef:s,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:p=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b=void 0,orientation:x=`vertical`,parentOrientation:S,cols:C=1,id:w,resetOnPointerLeave:T=!0,externalTree:E}=t,D=Yr(Si(i)),O=co(),k=lo(E);V(()=>{o.current.orientation=x},[o,x]);let A=bi(a),j=z.useRef(_),M=z.useRef(d??-1),ee=z.useRef(null),N=z.useRef(!0),P=B(e=>{l(M.current===-1?null:M.current,e)}),F=z.useRef(P),te=z.useRef(!!i),I=z.useRef(r),ne=z.useRef(!1),re=z.useRef(!1),ie=z.useRef(null),L=Yr(b),ae=Yr(r),R=Yr(d),oe=Yr(T),se=B(()=>{function e(e){g?k?.events.emit(`virtualfocus`,e):ie.current=Ia(e,{sync:ne.current,preventScroll:!0})}let t=s.current[M.current],n=re.current;t&&e(t),(ne.current?e=>e():requestAnimationFrame)(()=>{let r=s.current[M.current]||t;r&&(t||e(r),ue&&(n||!N.current)&&r.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});V(()=>{u&&(r&&i?(M.current=d??-1,j.current&&d!=null&&(re.current=!0,P())):te.current&&(M.current=-1,F.current()))},[u,r,i,d,P]),V(()=>{if(u){if(!r){ne.current=!1;return}if(i)if(c==null){if(ne.current=!1,R.current!=null)return;if(te.current&&(M.current=-1,se()),(!I.current||!te.current)&&j.current&&(ee.current!=null||j.current===!0&&ee.current==null)){let e=0,t=()=>{s.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e+=1):(M.current=ee.current==null||Kc(ee.current,x,h)||m?$i(s):ea(s),ee.current=null,P())};t()}}else Qi(s.current,c)||(M.current=c,se(),re.current=!1)}},[u,r,i,c,R,m,s,x,h,P,se,L]),V(()=>{if(!u||i||!k||g||!te.current)return;let e=k.nodesRef.current,t=e.find(e=>e.id===O)?.context?.elements.floating,n=fi(ti(i)),r=e.some(e=>e.context&&pi(e.context.elements.floating,n));t&&!r&&N.current&&t.focus({preventScroll:!0})},[u,i,k,O,g]),V(()=>{F.current=P,I.current=r,te.current=!!i}),V(()=>{r||(ee.current=null,j.current=_)},[r,_]);let ce=c!=null,le=B(e=>{if(!ae.current)return;let t=s.current.indexOf(e.currentTarget);t!==-1&&(M.current!==t||c!==t)&&(M.current=t,P(e))}),ue=z.useMemo(()=>({onFocus(e){ne.current=!0,le(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){ne.current=!0,re.current=!1,v&&le(e)},onPointerLeave(e){if(!ae.current||!N.current||e.pointerType===`touch`)return;ne.current=!0;let t=e.relatedTarget;if(!Hc(e)&&!(!v||s.current.includes(t))&&oe.current&&(ie.current?.(),ie.current=null,M.current=-1,P(e),!g)){let e=D.current,t=fi(ti(e));e&&pi(e,t)&&e.focus({preventScroll:!0})}}}),[le,ae,D,v,s,P,oe,g]),de=z.useCallback(()=>S??k?.nodesRef.current.find(e=>e.id===O)?.context?.dataRef?.current.orientation,[O,k,S]),fe=B(e=>{if(N.current=!1,ne.current=!0,e.which===229||!ae.current&&e.currentTarget===D.current)return;if(m&&Jc(e.key,x,h,C)){Gc(e.key,de())||yr(e),n.setOpen(!1,Ur(Rr,e.nativeEvent)),Tt(a)&&(g?k?.events.emit(`virtualfocus`,a):a.focus());return}let t=M.current,i=$i(s,b),o=ea(s,b);if(A||(e.key===`Home`&&(yr(e),M.current=i,P(e)),e.key===`End`&&(yr(e),M.current=o,P(e))),C>1){let t=Array.from({length:s.current.length},()=>({width:1,height:1})),n=ra(t,C,!1),r=n.findIndex(e=>e!=null&&!oa(s.current,e,b)),a=n.reduce((e,t,n)=>t!=null&&!oa(s.current,t,b)?n:e,-1),c=n[na(n.map(e=>e==null?null:s.current[e]),{event:e,orientation:x,loopFocus:p,rtl:h,cols:C,disabledIndices:aa([...(typeof b==`function`?null:b)||s.current.map((e,t)=>oa(s.current,t,b)?t:void 0),void 0],n),minIndex:r,maxIndex:a,prevIndex:ia(M.current>o?i:M.current,t,n,C,e.key===`ArrowDown`?`bl`:e.key===(h?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(M.current=c,P(e)),x===`both`)return}if(Gc(e.key,x)){if(yr(e),r&&!g&&fi(e.currentTarget.ownerDocument)===e.currentTarget){M.current=Kc(e.key,x,h)?i:o,P(e);return}Kc(e.key,x,h)?p?t>=o?f&&t!==s.current.length?M.current=-1:(ne.current=!1,M.current=i):M.current=ta(s.current,{startingIndex:t,disabledIndices:b}):M.current=Math.min(o,ta(s.current,{startingIndex:t,disabledIndices:b})):p?t<=i?f&&t!==-1?M.current=s.current.length:(ne.current=!1,M.current=o):M.current=ta(s.current,{startingIndex:t,decrement:!0,disabledIndices:b}):M.current=Math.max(i,ta(s.current,{startingIndex:t,decrement:!0,disabledIndices:b})),Qi(s.current,M.current)&&(M.current=-1),P(e)}}),pe=z.useMemo(()=>g&&r&&ce&&{"aria-activedescendant":`${w}-${c}`},[g,r,ce,w,c]),me=z.useMemo(()=>({"aria-orientation":x===`both`?void 0:x,...A?{}:pe,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&r&&!g){let t=mi(e.nativeEvent);if(t&&!pi(D.current,t))return;yr(e),n.setOpen(!1,Ur(Ir,e.nativeEvent)),Tt(a)&&a.focus();return}fe(e)},onPointerMove(){N.current=!0}}),[pe,fe,D,x,A,n,r,g,a]),he=z.useMemo(()=>{function e(e){_===`auto`&&xr(e.nativeEvent)&&(j.current=!g)}function t(e){j.current=_,_===`auto`&&Sr(e.nativeEvent)&&(j.current=!0)}return{onKeyDown(e){let t=n.select(`open`);N.current=!1;let r=e.key.startsWith(`Arrow`),i=qc(e.key,de(),h),a=Gc(e.key,x),o=(m?i:a)||e.key===`Enter`||e.key.trim()===``;if(g&&t)return fe(e);if(!(!t&&!y&&r)){if(o){let t=Gc(e.key,de());ee.current=m&&t?null:e.key}if(m){i&&(yr(e),t?(M.current=$i(s,L.current),P(e)):n.setOpen(!0,Ur(Rr,e.nativeEvent,e.currentTarget)));return}a&&(R.current!=null&&(M.current=R.current),yr(e),!t&&y?n.setOpen(!0,Ur(Rr,e.nativeEvent,e.currentTarget)):fe(e),t&&P(e))}},onFocus(e){n.select(`open`)&&!g&&(M.current=-1,P(e))},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[fe,L,_,s,m,P,n,y,x,de,h,R,g]),ge=z.useMemo(()=>({...pe,...he}),[pe,he]);return z.useMemo(()=>u?{reference:ge,floating:me,item:ue,trigger:he}:{},[u,ge,me,he,ue])}var Xc=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Zc(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=Qa(),l=a?.id||c,u=z.useMemo(()=>Si(o)?.id||i,[o,i]),d=Xc.get(s)??s,f=co()!=null,p=z.useMemo(()=>d===`tooltip`||s===`label`?In:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&f&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,f,s]),m=z.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...p,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,p]),h=z.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),g=z.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[u,s]);return z.useMemo(()=>({reference:m,floating:h,item:g,trigger:p}),[m,h,p,g])}function Qc(e,t){let n=`rootStore`in e?e.rootStore:e,r=n.context.dataRef,i=n.useState(`open`),{listRef:a,elementsRef:o,activeIndex:s,onMatch:c,onTypingChange:l,enabled:u=!0,resetMs:d=750,selectedIndex:f=null}=t,p=ar(),m=z.useRef(``),h=z.useRef(f??s??-1),g=z.useRef(null);V(()=>{!i&&f!==null||(p.clear(),g.current=null,m.current!==``&&(m.current=``))},[i,f,p]),V(()=>{i&&m.current===``&&(h.current=f??s??-1)},[i,f,s]);let _=B(e=>{e?r.current.typing||(r.current.typing=e,l?.(e)):r.current.typing&&(r.current.typing=e,l?.(e))}),v=B(e=>{function t(e){let t=o?.current[e];return!t||sa(t)}function n(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let r=a.current;if(m.current.length>0&&e.key===` `&&(yr(e),_(!0)),m.current.length>0&&m.current[0]!==` `&&n(r,m.current)===-1&&e.key!==` `&&_(!1),r==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;i&&e.key!==` `&&(yr(e),_(!0));let l=m.current===``;l&&(h.current=f??s??-1),r.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(d,()=>{m.current=``,h.current=g.current,_(!1)});let u=((l?f??s??-1:h.current)??0)+1,v=n(r,m.current,u);v===-1?e.key!==` `&&(m.current=``,_(!1)):(c?.(v),g.current=v)}),y=B(e=>{let t=e.relatedTarget,r=n.select(`domReferenceElement`),i=n.select(`floatingElement`),a=pi(r,t),o=pi(i,t);a||o||(p.clear(),m.current=``,h.current=g.current,_(!1))}),b=z.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]),x=z.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return z.useMemo(()=>u?{reference:b,floating:x}:{},[u,b,x])}var $c=.1,el=$c*$c,tl=.5;function nl(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function rl(e,t,n,r,i,a,o,s,c,l){let u=!1;return nl(e,t,n,r,i,a)&&(u=!u),nl(e,t,i,a,o,s)&&(u=!u),nl(e,t,o,s,c,l)&&(u=!u),nl(e,t,c,l,n,r)&&(u=!u),u}function il(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function al(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function ol(e={}){let{blockPointerEvents:t=!1}=e,n=new ir,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*el;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=mi(r),g=r.type===`mouseleave`,_=pi(u,h),v=pi(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&wt(r.relatedTarget)&&pi(u,r.relatedTarget))return;function y(){return!!(s&&Ma(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=al(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=al(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=al(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=al(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!il(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?tl/2:tl*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+tl+1,o=C||T?S.bottom-tl:S.top,s=C?T?S.bottom-tl:S.top:S.bottom-tl;M=rl(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?tl/2:tl*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-tl,o=C||T?S.top+tl:S.bottom,s=C?T?S.top+tl:S.bottom:S.top+tl;M=rl(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?tl/2:tl*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+tl+1,o=w||E?S.right-tl:S.left,s=w?E?S.right-tl:S.left:S.right-tl;M=rl(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?tl/2:tl*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-tl,o=w||E?S.left+tl:S.right,s=w?E?S.left+tl:S.right:S.left+tl;M=rl(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var sl=z.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{portalNode:c,portalSubtree:l}=no({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,U.jsxs)(z.Fragment,{children:[l,c&&He.createPortal(n,c)]})}),cl=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=dc.startingStyle]=`startingStyle`,e[e.endingStyle=dc.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),ll=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),ul={[ll.popupOpen]:``},dl={[ll.popupOpen]:``,[ll.pressed]:``},fl={[cl.open]:``},pl={[cl.closed]:``},ml={[cl.anchorHidden]:``},hl={open(e){return e?ul:null}},gl={open(e){return e?dl:null}},_l={open(e){return e?fl:pl},anchorHidden(e){return e?ml:null}};function vl(e){return Qa(e,`base-ui`)}var yl=z.createContext(void 0);function bl(){return z.useContext(yl)?.direction??`ltr`}var xl=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,offsetParent:d=`real`}=ji(e,t)||{};if(l==null)return{};let f=Yi(u),p={x:n,y:r},m=Li(i),h=Fi(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Ai(k,j,A),ee=!c.arrow&&Ni(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,N=ee?j<k?j-k:j-A:0;return{[m]:p[m]+N,data:{[m]:M,centerOffset:j-M-N,...ee&&{alignmentOffset:N}},reset:ee}}}),Sl=(e,t)=>({...xl(e),options:[e,t]}),Cl={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await Vs().fn(e)).data?.referenceHidden||a}}}},wl={sideX:`left`,sideY:`top`},Tl={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=xt(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:wl};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=ti(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=Mi(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:wl.sideX,g=f===`top`?`bottom`:wl.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function El(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Dl(e,t,n){let{rects:r,placement:i}=e;return{side:El(t,Mi(i),n),align:Ni(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Ol(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=z.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=B(E),O=E?D:t,k=Yr(t),A=Yr(m),j=bl()===`rtl`,M=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":j?`left`:`right`,"inline-start":j?`right`:`left`}[r],ee=a===`center`?M:`${M}-${a}`,N=c,P=+(r===`bottom`),F=+(r===`top`),te=+(r===`right`),I=+(r===`left`);typeof N==`number`?N={top:N+P,right:N+I,bottom:N+F,left:N+te}:N&&={top:(N.top||0)+P,right:(N.right||0)+I,bottom:(N.bottom||0)+F,left:(N.left||0)+te};let ne={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:N},re=z.useRef(null),ie=Yr(i),L=Yr(o),ae=[Is(e=>{let t=Dl(e,r,j),n=typeof ie.current==`function`?ie.current(t):ie.current,i=typeof L.current==`function`?L.current(t):L.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,j,r])],R=w===`none`&&C!==`shift`,oe=!R&&(l||g||C===`shift`),se=C===`none`?null:zs({...ne,padding:{top:N.top+1,right:N.right+1,bottom:N.bottom+1,left:N.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`?`alignment`:!1,fallbackAxisSideDirection:T}),ce=R?null:Ls(e=>{let t=ti(e.elements.floating).documentElement;return{...ne,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:oe,limiter:l||g?void 0:Rs(e=>{if(!re.current)return{};let{width:t,height:n}=re.current.getBoundingClientRect(),r=Ii(Mi(e.placement)),i=r===`y`?t:n,a=r===`y`?N.left+N.right:N.top+N.bottom;return{offset:i/2+a/2}})}},[ne,l,g,N,w]);C===`shift`||w===`shift`||a===`center`?ae.push(ce,se):ae.push(se,ce),ae.push(Bs({...ne,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!A.current)return;let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=xt(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),Sl(()=>({element:re.current||ti(re.current).createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=Mi(a),l=Ii(c),u=re.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(Dl(e,r,j)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,oe&&l===`y`&&b?S:x),{}}},Cl,v),V(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,p]);let le=z.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:ue,elements:de,x:fe,y:pe,middlewareData:me,update:he,placement:ge,context:_e,isPositioned:ve,floatingStyles:ye}=Dc({rootContext:p,open:f?m:void 0,placement:ee,middleware:ae,strategy:n,whileElementsMounted:f?void 0:(...e)=>Ss(...e,le),nodeId:_,externalTree:b}),{sideX:be,sideY:xe}=me.adaptiveOrigin||wl,Se=ve?n:`fixed`,Ce=z.useMemo(()=>{let e=v?{position:Se,[be]:fe,[xe]:pe}:{position:Se,...ye};return ve||(e.opacity=0),e},[v,Se,be,fe,xe,pe,ye,ve]),we=z.useRef(null);V(()=>{if(!m)return;let e=k.current,t=typeof e==`function`?e():e,n=(kl(t)?t.current:t)||null;n!==we.current&&(ue.setPositionReference(n),we.current=n)},[m,ue,O,k]),z.useEffect(()=>{if(!m)return;let e=k.current;typeof e!=`function`&&kl(e)&&e.current!==we.current&&(ue.setPositionReference(e.current),we.current=e.current)},[m,ue,O,k]),z.useEffect(()=>{if(f&&m&&de.domReference&&de.floating)return Ss(de.domReference,de.floating,he,le)},[f,m,de,he,le]);let Te=Mi(ge),Ee=El(r,Te,j),De=Ni(ge)||`center`,Oe=!!me.hide?.referenceHidden;V(()=>{y&&m&&ve&&S(Te)},[y,m,ve,Te]);let ke=z.useMemo(()=>({position:`absolute`,top:me.arrow?.y,left:me.arrow?.x}),[me.arrow]),Ae=me.arrow?.centerOffset!==0;return z.useMemo(()=>({positionerStyles:Ce,arrowStyles:ke,arrowRef:re,arrowUncentered:Ae,side:Ee,align:De,physicalSide:Te,anchorHidden:Oe,refs:ue,context:_e,isPositioned:ve,update:he}),[Ce,ke,re,Ae,Ee,De,Te,Oe,ue,_e,ve,he])}function kl(e){return e!=null&&`current`in e}function Al(e){return e===`starting`?Ln:In}function jl(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Hn(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Al(r),i],stateAttributesMapping:_l})}function Ml(e){return kn(19)?e:e?`true`:void 0}var Nl=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Pl=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Fl=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Il=e=>{let t=Fl(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ll={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Rl=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},zl=(0,z.createContext)({}),Bl=()=>(0,z.useContext)(zl),Vl=(0,z.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=Bl()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,z.createElement)(`svg`,{ref:c,...Ll,width:t??l??Ll.width,height:t??l??Ll.height,stroke:e??f,strokeWidth:m,className:Nl(`lucide`,p,i),...!a&&!Rl(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,z.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),G=(e,t)=>{let n=(0,z.forwardRef)(({className:n,...r},i)=>(0,z.createElement)(Vl,{ref:i,iconNode:t,className:Nl(`lucide-${Pl(Il(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Il(e),n},Hl=G(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Ul=G(`book`,[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}]]),Wl=G(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Gl=G(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Kl=G(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),ql=G(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Jl=G(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Yl=G(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Xl=G(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Zl=G(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Ql=G(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),$l=G(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),eu=G(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),tu=G(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),nu=G(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ru=G(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),iu=G(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),au=G(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),ou=G(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),su=G(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),cu=G(`music-2`,[[`circle`,{cx:`8`,cy:`18`,r:`4`,key:`1fc0mg`}],[`path`,{d:`M12 18V2l7 4`,key:`g04rme`}]]),lu=G(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),uu=G(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),du=G(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),fu=G(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),pu=G(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),mu=G(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),hu=G(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),gu=G(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),_u=G(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),vu=G(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),yu=G(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),bu=G(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),xu={audio:cu,document:eu,image:nu,source:tu,unknown:lu,video:vu},Su=e=>{if(e.type===`source-document`)return`source`;let t=e.mediaType??``;return t.startsWith(`image/`)?`image`:t.startsWith(`video/`)?`video`:t.startsWith(`audio/`)?`audio`:t.startsWith(`application/`)||t.startsWith(`text/`)?`document`:`unknown`},Cu=(e,t,n)=>n?(0,U.jsx)(`img`,{alt:t||`Image`,className:`size-full object-cover`,height:96,src:e,width:96}):(0,U.jsx)(`img`,{alt:t||`Image`,className:`size-full rounded object-cover`,height:20,src:e,width:20}),wu=(0,z.createContext)(null),Tu=(0,z.createContext)(null),Eu=()=>(0,z.useContext)(wu)??{variant:`grid`},Du=()=>{let e=(0,z.useContext)(Tu);if(!e)throw Error(`Attachment components must be used within <Attachment>`);return e},Ou=({variant:e=`grid`,className:t,children:n,...r})=>{let i=(0,z.useMemo)(()=>({variant:e}),[e]);return(0,U.jsx)(wu.Provider,{value:i,children:(0,U.jsx)(`div`,{className:H(`flex items-start`,e===`list`?`flex-col gap-2`:`flex-wrap gap-2`,e===`grid`&&`ml-auto w-fit`,t),...r,children:n})})},ku=({data:e,onRemove:t,className:n,children:r,...i})=>{let{variant:a}=Eu(),o=Su(e),s=(0,z.useMemo)(()=>({data:e,mediaCategory:o,onRemove:t,variant:a}),[e,o,t,a]);return(0,U.jsx)(Tu.Provider,{value:s,children:(0,U.jsx)(`div`,{className:H(`group relative`,a===`grid`&&`size-24 overflow-hidden rounded-lg`,a===`inline`&&[`flex h-8 cursor-pointer select-none items-center gap-1.5`,`rounded-md border border-border px-1.5`,`font-medium text-sm transition-all`,`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`],a===`list`&&[`flex w-full items-center gap-3 rounded-lg border p-3`,`hover:bg-accent/50`],n),...i,children:r})})},Au=({fallbackIcon:e,className:t,...n})=>{let{data:r,mediaCategory:i,variant:a}=Du(),o=a===`inline`?`size-3`:`size-4`,s=e=>(0,U.jsx)(e,{className:H(o,`text-muted-foreground`)}),c=()=>{if(i===`image`&&r.type===`file`&&r.url)return Cu(r.url,r.filename,a===`grid`);if(i===`video`&&r.type===`file`&&r.url)return(0,U.jsx)(`video`,{className:`size-full object-cover`,muted:!0,src:r.url});let t=xu[i];return e??s(t)};return(0,U.jsx)(`div`,{className:H(`flex shrink-0 items-center justify-center overflow-hidden`,a===`grid`&&`size-full bg-muted`,a===`inline`&&`size-5 rounded bg-background`,a===`list`&&`size-12 rounded bg-muted`,t),...n,children:c()})},ju=({label:e=`Remove`,className:t,children:n,...r})=>{let{onRemove:i,variant:a}=Du(),o=(0,z.useCallback)(e=>{e.stopPropagation(),i?.()},[i]);return i?(0,U.jsxs)($n,{"aria-label":e,className:H(a===`grid`&&[`absolute top-2 right-2 size-6 rounded-full p-0`,`bg-background/80 backdrop-blur-sm`,`opacity-0 transition-opacity group-hover:opacity-100`,`hover:bg-background`,`[&>svg]:size-3`],a===`inline`&&[`size-5 rounded p-0`,`opacity-0 transition-opacity group-hover:opacity-100`,`[&>svg]:size-2.5`],a===`list`&&[`size-8 shrink-0 rounded p-0`,`[&>svg]:size-4`],t),onClick:o,type:`button`,variant:`ghost`,...r,children:[n??(0,U.jsx)(bu,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:e})]}):null},Mu={damping:.7,stiffness:.05,mass:1.25},Nu=70,Pu=1e3/60,Fu=350,Iu=!1;globalThis.document?.addEventListener(`mousedown`,()=>{Iu=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{Iu=!1}),globalThis.document?.addEventListener(`click`,()=>{Iu=!1});var Lu=(e={})=>{let[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)(e.initial!==!1),[a,o]=(0,z.useState)(!1),s=(0,z.useRef)(null);s.current=e;let c=(0,z.useCallback)(()=>{if(!Iu)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,z.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,z.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,z.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){g.current&&(g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop)},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Nu}}},[]),f=(0,z.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=Bu(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/Pu;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Bu(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,z.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,z.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,z.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=Ru(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=Ru(e=>{if(d.resizeObserver?.disconnect(),!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=Bu(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:Fu})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function Ru(e,t){let n=(0,z.useCallback)(t=>(n.current=t,e(t)),t);return n}var zu=new Map;function Bu(...e){let t={...Mu},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return zu.has(r)||zu.set(r,Object.freeze(t)),n?`instant`:zu.get(r)}var Vu=(0,z.createContext)(null),Hu=typeof window<`u`?z.useLayoutEffect:z.useEffect;function Uu({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,z.useRef)(null),d=Lu({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:z.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,z.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,z.useImperativeHandle)(c,()=>y,[y]),Hu(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),z.createElement(Vu.Provider,{value:y},z.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=Wu();return z.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},z.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(Uu||={});function Wu(){let e=(0,z.useContext)(Vu);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var Gu=({className:e,...t})=>(0,U.jsx)(Uu,{className:H(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),Ku=({className:e,...t})=>(0,U.jsx)(Uu.Content,{className:H(`flex flex-col gap-8 p-4`,e),...t}),qu=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=Wu(),i=(0,z.useCallback)(()=>{r()},[r]);return!n&&(0,U.jsx)($n,{className:H(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,U.jsx)(Hl,{className:`size-4`})})};function Ju(e){return Hn(e.defaultTagName??`div`,e,e)}var Yu=z.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return Hn(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function Xu({className:e,orientation:t=`horizontal`,...n}){return(0,U.jsx)(Yu,{"data-slot":`separator`,orientation:t,className:H(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,e),...n})}var Zu=z.createContext(void 0);function Qu(e){let t=z.useContext(Zu);if(t===void 0&&!e)throw Error(hn(72));return t}var $u={...Tc,disabled:W(e=>e.disabled),instantType:W(e=>e.instantType),isInstantPhase:W(e=>e.isInstantPhase),trackCursorAxis:W(e=>e.trackCursorAxis),disableHoverablePopup:W(e=>e.disableHoverablePopup),lastOpenChangeReason:W(e=>e.openChangeReason),closeOnClick:W(e=>e.closeOnClick),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport)},ed=class e extends sc{constructor(e){super({...td(),...e},{popupRef:z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new xc},$u)}setOpen=(e,t)=>{let n=t.reason,r=n===jr,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?He.flushSync(o):o()};static useStore(t,n){let r=Gt(()=>new e(n)).current,i=t??r,a=Oc({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=a,i}};function td(){return{...Cc(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}var nd=Xs(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=ed.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});er(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),V(()=>{m&&t&&p.setOpen(!1,Ur(Vr))},[m,t,p]),p.useSyncedValue(`disabled`,t),yc(p);let{forceUnmount:v,transitionStatus:y}=bc(h,p),b=p.select(`floatingRootContext`),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=z.useRef(null);V(()=>{y===`ending`&&C===`none`||y!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[y,x,C,S,p]),V(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let T=z.useCallback(()=>{p.setOpen(!1,rd(p,Hr))},[p]);z.useImperativeHandle(o,()=>({unmount:v,close:T}),[v,T]);let{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=zc([Mo(b,{enabled:!t,referencePress:()=>p.select(`closeOnClick`)}),Oo(b,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),k=z.useMemo(()=>E(),[E]),A=z.useMemo(()=>O(),[O]),j=z.useMemo(()=>D(),[D]);return p.useSyncedValues({activeTriggerProps:k,inactiveTriggerProps:A,popupProps:j}),(0,U.jsx)(Zu.Provider,{value:p,children:typeof f==`function`?f({payload:_}):f})});function rd(e,t){let n=Ur(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var id=z.createContext(void 0);function ad(){return z.useContext(id)}var od=function(e){return e[e.popupOpen=ll.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({}),sd=Zs(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeOnClick:c=!0,closeDelay:l,id:u,style:d,...f}=e,p=Qu(!0),m=i?.store??p;if(!m)throw Error(hn(82));let h=vl(u),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=z.useRef(null),b=s??600,x=l??0,{registerTrigger:S,isMountedByThisTrigger:C}=vc(h,y,m,{payload:a,closeOnClick:c,closeDelay:x}),w=ad(),{delayRef:T,isInstantPhase:E,hasProvider:D}=Kr(v,{open:_});m.useSyncedValue(`isInstantPhase`,E);let O=m.useState(`disabled`),k=o??O,A=m.useState(`trackCursorAxis`),j=m.useState(`disableHoverablePopup`),M=Rc(v,{enabled:!k,mouseOnly:!0,move:!1,handleClose:!j&&A!==`both`?ol():null,restMs(){let e=w?.delay,t=typeof T.current==`object`?T.current.open:void 0,n=b;return D&&(n=t===0?0:s??e??b),n},delay(){let e=typeof T.current==`object`?T.current.close:void 0,t=x;return l==null&&D&&(t=e),{close:t}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`}),ee=Ac(v,{enabled:!k}).reference,N={open:_},P=m.useState(`triggerProps`,C);return Hn(`button`,e,{state:N,ref:[t,S,y],props:[M,ee,P,{onPointerDown(){m.set(`closeOnClick`,c)},id:h,[od.triggerDisabled]:k?``:void 0},f],stateAttributesMapping:hl})}),cd=z.createContext(void 0);function ld(){let e=z.useContext(cd);if(e===void 0)throw Error(hn(70));return e}var ud=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Qu().useState(`mounted`)||n?(0,U.jsx)(cd.Provider,{value:n,children:(0,U.jsx)(sl,{ref:t,...r})}):null}),dd=z.createContext(void 0);function fd(){let e=z.useContext(dd);if(e===void 0)throw Error(hn(71));return e}var pd=z.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Bn,style:g,..._}=e,v=Qu(),y=ld(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=Ol({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`hasViewport`)?Tl:void 0}),O=jl(e,z.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,U.jsx)(dd.Provider,{value:D,children:O})}),md={..._l,...mc},hd=z.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=Qu(),{side:s,align:c}=fd(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`);gc({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}});let m=o.useState(`disabled`),h=o.useState(`closeDelay`);return Ic(p,{enabled:!m,closeDelay:h}),Hn(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[f,Al(d),a],stateAttributesMapping:md})}),gd=z.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=Qu(),s=o.useState(`open`),c=o.useState(`instantType`),{arrowRef:l,side:u,align:d,arrowUncentered:f,arrowStyles:p}=fd();return Hn(`div`,e,{state:{open:s,side:u,align:d,uncentered:f,instant:c},ref:[t,l],props:[{style:p,"aria-hidden":!0},a],stateAttributesMapping:_l})}),_d=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=z.useMemo(()=>({delay:t,closeDelay:n}),[t,n]),a=z.useMemo(()=>({open:t,close:n}),[t,n]);return(0,U.jsx)(id.Provider,{value:i,children:(0,U.jsx)(Gr,{delay:a,timeoutMs:r,children:e.children})})};function vd({delay:e=0,...t}){return(0,U.jsx)(_d,{"data-slot":`tooltip-provider`,delay:e,...t})}function yd({...e}){return(0,U.jsx)(nd,{"data-slot":`tooltip`,...e})}function bd({...e}){return(0,U.jsx)(sd,{"data-slot":`tooltip-trigger`,...e})}function xd({className:e,side:t=`top`,sideOffset:n=4,align:r=`center`,alignOffset:i=0,children:a,...o}){return(0,U.jsx)(ud,{children:(0,U.jsx)(pd,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,U.jsxs)(hd,{"data-slot":`tooltip-content`,className:H(`z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o,children:[a,(0,U.jsx)(gd,{className:`z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5`})]})})})}var Sd={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},Cd={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},wd={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},Td=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ed=[12288,12288,65281,65376,65504,65510],Dd=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Od=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],kd=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],Ad=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},jd=Td[0],Md=Td.at(-1),Nd=Ed[0],Pd=Ed.at(-1),Fd=Dd[0],Id=Dd.at(-1),Ld=Od[0],Rd=Od.at(-1),zd=kd[0],Bd=kd.at(-1),Vd=19968,[Hd,Ud]=Wd(kd);function Wd(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(Vd>=i&&Vd<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var Gd=e=>e<jd||e>Md?!1:Ad(Td,e),Kd=e=>e<Nd||e>Pd?!1:Ad(Ed,e),qd=e=>e<Fd||e>Id?!1:Ad(Dd,e),Jd=e=>e<Ld||e>Rd?!1:Ad(Od,e),Yd=e=>e>=Hd&&e<=Ud?!0:e<zd||e>Bd?!1:Ad(kd,e);function Xd(e){return Gd(e)?`ambiguous`:Kd(e)?`fullwidth`:qd(e)?`halfwidth`:Jd(e)?`narrow`:Yd(e)?`wide`:`neutral`}function Zd(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Qd(e){return Zd(e),Xd(e)}function $d(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function ef(e){if(!e||e<4352)return!1;switch(Qd(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!$d(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999?null:!1;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function tf(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function nf(e){return e!==null&&e>=65024&&e<=65038}var rf=of(/\p{P}|\p{S}/u),af=of(/\s/);function of(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function sf(e){return!!(e&Cd.characterGroupWhitespace)}function cf(e){return(e&mf.cjkPunctuation)===Cd.characterGroupPunctuation}function lf(e){return!!(e&mf.cjk)}function uf(e){return e===mf.ivs}function df(e){return!!(e&mf.cjkOrIvs)}function ff(e){return e===mf.nonEmojiGeneralUseVS}function pf(e){return!!(e&mf.spaceOrPunctuation)}var mf;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(mf||={});function hf(e){if(e===Sd.eof||d(e)||af(e))return Cd.characterGroupWhitespace;let t=0;if(e>=4352){if(nf(e))return mf.nonEmojiGeneralUseVS;switch(ef(e)){case null:return mf.ivs;case!0:t|=mf.cjk;break}}return rf(e)&&(t|=Cd.characterGroupPunctuation),t}function gf(e,t,n){if(!ff(e))return e;let r=t(),i=hf(r);return!r||sf(i)?e:tf(r,n)?mf.cjkPunctuation:_f(i)}function _f(e){return e&~mf.ivs}function vf(e){return!!(e&&e>=55296&&e<=56319)}function yf(e){return!!(e&&e>=56320&&e<=57343)}function bf(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function xf(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var Sf=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=xf(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function Cf(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}var wf={name:`attention`,resolveAll:Tf,tokenize:Ef};function Tf(e,t){let n=-1,r,i,a,o,s,l,u,d;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let f={...e[r][1].end},p={...e[n][1].start};Df(f,-l),Df(p,l),o={type:l>1?wd.strongSequence:wd.emphasisSequence,start:f,end:{...e[r][1].end}},s={type:l>1?wd.strongSequence:wd.emphasisSequence,start:{...e[n][1].start},end:p},a={type:l>1?wd.strongText:wd.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?wd.strong:wd.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=m(u,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),u=m(u,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,u=m(u,j(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=m(u,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=m(u,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):d=0,c(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Ef(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=yf(a)?bf(a,r(),i):a,s=hf(o),c=new Sf(o,r(),i),l=gf(s,c.value.bind(c),o),u;return d;function d(t){return t===Sd.asterisk||Sd.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=hf(vf(a)?Cf(a,r(),i):a),d=cf(l),p=d||sf(l),m=cf(c),h=m||sf(c),g=df(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||lf(c))||n.includes(o);return s._open=!!(u===Sd.asterisk?_:_&&(pf(l)||!v)),s._close=!!(u===Sd.asterisk?v:v&&(pf(c)||!_)),t(a)}}function Df(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Of(){return{text:{[Sd.asterisk]:wf,[Sd.underscore]:wf},insideSpan:{null:[wf]}}}function kf(){let e=this.data();(e.micromarkExtensions||=[]).push(Of())}function Af(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[Sd.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[Sd.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&c(o,o.length,0,j(s,e.slice(r+1,n),t)),c(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),c(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=wd.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=yf(o)?bf(o,i(),a):o,c=hf(s),l=new Sf(s,i(),a),u=gf(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return Sd.tilde,s===Sd.tilde&&d[d.length-1][1].type!==wd.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=hf(s);if(o===Sd.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=hf(vf(o)?Cf(o,i(),a):o),p=cf(u)||sf(u),h=cf(d)||sf(d),g=lf(u)||uf(c);return l._open=!h||d===Cd.attentionSideAfter&&(p||g),l._close=!p||c===Cd.attentionSideAfter&&(h||lf(d)),n(o)}}}function jf(e){let t=this.data();(t.micromarkExtensions||=[]).push(Af(e))}var Mf=new Set([`。`,`.`,`,`,`、`,`?`,`!`,`:`,`;`,`(`,`)`,`【`,`】`,`「`,`」`,`『`,`』`,`〈`,`〉`,`《`,`》`]),Nf=/^(https?:\/\/|mailto:|www\.)/i,Pf=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},Ff=e=>{let t=0;for(let n of e){if(Mf.has(n))return t;t+=n.length}return null},If=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),Lf=e=>({type:`text`,value:e}),Rf=()=>e=>{g(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!Pf(e)||!Nf.test(e.url))return;let r=Ff(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=If(i,e),s=Lf(a);return n.children.splice(t,1,o,s),t+1})};function zf(){let e=[kf],t=[Rf,jf];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var Bf=zf(),Vf=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Hf(e){return Uf(e)}function Uf(e){return Array.isArray(e)?Wf(e):e instanceof RegExp?e:typeof e==`object`?Gf(e):e}function Wf(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Uf(e[n]);return t}function Gf(e){let t={};for(let n in e)t[n]=Uf(e[n]);return t}function Kf(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function qf(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?qf(e.substring(0,e.length-1)):e.substr(~t+1)}var Jf=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Yf=class{static hasCaptures(e){return e===null?!1:(Jf.lastIndex=0,Jf.test(e))}static replaceCaptures(e,t,n){return e.replace(Jf,(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 Xf(e,t){return e<t?-1:+(e>t)}function Zf(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=Xf(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function Qf(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 $f(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var ep=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}},tp=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(op(e),t)}static createFromParsedTheme(e,t){return lp(e,t)}_cachedMatchRoot=new ep(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=>rp(e.parent,t.parentScopes));return n?new ap(n.fontStyle,n.foreground,n.background):null}},np=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?!0:this.parent===null?!1: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 rp(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&&!ip(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ip(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var ap=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function op(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;break}}let s=null;typeof i.settings.foreground==`string`&&Qf(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&Qf(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 sp(l,u,e,o,s,c)}}return n}var sp=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}},cp=(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))(cp||{});function lp(e,t){e.sort((e,t)=>{let n=Xf(e.scope,t.scope);return n!==0||(n=Zf(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 up(t),o=new ap(n,a.getId(r),a.getId(i)),s=new pp(new fp(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 tp(a,o,s)}var up=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)}},dp=Object.freeze([]),fp=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||dp,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)}},pp=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(),fp.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(Zf(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 fp(e,t,n,r,i))}},mp=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)!=0}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=gp(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 hp(e){return e}function gp(e){return e}function _p(e,t){let n=[],r=yp(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(vp(i)){let e=[];do e.push(i),i=r.next();while(vp(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 vp(e){return!!e&&!!e.match(/[\w\.:]+/)}function yp(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 bp(e){typeof e.dispose==`function`&&e.dispose()}var xp=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Sp=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Cp=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))}},wp=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new xp(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Cp;for(let n of e)Tp(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof xp){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 Tp(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 xp?Dp({baseGrammar:a,selfGrammar:i},r):Ep(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 xp(e))}function Ep(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Op([r],t,n)}}function Dp(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Op(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Op(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Op(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Kf({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Op(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=Pp(i);switch(a.kind){case 0:Dp({...t,selfGrammar:t.baseGrammar},n);break;case 1:Dp(t,n);break;case 2:Ep(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?Ep(a.ruleName,i,n):Dp(i,n)}else a.kind===4?n.add(new Sp(a.scopeName,a.ruleName)):n.add(new xp(a.scopeName));break}}}var kp=class{kind=0},Ap=class{kind=1},jp=class{constructor(e){this.ruleName=e}kind=2},Mp=class{constructor(e){this.scopeName=e}kind=3},Np=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Pp(e){if(e===`$base`)return new kp;if(e===`$self`)return new Ap;let t=e.indexOf(`#`);return t===-1?new Mp(e):t===0?new jp(e.substring(1)):new Np(e.substring(0,t),e.substring(t+1))}var Fp=/\\(\d+)/,Ip=/\\(\d+)/g,Lp=-1,Rp=-2;function zp(e){return e}function Bp(e){return e}var Vp=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Yf.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Yf.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${qf(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:Yf.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Yf.replaceCaptures(this._contentName,e,t)}},Hp=class extends Vp{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!`)}},Up=class extends Vp{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Jp(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 Yp,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Wp=class extends Vp{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 Yp,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Gp=class extends Vp{_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 Jp(i,this.id),this.beginCaptures=a,this._end=new Jp(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 Yp;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}},Kp=class extends Vp{_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 Jp(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Jp(o,Rp),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 Yp;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 Yp,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},qp=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Hp(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Up(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Kf({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new Wp(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Kp(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 Gp(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=Pp(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);break}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof Wp||e instanceof Gp||e instanceof Kp)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Jp=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.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,typeof this.source==`string`?this.hasBackReferences=Fp.test(this.source):this.hasBackReferences=!1}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 Ip.lastIndex=0,this.source.replace(Ip,(e,t)=>$f(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}},Yp=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){return this._cached||=new Xp(e,this._items.map(e=>e.source),this._items.map(e=>e.ruleId)),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 Xp(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Xp=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(`
11
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Zp=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Qp=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Zp(e,8),this._embeddedLanguagesMatcher=new $p(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 Zp(0,0);_getBasicScopeAttributes=new ep(e=>new Zp(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/},$p=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])=>$f(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 em=!1,tm=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function nm(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=rm(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 tm(i,!0);f()}return new tm(i,!1);function f(){let o=im(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===Lp){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),um(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 Gp){let r=o;um(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 Kp){let r=o;um(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(um(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 rm(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 Kp&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=cm(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Rp){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),um(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 im(e,t,n,r,i,a){let o=am(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=om(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 am(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=sm(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 om(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}=sm(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 sm(e,t,n,r,i){return em?{ruleScanner:e.compile(t,n),findOptions:lm(r,i)}:{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function cm(e,t,n,r,i){return em?{ruleScanner:e.compileWhile(t,n),findOptions:lm(r,i)}:{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function lm(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function um(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));nm(e,p,n&&d.start===0,d.start,f,i,!1,0),bp(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 dm(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var dm=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function fm(e,t,n,r,i,a,o,s){return new gm(e,t,n,r,i,a,o,s)}function pm(e,t,n,r,i){let a=_p(t,mm),o=qp.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 mm(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(hm(t[r],e))return n=r+1,!0;return!1})}function hm(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 gm=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new Qp(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=_m(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=_p(e,mm);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)pm(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&&pm(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(zp(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Bp(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]=_m(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=qp.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===ym.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=mp.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?vm.createRootAndLookUpScopeName(a,r,this):vm.createRoot(`unknown`,r),t=new ym(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
12
+ `;let a=this.createOnigString(e),o=a.content.length,s=new xm(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=nm(this,a,i,0,t,s,!0,r);return bp(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function _m(e,t){return e=Hf(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 vm=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=np.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new np(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new np(null,t),o=r.themeProvider.themeMatch(a);return new e(null,a,e.mergeAttributes(n,i,o))}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(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),mp.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);return new e(t,a,e.mergeAttributes(t.tokenAttributes,i,o))}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}},ym=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?!1:e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?vm.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(!0)}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:Bp(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=vm.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,zp(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,vm.fromExtension(r,n.contentNameScopesList))}},bm=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):_p(e,mm).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>_p(e,mm).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}},xm=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=mp.set(n,0,hp(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=mp.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}},Sm=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,fm(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Cm=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Sm(tp.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(tp.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 bm(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new wp(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)}},wm=ym.NULL,Tm=/["&'<>`]/g,Em=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Dm=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Om=/[|\\{}()[\]^$+*?.]/g,km=new WeakMap;function Am(e,t){if(e=e.replace(t.subset?jm(t.subset):Tm,r),t.subset||t.escapeOnly)return e;return e.replace(Em,n).replace(Dm,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 jm(e){let t=km.get(e);return t||(t=Mm(e),km.set(e,t)),t}function Mm(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Om,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Nm=/[\dA-Fa-f]/;function Pm(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Nm.test(String.fromCharCode(t))?r:r+`;`}var Fm=/\d/;function Im(e,t,n){let r=`&#`+String(e);return n&&t&&!Fm.test(String.fromCharCode(t))?r:r+`;`}var Lm=`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(`.`),Rm={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:`€`},zm=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Bm={}.hasOwnProperty,Vm={},Hm;for(Hm in Rm)Bm.call(Rm,Hm)&&(Vm[Rm[Hm]]=Hm);var Um=/[^\dA-Za-z]/;function Wm(e,t,n,r){let i=String.fromCharCode(e);if(Bm.call(Vm,i)){let e=Vm[i],a=`&`+e;return n&&Lm.includes(e)&&!zm.includes(e)&&(!r||t&&t!==61&&Um.test(String.fromCharCode(t)))?a:a+`;`}return``}function Gm(e,t,n){let r=Pm(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Wm(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Im(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function Km(e,t){return Am(e,Object.assign({format:Gm},t))}var qm=/^>|^->|<!--|-->|--!>|<!-$/g,Jm=[`>`],Ym=[`<`,`>`];function Xm(e,t,n,r){return r.settings.bogusComments?`<?`+Km(e.value,Object.assign({},r.settings.characterReferences,{subset:Jm}))+`>`:`<!--`+e.value.replace(qm,i)+`-->`;function i(e){return Km(e,Object.assign({},r.settings.characterReferences,{subset:Ym}))}}function Zm(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var Qm=th(1),$m=th(-1),eh=[];function th(e){return t;function t(t,n,r){let i=t?t.children:eh,a=(n||0)+e,o=i[a];if(!r)for(;o&&v(o);)a+=e,o=i[a];return o}}var nh={}.hasOwnProperty;function rh(e){return t;function t(t,n,r){return nh.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var ih=rh({body:sh,caption:ah,colgroup:ah,dd:dh,dt:uh,head:ah,html:oh,li:lh,optgroup:ph,option:mh,p:ch,rp:fh,rt:fh,tbody:gh,td:yh,tfoot:_h,th:yh,thead:hh,tr:vh});function ah(e,t,n){let r=Qm(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&v(r.value.charAt(0)))}function oh(e,t,n){let r=Qm(n,t);return!r||r.type!==`comment`}function sh(e,t,n){let r=Qm(n,t);return!r||r.type!==`comment`}function ch(e,t,n){let r=Qm(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 lh(e,t,n){let r=Qm(n,t);return!r||r.type===`element`&&r.tagName===`li`}function uh(e,t,n){let r=Qm(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function dh(e,t,n){let r=Qm(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function fh(e,t,n){let r=Qm(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function ph(e,t,n){let r=Qm(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function mh(e,t,n){let r=Qm(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function hh(e,t,n){let r=Qm(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function gh(e,t,n){let r=Qm(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function _h(e,t,n){return!Qm(n,t)}function vh(e,t,n){let r=Qm(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function yh(e,t,n){let r=Qm(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var bh=rh({body:Ch,colgroup:wh,head:Sh,html:xh,tbody:Th});function xh(e){let t=Qm(e,-1);return!t||t.type!==`comment`}function Sh(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 Ch(e){let t=Qm(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&v(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function wh(e,t,n){let r=$m(n,t),i=Qm(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&ih(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Th(e,t,n){let r=$m(n,t),i=Qm(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&ih(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Eh={name:[[`
13
+ \f\r &/=>`.split(``),`
14
+ \f\r "&'/=>\``.split(``)],[`\0
15
+ \f\r "&'/<=>`.split(``),`\0
16
+ \f\r "&'/<=>\``.split(``)]],unquoted:[[`
17
+ \f\r &>`.split(``),`\0
18
+ \f\r "&'<=>\``.split(``)],[`\0
19
+ \f\r "&'<=>\``.split(``),`\0
20
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Dh(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1: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=h);let l=Oh(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!bh(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||!ih(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Oh(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=kh(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 kh(e,t,n){let r=A(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=Km(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Eh.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?E:y)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=Km(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Eh.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&w(n,o)>w(n,e.alternative)&&(o=e.alternative),s=o+Km(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Eh.single:Eh.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Ah=[`<`,`&`];function jh(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:Km(e.value,Object.assign({},r.settings.characterReferences,{subset:Ah}))}function Mh(e,t,n,r){return r.settings.allowDangerousHtml?e.value:jh(e,t,n,r)}function Nh(e,t,n,r){return r.all(e)}var Ph=x(`type`,{invalid:Fh,unknown:Ih,handlers:{comment:Xm,doctype:Zm,element:Dh,raw:Mh,root:Nh,text:jh}});function Fh(e){throw Error("Expected node, not `"+e+"`")}function Ih(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Lh={},Rh={},zh=[];function Bh(e,t){let n=t||Lh,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Vh,all:Hh,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||ee,characterReferences:n.characterReferences||Rh,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?h:b,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Vh(e,t,n){return Ph(e,t,n,this)}function Hh(e){let t=[],n=e&&e.children||zh,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function Uh(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 Wh(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Gh(e){return Array.isArray(e)?e:[e]}async function Kh(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function qh(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Jh(e){return e===`ansi`||qh(e)}function Yh(e){return e===`none`}function Xh(e){return Yh(e)}function Zh(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Qh(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),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}function $h(e){let t=Qh(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-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 eg(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var tg=`light-dark()`,ng=[`color`,`background-color`];function rg(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 ig(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?rg(e,t):e})):e}function ag(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>og(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&&ng.includes(a))if(r===tg&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new Vf('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,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 og(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&cp.Italic&&(t[`font-style`]=`italic`),e.fontStyle&cp.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&cp.Underline&&n.push(`underline`),e.fontStyle&cp.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function sg(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var cg=new WeakMap;function lg(e,t){cg.set(e,t)}function ug(e){return cg.get(e)}var dg=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(Gh(n).map(e=>[e,wm])),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 fg(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function fg(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 pg(e,t){if(!(e instanceof dg))throw new Vf(`Invalid grammar state`);return e.getInternalStack(t)}function mg(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new Vf(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}else{let t=r.lines[e.line];if(t===void 0)throw new Vf(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new Vf(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}},r=$h(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));hg(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return ig(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=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new Vf(`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+=gg(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new Vf(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new Vf(`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&&Zh(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 hg(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new Vf(`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 Vf(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function gg(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(gg).join(``):``}var _g=[mg()];function vg(e){let t=yg(e.transformers||[]);return[...t.pre,...t.normal,...t.post,..._g]}function yg(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 bg=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],xg={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Sg(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 Cg(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}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function wg(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)xg[r]&&t.push({type:`setDecoration`,value:xg[r]});else if(r<=29){let e=xg[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:bg[r-30]}});else if(r===38){let n=Cg(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:bg[r-40]}});else if(r===48){let n=Cg(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:bg[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:bg[r-100+8]}})}return t}function Tg(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Sg(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=wg(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 Eg={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 Dg(e=Eg){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<bg.length;e++)r.push(t(bg[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 Og={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 kg(e,t,n){let r=Uh(e,n),i=Qh(t),a=Dg(Object.fromEntries(bg.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Og[t]]}))),o=Tg();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=Wh(i,r),o=Wh(o,r),n.decorations.has(`dim`)&&(i=Ag(i));let s=cp.None;return n.decorations.has(`bold`)&&(s|=cp.Bold),n.decorations.has(`italic`)&&(s|=cp.Italic),n.decorations.has(`underline`)&&(s|=cp.Underline),n.decorations.has(`strikethrough`)&&(s|=cp.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Ag(e){let t=e.match(/#([0-9a-f]{3,8})/i);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}`}else if(e.length===6)return`#${e}80`;else 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`)}`}else 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(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function jg(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||`text`);if(qh(i)||Yh(r))return Qh(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:a,colorMap:o}=e.setTheme(r);if(i===`ansi`)return kg(a,t,n);let s=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==s.name)throw new Vf(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(a.name))throw new Vf(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Ng(t,s,a,o,n)}function Mg(...e){if(e.length===2)return ug(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(qh(i)||Yh(a))throw new Vf(`Plain language does not have grammar state`);if(i===`ansi`)throw new Vf(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new dg(Pg(n,c,o,s,r).stateStack,c.name,o.name)}function Ng(e,t,n,r,i){let a=Pg(e,t,n,r,i),o=new dg(a.stateStack,t.name,n.name);return lg(a.tokens,o),a.tokens}function Pg(e,t,n,r,i){let a=Uh(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=Qh(e),l=i.grammarState?pg(i.grammarState,n.name)??wm:i.grammarContextCode==null?wm:Pg(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,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]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=Wh(r[mp.getForeground(s)],a),l=mp.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?Fg(t.scopes):Ig(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function Fg(e){return e.map(e=>({scopeName:e}))}function Ig(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:zg(e,i,t.slice(0,r))}}return n}function Lg(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function Rg(e,t,n){if(!Lg(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)Lg(e[r],n[i])&&--r,--i;return r===-1}function zg(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(Rg(e,t,n)){r.push(a);break}return r}function Bg(e,t,n){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{let i=jg(e,t,{...n,theme:r.theme});return{tokens:i,state:ug(i),theme:typeof r.theme==`string`?r.theme:r.theme.name}}),a=Vg(...i.map(e=>e.tokens)),o=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:s,offset:c,...l}=e[t][i];o.variants[r[n].color]=l}),o})),s=i[0].state?new dg(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return s&&lg(o,s),o}function Vg(...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}function Hg(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 Vf("`themes` option must not be empty");let p=Bg(e,t,n);if(c=ug(p),l&&tg!==l&&!f.find(e=>e.color===l))throw new Vf(`\`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=>ag(e,h,u,l,d))),c&&lg(a,c);let g=f.map(e=>Uh(e.theme,n));i=Ug(f,m,g,u,l,`fg`,d),r=Ug(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=Uh(n.theme,n);a=jg(e,t,n);let l=e.getTheme(n.theme);r=Wh(l.bg,s),i=Wh(l.fg,s),o=l.name,c=ug(a)}else throw new Vf("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Ug(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=Wh(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===tg&&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 Vf('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Wh(t[r][a],n[r])||`inherit`}, ${Wh(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function Wg(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Wg(e,t,n),codeToTokens:(t,n)=>Hg(e,t,n)}){let i=t;for(let e of vg(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Hg(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Kg(a):d===`never`&&(a=qg(a)),f&&(a=Jg(a));let p={...r,get source(){return i}};for(let e of vg(n))a=e.tokens?.call(p,a)||a;return Gg(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Gg(e,t,n,r=ug(e)){let i=vg(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=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:Zh,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:`
21
+ `}));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=sg(a.htmlStyle||og(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&&lg(m,r),m}function Kg(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&cp.Underline||i.fontStyle&cp.Strikethrough));o&&i.content.match(/^\s+$/)&&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 qg(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);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 Jg(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=sg(e.htmlStyle||og(e)),i=sg(n.htmlStyle||og(n)),a=e.fontStyle&&(e.fontStyle&cp.Underline||e.fontStyle&cp.Strikethrough),o=n.fontStyle&&(n.fontStyle&cp.Underline||n.fontStyle&cp.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Yg=Bh;function Xg(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Wg(e,t,n),codeToTokens:(t,n)=>Hg(e,t,n)},i=Yg(Wg(e,t,n,r));for(let e of vg(n))i=e.postprocess?.call(r,i,n)||i;return i}var Zg={light:`#333333`,dark:`#bbbbbb`},Qg={light:`#fffffe`,dark:`#1e1e1e`},$g=`__shiki_resolved`;function e_(e){if(e?.[$g])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`?Zg.light:Zg.dark,n||=t.type===`light`?Qg.light:Qg.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,$g,{enumerable:!1,writable:!1,value:!0}),t}async function t_(e){return Array.from(new Set((await Promise.all(e.filter(e=>!Jh(e)).map(async e=>await Kh(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function n_(e){return(await Promise.all(e.map(async e=>Xh(e)?null:e_(await Kh(e))))).filter(e=>!!e)}var r_=3,i_=!1;function a_(e,t=3){if(r_&&!(typeof r_==`number`&&t>r_)){if(i_)throw Error(`[SHIKI DEPRECATE]: ${e}`);console.trace(`[SHIKI DEPRECATE]: ${e}`)}}var o_=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function s_(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 o_(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var c_=class extends Cm{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)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=e_(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=tp.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=s_(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=Array.from(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 o_(`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))}},l_=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}},u_=0;function d_(e){u_+=1,e.warnings!==!1&&u_>=10&&u_%10==0&&console.warn(`[Shiki] ${u_} 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 o_("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(e_),i=new c_(new l_(e.engine,n),r,n,e.langAlias),a;function o(t){return s_(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new o_(`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 o_(`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 t_(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await n_(e))}function g(){if(t)throw new o_(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--u_)}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 f_(e){e.engine||a_("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([n_(e.themes||[]),t_(e.langs||[]),e.engine]);return d_({...e,themes:t,langs:n,engine:r})}async function p_(e){let t=await f_(e);return{getLastGrammarState:(...e)=>Mg(t,...e),codeToTokensBase:(e,n)=>jg(t,e,n),codeToTokensWithThemes:(e,n)=>Bg(t,e,n),codeToTokens:(e,n)=>Hg(t,e,n),codeToHast:(e,n)=>Wg(t,e,n),codeToHtml:(e,n)=>Xg(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function m_(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,Jh(n))return[];let r=t[n];if(!r)throw new Vf(`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(Xh(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Vf(`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 p_({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 h_(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}else{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 g_(e,t){let n=h_(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 __=[{id:`abap`,name:`ABAP`,import:(()=>N(()=>import(`./abap-Cp2NWtLj.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>N(()=>import(`./actionscript-3-D_ENX1Nj.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>N(()=>import(`./ada-C5QOkaIU.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>N(()=>import(`./angular-html-_HwXvSwT.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>N(()=>import(`./angular-ts-C0MdMUxp.js`),__vite__mapDeps([5,0,1,2,3,4,6])))},{id:`apache`,name:`Apache Conf`,import:(()=>N(()=>import(`./apache-tzyIR1bK.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>N(()=>import(`./apex-CsgzH81j.js`),[]))},{id:`apl`,name:`APL`,import:(()=>N(()=>import(`./apl-4QeRDQub.js`),__vite__mapDeps([7,3,1,2,4,8,9,10])))},{id:`applescript`,name:`AppleScript`,import:(()=>N(()=>import(`./applescript-BV6_dNCI.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>N(()=>import(`./ara-el9Xuz73.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>N(()=>import(`./asciidoc-Cg6ffMc2.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>N(()=>import(`./asm-BDQSdsix.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>N(()=>import(`./astro-BabKmEmb.js`),__vite__mapDeps([11,3,1,4,8,12,13,14])))},{id:`awk`,name:`AWK`,import:(()=>N(()=>import(`./awk-Wtefdr5M.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>N(()=>import(`./ballerina-DeAyHSYI.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>N(()=>import(`./bat-Bw8OL474.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>N(()=>import(`./beancount-FOEKHml4.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>N(()=>import(`./berry-DRdPLDBk.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>N(()=>import(`./bibtex-B3bGeWSZ.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>N(()=>import(`./bicep-BNT1dlN4.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>N(()=>import(`./bird2-C8cL01Ff.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>N(()=>import(`./blade-Bu8RXJ0S.js`),__vite__mapDeps([15,3,1,16,2,4,8,17,9,10])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>N(()=>import(`./bsl-DbC1tprz.js`),__vite__mapDeps([18,19])))},{id:`c`,name:`C`,import:(()=>N(()=>import(`./c-s_ZxyIK8.js`).then(e=>e.n),__vite__mapDeps([20,1])))},{id:`c3`,name:`C3`,import:(()=>N(()=>import(`./c3-BPoyP0sU.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>N(()=>import(`./cadence-C3XXUeGa.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>N(()=>import(`./cairo-bw2LlBny.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>N(()=>import(`./clarity-Bl0nloC4.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>N(()=>import(`./clojure-CJZ-gtn1.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>N(()=>import(`./cmake-jShv_G9x.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>N(()=>import(`./cobol-CFVNX4pB.js`),__vite__mapDeps([23,2,1,3,4,10])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>N(()=>import(`./codeowners-D1nMTboy.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>N(()=>import(`./codeql-BzknEKqm.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>N(()=>import(`./coffee-B-j1zMpl.js`),__vite__mapDeps([24,4,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>N(()=>import(`./common-lisp-DzHL1bbK.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>N(()=>import(`./coq-7slaLuh6.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>N(()=>import(`./cpp-BH37dOMC.js`).then(e=>e.n),__vite__mapDeps([25,1,26,20,27,17])))},{id:`crystal`,name:`Crystal`,import:(()=>N(()=>import(`./crystal-C9FTVoTU.js`),__vite__mapDeps([28,20,1,3,2,4,29,17])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>N(()=>import(`./csharp-Dy8WhnQ5.js`),[]))},{id:`css`,name:`CSS`,import:(()=>N(()=>import(`./css-B7Tsta-P.js`).then(e=>e.n),__vite__mapDeps([3,1])))},{id:`csv`,name:`CSV`,import:(()=>N(()=>import(`./csv-r5qbRpGD.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>N(()=>import(`./cue--2gU_GVk.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>N(()=>import(`./cypher-D9h2zY0l.js`),[]))},{id:`d`,name:`D`,import:(()=>N(()=>import(`./d-5QAgRtXf.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>N(()=>import(`./dart-LsE7mWCI.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>N(()=>import(`./dax-Cl5XWZWz.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>N(()=>import(`./desktop-gYGfgyJp.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>N(()=>import(`./diff-By5eTuf6.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>N(()=>import(`./docker-Dvr59O5X.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>N(()=>import(`./dotenv-D0v3yJqt.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>N(()=>import(`./dream-maker-DAo8Qrzh.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>N(()=>import(`./edge-zQ9tv2o7.js`),__vite__mapDeps([30,16,2,1,3,4,14])))},{id:`elixir`,name:`Elixir`,import:(()=>N(()=>import(`./elixir-D01zNC3Z.js`),__vite__mapDeps([31,2,1,3,4])))},{id:`elm`,name:`Elm`,import:(()=>N(()=>import(`./elm-u3p_kDl6.js`),__vite__mapDeps([32,26,1,20])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>N(()=>import(`./emacs-lisp-COnnesO5.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>N(()=>import(`./erb-Du9uLkX4.js`),__vite__mapDeps([33,2,1,3,4,34,20,25,26,27,17,35,36,13,14,37,38,29,9,10,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>N(()=>import(`./erlang-zz4Xiq1y.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>N(()=>import(`./fennel-cc2o_n_y.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>N(()=>import(`./fish-KPxolgaQ.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>N(()=>import(`./fluent-C7fDSoRl.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>N(()=>import(`./fortran-fixed-form-de25IAQL.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>N(()=>import(`./fortran-free-form-BJSYMpiH.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>N(()=>import(`./fsharp-C27rIlvh.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>N(()=>import(`./gdresource-JgzdZtHI.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>N(()=>import(`./gdscript-HNVdFJmW.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>N(()=>import(`./gdshader-BwO0aTPI.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>N(()=>import(`./genie-Bp6Tcc1X.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>N(()=>import(`./gherkin-wKbnGa7y.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>N(()=>import(`./git-commit-DJWct9wS.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>N(()=>import(`./git-rebase-lfDZ8skH.js`),__vite__mapDeps([50,29,1])))},{id:`gleam`,name:`Gleam`,import:(()=>N(()=>import(`./gleam-D6CCNv9W.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>N(()=>import(`./glimmer-js-CTRBBeAm.js`),__vite__mapDeps([51,3,1,2,4,14])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>N(()=>import(`./glimmer-ts-CnIDOVFA.js`),__vite__mapDeps([52,3,1,2,4,14])))},{id:`glsl`,name:`GLSL`,import:(()=>N(()=>import(`./glsl-BEtNaWrS.js`).then(e=>e.n),__vite__mapDeps([26,1,20])))},{id:`gn`,name:`GN`,import:(()=>N(()=>import(`./gn-HCNfZa0n.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>N(()=>import(`./gnuplot-BlxkOlzb.js`),[]))},{id:`go`,name:`Go`,import:(()=>N(()=>import(`./go-BprGU5Fu.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>N(()=>import(`./graphql-Cq3O5Xqa.js`).then(e=>e.n),__vite__mapDeps([35,1,4,36,13,14])))},{id:`groovy`,name:`Groovy`,import:(()=>N(()=>import(`./groovy-Dn-BA3iB.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>N(()=>import(`./hack-BZ3dx1--.js`),__vite__mapDeps([53,2,1,3,4,17])))},{id:`haml`,name:`Ruby Haml`,import:(()=>N(()=>import(`./haml-B5A75U37.js`).then(e=>e.n),__vite__mapDeps([37,1,3,4])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>N(()=>import(`./handlebars-w9cZONbN.js`),__vite__mapDeps([54,3,1,2,4,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>N(()=>import(`./haskell-BdSEA8QL.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>N(()=>import(`./haxe-Wo1G3Awf.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>N(()=>import(`./hcl-BNYD0BsV.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>N(()=>import(`./hjson-DNhFISic.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>N(()=>import(`./hlsl-Bg-0F0fd.js`),[]))},{id:`html`,name:`HTML`,import:(()=>N(()=>import(`./html-Cvpf_YOL.js`).then(e=>e.n),__vite__mapDeps([2,1,3,4])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>N(()=>import(`./html-derivative-oVy6yJkw.js`),__vite__mapDeps([16,2,1,3,4])))},{id:`http`,name:`HTTP`,import:(()=>N(()=>import(`./http-BrKjqtuP.js`),__vite__mapDeps([55,35,1,4,36,13,14,8,29,9,10])))},{id:`hurl`,name:`Hurl`,import:(()=>N(()=>import(`./hurl-_ZAULsES.js`),__vite__mapDeps([56,57,35,1,4,36,13,14,9,10])))},{id:`hxml`,name:`HXML`,import:(()=>N(()=>import(`./hxml-B8YISzVb.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>N(()=>import(`./hy-DzHXak2i.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>N(()=>import(`./imba-6IS1QWMh.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>N(()=>import(`./ini-B2jDD_I7.js`),[]))},{id:`java`,name:`Java`,import:(()=>N(()=>import(`./java-REBmrI9v.js`).then(e=>e.n),__vite__mapDeps([10,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>N(()=>import(`./javascript-CpnmjKAl.js`).then(e=>e.n),__vite__mapDeps([4,1])))},{id:`jinja`,name:`Jinja`,import:(()=>N(()=>import(`./jinja-KiVCDEJo.js`),__vite__mapDeps([60,2,1,3,4])))},{id:`jison`,name:`Jison`,import:(()=>N(()=>import(`./jison-B7y4AqWt.js`),__vite__mapDeps([61,4,1])))},{id:`json`,name:`JSON`,import:(()=>N(()=>import(`./json-DKZl9weG.js`).then(e=>e.n),__vite__mapDeps([8,1])))},{id:`json5`,name:`JSON5`,import:(()=>N(()=>import(`./json5-BTxbmk-i.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>N(()=>import(`./jsonc-7F1EbEh5.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>N(()=>import(`./jsonl-Dxnxk5Cb.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>N(()=>import(`./jsonnet-D-jVxGKn.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>N(()=>import(`./jssm-GbGPSNXP.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>N(()=>import(`./jsx-CZSUqxTg.js`).then(e=>e.n),__vite__mapDeps([36,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>N(()=>import(`./julia-3f4tjBxU.js`),__vite__mapDeps([62,25,1,26,20,27,17,4,22,63])))},{id:`just`,name:`Just`,import:(()=>N(()=>import(`./just-z9y20Tc6.js`),__vite__mapDeps([64,4,1,65,3,2,17,9,10,22,34,20,25,26,27,35,36,13,14,37,38,29,39])))},{id:`kdl`,name:`KDL`,import:(()=>N(()=>import(`./kdl-B3jtVNv2.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>N(()=>import(`./kotlin-Bz8cnwKd.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>N(()=>import(`./kusto-BB-ZwOBj.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>N(()=>import(`./latex-CcomvWaP.js`),__vite__mapDeps([66,67,63,1])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>N(()=>import(`./lean-CtQ4bvXi.js`),[]))},{id:`less`,name:`Less`,import:(()=>N(()=>import(`./less-DpUZYmN5.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>N(()=>import(`./liquid-oC-fo7l1.js`),__vite__mapDeps([68,3,1,2,4,8])))},{id:`llvm`,name:`LLVM IR`,import:(()=>N(()=>import(`./llvm-5f5y_Ap2.js`),[]))},{id:`log`,name:`Log file`,import:(()=>N(()=>import(`./log-DfElwAn3.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>N(()=>import(`./logo-BsNoYTpI.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>N(()=>import(`./lua-oGz5kt0D.js`).then(e=>e.n),__vite__mapDeps([38,1,20])))},{id:`luau`,name:`Luau`,import:(()=>N(()=>import(`./luau-C1E67huT.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>N(()=>import(`./make-CoWY1rq1.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>N(()=>import(`./markdown-De3qwImy.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>N(()=>import(`./marko-5zZ9G9ce.js`),__vite__mapDeps([69,3,1,70,6,14])))},{id:`matlab`,name:`MATLAB`,import:(()=>N(()=>import(`./matlab-B6Mh-hw5.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>N(()=>import(`./mdc-B7fvqQ0X.js`),__vite__mapDeps([71,16,2,1,3,4,41,39])))},{id:`mdx`,name:`MDX`,import:(()=>N(()=>import(`./mdx-B-fVCB-m.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>N(()=>import(`./mermaid-DtUxib9M.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>N(()=>import(`./mipsasm-B6wA5Xok.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>N(()=>import(`./mojo-LQUXsZYw.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>N(()=>import(`./moonbit-3cYxDdHt.js`),[]))},{id:`move`,name:`Move`,import:(()=>N(()=>import(`./move-CFVitcTM.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>N(()=>import(`./narrat-0TgK8Yuw.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>N(()=>import(`./nextflow-CnpGqZ74.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>N(()=>import(`./nextflow-groovy-mfiIAXye.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>N(()=>import(`./nginx-CTzOtRsu.js`),__vite__mapDeps([74,38,1,20])))},{id:`nim`,name:`Nim`,import:(()=>N(()=>import(`./nim-BJIO_Cd5.js`),__vite__mapDeps([75,20,1,3,26,2,4,41,9,10])))},{id:`nix`,name:`Nix`,import:(()=>N(()=>import(`./nix-CSvXpwvW.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>N(()=>import(`./nushell-DHywrRK4.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>N(()=>import(`./objective-c-Dy0Y_D4w.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>N(()=>import(`./objective-cpp-BTsF8DIT.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>N(()=>import(`./ocaml-DMaIDPmL.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>N(()=>import(`./odin-DkPxqim1.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>N(()=>import(`./openscad-DKrIrwXa.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>N(()=>import(`./pascal-9bHBD0ZD.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>N(()=>import(`./perl-Bso7vGwI.js`),__vite__mapDeps([65,3,1,2,4,17,9,10])))},{id:`php`,name:`PHP`,import:(()=>N(()=>import(`./php-CZEE7un0.js`),__vite__mapDeps([76,3,1,2,4,8,17,9,10])))},{id:`pkl`,name:`Pkl`,import:(()=>N(()=>import(`./pkl-BPbcF3Mv.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>N(()=>import(`./plsql-Dw-kgMR6.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>N(()=>import(`./po-C6zPTw0N.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>N(()=>import(`./polar-tXzFKhQl.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>N(()=>import(`./postcss-BgZZjrY8.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>N(()=>import(`./powerquery-CZjIPRWQ.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>N(()=>import(`./powershell-B3ZuN6EU.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>N(()=>import(`./prisma-BsGwRpag.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>N(()=>import(`./prolog-dIzFr3Uc.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>N(()=>import(`./proto-Bzsjp858.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>N(()=>import(`./pug-DjeXSet8.js`),__vite__mapDeps([77,3,1,2,4])))},{id:`puppet`,name:`Puppet`,import:(()=>N(()=>import(`./puppet-Bp211A54.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>N(()=>import(`./purescript-D6CQukRG.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>N(()=>import(`./python-BoDrCLWh.js`),[]))},{id:`qml`,name:`QML`,import:(()=>N(()=>import(`./qml-QfHyLKVN.js`),__vite__mapDeps([78,4,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>N(()=>import(`./qmldir-Bqa3y4hN.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>N(()=>import(`./qss-CV96RR8G.js`),[]))},{id:`r`,name:`R`,import:(()=>N(()=>import(`./r-CkDPKduq.js`).then(e=>e.n),__vite__mapDeps([63,1])))},{id:`racket`,name:`Racket`,import:(()=>N(()=>import(`./racket-CCnuhh3j.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>N(()=>import(`./raku-CUxQRVYx.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>N(()=>import(`./razor-7wlVG6CD.js`),__vite__mapDeps([79,80,2,1,3,4])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>N(()=>import(`./reg-D7CnTOVU.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>N(()=>import(`./regexp-Boe98dsB.js`).then(e=>e.n),__vite__mapDeps([27,1])))},{id:`rel`,name:`Rel`,import:(()=>N(()=>import(`./rel-BifuT133.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>N(()=>import(`./riscv-BOJTt6_-.js`),[]))},{id:`ron`,name:`RON`,import:(()=>N(()=>import(`./ron-DWlvBQTR.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>N(()=>import(`./rosmsg-tnBdvEy4.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>N(()=>import(`./rst-DRyPiGBA.js`),__vite__mapDeps([81,82,25,1,26,20,27,17,16,2,3,4,22,34,35,36,13,14,37,38,29,9,10,39])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>N(()=>import(`./ruby-e6Q48MT7.js`),__vite__mapDeps([34,20,1,25,26,27,17,3,35,4,36,13,14,37,2,38,29,9,10,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>N(()=>import(`./rust-5u0bkJOL.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>N(()=>import(`./sas-CxE4QqzN.js`),__vite__mapDeps([83,17,1])))},{id:`sass`,name:`Sass`,import:(()=>N(()=>import(`./sass-CXKtXO--.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>N(()=>import(`./scala-Dl5o9Fo3.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>N(()=>import(`./scheme-TJ1tjRfE.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>N(()=>import(`./scss-CzZ1rdcq.js`).then(e=>e.n),__vite__mapDeps([6,1,3])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>N(()=>import(`./sdbl-CuMvbO_3.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>N(()=>import(`./shaderlab-kJ264lrP.js`),__vite__mapDeps([84,85])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>N(()=>import(`./shellscript-BdIWhdXD.js`).then(e=>e.n),__vite__mapDeps([29,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>N(()=>import(`./shellsession-CCVKJfet.js`),__vite__mapDeps([86,29,1])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>N(()=>import(`./smalltalk-C92xxm_X.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>N(()=>import(`./solidity-DRbaPrku.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>N(()=>import(`./soy-TfJ13c8R.js`),__vite__mapDeps([87,2,1,3,4])))},{id:`sparql`,name:`SPARQL`,import:(()=>N(()=>import(`./sparql-0Ag2VZSm.js`),__vite__mapDeps([88,89])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>N(()=>import(`./splunk-D5gtBDO9.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>N(()=>import(`./sql-F9n8qBBa.js`).then(e=>e.n),__vite__mapDeps([17,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>N(()=>import(`./ssh-config-C5SvhCXH.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>N(()=>import(`./stata-Bo09-SYB.js`),__vite__mapDeps([90,17,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>N(()=>import(`./stylus-BB4kxg9C.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>N(()=>import(`./surrealql-TQdVNqkg.js`),__vite__mapDeps([91,4,1])))},{id:`svelte`,name:`Svelte`,import:(()=>N(()=>import(`./svelte-C5Xk7kp7.js`),__vite__mapDeps([92,3,1,4,12,14])))},{id:`swift`,name:`Swift`,import:(()=>N(()=>import(`./swift-CZ9OVoM1.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>N(()=>import(`./system-verilog-hes_WyrP.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>N(()=>import(`./systemd-Bi3dargt.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>N(()=>import(`./talonscript-Df0VQqEL.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>N(()=>import(`./tasl-pC6IIYHu.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>N(()=>import(`./tcl-z4Ky99K0.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>N(()=>import(`./templ-B3XM4bsW.js`),__vite__mapDeps([93,3,1,94,4])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>N(()=>import(`./terraform-Bk8EtaWS.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>N(()=>import(`./tex-BS51bcGt.js`),__vite__mapDeps([67,63,1])))},{id:`toml`,name:`TOML`,import:(()=>N(()=>import(`./toml-CsBE8Oq-.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>N(()=>import(`./ts-tags-LkJG_bdC.js`),__vite__mapDeps([95,3,1,26,20,2,4,17,14,9,10])))},{id:`tsv`,name:`TSV`,import:(()=>N(()=>import(`./tsv-CGxeB27z.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>N(()=>import(`./tsx-F9M9wC-q.js`).then(e=>e.n),__vite__mapDeps([13,1])))},{id:`turtle`,name:`Turtle`,import:(()=>N(()=>import(`./turtle-B-HRGjvW.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>N(()=>import(`./twig-Cys-f5X9.js`),__vite__mapDeps([96,3,1,4,76,2,8,17,9,10,22,34,20,25,26,27,35,36,13,14,37,38,29,39,6])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>N(()=>import(`./typescript-DTrDmW2l.js`).then(e=>e.n),__vite__mapDeps([14,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>N(()=>import(`./typespec-DgbAFl5y.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>N(()=>import(`./typst-BS0MQPgb.js`),[]))},{id:`v`,name:`V`,import:(()=>N(()=>import(`./v-DGWsuNWd.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>N(()=>import(`./vala-CpIG-nc4.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>N(()=>import(`./vb-Decf5kRe.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>N(()=>import(`./verilog-Bqm04fOa.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>N(()=>import(`./vhdl-CUg4kQKk.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>N(()=>import(`./viml-B17z03zu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>N(()=>import(`./vue-CAuAJ1hM.js`),__vite__mapDeps([97,3,1,16,2,4,8,14])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>N(()=>import(`./vue-html-4zOPz6rT.js`),__vite__mapDeps([98,4,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>N(()=>import(`./vue-vine-cZhCFYnN.js`),__vite__mapDeps([99,3,1,4,70,12,6,100])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>N(()=>import(`./vyper--2IZ1gB8.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>N(()=>import(`./wasm-BvWczlav.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>N(()=>import(`./wenyan-BN3hCa5i.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>N(()=>import(`./wgsl-B30_-Yk7.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>N(()=>import(`./wikitext-CDZb-JVO.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>N(()=>import(`./wit-DUo3ucJM.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>N(()=>import(`./wolfram-BB_aQCD_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>N(()=>import(`./xml-BBXp_5Wh.js`).then(e=>e.n),__vite__mapDeps([9,1,10])))},{id:`xsl`,name:`XSL`,import:(()=>N(()=>import(`./xsl-DLFc1Cir.js`),__vite__mapDeps([101,9,1,10])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>N(()=>import(`./yaml-BEergP_M.js`).then(e=>e.n),__vite__mapDeps([39,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>N(()=>import(`./zenscript-0p2Pt-0U.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>N(()=>import(`./zig-cKhYw_pf.js`),[]))}],v_=Object.fromEntries(__.map(e=>[e.id,e.import])),y_=Object.fromEntries(__.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),b_={...v_,...y_},x_=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>N(()=>import(`./andromeeda-gpQx4Ui_.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>N(()=>import(`./aurora-x-DsNVq0oK.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>N(()=>import(`./ayu-dark-yjw2IZUi.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>N(()=>import(`./ayu-light-DqTxNwgj.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>N(()=>import(`./ayu-mirage-BZKkXq3S.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-frappe-Do7-8EbK.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>N(()=>import(`./catppuccin-latte-DQx-D1XD.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-macchiato-S3Zr9pg5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-mocha-2Azsd_eT.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>N(()=>import(`./dark-plus-DRT6l1e5.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>N(()=>import(`./dracula-lYVP4czV.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>N(()=>import(`./dracula-soft-D64fZDVY.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>N(()=>import(`./everforest-dark-CEGvuWza.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>N(()=>import(`./everforest-light-BGKTQKYD.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>N(()=>import(`./github-dark-D80zISrT.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>N(()=>import(`./github-dark-default-BUv0_3sU.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>N(()=>import(`./github-dark-dimmed-CuEI3RUT.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>N(()=>import(`./github-dark-high-contrast-CqJ6S95a.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>N(()=>import(`./github-light-Ds1z2XMh.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>N(()=>import(`./github-light-default-VLujVjUi.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>N(()=>import(`./github-light-high-contrast-CxeiO0FP.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-hard-BBygRmmV.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-medium-CimGs1J7.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-soft-BOCsSH9k.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-hard-ChQMTS2U.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-medium-l62I8Ms4.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-soft-CCPt2SY9.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>N(()=>import(`./horizon-C_qVygtZ.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>N(()=>import(`./horizon-bright-B7Z_XBIQ.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>N(()=>import(`./houston-BQstZrkk.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>N(()=>import(`./kanagawa-dragon-CAc2LRFn.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>N(()=>import(`./kanagawa-lotus-DvLUkLyh.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>N(()=>import(`./kanagawa-wave-BVpM7zGZ.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>N(()=>import(`./laserwave-D5LoZXQX.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>N(()=>import(`./light-plus-CL46aO56.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>N(()=>import(`./material-theme-B5ZTHqME.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>N(()=>import(`./material-theme-darker-BnWixryh.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>N(()=>import(`./material-theme-lighter-DSFHOoOQ.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>N(()=>import(`./material-theme-ocean-Dx383GZj.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>N(()=>import(`./material-theme-palenight-D4yUVIXW.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>N(()=>import(`./min-dark-D-xosi7l.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>N(()=>import(`./min-light-ByPAW3HC.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>N(()=>import(`./monokai-CvGZRlpZ.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>N(()=>import(`./night-owl-C2MlyHiZ.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>N(()=>import(`./night-owl-light-DaU19D4v.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>N(()=>import(`./nord-Cv5-TRWF.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>N(()=>import(`./one-dark-pro-BE_knhWR.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>N(()=>import(`./one-light-5Q3PFrOp.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>N(()=>import(`./plastic-BwnRK-3u.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>N(()=>import(`./poimandres-C7tYlE8I.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>N(()=>import(`./red-B_7XAHc2.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>N(()=>import(`./rose-pine-BAejRd5Y.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>N(()=>import(`./rose-pine-dawn-BnhnD1BF.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>N(()=>import(`./rose-pine-moon-GrEKCLmf.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>N(()=>import(`./slack-dark-BR8B10x9.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>N(()=>import(`./slack-ochin-CHoq3Ljy.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>N(()=>import(`./snazzy-light-CRCmrr4v.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>N(()=>import(`./solarized-dark-6XjlVp3T.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>N(()=>import(`./solarized-light-DkMUIXIj.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>N(()=>import(`./synthwave-84-BII9WYdg.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>N(()=>import(`./tokyo-night-BLxK2OaS.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>N(()=>import(`./vesper-BSHPbApa.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>N(()=>import(`./vitesse-black-BwVbzKbo.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>N(()=>import(`./vitesse-dark-Decwx7UD.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>N(()=>import(`./vitesse-light-VmXA3IDd.js`),[]))}].map(e=>[e.id,e.import])),S_=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function C_(){return 2147483648}function w_(){return typeof performance<`u`?performance.now():Date.now()}var T_=(e,t)=>e+(t-e%t)%t;async function E_(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=C_();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,T_(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:w_,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 D_=Object.defineProperty,O_=(e,t,n)=>t in e?D_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k_=(e,t,n)=>O_(e,typeof t==`symbol`?t:t+``,n),A_=null;function j_(e){throw new S_(e.UTF8ToString(e.getLastOnigError()))}var M_=class e{constructor(t){k_(this,`utf16Length`),k_(this,`utf8Length`),k_(this,`utf16Value`),k_(this,`utf8Value`),k_(this,`utf16OffsetToUtf8`),k_(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)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},N_=class e{constructor(t){if(k_(this,`id`,++e.LAST_ID),k_(this,`_onigBinding`),k_(this,`content`),k_(this,`utf16Length`),k_(this,`utf8Length`),k_(this,`utf16OffsetToUtf8`),k_(this,`utf8OffsetToUtf16`),k_(this,`ptr`),!A_)throw new S_(`Must invoke loadWasm first.`);this._onigBinding=A_,this.content=t;let n=new M_(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=A_.omalloc(1e4),e._sharedPtrInUse=!0,A_.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(A_)}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)}};k_(N_,`LAST_ID`,0),k_(N_,`_sharedPtr`,0),k_(N_,`_sharedPtrInUse`,!1);var P_=N_,F_=class{constructor(e){if(k_(this,`_onigBinding`),k_(this,`_ptr`),!A_)throw new S_(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new M_(e[r]);t[r]=i.createString(A_),n[r]=i.utf8Length}let r=A_.omalloc(4*e.length);A_.HEAPU32.set(t,r/4);let i=A_.omalloc(4*e.length);A_.HEAPU32.set(n,i/4);let a=A_.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)A_.ofree(t[n]);A_.ofree(i),A_.ofree(r),a===0&&j_(A_),this._onigBinding=A_,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 P_(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 I_(e){return typeof e.instantiator==`function`}function L_(e){return typeof e.default==`function`}function R_(e){return e.data!==void 0}function z_(e){return typeof Response<`u`&&e instanceof Response}function B_(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 V_;function H_(e){if(V_)return V_;async function t(){A_=await E_(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),I_(n)?n=await n.instantiator(t):L_(n)?n=await n.default(t):(R_(n)&&(n=n.data),z_(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await W_(n)(t):await G_(n)(t):B_(n)||n instanceof WebAssembly.Module?n=await U_(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await U_(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return V_=t(),V_}function U_(e){return t=>WebAssembly.instantiate(e,t)}function W_(e){return t=>WebAssembly.instantiateStreaming(e,t)}function G_(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function K_(e){return e&&await H_(e),{createScanner(e){return new F_(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new P_(e)}}}var q_=m_({langs:b_,themes:x_,engine:()=>K_(N(()=>import(`./wasm-D6xWlcdz.js`),[]))}),{codeToHtml:J_,codeToHast:Y_,codeToTokens:X_,codeToTokensBase:Z_,codeToTokensWithThemes:Q_,getSingletonHighlighter:$_,getLastGrammarState:ev}=g_(q_,{guessEmbeddedLanguages:eg});function tv(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function nv(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var rv=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),iv=String.raw;function av(e,t){if(e==null)throw Error(t??`Value expected`);return e}var ov=iv`\[\^?`,sv=`c.? | C(?:-.?)?|${iv`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${iv`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${iv`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${iv`o\{[^\}]*\}?`}|${iv`\d{1,3}`}`,cv=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,lv=new RegExp(iv`
22
+ \\ (?:
23
+ ${sv}
24
+ | [gk]<[^>]*>?
25
+ | [gk]'[^']*'?
26
+ | .
27
+ )
28
+ | \( (?:
29
+ \? (?:
30
+ [:=!>({]
31
+ | <[=!]
32
+ | <[^>]*>
33
+ | '[^']*'
34
+ | ~\|?
35
+ | #(?:[^)\\]|\\.?)*
36
+ | [^:)]*[:)]
37
+ )?
38
+ | \*[^\)]*\)?
39
+ )?
40
+ | (?:${cv.source})+
41
+ | ${ov}
42
+ | .
43
+ `.replace(/\s+/g,``),`gsu`),uv=new RegExp(iv`
44
+ \\ (?:
45
+ ${sv}
46
+ | .
47
+ )
48
+ | \[:(?:\^?\p{Alpha}+|\^):\]
49
+ | ${ov}
50
+ | &&
51
+ | .
52
+ `.replace(/\s+/g,``),`gsu`);function dv(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=Vv(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(lv.lastIndex=0;s=lv.exec(e);){let t=fv(a,e,s[0],lv.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(lv.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`?Uv(e,u):e).flat(),flags:r}}function fv(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=pv(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:_v(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:jv(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:vv(n)}}if(a===`K`)return{token:Tv(`keep`,n)};if(a===`N`||a===`R`)return{token:wv(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:wv(`any`,n)};if(a===`X`)return{token:wv(`text_segment`,n)};let e=hv(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:Iv(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:Fv(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Ov(`group`,n)};if(n===`(?>`)return{token:Ov(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Ov(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Ov(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Ov(`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:Dv(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
53
+ `,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:wv(`dot`,n)}:n===`^`||n===`$`?{token:_v(e.singleline?{"^":iv`\A`,$:iv`\Z`}[n]:n,n)}:n===`|`?{token:gv(n)}:cv.test(n)?{tokens:Wv(n)}:{token:yv(tv(n),n)}}function pv(e,t,n){let r=[Cv(t[1]===`^`,t)],i=1,a;for(uv.lastIndex=n;a=uv.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Cv(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(yv(93,e));else if(i--,r.push(bv(e)),!i)break}else{let t=mv(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:uv.lastIndex||e.length}}function mv(e){if(e[0]===`\\`)return hv(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!rv.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return wv(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?xv(e):e===`&&`?Sv(e):yv(tv(e),e)}function hv(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return Pv(e);if(`dDhHsSwW`.includes(n))return Rv(e);if(e.startsWith(iv`\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 zv(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 yv(tv(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return yv(Hv(e),e);if(Nv.has(n))return yv(Nv.get(n),e);if(/\d/.test(n))return Ev(t,e);if(e===`\\`)throw Error(iv`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return yv(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function gv(e){return{type:`Alternator`,raw:e}}function _v(e,t){return{type:`Assertion`,kind:e,raw:t}}function vv(e){return{type:`Backreference`,raw:e}}function yv(e,t){return{type:`Character`,value:e,raw:t}}function bv(e){return{type:`CharacterClassClose`,raw:e}}function xv(e){return{type:`CharacterClassHyphen`,raw:e}}function Sv(e){return{type:`CharacterClassIntersector`,raw:e}}function Cv(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function wv(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Tv(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:av(n.flags),raw:t}}function Ev(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Dv(e){return{type:`GroupClose`,raw:e}}function Ov(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function kv(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Av(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function jv(e){return{type:`Subroutine`,raw:e}}var Mv=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Nv=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function Pv(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return yv(tv(t.toUpperCase())-64,e)}function Fv(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=Bv(n),o=Bv(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Tv(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Ov(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function Iv(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=Mv.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 kv(l,r??null,i?.split(`,`)??null,e)}function Lv(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 Av(t,n,r,e)}function Rv(e){let t=e[1].toLowerCase();return wv({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function zv(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return wv(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function Bv(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 Vv(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 Hv(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 Uv(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[vv(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(iv`Octal encoded byte above 177 unsupported "${n}"`)}else r=tv(t);a.push(yv(r,(e===0?`\\`:``)+t))}return a}function Wv(e){let t=[],n=new RegExp(cv,`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(Lv(e.slice(0,-1)));continue}}}t.push(Lv(e))}return t}function Gv(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 Kv(e){return qv.has(e.type)}var qv=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function Jv(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=dv(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 iy();case`Assertion`:return Yv(n);case`Backreference`:return Xv(n,a);case`Character`:return cy(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return Zv(n,a,t);case`CharacterClassOpen`:return Qv(n,a,t);case`CharacterSet`:return $v(n,a);case`Directive`:return fy(n.kind,{flags:n.flags});case`GroupOpen`:return ey(n,a,t);case`NamedCallout`:return gy(n.kind,n.tag,n.arguments);case`Quantifier`:return ty(n,a);case`Subroutine`:return ny(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=yy(py(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(iv`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(iv`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Yv({kind:e}){return ay(av({"^":`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===iv`\B`||e===iv`\Y`})}function Xv({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,oy(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 oy(r)}return i(+r)}function Zv(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(),uy(o,e);throw Error(`Invalid character class range`)}return cy(tv(`-`))}function Qv({negate:e},t,n){let{tokens:r,walk:i}=t,a=r[t.nextIndex],o=[ly()],s=Ay(a);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)o.push(ly()),t.nextIndex++;else{let e=o.at(-1);e.body.push(i(e,n))}s=Ay(r[t.nextIndex],a)}let c=ly({negate:e});return o.length===1?c.body=o[0].body:(c.kind=`intersection`,c.body=o.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function $v({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=ky(n);if(rv.has(r)&&!o?.has(r))e=`posix`,n=r;else return xy(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?_y(n,{negate:t}):dy(e,{negate:t})}function ey(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=Sy(e),l=c.type===`AbsenceFunction`,u=Ey(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&nv(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=jy(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(iy()),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(Ty(t)||t.type===`CapturingGroup`)throw Error(e)}else if(Ty(t)||Ey(t)&&t.negate)throw Error(e)}}f=jy(r[t.nextIndex])}return t.nextIndex++,c}function ty({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Kv(a))throw Error(`Quantifier requires a repeatable token`);let o=vy(e,t,n,a);return i.body.pop(),o}function ny({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=by(i);return r.push(o),o}function ry(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:Cy(t?.body)}}function iy(e){return{type:`Alternative`,body:wy(e?.body)}}function ay(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function oy(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function sy(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!Dy(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:Cy(t?.body)}}function cy(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 ly(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:wy(e?.body)}}function uy(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function dy(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 fy(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:av(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function py(e){return{type:`Flags`,...e}}function my(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:Cy(e?.body)}}function hy(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:Cy(e?.body)}}function gy(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function _y(e,t){let n=!!t?.negate;if(!rv.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function vy(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 yy(e,t){return{type:`Regex`,body:Cy(t?.body),flags:e}}function by(e){return{type:`Subroutine`,ref:e}}function xy(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(ky(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Oy(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(iv`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function Sy({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return ry(`repeater`);case`atomic`:return my({atomic:!0});case`capturing`:return sy(i,{name:n});case`group`:return my({flags:e});case`lookahead`:case`lookbehind`:return hy({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function Cy(e){if(e===void 0)e=[iy()];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 wy(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 Ty(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function Ey(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function Dy(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Oy(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 ky(e){return e.replace(/[- _]+/g,``).toLowerCase()}function Ay(e,t){return av(e,`${t?.type===`Character`&&t.value===93?`Empty`:`Unclosed`} character class`)}function jy(e){return av(e,`Unclosed group`)}function My(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(){Ny(c).splice(Math.max(0,Py(s)+l),1),l--,u=!0},removeAllNextSiblings(){return Ny(c).splice(Py(s)+1)},removeAllPrevSiblings(){let e=Py(s)+l;return l-=e,Ny(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,Py(s)+l)]=e:av(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(Ny(c).splice(Math.max(0,Py(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,Py(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`CapturingGroup`:case`Group`:r(a.body,a);break;case`Alternative`:case`CharacterClass`: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`LookaroundAssertion`:r(a.body,a);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 Ny(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function Py(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var Fy=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Iy(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Ly(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Ry=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function zy(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===Ry.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?Ry.CHAR_CLASS:Ry.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 By(e,t,n,r){zy(e,t,n,r)}function Vy(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===Ry.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function Hy(e,t,n){return!!Vy(e,t,0,n)}function Uy(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 Wy=new RegExp(String.raw`(?<noncapturingStart>${Fy})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function Gy(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(Wy.lastIndex=Number.isNaN(c)?0:c+7;f=Wy.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),Iy(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=zy(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}`},Ry.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var Ky=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,qy=new RegExp(String.raw`
54
+ \\(?: \d+
55
+ | c[A-Za-z]
56
+ | [gk]<[^>]+>
57
+ | [pPu]\{[^\}]+\}
58
+ | u[A-Fa-f\d]{4}
59
+ | x[A-Fa-f\d]{2}
60
+ )
61
+ | \((?: \? (?: [:=!>]
62
+ | <(?:[=!]|[^>]+>)
63
+ | [A-Za-z\-]+:
64
+ | \(DEFINE\)
65
+ ))?
66
+ | (?<qBase>${Ky})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
67
+ | \\?.
68
+ `.replace(/\s+/g,``),`gsu`);function Jy(e){if(!RegExp(`${Ky}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(qy.lastIndex=0;o=qy.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=Ly(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}qy.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null);i=s}return{pattern:e}}var Yy=String.raw,Xy=Yy`\(\?R=(?<rDepth>[^\)]+)\)|${Yy`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,Zy=Yy`\(\?<(?![=!])(?<captureName>[^>]+)>`,Qy=Yy`${Zy}|(?<unnamed>\()(?!\?)`,$y=new RegExp(Yy`${Zy}|${Xy}|\(\?|\\?.`,`gsu`),eb=`Cannot use multiple overlapping recursions`;function tb(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(Xy,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&Hy(e,Yy`\(\?\(DEFINE\)`,Ry.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=Hy(e,Yy`\\[1-9]`,Ry.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for($y.lastIndex=0;f=$y.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(nb(m),l)throw Error(eb);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($y.lastIndex);if(Hy(s,Xy,Ry.DEFAULT))throw Error(eb);let c=m-1;e=rb(t,s,c,!1,n,a,d),i=ob(i,t,c,a.length,0,d);break}else if(h){nb(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(eb);break}if(!u)throw Error(Yy`Recursive \g cannot be used outside the referenced group "${r===`external`?h:Yy`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=Uy(e,p);if(o&&Hy(m,Yy`${Zy}|\((?!\?)`,Ry.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=rb(_,v,b,!0,n,a,d);i=ob(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,$y.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),$y.lastIndex),s.set(p,$y.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),$y.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function nb(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 rb(e,t,n,r,i,a,o){let s=new Set;r&&By(e+t,Zy,({groups:{captureName:e}})=>{s.add(e)},Ry.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${ib(`(?:${e}`,`forward`,...c)}(?:)${ib(`${t})`,`backward`,...c)}${t}`}function ib(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+=zy(e,Yy`${Qy}|\\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),ab(i,n),s?e:`(?<${t}${l}>`}return Yy`\k<${c}${l}>`},Ry.DEFAULT)}return c}function ab(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function ob(e,t,n,r,i,a){if(e.size&&r){let o=0;By(t,Qy,()=>o++,Ry.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 sb=String.fromCodePoint,cb=String.raw,lb={},ub=globalThis.RegExp;lb.flagGroups=(()=>{try{new ub(`(?i:)`)}catch{return!1}return!0})(),lb.unicodeSets=(()=>{try{new ub(`[[]]`,`v`)}catch{return!1}return!0})(),lb.bugFlagVLiteralHyphenIsRange=lb.unicodeSets?(()=>{try{new ub(cb`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,lb.bugNestedClassIgnoresNegation=lb.unicodeSets&&new ub(`[[^a]]`,`v`).test(`a`);function db(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function fb(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function pb(e,t){return hb[e]>=hb[t]}function mb(e,t){if(e==null)throw Error(t??`Value expected`);return e}var hb={ES2025:2025,ES2024:2024,ES2018:2018},gb={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function _b(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!gb[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=lb.flagGroups?`ES2025`:lb.unicodeSets?`ES2024`:`ES2018`),t}var vb=`[ -\r ]`,yb=new Set([sb(304),sb(305)]),bb=cb`[\p{L}\p{M}\p{N}\p{Pc}]`;function xb(e){if(yb.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Tb.get(n),a=Cb.get(n),o=wb.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 Sb=new Map(`C Other
69
+ Cc Control cntrl
70
+ Cf Format
71
+ Cn Unassigned
72
+ Co Private_Use
73
+ Cs Surrogate
74
+ L Letter
75
+ LC Cased_Letter
76
+ Ll Lowercase_Letter
77
+ Lm Modifier_Letter
78
+ Lo Other_Letter
79
+ Lt Titlecase_Letter
80
+ Lu Uppercase_Letter
81
+ M Mark Combining_Mark
82
+ Mc Spacing_Mark
83
+ Me Enclosing_Mark
84
+ Mn Nonspacing_Mark
85
+ N Number
86
+ Nd Decimal_Number digit
87
+ Nl Letter_Number
88
+ No Other_Number
89
+ P Punctuation punct
90
+ Pc Connector_Punctuation
91
+ Pd Dash_Punctuation
92
+ Pe Close_Punctuation
93
+ Pf Final_Punctuation
94
+ Pi Initial_Punctuation
95
+ Po Other_Punctuation
96
+ Ps Open_Punctuation
97
+ S Symbol
98
+ Sc Currency_Symbol
99
+ Sk Modifier_Symbol
100
+ Sm Math_Symbol
101
+ So Other_Symbol
102
+ Z Separator
103
+ Zl Line_Separator
104
+ Zp Paragraph_Separator
105
+ Zs Space_Separator
106
+ ASCII
107
+ ASCII_Hex_Digit AHex
108
+ Alphabetic Alpha
109
+ Any
110
+ Assigned
111
+ Bidi_Control Bidi_C
112
+ Bidi_Mirrored Bidi_M
113
+ Case_Ignorable CI
114
+ Cased
115
+ Changes_When_Casefolded CWCF
116
+ Changes_When_Casemapped CWCM
117
+ Changes_When_Lowercased CWL
118
+ Changes_When_NFKC_Casefolded CWKCF
119
+ Changes_When_Titlecased CWT
120
+ Changes_When_Uppercased CWU
121
+ Dash
122
+ Default_Ignorable_Code_Point DI
123
+ Deprecated Dep
124
+ Diacritic Dia
125
+ Emoji
126
+ Emoji_Component EComp
127
+ Emoji_Modifier EMod
128
+ Emoji_Modifier_Base EBase
129
+ Emoji_Presentation EPres
130
+ Extended_Pictographic ExtPict
131
+ Extender Ext
132
+ Grapheme_Base Gr_Base
133
+ Grapheme_Extend Gr_Ext
134
+ Hex_Digit Hex
135
+ IDS_Binary_Operator IDSB
136
+ IDS_Trinary_Operator IDST
137
+ ID_Continue IDC
138
+ ID_Start IDS
139
+ Ideographic Ideo
140
+ Join_Control Join_C
141
+ Logical_Order_Exception LOE
142
+ Lowercase Lower
143
+ Math
144
+ Noncharacter_Code_Point NChar
145
+ Pattern_Syntax Pat_Syn
146
+ Pattern_White_Space Pat_WS
147
+ Quotation_Mark QMark
148
+ Radical
149
+ Regional_Indicator RI
150
+ Sentence_Terminal STerm
151
+ Soft_Dotted SD
152
+ Terminal_Punctuation Term
153
+ Unified_Ideograph UIdeo
154
+ Uppercase Upper
155
+ Variation_Selector VS
156
+ White_Space space
157
+ XID_Continue XIDC
158
+ XID_Start XIDS`.split(/\s/).map(e=>[ky(e),e])),Cb=new Map([[`s`,sb(383)],[sb(383),`s`]]),wb=new Map([[sb(223),sb(7838)],[sb(107),sb(8490)],[sb(229),sb(8491)],[sb(969),sb(8486)]]),Tb=new Map([Ob(453),Ob(456),Ob(459),Ob(498),...kb(8072,8079),...kb(8088,8095),...kb(8104,8111),Ob(8124),Ob(8140),Ob(8188)]),Eb=new Map([[`alnum`,cb`[\p{Alpha}\p{Nd}]`],[`alpha`,cb`\p{Alpha}`],[`ascii`,cb`\p{ASCII}`],[`blank`,cb`[\p{Zs}\t]`],[`cntrl`,cb`\p{Cc}`],[`digit`,cb`\p{Nd}`],[`graph`,cb`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,cb`\p{Lower}`],[`print`,cb`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,cb`[\p{P}\p{S}]`],[`space`,cb`\p{space}`],[`upper`,cb`\p{Upper}`],[`word`,cb`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,cb`\p{AHex}`]]);function Db(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Ob(e){let t=sb(e);return[t.toLowerCase(),t]}function kb(e,t){return Db(e,t).map(e=>Ob(e))}var Ab=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function jb(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Fb(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:pb(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};My(e,Mb,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 My(e,Nb,a),My(e,Pb,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Mb={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=my();e.body[0].body.push(hy({negate:!0,body:r}),xy(`Any`));let i=my();i.body[0].body.push(vy(`greedy`,0,1/0,e)),n(ex(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];fb(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Hb(t.get(e));if(n){let t=my({flags:n});t.body[0].body=e.body,e.body=[ex(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(ex(hy({body:[iy({body:[ay(`string_end`)]}),iy({body:[cy(10)]})]}),t));else if(c===`line_start`)o(ex(Zb(cb`(?<=\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&&Jb(e))o(ex(hy({negate:!0}),t));else if(d)throw Error(cb`Uses "\G" in a way that requires a subclass`);else o($b(ay(`string_start`),t)),s.strategy=`clip_search`}else if(!(c===`string_end`||c===`string_start`))if(c===`string_end_newline`)o(ex(Zb(cb`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${bb})(?!${bb})|(?<!${bb})(?=${bb}))`,n=`(?:(?<=${bb})(?=${bb})|(?<!${bb})(?!${bb}))`;o(ex(Zb(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Xb(n)&&(n=Vb(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Xb(r)&&(r=Vb(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(ex(ly({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($b(dy(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(ex(Qb(Zb(vb),l),t));return}if(s&&(c===`word`||u===`word`)){n($b(dy(`word`,{negate:l}),t));return}if(c===`any`)n($b(xy(`Any`),t));else if(c===`digit`)n($b(xy(`Nd`,{negate:l}),t));else if(c!==`dot`)if(c===`text_segment`){if(r===`strict`)throw Error(cb`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=cb`\p{RI}{2}|${e}(?:\u200D${e})*`;n(ex(Zb(cb`(?>\r\n|${i?cb`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n($b(xy(`AHex`,{negate:l}),t));else if(c===`newline`)n(ex(Zb(l?`[^
159
+ ]`:`(?>\r
160
+ ?|[
161
+ \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-${sb(e.codePointAt(0)-1)}${sb(e.codePointAt(2)+1)}-\u{10FFFF}`),n(ex(Zb(`[${e}]`),t))}else n(ex(Qb(Zb(Eb.get(u)),l),t));else if(c===`property`)Sb.has(ky(u))||(e.key=`sc`);else if(c===`space`)n($b(xy(`space`,{negate:l}),t));else if(c===`word`)n(ex(Qb(Zb(bb),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=my({flags:c});e.body[0].body=o(),i(ex(e,t),{traverse:!0})}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Gv(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(cb`Uses "\K" in a way that's unsupported`);let o=hy({behind:!0});o.body[0].body=a(),i(ex(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(ex(hy({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=my();t.body[0].body.push(e.body),e.body=ex(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=Gb(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(cb`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Xb(n)&&(n=Vb(n,t),e.ref=n)}},Nb={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=$b(zb(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&fb(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=fb(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.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=db(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?zb(0):Rb(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Hb(Bb(o,e=>e.type===`Group`&&!!e.flags)),t=e?db(r.globalFlags,e):r.globalFlags;Ib(t,r.currentFlags)||(l=my({flags:Ub(t)}),l.body[0].body.push(c))}n(ex(l,t),{traverse:!s})}},Pb={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=>Lb(t,e));i.length?i.length>1?n(ex(my({atomic:!0,body:i.reverse().map(e=>iy({body:[oy(e.number)]}))}),t)):e.ref=i[0].number:n(ex(hy({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=sy();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Fb(e){My(e,{"*"({node:e,parent:t}){e.parent=t}})}function Ib(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Lb(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Wb(n.parent);for(let r of t){if(r===n)break;if(r===e||Kb(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Rb(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]=Rb(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function zb(e){let t=by(e);return t.isRecursive=!0,t}function Bb(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Vb(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 Hb(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 Ub({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 Wb(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Gb(e){let t=e.find(e=>e.kind===`search_start`||Yb(e,{negate:!1})||!qb(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=Gb(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Kb(e,t){let n=Wb(e)??[];for(let e of n)if(e===t||Kb(e,t))return!0;return!1}function qb({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function Jb(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Yb(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Gv(e.body[0],{type:`Assertion`,kind:`search_start`})}function Xb(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Zb(e,t){let n=Jv(e,{...t,unicodePropertyMap:Sb}).body;return n.length>1||n[0].body.length>1?my({body:n}):n[0].body[0]}function Qb(e,t){return e.negate=t,e}function $b(e,t){return e.parent=t,e}function ex(e,t){return Fb(e),e.parent=t,e}function tx(e,t){let n=_b(t),r=pb(n.target,`ES2024`),i=pb(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];My(e,nx,{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,mb(rx[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&&fb(f._captureTransfers,e.transferTo,[]).push(t)}),f}var nx={"*":{enter({node:e},t){if(hx(e)){let n=t.getCurrentModI();t.pushModI(e.flags?db({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){hx(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){lx(sb(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),ux(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Ab.has(e.value)&&t.setHasCasedChar()}},rx={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?cb`\B`:cb`\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=sb(e),r=dx(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&lx(n)){let e=xb(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`);lb.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(_x)&&(o=[cy(45),...o.filter(e=>!_x(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||lb.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=my(),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=iy({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`&&!(lb.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=dx(n,i),o=dx(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&fx(ux(e)).forEach(e=>{s.add(Array.isArray(e)?`${dx(e[0],i)}-${dx(e[1],i)}`:dx(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?`.`:`[^]`:cb`[^\n]`;if(e===`digit`)return t?cb`\D`:cb`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Ab.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?cb`\P`:cb`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?cb`\W`:cb`\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=db(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${px(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)+mx(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})`:cb`\g<${t}&R=${r}>`}},ix=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),ax=new Set([`-`,`\\`,`]`,`^`,`[`]),ox=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),sx=new Map([[9,cb`\t`],[10,cb`\n`],[11,cb`\v`],[12,cb`\f`],[13,cb`\r`],[8232,cb`\u2028`],[8233,cb`\u2029`],[65279,cb`\uFEFF`]]),cx=/^\p{Cased}$/u;function lx(e){return cx.test(e)}function ux(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=sb(e);if(!lx(t))continue;let o=xb(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function dx(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(sx.has(e))return sx.get(e);if(e<32||e>126&&e<160||e>262143||t&&gx(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?ox:ax:ix,a=sb(e);return(i.has(a)?`\\`:``)+a}function fx(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 px(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 mx({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 hx({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function gx(e){return e>47&&e<58}function _x({type:e,value:t}){return e===`Character`&&t===45}var vx=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=bx(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&&(yx(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||=xx(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 yx(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 bx(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)fb(n,t,{}).transferTo=e;return n}function xx(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 Sx(e,t){let n=Cx(e,t);return n.options?new vx(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Cx(e,t){let n=_b(t),r=jb(Jv(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Sb}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=tx(r,n),a=tb(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=Gy(Jy(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}var wx=4294967295,Tx=class{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}})}regexps;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:wx,end:wx,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 Ex(e,t){return Sx(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Dx(e={}){let t=Object.assign({target:`auto`,cache:new Map},e);return t.regexConstructor||=e=>Ex(e,{target:t.target}),{createScanner(e){return new Tx(e,t)},createString(e){return{content:e}}}}var Ox=Dx({forgiving:!0}),kx=Object.fromEntries(__.flatMap(e=>(e.aliases??[]).map(t=>[t,e.id]))),Ax=new Set(Object.keys(b_)),jx=e=>{let t=e.trim().toLowerCase();return kx[t]||(Ax.has(t),t)},Mx=new Map,Nx=new Map,Px=new Map,Fx=e=>typeof e==`string`?e:e.name??`custom`,Ix=(e,t)=>`${e}-${Fx(t[0])}-${Fx(t[1])}`,Lx=(e,t,n)=>{let r=e.slice(0,100),i=e.length>100?e.slice(-100):``;return`${t}:${n[0]}:${n[1]}:${e.length}:${r}:${i}`},Rx=(e,t)=>{let n=Ix(e,t);if(Mx.has(n))return Mx.get(n);let r=q_({themes:t,langs:[e],engine:Ox});return Mx.set(n,r),r};function zx(e={}){let t=e.themes??[`github-light`,`github-dark`];return{name:`shiki`,type:`code-highlighter`,supportsLanguage(e){let t=jx(e);return Ax.has(t)},getSupportedLanguages(){return Array.from(Ax)},getThemes(){return t},highlight({code:e,language:t,themes:n},r){let i=jx(t),a=[Fx(n[0]),Fx(n[1])],o=Lx(e,i,a);return Nx.has(o)?Nx.get(o):(r&&(Px.has(o)||Px.set(o,new Set),Px.get(o).add(r)),Rx(Ax.has(i)?i:`text`,n).then(t=>{let n=t.getLoadedLanguages().includes(i)?i:`text`,r=t.codeToTokens(e,{lang:n,themes:{light:a[0],dark:a[1]}});Nx.set(o,r);let s=Px.get(o);if(s){for(let e of s)e(r);Px.delete(o)}}).catch(e=>{console.error(`[Streamdown Code] Failed to highlight code:`,e),Px.delete(o)}),null)}}}var Bx=zx();function Vx(e,t){return Hx(e,t||{})||{type:`root`,children:[]}}function Hx(e,t){let n=Ux(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function Ux(e,t){switch(e.nodeType){case 1:return Jx(e,t);case 3:return Kx(e);case 8:return qx(e);case 9:return Wx(e,t);case 10:return Gx();case 11:return Wx(e,t);default:return}}function Wx(e,t){return{type:`root`,children:Yx(e,t)}}function Gx(){return{type:`doctype`}}function Kx(e){return{type:`text`,value:e.nodeValue||``}}function qx(e){return{type:`comment`,value:e.nodeValue||``}}function Jx(e,t){let n=e.namespaceURI,r=n===_.svg?k:C,i=n===_.html?e.tagName.toLowerCase():e.tagName,a=n===_.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,Yx(a,t))}function Yx(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=Hx(n[i],t);e!==void 0&&r.push(e)}return r}var Xx=new DOMParser;function Zx(e,t){return Vx(t?.fragment?Qx(e):Xx.parseFromString(e,`text/html`))}function Qx(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}var $x=(function(e,t,n){let r=o(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),eS=(function(e){if(e==null)return iS;if(typeof e==`string`)return nS(e);if(typeof e==`object`)return tS(e);if(typeof e==`function`)return rS(e);throw Error("Expected function, string, or array as `test`")});function tS(e){let t=[],n=-1;for(;++n<e.length;)t[n]=eS(e[n]);return rS(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function nS(e){return rS(t);function t(t){return t.tagName===e}}function rS(e){return t;function t(t,n,r){return!!(aS(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function iS(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function aS(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var oS=/\n/g,sS=/[\t ]+/g,cS=eS(`br`),lS=eS(SS),uS=eS(`p`),dS=eS(`tr`),fS=eS([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,xS,CS]),pS=eS(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function mS(e,t){let n=t||{},r=`children`in e?e.children:[],i=pS(e),a=bS(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(..._S(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...hS(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?cS(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
162
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function hS(e,t,n){return e.type===`element`?gS(e,t,n):e.type===`text`?n.whitespace===`normal`?_S(e,n):vS(e):[]}function gS(e,t,n){let r=bS(e,n),i=e.children||[],a=-1,o=[];if(fS(e))return o;let s,c;for(cS(e)||dS(e)&&$x(t,e,dS)?c=`
163
+ `:uS(e)?(s=2,c=2):pS(e)&&(s=1,c=1);++a<i.length;)o=o.concat(hS(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?cS(i[a+1]):c}));return lS(e)&&$x(t,e,lS)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function _S(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){oS.lastIndex=a;let e=oS.exec(n),i=e&&`index`in e?e.index:n.length;r.push(yS(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function vS(e){return[String(e.value)]}function yS(e,t,n){let r=[],i=0,a;for(;i<e.length;){sS.lastIndex=i;let n=sS.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function bS(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function xS(e){return!!(e.properties||{}).hidden}function SS(e){return e.tagName===`td`||e.tagName===`th`}function CS(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var wS={},TS=[];function ES(e){let t=e||wS;return function(e,n){p(e,`element`,function(e,r){let i=Array.isArray(e.properties.className)?e.properties.className:TS,a=i.includes(`language-math`),o=i.includes(`math-display`),s=i.includes(`math-inline`),c=o;if(!a&&!o&&!s)return;let l=r[r.length-1],u=e;if(e.tagName===`code`&&a&&l&&l.type===`element`&&l.tagName===`pre`&&(u=l,l=r[r.length-2],c=!0),!l)return;let d=mS(u,{whitespace:`pre`}),f;try{f=P.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(i){let a=i,o=a.name.toLowerCase();n.message(`Could not render math with KaTeX`,{ancestors:[...r,e],cause:a,place:e.position,ruleId:o,source:`rehype-katex`});try{f=P.renderToString(d,{...t,displayMode:c,strict:`ignore`,throwOnError:!1})}catch{f=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(t.errorColor||`#cc0000`),title:String(i)},children:[{type:`text`,value:d}]}]}}typeof f==`string`&&(f=Zx(f,{fragment:!0}).children);let p=l.children.indexOf(u);return l.children.splice(p,1,...f),M})}}function DS(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function OS(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
164
+ `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(O(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
165
+ `,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
166
+ `),i&&(c+=a.move(i+`
167
+ `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var kS={tokenize:jS,concrete:!0,name:`mathFlow`},AS={tokenize:MS,partial:!0};function jS(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return c;function c(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),l(t)}function l(t){return t===36?(e.consume(t),o++,l):o<2?n(t):(e.exit(`mathFlowFenceSequence`),T(e,u,`whitespace`)(t))}function u(t){return t===null||s(t)?f(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),d(t))}function d(t){return t===null||s(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),f(t)):t===36?n(t):(e.consume(t),d)}function f(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(AS,p,_)(n)}function p(t){return e.attempt({tokenize:v,partial:!0},_,m)(t)}function m(t){return(a?T(e,h,`linePrefix`,a+1):h)(t)}function h(t){return t===null?_(t):s(t)?e.attempt(AS,p,_)(t):(e.enter(`mathFlowValue`),g(t))}function g(t){return t===null||s(t)?(e.exit(`mathFlowValue`),h(t)):(e.consume(t),g)}function _(n){return e.exit(`mathFlow`),t(n)}function v(e,t,n){let i=0;return T(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(i++,e.consume(t),c):i<o?n(t):(e.exit(`mathFlowFenceSequence`),T(e,l,`whitespace`)(t))}function l(r){return r===null||s(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function MS(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function NS(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:PS,previous:FS,name:`mathText`};function n(e,n,r){let i=0,a,o;return c;function c(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),l(t)}function l(n){return n===36?(e.consume(n),i++,l):i<2&&!t?r(n):(e.exit(`mathTextSequence`),u(n))}function u(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,f(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),u):s(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),u):(e.enter(`mathTextData`),d(t))}function d(t){return t===null||t===32||t===36||s(t)?(e.exit(`mathTextData`),u(t)):(e.consume(t),d)}function f(t){return t===36?(e.consume(t),a++,f):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,d(t))}}}function PS(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function FS(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function IS(e){return{flow:{36:kS},text:{36:NS(e)}}}var LS={};function RS(e){let t=this,n=e||LS,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(IS(n)),a.push(DS()),o.push(OS(n))}function zS(e={}){return{name:`katex`,type:`math`,remarkPlugin:[RS,{singleDollarTextMath:e.singleDollarTextMath??!1}],rehypePlugin:[ES,{errorColor:e.errorColor??`var(--color-muted-foreground)`}],getStyles(){return`katex/dist/katex.min.css`}}}var BS=zS(),VS=`comm`,HS=`rule`,US=`decl`,WS=`@import`,GS=`@namespace`,KS=`@keyframes`,qS=`@layer`,JS=Math.abs,YS=String.fromCharCode;function XS(e){return e.trim()}function ZS(e,t,n){return e.replace(t,n)}function QS(e,t,n){return e.indexOf(t,n)}function $S(e,t){return e.charCodeAt(t)|0}function eC(e,t,n){return e.slice(t,n)}function tC(e){return e.length}function nC(e){return e.length}function rC(e,t){return t.push(e),e}var iC=1,aC=1,oC=0,sC=0,cC=0,lC=``;function uC(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:iC,column:aC,length:o,return:``,siblings:s}}function dC(){return cC}function fC(){return cC=sC>0?$S(lC,--sC):0,aC--,cC===10&&(aC=1,iC--),cC}function pC(){return cC=sC<oC?$S(lC,sC++):0,aC++,cC===10&&(aC=1,iC++),cC}function mC(){return $S(lC,sC)}function hC(){return sC}function gC(e,t){return eC(lC,e,t)}function _C(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function vC(e){return iC=aC=1,oC=tC(lC=e),sC=0,[]}function yC(e){return lC=``,e}function bC(e){return XS(gC(sC-1,CC(e===91?e+2:e===40?e+1:e)))}function xC(e){for(;(cC=mC())&&cC<33;)pC();return _C(e)>2||_C(cC)>3?``:` `}function SC(e,t){for(;--t&&pC()&&!(cC<48||cC>102||cC>57&&cC<65||cC>70&&cC<97););return gC(e,hC()+(t<6&&mC()==32&&pC()==32))}function CC(e){for(;pC();)switch(cC){case e:return sC;case 34:case 39:e!==34&&e!==39&&CC(cC);break;case 40:e===41&&CC(e);break;case 92:pC();break}return sC}function wC(e,t){for(;pC()&&e+cC!==57&&!(e+cC===84&&mC()===47););return`/*`+gC(t,sC-1)+`*`+YS(e===47?e:pC())}function TC(e){for(;!_C(mC());)pC();return gC(e,sC)}function EC(e){return yC(DC(``,null,null,null,[``],e=vC(e),0,[0],e))}function DC(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=pC()){case 40:if(m!=108&&$S(C,d-1)==58){QS(C+=ZS(bC(v),`&`,`&\f`),`&\f`,JS(l?s[l-1]:0))!=-1&&(_=-1);break}case 34:case 39:case 91:C+=bC(v);break;case 9:case 10:case 13:case 32:C+=xC(m);break;case 92:C+=SC(hC()-1,7);continue;case 47:switch(mC()){case 42:case 47:rC(kC(wC(pC(),hC()),t,n,c),c),(_C(m||1)==5||_C(mC()||1)==5)&&tC(C)&&eC(C,-1,void 0)!==` `&&(C+=` `);break;default:C+=`/`}break;case 123*h:s[l++]=tC(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=ZS(C,/\f/g,``)),p>0&&(tC(C)-d||h===0&&m===47)&&rC(p>32?AC(C+`;`,r,n,d-1,c):AC(ZS(C,` `,``)+`;`,r,n,d-2,c),c);break;case 59:C+=`;`;default:if(rC(S=OC(C,t,n,l,u,i,s,y,b=[],x=[],d,a),a),v===123)if(u===0)DC(C,t,S,S,b,a,d,s,x);else{switch(f){case 99:if($S(C,3)===110)break;case 108:if($S(C,2)===97)break;default:u=0;case 100:case 109:case 115:}u?DC(e,S,S,r&&rC(OC(e,S,S,0,0,i,s,y,i,b=[],d,x),x),i,x,d,s,r?b:x):DC(C,S,S,S,[``],x,0,s,x)}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+tC(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&fC()==125)continue}switch(C+=YS(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(tC(C)-1)*_,_=1;break;case 64:mC()===45&&(C+=bC(pC())),f=mC(),u=d=tC(y=C+=TC(hC())),v++;break;case 45:m===45&&tC(C)==2&&(h=0)}}return a}function OC(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=nC(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=eC(e,f+1,f=JS(g=o[h])),b=e;v<m;++v)(b=XS(g>0?p[v]+` `+y:ZS(y,/&\f/g,p[v])))&&(c[_++]=b);return uC(e,t,n,i===0?HS:s,c,l,u,d)}function kC(e,t,n,r){return uC(e,t,n,VS,YS(dC()),eC(e,2,-2),0,r)}function AC(e,t,n,r,i){return uC(e,t,n,US,eC(e,0,r),eC(e,r+1,-1),r,i)}function jC(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function MC(e,t,n,r){switch(e.type){case qS:if(e.children.length)break;case WS:case GS:case US:return e.return=e.return||e.value;case VS:return``;case KS:return e.return=e.value+`{`+jC(e.children,r)+`}`;case HS:if(!tC(e.value=e.props.join(`,`)))return``}return tC(n=jC(e.children,r))?e.return=e.value+`{`+n+`}`:``}var NC=`c4`,PC={id:NC,detector:I(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./c4Diagram-AHTNJAMY-CWB837fW.js`);return{diagram:e}},__vite__mapDeps([102,103,1,104,105,106,107,108,109]));return{id:NC,diagram:e}},`loader`)},FC=`flowchart`,IC={id:FC,detector:I((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-Bktw281T.js`);return{diagram:e}},__vite__mapDeps([110,111,104,1,105,103,106,107,108,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,109]));return{id:FC,diagram:e}},`loader`)},LC=`flowchart-v2`,RC={id:LC,detector:I((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-Bktw281T.js`);return{diagram:e}},__vite__mapDeps([110,111,104,1,105,103,106,107,108,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,109]));return{id:LC,diagram:e}},`loader`)},zC=`er`,BC={id:zC,detector:I(e=>/^\s*erDiagram/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./erDiagram-SMLLAGMA-Bx1_Os8W.js`);return{diagram:e}},__vite__mapDeps([127,111,104,1,105,103,106,107,108,112,113,114,115,116,117,118,119,120,121,122,123,124]));return{id:zC,diagram:e}},`loader`)},VC=`gitGraph`,HC={id:VC,detector:I(e=>/^\s*gitGraph/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-UUTBAWPF-ChQ9Ghgn.js`);return{diagram:e}},__vite__mapDeps([128,129,107,130,1,131,108,132,133,134,135,136,137,138,139,140,141,142,104,105,103,106,143,144]));return{id:VC,diagram:e}},`loader`)},UC=`gantt`,WC={id:UC,detector:I(e=>/^\s*gantt/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./ganttDiagram-T4ZO3ILL-BMXeVYqc.js`);return{diagram:e}},__vite__mapDeps([145,1,103,146,104,147,148,105,106,107,108]));return{id:UC,diagram:e}},`loader`)},GC=`info`,KC={id:GC,detector:I(e=>/^\s*info/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./infoDiagram-42DDH7IO-Dsx5n_6C.js`);return{diagram:e}},__vite__mapDeps([149,129,107,130,1,131,108,132,133,134,135,136,137,138,139,140,141,142,104,106,150]));return{id:GC,diagram:e}},`loader`)},qC=`pie`,JC={id:qC,detector:I(e=>/^\s*pie/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./pieDiagram-DEJITSTG-C2vsUYuj.js`);return{diagram:e}},__vite__mapDeps([151,103,1,129,107,130,131,108,132,133,134,135,136,137,138,139,140,141,142,104,120,152,148,153,121,105,106,150,143]));return{id:qC,diagram:e}},`loader`)},YC=`quadrantChart`,XC={id:YC,detector:I(e=>/^\s*quadrantChart/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./quadrantDiagram-34T5L4WZ-CwMD-RYU.js`);return{diagram:e}},__vite__mapDeps([154,146,104,1,147,148,106,107]));return{id:YC,diagram:e}},`loader`)},ZC=`xychart`,QC={id:ZC,detector:I(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./xychartDiagram-5P7HB3ND-DWFCOGcC.js`);return{diagram:e}},__vite__mapDeps([155,111,104,1,105,103,106,107,108,146,147,148,152,119,120,121,150]));return{id:ZC,diagram:e}},`loader`)},$C=`requirement`,ew={id:$C,detector:I(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./requirementDiagram-MS252O5E-J4ulsCM6.js`);return{diagram:e}},__vite__mapDeps([156,111,104,1,105,103,106,107,108,113,114,115,116,117,118,119,120,121,122,123,124]));return{id:$C,diagram:e}},`loader`)},tw=`sequence`,nw={id:tw,detector:I(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./sequenceDiagram-FGHM5R23-b4aQT_5K.js`);return{diagram:e}},__vite__mapDeps([157,103,1,104,105,106,107,108,144,126,109]));return{id:tw,diagram:e}},`loader`)},rw=`class`,iw={id:rw,detector:I((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./classDiagram-6PBFFD2Q-DB1wrXGP.js`);return{diagram:e}},__vite__mapDeps([158,111,104,1,105,103,106,107,108,113,114,115,116,117,118,119,120,121,122,159,123,124,125,109]));return{id:rw,diagram:e}},`loader`)},aw=`classDiagram`,ow={id:aw,detector:I((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./classDiagram-v2-HSJHXN6E-Bw6ca9pK.js`);return{diagram:e}},__vite__mapDeps([160,111,104,1,105,103,106,107,108,113,114,115,116,117,118,119,120,121,122,159,123,124,125,109]));return{id:aw,diagram:e}},`loader`)},sw=`state`,cw={id:sw,detector:I((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./stateDiagram-FHFEXIEX-DDenxAJa.js`);return{diagram:e}},__vite__mapDeps([161,111,104,1,105,103,106,107,108,119,120,121,162,163,131,132,133,113,114,115,116,117,118,122,123,124,164]));return{id:sw,diagram:e}},`loader`)},lw=`stateDiagram`,uw={id:lw,detector:I((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-QKLJ7IA2-ClBsUbLz.js`);return{diagram:e}},__vite__mapDeps([165,111,104,1,105,103,106,107,108,113,114,115,116,117,118,119,120,121,122,123,124,164]));return{id:lw,diagram:e}},`loader`)},dw=`journey`,fw={id:dw,detector:I(e=>/^\s*journey/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./journeyDiagram-VCZTEJTY-B6vqrNf2.js`);return{diagram:e}},__vite__mapDeps([166,104,1,153,103,120,106,107,125,109]));return{id:dw,diagram:e}},`loader`)},pw={draw:I((e,t,n)=>{te.debug(`rendering svg for syntax error
168
+ `);let r=je(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),fe(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},mw=pw,hw={db:{},renderer:pw,parser:{parse:I(()=>{},`parse`)}},gw=`flowchart-elk`,_w={id:gw,detector:I((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-Bktw281T.js`);return{diagram:e}},__vite__mapDeps([110,111,104,1,105,103,106,107,108,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,109]));return{id:gw,diagram:e}},`loader`)},vw=`timeline`,yw={id:vw,detector:I(e=>/^\s*timeline/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./timeline-definition-GMOUNBTQ-57fEq56M.js`);return{diagram:e}},__vite__mapDeps([167,104,1,153,103,120,105,106,107,108,150]));return{id:vw,diagram:e}},`loader`)},bw=`mindmap`,xw={id:bw,detector:I(e=>/^\s*mindmap/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./mindmap-definition-QFDTVHPH-BtXgyix8.js`);return{diagram:e}},__vite__mapDeps([168,111,104,1,105,103,106,107,108,113,114,115,116,117,118,119,120,121,122,123,124]));return{id:bw,diagram:e}},`loader`)},Sw=`kanban`,Cw={id:Sw,detector:I(e=>/^\s*kanban/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./kanban-definition-6JOO6SKY-bI4JYf8h.js`);return{diagram:e}},__vite__mapDeps([169,111,104,1,105,103,106,107,108,150,114,115,116,117,125,126]));return{id:Sw,diagram:e}},`loader`)},ww=`sankey`,Tw={id:ww,detector:I(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./sankeyDiagram-XADWPNL6-Bz2ZMHFN.js`);return{diagram:e}},__vite__mapDeps([170,104,1,152,148,106,107]));return{id:ww,diagram:e}},`loader`)},Ew=`packet`,Dw={id:Ew,detector:I(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./diagram-TYMM5635-cq8z5oad.js`);return{diagram:e}},__vite__mapDeps([171,129,107,130,1,131,108,132,133,134,135,136,137,138,139,140,141,142,104,105,103,106,150,143]));return{id:Ew,diagram:e}},`loader`)},Ow=`radar`,kw={id:Ow,detector:I(e=>/^\s*radar-beta/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./diagram-MMDJMWI5-Gu8Src1V.js`);return{diagram:e}},__vite__mapDeps([172,129,107,130,1,131,108,132,133,134,135,136,137,138,139,140,141,142,104,105,103,106,150,143]));return{id:Ow,diagram:e}},`loader`)},Aw=`block`,jw={id:Aw,detector:I(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./blockDiagram-DXYQGD6D-CltV9XBC.js`);return{diagram:e}},__vite__mapDeps([173,111,104,1,105,103,106,107,108,119,120,121,163,131,132,112,174,122,125,116]));return{id:Aw,diagram:e}},`loader`)},Mw=`treeView`,Nw={id:Mw,detector:I(e=>/^\s*treeView-beta/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./diagram-5BDNPKRD-GSxbfnJz.js`);return{diagram:e}},__vite__mapDeps([175,129,107,130,1,131,108,132,133,134,135,136,137,138,139,140,141,142,104,105,103,106,150,143,144]));return{id:Mw,diagram:e}},`loader`)},Pw=`architecture`,Fw={id:Pw,detector:I(e=>/^\s*architecture/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./architectureDiagram-Q4EWVU46-YqMLsb7j.js`);return{diagram:e}},__vite__mapDeps([176,1,111,104,105,103,106,107,108,129,130,131,132,133,134,135,136,137,138,139,140,141,142,177,150,143]));return{id:Pw,diagram:e}},`loader`)},Iw=`ishikawa`,Lw={id:Iw,detector:I(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-UXIWVN3A-Mp37nJ4d.js`);return{diagram:e}},__vite__mapDeps([178,104,1,105,103,106,107,108,150,117]));return{id:Iw,diagram:e}},`loader`)},Rw=`venn`,zw={id:Rw,detector:I(e=>/^\s*venn-beta/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./vennDiagram-DHZGUBPP-Bvydqbbx.js`);return{diagram:e}},__vite__mapDeps([179,104,1,105,103,106,107,108,150,117]));return{id:Rw,diagram:e}},`loader`)},Bw=`treemap`,Vw={id:Bw,detector:I(e=>/^\s*treemap/.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./diagram-G4DWMVQ6-tp6J6SRd.js`);return{diagram:e}},__vite__mapDeps([180,129,107,130,1,131,108,132,133,134,135,136,137,138,139,140,141,142,104,147,152,148,105,103,106,150,143,124,115]));return{id:Bw,diagram:e}},`loader`)},Hw=`wardley-beta`,Uw={id:Hw,detector:I(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:I(async()=>{let{diagram:e}=await N(async()=>{let{diagram:e}=await import(`./wardleyDiagram-NUSXRM2D-BpjtR_nt.js`);return{diagram:e}},__vite__mapDeps([181,129,107,130,1,131,108,132,133,134,135,136,137,138,139,140,141,142,104,106,150,143]));return{id:Hw,diagram:e}},`loader`)},Ww=!1,Gw=I(()=>{Ww||(Ww=!0,R(`error`,hw,e=>e.toLowerCase().trim()===`error`),R(`---`,{db:{clear:I(()=>{},`clear`)},styles:{},renderer:{draw:I(()=>{},`draw`)},parser:{parse:I(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:I(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),oe(_w,xw,Fw),oe(PC,Cw,ow,iw,BC,WC,KC,JC,ew,nw,RC,IC,yw,HC,uw,cw,fw,XC,Tw,Dw,QC,jw,Nw,kw,Lw,Vw,zw,Uw))},`addDiagrams`),Kw=I(async()=>{te.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(ve).map(async([e,{detector:t,loader:n}])=>{if(n)try{Se(e)}catch{try{let{diagram:e,id:r}=await n();R(r,e,t)}catch(t){throw te.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete ve[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){te.error(`Failed to load ${e.length} external diagrams`);for(let t of e)te.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),qw=`graphics-document document`;function Jw(e,t){e.attr(`role`,qw),t!==``&&e.attr(`aria-roledescription`,t)}I(Jw,`setA11yDiagramInfo`);function Yw(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}I(Yw,`addSVGa11yTitleDescription`);var Xw=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{I(this,`Diagram`)}static async fromText(t,n={}){let r=Ce(),i=pe(t,r);t=Te(t)+`
169
+ `;try{Se(i)}catch{let e=se(i);if(!e)throw new be(`Diagram ${i} not found.`);let{id:t,diagram:n}=await e();R(t,n)}let{db:a,parser:o,renderer:s,init:c}=Se(i);return o.parser&&(o.parser.yy=a),a.clear?.(),c?.(r),n.title&&a.setDiagramTitle?.(n.title),await o.parse(t),new e(i,t,a,o,s)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},Zw=[],Qw=I(()=>{Zw.forEach(e=>{e()}),Zw=[]},`attachFunctions`),$w=I(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function eT(e){let t=e.match(me);if(!t)return{text:e,metadata:{}};let n=Me(t[1],{schema:Ne})??{};n=typeof n==`object`&&!Array.isArray(n)?n:{};let r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}I(eT,`extractFrontMatter`);var tT=I(e=>e.replace(/\r\n?/g,`
170
+ `).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),nT=I(e=>{let{text:t,metadata:n}=eT(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),rT=I(e=>{let t=De.detectInit(e)??{},n=De.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:ke(e),directive:t}},`processDirectives`);function iT(e){let t=nT(tT(e)),n=rT(t.text),r=Ae(t.config,n.directive);return e=$w(n.text),{code:e,title:t.title,config:r}}I(iT,`preprocessDiagram`);function aT(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}I(aT,`toBase64`);var oT=5e4,sT=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,cT=`sandbox`,lT=`loose`,uT=`http://www.w3.org/2000/svg`,dT=`http://www.w3.org/1999/xlink`,fT=`http://www.w3.org/1999/xhtml`,pT=`100%`,mT=`100%`,hT=`border:0;margin:0;`,gT=`margin:0`,_T=`allow-top-navigation-by-user-activation allow-popups`,vT=`The "iframe" tag is not supported by your browser.`,yT=[`foreignobject`],bT=[`dominant-baseline`];function xT(e){let t=iT(e);return re(),_e(t.config??{}),t}I(xT,`processAndSetConfigs`);async function ST(e,t){Gw();try{let{code:t,config:n}=xT(e);return{diagramType:(await NT(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}I(ST,`parse`);var CT=I((e,t,n=[])=>`
171
+ .${e} ${t} { ${n.join(` !important; `)} !important; }`,`cssImportantStyles`),wT=I((e,t=new Map)=>{let n=``;if(e.themeCSS!==void 0&&(n+=`
172
+ ${e.themeCSS}`),e.fontFamily!==void 0&&(n+=`
173
+ :root { --mermaid-font-family: ${e.fontFamily}}`),e.altFontFamily!==void 0&&(n+=`
174
+ :root { --mermaid-alt-font-family: ${e.altFontFamily}}`),t instanceof Map){let r=xe(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{Le(e.styles)||r.forEach(t=>{n+=CT(e.id,t,e.styles)}),Le(e.textStyles)||(n+=CT(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))))})}return n},`createCssStyles`),TT=I((e,t,n,r)=>jC(EC(`${r}{${ae(t,wT(e,n),{...e.themeVariables,theme:e.theme,look:e.look},r)}}`),MC),`createUserStyles`),ET=I((e=``,t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,`marker-end="url(#`)),r=Oe(r),r=r.replace(/<br>/g,`<br/>`),r},`cleanUpSvgCode`),DT=I((e=``,t)=>`<iframe style="width:${pT};height:${t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+`px`:mT};${hT}" src="data:text/html;charset=UTF-8;base64,${aT(`<body style="${gT}">${e}</body>`)}" sandbox="${_T}">
175
+ ${vT}
176
+ </iframe>`,`putIntoIFrame`),OT=I((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,uT);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function kT(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}I(kT,`sandboxedIframe`);var AT=I((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),jT=I(async function(e,t,n){Gw();let r=xT(t);t=r.code;let i=Ce();te.debug(i),t.length>(i?.maxTextSize??oT)&&(t=sT);let a=`#`+e,o=`i`+e,s=`#`+o,c=`d`+e,l=`#`+c,u=I(()=>{let e=ne(f?s:l).node();e&&`remove`in e&&e.remove()},`removeTempElements`),d=ne(`body`),f=i.securityLevel===cT,p=i.securityLevel===lT,m=i.fontFamily;n===void 0?(AT(document,e,c,o),f?(d=ne(kT(ne(`body`),o).nodes()[0].contentDocument.body),d.node().style.margin=0):d=ne(`body`),OT(d,e,c)):(n&&(n.innerHTML=``),f?(d=ne(kT(ne(n),o).nodes()[0].contentDocument.body),d.node().style.margin=0):d=ne(n),OT(d,e,c,`font-family: ${m}`,dT));let h,g;try{h=await Xw.fromText(t,{title:r.title})}catch(e){if(i.suppressErrorRendering)throw u(),e;h=await Xw.fromText(`error`),g=e}let _=d.select(l).node(),v=h.type,y=_.firstChild,b=y.firstChild,x=h.renderer.getClasses?.(t,h),S=TT(i,v,x,a),C=document.createElement(`style`);C.innerHTML=S,y.insertBefore(C,b);try{await h.renderer.draw(t,e,`11.14.0`,h)}catch(n){throw i.suppressErrorRendering?u():mw.draw(t,e,`11.14.0`),n}let w=d.select(`${l} svg`),T=h.db.getAccTitle?.(),E=h.db.getAccDescription?.();PT(v,w,T,E),d.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,fT);let D=d.select(l).node().innerHTML;if(te.debug(`config.arrowMarkerAbsolute`,i.arrowMarkerAbsolute),D=ET(D,f,he(i.arrowMarkerAbsolute)),f){let e=d.select(l+` svg`).node();D=DT(D,e)}else p||(D=de.sanitize(D,{ADD_TAGS:yT,ADD_ATTR:bT,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(Qw(),g)throw g;return u(),{diagramType:v,svg:D,bindFunctions:h.db.bindFunctions}},`render`);function MT(e={}){let t=ye({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||={},t.themeVariables.fontFamily=t.fontFamily),we(t),t?.theme&&t.theme in ue?t.themeVariables=ue[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=ue.default.getThemeVariables(t.themeVariables)),F((typeof t==`object`?ie(t):ce()).logLevel),Gw()}I(MT,`initialize`);var NT=I((e,t={})=>{let{code:n}=iT(e);return Xw.fromText(n,t)},`getDiagramFromText`);function PT(e,t,n,r){Jw(t,e),Yw(t,n,r,t.attr(`id`))}I(PT,`addA11yInfo`);var FT=Object.freeze({render:jT,parse:ST,getDiagramFromText:NT,initialize:MT,getConfig:Ce,setConfig:L,getSiteConfig:ce,updateSiteConfig:le,reset:I(()=>{re()},`reset`),globalReset:I(()=>{re(ge)},`globalReset`),defaultConfig:ge});F(Ce().logLevel),re(Ce());var IT=I((e,t,n)=>{te.warn(e),Ee(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),LT=I(async function(e={querySelector:`.mermaid`}){try{await RT(e)}catch(t){if(Ee(t)&&te.error(t.str),YT.parseError&&YT.parseError(t),!e.suppressErrors)throw te.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),RT=I(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let r=FT.getConfig();te.debug(`${e?``:`No `}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);te.debug(`Found ${i.length} diagrams`),r?.startOnLoad!==void 0&&(te.debug(`Start On Load: `+r?.startOnLoad),FT.updateSiteConfig({startOnLoad:r?.startOnLoad}));let a=new De.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed),o,s=[];for(let t of Array.from(i)){if(te.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${a.next()}`;o=t.innerHTML,o=Fe(De.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,`<br/>`);let r=De.detectInit(o);r&&te.debug(`Detected early reinit: `,r);try{let{svg:r,bindFunctions:i}=await JT(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){IT(e,s,YT.parseError)}}if(s.length>0)throw s[0]},`runThrowsErrors`),zT=I(function(e){FT.initialize(e)},`initialize`),BT=I(async function(e,t,n){te.warn(`mermaid.init is deprecated. Please use run instead.`),e&&zT(e);let r={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?r.querySelector=t:t&&(t instanceof HTMLElement?r.nodes=[t]:r.nodes=t),await LT(r)},`init`),VT=I(async(e,{lazyLoad:t=!0}={})=>{Gw(),oe(...e),t===!1&&await Kw()},`registerExternalDiagrams`),HT=I(function(){if(YT.startOnLoad){let{startOnLoad:e}=FT.getConfig();e&&YT.run().catch(e=>te.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,HT,!1);var UT=I(function(e){YT.parseError=e},`setParseErrorHandler`),WT=[],GT=!1,KT=I(async()=>{if(!GT){for(GT=!0;WT.length>0;){let e=WT.shift();if(e)try{await e()}catch(e){te.error(`Error executing queue`,e)}}GT=!1}},`executeQueue`),qT=I(async(e,t)=>new Promise((n,r)=>{let i=I(()=>new Promise((i,a)=>{FT.parse(e,t).then(e=>{i(e),n(e)},e=>{te.error(`Error parsing`,e),YT.parseError?.(e),a(e),r(e)})}),`performCall`);WT.push(i),KT().catch(r)}),`parse`),JT=I((e,t,n)=>new Promise((r,i)=>{let a=I(()=>new Promise((a,o)=>{FT.render(e,t,n).then(e=>{a(e),r(e)},e=>{te.error(`Error parsing`,e),YT.parseError?.(e),o(e),i(e)})}),`performCall`);WT.push(a),KT().catch(i)}),`render`),YT={startOnLoad:!0,mermaidAPI:FT,parse:qT,render:JT,init:BT,run:LT,registerExternalDiagrams:VT,registerLayoutLoaders:Ie,initialize:zT,parseError:void 0,contentLoaded:HT,setParseErrorHandler:UT,detectType:pe,registerIconPacks:Pe,getRegisteredDiagramsMetadata:I(()=>Object.keys(ve).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},XT=YT,ZT={startOnLoad:!1,theme:`default`,securityLevel:`strict`,fontFamily:`monospace`,suppressErrorRendering:!0};function QT(e={}){let t=!1,n={...ZT,...e.config},r={initialize(r){n={...ZT,...e.config,...r},XT.initialize(n),t=!0},async render(e,r){return t||=(XT.initialize(n),!0),await XT.render(e,r)}};return{name:`mermaid`,type:`diagram`,language:`mermaid`,getMermaid(e){return e&&r.initialize(e),r}}}var $T=QT(),eE=({className:e,from:t,...n})=>(0,U.jsx)(`div`,{className:H(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant self-start`,e),...n}),tE=({children:e,className:t,...n})=>(0,U.jsx)(`div`,{className:H(`is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-left group-[.is-assistant]:text-foreground`,t),...n,children:e}),nE=({className:e,children:t,...n})=>(0,U.jsx)(`div`,{className:H(`flex items-center gap-1`,e),...n,children:t}),rE=({tooltip:e,children:t,label:n,variant:r=`ghost`,size:i=`icon-sm`,...a})=>{let o=(0,U.jsxs)($n,{size:i,type:`button`,variant:r,...a,children:[t,(0,U.jsx)(`span`,{className:`sr-only`,children:n||e})]});return e?(0,U.jsx)(vd,{children:(0,U.jsxs)(yd,{children:[(0,U.jsx)(bd,{children:o}),(0,U.jsx)(xd,{children:(0,U.jsx)(`p`,{children:e})})]})}):o},iE=(0,z.createContext)(null),aE=()=>{let e=(0,z.useContext)(iE);if(!e)throw Error(`MessageBranch components must be used within MessageBranch`);return e},oE=({defaultBranch:e=0,onBranchChange:t,className:n,...r})=>{let[i,a]=(0,z.useState)(e),[o,s]=(0,z.useState)([]),c=(0,z.useCallback)(e=>{a(e),t?.(e)},[t]),l=(0,z.useCallback)(()=>{c(i>0?i-1:o.length-1)},[i,o.length,c]),u=(0,z.useCallback)(()=>{c(i<o.length-1?i+1:0)},[i,o.length,c]),d=(0,z.useMemo)(()=>({branches:o,currentBranch:i,goToNext:u,goToPrevious:l,setBranches:s,totalBranches:o.length}),[o,i,u,l]);return(0,U.jsx)(iE.Provider,{value:d,children:(0,U.jsx)(`div`,{className:H(`grid w-full gap-2 [&>div]:pb-0`,n),...r})})},sE=({children:e,...t})=>{let{currentBranch:n,setBranches:r,branches:i}=aE(),a=(0,z.useMemo)(()=>Array.isArray(e)?e:[e],[e]);return(0,z.useEffect)(()=>{i.length!==a.length&&r(a)},[a,i,r]),a.map((e,r)=>(0,U.jsx)(`div`,{className:H(`grid gap-2 overflow-hidden [&>div]:pb-0`,r===n?`block`:`hidden`),...t,children:e},e.key))},cE={cjk:Bf,code:Bx,math:BS,mermaid:$T},lE=(0,z.memo)(({className:e,...t})=>(0,U.jsx)(D,{className:H(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),plugins:cE,...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);lE.displayName=`MessageResponse`;var uE=({messageId:e,rating:t,onRate:n,disabled:r})=>(0,U.jsxs)(nE,{className:`mt-2`,children:[(0,U.jsx)(rE,{tooltip:`Thumbs up`,onClick:()=>n(e,t===1?0:1),variant:t===1?`default`:`ghost`,disabled:r,children:(0,U.jsx)(gu,{className:`size-4`})}),(0,U.jsx)(rE,{tooltip:`Thumbs down`,onClick:()=>n(e,t===-1?0:-1),variant:t===-1?`default`:`ghost`,disabled:r,children:(0,U.jsx)(hu,{className:`size-4`})})]}),dE=globalThis?.document?z.useLayoutEffect:()=>{},fE=z.useInsertionEffect||dE;function pE({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=mE({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=z.useRef(e!==void 0);z.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,z.useCallback(t=>{if(s){let n=hE(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function mE({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return fE(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function hE(e){return typeof e==`function`}var gE=z.createContext(void 0);function _E(e){let t=z.useContext(gE);if(e===!1&&t===void 0)throw Error(hn(27));return t}var vE={..._l,...mc},yE=z.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,{store:s}=_E(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Hn(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:vE,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),bE=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,style:o,...s}=e,{store:c}=_E(),l=c.useState(`open`);function u(e){l&&c.setOpen(!1,Ur(Fr,e.nativeEvent))}let{getButtonProps:d,buttonRef:f}=yn({disabled:i,native:a});return Hn(`button`,e,{state:{disabled:i},ref:[t,f],props:[{onClick:u},s,d]})}),xE=z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=_E(),c=vl(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Hn(`p`,e,{ref:t,props:[{id:c},o]})}),SE=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),CE=function(e){return e[e.open=cl.open]=`open`,e[e.closed=cl.closed]=`closed`,e[e.startingStyle=cl.startingStyle]=`startingStyle`,e[e.endingStyle=cl.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),wE=z.createContext(void 0);function TE(){let e=z.useContext(wE);if(e===void 0)throw Error(hn(26));return e}var EE=`ArrowUp`,DE=`ArrowDown`,OE=`ArrowLeft`,kE=`ArrowRight`,AE=`Home`,jE=new Set([OE,kE]),ME=new Set([EE,DE]),NE=new Set([...jE,...ME]);new Set([...NE,AE,`End`]);var PE=new Set([EE,DE,OE,kE,AE,`End`]),FE={..._l,...mc,nestedDialogOpen(e){return e?{[CE.nestedDialogOpen]:``}:null}},IE=z.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,style:o,...s}=e,{store:c}=_E(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`);TE(),gc({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});function S(e){return e===`touch`?c.context.popupRef.current:!0}let C=i===void 0?S:i,w=Hn(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:g>0},props:[f,{"aria-labelledby":y??void 0,"aria-describedby":l??void 0,role:x,tabIndex:-1,hidden:!m,onKeyDown(e){PE.has(e.key)&&e.stopPropagation()},style:{[SE.nestedDialogs]:g}},s],ref:[t,c.context.popupRef,c.useStateSetter(`popupElement`)],stateAttributesMapping:FE});return(0,U.jsx)(wo,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:r,modal:p!==!1,restoreFocus:`popup`,children:w})}),LE=z.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,U.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),RE=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=_E(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,U.jsx)(wE.Provider,{value:n,children:(0,U.jsxs)(ro,{ref:t,...r,children:[a&&o===!0&&(0,U.jsx)(LE,{ref:i.context.internalBackdropRef,inert:Ml(!s)}),e.children]})}):null}),zE={},BE={},VE=``;function HE(e){if(typeof document>`u`)return!1;let t=ti(e);return xt(t).innerWidth-t.documentElement.clientWidth>0}function UE(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=ti(e),n=t.documentElement,r=t.body,i=Dt(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function WE(e){let t=ti(e),n=t.documentElement,r=t.body,i=Dt(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function GE(e){let t=ti(e),n=t.documentElement,r=t.body,i=xt(n),a=0,o=0,s=!1,c=$r.create();if(ur&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,zE={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},VE=n.style.scrollBehavior,BE={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Dt(n)?n:r;if(s=UE(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,zE),Object.assign(r.style,BE),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=VE)}function d(){u(),c.request(l)}l();let f=qr(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var KE=new class{lockCount=0;restore=null;timeoutLock=ir.create();timeoutUnlock=ir.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=ti(e).documentElement,n=xt(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=Pn;return}this.restore=dr||!HE(e)?WE(e):GE(e)}};function qE(e=!0,t=null){V(()=>{if(e)return KE.acquire(t)},[e,t])}function JE(e){let t=z.useRef(``),n=z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:z.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function YE(e,t){let n=z.useRef(e),r=B(t);V(()=>{n.current!==e&&r(n.current)},[e,r]),V(()=>{n.current=e},[e])}function XE(e){let[t,n]=z.useState(null),r=B((t,r)=>{e||n(r||(dr?`touch`:``))});YE(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=JE(r);return z.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function ZE(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState(`open`),o=t.useState(`disablePointerDismissal`),s=t.useState(`modal`),c=t.useState(`popupElement`),{openMethod:l,triggerProps:u}=XE(a);yc(t);let{forceUnmount:d}=bc(a,t),f=B(e=>{let n=Ur(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),p=z.useCallback(()=>{t.setOpen(!1,f(Hr))},[t,f]);z.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);let m=Oc({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[h,g]=z.useState(0),[_,v]=z.useState(0),y=h===0,b=Zc(m),x=Mo(m,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=mi(e);if(y&&!o){let e=n;return s&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||pi(e,c)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:y});qE(a&&s===!0,c);let{getReferenceProps:S,getFloatingProps:C,getTriggerProps:w}=zc([b,x]);t.useContextCallback(`onNestedDialogOpen`,(e,t)=>{g(e),v(t)}),t.useContextCallback(`onNestedDialogClose`,()=>{g(0),v(0)}),z.useEffect(()=>(n?.onNestedDialogOpen&&a&&n.onNestedDialogOpen(h+1,_+ +!!i),n?.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[i,a,h,_,n]);let T=z.useMemo(()=>S(u),[S,u]),E=z.useMemo(()=>w(u),[w,u]),D=z.useMemo(()=>C(),[C]);t.useSyncedValues({openMethod:l,activeTriggerProps:T,inactiveTriggerProps:E,popupProps:D,floatingRootContext:m,nestedOpenDialogCount:h,nestedOpenDrawerCount:_})}var QE={...Tc,modal:W(e=>e.modal),nested:W(e=>e.nested),nestedOpenDialogCount:W(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:W(e=>e.nestedOpenDrawerCount),disablePointerDismissal:W(e=>e.disablePointerDismissal),openMethod:W(e=>e.openMethod),descriptionElementId:W(e=>e.descriptionElementId),titleElementId:W(e=>e.titleElementId),viewportElement:W(e=>e.viewportElement),role:W(e=>e.role)},$E=class e extends sc{constructor(e){super(eD(e),{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new xc,onOpenChange:void 0,onOpenChangeComplete:void 0},QE)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};static useStore(t,n){let r=Gt(()=>new e(n)).current;return t??r}};function eD(e={}){return{...Cc(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}var tD=z.createContext(!1);function nD(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=_E(!0),p=z.useContext(tD),m=!!f,h=$E.useStore(l?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:m});er(()=>{n===void 0&&h.state.open===!1&&r===!0&&h.update({open:!0,activeTriggerId:d})}),h.useControlledProp(`openProp`,n),h.useControlledProp(`triggerIdProp`,u),h.useSyncedValues({disablePointerDismissal:o,nested:m,modal:s}),h.useContextCallback(`onOpenChange`,i),h.useContextCallback(`onOpenChangeComplete`,a);let g=h.useState(`payload`);ZE({store:h,actionsRef:c,parentContext:f?.store.context,isDrawer:p,onOpenChange:i,triggerIdProp:u});let _=z.useMemo(()=>({store:h}),[h]);return(0,U.jsx)(tD.Provider,{value:!1,children:(0,U.jsx)(gE.Provider,{value:_,children:typeof t==`function`?t({payload:g}):t})})}var rD=z.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{store:s}=_E(),c=vl(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Hn(`h2`,e,{ref:t,props:[{id:c},o]})}),iD=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,payload:s,handle:c,style:l,...u}=e,d=_E(!0),f=c?.store??d?.store;if(!f)throw Error(hn(79));let p=vl(o),m=f.useState(`floatingRootContext`),h=f.useState(`isOpenedByTrigger`,p),g=z.useRef(null),{registerTrigger:_,isMountedByThisTrigger:v}=vc(p,g,f,{payload:s}),{getButtonProps:y,buttonRef:b}=yn({disabled:i,native:a}),x=zc([To(m,{enabled:m!=null})]),S={disabled:i,open:h},C=f.useState(`triggerProps`,v);return Hn(`button`,e,{state:S,ref:[b,t,_,g],props:[x.getReferenceProps(),C,{[Rn]:``,id:p},u,y],stateAttributesMapping:hl})});function aD({...e}){return(0,U.jsx)(nD,{"data-slot":`dialog`,...e})}function oD({...e}){return(0,U.jsx)(iD,{"data-slot":`dialog-trigger`,...e})}function sD({...e}){return(0,U.jsx)(RE,{"data-slot":`dialog-portal`,...e})}function cD({className:e,...t}){return(0,U.jsx)(yE,{"data-slot":`dialog-overlay`,className:H(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function lD({className:e,children:t,showCloseButton:n=!0,...r}){return(0,U.jsxs)(sD,{children:[(0,U.jsx)(cD,{}),(0,U.jsxs)(IE,{"data-slot":`dialog-content`,className:H(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,U.jsxs)(bE,{"data-slot":`dialog-close`,render:(0,U.jsx)($n,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,U.jsx)(bu,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function uD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`dialog-header`,className:H(`flex flex-col gap-2`,e),...t})}function dD({className:e,showCloseButton:t=!1,children:n,...r}){return(0,U.jsxs)(`div`,{"data-slot":`dialog-footer`,className:H(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,U.jsx)(bE,{render:(0,U.jsx)($n,{variant:`outline`}),children:`Close`})]})}function fD({className:e,...t}){return(0,U.jsx)(rD,{"data-slot":`dialog-title`,className:H(`text-base leading-none font-medium`,e),...t})}var pD=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),mD={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},hD={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},gD={disabled:!1,...hD},_D={valid(e){return e===null?null:e?{[pD.valid]:``}:{[pD.invalid]:``}}},vD=z.createContext({invalid:void 0,name:void 0,validityData:{state:mD,errors:[],error:``,value:``,initialValue:null},setValidityData:Pn,disabled:void 0,touched:hD.touched,setTouched:Pn,dirty:hD.dirty,setDirty:Pn,filled:hD.filled,setFilled:Pn,focused:hD.focused,setFocused:Pn,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:gD,markedDirtyRef:{current:!1},registerFieldControl:Pn,validation:{getValidationProps:(e=In)=>e,getInputValidationProps:(e=In)=>e,inputRef:{current:null},commit:async()=>{}}});function yD(e=!0){let t=z.useContext(vD);if(t.setValidityData===Pn&&!e)throw Error(hn(28));return t}var bD=z.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Pn,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function xD(){return z.useContext(bD)}var SD=z.createContext({controlId:void 0,registerControlId:Pn,labelId:void 0,setLabelId:Pn,messageIds:[],setMessageIds:Pn,getDescriptionProps:e=>e});function CD(){return z.useContext(SD)}function wD({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=z.useRef(e!==void 0),[a,o]=z.useState(t);return[i?e:a,z.useCallback(e=>{i||o(e)},[])]}function TD(e,t){let{enabled:n=!0,getValue:r,id:i,value:a}=t,{registerFieldControl:o}=yD(),s=z.useRef(null);s.current||=Symbol(),V(()=>{let t=s.current;if(!(!t||!n))return o(t,{controlRef:e,getValue:r,id:i,value:a}),()=>{o(t,void 0)}},[e,n,r,i,o,a])}function ED(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=CD(),o=vl(t),s=n?i:void 0,c=Gt(()=>Symbol(`labelable-control`)),l=z.useRef(!1),u=z.useRef(t!=null),d=B(()=>{!l.current||a===Pn||(l.current=!1,a(c.current,void 0))});return V(()=>{if(a===Pn)return;let e;if(n){let n=r?.current;e=wt(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),z.useEffect(()=>d,[d]),i??o}var DD=z.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFocused:y,setFilled:b,validationMode:x,validation:S}=yD(),C=h||s,w=m??a,T={...p,disabled:C},{labelId:E}=CD(),D=ED({id:i});V(()=>{let e=o!=null;S.inputRef.current?.value||e&&o!==``?b(!0):e&&o===``&&b(!1)},[S.inputRef,b,o]);let O=z.useRef(null);V(()=>{u&&O.current===fi(ti(O.current))&&y(!0)},[u,y]);let[k]=wD({controlled:o,default:l,name:`FieldControl`,state:`value`}),A=o!==void 0,j=A?k:void 0,M=B(()=>S.inputRef.current?.value);return TD(S.inputRef,{id:D,value:j,getValue:M}),Hn(`input`,e,{ref:[t,O],state:T,props:[{id:D,disabled:C,name:w,ref:S.inputRef,"aria-labelledby":E,autoFocus:u,...A?{value:j}:{defaultValue:l},onChange(e){let t=e.currentTarget.value;c?.(t,Ur(kr,e.nativeEvent)),_(t!==v.initialValue),b(t!==``)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),x===`onBlur`&&S.commit(e.currentTarget.value)},onKeyDown(e){e.currentTarget.tagName===`INPUT`&&e.key===`Enter`&&(g(!0),S.commit(e.currentTarget.value))}},S.getInputValidationProps(),f],stateAttributesMapping:_D})}),OD=z.forwardRef(function(e,t){return(0,U.jsx)(DD,{ref:t,...e})});function kD({className:e,type:t,...n}){return(0,U.jsx)(OD,{type:t,"data-slot":`input`,className:H(`h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function AD({className:e,...t}){return(0,U.jsx)(`textarea`,{"data-slot":`textarea`,className:H(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function jD({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:H(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var MD=Zn(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function ND({className:e,align:t=`inline-start`,...n}){return(0,U.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:H(MD({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var PD=Zn(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function FD({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,U.jsx)($n,{type:t,"data-size":r,variant:n,className:H(PD({size:r}),e),...i})}function ID({className:e,...t}){return(0,U.jsx)(AD,{"data-slot":`input-group-control`,className:H(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,e),...t})}var LD=z.createContext(void 0);function RD(e){let t=z.useContext(LD);if(t===void 0&&!e)throw Error(hn(33));return t}var zD=z.createContext(void 0);function BD(e){let t=z.useContext(zD);if(t===void 0&&!e)throw Error(hn(36));return t}var VD=z.createContext(void 0);function HD(e=!0){let t=z.useContext(VD);if(t===void 0&&!e)throw Error(hn(25));return t}function UD(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=HD(!0),d=u!==void 0;return z.useMemo(()=>({id:r,role:`menuitem`,tabIndex:n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Pr})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,d&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||d&&!mr&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!d||e.button===2)&&(!c||c.type===`regular-item`)&&s.current.click()}}),[t,n,r,l,i,a,o,s,u,d,c])}var WD={type:`regular-item`};function GD(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=z.useRef(null),{getButtonProps:d,buttonRef:f}=yn({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=UD({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=z.useCallback(e=>$t(p,{onMouseEnter(){c.type===`submenu-trigger`&&c.setActive()}},e,d),[p,d,c]),h=Sn(u,f);return z.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var KD=z.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function qD(){return z.useContext(KD)}var JD=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function YD(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=qD(),f=z.useRef(-1),[p,m]=z.useState(a??(i===JD.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=z.useRef(null),g=z.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return V(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),V(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),z.useMemo(()=>({ref:g,index:p}),[p,g])}var XD=z.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=YD({label:a}),f=RD(!0),p=vl(i),{store:m}=BD(),h=m.useState(`isActive`,d.index),g=m.useState(`itemProps`),{getItemProps:_,itemRef:v}=GD({closeOnClick:c,disabled:s,highlighted:h,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:WD});return Hn(`div`,e,{state:{disabled:s,highlighted:h},props:[g,u,_],ref:[v,t,d.ref]})}),ZD=z.createContext(void 0);function QD(e){let t=z.useContext(ZD);if(t===void 0&&!e)throw Error(hn(69));return t}var $D={..._l,...mc},eO=z.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...o}=e,{store:s}=BD(),{side:c,align:l}=RD(),u=QD(!0)!=null,d=s.useState(`open`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`mounted`),h=s.useState(`instantType`),g=s.useState(`activeTriggerElement`),_=s.useState(`parent`),v=s.useState(`lastOpenChangeReason`),y=s.useState(`rootId`),b=s.useState(`floatingRootContext`),x=s.useState(`floatingTreeRoot`),S=s.useState(`closeDelay`),C=s.useState(`activeTriggerElement`),w=_.type===`context-menu`;gc({open:d,ref:s.context.popupRef,onComplete(){d&&s.context.onOpenChangeComplete?.(!0)}}),z.useEffect(()=>{function e(e){s.setOpen(!1,Ur(e.reason,e.domEvent))}return x.events.on(`close`,e),()=>{x.events.off(`close`,e)}},[x.events,s]);let T=s.useState(`hoverEnabled`),E=s.useState(`disabled`);Ic(b,{enabled:T&&!E&&!w&&_.type!==`menubar`,closeDelay:S});let D={transitionStatus:f,side:c,align:l,open:d,nested:_.type===`menu`,instant:h},O=z.useCallback(e=>{s.set(`popupElement`,e)},[s]),k=Hn(`div`,e,{state:D,ref:[t,s.context.popupRef,O],stateAttributesMapping:$D,props:[p,{onKeyDown(e){u&&PE.has(e.key)&&e.stopPropagation()}},Al(f),o,{"data-rootownerid":y}]}),A=_.type===void 0||w;return(g||_.type===`menubar`&&v!==`outside-press`)&&(A=!0),(0,U.jsx)(wo,{context:b,modal:w,disabled:!m,returnFocus:a===void 0?A:a,initialFocus:_.type!==`menu`,restoreFocus:!0,externalTree:_.type===`menubar`?void 0:x,previousFocusableElement:C,nextFocusableElement:_.type===void 0?s.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?s.context.beforeContentFocusGuardRef:void 0,children:k})}),tO=z.createContext(void 0);function nO(){let e=z.useContext(tO);if(e===void 0)throw Error(hn(32));return e}var rO=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=BD();return i.useState(`mounted`)||n?(0,U.jsx)(tO.Provider,{value:n,children:(0,U.jsx)(ro,{ref:t,...r})}):null});function iO(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=B(i),o=z.useRef(0),s=Gt(oO).current,c=Gt(aO).current,[l,u]=z.useState(0),d=z.useRef(l),f=B((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=B(e=>{c.delete(e),d.current+=1,u(d.current)}),m=z.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(sO).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);V(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),V(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),V(()=>()=>{n.current=[]},[n]),V(()=>()=>{r&&(r.current=[])},[r]);let h=B(e=>(s.add(e),()=>{s.delete(e)}));V(()=>{s.forEach(e=>e(m))},[s,m]);let g=z.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,U.jsx)(KD.Provider,{value:g,children:t})}function aO(){return new Map}function oO(){return new Set}function sO(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var cO=20;function lO(e,t,n,r){let[i,a]=z.useState(!1);V(()=>{if(!e||!t||n==null){a(!1);return}let r=ti(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-cO)},[e,t,n]),qE(e&&(!t||i),r)}var uO=z.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=zn,style:g,..._}=e,{store:v}=BD(),y=nO(),b=HD(!0),x=v.useState(`parent`),S=v.useState(`floatingRootContext`),C=v.useState(`floatingTreeRoot`),w=v.useState(`mounted`),T=v.useState(`open`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`activeTriggerElement`),k=v.useState(`transitionStatus`),A=v.useState(`positionerElement`),j=v.useState(`instantType`),M=v.useState(`hasViewport`),ee=v.useState(`lastOpenChangeReason`),N=v.useState(`floatingNodeId`),P=v.useState(`floatingParentNodeId`),F=S.useState(`domReferenceElement`),te=z.useRef(null),I=hc(A,!1,!1),ne=n,re=c,ie=l,L=s,ae=h;x.type===`context-menu`&&(ne=n??x.context?.anchor,L??=`start`,!o&&L!==`center`&&(ie=e.alignOffset??2,re=e.sideOffset??-5));let R=o,oe=L;x.type===`menu`?(R??=`inline-end`,oe??=`start`,ae=e.collisionAvoidance??Bn):x.type===`menubar`&&(R??=`bottom`,oe??=`start`);let se=x.type===`context-menu`,ce=Ol({anchor:ne,floatingRootContext:S,positionMethod:b?`fixed`:r,mounted:w,side:R,sideOffset:re,align:oe,alignOffset:ie,arrowPadding:se?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:N,keepMounted:y,disableAnchorTracking:m,collisionAvoidance:ae,shiftCrossAxis:se&&!(`side`in ae&&ae.side===`flip`),externalTree:C,adaptiveOrigin:M?Tl:void 0});z.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===N&&v.set(`hoverEnabled`,!1),e.nodeId!==N&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,Ur(Br)))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[v,C.events,N]),z.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,Ur(t))}return C.events.on(`menuopenchange`,e),()=>{C.events.off(`menuopenchange`,e)}},[C.events,v]);let le=ar();z.useEffect(()=>{T||le.clear()},[T,le]),z.useEffect(()=>{function e(e){if(!(!T||e.nodeId!==v.select(`floatingParentNodeId`)))if(e.target&&O&&O!==e.target){let e=v.select(`closeDelay`);e>0?le.isStarted()||le.start(e,()=>{v.setOpen(!1,Ur(Br))}):v.setOpen(!1,Ur(Br))}else le.clear()}return C.events.on(`itemhover`,e),()=>{C.events.off(`itemhover`,e)}},[C.events,T,O,v,le]),z.useEffect(()=>{let e={open:T,nodeId:N,parentNodeId:P,reason:v.select(`lastOpenChangeReason`)};C.events.emit(`menuopenchange`,e)},[C.events,T,v,N,P]),V(()=>{let e=F,t=te.current;if(e&&(te.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return I(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[F,I,v]);let ue={open:T,side:ce.side,align:ce.align,anchorHidden:ce.anchorHidden,nested:x.type===`menu`,instant:j},de=x.type===`menubar`&&x.context.modal;lO(T&&(de||E&&ee!==`trigger-hover`),D===`touch`,A,O);let fe=jl(e,ue,{styles:ce.positionerStyles,transitionStatus:k,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!w,inert:!T}),pe=w&&x.type!==`menu`&&(x.type!==`menubar`&&E&&ee!==`trigger-hover`||x.type===`menubar`&&x.context.modal),me=null;return x.type===`menubar`?me=x.context.contentElement:x.type===void 0&&(me=O),(0,U.jsxs)(LD.Provider,{value:ce,children:[pe&&(0,U.jsx)(LE,{ref:x.type===`context-menu`||x.type===`nested-context-menu`?x.context.internalBackdropRef:null,inert:Ml(!T),cutout:me}),(0,U.jsx)(fo,{id:N,children:(0,U.jsx)(iO,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:fe})})]})}),dO=z.createContext(null);function fO(e){let t=z.useContext(dO);if(t===null&&!e)throw Error(hn(5));return t}var pO={...Tc,disabled:W(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:W(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),openMethod:W(e=>e.openMethod),allowMouseEnter:W(e=>e.allowMouseEnter),stickIfOpen:W(e=>e.stickIfOpen),parent:W(e=>e.parent),rootId:W(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:W(e=>e.activeIndex),isActive:W((e,t)=>e.activeIndex===t),hoverEnabled:W(e=>e.hoverEnabled),instantType:W(e=>e.instantType),lastOpenChangeReason:W(e=>e.openChangeReason),floatingTreeRoot:W(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:W(e=>e.floatingNodeId),floatingParentNodeId:W(e=>e.floatingParentNodeId),itemProps:W(e=>e.itemProps),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport),keyboardEventRelay:W(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},mO=class e extends sc{constructor(e){super({...hO(),...e},{positionerRef:z.createRef(),popupRef:z.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:z.createRef(),beforeContentFocusGuardRef:z.createRef(),onOpenChangeComplete:void 0,triggerElements:new xc},pO),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);t===i&&n===a&&r===o||(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=Gt(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function hO(){return{...Cc(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new ao,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:In,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}var gO=z.createContext(void 0);function _O(){return z.useContext(gO)}var vO=Xs(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:d=!1,handle:f,triggerId:p,defaultTriggerId:m=null,highlightItemOnHover:h=!0}=e,g=HD(!0),_=BD(!0),v=fO(!0),y=_O(),b=z.useMemo(()=>y&&_?{type:`menu`,store:_.store}:v?{type:`menubar`,context:v}:g&&!_?{type:`context-menu`,context:g}:{type:void 0},[g,_,v,y]),x=mO.useStore(f?.store,{open:a,openProp:n,activeTriggerId:m,triggerIdProp:p,parent:b});er(()=>{n===void 0&&x.state.open===!1&&a===!0&&x.update({open:!0,activeTriggerId:m})}),x.useControlledProp(`openProp`,n),x.useControlledProp(`triggerIdProp`,p),x.useContextCallback(`onOpenChangeComplete`,i);let S=x.useState(`floatingTreeRoot`),C=uo(S),w=co();V(()=>{g&&!_?x.update({parent:{type:`context-menu`,context:g},floatingNodeId:C,floatingParentNodeId:w}):_&&x.update({floatingNodeId:C,floatingParentNodeId:w})},[g,_,C,w,x]);let T=x.useState(`open`),E=x.useState(`activeTriggerElement`),D=x.useState(`positionerElement`),O=x.useState(`hoverEnabled`),k=x.useState(`disabled`),A=x.useState(`lastOpenChangeReason`),j=x.useState(`parent`),M=x.useState(`activeIndex`),ee=x.useState(`payload`),N=x.useState(`floatingParentNodeId`),P=z.useRef(null),F=N!=null,{openMethod:te,triggerProps:I}=XE(T);x.useSyncedValues({disabled:o,modal:j.type===void 0?s:void 0,openMethod:te,rootId:Qa()}),yc(x);let{forceUnmount:ne}=bc(T,x,()=>{x.update({allowMouseEnter:!1,stickIfOpen:!0})}),re=z.useRef(j.type!==`context-menu`),ie=ar();z.useEffect(()=>{if(T||(P.current=null),j.type===`context-menu`){if(!T){ie.clear(),re.current=!1;return}ie.start(500,()=>{re.current=!0})}},[ie,T,j.type]),V(()=>{!T&&!O&&x.set(`hoverEnabled`,!0)},[T,O,x]);let L=z.useRef(!0),ae=ar(),R=B((e,t)=>{let n=t.reason;if(T===e&&t.trigger===E&&A===n||(t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&(t.trigger=E??void 0),r?.(e,t),t.isCanceled))return;x.state.floatingRootContext.dispatchOpenChange(e,t);let i=t.event;if(e===!1&&i?.type===`click`&&i.pointerType===`touch`&&!L.current)return;if(!e&&M!==null){let e=x.context.itemDomElements.current[M];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}e&&n===`trigger-focus`?(L.current=!1,ae.start(300,()=>{L.current=!0})):(L.current=!0,ae.clear());let a=(n===`trigger-press`||n===`item-press`)&&i.detail===0&&i?.isTrusted,o=!e&&(n===`escape-key`||n==null),s={open:e,openChangeReason:n};P.current=t.event??null;let c=t.trigger?.id??null;(c||e)&&(s.activeTriggerId=c,s.activeTriggerElement=t.trigger??null),x.update(s),j.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?x.set(`instantType`,`group`):a||o?x.set(`instantType`,a?`click`:`dismiss`):x.set(`instantType`,void 0)}),oe=z.useCallback(e=>{let t=Ur(e);return t.preventUnmountOnClose=()=>{x.set(`preventUnmountingOnClose`,!0)},t},[x]),se=z.useCallback(()=>{x.setOpen(!1,oe(Hr))},[x,oe]);z.useImperativeHandle(u,()=>({unmount:ne,close:se}),[ne,se]);let ce;j.type===`context-menu`&&(ce=j.context),z.useImperativeHandle(ce?.positionerRef,()=>D,[D]),z.useImperativeHandle(ce?.actionsRef,()=>({setOpen:R}),[R]);let le=Oc({popupStore:x,onOpenChange:R}),ue=le.context.events;z.useEffect(()=>{let e=({open:e,eventDetails:t})=>R(e,t);return ue.on(`setOpen`,e),()=>{ue?.off(`setOpen`,e)}},[ue,R]);let de=Mo(le,{enabled:!k,bubbles:{escapeKey:d&&j.type===`menu`},outsidePress(){return j.type!==`context-menu`||P.current?.type===`contextmenu`?!0:re.current},externalTree:F?S:void 0}),fe=Zc(le,{role:`menu`}),pe=bl(),me=z.useCallback(e=>{x.select(`activeIndex`)!==e&&x.set(`activeIndex`,e)},[x]),he=Yc(le,{enabled:!k,listRef:x.context.itemDomElements,activeIndex:M,nested:j.type!==void 0,loopFocus:c,orientation:l,parentOrientation:j.type===`menubar`?j.context.orientation:void 0,rtl:pe===`rtl`,disabledIndices:Fn,onNavigate:me,openOnArrowKeyDown:j.type!==`context-menu`,externalTree:F?S:void 0,focusItemOnHover:h}),ge=z.useCallback(e=>{x.context.typingRef.current=e},[x]),{getReferenceProps:_e,getFloatingProps:ve,getItemProps:ye,getTriggerProps:be}=zc([de,fe,he,Qc(le,{listRef:x.context.itemLabels,elementsRef:x.context.itemDomElements,activeIndex:M,resetMs:500,onMatch:e=>{T&&e!==M&&x.set(`activeIndex`,e)},onTypingChange:ge})]),xe=z.useMemo(()=>{let e=$t(_e(),{onMouseMove(){x.set(`allowMouseEnter`,!0)}},I);return delete e.role,e},[_e,x,I]),Se=z.useMemo(()=>{let e=be();if(!e)return e;let t=$t(e,I);return delete t.role,delete t[`aria-controls`],t},[be,I]),Ce=z.useMemo(()=>ve({onMouseMove(){x.set(`allowMouseEnter`,!0),j.type===`menu`&&x.set(`hoverEnabled`,!1)},onClick(){x.select(`hoverEnabled`)&&x.set(`hoverEnabled`,!1)},onKeyDown(e){let t=x.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}}),[ve,j.type,x]),we=z.useMemo(()=>ye(),[ye]);x.useSyncedValues({floatingRootContext:le,activeTriggerProps:xe,inactiveTriggerProps:Se,popupProps:Ce,itemProps:we});let Te=z.useMemo(()=>({store:x,parent:b}),[x,b]),Ee=(0,U.jsx)(zD.Provider,{value:Te,children:typeof t==`function`?t({payload:ee}):t});return j.type===void 0||j.type===`context-menu`?(0,U.jsx)(po,{externalTree:S,children:Ee}):Ee});function yO(e){let t=e.getBoundingClientRect(),n=xt(e),r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||i.content!==`none`))return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function bO(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=_n(),{ref:i,index:a}=YD(e),o=n===a,s=z.useRef(null),c=Sn(i,s);return{compositeProps:z.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}function xO(e){let{render:t,className:n,style:r,state:i=In,props:a=Fn,refs:o=Fn,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=bO({metadata:s});return Hn(l,e,{state:i,ref:[...o,f],props:[d,...a,u],stateAttributesMapping:c})}function SO(e){if(Tt(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!Lt(e))return SO(Bt(e))}function CO(e,t){let n=z.useRef(null);return{preFocusGuardRef:n,handlePreFocusGuardFocus:B(t=>{He.flushSync(()=>{e.setOpen(!1,Ur(Ir,t.nativeEvent,t.currentTarget))}),Oa(n.current)?.focus()}),handleFocusTargetFocus:B(n=>{let r=e.select(`positionerElement`);if(r&&ka(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{He.flushSync(()=>{e.setOpen(!1,Ur(Ir,n.nativeEvent,n.currentTarget))});let i=Da(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&pi(r,i);){let e=i;if(i=wa(i),i===e)break}i?.focus()}})}}function wO(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=z.useRef(!1);return z.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,ti(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:In,[t,n,r])}var TO=2,EO=Zs(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,id:o,openOnHover:s,delay:c=100,closeDelay:l=0,handle:u,payload:d,style:f,...p}=e,m=BD(!0),h=u?.store??m?.store;if(!h)throw Error(hn(85));let g=vl(o),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=z.useRef(null),x=OO(),S=_n(!0),C=lo(),w=z.useMemo(()=>C??new ao,[C]),{registerTrigger:T,isMountedByThisTrigger:E}=vc(g,b,h,{payload:d,closeDelay:l,parent:x,floatingTreeRoot:w,floatingNodeId:uo(w),floatingParentNodeId:co(),keyboardEventRelay:S?.relayKeyboardEvent}),D=x.type===`menubar`,O=h.useState(`disabled`),k=i||O||D&&x.context.disabled,{getButtonProps:A,buttonRef:j}=yn({disabled:k,native:a});z.useEffect(()=>{!y&&x.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,x.type]);let M=z.useRef(null),ee=ar(),N=B(e=>{if(!M.current)return;ee.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(pi(M.current,t)||pi(h.select(`positionerElement`),t)||t===M.current||t!=null&&SO(t)===h.select(`rootId`))return;let n=yO(M.current);e.clientX>=n.left-TO&&e.clientX<=n.right+TO&&e.clientY>=n.top-TO&&e.clientY<=n.bottom+TO||w.events.emit(`close`,{domEvent:e,reason:zr})});z.useEffect(()=>{y&&h.select(`lastOpenChangeReason`)===`trigger-hover`&&ti(M.current).addEventListener(`mouseup`,N,{once:!0})},[y,N,h]);let P=D&&x.context.hasSubmenuOpen,F=Rc(v,{enabled:(s??P)&&!k&&x.type!==`context-menu`&&(!D||P&&!E),handleClose:ol({blockPointerEvents:!D}),mouseOnly:!0,move:!1,restMs:x.type===void 0?c:void 0,delay:{close:l},triggerElementRef:b,externalTree:w,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),te=DO(y,h.select(`lastOpenChangeReason`)),I=To(v,{enabled:!k&&x.type!==`context-menu`,event:y&&D?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:x.type===void 0?te:!1}),ne=Ac(v,{enabled:!k&&P}),re=wO({open:y,enabled:D,mouseDownAction:`open`}),ie=zc([I,ne]),L={disabled:k,open:y},ae=h.useState(`triggerProps`,E),R=[M,t,j,T,b],oe=[ie.getReferenceProps(),F??In,ae,{"aria-haspopup":`menu`,id:g,onMouseDown:e=>{h.select(`open`)||(ee.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),ti(e.currentTarget).addEventListener(`mouseup`,N,{once:!0}))}},D?{role:`menuitem`}:{},re,p,A],{preFocusGuardRef:se,handlePreFocusGuardFocus:ce,handleFocusTargetFocus:le}=CO(h,b),ue=Hn(`button`,e,{enabled:!D,stateAttributesMapping:gl,state:L,ref:R,props:oe});return D?(0,U.jsx)(xO,{tag:`button`,render:n,className:r,style:f,state:L,refs:R,props:oe,stateAttributesMapping:gl}):y?(0,U.jsxs)(z.Fragment,{children:[(0,U.jsx)(ai,{ref:se,onFocus:ce},`${g}-pre-focus-guard`),(0,U.jsx)(z.Fragment,{children:ue},g),(0,U.jsx)(ai,{ref:h.context.triggerFocusTargetRef,onFocus:le},`${g}-post-focus-guard`)]}):(0,U.jsx)(z.Fragment,{children:ue},g)});function DO(e,t){let n=ar(),[r,i]=z.useState(!1);return V(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function OO(){let e=HD(!0),t=BD(!0),n=fO(!0);return z.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}function kO({...e}){return(0,U.jsx)(vO,{"data-slot":`dropdown-menu`,...e})}function AO({...e}){return(0,U.jsx)(EO,{"data-slot":`dropdown-menu-trigger`,...e})}function jO({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,U.jsx)(rO,{children:(0,U.jsx)(uO,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,U.jsx)(eO,{"data-slot":`dropdown-menu-content`,className:H(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function MO({className:e,inset:t,variant:n=`default`,...r}){return(0,U.jsx)(XD,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:H(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function NO(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function PO(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function FO(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function IO(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(FO(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function LO(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?PO(e.value):PO(e)}W(e=>e.id),W(e=>e.labelId),W(e=>e.modal),W(e=>e.multiple),W(e=>e.items),W(e=>e.itemToStringLabel),W(e=>e.itemToStringValue),W(e=>e.isItemEqualToValue),W(e=>e.value),W(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:LO(t,r)!==``}),W((e,t)=>t?IO(e.items):!1),W(e=>e.open),W(e=>e.mounted),W(e=>e.forceMount),W(e=>e.transitionStatus),W(e=>e.openMethod),W(e=>e.activeIndex),W(e=>e.selectedIndex),W((e,t)=>e.activeIndex===t),W((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>NO(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:NO(n,i,r)}),W((e,t)=>e.selectedIndex===t),W(e=>e.popupProps),W(e=>e.triggerProps),W(e=>e.triggerElement),W(e=>e.positionerElement),W(e=>e.listElement),W(e=>e.scrollUpArrowVisible),W(e=>e.scrollDownArrowVisible),W(e=>e.hasScrollArrows);function RO({className:e,...t}){return(0,U.jsx)(iu,{role:`status`,"aria-label":`Loading`,className:H(`size-4 animate-spin`,e),...t})}var zO=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,BO=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=zO[n[e]&63];return t},VO=async e=>{try{let t=await(await fetch(e)).blob();return new Promise(e=>{let n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>e(null),n.readAsDataURL(t)})}catch{return null}},HO=(0,z.createContext)(null),UO=(0,z.createContext)(null),WO=()=>(0,z.useContext)(HO),GO=()=>(0,z.useContext)(UO),KO=(0,z.createContext)(null),qO=()=>{let e=GO(),t=(0,z.useContext)(KO)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},JO=(0,z.createContext)(null),YO=({label:e=`Add photos or files`,...t})=>{let n=qO(),r=(0,z.useCallback)(()=>{n.openFileDialog()},[n]);return(0,U.jsxs)(MO,{...t,closeOnClick:!1,onClick:r,children:[(0,U.jsx)(nu,{className:`mr-2 size-4`}),` `,e]})},XO=({className:e,accept:t,multiple:n,globalDrop:r,syncHiddenInput:i,maxFiles:a,maxFileSize:o,onError:s,onSubmit:c,children:l,...u})=>{let d=WO(),f=!!d,p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)([]),_=f?d.attachments.files:h,[v,y]=(0,z.useState)([]),b=(0,z.useRef)(_);(0,z.useEffect)(()=>{b.current=_},[_]);let x=(0,z.useCallback)(()=>{p.current?.click()},[]),S=(0,z.useCallback)(e=>!t||t.trim()===``?!0:t.split(`,`).map(e=>e.trim()).filter(Boolean).some(t=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t}),[t]),C=(0,z.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>o?e.size<=o:!0);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}g(e=>{let t=typeof a==`number`?Math.max(0,a-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&s?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({filename:e.name,id:BO(),mediaType:e.type,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[S,a,o,s]),w=(0,z.useCallback)(e=>g(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),T=(0,z.useCallback)(e=>{let t=[...e],n=t.filter(e=>S(e));if(t.length&&n.length===0){s?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>o?e.size<=o:!0);if(n.length>0&&r.length===0){s?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}let i=_.length,c=typeof a==`number`?Math.max(0,a-i):void 0,l=typeof c==`number`?r.slice(0,c):r;typeof c==`number`&&r.length>c&&s?.({code:`max_files`,message:`Too many files. Some were not added.`}),l.length>0&&d?.attachments.add(l)},[S,o,a,s,_.length,d]),E=(0,z.useCallback)(()=>f?d?.attachments.clear():g(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[f,d]),D=(0,z.useCallback)(()=>y([]),[]),O=f?T:C,k=f?d.attachments.remove:w,A=f?d.attachments.openFileDialog:x,j=(0,z.useCallback)(()=>{E(),D()},[E,D]);(0,z.useEffect)(()=>{f&&d.__registerFileInput(p,()=>p.current?.click())},[f,d]),(0,z.useEffect)(()=>{i&&p.current&&_.length===0&&(p.current.value=``)},[_,i]),(0,z.useEffect)(()=>{let e=m.current;if(!e||r)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&O(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[O,r]),(0,z.useEffect)(()=>{if(!r)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&O(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[O,r]),(0,z.useEffect)(()=>()=>{if(!f)for(let e of b.current)e.url&&URL.revokeObjectURL(e.url)},[f]);let M=(0,z.useCallback)(e=>{e.currentTarget.files&&O(e.currentTarget.files),e.currentTarget.value=``},[O]),ee=(0,z.useMemo)(()=>({add:O,clear:E,fileInputRef:p,files:_.map(e=>({...e,id:e.id})),openFileDialog:A,remove:k}),[_,O,k,E,A]),N=(0,z.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];y(e=>[...e,...t.map(e=>({...e,id:BO()}))])},clear:D,remove:e=>{y(t=>t.filter(t=>t.id!==e))},sources:v}),[v,D]),P=(0,z.useCallback)(async e=>{e.preventDefault();let t=e.currentTarget,n=f?d.textInput.value:new FormData(t).get(`message`)||``;f||t.reset();try{let t=c({files:await Promise.all(_.map(async({id:e,...t})=>{if(t.url?.startsWith(`blob:`)){let e=await VO(t.url);return{...t,url:e??t.url}}return t})),text:n},e);if(t instanceof Promise)try{await t,j(),f&&d.textInput.clear()}catch{}else j(),f&&d.textInput.clear()}catch{}},[f,d,_,c,j]),F=(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{accept:t,"aria-label":`Upload files`,className:`hidden`,multiple:n,onChange:M,ref:p,title:`Upload files`,type:`file`}),(0,U.jsx)(`form`,{className:H(`w-full`,e),onSubmit:P,ref:m,...u,children:(0,U.jsx)(jD,{className:`overflow-hidden`,children:l})})]}),te=(0,U.jsx)(JO.Provider,{value:N,children:F});return(0,U.jsx)(KO.Provider,{value:ee,children:te})},ZO=({className:e,...t})=>(0,U.jsx)(`div`,{className:H(`contents`,e),...t}),QO=({onChange:e,onKeyDown:t,className:n,placeholder:r=`What would you like to know?`,...i})=>{let a=WO(),o=qO(),[s,c]=(0,z.useState)(!1),l=(0,z.useCallback)(e=>{if(t?.(e),!e.defaultPrevented){if(e.key===`Enter`){if(s||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let{form:t}=e.currentTarget;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&o.files.length>0){e.preventDefault();let t=o.files.at(-1);t&&o.remove(t.id)}}},[t,s,o]),u=(0,z.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),o.add(n))},[o]),d=(0,z.useCallback)(()=>c(!1),[]),f=(0,z.useCallback)(()=>c(!0),[]),p=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,U.jsx)(ID,{className:H(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:d,onCompositionStart:f,onKeyDown:l,onPaste:u,placeholder:r,...i,...p})},$O=({className:e,...t})=>(0,U.jsx)(ND,{align:`block-end`,className:H(`order-first flex-wrap gap-1`,e),...t}),ek=({className:e,...t})=>(0,U.jsx)(ND,{align:`block-end`,className:H(`justify-between gap-1`,e),...t}),tk=({className:e,...t})=>(0,U.jsx)(`div`,{className:H(`flex min-w-0 items-center gap-1`,e),...t}),nk=({variant:e=`ghost`,className:t,size:n,tooltip:r,...i})=>{let a=n??(z.Children.count(i.children)>1?`sm`:`icon-sm`),o=(0,U.jsx)(FD,{className:H(t),size:a,type:`button`,variant:e,...i});if(!r)return o;let s=typeof r==`string`?r:r.content,c=typeof r==`string`?void 0:r.shortcut,l=typeof r==`string`?`top`:r.side??`top`;return(0,U.jsxs)(yd,{children:[(0,U.jsx)(bd,{children:o}),(0,U.jsxs)(xd,{side:l,children:[s,c&&(0,U.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:c})]})]})},rk=e=>(0,U.jsx)(kO,{...e}),ik=({className:e,children:t,...n})=>(0,U.jsx)(AO,{render:(0,U.jsx)(nk,{className:e,...n}),children:t??(0,U.jsx)(uu,{className:`size-4`})}),ak=({className:e,...t})=>(0,U.jsx)(jO,{align:`start`,className:H(e),...t}),ok=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,onStop:i,onClick:a,children:o,...s})=>{let c=r===`submitted`||r===`streaming`,l=(0,U.jsx)(Zl,{className:`size-4`});r===`submitted`?l=(0,U.jsx)(RO,{}):r===`streaming`?l=(0,U.jsx)(mu,{className:`size-4`}):r===`error`&&(l=(0,U.jsx)(bu,{className:`size-4`}));let u=(0,z.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,U.jsx)(FD,{"aria-label":c?`Stop`:`Submit`,className:H(e),onClick:u,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??l})};function sk(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=wD({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=uc(o,!0,!0),[d,f]=z.useState(o),[{height:p,width:m},h]=z.useState({height:void 0,width:void 0}),g=vl(),[_,v]=z.useState(),y=_??g,[b,x]=z.useState(!1),[S,C]=z.useState(!1),w=z.useRef(null),T=z.useRef(null),E=z.useRef(null),D=z.useRef(null),O=hc(D,!1),k=B(e=>{let t=!o,n=Ur(Ar,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=D.current;T.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!b&&!S&&(T.current!=null&&T.current!==`css-animation`&&!c&&t&&l(!0),T.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),T.current===`none`&&c&&!t&&l(!1)});return V(()=>{a&&T.current===`none`&&!o&&l(!1)},[a,o,t,l]),z.useMemo(()=>({abortControllerRef:w,animationTypeRef:T,disabled:i,handleTrigger:k,height:p,mounted:c,open:o,panelId:y,panelRef:D,runOnceAnimationsFinish:O,setDimensions:h,setHiddenUntilFound:x,setKeepMounted:C,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:E,transitionStatus:u,visible:d,width:m}),[w,T,i,k,p,c,o,y,D,O,h,x,C,l,s,f,E,u,d,m])}var ck=z.createContext(void 0);function lk(){let e=z.useContext(ck);if(e===void 0)throw Error(hn(15));return e}var uk=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=dc.startingStyle]=`startingStyle`,e[e.endingStyle=dc.endingStyle]=`endingStyle`,e}({}),dk=function(e){return e.panelOpen=`data-panel-open`,e}({}),fk={[uk.open]:``},pk={[uk.closed]:``},mk={open(e){return e?{[dk.panelOpen]:``}:null}},hk={open(e){return e?fk:pk},...mc},gk=z.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=B(o),d=sk({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=z.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=z.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=Hn(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:hk});return(0,U.jsx)(ck.Provider,{value:p,children:m})}),_k={...mk,...mc},vk=z.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=lk(),{className:s,disabled:c=o,id:l,render:u,nativeButton:d=!0,style:f,...p}=e,{getButtonProps:m,buttonRef:h}=yn({disabled:c,focusableWhenDisabled:!0,native:d}),g=z.useMemo(()=>({"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i}),[n,r,i]);return Hn(`button`,e,{state:a,ref:[t,h],props:[g,p,m],stateAttributesMapping:_k})}),yk=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function bk(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,b=z.useRef(!1),x=z.useRef(null),S=z.useRef(u),C=z.useRef(u),w=ei(),T=z.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),E=Sn(r,d,B(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(yk.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),C.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=$r.request(()=>{C.current=!1,r=$r.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{$r.cancel(t),$r.cancel(r)}}));return V(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)}),!C.current&&!o&&e.setAttribute(uk.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=$r.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=uk.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),w.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{$r.cancel(r)}},[t,n,w,a,o,c,u,d,f,p,m]),V(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(x.current=e.style.animationName||x.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!S.current&&!b.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),nr(()=>{let e=$r.request(()=>{S.current=!1});return()=>$r.cancel(e)}),V(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&b.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=$r.request(()=>{b.current=!1,n=$r.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{$r.cancel(t),$r.cancel(n)}},[a,u,d,p]),V(()=>{let e=d.current;e&&a&&T&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(uk.startingStyle,``))},[a,T,n,d]),z.useEffect(function(){let e=d.current;if(!e)return;function t(e){b.current=!0,h(!0),l(!0,Ur(kr,e))}return qr(e,`beforematch`,t)},[l,d,h]),z.useMemo(()=>({props:{hidden:T,id:s,ref:E}}),[T,s,E])}var xk=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),Sk=z.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{abortControllerRef:l,animationTypeRef:u,height:d,mounted:f,onOpenChange:p,open:m,panelId:h,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setHiddenUntilFound:y,setKeepMounted:b,setMounted:x,setPanelIdState:S,setOpen:C,setVisible:w,state:T,transitionDimensionRef:E,visible:D,width:O,transitionStatus:k}=lk(),A=r??!1,j=i??!1;V(()=>{if(o)return S(o),()=>{S(void 0)}},[o,S]),V(()=>{y(A)},[y,A]),V(()=>{b(j)},[b,j]);let{props:M}=bk({abortControllerRef:l,animationTypeRef:u,externalRef:t,height:d,hiddenUntilFound:A,id:h,keepMounted:j,mounted:f,onOpenChange:p,open:m,panelRef:g,runOnceAnimationsFinish:_,setDimensions:v,setMounted:x,setOpen:C,setVisible:w,transitionDimensionRef:E,visible:D,width:O});gc({open:m&&k===`idle`,ref:g,onComplete(){m&&v({height:void 0,width:void 0})}});let ee=Hn(`div`,e,{state:z.useMemo(()=>({...T,transitionStatus:k}),[T,k]),ref:[t,g],props:[M,{style:{[xk.collapsiblePanelHeight]:d===void 0?`auto`:`${d}px`,[xk.collapsiblePanelWidth]:O===void 0?`auto`:`${O}px`}},c],stateAttributesMapping:hk});return j||A||f?ee:null});function Ck({...e}){return(0,U.jsx)(gk,{"data-slot":`collapsible`,...e})}function wk({...e}){return(0,U.jsx)(vk,{"data-slot":`collapsible-trigger`,...e})}function Tk({...e}){return(0,U.jsx)(Sk,{"data-slot":`collapsible-content`,...e})}var Ek=(0,z.createContext)({});function Dk(e){let t=(0,z.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ok=typeof window<`u`?z.useLayoutEffect:z.useEffect,kk=(0,z.createContext)(null);function Ak(e,t){e.indexOf(t)===-1&&e.push(t)}function jk(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Mk=(e,t,n)=>n>t?t:n<e?e:n,Nk={},Pk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Fk(e){return typeof e==`object`&&!!e}var Ik=e=>/^0[^.\s]+$/u.test(e);function Lk(e){let t;return()=>(t===void 0&&(t=e()),t)}var Rk=e=>e,zk=(e,t)=>n=>t(e(n)),Bk=(...e)=>e.reduce(zk),Vk=(e,t,n)=>{let r=t-e;return r===0?1:(n-e)/r},Hk=class{constructor(){this.subscriptions=[]}add(e){return Ak(this.subscriptions,e),()=>jk(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}},Uk=e=>e*1e3,Wk=e=>e/1e3;function Gk(e,t){return t?1e3/t*e:0}var Kk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,qk=1e-7,Jk=12;function Yk(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Kk(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>qk&&++s<Jk);return o}function Xk(e,t,n,r){if(e===t&&n===r)return Rk;let i=t=>Yk(t,0,1,e,n);return e=>e===0||e===1?e:Kk(i(e),t,r)}var Zk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Qk=e=>t=>1-e(1-t),$k=Xk(.33,1.53,.69,.99),eA=Qk($k),tA=Zk(eA),nA=e=>e>=1?1:(e*=2)<1?.5*eA(e):.5*(2-2**(-10*(e-1))),rA=e=>1-Math.sin(Math.acos(e)),iA=Qk(rA),aA=Zk(rA),oA=Xk(.42,0,1,1),sA=Xk(0,0,.58,1),cA=Xk(.42,0,.58,1),lA=e=>Array.isArray(e)&&typeof e[0]!=`number`,uA=e=>Array.isArray(e)&&typeof e[0]==`number`,dA={linear:Rk,easeIn:oA,easeInOut:cA,easeOut:sA,circIn:rA,circInOut:aA,circOut:iA,backIn:eA,backInOut:tA,backOut:$k,anticipate:nA},fA=e=>typeof e==`string`,pA=e=>{if(uA(e)){e.length;let[t,n,r,i]=e;return Xk(t,n,r,i)}else if(fA(e))return dA[e],`${e}`,dA[e];return e},mA=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`],hA={value:null,addProjectionMetrics:null};function gA(e,t){let n=new Set,r=new Set,i=!1,a=!1,o=new WeakSet,s={delta:0,timestamp:0,isProcessing:!1},c=0;function l(t){o.has(t)&&(u.schedule(t),e()),c++,t(s)}let u={schedule:(e,t=!1,a=!1)=>{let s=a&&i?n:r;return t&&o.add(e),s.add(e),e},cancel:e=>{r.delete(e),o.delete(e)},process:e=>{if(s=e,i){a=!0;return}i=!0;let o=n;n=r,r=o,n.forEach(l),t&&hA.value&&hA.value.frameloop[t].push(c),c=0,n.clear(),i=!1,a&&(a=!1,u.process(e))}};return u}var _A=40;function vA(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=mA.reduce((e,n)=>(e[n]=gA(a,t?n:void 0),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Nk.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,_A),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:mA.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<mA.length;t++)o[mA[t]].cancel(e)},state:i,steps:o}}var{schedule:yA,cancel:bA,state:xA,steps:SA}=vA(typeof requestAnimationFrame<`u`?requestAnimationFrame:Rk,!0),CA;function wA(){CA=void 0}var TA={now:()=>(CA===void 0&&TA.set(xA.isProcessing||Nk.useManualTiming?xA.timestamp:performance.now()),CA),set:e=>{CA=e,queueMicrotask(wA)}},EA={layout:0,mainThread:0,waapi:0},DA=e=>t=>typeof t==`string`&&t.startsWith(e),OA=DA(`--`),kA=DA(`var(--`),AA=e=>kA(e)?jA.test(e.split(`/*`)[0].trim()):!1,jA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function MA(e){return typeof e==`string`?e.split(`/*`)[0].includes(`var(--`):!1}var NA={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},PA={...NA,transform:e=>Mk(0,1,e)},FA={...NA,default:1},IA=e=>Math.round(e*1e5)/1e5,LA=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function RA(e){return e==null}var zA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,BA=(e,t)=>n=>!!(typeof n==`string`&&zA.test(n)&&n.startsWith(e)||t&&!RA(n)&&Object.prototype.hasOwnProperty.call(n,t)),VA=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(LA);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},HA=e=>Mk(0,255,e),UA={...NA,transform:e=>Math.round(HA(e))},WA={test:BA(`rgb`,`red`),parse:VA(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+UA.transform(e)+`, `+UA.transform(t)+`, `+UA.transform(n)+`, `+IA(PA.transform(r))+`)`};function GA(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 KA={test:BA(`#`),parse:GA,transform:WA.transform},qA=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),JA=qA(`deg`),YA=qA(`%`),K=qA(`px`),XA=qA(`vh`),ZA=qA(`vw`),QA={...YA,parse:e=>YA.parse(e)/100,transform:e=>YA.transform(e*100)},$A={test:BA(`hsl`,`hue`),parse:VA(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+YA.transform(IA(t))+`, `+YA.transform(IA(n))+`, `+IA(PA.transform(r))+`)`},ej={test:e=>WA.test(e)||KA.test(e)||$A.test(e),parse:e=>WA.test(e)?WA.parse(e):$A.test(e)?$A.parse(e):KA.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?WA.transform(e):$A.transform(e),getAnimatableNone:e=>{let t=ej.parse(e);return t.alpha=0,ej.transform(t)}},tj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function nj(e){return isNaN(e)&&typeof e==`string`&&(e.match(LA)?.length||0)+(e.match(tj)?.length||0)>0}var rj=`number`,ij=`color`,aj=`var`,oj=`var(`,sj="${}",cj=/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 lj(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(cj,e=>(ej.test(e)?(r.color.push(a),i.push(ij),n.push(ej.parse(e))):e.startsWith(oj)?(r.var.push(a),i.push(aj),n.push(e)):(r.number.push(a),i.push(rj),n.push(parseFloat(e))),++a,sj)).split(sj),indexes:r,types:i}}function uj(e){return lj(e).values}function dj({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];e===rj?i+=IA(r[a]):e===ij?i+=ej.transform(r[a]):i+=r[a]}return i}}function fj(e){return dj(lj(e))}var pj=e=>typeof e==`number`?0:ej.test(e)?ej.getAnimatableNone(e):e,mj=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:pj(e);function hj(e){let t=lj(e);return dj(t)(t.values.map((e,n)=>mj(e,t.split[n])))}var gj={test:nj,parse:uj,createTransformer:fj,getAnimatableNone:hj};function _j(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 vj({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=_j(s,r,e+1/3),a=_j(s,r,e),o=_j(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function yj(e,t){return n=>n>0?t:e}var bj=(e,t,n)=>e+(t-e)*n,xj=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Sj=[KA,WA,$A],Cj=e=>Sj.find(t=>t.test(e));function wj(e){let t=Cj(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===$A&&(n=vj(n)),n}var Tj=(e,t)=>{let n=wj(e),r=wj(t);if(!n||!r)return yj(e,t);let i={...n};return e=>(i.red=xj(n.red,r.red,e),i.green=xj(n.green,r.green,e),i.blue=xj(n.blue,r.blue,e),i.alpha=bj(n.alpha,r.alpha,e),WA.transform(i))},Ej=new Set([`none`,`hidden`]);function Dj(e,t){return Ej.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Oj(e,t){return n=>bj(e,t,n)}function kj(e){return typeof e==`number`?Oj:typeof e==`string`?AA(e)?yj:ej.test(e)?Tj:Nj:Array.isArray(e)?Aj:typeof e==`object`?ej.test(e)?Tj:jj:yj}function Aj(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>kj(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function jj(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=kj(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Mj(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]];n[i]=e.values[o]??0,r[a]++}return n}var Nj=(e,t)=>{let n=gj.createTransformer(t),r=lj(e),i=lj(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?Ej.has(e)&&!i.values.length||Ej.has(t)&&!r.values.length?Dj(e,t):Bk(Aj(Mj(r,i),i.values),n):(`${e}${t}`,yj(e,t))};function Pj(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?bj(e,t,n):kj(e)(e,t)}var Fj=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>yA.update(t,e),stop:()=>bA(t),now:()=>xA.isProcessing?xA.timestamp:TA.now()}},Ij=(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)})`},Lj=2e4;function Rj(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 zj(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Rj(r),Lj);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Wk(i)}}var Bj={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 Vj(e,t){return e*Math.sqrt(1-t*t)}var Hj=12;function Uj(e,t,n){let r=n;for(let n=1;n<Hj;n++)r-=e(r)/t(r);return r}var Wj=.001;function Gj({duration:e=Bj.duration,bounce:t=Bj.bounce,velocity:n=Bj.velocity,mass:r=Bj.mass}){let i,a;Bj.maxDuration;let o=1-t;o=Mk(Bj.minDamping,Bj.maxDamping,o),e=Mk(Bj.minDuration,Bj.maxDuration,Wk(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Vj(t,o),c=Math.exp(-i);return Wj-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=Vj(t**2,o);return(-i(t)+Wj>0?-1:1)*((a-s)*c)/l}):(i=t=>{let r=Math.exp(-t*e),i=(t-n)*e+1;return-Wj+r*i},a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Uj(i,a,s);if(e=Uk(e),isNaN(c))return{stiffness:Bj.stiffness,damping:Bj.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Kj=[`duration`,`bounce`],qj=[`stiffness`,`damping`,`mass`];function Jj(e,t){return t.some(t=>e[t]!==void 0)}function Yj(e){let t={velocity:Bj.velocity,stiffness:Bj.stiffness,damping:Bj.damping,mass:Bj.mass,isResolvedFromDuration:!1,...e};if(!Jj(e,qj)&&Jj(e,Kj))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Mk(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Bj.mass,stiffness:i,damping:a}}else{let n=Gj({...e,velocity:0});t={...t,...n,mass:Bj.mass},t.isResolvedFromDuration=!0}return t}function Xj(e=Bj.visualDuration,t=Bj.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}=Yj({...n,velocity:-Wk(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Wk(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?Bj.restSpeed.granular:Bj.restSpeed.default,i||=v?Bj.restDelta.granular:Bj.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Vj(_,h),S=(m+h*_*g)/x,y=e=>o-Math.exp(-h*_*e)*(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=>Uk(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=Uk(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=Uk(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(Rj(T),Lj),t=Ij(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Xj.applyToOptions=e=>{let t=zj(e,100,Xj);return e.ease=t.ease,e.duration=Uk(t.duration),e.type=`keyframes`,e};var Zj=5;function Qj(e,t,n){let r=Math.max(t-Zj,0);return Gk(n-e(r),t-r)}function $j({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=Xj({keyframes:[f.value,m(f.value)],velocity:Qj(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 eM(e,t,n){let r=[],i=n||Nk.mix||Pj,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Bk(Array.isArray(t)?t[n]||Rk:t,a)),r.push(a)}return r}function tM(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=eM(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=Vk(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Mk(e[0],e[a-1],t)):l}function nM(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Vk(0,t,r);e.push(bj(n,1,i))}}function rM(e){let t=[0];return nM(t,e.length-1),t}function iM(e,t){return e.map(e=>e*t)}function aM(e,t){return e.map(()=>t||cA).splice(0,e.length-1)}function oM({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=lA(r)?r.map(pA):pA(r),a={done:!1,value:t[0]},o=tM(iM(n&&n.length===t.length?n:rM(t),e),t,{ease:Array.isArray(i)?i:aM(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var sM=e=>e!==null;function cM(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(sM),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var lM={decay:$j,inertia:$j,tween:oM,keyframes:oM,spring:Xj};function uM(e){typeof e.type==`string`&&(e.type=lM[e.type])}var dM=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)}},fM=e=>e/100,pM=class extends dM{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!==TA.now()&&this.tick(TA.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},EA.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;uM(e);let{type:t=oM,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||oM;s!==oM&&typeof o[0]!=`number`&&(this.mixKeyframes=Bk(fM,Pj(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=Rj(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.holdTime===null?this.currentTime=t:this.currentTime=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=Mk(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!==$j&&(b.value=cM(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 Wk(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Wk(e)}get time(){return Wk(this.currentTime)}set time(e){e=Uk(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 Qj(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(TA.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Wk(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Fj,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(TA.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,EA.mainThread--}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 mM(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var hM=e=>e*180/Math.PI,gM=e=>vM(hM(Math.atan2(e[1],e[0]))),_M={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gM,rotateZ:gM,skewX:e=>hM(Math.atan(e[1])),skewY:e=>hM(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vM=e=>(e%=360,e<0&&(e+=360),e),yM=gM,bM=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xM=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),SM={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bM,scaleY:xM,scale:e=>(bM(e)+xM(e))/2,rotateX:e=>vM(hM(Math.atan2(e[6],e[5]))),rotateY:e=>vM(hM(Math.atan2(-e[2],e[0]))),rotateZ:yM,rotate:yM,skewX:e=>hM(Math.atan(e[4])),skewY:e=>hM(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function CM(e){return+!!e.includes(`scale`)}function wM(e,t){if(!e||e===`none`)return CM(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=SM,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_M,i=t}if(!i)return CM(t);let a=r[t],o=i[1].split(`,`).map(EM);return typeof a==`function`?a(o):o[a]}var TM=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wM(n,t)};function EM(e){return parseFloat(e.trim())}var DM=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],OM=new Set(DM),kM=e=>e===NA||e===K,AM=new Set([`x`,`y`,`z`]),jM=DM.filter(e=>!AM.has(e));function MM(e){let t=[];return jM.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var NM={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})=>wM(t,`x`),y:(e,{transform:t})=>wM(t,`y`)};NM.translateX=NM.x,NM.translateY=NM.y;var PM=new Set,FM=!1,IM=!1,LM=!1;function RM(){if(IM){let e=Array.from(PM).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=MM(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)})}IM=!1,FM=!1,PM.forEach(e=>e.complete(LM)),PM.clear()}function zM(){PM.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(IM=!0)})}function BM(){LM=!0,zM(),RM(),LM=!1}var VM=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?(PM.add(this),FM||(FM=!0,yA.read(zM),yA.resolveKeyframes(RM))):(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])}mM(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),PM.delete(this)}cancel(){this.state===`scheduled`&&(PM.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},HM=e=>e.startsWith(`--`);function UM(e,t,n){HM(t)?e.style.setProperty(t,n):e.style[t]=n}var WM={};function GM(e,t){let n=Lk(e);return()=>WM[t]??n()}var KM=GM(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),qM=GM(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),JM=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,YM={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:JM([0,.65,.55,1]),circOut:JM([.55,0,1,.45]),backIn:JM([.31,.01,.66,-.59]),backOut:JM([.33,1.53,.69,.99])};function XM(e,t){if(e)return typeof e==`function`?qM()?Ij(e,t):`ease-out`:uA(e)?JM(e):Array.isArray(e)?e.map(e=>XM(e,t)||YM.easeOut):YM[e]}function ZM(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=XM(s,i);Array.isArray(d)&&(u.easing=d),hA.value&&EA.waapi++;let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};l&&(f.pseudoElement=l);let p=e.animate(u,f);return hA.value&&p.finished.finally(()=>{EA.waapi--}),p}function QM(e){return typeof e==`function`&&`applyToOptions`in e}function $M({type:e,...t}){return QM(e)&&qM()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var eN=class extends dM{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=$M(e);this.animation=ZM(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=cM(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),UM(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 Wk(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Wk(e)}get time(){return Wk(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Uk(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&&KM()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Rk):r(this)}},tN={anticipate:nA,backInOut:tA,circInOut:aA};function nN(e){return e in tN}function rN(e){typeof e.ease==`string`&&nN(e.ease)&&(e.ease=tN[e.ease])}var iN=10,aN=class extends eN{constructor(e){rN(e),uM(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 pM({...a,autoplay:!1}),s=Math.max(iN,TA.now()-this.startTime),c=Mk(0,iN,s-iN),l=o.sample(s).value,{name:u}=this.options;i&&u&&UM(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},oN=(e,t)=>t===`zIndex`?!1:!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(gj.test(e)||e===`0`)&&!e.startsWith(`url(`));function sN(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 cN(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=oN(i,t),s=oN(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:sN(e)||(n===`spring`||QM(n))&&r}function lN(e){e.duration=0,e.type=`keyframes`}var uN=new Set([`opacity`,`clipPath`,`filter`,`transform`]),dN=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function fN(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&dN.test(e[t]))return!0;return!1}var pN=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),mN=Lk(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function hN(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return mN()&&n&&(uN.has(n)||pN.has(n)&&fN(s))&&(n!==`transform`||!l)&&!c&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var gN=40,_N=class extends dM{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=TA.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u};this.keyframeResolver=new(l?.KeyframeResolver||VM)(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=TA.now();let u=!0;cN(e,i,a,o)||(u=!1,(Nk.instantAnimations||!s)&&l?.(cM(e,n,t)),e[0]=e[e.length-1],lN(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>gN?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&hN(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new aN({...d,element:p})}catch{m=new pM(d)}else m=new pM(d);m.finished.then(()=>{this.notifyFinished()}).catch(Rk),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(),BM()),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()}};function vN(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var yN=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function bN(e){let t=yN.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function xN(e,t,n=1){`${e}`;let[r,i]=bN(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Pk(e)?parseFloat(e):e}return AA(i)?xN(i,t,n+1):i}var SN={type:`spring`,stiffness:500,damping:25,restSpeed:10},CN=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),wN={type:`keyframes`,duration:.8},TN={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},EN=(e,{keyframes:t})=>t.length>2?wN:OM.has(e)?e.startsWith(`scale`)?CN(t[1]):SN:TN;function DN(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function ON(e,t){let n=e?.[t]??e?.default??e;return n===e?n:DN(n,e)}var kN=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function AN(e){for(let t in e)if(!kN.has(t))return!0;return!1}var jN=(e,t,n,r={},i,a)=>o=>{let s=ON(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Uk(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};AN(s)||Object.assign(u,EN(e,u)),u.duration&&=Uk(u.duration),u.repeatDelay&&=Uk(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(lN(u),u.delay===0&&(d=!0)),(Nk.instantAnimations||Nk.skipAnimations||i?.shouldSkipAnimations)&&(d=!0,lN(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=cM(u.keyframes,s);if(e!==void 0){yA.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new pM(u):new _N(u)};function MN(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function NN(e,t,n,r){if(typeof t==`function`){let[i,a]=MN(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]=MN(r);t=t(n===void 0?e.custom:n,i,a)}return t}function PN(e,t,n){let r=e.getProps();return NN(r,t,n===void 0?r.custom:n,e)}var FN=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...DM]),IN=30,LN=e=>!isNaN(parseFloat(e)),RN={current:void 0},zN=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=TA.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=TA.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=LN(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 Hk);let n=this.events[e].add(t);return e===`change`?()=>{n(),yA.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 RN.current&&RN.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=TA.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>IN)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,IN);return Gk(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 BN(e,t){return new zN(e,t)}var VN=e=>Array.isArray(e);function HN(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,BN(n))}function UN(e){return VN(e)?e[e.length-1]||0:e}function WN(e,t){let{transitionEnd:n={},transition:r={},...i}=PN(e,t)||{};i={...i,...n};for(let t in i)HN(e,t,UN(i[t]))}var GN=e=>!!(e&&e.getVelocity);function KN(e){return!!(GN(e)&&e.add)}function qN(e,t){let n=e.getValue(`willChange`);if(KN(n))return n.add(t);if(!n&&Nk.WillChange){let n=new Nk.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function JN(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var YN=`data-`+JN(`framerAppearId`);function XN(e){return e.props[YN]}function ZN({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function QN(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?DN(a,c):c;let l=a?.reduceMotion;r&&(a=r);let u=[],d=i&&e.animationState&&e.animationState.getState()[i];for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||d&&ZN(d,t))continue;let o={delay:n,...ON(a||{},t)},c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){yA.update(()=>r.set(i));continue}let f=!1;if(window.MotionHandoffAnimation){let n=XN(e);if(n){let e=window.MotionHandoffAnimation(n,t,yA);e!==null&&(o.startTime=e,f=!0)}}qN(e,t);let p=l??e.shouldReduceMotion;r.start(jN(t,r,i,p&&FN.has(t)?{type:!1}:o,e,f));let m=r.animation;m&&u.push(m)}if(o){let t=()=>yA.update(()=>{o&&WN(e,o)});u.length?Promise.all(u).then(t):t()}return u}function $N(e,t,n={}){let r=PN(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(QN(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return eP(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}else return Promise.all([a(),o(n.delay)])}function eP(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push($N(c,t,{...o,delay:n+(typeof r==`function`?0:r)+vN(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function tP(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>$N(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=$N(e,t,n);else{let i=typeof t==`function`?PN(e,t,n.custom):t;r=Promise.all(QN(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var nP={test:e=>e===`auto`,parse:e=>e},rP=e=>t=>t.test(e),iP=[NA,K,YA,JA,ZA,XA,nP],aP=e=>iP.find(rP(e));function oP(e){return typeof e==`number`?e===0:e===null?!0:e===`none`||e===`0`||Ik(e)}var sP=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function cP(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(LA)||[];if(!r)return e;let i=n.replace(r,``),a=+!!sP.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var lP=/\b([a-z-]*)\(.*?\)/gu,uP={...gj,getAnimatableNone:e=>{let t=e.match(lP);return t?t.map(cP).join(` `):e}},dP={...gj,getAnimatableNone:e=>{let t=gj.parse(e);return gj.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},fP={...NA,transform:Math.round},pP={borderWidth:K,borderTopWidth:K,borderRightWidth:K,borderBottomWidth:K,borderLeftWidth:K,borderRadius:K,borderTopLeftRadius:K,borderTopRightRadius:K,borderBottomRightRadius:K,borderBottomLeftRadius:K,width:K,maxWidth:K,height:K,maxHeight:K,top:K,right:K,bottom:K,left:K,inset:K,insetBlock:K,insetBlockStart:K,insetBlockEnd:K,insetInline:K,insetInlineStart:K,insetInlineEnd:K,padding:K,paddingTop:K,paddingRight:K,paddingBottom:K,paddingLeft:K,paddingBlock:K,paddingBlockStart:K,paddingBlockEnd:K,paddingInline:K,paddingInlineStart:K,paddingInlineEnd:K,margin:K,marginTop:K,marginRight:K,marginBottom:K,marginLeft:K,marginBlock:K,marginBlockStart:K,marginBlockEnd:K,marginInline:K,marginInlineStart:K,marginInlineEnd:K,fontSize:K,backgroundPositionX:K,backgroundPositionY:K,rotate:JA,rotateX:JA,rotateY:JA,rotateZ:JA,scale:FA,scaleX:FA,scaleY:FA,scaleZ:FA,skew:JA,skewX:JA,skewY:JA,distance:K,translateX:K,translateY:K,translateZ:K,x:K,y:K,z:K,perspective:K,transformPerspective:K,opacity:PA,originX:QA,originY:QA,originZ:K,zIndex:fP,fillOpacity:PA,strokeOpacity:PA,numOctaves:fP},mP={...pP,color:ej,backgroundColor:ej,outlineColor:ej,fill:ej,stroke:ej,borderColor:ej,borderTopColor:ej,borderRightColor:ej,borderBottomColor:ej,borderLeftColor:ej,filter:uP,WebkitFilter:uP,mask:dP,WebkitMask:dP},hP=e=>mP[e],gP=new Set([uP,dP]);function _P(e,t){let n=hP(e);return gP.has(n)||(n=gj),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var vP=new Set([`auto`,`none`,`0`]);function yP(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!vP.has(t)&&lj(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=_P(n,i)}var bP=class extends VM{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(),AA(r))){let i=xN(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!FN.has(n)||e.length!==2)return;let[r,i]=e,a=aP(r),o=aP(i);if(MA(r)!==MA(i)&&NM[n]){this.needsMeasurement=!0;return}if(a!==o)if(kM(a)&&kM(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else NM[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||oP(e[t]))&&n.push(t);n.length&&yP(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=NM[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]=NM[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()}};function xP(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 SP=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function CP(e){return Fk(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:wP,cancel:TP}=vA(queueMicrotask,!1),EP={x:!1,y:!1};function DP(){return EP.x||EP.y}function OP(e){return e===`x`||e===`y`?EP[e]?null:(EP[e]=!0,()=>{EP[e]=!1}):EP.x||EP.y?null:(EP.x=EP.y=!0,()=>{EP.x=EP.y=!1})}function kP(e,t){let n=xP(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function AP(e){return!(e.pointerType===`touch`||DP())}function jP(e,t,n={}){let[r,i,a]=kP(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!AP(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var MP=(e,t)=>t?e===t?!0:MP(e,t.parentElement):!1,NP=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,PP=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function FP(e){return PP.has(e.tagName)||e.isContentEditable===!0}var IP=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function LP(e){return IP.has(e.tagName)||e.isContentEditable===!0}var RP=new WeakSet;function zP(e){return t=>{t.key===`Enter`&&e(t)}}function BP(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var VP=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=zP(()=>{if(RP.has(n))return;BP(n,`down`);let e=zP(()=>{BP(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>BP(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function HP(e){return NP(e)&&!DP()}var UP=new WeakSet;function WP(e,t,n={}){let[r,i,a]=kP(e,n),o=e=>{let r=e.currentTarget;if(!HP(e)||UP.has(e))return;RP.add(r),n.stopPropagation&&UP.add(e);let a=t(r,e),o=(e,t)=>{window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,c),RP.has(r)&&RP.delete(r),HP(e)&&typeof a==`function`&&a(e,{success:t})},s=e=>{o(e,r===window||r===document||n.useGlobalTarget||MP(r,e.target))},c=e=>{o(e,!1)};window.addEventListener(`pointerup`,s,i),window.addEventListener(`pointercancel`,c,i)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),CP(e)&&(e.addEventListener(`focus`,e=>VP(e,i)),!FP(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function GP(e){return Fk(e)&&`ownerSVGElement`in e}var KP=new WeakMap,qP,JP=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:GP(r)&&`getBBox`in r?r.getBBox()[t]:r[n],YP=JP(`inline`,`width`,`offsetWidth`),XP=JP(`block`,`height`,`offsetHeight`);function ZP({target:e,borderBoxSize:t}){KP.get(e)?.forEach(n=>{n(e,{get width(){return YP(e,t)},get height(){return XP(e,t)}})})}function QP(e){e.forEach(ZP)}function $P(){typeof ResizeObserver>`u`||(qP=new ResizeObserver(QP))}function eF(e,t){qP||$P();let n=xP(e);return n.forEach(e=>{let n=KP.get(e);n||(n=new Set,KP.set(e,n)),n.add(t),qP?.observe(e)}),()=>{n.forEach(e=>{let n=KP.get(e);n?.delete(t),n?.size||qP?.unobserve(e)})}}var tF=new Set,nF;function rF(){nF=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};tF.forEach(t=>t(e))},window.addEventListener(`resize`,nF)}function iF(e){return tF.add(e),nF||rF(),()=>{tF.delete(e),!tF.size&&typeof nF==`function`&&(window.removeEventListener(`resize`,nF),nF=void 0)}}function aF(e,t){return typeof e==`function`?iF(e):eF(e,t)}function oF(e){return GP(e)&&e.tagName===`svg`}var sF=[...iP,ej,gj],cF=e=>sF.find(rP(e)),lF=()=>({translate:0,scale:1,origin:0,originPoint:0}),uF=()=>({x:lF(),y:lF()}),dF=()=>({min:0,max:0}),fF=()=>({x:dF(),y:dF()}),pF=new WeakMap;function mF(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function hF(e){return typeof e==`string`||Array.isArray(e)}var gF=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],_F=[`initial`,...gF];function vF(e){return mF(e.animate)||_F.some(t=>hF(e[t]))}function yF(e){return!!(vF(e)||e.variants)}function bF(e,t,n){for(let r in t){let i=t[r],a=n[r];if(GN(i))e.addValue(r,i);else if(GN(a))e.addValue(r,BN(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,BN(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var xF={current:null},SF={current:!1},CF=typeof window<`u`;function wF(){if(SF.current=!0,CF)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>xF.current=e.matches;e.addEventListener(`change`,t),t()}else xF.current=!1}var TF=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],EF={};function DF(e){EF=e}function OF(){return EF}var kF=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=VM,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=TA.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,yA.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=vF(t),this.isVariantNode=yF(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&&GN(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,pF.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:(SF.current||wF(),this.shouldReduceMotion=xF.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(),bA(this.notifyUpdate),bA(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&&uN.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new eN({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Uk(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=OM.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&yA.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(),t.owner&&t.stop()})}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 EF){let t=EF[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):fF()}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<TF.length;t++){let n=TF[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=bF(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=BN(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`&&(Pk(n)||Ik(n))?n=parseFloat(n):!cF(n)&&gj.test(t)&&(n=_P(e,t)),this.setBaseTarget(e,GN(n)?n.get():n)),GN(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=NN(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&&!GN(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 Hk),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){wP.render(this.render)}},AF=class extends kF{constructor(){super(...arguments),this.KeyframeResolver=bP}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;GN(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},jF=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function MF({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function NF({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function PF(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 FF(e){return e===void 0||e===1}function IF({scale:e,scaleX:t,scaleY:n}){return!FF(e)||!FF(t)||!FF(n)}function LF(e){return IF(e)||RF(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function RF(e){return zF(e.x)||zF(e.y)}function zF(e){return e&&e!==`0%`}function BF(e,t,n){return n+t*(e-n)}function VF(e,t,n,r,i){return i!==void 0&&(e=BF(e,i,r)),BF(e,n,r)+t}function HF(e,t=0,n=1,r,i){e.min=VF(e.min,t,n,r,i),e.max=VF(e.max,t,n,r,i)}function UF(e,{x:t,y:n}){HF(e.x,t.translate,t.scale,t.originPoint),HF(e.y,n.translate,n.scale,n.originPoint)}var WF=.999999999999,GF=1.0000000000001;function KF(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(qF(e.x,-a.scroll.offset.x),qF(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,UF(e,o)),r&&LF(a.latestValues)&&XF(e,a.latestValues,a.layout?.layoutBox))}t.x<GF&&t.x>WF&&(t.x=1),t.y<GF&&t.y>WF&&(t.y=1)}function qF(e,t){e.min+=t,e.max+=t}function JF(e,t,n,r,i=.5){HF(e,t,n,bj(e.min,e.max,i),r)}function YF(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function XF(e,t,n){let r=n??e;JF(e.x,YF(t.x,r.x),t.scaleX,t.scale,t.originX),JF(e.y,YF(t.y,r.y),t.scaleY,t.scale,t.originY)}function ZF(e,t){return MF(PF(e.getBoundingClientRect(),t))}function QF(e,t,n){let r=ZF(e,n),{scroll:i}=t;return i&&(qF(r.x,i.offset.x),qF(r.y,i.offset.y)),r}var $F={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},eI=DM.length;function tI(e,t,n){let r=``,i=!0;for(let a=0;a<eI;a++){let o=DM[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=SP(s,pP[o]);if(!c){i=!1;let t=$F[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}return r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function nI(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(OM.has(e)){o=!0;continue}else if(OA(e)){i[e]=n;continue}else{let t=SP(n,pP[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=tI(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 rI(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 iI(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var aI={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(K.test(e))e=parseFloat(e);else return e;return`${iI(e,t.target.x)}% ${iI(e,t.target.y)}%`}},oI={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=gj.parse(e);if(i.length>5)return r;let a=gj.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=bj(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},sI={borderRadius:{...aI,applyTo:[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`]},borderTopLeftRadius:aI,borderTopRightRadius:aI,borderBottomLeftRadius:aI,borderBottomRightRadius:aI,boxShadow:oI};function cI(e,{layout:t,layoutId:n}){return OM.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!sI[e]||e===`opacity`)}function lI(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(GN(r[t])||i&&GN(i[t])||cI(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function uI(e){return window.getComputedStyle(e)}var dI=class extends AF{constructor(){super(...arguments),this.type=`html`,this.renderInstance=rI}readValueFromInstance(e,t){if(OM.has(t))return this.projection?.isProjecting?CM(t):TM(e,t);{let n=uI(e),r=(OA(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return ZF(e,t)}build(e,t,n){nI(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return lI(e,t,n)}},fI={offset:`stroke-dashoffset`,array:`stroke-dasharray`},pI={offset:`strokeDashoffset`,array:`strokeDasharray`};function mI(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?fI:pI;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var hI=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function gI(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(nI(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 hI)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&&mI(d,i,a,o,!1)}var _I=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`]),vI=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function yI(e,t,n,r){rI(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(_I.has(n)?n:JN(n),t.attrs[n])}function bI(e,t,n){let r=lI(e,t,n);for(let n in e)if(GN(e[n])||GN(t[n])){let t=DM.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var xI=class extends AF{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=fF}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(OM.has(t)){let e=hP(t);return e&&e.default||0}return t=_I.has(t)?t:JN(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return bI(e,t,n)}build(e,t,n){gI(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){yI(e,t,n,r)}mount(e){this.isSVGTag=vI(e.tagName),super.mount(e)}},SI=_F.length;function CI(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&CI(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<SI;n++){let r=_F[n],i=e.props[r];(hF(i)||i===!1)&&(t[r]=i)}return t}function wI(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var TI=[...gF].reverse(),EI=gF.length;function DI(e){return t=>Promise.all(t.map(({animation:t,options:n})=>tP(e,t,n)))}function OI(e){let t=DI(e),n=jI(),r=!0,i=!1,a=t=>(n,r)=>{let i=PN(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=CI(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<EI;t++){let p=TI[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=hF(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||mF(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=kI(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=VN(t)&&VN(n)?!wI(t,n):t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=PN(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=vN(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=PN(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=jI(),i=!0}}}function kI(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!wI(t,e):!1}function AI(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function jI(){return{animate:AI(!0),whileInView:AI(),whileHover:AI(),whileTap:AI(),whileDrag:AI(),whileFocus:AI(),exit:AI()}}function MI(e,t){e.min=t.min,e.max=t.max}function NI(e,t){MI(e.x,t.x),MI(e.y,t.y)}function PI(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var FI=1e-4,II=1-FI,LI=1+FI,RI=.01,zI=0-RI,BI=0+RI;function VI(e){return e.max-e.min}function HI(e,t,n){return Math.abs(e-t)<=n}function UI(e,t,n,r=.5){e.origin=r,e.originPoint=bj(t.min,t.max,e.origin),e.scale=VI(n)/VI(t),e.translate=bj(n.min,n.max,e.origin)-e.originPoint,(e.scale>=II&&e.scale<=LI||isNaN(e.scale))&&(e.scale=1),(e.translate>=zI&&e.translate<=BI||isNaN(e.translate))&&(e.translate=0)}function WI(e,t,n,r){UI(e.x,t.x,n.x,r?r.originX:void 0),UI(e.y,t.y,n.y,r?r.originY:void 0)}function GI(e,t,n,r=0){e.min=(r?bj(n.min,n.max,r):n.min)+t.min,e.max=e.min+VI(t)}function KI(e,t,n,r){GI(e.x,t.x,n.x,r?.x),GI(e.y,t.y,n.y,r?.y)}function qI(e,t,n,r=0){let i=r?bj(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+VI(t)}function JI(e,t,n,r){qI(e.x,t.x,n.x,r?.x),qI(e.y,t.y,n.y,r?.y)}function YI(e,t,n,r,i){return e-=t,e=BF(e,1/n,r),i!==void 0&&(e=BF(e,1/i,r)),e}function XI(e,t=0,n=1,r=.5,i,a=e,o=e){if(YA.test(t)&&(t=parseFloat(t),t=bj(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=bj(a.min,a.max,r);e===a&&(s-=t),e.min=YI(e.min,t,n,s,i),e.max=YI(e.max,t,n,s,i)}function ZI(e,t,[n,r,i],a,o){XI(e,t[n],t[r],t[i],t.scale,a,o)}var QI=[`x`,`scaleX`,`originX`],$I=[`y`,`scaleY`,`originY`];function eL(e,t,n,r){ZI(e.x,t,QI,n?n.x:void 0,r?r.x:void 0),ZI(e.y,t,$I,n?n.y:void 0,r?r.y:void 0)}function tL(e){return e.translate===0&&e.scale===1}function nL(e){return tL(e.x)&&tL(e.y)}function rL(e,t){return e.min===t.min&&e.max===t.max}function iL(e,t){return rL(e.x,t.x)&&rL(e.y,t.y)}function aL(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function oL(e,t){return aL(e.x,t.x)&&aL(e.y,t.y)}function sL(e){return VI(e.x)/VI(e.y)}function cL(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function lL(e){return[e(`x`),e(`y`)]}function uL(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,rotateX:i,rotateY:a,skewX:o,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotateX(${i}deg) `),a&&(r+=`rotateY(${a}deg) `),o&&(r+=`skewX(${o}deg) `),s&&(r+=`skewY(${s}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var dL=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomLeftRadius`,`borderBottomRightRadius`],fL=dL.length,pL=e=>typeof e==`string`?parseFloat(e):e,mL=e=>typeof e==`number`||K.test(e);function hL(e,t,n,r,i,a){i?(e.opacity=bj(0,n.opacity??1,_L(r)),e.opacityExit=bj(t.opacity??1,0,vL(r))):a&&(e.opacity=bj(t.opacity??1,n.opacity??1,r));for(let i=0;i<fL;i++){let a=dL[i],o=gL(t,a),s=gL(n,a);o===void 0&&s===void 0||(o||=0,s||=0,o===0||s===0||mL(o)===mL(s)?(e[a]=Math.max(bj(pL(o),pL(s),r),0),(YA.test(s)||YA.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=bj(t.rotate||0,n.rotate||0,r))}function gL(e,t){return e[t]===void 0?e.borderRadius:e[t]}var _L=yL(0,.5,iA),vL=yL(.5,.95,Rk);function yL(e,t,n){return r=>r<e?0:r>t?1:n(Vk(e,t,r))}function bL(e,t,n){let r=GN(e)?e:BN(e);return r.start(jN(``,r,t,n)),r.animation}function xL(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}var SL=(e,t)=>e.depth-t.depth,CL=class{constructor(){this.children=[],this.isDirty=!1}add(e){Ak(this.children,e),this.isDirty=!0}remove(e){jk(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(SL),this.isDirty=!1,this.children.forEach(e)}};function wL(e,t){let n=TA.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(bA(r),e(a-t))};return yA.setup(r,!0),()=>bA(r)}function TL(e){return GN(e)?e.get():e}var EL=class{constructor(){this.members=[]}add(e){Ak(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(jk(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(jk(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},DL={hasAnimatedSinceResize:!0,hasEverUpdated:!1},OL={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},kL=[``,`X`,`Y`,`Z`],AL=1e3,jL=0;function ML(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function NL(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=XN(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,yA,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&NL(r)}function PL({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=jL++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,hA.value&&(OL.nodes=OL.calculatedTargetDeltas=OL.calculatedProjections=0),this.nodes.forEach(LL),this.nodes.forEach(KL),this.nodes.forEach(qL),this.nodes.forEach(RL),hA.addProjectionMetrics&&hA.addProjectionMetrics(OL)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new CL)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Hk),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=GP(t)&&!oF(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;yA.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=wL(i,250),DL.hasAnimatedSinceResize&&(DL.hasAnimatedSinceResize=!1,this.nodes.forEach(GL)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||eR,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!oL(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...ON(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l)}else t||GL(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),bA(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(JL),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&NL(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(VL),this.nodes.forEach(BL);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(HL);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(UL),this.nodes.forEach(WL),this.nodes.forEach(FL),this.nodes.forEach(IL)):this.nodes.forEach(HL),this.clearAllSnapshots();let e=TA.now();xA.delta=Mk(0,1e3/60,e-xA.timestamp),xA.timestamp=e,xA.isProcessing=!0,SA.update.process(xA),SA.preRender.process(xA),SA.render.process(xA),xA.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,wP.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zL),this.sharedNodes.forEach(YL)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yA.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yA.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!VI(this.snapshot.measuredBox.x)&&!VI(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=fF(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!nL(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||LF(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),iR(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return fF();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(oR))){let{scroll:e}=this.root;e&&(qF(t.x,e.offset.x),qF(t.y,e.offset.y))}return t}removeElementScroll(e){let t=fF();if(NI(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&NI(t,e),qF(t.x,i.offset.x),qF(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||fF();NI(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(qF(r.x,-n.scroll.offset.x),qF(r.y,-n.scroll.offset.y)),LF(n.latestValues)&&XF(r,n.latestValues,n.layout?.layoutBox)}return LF(this.latestValues)&&XF(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=fF();NI(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!LF(n.latestValues))continue;let r;n.instance&&(IF(n.latestValues)&&n.updateSnapshot(),r=fF(),NI(r,n.measurePageBox())),eL(t,n.latestValues,n.snapshot?.layoutBox,r)}return LF(this.latestValues)&&eL(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0?!0:e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==xA.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=xA.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=fF(),this.targetWithTransforms=fF()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),KI(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):NI(this.target,this.layout.layoutBox),UF(this.target,this.targetDelta)):NI(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),hA.value&&OL.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||IF(this.parent.latestValues)||RF(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fF(),this.relativeTargetOrigin=fF(),JI(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),NI(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===xA.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;NI(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;KF(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=fF());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(PI(this.prevProjectionDelta.x,this.projectionDelta.x),PI(this.prevProjectionDelta.y,this.projectionDelta.y)),WI(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!cL(this.projectionDelta.x,this.prevProjectionDelta.x)||!cL(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),hA.value&&OL.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=uF(),this.projectionDelta=uF(),this.projectionDeltaWithTransform=uF()}setAnimationOrigin(e,t=!1){let n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},a=uF();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let o=fF(),s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),c=this.getStack(),l=!c||c.members.length<=1,u=!!(s&&!l&&this.options.crossfade===!0&&!this.path.some($L));this.animationProgress=0;let d;this.mixTargetDelta=t=>{let n=t/1e3;XL(a.x,e.x,n),XL(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(JI(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),QL(this.relativeTarget,this.relativeTargetOrigin,o,n),d&&iL(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||=fF(),NI(d,this.relativeTarget)),s&&(this.animationValues=i,hL(i,r,this.latestValues,n,u,l)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(bA(this.pendingAnimation),void 0),this.pendingAnimation=yA.update(()=>{DL.hasAnimatedSinceResize=!0,EA.layout++,this.motionValue||=BN(0),this.motionValue.jump(0,!1),this.currentAnimation=bL(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onStop:()=>{EA.layout--},onComplete:()=>{EA.layout--,e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(AL),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&aR(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||fF();let t=VI(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=VI(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}NI(t,n),XF(t,i),WI(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new EL),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return e?e.lead===this:!0}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&ML(`z`,e,r,this.animationValues);for(let t=0;t<kL.length;t++)ML(`rotate${kL[t]}`,e,r,this.animationValues),ML(`skew${kL[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=TL(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=TL(t?.pointerEvents)||``),this.hasProjected&&!LF(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=uL(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,r.animationValues?e.opacity=r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in sI){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=sI[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?TL(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(BL),this.root.sharedNodes.clear()}}}function FL(e){e.updateLayout()}function IL(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)lL(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=VI(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;MI(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else aR(i,t.layoutBox,n)&&lL(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=VI(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=uF();WI(o,n,t.layoutBox);let s=uF();a?WI(s,e.applyTransform(r,!0),t.measuredBox):WI(s,n,t.layoutBox);let c=!nL(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=fF();JI(s,t.layoutBox,i.layoutBox,o);let c=fF();JI(c,n,a.layoutBox,o),oL(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function LL(e){hA.value&&OL.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function RL(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zL(e){e.clearSnapshot()}function BL(e){e.clearMeasurements()}function VL(e){e.isLayoutDirty=!0,e.updateLayout()}function HL(e){e.isLayoutDirty=!1}function UL(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function WL(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function GL(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function KL(e){e.resolveTargetDelta()}function qL(e){e.calcProjection()}function JL(e){e.resetSkewAndRotation()}function YL(e){e.removeLeadSnapshot()}function XL(e,t,n){e.translate=bj(t.translate,0,n),e.scale=bj(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function ZL(e,t,n,r){e.min=bj(t.min,n.min,r),e.max=bj(t.max,n.max,r)}function QL(e,t,n,r){ZL(e.x,t.x,n.x,r),ZL(e.y,t.y,n.y,r)}function $L(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var eR={duration:.45,ease:[.4,0,.1,1]},tR=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nR=tR(`applewebkit/`)&&!tR(`chrome/`)?Math.round:Rk;function rR(e){e.min=nR(e.min),e.max=nR(e.max)}function iR(e){rR(e.x),rR(e.y)}function aR(e,t,n){return e===`position`||e===`preserve-aspect`&&!HI(sL(t),sL(n),.2)}function oR(e){return e!==e.root&&e.scroll?.wasRoot}var sR=PL({attachResizeListener:(e,t)=>xL(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),cR={current:void 0},lR=PL({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!cR.current){let e=new sR({});e.mount(window),e.setOptions({layoutScroll:!0}),cR.current=e}return cR.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),uR=(0,z.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function dR(e=!0){let t=(0,z.useContext)(kk);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,z.useId)();(0,z.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,z.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var fR=(0,z.createContext)({strict:!1}),pR={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},mR=!1;function hR(){if(mR)return;let e={};for(let t in pR)e[t]={isEnabled:e=>pR[t].some(t=>!!e[t])};DF(e),mR=!0}function gR(){return hR(),OF()}function _R(e){let t=gR();for(let n in e)t[n]={...t[n],...e[n]};DF(t)}var vR=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function yR(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||vR.has(e)}var bR=r({default:()=>xR}),xR,SR=t((()=>{throw xR={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),CR=e=>!yR(e);function wR(e){typeof e==`function`&&(CR=t=>t.startsWith(`on`)?!yR(t):e(t))}try{wR((SR(),e(bR)).default)}catch{}function TR(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||GN(e[i])||(CR(i)||n===!0&&yR(i)||!t&&!yR(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var ER=(0,z.createContext)({});function DR(e,t){if(vF(e)){let{initial:t,animate:n}=e;return{initial:t===!1||hF(t)?t:void 0,animate:hF(n)?n:void 0}}return e.inherit===!1?{}:t}function OR(e){let{initial:t,animate:n}=DR(e,(0,z.useContext)(ER));return(0,z.useMemo)(()=>({initial:t,animate:n}),[kR(t),kR(n)])}function kR(e){return Array.isArray(e)?e.join(` `):e}var AR=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jR(e,t,n){for(let r in t)!GN(t[r])&&!cI(r,n)&&(e[r]=t[r])}function MR({transformTemplate:e},t){return(0,z.useMemo)(()=>{let n=AR();return nI(n,t,e),Object.assign({},n.vars,n.style)},[t])}function NR(e,t){let n=e.style||{},r={};return jR(r,n,e),Object.assign(r,MR(e,t)),r}function PR(e,t){let n={},r=NR(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var FR=()=>({...AR(),attrs:{}});function IR(e,t,n,r){let i=(0,z.useMemo)(()=>{let n=FR();return gI(n,t,vI(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};jR(t,e.style,e),i.style={...t,...i.style}}return i}var LR=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function RR(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(LR.indexOf(e)>-1||/[A-Z]/u.test(e))}function zR(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??RR(e)?IR:PR)(t,r,i,e),c=TR(t,typeof e==`string`,a),l=e===z.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,z.useMemo)(()=>GN(u)?u.get():u,[u]);return(0,z.createElement)(e,{...l,children:d})}function BR({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:VR(n,r,i,e),renderState:t()}}function VR(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=TL(a[e]);let{initial:o,animate:s}=e,c=vF(e),l=yF(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!mF(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=NN(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var HR=e=>(t,n)=>{let r=(0,z.useContext)(ER),i=(0,z.useContext)(kk),a=()=>BR(e,t,r,i);return n?a():Dk(a)},UR=HR({scrapeMotionValuesFromProps:lI,createRenderState:AR}),WR=HR({scrapeMotionValuesFromProps:bI,createRenderState:FR}),GR=Symbol.for(`motionComponentSymbol`);function KR(e,t,n){let r=(0,z.useRef)(n);(0,z.useInsertionEffect)(()=>{r.current=n});let i=(0,z.useRef)(null);return(0,z.useCallback)(n=>{n&&e.onMount?.(n);let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n);t&&(n?t.mount(n):t.unmount())},[t])}var qR=(0,z.createContext)({});function JR(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function YR(e,t,n,r,i,a){let{visualElement:o}=(0,z.useContext)(ER),s=(0,z.useContext)(fR),c=(0,z.useContext)(kk),l=(0,z.useContext)(uR),u=l.reducedMotion,d=l.skipAnimations,f=(0,z.useRef)(null),p=(0,z.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,z.useContext)(qR);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&XR(f.current,n,i,h);let g=(0,z.useRef)(!1);(0,z.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[YN],v=(0,z.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Ok(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,z.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function XR(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:ZR(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&JR(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function ZR(e){if(e)return e.options.allowProjection===!1?ZR(e.parent):e.projection}function QR(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&_R(r);let a=n?n===`svg`:RR(e),o=a?WR:UR;function s(n,s){let c,l={...(0,z.useContext)(uR),...n,layoutId:$R(n)},{isStatic:u}=l,d=OR(n),f=o(n,u);if(!u&&typeof window<`u`){ez(l,r);let t=tz(l);c=t.MeasureLayout,d.visualElement=YR(e,f,l,i,t.ProjectionNode,a)}return(0,U.jsxs)(ER.Provider,{value:d,children:[c&&d.visualElement?(0,U.jsx)(c,{visualElement:d.visualElement,...l}):null,zR(e,n,KR(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,z.forwardRef)(s);return c[GR]=e,c}function $R({layoutId:e}){let t=(0,z.useContext)(Ek).id;return t&&e!==void 0?t+`-`+e:e}function ez(e,t){(0,z.useContext)(fR).strict}function tz(e){let{drag:t,layout:n}=gR();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function nz(e,t){if(typeof Proxy>`u`)return QR;let n=new Map,r=(n,r)=>QR(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,QR(a,void 0,e,t)),n.get(a))})}var rz=(e,t)=>t.isSVG??RR(e)?new xI(t):new dI(t,{allowProjection:e!==z.Fragment}),iz=class extends jF{constructor(e){super(e),e.animationState||=OI(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();mF(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},az=0,oz={animation:{Feature:iz},exit:{Feature:class extends jF{constructor(){super(...arguments),this.id=az++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`){let n=PN(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function sz(e){return{point:{x:e.pageX,y:e.pageY}}}var cz=e=>t=>NP(t)&&e(t,sz(t));function lz(e,t,n,r){return xL(e,t,cz(n),r)}var uz=({current:e})=>e?e.ownerDocument.defaultView:null,dz=(e,t)=>Math.abs(e-t);function fz(e,t){let n=dz(e.x,t.x),r=dz(e.y,t.y);return Math.sqrt(n**2+r**2)}var pz=new Set([`auto`,`scroll`]),mz=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=hz(this.lastRawMoveEventInfo,this.transformPagePoint));let e=_z(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=fz(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=xA;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=hz(t,this.transformPagePoint),yA.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=_z(e.type===`pointercancel`?this.lastMoveEventInfo:hz(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!NP(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=hz(sz(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=xA;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,_z(s,this.history)),this.removeListeners=Bk(lz(this.contextWindow,`pointermove`,this.handlePointerMove),lz(this.contextWindow,`pointerup`,this.handlePointerUp),lz(this.contextWindow,`pointercancel`,this.handlePointerUp)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(pz.has(e.overflowX)||pz.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),yA.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),bA(this.updatePoint)}};function hz(e,t){return t?{point:t(e.point)}:e}function gz(e,t){return{x:e.x-t.x,y:e.y-t.y}}function _z({point:e},t){return{point:e,delta:gz(e,yz(t)),offset:gz(e,vz(t)),velocity:bz(t,.1)}}function vz(e){return e[0]}function yz(e){return e[e.length-1]}function bz(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=yz(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Uk(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Uk(t)*2&&(r=e[1]);let a=Wk(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function xz(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?bj(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?bj(n,e,r.max):Math.min(e,n)),e}function Sz(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Cz(e,{top:t,left:n,bottom:r,right:i}){return{x:Sz(e.x,n,i),y:Sz(e.y,t,r)}}function wz(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Tz(e,t){return{x:wz(e.x,t.x),y:wz(e.y,t.y)}}function Ez(e,t){let n=.5,r=VI(e),i=VI(t);return i>r?n=Vk(t.min,t.max-r,e.min):r>i&&(n=Vk(e.min,e.max-i,t.min)),Mk(0,1,n)}function Dz(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var Oz=.35;function kz(e=Oz){return e===!1?e=0:e===!0&&(e=Oz),{x:Az(e,`left`,`right`),y:Az(e,`top`,`bottom`)}}function Az(e,t,n){return{min:jz(e,t),max:jz(e,n)}}function jz(e,t){return typeof e==`number`?e:e[t]||0}var Mz=new WeakMap,Nz=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=fF(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(sz(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=OP(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),lL(e=>{let t=this.getAxisMotionValue(e).get()||0;if(YA.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=VI(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&yA.update(()=>i(e,t),!1,!0),qN(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=Lz(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&yA.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new mz(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:uz(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&yA.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!Iz(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=xz(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&JR(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=Cz(n.layoutBox,e):this.constraints=!1,this.elastic=kz(t),r!==this.constraints&&!JR(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&lL(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Dz(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!JR(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;let i=QF(n,r.root,this.visualElement.getTransformPagePoint()),a=Tz(r.layout.layoutBox,i);if(t){let e=t(NF(a));this.hasMutatedConstraints=!!e,e&&(a=MF(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=lL(o=>{if(!Iz(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return qN(this.visualElement,e),n.start(jN(e,n,0,t,this.visualElement,!1))}stopAnimation(){lL(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){lL(t=>{let{drag:n}=this.getProps();if(!Iz(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-bj(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!JR(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};lL(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Ez({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),lL(t=>{if(!Iz(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(bj(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Mz.set(this.visualElement,this);let e=this.visualElement.current,t=lz(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&LP(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();JR(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=Fz(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),yA.read(r);let o=xL(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(lL(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Oz,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function Pz(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Fz(e,t,n){let r=aF(e,Pz(n)),i=aF(t,Pz(n));return()=>{r(),i()}}function Iz(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Lz(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var Rz=class extends jF{constructor(e){super(e),this.removeGroupControls=Rk,this.removeListeners=Rk,this.controls=new Nz(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Rk}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},zz=e=>(t,n)=>{e&&yA.update(()=>e(t,n),!1,!0)},Bz=class extends jF{constructor(){super(...arguments),this.removePointerDownListener=Rk}onPointerDown(e){this.session=new mz(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:uz(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:zz(e),onStart:zz(t),onMove:zz(n),onEnd:(e,t)=>{delete this.session,r&&yA.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=lz(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},Vz=!1,Hz=class extends z.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),Vz&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),DL.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),Vz=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||yA.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),wP.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;Vz=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function Uz(e){let[t,n]=dR(),r=(0,z.useContext)(Ek);return(0,U.jsx)(Hz,{...e,layoutGroup:r,switchLayoutGroup:(0,z.useContext)(qR),isPresent:t,safeToRemove:n})}var Wz={pan:{Feature:Bz},drag:{Feature:Rz,ProjectionNode:lR,MeasureLayout:Uz}};function Gz(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&yA.postRender(()=>i(t,sz(t)))}var Kz=class extends jF{mount(){let{current:e}=this.node;e&&(this.unmount=jP(e,(e,t)=>(Gz(this.node,t,`Start`),e=>Gz(this.node,e,`End`))))}unmount(){}},qz=class extends jF{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Bk(xL(this.node.current,`focus`,()=>this.onFocus()),xL(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Jz(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&yA.postRender(()=>i(t,sz(t)))}var Yz=class extends jF{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=WP(e,(e,t)=>(Jz(this.node,t,`Start`),(e,{success:t})=>Jz(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},Xz=new WeakMap,Zz=new WeakMap,Qz=e=>{let t=Xz.get(e.target);t&&t(e)},$z=e=>{e.forEach(Qz)};function eB({root:e,...t}){let n=e||document;Zz.has(n)||Zz.set(n,{});let r=Zz.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver($z,{root:e,...t})),r[i]}function tB(e,t,n){let r=eB(t);return Xz.set(e,n),r.observe(e),()=>{Xz.delete(e),r.unobserve(e)}}var nB={some:0,all:1},rB=class extends jF{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:nB[r]};this.stopObserver=tB(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(iB(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function iB({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var aB={inView:{Feature:rB},tap:{Feature:Yz},focus:{Feature:qz},hover:{Feature:Kz}},oB={layout:{ProjectionNode:lR,MeasureLayout:Uz}},sB=nz({...oz,...aB,...Wz,...oB},rz),cB=new Map,lB=e=>{let t=cB.get(e);return t||(t=sB.create(e),cB.set(e,t)),t},uB=(0,z.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=lB(t),o=(0,z.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,U.jsx)(a,{animate:{backgroundPosition:`0% center`},className:H(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{duration:r,ease:`linear`,repeat:1/0},children:e})}),dB=(0,z.createContext)(null),fB=()=>{let e=(0,z.useContext)(dB);if(!e)throw Error(`Reasoning components must be used within Reasoning`);return e},pB=1e3,mB=1e3,hB=(0,z.memo)(({className:e,isStreaming:t=!1,open:n,defaultOpen:r,onOpenChange:i,duration:a,children:o,...s})=>{let c=r??t,l=r===!1,[u,d]=pE({defaultProp:c,onChange:i,prop:n}),[f,p]=pE({defaultProp:void 0,prop:a}),m=(0,z.useRef)(t),[h,g]=(0,z.useState)(!1),_=(0,z.useRef)(null);(0,z.useEffect)(()=>{t?(m.current=!0,_.current===null&&(_.current=Date.now())):_.current!==null&&(p(Math.ceil((Date.now()-_.current)/mB)),_.current=null)},[t,p]),(0,z.useEffect)(()=>{t&&!u&&!l&&d(!0)},[t,u,d,l]),(0,z.useEffect)(()=>{if(m.current&&!t&&u&&!h){let e=setTimeout(()=>{d(!1),g(!0)},pB);return()=>clearTimeout(e)}},[t,u,d,h]);let v=(0,z.useCallback)(e=>{d(e)},[d]),y=(0,z.useMemo)(()=>({duration:f,isOpen:u,isStreaming:t,setIsOpen:d}),[f,u,t,d]);return(0,U.jsx)(dB.Provider,{value:y,children:(0,U.jsx)(Ck,{className:H(`not-prose mb-4`,e),onOpenChange:v,open:u,...s,children:o})})}),gB=(e,t)=>e||t===0?(0,U.jsx)(uB,{duration:1,children:`Thinking...`}):t===void 0?(0,U.jsx)(`p`,{children:`Thought for a few seconds`}):(0,U.jsxs)(`p`,{children:[`Thought for `,t,` seconds`]}),_B=(0,z.memo)(({className:e,children:t,getThinkingMessage:n=gB,...r})=>{let{isStreaming:i,isOpen:a,duration:o}=fB();return(0,U.jsx)(wk,{className:H(`flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground`,e),...r,children:t??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Wl,{className:`size-4`}),n(i,o),(0,U.jsx)(Gl,{className:H(`size-4 transition-transform`,a?`rotate-180`:`rotate-0`)})]})})}),vB={cjk:Bf,code:Bx,math:BS,mermaid:$T},yB=(0,z.memo)(({className:e,children:t,...n})=>(0,U.jsx)(Tk,{className:H(`mt-4 text-sm`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...n,children:(0,U.jsx)(D,{plugins:vB,children:t})}));hB.displayName=`Reasoning`,_B.displayName=`ReasoningTrigger`,yB.displayName=`ReasoningContent`;var bB=({className:e,...t})=>(0,U.jsx)(Ck,{className:H(`not-prose mb-4 text-primary text-xs`,e),...t}),xB=({className:e,count:t,children:n,...r})=>(0,U.jsx)(wk,{className:H(`flex items-center gap-2`,e),...r,children:n??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`font-medium`,children:[`Used `,t,` sources`]}),(0,U.jsx)(Gl,{className:`h-4 w-4`})]})}),SB=({className:e,...t})=>(0,U.jsx)(Tk,{className:H(`mt-3 flex w-fit flex-col gap-2`,`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),CB=({href:e,title:t,children:n,...r})=>(0,U.jsx)(`a`,{className:`flex items-center gap-2`,href:e,rel:`noreferrer`,target:`_blank`,...r,children:n??(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ul,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{className:`block font-medium`,children:t})]})}),wB=()=>typeof window>`u`?`none`:`SpeechRecognition`in window||`webkitSpeechRecognition`in window?`speech-recognition`:`MediaRecorder`in window&&`mediaDevices`in navigator?`media-recorder`:`none`,TB=({className:e,onTranscriptionChange:t,onAudioRecorded:n,lang:r=`en-US`,...i})=>{let[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(!1),[l]=(0,z.useState)(wB),[u,d]=(0,z.useState)(!1),f=(0,z.useRef)(null),p=(0,z.useRef)(null),m=(0,z.useRef)(null),h=(0,z.useRef)([]),g=(0,z.useRef)(t),_=(0,z.useRef)(n);g.current=t,_.current=n,(0,z.useEffect)(()=>{if(l!==`speech-recognition`)return;let e=new(window.SpeechRecognition||window.webkitSpeechRecognition);e.continuous=!0,e.interimResults=!0,e.lang=r;let t=()=>{o(!0)},n=()=>{o(!1)},i=e=>{let t=e,n=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let r=t.results[e];r.isFinal&&(n+=r[0]?.transcript??``)}n&&g.current?.(n)},a=()=>{o(!1)};return e.addEventListener(`start`,t),e.addEventListener(`end`,n),e.addEventListener(`result`,i),e.addEventListener(`error`,a),f.current=e,d(!0),()=>{e.removeEventListener(`start`,t),e.removeEventListener(`end`,n),e.removeEventListener(`result`,i),e.removeEventListener(`error`,a),e.stop(),f.current=null,d(!1)}},[l,r]),(0,z.useEffect)(()=>()=>{if(p.current?.state===`recording`&&p.current.stop(),m.current)for(let e of m.current.getTracks())e.stop()},[]);let v=(0,z.useCallback)(async()=>{if(_.current)try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});m.current=e;let t=new MediaRecorder(e);h.current=[],t.addEventListener(`dataavailable`,e=>{e.data.size>0&&h.current.push(e.data)}),t.addEventListener(`stop`,async()=>{for(let t of e.getTracks())t.stop();m.current=null;let t=new Blob(h.current,{type:`audio/webm`});if(t.size>0&&_.current){c(!0);try{let e=await _.current(t);e&&g.current?.(e)}catch{}finally{c(!1)}}}),t.addEventListener(`error`,()=>{o(!1);for(let t of e.getTracks())t.stop();m.current=null}),p.current=t,t.start(),o(!0)}catch{o(!1)}},[]),y=(0,z.useCallback)(()=>{p.current?.state===`recording`&&p.current.stop(),o(!1)},[]),b=(0,z.useCallback)(()=>{l===`speech-recognition`&&f.current?a?f.current.stop():f.current.start():l===`media-recorder`&&(a?y():v())},[l,a,v,y]),x=l===`none`||l===`speech-recognition`&&!u||l===`media-recorder`&&!n||s;return(0,U.jsxs)(`div`,{className:`relative inline-flex items-center justify-center`,children:[a&&[0,1,2].map(e=>(0,U.jsx)(`div`,{className:`absolute inset-0 animate-ping rounded-full border-2 border-red-400/30`,style:{animationDelay:`${e*.3}s`,animationDuration:`2s`}},e)),(0,U.jsxs)($n,{className:H(`relative z-10 rounded-full transition-all duration-300`,a?`bg-destructive text-white hover:bg-destructive/80 hover:text-white`:`bg-primary text-primary-foreground hover:bg-primary/80 hover:text-primary-foreground`,e),disabled:x,onClick:b,...i,children:[s&&(0,U.jsx)(RO,{}),!s&&a&&(0,U.jsx)(mu,{className:`size-4`}),!(s||a)&&(0,U.jsx)(su,{className:`size-4`})]})]})},EB=Zn(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function DB({className:e,variant:t=`default`,render:n,...r}){return Ju({defaultTagName:`span`,props:$t({className:H(EB({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}var OB=Object.defineProperty,kB=Object.getOwnPropertyDescriptor,AB=Object.getOwnPropertyNames,jB=Object.prototype.hasOwnProperty,MB=(e,t)=>{let n={};for(var r in e)OB(n,r,{get:e[r],enumerable:!0});return t||OB(n,Symbol.toStringTag,{value:`Module`}),n},NB=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=AB(t),a=0,o=i.length,s;a<o;a++)s=i[a],!jB.call(e,s)&&s!==n&&OB(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=kB(t,s))||r.enumerable});return e},PB=(e,t,n)=>(NB(e,t,`default`),n&&NB(n,t,`default`)),FB=[{id:`abap`,name:`ABAP`,import:(()=>N(()=>import(`./abap-wT6fgqwv.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>N(()=>import(`./actionscript-3-CqcHpPYj.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>N(()=>import(`./ada-DWE3Hn4E.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>N(()=>import(`./angular-html-BNkY0l6I.js`).then(e=>e.n),__vite__mapDeps([182,1,183,184,185])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>N(()=>import(`./angular-ts-BJR7ZmZ4.js`),__vite__mapDeps([186,182,1,183,184,185,187])))},{id:`apache`,name:`Apache Conf`,import:(()=>N(()=>import(`./apache-LRTUP4r3.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>N(()=>import(`./apex-Cr4FccGl.js`),[]))},{id:`apl`,name:`APL`,import:(()=>N(()=>import(`./apl-Cwj0kSUr.js`),__vite__mapDeps([188,184,1,183,185,189,190,191])))},{id:`applescript`,name:`AppleScript`,import:(()=>N(()=>import(`./applescript-DyQiO9JU.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>N(()=>import(`./ara-Cf-OWd2S.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>N(()=>import(`./asciidoc-gocbKcVK.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>N(()=>import(`./asm-C3meb5HY.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>N(()=>import(`./astro--s34HbNO.js`),__vite__mapDeps([192,184,1,185,189,193,194,195])))},{id:`awk`,name:`AWK`,import:(()=>N(()=>import(`./awk-BcT6nIdN.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>N(()=>import(`./ballerina-BCARR-zK.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>N(()=>import(`./bat-_yaRjWOb.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>N(()=>import(`./beancount-BPESBMS9.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>N(()=>import(`./berry-BSLE-Sf8.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>N(()=>import(`./bibtex-CvUWWCVx.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>N(()=>import(`./bicep--vcqqALZ.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>N(()=>import(`./bird2-Clclqgh6.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>N(()=>import(`./blade-CA0lh7nk.js`),__vite__mapDeps([196,184,1,197,183,185,189,198,190,191])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>N(()=>import(`./bsl-Bq5qFzpU.js`),__vite__mapDeps([199,200])))},{id:`c`,name:`C`,import:(()=>N(()=>import(`./c-BwwtBtD9.js`).then(e=>e.n),__vite__mapDeps([201,1])))},{id:`c3`,name:`C3`,import:(()=>N(()=>import(`./c3-BYD8LEiv.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>N(()=>import(`./cadence-BwAD7vSC.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>N(()=>import(`./cairo-Cn9-ZKRa.js`),__vite__mapDeps([202,203])))},{id:`clarity`,name:`Clarity`,import:(()=>N(()=>import(`./clarity-BeQd5TQD.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>N(()=>import(`./clojure-Csdo0vb_.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>N(()=>import(`./cmake-Cf0q7ddg.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>N(()=>import(`./cobol-DC9HzFj-.js`),__vite__mapDeps([204,183,1,184,185,191])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>N(()=>import(`./codeowners-CUEzlC7R.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>N(()=>import(`./codeql-DxHyogQt.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>N(()=>import(`./coffee-BXAFJg0r.js`),__vite__mapDeps([205,185,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>N(()=>import(`./common-lisp-WLb-tAda.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>N(()=>import(`./coq-DFtMD6Wn.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>N(()=>import(`./cpp-DKSsqshA.js`).then(e=>e.n),__vite__mapDeps([206,1,207,201,208,198])))},{id:`crystal`,name:`Crystal`,import:(()=>N(()=>import(`./crystal-IeOtgHp5.js`),__vite__mapDeps([209,201,1,184,183,185,210,198])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>N(()=>import(`./csharp-BsEjf_Dq.js`),[]))},{id:`css`,name:`CSS`,import:(()=>N(()=>import(`./css-BwJx5n-d.js`).then(e=>e.n),__vite__mapDeps([184,1])))},{id:`csv`,name:`CSV`,import:(()=>N(()=>import(`./csv-DTSgNSaP.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>N(()=>import(`./cue-BEmVIZmd.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>N(()=>import(`./cypher-CncQVhvU.js`),[]))},{id:`d`,name:`D`,import:(()=>N(()=>import(`./d-BzUSBVex.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>N(()=>import(`./dart-BBu3nkcE.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>N(()=>import(`./dax-DcLVz9_9.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>N(()=>import(`./desktop-DS2PdvoU.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>N(()=>import(`./diff-aUYk5Qys.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>N(()=>import(`./docker-12Lj1QUD.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>N(()=>import(`./dotenv-D-P4bzvl.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>N(()=>import(`./dream-maker-C_j5A0r7.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>N(()=>import(`./edge-DvUIs6yL.js`),__vite__mapDeps([211,197,183,1,184,185,195])))},{id:`elixir`,name:`Elixir`,import:(()=>N(()=>import(`./elixir-uf320cNm.js`),__vite__mapDeps([212,183,1,184,185])))},{id:`elm`,name:`Elm`,import:(()=>N(()=>import(`./elm-C0jRU6CE.js`),__vite__mapDeps([213,207,1,201])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>N(()=>import(`./emacs-lisp-W54LT7rh.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>N(()=>import(`./erb-IQLcm3Em.js`),__vite__mapDeps([214,183,1,184,185,215,201,206,207,208,198,216,217,194,195,218,219,210,190,191,220])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>N(()=>import(`./erlang-CzlD_Joo.js`),__vite__mapDeps([221,222])))},{id:`fennel`,name:`Fennel`,import:(()=>N(()=>import(`./fennel-DK82-oso.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>N(()=>import(`./fish-CbJVJzQj.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>N(()=>import(`./fluent-Cug5cOL1.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>N(()=>import(`./fortran-fixed-form-CT90EtSp.js`),__vite__mapDeps([223,224])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>N(()=>import(`./fortran-free-form-amHz32Zw.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>N(()=>import(`./fsharp-LasxezlU.js`),__vite__mapDeps([225,222])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>N(()=>import(`./gdresource-XqgPdfiE.js`),__vite__mapDeps([226,227,228])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>N(()=>import(`./gdscript-t_G6VYpv.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>N(()=>import(`./gdshader-DqZaHh4E.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>N(()=>import(`./genie-CIJtFlZK.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>N(()=>import(`./gherkin-CalidqLY.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>N(()=>import(`./git-commit-CZBgPolw.js`),__vite__mapDeps([229,230])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>N(()=>import(`./git-rebase-SvuYB-yx.js`),__vite__mapDeps([231,210,1])))},{id:`gleam`,name:`Gleam`,import:(()=>N(()=>import(`./gleam-D-2cpXVX.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>N(()=>import(`./glimmer-js-BRM4xWAn.js`),__vite__mapDeps([232,184,1,183,185,195])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>N(()=>import(`./glimmer-ts-q2S6_FNL.js`),__vite__mapDeps([233,184,1,183,185,195])))},{id:`glsl`,name:`GLSL`,import:(()=>N(()=>import(`./glsl-DBjPQFVZ.js`).then(e=>e.n),__vite__mapDeps([207,1,201])))},{id:`gn`,name:`GN`,import:(()=>N(()=>import(`./gn-C1cC4xLc.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>N(()=>import(`./gnuplot-2Gp459mV.js`),[]))},{id:`go`,name:`Go`,import:(()=>N(()=>import(`./go-BA1q0q8h.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>N(()=>import(`./graphql-COm4gzYD.js`).then(e=>e.n),__vite__mapDeps([216,1,185,217,194,195])))},{id:`groovy`,name:`Groovy`,import:(()=>N(()=>import(`./groovy-BlIa-VfI.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>N(()=>import(`./hack-D776y6TN.js`),__vite__mapDeps([234,183,1,184,185,198])))},{id:`haml`,name:`Ruby Haml`,import:(()=>N(()=>import(`./haml-BDLQGKJ5.js`).then(e=>e.n),__vite__mapDeps([218,1,184,185])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>N(()=>import(`./handlebars-CIxBD-3g.js`),__vite__mapDeps([235,184,1,183,185,220])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>N(()=>import(`./haskell-Da8UeSv-.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>N(()=>import(`./haxe-mcKlcxBa.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>N(()=>import(`./hcl-BdZcx5JX.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>N(()=>import(`./hjson-pFXYbN4t.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>N(()=>import(`./hlsl-Z0II0KR8.js`),[]))},{id:`html`,name:`HTML`,import:(()=>N(()=>import(`./html-Be5Uf2PY.js`).then(e=>e.n),__vite__mapDeps([183,1,184,185])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>N(()=>import(`./html-derivative-DwTv3LQJ.js`),__vite__mapDeps([197,183,1,184,185])))},{id:`http`,name:`HTTP`,import:(()=>N(()=>import(`./http-BoUyJiuw.js`),__vite__mapDeps([236,216,1,185,217,194,195,189,210,190,191])))},{id:`hurl`,name:`Hurl`,import:(()=>N(()=>import(`./hurl-BrO1xhi5.js`),__vite__mapDeps([237,238,216,1,185,217,194,195,190,191])))},{id:`hxml`,name:`HXML`,import:(()=>N(()=>import(`./hxml-e5uS5jTD.js`),__vite__mapDeps([239,240])))},{id:`hy`,name:`Hy`,import:(()=>N(()=>import(`./hy-BVbDMDcG.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>N(()=>import(`./imba-DRM6LLS5.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>N(()=>import(`./ini-2KCnNvmz.js`),[]))},{id:`java`,name:`Java`,import:(()=>N(()=>import(`./java-CQxQB19a.js`).then(e=>e.n),__vite__mapDeps([191,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>N(()=>import(`./javascript-DMa1awvA.js`).then(e=>e.n),__vite__mapDeps([185,1])))},{id:`jinja`,name:`Jinja`,import:(()=>N(()=>import(`./jinja-Brxwu6oJ.js`),__vite__mapDeps([241,183,1,184,185])))},{id:`jison`,name:`Jison`,import:(()=>N(()=>import(`./jison-EXcEtIQd.js`),__vite__mapDeps([242,185,1])))},{id:`json`,name:`JSON`,import:(()=>N(()=>import(`./json-DTmumXbw.js`).then(e=>e.n),__vite__mapDeps([189,1])))},{id:`json5`,name:`JSON5`,import:(()=>N(()=>import(`./json5-CJeEJPTg.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>N(()=>import(`./jsonc-C1haTBsf.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>N(()=>import(`./jsonl-wQ8-AJgs.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>N(()=>import(`./jsonnet-BrEjY3Xh.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>N(()=>import(`./jssm-C6LgYbOs.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>N(()=>import(`./jsx-CjPAAfVI.js`).then(e=>e.n),__vite__mapDeps([217,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>N(()=>import(`./julia-ClaFus-7.js`),__vite__mapDeps([243,206,1,207,201,208,198,185,203,244])))},{id:`just`,name:`Just`,import:(()=>N(()=>import(`./just-i-NvfbL-.js`),__vite__mapDeps([245,185,1,246,184,183,198,190,191,203,215,201,206,207,208,216,217,194,195,218,219,210,220])))},{id:`kdl`,name:`KDL`,import:(()=>N(()=>import(`./kdl-BrLEivmb.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>N(()=>import(`./kotlin-BO2FUnDB.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>N(()=>import(`./kusto-Cev1yiq9.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>N(()=>import(`./latex-CJqFaM_A.js`),__vite__mapDeps([247,248,244,1])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>N(()=>import(`./lean-BLS3Xk2w.js`),[]))},{id:`less`,name:`Less`,import:(()=>N(()=>import(`./less-BXmcsqcq.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>N(()=>import(`./liquid-C-yRtTgD.js`),__vite__mapDeps([249,184,1,183,185,189])))},{id:`llvm`,name:`LLVM IR`,import:(()=>N(()=>import(`./llvm-C_wLnJgX.js`),[]))},{id:`log`,name:`Log file`,import:(()=>N(()=>import(`./log-Cg8pvmWi.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>N(()=>import(`./logo-C9-kEvPW.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>N(()=>import(`./lua-YdeG1vR1.js`).then(e=>e.n),__vite__mapDeps([219,1,201])))},{id:`luau`,name:`Luau`,import:(()=>N(()=>import(`./luau-CMEm2VzY.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>N(()=>import(`./make-DBpJE-Z8.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>N(()=>import(`./markdown-B7ZTAu7B.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>N(()=>import(`./marko-C28Bend9.js`),__vite__mapDeps([250,184,1,251,187,195])))},{id:`matlab`,name:`MATLAB`,import:(()=>N(()=>import(`./matlab-C7MYlMSn.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>N(()=>import(`./mdc-D4DkjJGD.js`),__vite__mapDeps([252,197,183,1,184,185,222,220])))},{id:`mdx`,name:`MDX`,import:(()=>N(()=>import(`./mdx-FkOOX3Dq.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>N(()=>import(`./mermaid-C_9qw5it.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>N(()=>import(`./mipsasm-Dmi1AZOT.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>N(()=>import(`./mojo-C6z7mry2.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>N(()=>import(`./moonbit-CEeNIoB4.js`),[]))},{id:`move`,name:`Move`,import:(()=>N(()=>import(`./move-bALfKUa7.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>N(()=>import(`./narrat-DX4JlAWT.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>N(()=>import(`./nextflow-BUrFV5aB.js`),__vite__mapDeps([253,254])))},{id:`nextflow-groovy`,name:`Nextflow Groovy`,import:(()=>N(()=>import(`./nextflow-groovy-CKQWtRkO.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>N(()=>import(`./nginx-BzrYdIS_.js`),__vite__mapDeps([255,219,1,201])))},{id:`nim`,name:`Nim`,import:(()=>N(()=>import(`./nim-BAdKQO6U.js`),__vite__mapDeps([256,201,1,184,207,183,185,222,190,191])))},{id:`nix`,name:`Nix`,import:(()=>N(()=>import(`./nix-B1jThkGj.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>N(()=>import(`./nushell-L6DbJTuL.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>N(()=>import(`./objective-c-CTZ4bR2U.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>N(()=>import(`./objective-cpp-Dm1YDIdA.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>N(()=>import(`./ocaml-B3n__LGy.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>N(()=>import(`./odin-DmqZ8n3i.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>N(()=>import(`./openscad-DTFB9Sj6.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>N(()=>import(`./pascal-RcT1dQYN.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>N(()=>import(`./perl-BMPsT4bZ.js`),__vite__mapDeps([246,184,1,183,185,198,190,191])))},{id:`php`,name:`PHP`,import:(()=>N(()=>import(`./php-0S5_LhYZ.js`),__vite__mapDeps([257,184,1,183,185,189,198,190,191])))},{id:`pkl`,name:`Pkl`,import:(()=>N(()=>import(`./pkl-Dr4yLQ_o.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>N(()=>import(`./plsql-pFcO4WZ0.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>N(()=>import(`./po-BkZ0_HvY.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>N(()=>import(`./polar-DHK3q8FF.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>N(()=>import(`./postcss-Bv7WzijA.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>N(()=>import(`./powerquery-DpaU_hW9.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>N(()=>import(`./powershell-_Rqc0MGP.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>N(()=>import(`./prisma-wyegE8us.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>N(()=>import(`./prolog-DspHCURv.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>N(()=>import(`./proto-BOBiNGf5.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>N(()=>import(`./pug-DCZyheX4.js`),__vite__mapDeps([258,184,1,183,185])))},{id:`puppet`,name:`Puppet`,import:(()=>N(()=>import(`./puppet-DfLvV8h2.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>N(()=>import(`./purescript-BY5ZSOZy.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>N(()=>import(`./python-B758mMeg.js`),[]))},{id:`qml`,name:`QML`,import:(()=>N(()=>import(`./qml-DLa2zzL2.js`),__vite__mapDeps([259,185,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>N(()=>import(`./qmldir-C75bpHvy.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>N(()=>import(`./qss-DcLTlbLd.js`),[]))},{id:`r`,name:`R`,import:(()=>N(()=>import(`./r-C2wIHWmU.js`).then(e=>e.n),__vite__mapDeps([244,1])))},{id:`racket`,name:`Racket`,import:(()=>N(()=>import(`./racket-DTye_5qn.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>N(()=>import(`./raku-uJXBXkV0.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>N(()=>import(`./razor-CIU_5PCa.js`),__vite__mapDeps([260,261,183,1,184,185])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>N(()=>import(`./reg-DkTIaX7a.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>N(()=>import(`./regexp-oKAhWQ7Q.js`).then(e=>e.n),__vite__mapDeps([208,1])))},{id:`rel`,name:`Rel`,import:(()=>N(()=>import(`./rel-B0jumCjt.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>N(()=>import(`./riscv-DtaWMlo0.js`),[]))},{id:`ron`,name:`RON`,import:(()=>N(()=>import(`./ron-BCPxwJD6.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>N(()=>import(`./rosmsg-CPG8X-D5.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>N(()=>import(`./rst-Cof_t7QZ.js`),__vite__mapDeps([262,263,206,1,207,201,208,198,197,183,184,185,203,215,216,217,194,195,218,219,210,190,191,220])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>N(()=>import(`./ruby-o2UFtTKv.js`),__vite__mapDeps([215,201,1,206,207,208,198,184,216,185,217,194,195,218,183,219,210,190,191,220])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>N(()=>import(`./rust-CxfW3ePx.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>N(()=>import(`./sas-hJL2y9ck.js`),__vite__mapDeps([264,198,1])))},{id:`sass`,name:`Sass`,import:(()=>N(()=>import(`./sass-D-7bxo_L.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>N(()=>import(`./scala-DyUsfHNc.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>N(()=>import(`./scheme-ROgrwiO-.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>N(()=>import(`./scss-Cs20-D4S.js`).then(e=>e.n),__vite__mapDeps([187,1,184])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>N(()=>import(`./sdbl-B1EAQWpp.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>N(()=>import(`./shaderlab-Byjk0kH7.js`),__vite__mapDeps([265,266])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>N(()=>import(`./shellscript-FTtRH7a6.js`).then(e=>e.n),__vite__mapDeps([210,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>N(()=>import(`./shellsession-Dsazo7ie.js`),__vite__mapDeps([267,210,1])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>N(()=>import(`./smalltalk-B-1waXvA.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>N(()=>import(`./solidity-DYxwp0om.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>N(()=>import(`./soy-D05E5TYG.js`),__vite__mapDeps([268,183,1,184,185])))},{id:`sparql`,name:`SPARQL`,import:(()=>N(()=>import(`./sparql-CawLnniT.js`),__vite__mapDeps([269,270])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>N(()=>import(`./splunk-jK6-Sr06.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>N(()=>import(`./sql-2nD5KprC.js`).then(e=>e.n),__vite__mapDeps([198,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>N(()=>import(`./ssh-config-Bimb9LVr.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>N(()=>import(`./stata-gi0HO22o.js`),__vite__mapDeps([271,198,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>N(()=>import(`./stylus-B2DgJRJw.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>N(()=>import(`./surrealql-C1OjlKtP.js`),__vite__mapDeps([272,185,1])))},{id:`svelte`,name:`Svelte`,import:(()=>N(()=>import(`./svelte-lCoYOeOH.js`),__vite__mapDeps([273,184,1,185,193,195])))},{id:`swift`,name:`Swift`,import:(()=>N(()=>import(`./swift-ChEH2nFL.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>N(()=>import(`./system-verilog-DoVBMhJ8.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>N(()=>import(`./systemd--Ux4VAYD.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>N(()=>import(`./talonscript-DQNx9nak.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>N(()=>import(`./tasl-Bwy_Y9uD.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>N(()=>import(`./tcl-Drea-2jA.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>N(()=>import(`./templ-Be5BnDnr.js`),__vite__mapDeps([274,184,1,275,185])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>N(()=>import(`./terraform-4rS5HoFk.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>N(()=>import(`./tex-BBX4cNm_.js`),__vite__mapDeps([248,244,1])))},{id:`toml`,name:`TOML`,import:(()=>N(()=>import(`./toml-tSgOSv42.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>N(()=>import(`./ts-tags-BdYhOUUe.js`),__vite__mapDeps([276,184,1,207,201,183,185,198,195,190,191])))},{id:`tsv`,name:`TSV`,import:(()=>N(()=>import(`./tsv-BmL4O1Zx.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>N(()=>import(`./tsx-CfScc0-T.js`).then(e=>e.n),__vite__mapDeps([194,1])))},{id:`turtle`,name:`Turtle`,import:(()=>N(()=>import(`./turtle-2DYvssFL.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>N(()=>import(`./twig-DVDO78vU.js`),__vite__mapDeps([277,184,1,185,257,183,189,198,190,191,203,215,201,206,207,208,216,217,194,195,218,219,210,220,187])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>N(()=>import(`./typescript-x0tnfxi7.js`).then(e=>e.n),__vite__mapDeps([195,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>N(()=>import(`./typespec-DkCEO45F.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>N(()=>import(`./typst-DAZdb2n6.js`),[]))},{id:`v`,name:`V`,import:(()=>N(()=>import(`./v-B_wsb4C1.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>N(()=>import(`./vala-BDBNS784.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>N(()=>import(`./vb-CuOoJSSa.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>N(()=>import(`./verilog-BCcOvOcc.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>N(()=>import(`./vhdl-CI8PoqeM.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>N(()=>import(`./viml-B66dNP1B.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>N(()=>import(`./vue-Bm4Rs_rd.js`),__vite__mapDeps([278,184,1,197,183,185,189,195])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>N(()=>import(`./vue-html-Idq00pHJ.js`),__vite__mapDeps([279,185,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>N(()=>import(`./vue-vine-DNdsuI61.js`),__vite__mapDeps([280,184,1,185,251,193,187,281])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>N(()=>import(`./vyper-dNodzEa8.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>N(()=>import(`./wasm-d6SE2_qm.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>N(()=>import(`./wenyan-D0h8Uz55.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>N(()=>import(`./wgsl-vKs_vsvQ.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>N(()=>import(`./wikitext-BIWsPJit.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>N(()=>import(`./wit-6vmKi2H3.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>N(()=>import(`./wolfram-zoNg6F1a.js`),[]))},{id:`xml`,name:`XML`,import:(()=>N(()=>import(`./xml-C1p67_Oq.js`).then(e=>e.n),__vite__mapDeps([190,1,191])))},{id:`xsl`,name:`XSL`,import:(()=>N(()=>import(`./xsl-DcNV5e8y.js`),__vite__mapDeps([282,190,1,191])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>N(()=>import(`./yaml-Dz3CpChp.js`).then(e=>e.n),__vite__mapDeps([220,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>N(()=>import(`./zenscript-BxircxDx.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>N(()=>import(`./zig-DD79WQtz.js`),[]))}],IB=Object.fromEntries(FB.map(e=>[e.id,e.import])),LB=Object.fromEntries(FB.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),RB={...IB,...LB},zB=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>N(()=>import(`./andromeeda-DpQ-y-Jt.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>N(()=>import(`./aurora-x-BYcXaCIg.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>N(()=>import(`./ayu-dark-CLZPoccg.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>N(()=>import(`./ayu-light-CTyRQdS2.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>N(()=>import(`./ayu-mirage-DjqfqZdo.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-frappe-hr0HKoFX.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>N(()=>import(`./catppuccin-latte-DXEIYlFO.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-macchiato-B2zST7sA.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>N(()=>import(`./catppuccin-mocha-CvrdnYv9.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>N(()=>import(`./dark-plus-mysFNRq2.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>N(()=>import(`./dracula-C-eRNn4o.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>N(()=>import(`./dracula-soft-CBB1BI7O.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>N(()=>import(`./everforest-dark-B_ISUDeh.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>N(()=>import(`./everforest-light-CNUYa354.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>N(()=>import(`./github-dark-BG2xX0wa.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>N(()=>import(`./github-dark-default-tDp_EOBs.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>N(()=>import(`./github-dark-dimmed-DlSfPwW2.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>N(()=>import(`./github-dark-high-contrast-qZM7j5KB.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>N(()=>import(`./github-light-CnvWTiyb.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>N(()=>import(`./github-light-default-Dy6OAt2Q.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>N(()=>import(`./github-light-high-contrast-1BHQCOPl.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-hard-BMIwVwaJ.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-medium-DxfuBW3n.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>N(()=>import(`./gruvbox-dark-soft-_NSslDDi.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-hard-CP5MIsL9.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-medium-BTMursH0.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>N(()=>import(`./gruvbox-light-soft-Bv6zFoVX.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>N(()=>import(`./horizon-CufN8DyP.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`,import:(()=>N(()=>import(`./horizon-bright-5qoQVyIY.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>N(()=>import(`./houston-DOFkQwep.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>N(()=>import(`./kanagawa-dragon-6UCcJpLw.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>N(()=>import(`./kanagawa-lotus-DOmfpsRg.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>N(()=>import(`./kanagawa-wave-CpxmPE7N.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>N(()=>import(`./laserwave-BlEkf-eH.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>N(()=>import(`./light-plus-DS6zriYl.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>N(()=>import(`./material-theme-BsXH-Mss.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>N(()=>import(`./material-theme-darker-CW9OlIeY.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>N(()=>import(`./material-theme-lighter-D2PAh0Kw.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>N(()=>import(`./material-theme-ocean-Vz6DBVi3.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>N(()=>import(`./material-theme-palenight-D-GleP3G.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>N(()=>import(`./min-dark-BowNvxk2.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>N(()=>import(`./min-light-x8oWUmbL.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>N(()=>import(`./monokai-BQ4e_Hn0.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>N(()=>import(`./night-owl-D4PQd726.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>N(()=>import(`./night-owl-light-BQo_YHll.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>N(()=>import(`./nord-35quHUKo.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>N(()=>import(`./one-dark-pro-16_UaUig.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>N(()=>import(`./one-light-B-GGjWn5.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>N(()=>import(`./plastic-hp2Nry0R.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>N(()=>import(`./poimandres-BcTrxj7f.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>N(()=>import(`./red-rs3HE3re.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>N(()=>import(`./rose-pine-CNryoqGi.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>N(()=>import(`./rose-pine-dawn-C-gJOQVP.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>N(()=>import(`./rose-pine-moon-BdXSXpZh.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>N(()=>import(`./slack-dark-DnmSY72G.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>N(()=>import(`./slack-ochin-q97gHjcd.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>N(()=>import(`./snazzy-light-C8yWDN2g.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>N(()=>import(`./solarized-dark-ClVDEMJZ.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>N(()=>import(`./solarized-light-Bts6CUIP.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>N(()=>import(`./synthwave-84-DwSLbgAm.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>N(()=>import(`./tokyo-night-C9MqaxIn.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>N(()=>import(`./vesper-CliZ6Pkm.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>N(()=>import(`./vitesse-black-0bGIaCfD.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>N(()=>import(`./vitesse-dark-Dk-RSXq-.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>N(()=>import(`./vitesse-light-BUsA5RhG.js`),[]))}].map(e=>[e.id,e.import])),BB=r({createOnigurumaEngine:()=>mV,getDefaultWasmLoader:()=>pV,loadWasm:()=>sV,setDefaultWasmLoader:()=>fV}),VB=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function HB(){return 2147483648}function UB(){return typeof performance<`u`?performance.now():Date.now()}var WB=(e,t)=>e+(t-e%t)%t;async function GB(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=HB();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,WB(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:UB,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 KB=Object.defineProperty,qB=(e,t,n)=>t in e?KB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,JB=(e,t,n)=>qB(e,typeof t==`symbol`?t:t+``,n),YB=null;function XB(e){throw new VB(e.UTF8ToString(e.getLastOnigError()))}var ZB=class e{constructor(t){JB(this,`utf16Length`),JB(this,`utf8Length`),JB(this,`utf16Value`),JB(this,`utf8Value`),JB(this,`utf16OffsetToUtf8`),JB(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)}a<=127?t+=1:a<=2047?t+=2:a<=65535?t+=3:t+=4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},QB=class e{constructor(t){if(JB(this,`id`,++e.LAST_ID),JB(this,`_onigBinding`),JB(this,`content`),JB(this,`utf16Length`),JB(this,`utf8Length`),JB(this,`utf16OffsetToUtf8`),JB(this,`utf8OffsetToUtf16`),JB(this,`ptr`),!YB)throw new VB(`Must invoke loadWasm first.`);this._onigBinding=YB,this.content=t;let n=new ZB(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=YB.omalloc(1e4),e._sharedPtrInUse=!0,YB.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(YB)}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)}};JB(QB,`LAST_ID`,0),JB(QB,`_sharedPtr`,0),JB(QB,`_sharedPtrInUse`,!1);var $B=QB,eV=class{constructor(e){if(JB(this,`_onigBinding`),JB(this,`_ptr`),!YB)throw new VB(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new ZB(e[r]);t[r]=i.createString(YB),n[r]=i.utf8Length}let r=YB.omalloc(4*e.length);YB.HEAPU32.set(t,r/4);let i=YB.omalloc(4*e.length);YB.HEAPU32.set(n,i/4);let a=YB.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)YB.ofree(t[n]);YB.ofree(i),YB.ofree(r),a===0&&XB(YB),this._onigBinding=YB,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 $B(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 tV(e){return typeof e.instantiator==`function`}function nV(e){return typeof e.default==`function`}function rV(e){return e.data!==void 0}function iV(e){return typeof Response<`u`&&e instanceof Response}function aV(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 oV;function sV(e){if(oV)return oV;async function t(){YB=await GB(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),tV(n)?n=await n.instantiator(t):nV(n)?n=await n.default(t):(rV(n)&&(n=n.data),iV(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await lV(n)(t):await uV(n)(t):aV(n)||n instanceof WebAssembly.Module?n=await cV(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await cV(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return oV=t(),oV}function cV(e){return t=>WebAssembly.instantiate(e,t)}function lV(e){return t=>WebAssembly.instantiateStreaming(e,t)}function uV(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var dV;function fV(e){dV=e}function pV(){return dV}async function mV(e){return e&&await sV(e),{createScanner(e){return new eV(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new $B(e)}}}var hV=MB({});PB(hV,BB);var gV=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function _V(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 vV(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function yV(e){return Array.isArray(e)?e:[e]}async function bV(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function xV(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function SV(e){return e===`ansi`||xV(e)}function CV(e){return e===`none`}function wV(e){return CV(e)}function TV(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),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 EV={light:`#333333`,dark:`#bbbbbb`},DV={light:`#fffffe`,dark:`#1e1e1e`},OV=`__shiki_resolved`;function kV(e){if(e?.[OV])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`?EV.light:EV.dark,n||=t.type===`light`?DV.light:DV.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,OV,{enumerable:!1,writable:!1,value:!0}),t}async function AV(e){return Array.from(new Set((await Promise.all(e.filter(e=>!SV(e)).map(async e=>await bV(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function jV(e){return(await Promise.all(e.map(async e=>wV(e)?null:kV(await bV(e))))).filter(e=>!!e)}function MV(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 gV(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var NV=class extends Cm{_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=kV(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=tp.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=MV(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=Array.from(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 gV(`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))}},PV=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}},FV=0;function IV(e){FV+=1,e.warnings!==!1&&FV>=10&&FV%10==0&&console.warn(`[Shiki] ${FV} 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 gV("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(kV),i=new NV(new PV(e.engine,n),r,n,e.langAlias),a;function o(t){return MV(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new gV(`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 gV(`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 AV(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await jV(e))}function g(){if(t)throw new gV(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--FV)}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 LV(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([jV(e.themes||[]),AV(e.langs||[]),e.engine]);return IV({...e,themes:t,langs:n,engine:r})}var RV=new WeakMap;function zV(e,t){RV.set(e,t)}function BV(e){return RV.get(e)}var VV=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(yV(n).map(e=>[e,wm])),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 HV(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function HV(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 UV(e,t){if(!(e instanceof VV))throw new gV(`Invalid grammar state`);return e.getInternalStack(t)}function WV(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(xV(e.resolveLangAlias(n.lang||`text`))||CV(r))return TV(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 gV(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new gV(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return KV(t,o,i,a,n)}function GV(...e){if(e.length===2)return BV(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(xV(i)||CV(a))throw new gV(`Plain language does not have grammar state`);if(i===`ansi`)throw new gV(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new VV(qV(n,c,o,s,r).stateStack,c.name,o.name)}function KV(e,t,n,r,i){let a=qV(e,t,n,r,i),o=new VV(a.stateStack,t.name,n.name);return zV(a.tokens,o),a.tokens}function qV(e,t,n,r,i){let a=_V(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=TV(e),l=i.grammarState?UV(i.grammarState,n.name)??wm:i.grammarContextCode==null?wm:qV(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,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]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=vV(r[mp.getForeground(s)],a),l=mp.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?JV(t.scopes):YV(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function JV(e){return e.map(e=>({scopeName:e}))}function YV(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:QV(e,i,t.slice(0,r))}}return n}function XV(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function ZV(e,t,n){if(!XV(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)XV(e[r],n[i])&&--r,--i;return r===-1}function QV(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(ZV(e,t,n)){r.push(a);break}return r}function $V(e,t,n,r=WV){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:BV(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=eH(...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 VV(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&zV(s,c),s}function eH(...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}function tH(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function nH(e){let t=TV(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-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 rH(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var iH=`light-dark()`,aH=[`color`,`background-color`];function oH(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 sH(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?oH(e,t):e})):e}function cH(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>lH(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&&aH.includes(a))if(r===iH&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new gV('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[a]=`light-dark(${o[e][a]||`inherit`}, ${o[r][a]||`inherit`})`,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 lH(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&cp.Italic&&(t[`font-style`]=`italic`),e.fontStyle&cp.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&cp.Underline&&n.push(`underline`),e.fontStyle&cp.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function uH(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function dH(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=nH(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new gV(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}else{let t=n.lines[e.line];if(t===void 0)throw new gV(`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 gV(`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)}));fH(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 sH(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=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new gV(`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+=pH(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new gV(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new gV(`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&&tH(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 fH(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new gV(`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 gV(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function pH(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(pH).join(``):``}var mH=[dH()];function hH(e){let t=gH(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...mH]}function gH(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 _H=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],vH={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function yH(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 bH(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}}else if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function xH(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)vH[r]&&t.push({type:`setDecoration`,value:vH[r]});else if(r<=29){let e=vH[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:_H[r-30]}});else if(r===38){let n=bH(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:_H[r-40]}});else if(r===48){let n=bH(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:_H[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:_H[r-100+8]}})}return t}function SH(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=yH(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=xH(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 CH={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 wH(e=CH){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<_H.length;e++)r.push(t(_H[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 TH={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 EH(e,t,n){let r=_V(e,n),i=TV(t),a=wH(Object.fromEntries(_H.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||TH[t]]}))),o=SH();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=vV(i,r),o=vV(o,r),n.decorations.has(`dim`)&&(i=DH(i));let s=cp.None;return n.decorations.has(`bold`)&&(s|=cp.Bold),n.decorations.has(`italic`)&&(s|=cp.Italic),n.decorations.has(`underline`)&&(s|=cp.Underline),n.decorations.has(`strikethrough`)&&(s|=cp.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function DH(e){let t=e.match(/#([0-9a-f]{3,8})/i);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}`}else if(e.length===6)return`#${e}80`;else 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`)}`}else 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(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function OH(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!xV(r)&&!CV(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return EH(r,t,n)}return WV(e,t,n)}function kH(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 gV("`themes` option must not be empty");let p=$V(e,t,n,OH);if(c=BV(p),l&&iH!==l&&!f.find(e=>e.color===l))throw new gV(`\`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=>cH(e,h,u,l,d))),c&&zV(a,c);let g=f.map(e=>_V(e.theme,n));i=AH(f,m,g,u,l,`fg`,d),r=AH(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=_V(n.theme,n);a=OH(e,t,n);let l=e.getTheme(n.theme);r=vV(l.bg,s),i=vV(l.fg,s),o=l.name,c=BV(a)}else throw new gV("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function AH(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=vV(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===iH&&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 gV('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${vV(t[r][a],n[r])||`inherit`}, ${vV(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function jH(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>jH(e,t,n),codeToTokens:(t,n)=>kH(e,t,n)}){let i=t;for(let e of hH(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=kH(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=NH(a):d===`never`&&(a=PH(a)),f&&(a=FH(a));let p={...r,get source(){return i}};for(let e of hH(n))a=e.tokens?.call(p,a)||a;return MH(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function MH(e,t,n,r=BV(e)){let i=hH(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(t.rootStyle==null?l.style=`background-color:${t.bg};color:${t.fg}`:l.style=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:tH,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:`
177
+ `}));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=uH(a.htmlStyle||lH(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&&zV(m,r),m}function NH(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&cp.Underline||i.fontStyle&cp.Strikethrough));o&&i.content.match(/^\s+$/)&&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 PH(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);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 FH(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=uH(e.htmlStyle||lH(e)),i=uH(n.htmlStyle||lH(n)),a=e.fontStyle&&(e.fontStyle&cp.Underline||e.fontStyle&cp.Strikethrough),o=n.fontStyle&&(n.fontStyle&cp.Underline||n.fontStyle&cp.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var IH=Bh;function LH(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>jH(e,t,n),codeToTokens:(t,n)=>kH(e,t,n)},i=IH(jH(e,t,n,r));for(let e of hH(n))i=e.postprocess?.call(r,i,n)||i;return i}async function RH(e){let t=await LV(e);return{getLastGrammarState:(...e)=>GV(t,...e),codeToTokensBase:(e,n)=>OH(t,e,n),codeToTokensWithThemes:(e,n)=>$V(t,e,n),codeToTokens:(e,n)=>kH(t,e,n),codeToHast:(e,n)=>jH(t,e,n),codeToHtml:(e,n)=>LH(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function zH(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,SV(n))return[];let r=t[n];if(!r)throw new gV(`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(wV(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new gV(`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 RH({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 BH(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}else{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 VH(e,t){let n=BH(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 HH=zH({langs:RB,themes:zB,engine:()=>(0,hV.createOnigurumaEngine)(N(()=>import(`./wasm-DBgC86Vn.js`),[]))}),{codeToHtml:UH,codeToHast:WH,codeToTokens:GH,codeToTokensBase:KH,codeToTokensWithThemes:qH,getSingletonHighlighter:JH,getLastGrammarState:YH}=VH(HH,{guessEmbeddedLanguages:rH}),XH=e=>e&&e&1,ZH=e=>e&&e&2,QH=e=>e&&e&4,$H=e=>e.map((e,t)=>({key:`line-${t}`,tokens:e.map((e,n)=>({key:`line-${t}-${n}`,token:e}))})),eU=({token:e})=>(0,U.jsx)(`span`,{className:`dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]`,style:{backgroundColor:e.bgColor,color:e.color,fontStyle:XH(e.fontStyle)?`italic`:void 0,fontWeight:ZH(e.fontStyle)?`bold`:void 0,textDecoration:QH(e.fontStyle)?`underline`:void 0,...e.htmlStyle},children:e.content}),tU=H(`block`,`before:content-[counter(line)]`,`before:inline-block`,`before:[counter-increment:line]`,`before:w-8`,`before:mr-4`,`before:text-right`,`before:text-muted-foreground/50`,`before:font-mono`,`before:select-none`),nU=({keyedLine:e,showLineNumbers:t})=>(0,U.jsx)(`span`,{className:t?tU:`block`,children:e.tokens.length===0?`
178
+ `:e.tokens.map(({token:e,key:t})=>(0,U.jsx)(eU,{token:e},t))}),rU=(0,z.createContext)({code:``}),iU=new Map,aU=new Map,oU=new Map,sU=(e,t)=>{let n=e.slice(0,100),r=e.length>100?e.slice(-100):``;return`${t}:${e.length}:${n}:${r}`},cU=e=>{let t=iU.get(e);if(t)return t;let n=HH({langs:[e],themes:[`github-light`,`github-dark`]});return iU.set(e,n),n},lU=e=>({bg:`transparent`,fg:`inherit`,tokens:e.split(`
179
+ `).map(e=>e===``?[]:[{color:`inherit`,content:e}])}),uU=(e,t,n)=>{let r=sU(e,t);return aU.get(r)||(n&&(oU.has(r)||oU.set(r,new Set),oU.get(r)?.add(n)),cU(t).then(n=>{let i=n.getLoadedLanguages().includes(t)?t:`text`,a=n.codeToTokens(e,{lang:i,themes:{dark:`github-dark`,light:`github-light`}}),o={bg:a.bg??`transparent`,fg:a.fg??`inherit`,tokens:a.tokens};aU.set(r,o);let s=oU.get(r);if(s){for(let e of s)e(o);oU.delete(r)}}).catch(e=>{console.error(`Failed to highlight code:`,e),oU.delete(r)}),null)},dU=(0,z.memo)(({tokenized:e,showLineNumbers:t,className:n})=>{let r=(0,z.useMemo)(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]),i=(0,z.useMemo)(()=>$H(e.tokens),[e.tokens]);return(0,U.jsx)(`pre`,{className:H(`dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm`,n),style:r,children:(0,U.jsx)(`code`,{className:H(`font-mono text-sm`,t&&`[counter-increment:line_0] [counter-reset:line]`),children:i.map(e=>(0,U.jsx)(nU,{keyedLine:e,showLineNumbers:t},e.key))})})},(e,t)=>e.tokenized===t.tokenized&&e.showLineNumbers===t.showLineNumbers&&e.className===t.className);dU.displayName=`CodeBlockBody`;var fU=({className:e,language:t,style:n,...r})=>(0,U.jsx)(`div`,{className:H(`group relative w-full overflow-hidden rounded-md border bg-background text-foreground`,e),"data-language":t,style:{containIntrinsicSize:`auto 200px`,contentVisibility:`auto`,...n},...r}),pU=({code:e,language:t,showLineNumbers:n=!1})=>{let r=(0,z.useMemo)(()=>lU(e),[e]),i=(0,z.useMemo)(()=>uU(e,t)??r,[e,t,r]),[a,o]=(0,z.useState)(null),s=(0,z.useRef)({code:e,language:t});return(s.current.code!==e||s.current.language!==t)&&(s.current={code:e,language:t},o(null)),(0,z.useEffect)(()=>{let n=!1;return uU(e,t,e=>{n||o(e)}),()=>{n=!0}},[e,t]),(0,U.jsx)(`div`,{className:`relative overflow-auto`,children:(0,U.jsx)(dU,{showLineNumbers:n,tokenized:a??i})})},mU=({code:e,language:t,showLineNumbers:n=!1,className:r,children:i,...a})=>{let o=(0,z.useMemo)(()=>({code:e}),[e]);return(0,U.jsx)(rU.Provider,{value:o,children:(0,U.jsxs)(fU,{className:r,language:t,...a,children:[i,(0,U.jsx)(pU,{code:e,language:t,showLineNumbers:n})]})})},hU=({className:e,...t})=>(0,U.jsx)(Ck,{className:H(`group not-prose mb-4 w-full rounded-md border`,e),...t}),gU={"approval-requested":`Awaiting Approval`,"approval-responded":`Responded`,"input-available":`Running`,"input-streaming":`Pending`,"output-available":`Completed`,"output-denied":`Denied`,"output-error":`Error`},_U={"approval-requested":(0,U.jsx)(Xl,{className:`size-4 text-yellow-600`}),"approval-responded":(0,U.jsx)(Kl,{className:`size-4 text-blue-600`}),"input-available":(0,U.jsx)(Xl,{className:`size-4 animate-pulse`}),"input-streaming":(0,U.jsx)(Jl,{className:`size-4`}),"output-available":(0,U.jsx)(Kl,{className:`size-4 text-green-600`}),"output-denied":(0,U.jsx)(ql,{className:`size-4 text-orange-600`}),"output-error":(0,U.jsx)(ql,{className:`size-4 text-red-600`})},vU=e=>(0,U.jsxs)(DB,{className:`gap-1.5 rounded-full text-xs`,variant:`secondary`,children:[_U[e],gU[e]]}),yU=({className:e,title:t,type:n,state:r,toolName:i,...a})=>{let o=n===`dynamic-tool`?i:n.split(`-`).slice(1).join(`-`);return(0,U.jsxs)(wk,{className:H(`flex w-full items-center justify-between gap-4 p-3`,e),...a,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(yu,{className:`size-4 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`font-medium text-sm`,children:t??o}),vU(r)]}),(0,U.jsx)(Gl,{className:`size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]})},bU=({className:e,...t})=>(0,U.jsx)(Tk,{className:H(`data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in`,e),...t}),xU=({className:e,input:t,...n})=>(0,U.jsxs)(`div`,{className:H(`space-y-2 overflow-hidden`,e),...n,children:[(0,U.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:`Parameters`}),(0,U.jsx)(`div`,{className:`rounded-md bg-muted/50`,children:(0,U.jsx)(mU,{code:JSON.stringify(t,null,2),language:`json`})})]}),SU=({className:e,output:t,errorText:n,...r})=>{if(!(t||n))return null;let i=(0,U.jsx)(`div`,{children:t});return typeof t==`object`&&!(0,z.isValidElement)(t)?i=(0,U.jsx)(mU,{code:JSON.stringify(t,null,2),language:`json`}):typeof t==`string`&&(i=(0,U.jsx)(mU,{code:t,language:`json`})),(0,U.jsxs)(`div`,{className:H(`space-y-2`,e),...r,children:[(0,U.jsx)(`h4`,{className:`font-medium text-muted-foreground text-xs uppercase tracking-wide`,children:n?`Error`:`Result`}),(0,U.jsxs)(`div`,{className:H(`overflow-x-auto rounded-md text-xs [&_table]:w-full`,n?`bg-destructive/10 text-destructive`:`bg-muted/50 text-foreground`),children:[n&&(0,U.jsx)(`div`,{children:n}),i]})]})},CU=function(e){return e.CF_AGENT_CHAT_MESSAGES=`cf_agent_chat_messages`,e.CF_AGENT_USE_CHAT_REQUEST=`cf_agent_use_chat_request`,e.CF_AGENT_USE_CHAT_RESPONSE=`cf_agent_use_chat_response`,e.CF_AGENT_CHAT_CLEAR=`cf_agent_chat_clear`,e.CF_AGENT_CHAT_REQUEST_CANCEL=`cf_agent_chat_request_cancel`,e.CF_AGENT_STREAM_RESUMING=`cf_agent_stream_resuming`,e.CF_AGENT_STREAM_RESUME_ACK=`cf_agent_stream_resume_ack`,e.CF_AGENT_STREAM_RESUME_REQUEST=`cf_agent_stream_resume_request`,e.CF_AGENT_STREAM_RESUME_NONE=`cf_agent_stream_resume_none`,e.CF_AGENT_TOOL_RESULT=`cf_agent_tool_result`,e.CF_AGENT_MESSAGE_UPDATED=`cf_agent_message_updated`,e.CF_AGENT_TOOL_APPROVAL=`cf_agent_tool_approval`,e}({}),wU=`vercel.ai.error`,TU=Symbol.for(wU),EU,DU,OU=class e extends (DU=Error,EU=TU,DU){constructor({name:e,message:t,cause:n}){super(t),this[EU]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,wU)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};function kU(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var AU=`AI_InvalidArgumentError`,jU=`vercel.ai.error.${AU}`,MU=Symbol.for(jU),NU,PU,FU=class extends (PU=OU,NU=MU,PU){constructor({message:e,cause:t,argument:n}){super({name:AU,message:e,cause:t}),this[NU]=!0,this.argument=n}static isInstance(e){return OU.hasMarker(e,jU)}},IU=`AI_JSONParseError`,LU=`vercel.ai.error.${IU}`,RU=Symbol.for(LU),zU,BU,VU=class extends (BU=OU,zU=RU,BU){constructor({text:e,cause:t}){super({name:IU,message:`JSON parsing failed: Text: ${e}.
180
+ Error message: ${kU(t)}`,cause:t}),this[zU]=!0,this.text=e}static isInstance(e){return OU.hasMarker(e,LU)}},HU=`AI_TypeValidationError`,UU=`vercel.ai.error.${HU}`,WU=Symbol.for(UU),GU,KU,qU=class e extends (KU=OU,GU=WU,KU){constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:HU,message:`${r}: Value: ${JSON.stringify(e)}.
181
+ Error message: ${kU(t)}`,cause:t}),this[GU]=!0,this.value=e,this.context=n}static isInstance(e){return OU.hasMarker(e,UU)}static wrap({value:t,cause:n,context:r}){return e.isInstance(n)&&n.value===t&&n.context?.field===r?.field&&n.context?.entityName===r?.entityName&&n.context?.entityId===r?.entityId?n:new e({value:t,cause:n,context:r})}};Object.freeze({status:`aborted`});function q(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var JU=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},YU=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},XU={};function ZU(e){return e&&Object.assign(XU,e),XU}function QU(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function $U(e,t){return typeof t==`bigint`?t.toString():t}function eW(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function tW(e){return e==null}function nW(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function rW(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var iW=Symbol(`evaluating`);function aW(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==iW)return r===void 0&&(r=iW,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function oW(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function sW(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function cW(e){return JSON.stringify(e)}function lW(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var uW=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function dW(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var fW=eW(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function pW(e){if(dW(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(dW(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function mW(e){return pW(e)?{...e}:Array.isArray(e)?[...e]:e}var hW=new Set([`string`,`number`,`symbol`]);function gW(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function _W(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function J(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function vW(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var yW={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function bW(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return _W(e,sW(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return oW(this,`shape`,e),e},checks:[]}))}function xW(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return _W(e,sW(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return oW(this,`shape`,r),r},checks:[]}))}function SW(e,t){if(!pW(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _W(e,sW(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return oW(this,`shape`,n),n}}))}function CW(e,t){if(!pW(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return _W(e,sW(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return oW(this,`shape`,n),n}}))}function wW(e,t){return _W(e,sW(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return oW(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function TW(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return _W(t,sW(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return oW(this,`shape`,i),i},checks:[]}))}function EW(e,t,n){return _W(t,sW(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return oW(this,`shape`,i),i}}))}function DW(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function OW(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function kW(e){return typeof e==`string`?e:e?.message}function AW(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=kW(e.inst?._zod.def?.error?.(e))??kW(t?.error?.(e))??kW(n.customError?.(e))??kW(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function jW(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function MW(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var NW=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,$U,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},PW=q(`$ZodError`,NW),FW=q(`$ZodError`,NW,{Parent:Error});function IW(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function LW(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var RW=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new JU;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>AW(e,a,ZU())));throw uW(t,i?.callee),t}return o.value},zW=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>AW(e,a,ZU())));throw uW(t,i?.callee),t}return o.value},BW=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new JU;return a.issues.length?{success:!1,error:new(e??PW)(a.issues.map(e=>AW(e,i,ZU())))}:{success:!0,data:a.value}},VW=BW(FW),HW=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>AW(e,i,ZU())))}:{success:!0,data:a.value}},UW=HW(FW),WW=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return RW(e)(t,n,i)},GW=e=>(t,n,r)=>RW(e)(t,n,r),KW=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return zW(e)(t,n,i)},qW=e=>async(t,n,r)=>zW(e)(t,n,r),JW=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return BW(e)(t,n,i)},YW=e=>(t,n,r)=>BW(e)(t,n,r),XW=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return HW(e)(t,n,i)},ZW=e=>async(t,n,r)=>HW(e)(t,n,r),QW=/^[cC][^\s-]{8,}$/,$W=/^[0-9a-z]+$/,eG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tG=/^[0-9a-vA-V]{20}$/,nG=/^[A-Za-z0-9]{27}$/,rG=/^[a-zA-Z0-9_-]{21}$/,iG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,aG=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,oG=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,sG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cG=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function lG(){return new RegExp(cG,`u`)}var uG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,dG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,fG=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,pG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hG=/^[A-Za-z0-9_-]*$/,gG=/^\+[1-9]\d{6,14}$/,_G=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,vG=RegExp(`^${_G}$`);function yG(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bG(e){return RegExp(`^${yG(e)}$`)}function xG(e){let t=yG({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${_G}T(?:${r})$`)}var SG=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},CG=/^-?\d+$/,wG=/^-?\d+(?:\.\d+)?$/,TG=/^(?:true|false)$/i,EG=/^null$/i,DG=/^[^A-Z]*$/,OG=/^[^a-z]*$/,kG=q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),AG={number:`number`,bigint:`bigint`,object:`date`},jG=q(`$ZodCheckLessThan`,(e,t)=>{kG.init(e,t);let n=AG[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),MG=q(`$ZodCheckGreaterThan`,(e,t)=>{kG.init(e,t);let n=AG[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),NG=q(`$ZodCheckMultipleOf`,(e,t)=>{kG.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):rW(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),PG=q(`$ZodCheckNumberFormat`,(e,t)=>{kG.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=yW[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=CG)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),FG=q(`$ZodCheckMaxLength`,(e,t)=>{var n;kG.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!tW(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=jW(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),IG=q(`$ZodCheckMinLength`,(e,t)=>{var n;kG.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!tW(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=jW(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),LG=q(`$ZodCheckLengthEquals`,(e,t)=>{var n;kG.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!tW(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=jW(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),RG=q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;kG.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),zG=q(`$ZodCheckRegex`,(e,t)=>{RG.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),BG=q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=DG,RG.init(e,t)}),VG=q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=OG,RG.init(e,t)}),HG=q(`$ZodCheckIncludes`,(e,t)=>{kG.init(e,t);let n=gW(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),UG=q(`$ZodCheckStartsWith`,(e,t)=>{kG.init(e,t);let n=RegExp(`^${gW(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),WG=q(`$ZodCheckEndsWith`,(e,t)=>{kG.init(e,t);let n=RegExp(`.*${gW(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),GG=q(`$ZodCheckOverwrite`,(e,t)=>{kG.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),KG=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
182
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
183
+ `))}},qG={major:4,minor:3,patch:6},JG=q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qG;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=DW(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new JU;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=DW(e,t))});else{if(e.issues.length===t)continue;r||=DW(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(DW(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new JU;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new JU;return o.then(e=>t(e,r,a))}return t(o,r,a)}}aW(e,`~standard`,()=>({validate:t=>{try{let n=VW(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return UW(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),YG=q(`$ZodString`,(e,t)=>{JG.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??SG(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),XG=q(`$ZodStringFormat`,(e,t)=>{RG.init(e,t),YG.init(e,t)}),ZG=q(`$ZodGUID`,(e,t)=>{t.pattern??=aG,XG.init(e,t)}),QG=q(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=oG(e)}else t.pattern??=oG();XG.init(e,t)}),$G=q(`$ZodEmail`,(e,t)=>{t.pattern??=sG,XG.init(e,t)}),eK=q(`$ZodURL`,(e,t)=>{XG.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),tK=q(`$ZodEmoji`,(e,t)=>{t.pattern??=lG(),XG.init(e,t)}),nK=q(`$ZodNanoID`,(e,t)=>{t.pattern??=rG,XG.init(e,t)}),rK=q(`$ZodCUID`,(e,t)=>{t.pattern??=QW,XG.init(e,t)}),iK=q(`$ZodCUID2`,(e,t)=>{t.pattern??=$W,XG.init(e,t)}),aK=q(`$ZodULID`,(e,t)=>{t.pattern??=eG,XG.init(e,t)}),oK=q(`$ZodXID`,(e,t)=>{t.pattern??=tG,XG.init(e,t)}),sK=q(`$ZodKSUID`,(e,t)=>{t.pattern??=nG,XG.init(e,t)}),cK=q(`$ZodISODateTime`,(e,t)=>{t.pattern??=xG(t),XG.init(e,t)}),lK=q(`$ZodISODate`,(e,t)=>{t.pattern??=vG,XG.init(e,t)}),uK=q(`$ZodISOTime`,(e,t)=>{t.pattern??=bG(t),XG.init(e,t)}),dK=q(`$ZodISODuration`,(e,t)=>{t.pattern??=iG,XG.init(e,t)}),fK=q(`$ZodIPv4`,(e,t)=>{t.pattern??=uG,XG.init(e,t),e._zod.bag.format=`ipv4`}),pK=q(`$ZodIPv6`,(e,t)=>{t.pattern??=dG,XG.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),mK=q(`$ZodCIDRv4`,(e,t)=>{t.pattern??=fG,XG.init(e,t)}),hK=q(`$ZodCIDRv6`,(e,t)=>{t.pattern??=pG,XG.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function gK(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var _K=q(`$ZodBase64`,(e,t)=>{t.pattern??=mG,XG.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{gK(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function vK(e){if(!hG.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return gK(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var yK=q(`$ZodBase64URL`,(e,t)=>{t.pattern??=hG,XG.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{vK(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),bK=q(`$ZodE164`,(e,t)=>{t.pattern??=gG,XG.init(e,t)});function xK(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var SK=q(`$ZodJWT`,(e,t)=>{XG.init(e,t),e._zod.check=n=>{xK(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),CK=q(`$ZodNumber`,(e,t)=>{JG.init(e,t),e._zod.pattern=e._zod.bag.pattern??wG,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),wK=q(`$ZodNumberFormat`,(e,t)=>{PG.init(e,t),CK.init(e,t)}),TK=q(`$ZodBoolean`,(e,t)=>{JG.init(e,t),e._zod.pattern=TG,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),EK=q(`$ZodNull`,(e,t)=>{JG.init(e,t),e._zod.pattern=EG,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),DK=q(`$ZodUnknown`,(e,t)=>{JG.init(e,t),e._zod.parse=e=>e}),OK=q(`$ZodNever`,(e,t)=>{JG.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function kK(e,t,n){e.issues.length&&t.issues.push(...OW(n,e.issues)),t.value[n]=e.value}var AK=q(`$ZodArray`,(e,t)=>{JG.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>kK(t,n,e))):kK(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function jK(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...OW(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function MK(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=vW(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function NK(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>jK(e,n,i,t,u))):jK(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var PK=q(`$ZodObject`,(e,t)=>{if(JG.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=eW(()=>MK(t));aW(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=dW,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>jK(n,t,e,s,r))):jK(i,t,e,s,r)}return i?NK(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),FK=q(`$ZodObjectJIT`,(e,t)=>{PK.init(e,t);let n=e._zod.parse,r=eW(()=>MK(t)),i=e=>{let t=new KG([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=cW(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=cW(r),s=e[r]?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),s?t.write(`
184
+ if (${n}.issues.length) {
185
+ if (${o} in input) {
186
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
187
+ ...iss,
188
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
189
+ })));
190
+ }
191
+ }
192
+
193
+ if (${n}.value === undefined) {
194
+ if (${o} in input) {
195
+ newResult[${o}] = undefined;
196
+ }
197
+ } else {
198
+ newResult[${o}] = ${n}.value;
199
+ }
200
+
201
+ `):t.write(`
202
+ if (${n}.issues.length) {
203
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
204
+ ...iss,
205
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
206
+ })));
207
+ }
208
+
209
+ if (${n}.value === undefined) {
210
+ if (${o} in input) {
211
+ newResult[${o}] = undefined;
212
+ }
213
+ } else {
214
+ newResult[${o}] = ${n}.value;
215
+ }
216
+
217
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=dW,s=!XU.jitless,c=s&&fW.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?NK([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function IK(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!DW(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>AW(e,r,ZU())))}),t)}var LK=q(`$ZodUnion`,(e,t)=>{JG.init(e,t),aW(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),aW(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),aW(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),aW(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>nW(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>IK(t,i,e,a)):IK(s,i,e,a)}}),RK=q(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,LK.init(e,t);let n=e._zod.parse;aW(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=eW(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!dW(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),zK=q(`$ZodIntersection`,(e,t)=>{JG.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>VK(e,t,n)):VK(e,i,a)}});function BK(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pW(e)&&pW(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=BK(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=BK(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function VK(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),DW(e))return e;let o=BK(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var HK=q(`$ZodRecord`,(e,t)=>{JG.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!pW(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...OW(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...OW(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&wG.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>AW(e,r,ZU())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...OW(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...OW(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),UK=q(`$ZodEnum`,(e,t)=>{JG.init(e,t);let n=QU(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>hW.has(typeof e)).map(e=>typeof e==`string`?gW(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),WK=q(`$ZodLiteral`,(e,t)=>{if(JG.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?gW(e):e?gW(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),GK=q(`$ZodTransform`,(e,t)=>{JG.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new YU(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new JU;return n.value=i,n}});function KK(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var qK=q(`$ZodOptional`,(e,t)=>{JG.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,aW(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),aW(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${nW(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>KK(t,e.value)):KK(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),JK=q(`$ZodExactOptional`,(e,t)=>{qK.init(e,t),aW(e._zod,`values`,()=>t.innerType._zod.values),aW(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),YK=q(`$ZodNullable`,(e,t)=>{JG.init(e,t),aW(e._zod,`optin`,()=>t.innerType._zod.optin),aW(e._zod,`optout`,()=>t.innerType._zod.optout),aW(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${nW(e.source)}|null)$`):void 0}),aW(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),XK=q(`$ZodDefault`,(e,t)=>{JG.init(e,t),e._zod.optin=`optional`,aW(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ZK(e,t)):ZK(r,t)}});function ZK(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var QK=q(`$ZodPrefault`,(e,t)=>{JG.init(e,t),e._zod.optin=`optional`,aW(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),$K=q(`$ZodNonOptional`,(e,t)=>{JG.init(e,t),aW(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>eq(t,e)):eq(i,e)}});function eq(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var tq=q(`$ZodCatch`,(e,t)=>{JG.init(e,t),aW(e._zod,`optin`,()=>t.innerType._zod.optin),aW(e._zod,`optout`,()=>t.innerType._zod.optout),aW(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>AW(e,n,ZU()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>AW(e,n,ZU()))},input:e.value}),e.issues=[]),e)}}),nq=q(`$ZodPipe`,(e,t)=>{JG.init(e,t),aW(e._zod,`values`,()=>t.in._zod.values),aW(e._zod,`optin`,()=>t.in._zod.optin),aW(e._zod,`optout`,()=>t.out._zod.optout),aW(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>rq(e,t.in,n)):rq(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>rq(e,t.out,n)):rq(r,t.out,n)}});function rq(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var iq=q(`$ZodReadonly`,(e,t)=>{JG.init(e,t),aW(e._zod,`propValues`,()=>t.innerType._zod.propValues),aW(e._zod,`values`,()=>t.innerType._zod.values),aW(e._zod,`optin`,()=>t.innerType?._zod?.optin),aW(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(aq):aq(r)}});function aq(e){return e.value=Object.freeze(e.value),e}var oq=q(`$ZodLazy`,(e,t)=>{JG.init(e,t),aW(e._zod,`innerType`,()=>t.getter()),aW(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),aW(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),aW(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),aW(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),sq=q(`$ZodCustom`,(e,t)=>{kG.init(e,t),JG.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>cq(t,n,r,e));cq(i,n,r,e)}});function cq(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(MW(e))}}var lq,uq=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function dq(){return new uq}(lq=globalThis).__zod_globalRegistry??(lq.__zod_globalRegistry=dq());var fq=globalThis.__zod_globalRegistry;function pq(e,t){return new e({type:`string`,...J(t)})}function mq(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...J(t)})}function hq(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...J(t)})}function gq(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...J(t)})}function _q(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...J(t)})}function vq(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...J(t)})}function yq(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...J(t)})}function bq(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...J(t)})}function xq(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...J(t)})}function Sq(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...J(t)})}function Cq(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...J(t)})}function wq(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...J(t)})}function Tq(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...J(t)})}function Eq(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...J(t)})}function Dq(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...J(t)})}function Oq(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...J(t)})}function kq(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...J(t)})}function Aq(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...J(t)})}function jq(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...J(t)})}function Mq(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...J(t)})}function Nq(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...J(t)})}function Pq(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...J(t)})}function Fq(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...J(t)})}function Iq(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...J(t)})}function Lq(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...J(t)})}function Rq(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...J(t)})}function zq(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...J(t)})}function Bq(e,t){return new e({type:`number`,checks:[],...J(t)})}function Vq(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...J(t)})}function Hq(e,t){return new e({type:`boolean`,...J(t)})}function Uq(e,t){return new e({type:`null`,...J(t)})}function Wq(e){return new e({type:`unknown`})}function Gq(e,t){return new e({type:`never`,...J(t)})}function Kq(e,t){return new jG({check:`less_than`,...J(t),value:e,inclusive:!1})}function qq(e,t){return new jG({check:`less_than`,...J(t),value:e,inclusive:!0})}function Jq(e,t){return new MG({check:`greater_than`,...J(t),value:e,inclusive:!1})}function Yq(e,t){return new MG({check:`greater_than`,...J(t),value:e,inclusive:!0})}function Xq(e,t){return new NG({check:`multiple_of`,...J(t),value:e})}function Zq(e,t){return new FG({check:`max_length`,...J(t),maximum:e})}function Qq(e,t){return new IG({check:`min_length`,...J(t),minimum:e})}function $q(e,t){return new LG({check:`length_equals`,...J(t),length:e})}function eJ(e,t){return new zG({check:`string_format`,format:`regex`,...J(t),pattern:e})}function tJ(e){return new BG({check:`string_format`,format:`lowercase`,...J(e)})}function nJ(e){return new VG({check:`string_format`,format:`uppercase`,...J(e)})}function rJ(e,t){return new HG({check:`string_format`,format:`includes`,...J(t),includes:e})}function iJ(e,t){return new UG({check:`string_format`,format:`starts_with`,...J(t),prefix:e})}function aJ(e,t){return new WG({check:`string_format`,format:`ends_with`,...J(t),suffix:e})}function oJ(e){return new GG({check:`overwrite`,tx:e})}function sJ(e){return oJ(t=>t.normalize(e))}function cJ(){return oJ(e=>e.trim())}function lJ(){return oJ(e=>e.toLowerCase())}function uJ(){return oJ(e=>e.toUpperCase())}function dJ(){return oJ(e=>lW(e))}function fJ(e,t,n){return new e({type:`array`,element:t,...J(n)})}function pJ(e,t,n){let r=J(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function mJ(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...J(n)})}function hJ(e){let t=gJ(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(MW(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(MW(r))}},e(n.value,n)));return t}function gJ(e,t){let n=new kG({check:`custom`,...J(t)});return n._zod.check=e,n}function _J(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??fq,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function vJ(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,vJ(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&xJ(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function yJ(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
218
+
219
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function bJ(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:CJ(t,`input`,e.processors),output:CJ(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function xJ(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return xJ(r.element,n);if(r.type===`set`)return xJ(r.valueType,n);if(r.type===`lazy`)return xJ(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return xJ(r.innerType,n);if(r.type===`intersection`)return xJ(r.left,n)||xJ(r.right,n);if(r.type===`record`||r.type===`map`)return xJ(r.keyType,n)||xJ(r.valueType,n);if(r.type===`pipe`)return xJ(r.in,n)||xJ(r.out,n);if(r.type===`object`){for(let e in r.shape)if(xJ(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(xJ(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(xJ(e,n))return!0;return!!(r.rest&&xJ(r.rest,n))}return!1}var SJ=(e,t={})=>n=>{let r=_J({...n,processors:t});return vJ(e,r),yJ(r,e),bJ(r,e)},CJ=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=_J({...i??{},target:a,io:t,processors:n});return vJ(e,o),yJ(o,e),bJ(o,e)},wJ={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},TJ=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=wJ[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},EJ=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},DJ=(e,t,n,r)=>{n.type=`boolean`},OJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`)},kJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`)},AJ=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},jJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},MJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},NJ=(e,t,n,r)=>{n.not={}},PJ=(e,t,n,r)=>{},FJ=(e,t,n,r)=>{},IJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},LJ=(e,t,n,r)=>{let i=e._zod.def,a=QU(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},RJ=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},zJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`)},BJ=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},VJ=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},HJ=(e,t,n,r)=>{n.type=`boolean`},UJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},WJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},GJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},KJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`)},qJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`)},JJ=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=vJ(a.element,t,{...r,path:[...r.path,`items`]})},YJ=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=vJ(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=vJ(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},XJ=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>vJ(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ZJ=(e,t,n,r)=>{let i=e._zod.def,a=vJ(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=vJ(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},QJ=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>vJ(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?vJ(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},$J=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=vJ(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=vJ(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=vJ(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},eY=(e,t,n,r)=>{let i=e._zod.def,a=vJ(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},tY=(e,t,n,r)=>{let i=e._zod.def;vJ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},nY=(e,t,n,r)=>{let i=e._zod.def;vJ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},rY=(e,t,n,r)=>{let i=e._zod.def;vJ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},iY=(e,t,n,r)=>{let i=e._zod.def;vJ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},aY=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;vJ(a,t,r);let o=t.seen.get(e);o.ref=a},oY=(e,t,n,r)=>{let i=e._zod.def;vJ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},sY=(e,t,n,r)=>{let i=e._zod.def;vJ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},cY=(e,t,n,r)=>{let i=e._zod.def;vJ(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},lY=(e,t,n,r)=>{let i=e._zod.innerType;vJ(i,t,r);let a=t.seen.get(e);a.ref=i},uY={string:TJ,number:EJ,boolean:DJ,bigint:OJ,symbol:kJ,null:AJ,undefined:jJ,void:MJ,never:NJ,any:PJ,unknown:FJ,date:IJ,enum:LJ,literal:RJ,nan:zJ,template_literal:BJ,file:VJ,success:HJ,custom:UJ,function:WJ,transform:GJ,map:KJ,set:qJ,array:JJ,object:YJ,union:XJ,intersection:ZJ,tuple:QJ,record:$J,nullable:eY,nonoptional:tY,default:nY,prefault:rY,catch:iY,pipe:aY,readonly:oY,promise:sY,optional:cY,lazy:lY};function dY(e,t){if(`_idmap`in e){let n=e,r=_J({...t,processors:uY}),i={};for(let e of n._idmap.entries()){let[t,n]=e;vJ(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;yJ(r,n),a[t]=bJ(r,n)}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=_J({...t,processors:uY});return vJ(e,n),yJ(n,e),bJ(n,e)}var fY=q(`ZodISODateTime`,(e,t)=>{cK.init(e,t),LY.init(e,t)});function pY(e){return Iq(fY,e)}var mY=q(`ZodISODate`,(e,t)=>{lK.init(e,t),LY.init(e,t)});function hY(e){return Lq(mY,e)}var gY=q(`ZodISOTime`,(e,t)=>{uK.init(e,t),LY.init(e,t)});function _Y(e){return Rq(gY,e)}var vY=q(`ZodISODuration`,(e,t)=>{dK.init(e,t),LY.init(e,t)});function yY(e){return zq(vY,e)}var bY=(e,t)=>{PW.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>LW(e,t)},flatten:{value:t=>IW(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,$U,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,$U,2)}},isEmpty:{get(){return e.issues.length===0}}})};q(`ZodError`,bY);var xY=q(`ZodError`,bY,{Parent:Error}),SY=RW(xY),CY=zW(xY),wY=BW(xY),TY=HW(xY),EY=WW(xY),DY=GW(xY),OY=KW(xY),kY=qW(xY),AY=JW(xY),jY=YW(xY),MY=XW(xY),NY=ZW(xY),PY=q(`ZodType`,(e,t)=>(JG.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:CJ(e,`input`),output:CJ(e,`output`)}}),e.toJSONSchema=SJ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(sW(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>_W(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>SY(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>wY(e,t,n),e.parseAsync=async(t,n)=>CY(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>TY(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>EY(e,t,n),e.decode=(t,n)=>DY(e,t,n),e.encodeAsync=async(t,n)=>OY(e,t,n),e.decodeAsync=async(t,n)=>kY(e,t,n),e.safeEncode=(t,n)=>AY(e,t,n),e.safeDecode=(t,n)=>jY(e,t,n),e.safeEncodeAsync=async(t,n)=>MY(e,t,n),e.safeDecodeAsync=async(t,n)=>NY(e,t,n),e.refine=(t,n)=>e.check(nZ(t,n)),e.superRefine=t=>e.check(rZ(t)),e.overwrite=t=>e.check(oJ(t)),e.optional=()=>FX(e),e.exactOptional=()=>LX(e),e.nullable=()=>zX(e),e.nullish=()=>FX(zX(e)),e.nonoptional=t=>GX(e,t),e.array=()=>gX(e),e.or=t=>xX([e,t]),e.and=t=>TX(e,t),e.transform=t=>YX(e,NX(t)),e.default=t=>VX(e,t),e.prefault=t=>UX(e,t),e.catch=t=>qX(e,t),e.pipe=t=>YX(e,t),e.readonly=()=>ZX(e),e.describe=t=>{let n=e.clone();return fq.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return fq.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return fq.get(e);let n=e.clone();return fq.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),FY=q(`_ZodString`,(e,t)=>{YG.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TJ(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(eJ(...t)),e.includes=(...t)=>e.check(rJ(...t)),e.startsWith=(...t)=>e.check(iJ(...t)),e.endsWith=(...t)=>e.check(aJ(...t)),e.min=(...t)=>e.check(Qq(...t)),e.max=(...t)=>e.check(Zq(...t)),e.length=(...t)=>e.check($q(...t)),e.nonempty=(...t)=>e.check(Qq(1,...t)),e.lowercase=t=>e.check(tJ(t)),e.uppercase=t=>e.check(nJ(t)),e.trim=()=>e.check(cJ()),e.normalize=(...t)=>e.check(sJ(...t)),e.toLowerCase=()=>e.check(lJ()),e.toUpperCase=()=>e.check(uJ()),e.slugify=()=>e.check(dJ())}),IY=q(`ZodString`,(e,t)=>{YG.init(e,t),FY.init(e,t),e.email=t=>e.check(mq(RY,t)),e.url=t=>e.check(bq(VY,t)),e.jwt=t=>e.check(Fq(nX,t)),e.emoji=t=>e.check(xq(HY,t)),e.guid=t=>e.check(hq(zY,t)),e.uuid=t=>e.check(gq(BY,t)),e.uuidv4=t=>e.check(_q(BY,t)),e.uuidv6=t=>e.check(vq(BY,t)),e.uuidv7=t=>e.check(yq(BY,t)),e.nanoid=t=>e.check(Sq(UY,t)),e.guid=t=>e.check(hq(zY,t)),e.cuid=t=>e.check(Cq(WY,t)),e.cuid2=t=>e.check(wq(GY,t)),e.ulid=t=>e.check(Tq(KY,t)),e.base64=t=>e.check(Mq($Y,t)),e.base64url=t=>e.check(Nq(eX,t)),e.xid=t=>e.check(Eq(qY,t)),e.ksuid=t=>e.check(Dq(JY,t)),e.ipv4=t=>e.check(Oq(YY,t)),e.ipv6=t=>e.check(kq(XY,t)),e.cidrv4=t=>e.check(Aq(ZY,t)),e.cidrv6=t=>e.check(jq(QY,t)),e.e164=t=>e.check(Pq(tX,t)),e.datetime=t=>e.check(pY(t)),e.date=t=>e.check(hY(t)),e.time=t=>e.check(_Y(t)),e.duration=t=>e.check(yY(t))});function Y(e){return pq(IY,e)}var LY=q(`ZodStringFormat`,(e,t)=>{XG.init(e,t),FY.init(e,t)}),RY=q(`ZodEmail`,(e,t)=>{$G.init(e,t),LY.init(e,t)}),zY=q(`ZodGUID`,(e,t)=>{ZG.init(e,t),LY.init(e,t)}),BY=q(`ZodUUID`,(e,t)=>{QG.init(e,t),LY.init(e,t)}),VY=q(`ZodURL`,(e,t)=>{eK.init(e,t),LY.init(e,t)}),HY=q(`ZodEmoji`,(e,t)=>{tK.init(e,t),LY.init(e,t)}),UY=q(`ZodNanoID`,(e,t)=>{nK.init(e,t),LY.init(e,t)}),WY=q(`ZodCUID`,(e,t)=>{rK.init(e,t),LY.init(e,t)}),GY=q(`ZodCUID2`,(e,t)=>{iK.init(e,t),LY.init(e,t)}),KY=q(`ZodULID`,(e,t)=>{aK.init(e,t),LY.init(e,t)}),qY=q(`ZodXID`,(e,t)=>{oK.init(e,t),LY.init(e,t)}),JY=q(`ZodKSUID`,(e,t)=>{sK.init(e,t),LY.init(e,t)}),YY=q(`ZodIPv4`,(e,t)=>{fK.init(e,t),LY.init(e,t)}),XY=q(`ZodIPv6`,(e,t)=>{pK.init(e,t),LY.init(e,t)}),ZY=q(`ZodCIDRv4`,(e,t)=>{mK.init(e,t),LY.init(e,t)}),QY=q(`ZodCIDRv6`,(e,t)=>{hK.init(e,t),LY.init(e,t)}),$Y=q(`ZodBase64`,(e,t)=>{_K.init(e,t),LY.init(e,t)}),eX=q(`ZodBase64URL`,(e,t)=>{yK.init(e,t),LY.init(e,t)}),tX=q(`ZodE164`,(e,t)=>{bK.init(e,t),LY.init(e,t)}),nX=q(`ZodJWT`,(e,t)=>{SK.init(e,t),LY.init(e,t)}),rX=q(`ZodNumber`,(e,t)=>{CK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EJ(e,t,n,r),e.gt=(t,n)=>e.check(Jq(t,n)),e.gte=(t,n)=>e.check(Yq(t,n)),e.min=(t,n)=>e.check(Yq(t,n)),e.lt=(t,n)=>e.check(Kq(t,n)),e.lte=(t,n)=>e.check(qq(t,n)),e.max=(t,n)=>e.check(qq(t,n)),e.int=t=>e.check(oX(t)),e.safe=t=>e.check(oX(t)),e.positive=t=>e.check(Jq(0,t)),e.nonnegative=t=>e.check(Yq(0,t)),e.negative=t=>e.check(Kq(0,t)),e.nonpositive=t=>e.check(qq(0,t)),e.multipleOf=(t,n)=>e.check(Xq(t,n)),e.step=(t,n)=>e.check(Xq(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function iX(e){return Bq(rX,e)}var aX=q(`ZodNumberFormat`,(e,t)=>{wK.init(e,t),rX.init(e,t)});function oX(e){return Vq(aX,e)}var sX=q(`ZodBoolean`,(e,t)=>{TK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DJ(e,t,n,r)});function cX(e){return Hq(sX,e)}var lX=q(`ZodNull`,(e,t)=>{EK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AJ(e,t,n,r)});function uX(e){return Uq(lX,e)}var dX=q(`ZodUnknown`,(e,t)=>{DK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function fX(){return Wq(dX)}var pX=q(`ZodNever`,(e,t)=>{OK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NJ(e,t,n,r)});function mX(e){return Gq(pX,e)}var hX=q(`ZodArray`,(e,t)=>{AK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>JJ(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Qq(t,n)),e.nonempty=t=>e.check(Qq(1,t)),e.max=(t,n)=>e.check(Zq(t,n)),e.length=(t,n)=>e.check($q(t,n)),e.unwrap=()=>e.element});function gX(e,t){return fJ(hX,e,t)}var _X=q(`ZodObject`,(e,t)=>{FK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>YJ(e,t,n,r),aW(e,`shape`,()=>t.shape),e.keyof=()=>kX(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fX()}),e.loose=()=>e.clone({...e._zod.def,catchall:fX()}),e.strict=()=>e.clone({...e._zod.def,catchall:mX()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>SW(e,t),e.safeExtend=t=>CW(e,t),e.merge=t=>wW(e,t),e.pick=t=>bW(e,t),e.omit=t=>xW(e,t),e.partial=(...t)=>TW(PX,e,t[0]),e.required=(...t)=>EW(WX,e,t[0])});function vX(e,t){return new _X({type:`object`,shape:e??{},...J(t)})}function yX(e,t){return new _X({type:`object`,shape:e,catchall:mX(),...J(t)})}var bX=q(`ZodUnion`,(e,t)=>{LK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>XJ(e,t,n,r),e.options=t.options});function xX(e,t){return new bX({type:`union`,options:e,...J(t)})}var SX=q(`ZodDiscriminatedUnion`,(e,t)=>{bX.init(e,t),RK.init(e,t)});function CX(e,t,n){return new SX({type:`union`,options:t,discriminator:e,...J(n)})}var wX=q(`ZodIntersection`,(e,t)=>{zK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ZJ(e,t,n,r)});function TX(e,t){return new wX({type:`intersection`,left:e,right:t})}var EX=q(`ZodRecord`,(e,t)=>{HK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$J(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function DX(e,t,n){return new EX({type:`record`,keyType:e,valueType:t,...J(n)})}var OX=q(`ZodEnum`,(e,t)=>{UK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LJ(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new OX({...t,checks:[],...J(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new OX({...t,checks:[],...J(r),entries:i})}});function kX(e,t){return new OX({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...J(t)})}var AX=q(`ZodLiteral`,(e,t)=>{WK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RJ(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function jX(e,t){return new AX({type:`literal`,values:Array.isArray(e)?e:[e],...J(t)})}var MX=q(`ZodTransform`,(e,t)=>{GK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>GJ(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new YU(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(MW(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(MW(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function NX(e){return new MX({type:`transform`,transform:e})}var PX=q(`ZodOptional`,(e,t)=>{qK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function FX(e){return new PX({type:`optional`,innerType:e})}var IX=q(`ZodExactOptional`,(e,t)=>{JK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function LX(e){return new IX({type:`optional`,innerType:e})}var RX=q(`ZodNullable`,(e,t)=>{YK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zX(e){return new RX({type:`nullable`,innerType:e})}var BX=q(`ZodDefault`,(e,t)=>{XK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function VX(e,t){return new BX({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():mW(t)}})}var HX=q(`ZodPrefault`,(e,t)=>{QK.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function UX(e,t){return new HX({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():mW(t)}})}var WX=q(`ZodNonOptional`,(e,t)=>{$K.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function GX(e,t){return new WX({type:`nonoptional`,innerType:e,...J(t)})}var KX=q(`ZodCatch`,(e,t)=>{tq.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qX(e,t){return new KX({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var JX=q(`ZodPipe`,(e,t)=>{nq.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aY(e,t,n,r),e.in=t.in,e.out=t.out});function YX(e,t){return new JX({type:`pipe`,in:e,out:t})}var XX=q(`ZodReadonly`,(e,t)=>{iq.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oY(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ZX(e){return new XX({type:`readonly`,innerType:e})}var QX=q(`ZodLazy`,(e,t)=>{oq.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lY(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function $X(e){return new QX({type:`lazy`,getter:e})}var eZ=q(`ZodCustom`,(e,t)=>{sq.init(e,t),PY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>UJ(e,t,n,r)});function tZ(e,t){return pJ(eZ,e??(()=>!0),t)}function nZ(e,t={}){return mJ(eZ,e,t)}function rZ(e){return hJ(e)}function iZ(e,t={}){let n=new eZ({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...J(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var aZ;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(aZ||={});var oZ;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(oZ||={});var X=aZ.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),sZ=e=>{switch(typeof e){case`undefined`:return X.undefined;case`string`:return X.string;case`number`:return Number.isNaN(e)?X.nan:X.number;case`boolean`:return X.boolean;case`function`:return X.function;case`bigint`:return X.bigint;case`symbol`:return X.symbol;case`object`:return Array.isArray(e)?X.array:e===null?X.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?X.promise:typeof Map<`u`&&e instanceof Map?X.map:typeof Set<`u`&&e instanceof Set?X.set:typeof Date<`u`&&e instanceof Date?X.date:X.object;default:return X.unknown}},Z=aZ.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),cZ=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,aZ.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};cZ.create=e=>new cZ(e);var lZ=(e,t)=>{let n;switch(e.code){case Z.invalid_type:n=e.received===X.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,aZ.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${aZ.joinValues(e.keys,`, `)}`;break;case Z.invalid_union:n=`Invalid input`;break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${aZ.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${aZ.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n=`Invalid function arguments`;break;case Z.invalid_return_type:n=`Invalid function return type`;break;case Z.invalid_date:n=`Invalid date`;break;case Z.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:aZ.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case Z.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case Z.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case Z.custom:n=`Invalid input`;break;case Z.invalid_intersection_types:n=`Intersection results could not be merged`;break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,aZ.assertNever(e)}return{message:n}},uZ=lZ;function dZ(){return uZ}var fZ=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function Q(e,t){let n=dZ(),r=fZ({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===lZ?void 0:lZ].filter(e=>!!e)});e.common.issues.push(r)}var pZ=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return mZ;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return mZ;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},mZ=Object.freeze({status:`aborted`}),hZ=e=>({status:`dirty`,value:e}),gZ=e=>({status:`valid`,value:e}),_Z=e=>e.status===`aborted`,vZ=e=>e.status===`dirty`,yZ=e=>e.status===`valid`,bZ=e=>typeof Promise<`u`&&e instanceof Promise,xZ;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(xZ||={});var SZ=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},CZ=(e,t)=>{if(yZ(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new cZ(e.common.issues),this._error}}};function wZ(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var TZ=class{get description(){return this._def.description}_getType(e){return sZ(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:sZ(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pZ,ctx:{common:e.parent.common,data:e.data,parsedType:sZ(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(bZ(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sZ(e)};return CZ(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sZ(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return yZ(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>yZ(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:sZ(e)},r=this._parse({data:e,path:n.path,parent:n});return CZ(n,await(bZ(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:Z.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new OQ({schema:this,typeName:$.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return kQ.create(this,this._def)}nullable(){return AQ.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return lQ.create(this)}promise(){return DQ.create(this,this._def)}or(e){return fQ.create([this,e],this._def)}and(e){return gQ.create(this,e,this._def)}transform(e){return new OQ({...wZ(this._def),schema:this,typeName:$.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new jQ({...wZ(this._def),innerType:this,defaultValue:t,typeName:$.ZodDefault})}brand(){return new PQ({typeName:$.ZodBranded,type:this,...wZ(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new MQ({...wZ(this._def),innerType:this,catchValue:t,typeName:$.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return FQ.create(this,e)}readonly(){return IQ.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},EZ=/^c[^\s-]{8,}$/i,DZ=/^[0-9a-z]+$/,OZ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kZ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AZ=/^[a-z0-9_-]{21}$/i,jZ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,MZ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,NZ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PZ=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,FZ,IZ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,LZ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,RZ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,zZ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,BZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VZ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,HZ=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,UZ=RegExp(`^${HZ}$`);function WZ(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function GZ(e){return RegExp(`^${WZ(e)}$`)}function KZ(e){let t=`${HZ}T${WZ(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function qZ(e,t){return!!((t===`v4`||!t)&&IZ.test(e)||(t===`v6`||!t)&&RZ.test(e))}function JZ(e,t){if(!jZ.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function YZ(e,t){return!!((t===`v4`||!t)&&LZ.test(e)||(t===`v6`||!t)&&zZ.test(e))}var XZ=class e extends TZ{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==X.string){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.string,received:t.parsedType}),mZ}let t=new pZ,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?Q(n,{code:Z.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&Q(n,{code:Z.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)NZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`email`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)FZ||=new RegExp(PZ,`u`),FZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`emoji`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)kZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`uuid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)AZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`nanoid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)EZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`cuid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)DZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`cuid2`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)OZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`ulid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),Q(n,{validation:`url`,code:Z.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`regex`,code:Z.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?KZ(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?UZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?GZ(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?MZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`duration`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?qZ(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`ip`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?JZ(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`jwt`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?YZ(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`cidr`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?BZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`base64`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?VZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`base64url`,code:Z.invalid_string,message:r.message}),t.dirty()):aZ.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:Z.invalid_string,...xZ.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...xZ.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...xZ.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...xZ.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...xZ.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...xZ.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...xZ.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...xZ.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...xZ.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...xZ.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...xZ.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...xZ.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...xZ.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...xZ.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...xZ.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...xZ.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...xZ.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...xZ.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...xZ.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...xZ.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...xZ.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...xZ.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...xZ.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...xZ.errToObj(t)})}nonempty(e){return this.min(1,xZ.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};XZ.create=e=>new XZ({checks:[],typeName:$.ZodString,coerce:e?.coerce??!1,...wZ(e)});function ZZ(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var QZ=class e extends TZ{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==X.number){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.number,received:t.parsedType}),mZ}let t,n=new pZ;for(let r of this._def.checks)r.kind===`int`?aZ.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?ZZ(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_finite,message:r.message}),n.dirty()):aZ.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,xZ.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,xZ.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,xZ.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,xZ.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:xZ.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:xZ.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:xZ.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:xZ.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:xZ.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:xZ.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:xZ.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:xZ.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:xZ.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:xZ.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&aZ.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};QZ.create=e=>new QZ({checks:[],typeName:$.ZodNumber,coerce:e?.coerce||!1,...wZ(e)});var $Z=class e extends TZ{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==X.bigint)return this._getInvalidInput(e);let t,n=new pZ;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):aZ.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.bigint,received:t.parsedType}),mZ}gte(e,t){return this.setLimit(`min`,e,!0,xZ.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,xZ.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,xZ.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,xZ.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:xZ.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:xZ.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:xZ.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:xZ.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:xZ.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:xZ.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};$Z.create=e=>new $Z({checks:[],typeName:$.ZodBigInt,coerce:e?.coerce??!1,...wZ(e)});var eQ=class extends TZ{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==X.boolean){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.boolean,received:t.parsedType}),mZ}return gZ(e.data)}};eQ.create=e=>new eQ({typeName:$.ZodBoolean,coerce:e?.coerce||!1,...wZ(e)});var tQ=class e extends TZ{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==X.date){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.date,received:t.parsedType}),mZ}if(Number.isNaN(e.data.getTime()))return Q(this._getOrReturnCtx(e),{code:Z.invalid_date}),mZ;let t=new pZ,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):aZ.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:xZ.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:xZ.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};tQ.create=e=>new tQ({checks:[],coerce:e?.coerce||!1,typeName:$.ZodDate,...wZ(e)});var nQ=class extends TZ{_parse(e){if(this._getType(e)!==X.symbol){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.symbol,received:t.parsedType}),mZ}return gZ(e.data)}};nQ.create=e=>new nQ({typeName:$.ZodSymbol,...wZ(e)});var rQ=class extends TZ{_parse(e){if(this._getType(e)!==X.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.undefined,received:t.parsedType}),mZ}return gZ(e.data)}};rQ.create=e=>new rQ({typeName:$.ZodUndefined,...wZ(e)});var iQ=class extends TZ{_parse(e){if(this._getType(e)!==X.null){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.null,received:t.parsedType}),mZ}return gZ(e.data)}};iQ.create=e=>new iQ({typeName:$.ZodNull,...wZ(e)});var aQ=class extends TZ{constructor(){super(...arguments),this._any=!0}_parse(e){return gZ(e.data)}};aQ.create=e=>new aQ({typeName:$.ZodAny,...wZ(e)});var oQ=class extends TZ{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gZ(e.data)}};oQ.create=e=>new oQ({typeName:$.ZodUnknown,...wZ(e)});var sQ=class extends TZ{_parse(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.never,received:t.parsedType}),mZ}};sQ.create=e=>new sQ({typeName:$.ZodNever,...wZ(e)});var cQ=class extends TZ{_parse(e){if(this._getType(e)!==X.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.void,received:t.parsedType}),mZ}return gZ(e.data)}};cQ.create=e=>new cQ({typeName:$.ZodVoid,...wZ(e)});var lQ=class e extends TZ{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==X.array)return Q(t,{code:Z.invalid_type,expected:X.array,received:t.parsedType}),mZ;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Q(t,{code:e?Z.too_big:Z.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(Q(t,{code:Z.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(Q(t,{code:Z.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new SZ(t,e,t.path,n)))).then(e=>pZ.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new SZ(t,e,t.path,n)));return pZ.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:xZ.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:xZ.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:xZ.toString(n)}})}nonempty(e){return this.min(1,e)}};lQ.create=(e,t)=>new lQ({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray,...wZ(t)});function uQ(e){if(e instanceof dQ){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=kQ.create(uQ(r))}return new dQ({...e._def,shape:()=>t})}else if(e instanceof lQ)return new lQ({...e._def,type:uQ(e.element)});else if(e instanceof kQ)return kQ.create(uQ(e.unwrap()));else if(e instanceof AQ)return AQ.create(uQ(e.unwrap()));else if(e instanceof _Q)return _Q.create(e.items.map(e=>uQ(e)));else return e}var dQ=class e extends TZ{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:aZ.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==X.object){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.object,received:t.parsedType}),mZ}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof sQ&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new SZ(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof sQ){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(Q(n,{code:Z.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new SZ(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>pZ.mergeObjectSync(t,e)):pZ.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return xZ.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:xZ.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of aZ.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of aZ.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return uQ(this)}partial(t){let n={};for(let e of aZ.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of aZ.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof kQ;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return wQ(aZ.objectKeys(this.shape))}};dQ.create=(e,t)=>new dQ({shape:()=>e,unknownKeys:`strip`,catchall:sQ.create(),typeName:$.ZodObject,...wZ(t)}),dQ.strictCreate=(e,t)=>new dQ({shape:()=>e,unknownKeys:`strict`,catchall:sQ.create(),typeName:$.ZodObject,...wZ(t)}),dQ.lazycreate=(e,t)=>new dQ({shape:e,unknownKeys:`strip`,catchall:sQ.create(),typeName:$.ZodObject,...wZ(t)});var fQ=class extends TZ{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new cZ(e.ctx.common.issues));return Q(t,{code:Z.invalid_union,unionErrors:n}),mZ}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new cZ(e));return Q(t,{code:Z.invalid_union,unionErrors:i}),mZ}}get options(){return this._def.options}};fQ.create=(e,t)=>new fQ({options:e,typeName:$.ZodUnion,...wZ(t)});var pQ=e=>e instanceof SQ?pQ(e.schema):e instanceof OQ?pQ(e.innerType()):e instanceof CQ?[e.value]:e instanceof TQ?e.options:e instanceof EQ?aZ.objectValues(e.enum):e instanceof jQ?pQ(e._def.innerType):e instanceof rQ?[void 0]:e instanceof iQ?[null]:e instanceof kQ?[void 0,...pQ(e.unwrap())]:e instanceof AQ?[null,...pQ(e.unwrap())]:e instanceof PQ||e instanceof IQ?pQ(e.unwrap()):e instanceof MQ?pQ(e._def.innerType):[],mQ=class e extends TZ{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==X.object)return Q(t,{code:Z.invalid_type,expected:X.object,received:t.parsedType}),mZ;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Q(t,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),mZ)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=pQ(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:$.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...wZ(r)})}};function hQ(e,t){let n=sZ(e),r=sZ(t);if(e===t)return{valid:!0,data:e};if(n===X.object&&r===X.object){let n=aZ.objectKeys(t),r=aZ.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=hQ(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===X.array&&r===X.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=hQ(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===X.date&&r===X.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var gQ=class extends TZ{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(_Z(e)||_Z(r))return mZ;let i=hQ(e.value,r.value);return i.valid?((vZ(e)||vZ(r))&&t.dirty(),{status:t.value,value:i.data}):(Q(n,{code:Z.invalid_intersection_types}),mZ)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};gQ.create=(e,t,n)=>new gQ({left:e,right:t,typeName:$.ZodIntersection,...wZ(n)});var _Q=class e extends TZ{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.array)return Q(n,{code:Z.invalid_type,expected:X.array,received:n.parsedType}),mZ;if(n.data.length<this._def.items.length)return Q(n,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),mZ;!this._def.rest&&n.data.length>this._def.items.length&&(Q(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new SZ(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>pZ.mergeArray(t,e)):pZ.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};_Q.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new _Q({items:e,typeName:$.ZodTuple,rest:null,...wZ(t)})};var vQ=class e extends TZ{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.object)return Q(n,{code:Z.invalid_type,expected:X.object,received:n.parsedType}),mZ;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new SZ(n,e,n.path,e)),value:a._parse(new SZ(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?pZ.mergeObjectAsync(t,r):pZ.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof TZ?new e({keyType:t,valueType:n,typeName:$.ZodRecord,...wZ(r)}):new e({keyType:XZ.create(),valueType:t,typeName:$.ZodRecord,...wZ(n)})}},yQ=class extends TZ{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.map)return Q(n,{code:Z.invalid_type,expected:X.map,received:n.parsedType}),mZ;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new SZ(n,e,n.path,[a,`key`])),value:i._parse(new SZ(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return mZ;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return mZ;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};yQ.create=(e,t,n)=>new yQ({valueType:t,keyType:e,typeName:$.ZodMap,...wZ(n)});var bQ=class e extends TZ{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==X.set)return Q(n,{code:Z.invalid_type,expected:X.set,received:n.parsedType}),mZ;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(Q(n,{code:Z.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(Q(n,{code:Z.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return mZ;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new SZ(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:xZ.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:xZ.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};bQ.create=(e,t)=>new bQ({valueType:e,minSize:null,maxSize:null,typeName:$.ZodSet,...wZ(t)});var xQ=class e extends TZ{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==X.function)return Q(t,{code:Z.invalid_type,expected:X.function,received:t.parsedType}),mZ;function n(e,n){return fZ({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,dZ(),lZ].filter(e=>!!e),issueData:{code:Z.invalid_arguments,argumentsError:n}})}function r(e,n){return fZ({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,dZ(),lZ].filter(e=>!!e),issueData:{code:Z.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof DQ){let e=this;return gZ(async function(...t){let o=new cZ([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return gZ(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new cZ([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new cZ([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:_Q.create(t).rest(oQ.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||_Q.create([]).rest(oQ.create()),returns:n||oQ.create(),typeName:$.ZodFunction,...wZ(r)})}},SQ=class extends TZ{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};SQ.create=(e,t)=>new SQ({getter:e,typeName:$.ZodLazy,...wZ(t)});var CQ=class extends TZ{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Q(t,{received:t.data,code:Z.invalid_literal,expected:this._def.value}),mZ}return{status:`valid`,value:e.data}}get value(){return this._def.value}};CQ.create=(e,t)=>new CQ({value:e,typeName:$.ZodLiteral,...wZ(t)});function wQ(e,t){return new TQ({values:e,typeName:$.ZodEnum,...wZ(t)})}var TQ=class e extends TZ{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{expected:aZ.joinValues(n),received:t.parsedType,code:Z.invalid_type}),mZ}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{received:t.data,code:Z.invalid_enum_value,options:n}),mZ}return gZ(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};TQ.create=wQ;var EQ=class extends TZ{_parse(e){let t=aZ.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==X.string&&n.parsedType!==X.number){let e=aZ.objectValues(t);return Q(n,{expected:aZ.joinValues(e),received:n.parsedType,code:Z.invalid_type}),mZ}if(this._cache||=new Set(aZ.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=aZ.objectValues(t);return Q(n,{received:n.data,code:Z.invalid_enum_value,options:e}),mZ}return gZ(e.data)}get enum(){return this._def.values}};EQ.create=(e,t)=>new EQ({values:e,typeName:$.ZodNativeEnum,...wZ(t)});var DQ=class extends TZ{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==X.promise&&t.common.async===!1?(Q(t,{code:Z.invalid_type,expected:X.promise,received:t.parsedType}),mZ):gZ((t.parsedType===X.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};DQ.create=(e,t)=>new DQ({type:e,typeName:$.ZodPromise,...wZ(t)});var OQ=class extends TZ{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{Q(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return mZ;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?mZ:r.status===`dirty`||t.value===`dirty`?hZ(r.value):r});{if(t.value===`aborted`)return mZ;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?mZ:r.status===`dirty`||t.value===`dirty`?hZ(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?mZ:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?mZ:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!yZ(e))return mZ;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>yZ(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):mZ);aZ.assertNever(r)}};OQ.create=(e,t,n)=>new OQ({schema:e,typeName:$.ZodEffects,effect:t,...wZ(n)}),OQ.createWithPreprocess=(e,t,n)=>new OQ({schema:t,effect:{type:`preprocess`,transform:e},typeName:$.ZodEffects,...wZ(n)});var kQ=class extends TZ{_parse(e){return this._getType(e)===X.undefined?gZ(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};kQ.create=(e,t)=>new kQ({innerType:e,typeName:$.ZodOptional,...wZ(t)});var AQ=class extends TZ{_parse(e){return this._getType(e)===X.null?gZ(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};AQ.create=(e,t)=>new AQ({innerType:e,typeName:$.ZodNullable,...wZ(t)});var jQ=class extends TZ{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===X.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};jQ.create=(e,t)=>new jQ({innerType:e,typeName:$.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...wZ(t)});var MQ=class extends TZ{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return bZ(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new cZ(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new cZ(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};MQ.create=(e,t)=>new MQ({innerType:e,typeName:$.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...wZ(t)});var NQ=class extends TZ{_parse(e){if(this._getType(e)!==X.nan){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:X.nan,received:t.parsedType}),mZ}return{status:`valid`,value:e.data}}};NQ.create=e=>new NQ({typeName:$.ZodNaN,...wZ(e)});var PQ=class extends TZ{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},FQ=class e extends TZ{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?mZ:e.status===`dirty`?(t.dirty(),hZ(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?mZ:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:$.ZodPipeline})}},IQ=class extends TZ{_parse(e){let t=this._def.innerType._parse(e),n=e=>(yZ(e)&&(e.value=Object.freeze(e.value)),e);return bZ(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};IQ.create=(e,t)=>new IQ({innerType:e,typeName:$.ZodReadonly,...wZ(t)}),dQ.lazycreate;var $;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})($||={}),XZ.create,QZ.create,NQ.create,$Z.create,eQ.create,tQ.create,nQ.create,rQ.create,iQ.create,aQ.create,oQ.create,sQ.create,cQ.create,lQ.create,dQ.create,dQ.strictCreate,fQ.create,mQ.create,gQ.create,_Q.create,vQ.create,yQ.create,bQ.create,xQ.create,SQ.create,CQ.create,TQ.create,EQ.create,DQ.create,OQ.create,kQ.create,AQ.create,OQ.createWithPreprocess,FQ.create;var LQ=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}};function RQ(e){}function zQ(e){if(typeof e==`function`)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=RQ,onError:n=RQ,onRetry:r=RQ,onComment:i}=e,a=``,o=!0,s,c=``,l=``;function u(e){let t=o?e.replace(/^\xEF\xBB\xBF/,``):e,[n,r]=BQ(`${a}${t}`);for(let e of n)d(e);a=r,o=!1}function d(e){if(e===``){p();return}if(e.startsWith(`:`)){i&&i(e.slice(e.startsWith(`: `)?2:1));return}let t=e.indexOf(`:`);if(t!==-1){let n=e.slice(0,t),r=e[t+1]===` `?2:1;f(n,e.slice(t+r),e);return}f(e,``,e)}function f(e,t,i){switch(e){case`event`:l=t;break;case`data`:c=`${c}${t}
220
+ `;break;case`id`:s=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new LQ(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new LQ(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}));break}}function p(){c.length>0&&t({id:s,event:l||void 0,data:c.endsWith(`
221
+ `)?c.slice(0,-1):c}),s=void 0,c=``,l=``}function m(e={}){a&&e.consume&&d(a),o=!0,s=void 0,c=``,l=``,a=``}return{feed:u,reset:m}}function BQ(e){let t=[],n=``,r=0;for(;r<e.length;){let i=e.indexOf(`\r`,r),a=e.indexOf(`
222
+ `,r),o=-1;if(i!==-1&&a!==-1?o=Math.min(i,a):i===-1?a!==-1&&(o=a):o=i===e.length-1?-1:i,o===-1){n=e.slice(r);break}else{let n=e.slice(r,o);t.push(n),r=o+1,e[r-1]===`\r`&&e[r]===`
223
+ `&&r++}}return[t,n]}var VQ=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n}={}){let r;super({start(i){r=zQ({onEvent:e=>{i.enqueue(e)},onError(t){e===`terminate`?i.error(t):typeof e==`function`&&e(t)},onRetry:t,onComment:n})},transform(e){r.feed(e)}})}},{btoa:HQ,atob:UQ}=globalThis,WQ=({prefix:e,size:t=16,alphabet:n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,separator:r=`-`}={})=>{let i=()=>{let e=n.length,r=Array(t);for(let i=0;i<t;i++)r[i]=n[Math.random()*e|0];return r.join(``)};if(e==null)return i;if(n.includes(r))throw new FU({argument:`separator`,message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},GQ=WQ();function KQ(e){if(e==null)return{};let t={};if(e instanceof Headers)e.forEach((e,n)=>{t[n.toLowerCase()]=e});else{Array.isArray(e)||(e=Object.entries(e));for(let[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}var qQ=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,JQ=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function YQ(e){let t=JSON.parse(e);return typeof t!=`object`||!t||qQ.test(e)===!1&&JQ.test(e)===!1?t:XQ(t)}function XQ(e){let t=[e];for(;t.length;){let e=t;t=[];for(let n of e){if(Object.prototype.hasOwnProperty.call(n,`__proto__`)||Object.prototype.hasOwnProperty.call(n,`constructor`)&&n.constructor!==null&&typeof n.constructor==`object`&&Object.prototype.hasOwnProperty.call(n.constructor,`prototype`))throw SyntaxError(`Object contains forbidden prototype property`);for(let e in n){let r=n[e];r&&typeof r==`object`&&t.push(r)}}}return e}function ZQ(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return YQ(e)}try{return YQ(e)}finally{Error.stackTraceLimit=t}}function QQ(e){if(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)){e.additionalProperties=!1;let{properties:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=$Q(t[e])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map($Q):$Q(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map($Q)),e.allOf!=null&&(e.allOf=e.allOf.map($Q)),e.oneOf!=null&&(e.oneOf=e.oneOf.map($Q));let{definitions:t}=e;if(t!=null)for(let e of Object.keys(t))t[e]=$Q(t[e]);return e}function $Q(e){return typeof e==`boolean`?e:QQ(e)}var e$=Symbol(`Let zodToJsonSchema decide on which parser to use`),t$={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`},n$=e=>typeof e==`string`?{...t$,name:e}:{...t$,...e};function r$(){return{}}function i$(e,t){let n={type:`array`};return e.type?._def&&e.type?._def?.typeName!==$.ZodAny&&(n.items=Y$(e.type._def,{...t,currentPath:[...t.currentPath,`items`]})),e.minLength&&(n.minItems=e.minLength.value),e.maxLength&&(n.maxItems=e.maxLength.value),e.exactLength&&(n.minItems=e.exactLength.value,n.maxItems=e.exactLength.value),n}function a$(e){let t={type:`integer`,format:`int64`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value;break}return t}function o$(){return{type:`boolean`}}function s$(e,t){return Y$(e.type._def,t)}var c$=(e,t)=>Y$(e.innerType._def,t);function l$(e,t,n){let r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((n,r)=>l$(e,t,n))};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return u$(e)}}var u$=e=>{let t={type:`integer`,format:`unix-time`};for(let n of e.checks)switch(n.kind){case`min`:t.minimum=n.value;break;case`max`:t.maximum=n.value;break}return t};function d$(e,t){return{...Y$(e.innerType._def,t),default:e.defaultValue()}}function f$(e,t){return t.effectStrategy===`input`?Y$(e.schema._def,t):r$()}function p$(e){return{type:`string`,enum:Array.from(e.values)}}var m$=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function h$(e,t){let n=[Y$(e.left._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]}),Y$(e.right._def,{...t,currentPath:[...t.currentPath,`allOf`,`1`]})].filter(e=>!!e),r=[];return n.forEach(e=>{if(m$(e))r.push(...e.allOf);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}r.push(t)}}),r.length?{allOf:r}:void 0}function g$(e){let t=typeof e.value;return t!==`bigint`&&t!==`number`&&t!==`boolean`&&t!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:{type:t===`bigint`?`integer`:t,const:e.value}}var _$=void 0,v$={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(_$===void 0&&(_$=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),_$),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function y$(e,t){let n={type:`string`};if(e.checks)for(let r of e.checks)switch(r.kind){case`min`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value;break;case`max`:n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`email`:switch(t.emailStrategy){case`format:email`:C$(n,`email`,r.message,t);break;case`format:idn-email`:C$(n,`idn-email`,r.message,t);break;case`pattern:zod`:w$(n,v$.email,r.message,t);break}break;case`url`:C$(n,`uri`,r.message,t);break;case`uuid`:C$(n,`uuid`,r.message,t);break;case`regex`:w$(n,r.regex,r.message,t);break;case`cuid`:w$(n,v$.cuid,r.message,t);break;case`cuid2`:w$(n,v$.cuid2,r.message,t);break;case`startsWith`:w$(n,RegExp(`^${b$(r.value,t)}`),r.message,t);break;case`endsWith`:w$(n,RegExp(`${b$(r.value,t)}$`),r.message,t);break;case`datetime`:C$(n,`date-time`,r.message,t);break;case`date`:C$(n,`date`,r.message,t);break;case`time`:C$(n,`time`,r.message,t);break;case`duration`:C$(n,`duration`,r.message,t);break;case`length`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,r.value):r.value;break;case`includes`:w$(n,RegExp(b$(r.value,t)),r.message,t);break;case`ip`:r.version!==`v6`&&C$(n,`ipv4`,r.message,t),r.version!==`v4`&&C$(n,`ipv6`,r.message,t);break;case`base64url`:w$(n,v$.base64url,r.message,t);break;case`jwt`:w$(n,v$.jwt,r.message,t);break;case`cidr`:r.version!==`v6`&&w$(n,v$.ipv4Cidr,r.message,t),r.version!==`v4`&&w$(n,v$.ipv6Cidr,r.message,t);break;case`emoji`:w$(n,v$.emoji(),r.message,t);break;case`ulid`:w$(n,v$.ulid,r.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:C$(n,`binary`,r.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:w$(n,v$.base64,r.message,t);break}break;case`nanoid`:w$(n,v$.nanoid,r.message,t);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:}return n}function b$(e,t){return t.patternStrategy===`escape`?S$(e):e}var x$=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function S$(e){let t=``;for(let n=0;n<e.length;n++)x$.has(e[n])||(t+=`\\`),t+=e[n];return t}function C$(e,t,n,r){e.format||e.anyOf?.some(e=>e.format)?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function w$(e,t,n,r){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:T$(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=T$(t,r)}function T$(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e<r.length;e++){if(a){i+=r[e],a=!1;continue}if(n.i){if(o){if(r[e].match(/[a-z]/)){s?(i+=r[e],i+=`${r[e-2]}-${r[e]}`.toUpperCase(),s=!1):r[e+1]===`-`&&r[e+2]?.match(/[a-z]/)?(i+=r[e],s=!0):i+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){i+=`[${r[e]}${r[e].toUpperCase()}]`;continue}}if(n.m){if(r[e]===`^`){i+=`(^|(?<=[\r
224
+ ]))`;continue}else if(r[e]===`$`){i+=`($|(?=[\r
225
+ ]))`;continue}}if(n.s&&r[e]===`.`){i+=o?`${r[e]}\r
226
+ `:`[${r[e]}\r
227
+ ]`;continue}i+=r[e],r[e]===`\\`?a=!0:o&&r[e]===`]`?o=!1:!o&&r[e]===`[`&&(o=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join(`/`)} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function E$(e,t){let n={type:`object`,additionalProperties:Y$(e.valueType._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]})??t.allowedAdditionalProperties};if(e.keyType?._def.typeName===$.ZodString&&e.keyType._def.checks?.length){let{type:r,...i}=y$(e.keyType._def,t);return{...n,propertyNames:i}}else if(e.keyType?._def.typeName===$.ZodEnum)return{...n,propertyNames:{enum:e.keyType._def.values}};else if(e.keyType?._def.typeName===$.ZodBranded&&e.keyType._def.type._def.typeName===$.ZodString&&e.keyType._def.type._def.checks?.length){let{type:r,...i}=s$(e.keyType._def,t);return{...n,propertyNames:i}}return n}function D$(e,t){return t.mapStrategy===`record`?E$(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[Y$(e.keyType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`0`]})||r$(),Y$(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`,`items`,`1`]})||r$()],minItems:2,maxItems:2}}}function O$(e){let t=e.values,n=Object.keys(e.values).filter(e=>typeof t[t[e]]!=`number`).map(e=>t[e]),r=Array.from(new Set(n.map(e=>typeof e)));return{type:r.length===1?r[0]===`string`?`string`:`number`:[`string`,`number`],enum:n}}function k$(){return{not:r$()}}function A$(){return{type:`null`}}var j$={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function M$(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(e=>e._def.typeName in j$&&(!e._def.checks||!e._def.checks.length))){let e=n.reduce((e,t)=>{let n=j$[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}else if(n.every(e=>e._def.typeName===`ZodLiteral`&&!e.description)){let e=n.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case`string`:case`number`:case`boolean`:return[...e,n];case`bigint`:return[...e,`integer`];case`object`:if(t._def.value===null)return[...e,`null`];default:return e}},[]);if(e.length===n.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:n.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(n.every(e=>e._def.typeName===`ZodEnum`))return{type:`string`,enum:n.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return N$(e,t)}var N$=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,n)=>Y$(e._def,{...t,currentPath:[...t.currentPath,`anyOf`,`${n}`]})).filter(e=>!!e&&(!t.strictUnions||typeof e==`object`&&Object.keys(e).length>0));return n.length?{anyOf:n}:void 0};function P$(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[j$[e.innerType._def.typeName],`null`]};let n=Y$(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`0`]});return n&&{anyOf:[n,{type:`null`}]}}function F$(e){let t={type:`number`};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case`int`:t.type=`integer`;break;case`min`:n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case`max`:n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case`multipleOf`:t.multipleOf=n.value;break}return t}function I$(e,t){let n={type:`object`,properties:{}},r=[],i=e.shape();for(let e in i){let a=i[e];if(a===void 0||a._def===void 0)continue;let o=R$(a),s=Y$(a._def,{...t,currentPath:[...t.currentPath,`properties`,e],propertyPath:[...t.currentPath,`properties`,e]});s!==void 0&&(n.properties[e]=s,o||r.push(e))}r.length&&(n.required=r);let a=L$(e,t);return a!==void 0&&(n.additionalProperties=a),n}function L$(e,t){if(e.catchall._def.typeName!==`ZodNever`)return Y$(e.catchall._def,{...t,currentPath:[...t.currentPath,`additionalProperties`]});switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function R$(e){try{return e.isOptional()}catch{return!0}}var z$=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return Y$(e.innerType._def,t);let n=Y$(e.innerType._def,{...t,currentPath:[...t.currentPath,`anyOf`,`1`]});return n?{anyOf:[{not:r$()},n]}:r$()},B$=(e,t)=>{if(t.pipeStrategy===`input`)return Y$(e.in._def,t);if(t.pipeStrategy===`output`)return Y$(e.out._def,t);let n=Y$(e.in._def,{...t,currentPath:[...t.currentPath,`allOf`,`0`]});return{allOf:[n,Y$(e.out._def,{...t,currentPath:[...t.currentPath,`allOf`,n?`1`:`0`]})].filter(e=>e!==void 0)}};function V$(e,t){return Y$(e.type._def,t)}function H$(e,t){let n={type:`array`,uniqueItems:!0,items:Y$(e.valueType._def,{...t,currentPath:[...t.currentPath,`items`]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function U$(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map((e,n)=>Y$(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:Y$(e.rest._def,{...t,currentPath:[...t.currentPath,`additionalItems`]})}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,n)=>Y$(e._def,{...t,currentPath:[...t.currentPath,`items`,`${n}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[])}}function W$(){return{not:r$()}}function G$(){return r$()}var K$=(e,t)=>Y$(e.innerType._def,t),q$=(e,t,n)=>{switch(t){case $.ZodString:return y$(e,n);case $.ZodNumber:return F$(e);case $.ZodObject:return I$(e,n);case $.ZodBigInt:return a$(e);case $.ZodBoolean:return o$();case $.ZodDate:return l$(e,n);case $.ZodUndefined:return W$();case $.ZodNull:return A$();case $.ZodArray:return i$(e,n);case $.ZodUnion:case $.ZodDiscriminatedUnion:return M$(e,n);case $.ZodIntersection:return h$(e,n);case $.ZodTuple:return U$(e,n);case $.ZodRecord:return E$(e,n);case $.ZodLiteral:return g$(e);case $.ZodEnum:return p$(e);case $.ZodNativeEnum:return O$(e);case $.ZodNullable:return P$(e,n);case $.ZodOptional:return z$(e,n);case $.ZodMap:return D$(e,n);case $.ZodSet:return H$(e,n);case $.ZodLazy:return()=>e.getter()._def;case $.ZodPromise:return V$(e,n);case $.ZodNaN:case $.ZodNever:return k$();case $.ZodEffects:return f$(e,n);case $.ZodAny:return r$();case $.ZodUnknown:return G$();case $.ZodDefault:return d$(e,n);case $.ZodBranded:return s$(e,n);case $.ZodReadonly:return K$(e,n);case $.ZodCatch:return c$(e,n);case $.ZodPipeline:return B$(e,n);case $.ZodFunction:case $.ZodVoid:case $.ZodSymbol:return;default:return(e=>void 0)(t)}},J$=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join(`/`)};function Y$(e,t,n=!1){let r=t.seen.get(e);if(t.override){let i=t.override?.call(t,e,t,r,n);if(i!==e$)return i}if(r&&!n){let e=X$(r,t);if(e!==void 0)return e}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=q$(e,e.typeName,t),o=typeof a==`function`?Y$(a(),t):a;if(o&&Z$(e,t,o),t.postProcess){let n=t.postProcess(o,e,t);return i.jsonSchema=o,n}return i.jsonSchema=o,o}var X$=(e,t)=>{switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:J$(t.currentPath,e.path)};case`none`:case`seen`:return e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e)?(console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`),r$()):t.$refStrategy===`seen`?r$():void 0}},Z$=(e,t,n)=>(e.description&&(n.description=e.description),n),Q$=e=>{let t=n$(e),n=t.name===void 0?t.basePath:[...t.basePath,t.definitionPath,t.name];return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,n])=>[n._def,{def:n._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}},$$=(e,t)=>{let n=Q$(t),r=typeof t==`object`&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>({...e,[t]:Y$(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0)??r$()}),{}):void 0,i=typeof t==`string`?t:t?.nameStrategy===`title`?void 0:t?.name,a=Y$(e._def,i===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,i]},!1)??r$(),o=typeof t==`object`&&t.name!==void 0&&t.nameStrategy===`title`?t.name:void 0;o!==void 0&&(a.title=o);let s=i===void 0?r?{...a,[n.definitionPath]:r}:a:{$ref:[...n.$refStrategy===`relative`?[]:n.basePath,n.definitionPath,i].join(`/`),[n.definitionPath]:{...r,[i]:a}};return s.$schema=`http://json-schema.org/draft-07/schema#`,s},e1=Symbol.for(`vercel.ai.schema`);function t1(e){let t;return()=>(t??=e(),t)}function n1(e,{validate:t}={}){return{[e1]:!0,_type:void 0,get jsonSchema(){return typeof e==`function`&&(e=e()),e},validate:t}}function r1(e){return typeof e==`object`&&!!e&&e1 in e&&e[e1]===!0&&`jsonSchema`in e&&`validate`in e}function i1(e){return e==null?n1({properties:{},additionalProperties:!1}):r1(e)?e:`~standard`in e?e[`~standard`].vendor===`zod`?l1(e):a1(e):e()}function a1(e){return n1(()=>QQ(e[`~standard`].jsonSchema.input({target:`draft-07`})),{validate:async t=>{let n=await e[`~standard`].validate(t);return`value`in n?{success:!0,value:n.value}:{success:!1,error:new qU({value:t,cause:n.issues})}}})}function o1(e,t){let n=t?.useReferences??!1;return n1(()=>$$(e,{$refStrategy:n?`root`:`none`}),{validate:async t=>{let n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function s1(e,t){let n=t?.useReferences??!1;return n1(()=>QQ(dY(e,{target:`draft-7`,io:`input`,reused:n?`ref`:`inline`})),{validate:async t=>{let n=await TY(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}function c1(e){return`_zod`in e}function l1(e,t){return c1(e)?s1(e,t):o1(e,t)}async function u1({value:e,schema:t,context:n}){let r=await d1({value:e,schema:t,context:n});if(!r.success)throw qU.wrap({value:e,cause:r.error,context:n});return r.value}async function d1({value:e,schema:t,context:n}){let r=i1(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};let t=await r.validate(e);return t.success?{success:!0,value:t.value,rawValue:e}:{success:!1,error:qU.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:qU.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function f1({text:e,schema:t}){try{let n=ZQ(e);return t==null?{success:!0,value:n,rawValue:n}:await d1({value:n,schema:t})}catch(t){return{success:!1,error:VU.isInstance(t)?t:new VU({text:e,cause:t}),rawValue:void 0}}}function p1({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new VQ).pipeThrough(new TransformStream({async transform({data:e},n){e!==`[DONE]`&&n.enqueue(await f1({text:e,schema:t}))}}))}async function m1(e){return typeof e==`function`&&(e=e()),Promise.resolve(e)}var h1=Object.defineProperty,g1=(e,t)=>{for(var n in t)h1(e,n,{get:t[n],enumerable:!0})},_1=`AI_NoObjectGeneratedError`,v1=`vercel.ai.error.${_1}`,y1=Symbol.for(v1),b1,x1=class extends OU{constructor({message:e=`No object generated.`,cause:t,text:n,response:r,usage:i,finishReason:a}){super({name:_1,message:e,cause:t}),this[b1]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(e){return OU.hasMarker(e,v1)}};b1=y1;var S1=`AI_UIMessageStreamError`,C1=`vercel.ai.error.${S1}`,w1=Symbol.for(C1),T1,E1=class extends OU{constructor({chunkType:e,chunkId:t,message:n}){super({name:S1,message:n}),this[T1]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return OU.hasMarker(e,C1)}};T1=w1;var D1=xX([Y(),iZ(Uint8Array),iZ(ArrayBuffer),tZ(e=>globalThis.Buffer?.isBuffer(e)??!1,{message:`Must be a Buffer`})]),O1=$X(()=>xX([uX(),Y(),iX(),cX(),DX(Y(),O1.optional()),gX(O1)])),k1=DX(Y(),DX(Y(),O1.optional())),A1=vX({type:jX(`text`),text:Y(),providerOptions:k1.optional()}),j1=vX({type:jX(`image`),image:xX([D1,iZ(URL)]),mediaType:Y().optional(),providerOptions:k1.optional()}),M1=vX({type:jX(`file`),data:xX([D1,iZ(URL)]),filename:Y().optional(),mediaType:Y(),providerOptions:k1.optional()}),N1=vX({type:jX(`reasoning`),text:Y(),providerOptions:k1.optional()}),P1=vX({type:jX(`tool-call`),toolCallId:Y(),toolName:Y(),input:fX(),providerOptions:k1.optional(),providerExecuted:cX().optional()}),F1=CX(`type`,[vX({type:jX(`text`),value:Y(),providerOptions:k1.optional()}),vX({type:jX(`json`),value:O1,providerOptions:k1.optional()}),vX({type:jX(`execution-denied`),reason:Y().optional(),providerOptions:k1.optional()}),vX({type:jX(`error-text`),value:Y(),providerOptions:k1.optional()}),vX({type:jX(`error-json`),value:O1,providerOptions:k1.optional()}),vX({type:jX(`content`),value:gX(xX([vX({type:jX(`text`),text:Y(),providerOptions:k1.optional()}),vX({type:jX(`media`),data:Y(),mediaType:Y()}),vX({type:jX(`file-data`),data:Y(),mediaType:Y(),filename:Y().optional(),providerOptions:k1.optional()}),vX({type:jX(`file-url`),url:Y(),providerOptions:k1.optional()}),vX({type:jX(`file-id`),fileId:xX([Y(),DX(Y(),Y())]),providerOptions:k1.optional()}),vX({type:jX(`image-data`),data:Y(),mediaType:Y(),providerOptions:k1.optional()}),vX({type:jX(`image-url`),url:Y(),providerOptions:k1.optional()}),vX({type:jX(`image-file-id`),fileId:xX([Y(),DX(Y(),Y())]),providerOptions:k1.optional()}),vX({type:jX(`custom`),providerOptions:k1.optional()})]))})]),I1=vX({type:jX(`tool-result`),toolCallId:Y(),toolName:Y(),output:F1,providerOptions:k1.optional()}),L1=vX({type:jX(`tool-approval-request`),approvalId:Y(),toolCallId:Y()}),R1=vX({type:jX(`tool-approval-response`),approvalId:Y(),approved:cX(),reason:Y().optional()});xX([vX({role:jX(`system`),content:Y(),providerOptions:k1.optional()}),vX({role:jX(`user`),content:xX([Y(),gX(xX([A1,j1,M1]))]),providerOptions:k1.optional()}),vX({role:jX(`assistant`),content:xX([Y(),gX(xX([A1,M1,N1,P1,I1,L1]))]),providerOptions:k1.optional()}),vX({role:jX(`tool`),content:gX(xX([I1,R1])),providerOptions:k1.optional()})]);function z1(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let i=t[r];if(i===void 0)continue;let a=r in e?e[r]:void 0,o=typeof i==`object`&&!!i&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),s=typeof a==`object`&&!!a&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp);o&&s?n[r]=z1(a,i):n[r]=i}return n}g1({},{array:()=>W1,choice:()=>G1,json:()=>K1,object:()=>U1,text:()=>H1});function B1(e){let t=[`ROOT`],n=-1,r=null;function i(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`);break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`);break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`);break}}function a(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop();break}}function o(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=r,t.pop();break}}for(let s=0;s<e.length;s++){let c=e[s];switch(t[t.length-1]){case`ROOT`:i(c,s,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(c){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break;case`}`:n=s,t.pop();break}break;case`INSIDE_OBJECT_AFTER_COMMA`:switch(c){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break}break;case`INSIDE_OBJECT_KEY`:switch(c){case`"`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`);break}break;case`INSIDE_OBJECT_AFTER_KEY`:switch(c){case`:`:t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`);break}break;case`INSIDE_OBJECT_BEFORE_VALUE`:i(c,s,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:a(c,s);break;case`INSIDE_STRING`:switch(c){case`"`:t.pop(),n=s;break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=s}break;case`INSIDE_ARRAY_START`:switch(c){case`]`:n=s,t.pop();break;default:n=s,i(c,s,`INSIDE_ARRAY_AFTER_VALUE`);break}break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(c){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=s,t.pop();break;default:n=s;break}break;case`INSIDE_ARRAY_AFTER_COMMA`:i(c,s,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),n=s;break;case`INSIDE_NUMBER`:switch(c){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=s;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&o(c,s),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&a(c,s);break;case`}`:t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&a(c,s);break;case`]`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&o(c,s);break;default:t.pop();break}break;case`INSIDE_LITERAL`:{let i=e.substring(r,s+1);!`false`.startsWith(i)&&!`true`.startsWith(i)&&!`null`.startsWith(i)?(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?a(c,s):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&o(c,s)):n=s;break}}}let s=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case`INSIDE_STRING`:s+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:s+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:s+=`]`;break;case`INSIDE_LITERAL`:{let t=e.substring(r,e.length);`true`.startsWith(t)?s+=`true`.slice(t.length):`false`.startsWith(t)?s+=`false`.slice(t.length):`null`.startsWith(t)&&(s+=`null`.slice(t.length))}}return s}async function V1(e){if(e===void 0)return{value:void 0,state:`undefined-input`};let t=await f1({text:e});return t.success?{value:t.value,state:`successful-parse`}:(t=await f1({text:B1(e)}),t.success?{value:t.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`})}var H1=()=>({name:`text`,responseFormat:Promise.resolve({type:`text`}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),U1=({schema:e,name:t,description:n})=>{let r=i1(e);return{name:`object`,responseFormat:m1(r.jsonSchema).then(e=>({type:`json`,schema:e,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:e},t){let n=await f1({text:e});if(!n.success)throw new x1({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=await d1({value:n.value,schema:r});if(!i.success)throw new x1({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return i.value},async parsePartialOutput({text:e}){let t=await V1(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return{partial:t.value}}},createElementStreamTransform(){}}},W1=({element:e,name:t,description:n})=>{let r=i1(e);return{name:`array`,responseFormat:m1(r.jsonSchema).then(e=>{let{$schema:r,...i}=e;return{type:`json`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{elements:{type:`array`,items:i}},required:[`elements`],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}}),async parseCompleteOutput({text:e},t){let n=await f1({text:e});if(!n.success)throw new x1({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=n.value;if(typeof i!=`object`||!i||!(`elements`in i)||!Array.isArray(i.elements))throw new x1({message:`No object generated: response did not match schema.`,cause:new qU({value:i,cause:`response must be an object with an elements array`}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});for(let n of i.elements){let i=await d1({value:n,schema:r});if(!i.success)throw new x1({message:`No object generated: response did not match schema.`,cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason})}return i.elements},async parsePartialOutput({text:e}){let t=await V1(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:{let e=t.value;if(typeof e!=`object`||!e||!(`elements`in e)||!Array.isArray(e.elements))return;let n=t.state===`repaired-parse`&&e.elements.length>0?e.elements.slice(0,-1):e.elements,i=[];for(let e of n){let t=await d1({value:e,schema:r});t.success&&i.push(t.value)}return{partial:i}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},n){if(t!=null)for(;e<t.length;e++)n.enqueue(t[e])}})}}},G1=({options:e,name:t,description:n})=>({name:`choice`,responseFormat:Promise.resolve({type:`json`,schema:{$schema:`http://json-schema.org/draft-07/schema#`,type:`object`,properties:{result:{type:`string`,enum:e}},required:[`result`],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:t},n){let r=await f1({text:t});if(!r.success)throw new x1({message:`No object generated: could not parse the response.`,cause:r.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});let i=r.value;if(typeof i!=`object`||!i||!(`result`in i)||typeof i.result!=`string`||!e.includes(i.result))throw new x1({message:`No object generated: response did not match schema.`,cause:new qU({value:i,cause:`response must be an object that contains a choice value.`}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return i.result},async parsePartialOutput({text:t}){let n=await V1(t);switch(n.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:{let t=n.value;if(typeof t!=`object`||!t||!(`result`in t)||typeof t.result!=`string`)return;let r=e.filter(e=>e.startsWith(t.result));return n.state===`successful-parse`?r.includes(t.result)?{partial:t.result}:void 0:r.length===1?{partial:r[0]}:void 0}}},createElementStreamTransform(){}}),K1=({name:e,description:t}={})=>({name:`json`,responseFormat:Promise.resolve({type:`json`,...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:e},t){let n=await f1({text:e});if(!n.success)throw new x1({message:`No object generated: could not parse the response.`,cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){let t=await V1(e);switch(t.state){case`failed-parse`:case`undefined-input`:return;case`repaired-parse`:case`successful-parse`:return t.value===void 0?void 0:{partial:t.value}}},createElementStreamTransform(){}});WQ({prefix:`aitxt`,size:24}),TransformStream;var q1=t1(()=>l1(xX([yX({type:jX(`text-start`),id:Y(),providerMetadata:k1.optional()}),yX({type:jX(`text-delta`),id:Y(),delta:Y(),providerMetadata:k1.optional()}),yX({type:jX(`text-end`),id:Y(),providerMetadata:k1.optional()}),yX({type:jX(`error`),errorText:Y()}),yX({type:jX(`tool-input-start`),toolCallId:Y(),toolName:Y(),providerExecuted:cX().optional(),providerMetadata:k1.optional(),dynamic:cX().optional(),title:Y().optional()}),yX({type:jX(`tool-input-delta`),toolCallId:Y(),inputTextDelta:Y()}),yX({type:jX(`tool-input-available`),toolCallId:Y(),toolName:Y(),input:fX(),providerExecuted:cX().optional(),providerMetadata:k1.optional(),dynamic:cX().optional(),title:Y().optional()}),yX({type:jX(`tool-input-error`),toolCallId:Y(),toolName:Y(),input:fX(),providerExecuted:cX().optional(),providerMetadata:k1.optional(),dynamic:cX().optional(),errorText:Y(),title:Y().optional()}),yX({type:jX(`tool-approval-request`),approvalId:Y(),toolCallId:Y()}),yX({type:jX(`tool-output-available`),toolCallId:Y(),output:fX(),providerExecuted:cX().optional(),providerMetadata:k1.optional(),dynamic:cX().optional(),preliminary:cX().optional()}),yX({type:jX(`tool-output-error`),toolCallId:Y(),errorText:Y(),providerExecuted:cX().optional(),providerMetadata:k1.optional(),dynamic:cX().optional()}),yX({type:jX(`tool-output-denied`),toolCallId:Y()}),yX({type:jX(`reasoning-start`),id:Y(),providerMetadata:k1.optional()}),yX({type:jX(`reasoning-delta`),id:Y(),delta:Y(),providerMetadata:k1.optional()}),yX({type:jX(`reasoning-end`),id:Y(),providerMetadata:k1.optional()}),yX({type:jX(`source-url`),sourceId:Y(),url:Y(),title:Y().optional(),providerMetadata:k1.optional()}),yX({type:jX(`source-document`),sourceId:Y(),mediaType:Y(),title:Y(),filename:Y().optional(),providerMetadata:k1.optional()}),yX({type:jX(`file`),url:Y(),mediaType:Y(),providerMetadata:k1.optional()}),yX({type:tZ(e=>typeof e==`string`&&e.startsWith(`data-`),{message:`Type must start with "data-"`}),id:Y().optional(),data:fX(),transient:cX().optional()}),yX({type:jX(`start-step`)}),yX({type:jX(`finish-step`)}),yX({type:jX(`start`),messageId:Y().optional(),messageMetadata:fX().optional()}),yX({type:jX(`finish`),finishReason:kX([`stop`,`length`,`content-filter`,`tool-calls`,`error`,`other`]).optional(),messageMetadata:fX().optional()}),yX({type:jX(`abort`),reason:Y().optional()}),yX({type:jX(`message-metadata`),messageMetadata:fX()})])));function J1(e){return e.type.startsWith(`data-`)}function Y1(e){return e.type===`text`}function X1(e){return e.type===`reasoning`}function Z1(e){return e.type.startsWith(`tool-`)}function Q1(e){return e.type===`dynamic-tool`}function $1(e){return Z1(e)||Q1(e)}function e0(e){return e.type.split(`-`).slice(1).join(`-`)}function t0(e){return Q1(e)?e.toolName:e0(e)}function n0({lastMessage:e,messageId:t}){return{message:e?.role===`assistant`?e:{id:t,metadata:void 0,role:`assistant`,parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function r0({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:o}){return e.pipeThrough(new TransformStream({async transform(e,s){await r(async({state:r,write:c})=>{function l(e){let t=r.message.parts.filter($1).find(t=>t.toolCallId===e);if(t==null)throw new E1({chunkType:`tool-invocation`,chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function u(e){let t=r.message.parts.find(t=>Z1(t)&&t.toolCallId===e.toolCallId),n=e,i=t;if(t!=null){t.state=e.state,i.input=n.input,i.output=n.output,i.errorText=n.errorText,i.rawInput=n.rawInput,i.preliminary=n.preliminary,e.title!==void 0&&(i.title=e.title),i.providerExecuted=n.providerExecuted??t.providerExecuted;let r=n.providerMetadata;if(r!=null)if(e.state===`output-available`||e.state===`output-error`){let e=t;e.resultProviderMetadata=r}else t.callProviderMetadata=r}else r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,input:n.input,output:n.output,rawInput:n.rawInput,errorText:n.errorText,providerExecuted:n.providerExecuted,preliminary:n.preliminary,...n.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:n.providerMetadata}:{},...n.providerMetadata!=null&&!(e.state===`output-available`||e.state===`output-error`)?{callProviderMetadata:n.providerMetadata}:{}})}function d(e){let t=r.message.parts.find(t=>t.type===`dynamic-tool`&&t.toolCallId===e.toolCallId),n=e,i=t;if(t!=null){t.state=e.state,i.toolName=e.toolName,i.input=n.input,i.output=n.output,i.errorText=n.errorText,i.rawInput=n.rawInput??i.rawInput,i.preliminary=n.preliminary,e.title!==void 0&&(i.title=e.title),i.providerExecuted=n.providerExecuted??t.providerExecuted;let r=n.providerMetadata;if(r!=null)if(e.state===`output-available`||e.state===`output-error`){let e=t;e.resultProviderMetadata=r}else t.callProviderMetadata=r}else r.message.parts.push({type:`dynamic-tool`,toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:n.input,output:n.output,errorText:n.errorText,preliminary:n.preliminary,providerExecuted:n.providerExecuted,title:e.title,...n.providerMetadata!=null&&(e.state===`output-available`||e.state===`output-error`)?{resultProviderMetadata:n.providerMetadata}:{},...n.providerMetadata!=null&&!(e.state===`output-available`||e.state===`output-error`)?{callProviderMetadata:n.providerMetadata}:{}})}async function f(e){if(e!=null){let n=r.message.metadata==null?e:z1(r.message.metadata,e);t!=null&&await u1({value:n,schema:t,context:{field:`message.metadata`,entityId:r.message.id}}),r.message.metadata=n}}switch(e.type){case`text-start`:{let t={type:`text`,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeTextParts[e.id]=t,r.message.parts.push(t),c();break}case`text-delta`:{let t=r.activeTextParts[e.id];if(t==null)throw new E1({chunkType:`text-delta`,chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=e.providerMetadata??t.providerMetadata,c();break}case`text-end`:{let t=r.activeTextParts[e.id];if(t==null)throw new E1({chunkType:`text-end`,chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});t.state=`done`,t.providerMetadata=e.providerMetadata??t.providerMetadata,delete r.activeTextParts[e.id],c();break}case`reasoning-start`:{let t={type:`reasoning`,text:``,providerMetadata:e.providerMetadata,state:`streaming`};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),c();break}case`reasoning-delta`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new E1({chunkType:`reasoning-delta`,chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=e.providerMetadata??t.providerMetadata,c();break}case`reasoning-end`:{let t=r.activeReasoningParts[e.id];if(t==null)throw new E1({chunkType:`reasoning-end`,chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});t.providerMetadata=e.providerMetadata??t.providerMetadata,t.state=`done`,delete r.activeReasoningParts[e.id],c();break}case`file`:r.message.parts.push({type:`file`,mediaType:e.mediaType,url:e.url,...e.providerMetadata==null?{}:{providerMetadata:e.providerMetadata}}),c();break;case`source-url`:r.message.parts.push({type:`source-url`,sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),c();break;case`source-document`:r.message.parts.push({type:`source-document`,sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),c();break;case`tool-input-start`:{let t=r.message.parts.filter(Z1);r.partialToolCalls[e.toolCallId]={text:``,toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title},e.dynamic?d({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted,title:e.title,providerMetadata:e.providerMetadata}):u({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted,title:e.title,providerMetadata:e.providerMetadata}),c();break}case`tool-input-delta`:{let t=r.partialToolCalls[e.toolCallId];if(t==null)throw new E1({chunkType:`tool-input-delta`,chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;let{value:n}=await V1(t.text);t.dynamic?d({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,input:n,title:t.title}):u({toolCallId:e.toolCallId,toolName:t.toolName,state:`input-streaming`,input:n,title:t.title}),c();break}case`tool-input-available`:e.dynamic?d({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}):u({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title}),c(),a&&!e.providerExecuted&&await a({toolCall:e});break;case`tool-input-error`:{let t=r.message.parts.filter($1).find(t=>t.toolCallId===e.toolCallId);(t==null?e.dynamic:t.type===`dynamic-tool`)?d({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):u({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),c();break}case`tool-approval-request`:{let t=l(e.toolCallId);t.state=`approval-requested`,t.approval={id:e.approvalId},c();break}case`tool-output-denied`:{let t=l(e.toolCallId);t.state=`output-denied`,c();break}case`tool-output-available`:{let t=l(e.toolCallId);t.type===`dynamic-tool`?d({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-available`,input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title}):u({toolCallId:e.toolCallId,toolName:e0(t),state:`output-available`,input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,providerMetadata:e.providerMetadata,title:t.title}),c();break}case`tool-output-error`:{let t=l(e.toolCallId);t.type===`dynamic-tool`?d({toolCallId:e.toolCallId,toolName:t.toolName,state:`output-error`,input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title}):u({toolCallId:e.toolCallId,toolName:e0(t),state:`output-error`,input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title}),c();break}case`start-step`:r.message.parts.push({type:`step-start`});break;case`finish-step`:r.activeTextParts={},r.activeReasoningParts={};break;case`start`:e.messageId!=null&&(r.message.id=e.messageId),await f(e.messageMetadata),(e.messageId!=null||e.messageMetadata!=null)&&c();break;case`finish`:e.finishReason!=null&&(r.finishReason=e.finishReason),await f(e.messageMetadata),e.messageMetadata!=null&&c();break;case`message-metadata`:await f(e.messageMetadata),e.messageMetadata!=null&&c();break;case`error`:i?.(Error(e.errorText));break;default:if(J1(e)){if(n?.[e.type]!=null){let t=r.message.parts.findIndex(t=>`id`in t&&`data`in t&&t.id===e.id&&t.type===e.type),i=t>=0?t:r.message.parts.length;await u1({value:e.data,schema:n[e.type],context:{field:`message.parts[${i}].data`,entityName:e.type,entityId:e.id}})}let t=e;if(t.transient){o?.(t);break}let i=t.id==null?void 0:r.message.parts.find(e=>t.type===e.type&&t.id===e.id);i==null?r.message.parts.push(t):i.data=t.data,o?.(t),c()}}s.enqueue(e)})}}))}async function i0({stream:e,onError:t}){let n=e.getReader();try{for(;;){let{done:e}=await n.read();if(e)break}}catch(e){t?.(e)}finally{n.releaseLock()}}WQ({prefix:`aitxt`,size:24}),WQ({prefix:`aiobj`,size:24});var a0=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){n(e)}}),this.processQueue()})}};WQ({prefix:`aiobj`,size:24});async function o0(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw Error(`FileList is not supported in the current environment`);return Promise.all(Array.from(e).map(async e=>{let{name:t,type:n}=e;return{type:`file`,mediaType:n,filename:t,url:await new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{t(e.target?.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}var s0=class{constructor({api:e=`/api/chat`,credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:o}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=o}async sendMessages({abortSignal:e,...t}){let n=await m1(this.body),r=await m1(this.headers),i=await m1(this.credentials),a={...KQ(r),...KQ(t.headers)},o=await this.prepareSendMessagesRequest?.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...n,...t.body},headers:a,credentials:i,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId}),s=o?.api??this.api,c=o?.headers===void 0?a:KQ(o.headers),l=o?.body===void 0?{...n,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId}:o.body,u=o?.credentials??i,d=await(this.fetch??globalThis.fetch)(s,{method:`POST`,headers:{"Content-Type":`application/json`,...c},body:JSON.stringify(l),credentials:u,signal:e});if(!d.ok)throw Error(await d.text()??`Failed to fetch the chat response.`);if(!d.body)throw Error(`The response body is empty.`);return this.processResponseStream(d.body)}async reconnectToStream(e){let t=await m1(this.body),n=await m1(this.headers),r=await m1(this.credentials),i={...KQ(n),...KQ(e.headers)},a=await this.prepareReconnectToStreamRequest?.call(this,{api:this.api,id:e.chatId,body:{...t,...e.body},headers:i,credentials:r,requestMetadata:e.metadata}),o=a?.api??`${this.api}/${e.chatId}/stream`,s=a?.headers===void 0?i:KQ(a.headers),c=a?.credentials??r,l=await(this.fetch??globalThis.fetch)(o,{method:`GET`,headers:s,credentials:c});if(l.status===204)return null;if(!l.ok)throw Error(await l.text()??`Failed to fetch the chat response.`);if(!l.body)throw Error(`The response body is empty.`);return this.processResponseStream(l.body)}},c0=class extends s0{constructor(e={}){super(e)}processResponseStream(e){return p1({stream:e,schema:q1}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},l0=class{constructor({generateId:e=GQ,id:t=e(),transport:n=new c0,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:o,onToolCall:s,onFinish:c,onData:l,sendAutomaticallyWhen:u}){this.activeResponse=void 0,this.jobExecutor=new a0,this.sendMessage=async(e,t)=>{if(e==null){await this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,...t});return}let n;if(n=`text`in e||`files`in e?{parts:[...Array.isArray(e.files)?e.files:await o0(e.files),...`text`in e&&e.text!=null?[{type:`text`,text:e.text}]:[]]}:e,e.messageId!=null){let t=this.state.messages.findIndex(t=>t.id===e.messageId);if(t===-1)throw Error(`message with id ${e.messageId} not found`);if(this.state.messages[t].role!==`user`)throw Error(`message with id ${e.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{...n,id:e.messageId,role:n.role??`user`,metadata:e.metadata})}else this.state.pushMessage({...n,id:n.id??this.generateId(),role:n.role??`user`,metadata:e.metadata});await this.makeRequest({trigger:`submit-message`,messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{let n=e==null?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(n===-1)throw Error(`message ${e} not found`);this.state.messages=this.state.messages.slice(0,this.messages[n].role===`assistant`?n:n+1),await this.makeRequest({trigger:`regenerate-message`,messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:`resume-stream`,...e})},this.clearError=()=>{this.status===`error`&&(this.state.error=void 0,this.setStatus({status:`ready`}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:n,options:r})=>this.jobExecutor.run(async()=>{let i=this.state.messages,a=i[i.length-1],o=r=>$1(r)&&r.state===`approval-requested`&&r.approval.id===e?{...r,state:`approval-responded`,approval:{id:e,approved:t,reason:n}}:r;this.state.replaceMessage(i.length-1,{...a,parts:a.parts.map(o)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(o)),this.status!==`streaming`&&this.status!==`submitted`&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{e&&this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,...r})})}),this.addToolOutput=async({state:e=`output-available`,toolCallId:t,output:n,errorText:r,options:i})=>this.jobExecutor.run(async()=>{let a=this.state.messages,o=a[a.length-1],s=i=>$1(i)&&i.toolCallId===t?{...i,state:e,output:n,errorText:r}:i;this.state.replaceMessage(a.length-1,{...o,parts:o.parts.map(s)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(s)),this.status!==`streaming`&&this.status!==`submitted`&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{e&&this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,...i})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{this.status!==`streaming`&&this.status!==`submitted`||this.activeResponse?.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=o,this.onToolCall=s,this.onFinish=c,this.onData=l,this.sendAutomaticallyWhen=u}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e==`object`&&`then`in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){var a;let o;if(e===`resume-stream`)try{let e=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(e==null)return;o=e}catch(e){this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:`error`,error:e});return}this.setStatus({status:`submitted`,error:void 0});let s=this.lastMessage,c=!1,l=!1,u=!1;try{let a={state:n0({lastMessage:this.state.snapshot(s),messageId:this.generateId()}),abortController:new AbortController};a.abortController.signal.addEventListener(`abort`,()=>{c=!0}),this.activeResponse=a;let l;l=e===`resume-stream`?o:await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:a.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i}),await i0({stream:r0({stream:l,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:e=>this.jobExecutor.run(()=>e({state:a.state,write:()=>{this.setStatus({status:`streaming`}),a.state.message.id===this.lastMessage?.id?this.state.replaceMessage(this.state.messages.length-1,a.state.message):this.state.pushMessage(a.state.message)}})),onError:e=>{throw e}}),onError:e=>{throw e}}),this.setStatus({status:`ready`})}catch(e){if(c||e.name===`AbortError`)return c=!0,this.setStatus({status:`ready`}),null;u=!0,e instanceof TypeError&&(e.message.toLowerCase().includes(`fetch`)||e.message.toLowerCase().includes(`network`))&&(l=!0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:`error`,error:e})}finally{try{(a=this.onFinish)==null||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:l,isError:u,finishReason:this.activeResponse?.state.finishReason})}catch(e){console.error(e)}this.activeResponse=void 0}!u&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,metadata:t,headers:n,body:r})}};function u0(e,t){switch(t.type){case`text-start`:return e.push({type:`text`,text:``,state:`streaming`}),!0;case`text-delta`:{let n=d0(e,`text`);return n&&n.type===`text`?n.text+=t.delta??``:e.push({type:`text`,text:t.delta??``,state:`streaming`}),!0}case`text-end`:{let t=d0(e,`text`);return t&&`state`in t&&(t.state=`done`),!0}case`reasoning-start`:return e.push({type:`reasoning`,text:``,state:`streaming`}),!0;case`reasoning-delta`:{let n=d0(e,`reasoning`);return n&&n.type===`reasoning`?(n.text+=t.delta??``,p0(n,t.providerMetadata)):e.push({type:`reasoning`,text:t.delta??``,state:`streaming`,...t.providerMetadata==null?{}:{providerMetadata:t.providerMetadata}}),!0}case`reasoning-end`:{let n=d0(e,`reasoning`);return n&&`state`in n&&(n.state=`done`,p0(n,t.providerMetadata)),!0}case`file`:return e.push({type:`file`,mediaType:t.mediaType,url:t.url}),!0;case`source-url`:return e.push({type:`source-url`,sourceId:t.sourceId,url:t.url,title:t.title,providerMetadata:t.providerMetadata}),!0;case`source-document`:return e.push({type:`source-document`,sourceId:t.sourceId,mediaType:t.mediaType,title:t.title,filename:t.filename,providerMetadata:t.providerMetadata}),!0;case`tool-input-start`:return e.push({type:`tool-${t.toolName}`,toolCallId:t.toolCallId,toolName:t.toolName,state:`input-streaming`,input:void 0,...t.providerExecuted==null?{}:{providerExecuted:t.providerExecuted},...t.providerMetadata==null?{}:{callProviderMetadata:t.providerMetadata},...t.title==null?{}:{title:t.title}}),!0;case`tool-input-delta`:{let n=f0(e,t.toolCallId);return n&&(n.input=t.input),!0}case`tool-input-available`:{let n=f0(e,t.toolCallId);if(n){let e=n;e.state=`input-available`,e.input=t.input,t.providerExecuted!=null&&(e.providerExecuted=t.providerExecuted),t.providerMetadata!=null&&(e.callProviderMetadata=t.providerMetadata),t.title!=null&&(e.title=t.title)}else e.push({type:`tool-${t.toolName}`,toolCallId:t.toolCallId,toolName:t.toolName,state:`input-available`,input:t.input,...t.providerExecuted==null?{}:{providerExecuted:t.providerExecuted},...t.providerMetadata==null?{}:{callProviderMetadata:t.providerMetadata},...t.title==null?{}:{title:t.title}});return!0}case`tool-input-error`:{let n=f0(e,t.toolCallId);if(n){let e=n;e.state=`output-error`,e.errorText=t.errorText,e.input=t.input,t.providerExecuted!=null&&(e.providerExecuted=t.providerExecuted),t.providerMetadata!=null&&(e.callProviderMetadata=t.providerMetadata)}else e.push({type:`tool-${t.toolName}`,toolCallId:t.toolCallId,toolName:t.toolName,state:`output-error`,input:t.input,errorText:t.errorText,...t.providerExecuted==null?{}:{providerExecuted:t.providerExecuted},...t.providerMetadata==null?{}:{callProviderMetadata:t.providerMetadata}});return!0}case`tool-approval-request`:{let n=f0(e,t.toolCallId);if(n){let e=n;e.state=`approval-requested`,e.approval={id:t.approvalId}}return!0}case`tool-output-denied`:{let n=f0(e,t.toolCallId);if(n){let e=n;e.state=`output-denied`}return!0}case`tool-output-available`:{let n=f0(e,t.toolCallId);if(n){let e=n;e.state=`output-available`,e.output=t.output,t.preliminary!==void 0&&(e.preliminary=t.preliminary)}return!0}case`tool-output-error`:{let n=f0(e,t.toolCallId);if(n){let e=n;e.state=`output-error`,e.errorText=t.errorText}return!0}case`step-start`:case`start-step`:return e.push({type:`step-start`}),!0;default:if(t.type.startsWith(`data-`)){if(t.transient)return!0;if(t.id!=null){let n=m0(e,t.type,t.id);if(n)return n.data=t.data,!0}return e.push({type:t.type,...t.id!=null&&{id:t.id},data:t.data}),!0}return!1}}function d0(e,t){for(let n=e.length-1;n>=0;n--)if(e[n].type===t)return e[n]}function f0(e,t){if(t)for(let n=e.length-1;n>=0;n--){let r=e[n];if(`toolCallId`in r&&r.toolCallId===t)return r}}function p0(e,t){if(t==null)return;let n=e;n.providerMetadata={...n.providerMetadata,...t}}function m0(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];if(i.type===t&&`id`in i&&i.id===n)return i}}new TextEncoder;function h0(e){if(typeof e==`object`&&e&&!Array.isArray(e))return e}var g0=class{constructor(e){this.messageId=e.messageId,this._isContinuation=e.continuation??!1,this.parts=e.existingParts?[...e.existingParts]:[],this.metadata=e.existingMetadata?{...e.existingMetadata}:void 0}applyChunk(e){let t=u0(this.parts,e);if(e.type===`tool-approval-request`&&e.toolCallId)return{handled:t,action:{type:`tool-approval-request`,toolCallId:e.toolCallId}};if((e.type===`tool-output-available`||e.type===`tool-output-error`)&&e.toolCallId&&!this.parts.some(t=>`toolCallId`in t&&t.toolCallId===e.toolCallId))return{handled:t,action:{type:`cross-message-tool-update`,updateType:e.type===`tool-output-available`?`output-available`:`output-error`,toolCallId:e.toolCallId,output:e.output,errorText:e.errorText,preliminary:e.preliminary}};if(!t)switch(e.type){case`start`:{e.messageId!=null&&!this._isContinuation&&(this.messageId=e.messageId);let t=h0(e.messageMetadata);return t&&(this.metadata=this.metadata?{...this.metadata,...t}:{...t}),{handled:!0,action:{type:`start`,messageId:e.messageId,metadata:t}}}case`finish`:{let t=h0(e.messageMetadata);return t&&(this.metadata=this.metadata?{...this.metadata,...t}:{...t}),{handled:!0,action:{type:`finish`,finishReason:`finishReason`in e?e.finishReason:void 0,metadata:t}}}case`message-metadata`:{let t=h0(e.messageMetadata);return t&&(this.metadata=this.metadata?{...this.metadata,...t}:{...t}),{handled:!0,action:{type:`message-metadata`,metadata:t??{}}}}case`finish-step`:return{handled:!0};case`error`:return{handled:!0,action:{type:`error`,error:e.errorText??JSON.stringify(e)}}}return{handled:t}}toMessage(){return{id:this.messageId,role:`assistant`,parts:[...this.parts],...this.metadata!=null&&{metadata:this.metadata}}}mergeInto(e){let t=e.findIndex(e=>e.id===this.messageId);if(t<0&&this._isContinuation){for(let n=e.length-1;n>=0;n--)if(e[n].role===`assistant`){t=n;break}}let n={id:t>=0?e[t].id:this.messageId,role:`assistant`,parts:[...this.parts],...this.metadata!=null&&{metadata:this.metadata}};if(t>=0){let r=[...e];return r[t]=n,r}return[...e,n]}};function _0(e,t){switch(t.type){case`clear`:return{state:{status:`idle`},isStreaming:!1};case`resume-fallback`:{let e=new g0({messageId:t.messageId});return{state:{status:`observing`,streamId:t.streamId,accumulator:e},isStreaming:!0}}case`response`:{let n;if(e.status===`idle`||e.streamId!==t.streamId){let e=t.messageId,r,i;if(t.continuation&&t.currentMessages){for(let n=t.currentMessages.length-1;n>=0;n--)if(t.currentMessages[n].role===`assistant`){e=t.currentMessages[n].id,r=[...t.currentMessages[n].parts],t.currentMessages[n].metadata!=null&&(i={...t.currentMessages[n].metadata});break}}n=new g0({messageId:e,continuation:t.continuation,existingParts:r,existingMetadata:i})}else n=e.accumulator;t.chunkData&&n.applyChunk(t.chunkData);let r;return t.done?(r=e=>n.mergeInto(e),{state:{status:`idle`},messagesUpdate:r,isStreaming:!1}):((t.chunkData&&!t.replay||t.replayComplete)&&(r=e=>n.mergeInto(e)),{state:{status:`observing`,streamId:t.streamId,accumulator:n},messagesUpdate:r,isStreaming:!0})}}}var v0={CHAT_MESSAGES:`cf_agent_chat_messages`,USE_CHAT_REQUEST:`cf_agent_use_chat_request`,USE_CHAT_RESPONSE:`cf_agent_use_chat_response`,CHAT_CLEAR:`cf_agent_chat_clear`,CHAT_REQUEST_CANCEL:`cf_agent_chat_request_cancel`,STREAM_RESUMING:`cf_agent_stream_resuming`,STREAM_RESUME_ACK:`cf_agent_stream_resume_ack`,STREAM_RESUME_REQUEST:`cf_agent_stream_resume_request`,STREAM_RESUME_NONE:`cf_agent_stream_resume_none`,TOOL_RESULT:`cf_agent_tool_result`,TOOL_APPROVAL:`cf_agent_tool_approval`,MESSAGE_UPDATED:`cf_agent_message_updated`},y0=10,b0=100,x0=600*1e3,S0=1440*60*1e3,C0=new TextEncoder,w0=class e{constructor(e){this.sql=e,this._activeStreamId=null,this._activeRequestId=null,this._streamChunkIndex=0,this._isLive=!1,this._chunkBuffer=[],this._isFlushingChunks=!1,this._lastCleanupTime=0,this.sql`create table if not exists cf_ai_chat_stream_chunks (
228
+ id text primary key,
229
+ stream_id text not null,
230
+ body text not null,
231
+ chunk_index integer not null,
232
+ created_at integer not null
233
+ )`,this.sql`create table if not exists cf_ai_chat_stream_metadata (
234
+ id text primary key,
235
+ request_id text not null,
236
+ status text not null,
237
+ created_at integer not null,
238
+ completed_at integer
239
+ )`,this.sql`create index if not exists idx_stream_chunks_stream_id
240
+ on cf_ai_chat_stream_chunks(stream_id, chunk_index)`,this.restore()}get activeStreamId(){return this._activeStreamId}get activeRequestId(){return this._activeRequestId}hasActiveStream(){return this._activeStreamId!==null}get isLive(){return this._isLive}start(e){this.flushBuffer();let t=BO();return this._activeStreamId=t,this._activeRequestId=e,this._streamChunkIndex=0,this._isLive=!0,this.sql`
241
+ insert into cf_ai_chat_stream_metadata (id, request_id, status, created_at)
242
+ values (${t}, ${e}, 'streaming', ${Date.now()})
243
+ `,t}complete(e){this.flushBuffer(),this.sql`
244
+ update cf_ai_chat_stream_metadata
245
+ set status = 'completed', completed_at = ${Date.now()}
246
+ where id = ${e}
247
+ `,this._activeStreamId=null,this._activeRequestId=null,this._streamChunkIndex=0,this._isLive=!1,this._maybeCleanupOldStreams()}markError(e){this.flushBuffer(),this.sql`
248
+ update cf_ai_chat_stream_metadata
249
+ set status = 'error', completed_at = ${Date.now()}
250
+ where id = ${e}
251
+ `,this._activeStreamId=null,this._activeRequestId=null,this._streamChunkIndex=0,this._isLive=!1}storeChunk(t,n){let r=C0.encode(n).byteLength;if(r>e.CHUNK_MAX_BYTES){console.warn(`[ResumableStream] Skipping oversized chunk (${r} bytes) to prevent SQLite row limit crash. Live clients still receive it.`);return}this._chunkBuffer.length>=b0&&this.flushBuffer(),this._chunkBuffer.push({id:BO(),streamId:t,body:n,index:this._streamChunkIndex}),this._streamChunkIndex++,this._chunkBuffer.length>=y0&&this.flushBuffer()}flushBuffer(){if(!(this._isFlushingChunks||this._chunkBuffer.length===0)){this._isFlushingChunks=!0;try{let e=this._chunkBuffer;this._chunkBuffer=[];let t=Date.now();for(let n of e)this.sql`
252
+ insert into cf_ai_chat_stream_chunks (id, stream_id, body, chunk_index, created_at)
253
+ values (${n.id}, ${n.streamId}, ${n.body}, ${n.index}, ${t})
254
+ `}finally{this._isFlushingChunks=!1}}}replayChunks(e,t){let n=this._activeStreamId;if(!n)return null;this.flushBuffer();let r=this.sql`
255
+ select * from cf_ai_chat_stream_chunks
256
+ where stream_id = ${n}
257
+ order by chunk_index asc
258
+ `;for(let n of r||[])e.send(JSON.stringify({body:n.body,done:!1,id:t,type:v0.USE_CHAT_RESPONSE,replay:!0}));return this._activeStreamId===n?this._isLive?(e.send(JSON.stringify({body:``,done:!1,id:t,type:v0.USE_CHAT_RESPONSE,replay:!0,replayComplete:!0})),null):(e.send(JSON.stringify({body:``,done:!0,id:t,type:v0.USE_CHAT_RESPONSE,replay:!0})),this.complete(n),n):(e.send(JSON.stringify({body:``,done:!0,id:t,type:v0.USE_CHAT_RESPONSE,replay:!0})),null)}restore(){let e=this.sql`
259
+ select * from cf_ai_chat_stream_metadata
260
+ where status = 'streaming'
261
+ order by created_at desc
262
+ limit 1
263
+ `;if(e&&e.length>0){let t=e[0];this._activeStreamId=t.id,this._activeRequestId=t.request_id;let n=this.sql`
264
+ select max(chunk_index) as max_index
265
+ from cf_ai_chat_stream_chunks
266
+ where stream_id = ${this._activeStreamId}
267
+ `;this._streamChunkIndex=n&&n[0]?.max_index!=null?n[0].max_index+1:0}}clearAll(){this._chunkBuffer=[],this.sql`delete from cf_ai_chat_stream_chunks`,this.sql`delete from cf_ai_chat_stream_metadata`,this._activeStreamId=null,this._activeRequestId=null,this._streamChunkIndex=0}destroy(){this.flushBuffer(),this.sql`drop table if exists cf_ai_chat_stream_chunks`,this.sql`drop table if exists cf_ai_chat_stream_metadata`,this._activeStreamId=null,this._activeRequestId=null}_maybeCleanupOldStreams(){let e=Date.now();if(e-this._lastCleanupTime<x0)return;this._lastCleanupTime=e;let t=e-S0;this.sql`
268
+ delete from cf_ai_chat_stream_chunks
269
+ where stream_id in (
270
+ select id from cf_ai_chat_stream_metadata
271
+ where status in ('completed', 'error') and completed_at < ${t}
272
+ )
273
+ `,this.sql`
274
+ delete from cf_ai_chat_stream_metadata
275
+ where status in ('completed', 'error') and completed_at < ${t}
276
+ `,this.sql`
277
+ delete from cf_ai_chat_stream_chunks
278
+ where stream_id in (
279
+ select id from cf_ai_chat_stream_metadata
280
+ where status = 'streaming' and created_at < ${t}
281
+ )
282
+ `,this.sql`
283
+ delete from cf_ai_chat_stream_metadata
284
+ where status = 'streaming' and created_at < ${t}
285
+ `}getStreamChunks(e){return this.sql`
286
+ select body, chunk_index from cf_ai_chat_stream_chunks
287
+ where stream_id = ${e}
288
+ order by chunk_index asc
289
+ `||[]}getStreamMetadata(e){let t=this.sql`
290
+ select status, request_id from cf_ai_chat_stream_metadata
291
+ where id = ${e}
292
+ `;return t&&t.length>0?t[0]:null}getAllStreamMetadata(){return this.sql`select id, status, request_id, created_at from cf_ai_chat_stream_metadata`||[]}insertStaleStream(e,t,n){let r=Date.now()-n;this.sql`
293
+ insert into cf_ai_chat_stream_metadata (id, request_id, status, created_at)
294
+ values (${e}, ${t}, 'streaming', ${r})
295
+ `}};w0.CHUNK_MAX_BYTES=18e5,v0.STREAM_RESUME_NONE;var T0=n(i(((e,t)=>{function n(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);let a=Date.now(),o=t-(a-r);o<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},o)}}t.exports=n}))(),1),E0=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},D0=(e,t,n)=>(E0(e,t,`read from private field`),n?n.call(e):t.get(e)),O0=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},k0=(e,t,n,r)=>(E0(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n);function A0(e,t){return t==null?e:(0,T0.default)(e,t)}var j0,M0,N0,P0,F0,I0,L0,R0,z0,B0=class{constructor(e=[]){O0(this,j0,void 0),O0(this,M0,`ready`),O0(this,N0,void 0),O0(this,P0,new Set),O0(this,F0,new Set),O0(this,I0,new Set),this.pushMessage=e=>{k0(this,j0,D0(this,j0).concat(e)),D0(this,L0).call(this)},this.popMessage=()=>{k0(this,j0,D0(this,j0).slice(0,-1)),D0(this,L0).call(this)},this.replaceMessage=(e,t)=>{k0(this,j0,[...D0(this,j0).slice(0,e),this.snapshot(t),...D0(this,j0).slice(e+1)]),D0(this,L0).call(this)},this.snapshot=e=>structuredClone(e),this[`~registerMessagesCallback`]=(e,t)=>{let n=t?A0(e,t):e;return D0(this,P0).add(n),()=>{D0(this,P0).delete(n)}},this[`~registerStatusCallback`]=e=>(D0(this,F0).add(e),()=>{D0(this,F0).delete(e)}),this[`~registerErrorCallback`]=e=>(D0(this,I0).add(e),()=>{D0(this,I0).delete(e)}),O0(this,L0,()=>{D0(this,P0).forEach(e=>e())}),O0(this,R0,()=>{D0(this,F0).forEach(e=>e())}),O0(this,z0,()=>{D0(this,I0).forEach(e=>e())}),k0(this,j0,e)}get status(){return D0(this,M0)}set status(e){k0(this,M0,e),D0(this,R0).call(this)}get error(){return D0(this,N0)}set error(e){k0(this,N0,e),D0(this,z0).call(this)}get messages(){return D0(this,j0)}set messages(e){k0(this,j0,[...e]),D0(this,L0).call(this)}};j0=new WeakMap,M0=new WeakMap,N0=new WeakMap,P0=new WeakMap,F0=new WeakMap,I0=new WeakMap,L0=new WeakMap,R0=new WeakMap,z0=new WeakMap;var V0,H0=class extends l0{constructor({messages:e,...t}){let n=new B0(e);super({...t,state:n}),O0(this,V0,void 0),this[`~registerMessagesCallback`]=(e,t)=>D0(this,V0)[`~registerMessagesCallback`](e,t),this[`~registerStatusCallback`]=e=>D0(this,V0)[`~registerStatusCallback`](e),this[`~registerErrorCallback`]=e=>D0(this,V0)[`~registerErrorCallback`](e),k0(this,V0,n)}};V0=new WeakMap;function U0({experimental_throttle:e,resume:t=!1,...n}={}){let r=(0,z.useRef)(`chat`in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});`chat`in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});let i={...n,onToolCall:e=>{var t;return(t=r.current).onToolCall?.call(t,e)},onData:e=>{var t;return(t=r.current).onData?.call(t,e)},onFinish:e=>{var t;return(t=r.current).onFinish?.call(t,e)},onError:e=>{var t;return(t=r.current).onError?.call(t,e)},sendAutomaticallyWhen:e=>{var t;return(t=r.current).sendAutomaticallyWhen?.call(t,e)??!1}},a=(0,z.useRef)(`chat`in n?n.chat:new H0(i));(`chat`in n&&n.chat!==a.current||`id`in n&&a.current.id!==n.id)&&(a.current=`chat`in n?n.chat:new H0(i));let o=(0,z.useSyncExternalStore)((0,z.useCallback)(t=>a.current[`~registerMessagesCallback`](t,e),[e,a.current.id]),()=>a.current.messages,()=>a.current.messages),s=(0,z.useSyncExternalStore)(a.current[`~registerStatusCallback`],()=>a.current.status,()=>a.current.status),c=(0,z.useSyncExternalStore)(a.current[`~registerErrorCallback`],()=>a.current.error,()=>a.current.error),l=(0,z.useCallback)(e=>{typeof e==`function`&&(e=e(a.current.messages)),a.current.messages=e},[a]);return(0,z.useEffect)(()=>{t&&a.current.resumeStream()},[t,a]),{id:a.current.id,messages:o,setMessages:l,sendMessage:a.current.sendMessage,regenerate:a.current.regenerate,clearError:a.current.clearError,stop:a.current.stop,error:c,resumeStream:a.current.resumeStream,status:s,addToolResult:a.current.addToolOutput,addToolOutput:a.current.addToolOutput,addToolApprovalResponse:a.current.addToolApprovalResponse}}var W0=class{constructor(e){this._resumeResolver=null,this._resumeNoneResolver=null,this._expectToolContinuation=!1,this._abortToolContinuation=null,this.agent=e.agent,this.prepareBody=e.prepareBody,this.activeRequestIds=e.activeRequestIds}expectToolContinuation(){this._expectToolContinuation=!0}abortActiveToolContinuation(){return this._abortToolContinuation?.()??!1}isAwaitingResume(){return this._resumeResolver!==null||this._resumeNoneResolver!==null}handleStreamResuming(e){return this._resumeResolver?(this._resumeResolver(e),!0):!1}handleStreamResumeNone(){return this._resumeNoneResolver?(this._resumeNoneResolver(),!0):!1}async sendMessages(e){let t=BO(8),n=new AbortController,r=!1,i={};this.prepareBody&&(i=await this.prepareBody({messages:e.messages,trigger:e.trigger,messageId:e.messageId})),e.body&&(i={...i,...e.body});let a=JSON.stringify({messages:e.messages,trigger:e.trigger,...i});this.activeRequestIds?.add(t);let o=this.agent,s=this.activeRequestIds,c=(e,i=!1)=>{if(!r){r=!0;try{e()}catch{}i||s?.delete(t),n.abort()}},l=Error(`Aborted`);l.name=`AbortError`;let u=()=>{if(!r){try{o.send(JSON.stringify({id:t,type:CU.CF_AGENT_CHAT_REQUEST_CANCEL}))}catch{}c(()=>d.error(l),!0)}},d,f=new ReadableStream({start(e){d=e,o.addEventListener(`message`,n=>{try{let r=JSON.parse(n.data);if(r.type!==CU.CF_AGENT_USE_CHAT_RESPONSE||r.id!==t)return;if(r.error){c(()=>e.error(Error(r.body||`Stream error`)));return}if(r.body?.trim())try{let t=JSON.parse(r.body);e.enqueue(t)}catch{}r.done&&c(()=>e.close())}catch{}},{signal:n.signal})},cancel(){u()}});return e.abortSignal&&(e.abortSignal.addEventListener(`abort`,u,{once:!0}),e.abortSignal.aborted&&u()),o.send(JSON.stringify({id:t,init:{method:`POST`,body:a},type:CU.CF_AGENT_USE_CHAT_REQUEST})),f}async reconnectToStream(e){if(this._expectToolContinuation)return this._expectToolContinuation=!1,this._createToolContinuationStream();let t=this.activeRequestIds;return new Promise(e=>{let n=!1,r,i=t=>{n||(n=!0,this._resumeResolver=null,this._resumeNoneResolver=null,r&&clearTimeout(r),e(t))};this._resumeNoneResolver=()=>i(null),this._resumeResolver=e=>{let n=e.id;t?.add(n),this.agent.send(JSON.stringify({type:CU.CF_AGENT_STREAM_RESUME_ACK,id:n})),i(this._createResumeStream(n))};try{this.agent.send(JSON.stringify({type:CU.CF_AGENT_STREAM_RESUME_REQUEST}))}catch{}r=setTimeout(()=>i(null),5e3)})}_createToolContinuationStream(){let e=this.agent,t=this.activeRequestIds,n=new AbortController,r=Error(`Aborted`);r.name=`AbortError`;let i=!1,a=null,o,s=null,c=null,l=(e,t)=>{if(e===void 0&&t===void 0){this._resumeResolver=null,this._resumeNoneResolver=null;return}e&&this._resumeResolver===e&&(this._resumeResolver=null),t&&this._resumeNoneResolver===t&&(this._resumeNoneResolver=null)},u=(e,r,o,s=!1)=>{if(!i){i=!0,this._abortToolContinuation=null,l(r,o);try{e()}catch{}a&&!s&&t?.delete(a),n.abort()}};this._abortToolContinuation=()=>{if(i)return!1;if(a===null)return u(()=>o.error(r),s,c),!0;try{e.send(JSON.stringify({type:CU.CF_AGENT_CHAT_REQUEST_CANCEL,id:a}))}catch{}return u(()=>o.error(r),s,c,!0),!0};let d=this;return new ReadableStream({start(r){o=r;let i,f=()=>{i&&clearTimeout(i),u(()=>r.close(),p,f)},p=n=>{a||(a=n.id,t?.add(a),l(p,f),i&&clearTimeout(i),e.send(JSON.stringify({type:CU.CF_AGENT_STREAM_RESUME_ACK,id:a})))};s=p,c=f,i=setTimeout(()=>u(()=>r.close(),p,f),5e3),d._resumeResolver=p,d._resumeNoneResolver=f,e.addEventListener(`message`,e=>{try{let t=JSON.parse(e.data);if(t.type!==CU.CF_AGENT_USE_CHAT_RESPONSE||a==null||t.id!==a)return;if(t.error){u(()=>r.error(Error(t.body||`Stream error`)),p,f);return}if(t.body?.trim())try{let e=JSON.parse(t.body);r.enqueue(e)}catch{}t.done&&u(()=>r.close(),p,f)}catch{}},{signal:n.signal});try{e.send(JSON.stringify({type:CU.CF_AGENT_STREAM_RESUME_REQUEST}))}catch{u(()=>r.close())}},cancel(){u(()=>{})}})}_createResumeStream(e){let t=this.agent,n=this.activeRequestIds,r=new AbortController,i=!1,a=t=>{if(!i){i=!0;try{t()}catch{}n?.delete(e),r.abort()}};return new ReadableStream({start(n){t.addEventListener(`message`,t=>{try{let r=JSON.parse(t.data);if(r.type!==CU.CF_AGENT_USE_CHAT_RESPONSE||r.id!==e)return;if(r.error){a(()=>n.error(Error(r.body||`Stream error`)));return}if(r.body?.trim())try{let e=JSON.parse(r.body);n.enqueue(e)}catch{}r.done&&a(()=>n.close())}catch{}},{signal:r.signal})},cancel(){a(()=>{})}})}},G0=new Set;function K0(e,t){G0.has(e)||(G0.add(e),console.warn(`[@cloudflare/ai-chat] Deprecated: ${t}`))}function q0(e){if(!e)return;let t=Object.entries(e).filter(([e,t])=>t.execute).map(([e,t])=>(t.inputSchema&&!t.parameters&&console.warn(`[useAgentChat] Tool "${e}" uses deprecated 'inputSchema'. Please migrate to 'parameters'.`),{name:e,description:t.description,parameters:t.parameters??t.inputSchema}));return t.length>0?t:void 0}var J0=new Map;function Y0(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.role===`assistant`)return{index:t,message:n}}return null}function X0(e,t){let n=e.findIndex(e=>e.id===t);if(n<0||n===e.length-1)return e;let r=[...e],[i]=r.splice(n,1);return i?(r.push(i),r):e}function Z0(e){let{agent:t,getInitialMessages:n,messages:r,onToolCall:i,onData:a,experimental_automaticToolResolution:o,tools:s,toolsRequiringConfirmation:c,autoContinueAfterToolResult:l=!0,autoSendAfterAllConfirmationsResolved:u=!0,resume:d=!0,body:f,prepareSendMessagesRequest:p,...m}=e;c&&K0(`useAgentChat.toolsRequiringConfirmation`,`The 'toolsRequiringConfirmation' option is deprecated. Use needsApproval on server-side tools instead. Will be removed in the next major version.`),o&&K0(`useAgentChat.experimental_automaticToolResolution`,`The 'experimental_automaticToolResolution' option is deprecated. Use the onToolCall callback instead. Will be removed in the next major version.`),e.autoSendAfterAllConfirmationsResolved!==void 0&&K0(`useAgentChat.autoSendAfterAllConfirmationsResolved`,`The 'autoSendAfterAllConfirmationsResolved' option is deprecated. Use sendAutomaticallyWhen from AI SDK instead. Will be removed in the next major version.`);let h=(0,z.useMemo)(()=>c||(s?Object.entries(s).filter(([e,t])=>!t.execute).map(([e])=>e):[]),[c,s]),g=(0,z.useRef)(i);g.current=i;let _=(0,z.useRef)(a);_.current=a;let v=new URL(t.getHttpUrl());v.searchParams.delete(`_pk`);let y=v.toString(),b=`${v.origin}${v.pathname}|${t.agent??``}|${t.name??``}`,x=(0,z.useRef)(t);x.current=t;async function S({url:t}){let n=new URL(t);n.pathname+=`/get-messages`;let r=await fetch(n.toString(),{credentials:e.credentials,headers:e.headers});if(!r.ok)return console.warn(`Failed to fetch initial messages: ${r.status} ${r.statusText}`),[];let i=await r.text();if(!i.trim())return[];try{return JSON.parse(i)}catch(e){return console.warn(`Failed to parse initial messages JSON:`,e),[]}}let C=n||S;function w(e,t){if(J0.has(t))return J0.get(t);let n=C(e);return J0.set(t,n),n}let T=n===null?null:w({agent:t.agent,name:t.name,url:y},b),E=T?(0,z.use)(T):r??[];(0,z.useEffect)(()=>{if(T)return J0.set(b,T),()=>{J0.get(b)===T&&J0.delete(b)}},[b,T]);let D=(0,z.useRef)(s);D.current=s;let O=(0,z.useRef)(p);O.current=p;let k=(0,z.useRef)(f);k.current=f;let A=(0,z.useRef)(new Set),j=(0,z.useRef)(null);j.current===null&&(j.current=new W0({agent:x.current,activeRequestIds:A.current,prepareBody:async({messages:e,trigger:t,messageId:n})=>{let r={},i=k.current;if(i&&(r={...typeof i==`function`?await i():i}),D.current){let e=q0(D.current);e&&(r.clientTools=e)}if(O.current){let i=await O.current({id:x.current._pk,messages:e,trigger:t,messageId:n});i.body&&Object.assign(r,i.body)}return r}})),j.current.agent=x.current;let M=j.current,ee=U0({...m,onData:a,messages:E,transport:M,id:b,resume:d}),{messages:N,setMessages:P,addToolResult:F,addToolApprovalResponse:te,sendMessage:I,resumeStream:ne,status:re,stop:ie}=ee,L=(0,z.useRef)(re);L.current=re;let ae=(0,z.useRef)(!1),R=(0,z.useCallback)(()=>{!l||ae.current||(ae.current=!0,M.expectToolContinuation(),ne().finally(()=>{ae.current=!1}))},[l,M,ne]),oe=(0,z.useCallback)(async()=>{try{await ie()}finally{M.abortActiveToolContinuation()}},[ie,M]),se=(0,z.useRef)(new Set),ce=(0,z.useRef)(!1),[le,ue]=(0,z.useState)(0),[de,fe]=(0,z.useState)(new Map),pe=(0,z.useRef)(N);pe.current=N;let me=(0,z.useRef)(new Map),he=(0,z.useRef)(null),ge=(0,z.useCallback)(e=>{let t=he.current;if(!t)return e;let n=pe.current.find(e=>e.id===t.assistantId)??e.find(e=>e.id===t.assistantId);return n?[...e.filter(e=>e.id!==t.assistantId),n]:e},[]),_e=(0,z.useCallback)(()=>{if(L.current!==`streaming`)return;let e=Y0(pe.current);e&&(he.current?.assistantId!==e.message.id&&(he.current={assistantId:e.message.id,anchorMessageId:pe.current[e.index-1]?.id??null}),P(e=>{let t=he.current;return t?X0(e,t.assistantId):e}))},[P]),ve=(0,z.useCallback)(e=>{let t=he.current;!t||e!==void 0&&t.assistantId!==e||(he.current=null,P(e=>{let n=e.findIndex(e=>e.id===t.assistantId);if(n<0)return e;let r=[...e],[i]=r.splice(n,1);if(!i)return e;if(t.anchorMessageId===null)r.unshift(i);else{let e=r.findIndex(e=>e.id===t.anchorMessageId);r.splice(e>=0?e+1:n,0,i)}return r}))},[P]),ye=(0,z.useCallback)(async(e,t)=>{let n=I(e,t);return e!==void 0&&!(typeof e==`object`&&e&&`messageId`in e&&e.messageId!=null)&&_e(),n},[I,_e]),be=N[N.length-1],xe=(()=>{if(!be||be.role!==`assistant`)return{messageId:void 0,toolCallIds:new Set};let e=new Set;for(let t of be.parts??[])$1(t)&&t.state===`input-available`&&h.includes(t0(t))&&e.add(t.toolCallId);return{messageId:be.id,toolCallIds:e}})(),Se=(0,z.useRef)(xe);Se.current=xe,(0,z.useEffect)(()=>{if(!o||ce.current)return;let e=N[N.length-1];if(!e||e.role!==`assistant`)return;let t=e.parts.filter(e=>$1(e)&&e.state===`input-available`&&!se.current.has(e.toolCallId));if(t.length>0){let e=D.current,n=t.filter(t=>$1(t)&&!h.includes(t0(t))&&e?.[t0(t)]?.execute);n.length>0&&(ce.current=!0,(async()=>{try{let t=[];for(let r of n)if($1(r)){let n=null,i=t0(r),a=e?.[i];if(a?.execute&&r.input!==void 0)try{n=await a.execute(r.input)}catch(e){n=`Error executing tool: ${e instanceof Error?e.message:String(e)}`}se.current.add(r.toolCallId),t.push({toolCallId:r.toolCallId,toolName:i,output:n})}if(t.length>0){let n=q0(e);for(let e of t)x.current.send(JSON.stringify({type:CU.CF_AGENT_TOOL_RESULT,toolCallId:e.toolCallId,toolName:e.toolName,output:e.output,autoContinue:l,clientTools:n}));await Promise.all(t.map(e=>F({tool:e.toolName,toolCallId:e.toolCallId,output:e.output}))),fe(e=>{let n=new Map(e);for(let e of t)n.set(e.toolCallId,e.output);return n}),R()}}finally{ce.current=!1,ue(e=>e+1)}})())}},[N,o,F,h,l,R,le]);let Ce=(0,z.useCallback)((e,t,n,r,i)=>{let a=r===`output-error`?!1:l;x.current.send(JSON.stringify({type:CU.CF_AGENT_TOOL_RESULT,toolCallId:e,toolName:t,output:n,...r?{state:r}:{},...i===void 0?{}:{errorText:i},autoContinue:a,clientTools:D.current?q0(D.current):void 0})),r!==`output-error`&&fe(t=>new Map(t).set(e,n)),a&&R()},[l,R]),we=(0,z.useCallback)((e,t)=>{x.current.send(JSON.stringify({type:CU.CF_AGENT_TOOL_APPROVAL,toolCallId:e,approved:t,autoContinue:l})),l&&R()},[l,R]);(0,z.useEffect)(()=>{let e=g.current;if(!e)return;let t=N[N.length-1];if(!t||t.role!==`assistant`)return;let n=t.parts.filter(e=>$1(e)&&e.state===`input-available`&&!se.current.has(e.toolCallId));for(let t of n)if($1(t)){let n=t.toolCallId,r=t0(t);se.current.add(n),e({toolCall:{toolCallId:n,toolName:r,input:t.input},addToolOutput:e=>{Ce(e.toolCallId,r,e.output,e.state,e.errorText),F({tool:r,toolCallId:e.toolCallId,output:e.state===`output-error`?e.errorText??`Tool execution denied by user`:e.output})}})}},[N,Ce,F]);let Te=(0,z.useRef)({status:`idle`}),[Ee,De]=(0,z.useState)(!1);(0,z.useEffect)(()=>{let e=me.current;function n(t){if(typeof t.data!=`string`)return;let n;try{n=JSON.parse(t.data)}catch{return}switch(n.type){case CU.CF_AGENT_CHAT_CLEAR:e.clear(),he.current=null,Te.current=_0(Te.current,{type:`clear`}).state,De(!1),P([]);break;case CU.CF_AGENT_CHAT_MESSAGES:P(ge(n.messages));break;case CU.CF_AGENT_MESSAGE_UPDATED:P(e=>{let t=n.message,r=e.findIndex(e=>e.id===t.id);if(r<0){let n=new Set(t.parts.filter(e=>`toolCallId`in e&&e.toolCallId).map(e=>e.toolCallId));n.size>0&&(r=e.findIndex(e=>e.parts.some(e=>`toolCallId`in e&&n.has(e.toolCallId))))}if(r>=0){let n=[...e];return n[r]={...t,id:e[r].id},n}return e});break;case CU.CF_AGENT_STREAM_RESUME_NONE:M.handleStreamResumeNone();break;case CU.CF_AGENT_STREAM_RESUMING:if(!d&&!M.isAwaitingResume()||M.handleStreamResuming(n)||A.current.has(n.id))return;Te.current=_0(Te.current,{type:`resume-fallback`,streamId:n.id,messageId:BO()}).state,De(!0),x.current.send(JSON.stringify({type:CU.CF_AGENT_STREAM_RESUME_ACK,id:n.id}));break;case CU.CF_AGENT_USE_CHAT_RESPONSE:{if(A.current.has(n.id)){if(n.body?.trim())try{let t=JSON.parse(n.body);t.type===`start`&&typeof t.messageId==`string`&&e.set(n.id,t.messageId)}catch{}n.done&&(ve(e.get(n.id)),e.delete(n.id),A.current.delete(n.id));return}let t;if(n.body?.trim())try{t=JSON.parse(n.body),typeof t.type==`string`&&t.type.startsWith(`data-`)&&_.current&&_.current(t)}catch(e){console.warn(`[useAgentChat] Failed to parse stream chunk:`,e instanceof Error?e.message:e,`body:`,n.body?.slice(0,100))}let r=_0(Te.current,{type:`response`,streamId:n.id,messageId:BO(),chunkData:t,done:n.done,error:n.error,replay:n.replay,replayComplete:n.replayComplete,continuation:n.continuation,currentMessages:n.continuation?pe.current:void 0});Te.current=r.state,r.messagesUpdate&&P(r.messagesUpdate),De(r.isStreaming);break}}}return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),Te.current={status:`idle`},De(!1),he.current=null,e.clear()}},[t,P,d,M,ge,ve]);let Oe=async e=>{let{toolCallId:t}=e,n=`tool`in e?e.tool:``,r=`output`in e?e.output:void 0;if(x.current.send(JSON.stringify({type:CU.CF_AGENT_TOOL_RESULT,toolCallId:t,toolName:n,output:r,autoContinue:l,clientTools:D.current?q0(D.current):void 0})),fe(e=>new Map(e).set(t,r)),F(e),l&&R(),!l){if(!u){I();return}let e=Se.current?.toolCallIds;if(!e){I();return}let n=e.size===1&&e.has(t);e.has(t)&&e.delete(t),(n||e.size===0)&&I()}},ke=e=>{let{id:t,approved:n}=e,r;for(let e of pe.current){for(let n of e.parts)if(`toolCallId`in n&&`approval`in n&&n.approval?.id===t){r=n.toolCallId;break}if(r)break}r?we(r,n):console.warn(`[useAgentChat] addToolApprovalResponse: Could not find toolCallId for approval ID "${t}". Server will not be notified, which may cause duplicate messages.`),te(e)},Ae=(0,z.useMemo)(()=>de.size===0?N:N.map(e=>({...e,parts:e.parts.map(e=>!(`toolCallId`in e)||!(`state`in e)||e.state!==`input-available`||!de.has(e.toolCallId)?e:{...e,state:`output-available`,output:de.get(e.toolCallId)})})),[N,de]);(0,z.useEffect)(()=>{let e=new Set;for(let t of N)for(let n of t.parts)`toolCallId`in n&&n.toolCallId&&e.add(n.toolCallId);fe(t=>{if(t.size===0)return t;let n=!1;for(let r of t.keys())if(!e.has(r)){n=!0;break}if(!n)return t;let r=new Map;for(let[n,i]of t)e.has(n)&&r.set(n,i);return r});for(let t of se.current)e.has(t)||se.current.delete(t)},[N]);let je=(0,z.useCallback)(e=>{let t=e.toolName??``;Ce(e.toolCallId,t,e.output,e.state,e.errorText),F({tool:t,toolCallId:e.toolCallId,output:e.state===`output-error`?e.errorText??`Tool execution denied by user`:e.output})},[Ce,F]),Me=re===`streaming`||Ee;return{...ee,messages:Ae,isServerStreaming:Ee,isStreaming:Me,sendMessage:ye,stop:oe,addToolOutput:je,addToolResult:Oe,addToolApprovalResponse:ke,clearHistory:()=>{P([]),fe(new Map),ae.current=!1,se.current.clear(),me.current.clear(),he.current=null,t.send(JSON.stringify({type:CU.CF_AGENT_CHAT_CLEAR}))},setMessages:e=>{let n;n=typeof e==`function`?e(pe.current):e,P(n),t.send(JSON.stringify({messages:n,type:CU.CF_AGENT_CHAT_MESSAGES}))}}}var Q0=function(e){return e.CF_AGENT_MCP_SERVERS=`cf_agent_mcp_servers`,e.CF_MCP_AGENT_EVENT=`cf_mcp_agent_event`,e.CF_AGENT_STATE=`cf_agent_state`,e.CF_AGENT_STATE_ERROR=`cf_agent_state_error`,e.CF_AGENT_IDENTITY=`cf_agent_identity`,e.CF_AGENT_SESSION=`cf_agent_session`,e.CF_AGENT_SESSION_ERROR=`cf_agent_session_error`,e.RPC=`rpc`,e}({});function $0(e){if(e===e.toUpperCase()&&e!==e.toLowerCase())return e.toLowerCase().replace(/_/g,`-`);let t=e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);return t=t.startsWith(`-`)?t.slice(1):t,t.replace(/_/g,`-`).replace(/-$/,``)}(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
296
+ PartySocket requires a global 'EventTarget' class to be available!
297
+ You can polyfill this global by adding this to your code before any partysocket imports:
298
+
299
+ \`\`\`
300
+ import 'partysocket/event-target-polyfill';
301
+ \`\`\`
302
+ Please file an issue at https://github.com/partykit/partykit if you're still having trouble.
303
+ `);var e2=class extends Event{message;error;constructor(e,t){super(`error`,t),this.message=e.message,this.error=e}},t2=class extends Event{code;reason;wasClean=!0;constructor(e=1e3,t=``,n){super(`close`,n),this.code=e,this.reason=t}},n2={Event,ErrorEvent:e2,CloseEvent:t2};function r2(e,t){if(!e)throw Error(t)}function i2(e){return new e.constructor(e.type,e)}function a2(e){return`data`in e?new MessageEvent(e.type,e):`code`in e||`reason`in e?new t2(e.code||1999,e.reason||`unknown reason`,e):`error`in e?new e2(e.error,e):new Event(e.type,e)}var o2=typeof process<`u`&&process.versions?.node!==void 0,s2=typeof navigator<`u`&&navigator.product===`ReactNative`,c2=o2||s2?a2:i2,l2={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},u2=!1,d2=class e extends EventTarget{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=!0;_connectLock=!1;_binaryType=`blob`;_closeCalled=!1;_messageQueue=[];_debugLogger=console.log.bind(console);_url;_protocols;_options;constructor(e,t,n={}){super(),this._url=e,this._protocols=t,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return e.CONNECTING}get OPEN(){return e.OPEN}get CLOSING(){return e.CLOSING}get CLOSED(){return e.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((e,t)=>(typeof t==`string`?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:``}get protocol(){return this._ws?this._ws.protocol:``}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING}get url(){return this._ws?this._ws.url:``}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;close(e=1e3,t){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug(`close enqueued: no ws instance`);return}if(this._ws.readyState===this.CLOSED){this._debug(`close: already closed`);return}this._ws.close(e,t)}reconnect(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED||this._disconnect(e,t),this._connect()}send(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug(`send`,e),this._ws.send(e);else{let{maxEnqueuedMessages:t=l2.maxEnqueuedMessages}=this._options;this._messageQueue.length<t&&(this._debug(`enqueue`,e),this._messageQueue.push(e))}}_debug(...e){this._options.debug&&this._debugLogger(`RWS>`,...e)}_getNextDelay(){let{reconnectionDelayGrowFactor:e=l2.reconnectionDelayGrowFactor,minReconnectionDelay:t=l2.minReconnectionDelay,maxReconnectionDelay:n=l2.maxReconnectionDelay}=this._options,r=0;return this._retryCount>0&&(r=t*e**(this._retryCount-1),r>n&&(r=n)),this._debug(`next delay`,r),r}_wait(){return new Promise(e=>{setTimeout(e,this._getNextDelay())})}_getNextProtocols(e){if(!e)return Promise.resolve(null);if(typeof e==`string`||Array.isArray(e))return Promise.resolve(e);if(typeof e==`function`){let t=e();if(!t)return Promise.resolve(null);if(typeof t==`string`||Array.isArray(t))return Promise.resolve(t);if(t.then)return t}throw Error(`Invalid protocols`)}_getNextUrl(e){if(typeof e==`string`)return Promise.resolve(e);if(typeof e==`function`){let t=e();if(typeof t==`string`)return Promise.resolve(t);if(t.then)return t}throw Error(`Invalid URL`)}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;let{maxRetries:e=l2.maxRetries,connectionTimeout:t=l2.connectionTimeout}=this._options;if(this._retryCount>=e){this._debug(`max retries reached`,this._retryCount,`>=`,e),this._connectLock=!1;return}this._retryCount++,this._debug(`connect`,this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([e,n])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>`u`&&!u2&&(console.error(`‼️ No WebSocket implementation available. You should define options.WebSocket.
304
+
305
+ For example, if you're using node.js, run \`npm install ws\`, and then in your code:
306
+
307
+ import PartySocket from 'partysocket';
308
+ import WS from 'ws';
309
+
310
+ const partysocket = new PartySocket({
311
+ host: "127.0.0.1:1999",
312
+ room: "test-room",
313
+ WebSocket: WS
314
+ });
315
+
316
+ `),u2=!0);let r=this._options.WebSocket||WebSocket;this._debug(`connect`,{url:e,protocols:n}),this._ws=n?new r(e,n):new r(e),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),t)}).catch(e=>{this._connectLock=!1,this._handleError(new n2.ErrorEvent(Error(e.message),this))})}_handleTimeout(){this._debug(`timeout event`),this._handleError(new n2.ErrorEvent(Error(`TIMEOUT`),this))}_disconnect(e=1e3,t){if(this._clearTimeouts(),this._ws){this._removeListeners();try{(this._ws.readyState===this.OPEN||this._ws.readyState===this.CONNECTING)&&this._ws.close(e,t),this._handleClose(new n2.CloseEvent(e,t,this))}catch{}}}_acceptOpen(){this._debug(`accept open`),this._retryCount=0}_handleOpen=e=>{this._debug(`open event`);let{minUptime:t=l2.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),t),r2(this._ws,`WebSocket is not defined`),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(e=>{this._ws?.send(e)}),this._messageQueue=[],this.onopen&&this.onopen(e),this.dispatchEvent(c2(e))};_handleMessage=e=>{this._debug(`message event`),this.onmessage&&this.onmessage(e),this.dispatchEvent(c2(e))};_handleError=e=>{this._debug(`error event`,e.message),this._disconnect(void 0,e.message===`TIMEOUT`?`timeout`:void 0),this.onerror&&this.onerror(e),this._debug(`exec error listeners`),this.dispatchEvent(c2(e)),this._connect()};_handleClose=e=>{this._debug(`close event`),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(e),this.dispatchEvent(c2(e))};_removeListeners(){this._ws&&(this._debug(`removeListeners`),this._ws.removeEventListener(`open`,this._handleOpen),this._ws.removeEventListener(`close`,this._handleClose),this._ws.removeEventListener(`message`,this._handleMessage),this._ws.removeEventListener(`error`,this._handleError))}_addListeners(){this._ws&&(this._debug(`addListeners`),this._ws.addEventListener(`open`,this._handleOpen),this._ws.addEventListener(`close`,this._handleClose),this._ws.addEventListener(`message`,this._handleMessage),this._ws.addEventListener(`error`,this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}},f2=e=>e[1]!==null&&e[1]!==void 0;function p2(){if(crypto?.randomUUID)return crypto.randomUUID();let e=Date.now(),t=performance?.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(n){let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n===`x`?r:r&3|8).toString(16)})}function m2(e,t,n={}){let{host:r,path:i,protocol:a,room:o,party:s,basePath:c,prefix:l,query:u}=e,d=r.replace(/^(http|https|ws|wss):\/\//,``);if(d.endsWith(`/`)&&(d=d.slice(0,-1)),i?.startsWith(`/`))throw Error(`path must not start with a slash`);let f=s??`main`,p=i?`/${i}`:``,m=a||(d.startsWith(`localhost:`)||d.startsWith(`127.0.0.1:`)||d.startsWith(`192.168.`)||d.startsWith(`10.`)||d.startsWith(`172.`)&&d.split(`.`)[1]>=`16`&&d.split(`.`)[1]<=`31`||d.startsWith(`[::ffff:7f00:1]:`)?t:`${t}s`),h=`${m}://${d}/${c||`${l||`parties`}/${f}/${o}`}${p}`,g=(e={})=>`${h}?${new URLSearchParams([...Object.entries(n),...Object.entries(e).filter(f2)])}`,_=typeof u==`function`?async()=>g(await u()):g(u);return{host:d,path:p,room:o,name:f,protocol:m,partyUrl:h,urlProvider:_}}var h2=class extends d2{_pk;_pkurl;name;room;host;path;basePath;constructor(e){let t=g2(e);if(super(t.urlProvider,t.protocols,t.socketOptions),this.partySocketOptions=e,this.setWSProperties(t),!e.startClosed&&!this.room&&!this.basePath)throw this.close(),Error(`Either room or basePath must be provided to connect. Use startClosed: true to create a socket and set them via updateProperties before calling reconnect().`);e.disableNameValidation||(e.party?.includes(`/`)&&console.warn(`PartySocket: party name "${e.party}" contains forward slash which may cause routing issues. Consider using a name without forward slashes or set disableNameValidation: true to bypass this warning.`),e.room?.includes(`/`)&&console.warn(`PartySocket: room name "${e.room}" contains forward slash which may cause routing issues. Consider using a name without forward slashes or set disableNameValidation: true to bypass this warning.`))}updateProperties(e){let t=g2({...this.partySocketOptions,...e,host:e.host??this.host,room:e.room??this.room,path:e.path??this.path,basePath:e.basePath??this.basePath});this._url=t.urlProvider,this._protocols=t.protocols,this._options=t.socketOptions,this.setWSProperties(t)}setWSProperties(e){let{_pk:t,_pkurl:n,name:r,room:i,host:a,path:o,basePath:s}=e;this._pk=t,this._pkurl=n,this.name=r,this.room=i,this.host=a,this.path=o,this.basePath=s}reconnect(e,t){if(!this.host)throw Error("The host must be set before connecting, use `updateProperties` method to set it or pass it to the constructor.");if(!this.room&&!this.basePath)throw Error("The room (or basePath) must be set before connecting, use `updateProperties` method to set it or pass it to the constructor.");super.reconnect(e,t)}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(e,t){let n=m2(e,`http`),r=typeof n.urlProvider==`string`?n.urlProvider:await n.urlProvider();return(e.fetch??fetch)(r,t)}};function g2(e){let{id:t,host:n,path:r,party:i,room:a,protocol:o,query:s,protocols:c,...l}=e,u=t||p2(),d=m2(e,`ws`,{_pk:u});return{_pk:u,_pkurl:d.partyUrl,name:d.name,room:d.room,host:d.host,path:d.path,basePath:e.basePath,protocols:c,socketOptions:l,urlProvider:d.urlProvider}}function _2(e){return new Proxy({},{get:(t,n)=>{if(!(typeof n==`symbol`||n===`toJSON`||n===`then`||n===`catch`||n===`finally`||n===`valueOf`||n===`toString`||n===`constructor`||n===`prototype`||n===`$$typeof`||n===`@@toStringTag`||n===`asymmetricMatch`||n===`nodeType`))return(...t)=>e(n,t)}})}var v2=(e,t)=>{let n=(0,z.useRef)(t);n.current=t,(0,z.useEffect)(()=>{let t=e=>n.current?.onOpen?.(e),r=e=>n.current?.onMessage?.(e),i=e=>n.current?.onClose?.(e),a=e=>n.current?.onError?.(e);return e.addEventListener(`open`,t),e.addEventListener(`close`,i),e.addEventListener(`error`,a),e.addEventListener(`message`,r),()=>{e.removeEventListener(`open`,t),e.removeEventListener(`close`,i),e.removeEventListener(`error`,a),e.removeEventListener(`message`,r)}},[e])},y2=e=>[e.startClosed,e.minUptime,e.maxRetries,e.connectionTimeout,e.maxEnqueuedMessages,e.maxReconnectionDelay,e.minReconnectionDelay,e.reconnectionDelayGrowFactor,e.debug];function b2({options:e,createSocket:t,createSocketMemoKey:n}){let{enabled:r=!0}=e,i=(0,z.useMemo)(()=>e,[n(e)]),[a,o]=(0,z.useState)(()=>t({...i,startClosed:!0})),s=(0,z.useRef)(null),c=(0,z.useRef)(t);c.current=t;let l=(0,z.useRef)(r),u=(0,z.useRef)(i),d=(0,z.useRef)(!1);return(0,z.useEffect)(()=>{let e=u.current!==i;if(u.current=i,!r)return a.close(),l.current=r,e&&(d.current=!0),()=>{a.close()};if(!l.current&&r){l.current=r;let t=e||d.current;if(d.current=!1,!t)return a.reconnect(),()=>{a.close()};let n=c.current({...i,startClosed:!0});return o(n),()=>{n.close()}}if(l.current=r,s.current===a)if(e){let e=c.current({...i,startClosed:!0});return o(e),()=>{e.close()}}else return i.startClosed!==!0&&a.reconnect(),()=>{a.close()};else return s.current?s.current!==a&&a.reconnect():i.startClosed!==!0&&a.reconnect(),s.current=a,()=>{a.close()}},[a,i,r]),a}function x2(e){let{host:t,...n}=e,r=b2({options:{host:t||(typeof window<`u`?window.location.host:`dummy-domain.com`),...n},createSocket:e=>new h2(e),createSocketMemoKey:e=>JSON.stringify([e.query,e.id,e.host,e.room,e.party,e.path,e.protocol,e.protocols,e.basePath,e.prefix,...y2(e)])});return v2(r,e),r}var S2=new Map;function C2(e,t,n){return JSON.stringify([e,t||`default`,...n])}function w2(e){let t=S2.get(e);if(t){if(Date.now()>=t.expiresAt){S2.delete(e);return}return t}}function T2(e,t,n){let r={promise:t,expiresAt:Date.now()+n};return S2.set(e,r),r}function E2(e){S2.delete(e)}function D2(e){let t=$0(e.agent),{query:n,queryDeps:r,cacheTtl:i,...a}=e,o=(0,z.useRef)(new Map),s=(0,z.useMemo)(()=>C2(t,e.name,r||[]),[t,e.name,r]),c=(0,z.useRef)(s);c.current=s;let l=i??300*1e3,[u,d]=(0,z.useState)(0),f=n&&typeof n==`function`,[p,m]=(0,z.useState)(!1),h=(0,z.useMemo)(()=>{if(!n||typeof n!=`function`)return null;let t=w2(s);if(t)return t.promise;let r=n().catch(t=>{throw console.error(`[useAgent] Query failed for agent "${e.agent}":`,t),E2(s),t});return T2(s,r,l),r},[s,n,e.agent,l,u]);(0,z.useEffect)(()=>{if(!h||l<=0)return;let e=w2(s);if(!e)return;let t=e.expiresAt-Date.now(),n=setTimeout(()=>{E2(s),d(Date.now())},Math.max(0,t));return()=>clearTimeout(n)},[s,h,l]);let g;if(n)if(typeof n==`function`){let e=(0,z.use)(h);if(e){for(let[t,n]of Object.entries(e))n!=null&&typeof n!=`string`&&typeof n!=`number`&&typeof n!=`boolean`&&console.warn(`[useAgent] Query parameter "${t}" is an object and will be converted to "[object Object]". Query parameters should be string, number, boolean, or null.`);g=e}}else g=n;(0,z.useEffect)(()=>{p&&g!==void 0&&m(!1)},[p,g]);let[_,v]=(0,z.useState)(void 0),[y,b]=(0,z.useState)({name:e.name||`default`,agent:t,identified:!1}),x=(0,z.useRef)({name:null,agent:null}),S=(0,z.useRef)(void 0),C=()=>{let e;S.current={promise:new Promise(t=>{e=t}),resolve:e}};S.current||C();let w=e.basePath?{basePath:e.basePath,path:e.path,query:g,...a}:{party:t,prefix:`agents`,room:e.name||`default`,path:e.path,query:g,...a},T=!p&&(a.enabled??!0),E=x2({...w,enabled:T,onMessage:t=>{if(typeof t.data==`string`){let n;try{n=JSON.parse(t.data)}catch{return e.onMessage?.(t)}if(n.type===Q0.CF_AGENT_IDENTITY){let t=x.current.name,r=x.current.agent,i=n.name,a=n.agent;if(b({name:i,agent:a,identified:!0}),S.current?.resolve(),t!==null&&r!==null&&(t!==i||r!==a))if(e.onIdentityChange)e.onIdentityChange(t,i,r,a);else{let e=r!==a,n=t!==i,o=``;o=e&&n?`agent "${r}" → "${a}", instance "${t}" → "${i}"`:e?`agent "${r}" → "${a}"`:`instance "${t}" → "${i}"`,console.warn(`[agents] Identity changed on reconnect: ${o}. This can happen with server-side routing (e.g., basePath with getAgentByName) where the instance is determined by auth/session. Provide onIdentityChange callback to handle this explicitly, or ignore if this is expected for your routing pattern.`)}x.current={name:i,agent:a},e.onIdentity?.(i,a);return}if(n.type===Q0.CF_AGENT_STATE){v(n.state),e.onStateUpdate?.(n.state,`server`);return}if(n.type===Q0.CF_AGENT_STATE_ERROR){e.onStateUpdateError?.(n.error);return}if(n.type===Q0.CF_AGENT_MCP_SERVERS){e.onMcpUpdate?.(n.mcp);return}if(n.type===Q0.RPC){let e=n,t=o.current.get(e.id);if(!t)return;if(!e.success){t.reject(Error(e.error)),o.current.delete(e.id),t.stream?.onError?.(e.error);return}`done`in e?e.done?(t.resolve(e.result),o.current.delete(e.id),t.stream?.onDone?.(e.result)):t.stream?.onChunk?.(e.result):(t.resolve(e.result),o.current.delete(e.id));return}}e.onMessage?.(t)},onClose:t=>{C(),b(e=>({...e,identified:!1})),f&&m(!0),E2(c.current),d(Date.now());let n=Error(`Connection closed`);for(let e of o.current.values())e.reject(n),e.stream?.onError?.(`Connection closed`);o.current.clear(),e.onClose?.(t)}}),D=(0,z.useCallback)((e,t=[],n)=>new Promise((r,i)=>{let a=crypto.randomUUID();o.current.set(a,{reject:i,resolve:r,stream:n});let s={args:t,id:a,method:e,type:Q0.RPC};E.send(JSON.stringify(s))}),[E]);return E.setState=t=>{E.send(JSON.stringify({state:t,type:Q0.CF_AGENT_STATE})),v(t),e.onStateUpdate?.(t,`client`)},E.call=D,E.agent=y.agent,E.name=y.name,E.identified=y.identified,E.ready=S.current.promise,E.state=_,E.stub=(0,z.useMemo)(()=>_2(D),[D]),E.getHttpUrl=()=>(E._url||E._pkurl||``).replace(`ws://`,`http://`).replace(`wss://`,`https://`),y.agent!==y.agent.toLowerCase()&&console.warn(`Agent name: `+y.agent+` should probably be in lowercase. Received: `+y.agent),E}function O2(e){let{agent:t,host:n,basePath:r,chatId:i,authToken:a,toolContext:o,connectionParams:s,welcomeMessage:c,onConnectionStatusChange:l,onOpen:u,onClose:d,onError:f}=e,[p,m]=z.useState(`connecting`),h=z.useCallback(e=>{m(e),l?.(e)},[l]),g={},_=[];a&&(g.Authorization=`Bearer ${a}`,_.push(`bearer`,a));let v=D2({agent:t,host:n,basePath:r,name:i,query:s??{},queryDeps:Object.keys(s??{}),onOpen:e=>{h(`connected`),u?.(e)},onClose:e=>{if(e.code>=3e3){h(`unauthorized`),v.close(),d?.(e);return}h(`disconnected`),d?.(e)},onError:f,protocols:_}),y=Z0({agent:v,body:o??{},headers:g}),b=z.useRef(!1);return z.useEffect(()=>{c&&p===`connected`&&y.messages.length===0&&!b.current&&(b.current=!0,y.setMessages([{id:`welcome-message`,role:`assistant`,parts:[{type:`text`,text:c}]}]))},[p,y.messages.length,c]),{agent:v,chat:y,connectionStatus:p}}function k2({part:e,partIndex:t,showTools:n}){if(Y1(e))return(0,U.jsx)(lE,{children:e.text},t);if($1(e)){if(!n)return null;let r=t0(e);return(0,U.jsxs)(hU,{defaultOpen:e.state===`output-error`,children:[e.type===`dynamic-tool`?(0,U.jsx)(yU,{state:e.state,title:r,toolName:r,type:`dynamic-tool`}):(0,U.jsx)(yU,{state:e.state,title:r,type:e.type}),(0,U.jsxs)(bU,{children:[(0,U.jsx)(xU,{input:e.input}),(0,U.jsx)(SU,{errorText:e.errorText,output:e.output})]})]},t)}return e.type===`source-url`?(0,U.jsx)(CB,{href:e.url,title:e.title??e.url},t):e.type===`source-document`?(0,U.jsx)(CB,{href:`#${e.sourceId}`,title:e.title},t):null}function A2({message:e,isStreaming:t,showTools:n,showReasoning:r,showRatings:i,rating:a,onRate:o}){let s=e.parts.filter(e=>e.type===`source-url`||e.type===`source-document`),c=e.parts.filter(e=>e.type!==`source-url`&&e.type!==`source-document`),l=c.filter(X1),u=c.filter(e=>!X1(e)),d=l.map(e=>e.text).join(`
317
+
318
+ ---
319
+
320
+ `),f=u.some(Y1),p=!t&&!f&&l.length>0;return(0,U.jsx)(eE,{from:e.role,children:(0,U.jsxs)(`div`,{children:[s.length>0&&(0,U.jsxs)(bB,{children:[(0,U.jsx)(xB,{count:s.length}),(0,U.jsx)(SB,{children:s.map((e,t)=>e.type===`source-url`?(0,U.jsx)(CB,{href:e.url,title:e.title??e.url},t):(0,U.jsx)(CB,{href:`#${e.sourceId}`,title:e.title},t))})]}),(0,U.jsx)(tE,{children:p?(0,U.jsx)(lE,{children:d}):(0,U.jsxs)(U.Fragment,{children:[d&&r&&(0,U.jsxs)(hB,{defaultOpen:!1,isStreaming:t,children:[(0,U.jsx)(_B,{}),(0,U.jsx)(yB,{children:d})]}),u.map((e,r)=>(0,U.jsx)(k2,{isStreaming:t,part:e,partIndex:r,showTools:n},r))]})}),e.role===`assistant`&&i&&o&&(0,U.jsx)(uE,{messageId:e.id,rating:a,onRate:o})]})})}var j2=({attachment:e,onRemove:t})=>(0,U.jsxs)(ku,{data:e,onRemove:(0,z.useCallback)(()=>{t(e.id)},[t,e.id]),children:[(0,U.jsx)(Au,{}),(0,U.jsx)(ju,{})]}),M2=()=>{let e=qO(),t=(0,z.useCallback)(t=>{e.remove(t)},[e]);return e.files.length===0?null:(0,U.jsx)(Ou,{variant:`inline`,children:e.files.map(e=>(0,U.jsx)(j2,{attachment:e,onRemove:t},e.id))})},N2=({chatId:e,host:t,agentName:n,agentUrl:r,authToken:i,body:a,query:o,welcomeMessage:s,onAgentChange:c,onConnectionStatusChange:l,onRetry:u,onUnauthorized:d,showTools:f=!0,showReasoning:p=!0,showRatings:m=!0})=>{let[h,g]=(0,z.useState)(``),[_,v]=(0,z.useState)(!1),[y,b]=(0,z.useState)({}),{agent:x,chat:S,connectionStatus:C}=O2({agent:n,host:t,chatId:e,authToken:i,toolContext:a??{},connectionParams:o??{},onConnectionStatusChange:l,welcomeMessage:s,onClose:e=>{e.code>=3e3&&d?.(e.reason??``)}});(0,z.useEffect)(()=>(c?.(x),()=>{c?.(null)}),[x,c]),(0,z.useEffect)(()=>{x&&C===`connected`&&x.call(`getMessageRatings`).then(e=>{e&&typeof e==`object`&&b(e)}).catch(()=>{})},[x,C]);let{messages:w,sendMessage:T,status:E,stop:D}=S,O=(0,z.useMemo)(()=>w.filter(e=>e.role!==`system`),[w]),k=(0,z.useCallback)(e=>{let t=!!e.text?.trim(),n=!!e.files?.length;if(!(t||n))return;let r=[];if(e.text?.trim()&&r.push({type:`text`,text:e.text.trim()}),e.files?.length)for(let t of e.files)r.push({type:`text`,text:`[Attachment: ${t.filename??`file`}]`});T({role:`user`,parts:r}),g(``),e.files?.length&&rt.success(`Files attached`,{description:`${e.files.length} file(s) attached to message`})},[T]),A=(0,z.useCallback)(e=>{g(t=>t?`${t} ${e}`:e)},[]),j=(0,z.useCallback)(e=>{g(e.target.value)},[]),M=(0,z.useCallback)(()=>{v(e=>!e)},[]),ee=(0,z.useCallback)(async(e,t)=>{if(b(n=>({...n,[e]:t})),x)try{await x.call(`rateMessage`,[e,t])}catch(e){console.error(`[Chatbot] Failed to rate message`,e)}},[x]),N=(0,z.useMemo)(()=>String(E)===`idle`||String(E)===`ready`?`ready`:E===`submitted`||E===`streaming`||E===`error`?E:`ready`,[E]),P=(0,z.useMemo)(()=>{if(N!==`submitted`&&N!==`streaming`)return!1;let e=O.at(-1);if(!e||e.role===`user`)return!0;if(e.role===`assistant`){let t=e.parts?.some(e=>e.type===`text`),n=e.parts?.some(e=>e.type===`reasoning`);return!t&&!n}return!1},[N,O]),F=(0,z.useMemo)(()=>!h.trim()||N===`streaming`||N===`submitted`,[h,N]);return C===`connecting`?(0,U.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-3 text-muted-foreground`,children:[(0,U.jsx)(`div`,{className:`h-6 w-6 rounded-full border-2 border-zinc-300 border-t-zinc-600 animate-spin`}),(0,U.jsx)(`p`,{className:`text-sm`,children:`Connecting to agent...`})]}):C===`disconnected`?(0,U.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`h-10 w-10 rounded-full bg-red-50 flex items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Unable to connect`}),r&&(0,U.jsxs)(`p`,{className:`text-xs text-muted-foreground max-w-xs`,children:[`Could not reach `,(0,U.jsx)(`span`,{className:`font-mono`,children:r}),`. Check the URL and make sure the agent is running.`]})]}),u&&(0,U.jsx)(`button`,{className:`text-xs text-muted-foreground underline underline-offset-2 hover:text-foreground transition-colors`,onClick:u,children:`Try again`})]}):(0,U.jsxs)(`div`,{className:`relative flex size-full flex-col divide-y overflow-hidden`,children:[(0,U.jsxs)(Gu,{children:[(0,U.jsxs)(Ku,{children:[O.map((e,t)=>(0,U.jsx)(oE,{defaultBranch:0,children:(0,U.jsx)(sE,{children:(0,U.jsx)(A2,{isStreaming:N===`streaming`&&t===O.length-1,message:e,showTools:f,showReasoning:p,showRatings:m,rating:y[e.id],onRate:ee})})},e.id)),P&&(0,U.jsx)(eE,{from:`assistant`,children:(0,U.jsx)(tE,{children:(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground text-sm`,children:[(0,U.jsx)(RO,{className:`size-3.5 shrink-0`}),(0,U.jsx)(`span`,{children:`Thinking...`})]})})})]}),(0,U.jsx)(qu,{})]}),(0,U.jsx)(`div`,{className:`grid shrink-0 gap-4 pt-4`,children:(0,U.jsx)(`div`,{className:`w-full px-4 pb-4`,children:(0,U.jsxs)(XO,{globalDrop:!0,multiple:!0,onSubmit:k,children:[(0,U.jsx)($O,{children:(0,U.jsx)(M2,{})}),(0,U.jsx)(ZO,{children:(0,U.jsx)(QO,{onChange:j,value:h})}),(0,U.jsxs)(ek,{children:[(0,U.jsxs)(tk,{children:[(0,U.jsxs)(rk,{children:[(0,U.jsx)(ik,{}),(0,U.jsx)(ak,{children:(0,U.jsx)(YO,{})})]}),(0,U.jsx)(TB,{className:`shrink-0`,onTranscriptionChange:A,size:`icon-sm`,variant:`ghost`}),(0,U.jsxs)(nk,{onClick:M,variant:_?`default`:`ghost`,children:[(0,U.jsx)(tu,{size:16}),(0,U.jsx)(`span`,{children:`Search`})]})]}),(0,U.jsx)(ok,{disabled:F,onStop:D,status:N})]})]})})})]})};function P2({className:e,size:t=`default`,...n}){return(0,U.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:H(`group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function F2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-header`,className:H(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3`,e),...t})}function I2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-title`,className:H(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,e),...t})}function L2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`card-description`,className:H(`text-sm text-muted-foreground`,e),...t})}function R2({...e}){return(0,U.jsx)(nD,{"data-slot":`sheet`,...e})}function z2({...e}){return(0,U.jsx)(iD,{"data-slot":`sheet-trigger`,...e})}function B2({...e}){return(0,U.jsx)(RE,{"data-slot":`sheet-portal`,...e})}function V2({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,U.jsx)(B2,{children:(0,U.jsxs)(IE,{"data-slot":`sheet-content`,"data-side":n,className:H(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm`,e),...i,children:[t,r&&(0,U.jsx)(bE,{"data-slot":`sheet-close`,render:(0,U.jsxs)($n,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,U.jsx)(bu,{}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})})}function H2({className:e,...t}){return(0,U.jsx)(`div`,{"data-slot":`sheet-header`,className:H(`flex flex-col gap-0.5 p-4`,e),...t})}function U2({className:e,...t}){return(0,U.jsx)(rD,{"data-slot":`sheet-title`,className:H(`cn-font-heading text-base font-medium text-foreground`,e),...t})}function W2({className:e,...t}){return(0,U.jsx)(xE,{"data-slot":`sheet-description`,className:H(`text-sm text-muted-foreground`,e),...t})}function G2(e){return!e||typeof e!=`object`?!1:`durable_object_name`in e||`title`in e||`summary`in e||`created_at`in e||`updated_at`in e}function K2(e){return Array.isArray(e)?{rows:e.filter(G2),supported:!0}:{rows:[],supported:!1}}function q2(e){if(e==null||e===``)return`Unknown time`;let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown time`:new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(t)}function J2(e){let t=e?.trim();return t?t.length>180?`${t.slice(0,177)}...`:t:`No summary available yet.`}function Y2(e){return e.title?.trim()||`Untitled conversation`}function X2(e){let t=e.indexOf(`:`);return t===-1?e:e.slice(t+1)}function Z2({agent:e,connectionStatus:t,currentChatId:n,onConversationClick:r}){let[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)([]),[c,l]=(0,z.useState)(`disconnected`),[u,d]=(0,z.useState)(null),[f,p]=(0,z.useState)(null),m=(0,z.useMemo)(()=>t===`unauthorized`?{title:`Unauthorized`,description:`Reconnect with valid credentials to load conversations.`}:{title:`Disconnected`,description:`Connect to the agent to load conversations for the active identity.`},[t]),h=(0,z.useCallback)(async()=>{if(!e){l(t===`unauthorized`?`unauthorized`:`disconnected`),d(null);return}if(t!==`connected`){l(t===`unauthorized`?`unauthorized`:`disconnected`),d(null);return}l(`loading`),d(null);try{let{rows:t,supported:n}=K2(await e.call(`getConversations`));s(t),p(new Date().toISOString()),l(n?t.length>0?`ready`:`empty`:`unsupported`)}catch(e){d(e instanceof Error?e.message:String(e)),l(`error`)}},[e,t]);return(0,z.useEffect)(()=>{if(t===`connected`&&e&&!i){h();return}if(i){if(t===`connected`&&e){h();return}l(t===`unauthorized`?`unauthorized`:`disconnected`),d(null)}},[i,t,h]),(0,U.jsxs)(R2,{open:i,onOpenChange:a,children:[(0,U.jsxs)(yd,{children:[(0,U.jsx)(bd,{render:(0,U.jsx)(z2,{render:(0,U.jsx)($n,{"aria-label":`Conversation history`,title:`Conversation history`,size:`icon-sm`,variant:`outline`,className:`relative`})}),children:(0,U.jsx)(ou,{className:`size-4`})}),(0,U.jsx)(xd,{children:(0,U.jsx)(`p`,{children:`Conversation history`})})]}),(0,U.jsxs)(V2,{className:`gap-0`,children:[(0,U.jsxs)(H2,{children:[(0,U.jsxs)(U2,{children:[`Conversation history`,(0,U.jsx)($n,{"aria-label":`Refresh conversations`,className:`absolute top-3 right-10`,onClick:()=>void h(),size:`icon-sm`,variant:`ghost`,children:(0,U.jsx)(du,{className:`size-4`})})]}),(0,U.jsx)(W2,{children:`Recent conversations for the connected identity.`})]}),(0,U.jsx)(`div`,{className:`border-b px-4 pb-3 text-xs text-muted-foreground`,children:f?(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(Yl,{className:`size-3.5`}),`Last refreshed`,` `,new Intl.DateTimeFormat(void 0,{timeStyle:`short`}).format(new Date(f))]}):(0,U.jsx)(`span`,{children:`Open the panel to load conversations from the current session.`})}),(0,U.jsxs)(`div`,{className:`overflow-y-auto`,children:[c===`loading`&&(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center px-4`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,U.jsx)(RO,{className:`size-4`}),`Loading conversations...`]})}),c===`unauthorized`||c===`disconnected`?(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center px-4`,children:(0,U.jsx)(P2,{size:`sm`,className:`w-full border-dashed`,children:(0,U.jsxs)(F2,{children:[(0,U.jsx)(I2,{className:`text-sm`,children:m.title}),(0,U.jsx)(L2,{children:m.description})]})})}):null,c===`error`?(0,U.jsxs)(`div`,{className:` items-center justify-center p-4`,children:[(0,U.jsx)(`p`,{className:`text-red-600`,children:`Could not load conversations`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:u??`An unexpected error occurred while loading the conversation list.`}),(0,U.jsx)($n,{onClick:()=>void h(),size:`sm`,variant:`outline`,children:`Retry`})]}):null,c===`empty`?(0,U.jsxs)(`div`,{className:` items-center justify-center p-4`,children:[(0,U.jsx)(`p`,{children:`No conversations yet`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This identity has not created any saved conversations.`})]}):null,c===`unsupported`?(0,U.jsxs)(`div`,{className:` items-center justify-center p-4`,children:[(0,U.jsx)(`p`,{children:`Conversations unavailable`}),(0,U.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This agent does not expose saved conversations for the current identity.`})]}):null,c===`ready`?(0,U.jsx)(`div`,{className:`flex flex-col gap-3 p-4`,children:o.map((e,t)=>{let i=X2(e.durable_object_name??``);return(0,U.jsx)(`article`,{className:[`rounded-lg border bg-card p-3 shadow-sm transition-shadow hover:shadow-md cursor-pointer`,n&&i===n?`ring-2 ring-primary border-primary`:``].filter(Boolean).join(` `),onClick:()=>{a(!1),r(i)},children:(0,U.jsxs)(`div`,{className:`flex flex-col justify-between gap-2`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex gap-x-2 items-center`,children:[(0,U.jsx)(`h3`,{className:`truncate text-sm font-medium`,children:Y2(e)}),(0,U.jsx)(`time`,{className:`shrink-0 text-[11px] text-muted-foreground ml-auto`,children:q2(e.updated_at)})]}),(0,U.jsx)(`p`,{className:`mt-1 line-clamp-3 text-xs leading-relaxed text-muted-foreground`,children:J2(e.summary)})]})},e.durable_object_name??`${e.updated_at??t}`)})}):null]})]})]})}var Q2=z.createContext(void 0);function $2(e){let t=z.useContext(Q2);if(t===void 0&&!e)throw Error(hn(47));return t}function e4(){return{...Cc(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}var t4={...Tc,disabled:W(e=>e.disabled),instantType:W(e=>e.instantType),openMethod:W(e=>e.openMethod),openChangeReason:W(e=>e.openChangeReason),modal:W(e=>e.modal),focusManagerModal:W(e=>e.focusManagerModal),stickIfOpen:W(e=>e.stickIfOpen),titleElementId:W(e=>e.titleElementId),descriptionElementId:W(e=>e.descriptionElementId),openOnHover:W(e=>e.openOnHover),closeDelay:W(e=>e.closeDelay),hasViewport:W(e=>e.hasViewport)},n4=class e extends sc{constructor(e){let t={...e4(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:z.createRef(),backdropRef:z.createRef(),internalBackdropRef:z.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:z.createRef(),beforeContentFocusGuardRef:z.createRef(),stickIfOpenTimeout:new ir,triggerElements:new xc},t4)}setOpen=(e,t)=>{let n=t.reason===jr,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let a=()=>{let n={open:e,openChangeReason:t.reason},r=t.trigger?.id??null;(r||e)&&(n.activeTriggerId=r,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set(`stickIfOpen`,!0),this.context.stickIfOpenTimeout.start(500,()=>{this.set(`stickIfOpen`,!1)}),He.flushSync(a)):a(),r||i?this.set(`instantType`,r?`click`:`dismiss`):t.reason===`focus-out`?this.set(`instantType`,`focus`):this.set(`instantType`,void 0)};static useStore(t,n){let r=Gt(()=>new e(n)).current,i=t??r;return nr(r.disposeEffect),i}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()};function r4({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=n4.useStore(s?.store,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});er(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a);let{openMethod:p,triggerProps:m}=XE(d);yc(u);let{forceUnmount:h}=bc(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});z.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);let g=z.useCallback(e=>{let t=Ur(e);return t.preventUnmountOnClose=()=>{u.set(`preventUnmountingOnClose`,!0)},t},[u]),_=z.useCallback(()=>{u.setOpen(!1,g(Hr))},[u,g]);z.useImperativeHandle(e.actionsRef,()=>({unmount:h,close:_}),[h,_]);let v=Oc({popupStore:u,onOpenChange:u.setOpen}),{getReferenceProps:y,getFloatingProps:b,getTriggerProps:x}=zc([Mo(v,{outsidePressEvent:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),Zc(v)]),S=z.useMemo(()=>y(m),[y,m]),C=z.useMemo(()=>x(m),[x,m]),w=z.useMemo(()=>b(),[b]);u.useSyncedValues({modal:o,openMethod:p,activeTriggerProps:S,inactiveTriggerProps:C,popupProps:w,floatingRootContext:v,nested:co()!=null});let T=z.useMemo(()=>({store:u}),[u]);return(0,U.jsx)(Q2.Provider,{value:T,children:typeof t==`function`?t({payload:f}):t})}function i4(e){return $2(!0)?(0,U.jsx)(r4,{props:e}):(0,U.jsx)(po,{children:(0,U.jsx)(r4,{props:e})})}var a4=z.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,handle:o,payload:s,openOnHover:c=!1,delay:l=300,closeDelay:u=0,id:d,style:f,...p}=e,m=$2(!0),h=o?.store??m?.store;if(!h)throw Error(hn(74));let g=vl(d),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=z.useRef(null),{registerTrigger:x,isMountedByThisTrigger:S}=vc(g,b,h,{payload:s,disabled:i,openOnHover:c,closeDelay:u}),C=h.useState(`openChangeReason`),w=h.useState(`stickIfOpen`),T=h.useState(`openMethod`),E=h.useState(`focusManagerModal`),D=Rc(v,{enabled:v!=null&&c&&(T!==`touch`||C!==`trigger-press`),mouseOnly:!0,move:!1,handleClose:ol(),restMs:l,delay:{close:u},triggerElementRef:b,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),O=zc([To(v,{enabled:v!=null,stickIfOpen:w})]),k=h.useState(`triggerProps`,S),A={disabled:i,open:y},{getButtonProps:j,buttonRef:M}=yn({disabled:i,native:a}),ee=z.useMemo(()=>({open(e){return e&&C===`trigger-press`?gl.open(e):hl.open(e)}}),[C]),N=Hn(`button`,e,{state:A,ref:[M,t,x,b],props:[O.getReferenceProps(),D,k,{[Rn]:``,id:g},p,j],stateAttributesMapping:ee}),{preFocusGuardRef:P,handlePreFocusGuardFocus:F,handleFocusTargetFocus:te}=CO(h,b);return _&&!E?(0,U.jsxs)(z.Fragment,{children:[(0,U.jsx)(ai,{ref:P,onFocus:F}),(0,U.jsx)(z.Fragment,{children:N},g),(0,U.jsx)(ai,{ref:h.context.triggerFocusTargetRef,onFocus:te})]}):(0,U.jsx)(z.Fragment,{children:N},g)}),o4=z.createContext(void 0);function s4(){let e=z.useContext(o4);if(e===void 0)throw Error(hn(45));return e}var c4=z.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=$2();return i.useState(`mounted`)||n?(0,U.jsx)(o4.Provider,{value:n,children:(0,U.jsx)(ro,{ref:t,...r})}):null}),l4=z.createContext(void 0);function u4(){let e=z.useContext(l4);if(!e)throw Error(hn(46));return e}var d4=z.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Bn,style:g,..._}=e,{store:v}=$2(),y=s4(),b=uo(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),w=v.useState(`openChangeReason`),T=v.useState(`activeTriggerElement`),E=v.useState(`modal`),D=v.useState(`openMethod`),O=v.useState(`positionerElement`),k=v.useState(`instantType`),A=v.useState(`transitionStatus`),j=v.useState(`hasViewport`),M=z.useRef(null),ee=hc(O,!1,!1),N=Ol({anchor:i,floatingRootContext:x,positionMethod:a,mounted:S,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:y,nodeId:b,collisionAvoidance:h,adaptiveOrigin:j?Tl:void 0}),P=x.useState(`domReferenceElement`);V(()=>{let e=P,t=M.current;if(e&&(M.current=e),t&&e&&e!==t){v.set(`instantType`,void 0);let e=new AbortController;return ee(()=>{v.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,ee,v]);let F={open:C,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:k};lO(C&&E===!0&&w!==`trigger-hover`,D===`touch`,O,T);let te=z.useCallback(e=>{v.set(`positionerElement`,e)},[v]),I=jl(e,F,{styles:N.positionerStyles,transitionStatus:A,props:_,refs:[t,te],hidden:!S,inert:!C});return(0,U.jsxs)(l4.Provider,{value:N,children:[S&&E===!0&&w!==`trigger-hover`&&(0,U.jsx)(LE,{ref:v.context.internalBackdropRef,inert:Ml(!C),cutout:T}),(0,U.jsx)(fo,{id:b,children:I})]})}),f4=z.createContext(void 0);function p4(){let[e,t]=z.useState(0),n=B(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:z.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function m4(e){let{value:t,children:n}=e;return(0,U.jsx)(f4.Provider,{value:t,children:n})}var h4={..._l,...mc},g4=z.forwardRef(function(e,t){let{className:n,render:r,initialFocus:i,finalFocus:a,style:o,...s}=e,{store:c}=$2(),l=u4(),u=QD(!0)!=null,{context:d,hasClosePart:f}=p4(),p=c.useState(`open`),m=c.useState(`openMethod`),h=c.useState(`instantType`),g=c.useState(`transitionStatus`),_=c.useState(`popupProps`),v=c.useState(`titleElementId`),y=c.useState(`descriptionElementId`),b=c.useState(`modal`),x=c.useState(`mounted`),S=c.useState(`openChangeReason`),C=c.useState(`activeTriggerElement`),w=c.useState(`floatingRootContext`);gc({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}});let T=c.useState(`disabled`),E=c.useState(`openOnHover`),D=c.useState(`closeDelay`);Ic(w,{enabled:E&&!T,closeDelay:D});function O(e){return e===`touch`?c.context.popupRef.current:!0}let k=i===void 0?O:i,A={open:p,side:l.side,align:l.align,instant:h,transitionStatus:g},j=b!==!1&&f;c.useSyncedValue(`focusManagerModal`,j);let M=z.useCallback(e=>{c.set(`popupElement`,e)},[c]),ee=Hn(`div`,e,{state:A,ref:[t,c.context.popupRef,M],props:[_,{"aria-labelledby":v,"aria-describedby":y,onKeyDown(e){u&&PE.has(e.key)&&e.stopPropagation()}},Al(g),s],stateAttributesMapping:h4});return(0,U.jsx)(wo,{context:w,openInteractionType:m,modal:j,disabled:!x||S===`trigger-hover`,initialFocus:k,returnFocus:a,restoreFocus:`popup`,previousFocusableElement:Tt(C)?C:void 0,nextFocusableElement:c.context.triggerFocusTargetRef,beforeContentFocusGuardRef:c.context.beforeContentFocusGuardRef,children:(0,U.jsx)(m4,{value:d,children:ee})})});function _4({...e}){return(0,U.jsx)(i4,{"data-slot":`popover`,...e})}function v4({...e}){return(0,U.jsx)(a4,{"data-slot":`popover-trigger`,...e})}function y4({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,U.jsx)(c4,{children:(0,U.jsx)(d4,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,U.jsx)(g4,{"data-slot":`popover-content`,className:H(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}var b4=z.createContext(void 0);function x4(){let e=z.useContext(b4);if(e===void 0)throw Error(hn(63));return e}var S4=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),C4={..._D,checked(e){return e?{[S4.checked]:``}:{[S4.unchecked]:``}}};function w4(e,t,n,r=!0,i){let[a,o]=z.useState(),s=vl(i?`${i}-label`:void 0),c=e??t??a;return V(()=>{let i=e||t||!r?void 0:T4(n.current,s);a!==i&&o(i)}),c}function T4(e,t){let n=E4(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function E4(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var D4=z.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:o,id:s,inputRef:c,name:l,nativeButton:u=!1,onCheckedChange:d,readOnly:f=!1,required:p=!1,disabled:m=!1,render:h,uncheckedValue:g,value:_,style:v,...y}=e,{clearErrors:b}=xD(),{state:x,setTouched:S,setDirty:C,validityData:w,setFilled:T,setFocused:E,shouldValidateOnChange:D,validationMode:O,disabled:k,name:A,validation:j}=yD(),{labelId:M}=CD(),ee=k||m,N=A??l,P=B(d),F=z.useRef(null),te=Sn(F,c,j.inputRef),I=z.useRef(null),ne=vl(),re=ED({id:s,implicit:!1,controlRef:I}),ie=u?void 0:re,[L,ae]=wD({controlled:n,default:!!i,name:`Switch`,state:`checked`});TD(I,{id:ne,value:L}),V(()=>{F.current&&T(F.current.checked)},[F,T]),YE(L,()=>{b(N),C(L!==w.initialValue),T(L),D()?j.commit(L):j.commit(L,!0)});let{getButtonProps:R,buttonRef:oe}=yn({disabled:ee,native:u}),se=w4(a,M,F,!u,ie),ce={id:u?re:ne,role:`switch`,"aria-checked":L,"aria-readonly":f||void 0,"aria-required":p||void 0,"aria-labelledby":se,onFocus(){ee||E(!0)},onBlur(){let e=F.current;!e||ee||(S(!0),E(!1),O===`onBlur`&&j.commit(e.checked))},onClick(e){f||ee||(e.preventDefault(),F.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},le=z.useMemo(()=>$t({checked:L,disabled:ee,form:o,id:ie,name:N,required:p,style:N?ii:ri,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:te,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(f){e.preventDefault();return}let t=e.currentTarget.checked,n=Ur(kr,e.nativeEvent);P?.(t,n),!n.isCanceled&&ae(t)},onFocus(){I.current?.focus()}},j.getInputValidationProps,_===void 0?In:{value:_}),[L,ee,o,te,ie,N,P,f,p,ae,j,_]),ue=z.useMemo(()=>({...x,checked:L,disabled:ee,readOnly:f,required:p}),[x,L,ee,f,p]),de=Hn(`span`,e,{state:ue,ref:[t,I,oe],props:[ce,j.getValidationProps,y,R],stateAttributesMapping:C4});return(0,U.jsxs)(b4.Provider,{value:ue,children:[de,!L&&N&&g!==void 0&&(0,U.jsx)(`input`,{type:`hidden`,form:o,name:N,value:g}),(0,U.jsx)(`input`,{...le,suppressHydrationWarning:!0})]})}),O4=z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=yD(),s=x4();return Hn(`span`,e,{state:{...o,...s},ref:t,stateAttributesMapping:C4,props:a})});function k4({className:e,size:t=`default`,...n}){return(0,U.jsx)(D4,{"data-slot":`switch`,"data-size":t,className:H(`peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,U.jsx)(O4,{"data-slot":`switch-thumb`,className:`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground`})})}var A4=class extends z.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,U.jsx)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4 text-muted-foreground`,children:(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`h-10 w-10 rounded-full bg-red-50 flex items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Something went wrong`}),(0,U.jsx)(`p`,{className:`text-xs max-w-xs`,children:`Could not connect to the agent. Check the URL above and try again.`})]})}):this.props.children}};function j4(e){try{let t=JSON.parse(e);return typeof t==`object`&&!!t&&Object.keys(t).length>0}catch{return!1}}var M4=`{
321
+ "currentDateTime": "2026-04-13T11:57:17.858Z",
322
+ "tokens": {
323
+ "X-Economic-Token": "token_123"
324
+ },
325
+ "user": {
326
+ "guid": "guid_123";
327
+ "agreementNumber": "agreementNumber_123";
328
+ }
329
+ }`;function N4({body:e,onChange:t}){let[n,r]=(0,z.useState)(!1),[i,a]=(0,z.useState)(e),o=(0,z.useCallback)(t=>{t&&a(e),r(t)},[e]),s=(0,z.useCallback)(()=>{let e=i.trim();if(e&&e!==`{}`)try{JSON.parse(e)}catch{rt.error(`Invalid JSON — check the syntax and try again.`);return}t(e),r(!1)},[i,t]),c=j4(e);return(0,U.jsxs)(aD,{open:n,onOpenChange:o,children:[(0,U.jsxs)(yd,{children:[(0,U.jsxs)(bd,{render:(0,U.jsx)(oD,{render:(0,U.jsx)($n,{"aria-label":`Request body`,title:`Request body — JSON merged into each chat request (tool execution context)`,size:`icon-sm`,variant:`outline`,className:`relative`})}),children:[(0,U.jsx)(pu,{className:`size-4`}),c&&(0,U.jsx)(`span`,{className:`absolute -top-1 -right-1 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-blue-500`})]}),(0,U.jsx)(xd,{children:(0,U.jsx)(`p`,{children:`Request body params`})})]}),(0,U.jsxs)(lD,{className:`!w-2xl !max-w-2xl`,children:[(0,U.jsx)(uD,{children:(0,U.jsx)(fD,{children:`Request body`})}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`JSON object merged into the body of every chat request. Available in tool`,` `,(0,U.jsx)(`code`,{className:`font-mono`,children:`execute`}),` functions via`,` `,(0,U.jsx)(`code`,{className:`font-mono`,children:`experimental_context`}),`.`]}),(0,U.jsx)(AD,{className:`font-mono text-xs min-h-32 max-h-72 break-all w-full`,placeholder:M4,value:i,onChange:e=>a(e.target.value),spellCheck:!1})]}),(0,U.jsx)(dD,{showCloseButton:!0,children:(0,U.jsx)($n,{size:`sm`,onClick:s,children:`Save`})})]})]})}function P4(e){if(!e||e===`{}`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t||Array.isArray(t))return null;let n=t;for(let e of Object.values(n))if(typeof e!=`string`)return null;return n}function F4(e,t){if(!t?.length)return;let n=e??{};for(let e of t)n[e]?.trim()||rt.warning(`Query param "${e}" is required for this playground session.`)}function I4(e,t,n){let r=n?.declaredQueryKeys;if(!e||e===`{}`)return F4(null,r),t(e),!0;let i=P4(e);return i===null?(rt.error(`Invalid query params — use only flat string key/value pairs.`),!1):(F4(i,r),t(e),!0)}function L4(e){let t=P4(e.trim());return!t||Object.keys(t).length===0?[{id:BO(),key:``,value:``}]:Object.entries(t).map(([e,t])=>({id:BO(),key:e,value:t}))}function R4(e){let t={},n=new Set;for(let r of e){let e=r.key.trim();if(e){if(n.has(e))return`duplicate`;n.add(e),t[e]=r.value}}return t}function z4({query:e,onChange:t,declaredQueryKeys:n,userId:r,onUserIdChange:i,token:a,onTokenChange:o,welcomeMessage:s,onWelcomeMessageChange:c}){let[l,u]=(0,z.useState)(!1),[d,f]=(0,z.useState)(r),[p,m]=(0,z.useState)(a),[h,g]=(0,z.useState)(s),[_,v]=(0,z.useState)(!1),[y,b]=(0,z.useState)(()=>L4(e)),x=(0,z.useCallback)(t=>{t&&(f(r),m(a),g(s),b(L4(e))),u(t)},[e,r,a,s]),S=(0,z.useCallback)(()=>{b(e=>[...e,{id:BO(),key:``,value:``}])},[]),C=(0,z.useCallback)(e=>{b(t=>{let n=t.filter(t=>t.id!==e);return n.length>0?n:[{id:BO(),key:``,value:``}]})},[]),w=(0,z.useCallback)((e,t,n)=>{b(r=>r.map(r=>r.id===e?{...r,[t]:n}:r))},[]),T=(0,z.useCallback)(()=>{let e=d.trim();if(!e){rt.error(`User ID is required.`);return}let r=R4(y);if(r===`duplicate`){rt.error(`Duplicate parameter keys are not allowed.`);return}I4(JSON.stringify(r),e=>t(e),{declaredQueryKeys:n})&&(i(e),o(p.trim()),c(h.trim()),u(!1))},[y,t,n,d,p,h,i,o,c]),E=j4(e)||!!r||!!a;return(0,U.jsxs)(aD,{open:l,onOpenChange:x,children:[(0,U.jsxs)(yd,{children:[(0,U.jsxs)(bd,{render:(0,U.jsx)(oD,{render:(0,U.jsx)($n,{"aria-label":`Connection settings`,title:`Connection settings — user ID, auth token, and query params`,size:`icon-sm`,variant:`outline`,className:`relative`})}),children:[(0,U.jsx)(ru,{className:`size-4`}),E&&(0,U.jsx)(`span`,{className:`absolute -top-1 -right-1 flex h-2.5 w-2.5 items-center justify-center rounded-full bg-blue-500`})]}),(0,U.jsx)(xd,{children:(0,U.jsx)(`p`,{children:`Connection settings`})})]}),(0,U.jsxs)(lD,{className:`!w-2xl !max-w-2xl`,children:[(0,U.jsx)(uD,{children:(0,U.jsx)(fD,{children:`Connection settings`})}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Configure your User ID, auth token, and any additional query params for the WebSocket connection. Changes take effect on the next connection after saving, such as starting a new chat or refreshing the page.`}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`params-user-id`,children:[`User ID `,(0,U.jsx)(`span`,{className:`text-destructive font-normal`,children:`(required)`})]}),(0,U.jsx)(kD,{autoComplete:`off`,className:`font-mono text-xs`,id:`params-user-id`,onChange:e=>f(e.target.value),placeholder:`e.g. user_123`,spellCheck:!1,value:d})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`params-token`,children:[`Auth Token `,(0,U.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(kD,{autoComplete:`off`,className:`font-mono text-xs pr-10`,id:`params-token`,onChange:e=>m(e.target.value),placeholder:`Bearer token for authentication`,spellCheck:!1,type:_?`text`:`password`,value:p}),(0,U.jsx)($n,{className:`absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7`,onClick:()=>v(e=>!e),size:`icon-sm`,type:`button`,variant:`ghost`,children:_?(0,U.jsx)(Ql,{className:`size-4`}):(0,U.jsx)($l,{className:`size-4`})})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`params-welcome-message`,children:[`Welcome Message `,(0,U.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,U.jsx)(AD,{className:`text-xs min-h-16 max-h-32`,id:`params-welcome-message`,onChange:e=>g(e.target.value),placeholder:`Hello! How can I help you today?`,spellCheck:!1,value:h})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Additional query params`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Flat string key/value pairs appended to the WebSocket URL.`}),(0,U.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,1fr)_minmax(0,2fr)_auto] gap-2 text-xs font-medium text-muted-foreground px-0.5`,children:[(0,U.jsx)(`span`,{children:`Name`}),(0,U.jsx)(`span`,{children:`Value`}),(0,U.jsx)(`span`,{className:`sr-only`,children:`Remove`})]}),y.map(e=>(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_auto] gap-2 items-center`,children:[(0,U.jsx)(kD,{"aria-label":`Parameter name`,className:`font-mono text-xs h-9`,onChange:t=>w(e.id,`key`,t.target.value),placeholder:`e.g. token`,spellCheck:!1,value:e.key}),(0,U.jsx)(kD,{"aria-label":`Value for ${e.key||`parameter`}`,className:`font-mono text-xs h-9`,onChange:t=>w(e.id,`value`,t.target.value),placeholder:`value`,spellCheck:!1,value:e.value}),(0,U.jsx)($n,{"aria-label":`Remove row`,className:`shrink-0 justify-self-end sm:justify-self-center`,onClick:()=>C(e.id),size:`icon-sm`,type:`button`,variant:`ghost`,children:(0,U.jsx)(_u,{className:`size-4 text-muted-foreground`})})]},e.id)),(0,U.jsxs)($n,{className:`self-start gap-1.5`,onClick:S,size:`sm`,type:`button`,variant:`outline`,children:[(0,U.jsx)(uu,{className:`size-4`}),`Add param`]})]})]}),(0,U.jsx)(dD,{showCloseButton:!0,children:(0,U.jsx)($n,{size:`sm`,onClick:T,children:`Save`})})]})]})}var B4=`playground:url`,V4=`playground:body`,H4=`playground:query`,U4=`playground:userId`,W4=`playground:token`,G4=`playground:welcomeMessage`,K4=`playground:showTools`,q4=`playground:showReasoning`,J4=`playground:showRatings`,Y4=`{{agent_name}}`,X4=`http://localhost:8787/agents/${Y4}`;function Z4(e){if(!e?.trim())return[];let t=new Set,n=[];for(let r of e.split(`,`)){let e=r.trim();e&&(t.has(e)||(t.add(e),n.push(e)))}return n}function Q4(e){return e?.length?Z4(e.join(`,`)):[]}function $4(){let e=window.__PLAYGROUND_CONFIG__,t=Q4(e?.queryParamKeys),n=Z4(void 0),r=t.length>0?t:n;return{agentName:e?.agentName,port:e?.port,queryParamKeys:r}}function e3(e,t){if(t.length===0)return!0;let n=P4(e.trim());return n?t.every(e=>!!n[e]?.trim()):!1}function t3(e,t){return P4(e.trim())?.[t]?.trim()??``}function n3(e){return`setup-query-${e.replace(/[^a-zA-Z0-9_-]/g,`_`)}`}function r3(){return localStorage.getItem(V4)??``}function i3(){return localStorage.getItem(H4)??``}function a3(){return new URLSearchParams(window.location.search).get(`user`)??``}function o3(){return a3()||(localStorage.getItem(U4)??``)}function s3(){return localStorage.getItem(W4)??``}function c3(){return localStorage.getItem(G4)??``}function l3(e){try{let t=new URL(e.includes(`://`)?e:`http://${e}`),n=t.pathname.split(`/`).filter(Boolean);return n[0]===`agents`&&n[1]?{host:t.host,agent:n[1]}:null}catch{return null}}function u3(e){return e?l3(e)||(rt.error(`Invalid agent URL — expected http://<host>/agents/<name>`),null):null}function d3({open:e,urlDraft:t,setUrlDraft:n,onCommitUrl:r,query:i,onPersistQuery:a,requiredParamKeys:o,userId:s,onUserIdChange:c,token:l,onTokenChange:u,welcomeMessage:d,onWelcomeMessageChange:f}){let[p,m]=(0,z.useState)(s),[h,g]=(0,z.useState)(l),[_,v]=(0,z.useState)(d),[y,b]=(0,z.useState)(!1),[x,S]=(0,z.useState)(()=>Object.fromEntries(o.map(e=>[e,t3(i,e)])));(0,z.useEffect)(()=>{m(s)},[s]),(0,z.useEffect)(()=>{g(l)},[l]),(0,z.useEffect)(()=>{v(d)},[d]),(0,z.useEffect)(()=>{S(Object.fromEntries(o.map(e=>[e,t3(i,e)])))},[i,o]);let C=(0,z.useCallback)(()=>{let e=p.trim();if(!e){rt.error(`User ID is required.`);return}if(r()){if(o.length>0){for(let e of o)if(!x[e]?.trim()){rt.error(`"${e}" is required for this playground session (WebSocket query param).`);return}let e={...P4(i.trim())??{},...Object.fromEntries(o.map(e=>[e,x[e].trim()]))};a(JSON.stringify(e))}c(e),u(h.trim()),f(_.trim())}},[p,h,_,r,o,x,i,a,c,u,f]);return(0,U.jsx)(aD,{open:e,onOpenChange:e=>{},children:(0,U.jsxs)(lD,{className:`!w-2xl !max-w-2xl`,showCloseButton:!1,children:[(0,U.jsx)(uD,{children:(0,U.jsx)(fD,{children:`Initial setup`})}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Set your User ID, a valid agent URL, and optionally an auth token.`,` `,o.length>0?(0,U.jsxs)(U.Fragment,{children:[`This CLI session also requires query params:`,` `,(0,U.jsx)(`code`,{className:`font-mono`,children:o.join(`, `)}),`.`]}):(0,U.jsx)(U.Fragment,{children:`Additional query params can be added later via the settings icon in the header.`}),` `,`Fields are pre-filled from saved settings when possible.`]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`setup-user-id`,children:[`User ID `,(0,U.jsx)(`span`,{className:`text-destructive font-normal`,children:`(required)`})]}),(0,U.jsx)(kD,{autoComplete:`off`,className:`font-mono text-xs`,id:`setup-user-id`,onChange:e=>m(e.target.value),placeholder:`e.g. user_123`,spellCheck:!1,value:p})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`setup-token`,children:[`Auth Token `,(0,U.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(kD,{autoComplete:`off`,className:`font-mono text-xs pr-10`,id:`setup-token`,onChange:e=>g(e.target.value),placeholder:`Bearer token for authentication`,spellCheck:!1,type:y?`text`:`password`,value:h}),(0,U.jsx)($n,{className:`absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7`,onClick:()=>b(e=>!e),size:`icon-sm`,type:`button`,variant:`ghost`,children:y?(0,U.jsx)(Ql,{className:`size-4`}):(0,U.jsx)($l,{className:`size-4`})})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsx)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`setup-agent-url`,children:`Agent URL`}),(0,U.jsx)(kD,{className:`font-mono text-xs`,id:`setup-agent-url`,onChange:e=>n(e.target.value),placeholder:`http://localhost:8787/agents/my-agent`,spellCheck:!1,value:t})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:`setup-welcome-message`,children:[`Welcome Message `,(0,U.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(optional)`})]}),(0,U.jsx)(AD,{className:`text-xs min-h-16 max-h-32`,id:`setup-welcome-message`,onChange:e=>v(e.target.value),placeholder:`Hello! How can I help you today?`,spellCheck:!1,value:_})]}),o.length>0?(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsx)(`p`,{className:`text-xs font-medium text-foreground`,children:`Required query params`}),o.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,U.jsxs)(`label`,{className:`text-xs font-medium text-foreground`,htmlFor:n3(e),children:[(0,U.jsx)(`code`,{className:`font-mono`,children:e}),` `,(0,U.jsx)(`span`,{className:`text-destructive font-normal`,children:`(required)`})]}),(0,U.jsx)(kD,{autoComplete:`off`,className:`font-mono text-xs`,id:n3(e),onChange:t=>S(n=>({...n,[e]:t.target.value})),placeholder:e,spellCheck:!1,value:x[e]??``})]},e)),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Use the key icon in the header to add more key/value pairs if you need keys beyond this list.`})]}):null]}),(0,U.jsx)(dD,{children:(0,U.jsx)($n,{size:`sm`,onClick:C,children:`Continue`})})]})})}function f3(){let e=$4();return e.agentName?`http://localhost:${e.port??8787}/agents/${e.agentName}`:X4}function p3(){return localStorage.getItem(B4)??f3()}function m3(){return new URLSearchParams(window.location.search).get(`chat`)??void 0}function h3(){return BO()}function g3(){let[e,t]=(0,z.useState)(()=>m3()??h3()),[n,r]=(0,z.useState)(o3),[i,a]=(0,z.useState)(s3),[o,s]=(0,z.useState)(c3),[c,l]=(0,z.useState)(p3),[u,d]=(0,z.useState)(c),[f,p]=(0,z.useState)(`connecting`),[m,h]=(0,z.useState)(null),[g,_]=(0,z.useState)(r3),[v,y]=(0,z.useState)(i3),[b,x]=(0,z.useState)(null),[S,C]=(0,z.useState)(()=>localStorage.getItem(K4)!==`false`),[w,T]=(0,z.useState)(()=>localStorage.getItem(q4)!==`false`),[E,D]=(0,z.useState)(()=>localStorage.getItem(J4)!==`false`),O=(0,z.useRef)(!1),k=(0,z.useMemo)(()=>$4().queryParamKeys??[],[]);(0,z.useEffect)(()=>{p(`connecting`),h(null)},[e]);let A=c.includes(Y4),j=A?null:l3(c),M=!A&&j!==null,ee=e3(v,k),N=!M||!ee||!n;(0,z.useEffect)(()=>{let t=new URLSearchParams(window.location.search);e&&t.get(`chat`)!==e&&(t.set(`chat`,e),history.replaceState(null,``,`?${t}`))},[e]),(0,z.useEffect)(()=>{let e=new URLSearchParams(window.location.search);n&&e.get(`user`)!==n&&(e.set(`user`,n),history.replaceState(null,``,`?${e}`))},[n]);let P=(0,z.useCallback)(()=>{let e=h3(),n=new URLSearchParams(window.location.search);n.set(`chat`,e),history.pushState(null,``,`?${n}`),t(e),rt.success(`New chat started`)},[]),F=(0,z.useCallback)(()=>{let e=u.trim();return u3(e)?(localStorage.setItem(B4,e),l(e),d(e),O.current=!0,t(h3()),!0):!1},[u]),te=(0,z.useCallback)(e=>{localStorage.setItem(U4,e),r(e)},[]),I=(0,z.useCallback)(e=>{localStorage.setItem(W4,e),a(e)},[]),ne=(0,z.useCallback)(e=>{localStorage.setItem(G4,e),s(e)},[]),re=(0,z.useCallback)(e=>I4(e,e=>{localStorage.setItem(H4,e),y(e)},{declaredQueryKeys:k}),[k]),ie=(0,z.useCallback)(e=>{localStorage.setItem(K4,String(e)),C(e)},[]),L=(0,z.useCallback)(e=>{localStorage.setItem(q4,String(e)),T(e)},[]),ae=(0,z.useCallback)(e=>{localStorage.setItem(J4,String(e)),D(e)},[]),R=(0,z.useCallback)(()=>{let e=!(!S&&!w&&!E);localStorage.setItem(K4,String(!e)),localStorage.setItem(q4,String(!e)),localStorage.setItem(J4,String(!e)),C(!e),T(!e),D(!e)},[S,w,E]),oe=!S&&!w&&!E;return(0,U.jsxs)(`div`,{className:`relative flex h-screen overflow-hidden`,children:[(0,U.jsx)(d3,{open:N,query:v,requiredParamKeys:k,setUrlDraft:d,urlDraft:u,onCommitUrl:F,onPersistQuery:re,userId:n,onUserIdChange:te,token:i,onTokenChange:I,welcomeMessage:o,onWelcomeMessageChange:ne}),(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col`,children:[(0,U.jsx)(`div`,{className:`border-b-2 border-zinc-200 flex items-center justify-between bg-zinc-50`,children:(0,U.jsxs)(`div`,{className:`h-20 flex items-center w-6xl mx-auto border-x-2 border-zinc-200/40 py-6 px-6 justify-between`,children:[(0,U.jsx)(`div`,{className:`flex items-center`,children:c?(0,U.jsx)(U.Fragment,{children:(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h2`,{className:`text-sm font-semibold mb-0 flex items-center`,children:[(0,U.jsx)(`div`,{className:[`h-2 w-2 rounded-full mr-2`,f===`connected`&&`bg-green-500`,f===`connecting`&&`bg-amber-400 animate-pulse`,(f===`disconnected`||f===`unauthorized`)&&`bg-red-500 animate-pulse`].filter(Boolean).join(` `)}),f===`connected`&&`Connected to agent`,f===`connecting`&&`Connecting...`,f===`disconnected`&&`Unable to connect to agent`,f===`unauthorized`&&`Unauthorized to connect to agent`]}),(0,U.jsx)(`input`,{className:`-ml-1.5 text-xs text-muted-foreground mb-0 py-1 pl-2 pr-10 field-sizing-content rounded-md hover:text-foreground focus:text-foreground hover:bg-white focus:bg-white hover:outline hover:outline-zinc-200 focus:outline focus:outline-zinc-300`,value:u,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`?(F(),e.currentTarget.blur()):e.key===`Escape`&&(d(c),e.currentTarget.blur())},onBlur:()=>{if(O.current){O.current=!1;return}d(c)}})]})}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`h-2 w-2 bg-muted-foreground/50 rounded-full mr-3`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground mb-0`,children:`Not Connected`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground mb-0`,children:`Enter an agent URL and click Connect`})]})]})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)($n,{onClick:P,size:`icon-sm`,variant:`outline`,children:(0,U.jsx)(au,{className:`size-4`})}),(0,U.jsx)(Z2,{agent:b,connectionStatus:f,currentChatId:e,onConversationClick:t}),(0,U.jsx)(z4,{declaredQueryKeys:k,query:v,onChange:e=>{localStorage.setItem(H4,e),y(e)},userId:n,onUserIdChange:te,token:i,onTokenChange:I,welcomeMessage:o,onWelcomeMessageChange:ne}),(0,U.jsx)(N4,{body:g,onChange:e=>{localStorage.setItem(V4,e),_(e)}}),(0,U.jsxs)(_4,{children:[(0,U.jsxs)(yd,{children:[(0,U.jsx)(bd,{render:(0,U.jsx)(v4,{render:(0,U.jsx)($n,{"aria-label":`Developer settings`,title:`Developer settings`,size:`icon-sm`,variant:`outline`})}),children:(0,U.jsx)(fu,{className:`size-4`})}),(0,U.jsx)(xd,{children:(0,U.jsx)(`p`,{children:`Developer settings`})})]}),(0,U.jsx)(y4,{className:`w-56`,align:`end`,children:(0,U.jsxs)(`div`,{className:`grid gap-4`,children:[(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`h4`,{className:`font-medium text-sm`,children:`Display options`}),(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Toggle what you see in the chat.`})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{className:`text-sm`,htmlFor:`show-tools`,children:`Show tool outputs`}),(0,U.jsx)(k4,{id:`show-tools`,checked:S,onCheckedChange:ie})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{className:`text-sm`,htmlFor:`show-reasoning`,children:`Show reasoning`}),(0,U.jsx)(k4,{id:`show-reasoning`,checked:w,onCheckedChange:L})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{className:`text-sm`,htmlFor:`show-ratings`,children:`Show ratings`}),(0,U.jsx)(k4,{id:`show-ratings`,checked:E,onCheckedChange:ae})]}),(0,U.jsx)(Xu,{}),(0,U.jsx)($n,{variant:`outline`,size:`sm`,onClick:R,children:oe?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ql,{className:`size-4 mr-2`}),`Developer view`]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)($l,{className:`size-4 mr-2`}),`User view`]})})]})})]})]})]})}),(0,U.jsx)(`div`,{className:`flex-1 overflow-hidden min-h-0 grow`,children:(0,U.jsxs)(`div`,{className:`max-w-6xl w-full mx-auto border-x-2 border-zinc-100 h-full`,children:[f===`unauthorized`&&M&&ee&&(0,U.jsx)(`div`,{className:`flex size-full flex-col items-center justify-center gap-4 text-muted-foreground`,children:(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,U.jsx)(`div`,{className:`h-10 w-10 rounded-full bg-red-50 flex items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-4 w-4 rounded-full bg-red-400`})}),(0,U.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:`Unauthorized`}),m?(0,U.jsx)(`p`,{className:`text-xs max-w-xs`,children:m}):(0,U.jsx)(`p`,{className:`text-xs max-w-xs`,children:`You are not authorized to connect to this agent.`})]})}),M&&ee&&j?(0,U.jsx)(A4,{children:(0,U.jsx)(N2,{agentName:j.agent,host:j.host,chatId:n?`${n}:${e}`:e,agentUrl:c,authToken:i||void 0,body:g?JSON.parse(g):void 0,query:v?P4(v.trim())??void 0:void 0,welcomeMessage:o||void 0,onAgentChange:x,onConnectionStatusChange:p,onUnauthorized:h,showTools:S,showReasoning:w,showRatings:E},`${n}:${e}:${v}`)},`${n}:${e}:${v}`):(0,U.jsx)(`div`,{className:`flex size-full flex-col items-center justify-center gap-3 text-muted-foreground px-4`,children:M?(0,U.jsxs)(`p`,{className:`text-sm text-center max-w-md`,children:[`Set required WebSocket query params in the setup dialog`,k.length>0?(0,U.jsxs)(U.Fragment,{children:[`: `,(0,U.jsx)(`code`,{className:`font-mono text-xs`,children:k.join(`, `)})]}):null,`.`]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`text-sm text-center`,children:`Enter an agent URL in the bar above or in the setup dialog.`}),(0,U.jsx)(`p`,{className:`text-xs font-mono text-muted-foreground/60`,children:`e.g. http://localhost:8787/agents/my-agent`})]})})]})})]})]})}(0,Ve.createRoot)(document.getElementById(`app`)).render((0,U.jsx)(z.StrictMode,{children:(0,U.jsxs)(vd,{children:[(0,U.jsx)(vt,{}),(0,U.jsx)(g3,{})]})}));