github-issue-tower-defence-management 2.141.1 → 2.142.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.
- package/bin/adapter/entry-points/console/ui-dist/assets/{index-BluBp4hI.js → index-yYPswy19.js} +2 -2
- package/bin/adapter/entry-points/console/ui-dist/index.html +1 -1
- package/bin/domain/usecases/SetNoStoryIssueToStoryUseCase.js +4 -3
- package/bin/domain/usecases/SetNoStoryIssueToStoryUseCase.js.map +1 -1
- package/package.json +1 -1
- package/types/domain/usecases/SetNoStoryIssueToStoryUseCase.d.ts.map +1 -1
package/bin/adapter/entry-points/console/ui-dist/assets/{index-BluBp4hI.js → index-yYPswy19.js}
RENAMED
|
@@ -86,8 +86,8 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
86
86
|
`)}),o+=1,i=null;continue}i.push(e);continue}if(dc(e)){r.push(e),a=!0;continue}r.push(e)}return i!==null&&r.push("```mermaid",...i),s(),n},mc=Object.defineProperty,hc=(e,t)=>mc(e,`name`,{value:t,configurable:!0});function gc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}hc(gc,`setRef`);function _c(...e){return t=>{let n=!1,r=e.map(e=>{let r=gc(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():gc(e[t],null)}}}}hc(_c,`composeRefs`);function vc(...e){return y.useCallback(_c(...e),e)}hc(vc,`useComposedRefs`);var yc=Object.defineProperty,bc=(e,t)=>yc(e,`name`,{value:t,configurable:!0});function xc(e){let t=y.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Ac(r)&&typeof Pc==`function`&&(r=Pc(r._payload)),y.Children.forEach(r,e=>{if(Oc(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ac(n)&&typeof Pc==`function`&&(n=Pc(n._payload)),a=Tc(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=y.cloneElement(a,void 0,s):!o&&y.Children.count(r)===1&&y.isValidElement(r)&&(a=r);let c=a?Dc(a):void 0,l=vc(n,c);if(!a){if(r||r===0)throw Error(o?Nc(e):Mc(e));return r}let u=Ec(i,a.props??{});return a.type!==y.Fragment&&(u.ref=n?l:c),y.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}bc(xc,`createSlot`);var Sc=xc(`Slot`),Cc=Symbol.for(`radix.slottable`);function wc(e){let t=bc(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Cc,t}bc(wc,`createSlottable`);var Tc=bc((e,t)=>{if(`child`in e.props){let t=e.props.child;return y.isValidElement(t)?y.cloneElement(t,void 0,e.props.children(t.props.children)):null}return y.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Ec(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}bc(Ec,`mergeProps`);function Dc(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}bc(Dc,`getElementRef`);function Oc(e){return y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Cc}bc(Oc,`isSlottable`);var kc=Symbol.for(`react.lazy`);function Ac(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===kc&&`_payload`in e&&jc(e._payload)}bc(Ac,`isLazyComponent`);function jc(e){return typeof e==`object`&&!!e&&`then`in e}bc(jc,`isPromiseLike`);var Mc=bc(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Nc=bc(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Pc=y.use;function Fc(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Fc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Ic(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Fc(e))&&(r&&(r+=` `),r+=t);return r}var Lc=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Rc=Ic,zc=(e,t)=>n=>{if(t?.variants==null)return Rc(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Lc(t)||Lc(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Rc(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Bc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Vc=(e,t)=>({classGroupId:e,validator:t}),Hc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Uc=`-`,Wc=[],Gc=`arbitrary..`,Kc=e=>{let t=Yc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Jc(e);let n=e.split(Uc);return qc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Bc(i,t):t:i||Wc}return n[e]||Wc}}},qc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=qc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Uc):e.slice(t).join(Uc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Jc=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Gc+r:void 0})(),Yc=e=>{let{theme:t,classGroups:n}=e;return Xc(n,t)},Xc=(e,t)=>{let n=Hc();for(let r in e){let i=e[r];Zc(i,n,r,t)}return n},Zc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Qc(i,t,n,r)}},Qc=(e,t,n,r)=>{if(typeof e==`string`){$c(e,t,n);return}if(typeof e==`function`){el(e,t,n,r);return}tl(e,t,n,r)},$c=(e,t,n)=>{let r=e===``?t:nl(t,e);r.classGroupId=n},el=(e,t,n,r)=>{if(rl(e)){Zc(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Vc(n,e))},tl=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Zc(o,nl(t,a),n,r)}},nl=(e,t)=>{let n=e,r=t.split(Uc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Hc(),n.nextPart.set(t,i)),n=i}return n},rl=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,il=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},al=`!`,ol=`:`,sl=[],cl=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ll=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===ol){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(al)?(c=s.slice(0,-1),l=!0):s.startsWith(al)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return cl(t,l,c,u)};if(t){let e=t+ol,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):cl(sl,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ul=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},dl=e=>({cache:il(e.cacheSize),parseClassName:ll(e),sortModifiers:ul(e),postfixLookupClassGroupIds:fl(e),...Kc(e)}),fl=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},pl=/\s+/,ml=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(pl),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+al:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},hl=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=gl(n))&&(i&&(i+=` `),i+=r);return i},gl=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=gl(e[r]))&&(n&&(n+=` `),n+=t);return n},_l=(e,...t)=>{let n,r,i,a,o=o=>(n=dl(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ml(e,n);return i(e,a),a};return a=o,(...e)=>a(hl(...e))},vl=[],yl=e=>{let t=t=>t[e]||vl;return t.isThemeGetter=!0,t.themeKey=e,t},bl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xl=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Sl=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Tl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,El=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dl=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ol=e=>Sl.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),kl=e=>!!e&&Number.isInteger(Number(e)),Al=e=>e.endsWith(`%`)&&q(e.slice(0,-1)),jl=e=>Cl.test(e),Ml=()=>!0,Nl=e=>wl.test(e)&&!Tl.test(e),Pl=()=>!1,Fl=e=>El.test(e),Il=e=>Dl.test(e),Ll=e=>!J(e)&&!Y(e),Rl=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),zl=e=>X(e,ru,Pl),J=e=>bl.test(e),Bl=e=>X(e,iu,Nl),Vl=e=>X(e,au,q),Hl=e=>X(e,su,Ml),Ul=e=>X(e,ou,Pl),Wl=e=>X(e,tu,Pl),Gl=e=>X(e,nu,Il),Kl=e=>X(e,cu,Fl),Y=e=>xl.test(e),ql=e=>eu(e,iu),Jl=e=>eu(e,ou),Yl=e=>eu(e,tu),Xl=e=>eu(e,ru),Zl=e=>eu(e,nu),Ql=e=>eu(e,cu,!0),$l=e=>eu(e,su,!0),X=(e,t,n)=>{let r=bl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},eu=(e,t,n=!1)=>{let r=xl.exec(e);return r?r[1]?t(r[1]):n:!1},tu=e=>e===`position`||e===`percentage`,nu=e=>e===`image`||e===`url`,ru=e=>e===`length`||e===`size`||e===`bg-size`,iu=e=>e===`length`,au=e=>e===`number`,ou=e=>e===`family-name`,su=e=>e===`number`||e===`weight`,cu=e=>e===`shadow`,lu=_l(()=>{let e=yl(`color`),t=yl(`font`),n=yl(`text`),r=yl(`font-weight`),i=yl(`tracking`),a=yl(`leading`),o=yl(`breakpoint`),s=yl(`container`),c=yl(`spacing`),l=yl(`radius`),u=yl(`shadow`),d=yl(`inset-shadow`),f=yl(`text-shadow`),p=yl(`drop-shadow`),m=yl(`blur`),h=yl(`perspective`),g=yl(`aspect`),_=yl(`ease`),v=yl(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),Y,J],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Y,J,c],T=()=>[Ol,`full`,`auto`,...w()],ee=()=>[kl,`none`,`subgrid`,Y,J],E=()=>[`auto`,{span:[`full`,kl,Y,J]},kl,Y,J],D=()=>[kl,`auto`,Y,J],O=()=>[`auto`,`min`,`max`,`fr`,Y,J],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],k=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ne=()=>[`auto`,...w()],A=()=>[Ol,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[s,Ol,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],M=()=>[Ol,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,Y,J],re=()=>[...b(),Yl,Wl,{position:[Y,J]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Xl,zl,{size:[Y,J]}],P=()=>[Al,ql,Bl],oe=()=>[``,`none`,`full`,l,Y,J],se=()=>[``,q,ql,Bl],ce=()=>[`solid`,`dashed`,`dotted`,`double`],le=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ue=()=>[q,Al,Yl,Wl],de=()=>[``,`none`,m,Y,J],fe=()=>[`none`,q,Y,J],pe=()=>[`none`,q,Y,J],me=()=>[q,Y,J],F=()=>[Ol,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[jl],breakpoint:[jl],color:[Ml],container:[jl],"drop-shadow":[jl],ease:[`in`,`out`,`in-out`],font:[Ll],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[jl],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[jl],shadow:[jl],spacing:[`px`,q],text:[jl],"text-shadow":[jl],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ol,J,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,J]}],"container-named":[Rl],columns:[{columns:[q,`auto`,J,Y,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[kl,`auto`,Y,J]}],basis:[{basis:[Ol,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[q,Ol,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,q,Y,J]}],shrink:[{shrink:[``,q,Y,J]}],order:[{order:[kl,`first`,`last`,`none`,Y,J]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...k(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...k()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...k(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...k(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...k(),`baseline`]}],"place-self":[{"place-self":[`auto`,...k()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:ne()}],mx:[{mx:ne()}],my:[{my:ne()}],ms:[{ms:ne()}],me:[{me:ne()}],mbs:[{mbs:ne()}],mbe:[{mbe:ne()}],mt:[{mt:ne()}],mr:[{mr:ne()}],mb:[{mb:ne()}],ml:[{ml:ne()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:A()}],"inline-size":[{inline:[`auto`,...j()]}],"min-inline-size":[{"min-inline":[`auto`,...j()]}],"max-inline-size":[{"max-inline":[`none`,...j()]}],"block-size":[{block:[`auto`,...M()]}],"min-block-size":[{"min-block":[`auto`,...M()]}],"max-block-size":[{"max-block":[`none`,...M()]}],w:[{w:[s,`screen`,...A()]}],"min-w":[{"min-w":[s,`screen`,`none`,...A()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...A()]}],h:[{h:[`screen`,`lh`,...A()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...A()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...A()]}],"font-size":[{text:[`base`,n,ql,Bl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,$l,Hl]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Al,J]}],"font-family":[{font:[Jl,Ul,t]}],"font-features":[{"font-features":[J]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,Y,J]}],"line-clamp":[{"line-clamp":[q,`none`,Y,Vl]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,Y,J]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Y,J]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ce(),`wavy`]}],"text-decoration-thickness":[{decoration:[q,`from-font`,`auto`,Y,Bl]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[q,`auto`,Y,J]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[kl,Y,J]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Y,J]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Y,J]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},kl,Y,J],radial:[``,Y,J],conic:[``,kl,Y,J]},Zl,Gl]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":se()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ce(),`hidden`,`none`]}],"divide-style":[{divide:[...ce(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...ce(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[q,Y,J]}],"outline-w":[{outline:[``,q,ql,Bl]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`inner`,`none`,u,Ql,Kl]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,Ql,Kl]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:se()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[q,Bl]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,Ql,Kl]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[q,Y,J]}],"mix-blend":[{"mix-blend":[...le(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":le()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[q]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[q]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:de()}],brightness:[{brightness:[q,Y,J]}],contrast:[{contrast:[q,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Ql,Kl]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,q,Y,J]}],"hue-rotate":[{"hue-rotate":[q,Y,J]}],invert:[{invert:[``,q,Y,J]}],saturate:[{saturate:[q,Y,J]}],sepia:[{sepia:[``,q,Y,J]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Y,J]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[q,Y,J]}],"backdrop-contrast":[{"backdrop-contrast":[q,Y,J]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,q,Y,J]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[q,Y,J]}],"backdrop-invert":[{"backdrop-invert":[``,q,Y,J]}],"backdrop-opacity":[{"backdrop-opacity":[q,Y,J]}],"backdrop-saturate":[{"backdrop-saturate":[q,Y,J]}],"backdrop-sepia":[{"backdrop-sepia":[``,q,Y,J]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Y,J]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[q,`initial`,Y,J]}],ease:[{ease:[`linear`,`initial`,_,Y,J]}],delay:[{delay:[q,Y,J]}],animate:[{animate:[`none`,v,Y,J]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,Y,J]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":[`scale-3d`],skew:[{skew:me()}],"skew-x":[{"skew-x":me()}],"skew-y":[{"skew-y":me()}],transform:[{transform:[Y,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":[`translate-none`],zoom:[{zoom:[kl,Y,J]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Y,J]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Y,J]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[q,ql,Bl,Vl]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),uu=(...e)=>lu(Ic(e)),du=zc(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`}},defaultVariants:{variant:`default`,size:`default`}}),fu=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,x.jsx)(r?Sc:`button`,{className:uu(du({variant:t,size:n,className:e})),ref:a,...i}));fu.displayName=`Button`;var pu=`Copying to the clipboard is not available in this browser context.`,mu=e=>{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.top=`0`,t.style.left=`0`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length);let n=document.execCommand(`copy`);return t.remove(),n},hu=async e=>{let t=navigator.clipboard;if(t!==void 0&&typeof t.writeText==`function`)try{await t.writeText(e);return}catch{if(mu(e))return;throw Error(pu)}if(!mu(e))throw Error(pu)},gu=1500,_u=`Copy failed`,vu=`Copying to the clipboard failed`,yu=({value:e,idleText:t,idleAriaLabel:n,copiedAriaLabel:r,className:i})=>{let[a,o]=(0,y.useState)(`idle`),s=(0,y.useRef)(null);return(0,y.useEffect)(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]),(0,x.jsx)(fu,{type:`button`,variant:`ghost`,size:`sm`,className:i,"aria-label":a===`copied`?r:a===`failed`?vu:n,onClick:async()=>{try{await hu(e),o(`copied`)}catch(e){console.error(e),o(`failed`)}s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{o(`idle`),s.current=null},gu)},children:a===`copied`?`Copied`:a===`failed`?_u:t})},bu=({code:e,label:t=`Copy code`})=>(0,x.jsx)(yu,{value:e,idleText:t,idleAriaLabel:t,copiedAriaLabel:`Code copied to clipboard`,className:`console-copy-code-button`}),xu=`https://cdn.jsdelivr.net/npm/mermaid@10.9.6/dist/mermaid.min.js`,Su=null,Cu=0,wu=e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`dark`,themeVariables:{background:`#0d1117`,primaryColor:`#161b22`,primaryTextColor:`#e6edf3`,primaryBorderColor:`#30363d`,lineColor:`#8b949e`,fontSize:`14px`}}),e),Tu=()=>Su===null?window.mermaid===void 0?(Su=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=xu,n.async=!0,n.onload=()=>{if(window.mermaid===void 0){t(Error(`mermaid failed to load`));return}e(wu(window.mermaid))},n.onerror=()=>t(Error(`mermaid script failed to load`)),document.head.appendChild(n)}),Su):(Su=Promise.resolve(wu(window.mermaid)),Su):Su,Eu=async e=>{let t=await Tu();Cu+=1;let n=`console-mermaid-${Cu}`,{svg:r}=await t.render(n,e);return oo.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`foreignObject`]})},Du=.5,Ou=e=>Number.isNaN(e)||e<1?1:e>6?6:e,ku=e=>Ou(Ou(e)+Du),Au=e=>Ou(Ou(e)-Du),ju=e=>Ou(e)<=1,Mu=e=>Ou(e)>=6,Nu=e=>`${Math.round(Ou(e)*100)}%`,Pu=e=>`${Ou(e)*100}%`,Fu=({svg:e,onClose:t})=>{let[n,r]=(0,y.useState)(1),i=(0,y.useRef)(null);return(0,y.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,y.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[t]),(0,x.jsxs)(`div`,{className:`console-mermaid-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":`Enlarged diagram`,children:[(0,x.jsxs)(`div`,{className:`console-mermaid-modal-bar`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-button`,"aria-label":`Zoom out`,disabled:ju(n),onClick:()=>r(Au(n)),children:`−`}),(0,x.jsx)(`span`,{className:`console-mermaid-modal-scale`,children:Nu(n)}),(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-button`,"aria-label":`Zoom in`,disabled:Mu(n),onClick:()=>r(ku(n)),children:`+`}),(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-close`,"aria-label":`Close enlarged diagram`,onClick:t,children:`✕`})]}),(0,x.jsx)(`div`,{className:`console-mermaid-modal-viewport`,children:(0,x.jsx)(`div`,{ref:i,className:`console-mermaid-modal-canvas`,style:{width:Pu(n)}})})]})},Iu=({code:e})=>{let[t,n]=(0,y.useState)({status:`loading`}),[r,i]=(0,y.useState)(!1),a=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let t=!1;return n({status:`loading`}),Eu(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,y.useEffect)(()=>{let e=a.current;e!==null&&(e.innerHTML=t.status===`ready`?t.svg:``)},[t]),t.status===`loading`?(0,x.jsx)(`div`,{className:`console-mermaid-loading`,children:`Rendering diagram...`}):t.status===`error`?(0,x.jsxs)(`div`,{className:`console-mermaid`,children:[(0,x.jsxs)(`div`,{className:`console-mermaid-error`,children:[`Mermaid render error: `,t.message]}),(0,x.jsx)(`pre`,{className:`console-mermaid-source`,children:(0,x.jsx)(`code`,{children:e})})]}):(0,x.jsxs)(`div`,{className:`console-mermaid`,children:[(0,x.jsx)(`div`,{ref:a,className:`console-mermaid-rendered`}),(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-enlarge`,onClick:()=>i(!0),children:`Enlarge diagram`}),r&&(0,x.jsx)(Fu,{svg:t.svg,onClose:()=>i(!1)})]})},Lu=e=>{let t=e.querySelectorAll(`a[href]`),n=[];return t.forEach((e,t)=>{let r=e.getAttribute(`href`)??``;if(ki(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},Ru=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},zu=({source:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useMemo)(()=>{let n=lc(e,r);return t===void 0?n:Fi(n,t)},[e,t,r]),a=(0,y.useRef)(null),[o,s]=(0,y.useState)([]),[c,l]=(0,y.useState)([]);return(0,y.useEffect)(()=>{let e=a.current;e!==null&&(e.innerHTML=i,l(Ru(e)),s(n===void 0?[]:Lu(e)))},[i,n]),(0,x.jsxs)(`div`,{ref:a,className:`console-markdown`,children:[c.map(e=>(0,ee.createPortal)((0,x.jsx)(bu,{code:e.code}),e.host,e.key)),n!==void 0&&o.map(e=>(0,ee.createPortal)(n(e.href,e.fallbackText),e.host,e.key))]})},Bu=({body:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useMemo)(()=>pc(e),[e]);return e.trim()===``?(0,x.jsx)(`p`,{className:`console-markdown-empty`,children:`No description provided.`}):(0,x.jsx)(`div`,{className:`console-markdown-view`,children:i.map(e=>e.kind===`mermaid`?(0,x.jsx)(Iu,{code:e.code},e.key):(0,x.jsx)(zu,{source:e.source,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r},e.key))})},Vu=({title:e,count:t=null,defaultCollapsed:n=!1,headerAction:r,children:i})=>{let[a,o]=(0,y.useState)(n),s=t===null?e:`${e} (${t})`;return(0,x.jsxs)(`section`,{className:`console-panel`,children:[(0,x.jsxs)(`header`,{className:`console-panel-header`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-panel-toggle`,"aria-expanded":!a,onClick:()=>o(e=>!e),children:[(0,x.jsx)(`span`,{className:`console-panel-caret`,children:a?`▸`:`▾`}),(0,x.jsx)(`span`,{className:`console-panel-title`,children:s})]}),r!==void 0&&(0,x.jsx)(`div`,{className:`console-panel-action`,children:r})]}),!a&&(0,x.jsx)(`div`,{className:`console-panel-body`,children:i})]})},Hu=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`}}},Uu=()=>({directories:new Map,files:[]}),Wu=e=>e.split(`/`).filter(e=>e!==``),Gu=(e,t)=>e.name.localeCompare(t.name),Ku=(e,t)=>{let n=[];e.directories.forEach((e,r)=>{let i=t===``?r:`${t}/${r}`;n.push({kind:`directory`,name:r,path:i,children:Ku(e,i)})}),n.sort(Gu);let r=e.files.map(e=>({kind:`file`,name:Wu(e.path).at(-1)??e.path,path:e.path,file:e}));return r.sort(Gu),[...n,...r]},qu=e=>{let t=Uu();for(let n of e){let e=Wu(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=Uu();i.directories.set(e,t),i=t;continue}i=t}i.files.push(n)}return Ku(t,``)},Ju=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,Yu=e=>{let t=[],n=0,r=0;for(let i of e.split(`
|
|
87
87
|
`)){if(i.startsWith(`@@`)){let e=i.match(Ju);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},Xu=[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.svg`,`.avif`,`.bmp`,`.ico`],Z=e=>{let t=e.toLowerCase();return Xu.some(e=>t.endsWith(e))},Q=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,Zu=e=>`${e.kind}:${e.oldLineNumber??`x`}:${e.newLineNumber??`x`}:${e.content}`,Qu=({target:e,onSubmit:t,onClose:n})=>{let[r,i]=(0,y.useState)(``),[a,o]=(0,y.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,x.jsxs)(`div`,{className:`console-diff-composer`,children:[(0,x.jsxs)(`div`,{className:`console-diff-composer-anchor`,children:[`commenting on line `,e.line,` (`,e.side,`)`]}),a.kind===`posted`?(0,x.jsx)(`p`,{className:`console-diff-composer-posted`,children:`Comment saved.`}):(0,x.jsxs)(x.Fragment,{children:[(0,x.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,x.jsxs)(`div`,{className:`console-diff-composer-controls`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-diff-composer-submit`,disabled:a.kind===`posting`,onClick:()=>{s()},children:`Comment`}),(0,x.jsx)(`button`,{type:`button`,className:`console-diff-composer-cancel`,onClick:n,children:`Cancel`}),a.kind===`posting`&&(0,x.jsx)(`span`,{className:`console-diff-composer-status`,children:`Posting…`}),a.kind===`error`&&(0,x.jsxs)(`span`,{role:`alert`,className:`console-diff-composer-status console-diff-composer-error`,children:[`Failed: `,a.message]})]})]})]})},$u=({patch:e,path:t,rawUrl:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,y.useState)(null);if(e===null||e===``){if(t!==void 0&&n!=null){if(n.startsWith(`data:image/`))return(0,x.jsx)(`div`,{className:`console-file-diff-image`,children:(0,x.jsx)(`img`,{className:`console-file-diff-image-content`,src:n,alt:t})});if(Z(t)&&r!==void 0)return(0,x.jsx)(`div`,{className:`console-file-diff-image`,children:(0,x.jsx)(`img`,{className:`console-file-diff-image-content`,src:r(n),alt:t})})}return(0,x.jsx)(`p`,{className:`console-file-diff-empty`,children:`(no diff / binary or too large)`})}let s=Yu(e),c=i!==void 0&&t!==void 0&&t.length>0,l=c?4:3;return(0,x.jsx)(`table`,{className:`console-file-diff`,children:(0,x.jsx)(`tbody`,{children:s.map(e=>{let n=Zu(e),r=c?Q(e):null,s=a!==null&&r!==null&&a.line===r.line&&a.side===r.side;return(0,x.jsxs)(y.Fragment,{children:[(0,x.jsxs)(`tr`,{className:`console-diff-row console-diff-${e.kind}`,children:[c&&(0,x.jsx)(`td`,{className:`console-diff-comment-cell`,children:r!==null&&t!==void 0&&(0,x.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,x.jsx)(`td`,{className:`console-diff-ln`,children:e.oldLineNumber??``}),(0,x.jsx)(`td`,{className:`console-diff-ln`,children:e.newLineNumber??``}),(0,x.jsx)(`td`,{className:`console-diff-code`,children:e.content})]}),s&&i!==void 0&&a!==null&&(0,x.jsx)(`tr`,{className:`console-diff-composer-row`,children:(0,x.jsx)(`td`,{colSpan:l,children:(0,x.jsx)(Qu,{target:a,onSubmit:i,onClose:()=>o(null)})})})]},n)})})})},ed=e=>({paddingLeft:`${e*16}px`}),td=({file:e,depth:t,name:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,y.useState)(!1),s=Hu(e.status);return(0,x.jsxs)(`li`,{className:`console-file`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-file-row`,style:ed(t),"aria-expanded":a,onClick:()=>o(e=>!e),children:[(0,x.jsx)(`span`,{className:`console-file-caret`,children:a?`▾`:`▸`}),(0,x.jsx)(`span`,{className:`console-file-badge`,style:{color:s.color,borderColor:s.color},children:s.label}),(0,x.jsx)(`span`,{className:`console-file-path`,children:n}),(0,x.jsxs)(`span`,{className:`console-file-stat console-file-add`,children:[`+`,e.additions]}),(0,x.jsxs)(`span`,{className:`console-file-stat console-file-del`,children:[`-`,e.deletions]})]}),a&&(0,x.jsx)($u,{patch:e.patch,path:e.path,rawUrl:e.rawUrl,buildImageProxyUrl:r,onAddInlineComment:i})]})},nd=({node:e,depth:t,buildImageProxyUrl:n,onAddInlineComment:r})=>e.kind===`file`?(0,x.jsx)(td,{file:e.file,depth:t,name:e.name,buildImageProxyUrl:n,onAddInlineComment:r}):(0,x.jsxs)(`li`,{className:`console-file-tree-dir`,children:[(0,x.jsxs)(`div`,{className:`console-file-tree-dir-name`,style:ed(t),children:[(0,x.jsx)(`span`,{className:`console-file-tree-dir-icon`,"aria-hidden":`true`,children:`📁`}),e.name]}),(0,x.jsx)(`ul`,{className:`console-file-tree-children`,children:e.children.map(e=>(0,x.jsx)(nd,{node:e,depth:t+1,buildImageProxyUrl:n,onAddInlineComment:r},e.path))})]}),rd=({files:e,isLoading:t,error:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{if(n!==null)return(0,x.jsx)(`p`,{className:`console-files-notloaded`,children:`Not loaded.`});if(t)return(0,x.jsx)(`p`,{className:`console-files-loading`,children:`Loading changed files...`});if(e.length===0)return(0,x.jsx)(`p`,{className:`console-files-empty`,children:`No changed files.`});let a=qu(e);return(0,x.jsx)(`ul`,{className:`console-files console-file-tree`,children:a.map(e=>(0,x.jsx)(nd,{node:e,depth:0,buildImageProxyUrl:r,onAddInlineComment:i},e.path))})},id=e=>e.split(`
|
|
88
88
|
`).find(e=>e.trim()!==``)??``,ad=e=>`${e.author}:${e.createdAt}:${e.body}`,od=({comment:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useRef)(null);return(0,y.useEffect)(()=>{let e=i.current;if(!e)return;let t=e=>e.stopPropagation();return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[]),(0,x.jsx)(`div`,{ref:i,className:`console-comment-body-expanded`,children:(0,x.jsx)(Bu,{body:e.body,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})})},sd=({comments:e,isLoading:t,error:n,now:r,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o,persistenceKey:s=null,onRequestWorkflowIssueCreate:c})=>{let[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(()=>s==null?new Set:kn(s)),p=e.length>0?ad(e[e.length-1]):null;(0,y.useEffect)(()=>{p!==null&&f(e=>new Set([...e,p]))},[p]),(0,y.useEffect)(()=>{s!=null&&An(s,d)},[s,d]);let m=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};if(n!==null)return(0,x.jsx)(`p`,{className:`console-comment-notloaded`,children:`Not loaded.`});if(t)return(0,x.jsx)(`p`,{className:`console-comment-loading`,children:`Loading comments...`});if(e.length===0)return(0,x.jsx)(`p`,{className:`console-comment-empty`,children:`No comments.`});let h=!l&&e.length>1;return(0,x.jsxs)(`div`,{className:`console-comment-list`,children:[h&&(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-show-all`,onClick:()=>{u(!0),f(t=>new Set([...t,...e.map(ad)]))},children:[`Show all `,e.length]}),e.map(e=>{let t=ad(e),n=d.has(t);return(0,x.jsxs)(`article`,{className:`console-comment${n?` is-expanded`:h?` console-comment--expandable`:``}`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-toggle`,onClick:()=>m(t),"aria-expanded":n,children:[(0,x.jsx)(`span`,{className:`console-comment-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-comment-time`,children:k(e.createdAt,r)}),!n&&(0,x.jsx)(`span`,{className:`console-comment-body-preview`,children:id(e.body)})]}),c!==void 0&&(0,x.jsx)(`button`,{type:`button`,className:`console-comment-create-workflow-issue`,onClick:t=>{t.stopPropagation(),c(e)},title:`Create workflow improvement issue from this comment`,children:`+`}),n&&(0,x.jsx)(od,{comment:e,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})]},t)})]})},cd=e=>e.slice(0,7),ld=e=>e.split(`
|
|
89
|
-
`)[0],ud=({commits:e,isLoading:t,error:n,now:r})=>n===null?t?(0,x.jsx)(`p`,{className:`console-commits-loading`,children:`Loading commits...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-commits-empty`,children:`No commits.`}):(0,x.jsx)(`ul`,{className:`console-commits`,children:e.map(e=>(0,x.jsxs)(`li`,{className:`console-commit`,children:[(0,x.jsx)(`span`,{className:`console-commit-message`,children:ld(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:cd(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:k(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),dd=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(yu,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),fd=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}))},pd=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,md=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:fd(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,pd(e.sections),`:`,` `,e.message]},e.message))}),hd=({title:e,onTitleRename:t})=>{let[n,r]=(0,y.useState)(e),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(e),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(null),f=(0,y.useRef)(e);(0,y.useEffect)(()=>{let t=e!==f.current;f.current=e,!i&&t&&r(e)},[e,i]);let p=()=>{s(n),d(null),a(!0)},m=()=>{a(!1),d(null)},h=async()=>{let e=o.trim();if(e===``||e===n){a(!1);return}l(!0),d(null);try{await t(e),r(e),a(!1)}catch(e){d(e instanceof Error?e.message:`Failed to rename`)}finally{l(!1)}};return i?(0,x.jsxs)(`span`,{className:`console-detail-title-text console-detail-title-text--editing`,children:[(0,x.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?h():e.key===`Escape`&&m()},disabled:c,className:`console-detail-title-input`,"aria-label":`Edit title`}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>void h(),disabled:c,className:`console-detail-title-save`,children:`Save`}),(0,x.jsx)(`button`,{type:`button`,onClick:m,disabled:c,className:`console-detail-title-cancel`,children:`Cancel`}),u!==null&&(0,x.jsx)(`span`,{className:`console-detail-title-error`,role:`alert`,children:u})]}):(0,x.jsxs)(`span`,{className:`console-detail-title-text`,children:[n,(0,x.jsx)(`button`,{type:`button`,onClick:p,className:`console-detail-title-edit`,"aria-label":`Edit title`,children:`Edit`})]})},gd={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`}},_d=({mergeableStatus:e})=>{let t=gd[e],n=fe(t.color);return(0,x.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})},vd=e=>{let t=fe(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},yd=({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,x.jsxs)(`span`,{className:`console-detail-pr-status`,children:[(0,x.jsxs)(`span`,{className:`console-detail-status-chip console-detail-ci-chip`,style:vd(a),title:s??o,children:[o,s!==null&&(0,x.jsxs)(`span`,{className:`console-detail-ci-missing`,children:[` `,`(`,s,`)`]})]}),n&&(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-outofdate-chip`,style:vd(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},bd=({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=ki(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,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`console-pr-header`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-pr-section-title`,target:`_blank`,rel:`noopener noreferrer`,children:p?.title??e.url}),e.isDraft&&(0,x.jsx)(`span`,{className:`console-pr-section-state`,children:`draft`}),(0,x.jsx)(_d,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(yd,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),(0,x.jsx)(dd,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[m!==null&&(0,x.jsxs)(`span`,{className:`console-pr-repo`,children:[m.owner,`/`,m.repo]}),e.branchName!==null&&(0,x.jsx)(`span`,{className:`console-pr-branch`,children:e.branchName}),p!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`console-pr-add`,children:[`+`,p.additions]}),(0,x.jsxs)(`span`,{className:`console-pr-del`,children:[`-`,p.deletions]}),(0,x.jsxs)(`span`,{className:`console-pr-files-count`,children:[p.changedFiles,` files`]})]})]})]}),(0,x.jsx)(Vu,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Bu,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Vu,{title:`Changed files`,count:g,children:(0,x.jsx)(rd,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Vu,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(ud,{commits:o,isLoading:s,error:c,now:l})})]})},xd=({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:S,relatedPullRequestsError:C,now:w,commentComposer:T,operationBar:ee,buildImageProxyUrl:E,renderReferenceLink:D,onAddInlineComment:O,onTitleRename:te,onRequestWorkflowIssueCreate:ne})=>{let j=a?.state??`open`,M=a?.merged??!1,N=!e.isPr&&j===`closed`?`Closed`:null,re=Ai(e.nameWithOwner)??void 0,ie=fe(n),ae=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,P=ae===null?null:fe(ae.color),oe=p||m!==null?null:f.length,se=u||d!==null?null:l.length,ce=g||_!==null?null:h.length,le=!u&&d===null&&l.length>0,ue=e=>{let t=ki(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},...S.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}]),pe=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:[];return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-header`,children:[(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[(0,x.jsx)(Oe,{isPr:e.isPr,state:j,merged:M,isDraft:!1,stateReason:``}),te==null?(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}):(0,x.jsx)(hd,{title:e.title,onTitleRename:te}),(0,x.jsx)(`span`,{className:`console-detail-number`,children:e.isPr?`PR #${e.number}`:`#${e.number}`})]}),(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[ae!==null&&P!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:P.fg,borderColor:P.border,backgroundColor:P.bg},children:ae.name}),e.agent!==null&&e.agent!==``&&(0,x.jsx)(`span`,{className:`console-detail-agent-chip`,children:e.agent}),t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:ie.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(yd,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),!e.isPr&&S.map(e=>(0,x.jsxs)(`span`,{className:`console-related-pr-group`,children:[S.length>1&&(0,x.jsx)(`span`,{className:`console-related-pr-label`,children:ue(e.pullRequest.url)}),(0,x.jsx)(yd,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)(_d,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),pe.map(e=>(0,x.jsx)(_d,{mergeableStatus:e.mergeableStatus},e.url)),N!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:N})]}),(0,x.jsx)(md,{failures:de}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsxs)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:[`#`,e.number]}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsxs)(`span`,{className:`console-detail-createdat`,title:A(e.createdAt),children:[`opened `,k(e.createdAt,w)]}),(0,x.jsx)(dd,{url:e.url}),e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))]})]}),(0,x.jsxs)(`div`,{className:`console-detail-body`,children:[(0,x.jsx)(Vu,{title:`Description`,defaultCollapsed:le,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:c===null?s?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(Bu,{body:o,buildImageProxyUrl:E,renderReferenceLink:D,repoContext:re}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},le?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(Vu,{title:`Changed files`,count:oe,children:(0,x.jsx)(rd,{files:f,isLoading:p,error:m,onAddInlineComment:O})}),(0,x.jsx)(Vu,{title:`Comments`,count:se,children:(0,x.jsx)(sd,{comments:l,isLoading:u,error:d,now:w,buildImageProxyUrl:E,renderReferenceLink:D,repoContext:re,persistenceKey:e.url,onRequestWorkflowIssueCreate:ne})}),e.isPr&&(0,x.jsx)(Vu,{title:`Commits`,count:ce,defaultCollapsed:!0,children:(0,x.jsx)(ud,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(bd,{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:E,renderReferenceLink:D,onAddInlineComment:O},e.pullRequest.url))]}),(0,x.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,x.jsx)(`div`,{className:`console-detail-dock-composer`,children:T}),(0,x.jsx)(`div`,{className:`console-actionbar`,children:ee})]})]})},Sd=({className:e,ariaLabel:t,placeholder:n,currentOption:r,options:i,onSelect:a})=>{let o=(0,y.useRef)({ready:!1,currentOptionId:r?.id??null});return(0,y.useLayoutEffect)(()=>{o.current.ready=!0,o.current.currentOptionId=r?.id??null}),(0,x.jsxs)(`select`,{className:e,defaultValue:r?.id??``,onChange:e=>{if(!o.current.ready||e.target.value===(o.current.currentOptionId??``))return;let t=i.find(t=>t.id===e.target.value);t!==void 0&&a(t)},"aria-label":t,children:[(0,x.jsx)(`option`,{value:``,children:n}),i.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})},Cd=({agentOptions:e,currentAgentName:t,onSetAgent:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(Sd,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},wd=({onClose:e,onCommentAndClose:t,isDraftEmpty:n})=>{let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(null),s=async()=>{if(!(t===void 0||r)){i(!0),o(null);try{await t()}catch(e){o(e instanceof Error?e.message:`failed to post`)}finally{i(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close_not_planned`),children:`Close as not planned`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close`),children:`Close`}),t!==void 0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,disabled:r||n===!0,onClick:()=>{s()},children:`Comment & Close`}),a!==null&&(0,x.jsx)(`span`,{role:`alert`,className:`console-op-comment-close-error`,children:a})]})]})},Td=({onDeleteAllComments:e,onDeleteStory:t,storyNameForDeletion:n})=>{let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=()=>{e(),i(!1)},f=()=>{o(!0),u(null)},p=async e=>{if(t){c(!0),u(null);try{await t(e)}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>i(e=>!e),children:`⚠`}),r&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:d,children:`Delete All Comments`}),t!=null&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:f,disabled:a,children:`Delete Story`})]}),a&&(0,x.jsxs)(`div`,{className:`console-story-delete-confirm`,role:`dialog`,"aria-modal":`true`,"aria-label":`Confirm story deletion`,children:[(0,x.jsxs)(`p`,{className:`console-story-delete-confirm-message`,children:[`Delete story option "`,n,`" from the GitHub custom field?`]}),l!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:l}),(0,x.jsxs)(`div`,{className:`console-story-delete-confirm-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(!0),disabled:s,children:s?`Deleting…`:`Delete with child tasks`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(!1),disabled:s,children:s?`Deleting…`:`Keep child tasks`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{o(!1),u(null)},disabled:s,children:`Cancel`})]})]})]})},Ed=({isManualTriage:e,onSetNextActionDate:t})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1hour`),children:`+1h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_6hours`),children:`+6h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_2days`),children:`+2d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3days`),children:`+3d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_5days`),children:`+5d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1w skip`:`+1w`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1month`),children:`+1mo`})]}),Dd=[{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`}],Od=`Reject needs an inline comment on the diff.`,kd=({onReview:e,rejectEnabled:t})=>(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-review`,children:[!t&&(0,x.jsx)(`p`,{className:`console-op-requirement`,children:Od}),Dd.map(n=>{let r=n.action===`request_changes`&&!t;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-${n.variant}`,disabled:r,onClick:()=>e(n.action),children:n.label},n.action)})]}),Ad=({onSetDependedIssueUrl:e})=>{let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null);return(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-rare-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{n(e=>!e),c(null)},title:`Rare actions`,children:`⋯`}),t&&e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`input`,{type:`url`,className:`console-settings-modal-input`,placeholder:`Depended issue URL`,value:r,onChange:e=>i(e.target.value),disabled:a}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:async()=>{if(e!==null&&r.trim()!==``){o(!0),c(null);try{await e(r.trim()),i(``),n(!1)}catch(e){c(e instanceof Error?e.message:`Failed to set depended issue URL`)}finally{o(!1)}}},disabled:a||r.trim()===``,children:a?`...`:`Set Depended Issue`})]}),s!==null&&(0,x.jsx)(`p`,{className:`console-settings-modal-error`,children:s})]})},jd=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},Md=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=Ce.map(t=>({name:t,option:jd(e,t)})).filter(e=>e.option!==null);return r.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group`,children:r.map(({name:e,option:r})=>{let i=fe(r.color),a=e===xe;return(0,x.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)})})},Nd=({storyOptions:e,currentStoryName:t,onSetStory:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(Sd,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},Pd=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l,onCommentAndClose:u,isDraftEmpty:d})=>{let[f,p]=(0,y.useState)(!1);return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(kd,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(Ed,{isManualTriage:we(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(Md,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),f&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Nd,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(Cd,{agentOptions:o,currentAgentName:s,onSetAgent:c.onSetAgent})]}),(0,x.jsxs)(`div`,{className:`console-op-group-bottom-row`,children:[(0,x.jsxs)(`div`,{className:`console-op-group-left-pair`,children:[(i.length>0||o.length>0)&&(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>p(e=>!e),title:`Change agent or story`,children:`⚙`})}),(0,x.jsx)(Ad,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(Td,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(wd,{onClose:c.onClose,onCommentAndClose:u,isDraftEmpty:d})]})]})},Fd=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,y.useState)(i??r),[s,c]=(0,y.useState)(t!==null&&i===void 0),[l,u]=(0,y.useState)(null);return(0,y.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}},Id=[],Ld=[],Rd=[],zd=[],Bd={state:`open`,merged:!1,isPullRequest:!1,title:``},Vd={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Hd=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=Fd(e.body,r,i,``),s=Fd(e.state,r,i,Bd),c=Fd(e.comments,r,i,Id),l=Fd(e.files,a?r:null,a?i:null,Ld),u=Fd(e.commits,a?r:null,a?i:null,Rd),d=Fd(e.prStatus,a?r:null,a?i:null,Vd),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=Fd(e.relatedPrs,f?r:null,f?i:null,zd),[m,h]=(0,y.useState)([]);return(0,y.useEffect)(()=>{if(a||p.data.length===0){h([]);return}let t=!1,n=p.data.map(e=>({pullRequest:e,files:Ld,filesAreLoading:!0,filesError:null,commits:Rd,commitsAreLoading:!0,commitsError:null}));h(n);let r=(e,n)=>{t||h(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of p.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,a,p.data]),{state:s.data,body:o.data,bodyIsLoading:o.isLoading,bodyError:o.error,comments:c.data,commentsAreLoading:c.isLoading,commentsError:c.error,files:l.data,filesAreLoading:l.isLoading,filesError:l.error,commits:u.data,commitsAreLoading:u.isLoading,commitsError:u.error,stateError:s.error,pullRequestStatus:a?d.data:null,pullRequestStatusError:a?d.error:null,relatedPullRequests:m,relatedPullRequestsError:a?null:p.error}},Ud=e=>JSON.stringify([e.author,e.createdAt,e.body]),Wd=(e,t)=>{let n=new Set(e.map(Ud));return[...e,...t.filter(e=>!n.has(Ud(e)))]},Gd=({href:e,fallbackText:t,state:n})=>{if(n===null||n.title.trim()===``)return(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t});let r=ki(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(Oe,{...ji(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title}),r!==null&&(0,x.jsxs)(`span`,{className:`console-markdown-reference-number`,children:[`#`,r.number]})]})},Kd=(e,t)=>{let[n,r]=(0,y.useState)(()=>e.peek(t)??null);return(0,y.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},qd=({cache:e,href:t,fallbackText:n})=>{let r=Kd(e,t);return(0,x.jsx)(Gd,{href:t,fallbackText:n,state:r})},Jd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),Yd=(e,t,n,r,i)=>({...Jd(t),apiPath:Or,requestBody:jr(e,t,n,r,i)}),Xd=(e,t,n,r)=>({...Jd(t),apiPath:kr,requestBody:Mr(e,t,n,r)}),Zd=(e,t)=>({...Jd(t),apiPath:Ar,requestBody:Nr(e,t)}),Qd=({tab:e,item:t,caches:n,operations:r,pjcode:i,statusOptions:a,storyOptions:o,agentOptions:s,storyColors:c,storyName:l,overlayStatus:u,now:d,initialCommentDraft:f,onCommentDraftChange:p,onQueueAction:m,onCommentError:h,onDeleteStory:g,storyNameForDeletion:_,onCreateWorkflowIssue:v})=>{let b=Hd(n,t,e),S=(0,y.useCallback)(e=>Pi(e,t.url),[t.url]),C=(0,y.useCallback)((e,t)=>(0,x.jsx)(qd,{cache:n.state,href:e,fallbackText:t}),[n.state]),w=t.isPr||t.relatedOpenPullRequestUrls.length>0||b.relatedPullRequests.length>0,[T,ee]=(0,y.useState)([]),E=(0,y.useCallback)(async(e,t,n,r)=>{ee(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[D,O]=(0,y.useState)([]),te=(0,y.useCallback)(async e=>{let n=await r.addComment(t,e);return O(e=>[...e,n]),n},[t,r]),[k,ne]=(0,y.useState)(null),A=(0,y.useCallback)(e=>{ne(e)},[]),j=e=>{let n=e.body.split(`
|
|
89
|
+
`)[0],ud=({commits:e,isLoading:t,error:n,now:r})=>n===null?t?(0,x.jsx)(`p`,{className:`console-commits-loading`,children:`Loading commits...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-commits-empty`,children:`No commits.`}):(0,x.jsx)(`ul`,{className:`console-commits`,children:e.map(e=>(0,x.jsxs)(`li`,{className:`console-commit`,children:[(0,x.jsx)(`span`,{className:`console-commit-message`,children:ld(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:cd(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:k(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),dd=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(yu,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),fd=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}))},pd=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,md=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:fd(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,pd(e.sections),`:`,` `,e.message]},e.message))}),hd=({title:e,onTitleRename:t})=>{let[n,r]=(0,y.useState)(e),[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(e),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(null),f=(0,y.useRef)(e);(0,y.useEffect)(()=>{let t=e!==f.current;f.current=e,!i&&t&&r(e)},[e,i]);let p=()=>{s(n),d(null),a(!0)},m=()=>{a(!1),d(null)},h=async()=>{let e=o.trim();if(e===``||e===n){a(!1);return}l(!0),d(null);try{await t(e),r(e),a(!1)}catch(e){d(e instanceof Error?e.message:`Failed to rename`)}finally{l(!1)}};return i?(0,x.jsxs)(`span`,{className:`console-detail-title-text console-detail-title-text--editing`,children:[(0,x.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`?h():e.key===`Escape`&&m()},disabled:c,className:`console-detail-title-input`,"aria-label":`Edit title`}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>void h(),disabled:c,className:`console-detail-title-save`,children:`Save`}),(0,x.jsx)(`button`,{type:`button`,onClick:m,disabled:c,className:`console-detail-title-cancel`,children:`Cancel`}),u!==null&&(0,x.jsx)(`span`,{className:`console-detail-title-error`,role:`alert`,children:u})]}):(0,x.jsxs)(`span`,{className:`console-detail-title-text`,children:[n,(0,x.jsx)(`button`,{type:`button`,onClick:p,className:`console-detail-title-edit`,"aria-label":`Edit title`,children:`Edit`})]})},gd={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`}},_d=({mergeableStatus:e})=>{let t=gd[e],n=fe(t.color);return(0,x.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})},vd=e=>{let t=fe(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},yd=({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,x.jsxs)(`span`,{className:`console-detail-pr-status`,children:[(0,x.jsxs)(`span`,{className:`console-detail-status-chip console-detail-ci-chip`,style:vd(a),title:s??o,children:[o,s!==null&&(0,x.jsxs)(`span`,{className:`console-detail-ci-missing`,children:[` `,`(`,s,`)`]})]}),n&&(0,x.jsx)(`span`,{className:`console-detail-status-chip console-detail-outofdate-chip`,style:vd(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},bd=({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=ki(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,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`console-pr-header`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-pr-section-title`,target:`_blank`,rel:`noopener noreferrer`,children:p?.title??e.url}),e.isDraft&&(0,x.jsx)(`span`,{className:`console-pr-section-state`,children:`draft`}),(0,x.jsx)(_d,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(yd,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),(0,x.jsx)(dd,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[m!==null&&(0,x.jsxs)(`span`,{className:`console-pr-repo`,children:[m.owner,`/`,m.repo]}),e.branchName!==null&&(0,x.jsx)(`span`,{className:`console-pr-branch`,children:e.branchName}),p!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`span`,{className:`console-pr-add`,children:[`+`,p.additions]}),(0,x.jsxs)(`span`,{className:`console-pr-del`,children:[`-`,p.deletions]}),(0,x.jsxs)(`span`,{className:`console-pr-files-count`,children:[p.changedFiles,` files`]})]})]})]}),(0,x.jsx)(Vu,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Bu,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Vu,{title:`Changed files`,count:g,children:(0,x.jsx)(rd,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Vu,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(ud,{commits:o,isLoading:s,error:c,now:l})})]})},xd=({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:S,relatedPullRequestsError:C,now:w,commentComposer:T,operationBar:ee,buildImageProxyUrl:E,renderReferenceLink:D,onAddInlineComment:O,onTitleRename:te,onRequestWorkflowIssueCreate:ne})=>{let j=a?.state??`open`,M=a?.merged??!1,N=!e.isPr&&j===`closed`?`Closed`:null,re=Ai(e.nameWithOwner)??void 0,ie=fe(n),ae=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,P=ae===null?null:fe(ae.color),oe=p||m!==null?null:f.length,se=u||d!==null?null:l.length,ce=g||_!==null?null:h.length,le=!u&&d===null&&l.length>0,ue=e=>{let t=ki(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},...S.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}]),pe=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:[];return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-header`,children:[(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[(0,x.jsx)(Oe,{isPr:e.isPr,state:j,merged:M,isDraft:!1,stateReason:``}),te==null?(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}):(0,x.jsx)(hd,{title:e.title,onTitleRename:te}),(0,x.jsx)(`span`,{className:`console-detail-number`,children:e.isPr?`PR #${e.number}`:`#${e.number}`})]}),(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[ae!==null&&P!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:P.fg,borderColor:P.border,backgroundColor:P.bg},children:ae.name}),e.agent!==null&&e.agent!==``&&(0,x.jsx)(`span`,{className:`console-detail-agent-chip`,children:e.agent}),t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:ie.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(yd,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),!e.isPr&&S.map(e=>(0,x.jsxs)(`span`,{className:`console-related-pr-group`,children:[S.length>1&&(0,x.jsx)(`span`,{className:`console-related-pr-label`,children:ue(e.pullRequest.url)}),(0,x.jsx)(yd,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)(_d,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),pe.map(e=>(0,x.jsx)(_d,{mergeableStatus:e.mergeableStatus},e.url)),N!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:N})]}),(0,x.jsx)(md,{failures:de}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsxs)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:[`#`,e.number]}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsxs)(`span`,{className:`console-detail-createdat`,title:A(e.createdAt),children:[`opened `,k(e.createdAt,w)]}),(0,x.jsx)(dd,{url:e.url}),e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))]})]}),(0,x.jsxs)(`div`,{className:`console-detail-body`,children:[(0,x.jsx)(Vu,{title:`Description`,defaultCollapsed:le,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:c===null?s?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(Bu,{body:o,buildImageProxyUrl:E,renderReferenceLink:D,repoContext:re}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},le?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(Vu,{title:`Changed files`,count:oe,children:(0,x.jsx)(rd,{files:f,isLoading:p,error:m,onAddInlineComment:O})}),(0,x.jsx)(Vu,{title:`Comments`,count:se,children:(0,x.jsx)(sd,{comments:l,isLoading:u,error:d,now:w,buildImageProxyUrl:E,renderReferenceLink:D,repoContext:re,persistenceKey:e.url,onRequestWorkflowIssueCreate:ne})}),e.isPr&&(0,x.jsx)(Vu,{title:`Commits`,count:ce,defaultCollapsed:!0,children:(0,x.jsx)(ud,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(bd,{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:E,renderReferenceLink:D,onAddInlineComment:O},e.pullRequest.url))]}),(0,x.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,x.jsx)(`div`,{className:`console-detail-dock-composer`,children:T}),(0,x.jsx)(`div`,{className:`console-actionbar`,children:ee})]})]})},Sd=({className:e,ariaLabel:t,placeholder:n,currentOption:r,options:i,onSelect:a})=>{let o=(0,y.useRef)({ready:!1,currentOptionId:r?.id??null});return(0,y.useLayoutEffect)(()=>{o.current.ready=!0,o.current.currentOptionId=r?.id??null}),(0,x.jsxs)(`select`,{className:e,defaultValue:r?.id??``,onChange:e=>{if(!o.current.ready||e.target.value===(o.current.currentOptionId??``))return;let t=i.find(t=>t.id===e.target.value);t!==void 0&&a(t)},"aria-label":t,children:[(0,x.jsx)(`option`,{value:``,children:n}),i.map(e=>(0,x.jsx)(`option`,{value:e.id,children:e.name},e.id))]})},Cd=({agentOptions:e,currentAgentName:t,onSetAgent:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(Sd,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},wd=({onClose:e,onCommentAndClose:t,onOkAndClose:n,isDraftEmpty:r})=>{let[i,a]=(0,y.useState)(!1),[o,s]=(0,y.useState)(null),c=async e=>{if(!(e===void 0||i)){a(!0),s(null);try{await e()}catch(e){s(e instanceof Error?e.message:`failed to post`)}finally{a(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close_not_planned`),children:`Close as not planned`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>e(`close`),children:`Close`}),n!==void 0&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,disabled:i,onClick:()=>{c(n)},children:`OK & Close`}),t!==void 0&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,disabled:i||r===!0,onClick:()=>{c(t)},children:`Comment & Close`}),o!==null&&(0,x.jsx)(`span`,{role:`alert`,className:`console-op-comment-close-error`,children:o})]})},Td=({onDeleteAllComments:e,onDeleteStory:t,storyNameForDeletion:n})=>{let[r,i]=(0,y.useState)(!1),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=()=>{e(),i(!1)},f=()=>{o(!0),u(null)},p=async e=>{if(t){c(!0),u(null);try{await t(e)}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}};return(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>i(e=>!e),children:`⚠`}),r&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:d,children:`Delete All Comments`}),t!=null&&(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:f,disabled:a,children:`Delete Story`})]}),a&&(0,x.jsxs)(`div`,{className:`console-story-delete-confirm`,role:`dialog`,"aria-modal":`true`,"aria-label":`Confirm story deletion`,children:[(0,x.jsxs)(`p`,{className:`console-story-delete-confirm-message`,children:[`Delete story option "`,n,`" from the GitHub custom field?`]}),l!==null&&(0,x.jsx)(`p`,{role:`alert`,className:`console-list-error`,children:l}),(0,x.jsxs)(`div`,{className:`console-story-delete-confirm-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(!0),disabled:s,children:s?`Deleting…`:`Delete with child tasks`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-danger`,onClick:()=>void p(!1),disabled:s,children:s?`Deleting…`:`Keep child tasks`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{o(!1),u(null)},disabled:s,children:`Cancel`})]})]})]})},Ed=({isManualTriage:e,onSetNextActionDate:t})=>(0,x.jsxs)(`div`,{className:`console-op-group`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1hour`),children:`+1h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_6hours`),children:`+6h`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_2days`),children:`+2d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3days`),children:`+3d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_5days`),children:`+5d`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1w skip`:`+1w`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1month`),children:`+1mo`})]}),Dd=[{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`}],Od=`Reject needs an inline comment on the diff.`,kd=({onReview:e,rejectEnabled:t})=>(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-review`,children:[!t&&(0,x.jsx)(`p`,{className:`console-op-requirement`,children:Od}),Dd.map(n=>{let r=n.action===`request_changes`&&!t;return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-${n.variant}`,disabled:r,onClick:()=>e(n.action),children:n.label},n.action)})]}),Ad=({onSetDependedIssueUrl:e})=>{let[t,n]=(0,y.useState)(!1),[r,i]=(0,y.useState)(``),[a,o]=(0,y.useState)(!1),[s,c]=(0,y.useState)(null);return(0,x.jsxs)(`div`,{className:`console-op-group console-op-group-rare-actions`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{n(e=>!e),c(null)},title:`Rare actions`,children:`⋯`}),t&&e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`input`,{type:`url`,className:`console-settings-modal-input`,placeholder:`Depended issue URL`,value:r,onChange:e=>i(e.target.value),disabled:a}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:async()=>{if(e!==null&&r.trim()!==``){o(!0),c(null);try{await e(r.trim()),i(``),n(!1)}catch(e){c(e instanceof Error?e.message:`Failed to set depended issue URL`)}finally{o(!1)}}},disabled:a||r.trim()===``,children:a?`...`:`Set Depended Issue`})]}),s!==null&&(0,x.jsx)(`p`,{className:`console-settings-modal-error`,children:s})]})},jd=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},Md=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=Ce.map(t=>({name:t,option:jd(e,t)})).filter(e=>e.option!==null);return r.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group`,children:r.map(({name:e,option:r})=>{let i=fe(r.color),a=e===xe;return(0,x.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)})})},Nd=({storyOptions:e,currentStoryName:t,onSetStory:n})=>{if(e.length===0)return null;let r=t===null?null:e.find(e=>e.name===t)??null;return(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(Sd,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},Pd=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l,onCommentAndClose:u,onOkAndClose:d,isDraftEmpty:f})=>{let[p,m]=(0,y.useState)(!1);return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(kd,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(Ed,{isManualTriage:we(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(Md,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),p&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(Nd,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(Cd,{agentOptions:o,currentAgentName:s,onSetAgent:c.onSetAgent})]}),(0,x.jsxs)(`div`,{className:`console-op-group-bottom-row`,children:[(0,x.jsxs)(`div`,{className:`console-op-group-left-pair`,children:[(i.length>0||o.length>0)&&(0,x.jsx)(`div`,{className:`console-op-group`,children:(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>m(e=>!e),title:`Change agent or story`,children:`⚙`})}),(0,x.jsx)(Ad,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(Td,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(wd,{onClose:c.onClose,onCommentAndClose:u,onOkAndClose:d,isDraftEmpty:f})]})]})},Fd=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,y.useState)(i??r),[s,c]=(0,y.useState)(t!==null&&i===void 0),[l,u]=(0,y.useState)(null);return(0,y.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}},Id=[],Ld=[],Rd=[],zd=[],Bd={state:`open`,merged:!1,isPullRequest:!1,title:``},Vd={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Hd=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=Fd(e.body,r,i,``),s=Fd(e.state,r,i,Bd),c=Fd(e.comments,r,i,Id),l=Fd(e.files,a?r:null,a?i:null,Ld),u=Fd(e.commits,a?r:null,a?i:null,Rd),d=Fd(e.prStatus,a?r:null,a?i:null,Vd),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=Fd(e.relatedPrs,f?r:null,f?i:null,zd),[m,h]=(0,y.useState)([]);return(0,y.useEffect)(()=>{if(a||p.data.length===0){h([]);return}let t=!1,n=p.data.map(e=>({pullRequest:e,files:Ld,filesAreLoading:!0,filesError:null,commits:Rd,commitsAreLoading:!0,commitsError:null}));h(n);let r=(e,n)=>{t||h(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of p.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,a,p.data]),{state:s.data,body:o.data,bodyIsLoading:o.isLoading,bodyError:o.error,comments:c.data,commentsAreLoading:c.isLoading,commentsError:c.error,files:l.data,filesAreLoading:l.isLoading,filesError:l.error,commits:u.data,commitsAreLoading:u.isLoading,commitsError:u.error,stateError:s.error,pullRequestStatus:a?d.data:null,pullRequestStatusError:a?d.error:null,relatedPullRequests:m,relatedPullRequestsError:a?null:p.error}},Ud=e=>JSON.stringify([e.author,e.createdAt,e.body]),Wd=(e,t)=>{let n=new Set(e.map(Ud));return[...e,...t.filter(e=>!n.has(Ud(e)))]},Gd=({href:e,fallbackText:t,state:n})=>{if(n===null||n.title.trim()===``)return(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t});let r=ki(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(Oe,{...ji(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title}),r!==null&&(0,x.jsxs)(`span`,{className:`console-markdown-reference-number`,children:[`#`,r.number]})]})},Kd=(e,t)=>{let[n,r]=(0,y.useState)(()=>e.peek(t)??null);return(0,y.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},qd=({cache:e,href:t,fallbackText:n})=>{let r=Kd(e,t);return(0,x.jsx)(Gd,{href:t,fallbackText:n,state:r})},Jd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),Yd=(e,t,n,r,i)=>({...Jd(t),apiPath:Or,requestBody:jr(e,t,n,r,i)}),Xd=(e,t,n,r)=>({...Jd(t),apiPath:kr,requestBody:Mr(e,t,n,r)}),Zd=(e,t)=>({...Jd(t),apiPath:Ar,requestBody:Nr(e,t)}),Qd=({tab:e,item:t,caches:n,operations:r,pjcode:i,statusOptions:a,storyOptions:o,agentOptions:s,storyColors:c,storyName:l,overlayStatus:u,now:d,initialCommentDraft:f,onCommentDraftChange:p,onQueueAction:m,onCommentError:h,onDeleteStory:g,storyNameForDeletion:_,onCreateWorkflowIssue:v})=>{let b=Hd(n,t,e),S=(0,y.useCallback)(e=>Pi(e,t.url),[t.url]),C=(0,y.useCallback)((e,t)=>(0,x.jsx)(qd,{cache:n.state,href:e,fallbackText:t}),[n.state]),w=t.isPr||t.relatedOpenPullRequestUrls.length>0||b.relatedPullRequests.length>0,[T,ee]=(0,y.useState)([]),E=(0,y.useCallback)(async(e,t,n,r)=>{ee(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[D,O]=(0,y.useState)([]),te=(0,y.useCallback)(async e=>{let n=await r.addComment(t,e);return O(e=>[...e,n]),n},[t,r]),[k,ne]=(0,y.useState)(null),A=(0,y.useCallback)(e=>{ne(e)},[]),j=e=>{let n=e.body.split(`
|
|
90
90
|
`).map(e=>`> ${e}`).join(`
|
|
91
|
-
`);return`${t.url}\n\n${t.title}\n\n\n\n\n\n${n}`},M=(0,y.useCallback)(async e=>{v!==void 0&&await v(e.title,e.body??``)},[v]),N={onReview:e=>{let n=t.isPr?t.url:b.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,a=e===`request_changes`?T:[];m({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,a),offline:i==null?void 0:Yd(i,t,n,e,a),overlayPatch:{done:!0}})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:Xd(i,t,e),overlayPatch:{done:!0}})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:Xd(i,t,`set_story`,{storyOptionId:e.id}),overlayPatch:{done:!0,story:{name:e.name,color:e.color}}})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:Xd(i,t,`set_agent`,{agentOptionId:e.id}),overlayPatch:{done:!0}})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:Xd(i,t,`set_status`,{statusName:e.name}),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},onSetInTmuxByHuman:e=>{m({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e),offline:i==null?void 0:Zd(i,t),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:Xd(i,t,e),overlayPatch:{done:!0}})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},onDeleteAllComments:()=>{m({kind:{type:`delete_all_comments`},item:t,commit:()=>r.deleteAllComments(t)})},onDeleteStory:g??null,onSetDependedIssueUrl:i==null?null:async e=>{await r.setDependedIssueUrl(t,e)}},re=(0,y.useCallback)(async e=>{await r.issueRename(t,e)},[t,r]),ie=a.find(e=>e.name===`Awaiting Workspace`)??null,ae=ie===null?void 0:async e=>{p?.(``),N.onSetStatus(ie);try{return await te(e)}catch(e){throw h===void 0?console.error(`Failed to post comment`,e):h(`Failed to post comment`,String(e)),e}},P=(0,y.useRef)(``),[oe,se]=(0,y.useState)((f??``).trim().length===0),ce=(0,y.useCallback)(e=>{P.current=e,se(e.trim().length===0),p?.(e)},[p]),le=async e=>{await te(e),N.onClose(`close`)},ue=async()=>{let e=P.current.trim();e.length!==0&&await le(e)},de=l??(t.story.trim()===``?null:t.story),fe=de===null?null:I(c,de);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(xd,{item:t,storyName:de,storyColorEnum:fe,overlayStatus:u,statusOptions:a,state:b.state,stateError:b.stateError,body:b.body,bodyIsLoading:b.bodyIsLoading,bodyError:b.bodyError,comments:Wd(b.comments,D),commentsAreLoading:b.commentsAreLoading,commentsError:b.commentsError,files:b.files,filesAreLoading:b.filesAreLoading,filesError:b.filesError,commits:b.commits,commitsAreLoading:b.commitsAreLoading,commitsError:b.commitsError,pullRequestStatus:b.pullRequestStatus,pullRequestStatusError:b.pullRequestStatusError,relatedPullRequests:b.relatedPullRequests,relatedPullRequestsError:b.relatedPullRequestsError,now:d,buildImageProxyUrl:S,renderReferenceLink:C,onAddInlineComment:E,onTitleRename:re,onRequestWorkflowIssueCreate:v===void 0?void 0:A,commentComposer:(0,x.jsx)(Di,{initiallyOpen:!0,initialDraft:f,onSubmit:te,onDraftChange:ce,onOkAndAwaitingWorkspace:ie===null?void 0:()=>N.onOkAndAwaitingWorkspace(ie),onSubmitAndMoveToAwaitingWorkspace:ae,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Pd,{tab:e,item:t,hasPullRequest:w,rejectEnabled:T.length>0,statusOptions:a,storyOptions:o,currentStoryName:de,agentOptions:s,currentAgentName:t.agent,handlers:N,storyNameForDeletion:_,onCommentAndClose:ue,isDraftEmpty:oe})}),k!==null&&v!==void 0&&(0,x.jsx)(me,{storyEntries:[],agentOptions:[],initialDraft:{title:``,body:j(k),storyName:null,agentOptionId:null},onSubmit:M,onClose:()=>ne(null)})]})},$d=()=>{let e={};for(let t of j)e[t.name]=0;return e},ef=`console`,tf=e=>e.replace(`https://github.com/`,``).replace(/\/issues\/new.*$/,``),nf=()=>{let e=Zr(),t=br(),n=xt(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=or(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=yi(),{pjcodes:v,projectUrls:b,fleetTaskCreateUrl:C,nameWithOwnerByPjcode:w,isLoading:ee}=Qr(),{isTimerExpired:E}=ni(e),D=Yr(e??ef),O=ti(v),te=(0,y.useMemo)(()=>Gr(D.overlay,i),[D.overlay,i]),k=(0,y.useMemo)(()=>{let e=$d();for(let t of j){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=Br(n.items,te,t.name))}return e},[i,te]),ne=Dr(e,k,(0,y.useMemo)(()=>{let e=new Set;for(let t of j){let n=i[t.name];n!==null&&!n.fromCache&&e.add(t.name)}return e},[i]),(0,y.useMemo)(()=>{let e=$d();for(let t of j){let n=i[t.name];n!==null&&(e[t.name]=t.name===`stories`?n.stories.filter(e=>e.color!==`GRAY`).length:n.items.length)}return e},[i])),{activeTab:A,selectedItemKey:M,openItem:N,closeItem:ie}=ne,ae=mi(ne.selectTab),{explicitlySelectedPjcode:P,notifyExplicitSelection:oe}=vr(e),ce=$r((0,y.useCallback)(e=>{oe(e),gi(`/projects/${e}`)},[oe]));sr(e,A,v,a,c&&r===null);let de=(0,y.useRef)(new Map),fe=(0,y.useCallback)(e=>{M!==null&&(e?de.current.set(M,e):de.current.delete(M))},[M]),pe=dr(r),F=Ir(e,pe,(0,y.useCallback)(()=>s(`queued`),[s])),I=Hn(),[he,_e]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{_e(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[ve,ye]=(0,y.useState)(!1),[be,xe]=(0,y.useState)(!1),[Se,Ce]=(0,y.useState)(``),[we,Te]=(0,y.useState)({title:``,body:null,storyName:null,agentOptionId:null}),[Ee,De]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>De(!0),t=()=>De(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[Oe,ke]=(0,y.useState)(new Map),[Ae,Ne]=(0,y.useState)(new Map),[Pe,Ie]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(Ee&&I.offlineActions.length!==0)for(let e of I.offlineActions)Oe.has(e.id)||Pe.has(e.id)||(ke(t=>new Map(t).set(e.id,null)),pe.client.fetchIssueState(e.itemUrl).then(t=>{ke(n=>new Map(n).set(e.id,t)),e.isPr&&(Ne(t=>new Map(t).set(e.id,null)),pe.client.fetchPullRequestStatus(e.itemUrl).then(t=>{Ne(n=>new Map(n).set(e.id,t))}).catch(e=>{console.warn(`Failed to fetch PR status for offline action:`,e)}))}).catch(t=>{console.warn(`Failed to fetch current state for offline action:`,t),Ie(t=>new Set(t).add(e.id))}))},[Ee,I.offlineActions,pe.client,Oe,Pe]);let[Le,Re]=(0,y.useState)(!1),ze=(0,y.useCallback)(async e=>{Re(!0);try{await I.confirmOfflineAction(e)}finally{Re(!1)}},[I]),Be=(0,y.useMemo)(()=>I.offlineActions.map(e=>{let t=Oe.get(e.id)??null,n=Ae.get(e.id)??null,r=Pe.has(e.id);return{id:e.id,message:e.message,color:e.color,itemNumber:e.itemNumber,isPr:e.isPr,currentTitle:r?null:t?.title??null,currentState:r||t===null?null:t.merged?`closed`:t.state,currentPrStatus:n,fetchError:r}}),[I.offlineActions,Oe,Ae,Pe]),R=i[A],Ve=(0,y.useMemo)(()=>R===null?[]:Vr(R.items,te,A),[R,te,A]),[He,We]=(0,y.useState)(null),Ge=(0,y.useMemo)(()=>{if(A!==`prs`)return{};let e={};for(let t of Ve)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[Ve,A]);(0,y.useEffect)(()=>{A===`prs`&&He!==null&&(Ge[He]??0)===0&&We(null)},[Ge,He,A]);let Ke=(0,y.useMemo)(()=>A!==`prs`||He===null?Ve:Ve.filter(e=>e.agent===He),[Ve,A,He]),qe=(0,y.useMemo)(()=>Ke.map(e=>Rr(e)),[Ke]),Ze=R?.storyOrder??[],Qe=(0,y.useMemo)(()=>ge(Ke,D.overlay,Ze,R?.generatedAt??null),[Ke,D.overlay,Ze,R]),$e=R?.storyColors??{},et=R?.statusOptions??[],tt=R?.agentOptions??[],nt=R?.storyOptions??[],rt=R?.generatedAt??null,it=R?.fromCache??!1,[at,z]=(0,y.useState)(null),B=(0,y.useMemo)(()=>M===null||R===null?null:R.items.find(e=>e.projectItemId===M)??null,[M,R]);_r(pe,B,Ve),(0,y.useEffect)(()=>{M!==null&&window.scrollTo({top:0})},[M]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=se(v,null,l);e!==null&&_i(`/projects/${e}/todo-by-human`)}},[e,c,v,l]),vi(c,k.prs,k[`todo-by-human`],e,v,l,i.prs!==null,i[`todo-by-human`]!==null,i.prs?.fromCache??!1,i[`todo-by-human`]?.fromCache??!1,P),hi(c,e,Ke,M,ne.openItem);let ot=k[A],st=(0,y.useRef)({tab:A,count:ot});(0,y.useEffect)(()=>{let e=st.current;if(st.current={tab:A,count:ot},e.tab===A&&e.count>0&&ot===0){let e=xr(A,k);e!==null&&(ae(e),ie())}},[A,ot,k,ae,ie]);let ct=B===null?null:Hr(D.overlay,B,i[A]?.generatedAt??null),lt=B===null?null:L(B,D.overlay,i[A]?.generatedAt??null),ut=(0,y.useCallback)(e=>{let t=bi(qe,e);t===null?ie():N(t)},[qe,N,ie]),dt=(0,y.useCallback)(t=>{if(n.status===`on`){I.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=Rr(t.item),i=t.overlayPatch;I.enqueue({message:Dn(t.kind,t.item,A),color:Tn(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,optimistic:i===void 0?void 0:()=>D.patchOverlay(r,i,A),revertOptimistic:i===void 0?void 0:()=>D.revertOverlayEntry(r),advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&En(t.kind,A)){if(c&&E(l[e??``]??15)){let t=se(v,e,l);t!==null&&gi(`/projects/${t}/todo-by-human`)}else ut(r)}}})},[I,A,ut,n.status,D,c,E,l,e,v]),ft=pi((0,y.useCallback)(e=>{if(M===null||e===null)return;let t=e===`next`?xi(qe,M):Si(qe,M);t!==null&&N(t)},[M,qe,N])),[pt,mt]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),ht=(0,y.useCallback)(()=>{mt(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),gt=i.stories,_t=gt?.stories??[],vt=at!==null&&at.generatedAt===gt?.generatedAt?at.stories:_t,yt=gt?.defaultNameWithOwner??null,bt=yt===null?null:`https://github.com/${yt}/issues/new`,St=(0,y.useMemo)(()=>B===null||!B.labels.includes(`story`)?null:vt.find(e=>e.storyName===B.story)??null,[B,vt]),Ct=(0,y.useCallback)((e,t)=>{if(C===null||B===null)return Promise.resolve();let n=tf(C);return I.enqueue({message:`Task created — "${e}"`,color:`blue`,commit:async()=>{await en({nameWithOwner:n,title:e,body:t})},advance:()=>{}}),Promise.resolve()},[C,B,I]),wt=(0,y.useCallback)(e=>{if(C===null)return Promise.resolve();let t=tf(C);return I.enqueue({message:`Task created — "${e}"`,color:`blue`,commit:async()=>{await en({nameWithOwner:t,title:e,body:``})},advance:()=>{}}),Ce(``),Promise.resolve()},[C,I]),Tt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(yt===null)throw Error(`No repository configured for this project.`);await Qt({pjcode:e,title:n,storyName:t,nameWithOwner:yt})},[e,yt]),Et=(0,y.useCallback)(({storyName:t,agentOptionId:n,title:r,body:i,files:a})=>{if(e===null||yt===null)return Promise.resolve();let o=e,s=yt;return I.enqueue({message:`Task created — "${r}"`,color:`blue`,commit:async()=>{let e=await Qt({pjcode:o,title:r,storyName:t??``,nameWithOwner:s,agentOptionId:n??null,body:i??null});if(a.length>0){let t=await Promise.all(a.map(async t=>{let n=V(new Uint8Array(await t.arrayBuffer()));return Wt({pjcode:o,url:e,fileName:t.name,contentBase64:n})})),n=await Ht({pjcode:o,url:e,body:t.join(`
|
|
91
|
+
`);return`${t.url}\n\n${t.title}\n\n\n\n\n\n${n}`},M=(0,y.useCallback)(async e=>{v!==void 0&&await v(e.title,e.body??``)},[v]),N={onReview:e=>{let n=t.isPr?t.url:b.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,a=e===`request_changes`?T:[];m({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,a),offline:i==null?void 0:Yd(i,t,n,e,a),overlayPatch:{done:!0}})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:Xd(i,t,e),overlayPatch:{done:!0}})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:Xd(i,t,`set_story`,{storyOptionId:e.id}),overlayPatch:{done:!0,story:{name:e.name,color:e.color}}})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:Xd(i,t,`set_agent`,{agentOptionId:e.id}),overlayPatch:{done:!0}})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:Xd(i,t,`set_status`,{statusName:e.name}),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},onSetInTmuxByHuman:e=>{m({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e),offline:i==null?void 0:Zd(i,t),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:Xd(i,t,e),overlayPatch:{done:!0}})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e),overlayPatch:{done:!0,status:{name:e.name,color:e.color}}})},onDeleteAllComments:()=>{m({kind:{type:`delete_all_comments`},item:t,commit:()=>r.deleteAllComments(t)})},onDeleteStory:g??null,onSetDependedIssueUrl:i==null?null:async e=>{await r.setDependedIssueUrl(t,e)}},re=(0,y.useCallback)(async e=>{await r.issueRename(t,e)},[t,r]),ie=a.find(e=>e.name===`Awaiting Workspace`)??null,ae=ie===null?void 0:async e=>{p?.(``),N.onSetStatus(ie);try{return await te(e)}catch(e){throw h===void 0?console.error(`Failed to post comment`,e):h(`Failed to post comment`,String(e)),e}},P=(0,y.useRef)(``),[oe,se]=(0,y.useState)((f??``).trim().length===0),ce=(0,y.useCallback)(e=>{P.current=e,se(e.trim().length===0),p?.(e)},[p]),le=async e=>{await te(e),N.onClose(`close`)},ue=async()=>{let e=P.current.trim();e.length!==0&&await le(e)},de=async()=>{await le(`ok`)},fe=l??(t.story.trim()===``?null:t.story),pe=fe===null?null:I(c,fe);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(xd,{item:t,storyName:fe,storyColorEnum:pe,overlayStatus:u,statusOptions:a,state:b.state,stateError:b.stateError,body:b.body,bodyIsLoading:b.bodyIsLoading,bodyError:b.bodyError,comments:Wd(b.comments,D),commentsAreLoading:b.commentsAreLoading,commentsError:b.commentsError,files:b.files,filesAreLoading:b.filesAreLoading,filesError:b.filesError,commits:b.commits,commitsAreLoading:b.commitsAreLoading,commitsError:b.commitsError,pullRequestStatus:b.pullRequestStatus,pullRequestStatusError:b.pullRequestStatusError,relatedPullRequests:b.relatedPullRequests,relatedPullRequestsError:b.relatedPullRequestsError,now:d,buildImageProxyUrl:S,renderReferenceLink:C,onAddInlineComment:E,onTitleRename:re,onRequestWorkflowIssueCreate:v===void 0?void 0:A,commentComposer:(0,x.jsx)(Di,{initiallyOpen:!0,initialDraft:f,onSubmit:te,onDraftChange:ce,onOkAndAwaitingWorkspace:ie===null?void 0:()=>N.onOkAndAwaitingWorkspace(ie),onSubmitAndMoveToAwaitingWorkspace:ae,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Pd,{tab:e,item:t,hasPullRequest:w,rejectEnabled:T.length>0,statusOptions:a,storyOptions:o,currentStoryName:fe,agentOptions:s,currentAgentName:t.agent,handlers:N,storyNameForDeletion:_,onCommentAndClose:ue,onOkAndClose:de,isDraftEmpty:oe})}),k!==null&&v!==void 0&&(0,x.jsx)(me,{storyEntries:[],agentOptions:[],initialDraft:{title:``,body:j(k),storyName:null,agentOptionId:null},onSubmit:M,onClose:()=>ne(null)})]})},$d=()=>{let e={};for(let t of j)e[t.name]=0;return e},ef=`console`,tf=e=>e.replace(`https://github.com/`,``).replace(/\/issues\/new.*$/,``),nf=()=>{let e=Zr(),t=br(),n=xt(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=or(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=yi(),{pjcodes:v,projectUrls:b,fleetTaskCreateUrl:C,nameWithOwnerByPjcode:w,isLoading:ee}=Qr(),{isTimerExpired:E}=ni(e),D=Yr(e??ef),O=ti(v),te=(0,y.useMemo)(()=>Gr(D.overlay,i),[D.overlay,i]),k=(0,y.useMemo)(()=>{let e=$d();for(let t of j){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=Br(n.items,te,t.name))}return e},[i,te]),ne=Dr(e,k,(0,y.useMemo)(()=>{let e=new Set;for(let t of j){let n=i[t.name];n!==null&&!n.fromCache&&e.add(t.name)}return e},[i]),(0,y.useMemo)(()=>{let e=$d();for(let t of j){let n=i[t.name];n!==null&&(e[t.name]=t.name===`stories`?n.stories.filter(e=>e.color!==`GRAY`).length:n.items.length)}return e},[i])),{activeTab:A,selectedItemKey:M,openItem:N,closeItem:ie}=ne,ae=mi(ne.selectTab),{explicitlySelectedPjcode:P,notifyExplicitSelection:oe}=vr(e),ce=$r((0,y.useCallback)(e=>{oe(e),gi(`/projects/${e}`)},[oe]));sr(e,A,v,a,c&&r===null);let de=(0,y.useRef)(new Map),fe=(0,y.useCallback)(e=>{M!==null&&(e?de.current.set(M,e):de.current.delete(M))},[M]),pe=dr(r),F=Ir(e,pe,(0,y.useCallback)(()=>s(`queued`),[s])),I=Hn(),[he,_e]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{_e(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[ve,ye]=(0,y.useState)(!1),[be,xe]=(0,y.useState)(!1),[Se,Ce]=(0,y.useState)(``),[we,Te]=(0,y.useState)({title:``,body:null,storyName:null,agentOptionId:null}),[Ee,De]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>De(!0),t=()=>De(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[Oe,ke]=(0,y.useState)(new Map),[Ae,Ne]=(0,y.useState)(new Map),[Pe,Ie]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(Ee&&I.offlineActions.length!==0)for(let e of I.offlineActions)Oe.has(e.id)||Pe.has(e.id)||(ke(t=>new Map(t).set(e.id,null)),pe.client.fetchIssueState(e.itemUrl).then(t=>{ke(n=>new Map(n).set(e.id,t)),e.isPr&&(Ne(t=>new Map(t).set(e.id,null)),pe.client.fetchPullRequestStatus(e.itemUrl).then(t=>{Ne(n=>new Map(n).set(e.id,t))}).catch(e=>{console.warn(`Failed to fetch PR status for offline action:`,e)}))}).catch(t=>{console.warn(`Failed to fetch current state for offline action:`,t),Ie(t=>new Set(t).add(e.id))}))},[Ee,I.offlineActions,pe.client,Oe,Pe]);let[Le,Re]=(0,y.useState)(!1),ze=(0,y.useCallback)(async e=>{Re(!0);try{await I.confirmOfflineAction(e)}finally{Re(!1)}},[I]),Be=(0,y.useMemo)(()=>I.offlineActions.map(e=>{let t=Oe.get(e.id)??null,n=Ae.get(e.id)??null,r=Pe.has(e.id);return{id:e.id,message:e.message,color:e.color,itemNumber:e.itemNumber,isPr:e.isPr,currentTitle:r?null:t?.title??null,currentState:r||t===null?null:t.merged?`closed`:t.state,currentPrStatus:n,fetchError:r}}),[I.offlineActions,Oe,Ae,Pe]),R=i[A],Ve=(0,y.useMemo)(()=>R===null?[]:Vr(R.items,te,A),[R,te,A]),[He,We]=(0,y.useState)(null),Ge=(0,y.useMemo)(()=>{if(A!==`prs`)return{};let e={};for(let t of Ve)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[Ve,A]);(0,y.useEffect)(()=>{A===`prs`&&He!==null&&(Ge[He]??0)===0&&We(null)},[Ge,He,A]);let Ke=(0,y.useMemo)(()=>A!==`prs`||He===null?Ve:Ve.filter(e=>e.agent===He),[Ve,A,He]),qe=(0,y.useMemo)(()=>Ke.map(e=>Rr(e)),[Ke]),Ze=R?.storyOrder??[],Qe=(0,y.useMemo)(()=>ge(Ke,D.overlay,Ze,R?.generatedAt??null),[Ke,D.overlay,Ze,R]),$e=R?.storyColors??{},et=R?.statusOptions??[],tt=R?.agentOptions??[],nt=R?.storyOptions??[],rt=R?.generatedAt??null,it=R?.fromCache??!1,[at,z]=(0,y.useState)(null),B=(0,y.useMemo)(()=>M===null||R===null?null:R.items.find(e=>e.projectItemId===M)??null,[M,R]);_r(pe,B,Ve),(0,y.useEffect)(()=>{M!==null&&window.scrollTo({top:0})},[M]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=se(v,null,l);e!==null&&_i(`/projects/${e}/todo-by-human`)}},[e,c,v,l]),vi(c,k.prs,k[`todo-by-human`],e,v,l,i.prs!==null,i[`todo-by-human`]!==null,i.prs?.fromCache??!1,i[`todo-by-human`]?.fromCache??!1,P),hi(c,e,Ke,M,ne.openItem);let ot=k[A],st=(0,y.useRef)({tab:A,count:ot});(0,y.useEffect)(()=>{let e=st.current;if(st.current={tab:A,count:ot},e.tab===A&&e.count>0&&ot===0){let e=xr(A,k);e!==null&&(ae(e),ie())}},[A,ot,k,ae,ie]);let ct=B===null?null:Hr(D.overlay,B,i[A]?.generatedAt??null),lt=B===null?null:L(B,D.overlay,i[A]?.generatedAt??null),ut=(0,y.useCallback)(e=>{let t=bi(qe,e);t===null?ie():N(t)},[qe,N,ie]),dt=(0,y.useCallback)(t=>{if(n.status===`on`){I.showError(`Airplane mode`,`This action requires a network connection. Turn off airplane mode and try again.`);return}let r=Rr(t.item),i=t.overlayPatch;I.enqueue({message:Dn(t.kind,t.item,A),color:Tn(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,optimistic:i===void 0?void 0:()=>D.patchOverlay(r,i,A),revertOptimistic:i===void 0?void 0:()=>D.revertOverlayEntry(r),advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&En(t.kind,A)){if(c&&E(l[e??``]??15)){let t=se(v,e,l);t!==null&&gi(`/projects/${t}/todo-by-human`)}else ut(r)}}})},[I,A,ut,n.status,D,c,E,l,e,v]),ft=pi((0,y.useCallback)(e=>{if(M===null||e===null)return;let t=e===`next`?xi(qe,M):Si(qe,M);t!==null&&N(t)},[M,qe,N])),[pt,mt]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),ht=(0,y.useCallback)(()=>{mt(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),gt=i.stories,_t=gt?.stories??[],vt=at!==null&&at.generatedAt===gt?.generatedAt?at.stories:_t,yt=gt?.defaultNameWithOwner??null,bt=yt===null?null:`https://github.com/${yt}/issues/new`,St=(0,y.useMemo)(()=>B===null||!B.labels.includes(`story`)?null:vt.find(e=>e.storyName===B.story)??null,[B,vt]),Ct=(0,y.useCallback)((e,t)=>{if(C===null||B===null)return Promise.resolve();let n=tf(C);return I.enqueue({message:`Task created — "${e}"`,color:`blue`,commit:async()=>{await en({nameWithOwner:n,title:e,body:t})},advance:()=>{}}),Promise.resolve()},[C,B,I]),wt=(0,y.useCallback)(e=>{if(C===null)return Promise.resolve();let t=tf(C);return I.enqueue({message:`Task created — "${e}"`,color:`blue`,commit:async()=>{await en({nameWithOwner:t,title:e,body:``})},advance:()=>{}}),Ce(``),Promise.resolve()},[C,I]),Tt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(yt===null)throw Error(`No repository configured for this project.`);await Qt({pjcode:e,title:n,storyName:t,nameWithOwner:yt})},[e,yt]),Et=(0,y.useCallback)(({storyName:t,agentOptionId:n,title:r,body:i,files:a})=>{if(e===null||yt===null)return Promise.resolve();let o=e,s=yt;return I.enqueue({message:`Task created — "${r}"`,color:`blue`,commit:async()=>{let e=await Qt({pjcode:o,title:r,storyName:t??``,nameWithOwner:s,agentOptionId:n??null,body:i??null});if(a.length>0){let t=await Promise.all(a.map(async t=>{let n=V(new Uint8Array(await t.arrayBuffer()));return Wt({pjcode:o,url:e,fileName:t.name,contentBase64:n})})),n=await Ht({pjcode:o,url:e,body:t.join(`
|
|
92
92
|
|
|
93
93
|
`)});if(!n.posted)throw Error(n.error)}},advance:()=>{}}),Te({title:``,body:null,storyName:null,agentOptionId:null}),Promise.resolve()},[e,yt,I]),Dt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await nn({pjcode:e,storyOptionId:t,direction:n});let r=vt.findIndex(e=>e.storyOptionId===t);if(r!==-1){let e=r+(n===`up`?-1:1);if(e>=0&&e<vt.length){let t=[...vt],n=t[r];t[r]=t[e],t[e]=n,z({generatedAt:gt?.generatedAt,stories:t})}}},[e,vt,gt?.generatedAt]),Ot=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);let n=await Kt({pjcode:e,storyName:t});if(n.length>0){let e=n.map(e=>{let t=vt.find(t=>t.storyOptionId===e.id);return{storyOptionId:e.id,storyName:e.name,color:e.color,description:t?.description??``,openItemCount:t?.openItemCount??0,storyViewUrl:t?.storyViewUrl??null,items:t?.items??[]}});z({generatedAt:gt?.generatedAt,stories:e})}},[e,vt,gt?.generatedAt]),kt=(0,y.useCallback)((e,t)=>{Te({title:t,body:null,storyName:e,agentOptionId:null}),ye(!0)},[]),[At,jt]=(0,y.useState)({}),[Mt,Nt]=(0,y.useState)(null),[Pt,Ft]=(0,y.useState)({}),It=(0,y.useCallback)((t,n)=>{let r=vt.find(e=>e.storyOptionId===t)?.color;if(Nt(t),jt(e=>({...e,[t]:n})),Ft(e=>{let n={...e};return delete n[t],n}),e===null||yt===null){jt(e=>r===void 0?e:{...e,[t]:r}),Ft(e=>({...e,[t]:`No project or repository configured.`})),Nt(e=>e===t?null:e);return}Zt({pjcode:e,storyOptionId:t,newColor:n,nameWithOwner:yt}).catch(e=>{jt(e=>r===void 0?e:{...e,[t]:r}),Ft(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}).finally(()=>{Nt(e=>e===t?null:e)})},[e,yt,vt]),Lt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await sn({pjcode:e,storyOptionId:t,deleteChildTasks:n}),z({generatedAt:gt?.generatedAt,stories:vt.filter(e=>e.storyOptionId!==t)})},[e,vt,gt?.generatedAt]),Rt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await ln({pjcode:e,storyOptionId:t,newName:n});let r=vt.map(e=>e.storyOptionId===t?{...e,storyName:n}:e);z({generatedAt:gt?.generatedAt,stories:r})},[e,vt,gt?.generatedAt]),zt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await dn({pjcode:e,storyOptionId:t,description:n});let r=vt.map(e=>e.storyOptionId===t?{...e,description:n}:e);z({generatedAt:gt?.generatedAt,stories:r})},[e,vt,gt?.generatedAt]),Bt=li(Ve,pe.comments,A===`prs`),Vt=(0,y.useCallback)((e,t)=>{dt({kind:{type:`ok_and_awaiting_workspace`},item:e,commit:()=>F.okAndMoveToAwaitingWorkspace(e,t),skipAdvance:!0,overlayPatch:{done:!0,status:{name:t.name,color:t.color}}})},[dt,F]);return(0,x.jsxs)(`main`,{className:`console-app`,children:[I.pending!==null&&(0,x.jsx)(Ye,{message:I.pending.message,color:I.pending.color,remainingSeconds:I.pending.remainingSeconds,progress:I.pending.progress,onUndo:I.undo}),I.error!==null&&(0,x.jsx)(Xe,{title:I.error.message,message:`Operation failed: ${I.error.reason}`,onDismiss:I.dismissError,onRetry:I.error.retry===void 0?void 0:()=>{I.dismissError(),I.error?.retry?.()}}),(0,x.jsx)(Je,{actions:Be,isOnline:Ee,isConfirming:Le,onConfirm:ze,onDiscard:I.discardOfflineAction}),O.isOpen&&(0,x.jsx)(S,{pjcodes:v,inputValues:O.inputValues,onChangeInput:O.changeInput,isLoading:O.isLoading,isSaving:O.isSaving,error:O.error,nameWithOwnerByPjcode:w,onSave:O.save,onClose:O.close}),(0,x.jsx)(re,{activeTab:A,counts:k,pjcode:e,pjcodes:v,generatedAt:rt,fromCache:it,tabHref:ne.tabHref,onSelectTab:ae,onSelectProject:ce,settingsButton:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(le,{isOpen:u,isTimerActive:c,timerMode:d,projectMinutes:f,pjcodes:v,isLoadingPjcodes:ee,onOpen:p,onToggleTimerMode:g,onChangeMinutes:_,onSave:h,onClose:m}),(0,x.jsx)(`button`,{type:`button`,className:`console-tab-settings-button`,"aria-label":`Open max settings`,onClick:O.open,children:`⚙`}),e!==null&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`button`,{type:`button`,className:`console-task-create-button`,disabled:yt===null||vt.length===0,onClick:()=>ye(!0),"aria-label":`Create new task`,title:`Create new task`,children:(0,x.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,x.jsx)(`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),(0,x.jsx)(`path`,{d:`M18.375 2.625a2.121 2.121 0 0 1 3 3L7 18l-4 1 1-4Z`})]})}),ve&&(0,x.jsx)(me,{storyEntries:vt,agentOptions:tt,onSubmit:Et,onClose:()=>ye(!1),initialDraft:we,onDraftChange:Te,fleetTaskCreateUrl:C,newIssueUrl:bt})]})]}),airplaneModeEnabled:t.airplaneMode,airplaneModeStatus:n.status,airplaneModeProgress:n.progress,airplaneModeCapturedAt:r?.capturedAt??null,airplaneModeFailures:n.failures,onAirplaneModeStartSync:n.startSync,onAirplaneModeTurnOff:n.turnOff,onAirplaneModeRetryFailed:n.retryFailed,projectUrl:e===null?null:b?.[e]??null,onFleetTaskCreate:C===null?null:()=>xe(!0),now:he}),be&&(0,x.jsx)(ue,{onSubmit:wt,onClose:()=>xe(!1),initialTitle:Se,onTitleChange:Ce}),(0,x.jsx)(T,{timerEndsAt:R?.timerEndsAt??null,timerTotalSeconds:R?.timerTotalSeconds??null,now:he}),A===`stories`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ue,{stories:vt,isLoading:a,error:o,showGray:pt,onCreateIssue:Tt,onAddStory:Ot,onSelectColor:It,onToggleGray:ht,onReorderStory:Dt,onDeleteStory:Lt,onRenameStory:Rt,onUpdateDescription:zt,onStoryTaskCreateEdit:kt,optimisticColors:At,colorChangeInFlight:Mt,colorErrors:Pt})}):B===null?A===`queued`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Fe,{rows:Qe,storyColors:$e,statusOptions:et,agentOptions:tt,activeItemId:null,isLoading:a,error:o,onSelectItem:e=>ne.openItem(e.projectItemId)})}):A===`prs`?(0,x.jsxs)(`div`,{className:`console-list-screen`,children:[(0,x.jsx)(Me,{agentOptions:tt,agentCounts:Ge,selectedAgent:He,onAgentChange:We}),(0,x.jsx)(je,{rows:Qe,storyColors:$e,statusOptions:et,activeItemId:null,now:he,isLoading:a,error:o,onSelectItem:e=>ne.openItem(e.projectItemId),executiveSummaries:Bt,onOkAndAwaitingWorkspace:Vt})]}):(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(je,{rows:Qe,storyColors:$e,statusOptions:et,activeItemId:null,now:he,isLoading:a,error:o,onSelectItem:e=>ne.openItem(e.projectItemId)})}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:ft,children:(0,x.jsx)(Qd,{tab:A,item:B,caches:pe,operations:F,pjcode:e,statusOptions:et,storyOptions:nt,agentOptions:tt,storyColors:$e,storyName:lt,overlayStatus:ct,now:he,initialCommentDraft:de.current.get(B.projectItemId)??``,onCommentDraftChange:fe,onQueueAction:dt,onCommentError:(e,t)=>I.showError(e,t),onDeleteStory:St===null?null:async e=>{await Lt(St.storyOptionId,e),ie()},storyNameForDeletion:St?.storyName??null,onCreateWorkflowIssue:C===null?void 0:Ct},B.projectItemId)})]})};`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.warn(`Service worker registration failed:`,e)});var rf=document.getElementById(`root`);if(rf===null)throw Error(`Root container #root not found`);(0,b.createRoot)(rf).render((0,x.jsx)(y.StrictMode,{children:(0,x.jsx)(nf,{})}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
7
|
<title>TDPM Console</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-yYPswy19.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-D9h1i3lf.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SetNoStoryIssueToStoryUseCase = void 0;
|
|
4
|
+
const RequiredProjectField_1 = require("../entities/RequiredProjectField");
|
|
4
5
|
class SetNoStoryIssueToStoryUseCase {
|
|
5
6
|
constructor(issueRepository) {
|
|
6
7
|
this.issueRepository = issueRepository;
|
|
@@ -19,15 +20,15 @@ class SetNoStoryIssueToStoryUseCase {
|
|
|
19
20
|
issue.nextActionHour === null &&
|
|
20
21
|
issue.state === 'OPEN');
|
|
21
22
|
};
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
23
|
+
const noStoryOption = story.stories.find((s) => s.name === RequiredProjectField_1.NO_STORY_STORY_NAME);
|
|
24
|
+
if (!noStoryOption) {
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
27
|
for (const issue of input.issues) {
|
|
27
28
|
if (!isTargetIssue(issue)) {
|
|
28
29
|
continue;
|
|
29
30
|
}
|
|
30
|
-
await this.issueRepository.updateStory({ ...input.project, story }, issue,
|
|
31
|
+
await this.issueRepository.updateStory({ ...input.project, story }, issue, noStoryOption.id);
|
|
31
32
|
await new Promise((resolve) => setTimeout(resolve, 5000));
|
|
32
33
|
}
|
|
33
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetNoStoryIssueToStoryUseCase.js","sourceRoot":"","sources":["../../../src/domain/usecases/SetNoStoryIssueToStoryUseCase.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"SetNoStoryIssueToStoryUseCase.js","sourceRoot":"","sources":["../../../src/domain/usecases/SetNoStoryIssueToStoryUseCase.ts"],"names":[],"mappings":";;;AAGA,2EAAuE;AAEvE,MAAa,6BAA6B;IACxC,YAAqB,eAAqD;QAArD,oBAAe,GAAf,eAAe,CAAsC;QAE1E,QAAG,GAAG,KAAK,EAAE,KAKZ,EAAiB,EAAE;YAClB,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAClC,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,OAAO;YACT,CAAC;YACD,MAAM,kBAAkB,GAAgB,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;YACrE,MAAM,aAAa,GAAG,CAAC,KAAY,EAAW,EAAE;gBAC9C,OAAO,CACL,KAAK,CAAC,KAAK,KAAK,IAAI;oBACpB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAC3B,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CACzC;oBACD,CAAC,KAAK,CAAC,cAAc,KAAK,IAAI;wBAC5B,CAAC,kBAAkB,KAAK,IAAI;4BAC1B,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,kBAAkB,CAAC,OAAO,EAAE,CAAC,CAAC;oBACpE,KAAK,CAAC,cAAc,KAAK,IAAI;oBAC7B,KAAK,CAAC,KAAK,KAAK,MAAM,CACvB,CAAC;YACJ,CAAC,CAAC;YACF,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CACtC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,0CAAmB,CACtC,CAAC;YACF,IAAI,CAAC,aAAa,EAAE,CAAC;gBACnB,OAAO;YACT,CAAC;YACD,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gBACjC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC1B,SAAS;gBACX,CAAC;gBACD,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CACpC,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,EAC3B,KAAK,EACL,aAAa,CAAC,EAAE,CACjB,CAAC;gBACF,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC,CAAC;IA3C2E,CAAC;CA4C/E;AA7CD,sEA6CC"}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SetNoStoryIssueToStoryUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/SetNoStoryIssueToStoryUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"SetNoStoryIssueToStoryUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/SetNoStoryIssueToStoryUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,qBAAa,6BAA6B;IAC5B,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC;gBAArD,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC;IAE1E,GAAG,GAAU,OAAO;QAClB,WAAW,EAAE,IAAI,EAAE,CAAC;QACpB,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,KAAK,EAAE,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;KACpB,KAAG,OAAO,CAAC,IAAI,CAAC,CAoCf;CACH"}
|