@pi-chamber/web 1.0.4-rc.2 → 1.0.4-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/assets/DiagramView--BGR3PRZ.js +1 -0
  2. package/dist/assets/{DiffView-Cay8VAqL.js → DiffView-hz90_htv.js} +5 -5
  3. package/dist/assets/FileSaveConflictDialog-CcrWHRvd.js +3 -0
  4. package/dist/assets/{FilesView-CEeQzjc6.js → FilesView-DaqkPMqx.js} +4 -4
  5. package/dist/assets/{GitHubDetailScaffold-q4YP8iyJ.js → GitHubDetailScaffold-BZhP67Va.js} +2 -2
  6. package/dist/assets/GitHubLinkPicker-CJZmDljp.js +1 -0
  7. package/dist/assets/{GitHubListPrimitives-XkALat1v.js → GitHubListPrimitives-DhF42guB.js} +1 -1
  8. package/dist/assets/{GitView-DV3d0oSJ.js → GitView-JK-QCK9R.js} +4 -4
  9. package/dist/assets/{IssuesSurface-OTyt9f3A.js → IssuesSurface-CAqQzrsv.js} +3 -3
  10. package/dist/assets/{JsonTreeView-X2Auiy_q.js → JsonTreeView-CKTqB1CD.js} +1 -1
  11. package/dist/assets/MarkdownRendererImpl-B5kJy9Nt.js +12 -0
  12. package/dist/assets/{PatchDiff-GMQAv4en.js → PatchDiff-BQnRFN30.js} +1 -1
  13. package/dist/assets/{PierreDiffViewer-0X__nypk.js → PierreDiffViewer-BeGpdI0x.js} +2 -2
  14. package/dist/assets/PullRequestsSurface-D9beq2x9.js +2 -0
  15. package/dist/assets/SessionSwitcherContent-DElQ_cjm.js +1 -0
  16. package/dist/assets/SessionSwitcherDropdown-JaIDcDIj.js +2 -0
  17. package/dist/assets/{SessionUnreadDot-CJFawQpo.js → SessionUnreadDot-Czfvjbdi.js} +1 -1
  18. package/dist/assets/SettingsView-C_GC1Mx3.js +6 -0
  19. package/dist/assets/SettingsWindow-CAxKgYOu.js +1 -0
  20. package/dist/assets/ToolOutputDialog-lz5exVQ4.js +8 -0
  21. package/dist/assets/ToolPartDiffPreview-nIUiNLpP.js +1 -0
  22. package/dist/assets/{VirtualizedFileDiff-CUWx7JVZ.js → VirtualizedFileDiff-IWqCJNXu.js} +1 -1
  23. package/dist/assets/{Virtualizer-wpC51ZBQ.js → Virtualizer-Cp_cJWbI.js} +1 -1
  24. package/dist/assets/{collapsible-Ce85nuXX.js → collapsible-C7oyikVm.js} +1 -1
  25. package/dist/assets/{computeVirtualFileMetrics-3PpRLd5B.js → computeVirtualFileMetrics-CyhUKEfv.js} +1 -1
  26. package/dist/assets/{contextFileOpenGuard-PoBklHMz.js → contextFileOpenGuard-DkjmJ-NU.js} +1 -1
  27. package/dist/assets/{gitStatusPredicates-BvzxqidP.js → gitStatusPredicates-DBmUY3kA.js} +1 -1
  28. package/dist/assets/{githubLink-iQ51wqRa.js → githubLink-BdbPMMAK.js} +5 -5
  29. package/dist/assets/index-BnZVqcki.js +11 -0
  30. package/dist/assets/index-BnieExes.css +1 -0
  31. package/dist/assets/index-CKgYIOis.js +1 -0
  32. package/dist/assets/{main-FasHq7Ck.js → main-6YKi4QM2.js} +2 -2
  33. package/dist/assets/{main-PSCt716b.js → main-CWdWdhdL.js} +4 -4
  34. package/dist/assets/{markdownCore-BH56o6Wu.js → markdownCore-D7V46WY9.js} +1 -1
  35. package/dist/assets/miniChat-PanPmbEK.js +2 -0
  36. package/dist/assets/mobile-0LY-2fxw.js +2 -0
  37. package/dist/assets/nativeFileSave-BzhtrDoD.js +1 -0
  38. package/dist/assets/{pi-session-focus-preference-D2-1HWmY.js → pi-session-focus-preference-BC-ze1oC.js} +4 -4
  39. package/dist/assets/{renderDiffWithHighlighter-l8hZWWBO.js → renderDiffWithHighlighter-ByZtK9za.js} +1 -1
  40. package/dist/assets/renderElectronMiniChatApp-DETQLjFi.js +2 -0
  41. package/dist/assets/{renderFileWithHighlighter-BvDoP7ob.js → renderFileWithHighlighter-CnN0Tv_8.js} +1 -1
  42. package/dist/assets/renderMobileApp-DS0FDQLg.js +11 -0
  43. package/dist/assets/runtimeEndpointReset-BqqXMwE9.js +62 -0
  44. package/dist/assets/{runtimeSurface-B1GRkkKC.js → runtimeSurface-DBiUWYK2.js} +1 -1
  45. package/dist/assets/useAppFontEffects-BisjofNZ.js +212 -0
  46. package/dist/assets/{useFilesViewSearch-D1jsGQrN.js → useFilesViewSearch-BWABG6pS.js} +1 -1
  47. package/dist/assets/{useGitHubRemoteSearch-zNgy2bSt.js → useGitHubRemoteSearch-Bsf2YeQP.js} +1 -1
  48. package/dist/assets/{useSwitcherItems-OCRYcHeu.js → useSwitcherItems-BSTSev5C.js} +1 -1
  49. package/dist/assets/vendor-aparajita-capacitor-secure-storage-BYohCVY0.js +1 -0
  50. package/dist/assets/{vendor-base-ui-DIkTOIJS.js → vendor-base-ui-BscvGUFt.js} +1 -1
  51. package/dist/assets/vendor-boot-Dgb9NVFe.js +69 -0
  52. package/dist/assets/vendor-capacitor-app-BjdQVib9.js +1 -0
  53. package/dist/assets/vendor-capacitor-keyboard-eTtI5go3.js +1 -0
  54. package/dist/assets/vendor-capacitor-push-notifications-CBKq2Arn.js +1 -0
  55. package/dist/assets/vendor-capacitor-status-bar-9rNIGxlO.js +1 -0
  56. package/dist/assets/{vendor-codemirror-autocomplete-DsFn4GLp.js → vendor-codemirror-autocomplete-DxS3jwvE.js} +1 -1
  57. package/dist/assets/{vendor-codemirror-lang-angular-B_NMmBbS.js → vendor-codemirror-lang-angular-DdjXl9e2.js} +1 -1
  58. package/dist/assets/vendor-codemirror-lang-cpp--aMr7NVt.js +1 -0
  59. package/dist/assets/vendor-codemirror-lang-css-CZ_qxZY9.js +1 -0
  60. package/dist/assets/{vendor-codemirror-lang-go-C2KHbcll.js → vendor-codemirror-lang-go-Ca-y2Alu.js} +2 -2
  61. package/dist/assets/vendor-codemirror-lang-html-COZ0L5wT.js +1 -0
  62. package/dist/assets/vendor-codemirror-lang-java-D3Rf3QNJ.js +1 -0
  63. package/dist/assets/{vendor-codemirror-lang-javascript-DpTUrvx8.js → vendor-codemirror-lang-javascript-DwJ-IvCs.js} +2 -2
  64. package/dist/assets/vendor-codemirror-lang-jinja-D_5lod6k.js +1 -0
  65. package/dist/assets/vendor-codemirror-lang-json-BG8C7OpC.js +1 -0
  66. package/dist/assets/vendor-codemirror-lang-less-CVEkoaTw.js +1 -0
  67. package/dist/assets/vendor-codemirror-lang-liquid-U9vj0m8w.js +1 -0
  68. package/dist/assets/vendor-codemirror-lang-markdown-DqlYH9gY.js +1 -0
  69. package/dist/assets/vendor-codemirror-lang-php-BFEiEVA1.js +1 -0
  70. package/dist/assets/vendor-codemirror-lang-python-Cz1dQXQd.js +3 -0
  71. package/dist/assets/vendor-codemirror-lang-rust-C_CoD9mj.js +1 -0
  72. package/dist/assets/vendor-codemirror-lang-sass-BuR0aKh5.js +1 -0
  73. package/dist/assets/{vendor-codemirror-lang-sql-C_RazIaB.js → vendor-codemirror-lang-sql-DggNUjdM.js} +2 -2
  74. package/dist/assets/{vendor-codemirror-lang-vue-BYL0r7KR.js → vendor-codemirror-lang-vue-DFZHi2J3.js} +1 -1
  75. package/dist/assets/vendor-codemirror-lang-wast-zuTN3SHT.js +1 -0
  76. package/dist/assets/vendor-codemirror-lang-xml-CrcvhI-k.js +1 -0
  77. package/dist/assets/vendor-codemirror-lang-yaml-DcVWsakb.js +1 -0
  78. package/dist/assets/{vendor-codemirror-language-data-DglcKYWT.js → vendor-codemirror-language-data-CCLITgCF.js} +2 -2
  79. package/dist/assets/{vendor-codemirror-search-DaE6R5gH.js → vendor-codemirror-search-H7NOEdbX.js} +2 -2
  80. package/dist/assets/{vendor-lezer-cpp-Dt99h3WT.js → vendor-lezer-cpp-C8aD2KAr.js} +1 -1
  81. package/dist/assets/{vendor-lezer-css-DNU_fzPI.js → vendor-lezer-css-2lbTJF-Y.js} +1 -1
  82. package/dist/assets/{vendor-lezer-go-BEFtcNyS.js → vendor-lezer-go-Bw6LFTrZ.js} +1 -1
  83. package/dist/assets/{vendor-lezer-html-DDGRhRUz.js → vendor-lezer-html-D7ym2z7S.js} +1 -1
  84. package/dist/assets/{vendor-lezer-java-DmfZtW09.js → vendor-lezer-java-CZhK7w21.js} +1 -1
  85. package/dist/assets/{vendor-lezer-javascript-oje4tdp_.js → vendor-lezer-javascript-rpKeTHZp.js} +1 -1
  86. package/dist/assets/{vendor-lezer-json-BRXb_bDX.js → vendor-lezer-json-C7jwsd2G.js} +1 -1
  87. package/dist/assets/{vendor-lezer-lr-BU2qmu_5.js → vendor-lezer-lr-DR-ylqNN.js} +1 -1
  88. package/dist/assets/{vendor-lezer-markdown-CicYv7V9.js → vendor-lezer-markdown-Bir0m5nB.js} +1 -1
  89. package/dist/assets/{vendor-lezer-php-COORrTpE.js → vendor-lezer-php-y0hIEfo1.js} +1 -1
  90. package/dist/assets/{vendor-lezer-python-Cuvm9X9Y.js → vendor-lezer-python-D64A9lNV.js} +1 -1
  91. package/dist/assets/{vendor-lezer-rust-C_zOfHbX.js → vendor-lezer-rust-E3ZA9T2L.js} +1 -1
  92. package/dist/assets/{vendor-lezer-sass-DWP4w7O1.js → vendor-lezer-sass-C5UFI9SP.js} +1 -1
  93. package/dist/assets/{vendor-lezer-xml-Br6nOYeG.js → vendor-lezer-xml-DOy7FzCR.js} +1 -1
  94. package/dist/assets/{vendor-lezer-yaml-CYQmm6Sb.js → vendor-lezer-yaml-kEjaSCvZ.js} +1 -1
  95. package/dist/assets/{vendor-replit-codemirror-vim-CZy3BUVv.js → vendor-replit-codemirror-vim-BLfh0LPy.js} +1 -1
  96. package/dist/assets/{web-components-v9fuidaX.js → web-components-CdMfsnXE.js} +1 -1
  97. package/dist/index.html +4 -4
  98. package/dist/mini-chat.html +3 -3
  99. package/dist/mobile.html +3 -3
  100. package/package.json +1 -1
  101. package/server/lib/pi/routes.js +1 -0
  102. package/server/lib/pi/session-daemon/DOCUMENTATION.md +1 -1
  103. package/server/lib/pi/session-daemon/supervisor.js +13 -1
  104. package/server/lib/pi/session-daemon/supervisor.test.js +92 -0
  105. package/server/lib/relay/DOCUMENTATION.md +4 -0
  106. package/server/lib/terminal/DOCUMENTATION.md +1 -0
  107. package/dist/assets/DiagramView-GKGxPczP.js +0 -1
  108. package/dist/assets/FileSaveConflictDialog-BRM9TJo0.js +0 -3
  109. package/dist/assets/GitHubLinkPicker-B9xgIW8y.js +0 -1
  110. package/dist/assets/MarkdownRendererImpl-1HameF6j.js +0 -12
  111. package/dist/assets/PullRequestsSurface-Dec20SIg.js +0 -2
  112. package/dist/assets/SessionSwitcherContent-DEw4nz7K.js +0 -1
  113. package/dist/assets/SessionSwitcherDropdown-DmLhbRzE.js +0 -2
  114. package/dist/assets/SettingsView-CwSspvq-.js +0 -6
  115. package/dist/assets/SettingsWindow-DkPv9MaU.js +0 -1
  116. package/dist/assets/ToolOutputDialog-DDwbOpTO.js +0 -8
  117. package/dist/assets/ToolPartDiffPreview-DZRP7p-Q.js +0 -1
  118. package/dist/assets/index-CkMnC_GK.js +0 -1
  119. package/dist/assets/index-Dd2OcIUY.js +0 -10
  120. package/dist/assets/index-DvN8zlLT.css +0 -1
  121. package/dist/assets/miniChat-BzfobBDq.js +0 -2
  122. package/dist/assets/mobile-DAzZE2EL.js +0 -2
  123. package/dist/assets/renderElectronMiniChatApp-DGYSIihR.js +0 -2
  124. package/dist/assets/renderMobileApp-CwgWG0lU.js +0 -11
  125. package/dist/assets/runtimeEndpointReset-CmI6dBKM.js +0 -62
  126. package/dist/assets/useAppFontEffects--lKKtKVo.js +0 -212
  127. package/dist/assets/vendor-aparajita-capacitor-secure-storage-5IShChL0.js +0 -1
  128. package/dist/assets/vendor-boot-DyL2td56.js +0 -69
  129. package/dist/assets/vendor-capacitor-app-BrDJj9I_.js +0 -1
  130. package/dist/assets/vendor-capacitor-core-B4EWRrHz.js +0 -1
  131. package/dist/assets/vendor-capacitor-keyboard-CYccoJjr.js +0 -1
  132. package/dist/assets/vendor-capacitor-push-notifications-KNe1zSBF.js +0 -1
  133. package/dist/assets/vendor-capacitor-status-bar-B-N0EOVk.js +0 -1
  134. package/dist/assets/vendor-codemirror-lang-cpp-GOE7Gjd0.js +0 -1
  135. package/dist/assets/vendor-codemirror-lang-css-Dwf2XpnZ.js +0 -1
  136. package/dist/assets/vendor-codemirror-lang-html-DcKqyeGk.js +0 -1
  137. package/dist/assets/vendor-codemirror-lang-java-6eGbyB2k.js +0 -1
  138. package/dist/assets/vendor-codemirror-lang-jinja-xSUJjXhr.js +0 -1
  139. package/dist/assets/vendor-codemirror-lang-json-CLGxdOCz.js +0 -1
  140. package/dist/assets/vendor-codemirror-lang-less-6nXi1rS9.js +0 -1
  141. package/dist/assets/vendor-codemirror-lang-liquid-B9hmb9P8.js +0 -1
  142. package/dist/assets/vendor-codemirror-lang-markdown-DmFP9s6x.js +0 -1
  143. package/dist/assets/vendor-codemirror-lang-php-DC6To8iX.js +0 -1
  144. package/dist/assets/vendor-codemirror-lang-python-yuxIkjit.js +0 -3
  145. package/dist/assets/vendor-codemirror-lang-rust-di1Sjz-0.js +0 -1
  146. package/dist/assets/vendor-codemirror-lang-sass-BWpV9NPV.js +0 -1
  147. package/dist/assets/vendor-codemirror-lang-wast-BiVarhcz.js +0 -1
  148. package/dist/assets/vendor-codemirror-lang-xml-Cn1lY1ts.js +0 -1
  149. package/dist/assets/vendor-codemirror-lang-yaml-BZ6mZw9L.js +0 -1
@@ -0,0 +1 @@
1
+ import{k as e,b2 as l,b3 as d,b4 as c,b5 as p,b6 as m,b7 as g,b8 as u}from"./vendor-boot-Dgb9NVFe.js";import{R as s}from"./vendor-react-DASdDPIk.js";import{o as a}from"./index-BnZVqcki.js";import{I as b}from"./useAppFontEffects-BisjofNZ.js";import{S as x}from"./SettingsView-C_GC1Mx3.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-zustand-CUi8eEds.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-tailwind-merge-CPcsbTWB.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./runtimeSurface-DBiUWYK2.js";import"./nativeFileSave-BzhtrDoD.js";import"./runtimeEndpointReset-BqqXMwE9.js";import"./SessionUnreadDot-Czfvjbdi.js";/* empty css */import"./permissionStore-B9Hkrqny.js";import"./vendor-qrcode-Dv4uniC1.js";import"./vendor-dijkstrajs-COg3n3zL.js";import"./collapsible-C7oyikVm.js";import"./vendor-base-ui-BscvGUFt.js";const M=({open:r,onOpenChange:t})=>{const o=s.useId(),n=s.useCallback(()=>typeof document>"u"?!1:!!document.querySelector('[data-slot="dropdown-menu-content"][data-open], [data-slot="select-content"][data-open]'),[]);return e.jsx(l,{open:r,onOpenChange:i=>{!i&&n()||t(i)},children:e.jsxs(d,{children:[e.jsx(c,{className:a("oc-glass-backdrop fixed inset-0 z-50 bg-black/25 dark:bg-black/40","transition-opacity duration-150 ease-out","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0")}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center pointer-events-none",children:e.jsxs(p,{"aria-describedby":o,className:a("relative pointer-events-auto","w-[92vw] max-w-[1120px] h-[84vh] max-h-[900px]","rounded-2xl border border-border/80 shadow-2xl overflow-hidden origin-center","bg-sidebar","transition-all duration-150 ease-out","data-[starting-style]:opacity-0 data-[starting-style]:scale-[0.98]","data-[ending-style]:opacity-0 data-[ending-style]:scale-[0.98]","data-[nested-dialog-open]:brightness-[0.55] dark:data-[nested-dialog-open]:brightness-[0.4]"),children:[e.jsx(m,{className:"sr-only",children:"Settings"}),e.jsx(g,{id:o,className:"sr-only",children:"PiChamber settings window."}),e.jsx(u,{"aria-label":"Close settings",className:"absolute right-3 top-3 z-10 inline-flex size-8 items-center justify-center rounded-md bg-background/80 text-muted-foreground backdrop-blur-sm hover:bg-interactive-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50",children:e.jsx(b,{name:"close",className:"size-4"})}),e.jsx(x,{onClose:()=>t(!1),isWindowed:!0})]})})]})})};export{M as SettingsWindow};
@@ -0,0 +1,8 @@
1
+ import{k as r,aL as K,bb as ie}from"./vendor-boot-Dgb9NVFe.js";import{R as i}from"./vendor-react-DASdDPIk.js";import{I as x,b2 as Y,dz as oe,aq as le,cf as de,dA as ce,dB as me,dC as ue,ck as X,aX as he,ak as fe,al as ge,dD as xe,av as A,dE as we,dF as ye,dG as be,dH as pe,dI as ve,dJ as je,dK as Ne}from"./useAppFontEffects-BisjofNZ.js";import{F as Q,J as ke}from"./JsonTreeView-CKTqB1CD.js";import{o as L,m as Me,_ as U,bP as C}from"./index-BnZVqcki.js";import{P as Se}from"./PatchDiff-BQnRFN30.js";import{ensurePierreThemeRegistered as $}from"./appThemeRegistry-gegrE2dq.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-zustand-CUi8eEds.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./runtimeSurface-DBiUWYK2.js";import"./nativeFileSave-BzhtrDoD.js";import"./vendor-tailwind-merge-CPcsbTWB.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./web-components-CdMfsnXE.js";import"./computeVirtualFileMetrics-CyhUKEfv.js";import"./vendor-shiki-Bbf2GEcE.js";import"./vendor-shikijs-core-CGM_jqPK.js";import"./vendor-shikijs-types-CPSbSeK6.js";import"./vendor-shikijs-vscode-textmate-BgLrS_2D.js";import"./vendor-hast-util-to-html-BKBhbTDb.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-property-information-rJCbAzvX.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-comma-separated-tokens-D8TqSuIK.js";import"./vendor-space-separated-tokens-DD3iYX1K.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-shikijs-engine-oniguruma-DPWuIF1G.js";import"./themeResolver-yJ9XpNMI.js";import"./vendor-pierre-theming-Dgp7B_O4.js";import"./vendor-shikijs-engine-javascript-Cme4830A.js";import"./vendor-oniguruma-to-es-DLBnFDCE.js";import"./vendor-oniguruma-parser-C0D4_9rT.js";import"./vendor-regex-BBWcyTkg.js";import"./vendor-regex-utilities-2BQyy0xI.js";import"./vendor-regex-recursion-JU4mF-dD.js";import"./vendor-shikijs-transformers-CZWsLLKm.js";import"./Virtualizer-Cp_cJWbI.js";import"./renderFileWithHighlighter-CnN0Tv_8.js";import"./VirtualizedFileDiff-IWqCJNXu.js";import"./renderDiffWithHighlighter-ByZtK9za.js";import"./vendor-diff-C3JhlQdm.js";import"./registerCustomTheme-DmolaWWZ.js";const Re=e=>{const n="h-3.5 w-3.5 flex-shrink-0",t=e.toLowerCase();return t==="reasoning"?r.jsx(x,{name:"brain-ai-3",className:n}):t==="image-preview"?r.jsx(x,{name:"file-image",className:n}):t==="mermaid-preview"?r.jsx(x,{name:"file-list-2",className:n}):t==="edit"||t==="multiedit"||t==="apply_patch"||t==="str_replace"||t==="str_replace_based_edit_tool"?r.jsx(x,{name:"pencil-ai",className:n}):t==="write"||t==="create"||t==="file_write"?r.jsx(x,{name:"file-pdf",className:n}):t==="read"||t==="view"||t==="file_read"||t==="cat"?r.jsx(x,{name:"file-pdf",className:n}):t==="bash"||t==="shell"||t==="cmd"||t==="terminal"?r.jsx(x,{name:"terminal-box",className:n}):t==="list"||t==="ls"||t==="dir"||t==="list_files"?r.jsx(x,{name:"folder-6",className:n}):t==="search"||t==="grep"||t==="find"||t==="ripgrep"?r.jsx(x,{name:"search",className:n}):t==="glob"?r.jsx(x,{name:"file-search",className:n}):t==="fetch"||t==="curl"||t==="wget"||t==="webfetch"?r.jsx(x,{name:"global",className:n}):t==="web-search"||t==="websearch"||t==="search_web"||t==="google"||t==="bing"||t==="duckduckgo"?r.jsx(x,{name:"search",className:n}):t==="todowrite"||t==="todoread"?r.jsx(x,{name:"list-check-3",className:n}):t==="plan_enter"?r.jsx(x,{name:"file-list-2",className:n}):t==="plan_exit"?r.jsx(x,{name:"task",className:n}):t.startsWith("git")?r.jsx(x,{name:"git-branch",className:n}):r.jsx(x,{name:"tools",className:n})};class H extends Error{constructor(n){super(n),this.name="MermaidLoadFailure"}}const Te=e=>new H(e),Ie=e=>e instanceof H,Pe=e=>e+1,q=(e,n)=>e===n,Le=e=>{const n=e.indexOf(",");if(n<0)throw Te("The Mermaid data URL is malformed.");const t=e.slice(0,n).toLowerCase(),s=e.slice(n+1);return t.includes(";base64")?atob(s):decodeURIComponent(s)},Ee=e=>Promise.resolve().then(()=>Le(e)),B=150,Ce=40,De=120,_e=3,Ae={download:!1,copy:!1,showPanZoomControls:!0},F=e=>new H(e),G=()=>({width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}),J={mobile:{widthRatio:.94,heightRatio:.86,padding:10},desktop:{widthRatio:.8,heightRatio:.8,padding:16}},Fe=(e,n)=>{const t=n?J.mobile:J.desktop,s=Math.max(160,e.width-t.padding*2),o=Math.max(160,e.height-t.padding*2);return{maxWidth:Math.max(160,Math.min(s,e.width*t.widthRatio)),maxHeight:Math.max(160,Math.min(o,e.height*t.heightRatio))}},ze=e=>{try{const d=Array.from(e.querySelectorAll("g"));let a=0,c=null;for(const l of d){if(!(l instanceof SVGGraphicsElement))continue;const h=l.getBBox();if(!(h.width>0&&h.height>0))continue;const f=h.width*h.height;f>a&&(a=f,c=h.width/h.height)}if(c&&Number.isFinite(c)&&c>0)return c}catch{}const n=e.getAttribute("viewBox");if(n){const d=n.trim().split(/\s+/).map(Number);if(d.length===4){const a=d[2],c=d[3];if(Number.isFinite(a)&&Number.isFinite(c)&&a>0&&c>0)return a/c}}const t=Number(e.getAttribute("width")),s=Number(e.getAttribute("height"));if(Number.isFinite(t)&&Number.isFinite(s)&&t>0&&s>0)return t/s;const o=e.getBoundingClientRect();return o.width>0&&o.height>0?o.width/o.height:null},ee=e=>{const[n,t]=i.useState(e),[s,o]=i.useState(e),[d,a]=i.useState(!1);return i.useEffect(()=>{if(e){if(t(!0),a(!0),typeof window>"u"){o(!0);return}const l=window.requestAnimationFrame(()=>{o(!0)}),h=window.setTimeout(()=>{a(!1)},B);return()=>{window.cancelAnimationFrame(l),window.clearTimeout(h)}}if(o(!1),a(!0),typeof window>"u"){t(!1);return}const c=window.setTimeout(()=>{t(!1),a(!1)},B);return()=>{window.clearTimeout(c)}},[e]),{isRendered:n,isVisible:s,isTransitioning:d}},te=e=>{const[n,t]=i.useState(G);return i.useEffect(()=>{if(!e||typeof window>"u")return;const s=()=>{t(G())};return s(),window.addEventListener("resize",s),()=>{window.removeEventListener("resize",s)}},[e]),n},Ve=({popup:e,onOpenChange:n,isMobile:t})=>{const s=i.useMemo(()=>{const u=e.image;if(!u)return[];const w=Array.isArray(u.gallery)?u.gallery.filter(S=>!!S?.url):[];return w.length>0?w:[{url:u.url,mimeType:u.mimeType,filename:u.filename,size:u.size}]},[e.image]),[o,d]=i.useState(0),[a,c]=i.useState(null),{isRendered:l,isVisible:h,isTransitioning:f}=ee(e.open),y=te(e.open);i.useEffect(()=>{if(!e.open||s.length===0)return;const u=typeof e.image?.index=="number"?e.image.index:-1;if(u>=0&&u<s.length){d(u);return}const w=e.image?.url?s.findIndex(S=>S.url===e.image?.url):-1;d(w>=0?w:0)},[s,e.image?.index,e.image?.url,e.open]);const j=s[o]??s[0]??e.image,N=j?.filename||e.title||"Image preview",T=s.length>1,k=i.useCallback(()=>{s.length<=1||d(u=>(u-1+s.length)%s.length)},[s.length]),I=i.useCallback(()=>{s.length<=1||d(u=>(u+1)%s.length)},[s.length]);i.useEffect(()=>{if(!e.open)return;const u=w=>{if(w.key==="Escape"){n(!1);return}if(w.key==="ArrowLeft"&&T){w.preventDefault(),k();return}w.key==="ArrowRight"&&T&&(w.preventDefault(),I())};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[T,n,e.open,I,k]),i.useEffect(()=>{c(null)},[j?.url]);const E=i.useMemo(()=>{const u=Math.max(160,y.width*(t?.86:.75)),w=Math.max(160,y.height*(t?.72:.75));if(!a)return{width:Math.round(u),height:Math.round(w)};const S=u/a.width,m=w/a.height,g=Math.min(S,m);return{width:Math.max(1,Math.round(a.width*g)),height:Math.max(1,Math.round(a.height*g))}},[a,t,y]);if(!l||typeof document>"u"||!j?.url)return null;const D=r.jsxs("div",{className:L("fixed inset-0 z-50",e.open?"pointer-events-auto":"pointer-events-none"),children:[r.jsx("div",{"aria-hidden":"true",className:L("absolute inset-0",f&&"transition-opacity duration-150 ease-out",h?"opacity-100":"opacity-0"),style:{backgroundColor:"color-mix(in srgb, var(--surface-background) 70%, transparent)"},onMouseDown:()=>n(!1)}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center p-4 pointer-events-none",children:r.jsxs("div",{className:L("pointer-events-auto flex flex-col gap-2",f&&"transition-opacity duration-150 ease-out",h?"opacity-100":"opacity-0"),style:{width:`${E.width}px`},onMouseDown:u=>u.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground typography-meta",children:[r.jsx("span",{className:"truncate pr-2",children:N}),T&&r.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[r.jsx("button",{type:"button",className:"p-1 rounded hover:bg-[var(--interactive-hover)]",onClick:k,"aria-label":"Previous image",children:r.jsx(x,{name:"arrow-left-s",className:"h-3.5 w-3.5"})}),r.jsxs("span",{children:[o+1," / ",s.length]}),r.jsx("button",{type:"button",className:"p-1 rounded hover:bg-[var(--interactive-hover)]",onClick:I,"aria-label":"Next image",children:r.jsx(x,{name:"arrow-right-s",className:"h-3.5 w-3.5"})})]}),r.jsx("button",{type:"button",className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground/80 hover:text-foreground focus:outline-none focus:ring-2 focus:ring-primary/60",onClick:()=>n(!1),"aria-label":"Close image preview",children:r.jsx(x,{name:"close",className:"h-4 w-4"})})]}),r.jsx("img",{src:j.url,alt:N,className:"block object-contain",style:{width:`${E.width}px`,height:`${E.height}px`},loading:"lazy",onLoad:u=>{const w=u.currentTarget,S=w.naturalWidth,m=w.naturalHeight;S>0&&m>0&&c(g=>g&&g.width===S&&g.height===m?g:{width:S,height:m})}})]})})]});return K.createPortal(D,document.body)},He=({popup:e,onOpenChange:n,isMobile:t})=>{const[s,o]=i.useState(e.mermaid?.source||""),[d,a]=i.useState(e.mermaid?.source?"ready":"idle"),[c,l]=i.useState(""),{isRendered:h,isVisible:f,isTransitioning:y}=ee(e.open),[j,N]=i.useState(null),T=te(e.open),k=i.useRef(0),I=i.useRef(null),E=i.useCallback(m=>{const g=m.trim();if(!g.toLowerCase().startsWith("file://"))return null;const v=p=>{if(!p||/[\0\r\n]/.test(p))return!1;const P=p.replace(/\\/g,"/");return P.split("/").filter(Boolean).includes("..")?!1:P.startsWith("/")?!0:/^[A-Za-z]:\//.test(P)},b=p=>p.replace(/%([0-9A-Fa-f]{2})/g,(P,V)=>{const O=Number.parseInt(V,16);return Number.isFinite(O)?String.fromCharCode(O):`%${V}`});if(typeof URL.canParse=="function"?URL.canParse(g):!1){let p=b(new URL(g).pathname||"");return/^\/[A-Za-z]:\//.test(p)&&(p=p.slice(1)),v(p)?p:null}const R=g.replace(/^file:\/\//i,""),_=b(R);return v(_)?_:v(R)?R:null},[]),D=i.useCallback(async()=>{const m=e.mermaid,g=Pe(k.current);if(k.current=g,!m?.url){a("error"),l("Missing Mermaid source URL.");return}if(m.source){o(m.source),a("ready"),l("");return}a("loading"),l("");let v;if(m.url.startsWith("data:"))v=Ee(m.url);else if(m.url.toLowerCase().startsWith("file://")){const b=E(m.url);b?v=Me("/api/fs/raw",{query:{path:b}}).then(M=>M.ok?M.text():Promise.reject(F(`Unable to read Mermaid file. Status: ${M.status}.`))):v=Promise.reject(F("The local Mermaid file path is invalid."))}else{const M=(typeof URL.canParse=="function"?URL.canParse(m.url,window.location.origin):!1)?new URL(m.url,window.location.origin):null;!M||M.protocol!=="http:"&&M.protocol!=="https:"?v=Promise.reject(F("The Mermaid URL protocol is unsupported.")):v=fetch(M.toString()).then(R=>R.ok?R.text():Promise.reject(F(`Unable to load Mermaid diagram. Status: ${R.status}.`)))}await v.then(b=>{q(k.current,g)&&(o(b),a("ready"))}).catch(b=>{q(k.current,g)&&(a("error"),l(Ie(b)?b.message:"Unable to load Mermaid diagram."))})},[E,e.mermaid]);i.useEffect(()=>{!e.open||!e.mermaid||D()},[D,e.mermaid,e.open]),i.useEffect(()=>{if(!e.open)return;const m=g=>{g.key==="Escape"&&n(!1)};return window.addEventListener("keydown",m),()=>{window.removeEventListener("keydown",m)}},[n,e.open]),i.useEffect(()=>{if(!e.open||d!=="ready"){N(null);return}const m=()=>{const _=I.current?.querySelector("svg");if(!_)return!1;const p=ze(_);return!p||!Number.isFinite(p)||p<=0?!1:(N(P=>P&&Math.abs(P-p)<.001?P:p),!0)};let g=window.requestAnimationFrame(()=>{m()||(g=window.requestAnimationFrame(()=>{m()}))}),v=0,b;const M=()=>{v>=_e||(b=window.setTimeout(()=>{v+=1,m()||M()},De))};M();const R=new MutationObserver(()=>{m()});return I.current&&R.observe(I.current,{childList:!0,subtree:!0,attributes:!0}),()=>{window.cancelAnimationFrame(g),typeof b=="number"&&window.clearTimeout(b),R.disconnect()}},[e.open,s,d]);const u=`\`\`\`mermaid
2
+ ${s}
3
+ \`\`\``,w=i.useMemo(()=>{const{maxWidth:m,maxHeight:g}=Fe(T,t),v=Math.max(160,g-Ce);if(j&&j<1){const b=Math.min(m,v);return{width:Math.round(b),height:Math.round(b)}}return{width:Math.round(m),height:Math.round(v)}},[j,t,T]);if(!h||typeof document>"u")return null;const S=r.jsxs("div",{className:L("fixed inset-0 z-50",e.open?"pointer-events-auto":"pointer-events-none"),children:[r.jsx("div",{"aria-hidden":"true",className:L("absolute inset-0",y&&"transition-opacity duration-150 ease-out",f?"opacity-100":"opacity-0"),style:{backgroundColor:"color-mix(in srgb, var(--surface-background) 70%, transparent)"},onMouseDown:()=>n(!1)}),r.jsx("div",{className:L("absolute inset-0 flex items-center justify-center pointer-events-none",t?"p-2.5":"p-4"),children:r.jsxs("div",{className:L("pointer-events-auto flex flex-col gap-2",y&&"transition-opacity duration-150 ease-out",f?"opacity-100":"opacity-0"),style:{width:`${w.width}px`},onMouseDown:m=>m.stopPropagation(),children:[r.jsx("div",{className:"flex items-center justify-end",children:r.jsx("button",{type:"button",className:"h-8 w-8 flex items-center justify-center rounded-lg text-muted-foreground/80 hover:text-foreground focus:outline-none focus:ring-2 focus:ring-primary/60",onClick:()=>n(!1),"aria-label":"Close diagram preview",children:r.jsx(x,{name:"close",className:"h-4 w-4"})})}),r.jsx("div",{className:"relative overflow-hidden",style:{height:`${w.height}px`},children:r.jsxs("div",{className:"h-full overflow-hidden",children:[d==="loading"&&r.jsxs("div",{className:"h-full min-h-28 flex items-center justify-center gap-2 text-muted-foreground typography-meta",children:[r.jsx(x,{name:"loader-4",className:"h-4 w-4 animate-spin"}),r.jsx("span",{children:"Loading diagram..."})]}),d==="error"&&r.jsxs("div",{className:"rounded-xl border p-3 space-y-3",style:{backgroundColor:"var(--status-error-background)",borderColor:"var(--status-error-border)"},children:[r.jsx("p",{className:"typography-markdown",style:{color:"var(--status-error)"},children:c||"Unable to render Mermaid diagram."}),r.jsx("button",{type:"button",onClick:()=>{D()},className:"px-3 py-1.5 rounded-lg typography-meta border transition-colors hover:bg-[var(--interactive-hover)]",style:{borderColor:"var(--interactive-border)",color:"var(--surface-foreground)"},children:"Retry"})]}),d==="ready"&&r.jsx("div",{ref:I,className:"h-full",children:r.jsx(Y,{content:u,variant:"tool",allowMermaidWheelEvents:!0,className:"markdown-mermaid-fullscreen h-full",mermaidControls:Ae,enableFileReferences:!1})})]})})]})})]});return K.createPortal(S,document.body)},We=(e,n)=>{const[t,s]=i.useState(null);return i.useEffect(()=>{let o=!0;return s(null),oe(e,(n||"text").toLowerCase()).then(d=>{o&&s(d)}),()=>{o=!1}},[e,n]),t},Oe=80,Z=20,re=i.memo(e=>{const{lines:n,language:t,maxHeight:s="60vh",showLineNumbers:o=!0,lineStyles:d}=e,{currentTheme:a}=le(),c=i.useMemo(()=>de(a),[a]),l=i.useMemo(()=>n.map(y=>y.text).join(`
4
+ `),[n]),h=We(l,t);return n.length>Oe?r.jsx(ne,{lines:n,highlighted:h,syntaxVars:c,maxHeight:s,showLineNumbers:o,lineStyles:d}):r.jsx("div",{className:"typography-code font-mono w-full min-w-0",style:{...c,maxHeight:s,overflow:"auto"},children:n.map((y,j)=>r.jsx(W,{line:y,html:h?.[j],showLineNumbers:o,style:d?.(y)},j))})});re.displayName="VirtualizedCodeBlock";const ne=i.memo(({lines:e,highlighted:n,syntaxVars:t,maxHeight:s,showLineNumbers:o,lineStyles:d})=>{const a=i.useRef(null),c=`min(${e.length*Z}px, ${s})`,l=ie({count:e.length,getScrollElement:()=>a.current,estimateSize:()=>Z,overscan:20}),h=l.getVirtualItems();return r.jsx("div",{ref:a,className:"typography-code font-mono w-full min-w-0",style:{...t,height:c,maxHeight:s,overflow:"auto"},children:r.jsx("div",{style:{height:l.getTotalSize(),position:"relative"},children:h.map(f=>{const y=e[f.index];return y?r.jsx("div",{"data-index":f.index,ref:l.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${f.start}px)`},children:r.jsx(W,{line:y,html:n?.[f.index],showLineNumbers:o,style:d?.(y)})},f.index):null})})})});ne.displayName="VirtualizedRows";const W=i.memo(({line:e,html:n,showLineNumbers:t,style:s})=>r.jsxs("div",{className:"typography-code font-mono flex w-full min-w-0",style:s,children:[t&&r.jsx("span",{className:"w-10 flex-shrink-0 text-right pr-3 select-none border-r mr-3 -my-0.5 py-0.5",style:{color:"var(--tools-edit-line-number)",borderColor:"var(--tools-border)"},children:!e.isInfo&&e.lineNumber!=null?e.lineNumber:""}),r.jsx("div",{className:"flex-1 min-w-0",children:e.isInfo?r.jsx("div",{className:"whitespace-pre-wrap break-words text-muted-foreground/70 italic",children:e.text}):n!==void 0?r.jsx("div",{className:"whitespace-pre",dangerouslySetInnerHTML:{__html:n}}):r.jsx("div",{className:"whitespace-pre",children:e.text})})]}));W.displayName="VirtualizedCodeBlock.Row";const ae=i.memo(({popup:e,diffViewMode:n,pierreThemeConfig:t})=>{const s=e.content||"";return r.jsx("div",{className:"typography-code",children:r.jsx(Se,{patch:s,metrics:me,options:{diffStyle:n==="unified"?"unified":"split",diffIndicators:"none",hunkSeparators:"line-info-basic",lineDiffType:"none",disableFileHeader:!0,maxLineDiffLength:1e3,expansionLineCount:20,overflow:"wrap",theme:t.theme,themeType:t.themeType,unsafeCSS:ce},className:"block w-full"})})});ae.displayName="DialogUnifiedDiff";const se=i.memo(({popup:e,pierreThemeConfig:n})=>{const t=i.useMemo(()=>ue(e.content),[e.content]),s=e.metadata?.input,o=typeof s=="object"&&s!==null?s:{},d=typeof o.offset=="number"?o.offset:0,a=typeof o.file_path=="string"?o.file_path:typeof o.filePath=="string"?o.filePath:typeof o.path=="string"?o.path:"read-output",c=i.useMemo(()=>t.lines.map(f=>f.text).join(`
5
+ `),[t]),l=i.useMemo(()=>e.language||X(a)||"text",[a,e.language]),h=i.useMemo(()=>{const f=t.lines.some(N=>N.lineNumber!==null),y=[];let j=d;for(const N of t.lines){N.lineNumber!==null&&(j=N.lineNumber);const T=t.type==="file"&&!f&&N.lineNumber===null&&!N.isInfo,k=N.lineNumber??(T?j+1:null);typeof k=="number"&&(j=k),y.push({text:N.text,lineNumber:k,isInfo:N.isInfo})}return y},[d,t]);return t.type==="file"?r.jsx(Q,{file:{name:a,contents:c,lang:l||void 0},options:{disableFileHeader:!0,overflow:"wrap",theme:n.theme,themeType:n.themeType},className:"block w-full"}):r.jsx(re,{lines:h,language:l,maxHeight:"70vh"})});se.displayName="DialogReadContent";const Ue=()=>{const e=he(),n=i.useMemo(()=>U(!1),[]),t=i.useMemo(()=>U(!0),[]),s=i.useMemo(()=>e?.availableThemes??[n,t],[t,n,e?.availableThemes]),o=e?.lightThemeId??n.metadata.id,d=e?.darkThemeId??t.metadata.id,a=i.useMemo(()=>s.find(h=>h.metadata.id===o)??n,[s,n,o]),c=i.useMemo(()=>s.find(h=>h.metadata.id===d)??t,[s,d,t]);i.useEffect(()=>{$(a),$(c)},[c,a]);const l=e?.currentTheme.metadata.variant??"light";return{theme:{light:a.metadata.id,dark:c.metadata.id},themeType:l==="dark"?"dark":"light"}},z={style:{background:"transparent",backgroundColor:"transparent",fontSize:"inherit"}},Ft=({popup:e,onOpenChange:n,isMobile:t})=>{const[s,o]=i.useState("unified"),d=Ue();return i.useEffect(()=>{e.open&&o("unified")},[e.open,e.title]),e.image?r.jsx(Ve,{popup:e,onOpenChange:n,isMobile:t}):e.mermaid?r.jsx(He,{popup:e,onOpenChange:n,isMobile:t}):r.jsx(fe,{open:e.open,onOpenChange:n,children:r.jsxs(ge,{className:L("overflow-hidden flex flex-col min-h-0 pt-3 pb-4 px-4 gap-1","[&>button]:top-1.5",t?"w-[95vw] max-w-[95vw]":"max-w-5xl",t?"[&>button]:right-1":"[&>button]:top-2.5 [&>button]:right-4"),style:{maxHeight:"90vh"},children:[r.jsx("div",{className:"flex-shrink-0 pb-1",children:r.jsxs("div",{className:"flex items-start gap-2 text-foreground typography-ui-header font-semibold",children:[e.metadata?.tool?Re(e.metadata.tool):r.jsx(x,{name:"tools",className:"h-3.5 w-3.5 text-foreground flex-shrink-0"}),r.jsx("span",{className:"break-words flex-1 leading-tight",children:e.title}),e.isDiff&&r.jsx(xe,{mode:s,onModeChange:o,className:"mr-8 flex-shrink-0"})]})}),r.jsx("div",{className:"flex-1 min-h-0 rounded-xl border border-border/30 bg-muted/10 overflow-hidden",children:r.jsxs("div",{className:"tool-output-surface h-full max-h-[75vh] overflow-y-auto px-3 pr-4",children:[e.metadata?.input&&typeof e.metadata.input=="object"&&Object.keys(e.metadata.input).length>0&&e.metadata?.tool!=="todowrite"&&e.metadata?.tool!=="todoread"&&e.metadata?.tool!=="apply_patch"?(()=>{const a=e.metadata,c=a.input,l=h=>{const f=c[h];return typeof f=="string"?f:typeof f=="number"?String(f):null};return r.jsxs("div",{className:"border-b border-border/20 p-4 -mx-3",children:[r.jsx("div",{className:"typography-markdown font-medium text-muted-foreground mb-2 px-3",children:a.tool==="bash"?"Command:":a.tool==="task"?"Task Details:":"Input:"}),a.tool==="bash"&&l("command")?r.jsx("div",{className:"tool-input-surface bg-transparent rounded-xl border border-border/20 mx-3",children:r.jsx(A,{language:"bash",code:l("command"),style:C.getPopupStyles(),codeStyle:z.style,wrap:!0})}):a.tool==="task"&&l("prompt")?r.jsxs("div",{className:"tool-input-surface bg-transparent rounded-xl border border-border/20 font-mono whitespace-pre-wrap text-foreground/90 mx-3",style:C.getPopupStyles(),children:[l("description")?`Task: ${l("description")}
6
+ `:"",l("subagent_type")?`Agent Type: ${l("subagent_type")}
7
+ `:"",`Instructions:
8
+ ${l("prompt")}`]}):a.tool==="write"&&l("content")?r.jsx("div",{className:"tool-input-surface bg-transparent rounded-xl border border-border/20 mx-3",children:r.jsx(Q,{file:{name:l("filePath")||l("file_path")||"new-file",contents:l("content"),lang:X(l("filePath")||l("file_path")||"")||void 0},options:{disableFileHeader:!0,overflow:"wrap",theme:d.theme,themeType:d.themeType},className:"block w-full"})}):r.jsx("div",{className:"tool-input-surface bg-transparent rounded-xl border border-border/20 font-mono whitespace-pre-wrap text-foreground/90 mx-3",style:C.getPopupStyles(),children:we(c,a.tool)})]})})():null,e.isDiff?r.jsx(ae,{popup:e,diffViewMode:s,pierreThemeConfig:d}):e.content?r.jsx("div",{className:"p-4",children:(()=>{const a=e.metadata?.tool;return a==="todowrite"||a==="todoread"?ye(e.content,{total:"Total",inProgress:"In Progress",pending:"Pending",completed:"Completed",cancelled:"Cancelled"})||r.jsx(A,{language:"json",code:e.content,style:C.getPopupContainerStyles(),codeStyle:z.style,wrap:!0}):a==="list"?be(e.content)||r.jsx("pre",{className:"typography-markdown bg-muted/30 p-2 rounded-xl border border-border/20 font-mono whitespace-pre-wrap",children:e.content}):a==="grep"?pe(e.content,t)||r.jsx("pre",{className:"typography-code bg-muted/30 p-2 rounded-xl border border-border/20 font-mono whitespace-pre-wrap",children:e.content}):a==="glob"?ve(e.content,t)||r.jsx("pre",{className:"typography-code bg-muted/30 p-2 rounded-xl border border-border/20 font-mono whitespace-pre-wrap",children:e.content}):a==="task"||a==="reasoning"?r.jsx("div",{className:a==="reasoning"?"text-muted-foreground/70":"",children:r.jsx(Y,{content:e.content,variant:"tool"})}):a==="web-search"||a==="websearch"||a==="search_web"?je(e.content)||r.jsx(A,{language:"text",code:e.content,style:C.getPopupContainerStyles(),codeStyle:z.style,wrap:!0}):a==="read"?r.jsx(se,{popup:e,pierreThemeConfig:d}):(e.content?Ne(e.content):{isJson:!1}).isJson?r.jsx(ke,{jsonString:e.content,initiallyExpandedDepth:3,maxHeight:"70vh"}):r.jsx(A,{language:e.language||"text",code:e.content,style:C.getPopupContainerStyles(),codeStyle:z.style,wrap:!0})})()}):r.jsxs("div",{className:"p-8 text-muted-foreground typography-ui-header",children:[r.jsx("div",{className:"mb-2",children:"Command completed successfully"}),r.jsx("div",{className:"typography-meta",children:"No output was produced"})]})]})})]})})};export{Ft as default};
@@ -0,0 +1 @@
1
+ import{k as s}from"./vendor-boot-Dgb9NVFe.js";import{R as i}from"./vendor-react-DASdDPIk.js";import{P as f}from"./PatchDiff-BQnRFN30.js";import{dA as T,dB as u,aX as k,dM as y}from"./useAppFontEffects-BisjofNZ.js";import{ensurePierreThemeRegistered as l}from"./appThemeRegistry-gegrE2dq.js";import{_ as d}from"./index-BnZVqcki.js";import"./vendor-clsx-B-dksMZM.js";import"./web-components-CdMfsnXE.js";import"./computeVirtualFileMetrics-CyhUKEfv.js";import"./vendor-vite-runtime-DD1OZmLC.js";import"./vendor-shiki-Bbf2GEcE.js";import"./vendor-shikijs-core-CGM_jqPK.js";import"./vendor-shikijs-types-CPSbSeK6.js";import"./vendor-shikijs-vscode-textmate-BgLrS_2D.js";import"./vendor-hast-util-to-html-BKBhbTDb.js";import"./vendor-html-void-elements-CkdplsNl.js";import"./vendor-property-information-rJCbAzvX.js";import"./vendor-zwitch-C2o2j-tx.js";import"./vendor-stringify-entities-CsH1VEn9.js";import"./vendor-character-entities-legacy-BpoLgcEt.js";import"./vendor-character-entities-html4-D7taRCQ7.js";import"./vendor-ccount-c2V3InAJ.js";import"./vendor-comma-separated-tokens-D8TqSuIK.js";import"./vendor-space-separated-tokens-DD3iYX1K.js";import"./vendor-hast-util-whitespace-D4Wp6AEg.js";import"./vendor-shikijs-engine-oniguruma-DPWuIF1G.js";import"./themeResolver-yJ9XpNMI.js";import"./vendor-pierre-theming-Dgp7B_O4.js";import"./vendor-shikijs-engine-javascript-Cme4830A.js";import"./vendor-oniguruma-to-es-DLBnFDCE.js";import"./vendor-oniguruma-parser-C0D4_9rT.js";import"./vendor-regex-BBWcyTkg.js";import"./vendor-regex-utilities-2BQyy0xI.js";import"./vendor-regex-recursion-JU4mF-dD.js";import"./vendor-shikijs-transformers-CZWsLLKm.js";import"./Virtualizer-Cp_cJWbI.js";import"./VirtualizedFileDiff-IWqCJNXu.js";import"./renderDiffWithHighlighter-ByZtK9za.js";import"./vendor-diff-C3JhlQdm.js";import"./vendor-zustand-CUi8eEds.js";import"./runtimeSurface-DBiUWYK2.js";import"./nativeFileSave-BzhtrDoD.js";import"./vendor-tailwind-merge-CPcsbTWB.js";import"./vendor-fuse.js-Dw8P0qyA.js";import"./registerCustomTheme-DmolaWWZ.js";const D=()=>{const t=k(),e=i.useMemo(()=>d(!1),[]),r=i.useMemo(()=>d(!0),[]),o=i.useMemo(()=>t?.availableThemes??[e,r],[r,e,t?.availableThemes]),a=t?.lightThemeId??e.metadata.id,m=t?.darkThemeId??r.metadata.id,n=i.useMemo(()=>o.find(p=>p.metadata.id===a)??e,[o,e,a]),h=i.useMemo(()=>o.find(p=>p.metadata.id===m)??r,[o,m,r]);l(n),l(h);const c=t?.currentTheme.metadata.variant??"light";return{pierreTheme:{light:n.metadata.id,dark:h.metadata.id},pierreThemeType:c==="dark"?"dark":"light"}};class b extends i.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidUpdate(e){e.resetKey!==this.props.resetKey&&this.state.hasError&&this.setState({hasError:!1})}componentDidCatch(e){}render(){return this.state.hasError?this.props.fallback:this.props.children}}const g=i.memo(({diff:t,diffViewMode:e})=>{const{pierreTheme:r,pierreThemeType:o}=D(),a=i.useMemo(()=>({diffStyle:e==="side-by-side"?"split":"unified",diffIndicators:"none",hunkSeparators:"line-info-basic",lineDiffType:"none",disableFileHeader:!0,maxLineDiffLength:1e3,expansionLineCount:20,overflow:"wrap",theme:r,themeType:o,unsafeCSS:T}),[e,r,o]),m=s.jsx(y,{diff:t});return s.jsx("div",{className:"typography-code px-1 pb-1 pt-0",children:s.jsx(b,{resetKey:t,fallback:m,children:s.jsx(f,{patch:t,metrics:u,options:a,className:"block w-full"})})})});g.displayName="ToolPartDiffPreview";export{g as default};
@@ -1,4 +1,4 @@
1
- import{a as Te,e as Qe,j as et,s as tt,b as Xe,c as Fe,k as it,i as nt,d as Ye,g as Ne,f as he,h as st,R as rt,I as ot,p as Ue,l as at,m as lt,n as ht,x as Pe,S as dt,o as ut,w as ft,q as Oe,u as ct,t as pt,v as Ae,y as gt,z as mt,r as Ct,A as St,C as vt,B as yt,F as Ht}from"./web-components-v9fuidaX.js";import{t as w,B as Se,y as Lt,o as Tt,d as At,i as ke,q as U,u as ce,s as kt,b as Rt,f as Be,w as Y,x as Ze,C as Re}from"./computeVirtualFileMetrics-3PpRLd5B.js";import{h as xt,a as se,i as be,b as re,r as Dt,g as Et,c as ve,d as we,e as oe,f as Me,j as ae}from"./renderDiffWithHighlighter-l8hZWWBO.js";import{dv as bt,dw as wt,de as Ie,c5 as _,dx as Mt,dy as It,di as Ve,dj as zt,dk as Ft,dl as Nt,dm as Ut,dn as Pt}from"./useAppFontEffects--lKKtKVo.js";import{c as Ot}from"./vendor-diff-C3JhlQdm.js";import{t as le}from"./vendor-hast-util-to-html-BKBhbTDb.js";function Z(e,t,i,n=!1){const s=bt(Ot(e.name,t.name,e.contents,t.contents,e.header,t.header,i),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:n});if(s==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return t.lang!=null&&(s.lang=t.lang),s}var Bt=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,i){if(t==null||i==null)for(const n of e.children??[])n instanceof HTMLElement&&("deletions"in n.dataset?t=n:"additions"in n.dataset&&(i=n));if(i==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==i&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=i,i.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function pe(e){return w({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function ge(e){return w({tagName:"div",children:[w({tagName:"span",children:[Se("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function xe(e){return w({tagName:"div",children:[Lt({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function K({type:e,content:t,expandIndex:i,chunked:n=!1,slotName:s,isFirstHunk:r,isLastHunk:o}){let a=0;const l=[];if(e==="metadata"&&t!=null&&l.push(w({tagName:"div",children:[Se(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const u=[];i!=null&&(n?(r||(u.push(xe("up")),a++),o||(u.push(xe("down")),a++)):(u.push(xe(!r&&!o?"both":r?"down":"up")),a++)),u.push(w({tagName:"div",children:[w({tagName:"span",children:[Se(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),n&&i!=null&&u.push(w({tagName:"div",children:[Se("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),l.push(w({tagName:"div",children:u,properties:{"data-separator-wrapper":"","data-separator-multi-button":a>1?"":void 0}}))}return e==="custom"&&s!=null&&l.push(w({tagName:"slot",properties:{name:s}})),w({tagName:"div",children:l,properties:{"data-separator":l.length===0?"simple":e,"data-expand-index":i,"data-separator-first":r?"":void 0,"data-separator-last":o?"":void 0}})}function Vt(e,t){return`hunk-separator-${e}-${t}`}function Gt(e){const t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function Wt(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function $t(e){return e!==""?e.split(wt):[]}function G(e,t){const i=Z({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:i.hunks,splitLineCount:i.splitLineCount,unifiedLineCount:i.unifiedLineCount,additionLines:i.additionLines,deletionLines:i.deletionLines,type:i.type}}function _t(e,t){const i=e.deletionLines.join(""),n=i===`
1
+ import{a as Te,e as Qe,j as et,s as tt,b as Xe,c as Fe,k as it,i as nt,d as Ye,g as Ne,f as he,h as st,R as rt,I as ot,p as Ue,l as at,m as lt,n as ht,x as Pe,S as dt,o as ut,w as ft,q as Oe,u as ct,t as pt,v as Ae,y as gt,z as mt,r as Ct,A as St,C as vt,B as yt,F as Ht}from"./web-components-CdMfsnXE.js";import{t as w,B as Se,y as Lt,o as Tt,d as At,i as ke,q as U,u as ce,s as kt,b as Rt,f as Be,w as Y,x as Ze,C as Re}from"./computeVirtualFileMetrics-CyhUKEfv.js";import{h as xt,a as se,i as be,b as re,r as Dt,g as Et,c as ve,d as we,e as oe,f as Me,j as ae}from"./renderDiffWithHighlighter-ByZtK9za.js";import{dv as bt,dw as wt,de as Ie,c5 as _,dx as Mt,dy as It,di as Ve,dj as zt,dk as Ft,dl as Nt,dm as Ut,dn as Pt}from"./useAppFontEffects-BisjofNZ.js";import{c as Ot}from"./vendor-diff-C3JhlQdm.js";import{t as le}from"./vendor-hast-util-to-html-BKBhbTDb.js";function Z(e,t,i,n=!1){const s=bt(Ot(e.name,t.name,e.contents,t.contents,e.header,t.header,i),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:n});if(s==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return t.lang!=null&&(s.lang=t.lang),s}var Bt=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,i){if(t==null||i==null)for(const n of e.children??[])n instanceof HTMLElement&&("deletions"in n.dataset?t=n:"additions"in n.dataset&&(i=n));if(i==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==i&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=i,i.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function pe(e){return w({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function ge(e){return w({tagName:"div",children:[w({tagName:"span",children:[Se("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function xe(e){return w({tagName:"div",children:[Lt({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function K({type:e,content:t,expandIndex:i,chunked:n=!1,slotName:s,isFirstHunk:r,isLastHunk:o}){let a=0;const l=[];if(e==="metadata"&&t!=null&&l.push(w({tagName:"div",children:[Se(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const u=[];i!=null&&(n?(r||(u.push(xe("up")),a++),o||(u.push(xe("down")),a++)):(u.push(xe(!r&&!o?"both":r?"down":"up")),a++)),u.push(w({tagName:"div",children:[w({tagName:"span",children:[Se(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),n&&i!=null&&u.push(w({tagName:"div",children:[Se("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),l.push(w({tagName:"div",children:u,properties:{"data-separator-wrapper":"","data-separator-multi-button":a>1?"":void 0}}))}return e==="custom"&&s!=null&&l.push(w({tagName:"slot",properties:{name:s}})),w({tagName:"div",children:l,properties:{"data-separator":l.length===0?"simple":e,"data-expand-index":i,"data-separator-first":r?"":void 0,"data-separator-last":o?"":void 0}})}function Vt(e,t){return`hunk-separator-${e}-${t}`}function Gt(e){const t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function Wt(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function $t(e){return e!==""?e.split(wt):[]}function G(e,t){const i=Z({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:i.hunks,splitLineCount:i.splitLineCount,unifiedLineCount:i.unifiedLineCount,additionLines:i.additionLines,deletionLines:i.deletionLines,type:i.type}}function _t(e,t){const i=e.deletionLines.join(""),n=i===`
2
2
  `?`
3
3
  `:`
4
4
  `,s=Z({name:e.prevName??e.name,contents:i},{name:e.name,contents:n,lang:e.lang},t);return{hunks:s.hunks,splitLineCount:s.splitLineCount,unifiedLineCount:s.unifiedLineCount,additionLines:[""],deletionLines:s.deletionLines,type:s.type}}function jt(e,t,i){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return B(e,G(e,i));const n=Array.from(t);if(n.length===0)return B(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(const r of n){const o=e.additionLines[r],a=e.deletionLines[r];if(o==null||a==null||Ie(o)===Ie(a))return B(e,G(e,i))}const s=qt(e,n);if(s.size===0)return B(e,G(e,i));for(const r of s)if(!Xt(e,r,i))return B(e,G(e,i));return Qt(e),xt(e)?B(e,G(e,i)):B(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function B(e,t){return Object.assign(e,t),t}function qt(e,t){const i=new Set;for(const n of t){const s=Kt(e,n);if(s==null)return new Set;i.add(s)}return i}function Kt(e,t){for(const[i,n]of e.hunks.entries()){const s=n.additionLineIndex+n.additionCount;if(t>=n.additionLineIndex&&t<s)return i}}function Xt(e,t,i){const n=e.hunks[t];if(n==null)return!1;const s=e.deletionLines.slice(n.deletionLineIndex,n.deletionLineIndex+n.deletionCount),r=e.additionLines.slice(n.additionLineIndex,n.additionLineIndex+n.additionCount),o=Z({name:e.prevName??e.name,contents:s.join("")},{name:e.name,contents:r.join(""),lang:e.lang},{...i,context:0}),a=o.hunks[0];return a==null||o.hunks.length!==1?!1:(Zt(n,a),Yt(e,t),!0)}function Yt(e,t){const i=e.hunks[t];if(i==null)return;if(t!==e.hunks.length-1){i.noEOFCRAdditions=!1,i.noEOFCRDeletions=!1;return}const n=e.additionLines.at(-1),s=e.deletionLines.at(-1);i.noEOFCRAdditions=n!=null&&n!==""&&!n.endsWith(`
@@ -1 +1 @@
1
- import{a as t}from"./vendor-react-DASdDPIk.js";import{j as o}from"./vendor-boot-DyL2td56.js";const c={position:"absolute",top:0,bottom:0,textAlign:"center",whiteSpace:"normal",touchAction:"none"},l={display:"contents"};function x(){return null}function d(e){const n=t.useRef(e);return t.useInsertionEffect(()=>{n.current=e}),t.useCallback((...r)=>n.current(...r),[])}const f=t.createContext(void 0),s=t.createContext(void 0);function p(){return t.useContext(s)}function m(e,n){return typeof window>"u"&&n!=null?o.jsxs(o.Fragment,{children:[o.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:n}}),e]}):o.jsx(o.Fragment,{children:e})}const a=t.createContext(void 0);function C(){return t.useContext(a)}export{c as G,l as M,f as W,p as a,d as b,x as n,m as t,C as u};
1
+ import{a as t}from"./vendor-react-DASdDPIk.js";import{k as o}from"./vendor-boot-Dgb9NVFe.js";const c={position:"absolute",top:0,bottom:0,textAlign:"center",whiteSpace:"normal",touchAction:"none"},l={display:"contents"};function x(){return null}function d(e){const n=t.useRef(e);return t.useInsertionEffect(()=>{n.current=e}),t.useCallback((...r)=>n.current(...r),[])}const f=t.createContext(void 0),s=t.createContext(void 0);function p(){return t.useContext(s)}function m(e,n){return typeof window>"u"&&n!=null?o.jsxs(o.Fragment,{children:[o.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:n}}),e]}):o.jsx(o.Fragment,{children:e})}const a=t.createContext(void 0);function C(){return t.useContext(a)}export{c as G,l as M,f as W,p as a,d as b,x as n,m as t,C as u};
@@ -1 +1 @@
1
- import{j as l}from"./vendor-boot-DyL2td56.js";import{a as i}from"./vendor-react-DASdDPIk.js";import{o as a}from"./index-Dd2OcIUY.js";import{C as n,a as p,b as m}from"./vendor-base-ui-DIkTOIJS.js";const d=n,x=({className:e,asChild:o,children:s,...t})=>{const r=o&&i.isValidElement(s)?{render:s}:{children:s};return l.jsx(p,{className:a("flex w-full items-center justify-between rounded-lg px-2 py-1.5 text-left text-foreground hover:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",e),...t,...r})},g=({className:e,...o})=>l.jsx(m,{className:a("overflow-hidden data-[closed]:animate-collapsible-up data-[open]:animate-collapsible-down",e),...o});export{d as C,x as a,g as b};
1
+ import{k as l}from"./vendor-boot-Dgb9NVFe.js";import{a as i}from"./vendor-react-DASdDPIk.js";import{o as a}from"./index-BnZVqcki.js";import{C as n,a as p,b as m}from"./vendor-base-ui-BscvGUFt.js";const d=n,x=({className:e,asChild:o,children:s,...t})=>{const r=o&&i.isValidElement(s)?{render:s}:{children:s};return l.jsx(p,{className:a("flex w-full items-center justify-between rounded-lg px-2 py-1.5 text-left text-foreground hover:bg-interactive-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",e),...t,...r})},g=({className:e,...o})=>l.jsx(m,{className:a("overflow-hidden data-[closed]:animate-collapsible-up data-[open]:animate-collapsible-down",e),...o});export{d as C,x as a,g as b};
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-shiki-Bbf2GEcE.js","assets/vendor-vite-runtime-DD1OZmLC.js","assets/vendor-shikijs-core-CGM_jqPK.js","assets/vendor-shikijs-types-CPSbSeK6.js","assets/vendor-shikijs-vscode-textmate-BgLrS_2D.js","assets/vendor-hast-util-to-html-BKBhbTDb.js","assets/vendor-html-void-elements-CkdplsNl.js","assets/vendor-property-information-rJCbAzvX.js","assets/vendor-zwitch-C2o2j-tx.js","assets/vendor-stringify-entities-CsH1VEn9.js","assets/vendor-character-entities-legacy-BpoLgcEt.js","assets/vendor-character-entities-html4-D7taRCQ7.js","assets/vendor-ccount-c2V3InAJ.js","assets/vendor-comma-separated-tokens-D8TqSuIK.js","assets/vendor-space-separated-tokens-DD3iYX1K.js","assets/vendor-hast-util-whitespace-D4Wp6AEg.js","assets/vendor-shikijs-engine-oniguruma-DPWuIF1G.js"])))=>i.map(i=>d[i]);
2
- import{_ as I}from"./vendor-vite-runtime-DD1OZmLC.js";import{b as j,c as O}from"./vendor-shiki-Bbf2GEcE.js";import{t as f}from"./themeResolver-yJ9XpNMI.js";import{s as M,p as F,n as v}from"./vendor-pierre-theming-Dgp7B_O4.js";import{c as N}from"./vendor-shikijs-engine-oniguruma-DPWuIF1G.js";import{c as z}from"./vendor-shikijs-engine-javascript-Cme4830A.js";import{c5 as L,dd as G}from"./useAppFontEffects--lKKtKVo.js";import{t as H}from"./vendor-shikijs-transformers-CZWsLLKm.js";function pe(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ue(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}const T=new Set;function E(e,t){e=Array.isArray(e)?e:[e];for(let r of e){let n;if(typeof r=="string"){if(n=f.getResolvedTheme(r),n==null)throw new Error(`loadResolvedThemes: ${r} is not resolved, you must resolve it before calling loadResolvedThemes`)}else n=r,r=r.name,f.getResolvedTheme(r)==null&&f.seedResolvedTheme(r,n);T.has(r)||(T.add(r),t.loadThemeSync(n))}}const g=new Map,k=new Map,V=new Map,$=new Set;function R(e,t){e=Array.isArray(e)?e:[e];for(const r of e){if($.has(r.name))continue;let n=g.get(r.name);n==null&&(n=r,g.set(r.name,n)),$.add(n.name),t.loadLanguageSync(n.data)}}function S(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function A(e){if(S())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=k.get(e);if(t!=null)return t;try{let r=V.get(e);if(r==null&&Object.prototype.hasOwnProperty.call(j,e)&&(r=j[e]),r==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const n=r().then(({default:o})=>{const s={name:e,data:o};return g.has(e)||g.set(e,s),s});return k.set(e,n),await n}finally{k.delete(e)}}function D(e){return g.get(e)??A(e)}function W(e){if(S())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(f.hasRegisteredTheme(e))return;const t=M.getTheme(e);if(t!=null){f.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function P(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function U(e){W(e);const t=await f.resolveTheme(e);return P(e,t),t}function K(e){return f.getResolvedTheme(e)??U(e)}let c;async function fe({themes:e,langs:t,preferredHighlighter:r="shiki-js"}){c??=O({themes:[],langs:["text"],engine:r==="shiki-wasm"?N(I(()=>import("./vendor-shiki-Bbf2GEcE.js").then(a=>a.w),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))):z()});const n=X(c)?await c:c;c=n;const o=[];for(const a of t){if(a==="text"||a==="ansi")continue;const i=D(a);"then"in i?o.push(i):R(i,n)}const s=[];for(const a of e){const i=K(a);"then"in i?s.push(i):E(i,c)}return(o.length>0||s.length>0)&&await Promise.all([Promise.all(o).then(a=>{R(a,n)}),Promise.all(s).then(a=>{E(a,n)})]),n}function de(){if(c!=null&&!("then"in c))return c}function X(e=c){return e!=null&&"then"in e}for(const e of F.getThemes())f.registerThemeIfAbsent(e.name,e.load);function me(e=L){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}const d=new Map;let B=0;const h={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function he(e){if(d.has(e))return d.get(e)??"text";if(h[e]!=null)return h[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(d.has(t[1]))return d.get(t[1])??"text";if(h[t[1]]!=null)return h[t[1]]??"text"}const r=e.match(/\.([^.]+)$/)?.[1]??"";return d.has(r)?d.get(r)??"text":h[r]??"text"}function ge(){return B}function be(){return Object.fromEntries(d)}function q(e){return{type:"text",value:e}}function m({tagName:e,children:t=[],properties:r={}}){return{type:"element",tagName:e,properties:r,children:t}}function ye({name:e,width:t=16,height:r=16,properties:n}){return m({tagName:"svg",properties:{width:t,height:r,viewBox:"0 0 16 16",...n},children:[m({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function J(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function ve(e){return m({tagName:"div",properties:{"data-gutter":""},children:e})}function ke(e,t,r,n={}){return m({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":r,...n},children:t!=null?[m({tagName:"span",properties:{"data-line-number-content":""},children:[q(`${t}`)]})]:void 0})}function we(e,t,r){return m({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":r,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${r};`:`grid-row: span ${r};min-height:calc(${r} * 1lh);`}})}function Q(e,t,r){const n=typeof r.lineInfo=="function"?r.lineInfo(t):r.lineInfo[t-1];if(n==null){const o=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(o,{node:e,line:t,state:r}),new Error(o)}return e.tagName="div",e.properties["data-line"]=n.lineNumber,e.properties["data-alt-line"]=n.altLineNumber,e.properties["data-line-type"]=n.type,e.properties["data-line-index"]=n.lineIndex,e.children.length===0&&e.children.push(q(`
2
+ import{_ as I}from"./vendor-vite-runtime-DD1OZmLC.js";import{b as j,c as O}from"./vendor-shiki-Bbf2GEcE.js";import{t as f}from"./themeResolver-yJ9XpNMI.js";import{s as M,p as F,n as v}from"./vendor-pierre-theming-Dgp7B_O4.js";import{c as N}from"./vendor-shikijs-engine-oniguruma-DPWuIF1G.js";import{c as z}from"./vendor-shikijs-engine-javascript-Cme4830A.js";import{c5 as L,dd as G}from"./useAppFontEffects-BisjofNZ.js";import{t as H}from"./vendor-shikijs-transformers-CZWsLLKm.js";function pe(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function ue(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}const T=new Set;function E(e,t){e=Array.isArray(e)?e:[e];for(let r of e){let n;if(typeof r=="string"){if(n=f.getResolvedTheme(r),n==null)throw new Error(`loadResolvedThemes: ${r} is not resolved, you must resolve it before calling loadResolvedThemes`)}else n=r,r=r.name,f.getResolvedTheme(r)==null&&f.seedResolvedTheme(r,n);T.has(r)||(T.add(r),t.loadThemeSync(n))}}const g=new Map,k=new Map,V=new Map,$=new Set;function R(e,t){e=Array.isArray(e)?e:[e];for(const r of e){if($.has(r.name))continue;let n=g.get(r.name);n==null&&(n=r,g.set(r.name,n)),$.add(n.name),t.loadLanguageSync(n.data)}}function S(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}async function A(e){if(S())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=k.get(e);if(t!=null)return t;try{let r=V.get(e);if(r==null&&Object.prototype.hasOwnProperty.call(j,e)&&(r=j[e]),r==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const n=r().then(({default:o})=>{const s={name:e,data:o};return g.has(e)||g.set(e,s),s});return k.set(e,n),await n}finally{k.delete(e)}}function D(e){return g.get(e)??A(e)}function W(e){if(S())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(f.hasRegisteredTheme(e))return;const t=M.getTheme(e);if(t!=null){f.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function P(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function U(e){W(e);const t=await f.resolveTheme(e);return P(e,t),t}function K(e){return f.getResolvedTheme(e)??U(e)}let c;async function fe({themes:e,langs:t,preferredHighlighter:r="shiki-js"}){c??=O({themes:[],langs:["text"],engine:r==="shiki-wasm"?N(I(()=>import("./vendor-shiki-Bbf2GEcE.js").then(a=>a.w),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))):z()});const n=X(c)?await c:c;c=n;const o=[];for(const a of t){if(a==="text"||a==="ansi")continue;const i=D(a);"then"in i?o.push(i):R(i,n)}const s=[];for(const a of e){const i=K(a);"then"in i?s.push(i):E(i,c)}return(o.length>0||s.length>0)&&await Promise.all([Promise.all(o).then(a=>{R(a,n)}),Promise.all(s).then(a=>{E(a,n)})]),n}function de(){if(c!=null&&!("then"in c))return c}function X(e=c){return e!=null&&"then"in e}for(const e of F.getThemes())f.registerThemeIfAbsent(e.name,e.load);function me(e=L){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}const d=new Map;let B=0;const h={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function he(e){if(d.has(e))return d.get(e)??"text";if(h[e]!=null)return h[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(d.has(t[1]))return d.get(t[1])??"text";if(h[t[1]]!=null)return h[t[1]]??"text"}const r=e.match(/\.([^.]+)$/)?.[1]??"";return d.has(r)?d.get(r)??"text":h[r]??"text"}function ge(){return B}function be(){return Object.fromEntries(d)}function q(e){return{type:"text",value:e}}function m({tagName:e,children:t=[],properties:r={}}){return{type:"element",tagName:e,properties:r,children:t}}function ye({name:e,width:t=16,height:r=16,properties:n}){return m({tagName:"svg",properties:{width:t,height:r,viewBox:"0 0 16 16",...n},children:[m({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function J(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function ve(e){return m({tagName:"div",properties:{"data-gutter":""},children:e})}function ke(e,t,r,n={}){return m({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":r,...n},children:t!=null?[m({tagName:"span",properties:{"data-line-number-content":""},children:[q(`${t}`)]})]:void 0})}function we(e,t,r){return m({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":r,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${r};`:`grid-row: span ${r};min-height:calc(${r} * 1lh);`}})}function Q(e,t,r){const n=typeof r.lineInfo=="function"?r.lineInfo(t):r.lineInfo[t-1];if(n==null){const o=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(o,{node:e,line:t,state:r}),new Error(o)}return e.tagName="div",e.properties["data-line"]=n.lineNumber,e.properties["data-alt-line"]=n.altLineNumber,e.properties["data-line-type"]=n.type,e.properties["data-line-index"]=n.lineIndex,e.children.length===0&&e.children.push(q(`
3
3
  `)),e}const b=Symbol("no-token"),w=Symbol("multiple-tokens");function _(e){const t=Y(e);if(t!=null)return t;let r=b;const n=[];let o=[],s;const a=()=>{if(o.length===0||s==null){o=[],s=void 0;return}if(o.length===1){const l=o[0];if(l?.type==="element"){Z(l,s);for(const p of l.children)y(p)}else y(l);n.push(l),o=[],s=void 0;return}for(const l of o)y(l);n.push(m({tagName:"span",properties:{"data-char":s},children:o})),o=[],s=void 0},i=l=>{if(l!==b){if(l===w){r=w;return}if(r===b){r=l;return}r!==l&&(r=w)}};for(const l of e.children){const p=l.type==="element"?_(l):b;if(i(p),typeof p!="number"){a(),n.push(l);continue}s!=null&&s!==p&&a(),s??=p,o.push(l)}return a(),e.children=n,r}function Y(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function y(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)y(t)}}function Z(e,t){e.properties["data-char"]=t}function xe(e=!1,t=!1){const r={lineInfo:[]},n=[{line(o){return delete o.properties.class,o},pre(o){const s=J(o),a=[];if(s!=null){let i=1;for(const l of s.children)l.type==="element"&&(e&&_(l),a.push(Q(l,i,r)),i++);s.children=a}return o},...e?{tokens(o){for(const s of o){let a=0;for(const i of s){const l=i;l.__lineChar??=a,a+=i.content.length}}},preprocess(o,s){s.mergeWhitespaces="never"},span(o,s,a,i,l){if(l?.offset!=null&&l.content!=null){const p=l.__lineChar;return p!=null&&(o.properties["data-char"]=p),o}return o}}:null}];return t&&n.push(ee,C),e&&n.push({line:o=>(o.type==="element"&&o.children.length===0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]}),o)}),{state:r,transformers:n,toClass:C}}const C=H({classPrefix:"hl-"}),ee={name:"token-style-normalizer",tokens(e){for(const t of e)for(const r of t){if(r.htmlStyle!=null)continue;const n={};r.color!=null&&(n.color=r.color),r.bgColor!=null&&(n["background-color"]=r.bgColor),r.fontStyle!=null&&r.fontStyle!==0&&((r.fontStyle&1)!==0&&(n["font-style"]="italic"),(r.fontStyle&2)!==0&&(n["font-weight"]="bold"),(r.fontStyle&4)!==0&&(n["text-decoration"]="underline")),Object.keys(n).length>0&&(r.htmlStyle=n)}}};function u(e){return`--${e==="token"?"diffs-token":"diffs"}-`}function je({theme:e=L,highlighter:t,prefix:r}){let n="";if(typeof e=="string"){const o=t.getTheme(e),s=v(o);n+=`color:${s.fg};`,n+=`background-color:${s.bg};`,n+=`${u("global")}fg:${s.fg};`,n+=`${u("global")}bg:${s.bg};`,n+=x(o,r)}else{let o=t.getTheme(e.dark),s=v(o);n+=`${u("global")}dark:${s.fg};`,n+=`${u("global")}dark-bg:${s.bg};`,n+=x(o,"dark"),o=t.getTheme(e.light),s=v(o),n+=`${u("global")}light:${s.fg};`,n+=`${u("global")}light-bg:${s.bg};`,n+=x(o,"light")}return n}function x(e,t){t=t!=null?`${t}-`:"";let r="";const n=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];n!=null&&(r+=`${u("global")}${t}addition-color:${n};`);const o=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];o!=null&&(r+=`${u("global")}${t}deletion-color:${o};`);const s=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return s!=null&&(r+=`${u("global")}${t}modified-color:${s};`),r}function Te(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}function Ee(e){return{...G,...e}}function $e(e,t){const r=te(e,t);return t?r:e.diffHeaderHeight+r}function te(e,t){return e.paddingTop??(t?e.spacing:0)}function Re(e){return e.paddingBottom??e.spacing}function Ce(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}export{$ as A,q as B,Ee as C,g as R,me as a,pe as b,E as c,fe as d,be as e,ue as f,D as g,ge as h,he as i,xe as j,je as k,Te as l,u as m,Ce as n,de as o,W as p,we as q,A as r,ke as s,m as t,ve as u,P as v,$e as w,Re as x,ye as y,T as z};
@@ -1 +1 @@
1
- import{m as a}from"./index-Dd2OcIUY.js";import{co as c,cn as l,cl as u,cp as d}from"./useAppFontEffects--lKKtKVo.js";const o=5e3,f=(r,t)=>{if(!r)return 1;let e=1;for(let n=0;n<r.length;n+=1)if(r.charCodeAt(n)===10&&(e+=1,e>t))return e;return e},y=r=>{const e=(r instanceof Error?r.message:String(r??"")).toLowerCase();return e.includes("file not found")||e.includes("not found")||e.includes("enoent")||e.includes("no such file")||e.includes("does not exist")?"missing":"unreadable"},m=async(r,t,e)=>{if(r.readFile)return(await r.readFile(t,{optional:!0,directory:e?.directory})).content??"";const n=new URLSearchParams({path:t,optional:"true"});e?.directory&&n.set("directory",e.directory);const i=await a(`/api/fs/read?${n.toString()}`,{cache:"no-store",headers:e?.directory?{"x-pichamber-directory":e.directory}:void 0});if(!i.ok){const s=await i.json().catch(()=>({error:i.statusText}));throw new Error(s.error||"Failed to read file")}return i.text()},w=async(r,t,e)=>{if(c(t)||l(t)||u(t))return{ok:!0};try{const n=await m(r,t,e);return d(n)?{ok:!1,reason:"binary"}:f(n,o)>o?{ok:!1,reason:"too-large"}:{ok:!0}}catch(n){return{ok:!1,reason:y(n)}}},x=r=>r==="too-large"?`File is too large to open (>${o.toLocaleString("en-US")} lines)`:r==="missing"?"File not found":r==="binary"?"Cannot preview binary file":"Failed to open file";export{x as g,w as v};
1
+ import{m as a}from"./index-BnZVqcki.js";import{co as c,cn as l,cl as u,cp as d}from"./useAppFontEffects-BisjofNZ.js";const o=5e3,f=(r,t)=>{if(!r)return 1;let e=1;for(let n=0;n<r.length;n+=1)if(r.charCodeAt(n)===10&&(e+=1,e>t))return e;return e},y=r=>{const e=(r instanceof Error?r.message:String(r??"")).toLowerCase();return e.includes("file not found")||e.includes("not found")||e.includes("enoent")||e.includes("no such file")||e.includes("does not exist")?"missing":"unreadable"},m=async(r,t,e)=>{if(r.readFile)return(await r.readFile(t,{optional:!0,directory:e?.directory})).content??"";const n=new URLSearchParams({path:t,optional:"true"});e?.directory&&n.set("directory",e.directory);const i=await a(`/api/fs/read?${n.toString()}`,{cache:"no-store",headers:e?.directory?{"x-pichamber-directory":e.directory}:void 0});if(!i.ok){const s=await i.json().catch(()=>({error:i.statusText}));throw new Error(s.error||"Failed to read file")}return i.text()},w=async(r,t,e)=>{if(c(t)||l(t)||u(t))return{ok:!0};try{const n=await m(r,t,e);return d(n)?{ok:!1,reason:"binary"}:f(n,o)>o?{ok:!1,reason:"too-large"}:{ok:!0}}catch(n){return{ok:!1,reason:y(n)}}},x=r=>r==="too-large"?`File is too large to open (>${o.toLocaleString("en-US")} lines)`:r==="missing"?"File not found":r==="binary"?"Cannot preview binary file":"Failed to open file";export{x as g,w as v};
@@ -1 +1 @@
1
- import{j as e}from"./vendor-boot-DyL2td56.js";import{R as x}from"./vendor-react-DASdDPIk.js";import{a8 as w,ab as y,B as N,I as b,ad as S,cu as C,cv as t}from"./useAppFontEffects--lKKtKVo.js";const v=x.memo(function({scope:n,isGitRepo:a,branchAvailable:i,allCount:l,workingCount:o,stagedCount:c,turnCount:d,branchCount:m,onScopeChange:p}){const[f,u]=x.useState(!1),g=n==="all"?l:n==="staged"?c:n==="turn"?d:n==="branch"?m:o,j=n==="staged"?"Staged":n==="turn"?"Last turn":n==="branch"?"Branch":n==="all"?"All":"Changed";return e.jsxs(w,{open:f,onOpenChange:u,children:[e.jsx(y,{asChild:!0,children:e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"h-8 flex-shrink-0 gap-1.5 px-2 py-1 normal-case","aria-label":"Select change mode",children:[e.jsxs("span",{className:"whitespace-nowrap font-medium",children:[j,e.jsxs("span",{className:"diff-toolbar__scope-count",children:[": ",g]})]}),e.jsx(b,{name:"arrow-down-s",className:"size-4 flex-shrink-0 opacity-60"})]})}),e.jsx(S,{align:"start",className:"w-40",children:e.jsxs(C,{value:n,onValueChange:r=>{(r==="all"||r==="working"||r==="staged"||r==="turn"||r==="branch")&&(p?.(r),u(!1))},children:[a!==!1?e.jsx(t,{value:"all",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[e.jsx("span",{children:"All"}),e.jsx("span",{className:"typography-meta text-muted-foreground",children:l})]})}):null,a!==!1?e.jsx(t,{value:"working",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[e.jsx("span",{children:"Changed"}),e.jsx("span",{className:"typography-meta text-muted-foreground",children:o})]})}):null,a!==!1?e.jsx(t,{value:"staged",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[e.jsx("span",{children:"Staged"}),e.jsx("span",{className:"typography-meta text-muted-foreground",children:c})]})}):null,e.jsx(t,{value:"turn",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[e.jsx("span",{children:"Last turn"}),e.jsx("span",{className:"typography-meta text-muted-foreground",children:d})]})}),i?e.jsx(t,{value:"branch",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[e.jsx("span",{children:"Branch"}),e.jsx("span",{className:"typography-meta text-muted-foreground",children:m})]})}):null]})})]})}),h={"?":{code:"?",color:"var(--status-info)",description:"Untracked file"},A:{code:"A",color:"var(--status-success)",description:"New file"},D:{code:"D",color:"var(--status-error)",description:"Deleted file"},R:{code:"R",color:"var(--status-info)",description:"Renamed file"},C:{code:"C",color:"var(--status-info)",description:"Copied file"},M:{code:"M",color:"var(--status-warning)",description:"Modified file"}};function D(s){const n=s.index?.trim(),a=s.working_dir?.trim(),i=n&&n!=="?"?n.charAt(0):a?.charAt(0)||n?.charAt(0)||"M";return h[i]??h.M}function R(s){const n=s.index?.trim();return!!(n&&n!=="?")}function B(s){return!!s.working_dir?.trim()||s.index?.trim()==="?"}function _(s){const n=s.index?.trim(),a=s.working_dir?.trim();return n==="A"||a==="A"||n==="?"||a==="?"}export{v as C,B as a,_ as b,D as d,R as i};
1
+ import{k as e}from"./vendor-boot-Dgb9NVFe.js";import{R as x}from"./vendor-react-DASdDPIk.js";import{a8 as w,ab as y,B as N,I as b,ad as S,cu as k,cv as t}from"./useAppFontEffects-BisjofNZ.js";const v=x.memo(function({scope:n,isGitRepo:a,branchAvailable:i,allCount:l,workingCount:o,stagedCount:c,turnCount:d,branchCount:m,onScopeChange:p}){const[f,u]=x.useState(!1),g=n==="all"?l:n==="staged"?c:n==="turn"?d:n==="branch"?m:o,j=n==="staged"?"Staged":n==="turn"?"Last turn":n==="branch"?"Branch":n==="all"?"All":"Changed";return e.jsxs(w,{open:f,onOpenChange:u,children:[e.jsx(y,{asChild:!0,children:e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"h-8 flex-shrink-0 gap-1.5 px-2 py-1 normal-case","aria-label":"Select change mode",children:[e.jsxs("span",{className:"whitespace-nowrap font-medium",children:[j,e.jsxs("span",{className:"diff-toolbar__scope-count",children:[": ",g]})]}),e.jsx(b,{name:"arrow-down-s",className:"size-4 flex-shrink-0 opacity-60"})]})}),e.jsx(S,{align:"start",className:"w-40",children:e.jsxs(k,{value:n,onValueChange:r=>{(r==="all"||r==="working"||r==="staged"||r==="turn"||r==="branch")&&(p?.(r),u(!1))},children:[a!==!1?e.jsx(t,{value:"all",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[e.jsx("span",{children:"All"}),e.jsx("span",{className:"typography-meta text-muted-foreground",children:l})]})}):null,a!==!1?e.jsx(t,{value:"working",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[e.jsx("span",{children:"Changed"}),e.jsx("span",{className:"typography-meta text-muted-foreground",children:o})]})}):null,a!==!1?e.jsx(t,{value:"staged",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[e.jsx("span",{children:"Staged"}),e.jsx("span",{className:"typography-meta text-muted-foreground",children:c})]})}):null,e.jsx(t,{value:"turn",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[e.jsx("span",{children:"Last turn"}),e.jsx("span",{className:"typography-meta text-muted-foreground",children:d})]})}),i?e.jsx(t,{value:"branch",children:e.jsxs("span",{className:"flex min-w-0 flex-1 items-center justify-between gap-3",children:[e.jsx("span",{children:"Branch"}),e.jsx("span",{className:"typography-meta text-muted-foreground",children:m})]})}):null]})})]})}),h={"?":{code:"?",color:"var(--status-info)",description:"Untracked file"},A:{code:"A",color:"var(--status-success)",description:"New file"},D:{code:"D",color:"var(--status-error)",description:"Deleted file"},R:{code:"R",color:"var(--status-info)",description:"Renamed file"},C:{code:"C",color:"var(--status-info)",description:"Copied file"},M:{code:"M",color:"var(--status-warning)",description:"Modified file"}};function D(s){const n=s.index?.trim(),a=s.working_dir?.trim(),i=n&&n!=="?"?n.charAt(0):a?.charAt(0)||n?.charAt(0)||"M";return h[i]??h.M}function R(s){const n=s.index?.trim();return!!(n&&n!=="?")}function B(s){return!!s.working_dir?.trim()||s.index?.trim()==="?"}function _(s){const n=s.index?.trim(),a=s.working_dir?.trim();return n==="A"||a==="A"||n==="?"||a==="?"}export{v as C,B as a,_ as b,D as d,R as i};
@@ -1,10 +1,10 @@
1
- import{S as m,T as p,U as u,V as w}from"./GitHubDetailScaffold-q4YP8iyJ.js";import{a5 as f}from"./useAppFontEffects--lKKtKVo.js";const x=[{id:"open",label:"Open"},{id:"closed",label:"Closed"},{id:"all",label:"All"}],k=[{id:"all",label:"All"},{id:"mine",label:"Created by me"},{id:"assigned",label:"Assigned to me"},{id:"mentioned",label:"Mentioned"}],y=[{id:"updated",label:"Recently updated"},{id:"newest",label:"Newest"},{id:"oldest",label:"Oldest"}],N=[{id:"completed",label:"Completed"},{id:"not_planned",label:"Not planned"}],_=(e,t,s)=>{if(!t&&e!=="comment")return{allowed:!1,reason:"Issue is still loading"};switch(e){case"close":return t?.state==="closed"?{allowed:!1,reason:"Already closed"}:u(s)?{allowed:!1,reason:"You need write access or be the author to close"}:{allowed:!0,reason:null};case"reopen":return t?.state!=="closed"?{allowed:!1,reason:"Already open"}:u(s)?{allowed:!1,reason:"You need write access or be the author to reopen"}:{allowed:!0,reason:null};case"edit":return u(s)?{allowed:!1,reason:"You need write access or be the author to edit"}:{allowed:!0,reason:null};case"labels":return p(s)?{allowed:!1,reason:"You need write access to change labels"}:{allowed:!0,reason:null};case"assignees":return p(s)?{allowed:!1,reason:"You need write access to change assignees"}:{allowed:!0,reason:null};case"comment":return m(s);default:return{allowed:!0,reason:null}}},E=(e,t)=>{switch(e){case"close-not-planned":return{title:`Close issue #${t} as not planned?`,detail:"The issue will close without being completed. You can reopen it later.",confirm:"Close as not planned",progress:"Closing…"};case"reopen":return{title:`Reopen issue #${t}?`,detail:"The issue will return to its previous open state.",confirm:"Reopen issue",progress:"Reopening…"};default:return{title:`Close issue #${t} as completed?`,detail:"The issue will be recorded as completed. You can reopen it later.",confirm:"Close as completed",progress:"Closing…"}}},L=e=>e==="reopen"?{state:"open"}:{state:"closed",stateReason:e==="close-not-planned"?"not_planned":"completed"},P=e=>{const t={},s=w(e.title,300);return s&&(t.title=s),e.body!==void 0&&e.body.length>2e5&&(t.body="Body is too long"),{ok:Object.keys(t).length===0,errors:t}},A=(e,t)=>e.trim()?t.trim()?`${e.replace(/\s+$/,"")}
1
+ import{U as m,V as p,W as u,X as w}from"./GitHubDetailScaffold-BZhP67Va.js";import{a5 as f}from"./useAppFontEffects-BisjofNZ.js";const x=[{id:"open",label:"Open"},{id:"closed",label:"Closed"},{id:"all",label:"All"}],k=[{id:"all",label:"All"},{id:"mine",label:"Created by me"},{id:"assigned",label:"Assigned to me"},{id:"mentioned",label:"Mentioned"}],y=[{id:"updated",label:"Recently updated"},{id:"newest",label:"Newest"},{id:"oldest",label:"Oldest"}],N=[{id:"completed",label:"Completed"},{id:"not_planned",label:"Not planned"}],_=(e,t,s)=>{if(!t&&e!=="comment")return{allowed:!1,reason:"Issue is still loading"};switch(e){case"close":return t?.state==="closed"?{allowed:!1,reason:"Already closed"}:u(s)?{allowed:!1,reason:"You need write access or be the author to close"}:{allowed:!0,reason:null};case"reopen":return t?.state!=="closed"?{allowed:!1,reason:"Already open"}:u(s)?{allowed:!1,reason:"You need write access or be the author to reopen"}:{allowed:!0,reason:null};case"edit":return u(s)?{allowed:!1,reason:"You need write access or be the author to edit"}:{allowed:!0,reason:null};case"labels":return p(s)?{allowed:!1,reason:"You need write access to change labels"}:{allowed:!0,reason:null};case"assignees":return p(s)?{allowed:!1,reason:"You need write access to change assignees"}:{allowed:!0,reason:null};case"comment":return m(s);default:return{allowed:!0,reason:null}}},E=(e,t)=>{switch(e){case"close-not-planned":return{title:`Close issue #${t} as not planned?`,detail:"The issue will close without being completed. You can reopen it later.",confirm:"Close as not planned",progress:"Closing…"};case"reopen":return{title:`Reopen issue #${t}?`,detail:"The issue will return to its previous open state.",confirm:"Reopen issue",progress:"Reopening…"};default:return{title:`Close issue #${t} as completed?`,detail:"The issue will be recorded as completed. You can reopen it later.",confirm:"Close as completed",progress:"Closing…"}}},L=e=>e==="reopen"?{state:"open"}:{state:"closed",stateReason:e==="close-not-planned"?"not_planned":"completed"},P=e=>{const t={},s=w(e.title,300);return s&&(t.title=s),e.body!==void 0&&e.body.length>2e5&&(t.body="Body is too long"),{ok:Object.keys(t).length===0,errors:t}},A=(e,t)=>e.trim()?t.trim()?`${e.replace(/\s+$/,"")}
2
2
 
3
- ${t}`:e:t,S=e=>e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"issue",R=(e,t)=>`issue-${e}-${S(t)}`,G=(e,t)=>{const s=e.trim();if(!s)return{link:null,outOfScope:!1};const c=s.match(/^#(\d{1,7})$/);if(c)return{link:{kind:"issue",number:Number(c[1]),owner:"",repo:""},outOfScope:!1};const r=s.match(/^([\w.-]+)\/([\w.-]+)#(\d{1,7})$/);if(r){const l=r[1].toLowerCase(),n=r[2].toLowerCase(),a=Number(r[3]);return t.some(i=>i.owner?.toLowerCase()===l&&i.repo?.toLowerCase()===n)?{link:{kind:"issue",number:a,owner:l,repo:n},outOfScope:!1}:{link:null,outOfScope:!0}}const o=s.match(/^https?:\/\/([^/]+)\/([\w.-]+)\/([\w.-]+)\/(issues|pull)\/(\d{1,7})(?:[/?#].*)?$/i);if(o){const l=o[1].toLowerCase(),n=o[2].toLowerCase(),a=o[3].toLowerCase().replace(/\.git$/,""),d=o[4].toLowerCase()==="pull"?"pr":"issue",i=Number(o[5]);return t.some(b=>b.ref.toLowerCase()===`${l}/${n}/${a}`)?{link:{kind:d,number:i,owner:n,repo:a},outOfScope:!1}:{link:null,outOfScope:!0}}return{link:null,outOfScope:!1}},H=e=>`Work on this GitHub issue. Read the quoted context below, then propose a plan and wait for confirmation before changing code.
3
+ ${t}`:e:t,h=e=>e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"issue",R=(e,t)=>`issue-${e}-${h(t)}`,G=(e,t)=>{const s=e.trim();if(!s)return{link:null,outOfScope:!1};const c=s.match(/^#(\d{1,7})$/);if(c)return{link:{kind:"issue",number:Number(c[1]),owner:"",repo:""},outOfScope:!1};const r=s.match(/^([\w.-]+)\/([\w.-]+)#(\d{1,7})$/);if(r){const l=r[1].toLowerCase(),n=r[2].toLowerCase(),a=Number(r[3]);return t.some(i=>i.owner?.toLowerCase()===l&&i.repo?.toLowerCase()===n)?{link:{kind:"issue",number:a,owner:l,repo:n},outOfScope:!1}:{link:null,outOfScope:!0}}const o=s.match(/^https?:\/\/([^/]+)\/([\w.-]+)\/([\w.-]+)\/(issues|pull)\/(\d{1,7})(?:[/?#].*)?$/i);if(o){const l=o[1].toLowerCase(),n=o[2].toLowerCase(),a=o[3].toLowerCase().replace(/\.git$/,""),d=o[4].toLowerCase()==="pull"?"pr":"issue",i=Number(o[5]);return t.some(b=>b.ref.toLowerCase()===`${l}/${n}/${a}`)?{link:{kind:d,number:i,owner:n,repo:a},outOfScope:!1}:{link:null,outOfScope:!0}}return{link:null,outOfScope:!1}},H=e=>`Work on this GitHub issue. Read the quoted context below, then propose a plan and wait for confirmation before changing code.
4
4
 
5
5
  Issue #${e.number}: ${e.title}
6
6
  ${e.url}
7
7
 
8
- ${e.contextText}`,h="GitHub issue context (JSON)",g="GitHub pull request context (JSON)",T=e=>{const t=e.kind==="pr"?"PR":"Issue",s=e.title.trim()||"(untitled)";return`${t} #${e.number}: ${s}`},C=e=>{const t=e.title.trim()||"(untitled)";return e.kind==="pr"?`${g}
9
- ${JSON.stringify({pr:{number:e.number,title:t,url:e.url}})}`:`${h}
10
- ${JSON.stringify({issue:{number:e.number,title:t,url:e.url}})}`},U=()=>({appendVisibleText:e=>{f.getState().setPendingInputText(e,"append")},appendSyntheticText:e=>{const t=f.getState(),s=t.pendingSyntheticParts??[];t.setPendingSyntheticParts([...s,{text:e,synthetic:!0}])}}),V=(e,t)=>{t.appendVisibleText(T(e)),t.appendSyntheticText(C(e)),e.contextText.trim()&&t.appendSyntheticText(e.contextText)};export{N as C,x as I,y as a,k as b,H as c,C as d,V as e,U as f,_ as g,L as h,R as i,E as j,A as k,G as p,S as s,P as v};
8
+ ${e.contextText}`,S="GitHub issue context (JSON)",g="GitHub pull request context (JSON)",C=e=>{const t=e.kind==="pr"?"PR":"Issue",s=e.title.trim()||"(untitled)";return`${t} #${e.number}: ${s}`},T=e=>{const t=e.title.trim()||"(untitled)";return e.kind==="pr"?`${g}
9
+ ${JSON.stringify({pr:{number:e.number,title:t,url:e.url}})}`:`${S}
10
+ ${JSON.stringify({issue:{number:e.number,title:t,url:e.url}})}`},U=()=>({appendVisibleText:e=>{f.getState().setPendingInputText(e,"append")},appendSyntheticText:e=>{const t=f.getState(),s=t.pendingSyntheticParts??[];t.setPendingSyntheticParts([...s,{text:e,synthetic:!0}])}}),V=(e,t)=>{t.appendVisibleText(C(e)),t.appendSyntheticText(T(e)),e.contextText.trim()&&t.appendSyntheticText(e.contextText)};export{N as C,x as I,y as a,k as b,H as c,T as d,V as e,U as f,_ as g,L as h,R as i,E as j,A as k,G as p,h as s,P as v};