@pi-chamber/web 1.0.6-rc.3 → 1.0.6-rc.5

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 (137) hide show
  1. package/dist/assets/{DiagramView-Dq5w8TCG.js → DiagramView--XO16VPB.js} +1 -1
  2. package/dist/assets/DiffView-Duy2_7Gp.js +18 -0
  3. package/dist/assets/{FileSaveConflictDialog-dFqLbFzT.js → FileSaveConflictDialog-B1DvL9zy.js} +2 -2
  4. package/dist/assets/FilesView-CjjPpE4c.js +6 -0
  5. package/dist/assets/{GitHubDetailScaffold-B2HRjT8V.js → GitHubDetailScaffold-DqxAKqCT.js} +4 -4
  6. package/dist/assets/{GitHubLinkPicker-D7I3J9_O.js → GitHubLinkPicker-ELF_chia.js} +1 -1
  7. package/dist/assets/GitHubListPrimitives-C2nGTntk.js +1 -0
  8. package/dist/assets/GitView-5fIq2nzM.js +9 -0
  9. package/dist/assets/IssuesSurface-Dq5A_bWq.js +7 -0
  10. package/dist/assets/{JsonTreeView-BJr5kBg4.js → JsonTreeView-BjFFSUwi.js} +1 -1
  11. package/dist/assets/MarkdownRendererImpl-B9Cu4TCh.js +12 -0
  12. package/dist/assets/{PatchDiff-B6RBZULC.js → PatchDiff-CTqTTcg7.js} +1 -1
  13. package/dist/assets/{PierreDiffViewer-YJJQkE7t.js → PierreDiffViewer-H2f4pJ1k.js} +15 -3
  14. package/dist/assets/PullRequestsSurface-DPpb2RW_.js +2 -0
  15. package/dist/assets/SessionSwitcherContent-B5DaBWZU.js +1 -0
  16. package/dist/assets/{SessionSwitcherDropdown-CEAid1Bd.js → SessionSwitcherDropdown-D86FaZg_.js} +2 -2
  17. package/dist/assets/SessionUnreadDot-CY9-1iV2.js +1 -0
  18. package/dist/assets/SettingsView-CiIuOi_E.js +6 -0
  19. package/dist/assets/{SettingsWindow-5dK-buUn.js → SettingsWindow-Bw1dUoJ1.js} +1 -1
  20. package/dist/assets/{StickyHorizontalScrollbar-p7EbL2-E.js → StickyHorizontalScrollbar-DNsbTLS7.js} +1 -1
  21. package/dist/assets/{ToolOutputDialog-gITobhpo.js → ToolOutputDialog-aR4kcgKL.js} +5 -5
  22. package/dist/assets/{ToolPartDiffPreview-nOJxBl-Y.js → ToolPartDiffPreview-B_wWmhtE.js} +1 -1
  23. package/dist/assets/{VirtualizedFileDiff-BmJk6XJm.js → VirtualizedFileDiff-BYby097w.js} +4 -4
  24. package/dist/assets/{Virtualizer-DNJrJKVb.js → Virtualizer-okhy9Aq3.js} +1 -1
  25. package/dist/assets/{collapsible-0yfy07W2.js → collapsible-Dz0bPrJ_.js} +1 -1
  26. package/dist/assets/{computeVirtualFileMetrics-BCFpa-1q.js → computeVirtualFileMetrics-8MuwxSC6.js} +1 -1
  27. package/dist/assets/{contextFileOpenGuard-BCi5nTZp.js → contextFileOpenGuard-fZ2NIQMQ.js} +1 -1
  28. package/dist/assets/fileTreeStatus-BzhMMLA9.js +7 -0
  29. package/dist/assets/gitStatusPredicates-Cyh9UhYX.js +1 -0
  30. package/dist/assets/{githubLink-CCmFsyTF.js → githubLink-D2PznPcI.js} +2 -2
  31. package/dist/assets/{index-BaeFf5Q8.js → index-BX5pAOQX.js} +1 -1
  32. package/dist/assets/index-Cs2nBW_t.js +11 -0
  33. package/dist/assets/index-tmO0fZa4.css +1 -0
  34. package/dist/assets/main-7vBNPBMb.js +137 -0
  35. package/dist/assets/{main-CgXs2e27.js → main-BI6qe8pz.js} +2 -2
  36. package/dist/assets/{markdownCore-DTNVLpYS.js → markdownCore-D5jiabKe.js} +1 -1
  37. package/dist/assets/{miniChat-CrAin_em.js → miniChat-B3up4Bnz.js} +2 -2
  38. package/dist/assets/{mobile-EK9oTupb.js → mobile-B4vLFgBc.js} +2 -2
  39. package/dist/assets/{nativeFileSave-Bhafll_7.js → nativeFileSave-DpBH1Sa3.js} +1 -1
  40. package/dist/assets/{pi-session-focus-preference-BoN1cyoG.js → pi-session-focus-preference-BrB72skF.js} +3 -3
  41. package/dist/assets/{renderDiffWithHighlighter-DixZh5Zd.js → renderDiffWithHighlighter-B6T04JGG.js} +1 -1
  42. package/dist/assets/renderElectronMiniChatApp-CX10w321.js +2 -0
  43. package/dist/assets/{renderFileWithHighlighter-s6fQq9eg.js → renderFileWithHighlighter-DtAcGyJr.js} +1 -1
  44. package/dist/assets/renderMobileApp-C9n-BhPZ.js +11 -0
  45. package/dist/assets/runtimeEndpointReset-aGyXPXPs.js +62 -0
  46. package/dist/assets/{runtimeSurface-CJN1oo_1.js → runtimeSurface-DiP2a57a.js} +1 -1
  47. package/dist/assets/useAppFontEffects-Oyin3dgQ.js +215 -0
  48. package/dist/assets/useGitHubRemoteSearch-CZ9Hauw0.js +1 -0
  49. package/dist/assets/useSwitcherItems-BSqDA1IF.js +1 -0
  50. package/dist/assets/{vendor-aparajita-capacitor-secure-storage-BLsm9T1Y.js → vendor-aparajita-capacitor-secure-storage-DVZvgYu4.js} +1 -1
  51. package/dist/assets/{vendor-base-ui-C7vVMZTg.js → vendor-base-ui-BCqPBzDj.js} +1 -1
  52. package/dist/assets/{vendor-boot-CoTxysn6.js → vendor-boot-3SaHYVb1.js} +18 -18
  53. package/dist/assets/{vendor-capacitor-app-NX6DULfp.js → vendor-capacitor-app-NbQ-WiPS.js} +1 -1
  54. package/dist/assets/{vendor-capacitor-keyboard-DJD81I9f.js → vendor-capacitor-keyboard-CgrHt8iN.js} +1 -1
  55. package/dist/assets/{vendor-capacitor-status-bar-DV24OoQV.js → vendor-capacitor-status-bar-CWt0OF5t.js} +1 -1
  56. package/dist/assets/{vendor-codemirror-autocomplete-qsuH4Dh-.js → vendor-codemirror-autocomplete-WThuuUAz.js} +1 -1
  57. package/dist/assets/{vendor-codemirror-lang-angular-ZHWyBf7j.js → vendor-codemirror-lang-angular-BbLGCxF6.js} +1 -1
  58. package/dist/assets/{vendor-codemirror-lang-cpp-pCTOmv-k.js → vendor-codemirror-lang-cpp-Cceks-9O.js} +1 -1
  59. package/dist/assets/{vendor-codemirror-lang-css-2bFuyM70.js → vendor-codemirror-lang-css-D1wpUg3Z.js} +1 -1
  60. package/dist/assets/{vendor-codemirror-lang-go-DrG_c7D7.js → vendor-codemirror-lang-go-Cv0zXHHM.js} +1 -1
  61. package/dist/assets/{vendor-codemirror-lang-html-BV8lrR8v.js → vendor-codemirror-lang-html-DbL8oT9H.js} +1 -1
  62. package/dist/assets/{vendor-codemirror-lang-java-DrsvH6T2.js → vendor-codemirror-lang-java-CNugenuC.js} +1 -1
  63. package/dist/assets/{vendor-codemirror-lang-javascript-Dkzl3s07.js → vendor-codemirror-lang-javascript-Bx_FIyZF.js} +1 -1
  64. package/dist/assets/{vendor-codemirror-lang-jinja-8Nn3bnoP.js → vendor-codemirror-lang-jinja-DDGjB3Zq.js} +1 -1
  65. package/dist/assets/{vendor-codemirror-lang-json-CsdmtHhi.js → vendor-codemirror-lang-json-DIvqf9Pb.js} +1 -1
  66. package/dist/assets/{vendor-codemirror-lang-less-DJuZ4cZe.js → vendor-codemirror-lang-less-D8r9dGG1.js} +1 -1
  67. package/dist/assets/{vendor-codemirror-lang-liquid-D2RO-Pzr.js → vendor-codemirror-lang-liquid-B24mguYi.js} +1 -1
  68. package/dist/assets/{vendor-codemirror-lang-markdown-C0Zu3b3n.js → vendor-codemirror-lang-markdown-v3yG2sbf.js} +1 -1
  69. package/dist/assets/{vendor-codemirror-lang-php-CuDtt2Zj.js → vendor-codemirror-lang-php-BcZGalqy.js} +1 -1
  70. package/dist/assets/{vendor-codemirror-lang-python-Cv2exx_M.js → vendor-codemirror-lang-python-b-JqEwQy.js} +1 -1
  71. package/dist/assets/{vendor-codemirror-lang-rust-C4TxJ6Rg.js → vendor-codemirror-lang-rust-B1uZxDW-.js} +1 -1
  72. package/dist/assets/{vendor-codemirror-lang-sass-BmtPz8kf.js → vendor-codemirror-lang-sass-DqPrngKp.js} +1 -1
  73. package/dist/assets/{vendor-codemirror-lang-sql-BF1ZaXqJ.js → vendor-codemirror-lang-sql-UyCnpt-k.js} +1 -1
  74. package/dist/assets/{vendor-codemirror-lang-vue-DZgXrP2k.js → vendor-codemirror-lang-vue-xDwYkovV.js} +1 -1
  75. package/dist/assets/{vendor-codemirror-lang-wast-DsnaGtL_.js → vendor-codemirror-lang-wast-CF3169p_.js} +1 -1
  76. package/dist/assets/{vendor-codemirror-lang-xml-D8DzzFat.js → vendor-codemirror-lang-xml-FCtVhuOb.js} +1 -1
  77. package/dist/assets/{vendor-codemirror-lang-yaml-D5hBv7m6.js → vendor-codemirror-lang-yaml-g0sPmAnv.js} +1 -1
  78. package/dist/assets/{vendor-codemirror-language-data-vn2RyN9T.js → vendor-codemirror-language-data-B03xgzP2.js} +2 -2
  79. package/dist/assets/{vendor-codemirror-search-BVCYIV0D.js → vendor-codemirror-search-Dw3Wpu15.js} +1 -1
  80. package/dist/assets/{vendor-lezer-cpp-vqXSn3lv.js → vendor-lezer-cpp-Cu3E-KUI.js} +1 -1
  81. package/dist/assets/{vendor-lezer-css-JnEzSyZR.js → vendor-lezer-css-Cb8vp67u.js} +1 -1
  82. package/dist/assets/{vendor-lezer-go-dD2gQMIL.js → vendor-lezer-go-BTsIaOm7.js} +1 -1
  83. package/dist/assets/{vendor-lezer-html-Cr3U-1pu.js → vendor-lezer-html-UQMsUwj-.js} +1 -1
  84. package/dist/assets/{vendor-lezer-java-CRM0IMCo.js → vendor-lezer-java-BIWrFrAx.js} +1 -1
  85. package/dist/assets/{vendor-lezer-javascript-B3s21DIS.js → vendor-lezer-javascript-BH2Etgoy.js} +1 -1
  86. package/dist/assets/{vendor-lezer-json-DPFM6EBV.js → vendor-lezer-json-CE-QUCwM.js} +1 -1
  87. package/dist/assets/{vendor-lezer-lr-Bllrq8hY.js → vendor-lezer-lr-HY6Yc0Vr.js} +1 -1
  88. package/dist/assets/{vendor-lezer-markdown-6-3PLvXG.js → vendor-lezer-markdown-xFL3Evwf.js} +1 -1
  89. package/dist/assets/{vendor-lezer-php-DOyzfHRl.js → vendor-lezer-php-Cr_mQGrG.js} +1 -1
  90. package/dist/assets/{vendor-lezer-python-CdHdN5qt.js → vendor-lezer-python-BNRFWCb0.js} +1 -1
  91. package/dist/assets/{vendor-lezer-rust-CqnW8EMH.js → vendor-lezer-rust-BvfOK5cU.js} +1 -1
  92. package/dist/assets/{vendor-lezer-sass-BbcF4y6A.js → vendor-lezer-sass-qoxiLisk.js} +1 -1
  93. package/dist/assets/{vendor-lezer-xml-C31AyWoo.js → vendor-lezer-xml--x8SSpqU.js} +1 -1
  94. package/dist/assets/{vendor-lezer-yaml-Cv908yC2.js → vendor-lezer-yaml-BDo1JaEr.js} +1 -1
  95. package/dist/assets/{vendor-replit-codemirror-vim-Cwhyn_5f.js → vendor-replit-codemirror-vim-D1Fe7FiY.js} +1 -1
  96. package/dist/assets/{web-components-Bz5oGa3p.js → web-components-CkTNGkJ2.js} +4 -4
  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/git/DOCUMENTATION.md +1 -0
  102. package/server/lib/git/routes.js +14 -0
  103. package/server/lib/git/routes.test.js +37 -0
  104. package/server/lib/git/service.js +27 -0
  105. package/server/lib/git/service.test.js +32 -0
  106. package/server/lib/pi/archive-store.js +38 -10
  107. package/server/lib/pi/archive-store.test.js +10 -0
  108. package/server/lib/pi/routes.js +107 -2
  109. package/server/lib/pi/routes.test.js +255 -0
  110. package/server/lib/pi/session-daemon/DOCUMENTATION.md +5 -1
  111. package/server/lib/pi/session-daemon/session-daemon-engines.test.js +18 -0
  112. package/server/lib/pi/session-daemon/session-daemon.js +24 -1
  113. package/server/lib/pi/session-shelf-store.js +252 -0
  114. package/server/lib/pi/session-shelf-store.test.js +174 -0
  115. package/server/lib/pi/ui-settings-store.js +60 -0
  116. package/server/lib/pi/ui-settings-store.test.js +105 -6
  117. package/dist/assets/DiffView-CFIjN2zy.js +0 -18
  118. package/dist/assets/FilesView-D0b2mEKA.js +0 -6
  119. package/dist/assets/GitHubListPrimitives-Dw5LAmzm.js +0 -1
  120. package/dist/assets/GitView-Dhr7qVeI.js +0 -9
  121. package/dist/assets/IssuesSurface-Bya7OsRl.js +0 -7
  122. package/dist/assets/MarkdownRendererImpl-DadkFPCz.js +0 -12
  123. package/dist/assets/PullRequestsSurface-D8JpzP5l.js +0 -2
  124. package/dist/assets/SessionSwitcherContent-CJ6C2ZKG.js +0 -1
  125. package/dist/assets/SessionUnreadDot-I1_tmqY9.js +0 -1
  126. package/dist/assets/SettingsView-B-b76XDV.js +0 -6
  127. package/dist/assets/gitStatusPredicates-BQOqDJU1.js +0 -1
  128. package/dist/assets/index-C2ISrmRR.js +0 -11
  129. package/dist/assets/index-DgwThEwf.css +0 -1
  130. package/dist/assets/main-DoVzQV56.js +0 -137
  131. package/dist/assets/renderElectronMiniChatApp-0MqKeGfI.js +0 -2
  132. package/dist/assets/renderMobileApp-BLoXL_J8.js +0 -11
  133. package/dist/assets/runtimeEndpointReset-Bv2Y1fMm.js +0 -62
  134. package/dist/assets/useAppFontEffects-D2xXdmYC.js +0 -215
  135. package/dist/assets/useFilesViewSearch-BKotcAUN.js +0 -7
  136. package/dist/assets/useGitHubRemoteSearch-CZ92xKSw.js +0 -1
  137. package/dist/assets/useSwitcherItems-BfA4omGb.js +0 -1
@@ -0,0 +1 @@
1
+ import{j as e,bW as me,bX as he,bY as fe,bZ as pe,b_ as xe,aP as ge}from"./vendor-boot-3SaHYVb1.js";import{R as h}from"./vendor-react-Bz1tRBxM.js";import{f as G,j as be,p as je}from"./index-Cs2nBW_t.js";import{B as N,I as H,ah as ye,t as O,cb as ve,cc as we,cd as Ne,ce as Ce,cf as ke,z as Se,A as I,bm as Re,a as He,bO as Ge,bN as Y,eb as Pe,a$ as J,b0 as ee,b1 as se,bT as Le,ec as K,b2 as Me,d_ as te,d$ as ne,dH as Ee,dI as Te,dJ as De}from"./useAppFontEffects-Oyin3dgQ.js";import{a7 as U,L as Fe,bc as ze,bd as Ie}from"./runtimeEndpointReset-aGyXPXPs.js";import{a as $e,G as re,b as Be,c as Ae,d as _e,e as Oe,f as Ke,g as qe,h as We}from"./GitHubListPrimitives-C2nGTntk.js";import{c as Ye}from"./vendor-zustand-CXhN0IMY.js";import{K as Ue,C as Ve,D as Qe}from"./GitHubDetailScaffold-DqxAKqCT.js";const ae=s=>s?s.kind==="rate-limited"?{reason:"rate-limited",retryAt:s.retryAt??null}:s.kind==="failed"?{reason:"failed",message:s.message}:{reason:s.reason,scopes:s.scopes??[]}:{reason:"failed",message:"GitHub request failed"},$=({command:s,label:t})=>{const i=h.useCallback(()=>{ye(s).then(a=>{O[a.ok?"success":"error"](a.ok?"Command copied":"Failed to copy command")}).catch(()=>O.error("Failed to copy command"))},[s]);return e.jsxs("span",{className:"inline-flex max-w-full items-center gap-1.5",children:[e.jsx("code",{className:"min-w-0 truncate rounded bg-[var(--surface-muted)] px-1.5 py-0.5 font-mono typography-micro text-foreground",children:s}),e.jsx("button",{type:"button",onClick:i,className:"shrink-0 rounded p-1 text-muted-foreground hover:bg-interactive-hover hover:text-foreground",title:t??`Copy ${s}`,"aria-label":t??`Copy ${s}`,children:e.jsx(H,{name:"file-copy",className:"size-3.5"})})]})},k=({icon:s,title:t,description:i,children:a})=>e.jsx($e,{icon:s,title:t,description:i,action:a?e.jsx("div",{className:"mt-1 flex flex-wrap items-center justify-center gap-2",children:a}):void 0}),T=({info:s,onRetry:t,isRetrying:i})=>{const a=t?e.jsxs(N,{type:"button",variant:"outline",size:"sm",onClick:t,disabled:i,children:[e.jsx(H,{name:"refresh",className:"size-3.5"}),i?"Checking…":"Check again"]}):null;switch(s.reason){case"gh-missing":return e.jsxs(k,{icon:"github-fill",title:"GitHub CLI not found",description:"Install the GitHub CLI on the machine running PiChamber to browse pull requests and issues.",children:[e.jsx($,{command:"gh --version",label:"Copy gh version check"}),a]});case"gh-outdated":return e.jsxs(k,{icon:"github-fill",title:"GitHub CLI too old",description:"Update gh on the machine running PiChamber, then check again.",children:[e.jsx($,{command:"gh upgrade",label:"Copy gh upgrade command"}),a]});case"gh-unauthenticated":return e.jsxs(k,{icon:"github-fill",title:"Not signed in",description:"Run gh auth login on the machine running PiChamber, then check again.",children:[e.jsx($,{command:"gh auth login",label:"Copy gh auth login command"}),a]});case"not-github":return e.jsx(k,{icon:"git-repository",title:"Not a GitHub repository",description:"This directory is a git repository, but none of its remotes point at GitHub."});case"no-repository":return e.jsx(k,{icon:"git-repository",title:"No repository here",description:"Open a directory inside a git repository to browse pull requests and issues."});case"no-access":return e.jsx(k,{icon:"lock",title:"No access",description:"The signed-in GitHub account cannot access this repository. Check the remote and the account in Settings.",children:a});case"scope-missing":{const r=(s.scopes??[]).filter(Boolean),n=r.length>0?`gh auth refresh -s ${r.join(" ")}`:"gh auth refresh -s repo";return e.jsxs(k,{icon:"shield-keyhole",title:"Missing token scope",description:`The GitHub token needs ${r.length>0?r.join(", "):"more scope"}. Run this on the machine running PiChamber, then check again.`,children:[e.jsx($,{command:n,label:"Copy gh auth refresh command"}),a]})}case"rate-limited":{const r=s.retryAt?new Date(s.retryAt).toLocaleTimeString():null;return e.jsx(k,{icon:"hourglass",title:"Rate limited",description:r?`GitHub rate limit reached. Try again after ${r}.`:"GitHub rate limit reached. Try again shortly.",children:a})}default:return e.jsx(k,{icon:"error-warning",title:"Something went wrong",description:s.message||"GitHub request failed",children:a})}},Xe=s=>s.map(t=>({host:t.host,owner:t.owner,repo:t.repo,relativePath:t.relativePath,kind:t.kind,submodule:t.submodule,disabledReason:t.disabledReason??null,ref:t.host&&t.owner&&t.repo?`${t.host}/${t.owner}/${t.repo}`:""})),Ze=s=>s.kind==="enclosing"?"enclosing":s.kind==="nested"?"nested":s.submodule?"submodule":null,V=({entries:s,value:t,onChange:i,ariaLabel:a})=>{const r=s.find(n=>n.ref===t)??null;return e.jsxs(ve,{value:t??"",onValueChange:i,children:[e.jsx(we,{size:"sm",className:"min-w-0 max-w-56","aria-label":a??"Select repository",children:e.jsx(Ne,{placeholder:"Select repository",children:n=>{const o=s.find(l=>l.ref===n)??r;return!o||!o.ref?"Select repository":e.jsxs("span",{className:"block truncate",children:[o.relativePath," · ",o.owner,"/",o.repo]})}})}),e.jsx(Ce,{children:s.map(n=>{const o=!n.ref||!!n.disabledReason,l=Ze(n);return e.jsx(ke,{value:n.ref,disabled:o,children:e.jsxs("span",{className:G("flex min-w-0 items-center gap-1.5",o&&"opacity-60"),children:[e.jsx(H,{name:"git-repository",className:"size-3.5 shrink-0"}),e.jsxs("span",{className:"min-w-0 truncate",children:[n.relativePath," · ",n.owner&&n.repo?`${n.owner}/${n.repo}`:"not on GitHub"]}),l?e.jsx("span",{className:"shrink-0 rounded bg-[var(--surface-muted)] px-1 typography-micro text-muted-foreground",children:l}):null,n.disabledReason?e.jsxs("span",{className:"shrink-0 typography-micro text-muted-foreground",children:["· ",n.disabledReason]}):null]})},`${n.ref||n.relativePath}:${n.relativePath}`)})})]})},bs=({directory:s,isRefreshing:t,onRefresh:i,children:a})=>{const n=Se().github??null,o=I(p=>p.entriesByDirectory[be(s.trim())]??null),l=I(p=>p.ensureScope),c=I(p=>p.refreshScope),u=I(p=>p.setSelectedRepo),d=Re(s||null),m=U(p=>p.status),g=U(p=>p.refresh);h.useEffect(()=>{!s||!n||(l(s,n),g(n))},[s,n,l,g]);const C=h.useCallback(()=>{if(i){i();return}n&&(c(s,n,{force:!0}),g(n,{force:!0}))},[i,n,c,g,s]);if(!n)return e.jsx("div",{className:"flex h-full flex-col",children:e.jsx(T,{info:{reason:"failed",message:"GitHub is not available in this runtime."}})});if(o?.isLoading&&!o.scope&&!o.error)return e.jsx("div",{className:"flex h-full min-h-0 flex-col",children:e.jsx(re,{label:"Finding GitHub repositories"})});if(o?.error&&!o.scope)return e.jsx("div",{className:"flex h-full flex-col",children:e.jsx(T,{info:ae(o.error),onRetry:C,isRetrying:t||o.isLoading})});const y=o?.scope??null;if(y&&!m?.installed)return e.jsx("div",{className:"flex h-full flex-col",children:e.jsx(T,{info:{reason:"gh-missing"},onRetry:C,isRetrying:t})});const x=y?Xe(y.repositories):[],f=x.filter(p=>!!(p.ref&&!p.disabledReason));if(y&&f.length===0){const p=y.topLevel?"not-github":"no-repository";return e.jsx("div",{className:"flex h-full flex-col",children:e.jsx(T,{info:{reason:p}})})}if(!d)return e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:e.jsx(V,{entries:x,value:d,onChange:p=>u(s,p)})}),e.jsxs("div",{className:"flex flex-col items-start gap-2 p-4",children:[e.jsx("div",{className:"typography-ui-header text-foreground",children:"Select a repository"}),e.jsx("p",{className:"typography-ui text-muted-foreground",children:"Several repositories are in scope. Pick one to browse."})]})]});const b=f.length>1;return e.jsxs("div",{className:"flex h-full flex-col",children:[b?e.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:e.jsx(V,{entries:x,value:d,onChange:p=>u(s,p)})}):null,e.jsx("div",{className:"min-h-0 flex-1",children:a({repo:d,directory:s})})]})},js=({copy:s,busy:t,destructive:i,disabled:a,disabledReason:r,label:n,variant:o="default",icon:l,onConfirm:c})=>{const[u,d]=h.useState(!1);return e.jsxs(me,{open:u,onOpenChange:m=>{t||d(m)},children:[e.jsxs(he,{render:e.jsx(N,{type:"button",variant:o,size:"xs",className:"shrink-0",disabled:a||t,title:r??n,"aria-label":n}),children:[l,n]}),e.jsx(fe,{children:e.jsx(pe,{side:"bottom",align:"start",sideOffset:6,collisionPadding:8,className:"z-50",children:e.jsxs(xe,{"aria-label":s.title,className:"w-64 rounded-lg border border-border/60 bg-[var(--surface-elevated)] p-3 shadow-lg",children:[e.jsx("p",{className:"typography-ui-label text-foreground",children:s.title}),e.jsx("p",{className:"mt-1 typography-micro text-muted-foreground",children:s.detail}),e.jsxs("div",{className:"mt-3 flex justify-end gap-1.5",children:[e.jsx(N,{type:"button",variant:"outline",size:"xs",disabled:t,onClick:()=>d(!1),children:"Cancel"}),e.jsx(N,{type:"button",variant:i?"destructive":"default",size:"xs",disabled:t,onClick:()=>{Promise.resolve(c()).finally(()=>d(!1))},"aria-label":s.confirm,children:t?s.progress:s.confirm})]})]})})})]})},ys=async(s,t)=>{if(!t?.listGitWorktrees)return;const i=He.getState().projects,a=Ge(i,Y.getState()),n=Pe(i,a,s)?.path??s;try{await Y.getState().refreshProject(n,t,{force:!0})}catch{}},v=(s,t)=>`${s}#${t}`,ie=Object.freeze([]),Je=Object.freeze({comments:ie,summary:"",verdict:"comment",commentDraft:""});let Q=0;const es=()=>(Q+=1,`pending-review-comment-${Q}`),R=(s,t)=>s.entries[t]??Je,S=(s,t,i)=>({...s.entries,[t]:{...R(s,t),...i}}),P=Ye()((s,t)=>({entries:{},addComment:(i,a,r)=>{const n=r.id??es(),o=v(i,a);return s(l=>({entries:S(l,o,{comments:[...R(l,o).comments,{...r,id:n}]})})),n},removeComment:(i,a,r)=>{const n=v(i,a);s(o=>{const l=R(o,n).comments,c=l.filter(u=>u.id!==r);if(c.length===l.length)return o;if(c.length===0&&R(o,n).summary===""&&R(o,n).commentDraft===""){const u={...o.entries};return delete u[n],{entries:u}}return{entries:S(o,n,{comments:c})}})},removeComments:(i,a,r)=>{if(r.length===0)return;const n=v(i,a),o=new Set(r);s(l=>{const c=R(l,n).comments,u=c.filter(d=>!o.has(d.id));return u.length===c.length?l:{entries:S(l,n,{comments:u})}})},clearComments:(i,a)=>{const r=v(i,a);s(n=>(n.entries[r]?.comments.length??0)===0?n:{entries:S(n,r,{comments:[]})})},setSummary:(i,a,r)=>{const n=v(i,a);t().entries[n]?.summary!==r&&s(o=>({entries:S(o,n,{summary:r})}))},clearSummary:(i,a,r)=>{const n=v(i,a);s(o=>R(o,n).summary!==r?o:{entries:S(o,n,{summary:""})})},setVerdict:(i,a,r)=>{const n=v(i,a);t().entries[n]?.verdict!==r&&s(o=>({entries:S(o,n,{verdict:r})}))},setCommentDraft:(i,a,r)=>{const n=v(i,a);t().entries[n]?.commentDraft!==r&&s(o=>({entries:S(o,n,{commentDraft:r})}))},clearCommentDraft:(i,a)=>{const r=v(i,a);s(n=>R(n,r).commentDraft===""?n:{entries:S(n,r,{commentDraft:""})})},resetForRuntimeSwitch:()=>s({entries:{}})}));typeof window<"u"&&je(()=>{P.getState().resetForRuntimeSwitch()});const vs=(s,t)=>P(i=>i.entries[v(s,t)]?.comments??ie),ws=(s,t)=>P(i=>i.entries[v(s,t)]?.summary??""),Ns=(s,t)=>P(i=>i.entries[v(s,t)]?.verdict??"comment"),Cs=(s,t)=>P(i=>i.entries[v(s,t)]?.comments.length??0),ss=300,ks=(s,t)=>{const i=v(s,t),a=P(m=>m.entries[i]?.commentDraft??""),[r,n]=h.useState(a),o=h.useRef(r);o.current=r;const l=h.useRef(a);l.current=a;const c=h.useRef(a);h.useEffect(()=>{o.current===c.current&&a!==c.current&&(c.current=a,n(a))},[a]);const u=h.useCallback(()=>{const m=o.current;m!==c.current&&(c.current=m,P.getState().setCommentDraft(s,t,m))},[s,t]),d=h.useCallback(m=>{n(m)},[]);return h.useEffect(()=>{if(r===c.current)return;const m=setTimeout(u,ss);return()=>clearTimeout(m)},[r,u]),h.useEffect(()=>()=>u(),[u]),{draft:r,onDraftChange:d,flushDraft:u}},ts=240,Ss=({draft:s,onDraftChange:t,placeholder:i="Leave a comment",ariaLabel:a="Leave a comment",busy:r,error:n,disabledReason:o,followUp:l,onSubmitComment:c,onDraftBlur:u})=>{const d=h.useRef(null),[m,g]=h.useState(!1),C=h.useRef(null);h.useLayoutEffect(()=>{const f=d.current;if(!f)return;f.style.height="0px",f.style.height=`${Math.min(f.scrollHeight,ts)}px`;let b=C.current;if(!b){const w=getComputedStyle(f);b={lineHeight:Number.parseFloat(w.lineHeight)||20,padding:Number.parseFloat(w.paddingTop)+Number.parseFloat(w.paddingBottom)||0},C.current=b}const p=f.scrollHeight-b.padding>b.lineHeight*1.5;g(w=>w===p?w:p)},[s]);const y=s.trim().length===0,x=r!==null;return e.jsxs("form",{className:"flex flex-col gap-2 border-t border-border/60 pt-5","aria-label":a,onSubmit:f=>{f.preventDefault(),c()},children:[e.jsxs("div",{className:`flex ${m?"items-end":"items-center"} gap-1.5 rounded-md border border-border bg-[var(--surface-elevated)] py-1 pr-1 focus-within:border-[var(--interactive-focus-ring)]`,children:[e.jsx(Fe,{simple:!0,ref:d,rows:1,value:s,placeholder:`${i} (⌘↩)`,"aria-label":a,disabled:x,onChange:f=>t(f.target.value),onBlur:()=>u?.(),outerClassName:"min-w-0 flex-1",className:"min-h-0 w-full resize-none overflow-y-auto border-0 bg-transparent px-2.5 py-1 typography-ui text-foreground shadow-none outline-none placeholder:text-muted-foreground focus-visible:ring-0",onKeyDown:f=>{f.nativeEvent.isComposing||f.key==="Enter"&&(f.metaKey||f.ctrlKey)&&!f.shiftKey&&!f.altKey&&!f.repeat&&(f.preventDefault(),f.stopPropagation(),!y&&!x&&c())}}),!y&&l&&l.allowed?e.jsx(N,{type:"button",variant:"ghost",size:"xs",disabled:x,title:l.reason??l.label,onClick:l.onRun,children:r===l.id?l.busyLabel:l.label}):null,e.jsx(N,{type:"button",variant:"default",size:"xs",disabled:y||x,title:o??"Post comment",onClick:c,children:r==="comment"?"Posting…":"Comment"})]}),n?e.jsx("p",{className:"typography-micro text-[var(--status-error)]",role:"alert",children:n}):null]})},ns=async s=>{const t=s.notify??((r,n)=>O[r](n)),i=await s.postComment(s.trimmed);if(!i.ok){const r=i.error?.kind==="failed"&&i.error.message?i.error.message:"Failed to post comment";throw t("error",r),new Error(r)}if(s.afterPost(),s.action==="comment"){t("success","Comment posted");return}const a=await s.runFollowUp(s.action);if(!a.ok){const r=s.verbs[s.action],n=a.error?.kind==="failed"&&a.error.message?a.error.message:`Failed to ${r}`;throw t("error",n),new Error(n)}t("success",s.doneLabels[s.action])},Rs=s=>{const[t,i]=h.useState(null),[a,r]=h.useState(null),n=h.useRef(s);n.current=s;const o=h.useCallback(async(l,c)=>{const u=c.trim(),d=n.current;if(!(u.length===0||t!==null)){i(l),r(null);try{await ns({trimmed:u,action:l,postComment:d.postComment,runFollowUp:d.runFollowUp,verbs:d.verbs,doneLabels:d.doneLabels,afterPost:d.afterPost})}catch(m){r(m instanceof Error?m.message:"Failed to post comment")}finally{i(null)}}},[t]);return{busy:t,error:a,submit:o}},X=({label:s,value:t,options:i,currentLabel:a,onChange:r})=>e.jsxs(Ee,{children:[e.jsxs(Te,{children:[e.jsx("span",{className:"flex-1",children:s}),e.jsx("span",{className:"min-w-0 max-w-32 truncate typography-micro text-muted-foreground",children:a})]}),e.jsx(De,{className:"min-w-48",children:e.jsxs(te,{value:t,onValueChange:n=>{typeof n=="string"&&n!==t&&r(n)},children:[e.jsx(K,{children:s}),i.map(n=>e.jsx(ne,{value:n.id,closeOnClick:!1,children:n.label},n.id))]})})]}),rs=({stateValue:s,stateOptions:t,onStateChange:i,involvementValue:a,involvementOptions:r,onInvolvementChange:n,labelsValue:o,onLabelsChange:l})=>{const c=t.find(g=>g.id===s)?.label??s,u=r.find(g=>g.id===a)?.label??a,d=(o??"").trim().length>0,m=(s!==t[0]?.id?1:0)+(a!==r[0]?.id?1:0)+(d?1:0);return e.jsxs(J,{modal:!1,children:[e.jsx(ee,{asChild:!0,children:e.jsxs(N,{type:"button",variant:"ghost",size:"sm","aria-label":"Filters",title:"Filters",className:"h-8 shrink-0 gap-1.5 px-2 normal-case",children:[e.jsx(H,{name:"equalizer",className:"size-4","aria-hidden":"true"}),e.jsx("span",{children:"Filters"}),m>0?e.jsx("span",{className:"rounded-full bg-[var(--surface-muted)] px-1.5 typography-micro tabular-nums text-muted-foreground",children:m}):null]})}),e.jsxs(se,{align:"end",className:"w-64",children:[e.jsx(X,{label:"State",value:s,options:t,currentLabel:c,onChange:i}),e.jsx(X,{label:"Involvement",value:a,options:r,currentLabel:u,onChange:n}),l?e.jsxs(e.Fragment,{children:[e.jsx(Le,{}),e.jsx(K,{children:"Labels"}),e.jsxs("div",{className:"px-2 pb-2",children:[e.jsx(Me,{value:o??"",onChange:g=>l(g.target.value),placeholder:"bug, enhancement","aria-label":"Filter by labels",className:"h-7"}),e.jsx("p",{className:"mt-1 typography-micro text-muted-foreground",children:"Comma-separated. Or type label:bug in search."})]})]}):null]})]})},as=({value:s,options:t,onChange:i,ariaLabel:a})=>e.jsxs(J,{modal:!1,children:[e.jsx(ee,{asChild:!0,children:e.jsx(N,{type:"button",variant:"ghost",size:"sm","aria-label":a,title:a,className:"h-8 w-8 shrink-0 p-0",children:e.jsx(H,{name:"expand-up-down",className:"size-4","aria-hidden":"true"})})}),e.jsx(se,{align:"end",className:"w-52",children:e.jsxs(te,{value:s,onValueChange:r=>{typeof r=="string"&&r!==s&&i(r)},children:[e.jsx(K,{children:"Sort"}),t.map(r=>e.jsx(ne,{value:r.id,children:r.label},r.id))]})})]}),Z=({isRefreshing:s,onRefresh:t,label:i,presentation:a="toolbar"})=>a==="desktop"?e.jsx(N,{type:"button",variant:"ghost",size:"sm",onClick:t,disabled:s,title:i??"Refresh","aria-label":i??"Refresh GitHub data",className:"h-8 w-8 shrink-0 p-0",children:e.jsx(H,{name:"refresh",className:G("size-4",s&&"animate-spin"),"aria-hidden":"true"})}):a==="drawer"?e.jsx(N,{type:"button",variant:"ghost",size:"icon",onClick:t,disabled:s,title:i??"Refresh","aria-label":i??"Refresh GitHub data",className:"shrink-0",children:e.jsx(H,{name:"refresh",className:G("size-4",s&&"animate-spin"),"aria-hidden":"true"})}):e.jsx(N,{type:"button",variant:"ghost",size:"sm",onClick:t,disabled:s,title:i??"Refresh","aria-label":i??"Refresh GitHub data",className:"h-8 w-8 shrink-0 p-0",children:e.jsx(H,{name:"refresh",className:G("size-4",s&&"animate-spin"),"aria-hidden":"true"})}),Hs=({items:s,renderRow:t,hasMore:i,isLoadingMore:a,isLoading:r,isRefreshing:n,stale:o,error:l,searchValue:c,onSearchChange:u,searchPlaceholder:d,searchAriaLabel:m,toolbarControls:g,primaryAction:C,headerActionsSlot:y=null,headerActionsPresentation:x="drawer",isDefaultFilters:f,noItemsTitle:b,noItemsBody:p,noItemsIcon:w,noItemsAction:D,listAriaLabel:L,skeletonLabel:B,incompleteNotice:M=null,remote:j=null,numberJump:F=null,numberJumpKind:oe,onClearFilters:le,onLoadMore:ce,onRetry:z,onOpen:ue})=>{const A=!!l&&s.length===0,q=!A&&r&&s.length===0,_=y??null,de=x??"drawer",W=n||r;return e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[o?e.jsx(Be,{onRetry:z}):null,e.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5 border-b border-border px-3 py-2",children:[e.jsx(Ae,{value:c,onChange:u,placeholder:d,ariaLabel:m}),g,_?null:e.jsxs(e.Fragment,{children:[C,e.jsx(Z,{isRefreshing:W,onRefresh:z,presentation:"toolbar"})]})]}),_?ge.createPortal(e.jsxs(e.Fragment,{children:[C,e.jsx(Z,{isRefreshing:W,onRefresh:z,presentation:de})]}),_):null,A?e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx(T,{info:ae(l),onRetry:z,isRetrying:r})}):q?e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(re,{label:B})}):e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",role:"list","aria-label":L,children:[s.length===0&&F==null?e.jsx(_e,{kind:f?"no-items":"no-match",noItemsTitle:b,noItemsBody:f?p:void 0,noItemsIcon:w,noItemsAction:f?D:void 0,onClearFilters:f?void 0:le}):e.jsxs(e.Fragment,{children:[s.length>0?e.jsx("ul",{className:"flex flex-col p-1",children:s.map(E=>e.jsx(h.Fragment,{children:t(E)},E.number))}):null,F!=null?e.jsx(Oe,{number:F,kindLabel:oe,onOpen:()=>ue(F)}):null]}),e.jsx(Ke,{hasMore:i,isLoading:a||r,onLoadMore:ce}),j&&(j.isSearching||j.error||j.items.length>0)?e.jsx(qe,{title:"More results from GitHub",isSearching:j.isSearching,error:j.error,hasResults:j.items.length>0,hasMore:j.hasMore,isLoadingMore:j.isLoadingMore,onRetry:j.onRetry,onLoadMore:j.onLoadMore,children:e.jsx("ul",{className:"flex flex-col",children:j.items.map(E=>e.jsx(h.Fragment,{children:t(E)},E.number))})}):null]}),!A&&!q&&M?e.jsx(We,{matchSummary:M.summary,searching:M.searching,onSearchAll:M.onSearchAll}):null]})},Gs=({stateValue:s,stateOptions:t,onStateChange:i,involvementValue:a,involvementOptions:r,onInvolvementChange:n,labelsValue:o,onLabelsChange:l,sortValue:c,sortOptions:u,onSortChange:d,sortAriaLabel:m})=>e.jsxs(e.Fragment,{children:[e.jsx(rs,{stateValue:s,stateOptions:t,onStateChange:i,involvementValue:a,involvementOptions:r,onInvolvementChange:n,labelsValue:o,onLabelsChange:l}),e.jsx(as,{value:c,options:u,onChange:d,ariaLabel:m})]}),is="shrink-0 font-mono typography-micro tabular-nums text-muted-foreground",os=({glyph:s,below:t})=>e.jsxs("span",{className:"flex w-4 shrink-0 flex-col items-center gap-0.5",children:[e.jsx("span",{className:"inline-flex",children:s}),t?e.jsx("span",{className:"inline-flex",children:t}):null]}),Ps=({login:s,avatarUrl:t})=>e.jsxs("span",{className:"inline-flex min-w-0 shrink-0 items-center gap-1",title:s??"ghost",children:[e.jsx(Ve,{login:s,avatarUrl:t,size:"xs"}),e.jsx("span",{className:"truncate",children:s??"ghost"})]}),Ls=({head:s,base:t})=>e.jsxs("span",{className:"flex min-w-0 items-center gap-1 font-mono",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",title:s,children:s}),e.jsx("span",{className:"shrink-0",children:"→"}),e.jsx("span",{className:"max-w-[45%] shrink-0 truncate",title:t,children:t})]}),ls=[{show:""},{show:"hidden @xl/github-row:inline-flex"},{show:"hidden @3xl/github-row:inline-flex"}],cs=["hidden @xl/github-row:hidden","hidden @xl/github-row:inline-flex @3xl/github-row:hidden",""],Ms=({labels:s})=>s.length===0?null:e.jsx("span",{className:"flex min-w-0 shrink-0 items-center gap-1",children:ls.map((t,i)=>{const a=s[i];if(!a)return null;const r=s.length-i-1;return e.jsxs("span",{className:G("min-w-0",t.show),children:[e.jsx(Qe,{name:a.name,color:a.color}),r>0?e.jsxs("span",{className:G("ml-0.5 shrink-0",cs[i]),"aria-label":`${r} more labels`,children:["+",r]}):null]},a.name)})}),Es=({glyph:s,glyphBelow:t,number:i,title:a,signals:r,status:n,meta:o,updatedAt:l,selected:c,onOpen:u,ariaLabel:d})=>e.jsxs("button",{type:"button",onClick:u,"aria-label":d,"aria-current":c?"true":void 0,className:G("@container/github-row group/github-row flex w-full items-center gap-2 rounded-md px-2 py-1 text-left",c?"bg-interactive-selection text-interactive-selection-foreground":"hover:bg-interactive-hover"),children:[e.jsx(os,{glyph:s,below:t}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:is,children:i}),e.jsx("span",{className:"min-w-0 flex-1 truncate typography-ui-label text-foreground",title:a,children:a}),r?e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:r}):null,n?e.jsx("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:n}):null]}),e.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 overflow-hidden typography-micro text-muted-foreground",children:[o,l?e.jsx("span",{className:"ml-auto shrink-0 whitespace-nowrap tabular-nums",children:Ue(l)}):null]})]})]}),Ts=s=>{const{repo:t,query:i,queryKey:a,autoRemote:r,indexNumbers:n,visibleItems:o,searchText:l,useRemoteEntry:c,runSearch:u,runLoadMore:d}=s,[m,g]=h.useState(!1),[C,y]=h.useState(null);h.useEffect(()=>y(null),[t]);const x=c(t,i),f=r||C===a||x!=null,b=h.useCallback(()=>{g(!0),u(i).catch(()=>null).finally(()=>g(!1))},[i,u]);h.useEffect(()=>{if(!r||x?.data||x?.isLoading||x?.error||m)return;const j=setTimeout(b,400);return()=>clearTimeout(j)},[r,a,x?.data,x?.isLoading,x?.error,m,b]);const p=h.useCallback(()=>{y(a),b()},[a,b]),w=h.useCallback(()=>{g(!0),d(i).catch(()=>null).finally(()=>g(!1))},[i,d]),D=h.useMemo(()=>ze(x?.data?.items??[],n),[x?.data?.items,n]),L=Ie(l),B=L!=null&&!o.some(j=>j.number===L)?L:null;return{remoteView:h.useMemo(()=>f?{items:D,isSearching:m||(x?.isLoading??!1),isLoadingMore:m,hasMore:x?.data?.nextCursor!=null,error:x?.error??null,onSearchAll:p,onLoadMore:w,onRetry:b}:null,[f,D,m,x?.isLoading,x?.data?.nextCursor,x?.error,p,w,b]),numberJump:B,remotePending:m,handleSearchAll:p}};export{Ss as G,vs as a,ks as b,Rs as c,ws as d,Ns as e,Cs as f,T as g,js as h,Es as i,Ps as j,Ls as k,Hs as l,Gs as m,bs as n,Ts as o,Ms as p,ys as r,ae as t,P as u};
@@ -0,0 +1 @@
1
+ import{R as f}from"./vendor-react-Bz1tRBxM.js";import{b9 as v,a as z,b as B,c as L,bM as M,r as I,d as D,bW as k}from"./useAppFontEffects-Oyin3dgQ.js";const C=50,P=n=>{if(!n)return null;const c=n.replace(/\\/g,"/");return c==="/"?"/":c.replace(/\/+$/,"")},R=(n,c)=>{const s=P(n),a=P(c);return!s||!a?!1:s===a||s.startsWith(`${a}/`)},A=n=>n?k(n):null,w=(n,c={})=>{const{scopeProjectId:s=null,maxParents:a=C}=c,u=v({archived:!1}),S=z(e=>e.projects),d=B(e=>e.ids),h=L(e=>e.rankById),b=M(),j=f.useMemo(()=>S.map(e=>({...e,normalizedPath:P(e.path)})).filter(e=>e.normalizedPath),[S]),m=f.useCallback(e=>e?j.filter(i=>R(e,i.normalizedPath)).sort((i,l)=>(l.normalizedPath?.length??0)-(i.normalizedPath?.length??0))[0]??null:null,[j]);return f.useMemo(()=>{if(!n)return[];const e=new Map;for(const t of u){const r=t.parentID;if(!r||t.time?.archived)continue;const o=e.get(r);o?o.push(t):e.set(r,[t])}const y=D(d,h);e.forEach(t=>{t.sort(y)});const i=u.filter(t=>!t.time?.archived).filter(t=>!t.parentID).filter(t=>{if(!s)return!0;const r=I(t);return m(r)?.id===s}).sort(D(d,h)).slice(0,a),l=t=>{const r=e.get(t.id)??[];return{session:t,children:r.map(o=>l(o))}};return i.map(t=>{const r=I(t),o=m(r),g=A(o),p=(r?b.get(r):void 0)??null;return{node:l(t),projectId:o?.id??null,groupDirectory:r,secondaryMeta:{projectLabel:g,branchLabel:p&&p!==g?p:null}}})},[u,b,n,m,a,d,s,h])};export{w as u};
@@ -1 +1 @@
1
- import{_ as y}from"./vendor-vite-runtime-DD1OZmLC.js";import{r as x,W as I,C as v,a as g}from"./vendor-boot-CoTxysn6.js";var o;(function(n){n.missingKey="missingKey",n.invalidData="invalidData",n.osError="osError",n.unknownError="unknownError",n.missingPrefix="missingPrefix"})(o||(o={}));var h;(function(n){n[n.whenUnlocked=0]="whenUnlocked",n[n.whenUnlockedThisDeviceOnly=1]="whenUnlockedThisDeviceOnly",n[n.afterFirstUnlock=2]="afterFirstUnlock",n[n.afterFirstUnlockThisDeviceOnly=3]="afterFirstUnlockThisDeviceOnly",n[n.whenPasscodeSetThisDeviceOnly=4]="whenPasscodeSetThisDeviceOnly"})(h||(h={}));class l extends Error{constructor(e,t){super(e),this.name="StorageError",this.code=t}}const u=x("SecureStorage",{web:async()=>{const n=await y(()=>Promise.resolve().then(()=>_),void 0);return new n.SecureStorageWeb},ios:async()=>{const n=await y(()=>Promise.resolve().then(()=>f),void 0);return new n.SecureStorageNative(u)},android:async()=>{const n=await y(()=>Promise.resolve().then(()=>f),void 0);return new n.SecureStorageNative(u)}});function w(n){return n!==void 0&&Object.keys(o).includes(n)}class a extends I{constructor(){super(...arguments),this.prefix="capacitor-storage_",this.sync=!1,this.access=h.whenUnlocked}async setSynchronize(e){if(this.sync=e,v.getPlatform()==="ios")return this.setSynchronizeKeychain({sync:e})}async getSynchronize(){return this.sync}async setDefaultKeychainAccess(e){this.access=e}async tryOperation(e){try{return await e()}catch(t){throw t instanceof g&&w(t.code)?new l(t.message,t.code):t}}async get(e,t=!0,i){if(e){const{data:r}=await this.tryOperation(async()=>this.internalGetItem({prefixedKey:this.prefixedKey(e),sync:i??this.sync}));if(r===null)return null;if(t){const s=S(r);if(s)return s}try{return JSON.parse(r)}catch{throw new l("Invalid data",o.invalidData)}}return a.missingKey()}async getItem(e){if(e){const{data:t}=await this.tryOperation(async()=>this.internalGetItem({prefixedKey:this.prefixedKey(e),sync:this.sync}));return t}return null}async set(e,t,i=!0,r,s){if(e){let c=t;return i&&t instanceof Date&&(c=t.toISOString()),this.tryOperation(async()=>this.internalSetItem({prefixedKey:this.prefixedKey(e),data:JSON.stringify(c),sync:r??this.sync,access:s??this.access}))}return a.missingKey()}async setItem(e,t){return e?this.tryOperation(async()=>this.internalSetItem({prefixedKey:this.prefixedKey(e),data:t,sync:this.sync,access:this.access})):a.missingKey()}async remove(e,t){if(e){const{success:i}=await this.tryOperation(async()=>this.internalRemoveItem({prefixedKey:this.prefixedKey(e),sync:t??this.sync}));return i}return a.missingKey()}async removeItem(e){if(e){await this.tryOperation(async()=>this.internalRemoveItem({prefixedKey:this.prefixedKey(e),sync:this.sync}));return}a.missingKey()}async clearItemsWithPrefix(e){const t=this.checkPrefix(e.prefix);await this.tryOperation(async()=>this.internalClearItemsWithPrefix({prefix:t,sync:this.sync}))}checkPrefix(e){if(e.trim().length===0)throw new l("Non-blank prefix provided",o.missingPrefix);return e}async keys(e){const{keys:t}=await this.tryOperation(async()=>this.internalGetPrefixedKeys({prefix:this.prefix,sync:e??this.sync})),i=this.prefix.length;return t.map(r=>r.slice(i))}async getKeyPrefix(){return this.prefix}async setKeyPrefix(e){this.prefix=this.checkPrefix(e)}prefixedKey(e){return this.prefix+e}static missingKey(){throw new l("No key provided",o.missingKey)}}const P=/^"(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z"$/u;function S(n){const e=P.exec(n);if(e){const t=Number.parseInt(e[1],10),i=Number.parseInt(e[2],10)-1,r=Number.parseInt(e[3],10),s=Number.parseInt(e[4],10),c=Number.parseInt(e[5],10),m=Number.parseInt(e[6],10),d=Number.parseInt(e[7],10),p=Date.UTC(t,i,r,s,c,m,d);return new Date(p)}return null}class K extends a{async setSynchronizeKeychain(e){}async internalGetItem(e){return{data:localStorage.getItem(e.prefixedKey)}}async internalSetItem(e){localStorage.setItem(e.prefixedKey,e.data)}async internalRemoveItem(e){return localStorage.getItem(e.prefixedKey)!==null?(localStorage.removeItem(e.prefixedKey),{success:!0}):{success:!1}}async clear(){const{keys:e}=await this.internalGetPrefixedKeys({prefix:this.prefix});for(const t of e)localStorage.removeItem(t)}async internalClearItemsWithPrefix(e){console.warn("internalClearItemsWithPrefix is native only")}async internalGetPrefixedKeys(e){const t=[];for(let i=0;i<localStorage.length;i++){const r=localStorage.key(i);r?.startsWith(e.prefix)&&t.push(r)}return{keys:t}}}const _=Object.freeze(Object.defineProperty({__proto__:null,SecureStorageWeb:K},Symbol.toStringTag,{value:"Module"}));class O extends a{constructor(e){super();const t=e;this.setSynchronizeKeychain=t.setSynchronizeKeychain,this.internalGetItem=t.internalGetItem,this.internalSetItem=t.internalSetItem,this.internalRemoveItem=t.internalRemoveItem,this.internalClearItemsWithPrefix=t.internalClearItemsWithPrefix,this.internalGetPrefixedKeys=t.internalGetPrefixedKeys}async setSynchronizeKeychain(e){}async internalGetItem(e){return{data:""}}async internalSetItem(e){}async internalRemoveItem(e){return{success:!0}}async clear(e){return this.tryOperation(async()=>this.clearItemsWithPrefix({prefix:this.prefix,sync:e??this.sync}))}async internalClearItemsWithPrefix(e){}async internalGetPrefixedKeys(e){return{keys:[]}}}const f=Object.freeze(Object.defineProperty({__proto__:null,SecureStorageNative:O},Symbol.toStringTag,{value:"Module"}));export{u as p};
1
+ import{_ as y}from"./vendor-vite-runtime-DD1OZmLC.js";import{r as x,W as I,C as v,a as g}from"./vendor-boot-3SaHYVb1.js";var o;(function(n){n.missingKey="missingKey",n.invalidData="invalidData",n.osError="osError",n.unknownError="unknownError",n.missingPrefix="missingPrefix"})(o||(o={}));var h;(function(n){n[n.whenUnlocked=0]="whenUnlocked",n[n.whenUnlockedThisDeviceOnly=1]="whenUnlockedThisDeviceOnly",n[n.afterFirstUnlock=2]="afterFirstUnlock",n[n.afterFirstUnlockThisDeviceOnly=3]="afterFirstUnlockThisDeviceOnly",n[n.whenPasscodeSetThisDeviceOnly=4]="whenPasscodeSetThisDeviceOnly"})(h||(h={}));class l extends Error{constructor(e,t){super(e),this.name="StorageError",this.code=t}}const u=x("SecureStorage",{web:async()=>{const n=await y(()=>Promise.resolve().then(()=>_),void 0);return new n.SecureStorageWeb},ios:async()=>{const n=await y(()=>Promise.resolve().then(()=>f),void 0);return new n.SecureStorageNative(u)},android:async()=>{const n=await y(()=>Promise.resolve().then(()=>f),void 0);return new n.SecureStorageNative(u)}});function w(n){return n!==void 0&&Object.keys(o).includes(n)}class a extends I{constructor(){super(...arguments),this.prefix="capacitor-storage_",this.sync=!1,this.access=h.whenUnlocked}async setSynchronize(e){if(this.sync=e,v.getPlatform()==="ios")return this.setSynchronizeKeychain({sync:e})}async getSynchronize(){return this.sync}async setDefaultKeychainAccess(e){this.access=e}async tryOperation(e){try{return await e()}catch(t){throw t instanceof g&&w(t.code)?new l(t.message,t.code):t}}async get(e,t=!0,i){if(e){const{data:r}=await this.tryOperation(async()=>this.internalGetItem({prefixedKey:this.prefixedKey(e),sync:i??this.sync}));if(r===null)return null;if(t){const s=S(r);if(s)return s}try{return JSON.parse(r)}catch{throw new l("Invalid data",o.invalidData)}}return a.missingKey()}async getItem(e){if(e){const{data:t}=await this.tryOperation(async()=>this.internalGetItem({prefixedKey:this.prefixedKey(e),sync:this.sync}));return t}return null}async set(e,t,i=!0,r,s){if(e){let c=t;return i&&t instanceof Date&&(c=t.toISOString()),this.tryOperation(async()=>this.internalSetItem({prefixedKey:this.prefixedKey(e),data:JSON.stringify(c),sync:r??this.sync,access:s??this.access}))}return a.missingKey()}async setItem(e,t){return e?this.tryOperation(async()=>this.internalSetItem({prefixedKey:this.prefixedKey(e),data:t,sync:this.sync,access:this.access})):a.missingKey()}async remove(e,t){if(e){const{success:i}=await this.tryOperation(async()=>this.internalRemoveItem({prefixedKey:this.prefixedKey(e),sync:t??this.sync}));return i}return a.missingKey()}async removeItem(e){if(e){await this.tryOperation(async()=>this.internalRemoveItem({prefixedKey:this.prefixedKey(e),sync:this.sync}));return}a.missingKey()}async clearItemsWithPrefix(e){const t=this.checkPrefix(e.prefix);await this.tryOperation(async()=>this.internalClearItemsWithPrefix({prefix:t,sync:this.sync}))}checkPrefix(e){if(e.trim().length===0)throw new l("Non-blank prefix provided",o.missingPrefix);return e}async keys(e){const{keys:t}=await this.tryOperation(async()=>this.internalGetPrefixedKeys({prefix:this.prefix,sync:e??this.sync})),i=this.prefix.length;return t.map(r=>r.slice(i))}async getKeyPrefix(){return this.prefix}async setKeyPrefix(e){this.prefix=this.checkPrefix(e)}prefixedKey(e){return this.prefix+e}static missingKey(){throw new l("No key provided",o.missingKey)}}const P=/^"(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z"$/u;function S(n){const e=P.exec(n);if(e){const t=Number.parseInt(e[1],10),i=Number.parseInt(e[2],10)-1,r=Number.parseInt(e[3],10),s=Number.parseInt(e[4],10),c=Number.parseInt(e[5],10),m=Number.parseInt(e[6],10),d=Number.parseInt(e[7],10),p=Date.UTC(t,i,r,s,c,m,d);return new Date(p)}return null}class K extends a{async setSynchronizeKeychain(e){}async internalGetItem(e){return{data:localStorage.getItem(e.prefixedKey)}}async internalSetItem(e){localStorage.setItem(e.prefixedKey,e.data)}async internalRemoveItem(e){return localStorage.getItem(e.prefixedKey)!==null?(localStorage.removeItem(e.prefixedKey),{success:!0}):{success:!1}}async clear(){const{keys:e}=await this.internalGetPrefixedKeys({prefix:this.prefix});for(const t of e)localStorage.removeItem(t)}async internalClearItemsWithPrefix(e){console.warn("internalClearItemsWithPrefix is native only")}async internalGetPrefixedKeys(e){const t=[];for(let i=0;i<localStorage.length;i++){const r=localStorage.key(i);r?.startsWith(e.prefix)&&t.push(r)}return{keys:t}}}const _=Object.freeze(Object.defineProperty({__proto__:null,SecureStorageWeb:K},Symbol.toStringTag,{value:"Module"}));class O extends a{constructor(e){super();const t=e;this.setSynchronizeKeychain=t.setSynchronizeKeychain,this.internalGetItem=t.internalGetItem,this.internalSetItem=t.internalSetItem,this.internalRemoveItem=t.internalRemoveItem,this.internalClearItemsWithPrefix=t.internalClearItemsWithPrefix,this.internalGetPrefixedKeys=t.internalGetPrefixedKeys}async setSynchronizeKeychain(e){}async internalGetItem(e){return{data:""}}async internalSetItem(e){}async internalRemoveItem(e){return{success:!0}}async clear(e){return this.tryOperation(async()=>this.clearItemsWithPrefix({prefix:this.prefix,sync:e??this.sync}))}async internalClearItemsWithPrefix(e){}async internalGetPrefixedKeys(e){return{keys:[]}}}const f=Object.freeze(Object.defineProperty({__proto__:null,SecureStorageNative:O},Symbol.toStringTag,{value:"Module"}));export{u as p};
@@ -1 +1 @@
1
- import{a as i}from"./vendor-react-Bz1tRBxM.js";import{u as ie,b as ae,c as le,d as L,e as X,t as ue,f as ce,s as de,g as ee,h as J,j as fe,i as pe,k as me,l as he,m as ge,n as K,o as ye,A as k,p as ve,q as be,v as Se,T as Pe,w as Re}from"./vendor-boot-CoTxysn6.js";function Ce(e){const{open:t,defaultOpen:r=!1,onOpenChange:f,disabled:a}=e,[n,y]=ie({controlled:t,default:r,name:"Collapsible",state:"open"}),{mounted:s,setMounted:p,transitionStatus:v}=ae(n,!0,!0),c=le(),[d,l]=i.useState(),m=d===null?void 0:d??c,b=L(g=>{const S=!n,C=X(ue,g.nativeEvent);f(S,C),!C.isCanceled&&y(S)});return i.useMemo(()=>({defaultPanelId:c,disabled:a,handleTrigger:b,mounted:s,open:n,panelId:m,setMounted:p,setOpen:y,setPanelIdState:l,transitionStatus:v}),[c,a,b,s,n,m,p,y,l,v])}const te=i.createContext(void 0);function ne(){const e=i.useContext(te);if(e===void 0)throw new Error(ce(15));return e}const Oe="data-open",Ae="data-closed",$=de,Me="data-panel-open",Te={[Oe]:""},xe={[Ae]:""},Ee={open(e){return e?{[Me]:""}:null}},we={open(e){return e?Te:xe}},se={...we,...ee},Ue=i.forwardRef(function(t,r){const{render:f,className:a,defaultOpen:n=!1,disabled:y=!1,onOpenChange:s,open:p,style:v,...c}=t,d=L(s),l=Ce({open:p,defaultOpen:n,onOpenChange:d,disabled:y}),m=i.useMemo(()=>({open:l.open,disabled:l.disabled,transitionStatus:l.transitionStatus}),[l.open,l.disabled,l.transitionStatus]),b=i.useMemo(()=>({...l,onOpenChange:d,state:m}),[l,d,m]),g=J("div",t,{state:m,ref:r,props:c,stateAttributesMapping:se});return fe.jsx(te.Provider,{value:b,children:g})}),De={...Ee,...ee},He=i.forwardRef(function(t,r){const{panelId:f,open:a,handleTrigger:n,state:y,disabled:s}=ne(),{className:p,disabled:v=s,render:c,nativeButton:d=!0,style:l,...m}=t,{getButtonProps:b,buttonRef:g}=pe({disabled:v,native:d});return J("button",t,{state:y,ref:[r,g],props:[{"aria-controls":a?f:void 0,"aria-expanded":a,onClick:n},m,b],stateAttributesMapping:De})}),I={height:void 0,width:void 0};function Ne(e){const{externalRef:t,hiddenUntilFound:r,id:f,keepMounted:a,mounted:n,onOpenChange:y,open:s,setMounted:p,setOpen:v,transitionStatus:c}=e,d=i.useRef(null),l=i.useRef(null),[m,b]=i.useState(I),g=i.useRef(I),S=i.useRef(!1),C=i.useRef(s),j=i.useRef(!1),[B,T]=i.useState(!1),P=i.useRef(null),Y=me(t,d),O=he(s),q=ge(d),x=!s&&!n,E=B?"idle":c,U=s&&(C.current||j.current),V=!s&&n&&l.current==="css-animation"&&m.height===void 0&&m.width===void 0?g.current:m,W=r&&x&&l.current!=="css-animation",h=L((o,u=!0)=>{u&&(g.current=o),b(o)}),A=L(()=>{P.current?.(),P.current=null}),H=L(o=>{A(),P.current=()=>{P.current=null,o()}}),M=L(()=>{s&&n&&l.current==="css-animation"&&(j.current=!0)});K(()=>{!B||c==="starting"||T(!1)},[B,c]),i.useEffect(()=>()=>{M(),A()},[M,A]),K(()=>{s||(C.current=!1,j.current=!1);const o=d.current;if(!o)return;!s&&P.current&&A();const u=Ie(o,U);if(l.current=u,s&&c==="idle"&&C.current&&u==="css-animation"){g.current=F(o);return}if(s&&c==="starting"){const w=S.current;if(S.current=!1,u==="none"){h(F(o)),T(!0);return}if(u==="css-transition"){const D=Fe(o);if(h(F(o)),!w)return D;const N=z(o,"transition-duration","0s");return H(N),T(!0),D}h(F(o));const Z=z(o,"animation-name","none");if(!w){Z();return}const G=z(o,"animation-duration","0s");Z(),H(G),T(!0);return}if(!s&&n&&(c==="idle"||c==="starting")){if(u==="none"){h(I,!1),p(!1);return}h(F(o));return}if(c!=="ending")return;if(u==="none"){p(!1);return}const R=F(o);if(!(R.height>0||R.width>0)){p(!1);return}h(R),u==="css-animation"&&z(o,"animation-name","none")()},[n,s,A,h,p,H,U,c]),ye({enabled:s&&n&&E==="idle",open:!0,ref:d,onComplete(){s&&h(I,!1)}}),i.useEffect(()=>{if(s||!n||E!=="ending")return;if(!d.current){p(!1),h(I,!1);return}const u=new AbortController;let R=-1;function _(){O.current||(p(!1),h(I,!1))}return R=k.request(()=>{q(_,u.signal)}),()=>{k.cancel(R),u.abort()}},[O,n,s,E,q,h,p]),K(()=>{const o=d.current;!o||!r||!x||o.setAttribute("hidden","until-found")},[x,r]),i.useEffect(function(){const u=d.current;if(!u)return;const R=Pe.create();let _=-1;const w=(D,N)=>{R.start(0,()=>{O.current||(_=k.request(()=>{O.current||(D&&(S.current=!1),N&&u.setAttribute($,""),u.setAttribute("hidden","until-found"))}))})},G=ve(u,"beforematch",D=>{const N=X(Se,D);if(y(!0,N),N.isCanceled){w(!1,!1);return}S.current=!0;const re=u.hasAttribute($);u.removeAttribute($),v(!0),w(!0,re)});return()=>{R.clear(),k.cancel(_),G()}},[O,y,v]);const oe=a||r||n||s;return{height:V.height,props:{...W?{[$]:""}:void 0,hidden:x,id:f},ref:Y,shouldPreventOpenAnimation:U,shouldRender:oe,transitionStatus:E,width:V.width}}function F(e){return{height:e.scrollHeight,width:e.scrollWidth}}function Ie(e,t){const r=be(e).getComputedStyle(e),f=(r.animationName.split(",").map(n=>n.trim()).some(n=>n!==""&&n!=="none")||t)&&Q(r.animationDuration),a=Q(r.transitionDuration);return f&&a||a?"css-transition":f?"css-animation":"none"}function Q(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function z(e,t,r){const f=e.style.getPropertyValue(t),a=e.style.getPropertyPriority(t);return e.style.setProperty(t,r),()=>{if(f===""){e.style.removeProperty(t);return}e.style.setProperty(t,f,a)}}function Fe(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(a=>{e.style.setProperty(a,"initial","important")});function r(){Object.entries(t).forEach(([a,n])=>{if(n===""){e.style.removeProperty(a);return}e.style.setProperty(a,n)})}const f=k.request(r);return()=>{k.cancel(f),r()}}const Le="--collapsible-panel-height",ke="--collapsible-panel-width",_e=i.forwardRef(function(t,r){const{className:f,hiddenUntilFound:a,keepMounted:n,render:y,id:s,style:p,...v}=t,{defaultPanelId:c,mounted:d,onOpenChange:l,open:m,setMounted:b,setPanelIdState:g,setOpen:S,state:C,transitionStatus:j}=ne(),B=a??!1,T=n??!1,P=s||void 0,Y=P??c;K(()=>(g(M=>P??(M===null?void 0:M)),()=>{g(M=>M===P?null:M)}),[P,g]);const{height:O,props:q,ref:x,shouldPreventOpenAnimation:E,shouldRender:U,transitionStatus:V,width:W}=Ne({externalRef:r,hiddenUntilFound:B,id:Y,keepMounted:T,mounted:d,onOpenChange:l,open:m,setMounted:b,setOpen:S,transitionStatus:j}),h={...C,transitionStatus:V},A=Re(p,h),H=J("div",{...t,style:void 0},{state:h,ref:x,props:[q,{style:{[Le]:O===void 0?"auto":`${O}px`,[ke]:W===void 0?"auto":`${W}px`}},v,A?{style:A}:void 0,E?{style:{animationName:"none"}}:void 0],stateAttributesMapping:se});return U?H:null});export{Ue as C,He as a,_e as b};
1
+ import{a as i}from"./vendor-react-Bz1tRBxM.js";import{u as ie,b as ae,c as le,d as L,e as X,t as ue,f as ce,s as de,g as ee,h as J,j as fe,i as pe,k as me,l as he,m as ge,n as K,o as ye,A as k,p as ve,q as be,v as Se,T as Pe,w as Re}from"./vendor-boot-3SaHYVb1.js";function Ce(e){const{open:t,defaultOpen:r=!1,onOpenChange:f,disabled:a}=e,[n,y]=ie({controlled:t,default:r,name:"Collapsible",state:"open"}),{mounted:s,setMounted:p,transitionStatus:v}=ae(n,!0,!0),c=le(),[d,l]=i.useState(),m=d===null?void 0:d??c,b=L(g=>{const S=!n,C=X(ue,g.nativeEvent);f(S,C),!C.isCanceled&&y(S)});return i.useMemo(()=>({defaultPanelId:c,disabled:a,handleTrigger:b,mounted:s,open:n,panelId:m,setMounted:p,setOpen:y,setPanelIdState:l,transitionStatus:v}),[c,a,b,s,n,m,p,y,l,v])}const te=i.createContext(void 0);function ne(){const e=i.useContext(te);if(e===void 0)throw new Error(ce(15));return e}const Oe="data-open",Ae="data-closed",$=de,Me="data-panel-open",Te={[Oe]:""},xe={[Ae]:""},Ee={open(e){return e?{[Me]:""}:null}},we={open(e){return e?Te:xe}},se={...we,...ee},Ue=i.forwardRef(function(t,r){const{render:f,className:a,defaultOpen:n=!1,disabled:y=!1,onOpenChange:s,open:p,style:v,...c}=t,d=L(s),l=Ce({open:p,defaultOpen:n,onOpenChange:d,disabled:y}),m=i.useMemo(()=>({open:l.open,disabled:l.disabled,transitionStatus:l.transitionStatus}),[l.open,l.disabled,l.transitionStatus]),b=i.useMemo(()=>({...l,onOpenChange:d,state:m}),[l,d,m]),g=J("div",t,{state:m,ref:r,props:c,stateAttributesMapping:se});return fe.jsx(te.Provider,{value:b,children:g})}),De={...Ee,...ee},He=i.forwardRef(function(t,r){const{panelId:f,open:a,handleTrigger:n,state:y,disabled:s}=ne(),{className:p,disabled:v=s,render:c,nativeButton:d=!0,style:l,...m}=t,{getButtonProps:b,buttonRef:g}=pe({disabled:v,native:d});return J("button",t,{state:y,ref:[r,g],props:[{"aria-controls":a?f:void 0,"aria-expanded":a,onClick:n},m,b],stateAttributesMapping:De})}),I={height:void 0,width:void 0};function Ne(e){const{externalRef:t,hiddenUntilFound:r,id:f,keepMounted:a,mounted:n,onOpenChange:y,open:s,setMounted:p,setOpen:v,transitionStatus:c}=e,d=i.useRef(null),l=i.useRef(null),[m,b]=i.useState(I),g=i.useRef(I),S=i.useRef(!1),C=i.useRef(s),j=i.useRef(!1),[B,T]=i.useState(!1),P=i.useRef(null),Y=me(t,d),O=he(s),q=ge(d),x=!s&&!n,E=B?"idle":c,U=s&&(C.current||j.current),V=!s&&n&&l.current==="css-animation"&&m.height===void 0&&m.width===void 0?g.current:m,W=r&&x&&l.current!=="css-animation",h=L((o,u=!0)=>{u&&(g.current=o),b(o)}),A=L(()=>{P.current?.(),P.current=null}),H=L(o=>{A(),P.current=()=>{P.current=null,o()}}),M=L(()=>{s&&n&&l.current==="css-animation"&&(j.current=!0)});K(()=>{!B||c==="starting"||T(!1)},[B,c]),i.useEffect(()=>()=>{M(),A()},[M,A]),K(()=>{s||(C.current=!1,j.current=!1);const o=d.current;if(!o)return;!s&&P.current&&A();const u=Ie(o,U);if(l.current=u,s&&c==="idle"&&C.current&&u==="css-animation"){g.current=F(o);return}if(s&&c==="starting"){const w=S.current;if(S.current=!1,u==="none"){h(F(o)),T(!0);return}if(u==="css-transition"){const D=Fe(o);if(h(F(o)),!w)return D;const N=z(o,"transition-duration","0s");return H(N),T(!0),D}h(F(o));const Z=z(o,"animation-name","none");if(!w){Z();return}const G=z(o,"animation-duration","0s");Z(),H(G),T(!0);return}if(!s&&n&&(c==="idle"||c==="starting")){if(u==="none"){h(I,!1),p(!1);return}h(F(o));return}if(c!=="ending")return;if(u==="none"){p(!1);return}const R=F(o);if(!(R.height>0||R.width>0)){p(!1);return}h(R),u==="css-animation"&&z(o,"animation-name","none")()},[n,s,A,h,p,H,U,c]),ye({enabled:s&&n&&E==="idle",open:!0,ref:d,onComplete(){s&&h(I,!1)}}),i.useEffect(()=>{if(s||!n||E!=="ending")return;if(!d.current){p(!1),h(I,!1);return}const u=new AbortController;let R=-1;function _(){O.current||(p(!1),h(I,!1))}return R=k.request(()=>{q(_,u.signal)}),()=>{k.cancel(R),u.abort()}},[O,n,s,E,q,h,p]),K(()=>{const o=d.current;!o||!r||!x||o.setAttribute("hidden","until-found")},[x,r]),i.useEffect(function(){const u=d.current;if(!u)return;const R=Pe.create();let _=-1;const w=(D,N)=>{R.start(0,()=>{O.current||(_=k.request(()=>{O.current||(D&&(S.current=!1),N&&u.setAttribute($,""),u.setAttribute("hidden","until-found"))}))})},G=ve(u,"beforematch",D=>{const N=X(Se,D);if(y(!0,N),N.isCanceled){w(!1,!1);return}S.current=!0;const re=u.hasAttribute($);u.removeAttribute($),v(!0),w(!0,re)});return()=>{R.clear(),k.cancel(_),G()}},[O,y,v]);const oe=a||r||n||s;return{height:V.height,props:{...W?{[$]:""}:void 0,hidden:x,id:f},ref:Y,shouldPreventOpenAnimation:U,shouldRender:oe,transitionStatus:E,width:V.width}}function F(e){return{height:e.scrollHeight,width:e.scrollWidth}}function Ie(e,t){const r=be(e).getComputedStyle(e),f=(r.animationName.split(",").map(n=>n.trim()).some(n=>n!==""&&n!=="none")||t)&&Q(r.animationDuration),a=Q(r.transitionDuration);return f&&a||a?"css-transition":f?"css-animation":"none"}function Q(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function z(e,t,r){const f=e.style.getPropertyValue(t),a=e.style.getPropertyPriority(t);return e.style.setProperty(t,r),()=>{if(f===""){e.style.removeProperty(t);return}e.style.setProperty(t,f,a)}}function Fe(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(a=>{e.style.setProperty(a,"initial","important")});function r(){Object.entries(t).forEach(([a,n])=>{if(n===""){e.style.removeProperty(a);return}e.style.setProperty(a,n)})}const f=k.request(r);return()=>{k.cancel(f),r()}}const Le="--collapsible-panel-height",ke="--collapsible-panel-width",_e=i.forwardRef(function(t,r){const{className:f,hiddenUntilFound:a,keepMounted:n,render:y,id:s,style:p,...v}=t,{defaultPanelId:c,mounted:d,onOpenChange:l,open:m,setMounted:b,setPanelIdState:g,setOpen:S,state:C,transitionStatus:j}=ne(),B=a??!1,T=n??!1,P=s||void 0,Y=P??c;K(()=>(g(M=>P??(M===null?void 0:M)),()=>{g(M=>M===P?null:M)}),[P,g]);const{height:O,props:q,ref:x,shouldPreventOpenAnimation:E,shouldRender:U,transitionStatus:V,width:W}=Ne({externalRef:r,hiddenUntilFound:B,id:Y,keepMounted:T,mounted:d,onOpenChange:l,open:m,setMounted:b,setOpen:S,transitionStatus:j}),h={...C,transitionStatus:V},A=Re(p,h),H=J("div",{...t,style:void 0},{state:h,ref:x,props:[q,{style:{[Le]:O===void 0?"auto":`${O}px`,[ke]:W===void 0?"auto":`${W}px`}},v,A?{style:A}:void 0,E?{style:{animationName:"none"}}:void 0],stateAttributesMapping:se});return U?H:null});export{Ue as C,He as a,_e as b};