@nikcli-ai/app 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +661 -0
- package/.turbo/turbo-typecheck.log +1 -0
- package/AGENTS.md +30 -0
- package/README.md +51 -0
- package/dist/_headers +17 -0
- package/dist/apple-touch-icon-v3.png +0 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/assets/BlexMonoNerdFontMono-Bold-B8jzonSj.woff2 +0 -0
- package/dist/assets/BlexMonoNerdFontMono-Medium-BvtJB5kd.woff2 +0 -0
- package/dist/assets/BlexMonoNerdFontMono-Regular-DSJ7IWr2.woff2 +0 -0
- package/dist/assets/CaskaydiaCoveNerdFontMono-Bold-CxABrWmj.woff2 +0 -0
- package/dist/assets/CaskaydiaCoveNerdFontMono-Regular-C_H0OSLN.woff2 +0 -0
- package/dist/assets/FiraCodeNerdFontMono-Bold-BjAeM3gJ.woff2 +0 -0
- package/dist/assets/FiraCodeNerdFontMono-Regular-io3c92n9.woff2 +0 -0
- package/dist/assets/HackNerdFontMono-Bold-BNG4kp7w.woff2 +0 -0
- package/dist/assets/HackNerdFontMono-Regular-IcpSchWC.woff2 +0 -0
- package/dist/assets/InconsolataNerdFontMono-Bold-oTRjQesI.woff2 +0 -0
- package/dist/assets/InconsolataNerdFontMono-Regular-CRHGEvh2.woff2 +0 -0
- package/dist/assets/IntoneMonoNerdFontMono-Bold-BL6LrHzx.woff2 +0 -0
- package/dist/assets/IntoneMonoNerdFontMono-Regular-BwjBdmsJ.woff2 +0 -0
- package/dist/assets/JetBrainsMonoNerdFontMono-Bold-CU80ifuM.woff2 +0 -0
- package/dist/assets/JetBrainsMonoNerdFontMono-Regular-QVq88ZfU.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/assets/MesloLGSNerdFontMono-Bold-CrpVO3ec.woff2 +0 -0
- package/dist/assets/MesloLGSNerdFontMono-Regular-j-nTZDWZ.woff2 +0 -0
- package/dist/assets/RobotoMonoNerdFontMono-Bold-DNxuDepp.woff2 +0 -0
- package/dist/assets/RobotoMonoNerdFontMono-Regular-DvxS3QZC.woff2 +0 -0
- package/dist/assets/SauceCodeProNerdFontMono-Bold-DloEeUVQ.woff2 +0 -0
- package/dist/assets/SauceCodeProNerdFontMono-Regular-Ba96Bdne.woff2 +0 -0
- package/dist/assets/UbuntuMonoNerdFontMono-Bold-wLXUURqB.woff2 +0 -0
- package/dist/assets/UbuntuMonoNerdFontMono-Regular-tdnXLyap.woff2 +0 -0
- package/dist/assets/abap-BXYWi5l2.js +1 -0
- package/dist/assets/abap-BdImnpbu.js +1 -0
- package/dist/assets/actionscript-3-CfeIJUat.js +1 -0
- package/dist/assets/actionscript-3-LjD3sNyx.js +1 -0
- package/dist/assets/ada-DeReRNhg.js +1 -0
- package/dist/assets/ada-bCR0ucgS.js +1 -0
- package/dist/assets/alert-01-BuOD_o_q.aac +0 -0
- package/dist/assets/alert-02-CS75AsoP.aac +0 -0
- package/dist/assets/alert-04-CaGsIGFP.aac +0 -0
- package/dist/assets/alert-05-D2gbGoRH.aac +0 -0
- package/dist/assets/alert-06-GK5Tqy6u.aac +0 -0
- package/dist/assets/alert-07-0r0kiLGz.aac +0 -0
- package/dist/assets/alert-08-CZowNquU.aac +0 -0
- package/dist/assets/alert-10-Ck5hR7zH.aac +0 -0
- package/dist/assets/android-studio-D0DqtVA4.svg +1 -0
- package/dist/assets/andromeeda-C-Jbm3Hp.js +1 -0
- package/dist/assets/angular-html-6NEUuZou.js +1 -0
- package/dist/assets/angular-html-CU67Zn6k.js +1 -0
- package/dist/assets/angular-ts-BfBSdvnY.js +1 -0
- package/dist/assets/angular-ts-BwZT4LLn.js +1 -0
- package/dist/assets/antigravity-XfClf80L.svg +1 -0
- package/dist/assets/apache-CCUDgqAf.js +1 -0
- package/dist/assets/apache-Pmp26Uib.js +1 -0
- package/dist/assets/apex-DDbsPZ6N.js +1 -0
- package/dist/assets/apex-ynV6aGfE.js +1 -0
- package/dist/assets/apl-C-KxP0FL.js +1 -0
- package/dist/assets/apl-dKokRX4l.js +1 -0
- package/dist/assets/applescript-Co6uUVPk.js +1 -0
- package/dist/assets/applescript-Dd26Nb5t.js +1 -0
- package/dist/assets/ara-BRHolxvo.js +1 -0
- package/dist/assets/ara-D6vCOKVX.js +1 -0
- package/dist/assets/asciidoc-DZ9uQOoP.js +1 -0
- package/dist/assets/asciidoc-Dv7Oe6Be.js +1 -0
- package/dist/assets/asm-CbVMAfFB.js +1 -0
- package/dist/assets/asm-D_Q5rh1f.js +1 -0
- package/dist/assets/astro-CbQHKStN.js +1 -0
- package/dist/assets/astro-OEl6i-aI.js +1 -0
- package/dist/assets/aurora-x-D-2ljcwZ.js +1 -0
- package/dist/assets/awk-DMzUqQB5.js +1 -0
- package/dist/assets/awk-UmR4Ublb.js +1 -0
- package/dist/assets/ayu-dark-Cv9koXgw.js +1 -0
- package/dist/assets/ballerina-BFfxhgS-.js +1 -0
- package/dist/assets/ballerina-BMbY-1wP.js +1 -0
- package/dist/assets/bat-BkioyH1T.js +1 -0
- package/dist/assets/bat-Dcnh2ot_.js +1 -0
- package/dist/assets/beancount-B92nBv9q.js +1 -0
- package/dist/assets/beancount-k_qm7-4y.js +1 -0
- package/dist/assets/berry-C9fz7p0n.js +1 -0
- package/dist/assets/berry-uYugtg8r.js +1 -0
- package/dist/assets/bibtex-CHM0blh-.js +1 -0
- package/dist/assets/bibtex-DELXwv0g.js +1 -0
- package/dist/assets/bicep-Bmn6On1c.js +1 -0
- package/dist/assets/bicep-D2njIRU5.js +1 -0
- package/dist/assets/bip-bop-03-DXp7Zb0f.aac +0 -0
- package/dist/assets/bip-bop-04-CfVtpI7z.aac +0 -0
- package/dist/assets/bip-bop-06-BuvNosjK.aac +0 -0
- package/dist/assets/bip-bop-08-DBf7Bwjz.aac +0 -0
- package/dist/assets/bip-bop-09-CxEgoAHQ.aac +0 -0
- package/dist/assets/blade-CwZbp2Ca.js +1 -0
- package/dist/assets/blade-DVc8C-J4.js +1 -0
- package/dist/assets/bsl-BO_Y6i37.js +1 -0
- package/dist/assets/bsl-C4qeDxuX.js +1 -0
- package/dist/assets/c-BIGW1oBm.js +1 -0
- package/dist/assets/c-CyUOlKFr.js +1 -0
- package/dist/assets/cadence-Bv_4Rxtq.js +1 -0
- package/dist/assets/cadence-bIHbUj02.js +1 -0
- package/dist/assets/cairo-C_mOTUpN.js +1 -0
- package/dist/assets/cairo-KRGpt6FW.js +1 -0
- package/dist/assets/catppuccin-frappe-DFWUc33u.js +1 -0
- package/dist/assets/catppuccin-latte-C9dUb6Cb.js +1 -0
- package/dist/assets/catppuccin-macchiato-DQyhUUbL.js +1 -0
- package/dist/assets/catppuccin-mocha-D87Tk5Gz.js +1 -0
- package/dist/assets/clarity-A4x-rz24.js +1 -0
- package/dist/assets/clarity-D53aC0YG.js +1 -0
- package/dist/assets/clojure-Bb2-3A0I.js +1 -0
- package/dist/assets/clojure-P80f7IUj.js +1 -0
- package/dist/assets/cmake-Cv5ljclQ.js +1 -0
- package/dist/assets/cmake-D1j8_8rp.js +1 -0
- package/dist/assets/cobol-Cg3yRVOY.js +1 -0
- package/dist/assets/cobol-nwyudZeR.js +1 -0
- package/dist/assets/codeowners-Bp6g37R7.js +1 -0
- package/dist/assets/codeowners-CKT8dJip.js +1 -0
- package/dist/assets/codeql-DXd8ggn3.js +1 -0
- package/dist/assets/codeql-DsOJ9woJ.js +1 -0
- package/dist/assets/coffee-CSg58a7P.js +1 -0
- package/dist/assets/coffee-Ch7k5sss.js +1 -0
- package/dist/assets/common-lisp-Cg-RD9OK.js +1 -0
- package/dist/assets/common-lisp-v102bg8X.js +1 -0
- package/dist/assets/coq-CxCehFeR.js +1 -0
- package/dist/assets/coq-DkFqJrB1.js +1 -0
- package/dist/assets/cpp-C28rag7_.js +1 -0
- package/dist/assets/cpp-CofmeUqb.js +1 -0
- package/dist/assets/crystal-kLfOnxTY.js +1 -0
- package/dist/assets/crystal-tKQVLTB8.js +1 -0
- package/dist/assets/csharp-DFQpaWb6.js +1 -0
- package/dist/assets/csharp-K5feNrxe.js +1 -0
- package/dist/assets/css-BSK200cd.js +1 -0
- package/dist/assets/css-DPfMkruS.js +1 -0
- package/dist/assets/csv-AZNL9t8Q.js +1 -0
- package/dist/assets/csv-fuZLfV_i.js +1 -0
- package/dist/assets/cue-D82EKSYY.js +1 -0
- package/dist/assets/cue-nzsbQn5T.js +1 -0
- package/dist/assets/cypher-BM7Pwunj.js +1 -0
- package/dist/assets/cypher-COkxafJQ.js +1 -0
- package/dist/assets/d-85-TOEBH.js +1 -0
- package/dist/assets/d-TG9YRPoI.js +1 -0
- package/dist/assets/dark-plus-C3mMm8J8.js +1 -0
- package/dist/assets/dart-CF10PKvl.js +1 -0
- package/dist/assets/dart-DArdxSyj.js +1 -0
- package/dist/assets/dax-B28Cho4e.js +1 -0
- package/dist/assets/dax-CEL-wOlO.js +1 -0
- package/dist/assets/desktop-BmXAJ9_W.js +1 -0
- package/dist/assets/desktop-Z9LhWKWr.js +1 -0
- package/dist/assets/diff-BlzBhZx2.js +1 -0
- package/dist/assets/diff-D97Zzqfu.js +1 -0
- package/dist/assets/docker-BcOcwvcX.js +1 -0
- package/dist/assets/docker-DIG_IqVK.js +1 -0
- package/dist/assets/dotenv-Bf0GLMGc.js +1 -0
- package/dist/assets/dotenv-Da5cRb03.js +1 -0
- package/dist/assets/dracula-BzJJZx-M.js +1 -0
- package/dist/assets/dracula-soft-BXkSAIEj.js +1 -0
- package/dist/assets/dream-maker-BtqSS_iP.js +1 -0
- package/dist/assets/dream-maker-DBhfoDN-.js +1 -0
- package/dist/assets/edge-BkV0erSs.js +1 -0
- package/dist/assets/edge-C9mkmEUa.js +1 -0
- package/dist/assets/elixir-B1OcFvXE.js +1 -0
- package/dist/assets/elixir-CDX3lj18.js +1 -0
- package/dist/assets/elm-BX_9EnK8.js +1 -0
- package/dist/assets/elm-DbKCFpqz.js +1 -0
- package/dist/assets/emacs-lisp-C9XAeP06.js +1 -0
- package/dist/assets/emacs-lisp-fXIB3QbG.js +1 -0
- package/dist/assets/erb-BOJIQeun.js +1 -0
- package/dist/assets/erb-CjsbKF3w.js +1 -0
- package/dist/assets/erlang-Dh270pQQ.js +1 -0
- package/dist/assets/erlang-DsQrWhSR.js +1 -0
- package/dist/assets/everforest-dark-BgDCqdQA.js +1 -0
- package/dist/assets/everforest-light-C8M2exoo.js +1 -0
- package/dist/assets/fennel-BYunw83y.js +1 -0
- package/dist/assets/fennel-CKW7gc4E.js +1 -0
- package/dist/assets/finder-CGxGn0h3.png +0 -0
- package/dist/assets/fish-BiaFC76h.js +1 -0
- package/dist/assets/fish-BvzEVeQv.js +1 -0
- package/dist/assets/fluent-C1VbA1FI.js +1 -0
- package/dist/assets/fluent-C4IJs8-o.js +1 -0
- package/dist/assets/fortran-fixed-form-BZjJHVRy.js +1 -0
- package/dist/assets/fortran-fixed-form-VBUom2Po.js +1 -0
- package/dist/assets/fortran-free-form-D22FLkUw.js +1 -0
- package/dist/assets/fortran-free-form-xZZnushS.js +1 -0
- package/dist/assets/fsharp-B6CigNpP.js +1 -0
- package/dist/assets/fsharp-CXgrBDvD.js +1 -0
- package/dist/assets/gdresource-B57lXvxj.js +1 -0
- package/dist/assets/gdresource-B7Tvp0Sc.js +1 -0
- package/dist/assets/gdscript-DTMYz4Jt.js +1 -0
- package/dist/assets/gdscript-etqGfJNh.js +1 -0
- package/dist/assets/gdshader-DkwncUOv.js +1 -0
- package/dist/assets/gdshader-MbeiIFWW.js +1 -0
- package/dist/assets/genie-CTXGoN_z.js +1 -0
- package/dist/assets/genie-D0YGMca9.js +1 -0
- package/dist/assets/gherkin-DQeIZrj7.js +1 -0
- package/dist/assets/gherkin-DyxjwDmM.js +1 -0
- package/dist/assets/ghostty-web-CsYhFgbJ.js +13 -0
- package/dist/assets/git-commit-BicZTByO.js +1 -0
- package/dist/assets/git-commit-F4YmCXRG.js +1 -0
- package/dist/assets/git-rebase-Bzlpfr7M.js +1 -0
- package/dist/assets/git-rebase-r7XF79zn.js +1 -0
- package/dist/assets/github-dark-DHJKELXO.js +1 -0
- package/dist/assets/github-dark-default-Cuk6v7N8.js +1 -0
- package/dist/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
- package/dist/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
- package/dist/assets/github-light-DAi9KRSo.js +1 -0
- package/dist/assets/github-light-default-D7oLnXFd.js +1 -0
- package/dist/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
- package/dist/assets/gleam-B-IqXlZK.js +1 -0
- package/dist/assets/gleam-BspZqrRM.js +1 -0
- package/dist/assets/glimmer-js-Rg0-pVw9.js +1 -0
- package/dist/assets/glimmer-js-cZi37nA1.js +1 -0
- package/dist/assets/glimmer-ts-BY3QTAW9.js +1 -0
- package/dist/assets/glimmer-ts-U6CK756n.js +1 -0
- package/dist/assets/glsl-Bk7TyU8J.js +1 -0
- package/dist/assets/glsl-DplSGwfg.js +1 -0
- package/dist/assets/gnuplot-BBjkHhdK.js +1 -0
- package/dist/assets/gnuplot-DdkO51Og.js +1 -0
- package/dist/assets/go-BYCC9JQ2.js +1 -0
- package/dist/assets/go-Dn2_MT6a.js +1 -0
- package/dist/assets/graphql-By4-2MiP.js +1 -0
- package/dist/assets/graphql-ChdNCCLP.js +1 -0
- package/dist/assets/groovy-DjMbfbx0.js +1 -0
- package/dist/assets/groovy-gcz8RCvz.js +1 -0
- package/dist/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
- package/dist/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
- package/dist/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
- package/dist/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
- package/dist/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
- package/dist/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
- package/dist/assets/hack-CaT9iCJl.js +1 -0
- package/dist/assets/hack-Ce3HFLQu.js +1 -0
- package/dist/assets/haml-B8DHNrY2.js +1 -0
- package/dist/assets/haml-C-C08OMF.js +1 -0
- package/dist/assets/handlebars-BFxKmXBZ.js +1 -0
- package/dist/assets/handlebars-BL8al0AC.js +1 -0
- package/dist/assets/haskell-Df6bDoY_.js +1 -0
- package/dist/assets/haskell-DtebQ3Kv.js +1 -0
- package/dist/assets/haxe-CzTSHFRz.js +1 -0
- package/dist/assets/haxe-n0Q_eay_.js +1 -0
- package/dist/assets/hcl-BWvSN4gD.js +1 -0
- package/dist/assets/hcl-shhv74hy.js +1 -0
- package/dist/assets/hjson-BEMFYqr7.js +1 -0
- package/dist/assets/hjson-D5-asLiD.js +1 -0
- package/dist/assets/hlsl-D3lLCCz7.js +1 -0
- package/dist/assets/hlsl-Pefxhtaj.js +1 -0
- package/dist/assets/home-DDFZTO3p.js +1 -0
- package/dist/assets/houston-DnULxvSX.js +1 -0
- package/dist/assets/html-DBrZJmtb.js +1 -0
- package/dist/assets/html-GMplVEZG.js +1 -0
- package/dist/assets/html-derivative-BFtXZ54Q.js +1 -0
- package/dist/assets/html-derivative-DgyNW28a.js +1 -0
- package/dist/assets/http-D0p2QOuJ.js +1 -0
- package/dist/assets/http-jrhK8wxY.js +1 -0
- package/dist/assets/hurl-CeF7EoTQ.js +1 -0
- package/dist/assets/hurl-irOxFIW8.js +1 -0
- package/dist/assets/hxml-B_SuSTPP.js +1 -0
- package/dist/assets/hxml-Bvhsp5Yf.js +1 -0
- package/dist/assets/hy-CTpXmg0M.js +1 -0
- package/dist/assets/hy-DFXneXwc.js +1 -0
- package/dist/assets/imba-DGztddWO.js +1 -0
- package/dist/assets/imba-z_cUhu9e.js +1 -0
- package/dist/assets/index-D0jX0BNw.js +1844 -0
- package/dist/assets/index-DDCRe3lm.css +1 -0
- package/dist/assets/ini-BEwlwnbL.js +1 -0
- package/dist/assets/ini-DOGW4-0C.js +1 -0
- package/dist/assets/inter-FIwubZjA.woff2 +0 -0
- package/dist/assets/iosevka-nerd-font-DKH7rjGs.woff2 +0 -0
- package/dist/assets/iosevka-nerd-font-bold-BObfzjZJ.woff2 +0 -0
- package/dist/assets/java-B2AjWfgk.js +1 -0
- package/dist/assets/java-CylS5w8V.js +1 -0
- package/dist/assets/javascript-XPxc2APE.js +1 -0
- package/dist/assets/javascript-wDzz0qaB.js +1 -0
- package/dist/assets/jinja-4LBKfQ-Z.js +1 -0
- package/dist/assets/jinja-DlBE7Xgz.js +1 -0
- package/dist/assets/jison-DRGa8fbr.js +1 -0
- package/dist/assets/jison-wvAkD_A8.js +1 -0
- package/dist/assets/json-CjLXzM_z.js +1 -0
- package/dist/assets/json-Cp-IABpG.js +1 -0
- package/dist/assets/json5-C9tS-k6U.js +1 -0
- package/dist/assets/json5-DE06a0U2.js +1 -0
- package/dist/assets/jsonc-BYi4HS05.js +1 -0
- package/dist/assets/jsonc-Des-eS-w.js +1 -0
- package/dist/assets/jsonl-CuhIcKDk.js +1 -0
- package/dist/assets/jsonl-DcaNXYhu.js +1 -0
- package/dist/assets/jsonnet-DFQXde-d.js +1 -0
- package/dist/assets/jsonnet-DtQdHwK-.js +1 -0
- package/dist/assets/jssm-BlhucWo7.js +1 -0
- package/dist/assets/jssm-C2t-YnRu.js +1 -0
- package/dist/assets/jsx-BGEKFWBk.js +1 -0
- package/dist/assets/jsx-g9-lgVsj.js +1 -0
- package/dist/assets/julia-Bh5qjrIj.js +1 -0
- package/dist/assets/julia-C8NyazO9.js +1 -0
- package/dist/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
- package/dist/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
- package/dist/assets/kanagawa-wave-DWedfzmr.js +1 -0
- package/dist/assets/kdl-DJsF4U57.js +1 -0
- package/dist/assets/kdl-DV7GczEv.js +1 -0
- package/dist/assets/kotlin-BdnUsdx6.js +1 -0
- package/dist/assets/kotlin-DwKqsDKK.js +1 -0
- package/dist/assets/kusto-BvAqAH-y.js +1 -0
- package/dist/assets/kusto-w7PrLrBe.js +1 -0
- package/dist/assets/laserwave-DUszq2jm.js +1 -0
- package/dist/assets/latex-BdAV_C_H.js +1 -0
- package/dist/assets/latex-BuzO6rjU.js +1 -0
- package/dist/assets/lean-Bc6EcWN3.js +1 -0
- package/dist/assets/lean-Dle5D8N4.js +1 -0
- package/dist/assets/less-B1dDrJ26.js +1 -0
- package/dist/assets/less-C76OjOdF.js +1 -0
- package/dist/assets/light-plus-B7mTdjB0.js +1 -0
- package/dist/assets/liquid-DYVedYrR.js +1 -0
- package/dist/assets/liquid-DdraCjph.js +1 -0
- package/dist/assets/llvm-BtvRca6l.js +1 -0
- package/dist/assets/llvm-s1WuUfOe.js +1 -0
- package/dist/assets/log-2UxHyX5q.js +1 -0
- package/dist/assets/log-CbW7hOWU.js +1 -0
- package/dist/assets/logo-BbooMuDm.js +1 -0
- package/dist/assets/logo-BtOb2qkB.js +1 -0
- package/dist/assets/lua-BbnMAYS6.js +1 -0
- package/dist/assets/lua-tkfysgZP.js +1 -0
- package/dist/assets/luau-CBwFb-vO.js +1 -0
- package/dist/assets/luau-CXu1NL6O.js +1 -0
- package/dist/assets/make-CHLpvVh8.js +1 -0
- package/dist/assets/make-s9FKP0VE.js +1 -0
- package/dist/assets/markdown-CKXSK5AY.js +1 -0
- package/dist/assets/markdown-Cvjx9yec.js +1 -0
- package/dist/assets/marko-BsqRlKIY.js +1 -0
- package/dist/assets/marko-CPi9NSCl.js +1 -0
- package/dist/assets/material-theme-D5KoaKCx.js +1 -0
- package/dist/assets/material-theme-darker-BfHTSMKl.js +1 -0
- package/dist/assets/material-theme-lighter-B0m2ddpp.js +1 -0
- package/dist/assets/material-theme-ocean-CyktbL80.js +1 -0
- package/dist/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
- package/dist/assets/matlab-BQKM-LA_.js +1 -0
- package/dist/assets/matlab-D7o27uSR.js +1 -0
- package/dist/assets/mdc-BBM-UqJy.js +1 -0
- package/dist/assets/mdc-DUICxH0z.js +1 -0
- package/dist/assets/mdx-BWRhHdFl.js +1 -0
- package/dist/assets/mdx-Cmh6b_Ma.js +1 -0
- package/dist/assets/mermaid-DKYwYmdq.js +1 -0
- package/dist/assets/mermaid-DrapLM8U.js +1 -0
- package/dist/assets/min-dark-CafNBF8u.js +1 -0
- package/dist/assets/min-light-CTRr51gU.js +1 -0
- package/dist/assets/mipsasm-BElnB_7Q.js +1 -0
- package/dist/assets/mipsasm-CKIfxQSi.js +1 -0
- package/dist/assets/mojo-1DNp92w6.js +1 -0
- package/dist/assets/mojo-Dz6zCmiK.js +1 -0
- package/dist/assets/monokai-D4h5O-jR.js +1 -0
- package/dist/assets/move-Bu9oaDYs.js +1 -0
- package/dist/assets/move-Dvu4btzz.js +1 -0
- package/dist/assets/narrat-Cy2k80UN.js +1 -0
- package/dist/assets/narrat-DRg8JJMk.js +1 -0
- package/dist/assets/nextflow-BO4ujnzu.js +1 -0
- package/dist/assets/nextflow-BrzmwbiE.js +1 -0
- package/dist/assets/nginx-DknmC5AR.js +1 -0
- package/dist/assets/nginx-XmDIhN78.js +1 -0
- package/dist/assets/night-owl-C39BiMTA.js +1 -0
- package/dist/assets/nim-CVrawwO9.js +1 -0
- package/dist/assets/nim-Cm6-Nayq.js +1 -0
- package/dist/assets/nix-DcZRBjkC.js +1 -0
- package/dist/assets/nix-c8nO5XWb.js +1 -0
- package/dist/assets/nope-02-EygnDbCM.aac +0 -0
- package/dist/assets/nope-05-DZsXzrQW.aac +0 -0
- package/dist/assets/nope-08-COPo0uNf.aac +0 -0
- package/dist/assets/nope-11-CVdXg8G-.aac +0 -0
- package/dist/assets/nope-12-BJR1Ka3c.aac +0 -0
- package/dist/assets/nord-Ddv68eIx.js +1 -0
- package/dist/assets/nushell-C-sUppwS.js +1 -0
- package/dist/assets/nushell-Dqv-0Q5X.js +1 -0
- package/dist/assets/objective-c-DXmwc3jG.js +1 -0
- package/dist/assets/objective-c-sgtl-PdD.js +1 -0
- package/dist/assets/objective-cpp-BTQ37cYs.js +1 -0
- package/dist/assets/objective-cpp-CLxacb5B.js +1 -0
- package/dist/assets/ocaml-BvBP9Lm0.js +1 -0
- package/dist/assets/ocaml-C0hk2d4L.js +1 -0
- package/dist/assets/one-dark-pro-DVMEJ2y_.js +1 -0
- package/dist/assets/one-light-PoHY5YXO.js +1 -0
- package/dist/assets/openscad-C4EeE6gA.js +1 -0
- package/dist/assets/openscad-Dmi2c_42.js +1 -0
- package/dist/assets/pascal-D93ZcfNL.js +1 -0
- package/dist/assets/pascal-DYjw0AuS.js +1 -0
- package/dist/assets/perl-C0TMdlhV.js +1 -0
- package/dist/assets/perl-Djxv1YJ9.js +1 -0
- package/dist/assets/php-CDn_0X-4.js +1 -0
- package/dist/assets/php-DEfiO3Bd.js +1 -0
- package/dist/assets/pierre-dark-BXuwtOqb.js +1 -0
- package/dist/assets/pierre-light-dckrK0oj.js +1 -0
- package/dist/assets/pkl-Cij4Vm9z.js +1 -0
- package/dist/assets/pkl-u5AG7uiY.js +1 -0
- package/dist/assets/plastic-3e1v2bzS.js +1 -0
- package/dist/assets/plsql-Bd6NdBJI.js +1 -0
- package/dist/assets/plsql-ChMvpjG-.js +1 -0
- package/dist/assets/po-BTJTHyun.js +1 -0
- package/dist/assets/po-CUhVi7la.js +1 -0
- package/dist/assets/poimandres-CS3Unz2-.js +1 -0
- package/dist/assets/polar-B-qJ3AIy.js +1 -0
- package/dist/assets/polar-C0HS_06l.js +1 -0
- package/dist/assets/postcss-BSGhOJ4k.js +1 -0
- package/dist/assets/postcss-CXtECtnM.js +1 -0
- package/dist/assets/powerquery-CC1XieQO.js +1 -0
- package/dist/assets/powerquery-CEu0bR-o.js +1 -0
- package/dist/assets/powershell-DdRAnR4Z.js +1 -0
- package/dist/assets/powershell-Dpen1YoG.js +1 -0
- package/dist/assets/prisma-C0hJlfqX.js +1 -0
- package/dist/assets/prisma-Dd19v3D-.js +1 -0
- package/dist/assets/prolog-CbFg5uaA.js +1 -0
- package/dist/assets/prolog-bSi0SE3D.js +1 -0
- package/dist/assets/proto-DIGPV07t.js +1 -0
- package/dist/assets/proto-DyJlTyXw.js +1 -0
- package/dist/assets/pug-CGlum2m_.js +1 -0
- package/dist/assets/pug-ClQUpJlV.js +1 -0
- package/dist/assets/puppet-BMWR74SV.js +1 -0
- package/dist/assets/puppet-ja2MI9-b.js +1 -0
- package/dist/assets/purescript-CklMAg4u.js +1 -0
- package/dist/assets/purescript-CxgsQa43.js +1 -0
- package/dist/assets/python-B6aJPvgy.js +1 -0
- package/dist/assets/python-DgE28U1V.js +1 -0
- package/dist/assets/qml-3beO22l8.js +1 -0
- package/dist/assets/qml-BEkX6VoX.js +1 -0
- package/dist/assets/qmldir-C8lEn-DE.js +1 -0
- package/dist/assets/qmldir-DNYHzgow.js +1 -0
- package/dist/assets/qss-BZsEMKxJ.js +1 -0
- package/dist/assets/qss-IeuSbFQv.js +1 -0
- package/dist/assets/r-BfG_C0qz.js +1 -0
- package/dist/assets/r-DiinP2Uv.js +1 -0
- package/dist/assets/racket-BqYA7rlc.js +1 -0
- package/dist/assets/racket-CzHBKLyy.js +1 -0
- package/dist/assets/raku-CPccoUN1.js +1 -0
- package/dist/assets/raku-DXvB9xmW.js +1 -0
- package/dist/assets/razor-8rj0VRTp.js +1 -0
- package/dist/assets/razor-CE9lU5zL.js +1 -0
- package/dist/assets/red-bN70gL4F.js +1 -0
- package/dist/assets/reg-C-SQnVFl.js +1 -0
- package/dist/assets/reg-DkqHJyC0.js +1 -0
- package/dist/assets/regexp-BW_zLBm-.js +1 -0
- package/dist/assets/regexp-CDVJQ6XC.js +1 -0
- package/dist/assets/rel-BIqKdwke.js +1 -0
- package/dist/assets/rel-C3B-1QV4.js +1 -0
- package/dist/assets/riscv-BM1_JUlF.js +1 -0
- package/dist/assets/riscv-s6spwTFp.js +1 -0
- package/dist/assets/rose-pine-dawn-DHQR4-dF.js +1 -0
- package/dist/assets/rose-pine-moon-D4_iv3hh.js +1 -0
- package/dist/assets/rose-pine-qdsjHGoJ.js +1 -0
- package/dist/assets/rosmsg-BJDFO7_C.js +1 -0
- package/dist/assets/rosmsg-TcL_zzr8.js +1 -0
- package/dist/assets/rst-8IYWyo0X.js +1 -0
- package/dist/assets/rst-B0xPkSld.js +1 -0
- package/dist/assets/ruby-BvKwtOVI.js +1 -0
- package/dist/assets/ruby-CHyTNJrF.js +1 -0
- package/dist/assets/rust-B1yitclQ.js +1 -0
- package/dist/assets/rust-DJErdhjk.js +1 -0
- package/dist/assets/sas-BZeeyq_z.js +1 -0
- package/dist/assets/sas-cz2c8ADy.js +1 -0
- package/dist/assets/sass-CIfQ9yqV.js +1 -0
- package/dist/assets/sass-Cj5Yp3dK.js +1 -0
- package/dist/assets/scala-C151Ov-r.js +1 -0
- package/dist/assets/scala-CWwlNtab.js +1 -0
- package/dist/assets/scheme-ByM66cy_.js +1 -0
- package/dist/assets/scheme-C98Dy4si.js +1 -0
- package/dist/assets/scss-Dk05w39G.js +1 -0
- package/dist/assets/scss-OYdSNvt2.js +1 -0
- package/dist/assets/sdbl-C5Q1usnU.js +1 -0
- package/dist/assets/sdbl-DVxCFoDh.js +1 -0
- package/dist/assets/session-fRmszlju.js +41 -0
- package/dist/assets/shaderlab-DNkMdb2B.js +1 -0
- package/dist/assets/shaderlab-Dg9Lc6iA.js +1 -0
- package/dist/assets/shellscript-CE-5zpiL.js +1 -0
- package/dist/assets/shellscript-Yzrsuije.js +1 -0
- package/dist/assets/shellsession-BADoaaVG.js +1 -0
- package/dist/assets/shellsession-BhddCRKA.js +1 -0
- package/dist/assets/slack-dark-BthQWCQV.js +1 -0
- package/dist/assets/slack-ochin-DqwNpetd.js +1 -0
- package/dist/assets/smalltalk-BERRCDM3.js +1 -0
- package/dist/assets/smalltalk-GKfhTxrk.js +1 -0
- package/dist/assets/snazzy-light-Bw305WKR.js +1 -0
- package/dist/assets/solarized-dark-DXbdFlpD.js +1 -0
- package/dist/assets/solarized-light-L9t79GZl.js +1 -0
- package/dist/assets/solidity-DanOLEvk.js +1 -0
- package/dist/assets/solidity-rGO070M0.js +1 -0
- package/dist/assets/soy-Brmx7dQM.js +1 -0
- package/dist/assets/soy-C6ERzLIv.js +1 -0
- package/dist/assets/sparql-CHK3vDkL.js +1 -0
- package/dist/assets/sparql-rVzFXLq3.js +1 -0
- package/dist/assets/splunk-BtCnVYZw.js +1 -0
- package/dist/assets/splunk-YU1HCmJX.js +1 -0
- package/dist/assets/sprite-BxALe73Z.svg +882 -0
- package/dist/assets/sprite-Fb-TFjRY.svg +11707 -0
- package/dist/assets/sql-BLtJtn59.js +1 -0
- package/dist/assets/sql-CKXjX23X.js +1 -0
- package/dist/assets/ssh-config-Cpnw3KEt.js +1 -0
- package/dist/assets/ssh-config-_ykCGR6B.js +1 -0
- package/dist/assets/staplebops-03-Aug82oH0.aac +0 -0
- package/dist/assets/staplebops-04-olyHi8qQ.aac +0 -0
- package/dist/assets/staplebops-06-Cj_2vOI4.aac +0 -0
- package/dist/assets/staplebops-07-cqQEvbIf.aac +0 -0
- package/dist/assets/stata-BH5u7GGu.js +1 -0
- package/dist/assets/stata-BJqnY-gO.js +1 -0
- package/dist/assets/stylus-BEDo0Tqx.js +1 -0
- package/dist/assets/stylus-CHekGIgu.js +1 -0
- package/dist/assets/svelte-3Dk4HxPD.js +1 -0
- package/dist/assets/svelte-DmnhoTkn.js +1 -0
- package/dist/assets/swift-Deru3G9w.js +1 -0
- package/dist/assets/swift-Dg5xB15N.js +1 -0
- package/dist/assets/synthwave-84-CbfX1IO0.js +1 -0
- package/dist/assets/system-verilog-CnnmHF94.js +1 -0
- package/dist/assets/system-verilog-rKNYENrf.js +1 -0
- package/dist/assets/systemd-4A_iFExJ.js +1 -0
- package/dist/assets/systemd-C1FfcI00.js +1 -0
- package/dist/assets/talonscript-CkByrt1z.js +1 -0
- package/dist/assets/talonscript-bksoRmW6.js +1 -0
- package/dist/assets/tasl-Bl4tsGRM.js +1 -0
- package/dist/assets/tasl-QIJgUcNo.js +1 -0
- package/dist/assets/tcl-B2_VAYrd.js +1 -0
- package/dist/assets/tcl-dwOrl1Do.js +1 -0
- package/dist/assets/templ-CyHhV9jl.js +1 -0
- package/dist/assets/templ-W15q3VgB.js +1 -0
- package/dist/assets/terminal-Cpd_WDea.png +0 -0
- package/dist/assets/terraform-BETggiCN.js +1 -0
- package/dist/assets/terraform-Ba94thAr.js +1 -0
- package/dist/assets/tex-CxkMU7Pf.js +1 -0
- package/dist/assets/tex-DZ7Smwga.js +1 -0
- package/dist/assets/textmate-B-hymv65.png +0 -0
- package/dist/assets/tokyo-night-hegEt444.js +1 -0
- package/dist/assets/toml-Btlk-g9G.js +1 -0
- package/dist/assets/toml-vGWfd6FD.js +1 -0
- package/dist/assets/ts-tags-DMPjx__B.js +1 -0
- package/dist/assets/ts-tags-zn1MmPIZ.js +1 -0
- package/dist/assets/tsv-B_m7g4N7.js +1 -0
- package/dist/assets/tsv-DYfmKMIW.js +1 -0
- package/dist/assets/tsx-COt5Ahok.js +1 -0
- package/dist/assets/tsx-Dio8iE-N.js +1 -0
- package/dist/assets/turtle-BsS91CYL.js +1 -0
- package/dist/assets/turtle-whXsfw69.js +1 -0
- package/dist/assets/twig-CO9l9SDP.js +1 -0
- package/dist/assets/twig-vsFUeHgy.js +1 -0
- package/dist/assets/typescript-BPQ3VLAy.js +1 -0
- package/dist/assets/typescript-DttGkNCf.js +1 -0
- package/dist/assets/typespec-BGHnOYBU.js +1 -0
- package/dist/assets/typespec-C_z-8Pri.js +1 -0
- package/dist/assets/typst-D2RORpaG.js +1 -0
- package/dist/assets/typst-DHCkPAjA.js +1 -0
- package/dist/assets/v-BcVCzyr7.js +1 -0
- package/dist/assets/v-CvM42WIw.js +1 -0
- package/dist/assets/vala-B_5xOBNr.js +1 -0
- package/dist/assets/vala-CsfeWuGM.js +1 -0
- package/dist/assets/vb-BVDm3zBt.js +1 -0
- package/dist/assets/vb-D17OF-Vu.js +1 -0
- package/dist/assets/verilog-BQ8w6xss.js +1 -0
- package/dist/assets/verilog-D5iownw6.js +1 -0
- package/dist/assets/vesper-DU1UobuO.js +1 -0
- package/dist/assets/vhdl-Bmgbkl_-.js +1 -0
- package/dist/assets/vhdl-CeAyd5Ju.js +1 -0
- package/dist/assets/viml-3ZODU9FQ.js +1 -0
- package/dist/assets/viml-CJc9bBzg.js +1 -0
- package/dist/assets/vitesse-black-Bkuqu6BP.js +1 -0
- package/dist/assets/vitesse-dark-D0r3Knsf.js +1 -0
- package/dist/assets/vitesse-light-CVO1_9PV.js +1 -0
- package/dist/assets/vue-BJuclMoA.js +1 -0
- package/dist/assets/vue-DnHKYNfI.js +1 -0
- package/dist/assets/vue-html-CChd_i61.js +1 -0
- package/dist/assets/vue-html-CRAum25o.js +1 -0
- package/dist/assets/vue-vine-8moa0y9V.js +1 -0
- package/dist/assets/vue-vine-CDS6dxm6.js +1 -0
- package/dist/assets/vyper-B6NKdirK.js +1 -0
- package/dist/assets/vyper-CDx5xZoG.js +1 -0
- package/dist/assets/wasm-CG6Dc4jp.js +1 -0
- package/dist/assets/wasm-LUzQYg3H.js +1 -0
- package/dist/assets/wasm-MzD3tlZU.js +1 -0
- package/dist/assets/wenyan-8fXatRyt.js +1 -0
- package/dist/assets/wenyan-BV7otONQ.js +1 -0
- package/dist/assets/wgsl-CECC3vJ5.js +1 -0
- package/dist/assets/wgsl-Dx-B1_4e.js +1 -0
- package/dist/assets/wikitext-BaRWL9sq.js +1 -0
- package/dist/assets/wikitext-BhOHFoWU.js +1 -0
- package/dist/assets/wit-5i3qLPDT.js +1 -0
- package/dist/assets/wit-MEd50GYB.js +1 -0
- package/dist/assets/wolfram-CmMaIVaG.js +1 -0
- package/dist/assets/wolfram-lXgVvXCa.js +1 -0
- package/dist/assets/worker-CKpRWWws.js +153 -0
- package/dist/assets/xcode-4zqeTePl.png +0 -0
- package/dist/assets/xml-DtyAt_xK.js +1 -0
- package/dist/assets/xml-sdJ4AIDG.js +1 -0
- package/dist/assets/xsl-Btrj9DhN.js +1 -0
- package/dist/assets/xsl-CtQFsRM5.js +1 -0
- package/dist/assets/yaml-B92AUxDB.js +1 -0
- package/dist/assets/yaml-Buea-lGh.js +1 -0
- package/dist/assets/yup-01-BtRq6dLN.aac +0 -0
- package/dist/assets/yup-03-BHLEoqSS.aac +0 -0
- package/dist/assets/yup-04-C7yadpJT.aac +0 -0
- package/dist/assets/yup-05-CuuaeyjC.aac +0 -0
- package/dist/assets/zenscript-DVFEvuxE.js +1 -0
- package/dist/assets/zenscript-Dja4fBOE.js +1 -0
- package/dist/assets/zig-LhWa2ADv.js +1 -0
- package/dist/assets/zig-VOosw3JB.js +1 -0
- package/dist/favicon-96x96-v3.png +0 -0
- package/dist/favicon-96x96.png +0 -0
- package/dist/favicon-v3.ico +0 -0
- package/dist/favicon-v3.svg +7 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon.svg +7 -0
- package/dist/index.html +24 -0
- package/dist/oc-theme-preload.js +28 -0
- package/dist/site.webmanifest +21 -0
- package/dist/social-share-zen.png +0 -0
- package/dist/social-share.png +0 -0
- package/dist/web-app-manifest-192x192.png +0 -0
- package/dist/web-app-manifest-512x512.png +0 -0
- package/e2e/AGENTS.md +176 -0
- package/e2e/actions.ts +421 -0
- package/e2e/app/home.spec.ts +21 -0
- package/e2e/app/navigation.spec.ts +10 -0
- package/e2e/app/palette.spec.ts +11 -0
- package/e2e/app/server-default.spec.ts +55 -0
- package/e2e/app/session.spec.ts +16 -0
- package/e2e/app/titlebar-history.spec.ts +42 -0
- package/e2e/files/file-open.spec.ts +18 -0
- package/e2e/files/file-tree.spec.ts +37 -0
- package/e2e/files/file-viewer.spec.ts +26 -0
- package/e2e/fixtures.ts +87 -0
- package/e2e/models/model-picker.spec.ts +42 -0
- package/e2e/models/models-visibility.spec.ts +61 -0
- package/e2e/projects/project-edit.spec.ts +53 -0
- package/e2e/projects/projects-close.spec.ts +74 -0
- package/e2e/projects/projects-switch.spec.ts +35 -0
- package/e2e/projects/workspaces.spec.ts +333 -0
- package/e2e/prompt/context.spec.ts +40 -0
- package/e2e/prompt/prompt-mention.spec.ts +26 -0
- package/e2e/prompt/prompt-slash-open.spec.ts +22 -0
- package/e2e/prompt/prompt.spec.ts +58 -0
- package/e2e/selectors.ts +57 -0
- package/e2e/session/session.spec.ts +157 -0
- package/e2e/settings/settings-keybinds.spec.ts +320 -0
- package/e2e/settings/settings-models.spec.ts +122 -0
- package/e2e/settings/settings-providers.spec.ts +136 -0
- package/e2e/settings/settings.spec.ts +292 -0
- package/e2e/sidebar/sidebar-session-links.spec.ts +31 -0
- package/e2e/sidebar/sidebar.spec.ts +14 -0
- package/e2e/status/status-popover.spec.ts +94 -0
- package/e2e/terminal/terminal-init.spec.ts +26 -0
- package/e2e/terminal/terminal.spec.ts +17 -0
- package/e2e/thinking-level.spec.ts +25 -0
- package/e2e/tsconfig.json +8 -0
- package/e2e/utils.ts +35 -0
- package/happydom.ts +75 -0
- package/index.html +23 -0
- package/package.json +72 -0
- package/playwright.config.ts +43 -0
- package/public/_headers +17 -0
- package/public/oc-theme-preload.js +28 -0
- package/script/e2e-local.ts +140 -0
- package/src/addons/serialize.test.ts +319 -0
- package/src/addons/serialize.ts +634 -0
- package/src/app.tsx +170 -0
- package/src/components/dialog-connect-provider.tsx +456 -0
- package/src/components/dialog-custom-provider.tsx +424 -0
- package/src/components/dialog-edit-project.tsx +245 -0
- package/src/components/dialog-fork.tsx +100 -0
- package/src/components/dialog-manage-models.tsx +76 -0
- package/src/components/dialog-release-notes.tsx +158 -0
- package/src/components/dialog-select-directory.tsx +326 -0
- package/src/components/dialog-select-file.tsx +404 -0
- package/src/components/dialog-select-mcp.tsx +96 -0
- package/src/components/dialog-select-model-unpaid.tsx +132 -0
- package/src/components/dialog-select-model.tsx +271 -0
- package/src/components/dialog-select-provider.tsx +87 -0
- package/src/components/dialog-select-server.tsx +536 -0
- package/src/components/dialog-settings.tsx +82 -0
- package/src/components/file-tree.test.ts +77 -0
- package/src/components/file-tree.tsx +468 -0
- package/src/components/link.tsx +17 -0
- package/src/components/model-tooltip.tsx +91 -0
- package/src/components/prompt-input/attachments.ts +145 -0
- package/src/components/prompt-input/build-request-parts.test.ts +277 -0
- package/src/components/prompt-input/build-request-parts.ts +190 -0
- package/src/components/prompt-input/context-items.tsx +82 -0
- package/src/components/prompt-input/drag-overlay.tsx +20 -0
- package/src/components/prompt-input/editor-dom.test.ts +51 -0
- package/src/components/prompt-input/editor-dom.ts +135 -0
- package/src/components/prompt-input/history.test.ts +69 -0
- package/src/components/prompt-input/history.ts +160 -0
- package/src/components/prompt-input/image-attachments.tsx +51 -0
- package/src/components/prompt-input/placeholder.test.ts +35 -0
- package/src/components/prompt-input/placeholder.ts +13 -0
- package/src/components/prompt-input/slash-popover.tsx +144 -0
- package/src/components/prompt-input/submit.ts +411 -0
- package/src/components/prompt-input.tsx +1199 -0
- package/src/components/question-dock.tsx +295 -0
- package/src/components/server/server-row.tsx +77 -0
- package/src/components/session/index.ts +5 -0
- package/src/components/session/session-context-metrics.test.ts +93 -0
- package/src/components/session/session-context-metrics.ts +94 -0
- package/src/components/session/session-context-tab.tsx +400 -0
- package/src/components/session/session-header.tsx +571 -0
- package/src/components/session/session-new-view.tsx +78 -0
- package/src/components/session/session-sortable-tab.tsx +63 -0
- package/src/components/session/session-sortable-terminal-tab.tsx +190 -0
- package/src/components/session-context-usage.tsx +100 -0
- package/src/components/settings-agents.tsx +15 -0
- package/src/components/settings-commands.tsx +15 -0
- package/src/components/settings-general.tsx +434 -0
- package/src/components/settings-keybinds.tsx +435 -0
- package/src/components/settings-mcp.tsx +15 -0
- package/src/components/settings-models.tsx +130 -0
- package/src/components/settings-permissions.tsx +228 -0
- package/src/components/settings-providers.tsx +264 -0
- package/src/components/status-popover.tsx +371 -0
- package/src/components/terminal.tsx +464 -0
- package/src/components/titlebar-history.test.ts +63 -0
- package/src/components/titlebar-history.ts +57 -0
- package/src/components/titlebar.tsx +261 -0
- package/src/context/command-keybind.test.ts +43 -0
- package/src/context/command.test.ts +25 -0
- package/src/context/command.tsx +365 -0
- package/src/context/comments.test.ts +111 -0
- package/src/context/comments.tsx +185 -0
- package/src/context/file/content-cache.ts +88 -0
- package/src/context/file/path.test.ts +352 -0
- package/src/context/file/path.ts +143 -0
- package/src/context/file/tree-store.ts +170 -0
- package/src/context/file/types.ts +41 -0
- package/src/context/file/view-cache.ts +136 -0
- package/src/context/file/watcher.test.ts +118 -0
- package/src/context/file/watcher.ts +52 -0
- package/src/context/file-content-eviction-accounting.test.ts +65 -0
- package/src/context/file.tsx +263 -0
- package/src/context/global-sdk.tsx +108 -0
- package/src/context/global-sync/bootstrap.ts +195 -0
- package/src/context/global-sync/child-store.ts +263 -0
- package/src/context/global-sync/event-reducer.test.ts +201 -0
- package/src/context/global-sync/event-reducer.ts +319 -0
- package/src/context/global-sync/eviction.ts +28 -0
- package/src/context/global-sync/queue.ts +83 -0
- package/src/context/global-sync/session-load.ts +26 -0
- package/src/context/global-sync/session-trim.test.ts +59 -0
- package/src/context/global-sync/session-trim.ts +56 -0
- package/src/context/global-sync/types.ts +134 -0
- package/src/context/global-sync/utils.ts +25 -0
- package/src/context/global-sync.test.ts +136 -0
- package/src/context/global-sync.tsx +365 -0
- package/src/context/highlights.tsx +225 -0
- package/src/context/language.tsx +226 -0
- package/src/context/layout-scroll.test.ts +36 -0
- package/src/context/layout-scroll.ts +118 -0
- package/src/context/layout.test.ts +69 -0
- package/src/context/layout.tsx +844 -0
- package/src/context/local.tsx +229 -0
- package/src/context/models.tsx +140 -0
- package/src/context/notification-index.ts +66 -0
- package/src/context/notification.test.ts +73 -0
- package/src/context/notification.tsx +199 -0
- package/src/context/permission.tsx +186 -0
- package/src/context/platform.tsx +75 -0
- package/src/context/prompt.tsx +246 -0
- package/src/context/sdk.tsx +48 -0
- package/src/context/server.tsx +208 -0
- package/src/context/settings.tsx +177 -0
- package/src/context/sync-optimistic.test.ts +56 -0
- package/src/context/sync.tsx +358 -0
- package/src/context/terminal.test.ts +38 -0
- package/src/context/terminal.tsx +283 -0
- package/src/entry.tsx +104 -0
- package/src/env.d.ts +8 -0
- package/src/hooks/use-providers.ts +31 -0
- package/src/i18n/ar.ts +716 -0
- package/src/i18n/br.ts +722 -0
- package/src/i18n/bs.ts +749 -0
- package/src/i18n/da.ts +721 -0
- package/src/i18n/de.ts +766 -0
- package/src/i18n/en.ts +792 -0
- package/src/i18n/es.ts +727 -0
- package/src/i18n/fr.ts +733 -0
- package/src/i18n/ja.ts +715 -0
- package/src/i18n/ko.ts +720 -0
- package/src/i18n/no.ts +723 -0
- package/src/i18n/parity.test.ts +31 -0
- package/src/i18n/pl.ts +723 -0
- package/src/i18n/ru.ts +727 -0
- package/src/i18n/th.ts +714 -0
- package/src/i18n/zh.ts +754 -0
- package/src/i18n/zht.ts +752 -0
- package/src/index.css +1 -0
- package/src/index.ts +3 -0
- package/src/pages/directory-layout.tsx +71 -0
- package/src/pages/error.tsx +290 -0
- package/src/pages/home.tsx +126 -0
- package/src/pages/layout/deep-links.ts +26 -0
- package/src/pages/layout/helpers.test.ts +63 -0
- package/src/pages/layout/helpers.ts +65 -0
- package/src/pages/layout/inline-editor.tsx +113 -0
- package/src/pages/layout/sidebar-items.tsx +328 -0
- package/src/pages/layout/sidebar-project-helpers.test.ts +63 -0
- package/src/pages/layout/sidebar-project-helpers.ts +11 -0
- package/src/pages/layout/sidebar-project.tsx +283 -0
- package/src/pages/layout/sidebar-shell-helpers.ts +1 -0
- package/src/pages/layout/sidebar-shell.test.ts +13 -0
- package/src/pages/layout/sidebar-shell.tsx +109 -0
- package/src/pages/layout/sidebar-workspace-helpers.ts +2 -0
- package/src/pages/layout/sidebar-workspace.test.ts +13 -0
- package/src/pages/layout/sidebar-workspace.tsx +410 -0
- package/src/pages/layout.tsx +1996 -0
- package/src/pages/session/file-tab-scroll.test.ts +40 -0
- package/src/pages/session/file-tab-scroll.ts +67 -0
- package/src/pages/session/file-tabs.tsx +516 -0
- package/src/pages/session/helpers.test.ts +61 -0
- package/src/pages/session/helpers.ts +38 -0
- package/src/pages/session/message-gesture.test.ts +62 -0
- package/src/pages/session/message-gesture.ts +21 -0
- package/src/pages/session/message-timeline.tsx +348 -0
- package/src/pages/session/review-tab.tsx +158 -0
- package/src/pages/session/scroll-spy.test.ts +127 -0
- package/src/pages/session/scroll-spy.ts +274 -0
- package/src/pages/session/session-command-helpers.ts +10 -0
- package/src/pages/session/session-mobile-tabs.tsx +36 -0
- package/src/pages/session/session-prompt-dock.test.ts +22 -0
- package/src/pages/session/session-prompt-dock.tsx +137 -0
- package/src/pages/session/session-prompt-helpers.ts +4 -0
- package/src/pages/session/session-side-panel.tsx +319 -0
- package/src/pages/session/terminal-label.ts +16 -0
- package/src/pages/session/terminal-panel.test.ts +25 -0
- package/src/pages/session/terminal-panel.tsx +169 -0
- package/src/pages/session/use-session-commands.test.ts +44 -0
- package/src/pages/session/use-session-commands.tsx +455 -0
- package/src/pages/session/use-session-hash-scroll.test.ts +16 -0
- package/src/pages/session/use-session-hash-scroll.ts +174 -0
- package/src/pages/session.tsx +1755 -0
- package/src/sst-env.d.ts +12 -0
- package/src/utils/agent.ts +11 -0
- package/src/utils/aim.ts +138 -0
- package/src/utils/base64.ts +10 -0
- package/src/utils/dom.ts +51 -0
- package/src/utils/id.ts +99 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/perf.ts +135 -0
- package/src/utils/persist.ts +451 -0
- package/src/utils/prompt.ts +203 -0
- package/src/utils/runtime-adapters.test.ts +62 -0
- package/src/utils/runtime-adapters.ts +39 -0
- package/src/utils/same.ts +6 -0
- package/src/utils/scoped-cache.test.ts +69 -0
- package/src/utils/scoped-cache.ts +104 -0
- package/src/utils/server-health.test.ts +42 -0
- package/src/utils/server-health.ts +29 -0
- package/src/utils/solid-dnd.tsx +55 -0
- package/src/utils/sound.ts +117 -0
- package/src/utils/speech.ts +326 -0
- package/src/utils/time.ts +14 -0
- package/src/utils/worktree.test.ts +46 -0
- package/src/utils/worktree.ts +73 -0
- package/sst-env.d.ts +10 -0
- package/tsconfig.json +26 -0
- package/vite.config.ts +15 -0
- package/vite.js +26 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ghostty-web-CsYhFgbJ.js","assets/index-D0jX0BNw.js","assets/index-DDCRe3lm.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{p as It,q as br,r as re,s as ot,v as rt,w as Ve,x as ii,y as Ce,t as $,P as Kc,z as kr,A as Ct,C as ze,E as yp,G as $a,g as w,h as s,H as Vc,m as se,J as Gt,K as Jc,N as At,O as Yo,Q as P,R as $p,T as _p,U as wp,V as xp,W as oi,X as Fn,Y as ai,Z as or,_ as ar,$ as Ot,a0 as Sl,a1 as kp,a2 as io,a3 as gt,i as d,a4 as zt,j as be,k as ct,a5 as _n,a6 as Dn,e as Xc,b as oo,c as wn,f as wt,d as si,B as Ue,a7 as it,F as Ge,a8 as Sp,I as Be,a9 as Te,D as Ip,aa as _a,ab as Tp,ac as Cp,ad as Il,ae as lt,af as Ut,ag as Yc,a as Sr,ah as Bn,ai as li,aj as wa,ak as Tt,al as Qo,am as ea,an as at,ao as Dp,ap as Zt,aq as mn,ar as zp,as as Ep,at as Op,au as In,av as Qc,aw as Ap,ax as Pp,ay as Np,az as jp,aA as Up,aB as Lp,aC as Rp,aD as Ir,aE as ut,aF as Xt,l as vr,aG as Mp,aH as ci,aI as eu,aJ as Tr,aK as tu,aL as Cr,aM as nu,aN as ao,aO as so,aP as ru,aQ as iu,aR as Fp,aS as ou,aT as xa,aU as Wi,aV as au,aW as ui,aX as su,aY as Zp,aZ as lo,a_ as ln,a$ as ka,S as bt,M as De,b0 as Sa,b1 as zn,b2 as Bp,b3 as Wp,b4 as Tl,b5 as qp,b6 as Hp,b7 as Gp,b8 as ta,b9 as Kp,ba as Ia,bb as lu,bc as cu,bd as uu,be as du,bf as fu,bg as mu,bh as Jn,bi as Vp,bj as Jp,bk as Xp,bl as Yp,bm as Qp,bn as Cl,bo as Wn,bp as gu,bq as ev,br as tv,bs as Qn,bt as nv,bu as rv,u as hu,bv as tr,bw as iv,bx as sr,n as ei,by as Dr,bz as Nt,bA as co,bB as Qr,bC as di,bD as ov,bE as Dl,bF as pu,bG as na,bH as av,bI as jo,bJ as sv,bK as lv,bL as vu,bM as bu,bN as zl,bO as cv,bP as El,bQ as yu,bR as Ol,bS as Di,bT as qi,bU as uv,bV as Ur,bW as Uo,bX as Al}from"./index-D0jX0BNw.js";function $u(e){const n=Math.min(e.start,e.end),r=Math.max(e.start,e.end);return{startLine:n,endLine:r,startChar:0,endChar:0}}function Ta(e){let n,r=!1,i,t,o,a;const l=()=>e.bottomThreshold??10,[u,c]=It({contentRef:void 0,userScrolled:!1}),m=()=>e.working()||r,f=k=>k.scrollHeight-k.clientHeight-k.scrollTop,g=k=>k.scrollHeight-k.clientHeight>1,p=k=>{a={top:Math.max(0,k.scrollHeight-k.clientHeight),time:Date.now()},t&&clearTimeout(t),t=setTimeout(()=>{a=void 0,t=void 0},250)},h=k=>{const D=a;return D?Date.now()-D.time>250?(a=void 0,!1):Math.abs(k.scrollTop-D.top)<2:!1},v=k=>{const D=n;D&&(p(D),D.scrollTop=D.scrollHeight)},b=k=>{if(!k&&!m())return;const D=n;!D||!k&&u.userScrolled||(k&&u.userScrolled&&c("userScrolled",!1),f(D)<2)||v()},x=()=>{const k=n;if(k){if(!g(k)){u.userScrolled&&c("userScrolled",!1);return}u.userScrolled||(c("userScrolled",!0),e.onUserInteracted?.())}},R=k=>{if(k.deltaY>=0)return;const D=n,S=(k.target instanceof Element?k.target:void 0)?.closest("[data-scrollable]");D&&S&&S!==D||x()},U=()=>{const k=n;if(k){if(!g(k)){u.userScrolled&&c("userScrolled",!1);return}if(f(k)<l()){u.userScrolled&&c("userScrolled",!1);return}if(!u.userScrolled&&h(k)){b(!1);return}x()}},A=()=>{m()&&x()},N=k=>{const D=e.overflowAnchor??"dynamic";if(D==="none"){k.style.overflowAnchor="none";return}if(D==="auto"){k.style.overflowAnchor="auto";return}k.style.overflowAnchor=u.userScrolled?"auto":"none"};return br(()=>u.contentRef,()=>{const k=n;if(k&&!g(k)){u.userScrolled&&c("userScrolled",!1);return}m()&&(u.userScrolled||b(!1))}),re(ot(e.working,k=>{if(r=!1,i&&clearTimeout(i),i=void 0,k){u.userScrolled||b(!0);return}r=!0,i=setTimeout(()=>{r=!1},300)})),re(()=>{u.userScrolled;const k=n;k&&N(k)}),rt(()=>{i&&clearTimeout(i),t&&clearTimeout(t),o&&o()}),{scrollRef:k=>{o&&(o(),o=void 0),n=k,k&&(N(k),k.addEventListener("wheel",R,{passive:!0}),o=()=>{k.removeEventListener("wheel",R)})},contentRef:k=>c("contentRef",k),handleScroll:U,handleInteraction:A,pause:x,resume:()=>{u.userScrolled&&c("userScrolled",!1),b(!0)},scrollToBottom:()=>b(!1),forceScrollToBottom:()=>b(!0),userScrolled:()=>u.userScrolled}}const dv="/assets/android-studio-D0DqtVA4.svg",fv="/assets/antigravity-XfClf80L.svg",mv="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='cursor_light__Ebene_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20466.73%20532.09'%3e%3c!--Generator:%20Adobe%20Illustrator%2029.6.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%202.1.1%20Build%209)--%3e%3cdefs%3e%3cstyle%3e.cursor_light__st0{fill:%2326251e}%3c/style%3e%3c/defs%3e%3cpath%20class='cursor_light__st0'%20d='M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z'/%3e%3c/svg%3e",gv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='256'%20height='256'%20viewBox='0%200%20256%20256'%20xml:space='preserve'%3e%3cg%20style='stroke:none;stroke-width:0;stroke-dasharray:none;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;fill:none;fill-rule:nonzero;opacity:1'%20transform='translate(1.407%201.407)scale(2.81)'%3e%3clinearGradient%20id='a'%20gradientUnits='userSpaceOnUse'%20x1='44.348'%20y1='16.53'%20x2='42.921'%20y2='8.538'%3e%3cstop%20offset='0%25'%20style='stop-color:%23ce9918;stop-opacity:1'/%3e%3cstop%20offset='59.02%25'%20style='stop-color:%23df9e00;stop-opacity:1'/%3e%3c/linearGradient%3e%3cpath%20d='m34.429%2012.182-3.618-3.93a5.72%205.72%200%200%200-4.208-1.846H2.438A2.437%202.437%200%200%200%200%208.844V25.75l.121.013a2.845%202.845%200%200%201%202.733-2.074h22.99c3.267%200%206.442-1.43%208.377-4.063a10.57%2010.57%200%200%201%208.515-4.309h44.41A2.854%202.854%200%200%201%2090%2018.171v-3.354a2.323%202.323%200%200%200-2.323-2.323H35.143a.97.97%200%200%201-.714-.312'%20style='stroke:none;stroke-width:1;stroke-dasharray:none;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;fill:url(%23a);fill-rule:nonzero;opacity:1'/%3e%3clinearGradient%20id='b'%20gradientUnits='userSpaceOnUse'%20x1='62.876'%20y1='69.664'%20x2='25.487'%20y2='26.567'%3e%3cstop%20offset='0%25'%20style='stop-color:%23f5b509;stop-opacity:1'/%3e%3cstop%20offset='100%25'%20style='stop-color:%23fece49;stop-opacity:1'/%3e%3c/linearGradient%3e%3cpath%20d='M34.313%2018.71a10.57%2010.57%200%200%201-8.423%204.186H2.854A2.854%202.854%200%200%200%200%2025.751V80.74a2.854%202.854%200%200%200%202.854%202.854h84.292A2.854%202.854%200%200%200%2090%2080.74V17.378a2.854%202.854%200%200%200-2.854-2.854h-44.41a10.57%2010.57%200%200%200-8.423%204.186'%20style='stroke:none;stroke-width:1;stroke-dasharray:none;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;fill:url(%23b);fill-rule:nonzero;opacity:1'/%3e%3clinearGradient%20id='c'%20gradientUnits='userSpaceOnUse'%20x1='66.058'%20y1='81.144'%20x2='10.973'%20y2='54.886'%3e%3cstop%20offset='0%25'%20style='stop-color:%230161b2;stop-opacity:1'/%3e%3cstop%20offset='100%25'%20style='stop-color:%231291dd;stop-opacity:1'/%3e%3c/linearGradient%3e%3cpath%20d='M66.834%2055.053H23.166a9.67%209.67%200%200%200-9.672%209.672v18.869h63.013V64.725c-.001-5.342-4.331-9.672-9.673-9.672'%20style='stroke:none;stroke-width:1;stroke-dasharray:none;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;fill:url(%23c);fill-rule:nonzero;opacity:1'/%3e%3cpath%20d='M63.552%2073.306H26.448a2%202%200%200%201%200-4h37.104a2%202%200%200%201%200%204'%20style='stroke:none;stroke-width:1;stroke-dasharray:none;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:10;fill:%2310498a;fill-rule:nonzero;opacity:1'/%3e%3c/g%3e%3c/svg%3e",hv="/assets/finder-CGxGn0h3.png",pv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2027%2032'%3e%3cpath%20fill='%233551F3'%20d='M20.395%2032a6.35%206.35%200%200%201-3.516-1.067A6.355%206.355%200%200%201%2013.362%2032c-1.249%200-2.48-.375-3.516-1.067A6.265%206.265%200%200%201%206.372%2032h-.038a6.255%206.255%200%200%201-4.5-1.906%206.377%206.377%200%200%201-1.836-4.482v-12.25C0%205.995%205.994%200%2013.362%200c7.369%200%2013.363%205.994%2013.363%2013.363v12.253c0%203.393-2.626%206.192-5.978%206.375-.117.007-.234.009-.352.009Z'/%3e%3cpath%20fill='%23000'%20d='M20.395%2030.593a4.932%204.932%200%200%201-3.08-1.083.656.656%200%200%200-.42-.145.784.784%200%200%200-.487.176%204.939%204.939%200%200%201-3.046%201.055%204.939%204.939%200%200%201-3.045-1.055.751.751%200%200%200-.942%200%204.883%204.883%200%200%201-3.01%201.055h-.033a4.852%204.852%200%200%201-3.49-1.482%204.982%204.982%200%200%201-1.436-3.498V13.367c0-6.597%205.364-11.96%2011.957-11.96%206.592%200%2011.956%205.363%2011.956%2011.956v12.253c0%202.645-2.042%204.827-4.65%204.97a5.342%205.342%200%200%201-.274.007Z'/%3e%3cpath%20fill='%23fff'%20d='M23.912%2013.363v12.253c0%201.876-1.447%203.463-3.32%203.566a3.503%203.503%200%200%201-2.398-.769c-.778-.626-1.873-.598-2.658.021a3.5%203.5%200%200%201-2.176.753%203.494%203.494%200%200%201-2.173-.753%202.153%202.153%200%200%200-2.684%200%203.498%203.498%200%200%201-2.15.753c-1.948.014-3.54-1.627-3.54-3.575v-12.25c0-5.825%204.724-10.549%2010.55-10.549%205.825%200%2010.549%204.724%2010.549%2010.55Z'/%3e%3cpath%20fill='%23000'%20d='m11.28%2012.437-3.93-2.27a1.072%201.072%200%200%200-1.463.392%201.072%201.072%200%200%200%20.391%201.463l2.326%201.343-2.326%201.343a1.072%201.072%200%200%200%201.071%201.855l3.932-2.27a1.071%201.071%200%200%200%200-1.854v-.002ZM20.182%2012.291h-5.164a1.071%201.071%200%201%200%200%202.143h5.164a1.071%201.071%200%201%200%200-2.143Z'/%3e%3c/svg%3e",vv="data:image/svg+xml,%3csvg%20width='1024'%20height='1024'%20viewBox='0%200%201024%201024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_d)'%3e%3crect%20x='100'%20y='100'%20width='824'%20height='824'%20rx='179'%20fill='url(%23paint0_linear)'/%3e%3c/g%3e%3crect%20x='121.788'%20y='121.789'%20width='780.423'%20height='780.423'%20rx='156'%20fill='black'/%3e%3crect%20x='183.192'%20y='183.192'%20width='657.615'%20height='657.615'%20rx='94'%20fill='%23202A2F'/%3e%3crect%20x='367.404'%20y='226.769'%20width='89.1346'%20height='178.269'%20fill='%230EE827'%20fill-opacity='0.35'/%3e%3cpath%20d='M274.468%20374.622C269.807%20374.227%20265.438%20373.568%20261.36%20372.645C257.427%20371.59%20253.786%20370.47%20250.436%20369.284C247.232%20368.097%20244.392%20366.977%20241.916%20365.922C239.586%20364.736%20237.838%20363.813%20236.673%20363.154L246.067%20345.754C247.086%20346.413%20248.834%20347.335%20251.31%20348.522C253.786%20349.708%20256.553%20350.96%20259.612%20352.279C262.816%20353.465%20266.093%20354.52%20269.443%20355.442C272.793%20356.365%20275.924%20356.827%20278.837%20356.827C293.402%20356.827%20300.684%20351.356%20300.684%20340.415C300.684%20337.778%20300.174%20335.603%20299.154%20333.89C298.281%20332.176%20296.897%20330.726%20295.004%20329.54C293.256%20328.221%20291.071%20327.101%20288.45%20326.178C285.974%20325.124%20283.134%20324.069%20279.929%20323.015C273.812%20320.905%20268.351%20318.73%20263.544%20316.489C258.884%20314.117%20254.878%20311.48%20251.529%20308.58C248.179%20305.68%20245.63%20302.385%20243.882%20298.694C242.135%20295.003%20241.261%20290.784%20241.261%20286.039C241.261%20282.348%20242.062%20278.789%20243.664%20275.361C245.266%20271.934%20247.523%20268.902%20250.436%20266.266C253.349%20263.498%20256.845%20261.191%20260.923%20259.345C265.001%20257.368%20269.516%20255.984%20274.468%20255.193V226.769H292.382V254.797C296.169%20255.193%20299.81%20255.786%20303.305%20256.577C306.801%20257.368%20309.932%20258.225%20312.699%20259.147C315.467%20260.07%20317.797%20260.993%20319.69%20261.916C321.729%20262.707%20323.186%20263.3%20324.06%20263.695L315.321%20279.909C314.156%20279.382%20312.481%20278.723%20310.296%20277.932C308.257%20277.009%20305.927%20276.086%20303.305%20275.164C300.684%20274.241%20297.844%20273.45%20294.785%20272.791C291.727%20272.132%20288.668%20271.802%20285.61%20271.802C280.658%20271.802%20276.215%20272.725%20272.283%20274.57C268.496%20276.284%20266.603%20279.25%20266.603%20283.468C266.603%20286.105%20267.113%20288.478%20268.132%20290.587C269.297%20292.564%20270.899%20294.344%20272.938%20295.925C275.123%20297.507%20277.745%20299.023%20280.803%20300.473C284.007%20301.791%20287.649%20303.11%20291.727%20304.428C297.115%20306.405%20301.922%20308.448%20306.145%20310.558C310.369%20312.667%20313.937%20315.039%20316.85%20317.676C319.763%20320.312%20321.948%20323.344%20323.404%20326.771C325.006%20330.199%20325.807%20334.219%20325.807%20338.833C325.807%20342.788%20325.079%20346.61%20323.623%20350.301C322.312%20353.992%20320.2%20357.42%20317.287%20360.583C314.52%20363.747%20311.025%20366.515%20306.801%20368.888C302.723%20371.129%20297.916%20372.777%20292.382%20373.831V403.058H274.468V374.622Z'%20fill='%230EE827'/%3e%3cdefs%3e%3cfilter%20id='filter0_d'%20x='78'%20y='86'%20width='868'%20height='868'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeMorphology%20radius='2'%20operator='dilate'%20in='SourceAlpha'%20result='effect1_dropShadow'/%3e%3cfeOffset%20dy='8'/%3e%3cfeGaussianBlur%20stdDeviation='10'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3clinearGradient%20id='paint0_linear'%20x1='512'%20y1='100'%20x2='512'%20y2='924'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23D4E6E8'/%3e%3cstop%20offset='1'%20stop-color='%23767573'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",bv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20viewBox='0%200%20128%20128'%3e%3clinearGradient%20id='powershell__a'%20x1='96.306'%20x2='25.454'%20y1='35.144'%20y2='98.431'%20gradientTransform='matrix(1%200%200%20-1%200%20128)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a9c8ff'/%3e%3cstop%20offset='1'%20stop-color='%23c7e6ff'/%3e%3c/linearGradient%3e%3cpath%20fill='url(%23powershell__a)'%20fill-rule='evenodd'%20d='M7.2%20110.5c-1.7%200-3.1-.7-4.1-1.9-1-1.2-1.3-2.9-.9-4.6l18.6-80.5c.8-3.4%204-6%207.4-6h92.6c1.7%200%203.1.7%204.1%201.9%201%201.2%201.3%202.9.9%204.6l-18.6%2080.5c-.8%203.4-4%206-7.4%206H7.2z'%20clip-rule='evenodd'%20opacity='.8'/%3e%3clinearGradient%20id='powershell__b'%20x1='25.336'%20x2='94.569'%20y1='98.33'%20y2='36.847'%20gradientTransform='matrix(1%200%200%20-1%200%20128)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%232d4664'/%3e%3cstop%20offset='.169'%20stop-color='%2329405b'/%3e%3cstop%20offset='.445'%20stop-color='%231e2f43'/%3e%3cstop%20offset='.79'%20stop-color='%230c131b'/%3e%3cstop%20offset='1'/%3e%3c/linearGradient%3e%3cpath%20fill='url(%23powershell__b)'%20fill-rule='evenodd'%20d='M120.3%2018.5H28.5c-2.9%200-5.7%202.3-6.4%205.2L3.7%20104.3c-.7%202.9%201.1%205.2%204%205.2h91.8c2.9%200%205.7-2.3%206.4-5.2l18.4-80.5c.7-2.9-1.1-5.3-4-5.3z'%20clip-rule='evenodd'/%3e%3cpath%20fill='%232C5591'%20fill-rule='evenodd'%20d='M64.2%2088.3h22.3c2.6%200%204.7%202.2%204.7%204.9s-2.1%204.9-4.7%204.9H64.2c-2.6%200-4.7-2.2-4.7-4.9s2.1-4.9%204.7-4.9zM78.7%2066.5c-.4.8-1.2%201.6-2.6%202.6L34.6%2098.9c-2.3%201.6-5.5%201-7.3-1.4-1.7-2.4-1.3-5.7.9-7.3l37.4-27.1v-.6l-23.5-25c-1.9-2-1.7-5.3.4-7.4%202.2-2%205.5-2%207.4%200l28.2%2030c1.7%201.9%201.8%204.5.6%206.4z'%20clip-rule='evenodd'/%3e%3cpath%20fill='%23FFF'%20fill-rule='evenodd'%20d='M77.6%2065.5c-.4.8-1.2%201.6-2.6%202.6L33.6%2097.9c-2.3%201.6-5.5%201-7.3-1.4-1.7-2.4-1.3-5.7.9-7.3l37.4-27.1v-.6l-23.5-25c-1.9-2-1.7-5.3.4-7.4%202.2-2%205.5-2%207.4%200l28.2%2030c1.7%201.8%201.8%204.4.5%206.4zM63.5%2087.8h22.3c2.6%200%204.7%202.1%204.7%204.6%200%202.6-2.1%204.6-4.7%204.6H63.5c-2.6%200-4.7-2.1-4.7-4.6%200-2.6%202.1-4.6%204.7-4.6z'%20clip-rule='evenodd'/%3e%3c/svg%3e",yv="/assets/terminal-Cpd_WDea.png",$v="/assets/textmate-B-hymv65.png",_v="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%20100%20100'%3e%3cmask%20id='vscode__a'%20width='100'%20height='100'%20x='0'%20y='0'%20mask-type='alpha'%20maskUnits='userSpaceOnUse'%3e%3cpath%20fill='%23fff'%20fill-rule='evenodd'%20d='M70.912%2099.317a6.223%206.223%200%200%200%204.96-.19l20.589-9.907A6.25%206.25%200%200%200%20100%2083.587V16.413a6.25%206.25%200%200%200-3.54-5.632L75.874.874a6.226%206.226%200%200%200-7.104%201.21L29.355%2038.04%2012.187%2025.01a4.162%204.162%200%200%200-5.318.236l-5.506%205.009a4.168%204.168%200%200%200-.004%206.162L16.247%2050%201.36%2063.583a4.168%204.168%200%200%200%20.004%206.162l5.506%205.01a4.162%204.162%200%200%200%205.318.236l17.168-13.032L68.77%2097.917a6.217%206.217%200%200%200%202.143%201.4ZM75.015%2027.3%2045.11%2050l29.906%2022.701V27.3Z'%20clip-rule='evenodd'/%3e%3c/mask%3e%3cg%20mask='url(%23vscode__a)'%3e%3cpath%20fill='%230065A9'%20d='M96.461%2010.796%2075.857.876a6.23%206.23%200%200%200-7.107%201.207l-67.451%2061.5a4.167%204.167%200%200%200%20.004%206.162l5.51%205.009a4.167%204.167%200%200%200%205.32.236l81.228-61.62c2.725-2.067%206.639-.124%206.639%203.297v-.24a6.25%206.25%200%200%200-3.539-5.63Z'/%3e%3cg%20filter='url(%23vscode__b)'%3e%3cpath%20fill='%23007ACC'%20d='m96.461%2089.204-20.604%209.92a6.229%206.229%200%200%201-7.107-1.207l-67.451-61.5a4.167%204.167%200%200%201%20.004-6.162l5.51-5.009a4.167%204.167%200%200%201%205.32-.236l81.228%2061.62c2.725%202.067%206.639.124%206.639-3.297v.24a6.25%206.25%200%200%201-3.539%205.63Z'/%3e%3c/g%3e%3cg%20filter='url(%23vscode__c)'%3e%3cpath%20fill='%231F9CF0'%20d='M75.858%2099.126a6.232%206.232%200%200%201-7.108-1.21c2.306%202.307%206.25.674%206.25-2.588V4.672c0-3.262-3.944-4.895-6.25-2.589a6.232%206.232%200%200%201%207.108-1.21l20.6%209.908A6.25%206.25%200%200%201%20100%2016.413v67.174a6.25%206.25%200%200%201-3.541%205.633l-20.601%209.906Z'/%3e%3c/g%3e%3cpath%20fill='url(%23vscode__d)'%20fill-rule='evenodd'%20d='M70.851%2099.317a6.224%206.224%200%200%200%204.96-.19L96.4%2089.22a6.25%206.25%200%200%200%203.54-5.633V16.413a6.25%206.25%200%200%200-3.54-5.632L75.812.874a6.226%206.226%200%200%200-7.104%201.21L29.294%2038.04%2012.126%2025.01a4.162%204.162%200%200%200-5.317.236l-5.507%205.009a4.168%204.168%200%200%200-.004%206.162L16.186%2050%201.298%2063.583a4.168%204.168%200%200%200%20.004%206.162l5.507%205.009a4.162%204.162%200%200%200%205.317.236L29.294%2061.96l39.414%2035.958a6.218%206.218%200%200%200%202.143%201.4ZM74.954%2027.3%2045.048%2050l29.906%2022.701V27.3Z'%20clip-rule='evenodd'%20opacity='.25'%20style='mix-blend-mode:overlay'/%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='vscode__b'%20width='116.727'%20height='92.246'%20x='-8.394'%20y='15.829'%20color-interpolation-filters='sRGB'%20filterUnits='userSpaceOnUse'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='4.167'/%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200'/%3e%3cfeBlend%20in2='BackgroundImageFix'%20mode='overlay'%20result='effect1_dropShadow'/%3e%3cfeBlend%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3cfilter%20id='vscode__c'%20width='47.917'%20height='116.151'%20x='60.417'%20y='-8.076'%20color-interpolation-filters='sRGB'%20filterUnits='userSpaceOnUse'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'/%3e%3cfeOffset/%3e%3cfeGaussianBlur%20stdDeviation='4.167'/%3e%3cfeColorMatrix%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.25%200'/%3e%3cfeBlend%20in2='BackgroundImageFix'%20mode='overlay'%20result='effect1_dropShadow'/%3e%3cfeBlend%20in='SourceGraphic'%20in2='effect1_dropShadow'%20result='shape'/%3e%3c/filter%3e%3clinearGradient%20id='vscode__d'%20x1='49.939'%20x2='49.939'%20y1='.258'%20y2='99.742'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23fff'/%3e%3cstop%20offset='1'%20stop-color='%23fff'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",wv="/assets/xcode-4zqeTePl.png",xv="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='96'%20height='96'%20fill='none'%20viewBox='0%200%2096%2096'%3e%3cg%20clip-path='url(%23zed_light__a)'%3e%3cpath%20fill='currentColor'%20fill-rule='evenodd'%20d='M9%206a3%203%200%200%200-3%203v66H0V9a9%209%200%200%201%209-9h80.379c4.009%200%206.016%204.847%203.182%207.682L43.055%2057.187H57V51h6v7.688a4.5%204.5%200%200%201-4.5%204.5H37.055L26.743%2073.5H73.5V36h6v37.5a6%206%200%200%201-6%206H20.743L10.243%2090H87a3%203%200%200%200%203-3V21h6v66a9%209%200%200%201-9%209H6.621c-4.009%200-6.016-4.847-3.182-7.682L52.757%2039H39v6h-6v-7.5a4.5%204.5%200%200%201%204.5-4.5h21.257l10.5-10.5H22.5V60h-6V22.5a6%206%200%200%201%206-6h52.757L85.757%206H9Z'%20clip-rule='evenodd'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='zed_light__a'%3e%3cpath%20fill='%23fff'%20d='M0%200h96v96H0z'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",kv="data:image/svg+xml,%3csvg%20viewBox='0%200%20256%20332'%20width='256'%20height='332'%20xmlns='http://www.w3.org/2000/svg'%20preserveAspectRatio='xMidYMid'%3e%3cdefs%3e%3clinearGradient%20x1='55.117%25'%20y1='58.68%25'%20x2='63.68%25'%20y2='39.597%25'%20id='sublimetext__a'%3e%3cstop%20stop-color='%23FF9700'%20offset='0%25'/%3e%3cstop%20stop-color='%23F48E00'%20offset='53%25'/%3e%3cstop%20stop-color='%23D06F00'%20offset='100%25'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20d='M255.288%20166.795c0-3.887-2.872-6.128-6.397-5.015L6.397%20238.675C2.865%20239.796%200%20243.86%200%20247.74v78.59c0%203.887%202.865%206.135%206.397%205.015l242.494-76.888c3.525-1.12%206.397-5.185%206.397-9.071v-78.59Z'%20fill='url(%23sublimetext__a)'/%3e%3cpath%20d='M0%20164.291c0%203.887%202.865%207.95%206.397%209.071l242.53%2076.902c3.531%201.12%206.397-1.127%206.397-5.007V166.66c0-3.88-2.866-7.944-6.397-9.064L6.397%2080.694C2.865%2079.574%200%2081.814%200%2085.7v78.59Z'%20fill='%23FF9800'/%3e%3cpath%20d='M255.288%205.302c0-3.886-2.872-6.135-6.397-5.014L6.397%2077.176C2.865%2078.296%200%2082.36%200%2086.247v78.59c0%203.887%202.865%206.128%206.397%205.014l242.494-76.895c3.525-1.12%206.397-5.184%206.397-9.064V5.302Z'%20fill='%23FF9800'/%3e%3c/svg%3e";var Sv=$("<img data-component=app-icon>");const Iv={vscode:_v,cursor:mv,zed:xv,"file-explorer":gv,finder:hv,terminal:yv,iterm2:vv,ghostty:pv,xcode:wv,"android-studio":dv,antigravity:fv,textmate:$v,powershell:bv,"sublime-text":kv},Pl=e=>{const[n,r]=Ve(e,["id","class","classList","alt","draggable"]);return(()=>{var i=Sv();return ii(i,Ce(r,{get src(){return Iv[n.id]},get alt(){return n.alt??""},get draggable(){return n.draggable??!1},get classList(){return{...n.classList??{},[n.class??""]:!!n.class}}}),!1,!1),i})()};var Tv={};io(Tv,{Anchor:()=>wu,Arrow:()=>Kc,CloseButton:()=>xu,Content:()=>ku,Description:()=>Su,Popover:()=>Vt,Portal:()=>Iu,Root:()=>Tu,Title:()=>Cu,Trigger:()=>Du,usePopoverContext:()=>qn});var _u=or();function qn(){const e=ar(_u);if(e===void 0)throw new Error("[kobalte]: `usePopoverContext` must be used within a `Popover` component");return e}function wu(e){const n=qn(),[r,i]=Ve(e,["ref"]);return s(At,Ce({as:"div",ref(t){var o=Gt(n.setDefaultAnchorRef,r.ref);typeof o=="function"&&o(t)}},()=>n.dataset(),i))}function xu(e){const n=qn(),[r,i]=Ve(e,["aria-label","onClick"]);return s(Jc,Ce({get"aria-label"(){return r["aria-label"]||n.translations().dismiss},onClick:o=>{Ot(o,r.onClick),n.close()}},()=>n.dataset(),i))}function ku(e){let n;const r=qn(),i=Ct({id:r.generateId("content")},e),[t,o]=Ve(i,["ref","style","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let a=!1,l=!1,u=!1;const c=p=>{t.onCloseAutoFocus?.(p),r.isModal()?(p.preventDefault(),a||Sl(r.triggerRef())):(p.defaultPrevented||(l||Sl(r.triggerRef()),p.preventDefault()),l=!1,u=!1)},m=p=>{t.onPointerDownOutside?.(p),r.isModal()&&(a=p.detail.isContextMenu)},f=p=>{t.onFocusOutside?.(p),r.isOpen()&&r.isModal()&&p.preventDefault()},g=p=>{t.onInteractOutside?.(p),!r.isModal()&&(p.defaultPrevented||(l=!0,p.detail.originalEvent.type==="pointerdown"&&(u=!0)),kp(r.triggerRef(),p.target)&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&u&&p.preventDefault())};return $p({isDisabled:()=>!(r.isOpen()&&r.isModal()),targets:()=>n?[n]:[]}),_p({element:()=>n??null,enabled:()=>r.contentPresent()&&r.preventScroll()}),wp({trapFocus:()=>r.isOpen()&&r.isModal(),onMountAutoFocus:t.onOpenAutoFocus,onUnmountAutoFocus:c},()=>n),re(()=>rt(r.registerContentId(o.id))),s(P,{get when(){return r.contentPresent()},get children(){return s(Vc.Positioner,{get children(){return s(xp,Ce({ref(p){var h=Gt(v=>{r.setContentRef(v),n=v},t.ref);typeof h=="function"&&h(p)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return se(()=>!!r.isOpen())()&&r.isModal()},get excludedElements(){return[r.triggerRef]},get style(){return oi({"--kb-popover-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},t.style)},get"aria-labelledby"(){return r.titleId()},get"aria-describedby"(){return r.descriptionId()},onPointerDownOutside:m,onFocusOutside:f,onInteractOutside:g,get onDismiss(){return r.close}},()=>r.dataset(),o))}})}})}function Su(e){const n=qn(),r=Ct({id:n.generateId("description")},e),[i,t]=Ve(r,["id"]);return re(()=>rt(n.registerDescriptionId(i.id))),s(At,Ce({as:"p",get id(){return i.id}},()=>n.dataset(),t))}function Iu(e){const n=qn();return s(P,{get when(){return n.contentPresent()},get children(){return s(Yo,e)}})}var Nl={dismiss:"Dismiss"};function Tu(e){const n=`popover-${kr()}`,r=Ct({id:n,modal:!1,translations:Nl},e),[i,t]=Ve(r,["translations","id","open","defaultOpen","onOpenChange","modal","preventScroll","forceMount","anchorRef"]),[o,a]=ze(),[l,u]=ze(),[c,m]=ze(),[f,g]=ze(),[p,h]=ze(),[v,b]=ze(),x=yp({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:k=>i.onOpenChange?.(k)}),R=()=>i.anchorRef?.()??o()??l(),{present:U}=$a({show:()=>i.forceMount||x.isOpen(),element:()=>c()??null}),A=w(()=>({"data-expanded":x.isOpen()?"":void 0,"data-closed":x.isOpen()?void 0:""})),N={translations:()=>i.translations??Nl,dataset:A,isOpen:x.isOpen,isModal:()=>i.modal??!1,preventScroll:()=>i.preventScroll??N.isModal(),contentPresent:U,triggerRef:l,contentId:f,titleId:p,descriptionId:v,setDefaultAnchorRef:a,setTriggerRef:u,setContentRef:m,close:x.close,toggle:x.toggle,generateId:ai(()=>i.id),registerContentId:Fn(g),registerTitleId:Fn(h),registerDescriptionId:Fn(b)};return s(_u.Provider,{value:N,get children(){return s(Vc,Ce({anchorRef:R,contentRef:c},t))}})}function Cu(e){const n=qn(),r=Ct({id:n.generateId("title")},e),[i,t]=Ve(r,["id"]);return re(()=>rt(n.registerTitleId(i.id))),s(At,Ce({as:"h2",get id(){return i.id}},()=>n.dataset(),t))}function Du(e){const n=qn(),[r,i]=Ve(e,["ref","onClick","onPointerDown"]);return s(Jc,Ce({ref(a){var l=Gt(n.setTriggerRef,r.ref);typeof l=="function"&&l(a)},"aria-haspopup":"dialog",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return se(()=>!!n.isOpen())()?n.contentId():void 0},onPointerDown:a=>{Ot(a,r.onPointerDown),a.preventDefault()},onClick:a=>{Ot(a,r.onClick),n.toggle()}},()=>n.dataset(),i))}var Vt=Object.assign(Tu,{Anchor:wu,Arrow:Kc,CloseButton:xu,Content:ku,Description:Su,Portal:Iu,Title:Cu,Trigger:Du}),Cv=$("<div data-slot=popover-header>"),Dv=$("<div data-slot=popover-body>");function zu(e){const n=gt(),[r,i]=Ve(e,["trigger","triggerAs","triggerProps","title","description","class","classList","style","children","portal","open","defaultOpen","onOpenChange","modal"]),[t,o]=ze(void 0),[a,l]=ze(void 0),[u,c]=ze(null),[m,f]=ze(r.defaultOpen??!1),g=()=>r.open!==void 0,p=()=>g()?r.open??!1:m(),h=b=>{b&&c(null),r.onOpenChange&&r.onOpenChange(b),!g()&&f(b)};re(()=>{if(!p())return;const b=N=>{if(!N)return!1;const k=t();if(k&&k.contains(N))return!0;const D=a();return!!(D&&D.contains(N))},x=N=>{c(N),h(!1)},R=N=>{N.key==="Escape"&&(x("escape"),N.preventDefault(),N.stopPropagation())},U=N=>{const k=N.target;k instanceof Node&&(b(k)||x("outside"))},A=N=>{const k=N.target;k instanceof Node&&(b(k)||x("outside"))};window.addEventListener("keydown",R,!0),window.addEventListener("pointerdown",U,!0),window.addEventListener("focusin",A,!0),rt(()=>{window.removeEventListener("keydown",R,!0),window.removeEventListener("pointerdown",U,!0),window.removeEventListener("focusin",A,!0)})});const v=()=>s(Vt.Content,{ref:b=>o(b),"data-component":"popover-content",get classList(){return{...r.classList??{},[r.class??""]:!!r.class}},get style(){return r.style},onCloseAutoFocus:b=>{u()==="outside"&&b.preventDefault(),c(null)},get children(){return[s(P,{get when(){return r.title},get children(){var b=Cv();return d(b,s(Vt.Title,{"data-slot":"popover-title",get children(){return r.title}}),null),d(b,s(Vt.CloseButton,{"data-slot":"popover-close-button",as:zt,icon:"close",variant:"ghost",get"aria-label"(){return n.t("ui.common.close")}}),null),b}}),s(P,{get when(){return r.description},get children(){return s(Vt.Description,{"data-slot":"popover-description",get children(){return r.description}})}}),(()=>{var b=Dv();return d(b,()=>r.children),b})()]}});return s(Vt,Ce({gutter:4},i,{get open(){return p()},onOpenChange:h,get modal(){return r.modal??!1},get children(){return[s(Vt.Trigger,Ce({ref:b=>l(b),get as(){return r.triggerAs??"div"},"data-slot":"popover-trigger"},()=>r.triggerProps,{get children(){return r.trigger}})),s(P,{get when(){return r.portal??!0},get fallback(){return v()},get children(){return s(Vt.Portal,{get children(){return v()}})}})]}}))}var zv=$("<span data-component=keybind>");function Eu(e){return(()=>{var n=zv();return d(n,()=>e.children),be(r=>ct(n,{...e.classList??{},[e.class??""]:!!e.class},r)),n})()}var zi=$('<div class="flex flex-col px-2 pb-2"><div class="flex flex-col p-3 bg-background-base rounded-sm min-h-14">'),Ev=$('<div class="flex items-center gap-1 w-[360px] rounded-xl shadow-[var(--shadow-lg-border-base)]">'),Ov=$('<div class="flex items-center gap-1.5"><div></div><span class="text-12-regular text-text-strong">'),Av=$("<div class=flex-1>"),Pv=$('<button type=button class="flex items-center gap-2 w-full h-8 pl-3 pr-1.5 py-1.5 rounded-md transition-colors text-left">'),Nv=$('<span class="text-11-regular text-text-base bg-surface-base px-1.5 py-0.5 rounded-md">'),Lo=$('<div class="text-14-regular text-text-base text-center my-auto">'),jv=$('<button type=button class="flex items-center gap-2 w-full h-8 pl-3 pr-2 py-1 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><div></div><span class="text-14-regular text-text-base truncate flex-1"></span><div>'),Uv=$('<div class="flex items-center gap-2 w-full px-2 py-1"><div></div><span class="text-14-regular text-text-base truncate">'),Lv=$('<code class="bg-surface-raised-base px-1.5 py-0.5 rounded-sm text-text-base">nikcli.json'),Rv=$('<div class="flex items-center gap-2 w-full px-2 py-1"><div class="size-1.5 rounded-full shrink-0 bg-icon-success-base"></div><span class="text-14-regular text-text-base truncate">');function Mv(){const e=_n(),n=Dn(),r=Xc(),i=oo(),t=wn(),o=wt(),a=si(),[l,u]=It({status:{},loading:null,defaultServerUrl:void 0}),c=i.fetch??globalThis.fetch,m=w(()=>{const D=r.url,I=r.list;return D?I.includes(D)?[D,...I.filter(S=>S!==D)]:[D,...I]:I}),f=w(()=>{const D=m();if(!D.length)return D;const I=r.url,S=new Map(D.map((_,M)=>[_,M])),O=_=>_?.healthy===!0?0:_?.healthy===!1?2:1;return D.slice().sort((_,M)=>{if(_===I)return-1;if(M===I)return 1;const F=O(l.status[_])-O(l.status[M]);return F!==0?F:(S.get(_)??0)-(S.get(M)??0)})});async function g(){const D={};await Promise.all(m().map(async I=>{D[I]=await Tp(I,c)})),u("status",Cp(D))}re(()=>{m(),g();const D=setInterval(g,1e4);rt(()=>clearInterval(D))});const p=w(()=>Object.entries(e.data.mcp??{}).map(([D,I])=>({name:D,status:I.status})).sort((D,I)=>D.name.localeCompare(I.name))),h=w(()=>p().filter(D=>D.status==="connected").length),v=async D=>{if(!l.loading){u("loading",D);try{await(e.data.mcp[D]?.status==="connected"?n.client.mcp.disconnect({name:D}):n.client.mcp.connect({name:D}));const S=await n.client.mcp.status();S.data&&e.set("mcp",S.data)}catch(I){lt({variant:"error",title:o.t("common.requestFailed"),description:I instanceof Error?I.message:String(I)})}finally{u("loading",null)}}},b=w(()=>e.data.lsp??[]),x=w(()=>b().length),R=w(()=>e.data.config.plugin??[]),U=w(()=>R().length),A=w(()=>{const D=r.healthy()===!0,I=p().some(S=>S.status!=="connected"&&S.status!=="disabled");return D&&!I}),N=w(()=>f().length),k=()=>{const D=i.getDefaultServerUrl?.();if(!D){u("defaultServerUrl",void 0);return}if(D instanceof Promise){D.then(I=>u("defaultServerUrl",I?Il(I):void 0));return}u("defaultServerUrl",Il(D))};return re(()=>{k()}),s(zu,{triggerAs:Ue,triggerProps:{variant:"ghost",class:"rounded-sm w-[75px] h-[24px] py-1.5 pr-3 pl-2 gap-2 border-none shadow-none data-[expanded]:bg-surface-raised-base-active",style:{scale:1}},get trigger(){return(()=>{var D=Ov(),I=D.firstChild,S=I.nextSibling;return d(S,()=>o.t("status.popover.trigger")),be(O=>ct(I,{"size-1.5 rounded-full":!0,"bg-icon-success-base":A(),"bg-icon-critical-base":!A()&&r.healthy()!==void 0,"bg-border-weak-base":r.healthy()===void 0},O)),D})()},class:"[&_[data-slot=popover-body]]:p-0 w-[360px] max-w-[calc(100vw-40px)] bg-transparent border-0 shadow-none rounded-xl",gutter:6,placement:"bottom-end",shift:-136,get children(){var D=Ev();return d(D,s(it,{get"aria-label"(){return o.t("status.popover.ariaLabel")},class:"tabs bg-background-strong rounded-xl overflow-hidden","data-component":"tabs","data-active":"servers",defaultValue:"servers",variant:"alt",get children(){return[s(it.List,{"data-slot":"tablist",class:"bg-transparent border-b-0 px-4 pt-2 pb-0 gap-4 h-10",get children(){return[s(it.Trigger,{value:"servers","data-slot":"tab",class:"text-12-regular",get children(){return[se(()=>se(()=>N()>0)()?`${N()} `:""),se(()=>o.t("status.popover.tab.servers"))]}}),s(it.Trigger,{value:"mcp","data-slot":"tab",class:"text-12-regular",get children(){return[se(()=>se(()=>h()>0)()?`${h()} `:""),se(()=>o.t("status.popover.tab.mcp"))]}}),s(it.Trigger,{value:"lsp","data-slot":"tab",class:"text-12-regular",get children(){return[se(()=>se(()=>x()>0)()?`${x()} `:""),se(()=>o.t("status.popover.tab.lsp"))]}}),s(it.Trigger,{value:"plugins","data-slot":"tab",class:"text-12-regular",get children(){return[se(()=>se(()=>U()>0)()?`${U()} `:""),se(()=>o.t("status.popover.tab.plugins"))]}})]}}),s(it.Content,{value:"servers",get children(){var I=zi(),S=I.firstChild;return d(S,s(Ge,{get each(){return f()},children:O=>{const _=()=>O===r.url,M=()=>O===l.defaultServerUrl,F=()=>l.status[O],Z=()=>F()?.healthy===!1;return(()=>{var B=Pv();return B.$$click=()=>{Z()||(r.setActive(O),a("/"))},d(B,s(Sp,{url:O,get status(){return F()},get dimmed(){return Z()},class:"flex items-center gap-2 w-full min-w-0",nameClass:"text-14-regular text-text-base truncate",versionClass:"text-12-regular text-text-weak truncate",get badge(){return s(P,{get when(){return M()},get children(){var W=Nv();return d(W,()=>o.t("common.default")),W}})},get children(){return[Av(),s(P,{get when(){return _()},get children(){return s(Be,{name:"check",size:"small",class:"text-icon-weak shrink-0"})}})]}})),be(W=>{var ee={"hover:bg-surface-raised-base-hover":!Z(),"cursor-not-allowed":Z()},Se=Z();return W.e=ct(B,ee,W.e),Se!==W.t&&Te(B,"aria-disabled",W.t=Se),W},{e:void 0,t:void 0}),B})()}}),null),d(S,s(Ue,{variant:"secondary",class:"mt-3 self-start h-8 px-3 py-1.5",onClick:()=>t.show(()=>s(Ip,{}),k),get children(){return o.t("status.popover.action.manageServers")}}),null),I}}),s(it.Content,{value:"mcp",get children(){var I=zi(),S=I.firstChild;return d(S,s(P,{get when(){return p().length>0},get fallback(){return(()=>{var O=Lo();return d(O,()=>o.t("dialog.mcp.empty")),O})()},get children(){return s(Ge,{get each(){return p()},children:O=>{const _=()=>O.status==="connected";return(()=>{var M=jv(),F=M.firstChild,Z=F.nextSibling,B=Z.nextSibling;return M.$$click=()=>v(O.name),d(Z,()=>O.name),B.$$click=W=>W.stopPropagation(),d(B,s(_a,{get checked(){return _()},get disabled(){return l.loading===O.name},onChange:()=>v(O.name)})),be(W=>{var ee=l.loading===O.name,Se={"size-1.5 rounded-full shrink-0":!0,"bg-icon-success-base":O.status==="connected","bg-icon-critical-base":O.status==="failed","bg-border-weak-base":O.status==="disabled","bg-icon-warning-base":O.status==="needs_auth"||O.status==="needs_client_registration"};return ee!==W.e&&(M.disabled=W.e=ee),W.t=ct(F,Se,W.t),W},{e:void 0,t:void 0}),M})()}})}})),I}}),s(it.Content,{value:"lsp",get children(){var I=zi(),S=I.firstChild;return d(S,s(P,{get when(){return b().length>0},get fallback(){return(()=>{var O=Lo();return d(O,()=>o.t("dialog.lsp.empty")),O})()},get children(){return s(Ge,{get each(){return b()},children:O=>(()=>{var _=Uv(),M=_.firstChild,F=M.nextSibling;return d(F,()=>O.name||O.id),be(Z=>ct(M,{"size-1.5 rounded-full shrink-0":!0,"bg-icon-success-base":O.status==="connected","bg-icon-critical-base":O.status==="error"},Z)),_})()})}})),I}}),s(it.Content,{value:"plugins",get children(){var I=zi(),S=I.firstChild;return d(S,s(P,{get when(){return R().length>0},get fallback(){return(()=>{var O=Lo();return d(O,()=>{const _=o.t("dialog.plugins.empty"),M="nikcli.json",F=_.split(M);return F.length===1?_:[se(()=>F[0]),Lv(),se(()=>F.slice(1).join(M))]}),O})()},get children(){return s(Ge,{get each(){return R()},children:O=>(()=>{var _=Rv(),M=_.firstChild,F=M.nextSibling;return d(F,O),_})()})}})),I}})]}})),D}})}Ut(["click"]);var Fv=$('<button type=button class="hidden md:flex w-[320px] max-w-full min-w-0 p-1 pl-1.5 items-center gap-2 justify-between rounded-md border border-border-weak-base bg-surface-raised-base transition-colors cursor-default hover:bg-surface-raised-base-hover focus-visible:bg-surface-raised-base-hover active:bg-surface-raised-base-active"><div class="flex min-w-0 flex-1 items-center gap-2 overflow-visible"><span class="flex-1 min-w-0 text-14-regular text-text-weak truncate h-4.5 flex items-center">'),jl=$('<span class="text-12-regular text-text-strong">'),Ul=$('<div class="flex items-center">'),Zv=$('<div class="hidden xl:flex items-center">'),Bv=$('<div class="flex flex-col gap-2"><div class="grid grid-cols-2 gap-2">'),Wv=$('<div class="flex flex-col gap-2">'),Ll=$('<div class="relative flex items-center justify-center size-4 [&>*]:absolute [&>*]:inset-0">'),qv=$('<div class="relative flex items-center justify-center size-4">'),Hv=$('<div class="flex items-center gap-3"><div class="hidden md:flex items-center gap-3 ml-2 shrink-0"></div><div class="hidden md:block shrink-0"></div><div class="hidden md:block shrink-0">'),Gv=$("<div class=flex>"),Kv=$("<div aria-hidden=true>");function Vv(){const e=Yc(),n=Sr(),r=Bn(),i=li(),t=Xc(),o=_n(),a=oo(),l=wt(),u=w(()=>wa(r.dir)??""),c=w(()=>{const V=u();if(V)return n.projects.list().find(z=>z.worktree===V||z.sandboxes?.includes(V))}),m=w(()=>{const V=c();return V?V.name||Tt(V.worktree):Tt(u())}),f=w(()=>i.keybind("file.open")),g=w(()=>o.data.session.find(V=>V.id===r.id)),p=w(()=>o.data.config.share!=="disabled"),h=w(()=>p()&&!!g()),v=w(()=>`${r.dir}${r.id?"/"+r.id:""}`),b=w(()=>n.view(v)),x=["vscode","cursor","zed","textmate","antigravity","finder","terminal","iterm2","ghostty","xcode","android-studio","powershell","sublime-text"],R=[{id:"vscode",label:"VS Code",icon:"vscode",openWith:"Visual Studio Code"},{id:"cursor",label:"Cursor",icon:"cursor",openWith:"Cursor"},{id:"zed",label:"Zed",icon:"zed",openWith:"Zed"},{id:"textmate",label:"TextMate",icon:"textmate",openWith:"TextMate"},{id:"antigravity",label:"Antigravity",icon:"antigravity",openWith:"Antigravity"},{id:"terminal",label:"Terminal",icon:"terminal",openWith:"Terminal"},{id:"iterm2",label:"iTerm2",icon:"iterm2",openWith:"iTerm"},{id:"ghostty",label:"Ghostty",icon:"ghostty",openWith:"Ghostty"},{id:"xcode",label:"Xcode",icon:"xcode",openWith:"Xcode"},{id:"android-studio",label:"Android Studio",icon:"android-studio",openWith:"Android Studio"},{id:"sublime-text",label:"Sublime Text",icon:"sublime-text",openWith:"Sublime Text"}],U=[{id:"vscode",label:"VS Code",icon:"vscode",openWith:"code"},{id:"cursor",label:"Cursor",icon:"cursor",openWith:"cursor"},{id:"zed",label:"Zed",icon:"zed",openWith:"zed"},{id:"powershell",label:"PowerShell",icon:"powershell",openWith:"powershell"},{id:"sublime-text",label:"Sublime Text",icon:"sublime-text",openWith:"Sublime Text"}],A=[{id:"vscode",label:"VS Code",icon:"vscode",openWith:"code"},{id:"cursor",label:"Cursor",icon:"cursor",openWith:"cursor"},{id:"zed",label:"Zed",icon:"zed",openWith:"zed"},{id:"sublime-text",label:"Sublime Text",icon:"sublime-text",openWith:"Sublime Text"}],N=w(()=>{if(a.platform==="desktop"&&a.os)return a.os;if(typeof navigator!="object")return"unknown";const V=navigator.platform||navigator.userAgent;return/Mac/i.test(V)?"macos":/Win/i.test(V)?"windows":/Linux/i.test(V)?"linux":"unknown"}),[k,D]=It({finder:!0});re(()=>{if(a.platform!=="desktop"||!a.checkAppExists)return;const V=N(),z=V==="macos"?R:V==="windows"?U:V==="linux"?A:[];z.length!==0&&Promise.all(z.map(H=>Promise.resolve(a.checkAppExists?.(H.openWith)).then($e=>{const te=!!$e;return console.debug(`[session-header] App "${H.label}" (${H.openWith}): ${te?"exists":"does not exist"}`),[H.id,te]}))).then(H=>{D(Object.fromEntries(H))})});const I=w(()=>N()==="macos"?[{id:"finder",label:"Finder",icon:"finder"},...R.filter(V=>k[V.id])]:N()==="windows"?[{id:"finder",label:"File Explorer",icon:"file-explorer"},...U.filter(V=>k[V.id])]:[{id:"finder",label:"File Manager",icon:"finder"},...A.filter(V=>k[V.id])]),[S,O]=Qo(ea.global("open.app"),It({app:"finder"})),_=w(()=>a.platform==="desktop"&&!!a.openPath&&t.isLocal()),M=w(()=>I().find(V=>V.id===S.app)??I()[0]);re(()=>{if(a.platform!=="desktop")return;const V=S.app;I().some(z=>z.id===V)||O("app",I()[0]?.id??"finder")});const F=V=>{const z=u();if(!z||!_())return;const H=I().find(te=>te.id===V),$e=H&&"openWith"in H?H.openWith:void 0;Promise.resolve(a.openPath?.(z,$e)).catch(te=>{lt({variant:"error",title:l.t("common.requestFailed"),description:te instanceof Error?te.message:String(te)})})},Z=()=>{const V=u();V&&navigator.clipboard.writeText(V).then(()=>{lt({variant:"success",icon:"circle-check",title:l.t("session.share.copy.copied"),description:V})}).catch(z=>{lt({variant:"error",title:l.t("common.requestFailed"),description:z instanceof Error?z.message:String(z)})})},[B,W]=It({share:!1,unshare:!1,copied:!1,timer:void 0}),ee=w(()=>g()?.share?.url);re(()=>{ee()||(B.timer&&window.clearTimeout(B.timer),W({copied:!1,timer:void 0}))}),rt(()=>{B.timer&&window.clearTimeout(B.timer)});function Se(){const V=g();!V||B.share||(W("share",!0),e.client.session.share({sessionID:V.id,directory:u()}).catch(z=>{console.error("Failed to share session",z)}).finally(()=>{W("share",!1)}))}function X(){const V=g();!V||B.unshare||(W("unshare",!0),e.client.session.unshare({sessionID:V.id,directory:u()}).catch(z=>{console.error("Failed to unshare session",z)}).finally(()=>{W("unshare",!1)}))}function ne(){const V=ee();V&&navigator.clipboard.writeText(V).then(()=>{B.timer&&window.clearTimeout(B.timer),W("copied",!0);const z=window.setTimeout(()=>{W("copied",!1),W("timer",void 0)},3e3);W("timer",z)}).catch(z=>{console.error("Failed to copy share link",z)})}function ce(){const V=ee();V&&a.openLink(V)}const fe=w(()=>document.getElementById("nikcli-titlebar-center")),me=w(()=>document.getElementById("nikcli-titlebar-right"));return[s(P,{get when(){return fe()},children:V=>s(Yo,{get mount(){return V()},get children(){var z=Fv(),H=z.firstChild,$e=H.firstChild;return z.$$click=()=>i.trigger("file.open"),d(H,s(Be,{name:"magnifying-glass",size:"normal",class:"icon-base shrink-0"}),$e),d($e,()=>l.t("session.header.search.placeholder",{project:m()})),d(z,s(P,{get when(){return f()},children:te=>s(Eu,{class:"shrink-0",get children(){return te()}})}),null),be(()=>Te(z,"aria-label",l.t("session.header.searchFiles"))),z}})}),s(P,{get when(){return me()},children:V=>s(Yo,{get mount(){return V()},get children(){var z=Hv(),H=z.firstChild,$e=H.nextSibling,te=$e.nextSibling;return d(z,s(P,{get when(){return u()},get children(){var he=Zv();return d(he,s(P,{get when(){return _()},get fallback(){return s(Ue,{variant:"ghost",class:"rounded-sm h-[24px] py-1.5 pr-3 pl-2 gap-2 border-none shadow-none",onClick:Z,get"aria-label"(){return l.t("session.header.open.copyPath")},get children(){return[s(Be,{name:"copy",size:"small",class:"text-icon-base"}),(()=>{var C=jl();return d(C,()=>l.t("session.header.open.copyPath")),C})()]}})},get children(){var C=Ul();return d(C,s(Ue,{variant:"ghost",class:"rounded-sm h-[24px] py-1.5 pr-3 pl-2 gap-2 border-none shadow-none rounded-r-none",onClick:()=>F(M().id),get"aria-label"(){return l.t("session.header.open.ariaLabel",{app:M().label})},get children(){return[s(Pl,{get id(){return M().icon},class:"size-5"}),(()=>{var q=jl();return d(q,()=>l.t("session.header.open.action",{app:M().label})),q})()]}}),null),d(C,s(at,{get children(){return[s(at.Trigger,{as:zt,icon:"chevron-down",variant:"ghost",class:"rounded-sm h-[24px] w-auto px-1.5 border-none shadow-none rounded-l-none data-[expanded]:bg-surface-raised-base-active",get"aria-label"(){return l.t("session.header.open.menu")}}),s(at.Portal,{get children(){return s(at.Content,{placement:"bottom-end",gutter:6,get children(){return[s(at.Group,{get children(){return[s(at.GroupLabel,{get children(){return l.t("session.header.openIn")}}),s(at.RadioGroup,{get value(){return S.app},onChange:q=>{x.includes(q)&&O("app",q)},get children(){return I().map(q=>s(at.RadioItem,{get value(){return q.id},onSelect:()=>F(q.id),get children(){return[s(Pl,{get id(){return q.icon},class:"size-5"}),s(at.ItemLabel,{get children(){return q.label}}),s(at.ItemIndicator,{get children(){return s(Be,{name:"check-small",size:"small",class:"text-icon-weak"})}})]}}))}})]}}),s(at.Separator,{}),s(at.Item,{onSelect:Z,get children(){return[s(Be,{name:"copy",size:"small",class:"text-icon-weak"}),s(at.ItemLabel,{get children(){return l.t("session.header.open.copyPath")}})]}})]}})}})]}}),null),C}})),he}}),H),d(z,s(Mv,{}),H),d(z,s(P,{get when(){return h()},get children(){var he=Ul();return d(he,s(zu,{get title(){return l.t("session.share.popover.title")},get description(){return se(()=>!!ee())()?l.t("session.share.popover.description.shared"):l.t("session.share.popover.description.unshared")},gutter:6,placement:"bottom-end",shift:-64,class:"rounded-xl [&_[data-slot=popover-close-button]]:hidden",triggerAs:Ue,get triggerProps(){return{variant:"secondary",class:"rounded-sm h-[24px] px-3",classList:{"rounded-r-none":ee()!==void 0},style:{scale:1}}},get trigger(){return l.t("session.share.action.share")},get children(){var C=Wv();return d(C,s(P,{get when(){return ee()},get fallback(){return(()=>{var q=Gv();return d(q,s(Ue,{size:"large",variant:"primary",class:"w-1/2",onClick:Se,get disabled(){return B.share},get children(){return se(()=>!!B.share)()?l.t("session.share.action.publishing"):l.t("session.share.action.publish")}})),q})()},get children(){var q=Bv(),ie=q.firstChild;return d(q,s(Dp,{get value(){return ee()??""},readOnly:!0,copyable:!0,tabIndex:-1,class:"w-full"}),ie),d(ie,s(Ue,{size:"large",variant:"secondary",class:"w-full shadow-none border border-border-weak-base",onClick:X,get disabled(){return B.unshare},get children(){return se(()=>!!B.unshare)()?l.t("session.share.action.unpublishing"):l.t("session.share.action.unpublish")}}),null),d(ie,s(Ue,{size:"large",variant:"primary",class:"w-full",onClick:ce,get disabled(){return B.unshare},get children(){return l.t("session.share.action.view")}}),null),q}})),C}}),null),d(he,s(P,{get when(){return ee()},get fallback(){return Kv()},get children(){return s(Zt,{get value(){return se(()=>!!B.copied)()?l.t("session.share.copy.copied"):l.t("session.share.copy.copyLink")},placement:"top",gutter:8,get children(){return s(zt,{get icon(){return B.copied?"check":"link"},variant:"secondary",class:"rounded-l-none",onClick:ne,get disabled(){return B.unshare},get"aria-label"(){return se(()=>!!B.copied)()?l.t("session.share.copy.copied"):l.t("session.share.copy.copyLink")}})}})}}),null),he}}),H),d(H,s(mn,{get title(){return l.t("command.terminal.toggle")},get keybind(){return i.keybind("terminal.toggle")},get children(){return s(Ue,{variant:"ghost",class:"group/terminal-toggle size-6 p-0",onClick:()=>b().terminal.toggle(),get"aria-label"(){return l.t("command.terminal.toggle")},get"aria-expanded"(){return b().terminal.opened()},"aria-controls":"terminal-panel",get children(){var he=Ll();return d(he,s(Be,{size:"small",get name(){return b().terminal.opened()?"layout-bottom-full":"layout-bottom"},class:"group-hover/terminal-toggle:hidden"}),null),d(he,s(Be,{size:"small",name:"layout-bottom-partial",class:"hidden group-hover/terminal-toggle:inline-block"}),null),d(he,s(Be,{size:"small",get name(){return b().terminal.opened()?"layout-bottom":"layout-bottom-full"},class:"hidden group-active/terminal-toggle:inline-block"}),null),he}})}})),d($e,s(mn,{get title(){return l.t("command.review.toggle")},get keybind(){return i.keybind("review.toggle")},get children(){return s(Ue,{variant:"ghost",class:"group/review-toggle size-6 p-0",onClick:()=>b().reviewPanel.toggle(),get"aria-label"(){return l.t("command.review.toggle")},get"aria-expanded"(){return b().reviewPanel.opened()},"aria-controls":"review-panel",get children(){var he=Ll();return d(he,s(Be,{size:"small",get name(){return b().reviewPanel.opened()?"layout-right-full":"layout-right"},class:"group-hover/review-toggle:hidden"}),null),d(he,s(Be,{size:"small",name:"layout-right-partial",class:"hidden group-hover/review-toggle:inline-block"}),null),d(he,s(Be,{size:"small",get name(){return b().reviewPanel.opened()?"layout-right":"layout-right-full"},class:"hidden group-active/review-toggle:inline-block"}),null),he}})}})),d(te,s(mn,{get title(){return l.t("command.fileTree.toggle")},get keybind(){return i.keybind("fileTree.toggle")},get children(){return s(Ue,{variant:"ghost",class:"group/file-tree-toggle size-6 p-0",onClick:()=>n.fileTree.toggle(),get"aria-label"(){return l.t("command.fileTree.toggle")},get"aria-expanded"(){return n.fileTree.opened()},"aria-controls":"file-tree-panel",get children(){var he=qv();return d(he,s(Be,{size:"small",name:"bullet-list",get classList(){return{"text-icon-strong":n.fileTree.opened(),"text-icon-weak":!n.fileTree.opened()}}})),he}})}})),z}})})]}Ut(["click"]);function hr(e,n){for(let r=e.length-1;r>=0;r-=1){const i=e[r];if(n(i,r,e))return i}}var Jv={};io(Jv,{Accordion:()=>zr,Content:()=>Pu,Header:()=>Nu,Item:()=>Uu,Root:()=>Lu,Trigger:()=>Ru,useAccordionContext:()=>Ca});var Ou=or();function Au(){const e=ar(Ou);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Pu(e){const n=Au(),r=n.generateId("content"),i=Ct({id:r},e),[t,o]=Ve(i,["id","style"]);return re(()=>rt(n.registerContentId(t.id))),s(Up,Ce({role:"region",get"aria-labelledby"(){return n.triggerId()},get style(){return oi({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},t.style)}},o))}function Nu(e){const n=Qc();return s(At,Ce({as:"h3"},()=>n.dataset(),e))}var ju=or();function Ca(){const e=ar(ju);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function Uu(e){const n=Ca(),r=`${n.generateId("item")}-${kr()}`,i=Ct({id:r},e),[t,o]=Ve(i,["value","disabled"]),[a,l]=ze(),[u,c]=ze(),m=()=>n.listState().selectionManager(),f=()=>m().isSelected(t.value),g={value:()=>t.value,triggerId:a,contentId:u,generateId:ai(()=>o.id),registerTriggerId:Fn(l),registerContentId:Fn(c)};return s(Ou.Provider,{value:g,get children(){return s(jp,Ce({get open(){return f()},get disabled(){return t.disabled}},o))}})}function Lu(e){let n;const r=`accordion-${kr()}`,i=Ct({id:r,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[t,o]=Ve(i,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[a,l]=ze([]),{DomCollectionProvider:u}=zp({items:a,onItemsChange:l}),c=Ep({selectedKeys:()=>t.value,defaultSelectedKeys:()=>t.defaultValue,onSelectionChange:g=>t.onChange?.(Array.from(g)),disallowEmptySelection:()=>!t.multiple&&!t.collapsible,selectionMode:()=>t.multiple?"multiple":"single",dataSource:a});c.selectionManager().setFocusedKey("item-1");const m=Op({selectionManager:()=>c.selectionManager(),collection:()=>c.collection(),disallowEmptySelection:()=>c.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>t.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>n),f={listState:()=>c,generateId:ai(()=>t.id)};return s(u,{get children(){return s(ju.Provider,{value:f,get children(){return s(At,Ce({as:"div",get id(){return t.id},ref(g){var p=Gt(h=>n=h,t.ref);typeof p=="function"&&p(g)},get onKeyDown(){return In([t.onKeyDown,m.onKeyDown])},get onMouseDown(){return In([t.onMouseDown,m.onMouseDown])},get onFocusIn(){return In([t.onFocusIn])},get onFocusOut(){return In([t.onFocusOut,m.onFocusOut])}},o))}})}})}function Ru(e){let n;const r=Ca(),i=Au(),t=Qc(),o=i.generateId("trigger"),a=Ct({id:o},e),[l,u]=Ve(a,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);Ap({getItem:()=>({ref:()=>n,type:"item",key:i.value(),textValue:"",disabled:t.disabled()})});const c=Pp({key:()=>i.value(),selectionManager:()=>r.listState().selectionManager(),disabled:()=>t.disabled(),shouldSelectOnPressUp:!0},()=>n),m=f=>{["Enter"," "].includes(f.key)&&f.preventDefault(),Ot(f,l.onKeyDown),Ot(f,c.onKeyDown)};return re(()=>rt(i.registerTriggerId(u.id))),s(Np,Ce({ref(f){var g=Gt(p=>n=p,l.ref);typeof g=="function"&&g(f)},get"data-key"(){return c.dataKey()},get onPointerDown(){return In([l.onPointerDown,c.onPointerDown])},get onPointerUp(){return In([l.onPointerUp,c.onPointerUp])},get onClick(){return In([l.onClick,c.onClick])},onKeyDown:m,get onMouseDown(){return In([l.onMouseDown,c.onMouseDown])},get onFocus(){return In([l.onFocus,c.onFocus])}},u))}var zr=Object.assign(Lu,{Content:Pu,Header:Nu,Item:Uu,Trigger:Ru});function Xv(e){const[n,r]=Ve(e,["class","classList"]);return s(zr,Ce(r,{"data-component":"accordion",get classList(){return{...n.classList??{},[n.class??""]:!!n.class}}}))}function Yv(e){const[n,r]=Ve(e,["class","classList"]);return s(zr.Item,Ce(r,{"data-slot":"accordion-item",get classList(){return{...n.classList??{},[n.class??""]:!!n.class}}}))}function Qv(e){const[n,r]=Ve(e,["class","classList","children"]);return s(zr.Header,Ce(r,{"data-slot":"accordion-header",get classList(){return{...n.classList??{},[n.class??""]:!!n.class}},get children(){return n.children}}))}function e0(e){const[n,r]=Ve(e,["class","classList","children"]);return s(zr.Trigger,Ce(r,{"data-slot":"accordion-trigger",get classList(){return{...n.classList??{},[n.class??""]:!!n.class}},get children(){return n.children}}))}function t0(e){const[n,r]=Ve(e,["class","classList","children"]);return s(zr.Content,Ce(r,{"data-slot":"accordion-content",get classList(){return{...n.classList??{},[n.class??""]:!!n.class}},get children(){return n.children}}))}const Tn=Object.assign(Xv,{Item:Yv,Header:Qv,Trigger:e0,Content:t0});function Mu(e){return s(Tn.Header,{"data-component":"sticky-accordion-header",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},get children(){return e.children}})}/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Fu,setPrototypeOf:Rl,isFrozen:n0,getPrototypeOf:r0,getOwnPropertyDescriptor:i0}=Object;let{freeze:Bt,seal:cn,create:ra}=Object,{apply:ia,construct:oa}=typeof Reflect<"u"&&Reflect;Bt||(Bt=function(n){return n});cn||(cn=function(n){return n});ia||(ia=function(n,r){for(var i=arguments.length,t=new Array(i>2?i-2:0),o=2;o<i;o++)t[o-2]=arguments[o];return n.apply(r,t)});oa||(oa=function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),t=1;t<r;t++)i[t-1]=arguments[t];return new n(...i)});const Ei=Wt(Array.prototype.forEach),o0=Wt(Array.prototype.lastIndexOf),Ml=Wt(Array.prototype.pop),Lr=Wt(Array.prototype.push),a0=Wt(Array.prototype.splice),Zi=Wt(String.prototype.toLowerCase),Ro=Wt(String.prototype.toString),Mo=Wt(String.prototype.match),Rr=Wt(String.prototype.replace),s0=Wt(String.prototype.indexOf),l0=Wt(String.prototype.trim),fn=Wt(Object.prototype.hasOwnProperty),Mt=Wt(RegExp.prototype.test),Mr=c0(TypeError);function Wt(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),t=1;t<r;t++)i[t-1]=arguments[t];return ia(e,n,i)}}function c0(e){return function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return oa(e,r)}}function Xe(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Zi;Rl&&Rl(e,null);let i=n.length;for(;i--;){let t=n[i];if(typeof t=="string"){const o=r(t);o!==t&&(n0(n)||(n[i]=o),t=o)}e[t]=!0}return e}function u0(e){for(let n=0;n<e.length;n++)fn(e,n)||(e[n]=null);return e}function yn(e){const n=ra(null);for(const[r,i]of Fu(e))fn(e,r)&&(Array.isArray(i)?n[r]=u0(i):i&&typeof i=="object"&&i.constructor===Object?n[r]=yn(i):n[r]=i);return n}function Fr(e,n){for(;e!==null;){const i=i0(e,n);if(i){if(i.get)return Wt(i.get);if(typeof i.value=="function")return Wt(i.value)}e=r0(e)}function r(){return null}return r}const Fl=Bt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Fo=Bt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Zo=Bt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),d0=Bt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Bo=Bt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),f0=Bt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Zl=Bt(["#text"]),Bl=Bt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Wo=Bt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wl=Bt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Oi=Bt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),m0=cn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),g0=cn(/<%[\w\W]*|[\w\W]*%>/gm),h0=cn(/\$\{[\w\W]*/gm),p0=cn(/^data-[\-\w.\u00B7-\uFFFF]+$/),v0=cn(/^aria-[\-\w]+$/),Zu=cn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),b0=cn(/^(?:\w+script|data):/i),y0=cn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bu=cn(/^html$/i),$0=cn(/^[a-z][.\w]*(-[.\w]+)+$/i);var ql=Object.freeze({__proto__:null,ARIA_ATTR:v0,ATTR_WHITESPACE:y0,CUSTOM_ELEMENT:$0,DATA_ATTR:p0,DOCTYPE_NAME:Bu,ERB_EXPR:g0,IS_ALLOWED_URI:Zu,IS_SCRIPT_OR_DATA:b0,MUSTACHE_EXPR:m0,TMPLIT_EXPR:h0});const Zr={element:1,text:3,progressingInstruction:7,comment:8,document:9},_0=function(){return typeof window>"u"?null:window},w0=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let i=null;const t="data-tt-policy-suffix";r&&r.hasAttribute(t)&&(i=r.getAttribute(t));const o="dompurify"+(i?"#"+i:"");try{return n.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Hl=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Wu(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:_0();const n=Oe=>Wu(Oe);if(n.version="3.3.1",n.removed=[],!e||!e.document||e.document.nodeType!==Zr.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const i=r,t=i.currentScript,{DocumentFragment:o,HTMLTemplateElement:a,Node:l,Element:u,NodeFilter:c,NamedNodeMap:m=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:g,trustedTypes:p}=e,h=u.prototype,v=Fr(h,"cloneNode"),b=Fr(h,"remove"),x=Fr(h,"nextSibling"),R=Fr(h,"childNodes"),U=Fr(h,"parentNode");if(typeof a=="function"){const Oe=r.createElement("template");Oe.content&&Oe.content.ownerDocument&&(r=Oe.content.ownerDocument)}let A,N="";const{implementation:k,createNodeIterator:D,createDocumentFragment:I,getElementsByTagName:S}=r,{importNode:O}=i;let _=Hl();n.isSupported=typeof Fu=="function"&&typeof U=="function"&&k&&k.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:M,ERB_EXPR:F,TMPLIT_EXPR:Z,DATA_ATTR:B,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:ee,ATTR_WHITESPACE:Se,CUSTOM_ELEMENT:X}=ql;let{IS_ALLOWED_URI:ne}=ql,ce=null;const fe=Xe({},[...Fl,...Fo,...Zo,...Bo,...Zl]);let me=null;const V=Xe({},[...Bl,...Wo,...Wl,...Oi]);let z=Object.seal(ra(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),H=null,$e=null;const te=Object.seal(ra(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let he=!0,C=!0,q=!1,ie=!0,_e=!1,ge=!0,Ae=!1,We=!1,mt=!1,yt=!1,kt=!1,dt=!1,G=!0,ue=!1;const ye="user-content-";let ke=!0,Pe=!1,He={},et=null;const Q=Xe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let we=null;const Re=Xe({},["audio","video","img","source","image","track"]);let je=null;const pt=Xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ke="http://www.w3.org/1998/Math/MathML",Et="http://www.w3.org/2000/svg",Lt="http://www.w3.org/1999/xhtml";let bn=Lt,en=!1,xn=null;const tn=Xe({},[Ke,Et,Lt],Ro);let E=Xe({},["mi","mo","mn","ms","mtext"]),K=Xe({},["annotation-xml"]);const ae=Xe({},["title","style","font","a","script"]);let xe=null;const Ye=["application/xhtml+xml","text/html"],nt="text/html";let Ee=null,Ne=null;const Me=r.createElement("form"),Le=function(T){return T instanceof RegExp||T instanceof Function},ve=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ne&&Ne===T)){if((!T||typeof T!="object")&&(T={}),T=yn(T),xe=Ye.indexOf(T.PARSER_MEDIA_TYPE)===-1?nt:T.PARSER_MEDIA_TYPE,Ee=xe==="application/xhtml+xml"?Ro:Zi,ce=fn(T,"ALLOWED_TAGS")?Xe({},T.ALLOWED_TAGS,Ee):fe,me=fn(T,"ALLOWED_ATTR")?Xe({},T.ALLOWED_ATTR,Ee):V,xn=fn(T,"ALLOWED_NAMESPACES")?Xe({},T.ALLOWED_NAMESPACES,Ro):tn,je=fn(T,"ADD_URI_SAFE_ATTR")?Xe(yn(pt),T.ADD_URI_SAFE_ATTR,Ee):pt,we=fn(T,"ADD_DATA_URI_TAGS")?Xe(yn(Re),T.ADD_DATA_URI_TAGS,Ee):Re,et=fn(T,"FORBID_CONTENTS")?Xe({},T.FORBID_CONTENTS,Ee):Q,H=fn(T,"FORBID_TAGS")?Xe({},T.FORBID_TAGS,Ee):yn({}),$e=fn(T,"FORBID_ATTR")?Xe({},T.FORBID_ATTR,Ee):yn({}),He=fn(T,"USE_PROFILES")?T.USE_PROFILES:!1,he=T.ALLOW_ARIA_ATTR!==!1,C=T.ALLOW_DATA_ATTR!==!1,q=T.ALLOW_UNKNOWN_PROTOCOLS||!1,ie=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,_e=T.SAFE_FOR_TEMPLATES||!1,ge=T.SAFE_FOR_XML!==!1,Ae=T.WHOLE_DOCUMENT||!1,yt=T.RETURN_DOM||!1,kt=T.RETURN_DOM_FRAGMENT||!1,dt=T.RETURN_TRUSTED_TYPE||!1,mt=T.FORCE_BODY||!1,G=T.SANITIZE_DOM!==!1,ue=T.SANITIZE_NAMED_PROPS||!1,ke=T.KEEP_CONTENT!==!1,Pe=T.IN_PLACE||!1,ne=T.ALLOWED_URI_REGEXP||Zu,bn=T.NAMESPACE||Lt,E=T.MATHML_TEXT_INTEGRATION_POINTS||E,K=T.HTML_INTEGRATION_POINTS||K,z=T.CUSTOM_ELEMENT_HANDLING||{},T.CUSTOM_ELEMENT_HANDLING&&Le(T.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=T.CUSTOM_ELEMENT_HANDLING.tagNameCheck),T.CUSTOM_ELEMENT_HANDLING&&Le(T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=T.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(z.allowCustomizedBuiltInElements=T.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),_e&&(C=!1),kt&&(yt=!0),He&&(ce=Xe({},Zl),me=[],He.html===!0&&(Xe(ce,Fl),Xe(me,Bl)),He.svg===!0&&(Xe(ce,Fo),Xe(me,Wo),Xe(me,Oi)),He.svgFilters===!0&&(Xe(ce,Zo),Xe(me,Wo),Xe(me,Oi)),He.mathMl===!0&&(Xe(ce,Bo),Xe(me,Wl),Xe(me,Oi))),T.ADD_TAGS&&(typeof T.ADD_TAGS=="function"?te.tagCheck=T.ADD_TAGS:(ce===fe&&(ce=yn(ce)),Xe(ce,T.ADD_TAGS,Ee))),T.ADD_ATTR&&(typeof T.ADD_ATTR=="function"?te.attributeCheck=T.ADD_ATTR:(me===V&&(me=yn(me)),Xe(me,T.ADD_ATTR,Ee))),T.ADD_URI_SAFE_ATTR&&Xe(je,T.ADD_URI_SAFE_ATTR,Ee),T.FORBID_CONTENTS&&(et===Q&&(et=yn(et)),Xe(et,T.FORBID_CONTENTS,Ee)),T.ADD_FORBID_CONTENTS&&(et===Q&&(et=yn(et)),Xe(et,T.ADD_FORBID_CONTENTS,Ee)),ke&&(ce["#text"]=!0),Ae&&Xe(ce,["html","head","body"]),ce.table&&(Xe(ce,["tbody"]),delete H.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw Mr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Mr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=T.TRUSTED_TYPES_POLICY,N=A.createHTML("")}else A===void 0&&(A=w0(p,t)),A!==null&&typeof N=="string"&&(N=A.createHTML(""));Bt&&Bt(T),Ne=T}},vt=Xe({},[...Fo,...Zo,...d0]),Kt=Xe({},[...Bo,...f0]),On=function(T){let oe=U(T);(!oe||!oe.tagName)&&(oe={namespaceURI:bn,tagName:"template"});const Ie=Zi(T.tagName),st=Zi(oe.tagName);return xn[T.namespaceURI]?T.namespaceURI===Et?oe.namespaceURI===Lt?Ie==="svg":oe.namespaceURI===Ke?Ie==="svg"&&(st==="annotation-xml"||E[st]):!!vt[Ie]:T.namespaceURI===Ke?oe.namespaceURI===Lt?Ie==="math":oe.namespaceURI===Et?Ie==="math"&&K[st]:!!Kt[Ie]:T.namespaceURI===Lt?oe.namespaceURI===Et&&!K[st]||oe.namespaceURI===Ke&&!E[st]?!1:!Kt[Ie]&&(ae[Ie]||!vt[Ie]):!!(xe==="application/xhtml+xml"&&xn[T.namespaceURI]):!1},Rt=function(T){Lr(n.removed,{element:T});try{U(T).removeChild(T)}catch{b(T)}},nn=function(T,oe){try{Lr(n.removed,{attribute:oe.getAttributeNode(T),from:oe})}catch{Lr(n.removed,{attribute:null,from:oe})}if(oe.removeAttribute(T),T==="is")if(yt||kt)try{Rt(oe)}catch{}else try{oe.setAttribute(T,"")}catch{}},An=function(T){let oe=null,Ie=null;if(mt)T="<remove></remove>"+T;else{const $t=Mo(T,/^[\r\n\t ]+/);Ie=$t&&$t[0]}xe==="application/xhtml+xml"&&bn===Lt&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const st=A?A.createHTML(T):T;if(bn===Lt)try{oe=new g().parseFromString(st,xe)}catch{}if(!oe||!oe.documentElement){oe=k.createDocument(bn,"template",null);try{oe.documentElement.innerHTML=en?N:st}catch{}}const Dt=oe.body||oe.documentElement;return T&&Ie&&Dt.insertBefore(r.createTextNode(Ie),Dt.childNodes[0]||null),bn===Lt?S.call(oe,Ae?"html":"body")[0]:Ae?oe.documentElement:Dt},Si=function(T){return D.call(T.ownerDocument||T,T,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Pn=function(T){return T instanceof f&&(typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||!(T.attributes instanceof m)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function")},kn=function(T){return typeof l=="function"&&T instanceof l};function rn(Oe,T,oe){Ei(Oe,Ie=>{Ie.call(n,T,oe,Ne)})}const on=function(T){let oe=null;if(rn(_.beforeSanitizeElements,T,null),Pn(T))return Rt(T),!0;const Ie=Ee(T.nodeName);if(rn(_.uponSanitizeElement,T,{tagName:Ie,allowedTags:ce}),ge&&T.hasChildNodes()&&!kn(T.firstElementChild)&&Mt(/<[/\w!]/g,T.innerHTML)&&Mt(/<[/\w!]/g,T.textContent)||T.nodeType===Zr.progressingInstruction||ge&&T.nodeType===Zr.comment&&Mt(/<[/\w]/g,T.data))return Rt(T),!0;if(!(te.tagCheck instanceof Function&&te.tagCheck(Ie))&&(!ce[Ie]||H[Ie])){if(!H[Ie]&&Gn(Ie)&&(z.tagNameCheck instanceof RegExp&&Mt(z.tagNameCheck,Ie)||z.tagNameCheck instanceof Function&&z.tagNameCheck(Ie)))return!1;if(ke&&!et[Ie]){const st=U(T)||T.parentNode,Dt=R(T)||T.childNodes;if(Dt&&st){const $t=Dt.length;for(let Pt=$t-1;Pt>=0;--Pt){const an=v(Dt[Pt],!0);an.__removalCount=(T.__removalCount||0)+1,st.insertBefore(an,x(T))}}}return Rt(T),!0}return T instanceof u&&!On(T)||(Ie==="noscript"||Ie==="noembed"||Ie==="noframes")&&Mt(/<\/no(script|embed|frames)/i,T.innerHTML)?(Rt(T),!0):(_e&&T.nodeType===Zr.text&&(oe=T.textContent,Ei([M,F,Z],st=>{oe=Rr(oe,st," ")}),T.textContent!==oe&&(Lr(n.removed,{element:T.cloneNode()}),T.textContent=oe)),rn(_.afterSanitizeElements,T,null),!1)},Sn=function(T,oe,Ie){if(G&&(oe==="id"||oe==="name")&&(Ie in r||Ie in Me))return!1;if(!(C&&!$e[oe]&&Mt(B,oe))){if(!(he&&Mt(W,oe))){if(!(te.attributeCheck instanceof Function&&te.attributeCheck(oe,T))){if(!me[oe]||$e[oe]){if(!(Gn(T)&&(z.tagNameCheck instanceof RegExp&&Mt(z.tagNameCheck,T)||z.tagNameCheck instanceof Function&&z.tagNameCheck(T))&&(z.attributeNameCheck instanceof RegExp&&Mt(z.attributeNameCheck,oe)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(oe,T))||oe==="is"&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Mt(z.tagNameCheck,Ie)||z.tagNameCheck instanceof Function&&z.tagNameCheck(Ie))))return!1}else if(!je[oe]){if(!Mt(ne,Rr(Ie,Se,""))){if(!((oe==="src"||oe==="xlink:href"||oe==="href")&&T!=="script"&&s0(Ie,"data:")===0&&we[T])){if(!(q&&!Mt(ee,Rr(Ie,Se,"")))){if(Ie)return!1}}}}}}}return!0},Gn=function(T){return T!=="annotation-xml"&&Mo(T,X)},Oo=function(T){rn(_.beforeSanitizeAttributes,T,null);const{attributes:oe}=T;if(!oe||Pn(T))return;const Ie={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:me,forceKeepAttr:void 0};let st=oe.length;for(;st--;){const Dt=oe[st],{name:$t,namespaceURI:Pt,value:an}=Dt,Nn=Ee($t),Ar=an;let _t=$t==="value"?Ar:l0(Ar);if(Ie.attrName=Nn,Ie.attrValue=_t,Ie.keepAttr=!0,Ie.forceKeepAttr=void 0,rn(_.uponSanitizeAttribute,T,Ie),_t=Ie.attrValue,ue&&(Nn==="id"||Nn==="name")&&(nn($t,T),_t=ye+_t),ge&&Mt(/((--!?|])>)|<\/(style|title|textarea)/i,_t)){nn($t,T);continue}if(Nn==="attributename"&&Mo(_t,"href")){nn($t,T);continue}if(Ie.forceKeepAttr)continue;if(!Ie.keepAttr){nn($t,T);continue}if(!ie&&Mt(/\/>/i,_t)){nn($t,T);continue}_e&&Ei([M,F,Z],Pr=>{_t=Rr(_t,Pr," ")});const Ti=Ee(T.nodeName);if(!Sn(Ti,Nn,_t)){nn($t,T);continue}if(A&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Pt)switch(p.getAttributeType(Ti,Nn)){case"TrustedHTML":{_t=A.createHTML(_t);break}case"TrustedScriptURL":{_t=A.createScriptURL(_t);break}}if(_t!==Ar)try{Pt?T.setAttributeNS(Pt,$t,_t):T.setAttribute($t,_t),Pn(T)?Rt(T):Ml(n.removed)}catch{nn($t,T)}}rn(_.afterSanitizeAttributes,T,null)},Ii=function Oe(T){let oe=null;const Ie=Si(T);for(rn(_.beforeSanitizeShadowDOM,T,null);oe=Ie.nextNode();)rn(_.uponSanitizeShadowNode,oe,null),on(oe),Oo(oe),oe.content instanceof o&&Oe(oe.content);rn(_.afterSanitizeShadowDOM,T,null)};return n.sanitize=function(Oe){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},oe=null,Ie=null,st=null,Dt=null;if(en=!Oe,en&&(Oe="<!-->"),typeof Oe!="string"&&!kn(Oe))if(typeof Oe.toString=="function"){if(Oe=Oe.toString(),typeof Oe!="string")throw Mr("dirty is not a string, aborting")}else throw Mr("toString is not a function");if(!n.isSupported)return Oe;if(We||ve(T),n.removed=[],typeof Oe=="string"&&(Pe=!1),Pe){if(Oe.nodeName){const an=Ee(Oe.nodeName);if(!ce[an]||H[an])throw Mr("root node is forbidden and cannot be sanitized in-place")}}else if(Oe instanceof l)oe=An("<!---->"),Ie=oe.ownerDocument.importNode(Oe,!0),Ie.nodeType===Zr.element&&Ie.nodeName==="BODY"||Ie.nodeName==="HTML"?oe=Ie:oe.appendChild(Ie);else{if(!yt&&!_e&&!Ae&&Oe.indexOf("<")===-1)return A&&dt?A.createHTML(Oe):Oe;if(oe=An(Oe),!oe)return yt?null:dt?N:""}oe&&mt&&Rt(oe.firstChild);const $t=Si(Pe?Oe:oe);for(;st=$t.nextNode();)on(st),Oo(st),st.content instanceof o&&Ii(st.content);if(Pe)return Oe;if(yt){if(kt)for(Dt=I.call(oe.ownerDocument);oe.firstChild;)Dt.appendChild(oe.firstChild);else Dt=oe;return(me.shadowroot||me.shadowrootmode)&&(Dt=O.call(i,Dt,!0)),Dt}let Pt=Ae?oe.outerHTML:oe.innerHTML;return Ae&&ce["!doctype"]&&oe.ownerDocument&&oe.ownerDocument.doctype&&oe.ownerDocument.doctype.name&&Mt(Bu,oe.ownerDocument.doctype.name)&&(Pt="<!DOCTYPE "+oe.ownerDocument.doctype.name+`>
|
|
3
|
+
`+Pt),_e&&Ei([M,F,Z],an=>{Pt=Rr(Pt,an," ")}),A&&dt?A.createHTML(Pt):Pt},n.setConfig=function(){let Oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ve(Oe),We=!0},n.clearConfig=function(){Ne=null,We=!1},n.isValidAttribute=function(Oe,T,oe){Ne||ve({});const Ie=Ee(Oe),st=Ee(T);return Sn(Ie,st,oe)},n.addHook=function(Oe,T){typeof T=="function"&&Lr(_[Oe],T)},n.removeHook=function(Oe,T){if(T!==void 0){const oe=o0(_[Oe],T);return oe===-1?void 0:a0(_[Oe],oe,1)[0]}return Ml(_[Oe])},n.removeHooks=function(Oe){_[Oe]=[]},n.removeAllHooks=function(){_=Hl()},n}var Hi=Wu(),Gl=11;function x0(e,n){var r=n.attributes,i,t,o,a,l;if(!(n.nodeType===Gl||e.nodeType===Gl)){for(var u=r.length-1;u>=0;u--)i=r[u],t=i.name,o=i.namespaceURI,a=i.value,o?(t=i.localName||t,l=e.getAttributeNS(o,t),l!==a&&(i.prefix==="xmlns"&&(t=i.name),e.setAttributeNS(o,t,a))):(l=e.getAttribute(t),l!==a&&e.setAttribute(t,a));for(var c=e.attributes,m=c.length-1;m>=0;m--)i=c[m],t=i.name,o=i.namespaceURI,o?(t=i.localName||t,n.hasAttributeNS(o,t)||e.removeAttributeNS(o,t)):n.hasAttribute(t)||e.removeAttribute(t)}}var Ai,k0="http://www.w3.org/1999/xhtml",Ft=typeof document>"u"?void 0:document,S0=!!Ft&&"content"in Ft.createElement("template"),I0=!!Ft&&Ft.createRange&&"createContextualFragment"in Ft.createRange();function T0(e){var n=Ft.createElement("template");return n.innerHTML=e,n.content.childNodes[0]}function C0(e){Ai||(Ai=Ft.createRange(),Ai.selectNode(Ft.body));var n=Ai.createContextualFragment(e);return n.childNodes[0]}function D0(e){var n=Ft.createElement("body");return n.innerHTML=e,n.childNodes[0]}function z0(e){return e=e.trim(),S0?T0(e):I0?C0(e):D0(e)}function Pi(e,n){var r=e.nodeName,i=n.nodeName,t,o;return r===i?!0:(t=r.charCodeAt(0),o=i.charCodeAt(0),t<=90&&o>=97?r===i.toUpperCase():o<=90&&t>=97?i===r.toUpperCase():!1)}function E0(e,n){return!n||n===k0?Ft.createElement(e):Ft.createElementNS(n,e)}function O0(e,n){for(var r=e.firstChild;r;){var i=r.nextSibling;n.appendChild(r),r=i}return n}function qo(e,n,r){e[r]!==n[r]&&(e[r]=n[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var Kl={OPTION:function(e,n){var r=e.parentNode;if(r){var i=r.nodeName.toUpperCase();i==="OPTGROUP"&&(r=r.parentNode,i=r&&r.nodeName.toUpperCase()),i==="SELECT"&&!r.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!n.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),r.selectedIndex=-1)}qo(e,n,"selected")},INPUT:function(e,n){qo(e,n,"checked"),qo(e,n,"disabled"),e.value!==n.value&&(e.value=n.value),n.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,n){var r=n.value;e.value!==r&&(e.value=r);var i=e.firstChild;if(i){var t=i.nodeValue;if(t==r||!r&&t==e.placeholder)return;i.nodeValue=r}},SELECT:function(e,n){if(!n.hasAttribute("multiple")){for(var r=-1,i=0,t=e.firstChild,o,a;t;)if(a=t.nodeName&&t.nodeName.toUpperCase(),a==="OPTGROUP")o=t,t=o.firstChild,t||(t=o.nextSibling,o=null);else{if(a==="OPTION"){if(t.hasAttribute("selected")){r=i;break}i++}t=t.nextSibling,!t&&o&&(t=o.nextSibling,o=null)}e.selectedIndex=r}}},Br=1,Vl=11,Jl=3,Xl=8;function Ln(){}function A0(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function P0(e){return function(r,i,t){if(t||(t={}),typeof i=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"){var o=i;i=Ft.createElement("html"),i.innerHTML=o}else if(r.nodeName==="BODY"){var a=i;i=Ft.createElement("html"),i.innerHTML=a;var l=i.querySelector("body");l&&(i=l)}else i=z0(i);else i.nodeType===Vl&&(i=i.firstElementChild);var u=t.getNodeKey||A0,c=t.onBeforeNodeAdded||Ln,m=t.onNodeAdded||Ln,f=t.onBeforeElUpdated||Ln,g=t.onElUpdated||Ln,p=t.onBeforeNodeDiscarded||Ln,h=t.onNodeDiscarded||Ln,v=t.onBeforeElChildrenUpdated||Ln,b=t.skipFromChildren||Ln,x=t.addChild||function(X,ne){return X.appendChild(ne)},R=t.childrenOnly===!0,U=Object.create(null),A=[];function N(X){A.push(X)}function k(X,ne){if(X.nodeType===Br)for(var ce=X.firstChild;ce;){var fe=void 0;ne&&(fe=u(ce))?N(fe):(h(ce),ce.firstChild&&k(ce,ne)),ce=ce.nextSibling}}function D(X,ne,ce){p(X)!==!1&&(ne&&ne.removeChild(X),h(X),k(X,ce))}function I(X){if(X.nodeType===Br||X.nodeType===Vl)for(var ne=X.firstChild;ne;){var ce=u(ne);ce&&(U[ce]=ne),I(ne),ne=ne.nextSibling}}I(r);function S(X){m(X);for(var ne=X.firstChild;ne;){var ce=ne.nextSibling,fe=u(ne);if(fe){var me=U[fe];me&&Pi(ne,me)?(ne.parentNode.replaceChild(me,ne),_(me,ne)):S(ne)}else S(ne);ne=ce}}function O(X,ne,ce){for(;ne;){var fe=ne.nextSibling;(ce=u(ne))?N(ce):D(ne,X,!0),ne=fe}}function _(X,ne,ce){var fe=u(ne);if(fe&&delete U[fe],!ce){var me=f(X,ne);if(me===!1||(me instanceof HTMLElement&&(X=me,I(X)),e(X,ne),g(X),v(X,ne)===!1))return}X.nodeName!=="TEXTAREA"?M(X,ne):Kl.TEXTAREA(X,ne)}function M(X,ne){var ce=b(X,ne),fe=ne.firstChild,me=X.firstChild,V,z,H,$e,te;e:for(;fe;){for($e=fe.nextSibling,V=u(fe);!ce&&me;){if(H=me.nextSibling,fe.isSameNode&&fe.isSameNode(me)){fe=$e,me=H;continue e}z=u(me);var he=me.nodeType,C=void 0;if(he===fe.nodeType&&(he===Br?(V?V!==z&&((te=U[V])?H===te?C=!1:(X.insertBefore(te,me),z?N(z):D(me,X,!0),me=te,z=u(me)):C=!1):z&&(C=!1),C=C!==!1&&Pi(me,fe),C&&_(me,fe)):(he===Jl||he==Xl)&&(C=!0,me.nodeValue!==fe.nodeValue&&(me.nodeValue=fe.nodeValue))),C){fe=$e,me=H;continue e}z?N(z):D(me,X,!0),me=H}if(V&&(te=U[V])&&Pi(te,fe))ce||x(X,te),_(te,fe);else{var q=c(fe);q!==!1&&(q&&(fe=q),fe.actualize&&(fe=fe.actualize(X.ownerDocument||Ft)),x(X,fe),S(fe))}fe=$e,me=H}O(X,me,z);var ie=Kl[X.nodeName];ie&&ie(X,ne)}var F=r,Z=F.nodeType,B=i.nodeType;if(!R){if(Z===Br)B===Br?Pi(r,i)||(h(r),F=O0(r,E0(i.nodeName,i.namespaceURI))):F=i;else if(Z===Jl||Z===Xl){if(B===Z)return F.nodeValue!==i.nodeValue&&(F.nodeValue=i.nodeValue),F;F=i}}if(F===i)h(r);else{if(i.isSameNode&&i.isSameNode(F))return;if(_(F,i,R),A)for(var W=0,ee=A.length;W<ee;W++){var Se=U[A[W]];Se&&D(Se,Se.parentNode,!1)}}return!R&&F!==r&&r.parentNode&&(F.actualize&&(F=F.actualize(r.ownerDocument||Ft)),r.parentNode.replaceChild(F,r)),F}}var Yl=P0(x0),N0=$("<div data-component=markdown>");const j0=200,gr=new Map;typeof window<"u"&&Hi.isSupported&&Hi.addHook("afterSanitizeAttributes",e=>{if(!(e instanceof HTMLAnchorElement)||e.target!=="_blank")return;const n=e.getAttribute("rel")??"",r=new Set(n.split(/\s+/).filter(Boolean));r.add("noopener"),r.add("noreferrer"),e.setAttribute("rel",Array.from(r).join(" "))});const U0={USE_PROFILES:{html:!0,mathMl:!0},SANITIZE_NAMED_PROPS:!0,FORBID_TAGS:["style"],FORBID_CONTENTS:["style","script"]},Ql={copy:'<path d="M6.2513 6.24935V2.91602H17.0846V13.7493H13.7513M13.7513 6.24935V17.0827H2.91797V6.24935H13.7513Z" stroke="currentColor" stroke-linecap="round"/>',check:'<path d="M5 11.9657L8.37838 14.7529L15 5.83398" stroke="currentColor" stroke-linecap="square"/>'};function L0(e){return Hi.isSupported?Hi.sanitize(e,U0):""}function ec(e,n){const r=document.createElement("div");r.setAttribute("data-component","icon"),r.setAttribute("data-size","small"),r.setAttribute("data-slot",n);const i=document.createElementNS("http://www.w3.org/2000/svg","svg");return i.setAttribute("data-slot","icon-svg"),i.setAttribute("fill","none"),i.setAttribute("viewBox","0 0 20 20"),i.setAttribute("aria-hidden","true"),i.innerHTML=e,r.appendChild(i),r}function R0(e){const n=document.createElement("button");return n.type="button",n.setAttribute("data-component","icon-button"),n.setAttribute("data-variant","secondary"),n.setAttribute("data-size","small"),n.setAttribute("data-slot","markdown-copy-button"),n.setAttribute("aria-label",e.copy),n.setAttribute("title",e.copy),n.appendChild(ec(Ql.copy,"copy-icon")),n.appendChild(ec(Ql.check,"check-icon")),n}function Ho(e,n,r){if(r){e.setAttribute("data-copied","true"),e.setAttribute("aria-label",n.copied),e.setAttribute("title",n.copied);return}e.removeAttribute("data-copied"),e.setAttribute("aria-label",n.copy),e.setAttribute("title",n.copy)}function M0(e,n){const r=new Map,i=u=>{const c=u.getAttribute("data-copied")==="true";Ho(u,n,c)},t=u=>{const c=u.parentElement;if(!c||c.getAttribute("data-component")==="markdown-code")return;const f=document.createElement("div");f.setAttribute("data-component","markdown-code"),c.replaceChild(f,u),f.appendChild(u),f.appendChild(R0(n))},o=async u=>{const c=u.target;if(!(c instanceof Element))return;const m=c.closest('[data-slot="markdown-copy-button"]');if(!(m instanceof HTMLButtonElement))return;const g=m.closest('[data-component="markdown-code"]')?.querySelector("code")?.textContent??"";if(!g)return;const p=navigator?.clipboard;if(!p)return;await p.writeText(g),Ho(m,n,!0);const h=r.get(m);h&&clearTimeout(h);const v=setTimeout(()=>Ho(m,n,!1),2e3);r.set(m,v)},a=Array.from(e.querySelectorAll("pre"));for(const u of a)t(u);const l=Array.from(e.querySelectorAll('[data-slot="markdown-copy-button"]'));for(const u of l)u instanceof HTMLButtonElement&&i(u);return e.addEventListener("click",o),()=>{e.removeEventListener("click",o);for(const u of r.values())clearTimeout(u)}}function tc(e,n){if(gr.delete(e),gr.set(e,n),gr.size<=j0)return;const r=gr.keys().next().value;r&&gr.delete(r)}function En(e){const[n,r]=Ve(e,["text","cacheKey","class","classList"]),i=Lp(),t=gt(),[o,a]=ze(),[l]=Rp(()=>n.text,async m=>{const f=Ir(m),g=n.cacheKey??f;if(g&&f){const v=gr.get(g);if(v&&v.hash===f)return tc(g,v),v.html}const p=await i.parse(m),h=L0(p);return g&&f&&tc(g,{hash:f,html:h}),h},{initialValue:""});let u,c;return re(()=>{const m=o(),f=l();if(!m)return;if(!f){m.innerHTML="";return}const g=document.createElement("div");g.innerHTML=f,Yl(m,g,{childrenOnly:!0,onBeforeElUpdated:(p,h)=>{if(p.isEqualNode(h))return!1;if(p.getAttribute("data-component")==="markdown-code"){const v=p.querySelector("pre"),b=h.querySelector("pre");return v&&b&&!v.isEqualNode(b)&&Yl(v,b),!1}return!0},onBeforeNodeDiscarded:p=>!(p instanceof Element&&(p.getAttribute("data-slot")==="markdown-copy-button"||p.getAttribute("data-component")==="markdown-code"))}),u&&clearTimeout(u),u=setTimeout(()=>{c&&c(),c=M0(m,{copy:t.t("ui.message.copy"),copied:t.t("ui.message.copied")})},150)}),rt(()=>{u&&clearTimeout(u),c&&c()}),(()=>{var m=N0();return ut(a,m),ii(m,Ce({get classList(){return{...n.classList??{},[n.class??""]:!!n.class}}},r),!1,!1),m})()}const nc=new WeakMap,qu=e=>e.tokens.input+e.tokens.output+e.tokens.reasoning+e.tokens.cache.read+e.tokens.cache.write,F0=e=>{for(let n=e.length-1;n>=0;n--){const r=e[n];if(r.role==="assistant"&&!(qu(r)<=0))return r}},Z0=(e,n)=>{const r=e.reduce((u,c)=>u+(c.role==="assistant"?c.cost:0),0),i=F0(e);if(!i)return{totalCost:r,context:void 0};const t=n.find(u=>u.id===i.providerID),o=t?.models[i.modelID],a=o?.limit.context,l=qu(i);return{totalCost:r,context:{message:i,provider:t,model:o,providerLabel:t?.name??i.providerID,modelLabel:o?.name??i.modelID,limit:a,input:i.tokens.input,output:i.tokens.output,reasoning:i.tokens.reasoning,cacheRead:i.tokens.cache.read,cacheWrite:i.tokens.cache.write,total:l,usage:a?Math.round(l/a*100):null}}};function Hu(e,n){const r=nc.get(e);if(r){const o=r.get(n);if(o)return o}const i=Z0(e,n),t=r??new WeakMap;return t.set(n,i),r||nc.set(e,t),i}var B0=$('<div class="flex flex-col gap-1"><div class="text-12-regular text-text-weak"></div><div class="text-12-medium text-text-strong">'),W0=$('<div class="flex items-center justify-between gap-2 w-full"><div class="min-w-0 truncate"> <span class=text-text-base>• </span></div><div class="flex items-center gap-3"><div class="shrink-0 text-12-regular text-text-weak">'),q0=$("<div class=p-3>"),H0=$('<div class="flex flex-col gap-2"><div class="text-12-regular text-text-weak"></div><div class="h-2 w-full rounded-full bg-surface-base overflow-hidden flex"></div><div class="flex flex-wrap gap-x-3 gap-y-1"></div><div class="hidden text-11-regular text-text-weaker">'),G0=$('<div class="@container h-full overflow-y-auto no-scrollbar pb-10"><div class="px-6 pt-4 flex flex-col gap-10"><div class="grid grid-cols-1 @[32rem]:grid-cols-2 gap-4"></div><div class="flex flex-col gap-2"><div class="text-12-regular text-text-weak">'),K0=$("<div class=h-full>"),V0=$('<div class="flex items-center gap-1 text-11-regular text-text-weak"><div class="size-2 rounded-sm"></div><div></div><div class=text-text-weaker>'),J0=$('<div class="flex flex-col gap-2"><div class="text-12-regular text-text-weak"></div><div class="border border-border-base rounded-md bg-surface-base px-3 py-2">');function X0(e){const n=Bn(),r=_n(),i=wt(),t=w(()=>new Intl.NumberFormat(i.locale(),{style:"currency",currency:"USD"})),o=w(()=>Hu(e.messages(),r.data.provider.all)),a=w(()=>o().context),l=w(()=>t().format(o().totalCost)),u=w(()=>{const S=e.messages(),O=S.reduce((M,F)=>M+(F.role==="user"?1:0),0),_=S.reduce((M,F)=>M+(F.role==="assistant"?1:0),0);return{all:S.length,user:O,assistant:_}}),c=w(()=>{const O=hr(e.visibleUserMessages(),M=>!!M.system)?.system;if(!O)return;const _=O.trim();if(_)return _}),m=S=>S===void 0||S===null?"—":S.toLocaleString(i.locale()),f=S=>S===void 0||S===null?"—":S.toLocaleString(i.locale())+"%",g=S=>S?vr.fromMillis(S).setLocale(i.locale()).toLocaleString(vr.DATETIME_MED):"—",p=w(()=>{const S=a();return S?S.providerLabel:"—"}),h=w(()=>{const S=a();return S?S.modelLabel:"—"}),v=w(ot(()=>[a()?.message.id,a()?.input,e.messages().length,c()],()=>{const S=a();if(!S)return[];const O=S.input;if(!O)return[];const _={system:c()?.length??0,user:0,assistant:0,tool:0};for(const V of e.messages()){const z=r.data.part[V.id]??[];if(V.role==="user"){for(const H of z)H.type==="text"&&(_.user+=H.text.length),H.type==="file"&&(_.user+=H.source?.text.value.length??0),H.type==="agent"&&(_.user+=H.source?.value.length??0);continue}if(V.role==="assistant")for(const H of z)H.type==="text"&&(_.assistant+=H.text.length),H.type==="reasoning"&&(_.assistant+=H.text.length),H.type==="tool"&&(_.tool+=Object.keys(H.state.input).length*16,H.state.status==="pending"&&(_.tool+=H.state.raw.length),H.state.status==="completed"&&(_.tool+=H.state.output.length),H.state.status==="error"&&(_.tool+=H.state.error.length))}const M=V=>Math.ceil(V/4),F=M(_.system),Z=M(_.user),B=M(_.assistant),W=M(_.tool),ee=F+Z+B+W,Se=V=>V/O*100,X=V=>(Math.round(Se(V)*10)/10).toString()+"%",ne=V=>[{key:"system",label:i.t("context.breakdown.system"),tokens:V.system,width:Se(V.system),percent:X(V.system),color:"var(--syntax-info)"},{key:"user",label:i.t("context.breakdown.user"),tokens:V.user,width:Se(V.user),percent:X(V.user),color:"var(--syntax-success)"},{key:"assistant",label:i.t("context.breakdown.assistant"),tokens:V.assistant,width:Se(V.assistant),percent:X(V.assistant),color:"var(--syntax-property)"},{key:"tool",label:i.t("context.breakdown.tool"),tokens:V.tool,width:Se(V.tool),percent:X(V.tool),color:"var(--syntax-warning)"},{key:"other",label:i.t("context.breakdown.other"),tokens:V.other,width:Se(V.other),percent:X(V.other),color:"var(--syntax-comment)"}].filter(z=>z.tokens>0);if(ee<=O)return ne({system:F,user:Z,assistant:B,tool:W,other:O-ee});const ce=O/ee,fe={system:Math.floor(F*ce),user:Math.floor(Z*ce),assistant:Math.floor(B*ce),tool:Math.floor(W*ce)},me=fe.system+fe.user+fe.assistant+fe.tool;return ne({...fe,other:Math.max(0,O-me)})}));function b(S){return(()=>{var O=B0(),_=O.firstChild,M=_.nextSibling;return d(_,()=>S.label),d(M,()=>S.value),O})()}const x=w(()=>{const S=a(),O=u();return[{label:i.t("context.stats.session"),value:e.info()?.title??n.id??"—"},{label:i.t("context.stats.messages"),value:O.all.toLocaleString(i.locale())},{label:i.t("context.stats.provider"),value:p()},{label:i.t("context.stats.model"),value:h()},{label:i.t("context.stats.limit"),value:m(S?.limit)},{label:i.t("context.stats.totalTokens"),value:m(S?.total)},{label:i.t("context.stats.usage"),value:f(S?.usage)},{label:i.t("context.stats.inputTokens"),value:m(S?.input)},{label:i.t("context.stats.outputTokens"),value:m(S?.output)},{label:i.t("context.stats.reasoningTokens"),value:m(S?.reasoning)},{label:i.t("context.stats.cacheTokens"),value:`${m(S?.cacheRead)} / ${m(S?.cacheWrite)}`},{label:i.t("context.stats.userMessages"),value:O.user.toLocaleString(i.locale())},{label:i.t("context.stats.assistantMessages"),value:O.assistant.toLocaleString(i.locale())},{label:i.t("context.stats.totalCost"),value:l()},{label:i.t("context.stats.sessionCreated"),value:g(e.info()?.time.created)},{label:i.t("context.stats.lastActivity"),value:g(S?.message.time.created)}]});function R(S){const O=w(()=>{const _=r.data.part[S.message.id]??[],M=JSON.stringify({message:S.message,parts:_},null,2);return{name:`${S.message.role}-${S.message.id}.json`,contents:M,cacheKey:Ir(M)}});return s(Mp,{get file(){return O()},overflow:"wrap",class:"select-text",onRendered:()=>requestAnimationFrame(D)})}function U(S){return s(Tn.Item,{get value(){return S.message.id},get children(){return[s(Mu,{get children(){return s(Tn.Trigger,{get children(){var O=W0(),_=O.firstChild,M=_.firstChild,F=M.nextSibling;F.firstChild;var Z=_.nextSibling,B=Z.firstChild;return d(_,()=>S.message.role,M),d(F,()=>S.message.id,null),d(B,()=>g(S.message.time.created)),d(Z,s(Be,{name:"chevron-grabber-vertical",size:"small",class:"shrink-0 text-text-weak"}),null),O}})}}),s(Tn.Content,{class:"bg-background-base",get children(){var O=q0();return d(O,s(R,{get message(){return S.message}})),O}})]}})}let A,N,k;const D=()=>{const S=A;if(!S)return;const O=e.view()?.scroll("context");O&&(S.scrollTop!==O.y&&(S.scrollTop=O.y),S.scrollLeft!==O.x&&(S.scrollLeft=O.x))},I=S=>{k={x:S.currentTarget.scrollLeft,y:S.currentTarget.scrollTop},N===void 0&&(N=requestAnimationFrame(()=>{N=void 0;const O=k;k=void 0,O&&e.view().setScroll("context",O)}))};return re(ot(()=>e.messages().length,()=>{requestAnimationFrame(D)},{defer:!0})),rt(()=>{N!==void 0&&cancelAnimationFrame(N)}),(()=>{var S=G0(),O=S.firstChild,_=O.firstChild,M=_.nextSibling,F=M.firstChild;return S.addEventListener("scroll",I),ut(Z=>{A=Z,D()},S),d(_,s(Ge,{get each(){return x()},children:Z=>s(b,{get label(){return Z.label},get value(){return Z.value}})})),d(O,s(P,{get when(){return v().length>0},get children(){var Z=H0(),B=Z.firstChild,W=B.nextSibling,ee=W.nextSibling,Se=ee.nextSibling;return d(B,()=>i.t("context.breakdown.title")),d(W,s(Ge,{get each(){return v()},children:X=>(()=>{var ne=K0();return be(ce=>{var fe=`${X.width}%`,me=X.color;return fe!==ce.e&&Xt(ne,"width",ce.e=fe),me!==ce.t&&Xt(ne,"background-color",ce.t=me),ce},{e:void 0,t:void 0}),ne})()})),d(ee,s(Ge,{get each(){return v()},children:X=>(()=>{var ne=V0(),ce=ne.firstChild,fe=ce.nextSibling,me=fe.nextSibling;return d(fe,()=>X.label),d(me,()=>X.percent),be(V=>Xt(ce,"background-color",X.color)),ne})()})),d(Se,()=>i.t("context.breakdown.note")),Z}}),M),d(O,s(P,{get when(){return c()},children:Z=>(()=>{var B=J0(),W=B.firstChild,ee=W.nextSibling;return d(W,()=>i.t("context.systemPrompt.title")),d(ee,s(En,{get text(){return Z()},class:"text-12-regular"})),B})()}),M),d(F,()=>i.t("context.rawMessages.title")),d(M,s(Tn,{multiple:!0,get children(){return s(Ge,{get each(){return e.messages()},children:Z=>s(U,{message:Z})})}}),null),S})()}var Y0=$('<div class="flex items-center gap-x-1.5 min-w-0"><span class="text-14-medium truncate">'),Q0=$('<div class=h-full><div class="relative h-full">');function Gu(e){return(()=>{var n=Y0(),r=n.firstChild;return d(n,s(Tr,{get node(){return{path:e.path,type:"file"}},get classList(){return{"grayscale-100 group-data-[selected]/tab:grayscale-0":!e.active,"grayscale-0":e.active}}}),r),d(r,()=>Tt(e.path)),n})()}function eb(e){const n=ci(),r=wt(),i=li(),t=eu(e.tab),o=w(()=>n.pathFromTab(e.tab));return(()=>{var a=Q0(),l=a.firstChild;return ut(t,a,()=>!0),d(l,s(it.Trigger,{get value(){return e.tab},get closeButton(){return s(mn,{get title(){return r.t("common.closeTab")},get keybind(){return i.keybind("tab.close")},placement:"bottom",get children(){return s(zt,{icon:"close-small",variant:"ghost",class:"h-5 w-5",onClick:()=>e.onTabClose(e.tab),get"aria-label"(){return r.t("common.closeTab")}})}})},hideCloseButton:!0,onMiddleClick:()=>e.onTabClose(e.tab),get children(){return s(P,{get when(){return o()},children:u=>s(Gu,{get path(){return u()}})})}})),be(()=>a.classList.toggle("opacity-0",!!t.isActiveDraggable)),a})()}var tb=$("<span>"),nb=$('<div class="absolute inset-0 flex items-center px-3 bg-muted z-10 pointer-events-auto"><input type=text class="bg-transparent border-none outline-none text-sm min-w-0 flex-1">'),rb=$('<div class="outline-none focus:outline-none focus-visible:outline-none h-full"><div class="relative h-full">');function ib(e){const n=tu(),r=wt(),i=eu(e.terminal.id),[t,o]=It({editing:!1,title:e.terminal.title,menuOpen:!1,menuPosition:{x:0,y:0},blurEnabled:!1}),a=()=>{const h=e.terminal.titleNumber;if(!Number.isFinite(h)||h<=0)return!1;const v=e.terminal.title.match(/^Terminal (\d+)$/);if(!v)return!1;const b=Number(v[1]);return!Number.isFinite(b)||b<=0?!1:b===h},l=()=>{if(r.locale(),e.terminal.title&&!a())return e.terminal.title;const h=e.terminal.titleNumber;return Number.isFinite(h)&&h>0?r.t("terminal.title.numbered",{number:h}):e.terminal.title?e.terminal.title:r.t("terminal.title")},u=()=>{const h=n.all().length;n.close(e.terminal.id),h===1&&e.onClose?.()},c=()=>{if(t.editing)return;document.activeElement instanceof HTMLElement&&document.activeElement.blur();const v=document.getElementById(`terminal-wrapper-${e.terminal.id}`)?.querySelector('[data-component="terminal"]');if(!v)return;const b=v.querySelector("textarea");if(b){b.focus();return}v.focus(),v.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0}))},m=h=>{h&&(h.stopPropagation(),h.preventDefault()),o("blurEnabled",!1),o("title",e.terminal.title),o("editing",!0),setTimeout(()=>{const v=document.getElementById(`terminal-title-input-${e.terminal.id}`);v&&(v.focus(),v.select(),setTimeout(()=>o("blurEnabled",!0),100))},10)},f=()=>{if(!t.blurEnabled)return;const h=t.title.trim();h&&h!==e.terminal.title&&n.update({id:e.terminal.id,title:h}),o("editing",!1)},g=h=>{if(h.key==="Enter"){h.preventDefault(),f();return}h.key==="Escape"&&(h.preventDefault(),o("editing",!1))},p=h=>{h.preventDefault(),o("menuPosition",{x:h.clientX,y:h.clientY}),o("menuOpen",!0)};return(()=>{var h=rb(),v=h.firstChild;return ut(i,h,()=>!0),d(v,s(it.Trigger,{get value(){return e.terminal.id},onClick:c,onMouseDown:b=>b.preventDefault(),onContextMenu:p,class:"!shadow-none",classes:{button:"border-0 outline-none focus:outline-none focus-visible:outline-none !shadow-none !ring-0"},get closeButton(){return s(zt,{icon:"close",variant:"ghost",onClick:b=>{b.stopPropagation(),u()},get"aria-label"(){return r.t("terminal.close")}})},get children(){var b=tb();return b.$$dblclick=m,d(b,l),be(()=>b.classList.toggle("invisible",!!t.editing)),b}}),null),d(v,s(P,{get when(){return t.editing},get children(){var b=nb(),x=b.firstChild;return x.$$mousedown=R=>R.stopPropagation(),x.$$keydown=g,x.addEventListener("blur",f),x.$$input=R=>o("title",R.currentTarget.value),be(()=>Te(x,"id",`terminal-title-input-${e.terminal.id}`)),be(()=>x.value=t.title),b}}),null),d(v,s(at,{get open(){return t.menuOpen},onOpenChange:b=>o("menuOpen",b),get children(){return s(at.Portal,{get children(){return s(at.Content,{class:"fixed",get style(){return{left:`${t.menuPosition.x}px`,top:`${t.menuPosition.y}px`}},get children(){return[s(at.Item,{onSelect:m,get children(){return[s(Be,{name:"edit",class:"w-4 h-4 mr-2"}),se(()=>r.t("common.rename"))]}}),s(at.Item,{onSelect:u,get children(){return[s(Be,{name:"close",class:"w-4 h-4 mr-2"}),se(()=>r.t("common.close"))]}})]}})}})}}),null),be(()=>h.classList.toggle("opacity-0",!!i.isActiveDraggable)),h})()}Ut(["dblclick","input","keydown","mousedown"]);var ob=$('<div class="size-full flex flex-col justify-end items-start gap-4 flex-[1_0_0] self-stretch max-w-200 mx-auto px-6 pb-[calc(var(--prompt-height,11.25rem)+64px)]"><div class="text-20-medium text-text-weaker"></div><div class="flex justify-center items-center gap-3"><div class="text-12-medium text-text-weak select-text"><span class=text-text-strong></span></div></div><div class="flex justify-center items-center gap-1"><div class="text-12-medium text-text-weak select-text ml-2">'),ab=$('<div class="flex justify-center items-center gap-3"><div class="text-12-medium text-text-weak"> <span class=text-text-strong>');const Go="main",rc="create";function sb(e){const n=_n(),r=wt(),i=w(()=>n.project?.sandboxes??[]),t=w(()=>[Go,...i(),rc]),o=w(()=>{const c=e.worktree;return t().includes(c)?c:Go}),a=w(()=>n.project?.worktree??n.data.path.directory),l=w(()=>{const c=n.project;return c?n.data.path.directory!==c.worktree:!1}),u=c=>{if(c===Go){if(l())return r.t("session.new.worktree.main");const m=n.data.vcs?.branch;return m?r.t("session.new.worktree.mainWithBranch",{branch:m}):r.t("session.new.worktree.main")}return c===rc?r.t("session.new.worktree.create"):Tt(c)};return(()=>{var c=ob(),m=c.firstChild,f=m.nextSibling,g=f.firstChild,p=g.firstChild,h=f.nextSibling,v=h.firstChild;return d(m,()=>r.t("command.session.new")),d(f,s(Be,{name:"folder",size:"small"}),g),d(g,()=>Cr(a()),p),d(p,()=>Tt(a())),d(h,s(Be,{name:"branch",size:"small"}),v),d(v,()=>u(o())),d(c,s(P,{get when(){return n.project},children:b=>(()=>{var x=ab(),R=x.firstChild,U=R.firstChild,A=U.nextSibling;return d(x,s(Be,{name:"pencil-line",size:"small"}),R),d(R,()=>r.t("session.new.lastModified"),U),d(A,()=>vr.fromMillis(b().time.updated??b().time.created).setLocale(r.locale()).toRelative()),x})()}),null),c})()}const ic=e=>{const r=document.getElementById(`terminal-wrapper-${e}`)?.querySelector('[data-component="terminal"]');if(!(r instanceof HTMLElement))return!1;const i=r.querySelector("textarea");return i instanceof HTMLTextAreaElement?(i.focus(),!0):(r.focus(),r.dispatchEvent(typeof PointerEvent=="function"?new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0}):new MouseEvent("pointerdown",{bubbles:!0,cancelable:!0})),!0)},lb=e=>n=>{e.showAllFiles(),e.openTab(e.tabForPath(n)),e.loadFile(n)},cb=e=>e.flatMap(n=>n),ub=(e,n)=>e.length===0?void 0:[...e].sort((i,t)=>{if(t.ratio!==i.ratio)return t.ratio-i.ratio;const o=Math.abs(i.top-n),a=Math.abs(t.top-n);return o!==a?o-a:i.top-t.top})[0]?.id,db=(e,n)=>{if(e.length===0)return;let r=0,i=e.length-1,t=0;for(;r<=i;){const o=r+i>>1,a=e[o]?.top;if(a===void 0)break;if(a<=n){t=o,r=o+1;continue}i=o-1}return e[t]?.id},fb=e=>{const n=e.raf??requestAnimationFrame,r=e.caf??cancelAnimationFrame,i=e.IntersectionObserver??globalThis.IntersectionObserver,t=e.ResizeObserver??globalThis.ResizeObserver,o=e.MutationObserver??globalThis.MutationObserver;let a,l,u,c,m,f,g=!0;const p=new Map,h=new WeakMap,v=new Map;let b=[];const x=()=>{m===void 0&&(m=n(()=>{m=void 0,U()}))},R=()=>{const _=a;if(!_){b=[],g=!1;return}const M=_.getBoundingClientRect().top;b=[...p].map(([F,Z])=>({id:F,top:Z.getBoundingClientRect().top-M+_.scrollTop})),b.sort((F,Z)=>F.top-Z.top),g=!1},U=()=>{const _=a;if(!_)return;const M=_.getBoundingClientRect().top+100,F=ub([...v].map(([Z,B])=>({id:Z,ratio:B.ratio,top:B.top})),M)??(g&&R(),db(b,_.scrollTop+100));!F||F===f||(f=F,e.onActive(F))},A=()=>{const _=a;if(_){if(l?.disconnect(),l=void 0,i)try{l=new i(M=>{for(const F of M){const Z=F.target;if(!(Z instanceof HTMLElement))continue;const B=h.get(Z);if(B){if(!F.isIntersecting||F.intersectionRatio<=0){v.delete(B);continue}v.set(B,{ratio:F.intersectionRatio,top:F.boundingClientRect.top})}}x()},{root:_,threshold:[0,.25,.5,.75,1]})}catch{l=void 0}if(l)for(const M of p.values())l.observe(M);if(u?.disconnect(),u=void 0,t){u=new t(()=>{g=!0,x()}),u.observe(_);for(const M of p.values())u.observe(M)}c?.disconnect(),c=void 0,o&&(c=new o(()=>{g=!0,x()}),c.observe(_,{subtree:!0,childList:!0,characterData:!0})),g=!0,x()}},N=_=>{a!==_&&(a=_,v.clear(),f=void 0,A())},k=(_,M)=>{const F=p.get(M);F&&F!==_&&(l?.unobserve(F),u?.unobserve(F)),p.set(M,_),h.set(_,M),l&&l.observe(_),u&&u.observe(_),g=!0,x()},D=_=>{const M=p.get(_);M&&(l?.unobserve(M),u?.unobserve(M),p.delete(_),v.delete(_),g=!0)},I=()=>{g=!0,x()},S=()=>{for(const _ of p.values())l?.unobserve(_),u?.unobserve(_);p.clear(),v.clear(),b=[],f=void 0,g=!0};return{setContainer:N,register:k,unregister:D,onScroll:x,markDirty:I,clear:S,destroy:()=>{m!==void 0&&r(m),m=void 0,S(),l?.disconnect(),u?.disconnect(),c?.disconnect(),l=void 0,u=void 0,c=void 0,a=void 0},getActiveId:()=>f}};var mb={};io(mb,{Description:()=>so,ErrorMessage:()=>ao,Item:()=>Ju,ItemControl:()=>Da,ItemDescription:()=>za,ItemIndicator:()=>Ea,ItemInput:()=>Xu,ItemLabel:()=>Oa,Label:()=>Aa,RadioGroup:()=>fo,Root:()=>Yu,useRadioGroupContext:()=>uo});var Ku=or();function uo(){const e=ar(Ku);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var Vu=or();function Er(){const e=ar(Vu);if(e===void 0)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function Ju(e){const n=ui(),r=uo(),i=`${n.generateId("item")}-${kr()}`,t=Ct({id:i},e),[o,a]=Ve(t,["value","disabled","onPointerDown"]),[l,u]=ze(),[c,m]=ze(),[f,g]=ze(),[p,h]=ze(),[v,b]=ze(!1),x=w(()=>r.isDefaultValue(o.value)),R=w(()=>r.isSelectedValue(o.value)),U=w(()=>o.disabled||n.isDisabled()||!1),A=D=>{Ot(D,o.onPointerDown),v()&&D.preventDefault()},N=w(()=>({...n.dataset(),"data-disabled":U()?"":void 0,"data-checked":R()?"":void 0})),k={value:()=>o.value,dataset:N,isDefault:x,isSelected:R,isDisabled:U,inputId:l,labelId:c,descriptionId:f,inputRef:p,select:()=>r.setSelectedValue(o.value),generateId:ai(()=>a.id),registerInput:Fn(u),registerLabel:Fn(m),registerDescription:Fn(g),setIsFocused:b,setInputRef:h};return s(Vu.Provider,{value:k,get children(){return s(At,Ce({as:"div",role:"group",onPointerDown:A},N,a))}})}function Da(e){const n=Er(),r=Ct({id:n.generateId("control")},e),[i,t]=Ve(r,["onClick","onKeyDown"]);return s(At,Ce({as:"div",onClick:l=>{Ot(l,i.onClick),n.select(),n.inputRef()?.focus()},onKeyDown:l=>{Ot(l,i.onKeyDown),l.key===ru.Space&&(n.select(),n.inputRef()?.focus())}},()=>n.dataset(),t))}function za(e){const n=Er(),r=Ct({id:n.generateId("description")},e);return re(()=>rt(n.registerDescription(r.id))),s(At,Ce({as:"div"},()=>n.dataset(),r))}function Ea(e){const n=Er(),r=Ct({id:n.generateId("indicator")},e),[i,t]=Ve(r,["ref","forceMount"]),[o,a]=ze(),{present:l}=$a({show:()=>i.forceMount||n.isSelected(),element:()=>o()??null});return s(P,{get when(){return l()},get children(){return s(At,Ce({as:"div",ref(u){var c=Gt(a,i.ref);typeof c=="function"&&c(u)}},()=>n.dataset(),t))}})}function Xu(e){const n=ui(),r=uo(),i=Er(),t=Ct({id:i.generateId("input")},e),[o,a]=Ve(t,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),l=()=>[o["aria-labelledby"],i.labelId(),o["aria-labelledby"]!=null&&a["aria-label"]!=null?a.id:void 0].filter(Boolean).join(" ")||void 0,u=()=>[o["aria-describedby"],i.descriptionId(),r.ariaDescribedBy()].filter(Boolean).join(" ")||void 0,[c,m]=ze(!1),f=h=>{if(Ot(h,o.onChange),h.stopPropagation(),!c()){r.setSelectedValue(i.value());const v=h.target;v.checked=i.isSelected()}m(!1)},g=h=>{Ot(h,o.onFocus),i.setIsFocused(!0)},p=h=>{Ot(h,o.onBlur),i.setIsFocused(!1)};return re(ot([()=>i.isSelected(),()=>i.value()],h=>{if(!h[0]&&h[1]===i.value())return;m(!0);const v=i.inputRef();v?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),v?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),re(()=>rt(i.registerInput(a.id))),s(At,Ce({as:"input",ref(h){var v=Gt(i.setInputRef,o.ref);typeof v=="function"&&v(h)},type:"radio",get name(){return n.name()},get value(){return i.value()},get checked(){return i.isSelected()},get required(){return n.isRequired()},get disabled(){return i.isDisabled()},get readonly(){return n.isReadOnly()},get style(){return oi({...su},o.style)},get"aria-labelledby"(){return l()},get"aria-describedby"(){return u()},onChange:f,onFocus:g,onBlur:p},()=>i.dataset(),a))}function Oa(e){const n=Er(),r=Ct({id:n.generateId("label")},e);return re(()=>rt(n.registerLabel(r.id))),s(At,Ce({as:"label",get for(){return n.inputId()}},()=>n.dataset(),r))}function Aa(e){return s(nu,Ce({as:"span"},e))}function Yu(e){let n;const r=`radiogroup-${kr()}`,i=Ct({id:r,orientation:"vertical"},e),[t,o,a]=Ve(i,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],iu),[l,u]=Fp({value:()=>t.value,defaultValue:()=>t.defaultValue,onChange:b=>t.onChange?.(b)}),{formControlContext:c}=ou(o);xa(()=>n,()=>u(t.defaultValue??""));const m=()=>c.getAriaLabelledBy(Wi(o.id),a["aria-label"],t["aria-labelledby"]),f=()=>c.getAriaDescribedBy(t["aria-describedby"]),g=b=>b===e.defaultValue,p=b=>b===l(),v={ariaDescribedBy:f,isDefaultValue:g,isSelectedValue:p,setSelectedValue:b=>{if(!(c.isReadOnly()||c.isDisabled())&&(u(b),n))for(const x of n.querySelectorAll("[type='radio']")){const R=x;R.checked=p(R.value)}}};return s(au.Provider,{value:c,get children(){return s(Ku.Provider,{value:v,get children(){return s(At,Ce({as:"div",ref(b){var x=Gt(R=>n=R,t.ref);typeof x=="function"&&x(b)},role:"radiogroup",get id(){return Wi(o.id)},get"aria-invalid"(){return c.validationState()==="invalid"||void 0},get"aria-required"(){return c.isRequired()||void 0},get"aria-disabled"(){return c.isDisabled()||void 0},get"aria-readonly"(){return c.isReadOnly()||void 0},get"aria-orientation"(){return t.orientation},get"aria-labelledby"(){return m()},get"aria-describedby"(){return f()}},()=>c.dataset(),a))}})}})}var fo=Object.assign(Yu,{Description:so,ErrorMessage:ao,Item:Ju,ItemControl:Da,ItemDescription:za,ItemIndicator:Ea,ItemInput:Xu,ItemLabel:Oa,Label:Aa}),Qu=or();function ed(){const e=ar(Qu);if(e===void 0)throw new Error("[kobalte]: `useSegmentedControlContext` must be used within a `SegmentedControl` component");return e}function gb(e){const n=ed(),[r,i]=Ve(e,["style"]),[t,o]=ze(),[a,l]=ze(!1),u=()=>{const m=n.selectedItem();if(!m){o(void 0);return}o({width:`${m.offsetWidth}px`,height:`${m.offsetHeight}px`,transform:c(m),"transition-duration":a()?"0ms":void 0})},c=m=>{const f=getComputedStyle(m.parentElement),g=m.offsetLeft-Number.parseFloat(f.paddingLeft),p=m.offsetTop-Number.parseFloat(f.paddingTop);return`translate(${g}px, ${p}px)`};return re(ot(n.selectedItem,()=>{l(!t()),u(),l(!1)})),br(n.root,()=>{Zp(()=>{l(!0),u(),l(!1)})}),s(At,Ce({as:"div",role:"presentation",get style(){return oi(t(),r.style)},get"data-resizing"(){return a()},get"data-orientation"(){return n.orientation()}},i))}var hb=e=>{const n=uo(),r=ed(),[i,t]=Ve(e,["ref"]),[o,a]=ze();return re(()=>{const l=o();l&&n.isSelectedValue(e.value)&&r.setSelectedItem(l)}),s(fo.Item,Ce({ref(l){var u=Gt(a,i.ref);typeof u=="function"&&u(l)}},t))},pb=e=>{const n=Er(),[r,i]=Ve(e,["ref"]),[t,o]=ze();return xa(t,()=>{requestAnimationFrame(()=>{n.isDefault()&&n.select()})}),s(fo.ItemInput,Ce({ref(a){var l=Gt(o,r.ref);typeof l=="function"&&l(a)}},i))},vb=e=>{const n=Ce({defaultValue:e.value,orientation:"horizontal"},e),[r,i]=Ve(n,["ref"]),[t,o]=ze(),[a,l]=ze(),u={value:()=>i.value,defaultValue:()=>i.defaultValue,orientation:()=>i.orientation,root:t,selectedItem:a,setSelectedItem:l};return re(()=>{u.value()||l(void 0)}),s(Qu.Provider,{value:u,get children(){return s(fo,Ce({ref(c){var m=Gt(o,r.ref);typeof m=="function"&&m(c)}},i))}})},Wr=Object.assign(vb,{Description:so,ErrorMessage:ao,Indicator:gb,Item:hb,ItemControl:Da,ItemDescription:za,ItemIndicator:Ea,ItemInput:pb,ItemLabel:Oa,Label:Aa}),bb=$("<div role=presentation data-slot=radio-group-wrapper><div role=presentation data-slot=radio-group-items>");function yb(e){const[n,r]=Ve(e,["class","classList","options","current","defaultValue","value","label","onSelect","size"]),i=a=>n.value?n.value(a):String(a),t=a=>n.label?n.label(a):String(a),o=a=>n.options.find(l=>i(l)===a);return s(Wr,Ce(r,{"data-component":"radio-group",get"data-size"(){return n.size??"medium"},get classList(){return{...n.classList??{},[n.class??""]:!!n.class}},get value(){return se(()=>!!n.current)()?i(n.current):void 0},get defaultValue(){return se(()=>!!n.defaultValue)()?i(n.defaultValue):void 0},onChange:a=>n.onSelect?.(o(a)),get children(){var a=bb(),l=a.firstChild;return d(a,s(Wr.Indicator,{"data-slot":"radio-group-indicator"}),l),d(l,s(Ge,{get each(){return n.options},children:u=>s(Wr.Item,{get value(){return i(u)},"data-slot":"radio-group-item",get children(){return[s(Wr.ItemInput,{"data-slot":"radio-group-item-input"}),s(Wr.ItemLabel,{"data-slot":"radio-group-item-label",get children(){return t(u)}})]}})})),a}}))}var $b=$("<div data-slot=line-comment-popover>"),_b=$("<div data-component=line-comment><button type=button data-slot=line-comment-button>"),wb=$("<div data-slot=line-comment-content><div data-slot=line-comment-text></div><div data-slot=line-comment-label>"),xb=$("<div data-slot=line-comment-editor><textarea data-slot=line-comment-textarea></textarea><div data-slot=line-comment-actions><div data-slot=line-comment-editor-label>");const td=e=>{const n=()=>e.top===void 0,r=()=>e.variant??"default";return(()=>{var i=_b(),t=i.firstChild;return ln(t,"mouseenter",e.onMouseEnter),ln(t,"click",e.onClick,!0),d(t,s(Be,{name:"comment",size:"small"})),d(i,s(P,{get when(){return e.open},get children(){var o=$b();return ln(o,"focusout",e.onPopoverFocusOut,!0),d(o,()=>e.children),be(a=>ct(o,{[e.popoverClass??""]:!!e.popoverClass},a)),o}}),null),be(o=>{var a=r(),l=e.id,u=e.open?"":void 0,c={[e.class??""]:!!e.class},m=`${e.top??0}px`,f=n()?0:1,g=n()?"none":"auto";return a!==o.e&&Te(i,"data-variant",o.e=a),l!==o.t&&Te(i,"data-comment-id",o.t=l),u!==o.a&&Te(i,"data-open",o.a=u),o.o=ct(i,c,o.o),m!==o.i&&Xt(i,"top",o.i=m),f!==o.n&&Xt(i,"opacity",o.n=f),g!==o.s&&Xt(i,"pointer-events",o.s=g),o},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),i})()},nd=e=>{const n=gt(),[r,i]=Ve(e,["comment","selection"]);return s(td,Ce(i,{variant:"default",get children(){var t=wb(),o=t.firstChild,a=o.nextSibling;return d(o,()=>r.comment),d(a,()=>n.t("ui.lineComment.label.prefix"),null),d(a,()=>r.selection,null),d(a,()=>n.t("ui.lineComment.label.suffix"),null),t}}))},rd=e=>{const n=gt(),[r,i]=Ve(e,["value","selection","onInput","onCancel","onSubmit","placeholder","rows","autofocus","cancelLabel","submitLabel"]),t={textarea:void 0},o=()=>t.textarea?.focus(),a=()=>{const l=r.value.trim();l&&r.onSubmit(l)};return lo(()=>{r.autofocus!==!1&&requestAnimationFrame(o)}),s(td,Ce(i,{open:!0,variant:"editor",onClick:()=>o(),get children(){var l=xb(),u=l.firstChild,c=u.nextSibling,m=c.firstChild;return u.$$keydown=f=>{if(f.key==="Escape"){f.preventDefault(),f.stopPropagation(),r.onCancel();return}f.key==="Enter"&&(f.shiftKey||(f.preventDefault(),f.stopPropagation(),a()))},u.$$input=f=>r.onInput(f.currentTarget.value),ut(f=>{t.textarea=f},u),d(m,()=>n.t("ui.lineComment.editorLabel.prefix"),null),d(m,()=>r.selection,null),d(m,()=>n.t("ui.lineComment.editorLabel.suffix"),null),d(c,s(Ue,{size:"small",variant:"ghost",get onClick(){return r.onCancel},get children(){return r.cancelLabel??n.t("ui.common.cancel")}}),null),d(c,s(Ue,{size:"small",variant:"primary",get disabled(){return r.value.trim().length===0},onClick:a,get children(){return r.submitLabel??n.t("ui.lineComment.submit")}}),null),be(f=>{var g=r.rows??3,p=r.placeholder??n.t("ui.lineComment.placeholder");return g!==f.e&&Te(u,"rows",f.e=g),p!==f.t&&Te(u,"placeholder",f.t=p),f},{e:void 0,t:void 0}),be(()=>u.value=r.value),l}}))};Ut(["click","focusout","input","keydown"]);var kb=$("<div data-component=session-review><div data-slot=session-review-header><div data-slot=session-review-title></div><div data-slot=session-review-actions></div></div><div data-slot=session-review-container>"),Sb=$("<span data-slot=session-review-directory>"),Ib=$("<button data-slot=session-review-view-button type=button>"),Tb=$("<span data-slot=session-review-change data-type=added>"),Cb=$("<span data-slot=session-review-change data-type=removed>"),Db=$("<span data-slot=session-review-change data-type=modified>"),zb=$("<div data-slot=session-review-trigger-content><div data-slot=session-review-file-info><div data-slot=session-review-file-name-container><span data-slot=session-review-filename></span></div></div><div data-slot=session-review-trigger-actions>"),Eb=$("<div data-slot=session-review-image-container><img data-slot=session-review-image>"),Ob=$("<div data-slot=session-review-image-container data-removed><span data-slot=session-review-image-placeholder>"),Ab=$("<div data-slot=session-review-image-container><span data-slot=session-review-image-placeholder>"),Pb=$("<div data-slot=session-review-diff-wrapper>");const Nb=new Set(["png","jpg","jpeg","gif","webp","avif","bmp","ico","tif","tiff","heic"]),jb=new Set(["mp3","wav","ogg","m4a","aac","flac","opus"]);function Pa(e){if(!e)return;const n=e.split(";",1)[0]?.trim().toLowerCase();if(n)return n==="audio/x-aac"?"audio/aac":n==="audio/x-m4a"?"audio/mp4":n}function id(e){const n=e.lastIndexOf(".");return n===-1?"":e.slice(n+1).toLowerCase()}function Ub(e){return Nb.has(id(e))}function Lb(e){return jb.has(id(e))}function oc(e){if(!e||e.encoding!=="base64")return;const n=Pa(e.mimeType);if(n&&!(!n.startsWith("image/")&&!n.startsWith("audio/")))return`data:${n};base64,${e.content}`}function Ni(e){if(typeof e=="string")return e.startsWith("data:image/")?e:e.startsWith("data:audio/x-aac;")?e.replace("data:audio/x-aac;","data:audio/aac;"):e.startsWith("data:audio/x-m4a;")?e.replace("data:audio/x-m4a;","data:audio/mp4;"):e.startsWith("data:audio/")?e:void 0;if(!e||typeof e!="object")return;const n=e.content,r=e.encoding,i=e.mimeType;if(typeof n!="string"||r!=="base64"||typeof i!="string")return;const t=Pa(i);if(t&&!(!t.startsWith("image/")&&!t.startsWith("audio/")))return`data:${t};base64,${n}`}function Rb(e){const n=Ir(e);if(n)return`session-review-diff-${n}`}function Mb(e){const n=e.closest("[data-line-type]");if(n instanceof HTMLElement){const i=n.dataset.lineType;if(i==="change-deletion")return"deletions";if(i==="change-addition"||i==="change-additions")return"additions"}const r=e.closest("[data-code]");if(r instanceof HTMLElement)return r.hasAttribute("data-deletions")?"deletions":"additions"}function ac(e,n){const r=(o,a)=>{const l=Array.from(e.querySelectorAll(`[data-line="${o}"], [data-alt-line="${o}"]`)).filter(c=>c instanceof HTMLElement);return l.length===0?void 0:a?l.find(c=>Mb(c)===a)??l[0]:l[0]},i=r(n.start,n.side),t=r(n.end,n.endSide??n.side);return i?t?i.getBoundingClientRect().top>t.getBoundingClientRect().top?i:t:i:t}function sc(e,n){const r=e.getBoundingClientRect(),i=n.getBoundingClientRect();return i.top-r.top+Math.max(0,(i.height-20)/2)}const Fb=e=>{let n,r=0;const i=gt(),t=ka(),o=new Map,[a,l]=It({open:e.diffs.length>10?[]:e.diffs.map(k=>k.file)}),[u,c]=ze(null),[m,f]=ze(null),[g,p]=ze(null),h=()=>e.open??a.open,v=()=>e.diffStyle??(e.split?"split":"unified"),b=()=>e.diffs.length>0,x=k=>{e.onOpenChange?.(k),e.open===void 0&&l("open",k)},R=()=>{const k=h().length>0?[]:e.diffs.map(D=>D.file);x(k)},U=k=>{const D=Math.min(k.start,k.end),I=Math.max(k.start,k.end);return D===I?`line ${D}`:`lines ${D}-${I}`},A=k=>k.endSide??k.side??"additions",N=(k,D)=>{const S=A(D)==="deletions"?k.before:k.after;if(typeof S!="string"||S.length===0)return;const O=Math.max(1,Math.min(D.start,D.end)),_=Math.max(D.start,D.end),M=S.split(`
|
|
4
|
+
`).slice(O-1,_);if(M.length!==0)return M.slice(0,2).join(`
|
|
5
|
+
`)};return re(()=>{const k=e.focusedComment;if(!k)return;r++;const D=r;p(k);const I=(e.comments??[]).find(_=>_.file===k.file&&_.id===k.id);I&&c({file:I.file,range:I.selection});const S=h();S.includes(k.file)||x([...S,k.file]);const O=_=>{if(D!==r)return;const M=n;if(!M)return;const F=M.querySelector(`[data-comment-id="${k.id}"]`),Z=F instanceof HTMLElement&&F.style.pointerEvents!=="none"&&F.style.opacity!=="0",B=Z?F:o.get(k.file);if(!B){if(_>=120)return;requestAnimationFrame(()=>O(_+1));return}const W=M.getBoundingClientRect(),ee=B.getBoundingClientRect(),Se=ee.top-W.top,X=M.scrollTop+Se-W.height/2+ee.height/2;M.scrollTop=Math.max(0,X),!Z&&(_>=120||requestAnimationFrame(()=>O(_+1)))};requestAnimationFrame(()=>O(0)),requestAnimationFrame(()=>e.onFocusedCommentChange?.(null))}),(()=>{var k=kb(),D=k.firstChild,I=D.firstChild,S=I.nextSibling,O=D.nextSibling;return ln(k,"scroll",e.onScroll),ut(_=>{n=_,e.scrollRef?.(_)},k),d(I,()=>e.title??i.t("ui.sessionReview.title")),d(S,s(P,{get when(){return se(()=>!!b())()&&e.onDiffStyleChange},get children(){return s(yb,{options:["unified","split"],get current(){return v()},value:_=>_,label:_=>i.t(_==="unified"?"ui.sessionReview.diffStyle.unified":"ui.sessionReview.diffStyle.split"),onSelect:_=>_&&e.onDiffStyleChange?.(_)})}}),null),d(S,s(P,{get when(){return b()},get children(){return s(Ue,{size:"normal",icon:"chevron-grabber-vertical",onClick:R,get children(){return s(bt,{get children(){return[s(De,{get when(){return h().length>0},get children(){return i.t("ui.sessionReview.collapseAll")}}),s(De,{when:!0,get children(){return i.t("ui.sessionReview.expandAll")}})]}})}})}}),null),d(S,()=>e.actions,null),d(O,s(P,{get when(){return b()},get fallback(){return e.empty},get children(){return s(Tn,{multiple:!0,get value(){return h()},onChange:x,get children(){return s(Ge,{get each(){return e.diffs},children:_=>{let M;const F=w(()=>(e.comments??[]).filter(Q=>Q.file===_.file)),Z=w(()=>F().map(Q=>Q.selection)),B=()=>typeof _.before=="string"?_.before:"",W=()=>typeof _.after=="string"?_.after:"",ee=()=>_.before===void 0||B().length===0&&W().length>0,Se=()=>_.after===void 0||W().length===0&&B().length>0,X=()=>Ub(_.file),ne=()=>Lb(_.file),ce=Ni(_.after)??Ni(_.before),[fe,me]=ze(ce),[V,z]=ze("idle"),H=Ni(_.after)??Ni(_.before),[$e,te]=ze(H),[he,C]=ze("idle"),[q,ie]=ze(void 0),_e=w(()=>{const Q=u();return!Q||Q.file!==_.file?null:Q.range}),ge=w(()=>{const Q=m();return!Q||Q.file!==_.file?null:Q.range}),[Ae,We]=ze(""),[mt,yt]=ze({}),[kt,dt]=ze(void 0),G=()=>{const Q=M;if(!Q)return;const we=Q.querySelector("diffs-container");if(we instanceof HTMLElement)return we.shadowRoot??void 0},ue=()=>{const Q=M;if(!Q)return;const we=G();if(!we)return;const Re={};for(const Ke of F()){const Et=ac(we,Ke.selection);Et&&(Re[Ke.id]=sc(Q,Et))}yt(Re);const je=ge();if(!je){dt(void 0);return}const pt=ac(we,je);if(!pt){dt(void 0);return}dt(sc(Q,pt))},ye=()=>{requestAnimationFrame(ue)};re(()=>{F(),ye()}),re(()=>{ge()&&(We(""),ye())}),re(()=>{if(!h().includes(_.file)||!X()||fe()||V()!=="idle"||Se())return;const Q=e.readFile;Q&&(z("loading"),Q(_.file).then(we=>{const Re=oc(we);if(!Re){z("error");return}me(Re),z("idle")}).catch(()=>{z("error")}))}),re(()=>{if(!h().includes(_.file)||!ne()||$e()||he()!=="idle")return;const Q=e.readFile;Q&&(C("loading"),Q(_.file).then(we=>{const Re=oc(we);if(!Re){C("error");return}ie(Pa(we?.mimeType)),te(Re),C("idle")}).catch(()=>{C("error")}))});const ke=Q=>{if(e.onLineComment){if(!Q){c(null);return}c({file:_.file,range:Q})}},Pe=Q=>{if(e.onLineComment){if(!Q){f(null);return}c({file:_.file,range:Q}),f({file:_.file,range:Q})}},He=Q=>{p({file:Q.file,id:Q.id}),c({file:Q.file,range:Q.selection})},et=Q=>{const we=g();return we?we.file===Q.file&&we.id===Q.id:!1};return s(Tn.Item,{get value(){return _.file},get id(){return Rb(_.file)},get"data-file"(){return _.file},"data-slot":"session-review-accordion-item",get"data-selected"(){return e.focusedFile===_.file?"":void 0},get children(){return[s(Mu,{get children(){return s(Tn.Trigger,{get children(){var Q=zb(),we=Q.firstChild,Re=we.firstChild,je=Re.firstChild,pt=we.nextSibling;return d(we,s(Tr,{get node(){return{path:_.file,type:"file"}}}),Re),d(Re,s(P,{get when(){return _.file.includes("/")},get children(){var Ke=Sb();return d(Ke,()=>`${Cr(_.file)}`),Ke}}),je),d(je,()=>Tt(_.file)),d(Re,s(P,{get when(){return e.onViewFile},get children(){var Ke=Ib();return Ke.$$click=Et=>{Et.stopPropagation(),e.onViewFile?.(_.file)},d(Ke,s(Be,{name:"eye",size:"small"})),Ke}}),null),d(pt,s(bt,{get children(){return[s(De,{get when(){return ee()},get children(){var Ke=Tb();return d(Ke,()=>i.t("ui.sessionReview.change.added")),Ke}}),s(De,{get when(){return Se()},get children(){var Ke=Cb();return d(Ke,()=>i.t("ui.sessionReview.change.removed")),Ke}}),s(De,{get when(){return X()},get children(){var Ke=Db();return d(Ke,()=>i.t("ui.sessionReview.change.modified")),Ke}}),s(De,{when:!0,get children(){return s(Sa,{changes:_})}})]}}),null),d(pt,s(Be,{name:"chevron-grabber-vertical",size:"small"}),null),Q}})}}),s(Tn.Content,{"data-slot":"session-review-accordion-content",get children(){var Q=Pb();return ut(we=>{M=we,o.set(_.file,we),ye()},Q),d(Q,s(bt,{get children(){return[s(De,{get when(){return se(()=>!!X())()&&fe()},get children(){var we=Eb(),Re=we.firstChild;return be(je=>{var pt=fe(),Ke=_.file;return pt!==je.e&&Te(Re,"src",je.e=pt),Ke!==je.t&&Te(Re,"alt",je.t=Ke),je},{e:void 0,t:void 0}),we}}),s(De,{get when(){return se(()=>!!X())()&&Se()},get children(){var we=Ob(),Re=we.firstChild;return d(Re,()=>i.t("ui.sessionReview.change.removed")),we}}),s(De,{get when(){return se(()=>!!X())()&&!fe()},get children(){var we=Ab(),Re=we.firstChild;return d(Re,()=>V()==="loading"?"Loading...":"Image"),we}}),s(De,{get when(){return!X()},get children(){return s(zn,{component:t,get preloadedDiff(){return _.preloaded},get diffStyle(){return v()},onRendered:()=>{e.onDiffRendered?.(),ye()},get enableLineSelection(){return e.onLineComment!=null},onLineSelected:ke,onLineSelectionEnd:Pe,get selectedLines(){return _e()},get commentedLines(){return Z()},get before(){return{name:_.file,contents:typeof _.before=="string"?_.before:""}},get after(){return{name:_.file,contents:typeof _.after=="string"?_.after:""}}})}})]}}),null),d(Q,s(Ge,{get each(){return F()},children:we=>s(nd,{get id(){return we.id},get top(){return mt()[we.id]},onMouseEnter:()=>c({file:we.file,range:we.selection}),onClick:()=>{if(et(we)){p(null);return}He(we)},get open(){return et(we)},get comment(){return we.comment},get selection(){return U(we.selection)}})}),null),d(Q,s(P,{get when(){return ge()},children:we=>s(P,{get when(){return kt()!==void 0},get children(){return s(rd,{get top(){return kt()},get value(){return Ae()},get selection(){return U(we())},onInput:We,onCancel:()=>f(null),onSubmit:Re=>{e.onLineComment?.({file:_.file,selection:we(),comment:Re,preview:N(_,we())}),f(null)}})}})}),null),Q}})]}})}})}})}})),be(_=>{var M={...e.classList??{},[e.classes?.root??""]:!!e.classes?.root,[e.class??""]:!!e.class},F={[e.classes?.header??""]:!!e.classes?.header},Z={[e.classes?.container??""]:!!e.classes?.container};return _.e=ct(k,M,_.e),_.t=ct(D,F,_.t),_.a=ct(O,Z,_.a),_},{e:void 0,t:void 0,a:void 0}),k})()};Ut(["click"]);var Zb=$('<div class="bg-background-base h-full shrink-0 sticky right-0 z-10 flex items-center justify-center border-b border-border-weak-base px-3">');function Bb(e){const[n,r]=ze(!1);let i;return re(()=>{const t=i;if(!t)return;const o=t.parentElement;if(!o)return;const a=()=>{const u=t.getBoundingClientRect(),c=o.getBoundingClientRect();r(u.right>=c.right&&o.scrollWidth>o.clientWidth)};o.addEventListener("scroll",a,{passive:!0});const l=new ResizeObserver(a);l.observe(o),a(),rt(()=>{o.removeEventListener("scroll",a),l.disconnect()})}),(()=>{var t=Zb(),o=i;return typeof o=="function"?ut(o,t):i=t,d(t,()=>e.children),be(()=>t.classList.toggle("border-l",!!n())),t})()}function lc(e){let n,r,i;const t=Dn(),o=async u=>t.client.file.read({path:u}).then(c=>c.data).catch(()=>{}),a=()=>{const u=n;if(!u)return;const c=e.view().scroll("review");c&&(u.scrollTop!==c.y&&(u.scrollTop=c.y),u.scrollLeft!==c.x&&(u.scrollLeft=c.x))},l=u=>{i={x:u.currentTarget.scrollLeft,y:u.currentTarget.scrollTop},r===void 0&&(r=requestAnimationFrame(()=>{r=void 0;const c=i;i=void 0,c&&e.view().setScroll("review",c)}))};return re(ot(()=>e.diffs().length,()=>{requestAnimationFrame(a)},{defer:!0})),rt(()=>{r!==void 0&&cancelAnimationFrame(r)}),s(Fb,{get title(){return e.title},get empty(){return e.empty},scrollRef:u=>{n=u,e.onScrollRef?.(u),a()},onScroll:l,onDiffRendered:()=>requestAnimationFrame(a),get open(){return e.view().review.open()},get onOpenChange(){return e.view().review.setOpen},get classes(){return{root:e.classes?.root??"pb-40",header:e.classes?.header??"px-6",container:e.classes?.container??"px-6"}},get diffs(){return e.diffs()},get diffStyle(){return e.diffStyle},get onDiffStyleChange(){return e.onDiffStyleChange},get onViewFile(){return e.onViewFile},get focusedFile(){return e.focusedFile},readFile:o,get onLineComment(){return e.onLineComment},get comments(){return e.comments},get focusedComment(){return e.focusedComment},get onFocusedCommentChange(){return e.onFocusedCommentChange}})}const aa=e=>typeof e=="object"&&e!==null,Ko=e=>!(!aa(e)||typeof e.length!="number"||typeof e.cursorX!="number"||typeof e.cursorY!="number"||typeof e.baseY!="number"||typeof e.viewportY!="number"||typeof e.getLine!="function"||typeof e.getNullCell!="function"),cc=e=>{if(!aa(e))return;const n=e.buffer;if(!aa(n))return;const r=Ko(n.active)?n.active:void 0,i=Ko(n.normal)?n.normal:void 0,t=Ko(n.alternate)?n.alternate:void 0;if(!(!r&&!i))return{active:r,normal:i,alternate:t}};function sa(e,n,r){return Math.max(n,Math.min(e,r))}function Wb(e,n){return e.getFgColorMode()===n.getFgColorMode()&&e.getFgColor()===n.getFgColor()}function qb(e,n){return e.getBgColorMode()===n.getBgColorMode()&&e.getBgColor()===n.getBgColor()}function Hb(e,n){return!!e.isInverse()==!!n.isInverse()&&!!e.isBold()==!!n.isBold()&&!!e.isUnderline()==!!n.isUnderline()&&!!e.isBlink()==!!n.isBlink()&&!!e.isInvisible()==!!n.isInvisible()&&!!e.isItalic()==!!n.isItalic()&&!!e.isDim()==!!n.isDim()&&!!e.isStrikethrough()==!!n.isStrikethrough()}class Gb{constructor(n){this._buffer=n}serialize(n,r){let i=this._buffer.getNullCell();const t=n.start.y,o=n.end.y,a=n.start.x,l=n.end.x;this._beforeSerialize(o-t+1,t,o);for(let u=t;u<=o;u++){const c=this._buffer.getLine(u);if(c){const m=u===n.start.y?a:0,f=Math.min(l,c.length);for(let g=m;g<f;g++){const p=c.getCell(g);p&&(this._nextCell(p,i,u,g),i=p)}}this._rowEnd(u,u===o)}return this._afterSerialize(),this._serializeString(r)}_nextCell(n,r,i,t){}_rowEnd(n,r){}_beforeSerialize(n,r,i){}_afterSerialize(){}_serializeString(n){return""}}class Kb extends Gb{constructor(n,r){super(n),this._terminal=r,this._cursorStyle=this._buffer.getNullCell()}_rowIndex=0;_allRows=[];_allRowSeparators=[];_currentRow="";_nullCellCount=0;_cursorStyle;_firstRow=0;_lastCursorRow=0;_lastCursorCol=0;_lastContentCursorRow=0;_lastContentCursorCol=0;_beforeSerialize(n,r,i){this._allRows=new Array(n),this._allRowSeparators=new Array(n),this._rowIndex=0,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._lastContentCursorRow=r,this._lastCursorRow=r,this._firstRow=r}_rowEnd(n,r){let i="";const o=!!(r?void 0:this._buffer.getLine(n+1))?.isWrapped;this._nullCellCount>0&&o&&(this._currentRow+=" ".repeat(this._nullCellCount)),this._nullCellCount=0,!r&&!o&&(i=`\r
|
|
6
|
+
`,this._lastCursorRow=n+1,this._lastCursorCol=0),this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=i,this._currentRow="",this._nullCellCount=0}_diffStyle(n,r){const i=[],t=!Wb(n,r),o=!qb(n,r),a=!Hb(n,r);if(t||o||a)if(this._isAttributeDefault(n))this._isAttributeDefault(r)||i.push(0);else{if(a&&(!!n.isInverse()!=!!r.isInverse()&&i.push(n.isInverse()?7:27),!!n.isBold()!=!!r.isBold()&&i.push(n.isBold()?1:22),!!n.isUnderline()!=!!r.isUnderline()&&i.push(n.isUnderline()?4:24),!!n.isBlink()!=!!r.isBlink()&&i.push(n.isBlink()?5:25),!!n.isInvisible()!=!!r.isInvisible()&&i.push(n.isInvisible()?8:28),!!n.isItalic()!=!!r.isItalic()&&i.push(n.isItalic()?3:23),!!n.isDim()!=!!r.isDim()&&i.push(n.isDim()?2:22),!!n.isStrikethrough()!=!!r.isStrikethrough()&&i.push(n.isStrikethrough()?9:29)),t){const l=n.getFgColor(),u=n.getFgColorMode();u===2||u===3||u===-1?i.push(38,2,l>>>16&255,l>>>8&255,l&255):u===1?l>=16?i.push(38,5,l):i.push(l&8?90+(l&7):30+(l&7)):i.push(39)}if(o){const l=n.getBgColor(),u=n.getBgColorMode();u===2||u===3||u===-1?i.push(48,2,l>>>16&255,l>>>8&255,l&255):u===1?l>=16?i.push(48,5,l):i.push(l&8?100+(l&7):40+(l&7)):i.push(49)}}return i}_isAttributeDefault(n){const r=n.getFgColorMode(),i=n.getBgColorMode();if(r===0&&i===0)return!n.isBold()&&!n.isItalic()&&!n.isUnderline()&&!n.isBlink()&&!n.isInverse()&&!n.isInvisible()&&!n.isDim()&&!n.isStrikethrough();const t=n.getFgColor(),o=n.getBgColor(),a=this._buffer.getNullCell(),l=a.getFgColor(),u=a.getBgColor();return t===l&&o===u&&!n.isBold()&&!n.isItalic()&&!n.isUnderline()&&!n.isBlink()&&!n.isInverse()&&!n.isInvisible()&&!n.isDim()&&!n.isStrikethrough()}_nextCell(n,r,i,t){if(n.getWidth()===0)return;const a=n.getCode(),u=a>1114111||a>=55296&&a<=57343||a>=61440&&n.getWidth()===1,c=a===0||n.getChars()===""||u,m=this._diffStyle(n,this._cursorStyle);if(m.length>0){this._nullCellCount>0&&(this._currentRow+=" ".repeat(this._nullCellCount),this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=i,this._lastContentCursorCol=this._lastCursorCol=t,this._currentRow+=`\x1B[${m.join(";")}m`;const p=this._buffer.getLine(i)?.getCell(t);p&&(this._cursorStyle=p)}c?this._nullCellCount+=n.getWidth():(this._nullCellCount>0&&(this._currentRow+=" ".repeat(this._nullCellCount),this._nullCellCount=0),this._currentRow+=n.getChars(),this._lastContentCursorRow=this._lastCursorRow=i,this._lastContentCursorCol=this._lastCursorCol=t+n.getWidth())}_serializeString(n){let r=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(r=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let i="";for(let f=0;f<r;f++)i+=this._allRows[f],f+1<r&&(i+=this._allRowSeparators[f]);if(n)return i;const t=(this._buffer.baseY??0)+this._buffer.cursorY,o=sa(t-this._firstRow+1,1,Number.MAX_SAFE_INTEGER),a=this._buffer.cursorX+1;i+=`\x1B[${o};${a}H`;const l=this._buffer.getLine(t),u=l?.getCell(this._buffer.cursorX),c=u?u.getWidth()!==0?u:this._buffer.cursorX>0?l?.getCell(this._buffer.cursorX-1)??u:u:this._buffer.getNullCell(),m=this._diffStyle(c,this._cursorStyle);return m.length&&(i+=`\x1B[${m.join(";")}m`),i}}class Vb{_terminal;activate(n){this._terminal=n}dispose(){this._terminal=void 0}serialize(n){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const r=cc(this._terminal);if(!r)return"";const i=r.normal??r.active,t=r.alternate;if(!i)return"";let o=n?.range?this._serializeBufferByRange(i,n.range,!0):this._serializeBufferByScrollback(i,n?.scrollback);if(!n?.excludeAltBuffer&&r.active?.type==="alternate"&&t){const a=this._serializeBufferByScrollback(t,void 0);o+=`\x1B[?1049h\x1B[H${a}`}return o}serializeAsText(n){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const r=cc(this._terminal);if(!r)return"";const i=r.active??r.normal;if(!i)return"";const t=i.length,o=n?.scrollback,a=o===void 0?t:sa(o+this._terminal.rows,0,t),l=t-a,u=t-1,c=[];for(let m=l;m<=u;m++){const f=i.getLine(m);if(f){const g=f.translateToString(n?.trimWhitespace??!0);c.push(g)}}if(n?.trimWhitespace)for(;c.length>0&&c[c.length-1]==="";)c.pop();return c.join(`
|
|
7
|
+
`)}_serializeBufferByScrollback(n,r){const i=n.length,t=this._terminal?.rows??24,o=r===void 0?i:sa(r+t,0,i);return this._serializeBufferByRange(n,{start:i-o,end:i-1},!1)}_serializeBufferByRange(n,r,i){const t=new Kb(n,this._terminal),o=this._terminal?.cols??80;return t.serialize({start:{x:0,y:r.start},end:{x:o,y:r.end}},i)}}const Gi=e=>typeof e=="object"&&e!==null,Jb=e=>Gi(e)&&typeof e.dispose=="function",ji=e=>{Jb(e)&&e.dispose()},Xb=e=>Gi(e)&&typeof e.setOption=="function",uc=(e,n,r)=>{Xb(e)&&e.setOption(n,r)},Yb=e=>{if(!Gi(e))return;const n=e.currentHoveredLink;if(Gi(n)&&typeof n.text=="string")return n.text};var Qb=$("<div data-component=terminal data-prevent-autofocus tabindex=-1>");const ey="terminal.toggle",ty="ctrl+`";let qr;const ny=()=>qr||(qr=Kp(()=>import("./ghostty-web-CsYhFgbJ.js"),__vite__mapDeps([0,1,2])).then(async e=>({mod:e,ghostty:await e.Ghostty.load()})).catch(e=>{throw qr=void 0,e}),qr),ry={light:{background:"#fcfcfc",foreground:"#211e1e",cursor:"#211e1e",selectionBackground:ta("#211e1e",.2)},dark:{background:"#191515",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:ta("#d4d4d4",.25)}},iy=e=>{const n=oo(),r=Dn(),i=Bp(),t=Wp(),o=wt();let a;const[l,u]=Ve(e,["pty","class","classList","onConnect","onConnectError"]);let c,m,f,g,p,h=!1;const v=[];let b=l.pty.tail??"";const x=()=>{if(!v.length)return;const I=v.splice(0).reverse();for(const S of I)try{S()}catch{}},R=()=>{const I=t.mode(),S=ry[I],O=t.themes()[t.themeId()];if(!O)return S;const _=I==="dark"?O.dark:O.light;if(!_?.seeds)return S;const M=Gp(_,I==="dark"),F=M["text-stronger"]??S.foreground,Z=M["background-stronger"]??S.background,B=I==="dark"?.25:.2,W=F.startsWith("#")?F:S.foreground,ee=ta(W,B);return{background:Z,foreground:F,cursor:F,selectionBackground:ee}},[U,A]=ze(R());re(()=>{const I=R();A(I),c&&uc(c,"theme",I)}),re(()=>{const I=Tl(i.appearance.font());c&&uc(c,"fontFamily",I)});const N=()=>{const I=c;I&&(I.focus(),setTimeout(()=>I.textarea?.focus(),0))},k=()=>{const I=document.activeElement;I instanceof HTMLElement&&I!==a&&I.blur(),N()},D=I=>{if(!I.shiftKey&&!I.ctrlKey&&!I.metaKey||I.altKey||I.button!==0)return;const S=c;if(!S)return;const O=Yb(S);O&&(I.preventDefault(),I.stopImmediatePropagation(),n.openLink(O))};return lo(()=>{(async()=>{const S=await ny();if(h)return;const O=S.mod,_=S.ghostty,M={value:!1},F=new URL(r.url+`/pty/${l.pty.id}/connect?directory=${encodeURIComponent(r.directory)}`);F.protocol=F.protocol==="https:"?"wss:":"ws:",window.__NIKCLI__?.serverPassword&&(F.username="nikcli",F.password=window.__NIKCLI__?.serverPassword);const Z=new WebSocket(F);if(v.push(()=>{Z.readyState!==WebSocket.CLOSED&&Z.readyState!==WebSocket.CLOSING&&Z.close()}),h){x();return}const B=new O.Terminal({cursorBlink:!0,cursorStyle:"bar",fontSize:14,fontFamily:Tl(i.appearance.font()),allowTransparency:!0,convertEol:!0,theme:U(),scrollback:1e4,ghostty:_});if(v.push(()=>B.dispose()),h){x();return}c=B;const W=()=>{const ge=B.getSelection();if(!ge)return!1;const Ae=document.body;if(Ae){const mt=document.createElement("textarea");mt.value=ge,mt.setAttribute("readonly",""),mt.style.position="fixed",mt.style.opacity="0",Ae.appendChild(mt),mt.select();const yt=document.execCommand("copy");if(Ae.removeChild(mt),yt)return!0}const We=navigator.clipboard;return We?.writeText?(We.writeText(ge).catch(()=>{}),!0):!1};B.attachCustomKeyEventHandler(ge=>{const Ae=ge.key.toLowerCase();if(ge.ctrlKey&&ge.shiftKey&&!ge.metaKey&&Ae==="c")return W(),!0;if(ge.metaKey&&!ge.ctrlKey&&!ge.altKey&&Ae==="c")return B.hasSelection()&&W(),!0;const We=i.keybinds.get(ey)??ty,mt=qp(We);return Hp(mt,ge)});const ee=new O.FitAddon,Se=new Vb;v.push(()=>ji(ee)),B.loadAddon(Se),B.loadAddon(ee),m=Se,B.open(a),a.addEventListener("pointerdown",k),v.push(()=>a.removeEventListener("pointerdown",k)),a.addEventListener("click",D,{capture:!0}),v.push(()=>a.removeEventListener("click",D,{capture:!0})),g=()=>{B.options.cursorBlink=!0},p=()=>{B.options.cursorBlink=!1},B.textarea?.addEventListener("focus",g),B.textarea?.addEventListener("blur",p),v.push(()=>B.textarea?.removeEventListener("focus",g)),v.push(()=>B.textarea?.removeEventListener("blur",p)),N(),ee.fit(),l.pty.buffer&&B.write(l.pty.buffer,()=>{l.pty.scrollY&&B.scrollToLine(l.pty.scrollY)}),ee.observeResize(),f=()=>ee.fit(),window.addEventListener("resize",f),v.push(()=>window.removeEventListener("resize",f));const X=16384,ne=32,ce=750,fe=b.length>X?b.slice(-X):b;let me=fe.length>=ne,V=0;const z=()=>{me=!1,V=0},H=ge=>{if(!fe)return 0;const Ae=Math.min(fe.length,ge.length);if(Ae<ne)return 0;for(let We=Ae;We>=ne;We--)if(fe.slice(-We)===ge.slice(0,We))return We;return 0},$e=B.onResize(async ge=>{Z.readyState===WebSocket.OPEN&&await r.client.pty.update({ptyID:l.pty.id,size:{cols:ge.cols,rows:ge.rows}}).catch(()=>{})});v.push(()=>ji($e));const te=B.onData(ge=>{ge&&z(),Z.readyState===WebSocket.OPEN&&Z.send(ge)});v.push(()=>ji(te));const he=B.onKey(ge=>{ge.key=="Enter"&&e.onSubmit?.()});v.push(()=>ji(he));const C=()=>{l.onConnect?.(),me&&(V=Date.now()+ce),r.client.pty.update({ptyID:l.pty.id,size:{cols:B.cols,rows:B.rows}}).catch(()=>{})};Z.addEventListener("open",C),v.push(()=>Z.removeEventListener("open",C));const q=ge=>{if(h)return;const Ae=typeof ge.data=="string"?ge.data:"";if(!Ae)return;const We=(()=>{if(!me)return Ae;if(V&&Date.now()>V)return z(),Ae;const mt=H(Ae);if(!mt)return z(),Ae;const yt=Ae.slice(mt);return yt&&z(),yt})();We&&(B.write(We),b=We.length>=X?We.slice(-X):(b+We).slice(-X))};Z.addEventListener("message",q),v.push(()=>Z.removeEventListener("message",q));const ie=ge=>{h||M.value||(M.value=!0,console.error("WebSocket error:",ge),l.onConnectError?.(ge))};Z.addEventListener("error",ie),v.push(()=>Z.removeEventListener("error",ie));const _e=ge=>{if(!h&&ge.code!==1e3){if(M.value)return;M.value=!0,l.onConnectError?.(new Error(`WebSocket closed abnormally: ${ge.code}`))}};Z.addEventListener("close",_e),v.push(()=>Z.removeEventListener("close",_e))})().catch(S=>{h||(lt({variant:"error",title:o.t("terminal.connectionLost.title"),description:S instanceof Error?S.message:o.t("terminal.connectionLost.description")}),l.onConnectError?.(S))})}),rt(()=>{h=!0;const I=c;if(m&&e.onCleanup&&I){const S=(()=>{try{return m.serialize()}catch{return""}})();e.onCleanup({...l.pty,buffer:S,tail:b,rows:I.rows,cols:I.cols,scrollY:I.getViewportY()})}x()}),(()=>{var I=Qb(),S=a;return typeof S=="function"?ut(S,I):a=I,ii(I,Ce({get style(){return{"background-color":U().background}},get classList(){return{...l.classList??{},"select-text":!0,"size-full px-6 py-3 font-mono":!0,[l.class??""]:!!l.class}}},u),!1,!1),I})()},od=e=>{const n=e.title??"",r=e.titleNumber??0,i=n.match(/^Terminal (\d+)$/),t=i?Number(i[1]):void 0,o=Number.isFinite(r)&&r>0&&Number.isFinite(t)&&t===r;return n&&!o?n:r>0?e.t("terminal.title.numbered",{number:r}):n||e.t("terminal.title")};var oy=$('<div class="h-full flex items-center justify-center">'),ay=$('<div class="flex flex-col h-full"><div class="flex-1 min-h-0 relative">'),sy=$('<div id=terminal-panel role=region class="relative w-full flex flex-col shrink-0 border-t border-border-weak-base">'),ly=$('<div class="flex flex-col h-full pointer-events-none"><div class="h-10 flex items-center gap-2 px-2 border-b border-border-weak-base bg-background-stronger overflow-hidden"><div class=flex-1></div><div class="text-text-weak pr-2"></div></div><div class="flex-1 flex items-center justify-center text-text-weak">'),cy=$('<div class="px-2 py-1 rounded-md bg-surface-base text-14-regular text-text-weak truncate max-w-40">'),uy=$('<div class="absolute inset-0">'),dy=$('<div class="relative p-1 h-10 flex items-center bg-background-stronger text-14-regular">');function fy(e){return s(P,{get when(){return e.open},get children(){var n=sy();return d(n,s(Ia,{direction:"vertical",get size(){return e.height},min:100,get max(){return window.innerHeight*.6},collapseThreshold:50,get onResize(){return e.resize},get onCollapse(){return e.close}}),null),d(n,s(P,{get when(){return e.terminal.ready()},get fallback(){return(()=>{var r=ly(),i=r.firstChild,t=i.firstChild,o=t.nextSibling,a=i.nextSibling;return d(i,s(Ge,{get each(){return e.handoff()},children:l=>(()=>{var u=cy();return d(u,l),u})()}),t),d(o,()=>e.language.t("common.loading"),null),d(o,()=>e.language.t("common.loading.ellipsis"),null),d(a,()=>e.language.t("terminal.loading")),r})()},get children(){return s(lu,{get onDragStart(){return e.handleTerminalDragStart},get onDragEnd(){return e.handleTerminalDragEnd},get onDragOver(){return e.handleTerminalDragOver},collisionDetector:cu,get children(){return[s(uu,{}),s(du,{}),(()=>{var r=ay(),i=r.firstChild;return d(r,s(it,{variant:"alt",get value(){return e.terminal.active()},onChange:t=>e.terminal.open(t),class:"!h-auto !flex-none",get children(){return s(it.List,{class:"h-10",get children(){return[s(fu,{get ids(){return e.terminal.all().map(t=>t.id)},get children(){return s(Ge,{get each(){return e.terminal.all()},children:t=>s(ib,{terminal:t,onClose:()=>{e.close(),e.onCloseTab()}})})}}),(()=>{var t=oy();return d(t,s(mn,{get title(){return e.language.t("command.terminal.new")},get keybind(){return e.command.keybind("terminal.new")},class:"flex items-center",get children(){return s(zt,{icon:"plus-small",variant:"ghost",iconSize:"large",get onClick(){return e.terminal.new},get"aria-label"(){return e.language.t("command.terminal.new")}})}})),t})()]}})}}),i),d(i,s(Ge,{get each(){return e.terminal.all()},children:t=>(()=>{var o=uy();return d(o,s(P,{get when(){return t.id},keyed:!0,get children(){return s(iy,{pty:t,get onCleanup(){return e.terminal.update},onConnectError:()=>e.terminal.clone(t.id)})}})),be(a=>{var l=`terminal-wrapper-${t.id}`,u=e.terminal.active()===t.id?"block":"none";return l!==a.e&&Te(o,"id",a.e=l),u!==a.t&&Xt(o,"display",a.t=u),a},{e:void 0,t:void 0}),o})()})),r})(),s(mu,{get children(){return s(P,{get when(){return e.activeTerminalDraggable()},children:r=>{const i=w(()=>e.terminal.all().find(t=>t.id===r()));return s(P,{get when(){return i()},children:t=>(()=>{var o=dy();return d(o,()=>od({title:t().title,titleNumber:t().titleNumber,t:e.language.t})),o})()})}})}})]}})}}),null),be(r=>{var i=e.language.t("terminal.title"),t=`${e.height}px`;return i!==r.e&&Te(n,"aria-label",r.e=i),t!==r.t&&Xt(n,"height",r.t=t),r},{e:void 0,t:void 0}),n}})}function my({onlyFirst:e=!1}={}){const t="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(t,e?void 0:"g")}const gy=my();function hy(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(gy,"")}var py=$("<div data-component=tool-trigger><div data-slot=basic-tool-tool-trigger-content><div data-slot=basic-tool-tool-info>"),vy=$("<span data-slot=basic-tool-tool-subtitle>"),by=$("<div data-slot=basic-tool-tool-info-structured><div data-slot=basic-tool-tool-info-main><span data-slot=basic-tool-tool-title>"),yy=$("<span data-slot=basic-tool-tool-arg>");const $y=e=>typeof e=="object"&&e!==null&&"title"in e&&(typeof Node>"u"||!(e instanceof Node));function jt(e){const[n,r]=ze(e.defaultOpen??!1);return re(()=>{e.forceOpen&&r(!0)}),s(Jn,{get open(){return n()},onOpenChange:t=>{e.locked&&!t||r(t)},get children(){return[s(Jn.Trigger,{get children(){var t=py(),o=t.firstChild,a=o.firstChild;return d(o,s(Be,{get name(){return e.icon},size:"small"}),a),d(a,s(bt,{get children(){return[s(De,{get when(){return se(()=>!!$y(e.trigger))()&&e.trigger},children:l=>(()=>{var u=by(),c=u.firstChild,m=c.firstChild;return d(m,()=>l().title),d(c,s(P,{get when(){return l().subtitle},get children(){var f=vy();return f.$$click=g=>{e.onSubtitleClick&&(g.stopPropagation(),e.onSubtitleClick())},d(f,()=>l().subtitle),be(g=>ct(f,{[l().subtitleClass??""]:!!l().subtitleClass,clickable:!!e.onSubtitleClick},g)),f}}),null),d(c,s(P,{get when(){return l().args?.length},get children(){return s(Ge,{get each(){return l().args},children:f=>(()=>{var g=yy();return d(g,f),be(p=>ct(g,{[l().argsClass??""]:!!l().argsClass},p)),g})()})}}),null),d(u,s(P,{get when(){return l().action},get children(){return l().action}}),null),be(f=>ct(m,{[l().titleClass??""]:!!l().titleClass},f)),u})()}),s(De,{when:!0,get children(){return e.trigger}})]}})),d(t,s(P,{get when(){return se(()=>!!(e.children&&!e.hideDetails))()&&!e.locked},get children(){return s(Jn.Arrow,{})}}),null),t}}),s(P,{get when(){return se(()=>!!e.children)()&&!e.hideDetails},get children(){return s(Jn.Content,{get children(){return e.children}})}})]}})}function ad(e){return s(jt,{icon:"mcp",get trigger(){return{title:e.tool}},get hideDetails(){return e.hideDetails}})}Ut(["click"]);var _y=$("<div>");function la(e){const[n,r]=Ve(e,["variant","class","classList"]);return(()=>{var i=_y();return ii(i,Ce(r,{"data-component":"card",get"data-variant"(){return n.variant||"normal"},get classList(){return{...n.classList??{},[n.class??""]:!!n.class}}}),!1,!0),d(i,()=>e.children),i})()}var wy={};io(wy,{Checkbox:()=>Rn,Control:()=>ld,Description:()=>cd,ErrorMessage:()=>ud,Indicator:()=>dd,Input:()=>fd,Label:()=>md,Root:()=>gd,useCheckboxContext:()=>lr});var sd=or();function lr(){const e=ar(sd);if(e===void 0)throw new Error("[kobalte]: `useCheckboxContext` must be used within a `Checkbox` component");return e}function ld(e){const n=ui(),r=lr(),i=Ct({id:r.generateId("control")},e),[t,o]=Ve(i,["onClick","onKeyDown"]);return s(At,Ce({as:"div",onClick:u=>{Ot(u,t.onClick),r.toggle(),r.inputRef()?.focus()},onKeyDown:u=>{Ot(u,t.onKeyDown),u.key===ru.Space&&(r.toggle(),r.inputRef()?.focus())}},()=>n.dataset(),()=>r.dataset(),o))}function cd(e){const n=lr();return s(so,Ce(()=>n.dataset(),e))}function ud(e){const n=lr();return s(ao,Ce(()=>n.dataset(),e))}function dd(e){const n=ui(),r=lr(),[i,t]=ze(),o=Ct({id:r.generateId("indicator")},e),[a,l]=Ve(o,["ref","forceMount"]),{present:u}=$a({show:()=>a.forceMount||r.indeterminate()||r.checked(),element:()=>i()??null});return s(P,{get when(){return u()},get children(){return s(At,Ce({as:"div",ref(c){var m=Gt(t,a.ref);typeof m=="function"&&m(c)}},()=>n.dataset(),()=>r.dataset(),l))}})}function fd(e){let n;const r=ui(),i=lr(),t=Ct({id:i.generateId("input")},e),[o,a,l]=Ve(t,["ref","style","onChange","onFocus","onBlur"],Jp),{fieldProps:u}=Xp(a),[c,m]=ze(!1),f=h=>{if(Ot(h,o.onChange),h.stopPropagation(),!c()){const v=h.target;i.setIsChecked(v.checked),v.checked=i.checked()}m(!1)},g=h=>{Ot(h,o.onFocus),i.setIsFocused(!0)},p=h=>{Ot(h,o.onBlur),i.setIsFocused(!1)};return re(ot([()=>i.checked(),()=>i.value()],()=>{m(!0),n?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),n?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},{defer:!0})),re(ot([()=>n,()=>i.indeterminate(),()=>i.checked()],([h,v])=>{h&&(h.indeterminate=v)})),s(At,Ce({as:"input",ref(h){var v=Gt(b=>{i.setInputRef(b),n=b},o.ref);typeof v=="function"&&v(h)},type:"checkbox",get id(){return u.id()},get name(){return r.name()},get value(){return i.value()},get checked(){return i.checked()},get required(){return r.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return r.isReadOnly()},get style(){return oi(su,o.style)},get"aria-label"(){return u.ariaLabel()},get"aria-labelledby"(){return u.ariaLabelledBy()},get"aria-describedby"(){return u.ariaDescribedBy()},get"aria-invalid"(){return r.validationState()==="invalid"||void 0},get"aria-required"(){return r.isRequired()},get"aria-disabled"(){return r.isDisabled()},get"aria-readonly"(){return r.isReadOnly()},onChange:f,onFocus:g,onBlur:p},()=>r.dataset(),()=>i.dataset(),l))}function md(e){const n=lr();return s(nu,Ce(()=>n.dataset(),e))}function gd(e){let n;const r=`checkbox-${kr()}`,i=Ct({value:"on",id:r},e),[t,o,a]=Ve(i,["ref","children","value","checked","defaultChecked","indeterminate","onChange","onPointerDown"],iu),[l,u]=ze(),[c,m]=ze(!1),{formControlContext:f}=ou(o),g=Vp({isSelected:()=>t.checked,defaultIsSelected:()=>t.defaultChecked,onSelectedChange:b=>t.onChange?.(b),isDisabled:()=>f.isDisabled(),isReadOnly:()=>f.isReadOnly()});xa(()=>n,()=>g.setIsSelected(t.defaultChecked??!1));const p=b=>{Ot(b,t.onPointerDown),c()&&b.preventDefault()},h=w(()=>({"data-checked":g.isSelected()?"":void 0,"data-indeterminate":t.indeterminate?"":void 0})),v={value:()=>t.value,dataset:h,checked:()=>g.isSelected(),indeterminate:()=>t.indeterminate??!1,inputRef:l,generateId:ai(()=>Wi(o.id)),toggle:()=>g.toggle(),setIsChecked:b=>g.setIsSelected(b),setIsFocused:m,setInputRef:u};return s(au.Provider,{value:f,get children(){return s(sd.Provider,{value:v,get children(){return s(At,Ce({as:"div",ref(b){var x=Gt(R=>n=R,t.ref);typeof x=="function"&&x(b)},role:"group",get id(){return Wi(o.id)},onPointerDown:p},()=>f.dataset(),h,a,{get children(){return s(xy,{state:v,get children(){return t.children}})}}))}})}})}function xy(e){const n=Yp(()=>{const r=e.children;return Qp(r)?r(e.state):r});return se(n)}var Rn=Object.assign(gd,{Control:ld,Description:cd,ErrorMessage:ud,Indicator:dd,Input:fd,Label:md}),ky=$("<div data-slot=checkbox-checkbox-content>"),Sy=$('<svg viewBox="0 0 12 12"fill=none width=10 height=10 xmlns=http://www.w3.org/2000/svg><path d="M3 7.17905L5.02703 8.85135L9 3.5"stroke=currentColor stroke-width=1.5 stroke-linecap=square>');function Iy(e){const[n,r]=Ve(e,["children","class","label","hideLabel","description","icon"]);return s(Rn,Ce(r,{"data-component":"checkbox",get children(){return[s(Rn.Input,{"data-slot":"checkbox-checkbox-input"}),s(Rn.Control,{"data-slot":"checkbox-checkbox-control",get children(){return s(Rn.Indicator,{"data-slot":"checkbox-checkbox-indicator",get children(){return n.icon||Sy()}})}}),(()=>{var i=ky();return d(i,s(P,{get when(){return e.children},get children(){return s(Rn.Label,{"data-slot":"checkbox-checkbox-label",get classList(){return{"sr-only":n.hideLabel}},get children(){return e.children}})}}),null),d(i,s(P,{get when(){return n.description},get children(){return s(Rn.Description,{"data-slot":"checkbox-checkbox-description",get children(){return n.description}})}}),null),d(i,s(Rn.ErrorMessage,{"data-slot":"checkbox-checkbox-error"}),null),i})()]}}))}var Ty=$("<div data-slot=image-preview-header>"),Cy=$("<div data-slot=image-preview-body><img data-slot=image-preview-image>"),Dy=$("<div data-component=image-preview><div data-slot=image-preview-container>");function hd(e){const n=gt();return(()=>{var r=Dy(),i=r.firstChild;return d(i,s(Cl.Content,{"data-slot":"image-preview-content",get children(){return[(()=>{var t=Ty();return d(t,s(Cl.CloseButton,{"data-slot":"image-preview-close",as:zt,icon:"close",variant:"ghost",get"aria-label"(){return n.t("ui.common.close")}})),t})(),(()=>{var t=Cy(),o=t.firstChild;return be(a=>{var l=e.src,u=e.alt??n.t("ui.imagePreview.alt");return l!==a.e&&Te(o,"src",a.e=l),u!==a.t&&Te(o,"alt",a.t=u),a},{e:void 0,t:void 0}),t})()]}})),r})()}var zy=$("<div data-component=diagnostics>"),Ey=$("<div data-slot=diagnostic><span data-slot=diagnostic-label></span><span data-slot=diagnostic-location>[<!>:<!>]</span><span data-slot=diagnostic-message>"),Oy=$("<div data-slot=user-message-attachments>"),Ay=$("<div data-slot=user-message-text><button data-slot=user-message-expand type=button></button><div data-slot=user-message-copy-wrapper>"),Py=$("<div data-component=user-message>"),Ny=$("<img data-slot=user-message-attachment-image>"),jy=$("<div data-slot=user-message-attachment>"),Uy=$("<div data-slot=user-message-attachment-icon>"),Ly=$("<span>"),pd=$("<div data-component=permission-prompt><div data-slot=permission-actions>"),vd=$("<div data-component=tool-part-wrapper>"),Ry=$("<div data-slot=message-part-tool-error-content><div data-slot=message-part-tool-error-title></div><span data-slot=message-part-tool-error-message>"),My=$("<span data-slot=message-part-tool-error-message>"),Fy=$("<div data-component=tool-error>"),Zy=$("<div data-component=text-part><div data-slot=text-part-body><div data-slot=text-part-copy-wrapper>"),By=$("<div data-component=reasoning-part>"),Wy=$("<div data-component=tool-loaded-file><span> "),fi=$("<div data-component=tool-output data-scrollable>"),qy=$("<div data-component=tool-action>"),Hy=$("<div data-component=tool-output data-scrollable><div data-component=task-tools>"),Gy=$("<span data-slot=task-tool-subtitle>"),Ky=$("<div data-slot=task-tool-item><span data-slot=task-tool-title>"),Vy=$("<div data-component=edit-content>"),bd=$("<div data-slot=message-part-path><span data-slot=message-part-directory>"),Jy=$("<div data-component=edit-trigger><div data-slot=message-part-title-area><div data-slot=message-part-title><span data-slot=message-part-title-text></span><span data-slot=message-part-title-filename></span></div></div><div data-slot=message-part-actions>"),Xy=$("<div data-component=write-content>"),Yy=$("<div data-component=write-trigger><div data-slot=message-part-title-area><div data-slot=message-part-title><span data-slot=message-part-title-text></span><span data-slot=message-part-title-filename></span></div></div><div data-slot=message-part-actions>"),Qy=$("<div data-component=apply-patch-files>"),e2=$("<span data-slot=apply-patch-file-action data-type=delete>"),t2=$("<span data-slot=apply-patch-file-action data-type=add>"),n2=$("<span data-slot=apply-patch-file-action data-type=move>"),r2=$("<span data-slot=apply-patch-file-action data-type=update>"),i2=$("<span data-slot=apply-patch-deletion-count>-"),o2=$("<div data-component=apply-patch-file-diff>"),a2=$("<div data-component=apply-patch-file><div data-slot=apply-patch-file-header><span data-slot=apply-patch-file-path>"),s2=$("<div data-component=todos>"),l2=$("<div data-slot=message-part-todo-content>"),c2=$("<div data-component=question-answers>"),u2=$("<div data-slot=question-answer-item><div data-slot=question-text></div><div data-slot=answer-text>"),d2=$("<div data-slot=question-tabs><button data-slot=question-tab>"),dc=$("<span data-slot=option-description>"),f2=$("<form data-slot=custom-input-form><input type=text data-slot=custom-input>"),m2=$("<div data-slot=question-content><div data-slot=question-text></div><div data-slot=question-options><button data-slot=question-option><span data-slot=option-label>"),g2=$("<div data-slot=question-review><div data-slot=review-title>"),h2=$("<div data-component=question-prompt><div data-slot=question-actions>"),p2=$("<button data-slot=question-tab>"),v2=$("<button data-slot=question-option><span data-slot=option-label>"),b2=$("<div data-slot=review-item><span data-slot=review-label></span><span data-slot=review-value>");function yd(e,n){return!e||!n?[]:(e[n]??[]).filter(i=>i.severity===1).slice(0,3)}function $d(e){const n=gt();return s(P,{get when(){return e.diagnostics.length>0},get children(){var r=zy();return d(r,s(Ge,{get each(){return e.diagnostics},children:i=>(()=>{var t=Ey(),o=t.firstChild,a=o.nextSibling,l=a.firstChild,u=l.nextSibling,c=u.nextSibling,m=c.nextSibling;m.nextSibling;var f=a.nextSibling;return d(o,()=>n.t("ui.messagePart.diagnostic.error")),d(a,()=>i.range.start.line+1,u),d(a,()=>i.range.start.character+1,m),d(f,()=>i.message),t})()})),r}})}const mo={},y2=100;function $2(e,n){return e===n?!0:e.length!==n.length?!1:e.every((r,i)=>r===n[i])}function _d(e){const[n,r]=ze(e());let i,t=0;return re(()=>{const o=e(),a=Date.now(),l=y2-(a-t);if(l<=0){i&&(clearTimeout(i),i=void 0),t=a,r(o);return}i&&clearTimeout(i),i=setTimeout(()=>{t=Date.now(),r(o),i=void 0},l)}),rt(()=>{i&&clearTimeout(i)}),n}function Na(e,n){return e?n?e.split(n).join(""):e:""}function mi(e){const n=Wn();return Na(Cr(e),n.directory)}function _2(e,n){const r=e.message[n]?.filter(t=>t.role==="assistant");if(!r)return[];const i=[];for(const t of r){const o=e.part[t.id];if(o)for(const a of o)a&&a.type==="tool"&&i.push(a)}return i}function w2(e,n={}){const r=gt();switch(e){case"read":return{icon:"glasses",title:r.t("ui.tool.read"),subtitle:n.filePath?Tt(n.filePath):void 0};case"list":return{icon:"bullet-list",title:r.t("ui.tool.list"),subtitle:n.path?Tt(n.path):void 0};case"glob":return{icon:"magnifying-glass-menu",title:r.t("ui.tool.glob"),subtitle:n.pattern};case"grep":return{icon:"magnifying-glass-menu",title:r.t("ui.tool.grep"),subtitle:n.pattern};case"webfetch":return{icon:"window-cursor",title:r.t("ui.tool.webfetch"),subtitle:n.url};case"task":return{icon:"task",title:r.t("ui.tool.agent",{type:n.subagent_type||"task"}),subtitle:n.description};case"bash":return{icon:"console",title:r.t("ui.tool.shell"),subtitle:n.description};case"edit":return{icon:"code-lines",title:r.t("ui.messagePart.title.edit"),subtitle:n.filePath?Tt(n.filePath):void 0};case"write":return{icon:"code-lines",title:r.t("ui.messagePart.title.write"),subtitle:n.filePath?Tt(n.filePath):void 0};case"apply_patch":return{icon:"code-lines",title:r.t("ui.tool.patch"),subtitle:n.files?.length?`${n.files.length} ${r.t(n.files.length>1?"ui.common.file.other":"ui.common.file.one")}`:void 0};case"todowrite":return{icon:"checklist",title:r.t("ui.tool.todos")};case"todoread":return{icon:"checklist",title:r.t("ui.tool.todos.read")};case"question":return{icon:"bubble-5",title:r.t("ui.tool.questions")};default:return{icon:"mcp",title:e}}}function ca(e){return s(bt,{get children(){return[s(De,{get when(){return se(()=>e.message.role==="user")()&&e.message},children:n=>s(k2,{get message(){return n()},get parts(){return e.parts}})}),s(De,{get when(){return se(()=>e.message.role==="assistant")()&&e.message},children:n=>s(x2,{get message(){return n()},get parts(){return e.parts}})})]}})}function x2(e){const r=w(()=>e.parts.filter(i=>i.type!=="tool"||i.tool!=="todoread"),[],{equals:$2});return s(Ge,{get each(){return r()},children:i=>s(ua,{part:i,get message(){return e.message}})})}function k2(e){const n=wn(),r=gt(),[i,t]=ze(!1),[o,a]=ze(!1),[l,u]=ze(!1);let c;const m=()=>{const A=c;A&&(o()||u(A.scrollHeight>A.clientHeight+2))};br(()=>c,()=>{m()});const f=w(()=>e.parts?.find(A=>A.type==="text"&&!A.synthetic)),g=w(()=>f()?.text||"");re(()=>{g(),m()});const p=w(()=>e.parts?.filter(A=>A.type==="file")??[]),h=w(()=>p()?.filter(A=>{const N=A.mime;return N.startsWith("image/")||N==="application/pdf"})),v=w(()=>p().filter(A=>{const N=A.mime;return!N.startsWith("image/")&&N!=="application/pdf"&&A.source?.text?.start!==void 0})),b=w(()=>e.parts?.filter(A=>A.type==="agent")??[]),x=(A,N)=>{n.show(()=>s(hd,{src:A,alt:N}))},R=async()=>{const A=g();A&&(await navigator.clipboard.writeText(A),t(!0),setTimeout(()=>t(!1),2e3))},U=()=>{l()&&a(A=>!A)};return(()=>{var A=Py();return d(A,s(P,{get when(){return h().length>0},get children(){var N=Oy();return d(N,s(Ge,{get each(){return h()},children:k=>(()=>{var D=jy();return D.$$click=()=>{k.mime.startsWith("image/")&&k.url&&x(k.url,k.filename)},d(D,s(P,{get when(){return se(()=>!!k.mime.startsWith("image/"))()&&k.url},get fallback(){return(()=>{var I=Uy();return d(I,s(Be,{name:"folder"})),I})()},get children(){var I=Ny();return be(S=>{var O=k.url,_=k.filename??r.t("ui.message.attachment.alt");return O!==S.e&&Te(I,"src",S.e=O),_!==S.t&&Te(I,"alt",S.t=_),S},{e:void 0,t:void 0}),I}})),be(()=>Te(D,"data-type",k.mime.startsWith("image/")?"image":"file")),D})()})),N}}),null),d(A,s(P,{get when(){return g()},get children(){var N=Ay(),k=N.firstChild,D=k.nextSibling;return N.$$click=U,ut(I=>c=I,N),d(N,s(S2,{get text(){return g()},get references(){return v()},get agents(){return b()}}),k),k.$$click=I=>{I.stopPropagation(),U()},d(k,s(Be,{name:"chevron-down",size:"small"})),d(D,s(Zt,{get value(){return se(()=>!!i())()?r.t("ui.message.copied"):r.t("ui.message.copy")},placement:"top",gutter:8,get children(){return s(zt,{get icon(){return i()?"check":"copy"},size:"small",variant:"secondary",onMouseDown:I=>I.preventDefault(),onClick:I=>{I.stopPropagation(),R()},get"aria-label"(){return se(()=>!!i())()?r.t("ui.message.copied"):r.t("ui.message.copy")}})}})),be(()=>Te(k,"aria-label",o()?r.t("ui.message.collapse"):r.t("ui.message.expand"))),N}}),null),be(N=>{var k=o(),D=l();return k!==N.e&&Te(A,"data-expanded",N.e=k),D!==N.t&&Te(A,"data-can-expand",N.t=D),N},{e:void 0,t:void 0}),A})()}function S2(e){const n=w(()=>{const r=e.text,i=[...e.references.filter(a=>a.source?.text?.start!==void 0&&a.source?.text?.end!==void 0).map(a=>({start:a.source.text.start,end:a.source.text.end,type:"file"})),...e.agents.filter(a=>a.source?.start!==void 0&&a.source?.end!==void 0).map(a=>({start:a.source.start,end:a.source.end,type:"agent"}))].sort((a,l)=>a.start-l.start),t=[];let o=0;for(const a of i)a.start<o||(a.start>o&&t.push({text:r.slice(o,a.start)}),t.push({text:r.slice(a.start,a.end),type:a.type}),o=a.end);return o<r.length&&t.push({text:r.slice(o)}),t});return s(Ge,{get each(){return n()},children:r=>(()=>{var i=Ly();return d(i,()=>r.text),be(()=>Te(i,"data-highlight",r.type)),i})()})}function ua(e){const n=w(()=>mo[e.part.type]);return s(P,{get when(){return n()},get children(){return s(zn,{get component(){return n()},get part(){return e.part},get message(){return e.message},get hideDetails(){return e.hideDetails},get defaultOpen(){return e.defaultOpen}})}})}const wd={};function I2(e){return wd[e.name]=e,e}function T2(e){return wd[e]?.render}const Ht={register:I2,render:T2};mo.tool=function(n){const r=Wn(),i=gt(),t=n.part,o=w(()=>{const A=r.store.permission?.[n.message.sessionID]?.[0];if(!(!A||!A.tool)&&A.tool.callID===t.callID)return A}),a=w(()=>{const A=r.store.question?.[n.message.sessionID]?.[0];if(!(!A||!A.tool)&&A.tool.callID===t.callID)return A}),[l,u]=ze(!1),[c,m]=ze(!1);re(()=>{if(o()){const N=setTimeout(()=>u(!0),50);rt(()=>clearTimeout(N))}else u(!1)}),re(()=>{if(a()){const N=setTimeout(()=>m(!0),50);rt(()=>clearTimeout(N))}else m(!1)});const[f,g]=ze(!1);re(()=>{(o()||a())&&g(!0)});const p=A=>{const N=o();!N||!r.respondToPermission||r.respondToPermission({sessionID:N.sessionID,permissionID:N.id,response:A})},h={},v={},b=()=>t.state?.input??h,x=()=>t.state?.metadata??v,R=()=>{const A=o();return A?.metadata?{...A.metadata,...x()}:x()},U=Ht.render(t.tool)??ad;return(()=>{var A=vd();return d(A,s(bt,{get children(){return[s(De,{get when(){return se(()=>t.state.status==="error")()&&t.state.error},children:N=>{const k=N().replace("Error: ",""),[D,...I]=k.split(": ");return s(la,{variant:"error",get children(){var S=Fy();return d(S,s(Be,{name:"circle-ban-sign",size:"small"}),null),d(S,s(bt,{get children(){return[s(De,{get when(){return D&&D.length<30},get children(){var O=Ry(),_=O.firstChild,M=_.nextSibling;return d(_,D),d(M,()=>I.join(": ")),O}}),s(De,{when:!0,get children(){var O=My();return d(O,k),O}})]}}),null),S}})}}),s(De,{when:!0,get children(){return s(zn,{component:U,get input(){return b()},get tool(){return t.tool},get metadata(){return R()},get output(){return t.state.output},get status(){return t.state.status},get hideDetails(){return n.hideDetails},get forceOpen(){return f()},get locked(){return l()||c()},get defaultOpen(){return n.defaultOpen}})}})]}}),null),d(A,s(P,{get when(){return se(()=>!!l())()&&o()},get children(){var N=pd(),k=N.firstChild;return d(k,s(Ue,{variant:"ghost",size:"small",onClick:()=>p("reject"),get children(){return i.t("ui.permission.deny")}}),null),d(k,s(Ue,{variant:"secondary",size:"small",onClick:()=>p("always"),get children(){return i.t("ui.permission.allowAlways")}}),null),d(k,s(Ue,{variant:"primary",size:"small",onClick:()=>p("once"),get children(){return i.t("ui.permission.allowOnce")}}),null),N}}),null),d(A,s(P,{get when(){return se(()=>!!c())()&&a()},children:N=>s(C2,{get request(){return N()}})}),null),be(N=>{var k=l(),D=c();return k!==N.e&&Te(A,"data-permission",N.e=k),D!==N.t&&Te(A,"data-question",N.t=D),N},{e:void 0,t:void 0}),A})()};mo.text=function(n){const r=Wn(),i=gt(),t=n.part,o=()=>Na((t.text??"").trim(),r.directory),a=_d(o),[l,u]=ze(!1),c=async()=>{const m=o();m&&(await navigator.clipboard.writeText(m),u(!0),setTimeout(()=>u(!1),2e3))};return s(P,{get when(){return a()},get children(){var m=Zy(),f=m.firstChild,g=f.firstChild;return d(f,s(En,{get text(){return a()},get cacheKey(){return t.id}}),g),d(g,s(Zt,{get value(){return se(()=>!!l())()?i.t("ui.message.copied"):i.t("ui.message.copy")},placement:"top",gutter:8,get children(){return s(zt,{get icon(){return l()?"check":"copy"},size:"small",variant:"secondary",onMouseDown:p=>p.preventDefault(),onClick:c,get"aria-label"(){return se(()=>!!l())()?i.t("ui.message.copied"):i.t("ui.message.copy")}})}})),m}})};mo.reasoning=function(n){const r=n.part,t=_d(()=>r.text.trim());return s(P,{get when(){return t()},get children(){var o=By();return d(o,s(En,{get text(){return t()},get cacheKey(){return r.id}})),o}})};Ht.register({name:"read",render(e){const n=Wn(),r=gt(),i=[];e.input.offset&&i.push("offset="+e.input.offset),e.input.limit&&i.push("limit="+e.input.limit);const t=w(()=>{if(e.status!=="completed")return[];const o=e.metadata.loaded;return!o||!Array.isArray(o)?[]:o.filter(a=>typeof a=="string")});return[s(jt,Ce(e,{icon:"glasses",get trigger(){return{title:r.t("ui.tool.read"),subtitle:e.input.filePath?Tt(e.input.filePath):"",args:i}}})),s(Ge,{get each(){return t()},children:o=>(()=>{var a=Wy(),l=a.firstChild,u=l.firstChild;return d(a,s(Be,{name:"enter",size:"small"}),l),d(l,()=>r.t("ui.tool.loaded"),u),d(l,()=>Na(o,n.directory),null),a})()})]}});Ht.register({name:"list",render(e){const n=gt();return s(jt,Ce(e,{icon:"bullet-list",get trigger(){return{title:n.t("ui.tool.list"),subtitle:mi(e.input.path||"/")}},get children(){return s(P,{get when(){return e.output},children:r=>(()=>{var i=fi();return d(i,s(En,{get text(){return r()}})),i})()})}}))}});Ht.register({name:"glob",render(e){const n=gt();return s(jt,Ce(e,{icon:"magnifying-glass-menu",get trigger(){return{title:n.t("ui.tool.glob"),subtitle:mi(e.input.path||"/"),args:e.input.pattern?["pattern="+e.input.pattern]:[]}},get children(){return s(P,{get when(){return e.output},children:r=>(()=>{var i=fi();return d(i,s(En,{get text(){return r()}})),i})()})}}))}});Ht.register({name:"grep",render(e){const n=gt(),r=[];return e.input.pattern&&r.push("pattern="+e.input.pattern),e.input.include&&r.push("include="+e.input.include),s(jt,Ce(e,{icon:"magnifying-glass-menu",get trigger(){return{title:n.t("ui.tool.grep"),subtitle:mi(e.input.path||"/"),args:r}},get children(){return s(P,{get when(){return e.output},children:i=>(()=>{var t=fi();return d(t,s(En,{get text(){return i()}})),t})()})}}))}});Ht.register({name:"webfetch",render(e){const n=gt();return s(jt,Ce(e,{icon:"window-cursor",get trigger(){return{title:n.t("ui.tool.webfetch"),subtitle:e.input.url||"",args:e.input.format?["format="+e.input.format]:[],action:(()=>{var r=qy();return d(r,s(Be,{name:"square-arrow-top-right",size:"small"})),r})()}},get children(){return s(P,{get when(){return e.output},children:r=>(()=>{var i=fi();return d(i,s(En,{get text(){return r()}})),i})()})}}))}});Ht.register({name:"task",render(e){const n=Wn(),r=gt(),i=()=>e.metadata.sessionId,t=w(()=>{const f=i();return f?_2(n.store,f):[]}),o=Ta({working:()=>!0,overflowAnchor:"auto"}),a=w(()=>{const f=i();return f?(n.store.permission?.[f]??[])[0]:void 0}),l=w(()=>{const f=a();if(!f||!f.tool)return;const g=i();if(!g)return;const p=n.store.message[g]??[],h=hr(p,b=>b.id===f.tool.messageID);if(!h)return;const v=n.store.part[h.id]??[];for(const b of v)if(b.type==="tool"&&b.callID===f.tool.callID)return{part:b,message:h}}),u=f=>{const g=a();!g||!n.respondToPermission||n.respondToPermission({sessionID:g.sessionID,permissionID:g.id,response:f})},c=()=>{const f=i();f&&n.navigateToSession&&n.navigateToSession(f)},m=()=>{const f=l();if(!f)return null;const{part:g}=f,p=Ht.render(g.tool)??ad,h=g.state?.metadata??{},v=g.state?.input??{};return s(zn,{component:p,input:v,get tool(){return g.tool},metadata:h,get output(){return g.state.output},get status(){return g.state.status},defaultOpen:!0})};return(()=>{var f=vd();return d(f,s(bt,{get children(){return[s(De,{get when(){return a()},get children(){return[s(P,{get when(){return l()},get fallback(){return s(jt,{icon:"task",defaultOpen:!0,get trigger(){return{title:r.t("ui.tool.agent",{type:e.input.subagent_type||e.tool}),titleClass:"capitalize",subtitle:e.input.description}},onSubtitleClick:c})},get children(){return m()}}),(()=>{var g=pd(),p=g.firstChild;return d(p,s(Ue,{variant:"ghost",size:"small",onClick:()=>u("reject"),get children(){return r.t("ui.permission.deny")}}),null),d(p,s(Ue,{variant:"secondary",size:"small",onClick:()=>u("always"),get children(){return r.t("ui.permission.allowAlways")}}),null),d(p,s(Ue,{variant:"primary",size:"small",onClick:()=>u("once"),get children(){return r.t("ui.permission.allowOnce")}}),null),g})()]}}),s(De,{when:!0,get children(){return s(jt,{icon:"task",defaultOpen:!0,get trigger(){return{title:r.t("ui.tool.agent",{type:e.input.subagent_type||e.tool}),titleClass:"capitalize",subtitle:e.input.description}},onSubtitleClick:c,get children(){var g=Hy(),p=g.firstChild;ln(g,"scroll",o.handleScroll);var h=o.scrollRef;typeof h=="function"?ut(h,g):o.scrollRef=g;var v=o.contentRef;return typeof v=="function"?ut(v,p):o.contentRef=p,d(p,s(Ge,{get each(){return t()},children:b=>{const x=w(()=>w2(b.tool,b.state.input)),R=w(()=>{if(x().subtitle)return x().subtitle;if(b.state.status==="completed"||b.state.status==="running")return b.state.title});return(()=>{var U=Ky(),A=U.firstChild;return d(U,s(Be,{get name(){return x().icon},size:"small"}),A),d(A,()=>x().title),d(U,s(P,{get when(){return R()},get children(){var N=Gy();return d(N,R),N}}),null),U})()}})),g}})}})]}})),be(()=>Te(f,"data-permission",!!a())),f})()}});Ht.register({name:"bash",render(e){const n=gt();return s(jt,Ce(e,{icon:"console",get trigger(){return{title:n.t("ui.tool.shell"),subtitle:e.input.description}},get children(){var r=fi();return d(r,s(En,{get text(){return`\`\`\`command
|
|
8
|
+
$ ${e.input.command??e.metadata.command??""}${e.output||e.metadata.output?`
|
|
9
|
+
|
|
10
|
+
`+hy(e.output||e.metadata.output):""}
|
|
11
|
+
\`\`\``}})),r}}))}});Ht.register({name:"edit",render(e){const n=gt(),r=ka(),i=w(()=>yd(e.metadata.diagnostics,e.input.filePath)),t=()=>Tt(e.input.filePath??"");return s(jt,Ce(e,{icon:"code-lines",get trigger(){return(()=>{var o=Jy(),a=o.firstChild,l=a.firstChild,u=l.firstChild,c=u.nextSibling,m=a.nextSibling;return d(u,()=>n.t("ui.messagePart.title.edit")),d(c,t),d(a,s(P,{get when(){return e.input.filePath?.includes("/")},get children(){var f=bd(),g=f.firstChild;return d(g,()=>mi(e.input.filePath)),f}}),null),d(m,s(P,{get when(){return e.metadata.filediff},get children(){return s(Sa,{get changes(){return e.metadata.filediff}})}})),o})()},get children(){return[s(P,{get when(){return e.metadata.filediff?.path||e.input.filePath},get children(){var o=Vy();return d(o,s(zn,{component:r,get before(){return{name:e.metadata?.filediff?.file||e.input.filePath,contents:e.metadata?.filediff?.before||e.input.oldString}},get after(){return{name:e.metadata?.filediff?.file||e.input.filePath,contents:e.metadata?.filediff?.after||e.input.newString}}})),o}}),s($d,{get diagnostics(){return i()}})]}}))}});Ht.register({name:"write",render(e){const n=gt(),r=gu(),i=w(()=>yd(e.metadata.diagnostics,e.input.filePath)),t=()=>Tt(e.input.filePath??"");return s(jt,Ce(e,{icon:"code-lines",get trigger(){return(()=>{var o=Yy(),a=o.firstChild,l=a.firstChild,u=l.firstChild,c=u.nextSibling;return d(u,()=>n.t("ui.messagePart.title.write")),d(c,t),d(a,s(P,{get when(){return e.input.filePath?.includes("/")},get children(){var m=bd(),f=m.firstChild;return d(f,()=>mi(e.input.filePath)),m}}),null),o})()},get children(){return[s(P,{get when(){return e.input.content},get children(){var o=Xy();return d(o,s(zn,{component:r,get file(){return{name:e.input.filePath,contents:e.input.content,cacheKey:Ir(e.input.content)}},overflow:"scroll"})),o}}),s($d,{get diagnostics(){return i()}})]}}))}});Ht.register({name:"apply_patch",render(e){const n=gt(),r=ka(),i=w(()=>e.metadata.files??[]),t=w(()=>{const o=i().length;return o===0?"":`${o} ${n.t(o>1?"ui.common.file.other":"ui.common.file.one")}`});return s(jt,Ce(e,{icon:"code-lines",get trigger(){return{title:n.t("ui.tool.patch"),subtitle:t()}},get children(){return s(P,{get when(){return i().length>0},get children(){var o=Qy();return d(o,s(Ge,{get each(){return i()},children:a=>(()=>{var l=a2(),u=l.firstChild,c=u.firstChild;return d(u,s(bt,{get children(){return[s(De,{get when(){return a.type==="delete"},get children(){var m=e2();return d(m,()=>n.t("ui.patch.action.deleted")),m}}),s(De,{get when(){return a.type==="add"},get children(){var m=t2();return d(m,()=>n.t("ui.patch.action.created")),m}}),s(De,{get when(){return a.type==="move"},get children(){var m=n2();return d(m,()=>n.t("ui.patch.action.moved")),m}}),s(De,{get when(){return a.type==="update"},get children(){var m=r2();return d(m,()=>n.t("ui.patch.action.patched")),m}})]}}),c),d(c,()=>a.relativePath),d(u,s(P,{get when(){return a.type!=="delete"},get children(){return s(Sa,{get changes(){return{additions:a.additions,deletions:a.deletions}}})}}),null),d(u,s(P,{get when(){return a.type==="delete"},get children(){var m=i2();return m.firstChild,d(m,()=>a.deletions,null),m}}),null),d(l,s(P,{get when(){return a.type!=="delete"},get children(){var m=o2();return d(m,s(zn,{component:r,get before(){return{name:a.filePath,contents:a.before}},get after(){return{name:a.filePath,contents:a.after}}})),m}}),null),l})()})),o}})}}))}});Ht.register({name:"todowrite",render(e){const n=gt(),r=w(()=>{const t=e.metadata?.todos;if(Array.isArray(t))return t;const o=e.input.todos;return Array.isArray(o)?o:[]}),i=w(()=>{const t=r();return t.length===0?"":`${t.filter(o=>o.status==="completed").length}/${t.length}`});return s(jt,Ce(e,{defaultOpen:!0,icon:"checklist",get trigger(){return{title:n.t("ui.tool.todos"),subtitle:i()}},get children(){return s(P,{get when(){return r().length},get children(){var t=s2();return d(t,s(Ge,{get each(){return r()},children:o=>s(Iy,{readOnly:!0,get checked(){return o.status==="completed"},get children(){var a=l2();return d(a,()=>o.content),be(()=>Te(a,"data-completed",o.status==="completed")),a}})})),t}})}}))}});Ht.register({name:"question",render(e){const n=gt(),r=w(()=>e.input.questions??[]),i=w(()=>e.metadata.answers??[]),t=w(()=>i().length>0),o=w(()=>{const a=r().length;return a===0?"":t()?n.t("ui.question.subtitle.answered",{count:a}):`${a} ${n.t(a>1?"ui.common.question.other":"ui.common.question.one")}`});return s(jt,Ce(e,{get defaultOpen(){return t()},icon:"bubble-5",get trigger(){return{title:n.t("ui.tool.questions"),subtitle:o()}},get children(){return s(P,{get when(){return t()},get children(){var a=c2();return d(a,s(Ge,{get each(){return r()},children:(l,u)=>{const c=()=>i()[u()]??[];return(()=>{var m=u2(),f=m.firstChild,g=f.nextSibling;return d(f,()=>l.question),d(g,()=>c().join(", ")||n.t("ui.question.answer.none")),m})()}})),a}})}}))}});function C2(e){const n=Wn(),r=gt(),i=w(()=>e.request.questions),t=w(()=>i().length===1&&i()[0]?.multiple!==!0),[o,a]=It({tab:0,answers:[],custom:[],editing:!1}),l=w(()=>i()[o.tab]),u=w(()=>!t()&&o.tab===i().length),c=w(()=>l()?.options??[]),m=w(()=>o.custom[o.tab]??""),f=w(()=>l()?.multiple===!0),g=w(()=>{const A=m();return A?o.answers[o.tab]?.includes(A)??!1:!1});function p(){const A=i().map((N,k)=>o.answers[k]??[]);n.replyToQuestion?.({requestID:e.request.id,answers:A})}function h(){n.rejectQuestion?.({requestID:e.request.id})}function v(A,N=!1){const k=[...o.answers];if(k[o.tab]=[A],a("answers",k),N){const D=[...o.custom];D[o.tab]=A,a("custom",D)}if(t()){n.replyToQuestion?.({requestID:e.request.id,answers:[[A]]});return}a("tab",o.tab+1)}function b(A){const k=[...o.answers[o.tab]??[]],D=k.indexOf(A);D===-1&&k.push(A),D!==-1&&k.splice(D,1);const I=[...o.answers];I[o.tab]=k,a("answers",I)}function x(A){a("tab",A),a("editing",!1)}function R(A){if(A===c().length){a("editing",!0);return}const N=c()[A];if(N){if(f()){b(N.label);return}v(N.label)}}function U(A){A.preventDefault();const N=m().trim();if(!N){a("editing",!1);return}if(f()){const D=[...o.answers[o.tab]??[]];D.includes(N)||D.push(N);const I=[...o.answers];I[o.tab]=D,a("answers",I),a("editing",!1);return}v(N,!0),a("editing",!1)}return(()=>{var A=h2(),N=A.firstChild;return d(A,s(P,{get when(){return!t()},get children(){var k=d2(),D=k.firstChild;return d(k,s(Ge,{get each(){return i()},children:(I,S)=>{const O=()=>S()===o.tab,_=()=>(o.answers[S()]?.length??0)>0;return(()=>{var M=p2();return M.$$click=()=>x(S()),d(M,()=>I.header),be(F=>{var Z=O(),B=_();return Z!==F.e&&Te(M,"data-active",F.e=Z),B!==F.t&&Te(M,"data-answered",F.t=B),F},{e:void 0,t:void 0}),M})()}}),D),D.$$click=()=>x(i().length),d(D,()=>r.t("ui.common.confirm")),be(()=>Te(D,"data-active",u())),k}}),N),d(A,s(P,{get when(){return!u()},get children(){var k=m2(),D=k.firstChild,I=D.nextSibling,S=I.firstChild,O=S.firstChild;return d(D,()=>l()?.question,null),d(D,(()=>{var _=se(()=>!!f());return()=>_()?" "+r.t("ui.question.multiHint"):""})(),null),d(I,s(Ge,{get each(){return c()},children:(_,M)=>{const F=()=>o.answers[o.tab]?.includes(_.label)??!1;return(()=>{var Z=v2(),B=Z.firstChild;return Z.$$click=()=>R(M()),d(B,()=>_.label),d(Z,s(P,{get when(){return _.description},get children(){var W=dc();return d(W,()=>_.description),W}}),null),d(Z,s(P,{get when(){return F()},get children(){return s(Be,{name:"check-small",size:"normal"})}}),null),be(()=>Te(Z,"data-picked",F())),Z})()}}),S),S.$$click=()=>R(c().length),d(O,()=>r.t("ui.messagePart.option.typeOwnAnswer")),d(S,s(P,{get when(){return se(()=>!o.editing)()&&m()},get children(){var _=dc();return d(_,m),_}}),null),d(S,s(P,{get when(){return g()},get children(){return s(Be,{name:"check-small",size:"normal"})}}),null),d(I,s(P,{get when(){return o.editing},get children(){var _=f2(),M=_.firstChild;return _.addEventListener("submit",U),M.$$input=F=>{const Z=[...o.custom];Z[o.tab]=F.currentTarget.value,a("custom",Z)},ut(F=>setTimeout(()=>F.focus(),0),M),d(_,s(Ue,{type:"submit",variant:"primary",size:"small",get children(){return se(()=>!!f())()?r.t("ui.common.add"):r.t("ui.common.submit")}}),null),d(_,s(Ue,{type:"button",variant:"ghost",size:"small",onClick:()=>a("editing",!1),get children(){return r.t("ui.common.cancel")}}),null),be(()=>Te(M,"placeholder",r.t("ui.question.custom.placeholder"))),be(()=>M.value=m()),_}}),null),be(()=>Te(S,"data-picked",g())),k}}),N),d(A,s(P,{get when(){return u()},get children(){var k=g2(),D=k.firstChild;return d(D,()=>r.t("ui.messagePart.review.title")),d(k,s(Ge,{get each(){return i()},children:(I,S)=>{const O=()=>o.answers[S()]?.join(", ")??"",_=()=>!!O();return(()=>{var M=b2(),F=M.firstChild,Z=F.nextSibling;return d(F,()=>I.question),d(Z,(()=>{var B=se(()=>!!_());return()=>B()?O():r.t("ui.question.review.notAnswered")})()),be(()=>Te(Z,"data-answered",_())),M})()}}),null),k}}),N),d(N,s(Ue,{variant:"ghost",size:"small",onClick:h,get children(){return r.t("ui.common.dismiss")}}),null),d(N,s(P,{get when(){return!t()},get children(){return[s(P,{get when(){return u()},get children(){return s(Ue,{variant:"primary",size:"small",onClick:p,get children(){return r.t("ui.common.submit")}})}}),s(P,{get when(){return se(()=>!u())()&&f()},get children(){return s(Ue,{variant:"secondary",size:"small",onClick:()=>x(o.tab+1),get disabled(){return(o.answers[o.tab]?.length??0)===0},get children(){return r.t("ui.common.next")}})}})]}}),null),A})()}Ut(["click","input"]);var D2=$("<div data-component=session-turn><div data-slot=session-turn-content><div>"),z2=$("<div data-slot=session-turn-attachments aria-live=off>"),E2=$('<svg width=10 height=10 viewBox="0 0 10 10"fill=none xmlns=http://www.w3.org/2000/svg data-slot=session-turn-trigger-icon><path d="M8.125 1.875H1.875L5 8.125L8.125 1.875Z"fill=currentColor stroke=currentColor stroke-linejoin=round>'),O2=$('<svg width=10 height=10 viewBox="0 0 10 10"fill=none xmlns=http://www.w3.org/2000/svg class=text-icon-base><path d="M8.125 8.125H1.875L5 1.875L8.125 8.125Z"fill=currentColor stroke=currentColor stroke-linejoin=round>'),A2=$("<span data-slot=session-turn-retry-message>"),P2=$("<span data-slot=session-turn-retry-seconds>· "),N2=$("<span data-slot=session-turn-retry-attempt>(#<!>)"),Vo=$("<span data-slot=session-turn-status-text>"),j2=$("<span aria-hidden=true>·"),U2=$("<span aria-live=off>"),L2=$("<div data-slot=session-turn-response-trigger>"),R2=$("<div data-slot=session-turn-sticky><div data-slot=session-turn-message-content aria-live=off>"),M2=$("<div data-slot=session-turn-collapsible-content-inner>"),F2=$("<div data-slot=session-turn-answered-question-parts>"),Z2=$("<div class=sr-only aria-live=polite>"),B2=$("<div data-slot=session-turn-response-copy-wrapper>"),W2=$("<div data-slot=session-turn-summary-section><div data-slot=session-turn-summary-header><div data-slot=session-turn-summary-title-row><h2 data-slot=session-turn-summary-title></h2></div><div data-slot=session-turn-response>"),q2=$("<div data-slot=session-turn-message-container>");function fc(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Hr(e){const n=e.replace(/^Error:\s*/,"").trim(),r=u=>{try{return JSON.parse(u)}catch{return}},i=u=>{const c=r(u);return typeof c!="string"?c:r(c.trim())};let t=i(n);if(t===void 0){const u=n.indexOf("{"),c=n.lastIndexOf("}");u!==-1&&c>u&&(t=i(n.slice(u,c+1)))}if(!fc(t))return e;const o=fc(t.error)?t.error:void 0;if(o){const u=typeof o.type=="string"?o.type:void 0,c=typeof o.message=="string"?o.message:void 0;if(u&&c)return`${u}: ${c}`;if(c)return c;if(u)return u;const m=typeof o.code=="string"?o.code:void 0;if(m)return m}const a=typeof t.message=="string"?t.message:void 0;if(a)return a;const l=typeof t.error=="string"?t.error:void 0;return l||e}function mc(e,n){if(e){if(e.type==="tool")switch(e.tool){case"task":return n("ui.sessionTurn.status.delegating");case"todowrite":case"todoread":return n("ui.sessionTurn.status.planning");case"read":return n("ui.sessionTurn.status.gatheringContext");case"list":case"grep":case"glob":return n("ui.sessionTurn.status.searchingCodebase");case"webfetch":return n("ui.sessionTurn.status.searchingWeb");case"edit":case"write":return n("ui.sessionTurn.status.makingEdits");case"bash":return n("ui.sessionTurn.status.runningCommands");default:return}if(e.type==="reasoning"){const i=(e.text??"").trimStart().match(/^\*\*(.+?)\*\*/);return i?n("ui.sessionTurn.status.thinkingWithTopic",{topic:i[1].trim()}):n("ui.sessionTurn.status.thinking")}if(e.type==="text")return n("ui.sessionTurn.status.gatheringThoughts")}}function H2(e,n){return e===n?!0:e.length!==n.length?!1:e.every((r,i)=>r===n[i])}function gc(e){if(e?.type!=="file")return!1;const n=e.mime??"";return n.startsWith("image/")||n==="application/pdf"}function G2(e){const n=Wn(),r=[],i=w(()=>n.store.part[e.message.id]??r),t=w(()=>{const a=i();for(let l=a.length-1;l>=0;l--){const u=a[l];if(u?.type==="text")return u}}),o=w(()=>{let a=i();if(e.hideReasoning&&(a=a.filter(c=>c?.type!=="reasoning")),e.hideResponsePart){const c=e.responsePartId;c&&c===t()?.id&&(a=a.filter(m=>m?.id!==c))}const l=e.hidden?.()??[];if(l.length===0)return a;const u=e.message.id;return a.filter(c=>{if(c?.type!=="tool")return!0;const m=c;return!l.some(f=>f.messageID===u&&f.callID===m.callID)})});return s(ca,{get message(){return e.message},get parts(){return o()}})}function K2(e){const n=gt(),r=Wn(),i=[],t=[],o=[],a=[],l=[],u=[],c=[],m={type:"idle"},f=w(()=>r.store.message[e.sessionID]??i),g=w(()=>{const G=f()??i,ue=ev.search(G,e.messageID,Pe=>Pe.id),ye=ue.found?ue.index:G.findIndex(Pe=>Pe.id===e.messageID);if(ye<0)return-1;const ke=G[ye];return!ke||ke.role!=="user"?-1:ye}),p=w(()=>{const G=g();if(G<0)return;const ye=(f()??i)[G];if(!(!ye||ye.role!=="user"))return ye}),h=w(()=>{if(e.lastUserMessageID)return e.lastUserMessageID;const G=f()??i;for(let ue=G.length-1;ue>=0;ue--){const ye=G[ue];if(ye?.role==="user")return ye.id}}),v=w(()=>e.messageID===h()),b=w(()=>{const G=p();return G?r.store.part[G.id]??t:t}),x=w(()=>{const G=b();return G.length===0?o:G.filter(ue=>gc(ue))}),R=w(()=>{const G=b();return G.length===0?t:x().length===0?G:G.filter(ue=>!gc(ue))}),U=w(()=>{const G=p();if(!G)return a;const ue=f()??i,ye=g();if(ye<0)return a;const ke=[];for(let Pe=ye+1;Pe<ue.length;Pe++){const He=ue[Pe];if(He){if(He.role==="user")break;He.role==="assistant"&&He.parentID===G.id&&ke.push(He)}}return ke},a,{equals:H2}),A=w(()=>U().at(-1)),N=w(()=>U().find(G=>G.error)?.error),k=w(()=>{const G=N()?.data?.message;return typeof G=="string"?Hr(G):G==null?"":Hr(String(G))}),D=w(()=>{const G=U();for(let ue=G.length-1;ue>=0;ue--){const ye=r.store.part[G[ue].id]??t;for(let ke=ye.length-1;ke>=0;ke--){const Pe=ye[ke];if(Pe?.type==="text")return Pe}}}),I=w(()=>{for(const G of U()){const ue=r.store.part[G.id];if(ue){for(const ye of ue)if(ye?.type==="tool")return!0}}return!1}),S=w(()=>r.store.permission?.[e.sessionID]??l),O=w(()=>S()[0]),_=w(()=>r.store.question?.[e.sessionID]??u),M=w(()=>_()[0]),F=w(()=>{const G=[],ue=O();ue?.tool&&G.push(ue.tool);const ye=M();return ye?.tool&&G.push(ye.tool),G}),Z=w(()=>{if(e.stepsExpanded||_().length>0)return c;const G=[];for(const ue of U()){const ye=r.store.part[ue.id]??t;for(const ke of ye){if(ke?.type!=="tool")continue;const Pe=ke;if(Pe.tool!=="question")continue;const He=Pe.state?.metadata?.answers;He&&He.length>0&&G.push({part:Pe,message:ue})}}return G}),B=w(()=>{const G=b();if(G.length===0||!G.every(Pe=>Pe?.type==="text"&&Pe?.synthetic))return;const ue=U();if(ue.length!==1)return;const ye=r.store.part[ue[0].id]??t;if(ye.length!==1)return;const ke=ye[0];if(ke?.type==="tool"&&ke.tool==="bash")return ke}),W=w(()=>!!B()),ee=w(()=>{const G=U();let ue,ye;for(let Pe=G.length-1;Pe>=0;Pe--){const He=r.store.part[G[Pe].id]??t;for(let et=He.length-1;et>=0;et--){const Q=He[et];if(Q&&(ue||(ue=Q),Q.type==="tool"&&Q.tool==="task"&&Q.state&&"metadata"in Q.state&&Q.state.metadata?.sessionId&&Q.state.status==="running")){ye=Q;break}}if(ye)break}const ke=ye?.state&&"metadata"in ye.state?ye.state.metadata?.sessionId:void 0;if(ke){const Pe=r.store.message[ke]??i;for(let He=Pe.length-1;He>=0;He--){const et=Pe[He];if(!et||et.role!=="assistant")continue;const Q=r.store.part[et.id]??t;for(let we=Q.length-1;we>=0;we--){const Re=Q[we];if(Re)return mc(Re,n.t)}}}return mc(ue,n.t)}),Se=w(()=>r.store.session_status[e.sessionID]??m),X=w(()=>Se().type!=="idle"&&v()),ne=w(()=>{if(!v())return;const G=Se();if(G.type==="retry")return G}),ce=w(()=>D()?.text),fe=w(()=>D()?.id),me=w(()=>(p()?.summary?.diffs?.length??0)>0),V=w(()=>!X()&&!!fe()),[z,H]=ze(!1),$e=async()=>{const G=ce()??"";G&&(await navigator.clipboard.writeText(G),H(!0),setTimeout(()=>H(!1),2e3))},[te,he]=ze(),[C,q]=ze(),ie=G=>{const ue=te();if(!ue)return;const ye=Math.ceil(G);ue.style.setProperty("--session-turn-sticky-height",`${ye}px`)};function _e(){const G=p();if(!G)return"";const ue=A()?.time.completed,ye=vr.fromMillis(G.time.created),ke=ue?vr.fromMillis(ue):vr.now(),Pe=nv.fromDateTimes(ye,ke),He=Pe.length("seconds")>60?["minutes","seconds"]:["seconds"],et=n.locale(),Q=Pe.toDuration(He).normalize().reconfigure({locale:et}).toHuman({notation:"compact",unitDisplay:"narrow",compactDisplay:"short",showZeros:!1});return et.startsWith("zh")?Q.replaceAll("、",""):Q}const ge=Ta({working:X,onUserInteracted:e.onUserInteracted,overflowAnchor:"auto"});br(()=>C(),({height:G})=>{ie(G)}),re(()=>{const G=te();if(!G)return;const ue=C();if(!ue){G.style.setProperty("--session-turn-sticky-height","0px");return}ie(ue.getBoundingClientRect().height)});const[Ae,We]=It({retrySeconds:0,status:ee(),duration:_e()});re(()=>{const G=ne();if(!G){We("retrySeconds",0);return}const ue=()=>{const ke=G.next;ke&&We("retrySeconds",Math.max(0,Math.round((ke-Date.now())/1e3)))};ue();const ye=setInterval(ue,1e3);rt(()=>clearInterval(ye))});let mt="";re(()=>{const G=ne();if(!G)return;const ue=`${G.attempt}:${G.next}:${G.message}`;ue!==mt&&(mt=ue,console.warn("[session-turn] retry",{sessionID:e.sessionID,messageID:e.messageID,attempt:G.attempt,next:G.next,raw:G.message,parsed:Hr(G.message)}))});let yt="";re(()=>{const G=N()?.data?.message;if(G==null)return;const ue=typeof G=="string"?G:String(G);ue&&ue!==yt&&(yt=ue,console.warn("[session-turn] assistant-error",{sessionID:e.sessionID,messageID:e.messageID,raw:ue,parsed:Hr(ue)}))}),re(()=>{const G=()=>{We("duration",_e())};if(G(),!X())return;const ue=setInterval(G,1e3);rt(()=>clearInterval(ue))});let kt=Date.now(),dt;return re(()=>{const G=ee();if(G===Ae.status||!G)return;const ue=Date.now()-kt;ue>=2500?(We("status",G),kt=Date.now(),dt&&(clearTimeout(dt),dt=void 0)):(dt&&clearTimeout(dt),dt=setTimeout(()=>{We("status",ee()),kt=Date.now(),dt=void 0},2500-ue))}),rt(()=>{dt&&clearTimeout(dt)}),(()=>{var G=D2(),ue=G.firstChild,ye=ue.firstChild;ut(he,G),ln(ue,"scroll",ge.handleScroll);var ke=ge.scrollRef;return typeof ke=="function"?ut(ke,ue):ge.scrollRef=ue,ln(ye,"click",ge.handleInteraction,!0),d(ye,s(P,{get when(){return p()},children:Pe=>(()=>{var He=q2(),et=ge.contentRef;return typeof et=="function"?ut(et,He):ge.contentRef=He,d(He,s(bt,{get children(){return[s(De,{get when(){return W()},get children(){return s(ua,{get part(){return B()},get message(){return Pe()},defaultOpen:!0})}}),s(De,{when:!0,get children(){return[s(P,{get when(){return x().length>0},get children(){var Q=z2();return d(Q,s(ca,{get message(){return Pe()},get parts(){return x()}})),Q}}),(()=>{var Q=R2(),we=Q.firstChild;return ut(q,Q),d(we,s(ca,{get message(){return Pe()},get parts(){return R()}})),d(Q,s(P,{get when(){return X()||I()},get children(){var Re=L2();return d(Re,s(Ue,{get"data-expandable"(){return U().length>0},"data-slot":"session-turn-collapsible-trigger-content",variant:"ghost",size:"small",get onClick(){return e.onStepsExpandedToggle??(()=>{})},get"aria-expanded"(){return e.stepsExpanded},get children(){return[s(bt,{get children(){return[s(De,{get when(){return X()},get children(){return s(tv,{})}}),s(De,{get when(){return!e.stepsExpanded},get children(){return E2()}}),s(De,{get when(){return e.stepsExpanded},get children(){return O2()}})]}}),s(bt,{get children(){return[s(De,{get when(){return ne()},get children(){return[(()=>{var je=A2();return d(je,()=>{const pt=ne();if(!pt)return"";const Ke=Hr(pt.message);return Ke.length>60?Ke.slice(0,60)+"...":Ke}),je})(),(()=>{var je=P2();return je.firstChild,d(je,()=>n.t("ui.sessionTurn.retry.retrying"),null),d(je,(()=>{var pt=se(()=>Ae.retrySeconds>0);return()=>pt()?" "+n.t("ui.sessionTurn.retry.inSeconds",{seconds:Ae.retrySeconds}):""})(),null),je})(),(()=>{var je=N2(),pt=je.firstChild,Ke=pt.nextSibling;return Ke.nextSibling,d(je,()=>ne()?.attempt,Ke),je})()]}}),s(De,{get when(){return X()},get children(){var je=Vo();return d(je,()=>Ae.status??n.t("ui.sessionTurn.status.consideringNextSteps")),je}}),s(De,{get when(){return e.stepsExpanded},get children(){var je=Vo();return d(je,()=>n.t("ui.sessionTurn.steps.hide")),je}}),s(De,{get when(){return!e.stepsExpanded},get children(){var je=Vo();return d(je,()=>n.t("ui.sessionTurn.steps.show")),je}})]}}),j2(),(()=>{var je=U2();return d(je,()=>Ae.duration),je})()]}})),Re}}),null),Q})(),s(P,{get when(){return se(()=>!!e.stepsExpanded)()&&U().length>0},get children(){var Q=M2();return d(Q,s(Ge,{get each(){return U()},children:we=>s(G2,{message:we,get responsePartId(){return fe()},get hideResponsePart(){return V()},get hideReasoning(){return!X()},hidden:F})}),null),d(Q,s(P,{get when(){return N()},get children(){return s(la,{variant:"error",class:"error-card",get children(){return k()}})}}),null),be(()=>Te(Q,"aria-hidden",X())),Q}}),s(P,{get when(){return se(()=>!e.stepsExpanded)()&&Z().length>0},get children(){var Q=F2();return d(Q,s(Ge,{get each(){return Z()},children:({part:we,message:Re})=>s(ua,{part:we,message:Re})})),Q}}),(()=>{var Q=Z2();return d(Q,(()=>{var we=se(()=>!!(!X()&&ce()));return()=>we()?ce():""})()),Q})(),s(P,{get when(){return se(()=>!X())()&&ce()},get children(){var Q=W2(),we=Q.firstChild,Re=we.firstChild,je=Re.firstChild,pt=Re.nextSibling;return d(je,()=>n.t("ui.sessionTurn.summary.response")),d(Re,s(P,{get when(){return ce()},get children(){var Ke=B2();return d(Ke,s(Zt,{get value(){return se(()=>!!z())()?n.t("ui.message.copied"):n.t("ui.message.copy")},placement:"top",gutter:8,get children(){return s(zt,{get icon(){return z()?"check":"copy"},size:"small",variant:"secondary",onMouseDown:Et=>Et.preventDefault(),onClick:Et=>{Et.stopPropagation(),$e()},get"aria-label"(){return se(()=>!!z())()?n.t("ui.message.copied"):n.t("ui.message.copy")}})}})),Ke}}),null),d(pt,s(En,{"data-slot":"session-turn-markdown",get"data-diffs"(){return me()},get text(){return ce()??""},get cacheKey(){return fe()}})),Q}}),s(P,{get when(){return se(()=>!!N())()&&!e.stepsExpanded},get children(){return s(la,{variant:"error",class:"error-card",get children(){return k()}})}})]}})]}})),be(Q=>{var we=Pe().id,Re=e.classes?.container;return we!==Q.e&&Te(He,"data-message",Q.e=we),Re!==Q.t&&Qn(He,Q.t=Re),Q},{e:void 0,t:void 0}),He})()}),null),d(ye,()=>e.children,null),be(Pe=>{var He=e.classes?.root,et=e.classes?.content;return He!==Pe.e&&Qn(G,Pe.e=He),et!==Pe.t&&Qn(ue,Pe.t=et),Pe},{e:void 0,t:void 0}),G})()}Ut(["click"]);const V2=e=>e.deltaMode===1?e.deltaY*40:e.deltaMode===2?e.deltaY*e.rootHeight:e.deltaY,hc=e=>{const n=e.scrollHeight-e.clientHeight;if(n<=1)return!0;if(!e.delta)return!1;if(e.delta<0)return e.scrollTop+e.delta<=0;const r=n-e.scrollTop;return e.delta>r};var J2=$('<div><div class="h-10 w-full flex items-center justify-between gap-2"><div class="flex items-center gap-1 min-w-0 flex-1">'),pc=$('<div class="w-full flex justify-center">'),X2=$('<div class="relative w-full h-full min-w-0"><div class="absolute left-1/2 -translate-x-1/2 bottom-[calc(var(--prompt-height,8rem)+32px)] z-[60] pointer-events-none transition-all duration-200 ease-out"><button class="pointer-events-auto size-8 flex items-center justify-center rounded-full bg-background-base border border-border-base shadow-sm text-text-base hover:bg-background-stronger transition-colors"></button></div><div class="relative min-w-0 w-full h-full overflow-y-auto session-scroller"><div role=log class="flex flex-col gap-12 items-start justify-start pb-[calc(var(--prompt-height,8rem)+64px)] md:pb-[calc(var(--prompt-height,10rem)+64px)] transition-[margin]">'),Y2=$('<div class="relative h-full overflow-hidden">'),Q2=$('<h1 class="text-16-medium text-text-strong truncate min-w-0">'),e$=$('<div class="shrink-0 flex items-center">'),t$=$("<div>");function n$(e){let n;return s(P,{get when(){return!e.mobileChanges},get fallback(){return(()=>{var r=Y2();return d(r,()=>e.mobileFallback),r})()},get children(){var r=X2(),i=r.firstChild,t=i.firstChild,o=i.nextSibling,a=o.firstChild;ln(t,"click",e.onResumeScroll,!0),d(t,s(Be,{name:"arrow-down-to-line"})),ln(o,"click",e.onAutoScrollInteraction,!0),o.addEventListener("scroll",c=>{e.onScheduleScrollState(c.currentTarget),e.hasScrollGesture()&&(e.onAutoScrollHandleScroll(),e.onMarkScrollGesture(c.currentTarget),e.isDesktop&&e.onScrollSpyScroll())}),o.$$pointerdown=c=>{c.target===c.currentTarget&&e.onMarkScrollGesture(c.currentTarget)},o.addEventListener("touchcancel",()=>{n=void 0}),o.$$touchend=()=>{n=void 0},o.$$touchmove=c=>{const m=c.touches[0]?.clientY,f=n;if(n=m,m===void 0||f===void 0)return;const g=f-m;if(!g)return;const p=c.currentTarget,v=(c.target instanceof Element?c.target:void 0)?.closest("[data-scrollable]");if(!v||v===p){e.onMarkScrollGesture(p);return}if(!(v instanceof HTMLElement)){e.onMarkScrollGesture(p);return}hc({delta:g,scrollTop:v.scrollTop,scrollHeight:v.scrollHeight,clientHeight:v.clientHeight})&&e.onMarkScrollGesture(p)},o.$$touchstart=c=>{n=c.touches[0]?.clientY},o.addEventListener("wheel",c=>{const m=c.currentTarget,g=(c.target instanceof Element?c.target:void 0)?.closest("[data-scrollable]");if(!g||g===m){e.onMarkScrollGesture(m);return}if(!(g instanceof HTMLElement)){e.onMarkScrollGesture(m);return}const p=V2({deltaY:c.deltaY,deltaMode:c.deltaMode,rootHeight:m.clientHeight});p&&hc({delta:p,scrollTop:g.scrollTop,scrollHeight:g.scrollHeight,clientHeight:g.clientHeight})&&e.onMarkScrollGesture(m)});var l=e.setScrollRef;typeof l=="function"?ut(l,o):e.setScrollRef=o,d(o,s(P,{get when(){return e.showHeader},get children(){var c=J2(),m=c.firstChild,f=m.firstChild;return d(f,s(P,{get when(){return e.parentID},get children(){return s(zt,{tabIndex:-1,icon:"arrow-left",variant:"ghost",get onClick(){return e.onNavigateParent},get"aria-label"(){return e.t("common.goBack")}})}}),null),d(f,s(P,{get when(){return e.title||e.titleState.editing},get children(){return s(P,{get when(){return e.titleState.editing},get fallback(){return(()=>{var g=Q2();return ln(g,"dblclick",e.openTitleEditor,!0),d(g,()=>e.title),g})()},get children(){return s(rv,{ref(g){var p=e.titleRef;typeof p=="function"?p(g):e.titleRef=g},get value(){return e.titleState.draft},get disabled(){return e.titleState.saving},class:"text-16-medium text-text-strong grow-1 min-w-0",onInput:g=>e.onTitleDraft(g.currentTarget.value),onKeyDown:g=>{if(g.stopPropagation(),g.key==="Enter"){g.preventDefault(),e.saveTitleEditor();return}g.key==="Escape"&&(g.preventDefault(),e.closeTitleEditor())},get onBlur(){return e.closeTitleEditor}})}})}}),null),d(m,s(P,{get when(){return e.sessionID},children:g=>(()=>{var p=e$();return d(p,s(at,{get open(){return e.titleState.menuOpen},get onOpenChange(){return e.onTitleMenuOpen},get children(){return[s(Zt,{get value(){return e.t("common.moreOptions")},placement:"top",get children(){return s(at.Trigger,{as:zt,icon:"dot-grid",variant:"ghost",class:"size-6 rounded-md data-[expanded]:bg-surface-base-active",get"aria-label"(){return e.t("common.moreOptions")}})}}),s(at.Portal,{get children(){return s(at.Content,{onCloseAutoFocus:h=>{e.titleState.pendingRename&&(h.preventDefault(),e.onTitlePendingRename(!1),e.openTitleEditor())},get children(){return[s(at.Item,{onSelect:()=>{e.onTitlePendingRename(!0),e.onTitleMenuOpen(!1)},get children(){return s(at.ItemLabel,{get children(){return e.t("common.rename")}})}}),s(at.Item,{onSelect:()=>e.onArchiveSession(g()),get children(){return s(at.ItemLabel,{get children(){return e.t("common.archive")}})}}),s(at.Separator,{}),s(at.Item,{onSelect:()=>e.onDeleteSession(g()),get children(){return s(at.ItemLabel,{get children(){return e.t("common.delete")}})}})]}})}})]}})),p})()}),null),be(g=>ct(c,{"sticky top-0 z-30 bg-background-stronger":!0,"w-full":!0,"px-4 md:px-6":!0,"md:max-w-200 md:mx-auto 3xl:max-w-[1200px]":e.centered},g)),c}}),a);var u=e.setContentRef;return typeof u=="function"?ut(u,a):e.setContentRef=a,d(a,s(P,{get when(){return e.turnStart>0},get children(){var c=pc();return d(c,s(Ue,{variant:"ghost",size:"large",class:"text-12-medium opacity-50",get onClick(){return e.onRenderEarlier},get children(){return e.t("session.messages.renderEarlier")}})),c}}),null),d(a,s(P,{get when(){return e.historyMore},get children(){var c=pc();return d(c,s(Ue,{variant:"ghost",size:"large",class:"text-12-medium opacity-50",get disabled(){return e.historyLoading},get onClick(){return e.onLoadEarlier},get children(){return se(()=>!!e.historyLoading)()?e.t("session.messages.loadingEarlier"):e.t("session.messages.loadEarlier")}})),c}}),null),d(a,s(Ge,{get each(){return e.renderedUserMessages},children:c=>(()=>{var m=t$();return ut(f=>{e.onRegisterMessage(f,c.id),rt(()=>e.onUnregisterMessage(c.id))},m),d(m,s(K2,{get sessionID(){return e.sessionID},get messageID(){return c.id},get lastUserMessageID(){return e.lastUserMessageID},get stepsExpanded(){return e.expanded[c.id]??!1},onStepsExpandedToggle:()=>e.onToggleExpanded(c.id),classes:{root:"min-w-0 w-full relative",content:"flex flex-col justify-between !overflow-visible",container:"w-full px-4 md:px-6"}})),be(f=>{var g=e.anchor(c.id),p=c.id,h={"min-w-0 w-full max-w-full":!0,"md:max-w-200 3xl:max-w-[1200px]":e.centered};return g!==f.e&&Te(m,"id",f.e=g),p!==f.t&&Te(m,"data-message-id",f.t=p),f.a=ct(m,h,f.a),f},{e:void 0,t:void 0,a:void 0}),m})()}),null),be(c=>{var m={"opacity-100 translate-y-0 scale-100":e.scroll.overflow&&!e.scroll.bottom,"opacity-0 translate-y-2 scale-95 pointer-events-none":!e.scroll.overflow||e.scroll.bottom},f=e.showHeader?"40px":"0px",g={"w-full":!0,"md:max-w-200 md:mx-auto 3xl:max-w-[1200px]":e.centered,"mt-0.5":e.centered,"mt-0":!e.centered};return c.e=ct(i,m,c.e),f!==c.t&&Xt(o,"--session-title-height",c.t=f),c.a=ct(a,g,c.a),c},{e:void 0,t:void 0,a:void 0}),r}})}Ut(["click","touchstart","touchmove","touchend","pointerdown","dblclick"]);function r$(e){const n=new Date(e),i=new Date().getTime()-n.getTime(),t=Math.floor(i/1e3),o=Math.floor(t/60),a=Math.floor(o/60),l=Math.floor(a/24);return t<60?"Just now":o<60?`${o}m ago`:a<24?`${a}h ago`:`${l}d ago`}var vc=$('<span class="text-14-regular text-text-weak truncate">'),i$=$('<div class="w-full flex items-center justify-between gap-4"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong whitespace-nowrap">'),o$=$('<span class="text-12-regular text-text-weak whitespace-nowrap ml-2">'),a$=$('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong truncate">'),s$=$('<div class="w-full flex items-center justify-between rounded-md pl-1"><div class="flex items-center gap-x-3 grow min-w-0"><div class="flex items-center text-14-regular"><span class="text-text-weak whitespace-nowrap overflow-hidden overflow-ellipsis truncate min-w-0"></span><span class="text-text-strong whitespace-nowrap">');function xd(e){const n=li(),r=wt(),i=Sr(),t=ci(),o=wn(),a=Bn(),l=si(),u=Yc(),c=hu(),m=()=>e.mode==="files",f=w(()=>`${a.dir}${a.id?"/"+a.id:""}`),g=w(()=>i.tabs(f)),p=w(()=>i.view(f)),h={cleanup:void 0,committed:!1},[v,b]=ze(!1),x=["session.new","workspace.new","session.previous","session.next","terminal.toggle","review.toggle"],R=5,U=w(()=>m()?[]:n.options.filter(z=>!z.disabled&&!z.id.startsWith("suggested.")&&z.id!=="file.open")),A=z=>({id:"command:"+z.id,type:"command",title:z.title,description:z.description,keybind:z.keybind,category:r.t("palette.group.commands"),option:z}),N=z=>({id:"file:"+z,type:"file",title:z,category:r.t("palette.group.files"),path:z}),k=w(()=>wa(a.dir)??""),D=w(()=>{const z=k();if(z)return i.projects.list().find(H=>H.worktree===z||H.sandboxes?.includes(z))}),I=w(()=>{const z=k(),H=D();if(!H)return z?[z]:[];const $e=[H.worktree,...H.sandboxes??[]];return z&&!$e.includes(z)?[...$e,z]:$e}),S=w(()=>c.data.path.home),O=z=>{const H=D(),$e=H&&z===H.worktree?r.t("workspace.type.local"):r.t("workspace.type.sandbox"),[te]=c.child(z,{bootstrap:!1}),he=S(),C=he?z.replace(he,"~"):z,q=te.vcs?.branch??Tt(z);return`${$e} : ${q||C}`},_=z=>({id:`session:${z.directory}:${z.id}`,type:"session",title:z.title,description:z.description,category:r.t("command.category.session"),directory:z.directory,sessionID:z.id,archived:z.archived,updated:z.updated}),M=w(()=>U().map(A)),F=w(()=>{const z=U(),H=new Map(x.map((C,q)=>[C,q])),$e=z.filter(C=>H.has(C.id)),te=$e.length?$e:z.slice(0,R);return($e.length?[...te].sort((C,q)=>(H.get(C.id)??0)-(H.get(q.id)??0)):te).map(A)}),Z=w(()=>{const z=g().all(),H=g().active(),$e=H?[H,...z.filter(C=>C!==H)]:z,te=new Set,he=[];for(const C of $e){const q=t.pathFromTab(C);q&&(te.has(q)||(te.add(q),he.push(N(q))))}return he.slice(0,R)}),B=w(()=>t.tree.children("").filter($e=>$e.type==="file").map($e=>$e.path).sort(($e,te)=>$e.localeCompare(te)).slice(0,R).map(N)),W=z=>{const H=new Set,$e=[];for(const te of z)H.has(te.id)||(H.add(te.id),$e.push(te));return $e},ee={value:0};let Se,X;const ne=z=>{if(!z.trim())return ee.value+=1,Se=void 0,X=void 0,[];if(X)return X;if(Se)return Se;const $e=ee.value,te=I();return te.length===0?[]:(Se=Promise.all(te.map(he=>{const C=O(he);return u.client.session.list({directory:he,roots:!0}).then(q=>(q.data??[]).filter(ie=>!!ie?.id).map(ie=>({id:ie.id,title:ie.title??r.t("command.session.new"),description:C,directory:he,archived:ie.time?.archived,updated:ie.time?.updated}))).catch(()=>[])})).then(he=>{if(ee.value!==$e)return[];const C=new Set,q=he.flat().filter(ie=>{const _e=`${ie.directory}:${ie.id}`;return C.has(_e)?!1:(C.add(_e),!0)}).map(_);return X=q,q}).catch(()=>[]).finally(()=>{Se=void 0}),Se)},ce=async z=>{const H=z.trim();if(b(H.length>0),!H&&m()){const C=t.tree.state("")?.loaded,q=C?Promise.resolve():t.tree.list(""),ie=W([...Z(),...B()]);return C||ie.length>0?ie:(await q,W([...Z(),...B()]))}if(!H)return[...F(),...Z()];if(m())return(await t.searchFiles(H)).map(N);const[$e,te]=await Promise.all([t.searchFiles(H),Promise.resolve(ne(H))]),he=$e.map(N);return[...M(),...te,...he]},fe=z=>{h.cleanup?.(),z&&z.type==="command"&&(h.cleanup=z.option?.onHighlight?.())},me=z=>{const H=t.tab(z);g().open(H),t.load(z),p().reviewPanel.opened()||p().reviewPanel.open(),i.fileTree.open(),i.fileTree.setTab("all"),e.onOpenFile?.(z)},V=z=>{if(z){if(h.committed=!0,h.cleanup=void 0,o.close(),z.type==="command"){z.option?.onSelect?.("palette");return}if(z.type==="session"){if(!z.directory||!z.sessionID)return;l(`/${ei(z.directory)}/session/${z.sessionID}`);return}z.path&&me(z.path)}};return rt(()=>{h.committed||h.cleanup?.()}),s(sr,{class:"pt-3 pb-0 !max-h-[480px]",transition:!0,get children(){return s(tr,{get search(){return{placeholder:m()?r.t("session.header.searchFiles"):r.t("palette.search.placeholder"),autofocus:!0,hideIcon:!0}},get emptyMessage(){return r.t("palette.empty")},get loadingMessage(){return r.t("common.loading")},items:ce,key:z=>z.id,filterKeys:["title","description","category"],get groupBy(){return v()?z=>z.category:()=>""},onMove:fe,onSelect:V,children:z=>s(bt,{get fallback(){return(()=>{var H=s$(),$e=H.firstChild,te=$e.firstChild,he=te.firstChild,C=he.nextSibling;return d($e,s(Tr,{get node(){return{path:z.path??"",type:"file"}},class:"shrink-0 size-4"}),te),d(he,()=>Cr(z.path??"")),d(C,()=>Tt(z.path??"")),H})()},get children(){return[s(De,{get when(){return z.type==="command"},get children(){var H=i$(),$e=H.firstChild,te=$e.firstChild;return d(te,()=>z.title),d($e,s(P,{get when(){return z.description},get children(){var he=vc();return d(he,()=>z.description),he}}),null),d(H,s(P,{get when(){return z.keybind},get children(){return s(Eu,{class:"rounded-[4px]",get children(){return iv(z.keybind??"")}})}}),null),H}}),s(De,{get when(){return z.type==="session"},get children(){var H=a$(),$e=H.firstChild,te=$e.firstChild,he=te.firstChild;return d($e,s(Be,{name:"bubble-5",size:"small",class:"shrink-0 text-icon-weak"}),te),d(he,()=>z.title),d(te,s(P,{get when(){return z.description},get children(){var C=vc();return d(C,()=>z.description),be(()=>C.classList.toggle("opacity-70",!!z.archived)),C}}),null),d(H,s(P,{get when(){return z.updated},get children(){var C=o$();return d(C,()=>r$(new Date(z.updated).toISOString())),C}}),null),be(()=>he.classList.toggle("opacity-70",!!z.archived)),H}})]}})})}})}var l$=$('<div class="w-full flex items-center justify-between gap-x-3"><span></span><div>');const kd=()=>{const e=Dr(),n=wt(),r=wn(),i=()=>{r.show(()=>s(co,{}))};return s(sr,{get title(){return n.t("dialog.model.manage")},get description(){return n.t("dialog.model.manage.description")},get action(){return s(Ue,{class:"h-7 -my-1 text-14-medium",icon:"plus-small",tabIndex:-1,onClick:i,get children(){return n.t("command.provider.connect")}})},get children(){return s(tr,{get search(){return{placeholder:n.t("dialog.model.search.placeholder"),autofocus:!0}},get emptyMessage(){return n.t("dialog.model.empty")},key:t=>`${t?.provider?.id}:${t?.id}`,get items(){return e.model.list()},filterKeys:["provider.name","name","id"],sortBy:(t,o)=>t.name.localeCompare(o.name),groupBy:t=>t.provider.name,sortGroupsBy:(t,o)=>{const a=t.items[0].provider.id,l=o.items[0].provider.id;return Nt.includes(a)&&!Nt.includes(l)?-1:!Nt.includes(a)&&Nt.includes(l)?1:Nt.indexOf(a)-Nt.indexOf(l)},onSelect:t=>{if(!t)return;const o=e.model.visible({modelID:t.id,providerID:t.provider.id});e.model.setVisibility({modelID:t.id,providerID:t.provider.id},!o)},children:t=>(()=>{var o=l$(),a=o.firstChild,l=a.nextSibling;return d(a,()=>t.name),l.$$click=u=>u.stopPropagation(),d(l,s(_a,{get checked(){return!!e.model.visible({modelID:t.id,providerID:t.provider.id})},onChange:u=>{e.model.setVisibility({modelID:t.id,providerID:t.provider.id},u)}})),o})()})}})};Ut(["click"]);var c$=$('<div class="flex flex-col gap-1 py-1"><div class=text-13-medium></div><div class="text-12-regular text-text-invert-base"></div><div class="text-12-regular text-text-invert-base">'),u$=$('<div class="text-12-regular text-text-invert-base">');const Sd=e=>{const n=wt(),r=u=>{const c=`${u.id} ${u.name}`.toLowerCase();return/claude|anthropic/.test(c)?n.t("model.provider.anthropic"):/gpt|o[1-4]|codex|openai/.test(c)?n.t("model.provider.openai"):/gemini|palm|bard|google/.test(c)?n.t("model.provider.google"):/grok|xai/.test(c)?n.t("model.provider.xai"):/llama|meta/.test(c)?n.t("model.provider.meta"):u.provider.name},i=u=>u==="text"?n.t("model.input.text"):u==="image"?n.t("model.input.image"):u==="audio"?n.t("model.input.audio"):u==="video"?n.t("model.input.video"):u==="pdf"?n.t("model.input.pdf"):u,t=()=>{const u=[];e.latest&&u.push(n.t("model.tag.latest")),e.free&&u.push(n.t("model.tag.free"));const c=u.length?` (${u.join(", ")})`:"";return`${r(e.model)} ${e.model.name}${c}`},o=()=>{if(e.model.capabilities){const m=e.model.capabilities.input,g=["text","image","audio","video","pdf"].filter(p=>m[p]).map(p=>i(p));return g.length?g.join(", "):void 0}const u=e.model.modalities?.input;if(!u)return;const c=u.map(m=>i(m));return c.length?c.join(", "):void 0},a=()=>e.model.capabilities?e.model.capabilities.reasoning?n.t("model.tooltip.reasoning.allowed"):n.t("model.tooltip.reasoning.none"):e.model.reasoning?n.t("model.tooltip.reasoning.allowed"):n.t("model.tooltip.reasoning.none"),l=()=>n.t("model.tooltip.context",{limit:e.model.limit.context.toLocaleString()});return(()=>{var u=c$(),c=u.firstChild,m=c.nextSibling,f=m.nextSibling;return d(c,t),d(u,s(P,{get when(){return o()},children:g=>(()=>{var p=u$();return d(p,()=>n.t("model.tooltip.allows",{inputs:g()})),p})()}),m),d(m,a),d(f,l),u})()};var d$=$('<div class="w-full flex items-center gap-x-2 text-13-regular"><span class=truncate>'),f$=$('<div class="flex items-center gap-1">');const Id=e=>{const n=Dr(),r=wt(),i=w(()=>n.model.list().filter(t=>n.model.visible({modelID:t.id,providerID:t.provider.id})).filter(t=>e.provider?t.provider.id===e.provider:!0));return s(tr,{get class(){return`flex-1 min-h-0 [&_[data-slot=list-scroll]]:flex-1 [&_[data-slot=list-scroll]]:min-h-0 ${e.class??""}`},get search(){return{placeholder:r.t("dialog.model.search.placeholder"),autofocus:!0,action:e.action}},get emptyMessage(){return r.t("dialog.model.empty")},key:t=>`${t.provider.id}:${t.id}`,items:i,get current(){return n.model.current()},filterKeys:["provider.name","name","id"],sortBy:(t,o)=>t.name.localeCompare(o.name),groupBy:t=>t.provider.name,sortGroupsBy:(t,o)=>{const a=t.items[0].provider.id,l=o.items[0].provider.id;return Nt.includes(a)&&!Nt.includes(l)?-1:!Nt.includes(a)&&Nt.includes(l)?1:Nt.indexOf(a)-Nt.indexOf(l)},itemWrapper:(t,o)=>s(Zt,{class:"w-full",placement:"right-start",gutter:12,get value(){return s(Sd,{model:t,get latest(){return t.latest},get free(){return se(()=>t.provider.id==="nikcli")()&&(!t.cost||t.cost.input===0)}})},children:o}),onSelect:t=>{n.model.set(t?{modelID:t.id,providerID:t.provider.id}:void 0,{recent:!0}),e.onSelect()},children:t=>(()=>{var o=d$(),a=o.firstChild;return d(a,()=>t.name),d(o,s(P,{get when(){return se(()=>t.provider.id==="nikcli")()&&(!t.cost||t.cost?.input===0)},get children(){return s(Qr,{get children(){return r.t("model.tag.free")}})}}),null),d(o,s(P,{get when(){return t.latest},get children(){return s(Qr,{get children(){return r.t("model.tag.latest")}})}}),null),o})()})};function m$(e){const[n,r]=It({open:!1,dismiss:null,trigger:void 0,content:void 0}),i=wn(),t=()=>{r("open",!1),i.show(()=>s(kd,{}))},o=()=>{r("open",!1),i.show(()=>s(co,{}))},a=wt();return re(()=>{if(!n.open)return;const l=f=>{if(!f)return!1;const g=n.content;if(g&&g.contains(f))return!0;const p=n.trigger;return!!(p&&p.contains(f))},u=f=>{f.key==="Escape"&&(r("dismiss","escape"),r("open",!1),f.preventDefault(),f.stopPropagation())},c=f=>{const g=f.target;g instanceof Node&&(l(g)||(r("dismiss","outside"),r("open",!1)))},m=f=>{if(!n.content)return;const g=f.target;g instanceof Node&&(l(g)||(r("dismiss","outside"),r("open",!1)))};window.addEventListener("keydown",u,!0),window.addEventListener("pointerdown",c,!0),window.addEventListener("focusin",m,!0),rt(()=>{window.removeEventListener("keydown",u,!0),window.removeEventListener("pointerdown",c,!0),window.removeEventListener("focusin",m,!0)})}),s(Vt,{get open(){return n.open},onOpenChange:l=>{l&&r("dismiss",null),r("open",l)},modal:!1,placement:"top-start",gutter:8,get children(){return[s(Vt.Trigger,Ce({ref:l=>r("trigger",l),get as(){return e.triggerAs??"div"}},()=>e.triggerProps,{get children(){return e.children}})),s(Vt.Portal,{get children(){return s(Vt.Content,{ref:l=>r("content",l),class:"w-72 h-80 flex flex-col p-2 rounded-md border border-border-base bg-surface-raised-stronger-non-alpha shadow-md z-50 outline-none overflow-hidden",onEscapeKeyDown:l=>{r("dismiss","escape"),r("open",!1),l.preventDefault(),l.stopPropagation()},onPointerDownOutside:()=>{r("dismiss","outside"),r("open",!1)},onFocusOutside:()=>{r("dismiss","outside"),r("open",!1)},onCloseAutoFocus:l=>{n.dismiss==="outside"&&l.preventDefault(),r("dismiss",null)},get children(){return[s(Vt.Title,{class:"sr-only",get children(){return a.t("dialog.model.select.title")}}),s(Id,{get provider(){return e.provider},onSelect:()=>r("open",!1),class:"p-1",get action(){return(()=>{var l=f$();return d(l,s(Zt,{placement:"top",get value(){return a.t("command.provider.connect")},get children(){return s(zt,{icon:"plus-small",variant:"ghost",iconSize:"normal",class:"size-6",get"aria-label"(){return a.t("command.provider.connect")},onClick:o})}}),null),d(l,s(Zt,{placement:"top",get value(){return a.t("dialog.model.manage")},get children(){return s(zt,{icon:"sliders",variant:"ghost",iconSize:"normal",class:"size-6",get"aria-label"(){return a.t("dialog.model.manage")},onClick:t})}}),null),l})()}})]}})}})]}})}const g$=e=>{const n=wn(),r=wt();return s(sr,{get title(){return r.t("dialog.model.select.title")},get action(){return s(Ue,{class:"h-7 -my-1 text-14-medium",icon:"plus-small",tabIndex:-1,onClick:()=>n.show(()=>s(co,{})),get children(){return r.t("command.provider.connect")}})},get children(){return[s(Id,{get provider(){return e.provider},onSelect:()=>n.close()}),s(Ue,{variant:"ghost",class:"ml-3 mt-5 mb-6 text-text-base self-start",onClick:()=>n.show(()=>s(kd,{})),get children(){return r.t("dialog.model.manage")}})]}})};var Ui=$('<span class="text-11-regular text-text-weaker">'),h$=$('<span class="text-11-regular text-text-weak">'),p$=$('<span class="text-11-regular text-text-weaker truncate">'),v$=$('<div class="w-full flex items-center justify-between gap-x-3"><div class="flex flex-col gap-0.5 min-w-0"><div class="flex items-center gap-2"><span class=truncate></span></div></div><div>');const b$=()=>{const e=_n(),n=Dn(),r=wt(),[i,t]=ze(null),o=w(()=>Object.entries(e.data.mcp??{}).map(([c,m])=>({name:c,status:m.status})).sort((c,m)=>c.name.localeCompare(m.name))),a=async c=>{if(i())return;t(c),e.data.mcp[c]?.status==="connected"?await n.client.mcp.disconnect({name:c}):await n.client.mcp.connect({name:c});const f=await n.client.mcp.status();f.data&&e.set("mcp",f.data),t(null)},l=w(()=>o().filter(c=>c.status==="connected").length),u=w(()=>o().length);return s(sr,{get title(){return r.t("dialog.mcp.title")},get description(){return r.t("dialog.mcp.description",{enabled:l(),total:u()})},get children(){return s(tr,{get search(){return{placeholder:r.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return r.t("dialog.mcp.empty")},key:c=>c?.name??"",items:o,filterKeys:["name","status"],sortBy:(c,m)=>c.name.localeCompare(m.name),onSelect:c=>{c&&a(c.name)},children:c=>{const m=()=>e.data.mcp[c.name],f=()=>m()?.status,g=()=>{const h=m();return h?.status==="failed"?h.error:void 0},p=()=>f()==="connected";return(()=>{var h=v$(),v=h.firstChild,b=v.firstChild,x=b.firstChild,R=v.nextSibling;return d(x,()=>c.name),d(b,s(P,{get when(){return f()==="connected"},get children(){var U=Ui();return d(U,()=>r.t("mcp.status.connected")),U}}),null),d(b,s(P,{get when(){return f()==="failed"},get children(){var U=Ui();return d(U,()=>r.t("mcp.status.failed")),U}}),null),d(b,s(P,{get when(){return f()==="needs_auth"},get children(){var U=Ui();return d(U,()=>r.t("mcp.status.needs_auth")),U}}),null),d(b,s(P,{get when(){return f()==="disabled"},get children(){var U=Ui();return d(U,()=>r.t("mcp.status.disabled")),U}}),null),d(b,s(P,{get when(){return i()===c.name},get children(){var U=h$();return d(U,()=>r.t("common.loading.ellipsis")),U}}),null),d(v,s(P,{get when(){return g()},get children(){var U=p$();return d(U,g),U}}),null),R.$$click=U=>U.stopPropagation(),d(R,s(_a,{get checked(){return p()},get disabled(){return i()===c.name},onChange:()=>a(c.name)})),h})()}})}})};Ut(["click"]);function y$(e){const n=e.indexOf("?");if(n===-1)return;const r=new URLSearchParams(e.slice(n+1)),i=Number(r.get("start")),t=Number(r.get("end"));if(!(!Number.isFinite(i)||!Number.isFinite(t)))return{startLine:i,endLine:t,startChar:0,endChar:0}}function $$(e){return e.filter(r=>r.type==="text").filter(r=>!r.synthetic&&!r.ignored).reduce((r,i)=>!r||i.text.length>r.text.length?i:r,void 0)}function Td(e,n){const i=$$(e)?.text??"",t=n?.directory,o=n?.attachmentName??"attachment",a=v=>{if(!t)return v;const b=t.endsWith("/")?t:t+"/";if(v.startsWith(b))return v.slice(b.length);if(v.startsWith(t)){const x=v.slice(t.length);return x.startsWith("/")?x.slice(1):x}return v},l=[],u=[];for(const v of e){if(v.type==="file"){const b=v,x=b.source?.text;if(x){const R=x.value,U=x.start,A=x.end;let N=R;R.startsWith("@")&&(N=R.slice(1)),!R.startsWith("@")&&b.source&&"path"in b.source&&(N=b.source.path),l.push({type:"file",start:U,end:A,value:R,path:a(N),selection:y$(b.url)});continue}b.url.startsWith("data:")&&u.push({type:"image",id:b.id,filename:b.filename??o,mime:b.mime,dataUrl:b.url})}if(v.type==="agent"){const b=v,x=b.source;if(!x)continue;l.push({type:"agent",start:x.start,end:x.end,value:x.value,name:b.name})}}l.sort((v,b)=>v.start!==b.start?v.start-b.start:v.end-b.end);const c=[];let m=0,f=0;const g=v=>{v&&(c.push({type:"text",content:v,start:m,end:m+v.length}),m+=v.length)},p=v=>{const b=v.value,x={type:"file",path:v.path,content:b,start:m,end:m+b.length,selection:v.selection};c.push(x),m+=b.length},h=v=>{const b=v.value,x={type:"agent",name:v.name,content:b,start:m,end:m+b.length};c.push(x),m+=b.length};for(const v of l){if(v.start<0||v.end<v.start)continue;const b=v.value;if(!b)continue;const x=v.end>i.length||v.start<f||i.slice(v.start,v.end)!==b,R=x?i.indexOf(b,f):v.start;if(R===-1)continue;const U=x?R+b.length:v.end;g(i.slice(f,R)),v.type==="file"&&p(v),v.type==="agent"&&h(v),f=U}return g(i.slice(f)),c.length===0&&c.push({type:"text",content:"",start:0,end:0}),u.length===0?c:[...c,...u]}var _$=$('<div class="w-full flex items-center gap-2"><span class="truncate flex-1 min-w-0 text-left font-normal"></span><span class="text-text-weak shrink-0 font-normal">');function w$(e){return e.toLocaleTimeString(void 0,{timeStyle:"short"})}const x$=()=>{const e=Bn(),n=si(),r=_n(),i=Dn(),t=di(),o=wn(),a=wt(),l=w(()=>{const c=e.id;if(!c)return[];const m=r.data.message[c]??[],f=[];for(const g of m){if(g.role!=="user")continue;const h=(r.data.part[g.id]??[]).find(v=>v.type==="text"&&!v.synthetic&&!v.ignored);h&&f.push({id:g.id,text:h.text.replace(/\n/g," ").slice(0,200),time:w$(new Date(g.time.created))})}return f.reverse()}),u=c=>{if(!c)return;const m=e.id;if(!m)return;const f=r.data.part[c.id]??[],g=Td(f,{directory:i.directory,attachmentName:a.t("common.attachment")});o.close(),i.client.session.fork({sessionID:m,messageID:c.id}).then(p=>{p.data&&(n(`/${ei(i.directory)}/session/${p.data.id}`),requestAnimationFrame(()=>{t.set(g)}))})};return s(sr,{get title(){return a.t("command.session.fork")},get children(){return s(tr,{class:"flex-1 min-h-0 [&_[data-slot=list-scroll]]:flex-1 [&_[data-slot=list-scroll]]:min-h-0",get search(){return{placeholder:a.t("common.search.placeholder"),autofocus:!0}},get emptyMessage(){return a.t("dialog.fork.empty")},key:c=>c.id,items:l,filterKeys:["text"],onSelect:u,children:c=>(()=>{var m=_$(),f=m.firstChild,g=f.nextSibling;return d(f,()=>c.text),d(g,()=>c.time),m})()})}})},k$=e=>{if(!e.active)return!1;const n=e.pathFromTab(e.active);return n?e.selectedLines(n)!=null:!1},S$=e=>{const n=w(()=>[{id:"session.new",title:e.language.t("command.session.new"),category:e.language.t("command.category.session"),keybind:"mod+shift+s",slash:"new",onSelect:()=>e.navigate(`/${e.params.dir}/session`)}]),r=w(()=>[{id:"file.open",title:e.language.t("command.file.open"),description:e.language.t("palette.search.placeholder"),category:e.language.t("command.category.file"),keybind:"mod+p",slash:"open",onSelect:()=>e.dialog.show(()=>s(xd,{get onOpenFile(){return e.showAllFiles}}))},{id:"tab.close",title:e.language.t("command.tab.close"),category:e.language.t("command.category.file"),keybind:"mod+w",disabled:!e.tabs().active(),onSelect:()=>{const m=e.tabs().active();m&&e.tabs().close(m)}}]),i=w(()=>[{id:"context.addSelection",title:e.language.t("command.context.addSelection"),description:e.language.t("command.context.addSelection.description"),category:e.language.t("command.category.context"),keybind:"mod+shift+l",disabled:!k$({active:e.tabs().active(),pathFromTab:e.file.pathFromTab,selectedLines:e.file.selectedLines}),onSelect:()=>{const m=e.tabs().active();if(!m)return;const f=e.file.pathFromTab(m);if(!f)return;const g=e.file.selectedLines(f);if(!g){lt({title:e.language.t("toast.context.noLineSelection.title"),description:e.language.t("toast.context.noLineSelection.description")});return}e.addSelectionToContext(f,$u(g))}}]),t=w(()=>[{id:"terminal.toggle",title:e.language.t("command.terminal.toggle"),description:"",category:e.language.t("command.category.view"),keybind:"ctrl+`",slash:"terminal",onSelect:()=>e.view().terminal.toggle()},{id:"review.toggle",title:e.language.t("command.review.toggle"),description:"",category:e.language.t("command.category.view"),keybind:"mod+shift+r",onSelect:()=>e.view().reviewPanel.toggle()},{id:"fileTree.toggle",title:e.language.t("command.fileTree.toggle"),description:"",category:e.language.t("command.category.view"),keybind:"mod+\\",onSelect:()=>e.layout.fileTree.toggle()},{id:"input.focus",title:e.language.t("command.input.focus"),category:e.language.t("command.category.view"),keybind:"ctrl+l",onSelect:()=>e.focusInput()},{id:"terminal.new",title:e.language.t("command.terminal.new"),description:e.language.t("command.terminal.new.description"),category:e.language.t("command.category.terminal"),keybind:"ctrl+alt+t",onSelect:()=>{e.terminal.all().length>0&&e.terminal.new(),e.view().terminal.open()}},{id:"steps.toggle",title:e.language.t("command.steps.toggle"),description:e.language.t("command.steps.toggle.description"),category:e.language.t("command.category.view"),keybind:"mod+e",slash:"steps",disabled:!e.params.id,onSelect:()=>{const m=e.activeMessage();m&&e.setExpanded(m.id,f=>!f)}}]),o=w(()=>[{id:"message.previous",title:e.language.t("command.message.previous"),description:e.language.t("command.message.previous.description"),category:e.language.t("command.category.session"),keybind:"mod+arrowup",disabled:!e.params.id,onSelect:()=>e.navigateMessageByOffset(-1)},{id:"message.next",title:e.language.t("command.message.next"),description:e.language.t("command.message.next.description"),category:e.language.t("command.category.session"),keybind:"mod+arrowdown",disabled:!e.params.id,onSelect:()=>e.navigateMessageByOffset(1)}]),a=w(()=>[{id:"model.choose",title:e.language.t("command.model.choose"),description:e.language.t("command.model.choose.description"),category:e.language.t("command.category.model"),keybind:"mod+'",slash:"model",onSelect:()=>e.dialog.show(()=>s(g$,{}))},{id:"mcp.toggle",title:e.language.t("command.mcp.toggle"),description:e.language.t("command.mcp.toggle.description"),category:e.language.t("command.category.mcp"),keybind:"mod+;",slash:"mcp",onSelect:()=>e.dialog.show(()=>s(b$,{}))},{id:"agent.cycle",title:e.language.t("command.agent.cycle"),description:e.language.t("command.agent.cycle.description"),category:e.language.t("command.category.agent"),keybind:"mod+.",slash:"agent",onSelect:()=>e.local.agent.move(1)},{id:"agent.cycle.reverse",title:e.language.t("command.agent.cycle.reverse"),description:e.language.t("command.agent.cycle.reverse.description"),category:e.language.t("command.category.agent"),keybind:"shift+mod+.",onSelect:()=>e.local.agent.move(-1)},{id:"model.variant.cycle",title:e.language.t("command.model.variant.cycle"),description:e.language.t("command.model.variant.cycle.description"),category:e.language.t("command.category.model"),keybind:"shift+mod+d",onSelect:()=>{e.local.model.variant.cycle()}}]),l=w(()=>[{id:"permissions.autoaccept",title:e.params.id&&e.permission.isAutoAccepting(e.params.id,e.sdk.directory)?e.language.t("command.permissions.autoaccept.disable"):e.language.t("command.permissions.autoaccept.enable"),category:e.language.t("command.category.permissions"),keybind:"mod+shift+a",disabled:!e.params.id||!e.permission.permissionsEnabled(),onSelect:()=>{const m=e.params.id;m&&(e.permission.toggleAutoAccept(m,e.sdk.directory),lt({title:e.permission.isAutoAccepting(m,e.sdk.directory)?e.language.t("toast.permissions.autoaccept.on.title"):e.language.t("toast.permissions.autoaccept.off.title"),description:e.permission.isAutoAccepting(m,e.sdk.directory)?e.language.t("toast.permissions.autoaccept.on.description"):e.language.t("toast.permissions.autoaccept.off.description")}))}}]),u=w(()=>[{id:"session.undo",title:e.language.t("command.session.undo"),description:e.language.t("command.session.undo.description"),category:e.language.t("command.category.session"),slash:"undo",disabled:!e.params.id||e.visibleUserMessages().length===0,onSelect:async()=>{const m=e.params.id;if(!m)return;e.status()?.type!=="idle"&&await e.sdk.client.session.abort({sessionID:m}).catch(()=>{});const f=e.info()?.revert?.messageID,g=hr(e.userMessages(),v=>!f||v.id<f);if(!g)return;await e.sdk.client.session.revert({sessionID:m,messageID:g.id});const p=e.sync.data.part[g.id];if(p){const v=Td(p,{directory:e.sdk.directory});e.prompt.set(v)}const h=hr(e.userMessages(),v=>v.id<g.id);e.setActiveMessage(h)}},{id:"session.redo",title:e.language.t("command.session.redo"),description:e.language.t("command.session.redo.description"),category:e.language.t("command.category.session"),slash:"redo",disabled:!e.params.id||!e.info()?.revert?.messageID,onSelect:async()=>{const m=e.params.id;if(!m)return;const f=e.info()?.revert?.messageID;if(!f)return;const g=e.userMessages().find(h=>h.id>f);if(!g){await e.sdk.client.session.unrevert({sessionID:m}),e.prompt.reset();const h=hr(e.userMessages(),v=>v.id>=f);e.setActiveMessage(h);return}await e.sdk.client.session.revert({sessionID:m,messageID:g.id});const p=hr(e.userMessages(),h=>h.id<g.id);e.setActiveMessage(p)}},{id:"session.compact",title:e.language.t("command.session.compact"),description:e.language.t("command.session.compact.description"),category:e.language.t("command.category.session"),slash:"compact",disabled:!e.params.id||e.visibleUserMessages().length===0,onSelect:async()=>{const m=e.params.id;if(!m)return;const f=e.local.model.current();if(!f){lt({title:e.language.t("toast.model.none.title"),description:e.language.t("toast.model.none.description")});return}await e.sdk.client.session.summarize({sessionID:m,modelID:f.id,providerID:f.provider.id})}},{id:"session.fork",title:e.language.t("command.session.fork"),description:e.language.t("command.session.fork.description"),category:e.language.t("command.category.session"),slash:"fork",disabled:!e.params.id||e.visibleUserMessages().length===0,onSelect:()=>e.dialog.show(()=>s(x$,{}))}]),c=w(()=>e.sync.data.config.share==="disabled"?[]:[{id:"session.share",title:e.info()?.share?.url?"Copy share link":e.language.t("command.session.share"),description:e.info()?.share?.url?"Copy share URL to clipboard":e.language.t("command.session.share.description"),category:e.language.t("command.category.session"),slash:"share",disabled:!e.params.id,onSelect:async()=>{if(!e.params.id)return;const m=(g,p)=>navigator.clipboard.writeText(g).then(()=>lt({title:p?e.language.t("session.share.copy.copied"):e.language.t("toast.session.share.success.title"),description:e.language.t("toast.session.share.success.description"),variant:"success"})).catch(()=>lt({title:e.language.t("toast.session.share.copyFailed.title"),variant:"error"})),f=e.info()?.share?.url;if(f){await m(f,!0);return}await e.sdk.client.session.share({sessionID:e.params.id}).then(g=>m(g.data.share.url,!1)).catch(()=>lt({title:e.language.t("toast.session.share.failed.title"),description:e.language.t("toast.session.share.failed.description"),variant:"error"}))}},{id:"session.unshare",title:e.language.t("command.session.unshare"),description:e.language.t("command.session.unshare.description"),category:e.language.t("command.category.session"),slash:"unshare",disabled:!e.params.id||!e.info()?.share?.url,onSelect:async()=>{e.params.id&&await e.sdk.client.session.unshare({sessionID:e.params.id}).then(()=>lt({title:e.language.t("toast.session.unshare.success.title"),description:e.language.t("toast.session.unshare.success.description"),variant:"success"})).catch(()=>lt({title:e.language.t("toast.session.unshare.failed.title"),description:e.language.t("toast.session.unshare.failed.description"),variant:"error"}))}}]);e.command.register("session",()=>cb([n(),r(),i(),t(),o(),a(),l(),u(),c()]))};function I$(e){const[n,r]=ov(!1,()=>document.activeElement===e);return Dl(e,"blur",()=>r(!1),!0),Dl(e,"focus",()=>r(!0),!0),n}var T$=$('<div class="flex flex-col gap-3 px-2.5"><div class="text-14-medium text-text-base px-2.5">'),C$=$('<div class="px-1.5 pb-1.5"><div class="w-full rounded-sm border border-border-weak-base bg-surface-raised-base"><div class="w-full flex flex-col items-start gap-4 px-1.5 pt-4 pb-4"><div class="px-2 text-14-medium text-text-base"></div><div class=w-full>'),D$=$('<div class="w-full flex items-center gap-x-2.5"><span>'),z$=$('<div class="text-14-regular text-text-weak">'),E$=$('<div class="w-full flex items-center gap-x-3"><span>');const O$=()=>{const e=Dr(),n=wn(),r=pu(),i=wt();let t;const o=a=>{a.key!=="Escape"&&t?.onKeyDown(a)};return lo(()=>{document.addEventListener("keydown",o),rt(()=>{document.removeEventListener("keydown",o)})}),s(sr,{get title(){return i.t("dialog.model.select.title")},class:"overflow-y-auto [&_[data-slot=dialog-body]]:overflow-visible [&_[data-slot=dialog-body]]:flex-none",get children(){return[(()=>{var a=T$(),l=a.firstChild;return d(l,()=>i.t("dialog.model.unpaid.freeModels.title")),d(a,s(tr,{class:"[&_[data-slot=list-scroll]]:overflow-visible",ref:u=>t=u,get items(){return e.model.list},get current(){return e.model.current()},key:u=>`${u.provider.id}:${u.id}`,itemWrapper:(u,c)=>s(Zt,{class:"w-full",placement:"right-start",gutter:12,get value(){return s(Sd,{model:u,get latest(){return u.latest},get free(){return se(()=>u.provider.id==="nikcli")()&&(!u.cost||u.cost.input===0)}})},children:c}),onSelect:u=>{e.model.set(u?{modelID:u.id,providerID:u.provider.id}:void 0,{recent:!0}),n.close()},children:u=>(()=>{var c=D$(),m=c.firstChild;return d(m,()=>u.name),d(c,s(Qr,{get children(){return i.t("model.tag.free")}}),null),d(c,s(P,{get when(){return u.latest},get children(){return s(Qr,{get children(){return i.t("model.tag.latest")}})}}),null),c})()}),null),a})(),(()=>{var a=C$(),l=a.firstChild,u=l.firstChild,c=u.firstChild,m=c.nextSibling;return d(c,()=>i.t("dialog.model.unpaid.addMore.title")),d(m,s(tr,{class:"w-full px-0",key:f=>f?.id,get items(){return r.popular},activeIcon:"plus-small",sortBy:(f,g)=>Nt.includes(f.id)&&Nt.includes(g.id)?Nt.indexOf(f.id)-Nt.indexOf(g.id):f.name.localeCompare(g.name),onSelect:f=>{f&&n.show(()=>s(av,{get provider(){return f.id}}))},children:f=>(()=>{var g=E$(),p=g.firstChild;return d(g,s(na,{"data-slot":"list-item-extra-icon",get id(){return f.id}}),p),d(p,()=>f.name),d(g,s(P,{get when(){return f.id==="nikcli"},get children(){return s(Qr,{get children(){return i.t("dialog.provider.tag.recommended")}})}}),null),d(g,s(P,{get when(){return f.id==="anthropic"},get children(){var h=z$();return d(h,()=>i.t("dialog.provider.anthropic.note")),h}}),null),g})()}),null),d(m,s(Ue,{variant:"ghost",class:"w-full justify-start px-[11px] py-3.5 gap-4.5 text-14-medium",icon:"dot-grid",onClick:()=>{n.show(()=>s(co,{}))},get children(){return i.t("dialog.provider.viewAll")}}),null),a})()]}})};var A$=$("<svg><circle cx=8 cy=8 data-slot=progress-circle-background></circle><circle cx=8 cy=8 data-slot=progress-circle-progress>");function P$(e){const[n,r]=Ve(e,["percentage","size","strokeWidth","class","classList"]),i=()=>n.size||16,t=()=>n.strokeWidth||3,o=16,a=o/2,l=()=>a-t()/2,u=w(()=>2*Math.PI*l()),c=w(()=>{const f=Math.max(0,Math.min(100,n.percentage||0))/100;return u()*(1-f)});return(()=>{var m=A$(),f=m.firstChild,g=f.nextSibling;return ii(m,Ce(r,{get width(){return i()},get height(){return i()},viewBox:`0 0 ${o} ${o}`,fill:"none","data-component":"progress-circle",get classList(){return{...n.classList??{},[n.class??""]:!!n.class}}}),!0,!0),be(p=>{var h=l(),v=t(),b=l(),x=t(),R=u().toString(),U=c();return h!==p.e&&Te(f,"r",p.e=h),v!==p.t&&Te(f,"stroke-width",p.t=v),b!==p.a&&Te(g,"r",p.a=b),x!==p.o&&Te(g,"stroke-width",p.o=x),R!==p.i&&Te(g,"stroke-dasharray",p.i=R),U!==p.n&&Te(g,"stroke-dashoffset",p.n=U),p},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),m})()}var N$=$('<div class="flex items-center justify-center">'),j$=$('<div><div class="flex items-center gap-2"><span class=text-text-invert-strong></span><span class=text-text-invert-base>'),U$=$('<div class="flex items-center gap-2"><span class=text-text-invert-strong></span><span class=text-text-invert-base>'),L$=$('<div class="flex items-center gap-2"><span class=text-text-invert-strong>%</span><span class=text-text-invert-base>');function Cd(e){const n=_n(),r=Bn(),i=Sr(),t=wt(),o=w(()=>e.variant??"button"),a=w(()=>`${r.dir}${r.id?"/"+r.id:""}`),l=w(()=>i.tabs(a)),u=w(()=>i.view(a)),c=w(()=>r.id?n.data.message[r.id]??[]:[]),m=w(()=>new Intl.NumberFormat(t.locale(),{style:"currency",currency:"USD"})),f=w(()=>Hu(c(),n.data.provider.all)),g=w(()=>f().context),p=w(()=>m().format(f().totalCost)),h=()=>{r.id&&(u().reviewPanel.opened()||u().reviewPanel.open(),i.fileTree.open(),i.fileTree.setTab("all"),l().open("context"),l().setActive("context"))},v=()=>(()=>{var x=N$();return d(x,s(P$,{size:16,strokeWidth:2,get percentage(){return g()?.usage??0}})),x})(),b=()=>(()=>{var x=j$(),R=x.firstChild,U=R.firstChild,A=U.nextSibling;return d(x,s(P,{get when(){return g()},children:N=>[(()=>{var k=U$(),D=k.firstChild,I=D.nextSibling;return d(D,()=>N().total.toLocaleString(t.locale())),d(I,()=>t.t("context.usage.tokens")),k})(),(()=>{var k=L$(),D=k.firstChild,I=D.firstChild,S=D.nextSibling;return d(D,()=>N().usage??0,I),d(S,()=>t.t("context.usage.usage")),k})()]}),R),d(U,p),d(A,()=>t.t("context.usage.cost")),x})();return s(P,{get when(){return r.id},get children(){return s(Zt,{get value(){return b()},placement:"top",get children(){return s(bt,{get children(){return[s(De,{get when(){return o()==="indicator"},get children(){return v()}}),s(De,{when:!0,get children(){return s(Ue,{type:"button",variant:"ghost",class:"size-6",onClick:h,get"aria-label"(){return t.t("context.usage.view")},get children(){return v()}})}})]}})}})}})}function bc(e){const n=document.createDocumentFragment(),r=e.split(`
|
|
12
|
+
`);return r.forEach((i,t)=>{i?n.appendChild(document.createTextNode(i)):r.length>1&&n.appendChild(document.createTextNode("")),t<r.length-1&&n.appendChild(document.createElement("br"))}),n}function Dd(e){return e.nodeType===Node.ELEMENT_NODE&&e.tagName==="BR"?1:(e.textContent??"").replace(/\u200B/g,"").length}function zd(e){if(e.nodeType===Node.TEXT_NODE)return(e.textContent??"").replace(/\u200B/g,"").length;if(e.nodeType===Node.ELEMENT_NODE&&e.tagName==="BR")return 1;let n=0;for(const r of Array.from(e.childNodes))n+=zd(r);return n}function Mn(e){const n=window.getSelection();if(!n||n.rangeCount===0)return 0;const r=n.getRangeAt(0);if(!e.contains(r.startContainer))return 0;const i=r.cloneRange();return i.selectNodeContents(e),i.setEnd(r.startContainer,r.startOffset),zd(i.cloneContents())}function Jr(e,n){let r=n,i=e.firstChild;for(;i;){const l=Dd(i),u=i.nodeType===Node.TEXT_NODE,c=i.nodeType===Node.ELEMENT_NODE&&(i.dataset.type==="file"||i.dataset.type==="agent"),m=i.nodeType===Node.ELEMENT_NODE&&i.tagName==="BR";if(u&&r<=l){const f=document.createRange(),g=window.getSelection();f.setStart(i,r),f.collapse(!0),g?.removeAllRanges(),g?.addRange(f);return}if((c||m)&&r<=l){const f=document.createRange(),g=window.getSelection();if(r===0&&f.setStartBefore(i),r>0&&c&&f.setStartAfter(i),r>0&&m){const p=i.nextSibling;p&&p.nodeType===Node.TEXT_NODE&&f.setStart(p,0),(!p||p.nodeType!==Node.TEXT_NODE)&&f.setStartAfter(i)}f.collapse(!0),g?.removeAllRanges(),g?.addRange(f);return}r-=l,i=i.nextSibling}const t=document.createRange(),o=window.getSelection(),a=e.lastChild;if(a&&a.nodeType===Node.TEXT_NODE){const l=a.textContent?a.textContent.length:0;t.setStart(a,l)}(!a||a.nodeType!==Node.TEXT_NODE)&&t.selectNodeContents(e),t.collapse(!1),o?.removeAllRanges(),o?.addRange(t)}function yc(e,n,r,i){let t=i;const o=Array.from(e.childNodes);for(const a of o){const l=Dd(a),u=a.nodeType===Node.TEXT_NODE,c=a.nodeType===Node.ELEMENT_NODE&&(a.dataset.type==="file"||a.dataset.type==="agent"),m=a.nodeType===Node.ELEMENT_NODE&&a.tagName==="BR";if(u&&t<=l){r==="start"&&n.setStart(a,t),r==="end"&&n.setEnd(a,t);return}if((c||m)&&t<=l){r==="start"&&t===0&&n.setStartBefore(a),r==="start"&&t>0&&n.setStartAfter(a),r==="end"&&t===0&&n.setEndBefore(a),r==="end"&&t>0&&n.setEndAfter(a);return}t-=l}}const R$=["image/png","image/jpeg","image/gif","image/webp"],Bi=[...R$,"application/pdf"];function M$(e){const n=di(),r=wt(),i=async c=>{if(!Bi.includes(c.type))return;const m=new FileReader;m.onload=()=>{const f=e.editor();if(!f)return;const g=m.result,p={type:"image",id:crypto.randomUUID(),filename:c.name,mime:c.type,dataUrl:g},h=n.cursor()??Mn(f);n.set([...n.current(),p],h)},m.readAsDataURL(c)},t=c=>{const f=n.current().filter(g=>g.type!=="image"||g.id!==c);n.set(f,n.cursor())},o=async c=>{if(!e.isFocused())return;const m=c.clipboardData;if(!m)return;c.preventDefault(),c.stopPropagation();const g=Array.from(m.items).filter(v=>v.kind==="file"),p=g.filter(v=>Bi.includes(v.type));if(p.length>0){for(const v of p){const b=v.getAsFile();b&&await i(b)}return}if(g.length>0){lt({title:r.t("prompt.toast.pasteUnsupported.title"),description:r.t("prompt.toast.pasteUnsupported.description")});return}const h=m.getData("text/plain")??"";h&&e.addPart({type:"text",content:h,start:0,end:0})},a=c=>{if(e.isDialogActive())return;c.preventDefault();const m=c.dataTransfer?.types.includes("Files"),f=c.dataTransfer?.types.includes("text/plain");m?e.setDraggingType("image"):f&&e.setDraggingType("@mention")},l=c=>{e.isDialogActive()||c.relatedTarget||e.setDraggingType(null)},u=async c=>{if(e.isDialogActive())return;c.preventDefault(),e.setDraggingType(null);const m=c.dataTransfer?.getData("text/plain"),f="file:";if(m?.startsWith(f)){const p=m.slice(f.length);e.focusEditor(),e.addPart({type:"file",path:p,content:"@"+p,start:0,end:0});return}const g=c.dataTransfer?.files;if(g)for(const p of Array.from(g))Bi.includes(p.type)&&await i(p)};return lo(()=>{document.addEventListener("dragover",a),document.addEventListener("dragleave",l),document.addEventListener("drop",u)}),rt(()=>{document.removeEventListener("dragover",a),document.removeEventListener("dragleave",l),document.removeEventListener("drop",u)}),{addImageAttachment:i,removeImageAttachment:t,handlePaste:o}}const F$=[{type:"text",content:"",start:0,end:0}],Z$=100;function Ed(e){return e.map(n=>n.type==="text"?{...n}:n.type==="image"?{...n}:n.type==="agent"?{...n}:{...n,selection:n.selection?{...n.selection}:void 0})}function Gr(e){return e.reduce((n,r)=>n+("content"in r?r.content.length:0),0)}function B$(e,n,r=Z$){const i=n.map(l=>"content"in l?l.content:"").join("").trim(),t=n.some(l=>l.type==="image");if(!i&&!t)return e;const o=Ed(n),a=e[0];return a&&W$(a,o)?e:[o,...e].slice(0,r)}function W$(e,n){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],t=n[r];if(i.type!==t.type||i.type==="text"&&i.content!==(t.type==="text"?t.content:""))return!1;if(i.type==="file"){if(i.path!==(t.type==="file"?t.path:""))return!1;const o=i.selection,a=t.type==="file"?t.selection:void 0;if(!(!o&&!a||!!o&&!!a&&o.startLine===a.startLine&&o.startChar===a.startChar&&o.endLine===a.endLine&&o.endChar===a.endChar))return!1}if(i.type==="agent"&&i.name!==(t.type==="agent"?t.name:"")||i.type==="image"&&i.id!==(t.type==="image"?t.id:""))return!1}return!0}function q$(e){if(e.direction==="up"){if(e.entries.length===0)return{handled:!1,historyIndex:e.historyIndex,savedPrompt:e.savedPrompt};if(e.historyIndex===-1)return{handled:!0,historyIndex:0,savedPrompt:Ed(e.currentPrompt),prompt:e.entries[0],cursor:"start"};if(e.historyIndex<e.entries.length-1){const n=e.historyIndex+1;return{handled:!0,historyIndex:n,savedPrompt:e.savedPrompt,prompt:e.entries[n],cursor:"start"}}return{handled:!1,historyIndex:e.historyIndex,savedPrompt:e.savedPrompt}}if(e.historyIndex>0){const n=e.historyIndex-1;return{handled:!0,historyIndex:n,savedPrompt:e.savedPrompt,prompt:e.entries[n],cursor:"end"}}return e.historyIndex===0?e.savedPrompt?{handled:!0,historyIndex:-1,savedPrompt:null,prompt:e.savedPrompt,cursor:"end"}:{handled:!0,historyIndex:-1,savedPrompt:null,prompt:F$,cursor:"end"}:{handled:!1,historyIndex:e.historyIndex,savedPrompt:e.savedPrompt}}const Od=Object.freeze({status:"aborted"});function L(e,n,r){function i(l,u){var c;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(c=l._zod).traits??(c.traits=new Set),l._zod.traits.add(e),n(l,u);for(const m in a.prototype)m in l||Object.defineProperty(l,m,{value:a.prototype[m].bind(l)});l._zod.constr=a,l._zod.def=u}const t=r?.Parent??Object;class o extends t{}Object.defineProperty(o,"name",{value:e});function a(l){var u;const c=r?.Parent?new o:this;i(c,l),(u=c._zod).deferred??(u.deferred=[]);for(const m of c._zod.deferred)m();return c}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}const Ad=Symbol("zod_brand");class er extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class go extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}const Ki={};function qt(e){return e&&Object.assign(Ki,e),Ki}function H$(e){return e}function G$(e){return e}function K$(e){}function V$(e){throw new Error}function J$(e){}function ja(e){const n=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,t])=>n.indexOf(+i)===-1).map(([i,t])=>t)}function le(e,n="|"){return e.map(r=>Fe(r)).join(n)}function Vi(e,n){return typeof n=="bigint"?n.toString():n}function gi(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function cr(e){return e==null}function ho(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}function Pd(e,n){const r=(e.toString().split(".")[1]||"").length,i=n.toString();let t=(i.split(".")[1]||"").length;if(t===0&&/\d?e-\d?/.test(i)){const u=i.match(/\d?e-(\d?)/);u?.[1]&&(t=Number.parseInt(u[1]))}const o=r>t?r:t,a=Number.parseInt(e.toFixed(o).replace(".","")),l=Number.parseInt(n.toFixed(o).replace(".",""));return a%l/10**o}const $c=Symbol("evaluating");function Qe(e,n,r){let i;Object.defineProperty(e,n,{get(){if(i!==$c)return i===void 0&&(i=$c,i=r()),i},set(t){Object.defineProperty(e,n,{value:t})},configurable:!0})}function po(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function vn(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Hn(...e){const n={};for(const r of e){const i=Object.getOwnPropertyDescriptors(r);Object.assign(n,i)}return Object.defineProperties({},n)}function X$(e){return Hn(e._zod.def)}function Y$(e,n){return n?n.reduce((r,i)=>r?.[i],e):e}function Q$(e){const n=Object.keys(e),r=n.map(i=>e[i]);return Promise.all(r).then(i=>{const t={};for(let o=0;o<n.length;o++)t[n[o]]=i[o];return t})}function e_(e=10){const n="abcdefghijklmnopqrstuvwxyz";let r="";for(let i=0;i<e;i++)r+=n[Math.floor(Math.random()*n.length)];return r}function da(e){return JSON.stringify(e)}const Ua="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function yr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Nd=gi(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function nr(e){if(yr(e)===!1)return!1;const n=e.constructor;if(n===void 0)return!0;const r=n.prototype;return!(yr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function vo(e){return nr(e)?{...e}:Array.isArray(e)?[...e]:e}function t_(e){let n=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&n++;return n}const n_=e=>{const n=typeof e;switch(n){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${n}`)}},Ji=new Set(["string","number","symbol"]),jd=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Zn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function un(e,n,r){const i=new e._zod.constr(n??e._zod.def);return(!n||r?.parent)&&(i._zod.parent=e),i}function J(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function r_(e){let n;return new Proxy({},{get(r,i,t){return n??(n=e()),Reflect.get(n,i,t)},set(r,i,t,o){return n??(n=e()),Reflect.set(n,i,t,o)},has(r,i){return n??(n=e()),Reflect.has(n,i)},deleteProperty(r,i){return n??(n=e()),Reflect.deleteProperty(n,i)},ownKeys(r){return n??(n=e()),Reflect.ownKeys(n)},getOwnPropertyDescriptor(r,i){return n??(n=e()),Reflect.getOwnPropertyDescriptor(n,i)},defineProperty(r,i,t){return n??(n=e()),Reflect.defineProperty(n,i,t)}})}function Fe(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Ud(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const Ld={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Rd={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Md(e,n){const r=e._zod.def,i=Hn(e._zod.def,{get shape(){const t={};for(const o in n){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(t[o]=r.shape[o])}return vn(this,"shape",t),t},checks:[]});return un(e,i)}function Fd(e,n){const r=e._zod.def,i=Hn(e._zod.def,{get shape(){const t={...e._zod.def.shape};for(const o in n){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);n[o]&&delete t[o]}return vn(this,"shape",t),t},checks:[]});return un(e,i)}function Zd(e,n){if(!nr(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const t=Hn(e._zod.def,{get shape(){const o={...e._zod.def.shape,...n};return vn(this,"shape",o),o},checks:[]});return un(e,t)}function Bd(e,n){if(!nr(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const i={...e._zod.def.shape,...n};return vn(this,"shape",i),i},checks:e._zod.def.checks};return un(e,r)}function Wd(e,n){const r=Hn(e._zod.def,{get shape(){const i={...e._zod.def.shape,...n._zod.def.shape};return vn(this,"shape",i),i},get catchall(){return n._zod.def.catchall},checks:[]});return un(e,r)}function qd(e,n,r){const i=Hn(n._zod.def,{get shape(){const t=n._zod.def.shape,o={...t};if(r)for(const a in r){if(!(a in t))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=e?new e({type:"optional",innerType:t[a]}):t[a])}else for(const a in t)o[a]=e?new e({type:"optional",innerType:t[a]}):t[a];return vn(this,"shape",o),o},checks:[]});return un(n,i)}function Hd(e,n,r){const i=Hn(n._zod.def,{get shape(){const t=n._zod.def.shape,o={...t};if(r)for(const a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=new e({type:"nonoptional",innerType:t[a]}))}else for(const a in t)o[a]=new e({type:"nonoptional",innerType:t[a]});return vn(this,"shape",o),o},checks:[]});return un(n,i)}function Xn(e,n=0){if(e.aborted===!0)return!0;for(let r=n;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function gn(e,n){return n.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Xr(e){return typeof e=="string"?e:e?.message}function pn(e,n,r){const i={...e,path:e.path??[]};if(!e.message){const t=Xr(e.inst?._zod.def?.error?.(e))??Xr(n?.error?.(e))??Xr(r.customError?.(e))??Xr(r.localeError?.(e))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,n?.reportInput||delete i.input,i}function bo(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function yo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function $r(...e){const[n,r,i]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:i}:{...n}}function i_(e){return Object.entries(e).filter(([n,r])=>Number.isNaN(Number.parseInt(n,10))).map(n=>n[1])}function Gd(e){const n=atob(e),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r}function Kd(e){let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}function o_(e){const n=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-n.length%4)%4);return Gd(n+r)}function a_(e){return Kd(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function s_(e){const n=e.replace(/^0x/,"");if(n.length%2!==0)throw new Error("Invalid hex string length");const r=new Uint8Array(n.length/2);for(let i=0;i<n.length;i+=2)r[i/2]=Number.parseInt(n.slice(i,i+2),16);return r}function l_(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}class c_{constructor(...n){}}const Vd=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:Rd,Class:c_,NUMBER_FORMAT_RANGES:Ld,aborted:Xn,allowsEval:Nd,assert:J$,assertEqual:H$,assertIs:K$,assertNever:V$,assertNotEqual:G$,assignProp:vn,base64ToUint8Array:Gd,base64urlToUint8Array:o_,cached:gi,captureStackTrace:Ua,cleanEnum:i_,cleanRegex:ho,clone:un,cloneDef:X$,createTransparentProxy:r_,defineLazy:Qe,esc:da,escapeRegex:Zn,extend:Zd,finalizeIssue:pn,floatSafeRemainder:Pd,getElementAtPath:Y$,getEnumValues:ja,getLengthableOrigin:yo,getParsedType:n_,getSizableOrigin:bo,hexToUint8Array:s_,isObject:yr,isPlainObject:nr,issue:$r,joinValues:le,jsonStringifyReplacer:Vi,merge:Wd,mergeDefs:Hn,normalizeParams:J,nullish:cr,numKeys:t_,objectClone:po,omit:Fd,optionalKeys:Ud,partial:qd,pick:Md,prefixIssues:gn,primitiveTypes:jd,promiseAllObject:Q$,propertyKeyTypes:Ji,randomString:e_,required:Hd,safeExtend:Bd,shallowClone:vo,stringifyPrimitive:Fe,uint8ArrayToBase64:Kd,uint8ArrayToBase64url:a_,uint8ArrayToHex:l_,unwrapMessage:Xr},Symbol.toStringTag,{value:"Module"})),Jd=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Vi,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},La=L("$ZodError",Jd),Yt=L("$ZodError",Jd,{Parent:Error});function Ra(e,n=r=>r.message){const r={},i=[];for(const t of e.issues)t.path.length>0?(r[t.path[0]]=r[t.path[0]]||[],r[t.path[0]].push(n(t))):i.push(n(t));return{formErrors:i,fieldErrors:r}}function Ma(e,n){const r=n||function(o){return o.message},i={_errors:[]},t=o=>{for(const a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(l=>t({issues:l}));else if(a.code==="invalid_key")t({issues:a.issues});else if(a.code==="invalid_element")t({issues:a.issues});else if(a.path.length===0)i._errors.push(r(a));else{let l=i,u=0;for(;u<a.path.length;){const c=a.path[u];u===a.path.length-1?(l[c]=l[c]||{_errors:[]},l[c]._errors.push(r(a))):l[c]=l[c]||{_errors:[]},l=l[c],u++}}};return t(e),i}function Xd(e,n){const r=n||function(o){return o.message},i={errors:[]},t=(o,a=[])=>{var l,u;for(const c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(m=>t({issues:m},c.path));else if(c.code==="invalid_key")t({issues:c.issues},c.path);else if(c.code==="invalid_element")t({issues:c.issues},c.path);else{const m=[...a,...c.path];if(m.length===0){i.errors.push(r(c));continue}let f=i,g=0;for(;g<m.length;){const p=m[g],h=g===m.length-1;typeof p=="string"?(f.properties??(f.properties={}),(l=f.properties)[p]??(l[p]={errors:[]}),f=f.properties[p]):(f.items??(f.items=[]),(u=f.items)[p]??(u[p]={errors:[]}),f=f.items[p]),h&&f.errors.push(r(c)),g++}}};return t(e),i}function Yd(e){const n=[],r=e.map(i=>typeof i=="object"?i.key:i);for(const i of r)typeof i=="number"?n.push(`[${i}]`):typeof i=="symbol"?n.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?n.push(`[${JSON.stringify(i)}]`):(n.length&&n.push("."),n.push(i));return n.join("")}function Qd(e){const n=[],r=[...e.issues].sort((i,t)=>(i.path??[]).length-(t.path??[]).length);for(const i of r)n.push(`✖ ${i.message}`),i.path?.length&&n.push(` → at ${Yd(i.path)}`);return n.join(`
|
|
13
|
+
`)}const hi=e=>(n,r,i,t)=>{const o=i?Object.assign(i,{async:!1}):{async:!1},a=n._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new er;if(a.issues.length){const l=new(t?.Err??e)(a.issues.map(u=>pn(u,o,qt())));throw Ua(l,t?.callee),l}return a.value},fa=hi(Yt),pi=e=>async(n,r,i,t)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let a=n._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const l=new(t?.Err??e)(a.issues.map(u=>pn(u,o,qt())));throw Ua(l,t?.callee),l}return a.value},ma=pi(Yt),vi=e=>(n,r,i)=>{const t=i?{...i,async:!1}:{async:!1},o=n._zod.run({value:r,issues:[]},t);if(o instanceof Promise)throw new er;return o.issues.length?{success:!1,error:new(e??La)(o.issues.map(a=>pn(a,t,qt())))}:{success:!0,data:o.value}},ef=vi(Yt),bi=e=>async(n,r,i)=>{const t=i?Object.assign(i,{async:!0}):{async:!0};let o=n._zod.run({value:r,issues:[]},t);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>pn(a,t,qt())))}:{success:!0,data:o.value}},tf=bi(Yt),Fa=e=>(n,r,i)=>{const t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return hi(e)(n,r,t)},u_=Fa(Yt),Za=e=>(n,r,i)=>hi(e)(n,r,i),d_=Za(Yt),Ba=e=>async(n,r,i)=>{const t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return pi(e)(n,r,t)},f_=Ba(Yt),Wa=e=>async(n,r,i)=>pi(e)(n,r,i),m_=Wa(Yt),qa=e=>(n,r,i)=>{const t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return vi(e)(n,r,t)},g_=qa(Yt),Ha=e=>(n,r,i)=>vi(e)(n,r,i),h_=Ha(Yt),Ga=e=>async(n,r,i)=>{const t=i?Object.assign(i,{direction:"backward"}):{direction:"backward"};return bi(e)(n,r,t)},p_=Ga(Yt),Ka=e=>async(n,r,i)=>bi(e)(n,r,i),v_=Ka(Yt),nf=/^[cC][^\s-]{8,}$/,rf=/^[0-9a-z]+$/,of=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,af=/^[0-9a-vA-V]{20}$/,sf=/^[A-Za-z0-9]{27}$/,lf=/^[a-zA-Z0-9_-]{21}$/,cf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,b_=/^[-+]?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)?)??$/,uf=/^([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})$/,_r=e=>e?new 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)$/,y_=_r(4),$_=_r(6),__=_r(7),df=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,w_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,x_=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ff=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,k_=ff,S_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,I_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function mf(){return new RegExp(I_,"u")}const gf=/^(?:(?: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])$/,hf=/^(([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}|:))$/,pf=/^((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])$/,vf=/^(([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])$/,bf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Va=/^[A-Za-z0-9_-]*$/,Ja=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,yf=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,$f=/^\+(?:[0-9]){6,14}[0-9]$/,_f="(?:(?:\\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])))",wf=new RegExp(`^${_f}$`);function xf(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function kf(e){return new RegExp(`^${xf(e)}$`)}function Sf(e){const n=xf({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${n}(?:${r.join("|")})`;return new RegExp(`^${_f}T(?:${i})$`)}const If=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},Tf=/^-?\d+n?$/,Cf=/^-?\d+$/,Df=/^-?\d+(?:\.\d+)?/,zf=/^(?:true|false)$/i,Ef=/^null$/i,Of=/^undefined$/i,Af=/^[^A-Z]*$/,Pf=/^[^a-z]*$/,Nf=/^[0-9a-fA-F]*$/;function yi(e,n){return new RegExp(`^[A-Za-z0-9+/]{${e}}${n}$`)}function $i(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const T_=/^[0-9a-fA-F]{32}$/,C_=yi(22,"=="),D_=$i(22),z_=/^[0-9a-fA-F]{40}$/,E_=yi(27,"="),O_=$i(27),A_=/^[0-9a-fA-F]{64}$/,P_=yi(43,"="),N_=$i(43),j_=/^[0-9a-fA-F]{96}$/,U_=yi(64,""),L_=$i(64),R_=/^[0-9a-fA-F]{128}$/,M_=yi(86,"=="),F_=$i(86),Xa=Object.freeze(Object.defineProperty({__proto__:null,base64:bf,base64url:Va,bigint:Tf,boolean:zf,browserEmail:S_,cidrv4:pf,cidrv6:vf,cuid:nf,cuid2:rf,date:wf,datetime:Sf,domain:yf,duration:cf,e164:$f,email:df,emoji:mf,extendedDuration:b_,guid:uf,hex:Nf,hostname:Ja,html5Email:w_,idnEmail:k_,integer:Cf,ipv4:gf,ipv6:hf,ksuid:sf,lowercase:Af,md5_base64:C_,md5_base64url:D_,md5_hex:T_,nanoid:lf,null:Ef,number:Df,rfc5322Email:x_,sha1_base64:E_,sha1_base64url:O_,sha1_hex:z_,sha256_base64:P_,sha256_base64url:N_,sha256_hex:A_,sha384_base64:U_,sha384_base64url:L_,sha384_hex:j_,sha512_base64:M_,sha512_base64url:F_,sha512_hex:R_,string:If,time:kf,ulid:of,undefined:Of,unicodeEmail:ff,uppercase:Pf,uuid:_r,uuid4:y_,uuid6:$_,uuid7:__,xid:af},Symbol.toStringTag,{value:"Module"})),xt=L("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),jf={number:"number",bigint:"bigint",object:"date"},Ya=L("$ZodCheckLessThan",(e,n)=>{xt.init(e,n);const r=jf[typeof n.value];e._zod.onattach.push(i=>{const t=i._zod.bag,o=(n.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value<o&&(n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value)}),e._zod.check=i=>{(n.inclusive?i.value<=n.value:i.value<n.value)||i.issues.push({origin:r,code:"too_big",maximum:n.value,input:i.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Qa=L("$ZodCheckGreaterThan",(e,n)=>{xt.init(e,n);const r=jf[typeof n.value];e._zod.onattach.push(i=>{const t=i._zod.bag,o=(n.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>o&&(n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value)}),e._zod.check=i=>{(n.inclusive?i.value>=n.value:i.value>n.value)||i.issues.push({origin:r,code:"too_small",minimum:n.value,input:i.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),Uf=L("$ZodCheckMultipleOf",(e,n)=>{xt.init(e,n),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=n.value)}),e._zod.check=r=>{if(typeof r.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%n.value===BigInt(0):Pd(r.value,n.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:n.value,input:r.value,inst:e,continue:!n.abort})}}),Lf=L("$ZodCheckNumberFormat",(e,n)=>{xt.init(e,n),n.format=n.format||"float64";const r=n.format?.includes("int"),i=r?"int":"number",[t,o]=Ld[n.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=n.format,l.minimum=t,l.maximum=o,r&&(l.pattern=Cf)}),e._zod.check=a=>{const l=a.value;if(r){if(!Number.isInteger(l)){a.issues.push({expected:i,format:n.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!n.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!n.abort});return}}l<t&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!n.abort}),l>o&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inst:e})}}),Rf=L("$ZodCheckBigIntFormat",(e,n)=>{xt.init(e,n);const[r,i]=Rd[n.format];e._zod.onattach.push(t=>{const o=t._zod.bag;o.format=n.format,o.minimum=r,o.maximum=i}),e._zod.check=t=>{const o=t.value;o<r&&t.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!n.abort}),o>i&&t.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:e})}}),Mf=L("$ZodCheckMaxSize",(e,n)=>{var r;xt.init(e,n),(r=e._zod.def).when??(r.when=i=>{const t=i.value;return!cr(t)&&t.size!==void 0}),e._zod.onattach.push(i=>{const t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<t&&(i._zod.bag.maximum=n.maximum)}),e._zod.check=i=>{const t=i.value;t.size<=n.maximum||i.issues.push({origin:bo(t),code:"too_big",maximum:n.maximum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),Ff=L("$ZodCheckMinSize",(e,n)=>{var r;xt.init(e,n),(r=e._zod.def).when??(r.when=i=>{const t=i.value;return!cr(t)&&t.size!==void 0}),e._zod.onattach.push(i=>{const t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>t&&(i._zod.bag.minimum=n.minimum)}),e._zod.check=i=>{const t=i.value;t.size>=n.minimum||i.issues.push({origin:bo(t),code:"too_small",minimum:n.minimum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),Zf=L("$ZodCheckSizeEquals",(e,n)=>{var r;xt.init(e,n),(r=e._zod.def).when??(r.when=i=>{const t=i.value;return!cr(t)&&t.size!==void 0}),e._zod.onattach.push(i=>{const t=i._zod.bag;t.minimum=n.size,t.maximum=n.size,t.size=n.size}),e._zod.check=i=>{const t=i.value,o=t.size;if(o===n.size)return;const a=o>n.size;i.issues.push({origin:bo(t),...a?{code:"too_big",maximum:n.size}:{code:"too_small",minimum:n.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!n.abort})}}),Bf=L("$ZodCheckMaxLength",(e,n)=>{var r;xt.init(e,n),(r=e._zod.def).when??(r.when=i=>{const t=i.value;return!cr(t)&&t.length!==void 0}),e._zod.onattach.push(i=>{const t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum<t&&(i._zod.bag.maximum=n.maximum)}),e._zod.check=i=>{const t=i.value;if(t.length<=n.maximum)return;const a=yo(t);i.issues.push({origin:a,code:"too_big",maximum:n.maximum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),Wf=L("$ZodCheckMinLength",(e,n)=>{var r;xt.init(e,n),(r=e._zod.def).when??(r.when=i=>{const t=i.value;return!cr(t)&&t.length!==void 0}),e._zod.onattach.push(i=>{const t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>t&&(i._zod.bag.minimum=n.minimum)}),e._zod.check=i=>{const t=i.value;if(t.length>=n.minimum)return;const a=yo(t);i.issues.push({origin:a,code:"too_small",minimum:n.minimum,inclusive:!0,input:t,inst:e,continue:!n.abort})}}),qf=L("$ZodCheckLengthEquals",(e,n)=>{var r;xt.init(e,n),(r=e._zod.def).when??(r.when=i=>{const t=i.value;return!cr(t)&&t.length!==void 0}),e._zod.onattach.push(i=>{const t=i._zod.bag;t.minimum=n.length,t.maximum=n.length,t.length=n.length}),e._zod.check=i=>{const t=i.value,o=t.length;if(o===n.length)return;const a=yo(t),l=o>n.length;i.issues.push({origin:a,...l?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!n.abort})}}),_i=L("$ZodCheckStringFormat",(e,n)=>{var r,i;xt.init(e,n),e._zod.onattach.push(t=>{const o=t._zod.bag;o.format=n.format,n.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=t=>{n.pattern.lastIndex=0,!n.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:n.format,input:t.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(i=e._zod).check??(i.check=()=>{})}),Hf=L("$ZodCheckRegex",(e,n)=>{_i.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),Gf=L("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=Af),_i.init(e,n)}),Kf=L("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=Pf),_i.init(e,n)}),Vf=L("$ZodCheckIncludes",(e,n)=>{xt.init(e,n);const r=Zn(n.includes),i=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=i,e._zod.onattach.push(t=>{const o=t._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),e._zod.check=t=>{t.value.includes(n.includes,n.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:t.value,inst:e,continue:!n.abort})}}),Jf=L("$ZodCheckStartsWith",(e,n)=>{xt.init(e,n);const r=new RegExp(`^${Zn(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(i=>{const t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(n.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:i.value,inst:e,continue:!n.abort})}}),Xf=L("$ZodCheckEndsWith",(e,n)=>{xt.init(e,n);const r=new RegExp(`.*${Zn(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(i=>{const t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(n.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:i.value,inst:e,continue:!n.abort})}});function _c(e,n,r){e.issues.length&&n.issues.push(...gn(r,e.issues))}const Yf=L("$ZodCheckProperty",(e,n)=>{xt.init(e,n),e._zod.check=r=>{const i=n.schema._zod.run({value:r.value[n.property],issues:[]},{});if(i instanceof Promise)return i.then(t=>_c(t,r,n.property));_c(i,r,n.property)}}),Qf=L("$ZodCheckMimeType",(e,n)=>{xt.init(e,n);const r=new Set(n.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=n.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:n.mime,input:i.value.type,inst:e,continue:!n.abort})}}),em=L("$ZodCheckOverwrite",(e,n)=>{xt.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class tm{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const i=n.split(`
|
|
14
|
+
`).filter(a=>a),t=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(t)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const n=Function,r=this?.args,t=[...(this?.content??[""]).map(o=>` ${o}`)];return new n(...r,t.join(`
|
|
15
|
+
`))}}const nm={major:4,minor:1,patch:8},qe=L("$ZodType",(e,n)=>{var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=nm;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const o of t._zod.onattach)o(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(a,l,u)=>{let c=Xn(a),m;for(const f of l){if(f._zod.def.when){if(!f._zod.def.when(a))continue}else if(c)continue;const g=a.issues.length,p=f._zod.check(a);if(p instanceof Promise&&u?.async===!1)throw new er;if(m||p instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await p,a.issues.length!==g&&(c||(c=Xn(a,g)))});else{if(a.issues.length===g)continue;c||(c=Xn(a,g))}}return m?m.then(()=>a):a},o=(a,l,u)=>{if(Xn(a))return a.aborted=!0,a;const c=t(l,i,u);if(c instanceof Promise){if(u.async===!1)throw new er;return c.then(m=>e._zod.parse(m,u))}return e._zod.parse(c,u)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){const c=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return c instanceof Promise?c.then(m=>o(m,a,l)):o(c,a,l)}const u=e._zod.parse(a,l);if(u instanceof Promise){if(l.async===!1)throw new er;return u.then(c=>t(c,i,l))}return t(u,i,l)}}e["~standard"]={validate:t=>{try{const o=ef(e,t);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return tf(e,t).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),wi=L("$ZodString",(e,n)=>{qe.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??If(e._zod.bag),e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ft=L("$ZodStringFormat",(e,n)=>{_i.init(e,n),wi.init(e,n)}),rm=L("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=uf),ft.init(e,n)}),im=L("$ZodUUID",(e,n)=>{if(n.version){const i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(i===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=_r(i))}else n.pattern??(n.pattern=_r());ft.init(e,n)}),om=L("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=df),ft.init(e,n)}),am=L("$ZodURL",(e,n)=>{ft.init(e,n),e._zod.check=r=>{try{const i=r.value.trim(),t=new URL(i);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(t.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Ja.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=t.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),sm=L("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=mf()),ft.init(e,n)}),lm=L("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=lf),ft.init(e,n)}),cm=L("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=nf),ft.init(e,n)}),um=L("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=rf),ft.init(e,n)}),dm=L("$ZodULID",(e,n)=>{n.pattern??(n.pattern=of),ft.init(e,n)}),fm=L("$ZodXID",(e,n)=>{n.pattern??(n.pattern=af),ft.init(e,n)}),mm=L("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=sf),ft.init(e,n)}),gm=L("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=Sf(n)),ft.init(e,n)}),hm=L("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=wf),ft.init(e,n)}),pm=L("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=kf(n)),ft.init(e,n)}),vm=L("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=cf),ft.init(e,n)}),bm=L("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=gf),ft.init(e,n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format="ipv4"})}),ym=L("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=hf),ft.init(e,n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),$m=L("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=pf),ft.init(e,n)}),_m=L("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=vf),ft.init(e,n),e._zod.check=r=>{const i=r.value.split("/");try{if(i.length!==2)throw new Error;const[t,o]=i;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${t}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function es(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const wm=L("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=bf),ft.init(e,n),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{es(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function xm(e){if(!Va.test(e))return!1;const n=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return es(r)}const km=L("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=Va),ft.init(e,n),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{xm(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),Sm=L("$ZodE164",(e,n)=>{n.pattern??(n.pattern=$f),ft.init(e,n)});function Im(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[i]=r;if(!i)return!1;const t=JSON.parse(atob(i));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||n&&(!("alg"in t)||t.alg!==n))}catch{return!1}}const Tm=L("$ZodJWT",(e,n)=>{ft.init(e,n),e._zod.check=r=>{Im(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),Cm=L("$ZodCustomStringFormat",(e,n)=>{ft.init(e,n),e._zod.check=r=>{n.fn(r.value)||r.issues.push({code:"invalid_format",format:n.format,input:r.value,inst:e,continue:!n.abort})}}),ts=L("$ZodNumber",(e,n)=>{qe.init(e,n),e._zod.pattern=e._zod.bag.pattern??Df,e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=Number(r.value)}catch{}const t=r.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return r;const o=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:t,inst:e,...o?{received:o}:{}}),r}}),Dm=L("$ZodNumber",(e,n)=>{Lf.init(e,n),ts.init(e,n)}),ns=L("$ZodBoolean",(e,n)=>{qe.init(e,n),e._zod.pattern=zf,e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=!!r.value}catch{}const t=r.value;return typeof t=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:e}),r}}),rs=L("$ZodBigInt",(e,n)=>{qe.init(e,n),e._zod.pattern=Tf,e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),zm=L("$ZodBigInt",(e,n)=>{Rf.init(e,n),rs.init(e,n)}),Em=L("$ZodSymbol",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{const t=r.value;return typeof t=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:e}),r}}),Om=L("$ZodUndefined",(e,n)=>{qe.init(e,n),e._zod.pattern=Of,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(r,i)=>{const t=r.value;return typeof t>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:e}),r}}),Am=L("$ZodNull",(e,n)=>{qe.init(e,n),e._zod.pattern=Ef,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{const t=r.value;return t===null||r.issues.push({expected:"null",code:"invalid_type",input:t,inst:e}),r}}),Pm=L("$ZodAny",(e,n)=>{qe.init(e,n),e._zod.parse=r=>r}),Nm=L("$ZodUnknown",(e,n)=>{qe.init(e,n),e._zod.parse=r=>r}),jm=L("$ZodNever",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Um=L("$ZodVoid",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{const t=r.value;return typeof t>"u"||r.issues.push({expected:"void",code:"invalid_type",input:t,inst:e}),r}}),Lm=L("$ZodDate",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{if(n.coerce)try{r.value=new Date(r.value)}catch{}const t=r.value,o=t instanceof Date;return o&&!Number.isNaN(t.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:t,...o?{received:"Invalid Date"}:{},inst:e}),r}});function wc(e,n,r){e.issues.length&&n.issues.push(...gn(r,e.issues)),n.value[r]=e.value}const Rm=L("$ZodArray",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{const t=r.value;if(!Array.isArray(t))return r.issues.push({expected:"array",code:"invalid_type",input:t,inst:e}),r;r.value=Array(t.length);const o=[];for(let a=0;a<t.length;a++){const l=t[a],u=n.element._zod.run({value:l,issues:[]},i);u instanceof Promise?o.push(u.then(c=>wc(c,r,a))):wc(u,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function Xi(e,n,r,i){e.issues.length&&n.issues.push(...gn(r,e.issues)),e.value===void 0?r in i&&(n.value[r]=void 0):n.value[r]=e.value}function Mm(e){const n=Object.keys(e.shape);for(const i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=Ud(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function Fm(e,n,r,i,t,o){const a=[],l=t.keySet,u=t.catchall._zod,c=u.def.type;for(const m of Object.keys(n)){if(l.has(m))continue;if(c==="never"){a.push(m);continue}const f=u.run({value:n[m],issues:[]},i);f instanceof Promise?e.push(f.then(g=>Xi(g,r,m,n))):Xi(f,r,m,n)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:n,inst:o}),e.length?Promise.all(e).then(()=>r):r}const Zm=L("$ZodObject",(e,n)=>{qe.init(e,n);const r=gi(()=>Mm(n));Qe(e._zod,"propValues",()=>{const a=n.shape,l={};for(const u in a){const c=a[u]._zod;if(c.values){l[u]??(l[u]=new Set);for(const m of c.values)l[u].add(m)}}return l});const i=yr,t=n.catchall;let o;e._zod.parse=(a,l)=>{o??(o=r.value);const u=a.value;if(!i(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const c=[],m=o.shape;for(const f of o.keys){const p=m[f]._zod.run({value:u[f],issues:[]},l);p instanceof Promise?c.push(p.then(h=>Xi(h,a,f,u))):Xi(p,a,f,u)}return t?Fm(c,u,a,l,r.value,e):c.length?Promise.all(c).then(()=>a):a}}),Bm=L("$ZodObjectJIT",(e,n)=>{Zm.init(e,n);const r=e._zod.parse,i=gi(()=>Mm(n)),t=g=>{const p=new tm(["shape","payload","ctx"]),h=i.value,v=U=>{const A=da(U);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};p.write("const input = payload.value;");const b=Object.create(null);let x=0;for(const U of h.keys)b[U]=`key_${x++}`;p.write("const newResult = {};");for(const U of h.keys){const A=b[U],N=da(U);p.write(`const ${A} = ${v(U)};`),p.write(`
|
|
16
|
+
if (${A}.issues.length) {
|
|
17
|
+
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
18
|
+
...iss,
|
|
19
|
+
path: iss.path ? [${N}, ...iss.path] : [${N}]
|
|
20
|
+
})));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
if (${A}.value === undefined) {
|
|
25
|
+
if (${N} in input) {
|
|
26
|
+
newResult[${N}] = undefined;
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
newResult[${N}] = ${A}.value;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");const R=p.compile();return(U,A)=>R(g,U,A)};let o;const a=yr,l=!Ki.jitless,c=l&&Nd.value,m=n.catchall;let f;e._zod.parse=(g,p)=>{f??(f=i.value);const h=g.value;return a(h)?l&&c&&p?.async===!1&&p.jitless!==!0?(o||(o=t(n.shape)),g=o(g,p),m?Fm([],h,g,p,f,e):g):r(g,p):(g.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),g)}});function xc(e,n,r,i){for(const o of e)if(o.issues.length===0)return n.value=o.value,n;const t=e.filter(o=>!Xn(o));return t.length===1?(n.value=t[0].value,t[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(o=>o.issues.map(a=>pn(a,i,qt())))}),n)}const is=L("$ZodUnion",(e,n)=>{qe.init(e,n),Qe(e._zod,"optin",()=>n.options.some(t=>t._zod.optin==="optional")?"optional":void 0),Qe(e._zod,"optout",()=>n.options.some(t=>t._zod.optout==="optional")?"optional":void 0),Qe(e._zod,"values",()=>{if(n.options.every(t=>t._zod.values))return new Set(n.options.flatMap(t=>Array.from(t._zod.values)))}),Qe(e._zod,"pattern",()=>{if(n.options.every(t=>t._zod.pattern)){const t=n.options.map(o=>o._zod.pattern);return new RegExp(`^(${t.map(o=>ho(o.source)).join("|")})$`)}});const r=n.options.length===1,i=n.options[0]._zod.run;e._zod.parse=(t,o)=>{if(r)return i(t,o);let a=!1;const l=[];for(const u of n.options){const c=u._zod.run({value:t.value,issues:[]},o);if(c instanceof Promise)l.push(c),a=!0;else{if(c.issues.length===0)return c;l.push(c)}}return a?Promise.all(l).then(u=>xc(u,t,e,o)):xc(l,t,e,o)}}),Wm=L("$ZodDiscriminatedUnion",(e,n)=>{is.init(e,n);const r=e._zod.parse;Qe(e._zod,"propValues",()=>{const t={};for(const o of n.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(o)}"`);for(const[l,u]of Object.entries(a)){t[l]||(t[l]=new Set);for(const c of u)t[l].add(c)}}return t});const i=gi(()=>{const t=n.options,o=new Map;for(const a of t){const l=a._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(a)}"`);for(const u of l){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,a)}}return o});e._zod.parse=(t,o)=>{const a=t.value;if(!yr(a))return t.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),t;const l=i.value.get(a?.[n.discriminator]);return l?l._zod.run(t,o):n.unionFallback?r(t,o):(t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,input:a,path:[n.discriminator],inst:e}),t)}}),qm=L("$ZodIntersection",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{const t=r.value,o=n.left._zod.run({value:t,issues:[]},i),a=n.right._zod.run({value:t,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([u,c])=>kc(r,u,c)):kc(r,o,a)}});function ga(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(nr(e)&&nr(n)){const r=Object.keys(n),i=Object.keys(e).filter(o=>r.indexOf(o)!==-1),t={...e,...n};for(const o of i){const a=ga(e[o],n[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};t[o]=a.data}return{valid:!0,data:t}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i<e.length;i++){const t=e[i],o=n[i],a=ga(t,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function kc(e,n,r){if(n.issues.length&&e.issues.push(...n.issues),r.issues.length&&e.issues.push(...r.issues),Xn(e))return e;const i=ga(n.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const os=L("$ZodTuple",(e,n)=>{qe.init(e,n);const r=n.items,i=r.length-[...r].reverse().findIndex(t=>t._zod.optin!=="optional");e._zod.parse=(t,o)=>{const a=t.value;if(!Array.isArray(a))return t.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),t;t.value=[];const l=[];if(!n.rest){const c=a.length>r.length,m=a.length<i-1;if(c||m)return t.issues.push({...c?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},input:a,inst:e,origin:"array"}),t}let u=-1;for(const c of r){if(u++,u>=a.length&&u>=i)continue;const m=c._zod.run({value:a[u],issues:[]},o);m instanceof Promise?l.push(m.then(f=>Li(f,t,u))):Li(m,t,u)}if(n.rest){const c=a.slice(r.length);for(const m of c){u++;const f=n.rest._zod.run({value:m,issues:[]},o);f instanceof Promise?l.push(f.then(g=>Li(g,t,u))):Li(f,t,u)}}return l.length?Promise.all(l).then(()=>t):t}});function Li(e,n,r){e.issues.length&&n.issues.push(...gn(r,e.issues)),n.value[r]=e.value}const Hm=L("$ZodRecord",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{const t=r.value;if(!nr(t))return r.issues.push({expected:"record",code:"invalid_type",input:t,inst:e}),r;const o=[];if(n.keyType._zod.values){const a=n.keyType._zod.values;r.value={};for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){const c=n.valueType._zod.run({value:t[u],issues:[]},i);c instanceof Promise?o.push(c.then(m=>{m.issues.length&&r.issues.push(...gn(u,m.issues)),r.value[u]=m.value})):(c.issues.length&&r.issues.push(...gn(u,c.issues)),r.value[u]=c.value)}let l;for(const u in t)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:t,inst:e,keys:l})}else{r.value={};for(const a of Reflect.ownKeys(t)){if(a==="__proto__")continue;const l=n.keyType._zod.run({value:a,issues:[]},i);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(c=>pn(c,i,qt())),input:a,path:[a],inst:e}),r.value[l.value]=l.value;continue}const u=n.valueType._zod.run({value:t[a],issues:[]},i);u instanceof Promise?o.push(u.then(c=>{c.issues.length&&r.issues.push(...gn(a,c.issues)),r.value[l.value]=c.value})):(u.issues.length&&r.issues.push(...gn(a,u.issues)),r.value[l.value]=u.value)}}return o.length?Promise.all(o).then(()=>r):r}}),Gm=L("$ZodMap",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{const t=r.value;if(!(t instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:t,inst:e}),r;const o=[];r.value=new Map;for(const[a,l]of t){const u=n.keyType._zod.run({value:a,issues:[]},i),c=n.valueType._zod.run({value:l,issues:[]},i);u instanceof Promise||c instanceof Promise?o.push(Promise.all([u,c]).then(([m,f])=>{Sc(m,f,r,a,t,e,i)})):Sc(u,c,r,a,t,e,i)}return o.length?Promise.all(o).then(()=>r):r}});function Sc(e,n,r,i,t,o,a){e.issues.length&&(Ji.has(typeof i)?r.issues.push(...gn(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:t,inst:o,issues:e.issues.map(l=>pn(l,a,qt()))})),n.issues.length&&(Ji.has(typeof i)?r.issues.push(...gn(i,n.issues)):r.issues.push({origin:"map",code:"invalid_element",input:t,inst:o,key:i,issues:n.issues.map(l=>pn(l,a,qt()))})),r.value.set(e.value,n.value)}const Km=L("$ZodSet",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{const t=r.value;if(!(t instanceof Set))return r.issues.push({input:t,inst:e,expected:"set",code:"invalid_type"}),r;const o=[];r.value=new Set;for(const a of t){const l=n.valueType._zod.run({value:a,issues:[]},i);l instanceof Promise?o.push(l.then(u=>Ic(u,r))):Ic(l,r)}return o.length?Promise.all(o).then(()=>r):r}});function Ic(e,n){e.issues.length&&n.issues.push(...e.issues),n.value.add(e.value)}const Vm=L("$ZodEnum",(e,n)=>{qe.init(e,n);const r=ja(n.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(t=>Ji.has(typeof t)).map(t=>typeof t=="string"?Zn(t):t.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const a=t.value;return i.has(a)||t.issues.push({code:"invalid_value",values:r,input:a,inst:e}),t}}),Jm=L("$ZodLiteral",(e,n)=>{if(qe.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(n.values),e._zod.pattern=new RegExp(`^(${n.values.map(r=>typeof r=="string"?Zn(r):r?Zn(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const t=r.value;return e._zod.values.has(t)||r.issues.push({code:"invalid_value",values:n.values,input:t,inst:e}),r}}),Xm=L("$ZodFile",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{const t=r.value;return t instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:t,inst:e}),r}}),Ym=L("$ZodTransform",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new go(e.constructor.name);const t=n.transform(r.value,r);if(i.async)return(t instanceof Promise?t:Promise.resolve(t)).then(a=>(r.value=a,r));if(t instanceof Promise)throw new er;return r.value=t,r}});function Tc(e,n){return e.issues.length&&n===void 0?{issues:[],value:void 0}:e}const Qm=L("$ZodOptional",(e,n)=>{qe.init(e,n),e._zod.optin="optional",e._zod.optout="optional",Qe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),Qe(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${ho(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(n.innerType._zod.optin==="optional"){const t=n.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>Tc(o,r.value)):Tc(t,r.value)}return r.value===void 0?r:n.innerType._zod.run(r,i)}}),eg=L("$ZodNullable",(e,n)=>{qe.init(e,n),Qe(e._zod,"optin",()=>n.innerType._zod.optin),Qe(e._zod,"optout",()=>n.innerType._zod.optout),Qe(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${ho(r.source)}|null)$`):void 0}),Qe(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:n.innerType._zod.run(r,i)}),tg=L("$ZodDefault",(e,n)=>{qe.init(e,n),e._zod.optin="optional",Qe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);if(r.value===void 0)return r.value=n.defaultValue,r;const t=n.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>Cc(o,n)):Cc(t,n)}});function Cc(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const ng=L("$ZodPrefault",(e,n)=>{qe.init(e,n),e._zod.optin="optional",Qe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,i))}),rg=L("$ZodNonOptional",(e,n)=>{qe.init(e,n),Qe(e._zod,"values",()=>{const r=n.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const t=n.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>Dc(o,e)):Dc(t,e)}});function Dc(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const ig=L("$ZodSuccess",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new go("ZodSuccess");const t=n.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>(r.value=o.issues.length===0,r)):(r.value=t.issues.length===0,r)}}),og=L("$ZodCatch",(e,n)=>{qe.init(e,n),Qe(e._zod,"optin",()=>n.innerType._zod.optin),Qe(e._zod,"optout",()=>n.innerType._zod.optout),Qe(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);const t=n.innerType._zod.run(r,i);return t instanceof Promise?t.then(o=>(r.value=o.value,o.issues.length&&(r.value=n.catchValue({...r,error:{issues:o.issues.map(a=>pn(a,i,qt()))},input:r.value}),r.issues=[]),r)):(r.value=t.value,t.issues.length&&(r.value=n.catchValue({...r,error:{issues:t.issues.map(o=>pn(o,i,qt()))},input:r.value}),r.issues=[]),r)}}),ag=L("$ZodNaN",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),sg=L("$ZodPipe",(e,n)=>{qe.init(e,n),Qe(e._zod,"values",()=>n.in._zod.values),Qe(e._zod,"optin",()=>n.in._zod.optin),Qe(e._zod,"optout",()=>n.out._zod.optout),Qe(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const o=n.out._zod.run(r,i);return o instanceof Promise?o.then(a=>Ri(a,n.in,i)):Ri(o,n.in,i)}const t=n.in._zod.run(r,i);return t instanceof Promise?t.then(o=>Ri(o,n.out,i)):Ri(t,n.out,i)}});function Ri(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues},r)}const as=L("$ZodCodec",(e,n)=>{qe.init(e,n),Qe(e._zod,"values",()=>n.in._zod.values),Qe(e._zod,"optin",()=>n.in._zod.optin),Qe(e._zod,"optout",()=>n.out._zod.optout),Qe(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){const o=n.in._zod.run(r,i);return o instanceof Promise?o.then(a=>Mi(a,n,i)):Mi(o,n,i)}else{const o=n.out._zod.run(r,i);return o instanceof Promise?o.then(a=>Mi(a,n,i)):Mi(o,n,i)}}});function Mi(e,n,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){const t=n.transform(e.value,e);return t instanceof Promise?t.then(o=>Fi(e,o,n.out,r)):Fi(e,t,n.out,r)}else{const t=n.reverseTransform(e.value,e);return t instanceof Promise?t.then(o=>Fi(e,o,n.in,r)):Fi(e,t,n.in,r)}}function Fi(e,n,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:n,issues:e.issues},i)}const lg=L("$ZodReadonly",(e,n)=>{qe.init(e,n),Qe(e._zod,"propValues",()=>n.innerType._zod.propValues),Qe(e._zod,"values",()=>n.innerType._zod.values),Qe(e._zod,"optin",()=>n.innerType._zod.optin),Qe(e._zod,"optout",()=>n.innerType._zod.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return n.innerType._zod.run(r,i);const t=n.innerType._zod.run(r,i);return t instanceof Promise?t.then(zc):zc(t)}});function zc(e){return e.value=Object.freeze(e.value),e}const cg=L("$ZodTemplateLiteral",(e,n)=>{qe.init(e,n);const r=[];for(const i of n.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);const t=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${i._zod.traits}`);const o=t.startsWith("^")?1:0,a=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(o,a))}else if(i===null||jd.has(typeof i))r.push(Zn(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,t)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"template_literal",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:n.format??"template_literal",pattern:e._zod.pattern.source}),i)}),ug=L("$ZodFunction",(e,n)=>(qe.init(e,n),e._def=n,e._zod.def=n,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){const t=e._def.input?fa(e._def.input,i):i,o=Reflect.apply(r,this,t);return e._def.output?fa(e._def.output,o):o}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){const t=e._def.input?await ma(e._def.input,i):i,o=await Reflect.apply(r,this,t);return e._def.output?await ma(e._def.output,o):o}},e._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{const i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new os({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{const i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),dg=L("$ZodPromise",(e,n)=>{qe.init(e,n),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(t=>n.innerType._zod.run({value:t,issues:[]},i))}),fg=L("$ZodLazy",(e,n)=>{qe.init(e,n),Qe(e._zod,"innerType",()=>n.getter()),Qe(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),Qe(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),Qe(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),Qe(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),mg=L("$ZodCustom",(e,n)=>{xt.init(e,n),qe.init(e,n),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,t=n.fn(i);if(t instanceof Promise)return t.then(o=>Ec(o,r,i,e));Ec(t,r,i,e)}});function Ec(e,n,r,i){if(!e){const t={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(t.params=i._zod.def.params),n.issues.push($r(t))}}const Z_=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"};return t=>{switch(t.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${t.expected}، ولكن تم إدخال ${r(t.input)}`;case"invalid_value":return t.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${Fe(t.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?` أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${o} ${t.maximum.toString()} ${a.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${t.origin??"القيمة"} ${o} ${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${o} ${t.minimum.toString()} ${a.unit}`:`أصغر من اللازم: يفترض لـ ${t.origin} أن يكون ${o} ${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${t.prefix}"`:o.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`:o.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`:o.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`:`${i[o.format]??t.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${t.divisor}`;case"unrecognized_keys":return`معرف${t.keys.length>1?"ات":""} غريب${t.keys.length>1?"ة":""}: ${le(t.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${t.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${t.origin}`;default:return"مدخل غير مقبول"}}};function B_(){return{localeError:Z_()}}const W_=()=>{const e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return t=>{switch(t.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${t.expected}, daxil olan ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Yanlış dəyər: gözlənilən ${Fe(t.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${o}${t.maximum.toString()} ${a.unit??"element"}`:`Çox böyük: gözlənilən ${t.origin??"dəyər"} ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Çox kiçik: gözlənilən ${t.origin} ${o}${t.minimum.toString()} ${a.unit}`:`Çox kiçik: gözlənilən ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`:o.format==="ends_with"?`Yanlış mətn: "${o.suffix}" ilə bitməlidir`:o.format==="includes"?`Yanlış mətn: "${o.includes}" daxil olmalıdır`:o.format==="regex"?`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${i[o.format]??t.format}`}case"not_multiple_of":return`Yanlış ədəd: ${t.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${t.keys.length>1?"lar":""}: ${le(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${t.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function q_(){return{localeError:W_()}}function Oc(e,n,r,i){const t=Math.abs(e),o=t%10,a=t%100;return a>=11&&a<=19?i:o===1?n:o>=2&&o<=4?r:i}const H_=()=>{const e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"лік";case"object":{if(Array.isArray(t))return"масіў";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"};return t=>{switch(t.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${t.expected}, атрымана ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Няправільны ўвод: чакалася ${Fe(t.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);if(a){const l=Number(t.maximum),u=Oc(l,a.unit.one,a.unit.few,a.unit.many);return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна ${a.verb} ${o}${t.maximum.toString()} ${u}`}return`Занадта вялікі: чакалася, што ${t.origin??"значэнне"} павінна быць ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);if(a){const l=Number(t.minimum),u=Oc(l,a.unit.one,a.unit.few,a.unit.many);return`Занадта малы: чакалася, што ${t.origin} павінна ${a.verb} ${o}${t.minimum.toString()} ${u}`}return`Занадта малы: чакалася, што ${t.origin} павінна быць ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${o.prefix}"`:o.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${o.suffix}"`:o.format==="includes"?`Няправільны радок: павінен змяшчаць "${o.includes}"`:o.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`:`Няправільны ${i[o.format]??t.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${t.keys.length>1?"ключы":"ключ"}: ${le(t.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${t.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${t.origin}`;default:return"Няправільны ўвод"}}};function G_(){return{localeError:H_()}}const K_=()=>{const e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return t=>{switch(t.code){case"invalid_type":return`Tipus invàlid: s'esperava ${t.expected}, s'ha rebut ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Valor invàlid: s'esperava ${Fe(t.values[0])}`:`Opció invàlida: s'esperava una de ${le(t.values," o ")}`;case"too_big":{const o=t.inclusive?"com a màxim":"menys de",a=n(t.origin);return a?`Massa gran: s'esperava que ${t.origin??"el valor"} contingués ${o} ${t.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${o} ${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?"com a mínim":"més de",a=n(t.origin);return a?`Massa petit: s'esperava que ${t.origin} contingués ${o} ${t.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${t.origin} fos ${o} ${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Format invàlid: ha de començar amb "${o.prefix}"`:o.format==="ends_with"?`Format invàlid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format invàlid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${o.pattern}`:`Format invàlid per a ${i[o.format]??t.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${le(t.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${t.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${t.origin}`;default:return"Entrada invàlida"}}};function V_(){return{localeError:K_()}}const J_=()=>{const e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(t))return"pole";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"};return t=>{switch(t.code){case"invalid_type":return`Neplatný vstup: očekáváno ${t.expected}, obdrženo ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Neplatný vstup: očekáváno ${Fe(t.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Hodnota je příliš velká: ${t.origin??"hodnota"} musí mít ${o}${t.maximum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš velká: ${t.origin??"hodnota"} musí být ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Hodnota je příliš malá: ${t.origin??"hodnota"} musí mít ${o}${t.minimum.toString()} ${a.unit??"prvků"}`:`Hodnota je příliš malá: ${t.origin??"hodnota"} musí být ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Neplatný řetězec: musí začínat na "${o.prefix}"`:o.format==="ends_with"?`Neplatný řetězec: musí končit na "${o.suffix}"`:o.format==="includes"?`Neplatný řetězec: musí obsahovat "${o.includes}"`:o.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`:`Neplatný formát ${i[o.format]??t.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${t.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${le(t.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${t.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${t.origin}`;default:return"Neplatný vstup"}}};function X_(){return{localeError:J_()}}const Y_=()=>{const e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},n={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};function r(a){return e[a]??null}function i(a){return n[a]??a}const t=a=>{const l=typeof a;switch(l){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return l},o={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${i(a.expected)}, fik ${i(t(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig værdi: forventede ${Fe(a.values[0])}`:`Ugyldigt valg: forventede en af følgende ${le(a.values,"|")}`;case"too_big":{const l=a.inclusive?"<=":"<",u=r(a.origin),c=i(a.origin);return u?`For stor: forventede ${c??"value"} ${u.verb} ${l} ${a.maximum.toString()} ${u.unit??"elementer"}`:`For stor: forventede ${c??"value"} havde ${l} ${a.maximum.toString()}`}case"too_small":{const l=a.inclusive?">=":">",u=r(a.origin),c=i(a.origin);return u?`For lille: forventede ${c} ${u.verb} ${l} ${a.minimum.toString()} ${u.unit}`:`For lille: forventede ${c} havde ${l} ${a.minimum.toString()}`}case"invalid_format":{const l=a;return l.format==="starts_with"?`Ugyldig streng: skal starte med "${l.prefix}"`:l.format==="ends_with"?`Ugyldig streng: skal ende med "${l.suffix}"`:l.format==="includes"?`Ugyldig streng: skal indeholde "${l.includes}"`:l.format==="regex"?`Ugyldig streng: skal matche mønsteret ${l.pattern}`:`Ugyldig ${o[l.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${le(a.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${a.origin}`;default:return"Ugyldigt input"}}};function Q_(){return{localeError:Y_()}}const ew=()=>{const e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"Zahl";case"object":{if(Array.isArray(t))return"Array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return t=>{switch(t.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${t.expected}, erhalten ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Ungültige Eingabe: erwartet ${Fe(t.values[0])}`:`Ungültige Option: erwartet eine von ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Zu groß: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${t.origin??"Wert"} ${o}${t.maximum.toString()} ist`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${t.origin} ${o}${t.minimum.toString()} ist`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ungültiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ungültiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ungültiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`:`Ungültig: ${i[o.format]??t.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${le(t.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${t.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${t.origin}`;default:return"Ungültige Eingabe"}}};function tw(){return{localeError:ew()}}const nw=e=>{const n=typeof e;switch(n){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return n},rw=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function n(i){return e[i]??null}const r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${nw(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${Fe(i.values[0])}`:`Invalid option: expected one of ${le(i.values,"|")}`;case"too_big":{const t=i.inclusive?"<=":"<",o=n(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${t}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${t}${i.maximum.toString()}`}case"too_small":{const t=i.inclusive?">=":">",o=n(i.origin);return o?`Too small: expected ${i.origin} to have ${t}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${t}${i.minimum.toString()}`}case"invalid_format":{const t=i;return t.format==="starts_with"?`Invalid string: must start with "${t.prefix}"`:t.format==="ends_with"?`Invalid string: must end with "${t.suffix}"`:t.format==="includes"?`Invalid string: must include "${t.includes}"`:t.format==="regex"?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${r[t.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${le(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function gg(){return{localeError:rw()}}const iw=e=>{const n=typeof e;switch(n){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return n},ow=()=>{const e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function n(i){return e[i]??null}const r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return i=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${i.expected}, riceviĝis ${iw(i.input)}`;case"invalid_value":return i.values.length===1?`Nevalida enigo: atendiĝis ${Fe(i.values[0])}`:`Nevalida opcio: atendiĝis unu el ${le(i.values,"|")}`;case"too_big":{const t=i.inclusive?"<=":"<",o=n(i.origin);return o?`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${t}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${t}${i.maximum.toString()}`}case"too_small":{const t=i.inclusive?">=":">",o=n(i.origin);return o?`Tro malgranda: atendiĝis ke ${i.origin} havu ${t}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendiĝis ke ${i.origin} estu ${t}${i.minimum.toString()}`}case"invalid_format":{const t=i;return t.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${r[t.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} ŝlosilo${i.keys.length>1?"j":""}: ${le(i.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function aw(){return{localeError:ow()}}const sw=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},n={string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};function r(a){return e[a]??null}function i(a){return n[a]??a}const t=a=>{const l=typeof a;switch(l){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return l},o={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return a=>{switch(a.code){case"invalid_type":return`Entrada inválida: se esperaba ${i(a.expected)}, recibido ${i(t(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inválida: se esperaba ${Fe(a.values[0])}`:`Opción inválida: se esperaba una de ${le(a.values,"|")}`;case"too_big":{const l=a.inclusive?"<=":"<",u=r(a.origin),c=i(a.origin);return u?`Demasiado grande: se esperaba que ${c??"valor"} tuviera ${l}${a.maximum.toString()} ${u.unit??"elementos"}`:`Demasiado grande: se esperaba que ${c??"valor"} fuera ${l}${a.maximum.toString()}`}case"too_small":{const l=a.inclusive?">=":">",u=r(a.origin),c=i(a.origin);return u?`Demasiado pequeño: se esperaba que ${c} tuviera ${l}${a.minimum.toString()} ${u.unit}`:`Demasiado pequeño: se esperaba que ${c} fuera ${l}${a.minimum.toString()}`}case"invalid_format":{const l=a;return l.format==="starts_with"?`Cadena inválida: debe comenzar con "${l.prefix}"`:l.format==="ends_with"?`Cadena inválida: debe terminar en "${l.suffix}"`:l.format==="includes"?`Cadena inválida: debe incluir "${l.includes}"`:l.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${l.pattern}`:`Inválido ${o[l.format]??a.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${le(a.keys,", ")}`;case"invalid_key":return`Llave inválida en ${i(a.origin)}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${i(a.origin)}`;default:return"Entrada inválida"}}};function lw(){return{localeError:sw()}}const cw=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"عدد";case"object":{if(Array.isArray(t))return"آرایه";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"};return t=>{switch(t.code){case"invalid_type":return`ورودی نامعتبر: میبایست ${t.expected} میبود، ${r(t.input)} دریافت شد`;case"invalid_value":return t.values.length===1?`ورودی نامعتبر: میبایست ${Fe(t.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${le(t.values,"|")} میبود`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`خیلی بزرگ: ${t.origin??"مقدار"} باید ${o}${t.maximum.toString()} ${a.unit??"عنصر"} باشد`:`خیلی بزرگ: ${t.origin??"مقدار"} باید ${o}${t.maximum.toString()} باشد`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`خیلی کوچک: ${t.origin} باید ${o}${t.minimum.toString()} ${a.unit} باشد`:`خیلی کوچک: ${t.origin} باید ${o}${t.minimum.toString()} باشد`}case"invalid_format":{const o=t;return o.format==="starts_with"?`رشته نامعتبر: باید با "${o.prefix}" شروع شود`:o.format==="ends_with"?`رشته نامعتبر: باید با "${o.suffix}" تمام شود`:o.format==="includes"?`رشته نامعتبر: باید شامل "${o.includes}" باشد`:o.format==="regex"?`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`:`${i[o.format]??t.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${t.divisor} باشد`;case"unrecognized_keys":return`کلید${t.keys.length>1?"های":""} ناشناس: ${le(t.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${t.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${t.origin}`;default:return"ورودی نامعتبر"}}};function uw(){return{localeError:cw()}}const dw=()=>{const e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return t=>{switch(t.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${t.expected}, oli ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Virheellinen syöte: täytyy olla ${Fe(t.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Liian suuri: ${a.subject} täytyy olla ${o}${t.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon täytyy olla ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Liian pieni: ${a.subject} täytyy olla ${o}${t.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon täytyy olla ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen syöte: täytyy sisältää "${o.includes}"`:o.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${le(t.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function fw(){return{localeError:dw()}}const mw=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"nombre";case"object":{if(Array.isArray(t))return"tableau";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return t=>{switch(t.code){case"invalid_type":return`Entrée invalide : ${t.expected} attendu, ${r(t.input)} reçu`;case"invalid_value":return t.values.length===1?`Entrée invalide : ${Fe(t.values[0])} attendu`:`Option invalide : une valeur parmi ${le(t.values,"|")} attendue`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Trop grand : ${t.origin??"valeur"} doit ${a.verb} ${o}${t.maximum.toString()} ${a.unit??"élément(s)"}`:`Trop grand : ${t.origin??"valeur"} doit être ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Trop petit : ${t.origin} doit ${a.verb} ${o}${t.minimum.toString()} ${a.unit}`:`Trop petit : ${t.origin} doit être ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${o.pattern}`:`${i[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${le(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function gw(){return{localeError:mw()}}const hw=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"};return t=>{switch(t.code){case"invalid_type":return`Entrée invalide : attendu ${t.expected}, reçu ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Entrée invalide : attendu ${Fe(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"≤":"<",a=n(t.origin);return a?`Trop grand : attendu que ${t.origin??"la valeur"} ait ${o}${t.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${t.origin??"la valeur"} soit ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?"≥":">",a=n(t.origin);return a?`Trop petit : attendu que ${t.origin} ait ${o}${t.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${t.origin} soit ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${t.divisor}`;case"unrecognized_keys":return`Clé${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${le(t.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${t.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entrée invalide"}}};function pw(){return{localeError:hw()}}const vw=()=>{const e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return t=>{switch(t.code){case"invalid_type":return`קלט לא תקין: צריך ${t.expected}, התקבל ${r(t.input)}`;case"invalid_value":return t.values.length===1?`קלט לא תקין: צריך ${Fe(t.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`גדול מדי: ${t.origin??"value"} צריך להיות ${o}${t.maximum.toString()} ${a.unit??"elements"}`:`גדול מדי: ${t.origin??"value"} צריך להיות ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`קטן מדי: ${t.origin} צריך להיות ${o}${t.minimum.toString()} ${a.unit}`:`קטן מדי: ${t.origin} צריך להיות ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`מחרוזת לא תקינה: חייבת להתחיל ב"${o.prefix}"`:o.format==="ends_with"?`מחרוזת לא תקינה: חייבת להסתיים ב "${o.suffix}"`:o.format==="includes"?`מחרוזת לא תקינה: חייבת לכלול "${o.includes}"`:o.format==="regex"?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${o.pattern}`:`${i[o.format]??t.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case"unrecognized_keys":return`מפתח${t.keys.length>1?"ות":""} לא מזוה${t.keys.length>1?"ים":"ה"}: ${le(t.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${t.origin}`;case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${t.origin}`;default:return"קלט לא תקין"}}};function bw(){return{localeError:vw()}}const yw=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"szám";case"object":{if(Array.isArray(t))return"tömb";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"};return t=>{switch(t.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${t.expected}, a kapott érték ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Érvénytelen bemenet: a várt érték ${Fe(t.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Túl nagy: ${t.origin??"érték"} mérete túl nagy ${o}${t.maximum.toString()} ${a.unit??"elem"}`:`Túl nagy: a bemeneti érték ${t.origin??"érték"} túl nagy: ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Túl kicsi: a bemeneti érték ${t.origin} mérete túl kicsi ${o}${t.minimum.toString()} ${a.unit}`:`Túl kicsi: a bemeneti érték ${t.origin} túl kicsi ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`:o.format==="ends_with"?`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`:o.format==="includes"?`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`:o.format==="regex"?`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`:`Érvénytelen ${i[o.format]??t.format}`}case"not_multiple_of":return`Érvénytelen szám: ${t.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${le(t.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${t.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${t.origin}`;default:return"Érvénytelen bemenet"}}};function $w(){return{localeError:yw()}}const _w=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return t=>{switch(t.code){case"invalid_type":return`Input tidak valid: diharapkan ${t.expected}, diterima ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Input tidak valid: diharapkan ${Fe(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${o}${t.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Terlalu kecil: diharapkan ${t.origin} memiliki ${o}${t.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${t.origin} menjadi ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??t.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${t.keys.length>1?"s":""}: ${le(t.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${t.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${t.origin}`;default:return"Input tidak valid"}}};function ww(){return{localeError:_w()}}const xw=e=>{const n=typeof e;switch(n){case"number":return Number.isNaN(e)?"NaN":"númer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return n},kw=()=>{const e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function n(i){return e[i]??null}const r={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"};return i=>{switch(i.code){case"invalid_type":return`Rangt gildi: Þú slóst inn ${xw(i.input)} þar sem á að vera ${i.expected}`;case"invalid_value":return i.values.length===1?`Rangt gildi: gert ráð fyrir ${Fe(i.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${le(i.values,"|")}`;case"too_big":{const t=i.inclusive?"<=":"<",o=n(i.origin);return o?`Of stórt: gert er ráð fyrir að ${i.origin??"gildi"} hafi ${t}${i.maximum.toString()} ${o.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${i.origin??"gildi"} sé ${t}${i.maximum.toString()}`}case"too_small":{const t=i.inclusive?">=":">",o=n(i.origin);return o?`Of lítið: gert er ráð fyrir að ${i.origin} hafi ${t}${i.minimum.toString()} ${o.unit}`:`Of lítið: gert er ráð fyrir að ${i.origin} sé ${t}${i.minimum.toString()}`}case"invalid_format":{const t=i;return t.format==="starts_with"?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format==="ends_with"?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format==="includes"?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${r[t.format]??i.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`Óþekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${le(i.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${i.origin}`;default:return"Rangt gildi"}}};function Sw(){return{localeError:kw()}}const Iw=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"numero";case"object":{if(Array.isArray(t))return"vettore";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return t=>{switch(t.code){case"invalid_type":return`Input non valido: atteso ${t.expected}, ricevuto ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Input non valido: atteso ${Fe(t.values[0])}`:`Opzione non valida: atteso uno tra ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Troppo grande: ${t.origin??"valore"} deve avere ${o}${t.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${t.origin??"valore"} deve essere ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Troppo piccolo: ${t.origin} deve avere ${o}${t.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${t.origin} deve essere ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??t.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${t.divisor}`;case"unrecognized_keys":return`Chiav${t.keys.length>1?"i":"e"} non riconosciut${t.keys.length>1?"e":"a"}: ${le(t.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${t.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${t.origin}`;default:return"Input non valido"}}};function Tw(){return{localeError:Iw()}}const Cw=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"数値";case"object":{if(Array.isArray(t))return"配列";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"};return t=>{switch(t.code){case"invalid_type":return`無効な入力: ${t.expected}が期待されましたが、${r(t.input)}が入力されました`;case"invalid_value":return t.values.length===1?`無効な入力: ${Fe(t.values[0])}が期待されました`:`無効な選択: ${le(t.values,"、")}のいずれかである必要があります`;case"too_big":{const o=t.inclusive?"以下である":"より小さい",a=n(t.origin);return a?`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${a.unit??"要素"}${o}必要があります`:`大きすぎる値: ${t.origin??"値"}は${t.maximum.toString()}${o}必要があります`}case"too_small":{const o=t.inclusive?"以上である":"より大きい",a=n(t.origin);return a?`小さすぎる値: ${t.origin}は${t.minimum.toString()}${a.unit}${o}必要があります`:`小さすぎる値: ${t.origin}は${t.minimum.toString()}${o}必要があります`}case"invalid_format":{const o=t;return o.format==="starts_with"?`無効な文字列: "${o.prefix}"で始まる必要があります`:o.format==="ends_with"?`無効な文字列: "${o.suffix}"で終わる必要があります`:o.format==="includes"?`無効な文字列: "${o.includes}"を含む必要があります`:o.format==="regex"?`無効な文字列: パターン${o.pattern}に一致する必要があります`:`無効な${i[o.format]??t.format}`}case"not_multiple_of":return`無効な数値: ${t.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${t.keys.length>1?"群":""}: ${le(t.keys,"、")}`;case"invalid_key":return`${t.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${t.origin}内の無効な値`;default:return"無効な入力"}}};function Dw(){return{localeError:Cw()}}const zw=e=>{const n=typeof e;switch(n){case"number":return Number.isNaN(e)?"NaN":"რიცხვი";case"object":{if(Array.isArray(e))return"მასივი";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"სტრინგი",boolean:"ბულეანი",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"ფუნქცია"}[n]??n},Ew=()=>{const e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function n(i){return e[i]??null}const r={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"};return i=>{switch(i.code){case"invalid_type":return`არასწორი შეყვანა: მოსალოდნელი ${i.expected}, მიღებული ${zw(i.input)}`;case"invalid_value":return i.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${Fe(i.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${le(i.values,"|")}-დან`;case"too_big":{const t=i.inclusive?"<=":"<",o=n(i.origin);return o?`ზედმეტად დიდი: მოსალოდნელი ${i.origin??"მნიშვნელობა"} ${o.verb} ${t}${i.maximum.toString()} ${o.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${i.origin??"მნიშვნელობა"} იყოს ${t}${i.maximum.toString()}`}case"too_small":{const t=i.inclusive?">=":">",o=n(i.origin);return o?`ზედმეტად პატარა: მოსალოდნელი ${i.origin} ${o.verb} ${t}${i.minimum.toString()} ${o.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${i.origin} იყოს ${t}${i.minimum.toString()}`}case"invalid_format":{const t=i;return t.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${r[t.format]??i.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${i.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${i.keys.length>1?"ები":"ი"}: ${le(i.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${i.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${i.origin}-ში`;default:return"არასწორი შეყვანა"}}};function Ow(){return{localeError:Ew()}}const Aw=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":{if(Array.isArray(t))return"អារេ (Array)";if(t===null)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"};return t=>{switch(t.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t.expected} ប៉ុន្តែទទួលបាន ${r(t.input)}`;case"invalid_value":return t.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${Fe(t.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${o} ${t.maximum.toString()} ${a.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${t.origin??"តម្លៃ"} ${o} ${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`តូចពេក៖ ត្រូវការ ${t.origin} ${o} ${t.minimum.toString()} ${a.unit}`:`តូចពេក៖ ត្រូវការ ${t.origin} ${o} ${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`:o.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`:o.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`:o.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`:`មិនត្រឹមត្រូវ៖ ${i[o.format]??t.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${t.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${le(t.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${t.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function hg(){return{localeError:Aw()}}function Pw(){return hg()}const Nw=()=>{const e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"};return t=>{switch(t.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${t.expected}, 받은 타입은 ${r(t.input)}입니다`;case"invalid_value":return t.values.length===1?`잘못된 입력: 값은 ${Fe(t.values[0])} 이어야 합니다`:`잘못된 옵션: ${le(t.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const o=t.inclusive?"이하":"미만",a=o==="미만"?"이어야 합니다":"여야 합니다",l=n(t.origin),u=l?.unit??"요소";return l?`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()}${u} ${o}${a}`:`${t.origin??"값"}이 너무 큽니다: ${t.maximum.toString()} ${o}${a}`}case"too_small":{const o=t.inclusive?"이상":"초과",a=o==="이상"?"이어야 합니다":"여야 합니다",l=n(t.origin),u=l?.unit??"요소";return l?`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()}${u} ${o}${a}`:`${t.origin??"값"}이 너무 작습니다: ${t.minimum.toString()} ${o}${a}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`:o.format==="ends_with"?`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`:o.format==="includes"?`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`:o.format==="regex"?`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`:`잘못된 ${i[o.format]??t.format}`}case"not_multiple_of":return`잘못된 숫자: ${t.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${le(t.keys,", ")}`;case"invalid_key":return`잘못된 키: ${t.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${t.origin}`;default:return"잘못된 입력"}}};function jw(){return{localeError:Nw()}}const Uw=e=>Yr(typeof e,e),Yr=(e,n=void 0)=>{switch(e){case"number":return Number.isNaN(n)?"NaN":"skaičius";case"bigint":return"sveikasis skaičius";case"string":return"eilutė";case"boolean":return"loginė reikšmė";case"undefined":case"void":return"neapibrėžta reikšmė";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return n===void 0?"nežinomas objektas":n===null?"nulinė reikšmė":Array.isArray(n)?"masyvas":Object.getPrototypeOf(n)!==Object.prototype&&n.constructor?n.constructor.name:"objektas";case"null":return"nulinė reikšmė"}return e},Kr=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ac(e){const n=Math.abs(e),r=n%10,i=n%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}const Lw=()=>{const e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function n(i,t,o,a){const l=e[i]??null;return l===null?l:{unit:l.unit[t],verb:l.verb[a][o?"inclusive":"notInclusive"]}}const r={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"};return i=>{switch(i.code){case"invalid_type":return`Gautas tipas ${Uw(i.input)}, o tikėtasi - ${Yr(i.expected)}`;case"invalid_value":return i.values.length===1?`Privalo būti ${Fe(i.values[0])}`:`Privalo būti vienas iš ${le(i.values,"|")} pasirinkimų`;case"too_big":{const t=Yr(i.origin),o=n(i.origin,Ac(Number(i.maximum)),i.inclusive??!1,"smaller");if(o?.verb)return`${Kr(t??i.origin??"reikšmė")} ${o.verb} ${i.maximum.toString()} ${o.unit??"elementų"}`;const a=i.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Kr(t??i.origin??"reikšmė")} turi būti ${a} ${i.maximum.toString()} ${o?.unit}`}case"too_small":{const t=Yr(i.origin),o=n(i.origin,Ac(Number(i.minimum)),i.inclusive??!1,"bigger");if(o?.verb)return`${Kr(t??i.origin??"reikšmė")} ${o.verb} ${i.minimum.toString()} ${o.unit??"elementų"}`;const a=i.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Kr(t??i.origin??"reikšmė")} turi būti ${a} ${i.minimum.toString()} ${o?.unit}`}case"invalid_format":{const t=i;return t.format==="starts_with"?`Eilutė privalo prasidėti "${t.prefix}"`:t.format==="ends_with"?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format==="includes"?`Eilutė privalo įtraukti "${t.includes}"`:t.format==="regex"?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${r[t.format]??i.format}`}case"not_multiple_of":return`Skaičius privalo būti ${i.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${i.keys.length>1?"i":"as"} rakt${i.keys.length>1?"ai":"as"}: ${le(i.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const t=Yr(i.origin);return`${Kr(t??i.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Rw(){return{localeError:Lw()}}const Mw=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"број";case"object":{if(Array.isArray(t))return"низа";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"};return t=>{switch(t.code){case"invalid_type":return`Грешен внес: се очекува ${t.expected}, примено ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Invalid input: expected ${Fe(t.values[0])}`:`Грешана опција: се очекува една ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Премногу голем: се очекува ${t.origin??"вредноста"} да има ${o}${t.maximum.toString()} ${a.unit??"елементи"}`:`Премногу голем: се очекува ${t.origin??"вредноста"} да биде ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Премногу мал: се очекува ${t.origin} да има ${o}${t.minimum.toString()} ${a.unit}`:`Премногу мал: се очекува ${t.origin} да биде ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Неважечка низа: мора да започнува со "${o.prefix}"`:o.format==="ends_with"?`Неважечка низа: мора да завршува со "${o.suffix}"`:o.format==="includes"?`Неважечка низа: мора да вклучува "${o.includes}"`:o.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${o.pattern}`:`Invalid ${i[o.format]??t.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${le(t.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${t.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${t.origin}`;default:return"Грешен внес"}}};function Fw(){return{localeError:Mw()}}const Zw=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"nombor";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return t=>{switch(t.code){case"invalid_type":return`Input tidak sah: dijangka ${t.expected}, diterima ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Input tidak sah: dijangka ${Fe(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Terlalu besar: dijangka ${t.origin??"nilai"} ${a.verb} ${o}${t.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Terlalu kecil: dijangka ${t.origin} ${a.verb} ${o}${t.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${t.origin} adalah ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${le(t.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${t.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${t.origin}`;default:return"Input tidak sah"}}};function Bw(){return{localeError:Zw()}}const Ww=()=>{const e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"getal";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return t=>{switch(t.code){case"invalid_type":return`Ongeldige invoer: verwacht ${t.expected}, ontving ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Ongeldige invoer: verwacht ${Fe(t.values[0])}`:`Ongeldige optie: verwacht één van ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Te lang: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${t.origin??"waarde"} ${o}${t.maximum.toString()} is`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Te kort: verwacht dat ${t.origin} ${o}${t.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${t.origin} ${o}${t.minimum.toString()} is`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??t.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${t.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${t.keys.length>1?"s":""}: ${le(t.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${t.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${t.origin}`;default:return"Ongeldige invoer"}}};function qw(){return{localeError:Ww()}}const Hw=()=>{const e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"tall";case"object":{if(Array.isArray(t))return"liste";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return t=>{switch(t.code){case"invalid_type":return`Ugyldig input: forventet ${t.expected}, fikk ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventet ${Fe(t.values[0])}`:`Ugyldig valg: forventet en av ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`For stor(t): forventet ${t.origin??"value"} til å ha ${o}${t.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${t.origin??"value"} til å ha ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`For lite(n): forventet ${t.origin} til å ha ${o}${t.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${t.origin} til å ha ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ugyldig streng: må starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: må ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: må inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: må matche mønsteret ${o.pattern}`:`Ugyldig ${i[o.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${le(t.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function Gw(){return{localeError:Hw()}}const Kw=()=>{const e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"numara";case"object":{if(Array.isArray(t))return"saf";if(t===null)return"gayb";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"};return t=>{switch(t.code){case"invalid_type":return`Fâsit giren: umulan ${t.expected}, alınan ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Fâsit giren: umulan ${Fe(t.values[0])}`:`Fâsit tercih: mûteberler ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Fazla büyük: ${t.origin??"value"}, ${o}${t.maximum.toString()} ${a.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${t.origin??"value"}, ${o}${t.maximum.toString()} olmalıydı.`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Fazla küçük: ${t.origin}, ${o}${t.minimum.toString()} ${a.unit} sahip olmalıydı.`:`Fazla küçük: ${t.origin}, ${o}${t.minimum.toString()} olmalıydı.`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Fâsit metin: "${o.prefix}" ile başlamalı.`:o.format==="ends_with"?`Fâsit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`Fâsit metin: "${o.includes}" ihtivâ etmeli.`:o.format==="regex"?`Fâsit metin: ${o.pattern} nakşına uymalı.`:`Fâsit ${i[o.format]??t.format}`}case"not_multiple_of":return`Fâsit sayı: ${t.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${t.keys.length>1?"s":""}: ${le(t.keys,", ")}`;case"invalid_key":return`${t.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${t.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function Vw(){return{localeError:Kw()}}const Jw=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"عدد";case"object":{if(Array.isArray(t))return"ارې";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"};return t=>{switch(t.code){case"invalid_type":return`ناسم ورودي: باید ${t.expected} وای, مګر ${r(t.input)} ترلاسه شو`;case"invalid_value":return t.values.length===1?`ناسم ورودي: باید ${Fe(t.values[0])} وای`:`ناسم انتخاب: باید یو له ${le(t.values,"|")} څخه وای`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`ډیر لوی: ${t.origin??"ارزښت"} باید ${o}${t.maximum.toString()} ${a.unit??"عنصرونه"} ولري`:`ډیر لوی: ${t.origin??"ارزښت"} باید ${o}${t.maximum.toString()} وي`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`ډیر کوچنی: ${t.origin} باید ${o}${t.minimum.toString()} ${a.unit} ولري`:`ډیر کوچنی: ${t.origin} باید ${o}${t.minimum.toString()} وي`}case"invalid_format":{const o=t;return o.format==="starts_with"?`ناسم متن: باید د "${o.prefix}" سره پیل شي`:o.format==="ends_with"?`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`:o.format==="includes"?`ناسم متن: باید "${o.includes}" ولري`:o.format==="regex"?`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`:`${i[o.format]??t.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${t.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${t.keys.length>1?"کلیډونه":"کلیډ"}: ${le(t.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${t.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${t.origin} کې`;default:return"ناسمه ورودي"}}};function Xw(){return{localeError:Jw()}}const Yw=()=>{const e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"liczba";case"object":{if(Array.isArray(t))return"tablica";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"};return t=>{switch(t.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${t.expected}, otrzymano ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${Fe(t.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Za duża wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${o}${t.maximum.toString()} ${a.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Za mała wartość: oczekiwano, że ${t.origin??"wartość"} będzie mieć ${o}${t.minimum.toString()} ${a.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${t.origin??"wartość"} będzie wynosić ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`:o.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`:o.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`:o.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`:`Nieprawidłow(y/a/e) ${i[o.format]??t.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${le(t.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${t.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${t.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Qw(){return{localeError:Yw()}}const ex=()=>{const e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"número";case"object":{if(Array.isArray(t))return"array";if(t===null)return"nulo";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"};return t=>{switch(t.code){case"invalid_type":return`Tipo inválido: esperado ${t.expected}, recebido ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Entrada inválida: esperado ${Fe(t.values[0])}`:`Opção inválida: esperada uma das ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Muito grande: esperado que ${t.origin??"valor"} tivesse ${o}${t.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${t.origin??"valor"} fosse ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Muito pequeno: esperado que ${t.origin} tivesse ${o}${t.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${t.origin} fosse ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Texto inválido: deve começar com "${o.prefix}"`:o.format==="ends_with"?`Texto inválido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inválido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inválido: deve corresponder ao padrão ${o.pattern}`:`${i[o.format]??t.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${t.divisor}`;case"unrecognized_keys":return`Chave${t.keys.length>1?"s":""} desconhecida${t.keys.length>1?"s":""}: ${le(t.keys,", ")}`;case"invalid_key":return`Chave inválida em ${t.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${t.origin}`;default:return"Campo inválido"}}};function tx(){return{localeError:ex()}}function Pc(e,n,r,i){const t=Math.abs(e),o=t%10,a=t%100;return a>=11&&a<=19?i:o===1?n:o>=2&&o<=4?r:i}const nx=()=>{const e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"число";case"object":{if(Array.isArray(t))return"массив";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"};return t=>{switch(t.code){case"invalid_type":return`Неверный ввод: ожидалось ${t.expected}, получено ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Неверный ввод: ожидалось ${Fe(t.values[0])}`:`Неверный вариант: ожидалось одно из ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);if(a){const l=Number(t.maximum),u=Pc(l,a.unit.one,a.unit.few,a.unit.many);return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет иметь ${o}${t.maximum.toString()} ${u}`}return`Слишком большое значение: ожидалось, что ${t.origin??"значение"} будет ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);if(a){const l=Number(t.minimum),u=Pc(l,a.unit.one,a.unit.few,a.unit.many);return`Слишком маленькое значение: ожидалось, что ${t.origin} будет иметь ${o}${t.minimum.toString()} ${u}`}return`Слишком маленькое значение: ожидалось, что ${t.origin} будет ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Неверная строка: должна начинаться с "${o.prefix}"`:o.format==="ends_with"?`Неверная строка: должна заканчиваться на "${o.suffix}"`:o.format==="includes"?`Неверная строка: должна содержать "${o.includes}"`:o.format==="regex"?`Неверная строка: должна соответствовать шаблону ${o.pattern}`:`Неверный ${i[o.format]??t.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${t.divisor}`;case"unrecognized_keys":return`Нераспознанн${t.keys.length>1?"ые":"ый"} ключ${t.keys.length>1?"и":""}: ${le(t.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${t.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${t.origin}`;default:return"Неверные входные данные"}}};function rx(){return{localeError:nx()}}const ix=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"število";case"object":{if(Array.isArray(t))return"tabela";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"};return t=>{switch(t.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${t.expected}, prejeto ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Neveljaven vnos: pričakovano ${Fe(t.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} imelo ${o}${t.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${t.origin??"vrednost"} ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Premajhno: pričakovano, da bo ${t.origin} imelo ${o}${t.minimum.toString()} ${a.unit}`:`Premajhno: pričakovano, da bo ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Neveljaven niz: mora se začeti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se končati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??t.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i ključi":" ključ"}: ${le(t.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function ox(){return{localeError:ix()}}const ax=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"antal";case"object":{if(Array.isArray(t))return"lista";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return t=>{switch(t.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${t.expected}, fick ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Ogiltig inmatning: förväntat ${Fe(t.values[0])}`:`Ogiltigt val: förväntade en av ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`För stor(t): förväntade ${t.origin??"värdet"} att ha ${o}${t.maximum.toString()} ${a.unit??"element"}`:`För stor(t): förväntat ${t.origin??"värdet"} att ha ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`För lite(t): förväntade ${t.origin??"värdet"} att ha ${o}${t.minimum.toString()} ${a.unit}`:`För lite(t): förväntade ${t.origin??"värdet"} att ha ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ogiltig sträng: måste börja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig sträng: måste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig sträng: måste innehålla "${o.includes}"`:o.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${le(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${t.origin??"värdet"}`;default:return"Ogiltig input"}}};function sx(){return{localeError:ax()}}const lx=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"எண் அல்லாதது":"எண்";case"object":{if(Array.isArray(t))return"அணி";if(t===null)return"வெறுமை";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"};return t=>{switch(t.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t.expected}, பெறப்பட்டது ${r(t.input)}`;case"invalid_value":return t.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${Fe(t.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${le(t.values,"|")} இல் ஒன்று`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${o}${t.maximum.toString()} ${a.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${t.origin??"மதிப்பு"} ${o}${t.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${o}${t.minimum.toString()} ${a.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${t.origin} ${o}${t.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const o=t;return o.format==="starts_with"?`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`:o.format==="ends_with"?`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`:o.format==="includes"?`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`:o.format==="regex"?`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${i[o.format]??t.format}`}case"not_multiple_of":return`தவறான எண்: ${t.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${t.keys.length>1?"கள்":""}: ${le(t.keys,", ")}`;case"invalid_key":return`${t.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${t.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function cx(){return{localeError:lx()}}const ux=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":{if(Array.isArray(t))return"อาร์เรย์ (Array)";if(t===null)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"};return t=>{switch(t.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t.expected} แต่ได้รับ ${r(t.input)}`;case"invalid_value":return t.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${Fe(t.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"ไม่เกิน":"น้อยกว่า",a=n(t.origin);return a?`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${o} ${t.maximum.toString()} ${a.unit??"รายการ"}`:`เกินกำหนด: ${t.origin??"ค่า"} ควรมี${o} ${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?"อย่างน้อย":"มากกว่า",a=n(t.origin);return a?`น้อยกว่ากำหนด: ${t.origin} ควรมี${o} ${t.minimum.toString()} ${a.unit}`:`น้อยกว่ากำหนด: ${t.origin} ควรมี${o} ${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`:o.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`:o.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`:o.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`:`รูปแบบไม่ถูกต้อง: ${i[o.format]??t.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${t.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${le(t.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${t.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${t.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function dx(){return{localeError:ux()}}const fx=e=>{const n=typeof e;switch(n){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return n},mx=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function n(i){return e[i]??null}const r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"};return i=>{switch(i.code){case"invalid_type":return`Geçersiz değer: beklenen ${i.expected}, alınan ${fx(i.input)}`;case"invalid_value":return i.values.length===1?`Geçersiz değer: beklenen ${Fe(i.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${le(i.values,"|")}`;case"too_big":{const t=i.inclusive?"<=":"<",o=n(i.origin);return o?`Çok büyük: beklenen ${i.origin??"değer"} ${t}${i.maximum.toString()} ${o.unit??"öğe"}`:`Çok büyük: beklenen ${i.origin??"değer"} ${t}${i.maximum.toString()}`}case"too_small":{const t=i.inclusive?">=":">",o=n(i.origin);return o?`Çok küçük: beklenen ${i.origin} ${t}${i.minimum.toString()} ${o.unit}`:`Çok küçük: beklenen ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":{const t=i;return t.format==="starts_with"?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format==="ends_with"?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format==="includes"?`Geçersiz metin: "${t.includes}" içermeli`:t.format==="regex"?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${r[t.format]??i.format}`}case"not_multiple_of":return`Geçersiz sayı: ${i.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${le(i.keys,", ")}`;case"invalid_key":return`${i.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${i.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function gx(){return{localeError:mx()}}const hx=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"число";case"object":{if(Array.isArray(t))return"масив";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"};return t=>{switch(t.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${t.expected}, отримано ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Неправильні вхідні дані: очікується ${Fe(t.values[0])}`:`Неправильна опція: очікується одне з ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Занадто велике: очікується, що ${t.origin??"значення"} ${a.verb} ${o}${t.maximum.toString()} ${a.unit??"елементів"}`:`Занадто велике: очікується, що ${t.origin??"значення"} буде ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Занадто мале: очікується, що ${t.origin} ${a.verb} ${o}${t.minimum.toString()} ${a.unit}`:`Занадто мале: очікується, що ${t.origin} буде ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Неправильний рядок: повинен починатися з "${o.prefix}"`:o.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`:o.format==="includes"?`Неправильний рядок: повинен містити "${o.includes}"`:o.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`:`Неправильний ${i[o.format]??t.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${t.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${t.keys.length>1?"і":""}: ${le(t.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${t.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${t.origin}`;default:return"Неправильні вхідні дані"}}};function pg(){return{localeError:hx()}}function px(){return pg()}const vx=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"نمبر";case"object":{if(Array.isArray(t))return"آرے";if(t===null)return"نل";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"};return t=>{switch(t.code){case"invalid_type":return`غلط ان پٹ: ${t.expected} متوقع تھا، ${r(t.input)} موصول ہوا`;case"invalid_value":return t.values.length===1?`غلط ان پٹ: ${Fe(t.values[0])} متوقع تھا`:`غلط آپشن: ${le(t.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`بہت بڑا: ${t.origin??"ویلیو"} کے ${o}${t.maximum.toString()} ${a.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${t.origin??"ویلیو"} کا ${o}${t.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`بہت چھوٹا: ${t.origin} کے ${o}${t.minimum.toString()} ${a.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${t.origin} کا ${o}${t.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const o=t;return o.format==="starts_with"?`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`:o.format==="ends_with"?`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`:o.format==="includes"?`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`:o.format==="regex"?`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`:`غلط ${i[o.format]??t.format}`}case"not_multiple_of":return`غلط نمبر: ${t.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${t.keys.length>1?"ز":""}: ${le(t.keys,"، ")}`;case"invalid_key":return`${t.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${t.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function bx(){return{localeError:vx()}}const yx=()=>{const e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"số";case"object":{if(Array.isArray(t))return"mảng";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"};return t=>{switch(t.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${t.expected}, nhận được ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Đầu vào không hợp lệ: mong đợi ${Fe(t.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Quá lớn: mong đợi ${t.origin??"giá trị"} ${a.verb} ${o}${t.maximum.toString()} ${a.unit??"phần tử"}`:`Quá lớn: mong đợi ${t.origin??"giá trị"} ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Quá nhỏ: mong đợi ${t.origin} ${a.verb} ${o}${t.minimum.toString()} ${a.unit}`:`Quá nhỏ: mong đợi ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`:o.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`:o.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`:o.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`:`${i[o.format]??t.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${t.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${le(t.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${t.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${t.origin}`;default:return"Đầu vào không hợp lệ"}}};function $x(){return{localeError:yx()}}const _x=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"非数字(NaN)":"数字";case"object":{if(Array.isArray(t))return"数组";if(t===null)return"空值(null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"};return t=>{switch(t.code){case"invalid_type":return`无效输入:期望 ${t.expected},实际接收 ${r(t.input)}`;case"invalid_value":return t.values.length===1?`无效输入:期望 ${Fe(t.values[0])}`:`无效选项:期望以下之一 ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`数值过大:期望 ${t.origin??"值"} ${o}${t.maximum.toString()} ${a.unit??"个元素"}`:`数值过大:期望 ${t.origin??"值"} ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`数值过小:期望 ${t.origin} ${o}${t.minimum.toString()} ${a.unit}`:`数值过小:期望 ${t.origin} ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`无效字符串:必须以 "${o.prefix}" 开头`:o.format==="ends_with"?`无效字符串:必须以 "${o.suffix}" 结尾`:o.format==="includes"?`无效字符串:必须包含 "${o.includes}"`:o.format==="regex"?`无效字符串:必须满足正则表达式 ${o.pattern}`:`无效${i[o.format]??t.format}`}case"not_multiple_of":return`无效数字:必须是 ${t.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${le(t.keys,", ")}`;case"invalid_key":return`${t.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${t.origin} 中包含无效值(value)`;default:return"无效输入"}}};function wx(){return{localeError:_x()}}const xx=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"};return t=>{switch(t.code){case"invalid_type":return`無效的輸入值:預期為 ${t.expected},但收到 ${r(t.input)}`;case"invalid_value":return t.values.length===1?`無效的輸入值:預期為 ${Fe(t.values[0])}`:`無效的選項:預期為以下其中之一 ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`數值過大:預期 ${t.origin??"值"} 應為 ${o}${t.maximum.toString()} ${a.unit??"個元素"}`:`數值過大:預期 ${t.origin??"值"} 應為 ${o}${t.maximum.toString()}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`數值過小:預期 ${t.origin} 應為 ${o}${t.minimum.toString()} ${a.unit}`:`數值過小:預期 ${t.origin} 應為 ${o}${t.minimum.toString()}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`無效的字串:必須以 "${o.prefix}" 開頭`:o.format==="ends_with"?`無效的字串:必須以 "${o.suffix}" 結尾`:o.format==="includes"?`無效的字串:必須包含 "${o.includes}"`:o.format==="regex"?`無效的字串:必須符合格式 ${o.pattern}`:`無效的 ${i[o.format]??t.format}`}case"not_multiple_of":return`無效的數字:必須為 ${t.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${t.keys.length>1?"們":""}:${le(t.keys,"、")}`;case"invalid_key":return`${t.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${t.origin} 中有無效的值`;default:return"無效的輸入值"}}};function kx(){return{localeError:xx()}}const Sx=()=>{const e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function n(t){return e[t]??null}const r=t=>{const o=typeof t;switch(o){case"number":return Number.isNaN(t)?"NaN":"nọ́mbà";case"object":{if(Array.isArray(t))return"akopọ";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return o},i={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"};return t=>{switch(t.code){case"invalid_type":return`Ìbáwọlé aṣìṣe: a ní láti fi ${t.expected}, àmọ̀ a rí ${r(t.input)}`;case"invalid_value":return t.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${Fe(t.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${le(t.values,"|")}`;case"too_big":{const o=t.inclusive?"<=":"<",a=n(t.origin);return a?`Tó pọ̀ jù: a ní láti jẹ́ pé ${t.origin??"iye"} ${a.verb} ${o}${t.maximum} ${a.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${o}${t.maximum}`}case"too_small":{const o=t.inclusive?">=":">",a=n(t.origin);return a?`Kéré ju: a ní láti jẹ́ pé ${t.origin} ${a.verb} ${o}${t.minimum} ${a.unit}`:`Kéré ju: a ní láti jẹ́ ${o}${t.minimum}`}case"invalid_format":{const o=t;return o.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${o.prefix}"`:o.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${o.suffix}"`:o.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${o.includes}"`:o.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${o.pattern}`:`Aṣìṣe: ${i[o.format]??t.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${t.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${le(t.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${t.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${t.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function Ix(){return{localeError:Sx()}}const vg=Object.freeze(Object.defineProperty({__proto__:null,ar:B_,az:q_,be:G_,ca:V_,cs:X_,da:Q_,de:tw,en:gg,eo:aw,es:lw,fa:uw,fi:fw,fr:gw,frCA:pw,he:bw,hu:$w,id:ww,is:Sw,it:Tw,ja:Dw,ka:Ow,kh:Pw,km:hg,ko:jw,lt:Rw,mk:Fw,ms:Bw,nl:qw,no:Gw,ota:Vw,pl:Qw,ps:Xw,pt:tx,ru:rx,sl:ox,sv:sx,ta:cx,th:dx,tr:gx,ua:px,uk:pg,ur:bx,vi:$x,yo:Ix,zhCN:wx,zhTW:kx},Symbol.toStringTag,{value:"Module"})),bg=Symbol("ZodOutput"),yg=Symbol("ZodInput");class ss{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const i=r[0];if(this._map.set(n,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,n)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const t={...i,...this._map.get(n)};return Object.keys(t).length?t:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function ls(){return new ss}const Yn=ls();function $g(e,n){return new e({type:"string",...J(n)})}function _g(e,n){return new e({type:"string",coerce:!0,...J(n)})}function cs(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...J(n)})}function Yi(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...J(n)})}function us(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...J(n)})}function ds(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...J(n)})}function fs(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...J(n)})}function ms(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...J(n)})}function $o(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...J(n)})}function gs(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...J(n)})}function hs(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...J(n)})}function ps(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...J(n)})}function vs(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...J(n)})}function bs(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...J(n)})}function ys(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...J(n)})}function $s(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...J(n)})}function _s(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...J(n)})}function ws(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...J(n)})}function xs(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...J(n)})}function ks(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...J(n)})}function Ss(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...J(n)})}function Is(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...J(n)})}function Ts(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...J(n)})}function Cs(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...J(n)})}const wg={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function xg(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...J(n)})}function kg(e,n){return new e({type:"string",format:"date",check:"string_format",...J(n)})}function Sg(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...J(n)})}function Ig(e,n){return new e({type:"string",format:"duration",check:"string_format",...J(n)})}function Tg(e,n){return new e({type:"number",checks:[],...J(n)})}function Cg(e,n){return new e({type:"number",coerce:!0,checks:[],...J(n)})}function Dg(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...J(n)})}function zg(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...J(n)})}function Eg(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...J(n)})}function Og(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...J(n)})}function Ag(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...J(n)})}function Pg(e,n){return new e({type:"boolean",...J(n)})}function Ng(e,n){return new e({type:"boolean",coerce:!0,...J(n)})}function jg(e,n){return new e({type:"bigint",...J(n)})}function Ug(e,n){return new e({type:"bigint",coerce:!0,...J(n)})}function Lg(e,n){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...J(n)})}function Rg(e,n){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...J(n)})}function Mg(e,n){return new e({type:"symbol",...J(n)})}function Fg(e,n){return new e({type:"undefined",...J(n)})}function Zg(e,n){return new e({type:"null",...J(n)})}function Bg(e){return new e({type:"any"})}function Wg(e){return new e({type:"unknown"})}function qg(e,n){return new e({type:"never",...J(n)})}function Hg(e,n){return new e({type:"void",...J(n)})}function Gg(e,n){return new e({type:"date",...J(n)})}function Kg(e,n){return new e({type:"date",coerce:!0,...J(n)})}function Vg(e,n){return new e({type:"nan",...J(n)})}function rr(e,n){return new Ya({check:"less_than",...J(n),value:e,inclusive:!1})}function hn(e,n){return new Ya({check:"less_than",...J(n),value:e,inclusive:!0})}function ir(e,n){return new Qa({check:"greater_than",...J(n),value:e,inclusive:!1})}function Jt(e,n){return new Qa({check:"greater_than",...J(n),value:e,inclusive:!0})}function Jg(e){return ir(0,e)}function Xg(e){return rr(0,e)}function Yg(e){return hn(0,e)}function Qg(e){return Jt(0,e)}function ti(e,n){return new Uf({check:"multiple_of",...J(n),value:e})}function _o(e,n){return new Mf({check:"max_size",...J(n),maximum:e})}function ni(e,n){return new Ff({check:"min_size",...J(n),minimum:e})}function Ds(e,n){return new Zf({check:"size_equals",...J(n),size:e})}function wo(e,n){return new Bf({check:"max_length",...J(n),maximum:e})}function wr(e,n){return new Wf({check:"min_length",...J(n),minimum:e})}function xo(e,n){return new qf({check:"length_equals",...J(n),length:e})}function zs(e,n){return new Hf({check:"string_format",format:"regex",...J(n),pattern:e})}function Es(e){return new Gf({check:"string_format",format:"lowercase",...J(e)})}function Os(e){return new Kf({check:"string_format",format:"uppercase",...J(e)})}function As(e,n){return new Vf({check:"string_format",format:"includes",...J(n),includes:e})}function Ps(e,n){return new Jf({check:"string_format",format:"starts_with",...J(n),prefix:e})}function Ns(e,n){return new Xf({check:"string_format",format:"ends_with",...J(n),suffix:e})}function eh(e,n,r){return new Yf({check:"property",property:e,schema:n,...J(r)})}function js(e,n){return new Qf({check:"mime_type",mime:e,...J(n)})}function ur(e){return new em({check:"overwrite",tx:e})}function Us(e){return ur(n=>n.normalize(e))}function Ls(){return ur(e=>e.trim())}function Rs(){return ur(e=>e.toLowerCase())}function Ms(){return ur(e=>e.toUpperCase())}function th(e,n,r){return new e({type:"array",element:n,...J(r)})}function Tx(e,n,r){return new e({type:"union",options:n,...J(r)})}function Cx(e,n,r,i){return new e({type:"union",options:r,discriminator:n,...J(i)})}function Dx(e,n,r){return new e({type:"intersection",left:n,right:r})}function zx(e,n,r,i){const t=r instanceof qe,o=t?i:r,a=t?r:null;return new e({type:"tuple",items:n,rest:a,...J(o)})}function Ex(e,n,r,i){return new e({type:"record",keyType:n,valueType:r,...J(i)})}function Ox(e,n,r,i){return new e({type:"map",keyType:n,valueType:r,...J(i)})}function Ax(e,n,r){return new e({type:"set",valueType:n,...J(r)})}function Px(e,n,r){const i=Array.isArray(n)?Object.fromEntries(n.map(t=>[t,t])):n;return new e({type:"enum",entries:i,...J(r)})}function Nx(e,n,r){return new e({type:"enum",entries:n,...J(r)})}function jx(e,n,r){return new e({type:"literal",values:Array.isArray(n)?n:[n],...J(r)})}function nh(e,n){return new e({type:"file",...J(n)})}function Ux(e,n){return new e({type:"transform",transform:n})}function Lx(e,n){return new e({type:"optional",innerType:n})}function Rx(e,n){return new e({type:"nullable",innerType:n})}function Mx(e,n,r){return new e({type:"default",innerType:n,get defaultValue(){return typeof r=="function"?r():vo(r)}})}function Fx(e,n,r){return new e({type:"nonoptional",innerType:n,...J(r)})}function Zx(e,n){return new e({type:"success",innerType:n})}function Bx(e,n,r){return new e({type:"catch",innerType:n,catchValue:typeof r=="function"?r:()=>r})}function Wx(e,n,r){return new e({type:"pipe",in:n,out:r})}function qx(e,n){return new e({type:"readonly",innerType:n})}function Hx(e,n,r){return new e({type:"template_literal",parts:n,...J(r)})}function Gx(e,n){return new e({type:"lazy",getter:n})}function Kx(e,n){return new e({type:"promise",innerType:n})}function rh(e,n,r){const i=J(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:n,...i})}function ih(e,n,r){return new e({type:"custom",check:"custom",fn:n,...J(r)})}function oh(e){const n=ah(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push($r(i,r.value,n._zod.def));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=n),t.continue??(t.continue=!n._zod.def.abort),r.issues.push($r(t))}},e(r.value,r)));return n}function ah(e,n){const r=new xt({check:"custom",...J(n)});return r._zod.check=e,r}function sh(e,n){const r=J(n);let i=r.truthy??["true","1","yes","on","y","enabled"],t=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(p=>typeof p=="string"?p.toLowerCase():p),t=t.map(p=>typeof p=="string"?p.toLowerCase():p));const o=new Set(i),a=new Set(t),l=e.Codec??as,u=e.Boolean??ns,c=e.String??wi,m=new c({type:"string",error:r.error}),f=new u({type:"boolean",error:r.error}),g=new l({type:"pipe",in:m,out:f,transform:(p,h)=>{let v=p;return r.case!=="sensitive"&&(v=v.toLowerCase()),o.has(v)?!0:a.has(v)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:h.value,inst:g,continue:!1}),{})},reverseTransform:(p,h)=>p===!0?i[0]||"true":t[0]||"false",error:r.error});return g}function xi(e,n,r,i={}){const t=J(i),o={...J(i),check:"string_format",type:"string",format:n,fn:typeof r=="function"?r:l=>r.test(l),...t};return r instanceof RegExp&&(o.pattern=r),new e(o)}class ha{constructor(n){this.counter=0,this.metadataRegistry=n?.metadata??Yn,this.target=n?.target??"draft-2020-12",this.unrepresentable=n?.unrepresentable??"throw",this.override=n?.override??(()=>{}),this.io=n?.io??"output",this.seen=new Map}process(n,r={path:[],schemaPath:[]}){var i;const t=n._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(n);if(a)return a.count++,r.schemaPath.includes(n)&&(a.cycle=r.path),a.schema;const l={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(n,l);const u=n._zod.toJSONSchema?.();if(u)l.schema=u;else{const f={...r,schemaPath:[...r.schemaPath,n],path:r.path},g=n._zod.parent;if(g)l.ref=g,this.process(g,f),this.seen.get(g).isParent=!0;else{const p=l.schema;switch(t.type){case"string":{const h=p;h.type="string";const{minimum:v,maximum:b,format:x,patterns:R,contentEncoding:U}=n._zod.bag;if(typeof v=="number"&&(h.minLength=v),typeof b=="number"&&(h.maxLength=b),x&&(h.format=o[x]??x,h.format===""&&delete h.format),U&&(h.contentEncoding=U),R&&R.size>0){const A=[...R];A.length===1?h.pattern=A[0].source:A.length>1&&(l.schema.allOf=[...A.map(N=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:N.source}))])}break}case"number":{const h=p,{minimum:v,maximum:b,format:x,multipleOf:R,exclusiveMaximum:U,exclusiveMinimum:A}=n._zod.bag;typeof x=="string"&&x.includes("int")?h.type="integer":h.type="number",typeof A=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(h.minimum=A,h.exclusiveMinimum=!0):h.exclusiveMinimum=A),typeof v=="number"&&(h.minimum=v,typeof A=="number"&&this.target!=="draft-4"&&(A>=v?delete h.minimum:delete h.exclusiveMinimum)),typeof U=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(h.maximum=U,h.exclusiveMaximum=!0):h.exclusiveMaximum=U),typeof b=="number"&&(h.maximum=b,typeof U=="number"&&this.target!=="draft-4"&&(U<=b?delete h.maximum:delete h.exclusiveMaximum)),typeof R=="number"&&(h.multipleOf=R);break}case"boolean":{const h=p;h.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(p.type="string",p.nullable=!0,p.enum=[null]):p.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{p.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const h=p,{minimum:v,maximum:b}=n._zod.bag;typeof v=="number"&&(h.minItems=v),typeof b=="number"&&(h.maxItems=b),h.type="array",h.items=this.process(t.element,{...f,path:[...f.path,"items"]});break}case"object":{const h=p;h.type="object",h.properties={};const v=t.shape;for(const R in v)h.properties[R]=this.process(v[R],{...f,path:[...f.path,"properties",R]});const b=new Set(Object.keys(v)),x=new Set([...b].filter(R=>{const U=t.shape[R]._zod;return this.io==="input"?U.optin===void 0:U.optout===void 0}));x.size>0&&(h.required=Array.from(x)),t.catchall?._zod.def.type==="never"?h.additionalProperties=!1:t.catchall?t.catchall&&(h.additionalProperties=this.process(t.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(h.additionalProperties=!1);break}case"union":{const h=p,v=t.options.map((b,x)=>this.process(b,{...f,path:[...f.path,"anyOf",x]}));h.anyOf=v;break}case"intersection":{const h=p,v=this.process(t.left,{...f,path:[...f.path,"allOf",0]}),b=this.process(t.right,{...f,path:[...f.path,"allOf",1]}),x=U=>"allOf"in U&&Object.keys(U).length===1,R=[...x(v)?v.allOf:[v],...x(b)?b.allOf:[b]];h.allOf=R;break}case"tuple":{const h=p;h.type="array";const v=this.target==="draft-2020-12"?"prefixItems":"items",b=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",x=t.items.map((N,k)=>this.process(N,{...f,path:[...f.path,v,k]})),R=t.rest?this.process(t.rest,{...f,path:[...f.path,b,...this.target==="openapi-3.0"?[t.items.length]:[]]}):null;this.target==="draft-2020-12"?(h.prefixItems=x,R&&(h.items=R)):this.target==="openapi-3.0"?(h.items={anyOf:x},R&&h.items.anyOf.push(R),h.minItems=x.length,R||(h.maxItems=x.length)):(h.items=x,R&&(h.additionalItems=R));const{minimum:U,maximum:A}=n._zod.bag;typeof U=="number"&&(h.minItems=U),typeof A=="number"&&(h.maxItems=A);break}case"record":{const h=p;h.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(h.propertyNames=this.process(t.keyType,{...f,path:[...f.path,"propertyNames"]})),h.additionalProperties=this.process(t.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const h=p,v=ja(t.entries);v.every(b=>typeof b=="number")&&(h.type="number"),v.every(b=>typeof b=="string")&&(h.type="string"),h.enum=v;break}case"literal":{const h=p,v=[];for(const b of t.values)if(b===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof b=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");v.push(Number(b))}else v.push(b);if(v.length!==0)if(v.length===1){const b=v[0];h.type=b===null?"null":typeof b,this.target==="draft-4"||this.target==="openapi-3.0"?h.enum=[b]:h.const=b}else v.every(b=>typeof b=="number")&&(h.type="number"),v.every(b=>typeof b=="string")&&(h.type="string"),v.every(b=>typeof b=="boolean")&&(h.type="string"),v.every(b=>b===null)&&(h.type="null"),h.enum=v;break}case"file":{const h=p,v={type:"string",format:"binary",contentEncoding:"binary"},{minimum:b,maximum:x,mime:R}=n._zod.bag;b!==void 0&&(v.minLength=b),x!==void 0&&(v.maxLength=x),R?R.length===1?(v.contentMediaType=R[0],Object.assign(h,v)):h.anyOf=R.map(U=>({...v,contentMediaType:U})):Object.assign(h,v);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const h=this.process(t.innerType,f);this.target==="openapi-3.0"?(l.ref=t.innerType,p.nullable=!0):p.anyOf=[h,{type:"null"}];break}case"nonoptional":{this.process(t.innerType,f),l.ref=t.innerType;break}case"success":{const h=p;h.type="boolean";break}case"default":{this.process(t.innerType,f),l.ref=t.innerType,p.default=JSON.parse(JSON.stringify(t.defaultValue));break}case"prefault":{this.process(t.innerType,f),l.ref=t.innerType,this.io==="input"&&(p._prefault=JSON.parse(JSON.stringify(t.defaultValue)));break}case"catch":{this.process(t.innerType,f),l.ref=t.innerType;let h;try{h=t.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}p.default=h;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const h=p,v=n._zod.pattern;if(!v)throw new Error("Pattern not found in template literal");h.type="string",h.pattern=v.source;break}case"pipe":{const h=this.io==="input"?t.in._zod.def.type==="transform"?t.out:t.in:t.out;this.process(h,f),l.ref=h;break}case"readonly":{this.process(t.innerType,f),l.ref=t.innerType,p.readOnly=!0;break}case"promise":{this.process(t.innerType,f),l.ref=t.innerType;break}case"optional":{this.process(t.innerType,f),l.ref=t.innerType;break}case"lazy":{const h=n._zod.innerType;this.process(h,f),l.ref=h;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}}}}const c=this.metadataRegistry.get(n);return c&&Object.assign(l.schema,c),this.io==="input"&&St(n)&&(delete l.schema.examples,delete l.schema.default),this.io==="input"&&l.schema._prefault&&((i=l.schema).default??(i.default=l.schema._prefault)),delete l.schema._prefault,this.seen.get(n).schema}emit(n,r){const i={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},t=this.seen.get(n);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=m=>{const f=this.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const v=i.external.registry.get(m[0])?.id,b=i.external.uri??(R=>R);if(v)return{ref:b(v)};const x=m[1].defId??m[1].schema.id??`schema${this.counter++}`;return m[1].defId=x,{defId:x,ref:`${b("__shared")}#/${f}/${x}`}}if(m[1]===t)return{ref:"#"};const p=`#/${f}/`,h=m[1].schema.id??`__schema${this.counter++}`;return{defId:h,ref:p+h}},a=m=>{if(m[1].schema.$ref)return;const f=m[1],{ref:g,defId:p}=o(m);f.def={...f.schema},p&&(f.defId=p);const h=f.schema;for(const v in h)delete h[v];h.$ref=g};if(i.cycles==="throw")for(const m of this.seen.entries()){const f=m[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
33
|
+
|
|
34
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const m of this.seen.entries()){const f=m[1];if(n===m[0]){a(m);continue}if(i.external){const p=i.external.registry.get(m[0])?.id;if(n!==m[0]&&p){a(m);continue}}if(this.metadataRegistry.get(m[0])?.id){a(m);continue}if(f.cycle){a(m);continue}if(f.count>1&&i.reused==="ref"){a(m);continue}}const l=(m,f)=>{const g=this.seen.get(m),p=g.def??g.schema,h={...p};if(g.ref===null)return;const v=g.ref;if(g.ref=null,v){l(v,f);const b=this.seen.get(v).schema;b.$ref&&(f.target==="draft-7"||f.target==="draft-4"||f.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(b)):(Object.assign(p,b),Object.assign(p,h))}g.isParent||this.override({zodSchema:m,jsonSchema:p,path:g.path??[]})};for(const m of[...this.seen.entries()].reverse())l(m[0],{target:this.target});const u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?u.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),i.external?.uri){const m=i.external.registry.get(n)?.id;if(!m)throw new Error("Schema is missing an `id` property");u.$id=i.external.uri(m)}Object.assign(u,t.def);const c=i.external?.defs??{};for(const m of this.seen.entries()){const f=m[1];f.def&&f.defId&&(c[f.defId]=f.def)}i.external||Object.keys(c).length>0&&(this.target==="draft-2020-12"?u.$defs=c:u.definitions=c);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}}function lh(e,n){if(e instanceof ss){const i=new ha(n),t={};for(const l of e._idmap.entries()){const[u,c]=l;i.process(c)}const o={},a={registry:e,uri:n?.uri,defs:t};for(const l of e._idmap.entries()){const[u,c]=l;o[u]=i.emit(c,{...n,external:a})}if(Object.keys(t).length>0){const l=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[l]:t}}return{schemas:o}}const r=new ha(n);return r.process(e),r.emit(e,n)}function St(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const t=e._zod.def;switch(t.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return St(t.element,r);case"object":{for(const o in t.shape)if(St(t.shape[o],r))return!0;return!1}case"union":{for(const o of t.options)if(St(o,r))return!0;return!1}case"intersection":return St(t.left,r)||St(t.right,r);case"tuple":{for(const o of t.items)if(St(o,r))return!0;return!!(t.rest&&St(t.rest,r))}case"record":return St(t.keyType,r)||St(t.valueType,r);case"map":return St(t.keyType,r)||St(t.valueType,r);case"set":return St(t.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return St(t.innerType,r);case"lazy":return St(t.getter(),r);case"default":return St(t.innerType,r);case"prefault":return St(t.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return St(t.in,r)||St(t.out,r);case"success":return!1;case"catch":return!1;case"function":return!1}throw new Error(`Unknown schema type: ${t.type}`)}const Vx=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Jx=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:Pm,$ZodArray:Rm,$ZodAsyncError:er,$ZodBase64:wm,$ZodBase64URL:km,$ZodBigInt:rs,$ZodBigIntFormat:zm,$ZodBoolean:ns,$ZodCIDRv4:$m,$ZodCIDRv6:_m,$ZodCUID:cm,$ZodCUID2:um,$ZodCatch:og,$ZodCheck:xt,$ZodCheckBigIntFormat:Rf,$ZodCheckEndsWith:Xf,$ZodCheckGreaterThan:Qa,$ZodCheckIncludes:Vf,$ZodCheckLengthEquals:qf,$ZodCheckLessThan:Ya,$ZodCheckLowerCase:Gf,$ZodCheckMaxLength:Bf,$ZodCheckMaxSize:Mf,$ZodCheckMimeType:Qf,$ZodCheckMinLength:Wf,$ZodCheckMinSize:Ff,$ZodCheckMultipleOf:Uf,$ZodCheckNumberFormat:Lf,$ZodCheckOverwrite:em,$ZodCheckProperty:Yf,$ZodCheckRegex:Hf,$ZodCheckSizeEquals:Zf,$ZodCheckStartsWith:Jf,$ZodCheckStringFormat:_i,$ZodCheckUpperCase:Kf,$ZodCodec:as,$ZodCustom:mg,$ZodCustomStringFormat:Cm,$ZodDate:Lm,$ZodDefault:tg,$ZodDiscriminatedUnion:Wm,$ZodE164:Sm,$ZodEmail:om,$ZodEmoji:sm,$ZodEncodeError:go,$ZodEnum:Vm,$ZodError:La,$ZodFile:Xm,$ZodFunction:ug,$ZodGUID:rm,$ZodIPv4:bm,$ZodIPv6:ym,$ZodISODate:hm,$ZodISODateTime:gm,$ZodISODuration:vm,$ZodISOTime:pm,$ZodIntersection:qm,$ZodJWT:Tm,$ZodKSUID:mm,$ZodLazy:fg,$ZodLiteral:Jm,$ZodMap:Gm,$ZodNaN:ag,$ZodNanoID:lm,$ZodNever:jm,$ZodNonOptional:rg,$ZodNull:Am,$ZodNullable:eg,$ZodNumber:ts,$ZodNumberFormat:Dm,$ZodObject:Zm,$ZodObjectJIT:Bm,$ZodOptional:Qm,$ZodPipe:sg,$ZodPrefault:ng,$ZodPromise:dg,$ZodReadonly:lg,$ZodRealError:Yt,$ZodRecord:Hm,$ZodRegistry:ss,$ZodSet:Km,$ZodString:wi,$ZodStringFormat:ft,$ZodSuccess:ig,$ZodSymbol:Em,$ZodTemplateLiteral:cg,$ZodTransform:Ym,$ZodTuple:os,$ZodType:qe,$ZodULID:dm,$ZodURL:am,$ZodUUID:im,$ZodUndefined:Om,$ZodUnion:is,$ZodUnknown:Nm,$ZodVoid:Um,$ZodXID:fm,$brand:Ad,$constructor:L,$input:yg,$output:bg,Doc:tm,JSONSchema:Vx,JSONSchemaGenerator:ha,NEVER:Od,TimePrecision:wg,_any:Bg,_array:th,_base64:Ss,_base64url:Is,_bigint:jg,_boolean:Pg,_catch:Bx,_check:ah,_cidrv4:xs,_cidrv6:ks,_coercedBigint:Ug,_coercedBoolean:Ng,_coercedDate:Kg,_coercedNumber:Cg,_coercedString:_g,_cuid:ps,_cuid2:vs,_custom:rh,_date:Gg,_decode:Za,_decodeAsync:Wa,_default:Mx,_discriminatedUnion:Cx,_e164:Ts,_email:cs,_emoji:gs,_encode:Fa,_encodeAsync:Ba,_endsWith:Ns,_enum:Px,_file:nh,_float32:zg,_float64:Eg,_gt:ir,_gte:Jt,_guid:Yi,_includes:As,_int:Dg,_int32:Og,_int64:Lg,_intersection:Dx,_ipv4:_s,_ipv6:ws,_isoDate:kg,_isoDateTime:xg,_isoDuration:Ig,_isoTime:Sg,_jwt:Cs,_ksuid:$s,_lazy:Gx,_length:xo,_literal:jx,_lowercase:Es,_lt:rr,_lte:hn,_map:Ox,_max:hn,_maxLength:wo,_maxSize:_o,_mime:js,_min:Jt,_minLength:wr,_minSize:ni,_multipleOf:ti,_nan:Vg,_nanoid:hs,_nativeEnum:Nx,_negative:Xg,_never:qg,_nonnegative:Qg,_nonoptional:Fx,_nonpositive:Yg,_normalize:Us,_null:Zg,_nullable:Rx,_number:Tg,_optional:Lx,_overwrite:ur,_parse:hi,_parseAsync:pi,_pipe:Wx,_positive:Jg,_promise:Kx,_property:eh,_readonly:qx,_record:Ex,_refine:ih,_regex:zs,_safeDecode:Ha,_safeDecodeAsync:Ka,_safeEncode:qa,_safeEncodeAsync:Ga,_safeParse:vi,_safeParseAsync:bi,_set:Ax,_size:Ds,_startsWith:Ps,_string:$g,_stringFormat:xi,_stringbool:sh,_success:Zx,_superRefine:oh,_symbol:Mg,_templateLiteral:Hx,_toLowerCase:Rs,_toUpperCase:Ms,_transform:Ux,_trim:Ls,_tuple:zx,_uint32:Ag,_uint64:Rg,_ulid:bs,_undefined:Fg,_union:Tx,_unknown:Wg,_uppercase:Os,_url:$o,_uuid:us,_uuidv4:ds,_uuidv6:fs,_uuidv7:ms,_void:Hg,_xid:ys,clone:un,config:qt,decode:d_,decodeAsync:m_,encode:u_,encodeAsync:f_,flattenError:Ra,formatError:Ma,globalConfig:Ki,globalRegistry:Yn,isValidBase64:es,isValidBase64URL:xm,isValidJWT:Im,locales:vg,parse:fa,parseAsync:ma,prettifyError:Qd,regexes:Xa,registry:ls,safeDecode:h_,safeDecodeAsync:v_,safeEncode:g_,safeEncodeAsync:p_,safeParse:ef,safeParseAsync:tf,toDotPath:Yd,toJSONSchema:lh,treeifyError:Xd,util:Vd,version:nm},Symbol.toStringTag,{value:"Module"})),Fs=L("ZodISODateTime",(e,n)=>{gm.init(e,n),ht.init(e,n)});function ch(e){return xg(Fs,e)}const Zs=L("ZodISODate",(e,n)=>{hm.init(e,n),ht.init(e,n)});function uh(e){return kg(Zs,e)}const Bs=L("ZodISOTime",(e,n)=>{pm.init(e,n),ht.init(e,n)});function dh(e){return Sg(Bs,e)}const Ws=L("ZodISODuration",(e,n)=>{vm.init(e,n),ht.init(e,n)});function fh(e){return Ig(Ws,e)}const Xx=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:Zs,ZodISODateTime:Fs,ZodISODuration:Ws,ZodISOTime:Bs,date:uh,datetime:ch,duration:fh,time:dh},Symbol.toStringTag,{value:"Module"})),mh=(e,n)=>{La.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Ma(e,r)},flatten:{value:r=>Ra(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Vi,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Vi,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yx=L("ZodError",mh),Qt=L("ZodError",mh,{Parent:Error}),gh=hi(Qt),hh=pi(Qt),ph=vi(Qt),vh=bi(Qt),bh=Fa(Qt),yh=Za(Qt),$h=Ba(Qt),_h=Wa(Qt),wh=qa(Qt),xh=Ha(Qt),kh=Ga(Qt),Sh=Ka(Qt),Je=L("ZodType",(e,n)=>(qe.init(e,n),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.check=(...r)=>e.clone({...n,checks:[...n.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(r,i)=>un(e,r,i),e.brand=()=>e,e.register=(r,i)=>(r.add(e,i),e),e.parse=(r,i)=>gh(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>ph(e,r,i),e.parseAsync=async(r,i)=>hh(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>vh(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>bh(e,r,i),e.decode=(r,i)=>yh(e,r,i),e.encodeAsync=async(r,i)=>$h(e,r,i),e.decodeAsync=async(r,i)=>_h(e,r,i),e.safeEncode=(r,i)=>wh(e,r,i),e.safeDecode=(r,i)=>xh(e,r,i),e.safeEncodeAsync=async(r,i)=>kh(e,r,i),e.safeDecodeAsync=async(r,i)=>Sh(e,r,i),e.refine=(r,i)=>e.check(dp(r,i)),e.superRefine=r=>e.check(fp(r)),e.overwrite=r=>e.check(ur(r)),e.optional=()=>eo(e),e.nullable=()=>to(e),e.nullish=()=>eo(to(e)),e.nonoptional=r=>Qh(e,r),e.array=()=>Do(e),e.or=r=>fl([e,r]),e.and=r=>Rh(e,r),e.transform=r=>no(e,hl(r)),e.default=r=>Jh(e,r),e.prefault=r=>Yh(e,r),e.catch=r=>np(e,r),e.pipe=r=>no(e,r),e.readonly=()=>op(e),e.describe=r=>{const i=e.clone();return Yn.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return Yn.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Yn.get(e);const i=e.clone();return Yn.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),qs=L("_ZodString",(e,n)=>{wi.init(e,n),Je.init(e,n);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(zs(...i)),e.includes=(...i)=>e.check(As(...i)),e.startsWith=(...i)=>e.check(Ps(...i)),e.endsWith=(...i)=>e.check(Ns(...i)),e.min=(...i)=>e.check(wr(...i)),e.max=(...i)=>e.check(wo(...i)),e.length=(...i)=>e.check(xo(...i)),e.nonempty=(...i)=>e.check(wr(1,...i)),e.lowercase=i=>e.check(Es(i)),e.uppercase=i=>e.check(Os(i)),e.trim=()=>e.check(Ls()),e.normalize=(...i)=>e.check(Us(...i)),e.toLowerCase=()=>e.check(Rs()),e.toUpperCase=()=>e.check(Ms())}),ko=L("ZodString",(e,n)=>{wi.init(e,n),qs.init(e,n),e.email=r=>e.check(cs(Hs,r)),e.url=r=>e.check($o(So,r)),e.jwt=r=>e.check(Cs(sl,r)),e.emoji=r=>e.check(gs(Gs,r)),e.guid=r=>e.check(Yi(Qi,r)),e.uuid=r=>e.check(us(Cn,r)),e.uuidv4=r=>e.check(ds(Cn,r)),e.uuidv6=r=>e.check(fs(Cn,r)),e.uuidv7=r=>e.check(ms(Cn,r)),e.nanoid=r=>e.check(hs(Ks,r)),e.guid=r=>e.check(Yi(Qi,r)),e.cuid=r=>e.check(ps(Vs,r)),e.cuid2=r=>e.check(vs(Js,r)),e.ulid=r=>e.check(bs(Xs,r)),e.base64=r=>e.check(Ss(il,r)),e.base64url=r=>e.check(Is(ol,r)),e.xid=r=>e.check(ys(Ys,r)),e.ksuid=r=>e.check($s(Qs,r)),e.ipv4=r=>e.check(_s(el,r)),e.ipv6=r=>e.check(ws(tl,r)),e.cidrv4=r=>e.check(xs(nl,r)),e.cidrv6=r=>e.check(ks(rl,r)),e.e164=r=>e.check(Ts(al,r)),e.datetime=r=>e.check(ch(r)),e.date=r=>e.check(uh(r)),e.time=r=>e.check(dh(r)),e.duration=r=>e.check(fh(r))});function pa(e){return $g(ko,e)}const ht=L("ZodStringFormat",(e,n)=>{ft.init(e,n),qs.init(e,n)}),Hs=L("ZodEmail",(e,n)=>{om.init(e,n),ht.init(e,n)});function Qx(e){return cs(Hs,e)}const Qi=L("ZodGUID",(e,n)=>{rm.init(e,n),ht.init(e,n)});function ek(e){return Yi(Qi,e)}const Cn=L("ZodUUID",(e,n)=>{im.init(e,n),ht.init(e,n)});function tk(e){return us(Cn,e)}function nk(e){return ds(Cn,e)}function rk(e){return fs(Cn,e)}function ik(e){return ms(Cn,e)}const So=L("ZodURL",(e,n)=>{am.init(e,n),ht.init(e,n)});function ok(e){return $o(So,e)}function ak(e){return $o(So,{protocol:/^https?$/,hostname:yf,...J(e)})}const Gs=L("ZodEmoji",(e,n)=>{sm.init(e,n),ht.init(e,n)});function sk(e){return gs(Gs,e)}const Ks=L("ZodNanoID",(e,n)=>{lm.init(e,n),ht.init(e,n)});function lk(e){return hs(Ks,e)}const Vs=L("ZodCUID",(e,n)=>{cm.init(e,n),ht.init(e,n)});function ck(e){return ps(Vs,e)}const Js=L("ZodCUID2",(e,n)=>{um.init(e,n),ht.init(e,n)});function uk(e){return vs(Js,e)}const Xs=L("ZodULID",(e,n)=>{dm.init(e,n),ht.init(e,n)});function dk(e){return bs(Xs,e)}const Ys=L("ZodXID",(e,n)=>{fm.init(e,n),ht.init(e,n)});function fk(e){return ys(Ys,e)}const Qs=L("ZodKSUID",(e,n)=>{mm.init(e,n),ht.init(e,n)});function mk(e){return $s(Qs,e)}const el=L("ZodIPv4",(e,n)=>{bm.init(e,n),ht.init(e,n)});function gk(e){return _s(el,e)}const tl=L("ZodIPv6",(e,n)=>{ym.init(e,n),ht.init(e,n)});function hk(e){return ws(tl,e)}const nl=L("ZodCIDRv4",(e,n)=>{$m.init(e,n),ht.init(e,n)});function pk(e){return xs(nl,e)}const rl=L("ZodCIDRv6",(e,n)=>{_m.init(e,n),ht.init(e,n)});function vk(e){return ks(rl,e)}const il=L("ZodBase64",(e,n)=>{wm.init(e,n),ht.init(e,n)});function bk(e){return Ss(il,e)}const ol=L("ZodBase64URL",(e,n)=>{km.init(e,n),ht.init(e,n)});function yk(e){return Is(ol,e)}const al=L("ZodE164",(e,n)=>{Sm.init(e,n),ht.init(e,n)});function $k(e){return Ts(al,e)}const sl=L("ZodJWT",(e,n)=>{Tm.init(e,n),ht.init(e,n)});function _k(e){return Cs(sl,e)}const ki=L("ZodCustomStringFormat",(e,n)=>{Cm.init(e,n),ht.init(e,n)});function wk(e,n,r={}){return xi(ki,e,n,r)}function xk(e){return xi(ki,"hostname",Ja,e)}function kk(e){return xi(ki,"hex",Nf,e)}function Sk(e,n){const r=n?.enc??"hex",i=`${e}_${r}`,t=Xa[i];if(!t)throw new Error(`Unrecognized hash format: ${i}`);return xi(ki,i,t,n)}const Io=L("ZodNumber",(e,n)=>{ts.init(e,n),Je.init(e,n),e.gt=(i,t)=>e.check(ir(i,t)),e.gte=(i,t)=>e.check(Jt(i,t)),e.min=(i,t)=>e.check(Jt(i,t)),e.lt=(i,t)=>e.check(rr(i,t)),e.lte=(i,t)=>e.check(hn(i,t)),e.max=(i,t)=>e.check(hn(i,t)),e.int=i=>e.check(va(i)),e.safe=i=>e.check(va(i)),e.positive=i=>e.check(ir(0,i)),e.nonnegative=i=>e.check(Jt(0,i)),e.negative=i=>e.check(rr(0,i)),e.nonpositive=i=>e.check(hn(0,i)),e.multipleOf=(i,t)=>e.check(ti(i,t)),e.step=(i,t)=>e.check(ti(i,t)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Ih(e){return Tg(Io,e)}const Or=L("ZodNumberFormat",(e,n)=>{Dm.init(e,n),Io.init(e,n)});function va(e){return Dg(Or,e)}function Ik(e){return zg(Or,e)}function Tk(e){return Eg(Or,e)}function Ck(e){return Og(Or,e)}function Dk(e){return Ag(Or,e)}const To=L("ZodBoolean",(e,n)=>{ns.init(e,n),Je.init(e,n)});function Th(e){return Pg(To,e)}const Co=L("ZodBigInt",(e,n)=>{rs.init(e,n),Je.init(e,n),e.gte=(i,t)=>e.check(Jt(i,t)),e.min=(i,t)=>e.check(Jt(i,t)),e.gt=(i,t)=>e.check(ir(i,t)),e.gte=(i,t)=>e.check(Jt(i,t)),e.min=(i,t)=>e.check(Jt(i,t)),e.lt=(i,t)=>e.check(rr(i,t)),e.lte=(i,t)=>e.check(hn(i,t)),e.max=(i,t)=>e.check(hn(i,t)),e.positive=i=>e.check(ir(BigInt(0),i)),e.negative=i=>e.check(rr(BigInt(0),i)),e.nonpositive=i=>e.check(hn(BigInt(0),i)),e.nonnegative=i=>e.check(Jt(BigInt(0),i)),e.multipleOf=(i,t)=>e.check(ti(i,t));const r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function zk(e){return jg(Co,e)}const ll=L("ZodBigIntFormat",(e,n)=>{zm.init(e,n),Co.init(e,n)});function Ek(e){return Lg(ll,e)}function Ok(e){return Rg(ll,e)}const Ch=L("ZodSymbol",(e,n)=>{Em.init(e,n),Je.init(e,n)});function Ak(e){return Mg(Ch,e)}const Dh=L("ZodUndefined",(e,n)=>{Om.init(e,n),Je.init(e,n)});function Pk(e){return Fg(Dh,e)}const zh=L("ZodNull",(e,n)=>{Am.init(e,n),Je.init(e,n)});function Eh(e){return Zg(zh,e)}const Oh=L("ZodAny",(e,n)=>{Pm.init(e,n),Je.init(e,n)});function Nk(){return Bg(Oh)}const Ah=L("ZodUnknown",(e,n)=>{Nm.init(e,n),Je.init(e,n)});function xr(){return Wg(Ah)}const Ph=L("ZodNever",(e,n)=>{jm.init(e,n),Je.init(e,n)});function cl(e){return qg(Ph,e)}const Nh=L("ZodVoid",(e,n)=>{Um.init(e,n),Je.init(e,n)});function jk(e){return Hg(Nh,e)}const ul=L("ZodDate",(e,n)=>{Lm.init(e,n),Je.init(e,n),e.min=(i,t)=>e.check(Jt(i,t)),e.max=(i,t)=>e.check(hn(i,t));const r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function Uk(e){return Gg(ul,e)}const jh=L("ZodArray",(e,n)=>{Rm.init(e,n),Je.init(e,n),e.element=n.element,e.min=(r,i)=>e.check(wr(r,i)),e.nonempty=r=>e.check(wr(1,r)),e.max=(r,i)=>e.check(wo(r,i)),e.length=(r,i)=>e.check(xo(r,i)),e.unwrap=()=>e.element});function Do(e,n){return th(jh,e,n)}function Lk(e){const n=e._zod.def.shape;return gl(Object.keys(n))}const zo=L("ZodObject",(e,n)=>{Bm.init(e,n),Je.init(e,n),Qe(e,"shape",()=>n.shape),e.keyof=()=>gl(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:xr()}),e.loose=()=>e.clone({...e._zod.def,catchall:xr()}),e.strict=()=>e.clone({...e._zod.def,catchall:cl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Zd(e,r),e.safeExtend=r=>Bd(e,r),e.merge=r=>Wd(e,r),e.pick=r=>Md(e,r),e.omit=r=>Fd(e,r),e.partial=(...r)=>qd(pl,e,r[0]),e.required=(...r)=>Hd(vl,e,r[0])});function Rk(e,n){const r={type:"object",get shape(){return vn(this,"shape",e?po(e):{}),this.shape},...J(n)};return new zo(r)}function Mk(e,n){return new zo({type:"object",get shape(){return vn(this,"shape",po(e)),this.shape},catchall:cl(),...J(n)})}function Fk(e,n){return new zo({type:"object",get shape(){return vn(this,"shape",po(e)),this.shape},catchall:xr(),...J(n)})}const dl=L("ZodUnion",(e,n)=>{is.init(e,n),Je.init(e,n),e.options=n.options});function fl(e,n){return new dl({type:"union",options:e,...J(n)})}const Uh=L("ZodDiscriminatedUnion",(e,n)=>{dl.init(e,n),Wm.init(e,n)});function Zk(e,n,r){return new Uh({type:"union",options:n,discriminator:e,...J(r)})}const Lh=L("ZodIntersection",(e,n)=>{qm.init(e,n),Je.init(e,n)});function Rh(e,n){return new Lh({type:"intersection",left:e,right:n})}const Mh=L("ZodTuple",(e,n)=>{os.init(e,n),Je.init(e,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function Fh(e,n,r){const i=n instanceof qe,t=i?r:n,o=i?n:null;return new Mh({type:"tuple",items:e,rest:o,...J(t)})}const ml=L("ZodRecord",(e,n)=>{Hm.init(e,n),Je.init(e,n),e.keyType=n.keyType,e.valueType=n.valueType});function Zh(e,n,r){return new ml({type:"record",keyType:e,valueType:n,...J(r)})}function Bk(e,n,r){const i=un(e);return i._zod.values=void 0,new ml({type:"record",keyType:i,valueType:n,...J(r)})}const Bh=L("ZodMap",(e,n)=>{Gm.init(e,n),Je.init(e,n),e.keyType=n.keyType,e.valueType=n.valueType});function Wk(e,n,r){return new Bh({type:"map",keyType:e,valueType:n,...J(r)})}const Wh=L("ZodSet",(e,n)=>{Km.init(e,n),Je.init(e,n),e.min=(...r)=>e.check(ni(...r)),e.nonempty=r=>e.check(ni(1,r)),e.max=(...r)=>e.check(_o(...r)),e.size=(...r)=>e.check(Ds(...r))});function qk(e,n){return new Wh({type:"set",valueType:e,...J(n)})}const ri=L("ZodEnum",(e,n)=>{Vm.init(e,n),Je.init(e,n),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(i,t)=>{const o={};for(const a of i)if(r.has(a))o[a]=n.entries[a];else throw new Error(`Key ${a} not found in enum`);return new ri({...n,checks:[],...J(t),entries:o})},e.exclude=(i,t)=>{const o={...n.entries};for(const a of i)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new ri({...n,checks:[],...J(t),entries:o})}});function gl(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new ri({type:"enum",entries:r,...J(n)})}function Hk(e,n){return new ri({type:"enum",entries:e,...J(n)})}const qh=L("ZodLiteral",(e,n)=>{Jm.init(e,n),Je.init(e,n),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function Gk(e,n){return new qh({type:"literal",values:Array.isArray(e)?e:[e],...J(n)})}const Hh=L("ZodFile",(e,n)=>{Xm.init(e,n),Je.init(e,n),e.min=(r,i)=>e.check(ni(r,i)),e.max=(r,i)=>e.check(_o(r,i)),e.mime=(r,i)=>e.check(js(Array.isArray(r)?r:[r],i))});function Kk(e){return nh(Hh,e)}const Gh=L("ZodTransform",(e,n)=>{Ym.init(e,n),Je.init(e,n),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new go(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push($r(o,r.value,n));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push($r(a))}};const t=n.transform(r.value,r);return t instanceof Promise?t.then(o=>(r.value=o,r)):(r.value=t,r)}});function hl(e){return new Gh({type:"transform",transform:e})}const pl=L("ZodOptional",(e,n)=>{Qm.init(e,n),Je.init(e,n),e.unwrap=()=>e._zod.def.innerType});function eo(e){return new pl({type:"optional",innerType:e})}const Kh=L("ZodNullable",(e,n)=>{eg.init(e,n),Je.init(e,n),e.unwrap=()=>e._zod.def.innerType});function to(e){return new Kh({type:"nullable",innerType:e})}function Vk(e){return eo(to(e))}const Vh=L("ZodDefault",(e,n)=>{tg.init(e,n),Je.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Jh(e,n){return new Vh({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():vo(n)}})}const Xh=L("ZodPrefault",(e,n)=>{ng.init(e,n),Je.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Yh(e,n){return new Xh({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():vo(n)}})}const vl=L("ZodNonOptional",(e,n)=>{rg.init(e,n),Je.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Qh(e,n){return new vl({type:"nonoptional",innerType:e,...J(n)})}const ep=L("ZodSuccess",(e,n)=>{ig.init(e,n),Je.init(e,n),e.unwrap=()=>e._zod.def.innerType});function Jk(e){return new ep({type:"success",innerType:e})}const tp=L("ZodCatch",(e,n)=>{og.init(e,n),Je.init(e,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function np(e,n){return new tp({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const rp=L("ZodNaN",(e,n)=>{ag.init(e,n),Je.init(e,n)});function Xk(e){return Vg(rp,e)}const bl=L("ZodPipe",(e,n)=>{sg.init(e,n),Je.init(e,n),e.in=n.in,e.out=n.out});function no(e,n){return new bl({type:"pipe",in:e,out:n})}const yl=L("ZodCodec",(e,n)=>{bl.init(e,n),as.init(e,n)});function Yk(e,n,r){return new yl({type:"pipe",in:e,out:n,transform:r.decode,reverseTransform:r.encode})}const ip=L("ZodReadonly",(e,n)=>{lg.init(e,n),Je.init(e,n),e.unwrap=()=>e._zod.def.innerType});function op(e){return new ip({type:"readonly",innerType:e})}const ap=L("ZodTemplateLiteral",(e,n)=>{cg.init(e,n),Je.init(e,n)});function Qk(e,n){return new ap({type:"template_literal",parts:e,...J(n)})}const sp=L("ZodLazy",(e,n)=>{fg.init(e,n),Je.init(e,n),e.unwrap=()=>e._zod.def.getter()});function lp(e){return new sp({type:"lazy",getter:e})}const cp=L("ZodPromise",(e,n)=>{dg.init(e,n),Je.init(e,n),e.unwrap=()=>e._zod.def.innerType});function e1(e){return new cp({type:"promise",innerType:e})}const up=L("ZodFunction",(e,n)=>{ug.init(e,n),Je.init(e,n)});function Nc(e){return new up({type:"function",input:Array.isArray(e?.input)?Fh(e?.input):e?.input??Do(xr()),output:e?.output??xr()})}const Eo=L("ZodCustom",(e,n)=>{mg.init(e,n),Je.init(e,n)});function t1(e){const n=new xt({check:"custom"});return n._zod.check=e,n}function n1(e,n){return rh(Eo,e??(()=>!0),n)}function dp(e,n={}){return ih(Eo,e,n)}function fp(e){return oh(e)}function r1(e,n={error:`Input not instance of ${e.name}`}){const r=new Eo({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...J(n)});return r._zod.bag.Class=e,r}const i1=(...e)=>sh({Codec:yl,Boolean:To,String:ko},...e);function o1(e){const n=lp(()=>fl([pa(e),Ih(),Th(),Eh(),Do(n),Zh(pa(),n)]));return n}function a1(e,n){return no(hl(e),n)}const s1={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function l1(e){qt({customError:e})}function c1(){return qt().customError}var ba;ba||(ba={});function u1(e){return _g(ko,e)}function d1(e){return Cg(Io,e)}function f1(e){return Ng(To,e)}function m1(e){return Ug(Co,e)}function g1(e){return Kg(ul,e)}const h1=Object.freeze(Object.defineProperty({__proto__:null,bigint:m1,boolean:f1,date:g1,number:d1,string:u1},Symbol.toStringTag,{value:"Module"}));qt(gg());const p1=Object.freeze(Object.defineProperty({__proto__:null,$brand:Ad,$input:yg,$output:bg,NEVER:Od,TimePrecision:wg,ZodAny:Oh,ZodArray:jh,ZodBase64:il,ZodBase64URL:ol,ZodBigInt:Co,ZodBigIntFormat:ll,ZodBoolean:To,ZodCIDRv4:nl,ZodCIDRv6:rl,ZodCUID:Vs,ZodCUID2:Js,ZodCatch:tp,ZodCodec:yl,ZodCustom:Eo,ZodCustomStringFormat:ki,ZodDate:ul,ZodDefault:Vh,ZodDiscriminatedUnion:Uh,ZodE164:al,ZodEmail:Hs,ZodEmoji:Gs,ZodEnum:ri,ZodError:Yx,ZodFile:Hh,get ZodFirstPartyTypeKind(){return ba},ZodFunction:up,ZodGUID:Qi,ZodIPv4:el,ZodIPv6:tl,ZodISODate:Zs,ZodISODateTime:Fs,ZodISODuration:Ws,ZodISOTime:Bs,ZodIntersection:Lh,ZodIssueCode:s1,ZodJWT:sl,ZodKSUID:Qs,ZodLazy:sp,ZodLiteral:qh,ZodMap:Bh,ZodNaN:rp,ZodNanoID:Ks,ZodNever:Ph,ZodNonOptional:vl,ZodNull:zh,ZodNullable:Kh,ZodNumber:Io,ZodNumberFormat:Or,ZodObject:zo,ZodOptional:pl,ZodPipe:bl,ZodPrefault:Xh,ZodPromise:cp,ZodReadonly:ip,ZodRealError:Qt,ZodRecord:ml,ZodSet:Wh,ZodString:ko,ZodStringFormat:ht,ZodSuccess:ep,ZodSymbol:Ch,ZodTemplateLiteral:ap,ZodTransform:Gh,ZodTuple:Mh,ZodType:Je,ZodULID:Xs,ZodURL:So,ZodUUID:Cn,ZodUndefined:Dh,ZodUnion:dl,ZodUnknown:Ah,ZodVoid:Nh,ZodXID:Ys,_ZodString:qs,_default:Jh,_function:Nc,any:Nk,array:Do,base64:bk,base64url:yk,bigint:zk,boolean:Th,catch:np,check:t1,cidrv4:pk,cidrv6:vk,clone:un,codec:Yk,coerce:h1,config:qt,core:Jx,cuid:ck,cuid2:uk,custom:n1,date:Uk,decode:yh,decodeAsync:_h,discriminatedUnion:Zk,e164:$k,email:Qx,emoji:sk,encode:bh,encodeAsync:$h,endsWith:Ns,enum:gl,file:Kk,flattenError:Ra,float32:Ik,float64:Tk,formatError:Ma,function:Nc,getErrorMap:c1,globalRegistry:Yn,gt:ir,gte:Jt,guid:ek,hash:Sk,hex:kk,hostname:xk,httpUrl:ak,includes:As,instanceof:r1,int:va,int32:Ck,int64:Ek,intersection:Rh,ipv4:gk,ipv6:hk,iso:Xx,json:o1,jwt:_k,keyof:Lk,ksuid:mk,lazy:lp,length:xo,literal:Gk,locales:vg,looseObject:Fk,lowercase:Es,lt:rr,lte:hn,map:Wk,maxLength:wo,maxSize:_o,mime:js,minLength:wr,minSize:ni,multipleOf:ti,nan:Xk,nanoid:lk,nativeEnum:Hk,negative:Xg,never:cl,nonnegative:Qg,nonoptional:Qh,nonpositive:Yg,normalize:Us,null:Eh,nullable:to,nullish:Vk,number:Ih,object:Rk,optional:eo,overwrite:ur,parse:gh,parseAsync:hh,partialRecord:Bk,pipe:no,positive:Jg,prefault:Yh,preprocess:a1,prettifyError:Qd,promise:e1,property:eh,readonly:op,record:Zh,refine:dp,regex:zs,regexes:Xa,registry:ls,safeDecode:xh,safeDecodeAsync:Sh,safeEncode:wh,safeEncodeAsync:kh,safeParse:ph,safeParseAsync:vh,set:qk,setErrorMap:l1,size:Ds,startsWith:Ps,strictObject:Mk,string:pa,stringFormat:wk,stringbool:i1,success:Jk,superRefine:fp,symbol:Ak,templateLiteral:Qk,toJSONSchema:lh,toLowerCase:Rs,toUpperCase:Ms,transform:hl,treeifyError:Xd,trim:Ls,tuple:Fh,uint32:Dk,uint64:Ok,ulid:dk,undefined:Pk,union:fl,unknown:xr,uppercase:Os,url:ok,util:Vd,uuid:tk,uuidv4:nk,uuidv6:rk,uuidv7:ik,void:jk,xid:fk},Symbol.toStringTag,{value:"Module"})),ro={session:"ses",message:"msg",permission:"per",user:"usr",part:"prt",pty:"pty"},v1=26;let jc=0,Jo=0;var $n;(e=>{function n(t){return p1.string().startsWith(ro[t])}e.schema=n;function r(t,o){return Uc(t,!1,o)}e.ascending=r;function i(t,o){return Uc(t,!0,o)}e.descending=i})($n||($n={}));function Uc(e,n,r){if(!r)return b1(e,n);if(!r.startsWith(ro[e]))throw new Error(`ID ${r} does not start with ${ro[e]}`);return r}function b1(e,n,r){const i=Date.now();i!==jc&&(jc=i,Jo=0),Jo+=1;let t=BigInt(i)*BigInt(4096)+BigInt(Jo);n&&(t=~t);const o=new Uint8Array(6);for(let a=0;a<6;a+=1)o[a]=Number(t>>BigInt(40-8*a)&BigInt(255));return ro[e]+"_"+y1(o)+$1(v1-12)}function y1(e){let n="";for(let r=0;r<e.length;r+=1)n+=e[r].toString(16).padStart(2,"0");return n}function $1(e){const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",r=_1(e);let i="";for(let t=0;t<e;t+=1)i+=n[r[t]%62];return i}function _1(e){const n=new Uint8Array(e),r=typeof globalThis<"u"?globalThis.crypto:void 0;if(r&&typeof r.getRandomValues=="function")return r.getRandomValues(n),n;for(let i=0;i<e;i+=1)n[i]=Math.floor(Math.random()*256);return n}const Lc=(e,n)=>n.startsWith("/")?n:(e+"/"+n).replace("//","/"),Rc=e=>{let n=e.replace(/\\/g,"/");return/^[A-Za-z]:/.test(n)&&(n="/"+n),n.split("/").map(r=>encodeURIComponent(r)).join("/")},Mc=e=>e?`?start=${e.startLine}&end=${e.endLine}`:"",w1=e=>e.type==="file",x1=e=>e.type==="agent",k1=(e,n,r)=>{const i=n?Math.min(n.startLine,n.endLine):void 0,t=n?Math.max(n.startLine,n.endLine):void 0;return`The user made the following comment regarding ${i===void 0||t===void 0?"this file":i===t?`line ${i}`:`lines ${i} through ${t}`} of ${e}: ${r}`},S1=(e,n,r)=>e.type==="text"?{id:e.id,type:"text",text:e.text,synthetic:e.synthetic,ignored:e.ignored,time:e.time,metadata:e.metadata,sessionID:n,messageID:r}:e.type==="file"?{id:e.id,type:"file",mime:e.mime,filename:e.filename,url:e.url,source:e.source,sessionID:n,messageID:r}:{id:e.id,type:"agent",name:e.name,source:e.source,sessionID:n,messageID:r};function I1(e){const n=[{id:$n.ascending("part"),type:"text",text:e.text}],r=e.prompt.filter(w1).map(l=>{const u=Lc(e.sessionDirectory,l.path);return{id:$n.ascending("part"),type:"file",mime:"text/plain",url:`file://${Rc(u)}${Mc(l.selection)}`,filename:Tt(l.path),source:{type:"file",text:{value:l.content,start:l.start,end:l.end},path:u}}}),i=e.prompt.filter(x1).map(l=>({id:$n.ascending("part"),type:"agent",name:l.name,source:{value:l.content,start:l.start,end:l.end}})),t=new Set(r.map(l=>l.url)),o=e.context.flatMap(l=>{const u=Lc(e.sessionDirectory,l.path),c=`file://${Rc(u)}${Mc(l.selection)}`,m=l.comment?.trim();if(!m&&t.has(c))return[];t.add(c);const f={id:$n.ascending("part"),type:"file",mime:"text/plain",url:c,filename:Tt(l.path)};return m?[{id:$n.ascending("part"),type:"text",text:k1(l.path,l.selection,m),synthetic:!0},f]:[f]}),a=e.images.map(l=>({id:$n.ascending("part"),type:"file",mime:l.mime,url:l.dataUrl,filename:l.filename}));return n.push(...r,...o,...i,...a),{requestParts:n,optimisticParts:n.map(l=>S1(l,e.sessionID,e.messageID))}}const Vr=new Map;function T1(e){const n=si(),r=Dn(),i=_n(),t=hu(),o=oo(),a=Dr(),l=di(),u=Sr(),c=wt(),m=Bn(),f=b=>{if(b&&typeof b=="object"&&"data"in b){const x=b.data;if(x?.message)return x.message}return b instanceof Error?b.message:c.t("common.requestFailed")},g=async()=>{const b=m.id;if(!b)return Promise.resolve();const x=Vr.get(b);return x?(x.abort.abort(),x.cleanup(),Vr.delete(b),Promise.resolve()):r.client.session.abort({sessionID:b}).catch(()=>{})},p=b=>{for(const x of b)l.context.add({type:"file",path:x.path,selection:x.selection,comment:x.comment,commentID:x.commentID,commentOrigin:x.commentOrigin,preview:x.preview})},h=b=>{for(const x of b)l.context.remove(x.key)};return{abort:g,handleSubmit:async b=>{b.preventDefault();const x=l.current(),R=x.map(te=>"content"in te?te.content:"").join(""),U=e.imageAttachments().slice(),A=e.mode();if(R.trim().length===0&&U.length===0&&e.commentCount()===0){e.working()&&g();return}const N=a.model.current(),k=a.agent.current();if(!N||!k){lt({title:c.t("prompt.toast.modelAgentRequired.title"),description:c.t("prompt.toast.modelAgentRequired.description")});return}e.addToHistory(x,A),e.resetHistoryNavigation();const D=r.directory,I=!m.id,S=e.newSessionWorktree??"main";let O=D,_=r.client;if(I){if(S==="create"){const te=await _.worktree.create({directory:D}).then(he=>he.data).catch(he=>{lt({title:c.t("prompt.toast.worktreeCreateFailed.title"),description:f(he)})});if(!te?.directory){lt({title:c.t("prompt.toast.worktreeCreateFailed.title"),description:c.t("common.requestFailed")});return}jo.pending(te.directory),O=te.directory}S!=="main"&&S!=="create"&&(O=S),O!==D&&(_=sv({baseUrl:r.url,fetch:o.fetch,directory:O,throwOnError:!0}),t.child(O)),e.onNewSessionWorktreeReset?.()}let M=e.info();if(!M&&I&&(M=await _.session.create().then(te=>te.data??void 0).catch(te=>{lt({title:c.t("prompt.toast.sessionCreateFailed.title"),description:f(te)})}),M&&(u.handoff.setTabs(ei(O),M.id),n(`/${ei(O)}/session/${M.id}`))),!M)return;e.onSubmit?.();const F={modelID:N.id,providerID:N.provider.id},Z=k.name,B=a.model.variant.current(),W=()=>{l.reset(),e.setMode("normal"),e.setPopover(null)},ee=()=>{l.set(x,e.promptLength(x)),e.setMode(A),e.setPopover(null),requestAnimationFrame(()=>{const te=e.editor();te&&(te.focus(),Jr(te,e.promptLength(x)),e.queueScroll())})};if(A==="shell"){W(),_.session.shell({sessionID:M.id,agent:Z,model:F,command:R}).catch(te=>{lt({title:c.t("prompt.toast.shellSendFailed.title"),description:f(te)}),ee()});return}if(R.startsWith("/")){const[te,...he]=R.split(" "),C=te.slice(1);if(i.data.command.find(ie=>ie.name===C)){W(),_.session.command({sessionID:M.id,command:C,arguments:he.join(" "),agent:Z,model:`${F.providerID}/${F.modelID}`,variant:B,parts:U.map(ie=>({id:$n.ascending("part"),type:"file",mime:ie.mime,url:ie.dataUrl,filename:ie.filename}))}).catch(ie=>{lt({title:c.t("prompt.toast.commandSendFailed.title"),description:f(ie)}),ee()});return}}const Se=l.context.items().slice(),X=Se.filter(te=>te.type==="file"&&!!te.comment?.trim()),ne=$n.ascending("message"),{requestParts:ce,optimisticParts:fe}=I1({prompt:x,context:Se,images:U,text:R,sessionID:M.id,messageID:ne,sessionDirectory:O}),me={id:ne,sessionID:M.id,role:"user",time:{created:Date.now()},agent:Z,model:F},V=()=>i.session.optimistic.add({directory:O,sessionID:M.id,message:me,parts:fe}),z=()=>i.session.optimistic.remove({directory:O,sessionID:M.id,messageID:ne});h(X),W(),V();const H=async()=>{const te=jo.get(O);if(!te||te.status!=="pending")return!0;O===D&&i.set("session_status",M.id,{type:"busy"});const he=new AbortController,C=()=>{O===D&&i.set("session_status",M.id,{type:"idle"}),z(),p(X),ee()};Vr.set(M.id,{abort:he,cleanup:C});const q=new Promise(We=>{if(he.signal.aborted){We({status:"failed",message:"aborted"});return}he.signal.addEventListener("abort",()=>{We({status:"failed",message:"aborted"})},{once:!0})}),ie=5*60*1e3,_e={id:void 0},ge=new Promise(We=>{_e.id=window.setTimeout(()=>{We({status:"failed",message:c.t("workspace.error.stillPreparing")})},ie)}),Ae=await Promise.race([jo.wait(O),q,ge]).finally(()=>{_e.id!==void 0&&clearTimeout(_e.id)});if(Vr.delete(M.id),he.signal.aborted)return!1;if(Ae.status==="failed")throw new Error(Ae.message);return!0};(async()=>{await H()&&await _.session.prompt({sessionID:M.id,agent:Z,model:F,messageID:ne,parts:ce,variant:B})})().catch(te=>{Vr.delete(M.id),O===D&&i.set("session_status",M.id,{type:"idle"}),lt({title:c.t("prompt.toast.promptSendFailed.title"),description:f(te)}),z(),p(X),ee()})}}}var C1=$('<div class="absolute inset-x-0 -top-3 -translate-y-full origin-bottom-left max-h-80 min-h-10 overflow-auto no-scrollbar flex flex-col p-2 rounded-md border border-border-base bg-surface-raised-stronger-non-alpha shadow-md">'),Fc=$('<div class="text-text-weak px-2 py-1">'),D1=$('<span class="text-14-regular text-text-strong whitespace-nowrap">@'),z1=$("<button>"),E1=$('<span class="text-text-strong whitespace-nowrap">'),O1=$('<div class="flex items-center text-14-regular min-w-0"><span class="text-text-weak whitespace-nowrap truncate min-w-0">'),A1=$('<span class="text-14-regular text-text-weak truncate">'),P1=$('<span class="text-11-regular text-text-subtle px-1.5 py-0.5 bg-surface-base rounded">'),N1=$('<span class="text-12-regular text-text-subtle">'),j1=$('<button><div class="flex items-center gap-2 min-w-0"><span class="text-14-regular text-text-strong whitespace-nowrap">/</span></div><div class="flex items-center gap-2 shrink-0">');const U1=e=>s(P,{get when(){return e.popover},get children(){var n=C1();return n.$$mousedown=r=>r.preventDefault(),ut(r=>{e.popover==="slash"&&e.setSlashPopoverRef(r)},n),d(n,s(bt,{get children(){return[s(De,{get when(){return e.popover==="at"},get children(){return s(P,{get when(){return e.atFlat.length>0},get fallback(){return(()=>{var r=Fc();return d(r,()=>e.t("prompt.popover.emptyResults")),r})()},get children(){return s(Ge,{get each(){return e.atFlat.slice(0,10)},children:r=>(()=>{var i=z1();return i.addEventListener("mouseenter",()=>e.setAtActive(e.atKey(r))),i.$$click=()=>e.onAtSelect(r),d(i,s(P,{get when(){return r.type==="agent"},get fallback(){return[s(Tr,{get node(){return{path:r.type==="file"?r.path:"",type:"file"}},class:"shrink-0 size-4"}),(()=>{var t=O1(),o=t.firstChild;return d(o,(()=>{var a=se(()=>r.type==="file");return()=>a()?se(()=>!!r.path.endsWith("/"))()?r.path:Cr(r.path):""})()),d(t,s(P,{get when(){return se(()=>r.type==="file")()&&!r.path.endsWith("/")},get children(){var a=E1();return d(a,(()=>{var l=se(()=>r.type==="file");return()=>l()?Tt(r.path):""})()),a}}),null),t})()]},get children(){return[s(Be,{name:"brain",size:"small",class:"text-icon-info-active shrink-0"}),(()=>{var t=D1();return t.firstChild,d(t,(()=>{var o=se(()=>r.type==="agent");return()=>o()?r.name:""})(),null),t})()]}})),be(t=>ct(i,{"w-full flex items-center gap-x-2 rounded-md px-2 py-0.5":!0,"bg-surface-raised-base-hover":e.atActive===e.atKey(r)},t)),i})()})}})}}),s(De,{get when(){return e.popover==="slash"},get children(){return s(P,{get when(){return e.slashFlat.length>0},get fallback(){return(()=>{var r=Fc();return d(r,()=>e.t("prompt.popover.emptyCommands")),r})()},get children(){return s(Ge,{get each(){return e.slashFlat},children:r=>(()=>{var i=j1(),t=i.firstChild,o=t.firstChild;o.firstChild;var a=t.nextSibling;return i.addEventListener("mouseenter",()=>e.setSlashActive(r.id)),i.$$click=()=>e.onSlashSelect(r),d(o,()=>r.trigger,null),d(t,s(P,{get when(){return r.description},get children(){var l=A1();return d(l,()=>r.description),l}}),null),d(a,s(P,{get when(){return se(()=>r.type==="custom")()&&r.source!=="command"},get children(){var l=P1();return d(l,(()=>{var u=se(()=>r.source==="skill");return()=>u()?e.t("prompt.slash.badge.skill"):se(()=>r.source==="mcp")()?e.t("prompt.slash.badge.mcp"):e.t("prompt.slash.badge.custom")})()),l}}),null),d(a,s(P,{get when(){return e.commandKeybind(r.id)},get children(){var l=N1();return d(l,()=>e.commandKeybind(r.id)),l}}),null),be(l=>{var u=r.id,c={"w-full flex items-center justify-between gap-4 rounded-md px-2 py-1":!0,"bg-surface-raised-base-hover":e.slashActive===r.id};return u!==l.e&&Te(i,"data-slash-id",l.e=u),l.t=ct(i,c,l.t),l},{e:void 0,t:void 0}),i})()})}})}})]}})),n}});Ut(["mousedown","click"]);var L1=$('<div class="flex flex-nowrap items-start gap-2 p-2 overflow-x-auto no-scrollbar">'),R1=$('<div><div class="flex items-center gap-1.5"><div class="flex items-center text-11-regular min-w-0 font-medium"><span class="text-text-strong whitespace-nowrap">'),M1=$('<span class="flex max-w-[300px]"><span class="text-text-invert-base truncate-start [unicode-bidi:plaintext] min-w-0"></span><span class=shrink-0>'),F1=$('<span class="text-text-weak whitespace-nowrap shrink-0">'),Z1=$('<div class="text-12-regular text-text-strong ml-5 pr-1 truncate">');const B1=e=>s(P,{get when(){return e.items.length>0},get children(){var n=L1();return d(n,s(Ge,{get each(){return e.items},children:r=>s(Zt,{get value(){return(()=>{var i=M1(),t=i.firstChild,o=t.nextSibling;return d(t,()=>Cr(r.path)),d(o,()=>Tt(r.path)),i})()},placement:"top",openDelay:2e3,get children(){var i=R1(),t=i.firstChild,o=t.firstChild,a=o.firstChild;return i.$$click=()=>e.openComment(r),d(t,s(Tr,{get node(){return{path:r.path,type:"file"}},class:"shrink-0 size-3.5"}),o),d(a,()=>lv(r.path,14)),d(o,s(P,{get when(){return r.selection},children:l=>(()=>{var u=F1();return d(u,(()=>{var c=se(()=>l().startLine===l().endLine);return()=>c()?`:${l().startLine}`:`:${l().startLine}-${l().endLine}`})()),u})()}),null),d(t,s(zt,{type:"button",icon:"close-small",variant:"ghost",class:"ml-auto size-3.5 text-text-weak hover:text-text-strong transition-all",onClick:l=>{l.stopPropagation(),e.remove(r)},get"aria-label"(){return e.t("prompt.context.removeFile")}}),null),d(i,s(P,{get when(){return r.comment},children:l=>(()=>{var u=Z1();return d(u,l),u})()}),null),be(l=>ct(i,{"group shrink-0 flex flex-col rounded-[6px] pl-2 pr-1 py-1 max-w-[200px] h-12 transition-all transition-transform shadow-xs-border hover:shadow-xs-border-hover":!0,"cursor-pointer hover:bg-surface-interactive-weak":!!r.commentID&&!e.active(r),"cursor-pointer bg-surface-interactive-hover hover:bg-surface-interactive-hover shadow-xs-border-hover":e.active(r),"bg-background-stronger":!e.active(r)},l)),i}})})),n}});Ut(["click"]);var W1=$('<div class="flex flex-wrap gap-2 px-3 pt-3">'),q1=$('<img class="size-16 rounded-md object-cover border border-border-base hover:border-border-strong-base transition-colors">'),H1=$('<div class="relative group"><button type=button class="absolute -top-1.5 -right-1.5 size-5 rounded-full bg-surface-raised-stronger-non-alpha border border-border-base flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity hover:bg-surface-raised-base-hover"></button><div class="absolute bottom-0 left-0 right-0 px-1 py-0.5 bg-black/50 rounded-b-md"><span class="text-10-regular text-white truncate block">'),G1=$('<div class="size-16 rounded-md bg-surface-base flex items-center justify-center border border-border-base">');const K1=e=>s(P,{get when(){return e.attachments.length>0},get children(){var n=W1();return d(n,s(Ge,{get each(){return e.attachments},children:r=>(()=>{var i=H1(),t=i.firstChild,o=t.nextSibling,a=o.firstChild;return d(i,s(P,{get when(){return r.mime.startsWith("image/")},get fallback(){return(()=>{var l=G1();return d(l,s(Be,{name:"folder",class:"size-6 text-text-weak"})),l})()},get children(){var l=q1();return l.$$click=()=>e.onOpen(r),be(u=>{var c=r.dataUrl,m=r.filename;return c!==u.e&&Te(l,"src",u.e=c),m!==u.t&&Te(l,"alt",u.t=m),u},{e:void 0,t:void 0}),l}}),t),t.$$click=()=>e.onRemove(r.id),d(t,s(Be,{name:"close",class:"size-3 text-text-weak"})),d(a,()=>r.filename),be(()=>Te(t,"aria-label",e.removeLabel)),i})()})),n}});Ut(["click"]);var V1=$('<div class="absolute inset-0 z-10 flex items-center justify-center bg-surface-raised-stronger-non-alpha/90 pointer-events-none"><div class="flex flex-col items-center gap-2 text-text-weak"><span class=text-14-regular>');const J1=e=>s(P,{get when(){return e.type!==null},get children(){var n=V1(),r=n.firstChild,i=r.firstChild;return d(r,s(Be,{get name(){return e.type==="@mention"?"link":"photo"},class:"size-8"}),i),d(i,()=>e.label),n}});function X1(e){return e.mode==="shell"?e.t("prompt.placeholder.shell"):e.commentCount>1?e.t("prompt.placeholder.summarizeComments"):e.commentCount===1?e.t("prompt.placeholder.summarizeComment"):e.t("prompt.placeholder.normal",{example:e.example})}var Y1=$('<div class="absolute top-0 inset-x-0 p-3 pr-12 text-14-regular text-text-weak pointer-events-none whitespace-nowrap truncate">'),Q1=$('<div class="flex items-center gap-2 px-2 h-6"><span class="text-12-regular text-text-primary"></span><span class="text-12-regular text-text-weak">'),Zc=$("<span class=truncate>"),eS=$('<div class="relative size-full _max-h-[320px] flex flex-col gap-3"><form><div class="relative max-h-[240px] overflow-y-auto"><div data-component=prompt-input role=textbox aria-multiline=true contenteditable=true autocapitalize=off autocorrect=off></div></div><div class="relative p-3 flex items-center justify-between gap-2"><div class="flex items-center gap-2 min-w-0 flex-1"></div><div class="flex items-center gap-1 shrink-0"><input type=file class=hidden><div class="flex items-center gap-1 mr-1">'),tS=$('<div class="flex items-center gap-2"><span></span><span class="text-icon-base text-12-medium text-[10px]!">'),nS=$('<div class="flex items-center gap-2"><span>');const Xo=["prompt.example.1","prompt.example.2","prompt.example.3","prompt.example.4","prompt.example.5","prompt.example.6","prompt.example.7","prompt.example.8","prompt.example.9","prompt.example.10","prompt.example.11","prompt.example.12","prompt.example.13","prompt.example.14","prompt.example.15","prompt.example.16","prompt.example.17","prompt.example.18","prompt.example.19","prompt.example.20","prompt.example.21","prompt.example.22","prompt.example.23","prompt.example.24","prompt.example.25"],rS=e=>{const n=Dn(),r=_n(),i=Dr(),t=ci(),o=di(),a=w(()=>o.context.items().filter(E=>!!E.comment?.trim()).length),l=Sr(),u=vu(),c=Bn(),m=wn(),f=pu(),g=li(),p=bu(),h=wt();let v,b,x,R;const U={input:!1},A=()=>{const E=x,K=window.getSelection();if(!E||!K||K.rangeCount===0)return;const ae=K.getRangeAt(0);if(!v.contains(ae.startContainer))return;const xe=ae.getBoundingClientRect();if(!xe.height)return;const Ye=E.getBoundingClientRect(),nt=xe.top-Ye.top+E.scrollTop,Ee=xe.bottom-Ye.top+E.scrollTop,Ne=12;if(nt<E.scrollTop+Ne){E.scrollTop=Math.max(0,nt-Ne);return}Ee>E.scrollTop+E.clientHeight-Ne&&(E.scrollTop=Ee-E.clientHeight+Ne)},N=()=>{requestAnimationFrame(A)},k=w(()=>`${c.dir}${c.id?"/"+c.id:""}`),D=w(()=>l.tabs(k)),I=w(()=>l.view(k)),S=E=>{const K=c.id;if(!K)return!1;const ae=r.data.session_diff[K];return ae?ae.some(xe=>xe.file===E):!1},O=E=>{if(!E.commentID)return;const K={file:E.path,id:E.commentID};if(u.setActive(K),E.commentOrigin==="review"||E.commentOrigin!=="file"&&S(E.path)){I().reviewPanel.opened()||I().reviewPanel.open(),l.fileTree.open(),l.fileTree.setTab("changes"),requestAnimationFrame(()=>u.setFocus(K));return}I().reviewPanel.opened()||I().reviewPanel.open(),l.fileTree.open(),l.fileTree.setTab("all");const xe=t.tab(E.path);D().open(xe),t.load(E.path),requestAnimationFrame(()=>u.setFocus(K))},_=w(()=>{const E=D().all(),K=D().active(),ae=K?[K,...E.filter(nt=>nt!==K)]:E,xe=new Set,Ye=[];for(const nt of ae){const Ee=t.pathFromTab(nt);Ee&&(xe.has(Ee)||(xe.add(Ee),Ye.push(Ee)))}return Ye}),M=w(()=>c.id?r.session.get(c.id):void 0),F=w(()=>r.data.session_status[c.id??""]??{type:"idle"}),Z=w(()=>F()?.type!=="idle"),B=w(()=>o.current().filter(E=>E.type==="image")),[W,ee]=It({popover:null,historyIndex:-1,savedPrompt:null,placeholder:Math.floor(Math.random()*Xo.length),draggingType:null,mode:"normal",applyingHistory:!1}),Se=w(()=>X1({mode:W.mode,commentCount:a(),example:h.t(Xo[W.placeholder]),t:(E,K)=>h.t(E,K)})),[X,ne]=Qo(ea.global("prompt-history",["prompt-history.v1"]),It({entries:[]})),[ce,fe]=Qo(ea.global("prompt-history-shell",["prompt-history-shell.v1"]),It({entries:[]})),me=(E,K)=>{const ae=K==="start"?0:Gr(E);ee("applyingHistory",!0),o.set(E,ae),requestAnimationFrame(()=>{v.focus(),Jr(v,ae),ee("applyingHistory",!1),N()})},V=()=>{const E=window.getSelection(),K=Gr(o.current());if(!E||E.rangeCount===0)return{collapsed:!1,cursorPosition:0,textLength:K};const ae=E.anchorNode;return!ae||!v.contains(ae)?{collapsed:!1,cursorPosition:0,textLength:K}:{collapsed:E.isCollapsed,cursorPosition:Mn(v),textLength:K}},z=I$(()=>v);re(()=>{if(c.id,c.id)return;const E=setInterval(()=>{ee("placeholder",K=>(K+1)%Xo.length)},6500);rt(()=>clearInterval(E))});const[H,$e]=ze(!1),te=E=>E.isComposing||H()||E.keyCode===229;re(()=>{z()||ee("popover",null)}),re(()=>{z()||$e(!1)});const he=w(()=>r.data.agent.filter(E=>!E.hidden&&E.mode!=="primary").map(E=>({type:"agent",name:E.name,display:E.name}))),C=E=>{E&&(E.type==="agent"?je({type:"agent",name:E.name,content:"@"+E.name}):je({type:"file",path:E.path,content:"@"+E.path}))},q=E=>E?E.type==="agent"?`agent:${E.name}`:`file:${E.path}`:"",{flat:ie,active:_e,setActive:ge,onInput:Ae,onKeyDown:We}=zl({items:async E=>{const K=he(),ae=_(),xe=new Set(ae),Ye=ae.map(Ne=>({type:"file",path:Ne,display:Ne,recent:!0})),Ee=(await t.searchFilesAndDirectories(E)).filter(Ne=>!xe.has(Ne)).map(Ne=>({type:"file",path:Ne,display:Ne}));return[...K,...Ye,...Ee]},key:q,filterKeys:["display"],groupBy:E=>E.type==="agent"?"agent":E.recent?"recent":"file",sortGroupsBy:(E,K)=>{const ae=xe=>xe==="agent"?0:xe==="recent"?1:2;return ae(E.category)-ae(K.category)},onSelect:C}),mt=w(()=>{const E=g.options.filter(ae=>!ae.disabled&&!ae.id.startsWith("suggested.")&&ae.slash).map(ae=>({id:ae.id,trigger:ae.slash,title:ae.title,description:ae.description,keybind:ae.keybind,type:"builtin"}));return[...r.data.command.map(ae=>({id:`custom.${ae.name}`,trigger:ae.name,title:ae.name,description:ae.description,type:"custom",source:ae.mcp?"mcp":"command"})),...E]}),yt=E=>{if(E){if(ee("popover",null),E.type==="custom"){const K=`/${E.trigger} `;v.innerHTML="",v.textContent=K,o.set([{type:"text",content:K,start:0,end:K.length}],K.length),requestAnimationFrame(()=>{v.focus();const ae=document.createRange(),xe=window.getSelection();ae.selectNodeContents(v),ae.collapse(!1),xe?.removeAllRanges(),xe?.addRange(ae)});return}v.innerHTML="",o.set([{type:"text",content:"",start:0,end:0}],0),g.trigger(E.id,"slash")}},{flat:kt,active:dt,setActive:G,onInput:ue,onKeyDown:ye,refetch:ke}=zl({items:mt,key:E=>E?.id,filterKeys:["trigger","title","description"],onSelect:yt}),Pe=E=>{const K=document.createElement("span");return K.textContent=E.content,K.setAttribute("data-type",E.type),E.type==="file"&&K.setAttribute("data-path",E.path),E.type==="agent"&&K.setAttribute("data-name",E.name),K.setAttribute("contenteditable","false"),K.style.userSelect="text",K.style.cursor="default",K},He=()=>Array.from(v.childNodes).every(E=>{if(E.nodeType===Node.TEXT_NODE){const ae=E.textContent??"";if(!ae.includes(""))return!0;if(ae!=="")return!1;const xe=E.previousSibling,Ye=E.nextSibling,nt=xe?.nodeType===Node.ELEMENT_NODE&&xe.tagName==="BR",Ee=Ye?.nodeType===Node.ELEMENT_NODE&&Ye.tagName==="BR";return!(!nt&&!Ee||Ee&&!nt&&xe)}if(E.nodeType!==Node.ELEMENT_NODE)return!1;const K=E;return K.dataset.type==="file"||K.dataset.type==="agent"?!0:K.tagName==="BR"}),et=E=>{v.innerHTML="";for(const K of E){if(K.type==="text"){v.appendChild(bc(K.content));continue}(K.type==="file"||K.type==="agent")&&v.appendChild(Pe(K))}};re(ot(()=>r.data.command,()=>ke(),{defer:!0})),re(()=>{const E=dt();!E||!R||requestAnimationFrame(()=>{R.querySelector(`[data-slash-id="${E}"]`)?.scrollIntoView({block:"nearest",behavior:"smooth"})})});const Q=()=>{if(W.popover==="at"){const E=ie();if(E.length===0)return;const K=_e(),ae=E.find(xe=>q(xe)===K)??E[0];C(ae);return}if(W.popover==="slash"){const E=kt();if(E.length===0)return;const K=dt(),ae=E.find(xe=>xe.id===K)??E[0];yt(ae)}};re(ot(()=>o.current(),E=>{const K=E.filter(nt=>nt.type!=="image");if(U.input){if(U.input=!1,He())return;const nt=window.getSelection();let Ee=null;nt&&nt.rangeCount>0&&v.contains(nt.anchorNode)&&(Ee=Mn(v)),et(K),Ee!==null&&Jr(v,Ee);return}const ae=we();if(He()&&cv(K,ae))return;const xe=window.getSelection();let Ye=null;xe&&xe.rangeCount>0&&v.contains(xe.anchorNode)&&(Ye=Mn(v)),et(K),Ye!==null&&Jr(v,Ye)}));const we=()=>{const E=[];let K=0,ae="";const xe=()=>{const Me=ae.replace(/\r\n?/g,`
|
|
35
|
+
`).replace(/\u200B/g,"");ae="",Me&&(E.push({type:"text",content:Me,start:K,end:K+Me.length}),K+=Me.length)},Ye=Me=>{const Le=Me.textContent??"";E.push({type:"file",path:Me.dataset.path,content:Le,start:K,end:K+Le.length}),K+=Le.length},nt=Me=>{const Le=Me.textContent??"";E.push({type:"agent",name:Me.dataset.name,content:Le,start:K,end:K+Le.length}),K+=Le.length},Ee=Me=>{if(Me.nodeType===Node.TEXT_NODE){ae+=Me.textContent??"";return}if(Me.nodeType!==Node.ELEMENT_NODE)return;const Le=Me;if(Le.dataset.type==="file"){xe(),Ye(Le);return}if(Le.dataset.type==="agent"){xe(),nt(Le);return}if(Le.tagName==="BR"){ae+=`
|
|
36
|
+
`;return}for(const ve of Array.from(Le.childNodes))Ee(ve)},Ne=Array.from(v.childNodes);return Ne.forEach((Me,Le)=>{const ve=Me.nodeType===Node.ELEMENT_NODE&&["DIV","P"].includes(Me.tagName);Ee(Me),ve&&Le<Ne.length-1&&(ae+=`
|
|
37
|
+
`)}),xe(),E.length===0&&E.push(...El),E},Re=()=>{const E=we(),K=B(),ae=Mn(v),xe=E.map(Me=>"content"in Me?Me.content:"").join(""),Ye=xe.replace(/\u200B/g,"").trim(),nt=E.some(Me=>Me.type!=="text");if(Ye.length===0&&!nt&&K.length===0){ee("popover",null),W.historyIndex>=0&&!W.applyingHistory&&(ee("historyIndex",-1),ee("savedPrompt",null)),o.dirty()&&(U.input=!0,o.set(El,0)),N();return}if(W.mode==="shell")ee("popover",null);else{const Me=xe.substring(0,ae).match(/@(\S*)$/),Le=xe.match(/^\/(\S*)$/);Me?(Ae(Me[1]),ee("popover","at")):Le?(ue(Le[1]),ee("popover","slash")):ee("popover",null)}W.historyIndex>=0&&!W.applyingHistory&&(ee("historyIndex",-1),ee("savedPrompt",null)),U.input=!0,o.set([...E,...K],ae),N()},je=E=>{const K=window.getSelection();if(!K||K.rangeCount===0)return;const ae=Mn(v),Ee=o.current().map(Ne=>"content"in Ne?Ne.content:"").join("").substring(0,ae).match(/@(\S*)$/);if(E.type==="file"||E.type==="agent"){const Ne=Pe(E),Me=document.createTextNode(" "),Le=K.getRangeAt(0);if(Ee){const ve=Ee.index??ae-Ee[0].length;yc(v,Le,"start",ve),yc(v,Le,"end",ae)}Le.deleteContents(),Le.insertNode(Me),Le.insertNode(Ne),Le.setStartAfter(Me),Le.collapse(!0),K.removeAllRanges(),K.addRange(Le)}else if(E.type==="text"){const Ne=K.getRangeAt(0),Me=bc(E.content),Le=Me.lastChild;if(Ne.deleteContents(),Ne.insertNode(Me),Le){if(Le.nodeType===Node.TEXT_NODE){const ve=Le.textContent??"";ve===""&&Ne.setStart(Le,0),ve!==""&&Ne.setStart(Le,ve.length)}Le.nodeType!==Node.TEXT_NODE&&Ne.setStartAfter(Le)}Ne.collapse(!0),K.removeAllRanges(),K.addRange(Ne)}Re(),ee("popover",null)},pt=(E,K)=>{const ae=K==="shell"?ce:X,xe=K==="shell"?fe:ne,Ye=B$(ae.entries,E);Ye!==ae.entries&&xe("entries",Ye)},Ke=E=>{const K=q$({direction:E,entries:W.mode==="shell"?ce.entries:X.entries,historyIndex:W.historyIndex,currentPrompt:o.current(),savedPrompt:W.savedPrompt});return K.handled?(ee("historyIndex",K.historyIndex),ee("savedPrompt",K.savedPrompt),me(K.prompt,K.cursor),!0):!1},{addImageAttachment:Et,removeImageAttachment:Lt,handlePaste:bn}=M$({editor:()=>v,isFocused:z,isDialogActive:()=>!!m.active,setDraggingType:E=>ee("draggingType",E),focusEditor:()=>{v.focus(),Jr(v,Gr(o.current()))},addPart:je}),{abort:en,handleSubmit:xn}=T1({info:M,imageAttachments:B,commentCount:a,mode:()=>W.mode,working:Z,editor:()=>v,queueScroll:N,promptLength:Gr,addToHistory:pt,resetHistoryNavigation:()=>{ee("historyIndex",-1),ee("savedPrompt",null)},setMode:E=>ee("mode",E),setPopover:E=>ee("popover",E),newSessionWorktree:e.newSessionWorktree,onNewSessionWorktreeReset:e.onNewSessionWorktreeReset,onSubmit:e.onSubmit}),tn=E=>{if(E.key==="Backspace"){const ae=window.getSelection();if(ae&&ae.isCollapsed){const xe=ae.anchorNode,Ye=ae.anchorOffset;if(xe&&xe.nodeType===Node.TEXT_NODE){const nt=xe.textContent??"";if(/^\u200B+$/.test(nt)&&Ye>0){const Ee=document.createRange();Ee.setStart(xe,0),Ee.collapse(!0),ae.removeAllRanges(),ae.addRange(Ee)}}}}if(E.key==="!"&&W.mode==="normal"&&Mn(v)===0){ee("mode","shell"),ee("popover",null),E.preventDefault();return}if(W.mode==="shell"){const{collapsed:ae,cursorPosition:xe,textLength:Ye}=V();if(E.key==="Escape"){ee("mode","normal"),E.preventDefault();return}if(E.key==="Backspace"&&ae&&xe===0&&Ye===0){ee("mode","normal"),E.preventDefault();return}}if(E.key==="Enter"&&E.shiftKey){je({type:"text",content:`
|
|
38
|
+
`}),E.preventDefault();return}if(E.key==="Enter"&&te(E))return;const K=E.ctrlKey&&!E.metaKey&&!E.altKey&&!E.shiftKey;if(W.popover){if(E.key==="Tab"){Q(),E.preventDefault();return}const ae=E.key==="ArrowUp"||E.key==="ArrowDown"||E.key==="Enter",xe=K&&(E.key==="n"||E.key==="p");if(ae||xe){if(W.popover==="at"){We(E),E.preventDefault();return}W.popover==="slash"&&ye(E),E.preventDefault();return}}if(K&&E.code==="KeyG"){if(W.popover){ee("popover",null),E.preventDefault();return}Z()&&(en(),E.preventDefault());return}if(E.key==="ArrowUp"||E.key==="ArrowDown"){if(E.altKey||E.ctrlKey||E.metaKey)return;const{collapsed:ae}=V();if(!ae)return;const xe=Mn(v),Ye=Gr(o.current()),nt=o.current().map(On=>"content"in On?On.content:"").join(""),Ee=nt.trim()===""||Ye<=1,Ne=nt.includes(`
|
|
39
|
+
`),Me=W.historyIndex>=0,Le=xe<=(Ee?1:0),ve=xe>=(Ee?Ye-1:Ye),vt=Ee||Le||!Ne&&!Me||Me&&ve,Kt=Ee||ve||!Ne&&!Me||Me&&Le;if(E.key==="ArrowUp"){if(!vt)return;Ke("up")&&E.preventDefault();return}if(!Kt)return;Ke("down")&&E.preventDefault();return}E.key==="Enter"&&!E.shiftKey&&xn(E),E.key==="Escape"&&(W.popover?ee("popover",null):Z()&&en())};return(()=>{var E=eS(),K=E.firstChild,ae=K.firstChild,xe=ae.firstChild,Ye=ae.nextSibling,nt=Ye.firstChild,Ee=nt.nextSibling,Ne=Ee.firstChild,Me=Ne.nextSibling;d(E,s(U1,{get popover(){return W.popover},setSlashPopoverRef:ve=>R=ve,get atFlat(){return ie()},get atActive(){return _e()??void 0},atKey:q,setAtActive:ge,onAtSelect:C,get slashFlat(){return kt()},get slashActive(){return dt()??void 0},setSlashActive:G,onSlashSelect:yt,get commandKeybind(){return g.keybind},t:ve=>h.t(ve)}),K),ln(K,"submit",xn),d(K,s(J1,{get type(){return W.draggingType},get label(){return h.t(W.draggingType==="@mention"?"prompt.dropzone.file.label":"prompt.dropzone.label")}}),ae),d(K,s(B1,{get items(){return o.context.items()},active:ve=>{const vt=u.active();return!!ve.commentID&&ve.commentID===vt?.id&&ve.path===vt?.file},openComment:O,remove:ve=>{ve.commentID&&u.remove(ve.path,ve.commentID),o.context.remove(ve.key)},t:ve=>h.t(ve)}),ae),d(K,s(K1,{get attachments(){return B()},onOpen:ve=>m.show(()=>s(hd,{get src(){return ve.dataUrl},get alt(){return ve.filename}})),onRemove:Lt,get removeLabel(){return h.t("prompt.attachment.remove")}}),ae),ut(ve=>x=ve,ae),xe.$$keydown=tn,xe.addEventListener("compositionend",()=>$e(!1)),xe.addEventListener("compositionstart",()=>$e(!0)),ln(xe,"paste",bn),xe.$$input=Re,ut(ve=>{v=ve,e.ref?.(ve)},xe),Te(xe,"spellcheck",!1),d(ae,s(P,{get when(){return!o.dirty()},get children(){var ve=Y1();return d(ve,Se),ve}}),null),d(nt,s(bt,{get children(){return[s(De,{get when(){return W.mode==="shell"},get children(){var ve=Q1(),vt=ve.firstChild,Kt=vt.nextSibling;return d(ve,s(Be,{name:"console",size:"small",class:"text-icon-primary"}),vt),d(vt,()=>h.t("prompt.mode.shell")),d(Kt,()=>h.t("prompt.mode.shell.exit")),ve}}),s(De,{get when(){return W.mode==="normal"},get children(){return[s(mn,{placement:"top",gutter:8,get title(){return h.t("command.agent.cycle")},get keybind(){return g.keybind("agent.cycle")},get children(){return s(yu,{get options(){return i.agent.list().map(ve=>ve.name)},get current(){return i.agent.current()?.name??""},get onSelect(){return i.agent.set},get class(){return`capitalize ${i.model.variant.list().length>0?"max-w-full":"max-w-[120px]"}`},valueClass:"truncate",variant:"ghost"})}}),s(P,{get when(){return f.paid().length>0},get fallback(){return s(mn,{placement:"top",gutter:8,get title(){return h.t("command.model.choose")},get keybind(){return g.keybind("model.choose")},get children(){return s(Ue,{as:"div",variant:"ghost",class:"px-2 min-w-0 max-w-[240px]",onClick:()=>m.show(()=>s(O$,{})),get children(){return[s(P,{get when(){return i.model.current()?.provider?.id},get children(){return s(na,{get id(){return i.model.current().provider.id},class:"size-4 shrink-0"})}}),(()=>{var ve=Zc();return d(ve,()=>i.model.current()?.name??h.t("dialog.model.select.title")),ve})(),s(Be,{name:"chevron-down",size:"small",class:"shrink-0"})]}})}})},get children(){return s(mn,{placement:"top",gutter:8,get title(){return h.t("command.model.choose")},get keybind(){return g.keybind("model.choose")},get children(){return s(m$,{triggerAs:Ue,triggerProps:{variant:"ghost",class:"min-w-0 max-w-[240px]"},get children(){return[s(P,{get when(){return i.model.current()?.provider?.id},get children(){return s(na,{get id(){return i.model.current().provider.id},class:"size-4 shrink-0"})}}),(()=>{var ve=Zc();return d(ve,()=>i.model.current()?.name??h.t("dialog.model.select.title")),ve})(),s(Be,{name:"chevron-down",size:"small",class:"shrink-0"})]}})}})}}),s(P,{get when(){return i.model.variant.list().length>0},get children(){return s(mn,{placement:"top",gutter:8,get title(){return h.t("command.model.variant.cycle")},get keybind(){return g.keybind("model.variant.cycle")},get children(){return s(Ue,{"data-action":"model-variant-cycle",variant:"ghost",class:"text-text-base _hidden group-hover/prompt-input:inline-block capitalize text-12-regular",onClick:()=>i.model.variant.cycle(),get children(){return i.model.variant.current()??h.t("common.default")}})}})}}),s(P,{get when(){return se(()=>!!p.permissionsEnabled())()&&c.id},get children(){return s(mn,{placement:"top",gutter:8,get title(){return h.t("command.permissions.autoaccept.enable")},get keybind(){return g.keybind("permissions.autoaccept")},get children(){return s(Ue,{variant:"ghost",onClick:()=>p.toggleAutoAccept(c.id,n.directory),get classList(){return{"_hidden group-hover/prompt-input:flex size-6 items-center justify-center":!0,"text-text-base":!p.isAutoAccepting(c.id,n.directory),"hover:bg-surface-success-base":p.isAutoAccepting(c.id,n.directory)}},get"aria-label"(){return se(()=>!!p.isAutoAccepting(c.id,n.directory))()?h.t("command.permissions.autoaccept.disable"):h.t("command.permissions.autoaccept.enable")},get"aria-pressed"(){return p.isAutoAccepting(c.id,n.directory)},get children(){return s(Be,{name:"chevron-double-right",size:"small",get classList(){return{"text-icon-success-base":p.isAutoAccepting(c.id,n.directory)}}})}})}})}})]}})]}})),Ne.addEventListener("change",ve=>{const vt=ve.currentTarget.files?.[0];vt&&Et(vt),ve.currentTarget.value=""});var Le=b;return typeof Le=="function"?ut(Le,Ne):b=Ne,d(Me,s(Cd,{}),null),d(Me,s(P,{get when(){return W.mode==="normal"},get children(){return s(Zt,{placement:"top",get value(){return h.t("prompt.action.attachFile")},get children(){return s(Ue,{type:"button",variant:"ghost",class:"size-6 px-1",onClick:()=>b.click(),get"aria-label"(){return h.t("prompt.action.attachFile")},get children(){return s(Be,{name:"photo",class:"size-4.5"})}})}})}}),null),d(Ee,s(Zt,{placement:"top",get inactive(){return se(()=>!o.dirty())()&&!Z()},get value(){return s(bt,{get children(){return[s(De,{get when(){return Z()},get children(){var ve=tS(),vt=ve.firstChild,Kt=vt.nextSibling;return d(vt,()=>h.t("prompt.action.stop")),d(Kt,()=>h.t("common.key.esc")),ve}}),s(De,{when:!0,get children(){var ve=nS(),vt=ve.firstChild;return d(vt,()=>h.t("prompt.action.send")),d(ve,s(Be,{name:"enter",size:"small",class:"text-icon-base"}),null),ve}})]}})},get children(){return s(zt,{type:"submit",get disabled(){return se(()=>!o.dirty()&&!Z())()&&a()===0},get icon(){return Z()?"stop":"arrow-up"},variant:"primary",class:"h-6 w-4.5",get"aria-label"(){return se(()=>!!Z())()?h.t("prompt.action.stop"):h.t("prompt.action.send")}})}}),null),be(ve=>{var vt={"group/prompt-input":!0,"bg-surface-raised-stronger-non-alpha shadow-xs-border relative":!0,"rounded-[14px] overflow-clip focus-within:shadow-xs-border":!0,"border-icon-info-active border-dashed":W.draggingType!==null,[e.class??""]:!!e.class},Kt=Se(),On={"select-text":!0,"w-full p-3 pr-12 text-14-regular text-text-strong focus:outline-none whitespace-pre-wrap":!0,"[&_[data-type=file]]:text-syntax-property":!0,"[&_[data-type=agent]]:text-syntax-type":!0,"font-mono!":W.mode==="shell"},Rt=Bi.join(",");return ve.e=ct(K,vt,ve.e),Kt!==ve.t&&Te(xe,"aria-label",ve.t=Kt),ve.a=ct(xe,On,ve.a),Rt!==ve.o&&Te(Ne,"accept",ve.o=Rt),ve},{e:void 0,t:void 0,a:void 0,o:void 0}),E})()};Ut(["input","keydown"]);var iS=$("<div data-slot=question-tabs><button data-slot=question-tab>"),Bc=$("<span data-slot=option-description>"),oS=$("<form data-slot=custom-input-form><input type=text data-slot=custom-input>"),aS=$("<div data-slot=question-content><div data-slot=question-text></div><div data-slot=question-options><button data-slot=question-option><span data-slot=option-label>"),sS=$("<div data-slot=question-review><div data-slot=review-title>"),lS=$("<div data-component=question-prompt><div data-slot=question-actions>"),cS=$("<button data-slot=question-tab>"),uS=$("<button data-slot=question-option><span data-slot=option-label>"),dS=$("<div data-slot=review-item><span data-slot=review-label></span><span data-slot=review-value>");const fS=e=>{const n=Dn(),r=wt(),i=w(()=>e.request.questions),t=w(()=>i().length===1&&i()[0]?.multiple!==!0),[o,a]=It({tab:0,answers:[],custom:[],editing:!1,sending:!1}),l=w(()=>i()[o.tab]),u=w(()=>!t()&&o.tab===i().length),c=w(()=>l()?.options??[]),m=w(()=>o.custom[o.tab]??""),f=w(()=>l()?.multiple===!0),g=w(()=>{const k=m();return k?o.answers[o.tab]?.includes(k)??!1:!1}),p=k=>{const D=k instanceof Error?k.message:String(k);lt({title:r.t("common.requestFailed"),description:D})},h=k=>{o.sending||(a("sending",!0),n.client.question.reply({requestID:e.request.id,answers:k}).catch(p).finally(()=>a("sending",!1)))},v=()=>{o.sending||(a("sending",!0),n.client.question.reject({requestID:e.request.id}).catch(p).finally(()=>a("sending",!1)))},b=()=>{h(i().map((k,D)=>o.answers[D]??[]))},x=(k,D=!1)=>{const I=[...o.answers];if(I[o.tab]=[k],a("answers",I),D){const S=[...o.custom];S[o.tab]=k,a("custom",S)}if(t()){h([[k]]);return}a("tab",o.tab+1)},R=k=>{const I=[...o.answers[o.tab]??[]],S=I.indexOf(k);S===-1&&I.push(k),S!==-1&&I.splice(S,1);const O=[...o.answers];O[o.tab]=I,a("answers",O)},U=k=>{a("tab",k),a("editing",!1)},A=k=>{if(o.sending)return;if(k===c().length){a("editing",!0);return}const D=c()[k];if(D){if(f()){R(D.label);return}x(D.label)}},N=k=>{if(k.preventDefault(),o.sending)return;const D=m().trim();if(!D){a("editing",!1);return}if(f()){const S=[...o.answers[o.tab]??[]];S.includes(D)||S.push(D);const O=[...o.answers];O[o.tab]=S,a("answers",O),a("editing",!1);return}x(D,!0),a("editing",!1)};return(()=>{var k=lS(),D=k.firstChild;return d(k,s(P,{get when(){return!t()},get children(){var I=iS(),S=I.firstChild;return d(I,s(Ge,{get each(){return i()},children:(O,_)=>{const M=()=>_()===o.tab,F=()=>(o.answers[_()]?.length??0)>0;return(()=>{var Z=cS();return Z.$$click=()=>U(_()),d(Z,()=>O.header),be(B=>{var W=M(),ee=F(),Se=o.sending;return W!==B.e&&Te(Z,"data-active",B.e=W),ee!==B.t&&Te(Z,"data-answered",B.t=ee),Se!==B.a&&(Z.disabled=B.a=Se),B},{e:void 0,t:void 0,a:void 0}),Z})()}}),S),S.$$click=()=>U(i().length),d(S,()=>r.t("ui.common.confirm")),be(O=>{var _=u(),M=o.sending;return _!==O.e&&Te(S,"data-active",O.e=_),M!==O.t&&(S.disabled=O.t=M),O},{e:void 0,t:void 0}),I}}),D),d(k,s(P,{get when(){return!u()},get children(){var I=aS(),S=I.firstChild,O=S.nextSibling,_=O.firstChild,M=_.firstChild;return d(S,()=>l()?.question,null),d(S,(()=>{var F=se(()=>!!f());return()=>F()?" "+r.t("ui.question.multiHint"):""})(),null),d(O,s(Ge,{get each(){return c()},children:(F,Z)=>{const B=()=>o.answers[o.tab]?.includes(F.label)??!1;return(()=>{var W=uS(),ee=W.firstChild;return W.$$click=()=>A(Z()),d(ee,()=>F.label),d(W,s(P,{get when(){return F.description},get children(){var Se=Bc();return d(Se,()=>F.description),Se}}),null),d(W,s(P,{get when(){return B()},get children(){return s(Be,{name:"check-small",size:"normal"})}}),null),be(Se=>{var X=B(),ne=o.sending;return X!==Se.e&&Te(W,"data-picked",Se.e=X),ne!==Se.t&&(W.disabled=Se.t=ne),Se},{e:void 0,t:void 0}),W})()}}),_),_.$$click=()=>A(c().length),d(M,()=>r.t("ui.messagePart.option.typeOwnAnswer")),d(_,s(P,{get when(){return se(()=>!o.editing)()&&m()},get children(){var F=Bc();return d(F,m),F}}),null),d(_,s(P,{get when(){return g()},get children(){return s(Be,{name:"check-small",size:"normal"})}}),null),d(O,s(P,{get when(){return o.editing},get children(){var F=oS(),Z=F.firstChild;return F.addEventListener("submit",N),Z.$$input=B=>{const W=[...o.custom];W[o.tab]=B.currentTarget.value,a("custom",W)},ut(B=>setTimeout(()=>B.focus(),0),Z),d(F,s(Ue,{type:"submit",variant:"primary",size:"small",get disabled(){return o.sending},get children(){return se(()=>!!f())()?r.t("ui.common.add"):r.t("ui.common.submit")}}),null),d(F,s(Ue,{type:"button",variant:"ghost",size:"small",get disabled(){return o.sending},onClick:()=>a("editing",!1),get children(){return r.t("ui.common.cancel")}}),null),be(B=>{var W=r.t("ui.question.custom.placeholder"),ee=o.sending;return W!==B.e&&Te(Z,"placeholder",B.e=W),ee!==B.t&&(Z.disabled=B.t=ee),B},{e:void 0,t:void 0}),be(()=>Z.value=m()),F}}),null),be(F=>{var Z=g(),B=o.sending;return Z!==F.e&&Te(_,"data-picked",F.e=Z),B!==F.t&&(_.disabled=F.t=B),F},{e:void 0,t:void 0}),I}}),D),d(k,s(P,{get when(){return u()},get children(){var I=sS(),S=I.firstChild;return d(S,()=>r.t("ui.messagePart.review.title")),d(I,s(Ge,{get each(){return i()},children:(O,_)=>{const M=()=>o.answers[_()]?.join(", ")??"",F=()=>!!M();return(()=>{var Z=dS(),B=Z.firstChild,W=B.nextSibling;return d(B,()=>O.question),d(W,(()=>{var ee=se(()=>!!F());return()=>ee()?M():r.t("ui.question.review.notAnswered")})()),be(()=>Te(W,"data-answered",F())),Z})()}}),null),I}}),D),d(D,s(Ue,{variant:"ghost",size:"small",onClick:v,get disabled(){return o.sending},get children(){return r.t("ui.common.dismiss")}}),null),d(D,s(P,{get when(){return!t()},get children(){return[s(P,{get when(){return u()},get children(){return s(Ue,{variant:"primary",size:"small",onClick:b,get disabled(){return o.sending},get children(){return r.t("ui.common.submit")}})}}),s(P,{get when(){return se(()=>!u())()&&f()},get children(){return s(Ue,{variant:"secondary",size:"small",onClick:()=>U(o.tab+1),get disabled(){return o.sending||(o.answers[o.tab]?.length??0)===0},get children(){return r.t("ui.common.next")}})}})]}}),null),k})()};Ut(["click","input"]);const mS=(e,n)=>e===0?"":`${e} ${n(e>1?"ui.common.question.other":"ui.common.question.one")}`;var gS=$('<div class="absolute inset-x-0 bottom-0 pt-12 pb-4 flex flex-col justify-center items-center z-50 bg-gradient-to-t from-background-stronger via-background-stronger to-transparent pointer-events-none"><div>'),hS=$("<div data-component=tool-part-wrapper data-question=true class=mb-3>"),pS=$('<div class="flex flex-col gap-1 py-2 px-3 max-h-40 overflow-y-auto no-scrollbar">'),vS=$('<div class="text-12-regular text-text-weak pb-2 px-3">'),bS=$("<div data-component=tool-part-wrapper data-permission=true class=mb-3><div data-component=permission-prompt><div data-slot=permission-actions>"),yS=$('<code class="text-12-regular text-text-base break-all">'),$S=$('<div class="w-full min-h-32 md:min-h-40 rounded-md border border-border-weak-base bg-background-base/50 px-4 py-3 text-text-weak whitespace-pre-wrap pointer-events-none">');const _S=e=>e;function wS(e){return(()=>{var n=gS(),r=n.firstChild,i=e.setPromptDockRef;return typeof i=="function"?ut(i,n):e.setPromptDockRef=n,d(r,s(P,{get when(){return e.questionRequest()},keyed:!0,children:t=>{const o=mS(t.questions.length,a=>e.t(a));return(()=>{var a=hS();return d(a,s(jt,{icon:"bubble-5",locked:!0,defaultOpen:!0,get trigger(){return{title:e.t("ui.tool.questions"),subtitle:o}}}),null),d(a,s(fS,{get request(){return _S(t)}}),null),a})()}}),null),d(r,s(P,{get when(){return e.permissionRequest()},keyed:!0,children:t=>(()=>{var o=bS(),a=o.firstChild,l=a.firstChild;return d(o,s(jt,{icon:"checklist",locked:!0,defaultOpen:!0,get trigger(){return{title:e.t("notification.permission.title"),subtitle:t.permission==="doom_loop"?e.t("settings.permissions.tool.doom_loop.title"):t.permission}},get children(){return[s(P,{get when(){return t.patterns.length>0},get children(){var u=pS();return d(u,s(Ge,{get each(){return t.patterns},children:c=>(()=>{var m=yS();return d(m,c),m})()})),u}}),s(P,{get when(){return t.permission==="doom_loop"},get children(){var u=vS();return d(u,()=>e.t("settings.permissions.tool.doom_loop.description")),u}})]}}),a),d(l,s(Ue,{variant:"ghost",size:"small",onClick:()=>e.onDecide("reject"),get disabled(){return e.responding},get children(){return e.t("ui.permission.deny")}}),null),d(l,s(Ue,{variant:"secondary",size:"small",onClick:()=>e.onDecide("always"),get disabled(){return e.responding},get children(){return e.t("ui.permission.allowAlways")}}),null),d(l,s(Ue,{variant:"primary",size:"small",onClick:()=>e.onDecide("once"),get disabled(){return e.responding},get children(){return e.t("ui.permission.allowOnce")}}),null),o})()}),null),d(r,s(P,{get when(){return!e.blocked},get children(){return s(P,{get when(){return e.promptReady},get fallback(){return(()=>{var t=$S();return d(t,()=>e.handoffPrompt||e.t("prompt.loading")),t})()},get children(){return s(rS,{ref(t){var o=e.inputRef;typeof o=="function"?o(t):e.inputRef=t},get newSessionWorktree(){return e.newSessionWorktree},get onNewSessionWorktreeReset(){return e.onNewSessionWorktreeReset},get onSubmit(){return e.onSubmit}})}})}}),null),be(t=>ct(r,{"w-full px-4 pointer-events-auto":!0,"md:max-w-200 md:mx-auto 3xl:max-w-[1200px]":e.centered},t)),n})()}function xS(e){return s(P,{get when(){return e.open},get children(){return s(it,{class:"h-auto",get children(){return s(it.List,{get children(){return[s(it.Trigger,{value:"session",class:"w-1/2",classes:{button:"w-full"},get onClick(){return e.onSession},get children(){return e.t("session.tab.session")}}),s(it.Trigger,{value:"changes",class:"w-1/2 !border-r-0",classes:{button:"w-full"},get onClick(){return e.onChanges},get children(){return s(bt,{get children(){return[s(De,{get when(){return e.hasReview},get children(){return e.t("session.review.filesChanged",{count:e.reviewCount})}}),s(De,{when:!0,get children(){return e.t("session.review.change.other")}})]}})}})]}})}})}})}var kS=$("<span>"),SS=$('<span class="shrink-0 w-4 text-center text-12-medium">'),IS=$('<div class="shrink-0 size-1.5 mr-1.5 rounded-full">'),Wc=$("<div>"),qc=$('<span class="mx-1 font-bold text-text-invert-strong">•'),TS=$('<span class="shrink-0 text-text-invert-strong">Ignored'),CS=$('<div class="flex items-center min-w-0 whitespace-nowrap text-12-regular"><span class="min-w-0 truncate text-text-invert-base"style=direction:rtl;unicode-bidi:plaintext></span><span class="shrink-0 text-text-invert-strong">'),DS=$('<span class="shrink-0 text-text-invert-strong">'),zS=$('<div class="size-4 flex items-center justify-center text-icon-weak">'),ES=$('<div class="w-4 shrink-0">');function OS(e){return`file://${e.split("/").map(r=>encodeURIComponent(r)).join("/")}`}function AS(e){return!(e.level!==0||e.dir?.loaded||e.dir?.loading)}function PS(e){return!(e.level===0||!e.dir?.expanded||e.dir.loaded||e.dir.loading)}function NS(e){return e.level!==0?[]:e.filter?[...e.filter.dirs].filter(n=>!e.expanded(n)):[]}function ya(e){const n=ci(),r=e.level??0,i=()=>e.draggable??!0,t=()=>e.tooltip??!0,o=w(()=>{if(e._filter)return e._filter;const f=e.allowed;if(!f)return;const g=new Set(f),p=new Set;for(const h of f){const b=h.split("/").slice(0,-1);for(const[x]of b.entries()){const R=b.slice(0,x+1).join("/");R&&p.add(R)}}return{files:g,dirs:p}}),a=w(()=>{if(e._marks)return e._marks;const f=new Set;for(const g of e.modified??[])f.add(g);for(const g of e.kinds?.keys()??[])f.add(g);if(f.size!==0)return f}),l=w(()=>e._kinds?e._kinds:e.kinds),u=w(()=>{if(e._deeps)return e._deeps;const f=new Map,g=(p,h)=>{if(!(n.tree.state(p)?.expanded??!1))return-1;const x=n.tree.children(p).reduce((R,U)=>U.type!=="directory"||!(n.tree.state(U.path)?.expanded??!1)?R:Math.max(R,g(U.path,h+1)),h);return f.set(p,x),x};return g(e.path,r-1),f});re(()=>{const f=o(),g=NS({level:r,filter:f,expanded:p=>Ol(()=>n.tree.state(p)?.expanded)??!1});for(const p of g)n.tree.expand(p)}),re(ot(()=>e.path,f=>{const g=Ol(()=>n.tree.state(f));AS({level:r,dir:g})&&n.tree.list(f)},{defer:!1})),re(()=>{const f=n.tree.state(e.path);PS({level:r,dir:f})&&n.tree.list(e.path)});const c=w(()=>{const f=n.tree.children(e.path),g=o();if(!g)return f;const p=x=>{const R=x.lastIndexOf("/");return R===-1?"":x.slice(0,R)},h=x=>{const R=x.lastIndexOf("/");return R===-1?x:x.slice(R+1)},v=f.filter(x=>x.type==="file"?g.files.has(x.path):g.dirs.has(x.path)),b=new Set(v.map(x=>x.path));for(const x of g.dirs)p(x)===e.path&&(b.has(x)||(v.push({name:h(x),path:x,absolute:x,type:"directory",ignored:!1}),b.add(x)));for(const x of g.files)p(x)===e.path&&(b.has(x)||(v.push({name:h(x),path:x,absolute:x,type:"file",ignored:!1}),b.add(x)));return v.toSorted((x,R)=>x.type!==R.type?x.type==="directory"?-1:1:x.name.localeCompare(R.name))}),m=f=>{const[g,p]=Ve(f,["node","as","children","class","classList"]);return s(zn,Ce({get component(){return g.as??"div"},get classList(){return{"w-full min-w-0 h-6 flex items-center justify-start gap-x-1.5 rounded-md px-1.5 py-0 text-left hover:bg-surface-raised-base-hover active:bg-surface-base-active transition-colors cursor-pointer":!0,"bg-surface-base-active":g.node.path===e.active,...g.classList??{},[g.class??""]:!!g.class,[e.nodeClass??""]:!!e.nodeClass}},get style(){return`padding-left: ${Math.max(0,8+r*12-(g.node.type==="file"?24:4))}px`},get draggable(){return i()},onDragStart:h=>{if(!i())return;h.dataTransfer?.setData("text/plain",`file:${g.node.path}`),h.dataTransfer?.setData("text/uri-list",OS(g.node.path)),h.dataTransfer&&(h.dataTransfer.effectAllowed="copy");const v=document.createElement("div");v.className="flex items-center gap-x-2 px-2 py-1 bg-surface-raised-base rounded-md border border-border-base text-12-regular text-text-strong",v.style.position="absolute",v.style.top="-1000px";const b=h.currentTarget.querySelector('[data-component="file-icon"]')??h.currentTarget.querySelector("svg"),x=h.currentTarget.querySelector("span");b&&x&&(v.innerHTML=b.outerHTML+x.outerHTML),document.body.appendChild(v),h.dataTransfer?.setDragImage(v,0,12),setTimeout(()=>document.body.removeChild(v),0)}},p,{get children(){return[se(()=>g.children),se(()=>(()=>{const h=l()?.get(g.node.path),v=a()?.has(g.node.path)??!1,b=!!h&&v&&!g.node.ignored,x=h==="add"?"color: var(--icon-diff-add-base)":h==="del"?"color: var(--icon-diff-delete-base)":h==="mix"?"color: var(--icon-warning-active)":void 0;return(()=>{var R=kS();return d(R,()=>g.node.name),be(U=>{var A={"flex-1 min-w-0 text-12-medium whitespace-nowrap truncate":!0,"text-text-weaker":g.node.ignored,"text-text-weak":!g.node.ignored&&!b},N=b?x:void 0;return U.e=ct(R,A,U.e),U.t=Di(R,N,U.t),U},{e:void 0,t:void 0}),R})()})()),se(()=>(()=>{const h=l()?.get(g.node.path);if(!h||!a()?.has(g.node.path))return null;if(g.node.type==="file"){const v=h==="add"?"A":h==="del"?"D":"M",b=h==="add"?"color: var(--icon-diff-add-base)":h==="del"?"color: var(--icon-diff-delete-base)":"color: var(--icon-warning-active)";return(()=>{var x=SS();return d(x,v),be(R=>Di(x,b,R)),x})()}if(g.node.type==="directory"){const v=h==="add"?"background-color: var(--icon-diff-add-base)":h==="del"?"background-color: var(--icon-diff-delete-base)":"background-color: var(--icon-warning-active)";return(()=>{var b=IS();return be(x=>Di(b,v,x)),b})()}return null})())]}}))};return(()=>{var f=Wc();return d(f,s(Ge,{get each(){return c()},children:g=>{const p=()=>n.tree.state(g.path)?.expanded??!1,h=()=>u().get(g.path)??-1,v=b=>{if(!t())return b.children;const x=g.path.split("/"),R=x[x.length-1]??g.path,U=x.slice(0,-1).join("/"),A=U?`${U}/`:"",N=()=>l()?.get(g.path),k=()=>{const I=N();if(I)return I==="add"?"Additions":I==="del"?"Deletions":"Modifications"},D=()=>g.type==="directory"&&g.ignored;return s(Zt,{openDelay:2e3,placement:"bottom-start",class:"w-full",contentStyle:{"max-width":"480px",width:"fit-content"},get value(){return(()=>{var I=CS(),S=I.firstChild,O=S.nextSibling;return d(S,A),d(O,R),d(I,s(P,{get when(){return k()},children:_=>[qc(),(()=>{var M=DS();return d(M,_),M})()]}),null),d(I,s(P,{get when(){return D()},get children(){return[qc(),TS()]}}),null),I})()},get children(){return b.children}})};return s(bt,{get children(){return[s(De,{get when(){return g.type==="directory"},get children(){return s(Jn,{variant:"ghost",class:"w-full","data-scope":"filetree",forceMount:!1,get open(){return p()},onOpenChange:b=>b?n.tree.expand(g.path):n.tree.collapse(g.path),get children(){return[s(Jn.Trigger,{get children(){return s(v,{get children(){return s(m,{node:g,get children(){var b=zS();return d(b,s(Be,{get name(){return p()?"chevron-down":"chevron-right"},size:"small"})),b}})}})}}),s(Jn.Content,{class:"relative pt-0.5",get children(){return[(()=>{var b=Wc();return be(x=>{var R={"absolute top-0 bottom-0 w-px pointer-events-none bg-border-weak-base opacity-0 transition-opacity duration-150 ease-out motion-reduce:transition-none":!0,"group-hover/filetree:opacity-100":p()&&h()===r,"group-hover/filetree:opacity-50":!(p()&&h()===r)},U=`left: ${Math.max(0,8+r*12-4)+8}px`;return x.e=ct(b,R,x.e),x.t=Di(b,U,x.t),x},{e:void 0,t:void 0}),b})(),s(ya,{get path(){return g.path},level:r+1,get allowed(){return e.allowed},get modified(){return e.modified},get kinds(){return e.kinds},get active(){return e.active},get draggable(){return e.draggable},get tooltip(){return e.tooltip},get onFileClick(){return e.onFileClick},get _filter(){return o()},get _marks(){return a()},get _deeps(){return u()},get _kinds(){return l()}})]}})]}})}}),s(De,{get when(){return g.type==="file"},get children(){return s(v,{get children(){return s(m,{node:g,as:"button",type:"button",onClick:()=>e.onFileClick?.(g),get children(){return[ES(),s(Tr,{node:g,class:"text-icon-weak size-4"})]}})}})}})]}})}})),be(()=>Qn(f,`flex flex-col gap-0.5 ${e.class??""}`)),f})()}const jS=e=>{if(!(e.scrollWidth<=e.prevScrollWidth)){if(!e.prevContextOpen&&e.contextOpen)return 0;if(!(e.scrollWidth<=e.clientWidth))return e.scrollWidth-e.clientWidth}},US=e=>{let n,r=e.el.scrollWidth,i=e.contextOpen();const t=()=>{const u=e.el.scrollWidth,c=e.el.clientWidth,m=e.contextOpen(),f=jS({prevScrollWidth:r,scrollWidth:u,clientWidth:c,prevContextOpen:i,contextOpen:m});f!==void 0&&e.el.scrollTo({left:f,behavior:"smooth"}),r=u,i=m},o=()=>{n!==void 0&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{n=void 0,t()})},a=u=>{Math.abs(u.deltaY)<=Math.abs(u.deltaX)||(e.el.scrollLeft+=u.deltaY>0?50:-50,u.preventDefault())};e.el.addEventListener("wheel",a,{passive:!1});const l=new MutationObserver(o);return l.observe(e.el,{childList:!0}),()=>{e.el.removeEventListener("wheel",a),l.disconnect(),n!==void 0&&cancelAnimationFrame(n)}};var LS=$("<div>"),RS=$('<div class="px-6 py-4 pb-40"><img class=max-w-full>'),MS=$('<div class="flex justify-center pb-40"><img class="max-w-full max-h-96">'),FS=$('<div class="flex flex-col gap-4 px-6 py-4">'),ZS=$('<div class="h-full px-6 pb-42 flex flex-col items-center justify-center text-center gap-6"><div class="flex flex-col gap-2 max-w-md"><div class="text-14-semibold text-text-strong truncate"></div><div class="text-14-regular text-text-weak">'),BS=$('<div class="px-6 py-4 text-text-weak">...'),WS=$('<div class="px-6 py-4 text-text-weak">');function qS(e){let n,r,i,t=[];const o=w(()=>e.file.pathFromTab(e.tab)),a=w(()=>{const C=o();if(C)return e.file.get(C)}),l=w(()=>a()?.content?.content??""),u=w(()=>Ir(l())),c=w(()=>{const C=a()?.content;return C?.encoding==="base64"&&C?.mimeType?.startsWith("image/")&&C?.mimeType!=="image/svg+xml"}),m=w(()=>a()?.content?.mimeType==="image/svg+xml"),f=w(()=>a()?.content?.mimeType?.startsWith("application/")||!1),g=w(()=>{if(!m())return;const C=a()?.content;if(C)return C.encoding!=="base64"?C.content:wa(C.content)}),p=w(()=>{if(!m())return!1;const C=a()?.content;return!C||C.encoding!=="base64"?!1:g()===void 0}),h={shown:!1};re(()=>{p()&&(h.shown||(h.shown=!0,lt({variant:"error",title:e.language.t("toast.file.loadFailed.title"),description:"Invalid base64 content."})))});const v=w(()=>{if(!m())return;const C=a()?.content;if(C)return C.encoding==="base64"?`data:image/svg+xml;base64,${C.content}`:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(C.content)}`}),b=w(()=>{if(!c())return;const C=a()?.content;return`data:${C?.mimeType};base64,${C?.content}`}),x=w(()=>{const C=o();return C?e.file.ready()?e.file.selectedLines(C)??null:e.handoffFiles()?.[C]??null:null});let R;const U=w(()=>{const C=o();return C?e.comments.list(C):[]}),A=w(()=>U().map(C=>C.selection)),[N,k]=It({openedComment:null,commenting:null,draft:"",positions:{},draftTop:void 0}),D=()=>N.openedComment,I=C=>k("openedComment",C),S=()=>N.commenting,O=C=>k("commenting",C),_=()=>N.draft,M=C=>k("draft",C),F=()=>N.positions,Z=C=>k("positions",C),B=()=>N.draftTop,W=C=>k("draftTop",C),ee=C=>{const q=Math.min(C.start,C.end),ie=Math.max(C.start,C.end);return q===ie?`line ${q}`:`lines ${q}-${ie}`},Se=()=>{const C=R;if(!C)return;const q=C.querySelector("diffs-container");if(!(q instanceof HTMLElement))return;const ie=q.shadowRoot;if(ie)return ie},X=(C,q)=>{const ie=Math.max(q.start,q.end),_e=C.querySelector(`[data-line="${ie}"]`);if(_e instanceof HTMLElement)return _e},ne=(C,q)=>{const ie=C.getBoundingClientRect(),_e=q.getBoundingClientRect();return _e.top-ie.top+Math.max(0,(_e.height-20)/2)},ce=()=>{const C=R,q=Se();if(!C||!q){Z({}),W(void 0);return}const ie={};for(const Ae of U()){const We=X(q,Ae.selection);We&&(ie[Ae.id]=ne(C,We))}Z(ie);const _e=S();if(!_e){W(void 0);return}const ge=X(q,_e);if(!ge){W(void 0);return}W(ne(C,ge))},fe=()=>{requestAnimationFrame(ce)};re(()=>{U(),fe()}),re(()=>{const C=S();fe(),C&&M("")}),re(()=>{const C=e.comments.focus(),q=o();if(!C||!q||C.file!==q||e.activeTab()!==e.tab)return;const ie=U().find(_e=>_e.id===C.id);ie&&(I(ie.id),O(null),e.file.setSelectedLines(q,ie.selection),requestAnimationFrame(()=>e.comments.clearFocus()))});const me=()=>{const C=n;if(!C)return[];const q=C.querySelector("diffs-container");if(!(q instanceof HTMLElement))return[];const ie=q.shadowRoot;return ie?Array.from(ie.querySelectorAll("[data-code]")).filter(_e=>_e instanceof HTMLElement&&_e.clientWidth>0):[]},V=C=>{i=C,r===void 0&&(r=requestAnimationFrame(()=>{r=void 0;const q=i;i=void 0,q&&e.view().setScroll(e.tab,q)}))},z=C=>{const q=n;if(!q)return;const ie=C.currentTarget;ie instanceof HTMLElement&&V({x:ie.scrollLeft,y:q.scrollTop})},H=()=>{const C=me();if(!(C.length===t.length&&C.every((q,ie)=>q===t[ie]))){for(const q of t)q.removeEventListener("scroll",z);t=C;for(const q of t)q.addEventListener("scroll",z)}},$e=()=>{const C=n;if(!C)return;const q=e.view()?.scroll(e.tab);if(q){if(H(),t.length>0)for(const ie of t)ie.scrollLeft!==q.x&&(ie.scrollLeft=q.x);C.scrollTop!==q.y&&(C.scrollTop=q.y),!(t.length>0)&&C.scrollLeft!==q.x&&(C.scrollLeft=q.x)}},te=C=>{t.length===0&&H(),V({x:t[0]?.scrollLeft??C.currentTarget.scrollLeft,y:C.currentTarget.scrollTop})};re(ot(()=>a()?.loaded,C=>{C&&requestAnimationFrame($e)},{defer:!0})),re(ot(()=>e.file.ready(),C=>{C&&requestAnimationFrame($e)},{defer:!0})),re(ot(()=>e.tabs().active()===e.tab,C=>{C&&a()?.loaded&&requestAnimationFrame($e)})),rt(()=>{for(const C of t)C.removeEventListener("scroll",z);r!==void 0&&cancelAnimationFrame(r)});const he=(C,q)=>(()=>{var ie=LS();return ut(_e=>{R=_e,fe()},ie),Qn(ie,`relative overflow-hidden ${q}`),d(ie,s(zn,{get component(){return e.codeComponent},get file(){return{name:o()??"",contents:C,cacheKey:u()}},enableLineSelection:!0,get selectedLines(){return x()},get commentedLines(){return A()},onRendered:()=>{requestAnimationFrame($e),requestAnimationFrame(fe)},onLineSelected:_e=>{const ge=o();ge&&(e.file.setSelectedLines(ge,_e),_e||O(null))},onLineSelectionEnd:_e=>{if(!_e){O(null);return}I(null),O(_e)},overflow:"scroll",class:"select-text"}),null),d(ie,s(Ge,{get each(){return U()},children:_e=>s(nd,{get id(){return _e.id},get top(){return F()[_e.id]},get open(){return D()===_e.id},get comment(){return _e.comment},get selection(){return ee(_e.selection)},onMouseEnter:()=>{const ge=o();ge&&e.file.setSelectedLines(ge,_e.selection)},onClick:()=>{const ge=o();ge&&(O(null),I(Ae=>Ae===_e.id?null:_e.id),e.file.setSelectedLines(ge,_e.selection))}})}),null),d(ie,s(P,{get when(){return S()},children:_e=>s(P,{get when(){return B()!==void 0},get children(){return s(rd,{get top(){return B()},get value(){return _()},get selection(){return ee(_e())},onInput:ge=>M(ge),onCancel:()=>O(null),onSubmit:ge=>{const Ae=o();Ae&&(e.addCommentToContext({file:Ae,selection:_e(),comment:ge,origin:"file"}),O(null))},onPopoverFocusOut:ge=>{const Ae=ge.currentTarget,We=ge.relatedTarget;We instanceof Node&&Ae.contains(We)||setTimeout(()=>{(!document.activeElement||!Ae.contains(document.activeElement))&&O(null)},0)}})}})}),null),ie})();return s(it.Content,{get value(){return e.tab},class:"mt-3 relative",ref:C=>{n=C,$e()},onScroll:te,get children(){return s(bt,{get children(){return[s(De,{get when(){return se(()=>!!a()?.loaded)()&&c()},get children(){var C=RS(),q=C.firstChild;return q.addEventListener("load",()=>requestAnimationFrame($e)),be(ie=>{var _e=b(),ge=o();return _e!==ie.e&&Te(q,"src",ie.e=_e),ge!==ie.t&&Te(q,"alt",ie.t=ge),ie},{e:void 0,t:void 0}),C}}),s(De,{get when(){return se(()=>!!a()?.loaded)()&&m()},get children(){var C=FS();return d(C,()=>he(g()??"",""),null),d(C,s(P,{get when(){return v()},get children(){var q=MS(),ie=q.firstChild;return be(_e=>{var ge=v(),Ae=o();return ge!==_e.e&&Te(ie,"src",_e.e=ge),Ae!==_e.t&&Te(ie,"alt",_e.t=Ae),_e},{e:void 0,t:void 0}),q}}),null),C}}),s(De,{get when(){return se(()=>!!a()?.loaded)()&&f()},get children(){var C=ZS(),q=C.firstChild,ie=q.firstChild,_e=ie.nextSibling;return d(C,s(qi,{class:"w-14 opacity-10"}),q),d(ie,()=>o()?.split("/").pop()),d(_e,()=>e.language.t("session.files.binaryContent")),C}}),s(De,{get when(){return a()?.loaded},get children(){return he(l(),"pb-40")}}),s(De,{get when(){return a()?.loading},get children(){var C=BS(),q=C.firstChild;return d(C,()=>e.language.t("common.loading"),q),C}}),s(De,{get when(){return a()?.error},children:C=>(()=>{var q=WS();return d(q,C),q})()})]}})}})}var HS=$('<div class="flex-1 min-w-0 h-full">'),GS=$('<div class="mt-8 text-center text-12-regular text-text-weak">'),KS=$('<div id=file-tree-panel class="relative shrink-0 h-full"><div class="h-full flex flex-col overflow-hidden group/filetree">'),VS=$('<aside id=review-panel class="relative min-w-0 h-full border-l border-border-weak-base flex">'),JS=$('<div class="text-12-medium text-text-strong h-4 px-2 flex flex-col items-center justify-center rounded-full bg-surface-base">'),XS=$('<div class="flex items-center gap-1.5"><div>'),YS=$('<div class="flex items-center gap-2"><div>'),QS=$('<div class="sticky top-0 shrink-0 flex">'),eI=$('<div class="relative pt-2 flex-1 min-h-0 overflow-hidden"><div class="h-full px-6 pb-42 flex flex-col items-center justify-center text-center gap-6"><div class="text-14-regular text-text-weak max-w-56">'),tI=$('<div class="relative pt-2 flex-1 min-h-0 overflow-hidden">'),nI=$('<div class="relative px-6 h-12 flex items-center bg-background-stronger border-x border-border-weak-base border-b border-b-transparent">'),rI=$('<div class="px-2 py-2 text-12-regular text-text-weak">');function iI(e){return s(P,{get when(){return e.open},get children(){var n=VS();return d(n,s(P,{get when(){return e.reviewOpen},get children(){var r=HS();return d(r,s(P,{get when(){return se(()=>!!e.layout.fileTree.opened())()&&e.fileTreeTab()==="changes"},get fallback(){return s(lu,{get onDragStart(){return e.onDragStart},get onDragEnd(){return e.onDragEnd},get onDragOver(){return e.onDragOver},collisionDetector:cu,get children(){return[s(uu,{}),s(du,{}),s(it,{get value(){return e.activeTab()},get onChange(){return e.openTab},get children(){return[(()=>{var i=QS();return d(i,s(it.List,{ref:t=>{const o=US({el:t,contextOpen:e.contextOpen});rt(o)},get children(){return[s(P,{get when(){return e.reviewTab},get children(){return s(it.Trigger,{value:"review",classes:{button:"!pl-6"},get children(){var t=XS(),o=t.firstChild;return d(o,()=>e.language.t("session.tab.review")),d(t,s(P,{get when(){return e.hasReview},get children(){var a=JS();return d(a,()=>e.reviewCount),a}}),null),t}})}}),s(P,{get when(){return e.contextOpen()},get children(){return s(it.Trigger,{value:"context",get closeButton(){return s(Zt,{get value(){return e.language.t("common.closeTab")},placement:"bottom",get children(){return s(zt,{icon:"close-small",variant:"ghost",class:"h-5 w-5",onClick:()=>e.tabs().close("context"),get"aria-label"(){return e.language.t("common.closeTab")}})}})},hideCloseButton:!0,onMiddleClick:()=>e.tabs().close("context"),get children(){var t=YS(),o=t.firstChild;return d(t,s(Cd,{variant:"indicator"}),o),d(o,()=>e.language.t("session.tab.context")),t}})}}),s(fu,{get ids(){return e.openedTabs()},get children(){return s(Ge,{get each(){return e.openedTabs()},children:t=>s(eb,{tab:t,get onTabClose(){return e.tabs().close}})})}}),s(Bb,{get children(){return s(mn,{get title(){return e.language.t("command.file.open")},get keybind(){return e.command.keybind("file.open")},class:"flex items-center",get children(){return s(zt,{icon:"plus-small",variant:"ghost",iconSize:"large",onClick:()=>e.dialog.show(()=>s(xd,{mode:"files",get onOpenFile(){return e.showAllFiles}})),get"aria-label"(){return e.language.t("command.file.open")}})}})}})]}})),i})(),s(P,{get when(){return e.reviewTab},get children(){return s(it.Content,{value:"review",class:"flex flex-col h-full overflow-hidden contain-strict",get children(){return s(P,{get when(){return e.activeTab()==="review"},get children(){return e.reviewPanel()}})}})}}),s(it.Content,{value:"empty",class:"flex flex-col h-full overflow-hidden contain-strict",get children(){return s(P,{get when(){return e.activeTab()==="empty"},get children(){var i=eI(),t=i.firstChild,o=t.firstChild;return d(t,s(qi,{class:"w-14 opacity-10"}),o),d(o,()=>e.language.t("session.files.selectToOpen")),i}})}}),s(P,{get when(){return e.contextOpen()},get children(){return s(it.Content,{value:"context",class:"flex flex-col h-full overflow-hidden contain-strict",get children(){return s(P,{get when(){return e.activeTab()==="context"},get children(){var i=tI();return d(i,s(X0,{get messages(){return e.messages},get visibleUserMessages(){return e.visibleUserMessages},get view(){return e.view},get info(){return e.info}})),i}})}})}}),s(P,{get when(){return e.activeFileTab()},keyed:!0,children:i=>s(qS,{tab:i,get activeTab(){return e.activeTab},get tabs(){return e.tabs},get view(){return e.view},get handoffFiles(){return e.handoffFiles},get file(){return e.file},get comments(){return e.comments},get language(){return e.language},get codeComponent(){return e.codeComponent},get addCommentToContext(){return e.addCommentToContext}})})]}}),s(mu,{get children(){return s(P,{get when(){return e.activeDraggable()},children:i=>{const t=w(()=>e.file.pathFromTab(i()));return(()=>{var o=nI();return d(o,s(P,{get when(){return t()},children:a=>s(Gu,{active:!0,get path(){return a()}})})),o})()}})}})]}})},get children(){return e.reviewPanel()}})),r}}),null),d(n,s(P,{get when(){return e.layout.fileTree.opened()},get children(){var r=KS(),i=r.firstChild;return d(i,s(it,{variant:"pill",get value(){return e.fileTreeTab()},get onChange(){return e.setFileTreeTabValue},class:"h-full","data-scope":"filetree",get children(){return[s(it.List,{get children(){return[s(it.Trigger,{value:"changes",class:"flex-1",classes:{button:"w-full"},get children(){return[se(()=>e.reviewCount)," ",se(()=>e.language.t(e.reviewCount===1?"session.review.change.one":"session.review.change.other"))]}}),s(it.Trigger,{value:"all",class:"flex-1",classes:{button:"w-full"},get children(){return e.language.t("session.files.all")}})]}}),s(it.Content,{value:"changes",class:"bg-background-base px-3 py-0",get children(){return s(bt,{get children(){return[s(De,{get when(){return e.hasReview},get children(){return s(P,{get when(){return e.diffsReady},get fallback(){return(()=>{var t=rI();return d(t,()=>e.language.t("common.loading"),null),d(t,()=>e.language.t("common.loading.ellipsis"),null),t})()},get children(){return s(ya,{path:"",get allowed(){return e.diffFiles},get kinds(){return e.kinds},draggable:!1,get active(){return e.activeDiff},onFileClick:t=>e.focusReviewDiff(t.path)})}})}}),s(De,{when:!0,get children(){var t=GS();return d(t,()=>e.language.t("session.review.noChanges")),t}})]}})}}),s(it.Content,{value:"all",class:"bg-background-base px-3 py-0",get children(){return s(ya,{path:"",get modified(){return e.diffFiles},get kinds(){return e.kinds},onFileClick:t=>e.openTab(e.file.tab(t.path))})}})]}})),d(r,s(Ia,{direction:"horizontal",edge:"start",get size(){return e.layout.fileTree.width()},min:200,max:480,collapseThreshold:160,get onResize(){return e.layout.fileTree.resize},get onCollapse(){return e.layout.fileTree.close}}),null),be(t=>{var o=`${e.layout.fileTree.width()}px`,a={"border-l border-border-weak-base":e.reviewOpen};return o!==t.e&&Xt(r,"width",t.e=o),t.t=ct(i,a,t.t),t},{e:void 0,t:void 0}),r}}),null),be(r=>{var i=e.language.t("session.panel.reviewAndFiles"),t=!!e.reviewOpen,o=!e.reviewOpen,a=e.reviewOpen?void 0:`${e.layout.fileTree.width()}px`;return i!==r.e&&Te(n,"aria-label",r.e=i),t!==r.t&&n.classList.toggle("flex-1",r.t=t),o!==r.a&&n.classList.toggle("shrink-0",r.a=o),a!==r.o&&Xt(n,"width",r.o=a),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n}})}const Hc=e=>{const r=(e.startsWith("#")?e.slice(1):e).match(/^message-(.+)$/);if(r)return r[1]},oI=e=>{const n=()=>{window.location.hash&&window.history.replaceState(null,"",window.location.href.replace(/#.*$/,""))},r=a=>{window.history.replaceState(null,"",`#${e.anchor(a)}`)},i=(a,l)=>{const u=e.scroller();if(!u)return!1;const c=a.getBoundingClientRect(),m=u.getBoundingClientRect(),f=c.top-m.top+u.scrollTop;return u.scrollTo({top:f,behavior:l}),!0},t=(a,l="smooth")=>{e.setActiveMessage(a);const c=e.visibleUserMessages().findIndex(f=>f.id===a.id);if(c!==-1&&c<e.turnStart()){e.setTurnStart(c),e.scheduleTurnBackfill(),requestAnimationFrame(()=>{const f=document.getElementById(e.anchor(a.id));if(!f){requestAnimationFrame(()=>{const g=document.getElementById(e.anchor(a.id));g&&i(g,l)});return}i(f,l)}),r(a.id);return}const m=document.getElementById(e.anchor(a.id));if(!m){r(a.id),requestAnimationFrame(()=>{const f=document.getElementById(e.anchor(a.id));f&&i(f,l)});return}if(i(m,l)){r(a.id);return}requestAnimationFrame(()=>{const f=document.getElementById(e.anchor(a.id));f&&i(f,l)}),r(a.id)},o=a=>{const l=window.location.hash.slice(1);if(!l){e.autoScroll.forceScrollToBottom();const f=e.scroller();f&&e.scheduleScrollState(f);return}const u=Hc(l);if(u){e.autoScroll.pause();const f=e.visibleUserMessages().find(g=>g.id===u);if(f){t(f,a);return}return}const c=document.getElementById(l);if(c){e.autoScroll.pause(),i(c,a);return}e.autoScroll.forceScrollToBottom();const m=e.scroller();m&&e.scheduleScrollState(m)};return re(ot(e.sessionKey,a=>{if(!e.sessionID())return;const l=e.consumePendingMessage(a);l&&e.setPendingMessage(l)})),re(()=>{!e.sessionID()||!e.messagesReady()||requestAnimationFrame(()=>o("auto"))}),re(()=>{if(!e.sessionID()||!e.messagesReady())return;e.visibleUserMessages().length,e.turnStart();const a=e.pendingMessage()??Hc(window.location.hash);if(!a||e.currentMessageId()===a)return;const l=e.visibleUserMessages().find(u=>u.id===a);l&&(e.pendingMessage()===a&&e.setPendingMessage(void 0),e.autoScroll.pause(),requestAnimationFrame(()=>t(l,"auto")))}),re(()=>{if(!e.sessionID()||!e.messagesReady())return;const a=()=>requestAnimationFrame(()=>o("auto"));window.addEventListener("hashchange",a),rt(()=>window.removeEventListener("hashchange",a))}),{clearMessageHash:n,scrollToMessage:t,applyHash:o}};var aI=$('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span></div><div class="flex justify-end gap-2">'),sI=$('<div class="h-full pb-30 flex flex-col items-center justify-center text-center gap-6"><div class="text-14-regular text-text-weak max-w-56">'),lI=$('<div><div class="text-14-regular text-text-weak max-w-56">'),cI=$("<div>"),uI=$('<div class="flex flex-col h-full overflow-hidden bg-background-stronger contain-strict"><div class="relative pt-2 flex-1 min-h-0 overflow-hidden">'),dI=$('<div class="relative bg-background-base size-full overflow-hidden flex flex-col"><div class="flex-1 min-h-0 flex flex-col md:flex-row"><div><div class="flex-1 min-h-0 overflow-hidden">');const fI=40,pr={session:new Map,terminal:new Map},mp=(e,n,r)=>{for(e.delete(n),e.set(n,r);e.size>fI;){const i=e.keys().next().value;if(i===void 0)return;e.delete(i)}},Gc=(e,n)=>{const r=pr.session.get(e)??{prompt:"",files:{}};mp(pr.session,e,{...r,...n})};function gI(){const e=Sr(),n=Dr(),r=ci(),i=_n(),t=tu(),o=wn(),a=gu(),l=li(),u=wt(),c=Bn(),m=si(),f=Dn(),g=di(),p=vu(),h=bu(),v=w(()=>{const y=c.id;if(y)return i.data.permission[y]?.[0]}),b=w(()=>{const y=c.id;if(y)return i.data.question[y]?.[0]}),x=w(()=>!!v()||!!b()),[R,U]=It({responding:!1,pendingMessage:void 0,scrollGesture:0,autoCreated:!1,scroll:{overflow:!1,bottom:!0}});re(ot(()=>v()?.id,()=>U("responding",!1),{defer:!0}));const A=y=>{const j=v();j&&(R.responding||(U("responding",!0),f.client.permission.respond({sessionID:j.sessionID,permissionID:j.id,response:y}).catch(Y=>{const pe=Y instanceof Error?Y.message:String(Y);lt({title:u.t("common.requestFailed"),description:pe})}).finally(()=>U("responding",!1))))},N=w(()=>`${c.dir}${c.id?"/"+c.id:""}`),k=w(()=>c.dir??""),D=w(()=>e.tabs(k)),I=w(()=>e.tabs(N)),S=w(()=>e.view(N));re(ot(()=>c.id,(y,j)=>{if(!y||j)return;const Y=e.handoff.tabs();if(!Y)return;if(Date.now()-Y.at>6e4){e.handoff.clearTabs();return}if(Y.id!==y||(e.handoff.clearTabs(),Y.dir!==(c.dir??"")))return;const pe=D().tabs();if(pe.all.length===0&&!pe.active)return;const de=I().tabs();if(de.all.length>0||de.active)return;const Ze=ee(pe.all),tt=pe.active?W(pe.active):void 0;I().setAll(Ze),I().setActive(tt&&Ze.includes(tt)?tt:Ze[0]),D().setAll([]),D().setActive(void 0)},{defer:!0}));const O=uv("(min-width: 768px)"),_=w(()=>O()&&S().reviewPanel.opened()),M=w(()=>O()&&e.fileTree.opened()),F=w(()=>_()||M()),Z=w(()=>F()?_()?`${e.session.width()}px`:`calc(100% - ${e.fileTree.width()}px)`:"100%"),B=w(()=>O()&&!F());function W(y){return y.startsWith("file://")?r.tab(y):y}function ee(y){const j=new Set,Y=[];for(const pe of y){const de=W(pe);j.has(de)||(j.add(de),Y.push(de))}return Y}const Se=()=>{S().reviewPanel.opened()||S().reviewPanel.open()},X=y=>{const j=W(y);I().open(j);const Y=r.pathFromTab(j);Y&&(r.load(Y),Se())};re(()=>{const y=I().active();if(!y)return;const j=r.pathFromTab(y);j&&r.load(j)}),re(()=>{const y=I().all();if(y.length===0)return;const j=ee(y);if(Ur(y,j))return;I().setAll(j);const Y=I().active();if(!Y||!Y.startsWith("file://"))return;const pe=W(Y);Y!==pe&&I().setActive(pe)});const ne=w(()=>c.id?i.session.get(c.id):void 0),ce=w(()=>c.id?i.data.session_diff[c.id]??[]:[]),fe=w(()=>Math.max(ne()?.summary?.files??0,ce().length)),me=w(()=>fe()>0),V=w(()=>ne()?.revert?.messageID),z=w(()=>c.id?i.data.message[c.id]??[]:[]),H=w(()=>{const y=c.id;return y?i.data.message[y]!==void 0:!0}),$e=w(()=>{const y=c.id;return y?i.session.history.more(y):!1}),te=w(()=>{const y=c.id;return y?i.session.history.loading(y):!1}),[he,C]=It({draft:"",editing:!1,saving:!1,menuOpen:!1,pendingRename:!1});let q;const ie=y=>{if(y&&typeof y=="object"&&"data"in y){const j=y.data;if(j?.message)return j.message}return y instanceof Error?y.message:u.t("common.requestFailed")};re(ot(N,()=>C({draft:"",editing:!1,saving:!1,menuOpen:!1,pendingRename:!1}),{defer:!0}));const _e=()=>{c.id&&(C({editing:!0,draft:ne()?.title??""}),requestAnimationFrame(()=>{q?.focus(),q?.select()}))},ge=()=>{he.saving||C({editing:!1,saving:!1})},Ae=async()=>{const y=c.id;if(!y||he.saving)return;const j=he.draft.trim();if(!j||j===(ne()?.title??"")){C({editing:!1,saving:!1});return}C("saving",!0),await f.client.session.update({sessionID:y,title:j}).then(()=>{i.set(Uo(Y=>{const pe=Y.session.findIndex(de=>de.id===y);pe!==-1&&(Y.session[pe].title=j)})),C({editing:!1,saving:!1})}).catch(Y=>{C("saving",!1),lt({title:u.t("common.requestFailed"),description:ie(Y)})})};async function We(y){const j=i.session.get(y);if(!j)return;const Y=i.data.session??[],pe=Y.findIndex(Ze=>Ze.id===y),de=pe===-1?void 0:Y[pe+1]??Y[pe-1];await f.client.session.update({sessionID:y,time:{archived:Date.now()}}).then(()=>{if(i.set(Uo(Ze=>{const tt=Ze.session.findIndex(dn=>dn.id===y);tt!==-1&&Ze.session.splice(tt,1)})),c.id===y){if(j.parentID){m(`/${c.dir}/session/${j.parentID}`);return}if(de){m(`/${c.dir}/session/${de.id}`);return}m(`/${c.dir}/session`)}}).catch(Ze=>{lt({title:u.t("common.requestFailed"),description:ie(Ze)})})}async function mt(y){const j=i.session.get(y);if(!j)return!1;const Y=(i.data.session??[]).filter(tt=>!tt.parentID&&!tt.time?.archived),pe=Y.findIndex(tt=>tt.id===y),de=pe===-1?void 0:Y[pe+1]??Y[pe-1];return await f.client.session.delete({sessionID:y}).then(tt=>tt.data).catch(tt=>(lt({title:u.t("session.delete.failed.title"),description:ie(tt)}),!1))?(i.set(Uo(tt=>{const dn=new Set([y]),dr=new Map;for(const sn of tt.session){const fr=sn.parentID;if(!fr)continue;const mr=dr.get(fr);if(mr){mr.push(sn.id);continue}dr.set(fr,[sn.id])}const jr=[y];for(;jr.length;){const sn=jr.pop();if(!sn)continue;const fr=dr.get(sn);if(fr)for(const mr of fr)dn.has(mr)||(dn.add(mr),jr.push(mr))}tt.session=tt.session.filter(sn=>!dn.has(sn.id))})),c.id!==y?!0:j.parentID?(m(`/${c.dir}/session/${j.parentID}`),!0):de?(m(`/${c.dir}/session/${de.id}`),!0):(m(`/${c.dir}/session`),!0)):!1}function yt(y){const j=w(()=>i.session.get(y.sessionID)?.title??u.t("command.session.new")),Y=async()=>{await mt(y.sessionID),o.close()};return s(sr,{get title(){return u.t("session.delete.title")},fit:!0,get children(){var pe=aI(),de=pe.firstChild,Ze=de.firstChild,tt=de.nextSibling;return d(Ze,()=>u.t("session.delete.confirm",{name:j()})),d(tt,s(Ue,{variant:"ghost",size:"large",onClick:()=>o.close(),get children(){return u.t("common.cancel")}}),null),d(tt,s(Ue,{variant:"primary",size:"large",onClick:Y,get children(){return u.t("session.delete.button")}}),null),pe}})}const kt=[],dt=w(()=>z().filter(y=>y.role==="user"),kt,{equals:Ur}),G=w(()=>{const y=V();return y?dt().filter(j=>j.id<y):dt()},kt,{equals:Ur}),ue=w(()=>G().at(-1));re(ot(()=>ue()?.id,()=>{const y=ue();y&&(y.agent&&n.agent.set(y.agent),y.model&&n.model.set(y.model))}));const[ye,ke]=It({activeDraggable:void 0,activeTerminalDraggable:void 0,expanded:{},messageId:void 0,turnStart:0,mobileTab:"session",changes:"session",newSessionWorktree:"main",promptHeight:0}),Pe=w(()=>ue()?.summary?.diffs??[]),He=w(()=>ye.changes==="session"?ce():Pe()),et=w(()=>{const y=G(),j=ye.turnStart;return j<=0?y:j>=y.length?kt:y.slice(j)},kt,{equals:Ur}),Q=w(()=>{if(ye.newSessionWorktree==="create")return"create";const y=i.project;return y&&i.data.path.directory!==y.worktree?i.data.path.directory:"main"}),we=w(()=>ye.messageId?G()?.find(j=>j.id===ye.messageId)??ue():ue()),Re=y=>{ke("messageId",y?.id)};function je(y){const j=G();if(j.length===0)return;const Y=we(),pe=Y?j.findIndex(Ze=>Ze.id===Y.id):-1,de=pe===-1?y>0?0:j.length-1:pe+y;if(!(de<0||de>=j.length)){if(de===j.length-1){Po();return}jn.pause(),vp(j[de],"auto")}}const pt=w(()=>{const y=(pe,de)=>pe?pe===de?pe:"mix":de,j=pe=>pe.replaceAll("\\\\","/").replace(/\/+$/,""),Y=new Map;for(const pe of ce()){const de=j(pe.file),Ze=pe.before.length===0,tt=pe.after.length===0,dn=Ze&&!tt?"add":tt&&!Ze?"del":"mix";Y.set(de,dn);const dr=de.split("/");for(const[jr]of dr.slice(0,-1).entries()){const sn=dr.slice(0,jr+1).join("/");sn&&Y.set(sn,y(Y.get(sn),dn))}}return Y}),Et=w(()=>ce().map(y=>y.file),[],{equals:Ur}),Lt=w(()=>{const y=c.id;return!y||!me()?!0:i.data.session_diff[y]!==void 0}),bn={type:"idle"};let en,xn,tn,E;const K=250,ae=y=>{const j=tn;if(!j)return;const pe=(y instanceof Element?y:void 0)?.closest("[data-scrollable]");pe&&pe!==j||U("scrollGesture",Date.now())},xe=()=>Date.now()-R.scrollGesture<K;re(()=>{f.directory;const y=c.id;y&&i.session.sync(y)}),re(()=>{if(!S().terminal.opened()){U("autoCreated",!1);return}!t.ready()||t.all().length!==0||R.autoCreated||(t.new(),U("autoCreated",!0))}),re(ot(()=>t.all().length,(y,j)=>{j!==void 0&&j>0&&y===0&&S().terminal.opened()&&S().terminal.toggle()})),re(ot(()=>t.active(),y=>{!y||!S().terminal.opened()||(document.activeElement instanceof HTMLElement&&document.activeElement.blur(),ic(y))})),re(ot(()=>G().at(-1)?.id,(y,j)=>{y&&j&&y>j&&ke("messageId",void 0)},{defer:!0}));const Ye=w(()=>i.data.session_status[c.id??""]??bn);re(ot(N,()=>{ke("messageId",void 0),ke("expanded",{}),ke("changes","session"),U("autoCreated",!1)},{defer:!0})),re(ot(()=>c.dir,y=>{y&&ke("newSessionWorktree","main")},{defer:!0})),re(()=>{const y=ue()?.id;y&&ke("expanded",y,Ye().type!=="idle")});const nt=(y,j)=>{const Y=r.get(y)?.content?.content;if(!Y)return;const pe=Math.max(1,Math.min(j.startLine,j.endLine)),de=Math.max(j.startLine,j.endLine),Ze=Y.split(`
|
|
40
|
+
`).slice(pe-1,de);if(Ze.length!==0)return Ze.slice(0,2).join(`
|
|
41
|
+
`)},Ee=(y,j)=>{const Y=nt(y,j);g.context.add({type:"file",path:y,selection:j,preview:Y})},Ne=y=>{const j=$u(y.selection),Y=y.preview??nt(y.file,j),pe=p.add({file:y.file,selection:y.selection,comment:y.comment});g.context.add({type:"file",path:y.file,selection:j,comment:y.comment,commentID:pe.id,commentOrigin:y.origin,preview:Y})},Me=y=>{const j=document.activeElement;if(j){const Y=j.closest("[data-prevent-autofocus]"),pe=/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(j.tagName)||j.isContentEditable;if(Y||pe)return}if(!o.active){if(j===en){y.key==="Escape"&&en?.blur();return}if(!S().terminal.opened()){if(y.key==="PageUp"||y.key==="PageDown"||y.key==="Home"||y.key==="End"){ae();return}if(y.key.length===1&&y.key!=="Unidentified"&&!(y.ctrlKey||y.metaKey)){if(x())return;en?.focus()}}}},Le=y=>{const j=Al(y);j&&ke("activeDraggable",j)},ve=y=>{const{draggable:j,droppable:Y}=y;if(j&&Y){const pe=I().all(),de=pe?.indexOf(j.id.toString()),Ze=pe?.indexOf(Y.id.toString());de!==Ze&&Ze!==void 0&&I().move(j.id.toString(),Ze)}},vt=()=>{ke("activeDraggable",void 0)},Kt=y=>{const j=Al(y);j&&ke("activeTerminalDraggable",j)},On=y=>{const{draggable:j,droppable:Y}=y;if(j&&Y){const pe=t.all(),de=pe.findIndex(tt=>tt.id===j.id.toString()),Ze=pe.findIndex(tt=>tt.id===Y.id.toString());de!==-1&&Ze!==-1&&de!==Ze&&t.move(j.id.toString(),Ze)}},Rt=()=>{ke("activeTerminalDraggable",void 0);const y=t.active();y&&setTimeout(()=>{ic(y)},0)},nn=w(()=>I().active()==="context"||I().all().includes("context")),An=w(()=>I().all().filter(y=>y!=="context"&&y!=="review")),Si=w(()=>!O()&&ye.mobileTab==="changes"),Pn=w(()=>O()&&!e.fileTree.opened()),kn=()=>e.fileTree.tab(),rn=y=>e.fileTree.setTab(y),[on,Sn]=It({reviewScroll:void 0,pendingDiff:void 0,activeDiff:void 0});re(ot(N,()=>{Sn({reviewScroll:void 0,pendingDiff:void 0,activeDiff:void 0})},{defer:!0}));const Gn=()=>{kn()==="changes"&&rn("all")};S$({command:l,dialog:o,file:r,language:u,local:n,permission:h,prompt:g,sdk:f,sync:i,terminal:t,layout:e,params:c,navigate:m,tabs:I,view:S,info:ne,status:Ye,userMessages:dt,visibleUserMessages:G,activeMessage:we,showAllFiles:Gn,navigateMessageByOffset:je,setExpanded:(y,j)=>ke("expanded",y,j),setActiveMessage:Re,addSelectionToContext:Ee,focusInput:()=>en?.focus()});const Ii=lb({showAllFiles:Gn,tabForPath:r.tab,openTab:I().open,loadFile:r.load}),T=[...["session","turn"]],oe=()=>s(yu,{options:T,get current(){return ye.changes},label:y=>y==="session"?u.t("ui.sessionReview.title"):u.t("ui.sessionReview.title.lastTurn"),onSelect:y=>y&&ke("changes",y),variant:"ghost",size:"large",triggerStyle:{"font-size":"var(--font-size-large)"}}),Ie=()=>(()=>{var y=sI(),j=y.firstChild;return d(y,s(qi,{class:"w-14 opacity-10"}),j),d(j,()=>u.t("session.review.noChanges")),y})(),st=y=>s(bt,{get children(){return[s(De,{get when(){return se(()=>ye.changes==="turn")()&&!!c.id},get children(){return s(lc,{get title(){return oe()},get empty(){return Ie()},diffs:He,view:S,get diffStyle(){return y.diffStyle},get onDiffStyleChange(){return y.onDiffStyleChange},onScrollRef:j=>Sn("reviewScroll",j),get focusedFile(){return on.activeDiff},onLineComment:j=>Ne({...j,origin:"review"}),get comments(){return p.all()},get focusedComment(){return p.focus()},get onFocusedCommentChange(){return p.setFocus},onViewFile:Ii,get classes(){return y.classes}})}}),s(De,{get when(){return me()},get children(){return s(P,{get when(){return Lt()},get fallback(){return(()=>{var j=cI();return d(j,()=>u.t("session.review.loadingChanges")),be(()=>Qn(j,y.loadingClass)),j})()},get children(){return s(lc,{get title(){return oe()},diffs:He,view:S,get diffStyle(){return y.diffStyle},get onDiffStyleChange(){return y.onDiffStyleChange},onScrollRef:j=>Sn("reviewScroll",j),get focusedFile(){return on.activeDiff},onLineComment:j=>Ne({...j,origin:"review"}),get comments(){return p.all()},get focusedComment(){return p.focus()},get onFocusedCommentChange(){return p.setFocus},onViewFile:Ii,get classes(){return y.classes}})}})}}),s(De,{when:!0,get children(){var j=lI(),Y=j.firstChild;return d(j,s(qi,{class:"w-14 opacity-10"}),Y),d(Y,()=>u.t("session.review.empty")),be(()=>Qn(j,y.emptyClass)),j}})]}}),Dt=()=>(()=>{var y=uI(),j=y.firstChild;return d(j,()=>st({diffStyle:e.review.diffStyle(),onDiffStyleChange:e.review.setDiffStyle,loadingClass:"px-6 py-4 text-text-weak",emptyClass:"h-full px-6 pb-30 flex flex-col items-center justify-center text-center gap-6"})),y})();re(ot(()=>I().active(),y=>{y&&kn()==="changes"&&r.pathFromTab(y)&&Gn()},{defer:!0}));const $t=y=>{y!=="changes"&&y!=="all"||rn(y)},Pt=y=>{const j=Ir(y);if(j)return`session-review-diff-${j}`},an=y=>{const j=on.reviewScroll;if(!j)return;const Y=Pt(y);if(!Y)return;const pe=document.getElementById(Y);if(!(pe instanceof HTMLElement)||!j.contains(pe))return;const de=pe.getBoundingClientRect(),Ze=j.getBoundingClientRect();return de.top-Ze.top+j.scrollTop},Nn=y=>{const j=on.reviewScroll;if(!j)return!1;const Y=an(y);return Y===void 0?!1:(S().setScroll("review",{x:j.scrollLeft,y:Y}),j.scrollTo({top:Y,behavior:"auto"}),!0)},Ar=y=>{Se();const j=S().review.open()??[];j.includes(y)||S().review.setOpen([...j,y]),Sn({activeDiff:y,pendingDiff:y})};re(()=>{const y=on.pendingDiff;if(!y||!on.reviewScroll||!Lt())return;const j=Y=>{if(on.pendingDiff!==y)return;if(Y>60){Sn("pendingDiff",void 0);return}const pe=on.reviewScroll;if(!pe){requestAnimationFrame(()=>j(Y+1));return}if(!Nn(y)){requestAnimationFrame(()=>j(Y+1));return}const de=an(y);if(de===void 0){requestAnimationFrame(()=>j(Y+1));return}if(Math.abs(pe.scrollTop-de)<=1){Sn("pendingDiff",void 0);return}requestAnimationFrame(()=>j(Y+1))};requestAnimationFrame(()=>j(0))});const _t=w(()=>{const y=I().active();if(y==="context")return"context";if(y==="review"&&Pn())return"review";if(y&&r.pathFromTab(y))return W(y);const j=An()[0];return j||(nn()?"context":Pn()&&me()?"review":"empty")}),Ti=w(()=>{const y=_t();if(An().includes(y))return y});re(()=>{if(!e.ready()||I().active()||An().length===0&&!nn()&&!(Pn()&&me()))return;const y=_t();y!=="empty"&&I().setActive(y)}),re(ot(()=>e.fileTree.opened(),(y,j)=>{if(j!==void 0&&O()){if(y){const Y=I().active(),pe=Y==="review"||!Y&&me()?"changes":"all";e.fileTree.setTab(pe);return}kn()==="changes"&&I().setActive("review")}},{defer:!0})),re(()=>{if(!O()||!e.fileTree.opened()||kn()!=="all")return;const y=I().active();if(y&&y!=="review")return;const j=An()[0];if(j){I().setActive(j);return}nn()&&I().setActive("context")}),re(()=>{const y=c.id;!y||!(O()?M()||_()&&_t()==="review":ye.mobileTab==="changes")||i.data.session_diff[y]===void 0&&i.status!=="loading"&&i.session.diff(y)});let Pr;re(()=>{const y=f.directory;if(!O()||!e.fileTree.opened()||i.status==="loading")return;kn();const j=Pr!==y;Pr=y,j?r.tree.refresh(""):r.tree.list("")}),re(ot(()=>f.directory,()=>{r.tree.list("");const y=I().active();if(!y)return;const j=r.pathFromTab(y);j&&r.load(j,{force:!0})},{defer:!0}));const jn=Ta({working:()=>!0,overflowAnchor:"dynamic"});let Nr,Ao;const Un=fb({onActive:y=>{y!==ye.messageId&&ke("messageId",y)}}),gp=y=>{const j=y.scrollHeight-y.clientHeight,Y=j>1,pe=!Y||y.scrollTop>=j-2;R.scroll.overflow===Y&&R.scroll.bottom===pe||U("scroll",{overflow:Y,bottom:pe})},Kn=y=>{Ao=y,Nr===void 0&&(Nr=requestAnimationFrame(()=>{Nr=void 0;const j=Ao;Ao=void 0,j&&gp(j)}))},Po=()=>{ke("messageId",void 0),jn.forceScrollToBottom(),kl();const y=tn;y&&Kn(y)};re(ot(jn.userScrolled,y=>{y||(ke("messageId",void 0),kl())},{defer:!0})),re(ot(N,()=>{Un.clear()},{defer:!0}));const $l=y=>`message-${y}`,hp=y=>{tn=y,jn.scrollRef(y),Un.setContainer(y),y&&Kn(y)};br(()=>E,()=>{const y=tn;y&&Kn(y),Un.markDirty()});const _l=20,pp=20;let Vn,No=!1;function wl(){const y=Vn;if(y!==void 0){if(Vn=void 0,No&&window.cancelIdleCallback){window.cancelIdleCallback(y);return}clearTimeout(y)}}function Ci(){if(Vn===void 0&&!(ye.turnStart<=0)){if(window.requestIdleCallback){No=!0,Vn=window.requestIdleCallback(()=>{Vn=void 0,xl()});return}No=!1,Vn=window.setTimeout(()=>{Vn=void 0,xl()},0)}}function xl(){const y=ye.turnStart;if(y<=0)return;const j=y-pp,Y=j>0?j:0,pe=tn;if(!pe){ke("turnStart",Y),Ci();return}const de=pe.scrollTop,Ze=pe.scrollHeight;ke("turnStart",Y),requestAnimationFrame(()=>{const tt=pe.scrollHeight-Ze;tt&&(pe.scrollTop=de+tt)}),Ci()}re(ot(()=>[c.id,H()],([y,j])=>{if(wl(),ke("turnStart",0),!y||!j)return;const Y=G().length,pe=Y>_l?Y-_l:0;ke("turnStart",pe),Ci()},{defer:!0})),br(()=>xn,({height:y})=>{const j=Math.ceil(y);if(j===ye.promptHeight)return;const Y=tn,pe=Y?Y.scrollHeight-Y.clientHeight-Y.scrollTop<10:!1;ke("promptHeight",j),pe&&Y&&requestAnimationFrame(()=>{Y.scrollTo({top:Y.scrollHeight,behavior:"auto"})}),Y&&Kn(Y),Un.markDirty()});const{clearMessageHash:kl,scrollToMessage:vp}=oI({sessionKey:N,sessionID:()=>c.id,messagesReady:H,visibleUserMessages:G,turnStart:()=>ye.turnStart,currentMessageId:()=>ye.messageId,pendingMessage:()=>R.pendingMessage,setPendingMessage:y=>U("pendingMessage",y),setActiveMessage:Re,setTurnStart:y=>ke("turnStart",y),scheduleTurnBackfill:Ci,autoScroll:jn,scroller:()=>tn,anchor:$l,scheduleScrollState:Kn,consumePendingMessage:e.pendingMessage.consume});re(()=>{document.addEventListener("keydown",Me)});const bp=()=>g.current().map(y=>y.type==="file"?`[file:${y.path}]`:y.type==="agent"?`@${y.name}`:y.type==="image"?`[image:${y.filename}]`:y.content).join("").trim();return re(()=>{g.ready()&&Gc(N(),{prompt:bp()})}),re(()=>{t.ready()&&(u.locale(),mp(pr.terminal,c.dir,t.all().map(y=>od({title:y.title,titleNumber:y.titleNumber,t:u.t}))))}),re(()=>{r.ready()&&Gc(N(),{files:Object.fromEntries(I().all().flatMap(y=>{const j=r.pathFromTab(y);return j?[[j,r.selectedLines(j)??null]]:[]}))})}),rt(()=>{wl(),document.removeEventListener("keydown",Me),Un.destroy(),Nr!==void 0&&cancelAnimationFrame(Nr)}),(()=>{var y=dI(),j=y.firstChild,Y=j.firstChild,pe=Y.firstChild;return d(y,s(Vv,{}),j),d(j,s(xS,{get open(){return se(()=>!O())()&&!!c.id},get hasReview(){return me()},get reviewCount(){return fe()},onSession:()=>ke("mobileTab","session"),onChanges:()=>ke("mobileTab","changes"),get t(){return u.t}}),Y),d(pe,s(bt,{get children(){return[s(De,{get when(){return c.id},get children(){return s(P,{get when(){return we()},get children(){return s(n$,{get mobileChanges(){return Si()},get mobileFallback(){return st({diffStyle:"unified",classes:{root:"pb-[calc(var(--prompt-height,8rem)+32px)]",header:"px-4",container:"px-4"},loadingClass:"px-4 py-4 text-text-weak",emptyClass:"h-full px-4 pb-30 flex flex-col items-center justify-center text-center gap-6"})},get scroll(){return R.scroll},onResumeScroll:Po,setScrollRef:hp,onScheduleScrollState:Kn,get onAutoScrollHandleScroll(){return jn.handleScroll},onMarkScrollGesture:ae,hasScrollGesture:xe,get isDesktop(){return O()},get onScrollSpyScroll(){return Un.onScroll},get onAutoScrollInteraction(){return jn.handleInteraction},get showHeader(){return!!(ne()?.title||ne()?.parentID)},get centered(){return B()},get title(){return ne()?.title},get parentID(){return ne()?.parentID},openTitleEditor:_e,closeTitleEditor:ge,saveTitleEditor:Ae,titleRef:de=>{q=de},titleState:he,onTitleDraft:de=>C("draft",de),onTitleMenuOpen:de=>C("menuOpen",de),onTitlePendingRename:de=>C("pendingRename",de),onNavigateParent:()=>{m(`/${c.dir}/session/${ne()?.parentID}`)},get sessionID(){return c.id},onArchiveSession:de=>void We(de),onDeleteSession:de=>o.show(()=>s(yt,{sessionID:de})),get t(){return u.t},setContentRef:de=>{E=de,jn.contentRef(de);const Ze=tn;Ze&&Kn(Ze)},get turnStart(){return ye.turnStart},onRenderEarlier:()=>ke("turnStart",0),get historyMore(){return $e()},get historyLoading(){return te()},onLoadEarlier:()=>{const de=c.id;de&&(ke("turnStart",0),i.session.history.loadMore(de))},get renderedUserMessages(){return et()},anchor:$l,get onRegisterMessage(){return Un.register},get onUnregisterMessage(){return Un.unregister},onFirstTurnMount:()=>{c.id&&(c.dir,void 0)},get lastUserMessageID(){return ue()?.id},get expanded(){return ye.expanded},onToggleExpanded:de=>ke("expanded",de,Ze=>!Ze)})}})}}),s(De,{when:!0,get children(){return s(sb,{get worktree(){return Q()},onWorktreeChange:de=>{if(de==="create"){ke("newSessionWorktree",de);return}ke("newSessionWorktree","main");const Ze=de==="main"?i.project?.worktree:de;Ze&&Ze!==i.data.path.directory&&(e.projects.open(Ze),m(`/${ei(Ze)}/session`))}})}})]}})),d(Y,s(wS,{get centered(){return B()},questionRequest:b,permissionRequest:v,get blocked(){return x()},get promptReady(){return g.ready()},get handoffPrompt(){return pr.session.get(N())?.prompt},get t(){return u.t},get responding(){return R.responding},onDecide:A,inputRef:de=>{en=de},get newSessionWorktree(){return Q()},onNewSessionWorktreeReset:()=>ke("newSessionWorktree","main"),onSubmit:()=>{p.clear(),Po()},setPromptDockRef:de=>xn=de}),null),d(Y,s(P,{get when(){return _()},get children(){return s(Ia,{direction:"horizontal",get size(){return e.session.width()},min:450,get max(){return window.innerWidth*.45},get onResize(){return e.session.resize}})}}),null),d(j,s(iI,{get open(){return F()},get reviewOpen(){return _()},language:u,layout:e,command:l,dialog:o,file:r,comments:p,sync:i,get hasReview(){return me()},get reviewCount(){return fe()},get reviewTab(){return Pn()},contextOpen:nn,openedTabs:An,activeTab:_t,activeFileTab:Ti,tabs:I,openTab:X,showAllFiles:Gn,reviewPanel:Dt,messages:z,visibleUserMessages:G,view:S,info:ne,handoffFiles:()=>pr.session.get(N())?.files,codeComponent:a,addCommentToContext:Ne,activeDraggable:()=>ye.activeDraggable,onDragStart:Le,onDragEnd:vt,onDragOver:ve,fileTreeTab:kn,setFileTreeTabValue:$t,get diffsReady(){return Lt()},get diffFiles(){return Et()},get kinds(){return pt()},get activeDiff(){return on.activeDiff},focusReviewDiff:Ar}),null),d(y,s(fy,{get open(){return se(()=>!!O())()&&S().terminal.opened()},get height(){return e.terminal.height()},get resize(){return e.terminal.resize},get close(){return S().terminal.close},terminal:t,language:u,command:l,handoff:()=>pr.terminal.get(c.dir)??[],activeTerminalDraggable:()=>ye.activeTerminalDraggable,handleTerminalDragStart:Kt,handleTerminalDragOver:On,handleTerminalDragEnd:Rt,onCloseTab:()=>U("autoCreated",!1)}),null),be(de=>{var Ze={"@container relative shrink-0 flex flex-col min-h-0 h-full bg-background-stronger":!0,"flex-1 pt-2 md:pt-3":!0,"md:flex-none":F()},tt=Z(),dn=ye.promptHeight?`${ye.promptHeight}px`:void 0;return de.e=ct(Y,Ze,de.e),tt!==de.t&&Xt(Y,"width",de.t=tt),dn!==de.a&&Xt(Y,"--prompt-height",de.a=dn),de},{e:void 0,t:void 0,a:void 0}),y})()}export{gI as default};
|