github-issue-tower-defence-management 2.8.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/.github/workflows/umino-project.yml +0 -8
  2. package/CHANGELOG.md +7 -0
  3. package/README.md +1 -1
  4. package/bin/adapter/entry-points/console/consoleOperationApi.js +12 -0
  5. package/bin/adapter/entry-points/console/consoleOperationApi.js.map +1 -1
  6. package/bin/adapter/entry-points/console/ui-dist/assets/{index-DkMqSpkk.js → index-BSa2JTna.js} +2 -2
  7. package/bin/adapter/entry-points/console/ui-dist/index.html +1 -1
  8. package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +5 -1
  9. package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
  10. package/bin/adapter/repositories/projectFieldDefinition.js +1 -0
  11. package/bin/adapter/repositories/projectFieldDefinition.js.map +1 -1
  12. package/package.json +1 -1
  13. package/src/adapter/entry-points/console/consoleOperationApi.test.ts +84 -0
  14. package/src/adapter/entry-points/console/consoleOperationApi.ts +17 -0
  15. package/src/adapter/entry-points/console/ui/e2e/consoleScenario.spec.ts +6 -0
  16. package/src/adapter/entry-points/console/ui/e2e/consoleTestHarness.ts +5 -1
  17. package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleNextActionDateActions.test.tsx +7 -1
  18. package/src/adapter/entry-points/console/ui/src/features/console/components/operations/ConsoleNextActionDateActions.tsx +14 -0
  19. package/src/adapter/entry-points/console/ui/src/features/console/logic/actionToast.test.ts +22 -0
  20. package/src/adapter/entry-points/console/ui/src/features/console/logic/actionToast.ts +6 -0
  21. package/src/adapter/entry-points/console/ui/src/features/console/logic/operations.ts +5 -1
  22. package/src/adapter/entry-points/console/ui-dist/assets/{index-DkMqSpkk.js → index-BSa2JTna.js} +2 -2
  23. package/src/adapter/entry-points/console/ui-dist/index.html +1 -1
  24. package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.test.ts +63 -8
  25. package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts +7 -1
  26. package/src/adapter/repositories/projectFieldDefinition.test.ts +1 -0
  27. package/src/adapter/repositories/projectFieldDefinition.ts +1 -0
  28. package/src/domain/entities/Project.ts +1 -0
  29. package/src/domain/usecases/ClearPastNextActionDateHourUseCase.test.ts +1 -0
  30. package/types/adapter/entry-points/console/consoleOperationApi.d.ts.map +1 -1
  31. package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
  32. package/types/adapter/repositories/projectFieldDefinition.d.ts.map +1 -1
  33. package/types/domain/entities/Project.d.ts +1 -0
  34. package/types/domain/entities/Project.d.ts.map +1 -1
@@ -27,7 +27,11 @@ export type ConsoleReviewAction =
27
27
  | 'unnecessary'
28
28
  | 'totally_wrong';
29
29
 
30
- export type ConsoleNextActionDateAction = 'snooze_1day' | 'snooze_1week';
30
+ export type ConsoleNextActionDateAction =
31
+ | 'snooze_1hour'
32
+ | 'snooze_3hours'
33
+ | 'snooze_1day'
34
+ | 'snooze_1week';
31
35
 
32
36
  export type ConsoleCloseAction = 'close' | 'close_not_planned';
33
37
 
@@ -10,7 +10,7 @@ Error generating stack: `+e.message+`
10
10
 
11
11
  `);i=c.pop()??``;for(let e of c){if(!e.startsWith(`data: `))continue;let n=Xn(e.slice(6));if(n!==null){if(n.type===`progress`)r({fetched:typeof n.fetched==`number`?n.fetched:0,total:typeof n.total==`number`?n.total:0});else if(n.type===`done`){let e=Jn(n.snapshot);if(e===null){t(`error`),s([`Failed to parse snapshot`]);return}if(e.failures.length>0){s(e.failures),t(`error`);return}await jn(e),An(!0),a(e),t(`on`),s([])}}}}}).catch(e=>{e instanceof Error&&e.name===`AbortError`||(t(`error`),s([e instanceof Error?e.message:String(e)]))})},[]),turnOff:(0,_.useCallback)(()=>{c.current!==null&&(c.current.abort(),c.current=null),t(`off`),a(null),r(null),s([]),An(!1),Nn().catch(()=>{})},[])}},Qn=`totally wrong`,$n=`This pull request is unnecessary.`,er=e=>`The pull request for this issue was unnecessary and has been closed: ${e}\n\nDo not create it again.`,tr=e=>e.map(e=>`${e.path}:${e.line} ${e.body}`).join(`
12
12
 
13
- `),nr=`In Tmux by human`,rr=[`In Tmux by agent`,`In Tmux by human`,`Todo by human`,`Todo by agent`,`Awaiting Workspace`],ir=e=>e===`todo-by-human`||e===`todo-by-agent`,ar=5e3,or=e=>`${e.isPr?`PR #`:`#`}${e.number}`,sr=(e,t)=>{switch(e.type){case`review`:return e.action===`approve_and_merge`?`Approved & Merged`:e.action===`request_changes`?`Rejected`:e.action===`totally_wrong`?`Marked totally wrong`:`Marked unnecessary`;case`next_action_date`:return e.action===`snooze_1day`?`Next Action Date +1 day`:ir(t)?`Next Action Date +1 week and skip`:`Next Action Date +1 week`;case`set_story`:return`Story → ${e.optionName}`;case`set_status`:return`Status → ${e.optionName}`;case`set_in_tmux_by_human`:return`Added to In Tmux by human`;case`ok_and_awaiting_workspace`:return`ok → Awaiting Workspace`;case`close`:return e.action===`close`?`Closed`:`Closed as not planned`}},cr=e=>{switch(e.type){case`review`:return e.action===`approve_and_merge`?`green`:e.action===`request_changes`?`amber`:e.action===`totally_wrong`?`red`:`gray`;case`next_action_date`:return`amber`;case`set_story`:case`set_status`:case`set_in_tmux_by_human`:case`ok_and_awaiting_workspace`:return`blue`;case`close`:return`red`}},lr=(e,t)=>e.type!==`next_action_date`||ir(t),ur=(e,t,n)=>`${sr(e,n)} — ${or(t)}`,dr=e=>e instanceof Error&&e.message.length>0?e.message:String(e),fr=100,pr=e=>Math.max(0,Math.ceil((ar-e)/1e3)),mr=e=>Math.max(0,1-e/ar),hr=()=>{let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),i=(0,_.useRef)(null),a=(0,_.useRef)(0),o=(0,_.useRef)(null),s=(0,_.useRef)(!1),c=(0,_.useCallback)(()=>{o.current!==null&&(clearInterval(o.current),o.current=null)},[]),l=(0,_.useCallback)(e=>{e.commit().catch(t=>{r({message:e.message,reason:dr(t)})})},[]),u=(0,_.useCallback)(()=>{let e=i.current;c(),i.current=null,t(null),e!==null&&!s.current&&(s.current=!0,l(e))},[c,l]),d=(0,_.useCallback)(()=>{c(),i.current=null,s.current=!0,t(null)},[c]),f=(0,_.useCallback)(()=>{r(null)},[]),p=(0,_.useCallback)((e,t)=>{r({message:e,reason:t})},[]),m=(0,_.useCallback)(e=>{if(i.current!==null&&!s.current){let e=i.current;c(),s.current=!0,l(e)}s.current=!1,i.current=e,a.current=Date.now(),t({message:e.message,color:e.color,remainingSeconds:pr(0),progress:mr(0)}),e.advance(),o.current=setInterval(()=>{let n=Date.now()-a.current;if(n>=5e3){u();return}t({message:e.message,color:e.color,remainingSeconds:pr(n),progress:mr(n)})},fr)},[c,u,l]);return(0,_.useEffect)(()=>c,[c]),{pending:e,error:n,enqueue:m,showError:p,undo:d,dismissError:f}},gr=e=>typeof e==`object`&&!!e&&!Array.isArray(e),_r=e=>typeof e==`string`?e:``,vr=e=>typeof e==`number`?e:0,yr=e=>e===!0,br=`console-api-v1`,xr=async(e,t)=>{let n=`${e}?url=${encodeURIComponent(t)}`;try{let e=await fetch(n);if(!e.ok){let t=`HTTP ${e.status}`;try{let n=await e.json();gr(n)&&typeof n.error==`string`&&n.error.length>0&&(t=n.error)}catch(e){console.warn(`Failed to parse error body from non-ok response:`,e)}throw Error(t)}let t=await e.json();try{`caches`in globalThis&&globalThis.caches.open(br).then(e=>e.put(n,new Response(JSON.stringify(t),{headers:{"Content-Type":`application/json`}}))).catch(e=>{console.warn(`Failed to persist API response to cache:`,e)})}catch(e){console.warn(`Failed to access cache storage:`,e)}return t}catch(e){try{if(`caches`in globalThis){let e=await(await globalThis.caches.open(br)).match(n);if(e!==void 0)return e.json()}}catch{}throw e}},Sr=e=>!gr(e)||!Array.isArray(e.comments)?[]:e.comments.filter(gr).map(e=>({author:_r(e.author),body:_r(e.body),createdAt:_r(e.createdAt)})),Cr=e=>!gr(e)||!Array.isArray(e.files)?[]:e.files.filter(gr).map(e=>({path:_r(e.path)||_r(e.filename),additions:vr(e.additions),deletions:vr(e.deletions),status:_r(e.status),patch:typeof e.patch==`string`?e.patch:null,rawUrl:typeof e.rawUrl==`string`?e.rawUrl:null})),wr=e=>!gr(e)||!Array.isArray(e.commits)?[]:e.commits.filter(gr).map(e=>({sha:_r(e.sha),message:_r(e.message),author:_r(e.author),authoredAt:_r(e.authoredAt)})),Tr=e=>gr(e)?{title:_r(e.title),body:_r(e.body),additions:vr(e.additions),deletions:vr(e.deletions),changedFiles:vr(e.changedFiles)}:null,Er=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],Dr=e=>e===`MERGEABLE`?`MERGEABLE`:e===`CONFLICTING`?`CONFLICTING`:`UNKNOWN`,Or=e=>!gr(e)||!Array.isArray(e.relatedPullRequests)?[]:e.relatedPullRequests.filter(gr).map(e=>({url:_r(e.url),branchName:typeof e.branchName==`string`?e.branchName:null,createdAt:_r(e.createdAt),isDraft:yr(e.isDraft),isConflicted:yr(e.isConflicted),mergeableStatus:Dr(e.mergeableStatus),isPassedAllCiJob:yr(e.isPassedAllCiJob),isCiStateSuccess:yr(e.isCiStateSuccess),isResolvedAllReviewComments:yr(e.isResolvedAllReviewComments),isBranchOutOfDate:yr(e.isBranchOutOfDate),missingRequiredCheckNames:Er(e.missingRequiredCheckNames),summary:Tr(e.summary)})),kr=e=>{if(!gr(e)||!gr(e.status))return{found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]};let t=e.status;return{found:!0,isConflicted:yr(t.isConflicted),mergeableStatus:Dr(t.mergeableStatus),isPassedAllCiJob:yr(t.isPassedAllCiJob),isCiStateSuccess:yr(t.isCiStateSuccess),isBranchOutOfDate:yr(t.isBranchOutOfDate),missingRequiredCheckNames:Er(t.missingRequiredCheckNames)}},Ar=e=>gr(e)?{state:_r(e.state)||`open`,merged:yr(e.merged),isPullRequest:yr(e.isPullRequest),title:_r(e.title)}:{state:`open`,merged:!1,isPullRequest:!1,title:``},jr=()=>({fetchItemBody:async e=>{let t=await xr(`/api/itembody`,e);return gr(t)?_r(t.body):``},fetchComments:async e=>Sr(await xr(`/api/comments`,e)),fetchPrFiles:async e=>Cr(await xr(`/api/prfiles`,e)),fetchPrCommits:async e=>wr(await xr(`/api/prcommits`,e)),fetchRelatedPrs:async e=>Or(await xr(`/api/relatedprs`,e)),fetchIssueState:async e=>Ar(await xr(`/api/issuetitle`,e)),fetchPullRequestStatus:async e=>kr(await xr(`/api/pullrequeststatus`,e))}),Mr=async e=>{let t=await e.text().catch(()=>``);if(t.length===0)return`HTTP ${e.status}`;try{let e=JSON.parse(t);if(gr(e)&&typeof e.error==`string`)return e.error}catch{return t}return t},Nr=async(e,t)=>{let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(await Mr(n))},Pr=`/api/comment`,Fr=e=>{if(!gr(e)||!gr(e.comment))throw Error(`comment was not returned`);return{author:_r(e.comment.author),body:_r(e.comment.body),createdAt:_r(e.comment.createdAt)}},Ir=async e=>{let t=await fetch(Pr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`HTTP ${t.status}`);return Fr(await t.json())},Lr=`/api/upload`,Rr=e=>{let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)},zr=async e=>{let t=await fetch(Lr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t));let n=await t.json();if(!gr(n)||typeof n.markdown!=`string`)throw Error(`markdown was not returned`);return n.markdown},Br=`/api/addstory`,Vr=async e=>{let t=await fetch(Br,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t))},Hr=`/api/reviewcomment`,Ur=async e=>{let t=await fetch(Hr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t))},Wr=`/api/createissue`,Gr=`/api/storycolor`,Kr=async e=>{let t=await fetch(Gr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t))},qr=async e=>{let t=await fetch(Wr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t));let n=await t.json();if(!(e=>typeof e==`object`&&!!e&&!Array.isArray(e))(n)||typeof n.issueUrl!=`string`)throw Error(`issueUrl was not returned`);return n.issueUrl},Jr=`/api/reorderstory`,Yr=async e=>{let t=await fetch(Jr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t))},Xr=async()=>{let e=await fetch(`/api/projects`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();if(typeof t!=`object`||!t||Array.isArray(t))return[];let n=t;return Array.isArray(n.pjcodes)?n.pjcodes.filter(e=>typeof e==`string`):[]},Zr=class{fetcher;cache=new Map;inFlight=new Map;prefetchInFlight=new Set;constructor(e){this.fetcher=e}peek=e=>this.cache.get(e);has=e=>this.cache.has(e);load=(e,t)=>{let n=this.cache.get(e);if(n!==void 0)return Promise.resolve(n);let r=this.inFlight.get(e);if(r!==void 0)return r;let i=this.fetcher(t).then(t=>(this.cache.set(e,t),t)).finally(()=>{this.inFlight.delete(e)});return this.inFlight.set(e,i),i};prefetch=(e,t)=>{this.cache.has(e)||this.inFlight.has(e)||this.prefetchInFlight.has(e)||(this.prefetchInFlight.add(e),this.fetcher(t).then(t=>{this.cache.set(e,t)}).catch(()=>{}).finally(()=>{this.prefetchInFlight.delete(e)}))};seed(e,t){this.cache.set(e,t)}invalidate=e=>{this.cache.delete(e)}},Qr=e=>{try{let t=new URL(e).pathname.split(`/`).filter(Boolean);if(t.length>=4)return`${t[0]}/${t[1]}#${t[3]}`}catch{}return e},$r=(e,t)=>{for(let[n,r]of Object.entries(t.items)){let t=Qr(n);e.body.seed(t,r.body),e.comments.seed(t,r.comments),e.state.seed(t,r.state),r.files!==null&&e.files.seed(t,r.files),r.commits!==null&&e.commits.seed(t,r.commits),r.prStatus!==null&&e.prStatus.seed(t,r.prStatus),r.relatedPrs!==null&&e.relatedPrs.seed(t,r.relatedPrs)}},ei=(e=null)=>(0,_.useMemo)(()=>{let t=jr(),n={client:t,body:new Zr(t.fetchItemBody),comments:new Zr(t.fetchComments),files:new Zr(t.fetchPrFiles),commits:new Zr(t.fetchPrCommits),relatedPrs:new Zr(t.fetchRelatedPrs),state:new Zr(t.fetchIssueState),prStatus:new Zr(t.fetchPullRequestStatus)};return e!==null&&$r(n,e),n},[e]),ti=0,ni=500,ri=2e3,ii=e=>{let t=window;if(typeof t.requestIdleCallback==`function`&&typeof t.cancelIdleCallback==`function`){let n=t.requestIdleCallback(e,{timeout:ri});return{cancel:()=>t.cancelIdleCallback?.(n)}}let n=window.setTimeout(e,0);return{cancel:()=>window.clearTimeout(n)}},ai=(e,t)=>{let n=`${t.repo}#${t.number}`;e.body.prefetch(n,t.url),e.state.prefetch(n,t.url),e.comments.prefetch(n,t.url),t.isPr?(e.files.prefetch(n,t.url),e.commits.prefetch(n,t.url),e.prStatus.prefetch(n,t.url)):e.relatedPrs.prefetch(n,t.url)},oi=(e,t,n)=>{(0,_.useEffect)(()=>{if(t===null)return;let r=n.findIndex(e=>e.projectItemId===t.projectItemId);if(r===-1)return;let i=n.slice(r+1,r+1+ti);if(i.length===0)return;let a=null,o=window.setTimeout(()=>{a=ii(()=>{for(let t of i)ai(e,t)})},ni);return()=>{window.clearTimeout(o),a?.cancel()}},[e,t,n])},si=`/api/features`,ci=()=>{let[e,t]=(0,_.useState)({airplaneMode:!1});return(0,_.useEffect)(()=>{fetch(si).then(async e=>{if(!e.ok)return;let n=await e.json();typeof n==`object`&&n&&!Array.isArray(n)&&`airplaneMode`in n&&typeof n.airplaneMode==`boolean`&&t({airplaneMode:n.airplaneMode})}).catch(e=>{console.warn(`Failed to fetch /api/features`,e)})},[]),e},li=(e,t)=>{let n=b.findIndex(t=>t.name===e);if(n===-1)return null;for(let e=n+1;e<b.length;e+=1){let n=b[e].name;if((t[n]??0)>0)return n}return null},ui=e=>{for(let t of b)if((e[t.name]??0)>0)return t.name;return b[0].name},di=new Set(b.map(e=>e.name)),fi=e=>{let t=e.split(`/`).filter(e=>e.length>0);if(t.length<3||t[0]!==`projects`)return null;let n=t[2];return di.has(n)?n:null},pi=e=>{if(!e.startsWith(`#item/`))return null;let t=e.slice(6);return t.length===0?null:decodeURIComponent(t)},mi=(e,t)=>{let n=(0,_.useCallback)(()=>{let e=ui(t);return typeof window>`u`?{activeTab:e,selectedItemKey:null}:{activeTab:fi(window.location.pathname)??e,selectedItemKey:pi(window.location.hash)}},[t]),[r,i]=(0,_.useState)(n);(0,_.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{i(n())};return window.addEventListener(`popstate`,e),window.addEventListener(`hashchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`hashchange`,e)}},[n]),(0,_.useEffect)(()=>{if(typeof window>`u`||fi(window.location.pathname)!==null)return;let e=ui(t);i(t=>t.activeTab===e?t:{...t,activeTab:e})},[t]);let a=(0,_.useCallback)(t=>e===null?`#${t}`:`/projects/${e}/${t}`,[e]),o=(0,_.useCallback)(e=>{if(typeof window>`u`){i({activeTab:e,selectedItemKey:null});return}window.history.pushState({},``,a(e)),i({activeTab:e,selectedItemKey:null})},[a]),s=(0,_.useCallback)(e=>{typeof window<`u`&&(window.location.hash=`#item/${encodeURIComponent(e)}`),i(t=>({...t,selectedItemKey:e}))},[]),c=(0,_.useCallback)(()=>{if(typeof window<`u`&&window.location.hash!==``){let e=`${window.location.pathname}${window.location.search}`;window.history.pushState({},``,e)}i(e=>({...e,selectedItemKey:null}))},[]);return{activeTab:r.activeTab,selectedItemKey:r.selectedItemKey,tabHref:a,selectTab:o,openItem:s,closeItem:c}},hi=e=>`pv_overlay_${e}`,gi=e=>e.projectItemId===``?e.itemId:e.projectItemId,_i=(e,t)=>e!==void 0&&e.done===!0&&e.mode===t,vi=(e,t,n)=>e.filter(e=>!_i(t[gi(e)],n)).length,yi=(e,t,n)=>e.filter(e=>!_i(t[gi(e)],n)),bi=(e,t)=>{let n=Date.parse(t);if(Number.isNaN(n))return{};let r={};for(let[t,i]of Object.entries(e))i.ts>=n&&(r[t]=i);return r},xi=(e,t,n)=>{if(n===null)return null;let r=Date.parse(n);if(Number.isNaN(r))return null;let i=e[gi(t)];return i===void 0||i.ts<r?null:i.status??null},Si=(e,t,n,r,i)=>{let a={...e[t]??{},...n,ts:i,mode:r};return{...e,[t]:a}},Ci=`/api/review`,wi=`/api/triage`,Ti=`/api/intmux`,Ei=(e,t,n,r,i)=>{if(r===`approve_and_merge`)return{pjcode:e,action:`approve_and_merge`,prUrl:n,projectItemId:t.projectItemId};if(r===`request_changes`){let r=i[0];return{pjcode:e,action:`request_changes`,prUrl:n,projectItemId:t.projectItemId,commentBody:tr(i),...r===void 0?{}:{changedFilePath:r.path,line:r.line,side:r.side}}}return r===`totally_wrong`?{pjcode:e,action:`close`,prUrl:n,issueUrl:t.url,projectItemId:t.projectItemId,commentBody:Qn}:{pjcode:e,action:`unnecessary`,prUrl:n,projectItemId:t.projectItemId,issueUrl:t.url,commentBody:$n,issueCommentBody:er(n)}},Di=()=>Error(`No project specified in the URL path.`),Oi=(e,t,n,r)=>{let{patchOverlay:i}=n,a=(0,_.useCallback)(e=>{if(r===void 0)return;let t=`${e.repo}#${e.number}`;r.body.invalidate(t),r.comments.invalidate(t)},[r]),o=(0,_.useCallback)(e=>{i(gi(e),{done:!0},t)},[i,t]);return{reviewPullRequest:(0,_.useCallback)(async(t,n,r,i=[])=>{if(e===null)throw Di();o(t),await Nr(Ci,Ei(e,t,n,r,i)),a(t)},[e,o,a]),setNextActionDate:(0,_.useCallback)(async(t,n)=>{if(e===null)throw Di();let r={pjcode:e,action:n,issueUrl:t.url,projectItemId:t.projectItemId};o(t),await Nr(wi,r),a(t)},[e,o,a]),setStory:(0,_.useCallback)(async(n,r)=>{if(e===null)throw Di();let o={pjcode:e,action:`set_story`,issueUrl:n.url,projectItemId:n.projectItemId,storyOptionId:r.id};i(gi(n),{done:!0,story:{name:r.name,color:r.color}},t),await Nr(wi,o),a(n)},[e,a,i,t]),setStatus:(0,_.useCallback)(async(n,r)=>{if(e===null)throw Di();let o={pjcode:e,action:`set_status`,issueUrl:n.url,projectItemId:n.projectItemId,statusName:r.name};i(gi(n),{done:!0,status:{name:r.name,color:r.color}},t),await Nr(wi,o),a(n)},[e,a,i,t]),setInTmuxByHuman:(0,_.useCallback)(async(n,r)=>{if(e===null)throw Di();let o={pjcode:e,action:`set_intmux`,issueUrl:n.url,projectItemId:n.projectItemId};i(gi(n),{done:!0,status:{name:r.name,color:r.color}},t),await Nr(Ti,o),a(n)},[e,a,i,t]),closeIssue:(0,_.useCallback)(async(t,n)=>{if(e===null)throw Di();let r={pjcode:e,action:n,issueUrl:t.url,projectItemId:t.projectItemId};o(t),await Nr(wi,r),a(t)},[e,o,a]),okAndMoveToAwaitingWorkspace:(0,_.useCallback)(async(n,r)=>{if(e===null)throw Di();i(gi(n),{done:!0,status:{name:r.name,color:r.color}},t),await Ir({pjcode:e,url:n.url,body:`ok`}),await Nr(wi,{pjcode:e,action:`set_status`,issueUrl:n.url,projectItemId:n.projectItemId,statusName:r.name}),a(n)},[e,a,i,t]),addComment:(0,_.useCallback)(async(t,n)=>{if(e===null)throw Di();let r=await Ir({pjcode:e,url:t.url,body:n});return a(t),r},[e,a]),uploadAttachment:(0,_.useCallback)(async(t,n)=>{if(e===null)throw Error(`no project in the URL path`);let r=Rr(new Uint8Array(await n.arrayBuffer()));return zr({pjcode:e,url:t.url,fileName:n.name,contentBase64:r})},[e]),addInlineReviewComment:(0,_.useCallback)(async(t,n,r,i,a)=>{if(e===null)throw Di();await Ur({pjcode:e,url:t,path:n,line:r,side:i,body:a})},[e])}},ki=e=>typeof e==`object`&&!!e&&typeof e.ts==`number`,Ai=e=>{if(typeof localStorage>`u`)return{};let t=localStorage.getItem(hi(e));if(t===null)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{};let r={};for(let[e,t]of Object.entries(n))ki(t)&&(r[e]=t);return r},ji=(e,t)=>{typeof localStorage<`u`&&localStorage.setItem(hi(e),JSON.stringify(t))},Mi=e=>{let[t,n]=(0,_.useState)(()=>Ai(e));return{overlay:t,patchOverlay:(0,_.useCallback)((t,r,i)=>{n(n=>{let a=Si(n,t,r,i,Date.now());return ji(e,a),a})},[e])}},Ni=e=>{let t=e.split(`/`).filter(e=>e.length>0);if(t.length<2||t[0]!==`projects`)return null;let n=t[1];return n.length===0?null:n},Pi=()=>Ni(typeof window>`u`?``:window.location.pathname),z=()=>{let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=!1;return r(!0),a(null),Xr().then(n=>{e||(t(n),r(!1))}).catch(t=>{e||(a(t instanceof Error?t:Error(String(t))),r(!1))}),()=>{e=!0}},[]),{pjcodes:e,isLoading:n,error:i}},Fi=e=>{let t=(0,_.useRef)(e),n=(0,_.useRef)(Date.now());return t.current!==e&&(t.current=e,n.current=Date.now()),{isTimerExpired:(0,_.useCallback)(e=>e<=0?!1:Date.now()-n.current>=e*60*1e3,[])}},Ii=(e,t)=>{let n=Math.abs(e);return n<60||n<=Math.abs(t)*1.5?null:e<0?`next`:`previous`},Li=(e,t)=>{let n=Math.abs(e),r=Math.abs(t);return r>n*1.5&&r>20},Ri=e=>{let t=e instanceof Element?e:null;for(;t!==null&&t!==document.body;){let e=window.getComputedStyle(t).overflowX;if((e===`auto`||e===`scroll`)&&t.scrollWidth>t.clientWidth)return!0;t=t.parentElement}return!1},zi=e=>{let t=(0,_.useRef)(e);t.current=e;let n=(0,_.useRef)(null),r=(0,_.useCallback)(e=>{let n=0,r=0,i=!1,a=e=>{if(e.touches.length!==1){i=!1;return}if(Ri(e.target)){i=!1;return}let t=e.touches[0];n=t.clientX,r=t.clientY,i=!0},o=e=>{if(!i)return;let t=e.touches[0];Li(t.clientX-n,t.clientY-r)&&(i=!1)},s=e=>{if(!i||(i=!1,e.changedTouches.length!==1))return;let a=e.changedTouches[0],o=Ii(a.clientX-n,a.clientY-r);o!==null&&t.current(o)};return e.addEventListener(`touchstart`,a,{passive:!0}),e.addEventListener(`touchmove`,o,{passive:!0}),e.addEventListener(`touchend`,s,{passive:!0}),()=>{e.removeEventListener(`touchstart`,a),e.removeEventListener(`touchmove`,o),e.removeEventListener(`touchend`,s)}},[]),i=(0,_.useCallback)(e=>{n.current!==null&&(n.current(),n.current=null),e!==null&&(n.current=r(e))},[r]);return(0,_.useEffect)(()=>()=>{n.current!==null&&(n.current(),n.current=null)},[]),i},Bi=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Vi=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],Hi=e=>!Bi(e)||!Array.isArray(e.items)?[]:e.items.filter(Bi).map(e=>({...e,relatedOpenPullRequestUrls:Vi(e.relatedOpenPullRequestUrls)})),Ui=e=>Array.isArray(e)?e.filter(Bi):[],Wi=e=>Array.isArray(e)?e.filter(Bi):[],Gi=e=>({items:Hi(e),generatedAt:Bi(e)&&typeof e.generatedAt==`string`?e.generatedAt:``,statusOptions:Bi(e)?Ui(e.statusOptions):[],storyOptions:Bi(e)?Ui(e.storyOptions):[],storyColors:Bi(e)&&Bi(e.storyColors)?e.storyColors:{},stories:Bi(e)?Wi(e.stories):[],defaultNameWithOwner:Bi(e)&&typeof e.defaultNameWithOwner==`string`?e.defaultNameWithOwner:null,storyOrder:Bi(e)?Vi(e.storyOrder):[]}),Ki=()=>{let e={};for(let t of b)e[t.name]=null;return e},qi=(e,t)=>`/projects/${e}/${t}/list.json`,Ji=6e4,Yi=`console-list-v1`,Xi=(e,t)=>{try{if(!(`caches`in globalThis))return;globalThis.caches.open(Yi).then(n=>n.put(e,new Response(JSON.stringify(t),{headers:{"Content-Type":`application/json`}}))).catch(e=>{console.warn(`Failed to persist tab snapshot to cache:`,e)})}catch(e){console.warn(`Failed to access cache storage:`,e)}},Zi=async e=>{if(!(`caches`in globalThis))return null;try{let t=await(await globalThis.caches.open(Yi)).match(e);return t===void 0?null:{...Gi(await t.json()),fromCache:!0}}catch{return null}},Qi=async(e,t)=>{let n=qi(e,t);try{let e=await fetch(n);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();return Xi(n,t),{snapshot:{...Gi(t),fromCache:!1},error:null}}catch(e){let t=await Zi(n);return t===null?{snapshot:null,error:e instanceof Error?e:Error(String(e))}:{snapshot:t,error:null}}},$i=async e=>{let t=await Promise.all(b.map(async t=>{let{snapshot:n,error:r}=await Qi(e,t.name);return{tabName:t.name,snapshot:n,error:r}})),n=Ki(),r=null;for(let{tabName:e,snapshot:i,error:a}of t)n[e]=i,a!==null&&r===null&&(r=a);return{snapshots:n,firstError:Object.values(n).every(e=>e===null)?r:null}},ea=(e,t=null)=>{let[n,r]=(0,_.useState)(Ki),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(t!==null&&e!==null){let n=t.tabs[e];if(n!==void 0){let e=Ki();for(let t of b){let r=n[t.name];r!==void 0&&(e[t.name]=r)}r(e),a(!1),s(null);return}}let n=!1;if(a(!0),s(null),e===null)return r(Ki()),a(!1),s(`No project specified in the URL path.`),()=>{n=!0};let i=()=>{$i(e).then(({snapshots:e,firstError:t})=>{n||(r(e),s(t===null?null:t.message),a(!1))}).catch(e=>{n||(s(e instanceof Error?e.message:String(e)),a(!1))})};i();let o=setInterval(i,Ji);return()=>{n=!0,clearInterval(o)}},[e,t]),{snapshots:n,isLoading:i,error:o}},ta=`tdpm-timer-settings`,na=()=>({timerMode:!1,projectMinutes:{}}),ra=()=>{if(typeof localStorage>`u`)return na();let e=localStorage.getItem(ta);if(e===null)return na();try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return na();let n=t,r=typeof n.timerMode==`boolean`&&n.timerMode,i=n.projectMinutes;return{timerMode:r,projectMinutes:typeof i==`object`&&i&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).filter(([,e])=>typeof e==`number`).map(([e,t])=>[e,t])):{}}}catch{return na()}},ia=e=>{typeof localStorage<`u`&&localStorage.setItem(ta,JSON.stringify(e))},aa=(e,t,n)=>{if(e.length===0)return null;let r=t===null?-1:e.indexOf(t),i=r===-1?0:(r+1)%e.length,a=r===-1?e.length:e.length-1;for(let t=0;t<a;t++){let r=e[(i+t)%e.length];if((n[r]??0)>0)return r}return null},oa=()=>{let[e,t]=(0,_.useState)(ra),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(e),o=(0,_.useCallback)(()=>{t(e=>(a(e),e)),r(!0)},[]),s=(0,_.useCallback)(()=>{r(!1)},[]),c=(0,_.useCallback)(()=>{a(e=>(ia(e),t(e),e)),r(!1)},[]),l=(0,_.useCallback)(e=>{a(t=>({...t,timerMode:e}))},[]),u=(0,_.useCallback)((e,t)=>{a(n=>({...n,projectMinutes:{...n.projectMinutes,[e]:t}}))},[]);return{timerMode:e.timerMode,projectMinutes:e.projectMinutes,isOpen:n,draftTimerMode:i.timerMode,draftProjectMinutes:i.projectMinutes,openSettings:o,closeSettings:s,saveSettings:c,toggleDraftTimerMode:l,changeDraftMinutes:u}},sa=e=>{window.location.replace(e)},ca=e=>{window.location.assign(e)},la=(e,t)=>{let n=e.indexOf(t);if(n<0)return e.length>0?e[0]:null;let r=n+1;return r<e.length?e[r]:null},ua=(e,t)=>{let n=e.indexOf(t);return n<0||n>=e.length-1?null:e[n+1]},da=(e,t)=>{let n=e.indexOf(t);return n<=0?null:e[n-1]},fa=(e,t)=>e.length===0?`${t}\n`:e.endsWith(`
13
+ `),nr=`In Tmux by human`,rr=[`In Tmux by agent`,`In Tmux by human`,`Todo by human`,`Todo by agent`,`Awaiting Workspace`],ir=e=>e===`todo-by-human`||e===`todo-by-agent`,ar=5e3,or=e=>`${e.isPr?`PR #`:`#`}${e.number}`,sr=(e,t)=>{switch(e.type){case`review`:return e.action===`approve_and_merge`?`Approved & Merged`:e.action===`request_changes`?`Rejected`:e.action===`totally_wrong`?`Marked totally wrong`:`Marked unnecessary`;case`next_action_date`:return e.action===`snooze_1hour`?`Next Action Hour +1 hour`:e.action===`snooze_3hours`?`Next Action Hour +3 hours`:e.action===`snooze_1day`?`Next Action Date +1 day`:ir(t)?`Next Action Date +1 week and skip`:`Next Action Date +1 week`;case`set_story`:return`Story → ${e.optionName}`;case`set_status`:return`Status → ${e.optionName}`;case`set_in_tmux_by_human`:return`Added to In Tmux by human`;case`ok_and_awaiting_workspace`:return`ok → Awaiting Workspace`;case`close`:return e.action===`close`?`Closed`:`Closed as not planned`}},cr=e=>{switch(e.type){case`review`:return e.action===`approve_and_merge`?`green`:e.action===`request_changes`?`amber`:e.action===`totally_wrong`?`red`:`gray`;case`next_action_date`:return`amber`;case`set_story`:case`set_status`:case`set_in_tmux_by_human`:case`ok_and_awaiting_workspace`:return`blue`;case`close`:return`red`}},lr=(e,t)=>e.type!==`next_action_date`||ir(t),ur=(e,t,n)=>`${sr(e,n)} — ${or(t)}`,dr=e=>e instanceof Error&&e.message.length>0?e.message:String(e),fr=100,pr=e=>Math.max(0,Math.ceil((ar-e)/1e3)),mr=e=>Math.max(0,1-e/ar),hr=()=>{let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),i=(0,_.useRef)(null),a=(0,_.useRef)(0),o=(0,_.useRef)(null),s=(0,_.useRef)(!1),c=(0,_.useCallback)(()=>{o.current!==null&&(clearInterval(o.current),o.current=null)},[]),l=(0,_.useCallback)(e=>{e.commit().catch(t=>{r({message:e.message,reason:dr(t)})})},[]),u=(0,_.useCallback)(()=>{let e=i.current;c(),i.current=null,t(null),e!==null&&!s.current&&(s.current=!0,l(e))},[c,l]),d=(0,_.useCallback)(()=>{c(),i.current=null,s.current=!0,t(null)},[c]),f=(0,_.useCallback)(()=>{r(null)},[]),p=(0,_.useCallback)((e,t)=>{r({message:e,reason:t})},[]),m=(0,_.useCallback)(e=>{if(i.current!==null&&!s.current){let e=i.current;c(),s.current=!0,l(e)}s.current=!1,i.current=e,a.current=Date.now(),t({message:e.message,color:e.color,remainingSeconds:pr(0),progress:mr(0)}),e.advance(),o.current=setInterval(()=>{let n=Date.now()-a.current;if(n>=5e3){u();return}t({message:e.message,color:e.color,remainingSeconds:pr(n),progress:mr(n)})},fr)},[c,u,l]);return(0,_.useEffect)(()=>c,[c]),{pending:e,error:n,enqueue:m,showError:p,undo:d,dismissError:f}},gr=e=>typeof e==`object`&&!!e&&!Array.isArray(e),_r=e=>typeof e==`string`?e:``,vr=e=>typeof e==`number`?e:0,yr=e=>e===!0,br=`console-api-v1`,xr=async(e,t)=>{let n=`${e}?url=${encodeURIComponent(t)}`;try{let e=await fetch(n);if(!e.ok){let t=`HTTP ${e.status}`;try{let n=await e.json();gr(n)&&typeof n.error==`string`&&n.error.length>0&&(t=n.error)}catch(e){console.warn(`Failed to parse error body from non-ok response:`,e)}throw Error(t)}let t=await e.json();try{`caches`in globalThis&&globalThis.caches.open(br).then(e=>e.put(n,new Response(JSON.stringify(t),{headers:{"Content-Type":`application/json`}}))).catch(e=>{console.warn(`Failed to persist API response to cache:`,e)})}catch(e){console.warn(`Failed to access cache storage:`,e)}return t}catch(e){try{if(`caches`in globalThis){let e=await(await globalThis.caches.open(br)).match(n);if(e!==void 0)return e.json()}}catch{}throw e}},Sr=e=>!gr(e)||!Array.isArray(e.comments)?[]:e.comments.filter(gr).map(e=>({author:_r(e.author),body:_r(e.body),createdAt:_r(e.createdAt)})),Cr=e=>!gr(e)||!Array.isArray(e.files)?[]:e.files.filter(gr).map(e=>({path:_r(e.path)||_r(e.filename),additions:vr(e.additions),deletions:vr(e.deletions),status:_r(e.status),patch:typeof e.patch==`string`?e.patch:null,rawUrl:typeof e.rawUrl==`string`?e.rawUrl:null})),wr=e=>!gr(e)||!Array.isArray(e.commits)?[]:e.commits.filter(gr).map(e=>({sha:_r(e.sha),message:_r(e.message),author:_r(e.author),authoredAt:_r(e.authoredAt)})),Tr=e=>gr(e)?{title:_r(e.title),body:_r(e.body),additions:vr(e.additions),deletions:vr(e.deletions),changedFiles:vr(e.changedFiles)}:null,Er=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],Dr=e=>e===`MERGEABLE`?`MERGEABLE`:e===`CONFLICTING`?`CONFLICTING`:`UNKNOWN`,Or=e=>!gr(e)||!Array.isArray(e.relatedPullRequests)?[]:e.relatedPullRequests.filter(gr).map(e=>({url:_r(e.url),branchName:typeof e.branchName==`string`?e.branchName:null,createdAt:_r(e.createdAt),isDraft:yr(e.isDraft),isConflicted:yr(e.isConflicted),mergeableStatus:Dr(e.mergeableStatus),isPassedAllCiJob:yr(e.isPassedAllCiJob),isCiStateSuccess:yr(e.isCiStateSuccess),isResolvedAllReviewComments:yr(e.isResolvedAllReviewComments),isBranchOutOfDate:yr(e.isBranchOutOfDate),missingRequiredCheckNames:Er(e.missingRequiredCheckNames),summary:Tr(e.summary)})),kr=e=>{if(!gr(e)||!gr(e.status))return{found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]};let t=e.status;return{found:!0,isConflicted:yr(t.isConflicted),mergeableStatus:Dr(t.mergeableStatus),isPassedAllCiJob:yr(t.isPassedAllCiJob),isCiStateSuccess:yr(t.isCiStateSuccess),isBranchOutOfDate:yr(t.isBranchOutOfDate),missingRequiredCheckNames:Er(t.missingRequiredCheckNames)}},Ar=e=>gr(e)?{state:_r(e.state)||`open`,merged:yr(e.merged),isPullRequest:yr(e.isPullRequest),title:_r(e.title)}:{state:`open`,merged:!1,isPullRequest:!1,title:``},jr=()=>({fetchItemBody:async e=>{let t=await xr(`/api/itembody`,e);return gr(t)?_r(t.body):``},fetchComments:async e=>Sr(await xr(`/api/comments`,e)),fetchPrFiles:async e=>Cr(await xr(`/api/prfiles`,e)),fetchPrCommits:async e=>wr(await xr(`/api/prcommits`,e)),fetchRelatedPrs:async e=>Or(await xr(`/api/relatedprs`,e)),fetchIssueState:async e=>Ar(await xr(`/api/issuetitle`,e)),fetchPullRequestStatus:async e=>kr(await xr(`/api/pullrequeststatus`,e))}),Mr=async e=>{let t=await e.text().catch(()=>``);if(t.length===0)return`HTTP ${e.status}`;try{let e=JSON.parse(t);if(gr(e)&&typeof e.error==`string`)return e.error}catch{return t}return t},Nr=async(e,t)=>{let n=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw Error(await Mr(n))},Pr=`/api/comment`,Fr=e=>{if(!gr(e)||!gr(e.comment))throw Error(`comment was not returned`);return{author:_r(e.comment.author),body:_r(e.comment.body),createdAt:_r(e.comment.createdAt)}},Ir=async e=>{let t=await fetch(Pr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(`HTTP ${t.status}`);return Fr(await t.json())},Lr=`/api/upload`,Rr=e=>{let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)},zr=async e=>{let t=await fetch(Lr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t));let n=await t.json();if(!gr(n)||typeof n.markdown!=`string`)throw Error(`markdown was not returned`);return n.markdown},Br=`/api/addstory`,Vr=async e=>{let t=await fetch(Br,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t))},Hr=`/api/reviewcomment`,Ur=async e=>{let t=await fetch(Hr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t))},Wr=`/api/createissue`,Gr=`/api/storycolor`,Kr=async e=>{let t=await fetch(Gr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t))},qr=async e=>{let t=await fetch(Wr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t));let n=await t.json();if(!(e=>typeof e==`object`&&!!e&&!Array.isArray(e))(n)||typeof n.issueUrl!=`string`)throw Error(`issueUrl was not returned`);return n.issueUrl},Jr=`/api/reorderstory`,Yr=async e=>{let t=await fetch(Jr,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)throw Error(await Mr(t))},Xr=async()=>{let e=await fetch(`/api/projects`);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();if(typeof t!=`object`||!t||Array.isArray(t))return[];let n=t;return Array.isArray(n.pjcodes)?n.pjcodes.filter(e=>typeof e==`string`):[]},Zr=class{fetcher;cache=new Map;inFlight=new Map;prefetchInFlight=new Set;constructor(e){this.fetcher=e}peek=e=>this.cache.get(e);has=e=>this.cache.has(e);load=(e,t)=>{let n=this.cache.get(e);if(n!==void 0)return Promise.resolve(n);let r=this.inFlight.get(e);if(r!==void 0)return r;let i=this.fetcher(t).then(t=>(this.cache.set(e,t),t)).finally(()=>{this.inFlight.delete(e)});return this.inFlight.set(e,i),i};prefetch=(e,t)=>{this.cache.has(e)||this.inFlight.has(e)||this.prefetchInFlight.has(e)||(this.prefetchInFlight.add(e),this.fetcher(t).then(t=>{this.cache.set(e,t)}).catch(()=>{}).finally(()=>{this.prefetchInFlight.delete(e)}))};seed(e,t){this.cache.set(e,t)}invalidate=e=>{this.cache.delete(e)}},Qr=e=>{try{let t=new URL(e).pathname.split(`/`).filter(Boolean);if(t.length>=4)return`${t[0]}/${t[1]}#${t[3]}`}catch{}return e},$r=(e,t)=>{for(let[n,r]of Object.entries(t.items)){let t=Qr(n);e.body.seed(t,r.body),e.comments.seed(t,r.comments),e.state.seed(t,r.state),r.files!==null&&e.files.seed(t,r.files),r.commits!==null&&e.commits.seed(t,r.commits),r.prStatus!==null&&e.prStatus.seed(t,r.prStatus),r.relatedPrs!==null&&e.relatedPrs.seed(t,r.relatedPrs)}},ei=(e=null)=>(0,_.useMemo)(()=>{let t=jr(),n={client:t,body:new Zr(t.fetchItemBody),comments:new Zr(t.fetchComments),files:new Zr(t.fetchPrFiles),commits:new Zr(t.fetchPrCommits),relatedPrs:new Zr(t.fetchRelatedPrs),state:new Zr(t.fetchIssueState),prStatus:new Zr(t.fetchPullRequestStatus)};return e!==null&&$r(n,e),n},[e]),ti=0,ni=500,ri=2e3,ii=e=>{let t=window;if(typeof t.requestIdleCallback==`function`&&typeof t.cancelIdleCallback==`function`){let n=t.requestIdleCallback(e,{timeout:ri});return{cancel:()=>t.cancelIdleCallback?.(n)}}let n=window.setTimeout(e,0);return{cancel:()=>window.clearTimeout(n)}},ai=(e,t)=>{let n=`${t.repo}#${t.number}`;e.body.prefetch(n,t.url),e.state.prefetch(n,t.url),e.comments.prefetch(n,t.url),t.isPr?(e.files.prefetch(n,t.url),e.commits.prefetch(n,t.url),e.prStatus.prefetch(n,t.url)):e.relatedPrs.prefetch(n,t.url)},oi=(e,t,n)=>{(0,_.useEffect)(()=>{if(t===null)return;let r=n.findIndex(e=>e.projectItemId===t.projectItemId);if(r===-1)return;let i=n.slice(r+1,r+1+ti);if(i.length===0)return;let a=null,o=window.setTimeout(()=>{a=ii(()=>{for(let t of i)ai(e,t)})},ni);return()=>{window.clearTimeout(o),a?.cancel()}},[e,t,n])},si=`/api/features`,ci=()=>{let[e,t]=(0,_.useState)({airplaneMode:!1});return(0,_.useEffect)(()=>{fetch(si).then(async e=>{if(!e.ok)return;let n=await e.json();typeof n==`object`&&n&&!Array.isArray(n)&&`airplaneMode`in n&&typeof n.airplaneMode==`boolean`&&t({airplaneMode:n.airplaneMode})}).catch(e=>{console.warn(`Failed to fetch /api/features`,e)})},[]),e},li=(e,t)=>{let n=b.findIndex(t=>t.name===e);if(n===-1)return null;for(let e=n+1;e<b.length;e+=1){let n=b[e].name;if((t[n]??0)>0)return n}return null},ui=e=>{for(let t of b)if((e[t.name]??0)>0)return t.name;return b[0].name},di=new Set(b.map(e=>e.name)),fi=e=>{let t=e.split(`/`).filter(e=>e.length>0);if(t.length<3||t[0]!==`projects`)return null;let n=t[2];return di.has(n)?n:null},pi=e=>{if(!e.startsWith(`#item/`))return null;let t=e.slice(6);return t.length===0?null:decodeURIComponent(t)},mi=(e,t)=>{let n=(0,_.useCallback)(()=>{let e=ui(t);return typeof window>`u`?{activeTab:e,selectedItemKey:null}:{activeTab:fi(window.location.pathname)??e,selectedItemKey:pi(window.location.hash)}},[t]),[r,i]=(0,_.useState)(n);(0,_.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{i(n())};return window.addEventListener(`popstate`,e),window.addEventListener(`hashchange`,e),()=>{window.removeEventListener(`popstate`,e),window.removeEventListener(`hashchange`,e)}},[n]),(0,_.useEffect)(()=>{if(typeof window>`u`||fi(window.location.pathname)!==null)return;let e=ui(t);i(t=>t.activeTab===e?t:{...t,activeTab:e})},[t]);let a=(0,_.useCallback)(t=>e===null?`#${t}`:`/projects/${e}/${t}`,[e]),o=(0,_.useCallback)(e=>{if(typeof window>`u`){i({activeTab:e,selectedItemKey:null});return}window.history.pushState({},``,a(e)),i({activeTab:e,selectedItemKey:null})},[a]),s=(0,_.useCallback)(e=>{typeof window<`u`&&(window.location.hash=`#item/${encodeURIComponent(e)}`),i(t=>({...t,selectedItemKey:e}))},[]),c=(0,_.useCallback)(()=>{if(typeof window<`u`&&window.location.hash!==``){let e=`${window.location.pathname}${window.location.search}`;window.history.pushState({},``,e)}i(e=>({...e,selectedItemKey:null}))},[]);return{activeTab:r.activeTab,selectedItemKey:r.selectedItemKey,tabHref:a,selectTab:o,openItem:s,closeItem:c}},hi=e=>`pv_overlay_${e}`,gi=e=>e.projectItemId===``?e.itemId:e.projectItemId,_i=(e,t)=>e!==void 0&&e.done===!0&&e.mode===t,vi=(e,t,n)=>e.filter(e=>!_i(t[gi(e)],n)).length,yi=(e,t,n)=>e.filter(e=>!_i(t[gi(e)],n)),bi=(e,t)=>{let n=Date.parse(t);if(Number.isNaN(n))return{};let r={};for(let[t,i]of Object.entries(e))i.ts>=n&&(r[t]=i);return r},xi=(e,t,n)=>{if(n===null)return null;let r=Date.parse(n);if(Number.isNaN(r))return null;let i=e[gi(t)];return i===void 0||i.ts<r?null:i.status??null},Si=(e,t,n,r,i)=>{let a={...e[t]??{},...n,ts:i,mode:r};return{...e,[t]:a}},Ci=`/api/review`,wi=`/api/triage`,Ti=`/api/intmux`,Ei=(e,t,n,r,i)=>{if(r===`approve_and_merge`)return{pjcode:e,action:`approve_and_merge`,prUrl:n,projectItemId:t.projectItemId};if(r===`request_changes`){let r=i[0];return{pjcode:e,action:`request_changes`,prUrl:n,projectItemId:t.projectItemId,commentBody:tr(i),...r===void 0?{}:{changedFilePath:r.path,line:r.line,side:r.side}}}return r===`totally_wrong`?{pjcode:e,action:`close`,prUrl:n,issueUrl:t.url,projectItemId:t.projectItemId,commentBody:Qn}:{pjcode:e,action:`unnecessary`,prUrl:n,projectItemId:t.projectItemId,issueUrl:t.url,commentBody:$n,issueCommentBody:er(n)}},Di=()=>Error(`No project specified in the URL path.`),Oi=(e,t,n,r)=>{let{patchOverlay:i}=n,a=(0,_.useCallback)(e=>{if(r===void 0)return;let t=`${e.repo}#${e.number}`;r.body.invalidate(t),r.comments.invalidate(t)},[r]),o=(0,_.useCallback)(e=>{i(gi(e),{done:!0},t)},[i,t]);return{reviewPullRequest:(0,_.useCallback)(async(t,n,r,i=[])=>{if(e===null)throw Di();o(t),await Nr(Ci,Ei(e,t,n,r,i)),a(t)},[e,o,a]),setNextActionDate:(0,_.useCallback)(async(t,n)=>{if(e===null)throw Di();let r={pjcode:e,action:n,issueUrl:t.url,projectItemId:t.projectItemId};o(t),await Nr(wi,r),a(t)},[e,o,a]),setStory:(0,_.useCallback)(async(n,r)=>{if(e===null)throw Di();let o={pjcode:e,action:`set_story`,issueUrl:n.url,projectItemId:n.projectItemId,storyOptionId:r.id};i(gi(n),{done:!0,story:{name:r.name,color:r.color}},t),await Nr(wi,o),a(n)},[e,a,i,t]),setStatus:(0,_.useCallback)(async(n,r)=>{if(e===null)throw Di();let o={pjcode:e,action:`set_status`,issueUrl:n.url,projectItemId:n.projectItemId,statusName:r.name};i(gi(n),{done:!0,status:{name:r.name,color:r.color}},t),await Nr(wi,o),a(n)},[e,a,i,t]),setInTmuxByHuman:(0,_.useCallback)(async(n,r)=>{if(e===null)throw Di();let o={pjcode:e,action:`set_intmux`,issueUrl:n.url,projectItemId:n.projectItemId};i(gi(n),{done:!0,status:{name:r.name,color:r.color}},t),await Nr(Ti,o),a(n)},[e,a,i,t]),closeIssue:(0,_.useCallback)(async(t,n)=>{if(e===null)throw Di();let r={pjcode:e,action:n,issueUrl:t.url,projectItemId:t.projectItemId};o(t),await Nr(wi,r),a(t)},[e,o,a]),okAndMoveToAwaitingWorkspace:(0,_.useCallback)(async(n,r)=>{if(e===null)throw Di();i(gi(n),{done:!0,status:{name:r.name,color:r.color}},t),await Ir({pjcode:e,url:n.url,body:`ok`}),await Nr(wi,{pjcode:e,action:`set_status`,issueUrl:n.url,projectItemId:n.projectItemId,statusName:r.name}),a(n)},[e,a,i,t]),addComment:(0,_.useCallback)(async(t,n)=>{if(e===null)throw Di();let r=await Ir({pjcode:e,url:t.url,body:n});return a(t),r},[e,a]),uploadAttachment:(0,_.useCallback)(async(t,n)=>{if(e===null)throw Error(`no project in the URL path`);let r=Rr(new Uint8Array(await n.arrayBuffer()));return zr({pjcode:e,url:t.url,fileName:n.name,contentBase64:r})},[e]),addInlineReviewComment:(0,_.useCallback)(async(t,n,r,i,a)=>{if(e===null)throw Di();await Ur({pjcode:e,url:t,path:n,line:r,side:i,body:a})},[e])}},ki=e=>typeof e==`object`&&!!e&&typeof e.ts==`number`,Ai=e=>{if(typeof localStorage>`u`)return{};let t=localStorage.getItem(hi(e));if(t===null)return{};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{};let r={};for(let[e,t]of Object.entries(n))ki(t)&&(r[e]=t);return r},ji=(e,t)=>{typeof localStorage<`u`&&localStorage.setItem(hi(e),JSON.stringify(t))},Mi=e=>{let[t,n]=(0,_.useState)(()=>Ai(e));return{overlay:t,patchOverlay:(0,_.useCallback)((t,r,i)=>{n(n=>{let a=Si(n,t,r,i,Date.now());return ji(e,a),a})},[e])}},Ni=e=>{let t=e.split(`/`).filter(e=>e.length>0);if(t.length<2||t[0]!==`projects`)return null;let n=t[1];return n.length===0?null:n},Pi=()=>Ni(typeof window>`u`?``:window.location.pathname),z=()=>{let[e,t]=(0,_.useState)([]),[n,r]=(0,_.useState)(!0),[i,a]=(0,_.useState)(null);return(0,_.useEffect)(()=>{let e=!1;return r(!0),a(null),Xr().then(n=>{e||(t(n),r(!1))}).catch(t=>{e||(a(t instanceof Error?t:Error(String(t))),r(!1))}),()=>{e=!0}},[]),{pjcodes:e,isLoading:n,error:i}},Fi=e=>{let t=(0,_.useRef)(e),n=(0,_.useRef)(Date.now());return t.current!==e&&(t.current=e,n.current=Date.now()),{isTimerExpired:(0,_.useCallback)(e=>e<=0?!1:Date.now()-n.current>=e*60*1e3,[])}},Ii=(e,t)=>{let n=Math.abs(e);return n<60||n<=Math.abs(t)*1.5?null:e<0?`next`:`previous`},Li=(e,t)=>{let n=Math.abs(e),r=Math.abs(t);return r>n*1.5&&r>20},Ri=e=>{let t=e instanceof Element?e:null;for(;t!==null&&t!==document.body;){let e=window.getComputedStyle(t).overflowX;if((e===`auto`||e===`scroll`)&&t.scrollWidth>t.clientWidth)return!0;t=t.parentElement}return!1},zi=e=>{let t=(0,_.useRef)(e);t.current=e;let n=(0,_.useRef)(null),r=(0,_.useCallback)(e=>{let n=0,r=0,i=!1,a=e=>{if(e.touches.length!==1){i=!1;return}if(Ri(e.target)){i=!1;return}let t=e.touches[0];n=t.clientX,r=t.clientY,i=!0},o=e=>{if(!i)return;let t=e.touches[0];Li(t.clientX-n,t.clientY-r)&&(i=!1)},s=e=>{if(!i||(i=!1,e.changedTouches.length!==1))return;let a=e.changedTouches[0],o=Ii(a.clientX-n,a.clientY-r);o!==null&&t.current(o)};return e.addEventListener(`touchstart`,a,{passive:!0}),e.addEventListener(`touchmove`,o,{passive:!0}),e.addEventListener(`touchend`,s,{passive:!0}),()=>{e.removeEventListener(`touchstart`,a),e.removeEventListener(`touchmove`,o),e.removeEventListener(`touchend`,s)}},[]),i=(0,_.useCallback)(e=>{n.current!==null&&(n.current(),n.current=null),e!==null&&(n.current=r(e))},[r]);return(0,_.useEffect)(()=>()=>{n.current!==null&&(n.current(),n.current=null)},[]),i},Bi=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Vi=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],Hi=e=>!Bi(e)||!Array.isArray(e.items)?[]:e.items.filter(Bi).map(e=>({...e,relatedOpenPullRequestUrls:Vi(e.relatedOpenPullRequestUrls)})),Ui=e=>Array.isArray(e)?e.filter(Bi):[],Wi=e=>Array.isArray(e)?e.filter(Bi):[],Gi=e=>({items:Hi(e),generatedAt:Bi(e)&&typeof e.generatedAt==`string`?e.generatedAt:``,statusOptions:Bi(e)?Ui(e.statusOptions):[],storyOptions:Bi(e)?Ui(e.storyOptions):[],storyColors:Bi(e)&&Bi(e.storyColors)?e.storyColors:{},stories:Bi(e)?Wi(e.stories):[],defaultNameWithOwner:Bi(e)&&typeof e.defaultNameWithOwner==`string`?e.defaultNameWithOwner:null,storyOrder:Bi(e)?Vi(e.storyOrder):[]}),Ki=()=>{let e={};for(let t of b)e[t.name]=null;return e},qi=(e,t)=>`/projects/${e}/${t}/list.json`,Ji=6e4,Yi=`console-list-v1`,Xi=(e,t)=>{try{if(!(`caches`in globalThis))return;globalThis.caches.open(Yi).then(n=>n.put(e,new Response(JSON.stringify(t),{headers:{"Content-Type":`application/json`}}))).catch(e=>{console.warn(`Failed to persist tab snapshot to cache:`,e)})}catch(e){console.warn(`Failed to access cache storage:`,e)}},Zi=async e=>{if(!(`caches`in globalThis))return null;try{let t=await(await globalThis.caches.open(Yi)).match(e);return t===void 0?null:{...Gi(await t.json()),fromCache:!0}}catch{return null}},Qi=async(e,t)=>{let n=qi(e,t);try{let e=await fetch(n);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();return Xi(n,t),{snapshot:{...Gi(t),fromCache:!1},error:null}}catch(e){let t=await Zi(n);return t===null?{snapshot:null,error:e instanceof Error?e:Error(String(e))}:{snapshot:t,error:null}}},$i=async e=>{let t=await Promise.all(b.map(async t=>{let{snapshot:n,error:r}=await Qi(e,t.name);return{tabName:t.name,snapshot:n,error:r}})),n=Ki(),r=null;for(let{tabName:e,snapshot:i,error:a}of t)n[e]=i,a!==null&&r===null&&(r=a);return{snapshots:n,firstError:Object.values(n).every(e=>e===null)?r:null}},ea=(e,t=null)=>{let[n,r]=(0,_.useState)(Ki),[i,a]=(0,_.useState)(!0),[o,s]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(t!==null&&e!==null){let n=t.tabs[e];if(n!==void 0){let e=Ki();for(let t of b){let r=n[t.name];r!==void 0&&(e[t.name]=r)}r(e),a(!1),s(null);return}}let n=!1;if(a(!0),s(null),e===null)return r(Ki()),a(!1),s(`No project specified in the URL path.`),()=>{n=!0};let i=()=>{$i(e).then(({snapshots:e,firstError:t})=>{n||(r(e),s(t===null?null:t.message),a(!1))}).catch(e=>{n||(s(e instanceof Error?e.message:String(e)),a(!1))})};i();let o=setInterval(i,Ji);return()=>{n=!0,clearInterval(o)}},[e,t]),{snapshots:n,isLoading:i,error:o}},ta=`tdpm-timer-settings`,na=()=>({timerMode:!1,projectMinutes:{}}),ra=()=>{if(typeof localStorage>`u`)return na();let e=localStorage.getItem(ta);if(e===null)return na();try{let t=JSON.parse(e);if(typeof t!=`object`||!t||Array.isArray(t))return na();let n=t,r=typeof n.timerMode==`boolean`&&n.timerMode,i=n.projectMinutes;return{timerMode:r,projectMinutes:typeof i==`object`&&i&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).filter(([,e])=>typeof e==`number`).map(([e,t])=>[e,t])):{}}}catch{return na()}},ia=e=>{typeof localStorage<`u`&&localStorage.setItem(ta,JSON.stringify(e))},aa=(e,t,n)=>{if(e.length===0)return null;let r=t===null?-1:e.indexOf(t),i=r===-1?0:(r+1)%e.length,a=r===-1?e.length:e.length-1;for(let t=0;t<a;t++){let r=e[(i+t)%e.length];if((n[r]??0)>0)return r}return null},oa=()=>{let[e,t]=(0,_.useState)(ra),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(e),o=(0,_.useCallback)(()=>{t(e=>(a(e),e)),r(!0)},[]),s=(0,_.useCallback)(()=>{r(!1)},[]),c=(0,_.useCallback)(()=>{a(e=>(ia(e),t(e),e)),r(!1)},[]),l=(0,_.useCallback)(e=>{a(t=>({...t,timerMode:e}))},[]),u=(0,_.useCallback)((e,t)=>{a(n=>({...n,projectMinutes:{...n.projectMinutes,[e]:t}}))},[]);return{timerMode:e.timerMode,projectMinutes:e.projectMinutes,isOpen:n,draftTimerMode:i.timerMode,draftProjectMinutes:i.projectMinutes,openSettings:o,closeSettings:s,saveSettings:c,toggleDraftTimerMode:l,changeDraftMinutes:u}},sa=e=>{window.location.replace(e)},ca=e=>{window.location.assign(e)},la=(e,t)=>{let n=e.indexOf(t);if(n<0)return e.length>0?e[0]:null;let r=n+1;return r<e.length?e[r]:null},ua=(e,t)=>{let n=e.indexOf(t);return n<0||n>=e.length-1?null:e[n+1]},da=(e,t)=>{let n=e.indexOf(t);return n<=0?null:e[n-1]},fa=(e,t)=>e.length===0?`${t}\n`:e.endsWith(`
14
14
  `)?`${e}${t}\n`:`${e}\n${t}\n`,pa=(e,t)=>{let n=`![uploading ${t}]()`;return`${e.length===0?``:e.replace(/\n*$/,`
15
15
  `)}\n\n\n${n}\n`},ma=(e,t,n)=>{let r=`![uploading ${t}]()`,i=e.indexOf(r);return i===-1?fa(e,n):e.slice(0,i)+n+e.slice(i+r.length)},ha=(e,t)=>{let n=`![uploading ${t}]()`,r=e.indexOf(n);if(r===-1)return e;let i=r,a=0;for(;a<3&&i>0&&e[i-1]===`
16
16
  `;)i--,a++;let o=+(e[r+n.length]===`
@@ -85,4 +85,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
85
85
  `)}),o+=1,r=[])};for(let e of t){if(a){r.push(e),Jc(e)&&(a=!1);continue}if(i===null&&Kc(e)){s(),i=[];continue}if(i!==null){if(Jc(e)){n.push({kind:`mermaid`,key:`mermaid:${o}`,code:i.join(`
86
86
  `)}),o+=1,i=null;continue}i.push(e);continue}if(qc(e)){r.push(e),a=!0;continue}r.push(e)}return i!==null&&r.push("```mermaid",...i),s(),n},Xc=({code:e,label:t=`Copy code`})=>(0,S.jsx)(_n,{value:e,idleText:t,idleAriaLabel:t,copiedAriaLabel:`Code copied to clipboard`,className:`console-copy-code-button`}),Zc=`https://cdn.jsdelivr.net/npm/mermaid@10.9.6/dist/mermaid.min.js`,Qc=null,$c=0,el=e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`dark`,themeVariables:{background:`#0d1117`,primaryColor:`#161b22`,primaryTextColor:`#e6edf3`,primaryBorderColor:`#30363d`,lineColor:`#8b949e`,fontSize:`14px`}}),e),tl=()=>Qc===null?window.mermaid===void 0?(Qc=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=Zc,n.async=!0,n.onload=()=>{if(window.mermaid===void 0){t(Error(`mermaid failed to load`));return}e(el(window.mermaid))},n.onerror=()=>t(Error(`mermaid script failed to load`)),document.head.appendChild(n)}),Qc):(Qc=Promise.resolve(el(window.mermaid)),Qc):Qc,nl=async e=>{let t=await tl();$c+=1;let n=`console-mermaid-${$c}`,{svg:r}=await t.render(n,e);return Jo.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`foreignObject`]})},rl=.5,il=e=>Number.isNaN(e)||e<1?1:e>6?6:e,al=e=>il(il(e)+rl),ol=e=>il(il(e)-rl),sl=e=>il(e)<=1,cl=e=>il(e)>=6,ll=e=>`${Math.round(il(e)*100)}%`,ul=e=>`${il(e)*100}%`,dl=({svg:e,onClose:t})=>{let[n,r]=(0,_.useState)(1),i=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=i.current;if(t===null)return;t.innerHTML=e;let n=t.querySelector(`svg`);n!==null&&(n.style.removeProperty(`max-width`),n.style.setProperty(`width`,`100%`),n.style.setProperty(`height`,`auto`))},[e]),(0,_.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[t]),(0,S.jsxs)(`div`,{className:`console-mermaid-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`Enlarged diagram`,children:[(0,S.jsxs)(`div`,{className:`console-mermaid-modal-bar`,children:[(0,S.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-button`,"aria-label":`Zoom out`,disabled:sl(n),onClick:()=>r(ol(n)),children:`−`}),(0,S.jsx)(`span`,{className:`console-mermaid-modal-scale`,children:ll(n)}),(0,S.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-button`,"aria-label":`Zoom in`,disabled:cl(n),onClick:()=>r(al(n)),children:`+`}),(0,S.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-close`,"aria-label":`Close enlarged diagram`,onClick:t,children:`✕`})]}),(0,S.jsx)(`div`,{className:`console-mermaid-modal-viewport`,children:(0,S.jsx)(`div`,{ref:i,className:`console-mermaid-modal-canvas`,style:{width:ul(n)}})})]})},fl=({code:e})=>{let[t,n]=(0,_.useState)({status:`loading`}),[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=!1;return n({status:`loading`}),nl(e).then(e=>{t||n({status:`ready`,svg:e})}).catch(e=>{t||n({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},[e]),(0,_.useEffect)(()=>{let e=a.current;e!==null&&(e.innerHTML=t.status===`ready`?t.svg:``)},[t]),t.status===`loading`?(0,S.jsx)(`div`,{className:`console-mermaid-loading`,children:`Rendering diagram...`}):t.status===`error`?(0,S.jsxs)(`div`,{className:`console-mermaid`,children:[(0,S.jsxs)(`div`,{className:`console-mermaid-error`,children:[`Mermaid render error: `,t.message]}),(0,S.jsx)(`pre`,{className:`console-mermaid-source`,children:(0,S.jsx)(`code`,{children:e})})]}):(0,S.jsxs)(`div`,{className:`console-mermaid`,children:[(0,S.jsx)(`div`,{ref:a,className:`console-mermaid-rendered`}),(0,S.jsx)(`button`,{type:`button`,className:`console-mermaid-enlarge`,onClick:()=>i(!0),children:`Enlarge diagram`}),r&&(0,S.jsx)(dl,{svg:t.svg,onClose:()=>i(!1)})]})},pl=e=>{let t=e.querySelectorAll(`a[href]`),n=[];return t.forEach((e,t)=>{let r=e.getAttribute(`href`)??``;if(va(r)===null)return;let i=e.textContent??r,a=document.createElement(`span`);a.className=`console-markdown-reference-host`,e.replaceWith(a),n.push({key:`${t}:${r}`,host:a,href:r,fallbackText:i})}),n},ml=e=>{let t=e.querySelectorAll(`pre > code`),n=[];return t.forEach((e,t)=>{let r=e.parentElement;if(r===null)return;let i=e.textContent??``,a=document.createElement(`div`);a.className=`console-markdown-code-block`;let o=document.createElement(`div`);o.className=`console-markdown-code-copy-host`,r.replaceWith(a),a.append(o,r),n.push({key:`code:${t}`,host:o,code:i})}),n},hl=({source:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,_.useMemo)(()=>{let n=Gc(e,r);return t===void 0?n:wa(n,t)},[e,t,r]),a=(0,_.useRef)(null),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]);return(0,_.useEffect)(()=>{let e=a.current;e!==null&&(e.innerHTML=i,l(ml(e)),s(n===void 0?[]:pl(e)))},[i,n]),(0,S.jsxs)(`div`,{ref:a,className:`console-markdown`,children:[c.map(e=>(0,v.createPortal)((0,S.jsx)(Xc,{code:e.code}),e.host,e.key)),n!==void 0&&o.map(e=>(0,v.createPortal)(n(e.href,e.fallbackText),e.host,e.key))]})},gl=({body:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,_.useMemo)(()=>Yc(e),[e]);return e.trim()===``?(0,S.jsx)(`p`,{className:`console-markdown-empty`,children:`No description provided.`}):(0,S.jsx)(`div`,{className:`console-markdown-view`,children:i.map(e=>e.kind===`mermaid`?(0,S.jsx)(fl,{code:e.code},e.key):(0,S.jsx)(hl,{source:e.source,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r},e.key))})},_l=({title:e,count:t=null,defaultCollapsed:n=!1,headerAction:r,children:i})=>{let[a,o]=(0,_.useState)(n),s=t===null?e:`${e} (${t})`;return(0,S.jsxs)(`section`,{className:`console-panel`,children:[(0,S.jsxs)(`header`,{className:`console-panel-header`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`console-panel-toggle`,"aria-expanded":!a,onClick:()=>o(e=>!e),children:[(0,S.jsx)(`span`,{className:`console-panel-caret`,children:a?`▸`:`▾`}),(0,S.jsx)(`span`,{className:`console-panel-title`,children:s})]}),r!==void 0&&(0,S.jsx)(`div`,{className:`console-panel-action`,children:r})]}),!a&&(0,S.jsx)(`div`,{className:`console-panel-body`,children:i})]})},vl=e=>{switch(e){case`added`:return{label:`A`,color:`#3fb950`};case`modified`:return{label:`M`,color:`#d29922`};case`removed`:return{label:`D`,color:`#f85149`};case`renamed`:return{label:`R`,color:`#a371f7`};case`changed`:return{label:`M`,color:`#d29922`};default:return{label:`?`,color:`#8b949e`}}},yl=()=>({directories:new Map,files:[]}),bl=e=>e.split(`/`).filter(e=>e!==``),xl=(e,t)=>e.name.localeCompare(t.name),Sl=(e,t)=>{let n=[];e.directories.forEach((e,r)=>{let i=t===``?r:`${t}/${r}`;n.push({kind:`directory`,name:r,path:i,children:Sl(e,i)})}),n.sort(xl);let r=e.files.map(e=>({kind:`file`,name:bl(e.path).at(-1)??e.path,path:e.path,file:e}));return r.sort(xl),[...n,...r]},Cl=e=>{let t=yl();for(let n of e){let e=bl(n.path);if(e.length===0){t.files.push(n);continue}let r=e.slice(0,-1),i=t;for(let e of r){let t=i.directories.get(e);if(t===void 0){let t=yl();i.directories.set(e,t),i=t;continue}i=t}i.files.push(n)}return Sl(t,``)},wl=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,Tl=e=>{let t=[],n=0,r=0;for(let i of e.split(`
87
87
  `)){if(i.startsWith(`@@`)){let e=i.match(wl);e!==null&&(n=Number(e[1]),r=Number(e[2])),t.push({kind:`hunk`,oldLineNumber:null,newLineNumber:null,content:i});continue}if(i.startsWith(`+`)){t.push({kind:`add`,oldLineNumber:null,newLineNumber:r,content:i}),r+=1;continue}if(i.startsWith(`-`)){t.push({kind:`del`,oldLineNumber:n,newLineNumber:null,content:i}),n+=1;continue}t.push({kind:`ctx`,oldLineNumber:n,newLineNumber:r,content:i}),n+=1,r+=1}return t},El=[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.svg`,`.avif`,`.bmp`,`.ico`],Dl=e=>{let t=e.toLowerCase();return El.some(e=>t.endsWith(e))},Ol=e=>e.kind===`add`||e.kind===`ctx`?e.newLineNumber===null?null:{line:e.newLineNumber,side:`RIGHT`}:e.kind===`del`?e.oldLineNumber===null?null:{line:e.oldLineNumber,side:`LEFT`}:null,kl=e=>`${e.kind}:${e.oldLineNumber??`x`}:${e.newLineNumber??`x`}:${e.content}`,Al=({target:e,onSubmit:t,onClose:n})=>{let[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)({kind:`idle`}),s=async()=>{let n=r.trim();if(n.length!==0&&a.kind!==`posting`){o({kind:`posting`});try{await t(e.path,e.line,e.side,n),i(``),o({kind:`posted`})}catch(e){o({kind:`error`,message:e instanceof Error?e.message:`failed to post`})}}};return(0,S.jsxs)(`div`,{className:`console-diff-composer`,children:[(0,S.jsxs)(`div`,{className:`console-diff-composer-anchor`,children:[`commenting on line `,e.line,` (`,e.side,`)`]}),a.kind===`posted`?(0,S.jsx)(`p`,{className:`console-diff-composer-posted`,children:`Comment saved.`}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`textarea`,{className:`console-diff-composer-input`,rows:3,placeholder:`Leave a review comment on this line…`,value:r,onChange:e=>i(e.target.value)}),(0,S.jsxs)(`div`,{className:`console-diff-composer-controls`,children:[(0,S.jsx)(`button`,{type:`button`,className:`console-diff-composer-submit`,disabled:a.kind===`posting`,onClick:()=>{s()},children:`Comment`}),(0,S.jsx)(`button`,{type:`button`,className:`console-diff-composer-cancel`,onClick:n,children:`Cancel`}),a.kind===`posting`&&(0,S.jsx)(`span`,{className:`console-diff-composer-status`,children:`Posting…`}),a.kind===`error`&&(0,S.jsxs)(`span`,{role:`alert`,className:`console-diff-composer-status console-diff-composer-error`,children:[`Failed: `,a.message]})]})]})]})},jl=({patch:e,path:t,rawUrl:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,_.useState)(null);if(e===null||e===``){if(t!==void 0&&n!=null){if(n.startsWith(`data:image/`))return(0,S.jsx)(`div`,{className:`console-file-diff-image`,children:(0,S.jsx)(`img`,{className:`console-file-diff-image-content`,src:n,alt:t})});if(Dl(t)&&r!==void 0)return(0,S.jsx)(`div`,{className:`console-file-diff-image`,children:(0,S.jsx)(`img`,{className:`console-file-diff-image-content`,src:r(n),alt:t})})}return(0,S.jsx)(`p`,{className:`console-file-diff-empty`,children:`(no diff / binary or too large)`})}let s=Tl(e),c=i!==void 0&&t!==void 0&&t.length>0,l=c?4:3;return(0,S.jsx)(`table`,{className:`console-file-diff`,children:(0,S.jsx)(`tbody`,{children:s.map(e=>{let n=kl(e),r=c?Ol(e):null,s=a!==null&&r!==null&&a.line===r.line&&a.side===r.side;return(0,S.jsxs)(_.Fragment,{children:[(0,S.jsxs)(`tr`,{className:`console-diff-row console-diff-${e.kind}`,children:[c&&(0,S.jsx)(`td`,{className:`console-diff-comment-cell`,children:r!==null&&t!==void 0&&(0,S.jsx)(`button`,{type:`button`,className:`console-diff-comment-button`,"aria-label":`Comment on line ${r.line} (${r.side})`,"aria-expanded":s,onClick:()=>o(s?null:{path:t,line:r.line,side:r.side}),children:`+`})}),(0,S.jsx)(`td`,{className:`console-diff-ln`,children:e.oldLineNumber??``}),(0,S.jsx)(`td`,{className:`console-diff-ln`,children:e.newLineNumber??``}),(0,S.jsx)(`td`,{className:`console-diff-code`,children:e.content})]}),s&&i!==void 0&&a!==null&&(0,S.jsx)(`tr`,{className:`console-diff-composer-row`,children:(0,S.jsx)(`td`,{colSpan:l,children:(0,S.jsx)(Al,{target:a,onSubmit:i,onClose:()=>o(null)})})})]},n)})})})},Ml=e=>({paddingLeft:`${e*16}px`}),Nl=({file:e,depth:t,name:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,_.useState)(!1),s=vl(e.status);return(0,S.jsxs)(`li`,{className:`console-file`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`console-file-row`,style:Ml(t),"aria-expanded":a,onClick:()=>o(e=>!e),children:[(0,S.jsx)(`span`,{className:`console-file-caret`,children:a?`▾`:`▸`}),(0,S.jsx)(`span`,{className:`console-file-badge`,style:{color:s.color,borderColor:s.color},children:s.label}),(0,S.jsx)(`span`,{className:`console-file-path`,children:n}),(0,S.jsxs)(`span`,{className:`console-file-stat console-file-add`,children:[`+`,e.additions]}),(0,S.jsxs)(`span`,{className:`console-file-stat console-file-del`,children:[`-`,e.deletions]})]}),a&&(0,S.jsx)(jl,{patch:e.patch,path:e.path,rawUrl:e.rawUrl,buildImageProxyUrl:r,onAddInlineComment:i})]})},Pl=({node:e,depth:t,buildImageProxyUrl:n,onAddInlineComment:r})=>e.kind===`file`?(0,S.jsx)(Nl,{file:e.file,depth:t,name:e.name,buildImageProxyUrl:n,onAddInlineComment:r}):(0,S.jsxs)(`li`,{className:`console-file-tree-dir`,children:[(0,S.jsxs)(`div`,{className:`console-file-tree-dir-name`,style:Ml(t),children:[(0,S.jsx)(`span`,{className:`console-file-tree-dir-icon`,"aria-hidden":`true`,children:`📁`}),e.name]}),(0,S.jsx)(`ul`,{className:`console-file-tree-children`,children:e.children.map(e=>(0,S.jsx)(Pl,{node:e,depth:t+1,buildImageProxyUrl:n,onAddInlineComment:r},e.path))})]}),Fl=({files:e,isLoading:t,error:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{if(n!==null)return(0,S.jsx)(`p`,{className:`console-files-notloaded`,children:`Not loaded.`});if(t)return(0,S.jsx)(`p`,{className:`console-files-loading`,children:`Loading changed files...`});if(e.length===0)return(0,S.jsx)(`p`,{className:`console-files-empty`,children:`No changed files.`});let a=Cl(e);return(0,S.jsx)(`ul`,{className:`console-files console-file-tree`,children:a.map(e=>(0,S.jsx)(Pl,{node:e,depth:0,buildImageProxyUrl:r,onAddInlineComment:i},e.path))})},Il=({comments:e,isLoading:t,error:n,now:r,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})=>{let[s,c]=(0,_.useState)(!1);if(n!==null)return(0,S.jsx)(`p`,{className:`console-comment-notloaded`,children:`Not loaded.`});if(t)return(0,S.jsx)(`p`,{className:`console-comment-loading`,children:`Loading comments...`});if(e.length===0)return(0,S.jsx)(`p`,{className:`console-comment-empty`,children:`No comments.`});let l=s?e:e.slice(-1);return(0,S.jsxs)(`div`,{className:`console-comment-list`,children:[!s&&e.length>1&&(0,S.jsxs)(`button`,{type:`button`,className:`console-comment-show-all`,onClick:()=>c(!0),children:[`Show all `,e.length]}),l.map(e=>(0,S.jsxs)(`article`,{className:`console-comment`,children:[(0,S.jsxs)(`header`,{className:`console-comment-header`,children:[(0,S.jsx)(`span`,{className:`console-comment-author`,children:e.author}),(0,S.jsx)(`span`,{className:`console-comment-time`,children:O(e.createdAt,r)})]}),(0,S.jsx)(gl,{body:e.body,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})]},`${e.author}:${e.createdAt}:${e.body}`))]})},Ll=e=>e.slice(0,7),Rl=e=>e.split(`
88
- `)[0],K=({commits:e,isLoading:t,error:n,now:r})=>n===null?t?(0,S.jsx)(`p`,{className:`console-commits-loading`,children:`Loading commits...`}):e.length===0?(0,S.jsx)(`p`,{className:`console-commits-empty`,children:`No commits.`}):(0,S.jsx)(`ul`,{className:`console-commits`,children:e.map(e=>(0,S.jsxs)(`li`,{className:`console-commit`,children:[(0,S.jsx)(`span`,{className:`console-commit-message`,children:Rl(e.message)}),(0,S.jsx)(`span`,{className:`console-commit-sha`,children:Ll(e.sha)}),(0,S.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,S.jsx)(`span`,{className:`console-commit-time`,children:O(e.authoredAt,r)})]},e.sha))}):(0,S.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),q=({url:e,label:t=`Copy URL`})=>(0,S.jsx)(_n,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),J=e=>{let t=new Map;for(let n of e){let e=t.get(n.message);if(e===void 0){t.set(n.message,[n.section]);continue}e.push(n.section)}return Array.from(t,([e,t])=>({message:e,sections:t}))},Y=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,X=({failures:e})=>e.length===0?null:(0,S.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:J(e).map(e=>(0,S.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,Y(e.sections),`:`,` `,e.message]},e.message))}),zl={MERGEABLE:{color:`GREEN`,label:`No conflict`,title:`This pull request has no merge conflicts`,modifier:`console-detail-mergeable-chip-ok`},CONFLICTING:{color:`RED`,label:`Conflict`,title:`This pull request has merge conflicts`,modifier:`console-detail-mergeable-chip-conflict`},UNKNOWN:{color:`GRAY`,label:`Checking merge status`,title:`GitHub has not finished computing the merge status yet`,modifier:`console-detail-mergeable-chip-unknown`}},Bl=({mergeableStatus:e})=>{let t=zl[e],n=N(t.color);return(0,S.jsx)(`span`,{className:`console-detail-status-chip console-detail-mergeable-chip ${t.modifier}`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},title:t.title,children:t.label})},Vl=e=>{let t=N(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},Hl=({isPassedAllCiJob:e,isCiStateSuccess:t,isBranchOutOfDate:n,missingRequiredCheckNames:r})=>{let i=e&&t,a=i?`GREEN`:`RED`,o=i?`CI passing`:`CI failing`,s=!i&&r.length>0?`missing: ${r.join(`, `)}`:null;return(0,S.jsxs)(`span`,{className:`console-detail-pr-status`,children:[(0,S.jsxs)(`span`,{className:`console-detail-status-chip console-detail-ci-chip`,style:Vl(a),title:s??o,children:[o,s!==null&&(0,S.jsxs)(`span`,{className:`console-detail-ci-missing`,children:[` `,`(`,s,`)`]})]}),n&&(0,S.jsx)(`span`,{className:`console-detail-status-chip console-detail-outofdate-chip`,style:Vl(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},Ul=({pullRequest:e,body:t,bodyIsLoading:n,files:r,filesAreLoading:i,filesError:a,commits:o,commitsAreLoading:s,commitsError:c,now:l,buildImageProxyUrl:u,renderReferenceLink:d,onAddInlineComment:f})=>{let p=e.summary,m=va(e.url),h=m===null?void 0:{owner:m.owner,repo:m.repo},g=i||a!==null?null:r.length,_=s||c!==null?null:o.length;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`console-pr-header`,children:[(0,S.jsx)(`a`,{href:e.url,className:`console-pr-section-title`,target:`_blank`,rel:`noopener noreferrer`,children:p?.title??e.url}),e.isDraft&&(0,S.jsx)(`span`,{className:`console-pr-section-state`,children:`draft`}),(0,S.jsx)(Bl,{mergeableStatus:e.mergeableStatus}),(0,S.jsx)(Hl,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,S.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),(0,S.jsx)(q,{url:e.url,label:`Copy PR URL`}),(0,S.jsxs)(`div`,{className:`console-pr-statbar`,children:[m!==null&&(0,S.jsxs)(`span`,{className:`console-pr-repo`,children:[m.owner,`/`,m.repo]}),e.branchName!==null&&(0,S.jsx)(`span`,{className:`console-pr-branch`,children:e.branchName}),p!==null&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`span`,{className:`console-pr-add`,children:[`+`,p.additions]}),(0,S.jsxs)(`span`,{className:`console-pr-del`,children:[`-`,p.deletions]}),(0,S.jsxs)(`span`,{className:`console-pr-files-count`,children:[p.changedFiles,` files`]})]})]})]}),(0,S.jsx)(_l,{title:`Description`,children:n?(0,S.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,S.jsx)(gl,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,S.jsx)(_l,{title:`Changed files`,count:g,children:(0,S.jsx)(Fl,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,S.jsx)(_l,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,S.jsx)(K,{commits:o,isLoading:s,error:c,now:l})})]})},Wl=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,statusOptions:i,state:a,body:o,bodyIsLoading:s,bodyError:c,comments:l,commentsAreLoading:u,commentsError:d,files:f,filesAreLoading:p,filesError:m,commits:h,commitsAreLoading:g,commitsError:_,stateError:v,pullRequestStatus:y,pullRequestStatusError:b,relatedPullRequests:x,relatedPullRequestsError:C,now:w,commentComposer:T,operationBar:ee,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:ne})=>{let D=a?.state??`open`,re=a?.merged??!1,ie=!e.isPr&&D===`closed`?`Closed`:null,ae=ya(e.nameWithOwner)??void 0,oe=N(n),se=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,ce=se===null?null:N(se.color),A=p||m!==null?null:f.length,j=u||d!==null?null:l.length,M=g||_!==null?null:h.length,ue=e=>{let t=va(e);return t===null?e:`PR #${t.number}`},de=[{section:`item state`,message:v},{section:`pull request status`,message:e.isPr?b:null},{section:`description`,message:c},{section:`comments`,message:d},{section:`changed files`,message:e.isPr?m:null},{section:`commits`,message:e.isPr?_:null},{section:`related pull requests`,message:e.isPr?null:C},...x.flatMap(e=>[{section:`changed files of ${ue(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${ue(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),fe=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:[];return(0,S.jsxs)(`article`,{className:`console-detail`,children:[(0,S.jsxs)(`h2`,{className:`console-detail-title`,children:[(0,S.jsx)(le,{isPr:e.isPr,state:D,merged:re,isDraft:!1,stateReason:``}),(0,S.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}),(0,S.jsx)(`span`,{className:`console-detail-number`,children:e.isPr?`PR #${e.number}`:`#${e.number}`})]}),(0,S.jsxs)(`div`,{className:`console-detail-topline`,children:[se!==null&&ce!==null&&(0,S.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:ce.fg,borderColor:ce.border,backgroundColor:ce.bg},children:se.name}),e.agent!==null&&e.agent!==``&&(0,S.jsx)(`span`,{className:`console-detail-agent-chip`,children:e.agent}),t!==null&&(0,S.jsxs)(`span`,{className:`console-storytag`,children:[(0,S.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:oe.dot}}),t]}),e.isPr&&y?.found&&(0,S.jsx)(Hl,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),!e.isPr&&x.map(e=>(0,S.jsxs)(`span`,{className:`console-related-pr-group`,children:[x.length>1&&(0,S.jsx)(`span`,{className:`console-related-pr-label`,children:ue(e.pullRequest.url)}),(0,S.jsx)(Hl,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,S.jsx)(Bl,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),fe.map(e=>(0,S.jsx)(Bl,{mergeableStatus:e.mergeableStatus},e.url)),ie!==null&&(0,S.jsx)(`span`,{className:`console-detail-closed-label`,children:ie})]}),(0,S.jsx)(X,{failures:de}),(0,S.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,S.jsx)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:e.isPr?`PR #${e.number}`:`Issue #${e.number}`}),(0,S.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,S.jsx)(`span`,{className:`console-detail-pill`,children:e.isPr?`PR`:`Issue`}),(0,S.jsx)(q,{url:e.url})]}),e.labels.length>0&&(0,S.jsx)(`div`,{className:`console-detail-labels`,children:e.labels.map(e=>(0,S.jsx)(`span`,{className:`console-label-chip`,children:e},e))}),(0,S.jsxs)(`div`,{className:`console-detail-createdat`,title:k(e.createdAt),children:[`opened `,O(e.createdAt,w)]}),(0,S.jsx)(_l,{title:`Description`,headerAction:(0,S.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:c===null?s?(0,S.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,S.jsx)(gl,{body:o,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:ae}):(0,S.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})}),e.isPr&&(0,S.jsx)(_l,{title:`Changed files`,count:A,children:(0,S.jsx)(Fl,{files:f,isLoading:p,error:m,onAddInlineComment:ne})}),(0,S.jsx)(_l,{title:`Comments`,count:j,defaultCollapsed:e.isPr,children:(0,S.jsx)(Il,{comments:l,isLoading:u,error:d,now:w,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:ae})}),e.isPr&&(0,S.jsx)(_l,{title:`Commits`,count:M,defaultCollapsed:!0,children:(0,S.jsx)(K,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&x.map(e=>(0,S.jsx)(Ul,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:ne},e.pullRequest.url)),(0,S.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,S.jsx)(`div`,{className:`console-detail-dock-composer`,children:T}),(0,S.jsx)(`div`,{className:`console-actionbar`,children:ee})]})]})},Gl=({onClose:e})=>(0,S.jsxs)(`div`,{className:`console-op-group`,children:[(0,S.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close_not_planned`),children:`Close as not planned`}),(0,S.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close`),children:`Close`})]}),Kl=({isManualTriage:e,onSetNextActionDate:t})=>(0,S.jsxs)(`div`,{className:`console-op-group`,children:[(0,S.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1 day`}),(0,S.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1 week and skip`:`+1 week`})]}),ql=`awaiting workspace`,Jl=({statusOptions:e,onOkAndAwaitingWorkspace:t})=>{let n=e.find(e=>e.name.toLowerCase()===ql);if(n===void 0)return null;let r=N(n.color);return(0,S.jsx)(`div`,{className:`console-op-group`,children:(0,S.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:r.fg,borderColor:r.border,backgroundColor:r.bg},onClick:()=>t(n),children:`ok & Awaiting Workspace`})})},Yl=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve_and_merge`,label:`Approve & Merge`,variant:`approve`}],Xl=`Reject needs an inline comment on the diff.`,Zl=({onReview:e,rejectEnabled:t})=>(0,S.jsxs)(`div`,{className:`console-op-group console-op-group-review`,children:[!t&&(0,S.jsx)(`p`,{className:`console-op-requirement`,children:Xl}),Yl.map(n=>{let r=n.action===`request_changes`&&!t;return(0,S.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-${n.variant}`,disabled:r,onClick:()=>e(n.action),children:n.label},n.action)})]}),Ql=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},$l=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=rr.map(t=>({name:t,option:Ql(e,t)})).filter(e=>e.option!==null);return r.length===0?null:(0,S.jsx)(`div`,{className:`console-op-group`,children:r.map(({name:e,option:r})=>{let i=N(r.color),a=e===nr;return(0,S.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:i.fg,borderColor:i.border,backgroundColor:i.bg},onClick:()=>a?n(r):t(r),children:r.name},r.id)})})},eu=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,handlers:i})=>(0,S.jsxs)(`div`,{className:`console-operation-bar`,children:[(0,S.jsx)(Jl,{statusOptions:r,onOkAndAwaitingWorkspace:i.onOkAndAwaitingWorkspace}),t&&(0,S.jsx)(Zl,{onReview:i.onReview,rejectEnabled:n}),(0,S.jsx)(Kl,{isManualTriage:ir(e),onSetNextActionDate:i.onSetNextActionDate}),(0,S.jsx)($l,{statusOptions:r,onSetStatus:i.onSetStatus,onSetInTmuxByHuman:i.onSetInTmuxByHuman}),(0,S.jsx)(Gl,{onClose:i.onClose})]}),tu=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,_.useState)(i??r),[s,c]=(0,_.useState)(t!==null&&i===void 0),[l,u]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},nu=[],ru=[],iu=[],au=[],ou={state:`open`,merged:!1,isPullRequest:!1,title:``},su={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},cu=(e,t)=>{let n=t===null?null:`${t.repo}#${t.number}`,r=t===null?null:t.url,i=t?.isPr??!1,a=tu(e.body,n,r,``),o=tu(e.state,n,r,ou),s=tu(e.comments,n,r,nu),c=tu(e.files,i?n:null,i?r:null,ru),l=tu(e.commits,i?n:null,i?r:null,iu),u=tu(e.prStatus,i?n:null,i?r:null,su),d=!i&&(t?.relatedOpenPullRequestUrls.length??0)>0,f=tu(e.relatedPrs,d?n:null,d?r:null,au),[p,m]=(0,_.useState)([]);return(0,_.useEffect)(()=>{if(i||f.data.length===0){m([]);return}let t=!1,n=f.data.map(e=>({pullRequest:e,files:ru,filesAreLoading:!0,filesError:null,commits:iu,commitsAreLoading:!0,commitsError:null}));m(n);let r=(e,n)=>{t||m(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of f.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,i,f.data]),{state:o.data,body:a.data,bodyIsLoading:a.isLoading,bodyError:a.error,comments:s.data,commentsAreLoading:s.isLoading,commentsError:s.error,files:c.data,filesAreLoading:c.isLoading,filesError:c.error,commits:l.data,commitsAreLoading:l.isLoading,commitsError:l.error,stateError:o.error,pullRequestStatus:i?u.data:null,pullRequestStatusError:i?u.error:null,relatedPullRequests:p,relatedPullRequestsError:i?null:f.error}},lu=e=>JSON.stringify([e.author,e.createdAt,e.body]),uu=(e,t)=>{let n=new Set(e.map(lu));return[...e,...t.filter(e=>!n.has(lu(e)))]},du=({href:e,fallbackText:t,state:n})=>n===null||n.title.trim()===``?(0,S.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t}):(0,S.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,S.jsx)(le,{...ba(n)}),(0,S.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title})]}),fu=(e,t)=>{let[n,r]=(0,_.useState)(()=>e.peek(t)??null);return(0,_.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},pu=({cache:e,href:t,fallbackText:n})=>{let r=fu(e,t);return(0,S.jsx)(du,{href:t,fallbackText:n,state:r})},mu=({tab:e,item:t,caches:n,operations:r,statusOptions:i,storyColors:a,storyName:o,overlayStatus:s,now:c,initialCommentDraft:l,onCommentDraftChange:u,onQueueAction:d})=>{let f=cu(n,t),p=(0,_.useCallback)(e=>Ca(e,t.url),[t.url]),m=(0,_.useCallback)((e,t)=>(0,S.jsx)(pu,{cache:n.state,href:e,fallbackText:t}),[n.state]),h=t.isPr||t.relatedOpenPullRequestUrls.length>0||f.relatedPullRequests.length>0,[g,v]=(0,_.useState)([]),y=(0,_.useCallback)(async(e,t,n,r)=>{v(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[b,x]=(0,_.useState)([]),C=(0,_.useCallback)(async e=>{let n=await r.addComment(t,e);return x(e=>[...e,n]),n},[t,r]),w={onReview:e=>{let n=t.isPr?t.url:f.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,i=e===`request_changes`?g:[];d({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,i)})},onSetNextActionDate:e=>{d({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e)})},onSetStory:e=>{d({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e)})},onSetStatus:e=>{d({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e)})},onSetInTmuxByHuman:e=>{d({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e)})},onClose:e=>{d({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e)})},onOkAndAwaitingWorkspace:e=>{d({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e)})}},T=i.find(e=>e.name===`Awaiting Workspace`)??null,ee=T===null?void 0:async e=>{let t=await C(e);return w.onSetStatus(T),t},te=o??(t.story.trim()===``?null:t.story),ne=te===null?null:E(a,te);return(0,S.jsx)(Wl,{item:t,storyName:te,storyColorEnum:ne,overlayStatus:s,statusOptions:i,state:f.state,stateError:f.stateError,body:f.body,bodyIsLoading:f.bodyIsLoading,bodyError:f.bodyError,comments:uu(f.comments,b),commentsAreLoading:f.commentsAreLoading,commentsError:f.commentsError,files:f.files,filesAreLoading:f.filesAreLoading,filesError:f.filesError,commits:f.commits,commitsAreLoading:f.commitsAreLoading,commitsError:f.commitsError,pullRequestStatus:f.pullRequestStatus,pullRequestStatusError:f.pullRequestStatusError,relatedPullRequests:f.relatedPullRequests,relatedPullRequestsError:f.relatedPullRequestsError,now:c,buildImageProxyUrl:p,renderReferenceLink:m,onAddInlineComment:y,commentComposer:(0,S.jsx)(ga,{initiallyOpen:!0,initialDraft:l,onSubmit:C,onDraftChange:u,onSubmitAndMoveToAwaitingWorkspace:ee,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,S.jsx)(eu,{tab:e,item:t,hasPullRequest:h,rejectEnabled:g.length>0,statusOptions:i,handlers:w})})},hu=()=>{let e={};for(let t of b)e[t.name]=0;return e},gu=`console`,_u=()=>{let e=Pi(),t=ci(),n=Zn(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o}=ea(e,r),{timerMode:s,projectMinutes:c,isOpen:l,draftTimerMode:u,draftProjectMinutes:d,openSettings:f,closeSettings:p,saveSettings:m,toggleDraftTimerMode:h,changeDraftMinutes:g}=oa(),{pjcodes:v,isLoading:y}=z(),{isTimerExpired:x}=Fi(e),C=Mi(e??gu),w=(0,_.useMemo)(()=>{let e=hu();for(let t of b){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=vi(n.items,bi(C.overlay,n.generatedAt),t.name))}return e},[i,C.overlay]),te=mi(e,w),{activeTab:E,selectedItemKey:D,openItem:ie,closeItem:ae,selectTab:oe}=te,se=(0,_.useRef)(new Map),O=(0,_.useCallback)(e=>{D!==null&&(e?se.current.set(D,e):se.current.delete(D))},[D]),k=ei(r),ce=Oi(e,E,C,k),A=hr(),le=Date.now(),j=i[E],M=(0,_.useMemo)(()=>j===null?[]:yi(j.items,bi(C.overlay,j.generatedAt),E),[j,C.overlay,E]),N=(0,_.useMemo)(()=>M.map(e=>gi(e)),[M]),ue=j?.storyOrder??[],fe=(0,_.useMemo)(()=>re(M,C.overlay,ue,j?.generatedAt??null),[M,C.overlay,ue,j]),pe=j?.storyColors??{},me=j?.statusOptions??[],P=j?.generatedAt??null,he=j?.fromCache??!1,[F,ge]=(0,_.useState)(null),_e=(0,_.useMemo)(()=>D===null||j===null?null:j.items.find(e=>e.projectItemId===D)??null,[D,j]);oi(k,_e,M),(0,_.useEffect)(()=>{D!==null&&window.scrollTo({top:0})},[D]),(0,_.useEffect)(()=>{if(e===null&&s&&v.length>0){let e=aa(v,null,c);e!==null&&sa(`/projects/${e}`)}},[e,s,v,c]);let ve=w[E],ye=(0,_.useRef)({tab:E,count:ve});(0,_.useEffect)(()=>{let e=ye.current;if(ye.current={tab:E,count:ve},e.tab===E&&e.count>0&&ve===0){let e=li(E,w);e!==null&&(oe(e),ae())}},[E,ve,w,oe,ae]);let be=_e===null?null:xi(C.overlay,_e,i[E]?.generatedAt??null),xe=_e===null?null:ne(_e,C.overlay,i[E]?.generatedAt??null),Se=(0,_.useCallback)(e=>{let t=la(N,e);t===null?ae():ie(t)},[N,ie,ae]),Ce=(0,_.useCallback)(t=>{if(n.status===`on`){A.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=gi(t.item);A.enqueue({message:ur(t.kind,t.item,E),color:cr(t.kind),commit:t.commit,advance:()=>{if(lr(t.kind,E)){if(s&&x(c[e??``]??0)){let t=aa(v,e,c);t!==null&&ca(`/projects/${t}`)}else Se(r)}}})},[A,E,Se,n.status,s,x,c,e,v]),we=zi((0,_.useCallback)(e=>{if(D===null||e===null)return;let t=e===`next`?ua(N,D):da(N,D);t!==null&&ie(t)},[D,N,ie])),[Te,Ee]=(0,_.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),De=(0,_.useCallback)(()=>{Ee(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),Oe=i.stories,ke=Oe?.stories??[],Ae=F!==null&&F.generatedAt===Oe?.generatedAt?F.stories:ke,je=Oe?.defaultNameWithOwner??null,Me=(0,_.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(je===null)throw Error(`No repository configured for this project.`);await qr({pjcode:e,title:n,storyOptionId:t,nameWithOwner:je})},[e,je]),Ne=(0,_.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await Yr({pjcode:e,storyOptionId:t,direction:n});let r=Ae.findIndex(e=>e.storyOptionId===t);if(r!==-1){let e=r+(n===`up`?-1:1);if(e>=0&&e<Ae.length){let t=[...Ae],n=t[r];t[r]=t[e],t[e]=n,ge({generatedAt:Oe?.generatedAt,stories:t})}}},[e,Ae,Oe?.generatedAt]),Pe=(0,_.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await Vr({pjcode:e,storyName:t})},[e]),[Fe,Ie]=(0,_.useState)({}),[Le,Re]=(0,_.useState)(null),[ze,Be]=(0,_.useState)({}),Ve=(0,_.useCallback)((t,n)=>{let r=Ae.find(e=>e.storyOptionId===t)?.color;if(Re(t),Ie(e=>({...e,[t]:n})),Be(e=>{let n={...e};return delete n[t],n}),e===null||je===null){Ie(e=>r===void 0?e:{...e,[t]:r}),Be(e=>({...e,[t]:`No project or repository configured.`})),Re(e=>e===t?null:e);return}Kr({pjcode:e,storyOptionId:t,newColor:n,nameWithOwner:je}).catch(e=>{Ie(e=>r===void 0?e:{...e,[t]:r}),Be(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}).finally(()=>{Re(e=>e===t?null:e)})},[e,je,Ae]);return(0,S.jsxs)(`main`,{className:`console-app`,children:[A.pending!==null&&(0,S.jsx)(wn,{message:A.pending.message,color:A.pending.color,remainingSeconds:A.pending.remainingSeconds,progress:A.pending.progress,onUndo:A.undo}),A.error!==null&&(0,S.jsx)(Tn,{title:A.error.message,message:`Operation failed: ${A.error.reason}`,onDismiss:A.dismissError}),(0,S.jsx)(T,{activeTab:E,counts:w,pjcode:e,pjcodes:v,generatedAt:P,fromCache:he,tabHref:te.tabHref,onSelectTab:te.selectTab,onSelectProject:e=>ca(`/projects/${e}`),settingsButton:(0,S.jsx)(ee,{isOpen:l,timerMode:u,projectMinutes:d,pjcodes:v,isLoadingPjcodes:y,onOpen:f,onToggleTimerMode:h,onChangeMinutes:g,onSave:m,onClose:p}),airplaneModeEnabled:t.airplaneMode,airplaneModeStatus:n.status,airplaneModeProgress:n.progress,airplaneModeCapturedAt:r?.capturedAt??null,airplaneModeFailures:n.failures,onAirplaneModeStartSync:n.startSync,onAirplaneModeTurnOff:n.turnOff}),E===`stories`?(0,S.jsx)(Cn,{stories:Ae,isLoading:a,error:o,showGray:Te,onCreateIssue:Me,onAddStory:Pe,onSelectColor:Ve,onToggleGray:De,onReorderStory:Ne,optimisticColors:Fe,colorChangeInFlight:Le,colorErrors:ze}):_e===null?(0,S.jsx)(de,{rows:fe,storyColors:pe,activeItemId:null,now:le,isLoading:a,error:o,onSelectItem:e=>te.openItem(e.projectItemId)}):(0,S.jsx)(`div`,{className:`console-detail-screen`,ref:we,children:(0,S.jsx)(mu,{tab:E,item:_e,caches:k,operations:ce,statusOptions:me,storyColors:pe,storyName:xe,overlayStatus:be,now:le,initialCommentDraft:se.current.get(_e.projectItemId)??``,onCommentDraftChange:O,onQueueAction:Ce},_e.projectItemId)})]})};`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.warn(`Service worker registration failed:`,e)});var vu=document.getElementById(`root`);if(vu===null)throw Error(`Root container #root not found`);(0,y.createRoot)(vu).render((0,S.jsx)(_.StrictMode,{children:(0,S.jsx)(_u,{})}));
88
+ `)[0],K=({commits:e,isLoading:t,error:n,now:r})=>n===null?t?(0,S.jsx)(`p`,{className:`console-commits-loading`,children:`Loading commits...`}):e.length===0?(0,S.jsx)(`p`,{className:`console-commits-empty`,children:`No commits.`}):(0,S.jsx)(`ul`,{className:`console-commits`,children:e.map(e=>(0,S.jsxs)(`li`,{className:`console-commit`,children:[(0,S.jsx)(`span`,{className:`console-commit-message`,children:Rl(e.message)}),(0,S.jsx)(`span`,{className:`console-commit-sha`,children:Ll(e.sha)}),(0,S.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,S.jsx)(`span`,{className:`console-commit-time`,children:O(e.authoredAt,r)})]},e.sha))}):(0,S.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),q=({url:e,label:t=`Copy URL`})=>(0,S.jsx)(_n,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),J=e=>{let t=new Map;for(let n of e){let e=t.get(n.message);if(e===void 0){t.set(n.message,[n.section]);continue}e.push(n.section)}return Array.from(t,([e,t])=>({message:e,sections:t}))},Y=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,X=({failures:e})=>e.length===0?null:(0,S.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:J(e).map(e=>(0,S.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,Y(e.sections),`:`,` `,e.message]},e.message))}),zl={MERGEABLE:{color:`GREEN`,label:`No conflict`,title:`This pull request has no merge conflicts`,modifier:`console-detail-mergeable-chip-ok`},CONFLICTING:{color:`RED`,label:`Conflict`,title:`This pull request has merge conflicts`,modifier:`console-detail-mergeable-chip-conflict`},UNKNOWN:{color:`GRAY`,label:`Checking merge status`,title:`GitHub has not finished computing the merge status yet`,modifier:`console-detail-mergeable-chip-unknown`}},Bl=({mergeableStatus:e})=>{let t=zl[e],n=N(t.color);return(0,S.jsx)(`span`,{className:`console-detail-status-chip console-detail-mergeable-chip ${t.modifier}`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},title:t.title,children:t.label})},Vl=e=>{let t=N(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},Hl=({isPassedAllCiJob:e,isCiStateSuccess:t,isBranchOutOfDate:n,missingRequiredCheckNames:r})=>{let i=e&&t,a=i?`GREEN`:`RED`,o=i?`CI passing`:`CI failing`,s=!i&&r.length>0?`missing: ${r.join(`, `)}`:null;return(0,S.jsxs)(`span`,{className:`console-detail-pr-status`,children:[(0,S.jsxs)(`span`,{className:`console-detail-status-chip console-detail-ci-chip`,style:Vl(a),title:s??o,children:[o,s!==null&&(0,S.jsxs)(`span`,{className:`console-detail-ci-missing`,children:[` `,`(`,s,`)`]})]}),n&&(0,S.jsx)(`span`,{className:`console-detail-status-chip console-detail-outofdate-chip`,style:Vl(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},Ul=({pullRequest:e,body:t,bodyIsLoading:n,files:r,filesAreLoading:i,filesError:a,commits:o,commitsAreLoading:s,commitsError:c,now:l,buildImageProxyUrl:u,renderReferenceLink:d,onAddInlineComment:f})=>{let p=e.summary,m=va(e.url),h=m===null?void 0:{owner:m.owner,repo:m.repo},g=i||a!==null?null:r.length,_=s||c!==null?null:o.length;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`console-pr-header`,children:[(0,S.jsx)(`a`,{href:e.url,className:`console-pr-section-title`,target:`_blank`,rel:`noopener noreferrer`,children:p?.title??e.url}),e.isDraft&&(0,S.jsx)(`span`,{className:`console-pr-section-state`,children:`draft`}),(0,S.jsx)(Bl,{mergeableStatus:e.mergeableStatus}),(0,S.jsx)(Hl,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,S.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),(0,S.jsx)(q,{url:e.url,label:`Copy PR URL`}),(0,S.jsxs)(`div`,{className:`console-pr-statbar`,children:[m!==null&&(0,S.jsxs)(`span`,{className:`console-pr-repo`,children:[m.owner,`/`,m.repo]}),e.branchName!==null&&(0,S.jsx)(`span`,{className:`console-pr-branch`,children:e.branchName}),p!==null&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`span`,{className:`console-pr-add`,children:[`+`,p.additions]}),(0,S.jsxs)(`span`,{className:`console-pr-del`,children:[`-`,p.deletions]}),(0,S.jsxs)(`span`,{className:`console-pr-files-count`,children:[p.changedFiles,` files`]})]})]})]}),(0,S.jsx)(_l,{title:`Description`,children:n?(0,S.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,S.jsx)(gl,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,S.jsx)(_l,{title:`Changed files`,count:g,children:(0,S.jsx)(Fl,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,S.jsx)(_l,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,S.jsx)(K,{commits:o,isLoading:s,error:c,now:l})})]})},Wl=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,statusOptions:i,state:a,body:o,bodyIsLoading:s,bodyError:c,comments:l,commentsAreLoading:u,commentsError:d,files:f,filesAreLoading:p,filesError:m,commits:h,commitsAreLoading:g,commitsError:_,stateError:v,pullRequestStatus:y,pullRequestStatusError:b,relatedPullRequests:x,relatedPullRequestsError:C,now:w,commentComposer:T,operationBar:ee,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:ne})=>{let D=a?.state??`open`,re=a?.merged??!1,ie=!e.isPr&&D===`closed`?`Closed`:null,ae=ya(e.nameWithOwner)??void 0,oe=N(n),se=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,ce=se===null?null:N(se.color),A=p||m!==null?null:f.length,j=u||d!==null?null:l.length,M=g||_!==null?null:h.length,ue=e=>{let t=va(e);return t===null?e:`PR #${t.number}`},de=[{section:`item state`,message:v},{section:`pull request status`,message:e.isPr?b:null},{section:`description`,message:c},{section:`comments`,message:d},{section:`changed files`,message:e.isPr?m:null},{section:`commits`,message:e.isPr?_:null},{section:`related pull requests`,message:e.isPr?null:C},...x.flatMap(e=>[{section:`changed files of ${ue(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${ue(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),fe=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:[];return(0,S.jsxs)(`article`,{className:`console-detail`,children:[(0,S.jsxs)(`h2`,{className:`console-detail-title`,children:[(0,S.jsx)(le,{isPr:e.isPr,state:D,merged:re,isDraft:!1,stateReason:``}),(0,S.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}),(0,S.jsx)(`span`,{className:`console-detail-number`,children:e.isPr?`PR #${e.number}`:`#${e.number}`})]}),(0,S.jsxs)(`div`,{className:`console-detail-topline`,children:[se!==null&&ce!==null&&(0,S.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:ce.fg,borderColor:ce.border,backgroundColor:ce.bg},children:se.name}),e.agent!==null&&e.agent!==``&&(0,S.jsx)(`span`,{className:`console-detail-agent-chip`,children:e.agent}),t!==null&&(0,S.jsxs)(`span`,{className:`console-storytag`,children:[(0,S.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:oe.dot}}),t]}),e.isPr&&y?.found&&(0,S.jsx)(Hl,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),!e.isPr&&x.map(e=>(0,S.jsxs)(`span`,{className:`console-related-pr-group`,children:[x.length>1&&(0,S.jsx)(`span`,{className:`console-related-pr-label`,children:ue(e.pullRequest.url)}),(0,S.jsx)(Hl,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,S.jsx)(Bl,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),fe.map(e=>(0,S.jsx)(Bl,{mergeableStatus:e.mergeableStatus},e.url)),ie!==null&&(0,S.jsx)(`span`,{className:`console-detail-closed-label`,children:ie})]}),(0,S.jsx)(X,{failures:de}),(0,S.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,S.jsx)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:e.isPr?`PR #${e.number}`:`Issue #${e.number}`}),(0,S.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,S.jsx)(`span`,{className:`console-detail-pill`,children:e.isPr?`PR`:`Issue`}),(0,S.jsx)(q,{url:e.url})]}),e.labels.length>0&&(0,S.jsx)(`div`,{className:`console-detail-labels`,children:e.labels.map(e=>(0,S.jsx)(`span`,{className:`console-label-chip`,children:e},e))}),(0,S.jsxs)(`div`,{className:`console-detail-createdat`,title:k(e.createdAt),children:[`opened `,O(e.createdAt,w)]}),(0,S.jsx)(_l,{title:`Description`,headerAction:(0,S.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:c===null?s?(0,S.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,S.jsx)(gl,{body:o,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:ae}):(0,S.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})}),e.isPr&&(0,S.jsx)(_l,{title:`Changed files`,count:A,children:(0,S.jsx)(Fl,{files:f,isLoading:p,error:m,onAddInlineComment:ne})}),(0,S.jsx)(_l,{title:`Comments`,count:j,defaultCollapsed:e.isPr,children:(0,S.jsx)(Il,{comments:l,isLoading:u,error:d,now:w,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:ae})}),e.isPr&&(0,S.jsx)(_l,{title:`Commits`,count:M,defaultCollapsed:!0,children:(0,S.jsx)(K,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&x.map(e=>(0,S.jsx)(Ul,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:ne},e.pullRequest.url)),(0,S.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,S.jsx)(`div`,{className:`console-detail-dock-composer`,children:T}),(0,S.jsx)(`div`,{className:`console-actionbar`,children:ee})]})]})},Gl=({onClose:e})=>(0,S.jsxs)(`div`,{className:`console-op-group`,children:[(0,S.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close_not_planned`),children:`Close as not planned`}),(0,S.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close`),children:`Close`})]}),Kl=({isManualTriage:e,onSetNextActionDate:t})=>(0,S.jsxs)(`div`,{className:`console-op-group`,children:[(0,S.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1hour`),children:`+1 hour`}),(0,S.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3 hours`}),(0,S.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1 day`}),(0,S.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1 week and skip`:`+1 week`})]}),ql=`awaiting workspace`,Jl=({statusOptions:e,onOkAndAwaitingWorkspace:t})=>{let n=e.find(e=>e.name.toLowerCase()===ql);if(n===void 0)return null;let r=N(n.color);return(0,S.jsx)(`div`,{className:`console-op-group`,children:(0,S.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:r.fg,borderColor:r.border,backgroundColor:r.bg},onClick:()=>t(n),children:`ok & Awaiting Workspace`})})},Yl=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve_and_merge`,label:`Approve & Merge`,variant:`approve`}],Xl=`Reject needs an inline comment on the diff.`,Zl=({onReview:e,rejectEnabled:t})=>(0,S.jsxs)(`div`,{className:`console-op-group console-op-group-review`,children:[!t&&(0,S.jsx)(`p`,{className:`console-op-requirement`,children:Xl}),Yl.map(n=>{let r=n.action===`request_changes`&&!t;return(0,S.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-${n.variant}`,disabled:r,onClick:()=>e(n.action),children:n.label},n.action)})]}),Ql=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},$l=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=rr.map(t=>({name:t,option:Ql(e,t)})).filter(e=>e.option!==null);return r.length===0?null:(0,S.jsx)(`div`,{className:`console-op-group`,children:r.map(({name:e,option:r})=>{let i=N(r.color),a=e===nr;return(0,S.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:i.fg,borderColor:i.border,backgroundColor:i.bg},onClick:()=>a?n(r):t(r),children:r.name},r.id)})})},eu=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,handlers:i})=>(0,S.jsxs)(`div`,{className:`console-operation-bar`,children:[(0,S.jsx)(Jl,{statusOptions:r,onOkAndAwaitingWorkspace:i.onOkAndAwaitingWorkspace}),t&&(0,S.jsx)(Zl,{onReview:i.onReview,rejectEnabled:n}),(0,S.jsx)(Kl,{isManualTriage:ir(e),onSetNextActionDate:i.onSetNextActionDate}),(0,S.jsx)($l,{statusOptions:r,onSetStatus:i.onSetStatus,onSetInTmuxByHuman:i.onSetInTmuxByHuman}),(0,S.jsx)(Gl,{onClose:i.onClose})]}),tu=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,_.useState)(i??r),[s,c]=(0,_.useState)(t!==null&&i===void 0),[l,u]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},nu=[],ru=[],iu=[],au=[],ou={state:`open`,merged:!1,isPullRequest:!1,title:``},su={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},cu=(e,t)=>{let n=t===null?null:`${t.repo}#${t.number}`,r=t===null?null:t.url,i=t?.isPr??!1,a=tu(e.body,n,r,``),o=tu(e.state,n,r,ou),s=tu(e.comments,n,r,nu),c=tu(e.files,i?n:null,i?r:null,ru),l=tu(e.commits,i?n:null,i?r:null,iu),u=tu(e.prStatus,i?n:null,i?r:null,su),d=!i&&(t?.relatedOpenPullRequestUrls.length??0)>0,f=tu(e.relatedPrs,d?n:null,d?r:null,au),[p,m]=(0,_.useState)([]);return(0,_.useEffect)(()=>{if(i||f.data.length===0){m([]);return}let t=!1,n=f.data.map(e=>({pullRequest:e,files:ru,filesAreLoading:!0,filesError:null,commits:iu,commitsAreLoading:!0,commitsError:null}));m(n);let r=(e,n)=>{t||m(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of f.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,i,f.data]),{state:o.data,body:a.data,bodyIsLoading:a.isLoading,bodyError:a.error,comments:s.data,commentsAreLoading:s.isLoading,commentsError:s.error,files:c.data,filesAreLoading:c.isLoading,filesError:c.error,commits:l.data,commitsAreLoading:l.isLoading,commitsError:l.error,stateError:o.error,pullRequestStatus:i?u.data:null,pullRequestStatusError:i?u.error:null,relatedPullRequests:p,relatedPullRequestsError:i?null:f.error}},lu=e=>JSON.stringify([e.author,e.createdAt,e.body]),uu=(e,t)=>{let n=new Set(e.map(lu));return[...e,...t.filter(e=>!n.has(lu(e)))]},du=({href:e,fallbackText:t,state:n})=>n===null||n.title.trim()===``?(0,S.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t}):(0,S.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,S.jsx)(le,{...ba(n)}),(0,S.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title})]}),fu=(e,t)=>{let[n,r]=(0,_.useState)(()=>e.peek(t)??null);return(0,_.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},pu=({cache:e,href:t,fallbackText:n})=>{let r=fu(e,t);return(0,S.jsx)(du,{href:t,fallbackText:n,state:r})},mu=({tab:e,item:t,caches:n,operations:r,statusOptions:i,storyColors:a,storyName:o,overlayStatus:s,now:c,initialCommentDraft:l,onCommentDraftChange:u,onQueueAction:d})=>{let f=cu(n,t),p=(0,_.useCallback)(e=>Ca(e,t.url),[t.url]),m=(0,_.useCallback)((e,t)=>(0,S.jsx)(pu,{cache:n.state,href:e,fallbackText:t}),[n.state]),h=t.isPr||t.relatedOpenPullRequestUrls.length>0||f.relatedPullRequests.length>0,[g,v]=(0,_.useState)([]),y=(0,_.useCallback)(async(e,t,n,r)=>{v(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[b,x]=(0,_.useState)([]),C=(0,_.useCallback)(async e=>{let n=await r.addComment(t,e);return x(e=>[...e,n]),n},[t,r]),w={onReview:e=>{let n=t.isPr?t.url:f.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,i=e===`request_changes`?g:[];d({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,i)})},onSetNextActionDate:e=>{d({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e)})},onSetStory:e=>{d({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e)})},onSetStatus:e=>{d({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e)})},onSetInTmuxByHuman:e=>{d({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e)})},onClose:e=>{d({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e)})},onOkAndAwaitingWorkspace:e=>{d({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e)})}},T=i.find(e=>e.name===`Awaiting Workspace`)??null,ee=T===null?void 0:async e=>{let t=await C(e);return w.onSetStatus(T),t},te=o??(t.story.trim()===``?null:t.story),ne=te===null?null:E(a,te);return(0,S.jsx)(Wl,{item:t,storyName:te,storyColorEnum:ne,overlayStatus:s,statusOptions:i,state:f.state,stateError:f.stateError,body:f.body,bodyIsLoading:f.bodyIsLoading,bodyError:f.bodyError,comments:uu(f.comments,b),commentsAreLoading:f.commentsAreLoading,commentsError:f.commentsError,files:f.files,filesAreLoading:f.filesAreLoading,filesError:f.filesError,commits:f.commits,commitsAreLoading:f.commitsAreLoading,commitsError:f.commitsError,pullRequestStatus:f.pullRequestStatus,pullRequestStatusError:f.pullRequestStatusError,relatedPullRequests:f.relatedPullRequests,relatedPullRequestsError:f.relatedPullRequestsError,now:c,buildImageProxyUrl:p,renderReferenceLink:m,onAddInlineComment:y,commentComposer:(0,S.jsx)(ga,{initiallyOpen:!0,initialDraft:l,onSubmit:C,onDraftChange:u,onSubmitAndMoveToAwaitingWorkspace:ee,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,S.jsx)(eu,{tab:e,item:t,hasPullRequest:h,rejectEnabled:g.length>0,statusOptions:i,handlers:w})})},hu=()=>{let e={};for(let t of b)e[t.name]=0;return e},gu=`console`,_u=()=>{let e=Pi(),t=ci(),n=Zn(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o}=ea(e,r),{timerMode:s,projectMinutes:c,isOpen:l,draftTimerMode:u,draftProjectMinutes:d,openSettings:f,closeSettings:p,saveSettings:m,toggleDraftTimerMode:h,changeDraftMinutes:g}=oa(),{pjcodes:v,isLoading:y}=z(),{isTimerExpired:x}=Fi(e),C=Mi(e??gu),w=(0,_.useMemo)(()=>{let e=hu();for(let t of b){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=vi(n.items,bi(C.overlay,n.generatedAt),t.name))}return e},[i,C.overlay]),te=mi(e,w),{activeTab:E,selectedItemKey:D,openItem:ie,closeItem:ae,selectTab:oe}=te,se=(0,_.useRef)(new Map),O=(0,_.useCallback)(e=>{D!==null&&(e?se.current.set(D,e):se.current.delete(D))},[D]),k=ei(r),ce=Oi(e,E,C,k),A=hr(),le=Date.now(),j=i[E],M=(0,_.useMemo)(()=>j===null?[]:yi(j.items,bi(C.overlay,j.generatedAt),E),[j,C.overlay,E]),N=(0,_.useMemo)(()=>M.map(e=>gi(e)),[M]),ue=j?.storyOrder??[],fe=(0,_.useMemo)(()=>re(M,C.overlay,ue,j?.generatedAt??null),[M,C.overlay,ue,j]),pe=j?.storyColors??{},me=j?.statusOptions??[],P=j?.generatedAt??null,he=j?.fromCache??!1,[F,ge]=(0,_.useState)(null),_e=(0,_.useMemo)(()=>D===null||j===null?null:j.items.find(e=>e.projectItemId===D)??null,[D,j]);oi(k,_e,M),(0,_.useEffect)(()=>{D!==null&&window.scrollTo({top:0})},[D]),(0,_.useEffect)(()=>{if(e===null&&s&&v.length>0){let e=aa(v,null,c);e!==null&&sa(`/projects/${e}`)}},[e,s,v,c]);let ve=w[E],ye=(0,_.useRef)({tab:E,count:ve});(0,_.useEffect)(()=>{let e=ye.current;if(ye.current={tab:E,count:ve},e.tab===E&&e.count>0&&ve===0){let e=li(E,w);e!==null&&(oe(e),ae())}},[E,ve,w,oe,ae]);let be=_e===null?null:xi(C.overlay,_e,i[E]?.generatedAt??null),xe=_e===null?null:ne(_e,C.overlay,i[E]?.generatedAt??null),Se=(0,_.useCallback)(e=>{let t=la(N,e);t===null?ae():ie(t)},[N,ie,ae]),Ce=(0,_.useCallback)(t=>{if(n.status===`on`){A.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=gi(t.item);A.enqueue({message:ur(t.kind,t.item,E),color:cr(t.kind),commit:t.commit,advance:()=>{if(lr(t.kind,E)){if(s&&x(c[e??``]??0)){let t=aa(v,e,c);t!==null&&ca(`/projects/${t}`)}else Se(r)}}})},[A,E,Se,n.status,s,x,c,e,v]),we=zi((0,_.useCallback)(e=>{if(D===null||e===null)return;let t=e===`next`?ua(N,D):da(N,D);t!==null&&ie(t)},[D,N,ie])),[Te,Ee]=(0,_.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),De=(0,_.useCallback)(()=>{Ee(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),Oe=i.stories,ke=Oe?.stories??[],Ae=F!==null&&F.generatedAt===Oe?.generatedAt?F.stories:ke,je=Oe?.defaultNameWithOwner??null,Me=(0,_.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(je===null)throw Error(`No repository configured for this project.`);await qr({pjcode:e,title:n,storyOptionId:t,nameWithOwner:je})},[e,je]),Ne=(0,_.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await Yr({pjcode:e,storyOptionId:t,direction:n});let r=Ae.findIndex(e=>e.storyOptionId===t);if(r!==-1){let e=r+(n===`up`?-1:1);if(e>=0&&e<Ae.length){let t=[...Ae],n=t[r];t[r]=t[e],t[e]=n,ge({generatedAt:Oe?.generatedAt,stories:t})}}},[e,Ae,Oe?.generatedAt]),Pe=(0,_.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await Vr({pjcode:e,storyName:t})},[e]),[Fe,Ie]=(0,_.useState)({}),[Le,Re]=(0,_.useState)(null),[ze,Be]=(0,_.useState)({}),Ve=(0,_.useCallback)((t,n)=>{let r=Ae.find(e=>e.storyOptionId===t)?.color;if(Re(t),Ie(e=>({...e,[t]:n})),Be(e=>{let n={...e};return delete n[t],n}),e===null||je===null){Ie(e=>r===void 0?e:{...e,[t]:r}),Be(e=>({...e,[t]:`No project or repository configured.`})),Re(e=>e===t?null:e);return}Kr({pjcode:e,storyOptionId:t,newColor:n,nameWithOwner:je}).catch(e=>{Ie(e=>r===void 0?e:{...e,[t]:r}),Be(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}).finally(()=>{Re(e=>e===t?null:e)})},[e,je,Ae]);return(0,S.jsxs)(`main`,{className:`console-app`,children:[A.pending!==null&&(0,S.jsx)(wn,{message:A.pending.message,color:A.pending.color,remainingSeconds:A.pending.remainingSeconds,progress:A.pending.progress,onUndo:A.undo}),A.error!==null&&(0,S.jsx)(Tn,{title:A.error.message,message:`Operation failed: ${A.error.reason}`,onDismiss:A.dismissError}),(0,S.jsx)(T,{activeTab:E,counts:w,pjcode:e,pjcodes:v,generatedAt:P,fromCache:he,tabHref:te.tabHref,onSelectTab:te.selectTab,onSelectProject:e=>ca(`/projects/${e}`),settingsButton:(0,S.jsx)(ee,{isOpen:l,timerMode:u,projectMinutes:d,pjcodes:v,isLoadingPjcodes:y,onOpen:f,onToggleTimerMode:h,onChangeMinutes:g,onSave:m,onClose:p}),airplaneModeEnabled:t.airplaneMode,airplaneModeStatus:n.status,airplaneModeProgress:n.progress,airplaneModeCapturedAt:r?.capturedAt??null,airplaneModeFailures:n.failures,onAirplaneModeStartSync:n.startSync,onAirplaneModeTurnOff:n.turnOff}),E===`stories`?(0,S.jsx)(Cn,{stories:Ae,isLoading:a,error:o,showGray:Te,onCreateIssue:Me,onAddStory:Pe,onSelectColor:Ve,onToggleGray:De,onReorderStory:Ne,optimisticColors:Fe,colorChangeInFlight:Le,colorErrors:ze}):_e===null?(0,S.jsx)(de,{rows:fe,storyColors:pe,activeItemId:null,now:le,isLoading:a,error:o,onSelectItem:e=>te.openItem(e.projectItemId)}):(0,S.jsx)(`div`,{className:`console-detail-screen`,ref:we,children:(0,S.jsx)(mu,{tab:E,item:_e,caches:k,operations:ce,statusOptions:me,storyColors:pe,storyName:xe,overlayStatus:be,now:le,initialCommentDraft:se.current.get(_e.projectItemId)??``,onCommentDraftChange:O,onQueueAction:Ce},_e.projectItemId)})]})};`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.warn(`Service worker registration failed:`,e)});var vu=document.getElementById(`root`);if(vu===null)throw Error(`Root container #root not found`);(0,y.createRoot)(vu).render((0,S.jsx)(_.StrictMode,{children:(0,S.jsx)(_u,{})}));
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>TDPM Console</title>
7
- <script type="module" crossorigin src="/assets/index-DkMqSpkk.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-BSa2JTna.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-CLHvrafO.css">
9
9
  </head>
10
10
  <body>
@@ -1,20 +1,21 @@
1
1
  import { mock } from 'jest-mock-extended';
2
+ import type { Issue } from '../../../domain/entities/Issue';
3
+ import type { Project } from '../../../domain/entities/Project';
4
+ import type { DateRepository } from '../../../domain/usecases/adapter-interfaces/DateRepository';
5
+ import type { ProjectRepository } from '../../../domain/usecases/adapter-interfaces/ProjectRepository';
6
+ import type { LocalStorageCacheRepository } from '../LocalStorageCacheRepository';
7
+ import type { LocalStorageRepository } from '../LocalStorageRepository';
2
8
  import {
3
9
  ApiV3CheerioRestIssueRepository,
4
10
  REQUIRED_CHECKS_CACHE_TTL_MS,
5
11
  } from './ApiV3CheerioRestIssueRepository';
6
- import { ApiV3IssueRepository } from './ApiV3IssueRepository';
7
- import { RestIssueRepository } from './RestIssueRepository';
8
- import {
12
+ import type { ApiV3IssueRepository } from './ApiV3IssueRepository';
13
+ import type {
9
14
  GraphqlProjectItemRepository,
10
15
  ProjectItem,
11
16
  ProjectItemLight,
12
17
  } from './GraphqlProjectItemRepository';
13
- import { LocalStorageCacheRepository } from '../LocalStorageCacheRepository';
14
- import { LocalStorageRepository } from '../LocalStorageRepository';
15
- import { Project } from '../../../domain/entities/Project';
16
- import { ProjectRepository } from '../../../domain/usecases/adapter-interfaces/ProjectRepository';
17
- import { DateRepository } from '../../../domain/usecases/adapter-interfaces/DateRepository';
18
+ import type { RestIssueRepository } from './RestIssueRepository';
18
19
 
19
20
  const buildTestProject = (id: string): Project => ({
20
21
  id,
@@ -1140,6 +1141,60 @@ describe('ApiV3CheerioRestIssueRepository', () => {
1140
1141
  });
1141
1142
  });
1142
1143
 
1144
+ describe('updateNextActionHour', () => {
1145
+ const buildProjectWithHourOptions = (
1146
+ optionEntries: { id: string; name: string }[],
1147
+ ): Project & {
1148
+ nextActionHour: NonNullable<Project['nextActionHour']>;
1149
+ } => ({
1150
+ ...buildTestProject('hour-project'),
1151
+ nextActionHour: {
1152
+ name: 'Next Action Hour',
1153
+ fieldId: 'nah-field',
1154
+ options: optionEntries.map((o) => ({
1155
+ ...o,
1156
+ color: 'GRAY' as const,
1157
+ description: '',
1158
+ })),
1159
+ },
1160
+ });
1161
+
1162
+ const testIssue = {
1163
+ ...mock<Issue>(),
1164
+ itemId: 'test-item-id',
1165
+ };
1166
+
1167
+ it('submits singleSelectOptionId when a matching option exists', async () => {
1168
+ const { repository, graphqlProjectItemRepository } =
1169
+ createApiV3CheerioRestIssueRepository();
1170
+ graphqlProjectItemRepository.updateProjectField.mockResolvedValue();
1171
+ const project = buildProjectWithHourOptions([{ id: 'opt9', name: '9' }]);
1172
+
1173
+ await repository.updateNextActionHour(project, testIssue, 9);
1174
+
1175
+ expect(
1176
+ graphqlProjectItemRepository.updateProjectField,
1177
+ ).toHaveBeenCalledWith('hour-project', 'nah-field', 'test-item-id', {
1178
+ singleSelectOptionId: 'opt9',
1179
+ });
1180
+ });
1181
+
1182
+ it('falls back to number when no matching option exists', async () => {
1183
+ const { repository, graphqlProjectItemRepository } =
1184
+ createApiV3CheerioRestIssueRepository();
1185
+ graphqlProjectItemRepository.updateProjectField.mockResolvedValue();
1186
+ const project = buildProjectWithHourOptions([]);
1187
+
1188
+ await repository.updateNextActionHour(project, testIssue, 9);
1189
+
1190
+ expect(
1191
+ graphqlProjectItemRepository.updateProjectField,
1192
+ ).toHaveBeenCalledWith('hour-project', 'nah-field', 'test-item-id', {
1193
+ number: 9,
1194
+ });
1195
+ });
1196
+ });
1197
+
1143
1198
  describe('setDependedIssueUrl', () => {
1144
1199
  const projectWithDependedIssueUrlField = {
1145
1200
  ...mock<Project>(),
@@ -1064,11 +1064,17 @@ export class ApiV3CheerioRestIssueRepository
1064
1064
  issue: Issue,
1065
1065
  hour: number,
1066
1066
  ): Promise<void> => {
1067
+ const option = project.nextActionHour.options.find(
1068
+ (o) => o.name === String(hour),
1069
+ );
1070
+ const value = option
1071
+ ? { singleSelectOptionId: option.id }
1072
+ : { number: hour };
1067
1073
  return this.graphqlProjectItemRepository.updateProjectField(
1068
1074
  project.id,
1069
1075
  project.nextActionHour.fieldId,
1070
1076
  issue.itemId,
1071
- { number: hour },
1077
+ value,
1072
1078
  );
1073
1079
  };
1074
1080
  updateStory = async (
@@ -120,6 +120,7 @@ describe('projectFromDefinition', () => {
120
120
  nextActionHour: {
121
121
  name: 'nextactionhour',
122
122
  fieldId: 'PVTSSF_nextactionhour',
123
+ options: [],
123
124
  },
124
125
  story: {
125
126
  name: 'story',
@@ -102,6 +102,7 @@ export const projectFromDefinition = (
102
102
  ? {
103
103
  name: nextActionHour.name,
104
104
  fieldId: nextActionHour.fieldId,
105
+ options: nextActionHour.options,
105
106
  }
106
107
  : null,
107
108
  story:
@@ -56,6 +56,7 @@ export type Project = {
56
56
  nextActionHour: {
57
57
  name: string;
58
58
  fieldId: string;
59
+ options: FieldOption[];
59
60
  } | null;
60
61
  story: {
61
62
  name: string;
@@ -11,6 +11,7 @@ describe('ClearPastNextActionDateHourUseCase', () => {
11
11
  const nextActionHourField = {
12
12
  name: 'Next Action Hour',
13
13
  fieldId: 'hourFieldId',
14
+ options: [],
14
15
  };
15
16
  const nextActionDateField = {
16
17
  name: 'Next Action Date',
@@ -1 +1 @@
1
- {"version":3,"file":"consoleOperationApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleOperationApi.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,OAAO,EACb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uEAAuE,CAAC;AACvH,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,6DAA6D,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+DAA+D,CAAC;AASvG,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AACnE,eAAO,MAAM,yBAAyB,qHAC8E,CAAC;AACrH,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAC/D,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CACnC,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;AAE3C,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AAEjE,MAAM,MAAM,8BAA8B,GAAG,CAC3C,qBAAqB,EAAE,MAAM,KAC1B,eAAe,CAAC;AAErB,MAAM,MAAM,gCAAgC,GAAG,CAC7C,UAAU,EAAE,MAAM,KACf,IAAI,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;AAEhD,MAAM,MAAM,uBAAuB,GAAG;IACpC,sBAAsB,EAAE,8BAA8B,CAAC;IACvD,cAAc,EAAE,sBAAsB,CAAC;IACvC,kBAAkB,EAAE,sBAAsB,CAAC;IAC3C,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,yBAAyB,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC5D,wBAAwB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,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAqDlC,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAiClC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAyClC,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAqBlC,CAAC"}
1
+ {"version":3,"file":"consoleOperationApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleOperationApi.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,OAAO,EACb,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uEAAuE,CAAC;AACvH,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,6DAA6D,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+DAA+D,CAAC;AASvG,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AACnE,eAAO,MAAM,yBAAyB,qHAC8E,CAAC;AACrH,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAC/D,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CACnC,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;AAE3C,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE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AAsB,GACjC,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CA2ClC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAC5B,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CA0DlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CA6BlC,CAAC;AAKF,eAAO,MAAM,gBAAgB,GAC3B,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAqDlC,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAiClC,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAyClC,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAqBlC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiV3CheerioRestIssueRepository.d.ts","sourceRoot":"","sources":["../../../../src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EACjB,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,6DAA6D,CAAC;AACrE,OAA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B,GACnB,OAAO,MAAM,KACZ,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAsD7B;IAEF,0BAA0B,GACxB,KAAK,MAAM,KACV,OAAO,CAAC;QACT,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,OAAO,CAAC;QAChB,aAAa,EAAE,OAAO,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CA6DA;IAEF,qBAAqB,GACnB,OAAO,MAAM,KACZ,OAAO,CAAC;QACT,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;KACtB,GAAG,IAAI,CAAC,CAuCP;CACH"}
1
+ {"version":3,"file":"ApiV3CheerioRestIssueRepository.d.ts","sourceRoot":"","sources":["../../../../src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EACjB,4BAA4B,EAC5B,+BAA+B,EAChC,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,4BAA4B,EAC5B,WAAW,EACZ,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAO7E,OAAO,EAAE,oBAAoB,EAAE,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I,CAAC,CAuCP;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"projectFieldDefinition.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/projectFieldDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAUrE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,OAAO,MAAM,KACZ,WAAW,CAAC,OAAO,CAcrB,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,YAAY,iBAAiB,KAC5B,OAiGF,CAAC"}
1
+ {"version":3,"file":"projectFieldDefinition.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/projectFieldDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAUrE,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,OAAO,MAAM,KACZ,WAAW,CAAC,OAAO,CAcrB,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,YAAY,iBAAiB,KAC5B,OAkGF,CAAC"}
@@ -27,6 +27,7 @@ export type Project = {
27
27
  nextActionHour: {
28
28
  name: string;
29
29
  fieldId: string;
30
+ options: FieldOption[];
30
31
  } | null;
31
32
  story: {
32
33
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Project.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/Project.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,iFAStB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5C,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG;IACrD,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,iBAAiB,cAAc,EAAE,EACjC,SAAS,MAAM,KACd,cAAc,EAchB,CAAC;AACF,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,WAAW,EAAE,CAAC;KACzB,CAAC;IACF,cAAc,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,cAAc,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,WAAW,EAAE,CAAC;QACvB,uBAAuB,EAAE;YACvB,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;KACH,GAAG,IAAI,CAAC;IACT,0BAA0B,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,gCAAgC,EAAE;QAChC,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,iCAAiC,EAAE;QACjC,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;IACT,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,WAAW,EAAE,CAAC;KACxB,GAAG,IAAI,CAAC;CACV,CAAC"}
1
+ {"version":3,"file":"Project.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/Project.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,iFAStB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5C,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,cAA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