github-issue-tower-defence-management 2.105.0 → 2.106.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.
@@ -86,6 +86,6 @@ 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(Ys(e)){r.push(e),a=!0;continue}r.push(e)}return i!==null&&r.push("```mermaid",...i),s(),n},Qs=Object.defineProperty,$s=(e,t)=>Qs(e,`name`,{value:t,configurable:!0});function ec(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}$s(ec,`setRef`);function tc(...e){return t=>{let n=!1,r=e.map(e=>{let r=ec(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():ec(e[t],null)}}}}$s(tc,`composeRefs`);function nc(...e){return y.useCallback(tc(...e),e)}$s(nc,`useComposedRefs`);var rc=Object.defineProperty,ic=(e,t)=>rc(e,`name`,{value:t,configurable:!0});function ac(e){let t=y.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];mc(r)&&typeof vc==`function`&&(r=vc(r._payload)),y.Children.forEach(r,e=>{if(fc(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;mc(n)&&typeof vc==`function`&&(n=vc(n._payload)),a=lc(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=nc(n,c);if(!a){if(r||r===0)throw Error(o?_c(e):gc(e));return r}let u=uc(i,a.props??{});return a.type!==y.Fragment&&(u.ref=n?l:c),y.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}ic(ac,`createSlot`);var oc=ac(`Slot`),sc=Symbol.for(`radix.slottable`);function cc(e){let t=ic(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=sc,t}ic(cc,`createSlottable`);var lc=ic((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 uc(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}}ic(uc,`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)}ic(dc,`getElementRef`);function fc(e){return y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===sc}ic(fc,`isSlottable`);var pc=Symbol.for(`react.lazy`);function mc(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===pc&&`_payload`in e&&hc(e._payload)}ic(mc,`isLazyComponent`);function hc(e){return typeof e==`object`&&!!e&&`then`in e}ic(hc,`isPromiseLike`);var gc=ic(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),_c=ic(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),vc=y.use;function yc(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=yc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function bc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=yc(e))&&(r&&(r+=` `),r+=t);return r}var xc=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Sc=bc,Cc=(e,t)=>n=>{if(t?.variants==null)return Sc(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=xc(t)||xc(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 Sc(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)},wc=(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},Tc=(e,t)=>({classGroupId:e,validator:t}),Ec=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Dc=`-`,Oc=[],kc=`arbitrary..`,Ac=e=>{let t=Nc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Mc(e);let n=e.split(Dc);return jc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?wc(i,t):t:i||Oc}return n[e]||Oc}}},jc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=jc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Dc):e.slice(t).join(Dc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Mc=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?kc+r:void 0})(),Nc=e=>{let{theme:t,classGroups:n}=e;return Pc(n,t)},Pc=(e,t)=>{let n=Ec();for(let r in e){let i=e[r];Fc(i,n,r,t)}return n},Fc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ic(i,t,n,r)}},Ic=(e,t,n,r)=>{if(typeof e==`string`){Lc(e,t,n);return}if(typeof e==`function`){Rc(e,t,n,r);return}zc(e,t,n,r)},Lc=(e,t,n)=>{let r=e===``?t:Bc(t,e);r.classGroupId=n},Rc=(e,t,n,r)=>{if(Vc(e)){Fc(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Tc(n,e))},zc=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Fc(o,Bc(t,a),n,r)}},Bc=(e,t)=>{let n=e,r=t.split(Dc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ec(),n.nextPart.set(t,i)),n=i}return n},Vc=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Hc=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)}}},Uc=`!`,Wc=`:`,Gc=[],Kc=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),qc=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===Wc){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(Uc)?(c=s.slice(0,-1),l=!0):s.startsWith(Uc)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Kc(t,l,c,u)};if(t){let e=t+Wc,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Kc(Gc,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Jc=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}},Yc=e=>({cache:Hc(e.cacheSize),parseClassName:qc(e),sortModifiers:Jc(e),postfixLookupClassGroupIds:Xc(e),...Ac(e)}),Xc=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},Zc=/\s+/,Qc=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Zc),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?_+Uc:_,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},$c=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=el(n))&&(i&&(i+=` `),i+=r);return i},el=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=el(e[r]))&&(n&&(n+=` `),n+=t);return n},tl=(e,...t)=>{let n,r,i,a,o=o=>(n=Yc(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=Qc(e,n);return i(e,a),a};return a=o,(...e)=>a($c(...e))},nl=[],K=e=>{let t=t=>t[e]||nl;return t.isThemeGetter=!0,t},rl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,il=/^\((?:(\w[\w-]*):)?(.+)\)$/i,al=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ol=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sl=/\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$/,cl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ll=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ul=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dl=e=>al.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),fl=e=>!!e&&Number.isInteger(Number(e)),pl=e=>e.endsWith(`%`)&&q(e.slice(0,-1)),ml=e=>ol.test(e),hl=()=>!0,gl=e=>sl.test(e)&&!cl.test(e),_l=()=>!1,vl=e=>ll.test(e),yl=e=>ul.test(e),bl=e=>!J(e)&&!Y(e),xl=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)),Sl=e=>Z(e,Rl,_l),J=e=>rl.test(e),Cl=e=>Z(e,zl,gl),wl=e=>Z(e,Bl,q),Tl=e=>Z(e,Hl,hl),El=e=>Z(e,Vl,_l),Dl=e=>Z(e,Il,_l),Ol=e=>Z(e,Ll,yl),kl=e=>Z(e,Ul,vl),Y=e=>il.test(e),Al=e=>Q(e,zl),jl=e=>Q(e,Vl),Ml=e=>Q(e,Il),Nl=e=>Q(e,Rl),Pl=e=>Q(e,Ll),X=e=>Q(e,Ul,!0),Fl=e=>Q(e,Hl,!0),Z=(e,t,n)=>{let r=rl.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Q=(e,t,n=!1)=>{let r=il.exec(e);return r?r[1]?t(r[1]):n:!1},Il=e=>e===`position`||e===`percentage`,Ll=e=>e===`image`||e===`url`,Rl=e=>e===`length`||e===`size`||e===`bg-size`,zl=e=>e===`length`,Bl=e=>e===`number`,Vl=e=>e===`family-name`,Hl=e=>e===`number`||e===`weight`,Ul=e=>e===`shadow`,Wl=tl(()=>{let e=K(`color`),t=K(`font`),n=K(`text`),r=K(`font-weight`),i=K(`tracking`),a=K(`leading`),o=K(`breakpoint`),s=K(`container`),c=K(`spacing`),l=K(`radius`),u=K(`shadow`),d=K(`inset-shadow`),f=K(`text-shadow`),p=K(`drop-shadow`),m=K(`blur`),h=K(`perspective`),g=K(`aspect`),_=K(`ease`),v=K(`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=()=>[dl,`full`,`auto`,...w()],ee=()=>[fl,`none`,`subgrid`,Y,J],te=()=>[`auto`,{span:[`full`,fl,Y,J]},fl,Y,J],E=()=>[fl,`auto`,Y,J],D=()=>[`auto`,`min`,`max`,`fr`,Y,J],O=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ne=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],k=()=>[`auto`,...w()],A=()=>[dl,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],re=()=>[dl,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ie=()=>[dl,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[e,Y,J],M=()=>[...b(),Ml,Dl,{position:[Y,J]}],ae=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],N=()=>[`auto`,`cover`,`contain`,Nl,Sl,{size:[Y,J]}],oe=()=>[pl,Al,Cl],se=()=>[``,`none`,`full`,l,Y,J],P=()=>[``,q,Al,Cl],F=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],le=()=>[q,pl,Ml,Dl],I=()=>[``,`none`,m,Y,J],ue=()=>[`none`,q,Y,J],de=()=>[`none`,q,Y,J],L=()=>[q,Y,J],fe=()=>[dl,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ml],breakpoint:[ml],color:[hl],container:[ml],"drop-shadow":[ml],ease:[`in`,`out`,`in-out`],font:[bl],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ml],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ml],shadow:[ml],spacing:[`px`,q],text:[ml],"text-shadow":[ml],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,dl,J,Y,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Y,J]}],"container-named":[xl],columns:[{columns:[q,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:[fl,`auto`,Y,J]}],basis:[{basis:[dl,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[q,dl,`auto`,`initial`,`none`,J]}],grow:[{grow:[``,q,Y,J]}],shrink:[{shrink:[``,q,Y,J]}],order:[{order:[fl,`first`,`last`,`none`,Y,J]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...O(),`normal`]}],"justify-items":[{"justify-items":[...ne(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ne()]}],"align-content":[{content:[`normal`,...O()]}],"align-items":[{items:[...ne(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ne(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...ne(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ne()]}],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:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mbs:[{mbs:k()}],mbe:[{mbe:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"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`,...re()]}],"min-inline-size":[{"min-inline":[`auto`,...re()]}],"max-inline-size":[{"max-inline":[`none`,...re()]}],"block-size":[{block:[`auto`,...ie()]}],"min-block-size":[{"min-block":[`auto`,...ie()]}],"max-block-size":[{"max-block":[`none`,...ie()]}],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`,...A()]}],"font-size":[{text:[`base`,n,Al,Cl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Fl,Tl]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,pl,J]}],"font-family":[{font:[jl,El,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,wl]}],leading:[{leading:[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:j()}],"text-color":[{text:j()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...F(),`wavy`]}],"text-decoration-thickness":[{decoration:[q,`from-font`,`auto`,Y,Cl]}],"text-decoration-color":[{decoration:j()}],"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:[fl,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:M()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:N()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},fl,Y,J],radial:[``,Y,J],conic:[fl,Y,J]},Pl,Ol]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-bs":[{"border-bs":P()}],"border-w-be":[{"border-be":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":P()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...F(),`hidden`,`none`]}],"divide-style":[{divide:[...F(),`hidden`,`none`]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...F(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[q,Y,J]}],"outline-w":[{outline:[``,q,Al,Cl]}],"outline-color":[{outline:j()}],shadow:[{shadow:[``,`none`,u,X,kl]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":[`none`,d,X,kl]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:P()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[q,Cl]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":[`none`,f,X,kl]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[q,Y,J]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"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":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[Y,J]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"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":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Y,J]}],filter:[{filter:[``,`none`,Y,J]}],blur:[{blur:I()}],brightness:[{brightness:[q,Y,J]}],contrast:[{contrast:[q,Y,J]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,X,kl]}],"drop-shadow-color":[{"drop-shadow":j()}],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":I()}],"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:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":[`scale-3d`],skew:[{skew:L()}],"skew-x":[{"skew-x":L()}],"skew-y":[{"skew-y":L()}],transform:[{transform:[Y,J,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:fe()}],"translate-x":[{"translate-x":fe()}],"translate-y":[{"translate-y":fe()}],"translate-z":[{"translate-z":fe()}],"translate-none":[`translate-none`],zoom:[{zoom:[fl,Y,J]}],accent:[{accent:j()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:j()}],"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":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"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`,...j()]}],"stroke-w":[{stroke:[q,Al,Cl,wl]}],stroke:[{stroke:[`none`,...j()]}],"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":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`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-r`,`border-w-l`],"border-w-y":[`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-r`,`border-color-l`],"border-color-y":[`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-mr`,`scroll-ml`],"scroll-my":[`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-pr`,`scroll-pl`],"scroll-py":[`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`]}}),Gl=(...e)=>Wl(bc(e)),Kl=Cc(`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`}}),ql=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,x.jsx)(r?oc:`button`,{className:Gl(Kl({variant:t,size:n,className:e})),ref:a,...i}));ql.displayName=`Button`;var Jl=`Copying to the clipboard is not available in this browser context.`,Yl=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},Xl=async e=>{let t=navigator.clipboard;if(t!==void 0&&typeof t.writeText==`function`)try{await t.writeText(e);return}catch{if(Yl(e))return;throw Error(Jl)}if(!Yl(e))throw Error(Jl)},Zl=1500,Ql=`Copy failed`,$l=`Copying to the clipboard failed`,eu=({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)(ql,{type:`button`,variant:`ghost`,size:`sm`,className:i,"aria-label":a===`copied`?r:a===`failed`?$l:n,onClick:async()=>{try{await Xl(e),o(`copied`)}catch(e){console.error(e),o(`failed`)}s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{o(`idle`),s.current=null},Zl)},children:a===`copied`?`Copied`:a===`failed`?Ql:t})},tu=({code:e,label:t=`Copy code`})=>(0,x.jsx)(eu,{value:e,idleText:t,idleAriaLabel:t,copiedAriaLabel:`Code copied to clipboard`,className:`console-copy-code-button`}),nu=`https://cdn.jsdelivr.net/npm/mermaid@10.9.6/dist/mermaid.min.js`,ru=null,iu=0,au=e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`dark`,themeVariables:{background:`#0d1117`,primaryColor:`#161b22`,primaryTextColor:`#e6edf3`,primaryBorderColor:`#30363d`,lineColor:`#8b949e`,fontSize:`14px`}}),e),ou=()=>ru===null?window.mermaid===void 0?(ru=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=nu,n.async=!0,n.onload=()=>{if(window.mermaid===void 0){t(Error(`mermaid failed to load`));return}e(au(window.mermaid))},n.onerror=()=>t(Error(`mermaid script failed to load`)),document.head.appendChild(n)}),ru):(ru=Promise.resolve(au(window.mermaid)),ru):ru,su=async e=>{let t=await ou();iu+=1;let n=`console-mermaid-${iu}`,{svg:r}=await t.render(n,e);return Xa.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`foreignObject`]})},cu=.5,lu=e=>Number.isNaN(e)||e<1?1:e>6?6:e,uu=e=>lu(lu(e)+cu),du=e=>lu(lu(e)-cu),fu=e=>lu(e)<=1,pu=e=>lu(e)>=6,mu=e=>`${Math.round(lu(e)*100)}%`,hu=e=>`${lu(e)*100}%`,gu=({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:fu(n),onClick:()=>r(du(n)),children:`−`}),(0,x.jsx)(`span`,{className:`console-mermaid-modal-scale`,children:mu(n)}),(0,x.jsx)(`button`,{type:`button`,className:`console-mermaid-modal-button`,"aria-label":`Zoom in`,disabled:pu(n),onClick:()=>r(uu(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:hu(n)}})})]})},_u=({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`}),su(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)(gu,{svg:t.svg,onClose:()=>i(!1)})]})},vu=e=>{let t=e.querySelectorAll(`a[href]`),n=[];return t.forEach((e,t)=>{let r=e.getAttribute(`href`)??``;if(vi(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},yu=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},bu=({source:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useMemo)(()=>{let n=qs(e,r);return t===void 0?n:Ti(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(yu(e)),s(n===void 0?[]:vu(e)))},[i,n]),(0,x.jsxs)(`div`,{ref:a,className:`console-markdown`,children:[c.map(e=>(0,ee.createPortal)((0,x.jsx)(tu,{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))]})},xu=({body:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,y.useMemo)(()=>Zs(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)(_u,{code:e.code},e.key):(0,x.jsx)(bu,{source:e.source,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r},e.key))})},Su=({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})]})},Cu=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`}}},wu=()=>({directories:new Map,files:[]}),Tu=e=>e.split(`/`).filter(e=>e!==``),Eu=(e,t)=>e.name.localeCompare(t.name),Du=(e,t)=>{let n=[];e.directories.forEach((e,r)=>{let i=t===``?r:`${t}/${r}`;n.push({kind:`directory`,name:r,path:i,children:Du(e,i)})}),n.sort(Eu);let r=e.files.map(e=>({kind:`file`,name:Tu(e.path).at(-1)??e.path,path:e.path,file:e}));return r.sort(Eu),[...n,...r]},Ou=e=>{let t=wu();for(let n of e){let e=Tu(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=wu();i.directories.set(e,t),i=t;continue}i=t}i.files.push(n)}return Du(t,``)},ku=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,Au=e=>{let t=[],n=0,r=0;for(let i of e.split(`
87
87
  `)){if(i.startsWith(`@@`)){let e=i.match(ku);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},ju=[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.svg`,`.avif`,`.bmp`,`.ico`],Mu=e=>{let t=e.toLowerCase();return ju.some(e=>t.endsWith(e))},Nu=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,Pu=e=>`${e.kind}:${e.oldLineNumber??`x`}:${e.newLineNumber??`x`}:${e.content}`,Fu=({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]})]})]})]})},Iu=({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(Mu(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=Au(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=Pu(e),r=c?Nu(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)(Fu,{target:a,onSubmit:i,onClose:()=>o(null)})})})]},n)})})})},Lu=e=>({paddingLeft:`${e*16}px`}),Ru=({file:e,depth:t,name:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,y.useState)(!1),s=Cu(e.status);return(0,x.jsxs)(`li`,{className:`console-file`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-file-row`,style:Lu(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)(Iu,{patch:e.patch,path:e.path,rawUrl:e.rawUrl,buildImageProxyUrl:r,onAddInlineComment:i})]})},zu=({node:e,depth:t,buildImageProxyUrl:n,onAddInlineComment:r})=>e.kind===`file`?(0,x.jsx)(Ru,{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:Lu(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)(zu,{node:e,depth:t+1,buildImageProxyUrl:n,onAddInlineComment:r},e.path))})]}),Bu=({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=Ou(e);return(0,x.jsx)(`ul`,{className:`console-files console-file-tree`,children:a.map(e=>(0,x.jsx)(zu,{node:e,depth:0,buildImageProxyUrl:r,onAddInlineComment:i},e.path))})},Vu=e=>e.split(`
88
88
  `).find(e=>e.trim()!==``)??``,Hu=e=>`${e.author}:${e.createdAt}:${e.body}`,Uu=({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)(xu,{body:e.body,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})})},Wu=({comments:e,isLoading:t,error:n,now:r,workflowImprovementIssueUrl:i=null,buildImageProxyUrl:a,renderReferenceLink:o,repoContext:s,persistenceKey:c=null})=>{let[l,u]=(0,y.useState)(!1),[d,f]=(0,y.useState)(()=>c==null?new Set:Dr(c)),p=e.length>0?Hu(e[e.length-1]):null;(0,y.useEffect)(()=>{p!==null&&f(e=>new Set([...e,p]))},[p]),(0,y.useEffect)(()=>{c!=null&&Or(c,d)},[c,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(Hu)]))},children:[`Show all `,e.length]}),e.map(e=>{let t=Hu(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:ne(e.createdAt,r)}),!n&&(0,x.jsx)(`span`,{className:`console-comment-body-preview`,children:Vu(e.body)})]}),i!==null&&e.url!==null&&(0,x.jsx)(`a`,{href:xi(i,e.url),target:`_blank`,rel:`noreferrer`,className:`console-comment-report-link`,"aria-label":`Create workflow incident report for this comment`,children:`⚡`}),n&&(0,x.jsx)(Uu,{comment:e,buildImageProxyUrl:a,renderReferenceLink:o,repoContext:s})]},t)})]})},Gu=e=>e.slice(0,7),Ku=e=>e.split(`
89
- `)[0],qu=({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:Ku(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:Gu(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:ne(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),Ju=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(eu,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),Yu=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}))},Xu=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,Zu=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:Yu(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,Xu(e.sections),`:`,` `,e.message]},e.message))}),Qu={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`}},$u=({mergeableStatus:e})=>{let t=Qu[e],n=N(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})},ed=e=>{let t=N(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},td=({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:ed(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:ed(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},nd=({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=vi(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)($u,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(td,{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)(Ju,{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)(Su,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(xu,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Su,{title:`Changed files`,count:g,children:(0,x.jsx)(Bu,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Su,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(qu,{commits:o,isLoading:s,error:c,now:l})})]})},rd=({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:te,renderReferenceLink:E,onAddInlineComment:D,workflowImprovementIssueUrl:O=null})=>{let k=a?.state??`open`,re=a?.merged??!1,ie=!e.isPr&&k===`closed`?`Closed`:null,j=yi(e.nameWithOwner)??void 0,M=N(n),ae=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,oe=ae===null?null:N(ae.color),se=p||m!==null?null:f.length,P=u||d!==null?null:l.length,F=g||_!==null?null:h.length,ce=!u&&d===null&&l.length>0,le=e=>{let t=vi(e);return t===null?e:`PR #${t.number}`},I=[{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 ${le(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${le(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),ue=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)(Ce,{isPr:e.isPr,state:k,merged:re,isDraft:!1,stateReason:``}),(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}),(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&&oe!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:oe.fg,borderColor:oe.border,backgroundColor:oe.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:M.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(td,{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:le(e.pullRequest.url)}),(0,x.jsx)(td,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)($u,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),ue.map(e=>(0,x.jsx)($u,{mergeableStatus:e.mergeableStatus},e.url)),ie!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:ie})]}),(0,x.jsx)(Zu,{failures:I}),(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 `,ne(e.createdAt,w)]}),(0,x.jsx)(Ju,{url:e.url}),O!==null&&(0,x.jsx)(`a`,{href:xi(O,e.url),target:`_blank`,rel:`noreferrer`,className:`console-detail-report-link`,"aria-label":`Create workflow incident report for this task`,children:`⚡`}),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)(Su,{title:`Description`,defaultCollapsed:ce,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)(xu,{body:o,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:j}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},ce?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(Su,{title:`Changed files`,count:se,children:(0,x.jsx)(Bu,{files:f,isLoading:p,error:m,onAddInlineComment:D})}),(0,x.jsx)(Su,{title:`Comments`,count:P,children:(0,x.jsx)(Wu,{comments:l,isLoading:u,error:d,now:w,workflowImprovementIssueUrl:O,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:j,persistenceKey:e.url})}),e.isPr&&(0,x.jsx)(Su,{title:`Commits`,count:F,defaultCollapsed:!0,children:(0,x.jsx)(qu,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(nd,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:D},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})]})]})},id=({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))]})},ad=({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)(id,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},od=({onClose:e})=>(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`})]}),sd=({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()=>{if(t){c(!0),u(null);try{await t()}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? Open tasks assigned to this story will be closed.`]}),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(),disabled:s,children:s?`Deleting…`:`Delete`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{o(!1),u(null)},disabled:s,children:`Cancel`})]})]})]})},cd=({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:`+1 hour`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_6hours`),children:`+6 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1 day`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_2days`),children:`+2 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3days`),children:`+3 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_5days`),children:`+5 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1 week and skip`:`+1 week`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1month`),children:`+1 month`})]}),ld=[{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`}],ud=`Reject needs an inline comment on the diff.`,dd=({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:ud}),ld.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)})]}),fd=({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})]})},pd=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},md=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=ve.map(t=>({name:t,option:pd(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=N(r.color),a=e===ge;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)})})},hd=({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)(id,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},gd=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l})=>{let[u,d]=(0,y.useState)(!1);return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(dd,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(cd,{isManualTriage:ye(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(md,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),u&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(hd,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(ad,{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:()=>d(e=>!e),title:`Change agent or story`,children:`⚙`})}),(0,x.jsx)(fd,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(sd,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(od,{onClose:c.onClose})]})]})},_d=(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}},vd=[],$=[],yd=[],bd=[],xd={state:`open`,merged:!1,isPullRequest:!1,title:``},Sd={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Cd=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=_d(e.body,r,i,``),s=_d(e.state,r,i,xd),c=_d(e.comments,r,i,vd),l=_d(e.files,a?r:null,a?i:null,$),u=_d(e.commits,a?r:null,a?i:null,yd),d=_d(e.prStatus,a?r:null,a?i:null,Sd),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=_d(e.relatedPrs,f?r:null,f?i:null,bd),[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:$,filesAreLoading:!0,filesError:null,commits:yd,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}},wd=e=>JSON.stringify([e.author,e.createdAt,e.body]),Td=(e,t)=>{let n=new Set(e.map(wd));return[...e,...t.filter(e=>!n.has(wd(e)))]},Ed=({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=vi(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(Ce,{...bi(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]})]})},Dd=(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},Od=({cache:e,href:t,fallbackText:n})=>{let r=Dd(e,t);return(0,x.jsx)(Ed,{href:t,fallbackText:n,state:r})},kd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),Ad=(e,t,n,r,i)=>({...kd(t),apiPath:ur,requestBody:pr(e,t,n,r,i)}),jd=(e,t,n,r)=>({...kd(t),apiPath:dr,requestBody:mr(e,t,n,r)}),Md=(e,t)=>({...kd(t),apiPath:fr,requestBody:hr(e,t)}),Nd=({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,onDeleteStory:h,storyNameForDeletion:g,workflowImprovementIssueUrl:_})=>{let v=Cd(n,t,e),b=(0,y.useCallback)(e=>wi(e,t.url),[t.url]),S=(0,y.useCallback)((e,t)=>(0,x.jsx)(Od,{cache:n.state,href:e,fallbackText:t}),[n.state]),C=t.isPr||t.relatedOpenPullRequestUrls.length>0||v.relatedPullRequests.length>0,[w,T]=(0,y.useState)([]),ee=(0,y.useCallback)(async(e,t,n,r)=>{T(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[te,E]=(0,y.useState)([]),D=(0,y.useCallback)(async e=>{let n=await r.addComment(t,e);return E(e=>[...e,n]),n},[t,r]),O={onReview:e=>{let n=t.isPr?t.url:v.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,a=e===`request_changes`?w:[];m({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,a),offline:i==null?void 0:Ad(i,t,n,e,a)})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:jd(i,t,e)})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:jd(i,t,`set_story`,{storyOptionId:e.id})})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:jd(i,t,`set_agent`,{agentOptionId:e.id})})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:jd(i,t,`set_status`,{statusName:e.name})})},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:Md(i,t)})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:jd(i,t,e)})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e)})},onDeleteAllComments:()=>{m({kind:{type:`delete_all_comments`},item:t,commit:()=>r.deleteAllComments(t)})},onDeleteStory:h??null,onSetDependedIssueUrl:i==null?null:async e=>{await r.setDependedIssueUrl(t,e)}},ne=a.find(e=>e.name===`Awaiting Workspace`)??null,k=ne===null?void 0:async e=>(p?.(``),O.onSetStatus(ne),D(e)),A=l??(t.story.trim()===``?null:t.story),re=A===null?null:I(c,A);return(0,x.jsx)(rd,{item:t,storyName:A,storyColorEnum:re,overlayStatus:u,statusOptions:a,state:v.state,stateError:v.stateError,body:v.body,bodyIsLoading:v.bodyIsLoading,bodyError:v.bodyError,comments:Td(v.comments,te),commentsAreLoading:v.commentsAreLoading,commentsError:v.commentsError,files:v.files,filesAreLoading:v.filesAreLoading,filesError:v.filesError,commits:v.commits,commitsAreLoading:v.commitsAreLoading,commitsError:v.commitsError,pullRequestStatus:v.pullRequestStatus,pullRequestStatusError:v.pullRequestStatusError,relatedPullRequests:v.relatedPullRequests,relatedPullRequestsError:v.relatedPullRequestsError,now:d,buildImageProxyUrl:b,renderReferenceLink:S,onAddInlineComment:ee,workflowImprovementIssueUrl:_,commentComposer:(0,x.jsx)(gi,{initiallyOpen:!0,initialDraft:f,onSubmit:D,onDraftChange:p,onOkAndAwaitingWorkspace:ne===null?void 0:()=>O.onOkAndAwaitingWorkspace(ne),onSubmitAndMoveToAwaitingWorkspace:k,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(gd,{tab:e,item:t,hasPullRequest:C,rejectEnabled:w.length>0,statusOptions:a,storyOptions:o,currentStoryName:A,agentOptions:s,currentAgentName:t.agent,handlers:O,storyNameForDeletion:g})})},Pd=()=>{let e={};for(let t of re)e[t.name]=0;return e},Fd=`console`,Id=()=>{let e=wr(),t=Jn(),n=_t(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=oi(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=ci(),{pjcodes:v,projectUrls:b,workflowImprovementIssueUrl:C,fleetTaskCreateUrl:w,isLoading:ee}=Tr(),{isTimerExpired:te}=Nr(e),E=Sr(e??Fd),D=Mr(v),O=(0,y.useMemo)(()=>{let e=Pd();for(let t of re){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=ar(n.items,sr(E.overlay,n.generatedAt),t.name))}return e},[i,E.overlay]);In(c,O.prs,e,v,l);let ne=tr(e,O),{activeTab:k,selectedItemKey:A,openItem:ie,closeItem:j}=ne,ae=si(ne.selectTab),N=Ar((0,y.useCallback)(e=>kn(`/projects/${e}`),[])),oe=(0,y.useRef)(new Map),se=(0,y.useCallback)(e=>{A!==null&&(e?oe.current.set(A,e):oe.current.delete(A))},[A]),F=Bn(r),le=vr(e,k,E,F,(0,y.useCallback)(()=>s(`queued`),[s])),I=On(),[de,fe]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{fe(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[pe,me]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>me(!0),t=()=>me(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[he,ge]=(0,y.useState)(new Map),[_e,ve]=(0,y.useState)(new Map),[ye,be]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(!(!pe||I.offlineActions.length===0))for(let e of I.offlineActions)he.has(e.id)||ye.has(e.id)||(ge(t=>new Map(t).set(e.id,null)),F.client.fetchIssueState(e.itemUrl).then(t=>{ge(n=>new Map(n).set(e.id,t)),e.isPr&&(ve(t=>new Map(t).set(e.id,null)),F.client.fetchPullRequestStatus(e.itemUrl).then(t=>{ve(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),be(t=>new Set(t).add(e.id))}))},[pe,I.offlineActions,F.client,he,ye]);let[xe,Se]=(0,y.useState)(!1),Ce=(0,y.useCallback)(async e=>{Se(!0);try{await I.confirmOfflineAction(e)}finally{Se(!1)}},[I]),we=(0,y.useMemo)(()=>I.offlineActions.map(e=>{let t=he.get(e.id)??null,n=_e.get(e.id)??null,r=ye.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,he,_e,ye]),Te=i[k],Oe=(0,y.useMemo)(()=>Te===null?[]:or(Te.items,sr(E.overlay,Te.generatedAt),k),[Te,E.overlay,k]),[ke,je]=(0,y.useState)(null),Me=(0,y.useMemo)(()=>{if(k!==`prs`)return{};let e={};for(let t of Oe)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[Oe,k]);(0,y.useEffect)(()=>{k===`prs`&&ke!==null&&(Me[ke]??0)===0&&je(null)},[Me,ke,k]);let Ne=(0,y.useMemo)(()=>k!==`prs`||ke===null?Oe:Oe.filter(e=>e.agent===ke),[Oe,k,ke]),Pe=(0,y.useMemo)(()=>Ne.map(e=>rr(e)),[Ne]),Fe=Te?.storyOrder??[],Ie=(0,y.useMemo)(()=>L(Ne,E.overlay,Fe,Te?.generatedAt??null),[Ne,E.overlay,Fe,Te]),Le=Te?.storyColors??{},Re=Te?.statusOptions??[],Be=Te?.agentOptions??[],Ve=Te?.storyOptions??[],He=Te?.generatedAt??null,Ue=Te?.fromCache??!1,[qe,Je]=(0,y.useState)(null),Ye=(0,y.useMemo)(()=>A===null||Te===null?null:Te.items.find(e=>e.projectItemId===A)??null,[A,Te]);Kn(F,Ye,Oe),(0,y.useEffect)(()=>{A!==null&&window.scrollTo({top:0})},[A]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=Fn(v,null,l);e!==null&&An(`/projects/${e}`)}},[e,c,v,l]);let Xe=O[k],Ze=(0,y.useRef)({tab:k,count:Xe});(0,y.useEffect)(()=>{let e=Ze.current;if(Ze.current={tab:k,count:Xe},e.tab===k&&e.count>0&&Xe===0){let e=Yn(k,O);e!==null&&(ae(e),j())}},[k,Xe,O,ae,j]);let Qe=Ye===null?null:cr(E.overlay,Ye,i[k]?.generatedAt??null),$e=Ye===null?null:ue(Ye,E.overlay,i[k]?.generatedAt??null),et=(0,y.useCallback)(e=>{let t=li(Pe,e);t===null?j():ie(t)},[Pe,ie,j]),tt=(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.enqueue({message:_n(t.kind,t.item,k),color:hn(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&gn(t.kind,k)){if(c&&te(l[e??``]??0)){let t=Fn(v,e,l);t!==null&&kn(`/projects/${t}`)}else et(r)}}})},[I,k,et,n.status,c,te,l,e,v]),nt=Wr((0,y.useCallback)(e=>{if(A===null||e===null)return;let t=e===`next`?ui(Pe,A):di(Pe,A);t!==null&&ie(t)},[A,Pe,ie])),[rt,it]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),at=(0,y.useCallback)(()=>{it(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),ot=i.stories,st=ot?.stories??[],R=qe!==null&&qe.generatedAt===ot?.generatedAt?qe.stories:st,ct=ot?.defaultNameWithOwner??null,lt=(0,y.useMemo)(()=>Ye===null||!Ye.labels.includes(`story`)?null:R.find(e=>e.storyName===Ye.story)??null,[Ye,R]),ut=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(ct===null)throw Error(`No repository configured for this project.`);await qt({pjcode:e,title:n,storyName:t,nameWithOwner:ct})},[e,ct]),dt=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);if(ct===null)throw Error(`No repository configured for this project.`);let n=await qt({pjcode:e,title:t.title,storyName:t.storyName,agentOptionId:t.agentOptionId,body:t.body,nameWithOwner:ct});if(t.files.length>0){let r=[];for(let i of t.files){let t=Rt(new Uint8Array(await i.arrayBuffer())),a=await zt({pjcode:e,url:n,fileName:i.name,contentBase64:t});r.push(a)}await It({pjcode:e,url:n,body:r.join(`
89
+ `)[0],qu=({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:Ku(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:Gu(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:ne(e.authoredAt,r)})]},e.sha))}):(0,x.jsx)(`p`,{className:`console-commits-notloaded`,children:`Not loaded.`}),Ju=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(eu,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),Yu=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}))},Xu=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`,Zu=({failures:e})=>e.length===0?null:(0,x.jsx)(`div`,{role:`alert`,className:`console-detail-fetch-error`,children:Yu(e).map(e=>(0,x.jsxs)(`p`,{className:`console-detail-fetch-error-line`,children:[`Failed to load `,Xu(e.sections),`:`,` `,e.message]},e.message))}),Qu={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`}},$u=({mergeableStatus:e})=>{let t=Qu[e],n=N(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})},ed=e=>{let t=N(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},td=({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:ed(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:ed(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},nd=({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=vi(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)($u,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(td,{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)(Ju,{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)(Su,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(xu,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Su,{title:`Changed files`,count:g,children:(0,x.jsx)(Bu,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Su,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(qu,{commits:o,isLoading:s,error:c,now:l})})]})},rd=({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:te,renderReferenceLink:E,onAddInlineComment:D,workflowImprovementIssueUrl:O=null})=>{let k=a?.state??`open`,re=a?.merged??!1,ie=!e.isPr&&k===`closed`?`Closed`:null,j=yi(e.nameWithOwner)??void 0,M=N(n),ae=r===null?e.status===null?null:{name:e.status,color:i.find(t=>t.name===e.status)?.color??`GRAY`}:r,oe=ae===null?null:N(ae.color),se=p||m!==null?null:f.length,P=u||d!==null?null:l.length,F=g||_!==null?null:h.length,ce=!u&&d===null&&l.length>0,le=e=>{let t=vi(e);return t===null?e:`PR #${t.number}`},I=[{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 ${le(e.pullRequest.url)}`,message:e.filesError},{section:`commits of ${le(e.pullRequest.url)}`,message:e.commitsError}])].flatMap(e=>e.message===null?[]:[{section:e.section,message:e.message}]),ue=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)(Ce,{isPr:e.isPr,state:k,merged:re,isDraft:!1,stateReason:``}),(0,x.jsx)(`span`,{className:`console-detail-title-text`,children:e.title}),(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&&oe!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:oe.fg,borderColor:oe.border,backgroundColor:oe.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:M.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(td,{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:le(e.pullRequest.url)}),(0,x.jsx)(td,{isPassedAllCiJob:e.pullRequest.isPassedAllCiJob,isCiStateSuccess:e.pullRequest.isCiStateSuccess,isBranchOutOfDate:e.pullRequest.isBranchOutOfDate,missingRequiredCheckNames:e.pullRequest.missingRequiredCheckNames}),(0,x.jsx)($u,{mergeableStatus:e.pullRequest.mergeableStatus})]},e.pullRequest.url)),ue.map(e=>(0,x.jsx)($u,{mergeableStatus:e.mergeableStatus},e.url)),ie!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:ie})]}),(0,x.jsx)(Zu,{failures:I}),(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 `,ne(e.createdAt,w)]}),(0,x.jsx)(Ju,{url:e.url}),O!==null&&(0,x.jsx)(`a`,{href:xi(O,e.url),target:`_blank`,rel:`noreferrer`,className:`console-detail-report-link`,"aria-label":`Create workflow incident report for this task`,children:`⚡`}),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)(Su,{title:`Description`,defaultCollapsed:ce,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)(xu,{body:o,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:j}):(0,x.jsx)(`p`,{className:`console-detail-body-notloaded`,children:`Not loaded.`})},ce?`desc-collapsed`:`desc-open`),e.isPr&&(0,x.jsx)(Su,{title:`Changed files`,count:se,children:(0,x.jsx)(Bu,{files:f,isLoading:p,error:m,onAddInlineComment:D})}),(0,x.jsx)(Su,{title:`Comments`,count:P,children:(0,x.jsx)(Wu,{comments:l,isLoading:u,error:d,now:w,workflowImprovementIssueUrl:O,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:j,persistenceKey:e.url})}),e.isPr&&(0,x.jsx)(Su,{title:`Commits`,count:F,defaultCollapsed:!0,children:(0,x.jsx)(qu,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&S.map(e=>(0,x.jsx)(nd,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:D},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})]})]})},id=({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))]})},ad=({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)(id,{className:`console-agent-select`,ariaLabel:`Set agent`,placeholder:`— agent —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},od=({onClose:e})=>(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`})]}),sd=({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()=>{if(t){c(!0),u(null);try{await t()}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? Open tasks assigned to this story will be closed.`]}),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(),disabled:s,children:s?`Deleting…`:`Delete`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,onClick:()=>{o(!1),u(null)},disabled:s,children:`Cancel`})]})]})]})},cd=({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:`+1 hour`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3hours`),children:`+3 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_6hours`),children:`+6 hours`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1day`),children:`+1 day`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_2days`),children:`+2 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_3days`),children:`+3 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_5days`),children:`+5 days`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1week`),children:e?`+1 week and skip`:`+1 week`}),(0,x.jsx)(`button`,{type:`button`,className:`console-op-button console-op-button-snooze`,onClick:()=>t(`snooze_1month`),children:`+1 month`})]}),ld=[{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`}],ud=`Reject needs an inline comment on the diff.`,dd=({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:ud}),ld.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)})]}),fd=({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})]})},pd=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},md=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=ve.map(t=>({name:t,option:pd(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=N(r.color),a=e===ge;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)})})},hd=({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)(id,{className:`console-story-select`,ariaLabel:`Set story`,placeholder:`— story —`,currentOption:r,options:e,onSelect:n},r?.id??`none`)})},gd=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,currentStoryName:a,agentOptions:o,currentAgentName:s,handlers:c,storyNameForDeletion:l})=>{let[u,d]=(0,y.useState)(!1);return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(dd,{onReview:c.onReview,rejectEnabled:n}),(0,x.jsx)(cd,{isManualTriage:ye(e),onSetNextActionDate:c.onSetNextActionDate}),(0,x.jsx)(md,{statusOptions:r,onSetStatus:c.onSetStatus,onSetInTmuxByHuman:c.onSetInTmuxByHuman}),u&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(hd,{storyOptions:i,currentStoryName:a,onSetStory:c.onSetStory}),(0,x.jsx)(ad,{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:()=>d(e=>!e),title:`Change agent or story`,children:`⚙`})}),(0,x.jsx)(fd,{onSetDependedIssueUrl:c.onSetDependedIssueUrl}),(0,x.jsx)(sd,{onDeleteAllComments:c.onDeleteAllComments,onDeleteStory:c.onDeleteStory,storyNameForDeletion:l})]}),(0,x.jsx)(od,{onClose:c.onClose})]})]})},_d=(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}},vd=[],$=[],yd=[],bd=[],xd={state:`open`,merged:!1,isPullRequest:!1,title:``},Sd={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Cd=(e,t,n)=>{let r=t===null?null:`${t.repo}#${t.number}`,i=t===null?null:t.url,a=t?.isPr??!1,o=_d(e.body,r,i,``),s=_d(e.state,r,i,xd),c=_d(e.comments,r,i,vd),l=_d(e.files,a?r:null,a?i:null,$),u=_d(e.commits,a?r:null,a?i:null,yd),d=_d(e.prStatus,a?r:null,a?i:null,Sd),f=!a&&((t?.relatedOpenPullRequestUrls.length??0)>0||n===`prs`),p=_d(e.relatedPrs,f?r:null,f?i:null,bd),[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:$,filesAreLoading:!0,filesError:null,commits:yd,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}},wd=e=>JSON.stringify([e.author,e.createdAt,e.body]),Td=(e,t)=>{let n=new Set(e.map(wd));return[...e,...t.filter(e=>!n.has(wd(e)))]},Ed=({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=vi(e);return(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(Ce,{...bi(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]})]})},Dd=(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},Od=({cache:e,href:t,fallbackText:n})=>{let r=Dd(e,t);return(0,x.jsx)(Ed,{href:t,fallbackText:n,state:r})},kd=e=>({itemUrl:e.url,projectItemId:e.projectItemId,itemNumber:e.number,repo:e.repo,isPr:e.isPr}),Ad=(e,t,n,r,i)=>({...kd(t),apiPath:ur,requestBody:pr(e,t,n,r,i)}),jd=(e,t,n,r)=>({...kd(t),apiPath:dr,requestBody:mr(e,t,n,r)}),Md=(e,t)=>({...kd(t),apiPath:fr,requestBody:hr(e,t)}),Nd=({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,onDeleteStory:h,storyNameForDeletion:g,workflowImprovementIssueUrl:_})=>{let v=Cd(n,t,e),b=(0,y.useCallback)(e=>wi(e,t.url),[t.url]),S=(0,y.useCallback)((e,t)=>(0,x.jsx)(Od,{cache:n.state,href:e,fallbackText:t}),[n.state]),C=t.isPr||t.relatedOpenPullRequestUrls.length>0||v.relatedPullRequests.length>0,[w,T]=(0,y.useState)([]),ee=(0,y.useCallback)(async(e,t,n,r)=>{T(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[te,E]=(0,y.useState)([]),D=(0,y.useCallback)(async e=>{let n=await r.addComment(t,e);return E(e=>[...e,n]),n},[t,r]),O={onReview:e=>{let n=t.isPr?t.url:v.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,a=e===`request_changes`?w:[];m({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,a),offline:i==null?void 0:Ad(i,t,n,e,a)})},onSetNextActionDate:e=>{m({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e),offline:i==null?void 0:jd(i,t,e)})},onSetStory:e=>{m({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e),offline:i==null?void 0:jd(i,t,`set_story`,{storyOptionId:e.id})})},onSetAgent:e=>{m({kind:{type:`set_agent`,optionName:e.name},item:t,commit:()=>r.setAgent(t,e),offline:i==null?void 0:jd(i,t,`set_agent`,{agentOptionId:e.id})})},onSetStatus:e=>{m({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e),offline:i==null?void 0:jd(i,t,`set_status`,{statusName:e.name})})},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:Md(i,t)})},onClose:e=>{m({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e),offline:i==null?void 0:jd(i,t,e)})},onOkAndAwaitingWorkspace:e=>{m({kind:{type:`ok_and_awaiting_workspace`},item:t,commit:()=>r.okAndMoveToAwaitingWorkspace(t,e)})},onDeleteAllComments:()=>{m({kind:{type:`delete_all_comments`},item:t,commit:()=>r.deleteAllComments(t)})},onDeleteStory:h??null,onSetDependedIssueUrl:i==null?null:async e=>{await r.setDependedIssueUrl(t,e)}},ne=a.find(e=>e.name===`Awaiting Workspace`)??null,k=ne===null?void 0:async e=>(p?.(``),O.onSetStatus(ne),D(e)),A=l??(t.story.trim()===``?null:t.story),re=A===null?null:I(c,A);return(0,x.jsx)(rd,{item:t,storyName:A,storyColorEnum:re,overlayStatus:u,statusOptions:a,state:v.state,stateError:v.stateError,body:v.body,bodyIsLoading:v.bodyIsLoading,bodyError:v.bodyError,comments:Td(v.comments,te),commentsAreLoading:v.commentsAreLoading,commentsError:v.commentsError,files:v.files,filesAreLoading:v.filesAreLoading,filesError:v.filesError,commits:v.commits,commitsAreLoading:v.commitsAreLoading,commitsError:v.commitsError,pullRequestStatus:v.pullRequestStatus,pullRequestStatusError:v.pullRequestStatusError,relatedPullRequests:v.relatedPullRequests,relatedPullRequestsError:v.relatedPullRequestsError,now:d,buildImageProxyUrl:b,renderReferenceLink:S,onAddInlineComment:ee,workflowImprovementIssueUrl:_,commentComposer:(0,x.jsx)(gi,{initiallyOpen:!0,initialDraft:f,onSubmit:D,onDraftChange:p,onOkAndAwaitingWorkspace:ne===null?void 0:()=>O.onOkAndAwaitingWorkspace(ne),onSubmitAndMoveToAwaitingWorkspace:k,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(gd,{tab:e,item:t,hasPullRequest:C,rejectEnabled:w.length>0,statusOptions:a,storyOptions:o,currentStoryName:A,agentOptions:s,currentAgentName:t.agent,handlers:O,storyNameForDeletion:g})})},Pd=()=>{let e={};for(let t of re)e[t.name]=0;return e},Fd=`console`,Id=()=>{let e=wr(),t=Jn(),n=_t(),r=n.status===`on`?n.snapshot:null,{snapshots:i,isLoading:a,error:o,refreshSingleTab:s}=oi(e,r),{timerMode:c,projectMinutes:l,isOpen:u,draftTimerMode:d,draftProjectMinutes:f,openSettings:p,closeSettings:m,saveSettings:h,toggleDraftTimerMode:g,changeDraftMinutes:_}=ci(),{pjcodes:v,projectUrls:b,workflowImprovementIssueUrl:C,fleetTaskCreateUrl:w,isLoading:ee}=Tr(),{isTimerExpired:te}=Nr(e),E=Sr(e??Fd),D=Mr(v),O=(0,y.useMemo)(()=>{let e=Pd();for(let t of re){let n=i[t.name];n!==null&&(t.name===`stories`?e[t.name]=n.stories.filter(e=>e.color!==`GRAY`).length:e[t.name]=ar(n.items,sr(E.overlay,n.generatedAt),t.name))}return e},[i,E.overlay]);In(c,O.prs,e,v,l);let ne=tr(e,O),{activeTab:k,selectedItemKey:A,openItem:ie,closeItem:j}=ne,ae=si(ne.selectTab),N=Ar((0,y.useCallback)(e=>kn(`/projects/${e}`),[])),oe=(0,y.useRef)(new Map),se=(0,y.useCallback)(e=>{A!==null&&(e?oe.current.set(A,e):oe.current.delete(A))},[A]),F=Bn(r),le=vr(e,k,E,F,(0,y.useCallback)(()=>s(`queued`),[s])),I=On(),[de,fe]=(0,y.useState)(()=>Date.now());(0,y.useEffect)(()=>{let e=setInterval(()=>{fe(Date.now())},1e3);return()=>{clearInterval(e)}},[]);let[pe,me]=(0,y.useState)(()=>navigator.onLine);(0,y.useEffect)(()=>{let e=()=>me(!0),t=()=>me(!1);return window.addEventListener(`online`,e),window.addEventListener(`offline`,t),()=>{window.removeEventListener(`online`,e),window.removeEventListener(`offline`,t)}},[]);let[he,ge]=(0,y.useState)(new Map),[_e,ve]=(0,y.useState)(new Map),[ye,be]=(0,y.useState)(new Set);(0,y.useEffect)(()=>{if(!(!pe||I.offlineActions.length===0))for(let e of I.offlineActions)he.has(e.id)||ye.has(e.id)||(ge(t=>new Map(t).set(e.id,null)),F.client.fetchIssueState(e.itemUrl).then(t=>{ge(n=>new Map(n).set(e.id,t)),e.isPr&&(ve(t=>new Map(t).set(e.id,null)),F.client.fetchPullRequestStatus(e.itemUrl).then(t=>{ve(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),be(t=>new Set(t).add(e.id))}))},[pe,I.offlineActions,F.client,he,ye]);let[xe,Se]=(0,y.useState)(!1),Ce=(0,y.useCallback)(async e=>{Se(!0);try{await I.confirmOfflineAction(e)}finally{Se(!1)}},[I]),we=(0,y.useMemo)(()=>I.offlineActions.map(e=>{let t=he.get(e.id)??null,n=_e.get(e.id)??null,r=ye.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,he,_e,ye]),Te=i[k],Oe=(0,y.useMemo)(()=>Te===null?[]:or(Te.items,sr(E.overlay,Te.generatedAt),k),[Te,E.overlay,k]),[ke,je]=(0,y.useState)(null),Me=(0,y.useMemo)(()=>{if(k!==`prs`)return{};let e={};for(let t of Oe)t.agent!==null&&t.agent!==``&&(e[t.agent]=(e[t.agent]??0)+1);return e},[Oe,k]);(0,y.useEffect)(()=>{k===`prs`&&ke!==null&&(Me[ke]??0)===0&&je(null)},[Me,ke,k]);let Ne=(0,y.useMemo)(()=>k!==`prs`||ke===null?Oe:Oe.filter(e=>e.agent===ke),[Oe,k,ke]),Pe=(0,y.useMemo)(()=>Ne.map(e=>rr(e)),[Ne]),Fe=Te?.storyOrder??[],Ie=(0,y.useMemo)(()=>L(Ne,E.overlay,Fe,Te?.generatedAt??null),[Ne,E.overlay,Fe,Te]),Le=Te?.storyColors??{},Re=Te?.statusOptions??[],Be=Te?.agentOptions??[],Ve=Te?.storyOptions??[],He=Te?.generatedAt??null,Ue=Te?.fromCache??!1,[qe,Je]=(0,y.useState)(null),Ye=(0,y.useMemo)(()=>A===null||Te===null?null:Te.items.find(e=>e.projectItemId===A)??null,[A,Te]);Kn(F,Ye,Oe),(0,y.useEffect)(()=>{A!==null&&window.scrollTo({top:0})},[A]),(0,y.useEffect)(()=>{if(e===null&&c&&v.length>0){let e=Fn(v,null,l);e!==null&&An(`/projects/${e}`)}},[e,c,v,l]);let Xe=O[k],Ze=(0,y.useRef)({tab:k,count:Xe});(0,y.useEffect)(()=>{let e=Ze.current;if(Ze.current={tab:k,count:Xe},e.tab===k&&e.count>0&&Xe===0){let e=Yn(k,O);e!==null&&(ae(e),j())}},[k,Xe,O,ae,j]);let Qe=Ye===null?null:cr(E.overlay,Ye,i[k]?.generatedAt??null),$e=Ye===null?null:ue(Ye,E.overlay,i[k]?.generatedAt??null),et=(0,y.useCallback)(e=>{let t=li(Pe,e);t===null?j():ie(t)},[Pe,ie,j]),tt=(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.enqueue({message:_n(t.kind,t.item,k),color:hn(t.kind),commit:t.commit,offline:t.offline,revertAdvance:t.revertAdvance,advance:()=>{if(t.onAdvance?.(),!t.skipAdvance&&gn(t.kind,k)){if(c&&te(l[e??``]??0)){let t=Fn(v,e,l);t!==null&&kn(`/projects/${t}`)}else et(r)}}})},[I,k,et,n.status,c,te,l,e,v]),nt=Wr((0,y.useCallback)(e=>{if(A===null||e===null)return;let t=e===`next`?ui(Pe,A):di(Pe,A);t!==null&&ie(t)},[A,Pe,ie])),[rt,it]=(0,y.useState)(()=>localStorage.getItem(`console-story-show-gray`)===`true`),at=(0,y.useCallback)(()=>{it(e=>{let t=!e;return localStorage.setItem(`console-story-show-gray`,String(t)),t})},[]),ot=i.stories,st=ot?.stories??[],R=qe!==null&&qe.generatedAt===ot?.generatedAt?qe.stories:st,ct=ot?.defaultNameWithOwner??null,lt=(0,y.useMemo)(()=>Ye===null||!Ye.labels.includes(`story`)?null:R.find(e=>e.storyName===Ye.story)??null,[Ye,R]),ut=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);if(ct===null)throw Error(`No repository configured for this project.`);await qt({pjcode:e,title:n,storyName:t,nameWithOwner:ct})},[e,ct]),dt=(0,y.useCallback)(t=>{if(e===null)return Promise.reject(Error(`No project specified in the URL path.`));if(ct===null)return Promise.reject(Error(`No repository configured for this project.`));let n=e,r=ct;return I.enqueue({message:`Task created — "${t.title}"`,color:`blue`,commit:async()=>{let e=await qt({pjcode:n,title:t.title,storyName:t.storyName,agentOptionId:t.agentOptionId,body:t.body,nameWithOwner:r});if(t.files.length>0){let r=[];for(let i of t.files){let t=Rt(new Uint8Array(await i.arrayBuffer())),a=await zt({pjcode:n,url:e,fileName:i.name,contentBase64:t});r.push(a)}await It({pjcode:n,url:e,body:r.join(`
90
90
 
91
- `)})}},[e,ct]),ft=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await Yt({pjcode:e,storyOptionId:t,direction:n});let r=R.findIndex(e=>e.storyOptionId===t);if(r!==-1){let e=r+(n===`up`?-1:1);if(e>=0&&e<R.length){let t=[...R],n=t[r];t[r]=t[e],t[e]=n,Je({generatedAt:ot?.generatedAt,stories:t})}}},[e,R,ot?.generatedAt]),pt=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await Vt({pjcode:e,storyName:t})},[e]),[mt,ht]=(0,y.useState)({}),[gt,z]=(0,y.useState)(null),[B,vt]=(0,y.useState)({}),yt=(0,y.useCallback)((t,n)=>{let r=R.find(e=>e.storyOptionId===t)?.color;if(z(t),ht(e=>({...e,[t]:n})),vt(e=>{let n={...e};return delete n[t],n}),e===null||ct===null){ht(e=>r===void 0?e:{...e,[t]:r}),vt(e=>({...e,[t]:`No project or repository configured.`})),z(e=>e===t?null:e);return}Kt({pjcode:e,storyOptionId:t,newColor:n,nameWithOwner:ct}).catch(e=>{ht(e=>r===void 0?e:{...e,[t]:r}),vt(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}).finally(()=>{z(e=>e===t?null:e)})},[e,ct,R]),bt=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await $t({pjcode:e,storyOptionId:t}),Je({generatedAt:ot?.generatedAt,stories:R.filter(e=>e.storyOptionId!==t)})},[e,R,ot?.generatedAt]),xt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await tn({pjcode:e,storyOptionId:t,newName:n});let r=R.map(e=>e.storyOptionId===t?{...e,storyName:n}:e);Je({generatedAt:ot?.generatedAt,stories:r})},[e,R,ot?.generatedAt]),St=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await rn({pjcode:e,storyOptionId:t,description:n});let r=R.map(e=>e.storyOptionId===t?{...e,description:n}:e);Je({generatedAt:ot?.generatedAt,stories:r})},[e,R,ot?.generatedAt]),Ct=Br(Oe,F.comments,k===`prs`),wt=(0,y.useCallback)((e,t)=>{tt({kind:{type:`ok_and_awaiting_workspace`},item:e,commit:()=>le.okAndMoveToAwaitingWorkspace(e,t),skipAdvance:!0,onAdvance:()=>{E.patchOverlay(rr(e),{done:!0,status:{name:t.name,color:t.color}},k)},revertAdvance:()=>{E.patchOverlay(rr(e),{done:!1},k)}})},[tt,le,E,k]);return(0,x.jsxs)(`main`,{className:`console-app`,children:[I.pending!==null&&(0,x.jsx)(Ge,{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)(Ke,{title:I.error.message,message:`Operation failed: ${I.error.reason}`,onDismiss:I.dismissError}),(0,x.jsx)(We,{actions:we,isOnline:pe,isConfirming:xe,onConfirm:Ce,onDiscard:I.discardOfflineAction}),D.isOpen&&(0,x.jsx)(S,{pjcodes:v,inputValues:D.inputValues,onChangeInput:D.changeInput,isLoading:D.isLoading,isSaving:D.isSaving,error:D.error,onSave:D.save,onClose:D.close}),(0,x.jsx)(M,{activeTab:k,counts:O,pjcode:e,pjcodes:v,generatedAt:He,fromCache:Ue,tabHref:ne.tabHref,onSelectTab:ae,onSelectProject:N,settingsButton:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ce,{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:D.open,children:`⬆`}),e!==null&&(0,x.jsx)(P,{pjcode:e,storyEntries:R,agentOptions:Be,defaultNameWithOwner:ct,onCreateIssue:dt,fleetTaskCreateUrl:w})]}),airplaneModeEnabled:t.airplaneMode,airplaneModeStatus:n.status,airplaneModeProgress:n.progress,airplaneModeCapturedAt:r?.capturedAt??null,airplaneModeFailures:n.failures,onAirplaneModeStartSync:n.startSync,onAirplaneModeTurnOff:n.turnOff,projectUrl:e===null?null:b?.[e]??null,workflowImprovementIssueUrl:C,fleetTaskCreateUrl:w,now:de}),(0,x.jsx)(T,{timerEndsAt:Te?.timerEndsAt??null,timerTotalSeconds:Te?.timerTotalSeconds??null,now:de}),k===`stories`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(ze,{stories:R,isLoading:a,error:o,showGray:rt,onCreateIssue:ut,onAddStory:pt,onSelectColor:yt,onToggleGray:at,onReorderStory:ft,onDeleteStory:bt,onRenameStory:xt,onUpdateDescription:St,optimisticColors:mt,colorChangeInFlight:gt,colorErrors:B})}):Ye===null?k===`queued`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ae,{rows:Ie,storyColors:Le,statusOptions:Re,agentOptions:Be,activeItemId:null,isLoading:a,error:o,onSelectItem:e=>ne.openItem(e.projectItemId)})}):k===`prs`?(0,x.jsxs)(`div`,{className:`console-list-screen`,children:[(0,x.jsx)(De,{agentOptions:Be,agentCounts:Me,selectedAgent:ke,onAgentChange:je}),(0,x.jsx)(Ee,{rows:Ie,storyColors:Le,statusOptions:Re,activeItemId:null,now:de,isLoading:a,error:o,onSelectItem:e=>ne.openItem(e.projectItemId),executiveSummaries:Ct,onOkAndAwaitingWorkspace:wt})]}):(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ee,{rows:Ie,storyColors:Le,statusOptions:Re,activeItemId:null,now:de,isLoading:a,error:o,onSelectItem:e=>ne.openItem(e.projectItemId)})}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:nt,children:(0,x.jsx)(Nd,{tab:k,item:Ye,caches:F,operations:le,pjcode:e,statusOptions:Re,storyOptions:Ve,agentOptions:Be,storyColors:Le,storyName:$e,overlayStatus:Qe,now:de,initialCommentDraft:oe.current.get(Ye.projectItemId)??``,onCommentDraftChange:se,onQueueAction:tt,onDeleteStory:lt===null?null:async()=>{await bt(lt.storyOptionId),j()},storyNameForDeletion:lt?.storyName??null,workflowImprovementIssueUrl:C},Ye.projectItemId)})]})};`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.warn(`Service worker registration failed:`,e)});var Ld=document.getElementById(`root`);if(Ld===null)throw Error(`Root container #root not found`);(0,b.createRoot)(Ld).render((0,x.jsx)(y.StrictMode,{children:(0,x.jsx)(Id,{})}));
91
+ `)})}},advance:()=>{}}),Promise.resolve()},[e,ct,I]),ft=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await Yt({pjcode:e,storyOptionId:t,direction:n});let r=R.findIndex(e=>e.storyOptionId===t);if(r!==-1){let e=r+(n===`up`?-1:1);if(e>=0&&e<R.length){let t=[...R],n=t[r];t[r]=t[e],t[e]=n,Je({generatedAt:ot?.generatedAt,stories:t})}}},[e,R,ot?.generatedAt]),pt=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await Vt({pjcode:e,storyName:t})},[e]),[mt,ht]=(0,y.useState)({}),[gt,z]=(0,y.useState)(null),[B,vt]=(0,y.useState)({}),yt=(0,y.useCallback)((t,n)=>{let r=R.find(e=>e.storyOptionId===t)?.color;if(z(t),ht(e=>({...e,[t]:n})),vt(e=>{let n={...e};return delete n[t],n}),e===null||ct===null){ht(e=>r===void 0?e:{...e,[t]:r}),vt(e=>({...e,[t]:`No project or repository configured.`})),z(e=>e===t?null:e);return}Kt({pjcode:e,storyOptionId:t,newColor:n,nameWithOwner:ct}).catch(e=>{ht(e=>r===void 0?e:{...e,[t]:r}),vt(n=>({...n,[t]:e instanceof Error?e.message:String(e)}))}).finally(()=>{z(e=>e===t?null:e)})},[e,ct,R]),bt=(0,y.useCallback)(async t=>{if(e===null)throw Error(`No project specified in the URL path.`);await $t({pjcode:e,storyOptionId:t}),Je({generatedAt:ot?.generatedAt,stories:R.filter(e=>e.storyOptionId!==t)})},[e,R,ot?.generatedAt]),xt=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await tn({pjcode:e,storyOptionId:t,newName:n});let r=R.map(e=>e.storyOptionId===t?{...e,storyName:n}:e);Je({generatedAt:ot?.generatedAt,stories:r})},[e,R,ot?.generatedAt]),St=(0,y.useCallback)(async(t,n)=>{if(e===null)throw Error(`No project specified in the URL path.`);await rn({pjcode:e,storyOptionId:t,description:n});let r=R.map(e=>e.storyOptionId===t?{...e,description:n}:e);Je({generatedAt:ot?.generatedAt,stories:r})},[e,R,ot?.generatedAt]),Ct=Br(Oe,F.comments,k===`prs`),wt=(0,y.useCallback)((e,t)=>{tt({kind:{type:`ok_and_awaiting_workspace`},item:e,commit:()=>le.okAndMoveToAwaitingWorkspace(e,t),skipAdvance:!0,onAdvance:()=>{E.patchOverlay(rr(e),{done:!0,status:{name:t.name,color:t.color}},k)},revertAdvance:()=>{E.patchOverlay(rr(e),{done:!1},k)}})},[tt,le,E,k]);return(0,x.jsxs)(`main`,{className:`console-app`,children:[I.pending!==null&&(0,x.jsx)(Ge,{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)(Ke,{title:I.error.message,message:`Operation failed: ${I.error.reason}`,onDismiss:I.dismissError}),(0,x.jsx)(We,{actions:we,isOnline:pe,isConfirming:xe,onConfirm:Ce,onDiscard:I.discardOfflineAction}),D.isOpen&&(0,x.jsx)(S,{pjcodes:v,inputValues:D.inputValues,onChangeInput:D.changeInput,isLoading:D.isLoading,isSaving:D.isSaving,error:D.error,onSave:D.save,onClose:D.close}),(0,x.jsx)(M,{activeTab:k,counts:O,pjcode:e,pjcodes:v,generatedAt:He,fromCache:Ue,tabHref:ne.tabHref,onSelectTab:ae,onSelectProject:N,settingsButton:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ce,{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:D.open,children:`⬆`}),e!==null&&(0,x.jsx)(P,{pjcode:e,storyEntries:R,agentOptions:Be,defaultNameWithOwner:ct,onCreateIssue:dt,fleetTaskCreateUrl:w})]}),airplaneModeEnabled:t.airplaneMode,airplaneModeStatus:n.status,airplaneModeProgress:n.progress,airplaneModeCapturedAt:r?.capturedAt??null,airplaneModeFailures:n.failures,onAirplaneModeStartSync:n.startSync,onAirplaneModeTurnOff:n.turnOff,projectUrl:e===null?null:b?.[e]??null,workflowImprovementIssueUrl:C,fleetTaskCreateUrl:w,now:de}),(0,x.jsx)(T,{timerEndsAt:Te?.timerEndsAt??null,timerTotalSeconds:Te?.timerTotalSeconds??null,now:de}),k===`stories`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(ze,{stories:R,isLoading:a,error:o,showGray:rt,onCreateIssue:ut,onAddStory:pt,onSelectColor:yt,onToggleGray:at,onReorderStory:ft,onDeleteStory:bt,onRenameStory:xt,onUpdateDescription:St,optimisticColors:mt,colorChangeInFlight:gt,colorErrors:B})}):Ye===null?k===`queued`?(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ae,{rows:Ie,storyColors:Le,statusOptions:Re,agentOptions:Be,activeItemId:null,isLoading:a,error:o,onSelectItem:e=>ne.openItem(e.projectItemId)})}):k===`prs`?(0,x.jsxs)(`div`,{className:`console-list-screen`,children:[(0,x.jsx)(De,{agentOptions:Be,agentCounts:Me,selectedAgent:ke,onAgentChange:je}),(0,x.jsx)(Ee,{rows:Ie,storyColors:Le,statusOptions:Re,activeItemId:null,now:de,isLoading:a,error:o,onSelectItem:e=>ne.openItem(e.projectItemId),executiveSummaries:Ct,onOkAndAwaitingWorkspace:wt})]}):(0,x.jsx)(`div`,{className:`console-list-screen`,children:(0,x.jsx)(Ee,{rows:Ie,storyColors:Le,statusOptions:Re,activeItemId:null,now:de,isLoading:a,error:o,onSelectItem:e=>ne.openItem(e.projectItemId)})}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:nt,children:(0,x.jsx)(Nd,{tab:k,item:Ye,caches:F,operations:le,pjcode:e,statusOptions:Re,storyOptions:Ve,agentOptions:Be,storyColors:Le,storyName:$e,overlayStatus:Qe,now:de,initialCommentDraft:oe.current.get(Ye.projectItemId)??``,onCommentDraftChange:se,onQueueAction:tt,onDeleteStory:lt===null?null:async()=>{await bt(lt.storyOptionId),j()},storyNameForDeletion:lt?.storyName??null,workflowImprovementIssueUrl:C},Ye.projectItemId)})]})};`serviceWorker`in navigator&&navigator.serviceWorker.register(`/sw.js`).catch(e=>{console.warn(`Service worker registration failed:`,e)});var Ld=document.getElementById(`root`);if(Ld===null)throw Error(`Root container #root not found`);(0,b.createRoot)(Ld).render((0,x.jsx)(y.StrictMode,{children:(0,x.jsx)(Id,{})}));
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>TDPM Console</title>
7
- <script type="module" crossorigin src="/assets/index-DT_8c62d.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-D-Nh790L.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-BlQJRUQT.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-issue-tower-defence-management",
3
- "version": "2.105.0",
3
+ "version": "2.106.0",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {