github-issue-tower-defence-management 1.152.2 → 1.152.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.152.3](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.152.2...v1.152.3) (2026-08-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **console:** keep the comments panel as the reader left it when posting ([#1556](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/issues/1556)) ([2d7f7ec](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/2d7f7ecbb78ac69461a86e166d2a8bfab09e0060)), closes [#1555](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/issues/1555)
7
+
1
8
  ## [1.152.2](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.152.1...v1.152.2) (2026-08-14)
2
9
 
3
10
 
@@ -80,4 +80,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
80
80
  `)}),o+=1,r=[])};for(let e of t){if(a){r.push(e),wa(e)&&(a=!1);continue}if(i===null&&Sa(e)){s(),i=[];continue}if(i!==null){if(wa(e)){n.push({kind:`mermaid`,key:`mermaid:${o}`,code:i.join(`
81
81
  `)}),o+=1,i=null;continue}i.push(e);continue}if(Ca(e)){r.push(e),a=!0;continue}r.push(e)}return i!==null&&r.push("```mermaid",...i),s(),n},Ea=Object.defineProperty,Da=(e,t)=>Ea(e,`name`,{value:t,configurable:!0});function Oa(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Da(Oa,`setRef`);function ka(...e){return t=>{let n=!1,r=e.map(e=>{let r=Oa(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():Oa(e[t],null)}}}}Da(ka,`composeRefs`);function Aa(...e){return _.useCallback(ka(...e),e)}Da(Aa,`useComposedRefs`);var ja=Object.defineProperty,Ma=(e,t)=>ja(e,`name`,{value:t,configurable:!0});function Na(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Ha(r)&&typeof Ka==`function`&&(r=Ka(r._payload)),_.Children.forEach(r,e=>{if(Ba(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ha(n)&&typeof Ka==`function`&&(n=Ka(n._payload)),a=La(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?za(a):void 0,l=Aa(n,c);if(!a){if(r||r===0)throw Error(o?Ga(e):Wa(e));return r}let u=Ra(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Ma(Na,`createSlot`);var Pa=Na(`Slot`),Fa=Symbol.for(`radix.slottable`);function Ia(e){let t=Ma(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Fa,t}Ma(Ia,`createSlottable`);var La=Ma((e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Ra(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}}Ma(Ra,`mergeProps`);function za(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)}Ma(za,`getElementRef`);function Ba(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Fa}Ma(Ba,`isSlottable`);var Va=Symbol.for(`react.lazy`);function Ha(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Va&&`_payload`in e&&Ua(e._payload)}Ma(Ha,`isLazyComponent`);function Ua(e){return typeof e==`object`&&!!e&&`then`in e}Ma(Ua,`isPromiseLike`);var Wa=Ma(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ga=Ma(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ka=_.use;function qa(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=qa(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ja(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=qa(e))&&(r&&(r+=` `),r+=t);return r}var Ya=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Xa=Ja,Za=(e,t)=>n=>{if(t?.variants==null)return Xa(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=Ya(t)||Ya(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 Xa(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)},Qa=(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},$a=(e,t)=>({classGroupId:e,validator:t}),eo=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),to=`-`,no=[],ro=`arbitrary..`,io=e=>{let t=so(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return oo(e);let n=e.split(to);return ao(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Qa(i,t):t:i||no}return n[e]||no}}},ao=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ao(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(to):e.slice(t).join(to),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},oo=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?ro+r:void 0})(),so=e=>{let{theme:t,classGroups:n}=e;return co(n,t)},co=(e,t)=>{let n=eo();for(let r in e){let i=e[r];lo(i,n,r,t)}return n},lo=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];uo(i,t,n,r)}},uo=(e,t,n,r)=>{if(typeof e==`string`){fo(e,t,n);return}if(typeof e==`function`){V(e,t,n,r);return}H(e,t,n,r)},fo=(e,t,n)=>{let r=e===``?t:po(t,e);r.classGroupId=n},V=(e,t,n,r)=>{if(mo(e)){lo(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push($a(n,e))},H=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];lo(o,po(t,a),n,r)}},po=(e,t)=>{let n=e,r=t.split(to),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=eo(),n.nextPart.set(t,i)),n=i}return n},mo=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ho=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)}}},go=`!`,_o=`:`,vo=[],yo=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),bo=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===_o){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(go)?(c=s.slice(0,-1),l=!0):s.startsWith(go)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return yo(t,l,c,u)};if(t){let e=t+_o,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):yo(vo,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},xo=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}},So=e=>({cache:ho(e.cacheSize),parseClassName:bo(e),sortModifiers:xo(e),postfixLookupClassGroupIds:Co(e),...io(e)}),Co=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},wo=/\s+/,To=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(wo),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?_+go:_,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},Eo=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Do(n))&&(i&&(i+=` `),i+=r);return i},Do=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Do(e[r]))&&(n&&(n+=` `),n+=t);return n},Oo=(e,...t)=>{let n,r,i,a,o=o=>(n=So(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=To(e,n);return i(e,a),a};return a=o,(...e)=>a(Eo(...e))},ko=[],U=e=>{let t=t=>t[e]||ko;return t.isThemeGetter=!0,t},Ao=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Mo=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,No=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Po=/\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$/,Fo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Io=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ro=e=>Mo.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),zo=e=>!!e&&Number.isInteger(Number(e)),Bo=e=>e.endsWith(`%`)&&W(e.slice(0,-1)),Vo=e=>No.test(e),Ho=()=>!0,Uo=e=>Po.test(e)&&!Fo.test(e),Wo=()=>!1,Go=e=>Io.test(e),Ko=e=>Lo.test(e),qo=e=>!G(e)&&!K(e),Jo=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)),Yo=e=>us(e,ms,Wo),G=e=>Ao.test(e),Xo=e=>us(e,hs,Uo),Zo=e=>us(e,gs,W),Qo=e=>us(e,vs,Ho),$o=e=>us(e,_s,Wo),es=e=>us(e,fs,Wo),ts=e=>us(e,ps,Ko),ns=e=>us(e,ys,Go),K=e=>jo.test(e),rs=e=>ds(e,hs),is=e=>ds(e,_s),as=e=>ds(e,fs),os=e=>ds(e,ms),ss=e=>ds(e,ps),cs=e=>ds(e,ys,!0),ls=e=>ds(e,vs,!0),us=(e,t,n)=>{let r=Ao.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ds=(e,t,n=!1)=>{let r=jo.exec(e);return r?r[1]?t(r[1]):n:!1},fs=e=>e===`position`||e===`percentage`,ps=e=>e===`image`||e===`url`,ms=e=>e===`length`||e===`size`||e===`bg-size`,hs=e=>e===`length`,gs=e=>e===`number`,_s=e=>e===`family-name`,vs=e=>e===`number`||e===`weight`,ys=e=>e===`shadow`,bs=Oo(()=>{let e=U(`color`),t=U(`font`),n=U(`text`),r=U(`font-weight`),i=U(`tracking`),a=U(`leading`),o=U(`breakpoint`),s=U(`container`),c=U(`spacing`),l=U(`radius`),u=U(`shadow`),d=U(`inset-shadow`),f=U(`text-shadow`),p=U(`drop-shadow`),m=U(`blur`),h=U(`perspective`),g=U(`aspect`),_=U(`ease`),v=U(`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(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[Ro,`full`,`auto`,...w()],ee=()=>[zo,`none`,`subgrid`,K,G],te=()=>[`auto`,{span:[`full`,zo,K,G]},zo,K,G],E=()=>[zo,`auto`,K,G],ne=()=>[`auto`,`min`,`max`,`fr`,K,G],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ie=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ae=()=>[`auto`,...w()],oe=()=>[Ro,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],se=()=>[Ro,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[Ro,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[e,K,G],O=()=>[...b(),as,es,{position:[K,G]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,os,Yo,{size:[K,G]}],de=()=>[Bo,rs,Xo],k=()=>[``,`none`,`full`,l,K,G],A=()=>[``,W,rs,Xo],j=()=>[`solid`,`dashed`,`dotted`,`double`],fe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],pe=()=>[W,Bo,as,es],me=()=>[``,`none`,m,K,G],M=()=>[`none`,W,K,G],he=()=>[`none`,W,K,G],N=()=>[W,K,G],ge=()=>[Ro,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Vo],breakpoint:[Vo],color:[Ho],container:[Vo],"drop-shadow":[Vo],ease:[`in`,`out`,`in-out`],font:[qo],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Vo],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Vo],shadow:[Vo],spacing:[`px`,W],text:[Vo],"text-shadow":[Vo],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ro,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[Jo],columns:[{columns:[W,G,K,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:[zo,`auto`,K,G]}],basis:[{basis:[Ro,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[W,Ro,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,W,K,G]}],shrink:[{shrink:[``,W,K,G]}],order:[{order:[zo,`first`,`last`,`none`,K,G]}],"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":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...re(),`normal`]}],"justify-items":[{"justify-items":[...ie(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ie()]}],"align-content":[{content:[`normal`,...re()]}],"align-items":[{items:[...ie(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ie(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...ie(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ie()]}],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:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mbs:[{mbs:ae()}],mbe:[{mbe:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:oe()}],"inline-size":[{inline:[`auto`,...se()]}],"min-inline-size":[{"min-inline":[`auto`,...se()]}],"max-inline-size":[{"max-inline":[`none`,...se()]}],"block-size":[{block:[`auto`,...ce()]}],"min-block-size":[{"min-block":[`auto`,...ce()]}],"max-block-size":[{"max-block":[`none`,...ce()]}],w:[{w:[s,`screen`,...oe()]}],"min-w":[{"min-w":[s,`screen`,`none`,...oe()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...oe()]}],h:[{h:[`screen`,`lh`,...oe()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...oe()]}],"max-h":[{"max-h":[`screen`,`lh`,...oe()]}],"font-size":[{text:[`base`,n,rs,Xo]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ls,Qo]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Bo,G]}],"font-family":[{font:[is,$o,t]}],"font-features":[{"font-features":[G]}],"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,K,G]}],"line-clamp":[{"line-clamp":[W,`none`,K,Zo]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...j(),`wavy`]}],"text-decoration-thickness":[{decoration:[W,`from-font`,`auto`,K,Xo]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[W,`auto`,K,G]}],"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:[zo,K,G]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],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`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},zo,K,G],radial:[``,K,G],conic:[zo,K,G]},ss,ts]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:k()}],"rounded-s":[{"rounded-s":k()}],"rounded-e":[{"rounded-e":k()}],"rounded-t":[{"rounded-t":k()}],"rounded-r":[{"rounded-r":k()}],"rounded-b":[{"rounded-b":k()}],"rounded-l":[{"rounded-l":k()}],"rounded-ss":[{"rounded-ss":k()}],"rounded-se":[{"rounded-se":k()}],"rounded-ee":[{"rounded-ee":k()}],"rounded-es":[{"rounded-es":k()}],"rounded-tl":[{"rounded-tl":k()}],"rounded-tr":[{"rounded-tr":k()}],"rounded-br":[{"rounded-br":k()}],"rounded-bl":[{"rounded-bl":k()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-bs":[{"border-bs":A()}],"border-w-be":[{"border-be":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":A()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...j(),`hidden`,`none`]}],"divide-style":[{divide:[...j(),`hidden`,`none`]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...j(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[W,K,G]}],"outline-w":[{outline:[``,W,rs,Xo]}],"outline-color":[{outline:D()}],shadow:[{shadow:[``,`none`,u,cs,ns]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":[`none`,d,cs,ns]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:A()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[W,Xo]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":[`none`,f,cs,ns]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[W,K,G]}],"mix-blend":[{"mix-blend":[...fe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":fe()}],"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":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:me()}],brightness:[{brightness:[W,K,G]}],contrast:[{contrast:[W,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,cs,ns]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:[``,W,K,G]}],"hue-rotate":[{"hue-rotate":[W,K,G]}],invert:[{invert:[``,W,K,G]}],saturate:[{saturate:[W,K,G]}],sepia:[{sepia:[``,W,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[W,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[W,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,W,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,W,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[W,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[W,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,W,K,G]}],"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`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[W,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[W,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:M()}],"rotate-x":[{"rotate-x":M()}],"rotate-y":[{"rotate-y":M()}],"rotate-z":[{"rotate-z":M()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":[`scale-3d`],skew:[{skew:N()}],"skew-x":[{"skew-x":N()}],"skew-y":[{"skew-y":N()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[zo,K,G]}],accent:[{accent:D()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:D()}],"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`,K,G]}],"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":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"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`,K,G]}],fill:[{fill:[`none`,...D()]}],"stroke-w":[{stroke:[W,rs,Xo,Zo]}],stroke:[{stroke:[`none`,...D()]}],"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`]}}),xs=(...e)=>bs(Ja(e)),Ss=Za(`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`}}),Cs=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,x.jsx)(r?Pa:`button`,{className:xs(Ss({variant:t,size:n,className:e})),ref:a,...i}));Cs.displayName=`Button`;var ws=`Copying to the clipboard is not available in this browser context.`,Ts=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},Es=async e=>{let t=navigator.clipboard;if(t!==void 0&&typeof t.writeText==`function`)try{await t.writeText(e);return}catch{if(Ts(e))return;throw Error(ws)}if(!Ts(e))throw Error(ws)},Ds=1500,Os=`Copy failed`,ks=`Copying to the clipboard failed`,As=({value:e,idleText:t,idleAriaLabel:n,copiedAriaLabel:r,className:i})=>{let[a,o]=(0,_.useState)(`idle`),s=(0,_.useRef)(null);return(0,_.useEffect)(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]),(0,x.jsx)(Cs,{type:`button`,variant:`ghost`,size:`sm`,className:i,"aria-label":a===`copied`?r:a===`failed`?ks:n,onClick:async()=>{try{await Es(e),o(`copied`)}catch(e){console.error(e),o(`failed`)}s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{o(`idle`),s.current=null},Ds)},children:a===`copied`?`Copied`:a===`failed`?Os:t})},js=({code:e,label:t=`Copy code`})=>(0,x.jsx)(As,{value:e,idleText:t,idleAriaLabel:t,copiedAriaLabel:`Code copied to clipboard`,className:`console-copy-code-button`}),Ms=`https://cdn.jsdelivr.net/npm/mermaid@10.9.6/dist/mermaid.min.js`,Ns=null,Ps=0,Fs=e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`dark`,themeVariables:{background:`#0d1117`,primaryColor:`#161b22`,primaryTextColor:`#e6edf3`,primaryBorderColor:`#30363d`,lineColor:`#8b949e`,fontSize:`14px`}}),e),Is=()=>Ns===null?window.mermaid===void 0?(Ns=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=Ms,n.async=!0,n.onload=()=>{if(window.mermaid===void 0){t(Error(`mermaid failed to load`));return}e(Fs(window.mermaid))},n.onerror=()=>t(Error(`mermaid script failed to load`)),document.head.appendChild(n)}),Ns):(Ns=Promise.resolve(Fs(window.mermaid)),Ns):Ns,Ls=async e=>{let t=await Is();Ps+=1;let n=`console-mermaid-${Ps}`,{svg:r}=await t.render(n,e);return Tr.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`foreignObject`]})},Rs=({code:e})=>{let[t,n]=(0,_.useState)({status:`loading`}),r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=!1;return n({status:`loading`}),Ls(e).then(e=>{t||n({status:`ready`,svg:e})}).catch(e=>{t||n({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},[e]),(0,_.useEffect)(()=>{let e=r.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.jsx)(`div`,{ref:r,className:`console-mermaid-rendered`})},zs=e=>{let t=e.querySelectorAll(`a[href]`),n=[];return t.forEach((e,t)=>{let r=e.getAttribute(`href`)??``;if(Yt(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},Bs=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},Vs=({source:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,_.useMemo)(()=>{let n=xa(e,r);return t===void 0?n:nn(n,t)},[e,t,r]),a=(0,_.useRef)(null),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]);return(0,_.useEffect)(()=>{let e=a.current;e!==null&&(e.innerHTML=i,l(Bs(e)),s(n===void 0?[]:zs(e)))},[i,n]),(0,x.jsxs)(`div`,{ref:a,className:`console-markdown`,children:[c.map(e=>(0,Qt.createPortal)((0,x.jsx)(js,{code:e.code}),e.host,e.key)),n!==void 0&&o.map(e=>(0,Qt.createPortal)(n(e.href,e.fallbackText),e.host,e.key))]})},Hs=({body:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,_.useMemo)(()=>Ta(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)(Rs,{code:e.code},e.key):(0,x.jsx)(Vs,{source:e.source,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r},e.key))})},Us=({title:e,count:t=null,defaultCollapsed:n=!1,headerAction:r,children:i})=>{let[a,o]=(0,_.useState)(n),s=t===null?e:`${e} (${t})`;return(0,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})]})},Ws=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`}}},Gs=()=>({directories:new Map,files:[]}),Ks=e=>e.split(`/`).filter(e=>e!==``),qs=(e,t)=>e.name.localeCompare(t.name),Js=(e,t)=>{let n=[];e.directories.forEach((e,r)=>{let i=t===``?r:`${t}/${r}`;n.push({kind:`directory`,name:r,path:i,children:Js(e,i)})}),n.sort(qs);let r=e.files.map(e=>({kind:`file`,name:Ks(e.path).at(-1)??e.path,path:e.path,file:e}));return r.sort(qs),[...n,...r]},Ys=e=>{let t=Gs();for(let n of e){let e=Ks(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=Gs();i.directories.set(e,t),i=t;continue}i=t}i.files.push(n)}return Js(t,``)},Xs=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,Zs=e=>{let t=[],n=0,r=0;for(let i of e.split(`
82
82
  `)){if(i.startsWith(`@@`)){let e=i.match(Xs);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},Qs=[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.svg`,`.avif`,`.bmp`,`.ico`],$s=e=>{let t=e.toLowerCase();return Qs.some(e=>t.endsWith(e))},ec=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,tc=e=>`${e.kind}:${e.oldLineNumber??`x`}:${e.newLineNumber??`x`}:${e.content}`,nc=({target:e,onSubmit:t,onClose:n})=>{let[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)({kind:`idle`}),s=async()=>{let n=r.trim();if(!(n.length===0||a.kind===`posting`)){o({kind:`posting`});try{await t(e.path,e.line,e.side,n),i(``),o({kind:`posted`})}catch(e){o({kind:`error`,message:e instanceof Error?e.message:`failed to post`})}}};return(0,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]})]})]})]})},rc=({patch:e,path:t,rawUrl:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,_.useState)(null);if(e===null||e===``)return t!==void 0&&$s(t)&&n!=null&&r!==void 0?(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})}):(0,x.jsx)(`p`,{className:`console-file-diff-empty`,children:`(no diff / binary or too large)`});let s=Zs(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=tc(e),r=c?ec(e):null,s=a!==null&&r!==null&&a.line===r.line&&a.side===r.side;return(0,x.jsxs)(_.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)(nc,{target:a,onSubmit:i,onClose:()=>o(null)})})})]},n)})})})},ic=e=>({paddingLeft:`${e*16}px`}),ac=({file:e,depth:t,name:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,_.useState)(!1),s=Ws(e.status);return(0,x.jsxs)(`li`,{className:`console-file`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-file-row`,style:ic(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)(rc,{patch:e.patch,path:e.path,rawUrl:e.rawUrl,buildImageProxyUrl:r,onAddInlineComment:i})]})},oc=({node:e,depth:t,buildImageProxyUrl:n,onAddInlineComment:r})=>e.kind===`file`?(0,x.jsx)(ac,{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:ic(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)(oc,{node:e,depth:t+1,buildImageProxyUrl:n,onAddInlineComment:r},e.path))})]}),sc=({files:e,isLoading:t,error:n,buildImageProxyUrl:r,onAddInlineComment:i})=>n===null?t?(0,x.jsx)(`p`,{className:`console-files-loading`,children:`Loading changed files...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-files-empty`,children:`No changed files.`}):(0,x.jsx)(`ul`,{className:`console-files console-file-tree`,children:Ys(e).map(e=>(0,x.jsx)(oc,{node:e,depth:0,buildImageProxyUrl:r,onAddInlineComment:i},e.path))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-files-error`,children:[`Failed to load changed files: `,n]}),cc=({comments:e,isLoading:t,error:n,now:r,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})=>{let[s,c]=(0,_.useState)(!1);if(n!==null)return(0,x.jsxs)(`p`,{role:`alert`,className:`console-comment-error`,children:[`Failed to load comments: `,n]});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 l=s?e:e.slice(-1);return(0,x.jsxs)(`div`,{className:`console-comment-list`,children:[!s&&e.length>1&&(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-show-all`,onClick:()=>c(!0),children:[`Show all `,e.length]}),l.map(e=>(0,x.jsxs)(`article`,{className:`console-comment`,children:[(0,x.jsxs)(`header`,{className:`console-comment-header`,children:[(0,x.jsx)(`span`,{className:`console-comment-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-comment-time`,children:ie(e.createdAt,r)})]}),(0,x.jsx)(Hs,{body:e.body,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})]},`${e.author}:${e.createdAt}:${e.body}`))]})},lc=e=>e.slice(0,7),uc=e=>e.split(`
83
- `)[0],dc=({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:uc(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:lc(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:ie(e.authoredAt,r)})]},e.sha))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-commits-error`,children:[`Failed to load commits: `,n]}),fc=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(As,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),pc={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`}},mc=({mergeableStatus:e})=>{let t=pc[e],n=le(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})},hc=e=>{let t=le(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},gc=({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:hc(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:hc(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},_c=({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=Yt(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)(mc,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(gc,{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)(fc,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[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)(Us,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Hs,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Us,{title:`Changed files`,count:g,children:(0,x.jsx)(sc,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Us,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(dc,{commits:o,isLoading:s,error:c,now:l})})]})},vc=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,state:i,body:a,bodyIsLoading:o,bodyError:s,comments:c,hasPostedComment:l=!1,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:ne})=>{let re=i?.state??`open`,oe=i?.merged??!1,se=!e.isPr&&re===`closed`?`Closed`:null,D=Xt(e.nameWithOwner)??void 0,O=le(n),ue=r?le(r.color):null,de=p||m!==null?null:f.length,k=u||d!==null?null:c.length,A=g||_!==null?null:h.length,j=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:S.map(e=>({url:e.pullRequest.url,mergeableStatus:e.pullRequest.mergeableStatus}));return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:O.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(gc,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),j.map(e=>(0,x.jsx)(mc,{mergeableStatus:e.mergeableStatus},e.url))]}),(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[r!==null&&ue!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:ue.fg,borderColor:ue.border,backgroundColor:ue.bg},children:r.name}),(0,x.jsx)(ce,{isPr:e.isPr,state:re,merged:oe,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}`}),se!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:se})]}),v!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load item state: `,v]}),e.isPr&&b!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load pull request status: `,b]}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:e.isPr?`PR #${e.number}`:`Issue #${e.number}`}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsx)(`span`,{className:`console-detail-pill`,children:e.isPr?`PR`:`Issue`}),(0,x.jsx)(fc,{url:e.url})]}),e.labels.length>0&&(0,x.jsx)(`div`,{className:`console-detail-labels`,children:e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))}),(0,x.jsxs)(`div`,{className:`console-detail-createdat`,title:ae(e.createdAt),children:[`opened `,ie(e.createdAt,w)]}),(0,x.jsx)(Us,{title:`Description`,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:s===null?o?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(Hs,{body:a,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:D}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-body-error`,children:[`Failed to load description: `,s]})}),e.isPr&&(0,x.jsx)(Us,{title:`Changed files`,count:de,children:(0,x.jsx)(sc,{files:f,isLoading:p,error:m,onAddInlineComment:ne})}),(0,x.jsx)(Us,{title:`Comments`,count:k,defaultCollapsed:e.isPr&&!l,children:(0,x.jsx)(cc,{comments:c,isLoading:u,error:d,now:w,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:D})},l?`comments-with-posted`:`comments`),e.isPr&&(0,x.jsx)(Us,{title:`Commits`,count:A,defaultCollapsed:!0,children:(0,x.jsx)(dc,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&C!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load related pull requests: `,C]}),!e.isPr&&S.map(e=>(0,x.jsx)(_c,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:ne},e.pullRequest.url)),(0,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})]})]})},yc=({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`})]}),bc=({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_1day`),children:`+1 day`}),(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`})]}),xc=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve`,label:`Approve`,variant:`approve`}],Sc=`Reject needs an inline comment on the diff.`,Cc=({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:Sc}),xc.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)})]}),wc=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},Tc=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=M.map(t=>({name:t,option:wc(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=le(r.color),a=e===he;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)})})},Ec=e=>e.name.toLowerCase().includes(`no story`),Dc=({storyOptions:e,onSetStory:t})=>{let n=e.filter(e=>!Ec(e));return n.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group console-op-group-stories`,children:n.map(e=>{let n=le(e.color);return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},onClick:()=>t(e),children:e.name},e.id)})})},Oc=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,handlers:a})=>{let o=e===`triage`;return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(Cc,{onReview:a.onReview,rejectEnabled:n}),(0,x.jsx)(bc,{isManualTriage:N(e),onSetNextActionDate:a.onSetNextActionDate}),o&&(0,x.jsx)(Dc,{storyOptions:i,onSetStory:a.onSetStory}),(0,x.jsx)(Tc,{statusOptions:r,onSetStatus:a.onSetStatus,onSetInTmuxByHuman:a.onSetInTmuxByHuman}),(0,x.jsx)(yc,{onClose:a.onClose})]})},kc=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,_.useState)(i??r),[s,c]=(0,_.useState)(t!==null&&i===void 0),[l,u]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},Ac=[],jc=[],Mc=[],Nc=[],Pc={state:`open`,merged:!1,isPullRequest:!1,title:``},Fc={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Ic=(e,t)=>{let n=t===null?null:`${t.repo}#${t.number}`,r=t===null?null:t.url,i=t?.isPr??!1,a=kc(e.body,n,r,``),o=kc(e.state,n,r,Pc),s=kc(e.comments,n,r,Ac),c=kc(e.files,i?n:null,i?r:null,jc),l=kc(e.commits,i?n:null,i?r:null,Mc),u=kc(e.prStatus,i?n:null,i?r:null,Fc),d=kc(e.relatedPrs,i?null:n,i?null:r,Nc),[f,p]=(0,_.useState)([]);return(0,_.useEffect)(()=>{if(i||d.data.length===0){p([]);return}let t=!1,n=d.data.map(e=>({pullRequest:e,files:jc,filesAreLoading:!0,filesError:null,commits:Mc,commitsAreLoading:!0,commitsError:null}));p(n);let r=(e,n)=>{t||p(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of d.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,i,d.data]),{state:o.data,body:a.data,bodyIsLoading:a.isLoading,bodyError:a.error,comments:s.data,commentsAreLoading:s.isLoading,commentsError:s.error,files:c.data,filesAreLoading:c.isLoading,filesError:c.error,commits:l.data,commitsAreLoading:l.isLoading,commitsError:l.error,stateError:o.error,pullRequestStatus:i?u.data:null,pullRequestStatusError:i?u.error:null,relatedPullRequests:f,relatedPullRequestsError:i?null:d.error}},Lc=e=>JSON.stringify([e.author,e.createdAt,e.body]),Rc=(e,t)=>{let n=new Set(e.map(Lc));return[...e,...t.filter(e=>!n.has(Lc(e)))]},zc=({href:e,fallbackText:t,state:n})=>n===null||n.title.trim()===``?(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t}):(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(ce,{...Zt(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title})]}),Bc=(e,t)=>{let[n,r]=(0,_.useState)(()=>e.peek(t)??null);return(0,_.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},Vc=({cache:e,href:t,fallbackText:n})=>(0,x.jsx)(zc,{href:t,fallbackText:n,state:Bc(e,t)}),Hc=({tab:e,item:t,caches:n,operations:r,statusOptions:i,storyOptions:a,storyColors:o,storyName:s,overlayStatus:c,now:l,onQueueAction:u})=>{let d=Ic(n,t),f=(0,_.useCallback)(e=>tn(e),[]),p=(0,_.useCallback)((e,t)=>(0,x.jsx)(Vc,{cache:n.state,href:e,fallbackText:t}),[n.state]),m=t.isPr||t.relatedOpenPullRequestUrls.length>0||d.relatedPullRequests.length>0,[h,g]=(0,_.useState)([]),v=(0,_.useCallback)(async(e,t,n,r)=>{g(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[y,b]=(0,_.useState)([]),S=(0,_.useCallback)(async e=>{let n=await r.addComment(t,e);return b(e=>[...e,n]),n},[t,r]),C={onReview:e=>{let n=t.isPr?t.url:d.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,i=e===`request_changes`?h:[];u({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,i)})},onSetNextActionDate:e=>{u({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e)})},onSetStory:e=>{u({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e)})},onSetStatus:e=>{u({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e)})},onSetInTmuxByHuman:e=>{u({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e)})},onClose:e=>{u({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e)})}},T=s??(t.story.trim()===``?null:t.story);return(0,x.jsx)(vc,{item:t,storyName:T,storyColorEnum:T===null?null:w(o,T),overlayStatus:c,state:d.state,stateError:d.stateError,body:d.body,bodyIsLoading:d.bodyIsLoading,bodyError:d.bodyError,comments:Rc(d.comments,y),hasPostedComment:y.length>0,commentsAreLoading:d.commentsAreLoading,commentsError:d.commentsError,files:d.files,filesAreLoading:d.filesAreLoading,filesError:d.filesError,commits:d.commits,commitsAreLoading:d.commitsAreLoading,commitsError:d.commitsError,pullRequestStatus:d.pullRequestStatus,pullRequestStatusError:d.pullRequestStatusError,relatedPullRequests:d.relatedPullRequests,relatedPullRequestsError:d.relatedPullRequestsError,now:l,buildImageProxyUrl:f,renderReferenceLink:p,onAddInlineComment:v,commentComposer:(0,x.jsx)(qt,{initiallyOpen:!0,onSubmit:S,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Oc,{tab:e,item:t,hasPullRequest:m,rejectEnabled:h.length>0,statusOptions:i,storyOptions:a,handlers:C})})},Uc=()=>{let e={};for(let t of y)e[t.name]=0;return e},Wc=`console`,Gc=()=>{let e=Ot(),{snapshots:t,isLoading:n,error:r}=Ht(e),i=Et(e??Wc),a=(0,_.useMemo)(()=>{let e=Uc();for(let n of y){let r=t[n.name];r!==null&&(e[n.name]=pt(r.items,ht(i.overlay,r.generatedAt)))}return e},[t,i.overlay]),o=lt(e,a),{activeTab:s,selectedItemKey:c,openItem:l,closeItem:u,selectTab:d}=o,f=Qe(),p=St(e,s,i,f),m=Ee(),h=Date.now(),g=t[s],v=(0,_.useMemo)(()=>g===null?[]:mt(g.items,ht(i.overlay,g.generatedAt)),[g,i.overlay]),b=(0,_.useMemo)(()=>v.map(e=>dt(e)),[v]),C=(0,_.useMemo)(()=>ee(v,i.overlay),[v,i.overlay]),w=g?.storyColors??{},te=g?.statusOptions??[],E=g?.storyOptions??[],ne=g?.generatedAt??null,re=(0,_.useMemo)(()=>c===null||g===null?null:g.items.find(e=>e.projectItemId===c)??null,[c,g]);it(f,re,v),(0,_.useEffect)(()=>{c!==null&&window.scrollTo({top:0})},[c]);let ie=a[s],ae=(0,_.useRef)({tab:s,count:ie});(0,_.useEffect)(()=>{let e=ae.current;if(ae.current={tab:s,count:ie},e.tab===s&&e.count>0&&ie===0){let e=at(s,a);e!==null&&(d(e),u())}},[s,ie,a,d,u]);let oe=re===null?null:gt(i.overlay,re,t[s]?.generatedAt??null),se=re===null?null:T(re,i.overlay),ce=(0,_.useCallback)(e=>{let t=Ut(b,e);t===null?u():l(t)},[b,l,u]),D=(0,_.useCallback)(e=>{let t=dt(e.item);m.enqueue({message:xe(e.kind,e.item,s),color:ye(e.kind),commit:e.commit,advance:()=>{be(e.kind,s)&&ce(t)}})},[m,s,ce]),O=Mt((0,_.useCallback)(e=>{if(c===null||e===null)return;let t=e===`next`?Wt(b,c):Gt(b,c);t!==null&&l(t)},[c,b,l]));return(0,x.jsxs)(`main`,{className:`console-app`,children:[m.pending!==null&&(0,x.jsx)(k,{message:m.pending.message,color:m.pending.color,remainingSeconds:m.pending.remainingSeconds,progress:m.pending.progress,onUndo:m.undo}),m.error!==null&&(0,x.jsx)(A,{message:`Operation failed: ${m.error.reason}`,onDismiss:m.dismissError}),(0,x.jsx)(S,{activeTab:s,counts:a,pjcode:e,generatedAt:ne,tabHref:o.tabHref,onSelectTab:o.selectTab}),re===null?(0,x.jsx)(de,{rows:C,storyColors:w,activeItemId:null,now:h,isLoading:n,error:r,onSelectItem:e=>o.openItem(e.projectItemId)}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:O,children:(0,x.jsx)(Hc,{tab:s,item:re,caches:f,operations:p,statusOptions:te,storyOptions:E,storyColors:w,storyName:se,overlayStatus:oe,now:h,onQueueAction:D},re.projectItemId)})]})},Kc=document.getElementById(`root`);if(Kc===null)throw Error(`Root container #root not found`);(0,v.createRoot)(Kc).render((0,x.jsx)(_.StrictMode,{children:(0,x.jsx)(Gc,{})}));
83
+ `)[0],dc=({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:uc(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:lc(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:ie(e.authoredAt,r)})]},e.sha))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-commits-error`,children:[`Failed to load commits: `,n]}),fc=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(As,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),pc={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`}},mc=({mergeableStatus:e})=>{let t=pc[e],n=le(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})},hc=e=>{let t=le(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},gc=({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:hc(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:hc(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},_c=({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=Yt(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)(mc,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(gc,{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)(fc,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[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)(Us,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Hs,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Us,{title:`Changed files`,count:g,children:(0,x.jsx)(sc,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Us,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(dc,{commits:o,isLoading:s,error:c,now:l})})]})},vc=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,state:i,body:a,bodyIsLoading:o,bodyError:s,comments:c,commentsAreLoading:l,commentsError:u,files:d,filesAreLoading:f,filesError:p,commits:m,commitsAreLoading:h,commitsError:g,stateError:_,pullRequestStatus:v,pullRequestStatusError:y,relatedPullRequests:b,relatedPullRequestsError:S,now:C,commentComposer:w,operationBar:T,buildImageProxyUrl:ee,renderReferenceLink:te,onAddInlineComment:E})=>{let ne=i?.state??`open`,re=i?.merged??!1,oe=!e.isPr&&ne===`closed`?`Closed`:null,se=Xt(e.nameWithOwner)??void 0,D=le(n),O=r?le(r.color):null,ue=f||p!==null?null:d.length,de=l||u!==null?null:c.length,k=h||g!==null?null:m.length,A=e.isPr&&v?.found?[{url:e.url,mergeableStatus:v.mergeableStatus}]:b.map(e=>({url:e.pullRequest.url,mergeableStatus:e.pullRequest.mergeableStatus}));return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:D.dot}}),t]}),e.isPr&&v?.found&&(0,x.jsx)(gc,{isPassedAllCiJob:v.isPassedAllCiJob,isCiStateSuccess:v.isCiStateSuccess,isBranchOutOfDate:v.isBranchOutOfDate,missingRequiredCheckNames:v.missingRequiredCheckNames}),A.map(e=>(0,x.jsx)(mc,{mergeableStatus:e.mergeableStatus},e.url))]}),(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[r!==null&&O!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:O.fg,borderColor:O.border,backgroundColor:O.bg},children:r.name}),(0,x.jsx)(ce,{isPr:e.isPr,state:ne,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}`}),oe!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:oe})]}),_!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load item state: `,_]}),e.isPr&&y!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load pull request status: `,y]}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:e.isPr?`PR #${e.number}`:`Issue #${e.number}`}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsx)(`span`,{className:`console-detail-pill`,children:e.isPr?`PR`:`Issue`}),(0,x.jsx)(fc,{url:e.url})]}),e.labels.length>0&&(0,x.jsx)(`div`,{className:`console-detail-labels`,children:e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))}),(0,x.jsxs)(`div`,{className:`console-detail-createdat`,title:ae(e.createdAt),children:[`opened `,ie(e.createdAt,C)]}),(0,x.jsx)(Us,{title:`Description`,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:s===null?o?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(Hs,{body:a,buildImageProxyUrl:ee,renderReferenceLink:te,repoContext:se}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-body-error`,children:[`Failed to load description: `,s]})}),e.isPr&&(0,x.jsx)(Us,{title:`Changed files`,count:ue,children:(0,x.jsx)(sc,{files:d,isLoading:f,error:p,onAddInlineComment:E})}),(0,x.jsx)(Us,{title:`Comments`,count:de,defaultCollapsed:e.isPr,children:(0,x.jsx)(cc,{comments:c,isLoading:l,error:u,now:C,buildImageProxyUrl:ee,renderReferenceLink:te,repoContext:se})}),e.isPr&&(0,x.jsx)(Us,{title:`Commits`,count:k,defaultCollapsed:!0,children:(0,x.jsx)(dc,{commits:m,isLoading:h,error:g,now:C})}),!e.isPr&&S!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load related pull requests: `,S]}),!e.isPr&&b.map(e=>(0,x.jsx)(_c,{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:C,buildImageProxyUrl:ee,renderReferenceLink:te,onAddInlineComment:E},e.pullRequest.url)),(0,x.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,x.jsx)(`div`,{className:`console-detail-dock-composer`,children:w}),(0,x.jsx)(`div`,{className:`console-actionbar`,children:T})]})]})},yc=({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`})]}),bc=({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_1day`),children:`+1 day`}),(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`})]}),xc=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve`,label:`Approve`,variant:`approve`}],Sc=`Reject needs an inline comment on the diff.`,Cc=({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:Sc}),xc.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)})]}),wc=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},Tc=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=M.map(t=>({name:t,option:wc(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=le(r.color),a=e===he;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)})})},Ec=e=>e.name.toLowerCase().includes(`no story`),Dc=({storyOptions:e,onSetStory:t})=>{let n=e.filter(e=>!Ec(e));return n.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group console-op-group-stories`,children:n.map(e=>{let n=le(e.color);return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},onClick:()=>t(e),children:e.name},e.id)})})},Oc=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,handlers:a})=>{let o=e===`triage`;return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(Cc,{onReview:a.onReview,rejectEnabled:n}),(0,x.jsx)(bc,{isManualTriage:N(e),onSetNextActionDate:a.onSetNextActionDate}),o&&(0,x.jsx)(Dc,{storyOptions:i,onSetStory:a.onSetStory}),(0,x.jsx)(Tc,{statusOptions:r,onSetStatus:a.onSetStatus,onSetInTmuxByHuman:a.onSetInTmuxByHuman}),(0,x.jsx)(yc,{onClose:a.onClose})]})},kc=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,_.useState)(i??r),[s,c]=(0,_.useState)(t!==null&&i===void 0),[l,u]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},Ac=[],jc=[],Mc=[],Nc=[],Pc={state:`open`,merged:!1,isPullRequest:!1,title:``},Fc={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Ic=(e,t)=>{let n=t===null?null:`${t.repo}#${t.number}`,r=t===null?null:t.url,i=t?.isPr??!1,a=kc(e.body,n,r,``),o=kc(e.state,n,r,Pc),s=kc(e.comments,n,r,Ac),c=kc(e.files,i?n:null,i?r:null,jc),l=kc(e.commits,i?n:null,i?r:null,Mc),u=kc(e.prStatus,i?n:null,i?r:null,Fc),d=kc(e.relatedPrs,i?null:n,i?null:r,Nc),[f,p]=(0,_.useState)([]);return(0,_.useEffect)(()=>{if(i||d.data.length===0){p([]);return}let t=!1,n=d.data.map(e=>({pullRequest:e,files:jc,filesAreLoading:!0,filesError:null,commits:Mc,commitsAreLoading:!0,commitsError:null}));p(n);let r=(e,n)=>{t||p(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of d.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,i,d.data]),{state:o.data,body:a.data,bodyIsLoading:a.isLoading,bodyError:a.error,comments:s.data,commentsAreLoading:s.isLoading,commentsError:s.error,files:c.data,filesAreLoading:c.isLoading,filesError:c.error,commits:l.data,commitsAreLoading:l.isLoading,commitsError:l.error,stateError:o.error,pullRequestStatus:i?u.data:null,pullRequestStatusError:i?u.error:null,relatedPullRequests:f,relatedPullRequestsError:i?null:d.error}},Lc=e=>JSON.stringify([e.author,e.createdAt,e.body]),Rc=(e,t)=>{let n=new Set(e.map(Lc));return[...e,...t.filter(e=>!n.has(Lc(e)))]},zc=({href:e,fallbackText:t,state:n})=>n===null||n.title.trim()===``?(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t}):(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(ce,{...Zt(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title})]}),Bc=(e,t)=>{let[n,r]=(0,_.useState)(()=>e.peek(t)??null);return(0,_.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},Vc=({cache:e,href:t,fallbackText:n})=>(0,x.jsx)(zc,{href:t,fallbackText:n,state:Bc(e,t)}),Hc=({tab:e,item:t,caches:n,operations:r,statusOptions:i,storyOptions:a,storyColors:o,storyName:s,overlayStatus:c,now:l,onQueueAction:u})=>{let d=Ic(n,t),f=(0,_.useCallback)(e=>tn(e),[]),p=(0,_.useCallback)((e,t)=>(0,x.jsx)(Vc,{cache:n.state,href:e,fallbackText:t}),[n.state]),m=t.isPr||t.relatedOpenPullRequestUrls.length>0||d.relatedPullRequests.length>0,[h,g]=(0,_.useState)([]),v=(0,_.useCallback)(async(e,t,n,r)=>{g(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[y,b]=(0,_.useState)([]),S=(0,_.useCallback)(async e=>{let n=await r.addComment(t,e);return b(e=>[...e,n]),n},[t,r]),C={onReview:e=>{let n=t.isPr?t.url:d.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,i=e===`request_changes`?h:[];u({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,i)})},onSetNextActionDate:e=>{u({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e)})},onSetStory:e=>{u({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e)})},onSetStatus:e=>{u({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e)})},onSetInTmuxByHuman:e=>{u({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e)})},onClose:e=>{u({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e)})}},T=s??(t.story.trim()===``?null:t.story);return(0,x.jsx)(vc,{item:t,storyName:T,storyColorEnum:T===null?null:w(o,T),overlayStatus:c,state:d.state,stateError:d.stateError,body:d.body,bodyIsLoading:d.bodyIsLoading,bodyError:d.bodyError,comments:Rc(d.comments,y),commentsAreLoading:d.commentsAreLoading,commentsError:d.commentsError,files:d.files,filesAreLoading:d.filesAreLoading,filesError:d.filesError,commits:d.commits,commitsAreLoading:d.commitsAreLoading,commitsError:d.commitsError,pullRequestStatus:d.pullRequestStatus,pullRequestStatusError:d.pullRequestStatusError,relatedPullRequests:d.relatedPullRequests,relatedPullRequestsError:d.relatedPullRequestsError,now:l,buildImageProxyUrl:f,renderReferenceLink:p,onAddInlineComment:v,commentComposer:(0,x.jsx)(qt,{initiallyOpen:!0,onSubmit:S,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Oc,{tab:e,item:t,hasPullRequest:m,rejectEnabled:h.length>0,statusOptions:i,storyOptions:a,handlers:C})})},Uc=()=>{let e={};for(let t of y)e[t.name]=0;return e},Wc=`console`,Gc=()=>{let e=Ot(),{snapshots:t,isLoading:n,error:r}=Ht(e),i=Et(e??Wc),a=(0,_.useMemo)(()=>{let e=Uc();for(let n of y){let r=t[n.name];r!==null&&(e[n.name]=pt(r.items,ht(i.overlay,r.generatedAt)))}return e},[t,i.overlay]),o=lt(e,a),{activeTab:s,selectedItemKey:c,openItem:l,closeItem:u,selectTab:d}=o,f=Qe(),p=St(e,s,i,f),m=Ee(),h=Date.now(),g=t[s],v=(0,_.useMemo)(()=>g===null?[]:mt(g.items,ht(i.overlay,g.generatedAt)),[g,i.overlay]),b=(0,_.useMemo)(()=>v.map(e=>dt(e)),[v]),C=(0,_.useMemo)(()=>ee(v,i.overlay),[v,i.overlay]),w=g?.storyColors??{},te=g?.statusOptions??[],E=g?.storyOptions??[],ne=g?.generatedAt??null,re=(0,_.useMemo)(()=>c===null||g===null?null:g.items.find(e=>e.projectItemId===c)??null,[c,g]);it(f,re,v),(0,_.useEffect)(()=>{c!==null&&window.scrollTo({top:0})},[c]);let ie=a[s],ae=(0,_.useRef)({tab:s,count:ie});(0,_.useEffect)(()=>{let e=ae.current;if(ae.current={tab:s,count:ie},e.tab===s&&e.count>0&&ie===0){let e=at(s,a);e!==null&&(d(e),u())}},[s,ie,a,d,u]);let oe=re===null?null:gt(i.overlay,re,t[s]?.generatedAt??null),se=re===null?null:T(re,i.overlay),ce=(0,_.useCallback)(e=>{let t=Ut(b,e);t===null?u():l(t)},[b,l,u]),D=(0,_.useCallback)(e=>{let t=dt(e.item);m.enqueue({message:xe(e.kind,e.item,s),color:ye(e.kind),commit:e.commit,advance:()=>{be(e.kind,s)&&ce(t)}})},[m,s,ce]),O=Mt((0,_.useCallback)(e=>{if(c===null||e===null)return;let t=e===`next`?Wt(b,c):Gt(b,c);t!==null&&l(t)},[c,b,l]));return(0,x.jsxs)(`main`,{className:`console-app`,children:[m.pending!==null&&(0,x.jsx)(k,{message:m.pending.message,color:m.pending.color,remainingSeconds:m.pending.remainingSeconds,progress:m.pending.progress,onUndo:m.undo}),m.error!==null&&(0,x.jsx)(A,{message:`Operation failed: ${m.error.reason}`,onDismiss:m.dismissError}),(0,x.jsx)(S,{activeTab:s,counts:a,pjcode:e,generatedAt:ne,tabHref:o.tabHref,onSelectTab:o.selectTab}),re===null?(0,x.jsx)(de,{rows:C,storyColors:w,activeItemId:null,now:h,isLoading:n,error:r,onSelectItem:e=>o.openItem(e.projectItemId)}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:O,children:(0,x.jsx)(Hc,{tab:s,item:re,caches:f,operations:p,statusOptions:te,storyOptions:E,storyColors:w,storyName:se,overlayStatus:oe,now:h,onQueueAction:D},re.projectItemId)})]})},Kc=document.getElementById(`root`);if(Kc===null)throw Error(`Root container #root not found`);(0,v.createRoot)(Kc).render((0,x.jsx)(_.StrictMode,{children:(0,x.jsx)(Gc,{})}));
@@ -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-DR_LIP9n.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-BooMHl5Y.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-lemrqYKZ.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": "1.152.2",
3
+ "version": "1.152.3",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
@@ -51,7 +51,6 @@ export type ConsoleItemDetailProps = {
51
51
  bodyIsLoading: boolean;
52
52
  bodyError: string | null;
53
53
  comments: ConsoleComment[];
54
- hasPostedComment?: boolean;
55
54
  commentsAreLoading: boolean;
56
55
  commentsError: string | null;
57
56
  files: ConsoleChangedFile[];
@@ -83,7 +82,6 @@ export const ConsoleItemDetail = ({
83
82
  bodyIsLoading,
84
83
  bodyError,
85
84
  comments,
86
- hasPostedComment = false,
87
85
  commentsAreLoading,
88
86
  commentsError,
89
87
  files,
@@ -277,10 +275,9 @@ export const ConsoleItemDetail = ({
277
275
  )}
278
276
 
279
277
  <ConsolePanel
280
- key={hasPostedComment ? 'comments-with-posted' : 'comments'}
281
278
  title="Comments"
282
279
  count={commentsCount}
283
- defaultCollapsed={item.isPr && !hasPostedComment}
280
+ defaultCollapsed={item.isPr}
284
281
  >
285
282
  <ConsoleCommentList
286
283
  comments={comments}
@@ -83,6 +83,20 @@ const buildOperations = (): ConsoleOperationsApi => ({
83
83
  addInlineReviewComment: jest.fn(async () => {}),
84
84
  });
85
85
 
86
+ const findCommentsPanelToggle = (container: HTMLElement): HTMLElement => {
87
+ const toggle = Array.from(
88
+ container.querySelectorAll('.console-panel-toggle'),
89
+ ).find((element) =>
90
+ element
91
+ .querySelector('.console-panel-title')
92
+ ?.textContent?.startsWith('Comments'),
93
+ );
94
+ if (toggle === undefined) {
95
+ throw new Error('Comments panel toggle is not rendered');
96
+ }
97
+ return toggle as HTMLElement;
98
+ };
99
+
86
100
  describe('ConsoleItemDetailContainer', () => {
87
101
  it('queues the review action and commits it through the operations api for a PR item', async () => {
88
102
  const operations = buildOperations();
@@ -182,7 +196,7 @@ describe('ConsoleItemDetailContainer', () => {
182
196
  ).toBe(0);
183
197
  });
184
198
 
185
- it('opens the comments panel of a pull request item so the posted comment is on screen', async () => {
199
+ it('leaves the collapsed comments panel of a pull request item collapsed after a comment is posted', async () => {
186
200
  const operations = buildOperations();
187
201
  operations.addComment = jest.fn(async (_item, body) => ({
188
202
  author: 'HiromiShikata',
@@ -205,16 +219,78 @@ describe('ConsoleItemDetailContainer', () => {
205
219
  />,
206
220
  );
207
221
 
222
+ await waitFor(() => {
223
+ expect(findCommentsPanelToggle(container).textContent).toContain(
224
+ 'Comments (0)',
225
+ );
226
+ });
227
+ expect(
228
+ findCommentsPanelToggle(container).getAttribute('aria-expanded'),
229
+ ).toBe('false');
230
+
208
231
  fireEvent.change(getByPlaceholderText('Leave a comment…'), {
209
232
  target: { value: 'Posted from the pull request item.' },
210
233
  });
211
234
  fireEvent.click(getByText('Comment'));
212
235
 
213
236
  await waitFor(() => {
214
- expect(
215
- container.querySelector('.console-comment-list')?.textContent,
216
- ).toContain('Posted from the pull request item.');
237
+ expect(findCommentsPanelToggle(container).textContent).toContain(
238
+ 'Comments (1)',
239
+ );
240
+ });
241
+ expect(
242
+ findCommentsPanelToggle(container).getAttribute('aria-expanded'),
243
+ ).toBe('false');
244
+ expect(container.querySelector('.console-comment-list')).toBeNull();
245
+ });
246
+
247
+ it('keeps a reader-collapsed comments panel collapsed after a comment is posted on an issue item', async () => {
248
+ const operations = buildOperations();
249
+ operations.addComment = jest.fn(async (_item, body) => ({
250
+ author: 'HiromiShikata',
251
+ body,
252
+ createdAt: '2026-06-19T11:58:00.000Z',
253
+ }));
254
+ const { container, getByPlaceholderText, getByText } = render(
255
+ <ConsoleItemDetailContainer
256
+ tab="unread"
257
+ item={issueItem}
258
+ caches={buildCaches()}
259
+ operations={operations}
260
+ statusOptions={consoleStatusOptionsFixture}
261
+ storyOptions={consoleStoryOptionsFixture}
262
+ storyColors={consoleStoryColorsFixture}
263
+ storyName="TDPM Console port"
264
+ overlayStatus={null}
265
+ now={Date.parse('2026-06-19T12:00:00.000Z')}
266
+ onQueueAction={jest.fn()}
267
+ />,
268
+ );
269
+
270
+ await waitFor(() => {
271
+ expect(findCommentsPanelToggle(container).textContent).toContain(
272
+ 'Comments (0)',
273
+ );
274
+ });
275
+ fireEvent.click(findCommentsPanelToggle(container));
276
+ expect(
277
+ findCommentsPanelToggle(container).getAttribute('aria-expanded'),
278
+ ).toBe('false');
279
+
280
+ fireEvent.change(getByPlaceholderText('Leave a comment…'), {
281
+ target: { value: 'Posted from the issue item.' },
217
282
  });
283
+ fireEvent.click(getByText('Comment'));
284
+
285
+ await waitFor(() => {
286
+ expect(findCommentsPanelToggle(container).textContent).toContain(
287
+ 'Comments (1)',
288
+ );
289
+ });
290
+ expect(
291
+ findCommentsPanelToggle(container).getAttribute('aria-expanded'),
292
+ ).toBe('false');
293
+ expect(container.querySelector('.console-comment-list')).toBeNull();
218
294
  });
219
295
 
220
296
  it('shows Approve for an issue item from the generated related open pull request urls before the related pull requests are fetched', () => {
@@ -171,7 +171,6 @@ export const ConsoleItemDetailContainer = ({
171
171
  bodyIsLoading={detail.bodyIsLoading}
172
172
  bodyError={detail.bodyError}
173
173
  comments={mergePostedComments(detail.comments, postedComments)}
174
- hasPostedComment={postedComments.length > 0}
175
174
  commentsAreLoading={detail.commentsAreLoading}
176
175
  commentsError={detail.commentsError}
177
176
  files={detail.files}
@@ -80,4 +80,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
80
80
  `)}),o+=1,r=[])};for(let e of t){if(a){r.push(e),wa(e)&&(a=!1);continue}if(i===null&&Sa(e)){s(),i=[];continue}if(i!==null){if(wa(e)){n.push({kind:`mermaid`,key:`mermaid:${o}`,code:i.join(`
81
81
  `)}),o+=1,i=null;continue}i.push(e);continue}if(Ca(e)){r.push(e),a=!0;continue}r.push(e)}return i!==null&&r.push("```mermaid",...i),s(),n},Ea=Object.defineProperty,Da=(e,t)=>Ea(e,`name`,{value:t,configurable:!0});function Oa(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Da(Oa,`setRef`);function ka(...e){return t=>{let n=!1,r=e.map(e=>{let r=Oa(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():Oa(e[t],null)}}}}Da(ka,`composeRefs`);function Aa(...e){return _.useCallback(ka(...e),e)}Da(Aa,`useComposedRefs`);var ja=Object.defineProperty,Ma=(e,t)=>ja(e,`name`,{value:t,configurable:!0});function Na(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Ha(r)&&typeof Ka==`function`&&(r=Ka(r._payload)),_.Children.forEach(r,e=>{if(Ba(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Ha(n)&&typeof Ka==`function`&&(n=Ka(n._payload)),a=La(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?za(a):void 0,l=Aa(n,c);if(!a){if(r||r===0)throw Error(o?Ga(e):Wa(e));return r}let u=Ra(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Ma(Na,`createSlot`);var Pa=Na(`Slot`),Fa=Symbol.for(`radix.slottable`);function Ia(e){let t=Ma(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Fa,t}Ma(Ia,`createSlottable`);var La=Ma((e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Ra(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}}Ma(Ra,`mergeProps`);function za(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)}Ma(za,`getElementRef`);function Ba(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Fa}Ma(Ba,`isSlottable`);var Va=Symbol.for(`react.lazy`);function Ha(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Va&&`_payload`in e&&Ua(e._payload)}Ma(Ha,`isLazyComponent`);function Ua(e){return typeof e==`object`&&!!e&&`then`in e}Ma(Ua,`isPromiseLike`);var Wa=Ma(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ga=Ma(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Ka=_.use;function qa(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=qa(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Ja(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=qa(e))&&(r&&(r+=` `),r+=t);return r}var Ya=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Xa=Ja,Za=(e,t)=>n=>{if(t?.variants==null)return Xa(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=Ya(t)||Ya(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 Xa(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)},Qa=(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},$a=(e,t)=>({classGroupId:e,validator:t}),eo=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),to=`-`,no=[],ro=`arbitrary..`,io=e=>{let t=so(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return oo(e);let n=e.split(to);return ao(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Qa(i,t):t:i||no}return n[e]||no}}},ao=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ao(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(to):e.slice(t).join(to),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},oo=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?ro+r:void 0})(),so=e=>{let{theme:t,classGroups:n}=e;return co(n,t)},co=(e,t)=>{let n=eo();for(let r in e){let i=e[r];lo(i,n,r,t)}return n},lo=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];uo(i,t,n,r)}},uo=(e,t,n,r)=>{if(typeof e==`string`){fo(e,t,n);return}if(typeof e==`function`){V(e,t,n,r);return}H(e,t,n,r)},fo=(e,t,n)=>{let r=e===``?t:po(t,e);r.classGroupId=n},V=(e,t,n,r)=>{if(mo(e)){lo(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push($a(n,e))},H=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];lo(o,po(t,a),n,r)}},po=(e,t)=>{let n=e,r=t.split(to),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=eo(),n.nextPart.set(t,i)),n=i}return n},mo=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ho=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)}}},go=`!`,_o=`:`,vo=[],yo=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),bo=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===_o){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(go)?(c=s.slice(0,-1),l=!0):s.startsWith(go)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return yo(t,l,c,u)};if(t){let e=t+_o,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):yo(vo,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},xo=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}},So=e=>({cache:ho(e.cacheSize),parseClassName:bo(e),sortModifiers:xo(e),postfixLookupClassGroupIds:Co(e),...io(e)}),Co=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},wo=/\s+/,To=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(wo),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?_+go:_,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},Eo=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Do(n))&&(i&&(i+=` `),i+=r);return i},Do=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Do(e[r]))&&(n&&(n+=` `),n+=t);return n},Oo=(e,...t)=>{let n,r,i,a,o=o=>(n=So(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=To(e,n);return i(e,a),a};return a=o,(...e)=>a(Eo(...e))},ko=[],U=e=>{let t=t=>t[e]||ko;return t.isThemeGetter=!0,t},Ao=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jo=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Mo=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,No=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Po=/\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$/,Fo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Io=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ro=e=>Mo.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),zo=e=>!!e&&Number.isInteger(Number(e)),Bo=e=>e.endsWith(`%`)&&W(e.slice(0,-1)),Vo=e=>No.test(e),Ho=()=>!0,Uo=e=>Po.test(e)&&!Fo.test(e),Wo=()=>!1,Go=e=>Io.test(e),Ko=e=>Lo.test(e),qo=e=>!G(e)&&!K(e),Jo=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)),Yo=e=>us(e,ms,Wo),G=e=>Ao.test(e),Xo=e=>us(e,hs,Uo),Zo=e=>us(e,gs,W),Qo=e=>us(e,vs,Ho),$o=e=>us(e,_s,Wo),es=e=>us(e,fs,Wo),ts=e=>us(e,ps,Ko),ns=e=>us(e,ys,Go),K=e=>jo.test(e),rs=e=>ds(e,hs),is=e=>ds(e,_s),as=e=>ds(e,fs),os=e=>ds(e,ms),ss=e=>ds(e,ps),cs=e=>ds(e,ys,!0),ls=e=>ds(e,vs,!0),us=(e,t,n)=>{let r=Ao.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ds=(e,t,n=!1)=>{let r=jo.exec(e);return r?r[1]?t(r[1]):n:!1},fs=e=>e===`position`||e===`percentage`,ps=e=>e===`image`||e===`url`,ms=e=>e===`length`||e===`size`||e===`bg-size`,hs=e=>e===`length`,gs=e=>e===`number`,_s=e=>e===`family-name`,vs=e=>e===`number`||e===`weight`,ys=e=>e===`shadow`,bs=Oo(()=>{let e=U(`color`),t=U(`font`),n=U(`text`),r=U(`font-weight`),i=U(`tracking`),a=U(`leading`),o=U(`breakpoint`),s=U(`container`),c=U(`spacing`),l=U(`radius`),u=U(`shadow`),d=U(`inset-shadow`),f=U(`text-shadow`),p=U(`drop-shadow`),m=U(`blur`),h=U(`perspective`),g=U(`aspect`),_=U(`ease`),v=U(`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(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[Ro,`full`,`auto`,...w()],ee=()=>[zo,`none`,`subgrid`,K,G],te=()=>[`auto`,{span:[`full`,zo,K,G]},zo,K,G],E=()=>[zo,`auto`,K,G],ne=()=>[`auto`,`min`,`max`,`fr`,K,G],re=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ie=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ae=()=>[`auto`,...w()],oe=()=>[Ro,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],se=()=>[Ro,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[Ro,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[e,K,G],O=()=>[...b(),as,es,{position:[K,G]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,os,Yo,{size:[K,G]}],de=()=>[Bo,rs,Xo],k=()=>[``,`none`,`full`,l,K,G],A=()=>[``,W,rs,Xo],j=()=>[`solid`,`dashed`,`dotted`,`double`],fe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],pe=()=>[W,Bo,as,es],me=()=>[``,`none`,m,K,G],M=()=>[`none`,W,K,G],he=()=>[`none`,W,K,G],N=()=>[W,K,G],ge=()=>[Ro,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Vo],breakpoint:[Vo],color:[Ho],container:[Vo],"drop-shadow":[Vo],ease:[`in`,`out`,`in-out`],font:[qo],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Vo],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Vo],shadow:[Vo],spacing:[`px`,W],text:[Vo],"text-shadow":[Vo],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Ro,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[Jo],columns:[{columns:[W,G,K,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:[zo,`auto`,K,G]}],basis:[{basis:[Ro,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[W,Ro,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,W,K,G]}],shrink:[{shrink:[``,W,K,G]}],order:[{order:[zo,`first`,`last`,`none`,K,G]}],"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":ne()}],"auto-rows":[{"auto-rows":ne()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...re(),`normal`]}],"justify-items":[{"justify-items":[...ie(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ie()]}],"align-content":[{content:[`normal`,...re()]}],"align-items":[{items:[...ie(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ie(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":re()}],"place-items":[{"place-items":[...ie(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ie()]}],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:ae()}],mx:[{mx:ae()}],my:[{my:ae()}],ms:[{ms:ae()}],me:[{me:ae()}],mbs:[{mbs:ae()}],mbe:[{mbe:ae()}],mt:[{mt:ae()}],mr:[{mr:ae()}],mb:[{mb:ae()}],ml:[{ml:ae()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:oe()}],"inline-size":[{inline:[`auto`,...se()]}],"min-inline-size":[{"min-inline":[`auto`,...se()]}],"max-inline-size":[{"max-inline":[`none`,...se()]}],"block-size":[{block:[`auto`,...ce()]}],"min-block-size":[{"min-block":[`auto`,...ce()]}],"max-block-size":[{"max-block":[`none`,...ce()]}],w:[{w:[s,`screen`,...oe()]}],"min-w":[{"min-w":[s,`screen`,`none`,...oe()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...oe()]}],h:[{h:[`screen`,`lh`,...oe()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...oe()]}],"max-h":[{"max-h":[`screen`,`lh`,...oe()]}],"font-size":[{text:[`base`,n,rs,Xo]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ls,Qo]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Bo,G]}],"font-family":[{font:[is,$o,t]}],"font-features":[{"font-features":[G]}],"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,K,G]}],"line-clamp":[{"line-clamp":[W,`none`,K,Zo]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...j(),`wavy`]}],"text-decoration-thickness":[{decoration:[W,`from-font`,`auto`,K,Xo]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[W,`auto`,K,G]}],"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:[zo,K,G]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],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`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},zo,K,G],radial:[``,K,G],conic:[zo,K,G]},ss,ts]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:k()}],"rounded-s":[{"rounded-s":k()}],"rounded-e":[{"rounded-e":k()}],"rounded-t":[{"rounded-t":k()}],"rounded-r":[{"rounded-r":k()}],"rounded-b":[{"rounded-b":k()}],"rounded-l":[{"rounded-l":k()}],"rounded-ss":[{"rounded-ss":k()}],"rounded-se":[{"rounded-se":k()}],"rounded-ee":[{"rounded-ee":k()}],"rounded-es":[{"rounded-es":k()}],"rounded-tl":[{"rounded-tl":k()}],"rounded-tr":[{"rounded-tr":k()}],"rounded-br":[{"rounded-br":k()}],"rounded-bl":[{"rounded-bl":k()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-bs":[{"border-bs":A()}],"border-w-be":[{"border-be":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":A()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...j(),`hidden`,`none`]}],"divide-style":[{divide:[...j(),`hidden`,`none`]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...j(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[W,K,G]}],"outline-w":[{outline:[``,W,rs,Xo]}],"outline-color":[{outline:D()}],shadow:[{shadow:[``,`none`,u,cs,ns]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":[`none`,d,cs,ns]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:A()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[W,Xo]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":[`none`,f,cs,ns]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[W,K,G]}],"mix-blend":[{"mix-blend":[...fe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":fe()}],"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":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":pe()}],"mask-image-linear-to-pos":[{"mask-linear-to":pe()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":pe()}],"mask-image-t-to-pos":[{"mask-t-to":pe()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":pe()}],"mask-image-r-to-pos":[{"mask-r-to":pe()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":pe()}],"mask-image-b-to-pos":[{"mask-b-to":pe()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":pe()}],"mask-image-l-to-pos":[{"mask-l-to":pe()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":pe()}],"mask-image-x-to-pos":[{"mask-x-to":pe()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":pe()}],"mask-image-y-to-pos":[{"mask-y-to":pe()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":pe()}],"mask-image-radial-to-pos":[{"mask-radial-to":pe()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"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":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":pe()}],"mask-image-conic-to-pos":[{"mask-conic-to":pe()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:me()}],brightness:[{brightness:[W,K,G]}],contrast:[{contrast:[W,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,cs,ns]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:[``,W,K,G]}],"hue-rotate":[{"hue-rotate":[W,K,G]}],invert:[{invert:[``,W,K,G]}],saturate:[{saturate:[W,K,G]}],sepia:[{sepia:[``,W,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[W,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[W,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,W,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,W,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[W,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[W,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,W,K,G]}],"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`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[W,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[W,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:M()}],"rotate-x":[{"rotate-x":M()}],"rotate-y":[{"rotate-y":M()}],"rotate-z":[{"rotate-z":M()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":[`scale-3d`],skew:[{skew:N()}],"skew-x":[{"skew-x":N()}],"skew-y":[{"skew-y":N()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ge()}],"translate-x":[{"translate-x":ge()}],"translate-y":[{"translate-y":ge()}],"translate-z":[{"translate-z":ge()}],"translate-none":[`translate-none`],zoom:[{zoom:[zo,K,G]}],accent:[{accent:D()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:D()}],"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`,K,G]}],"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":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"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`,K,G]}],fill:[{fill:[`none`,...D()]}],"stroke-w":[{stroke:[W,rs,Xo,Zo]}],stroke:[{stroke:[`none`,...D()]}],"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`]}}),xs=(...e)=>bs(Ja(e)),Ss=Za(`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`}}),Cs=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,x.jsx)(r?Pa:`button`,{className:xs(Ss({variant:t,size:n,className:e})),ref:a,...i}));Cs.displayName=`Button`;var ws=`Copying to the clipboard is not available in this browser context.`,Ts=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},Es=async e=>{let t=navigator.clipboard;if(t!==void 0&&typeof t.writeText==`function`)try{await t.writeText(e);return}catch{if(Ts(e))return;throw Error(ws)}if(!Ts(e))throw Error(ws)},Ds=1500,Os=`Copy failed`,ks=`Copying to the clipboard failed`,As=({value:e,idleText:t,idleAriaLabel:n,copiedAriaLabel:r,className:i})=>{let[a,o]=(0,_.useState)(`idle`),s=(0,_.useRef)(null);return(0,_.useEffect)(()=>()=>{s.current!==null&&clearTimeout(s.current)},[]),(0,x.jsx)(Cs,{type:`button`,variant:`ghost`,size:`sm`,className:i,"aria-label":a===`copied`?r:a===`failed`?ks:n,onClick:async()=>{try{await Es(e),o(`copied`)}catch(e){console.error(e),o(`failed`)}s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{o(`idle`),s.current=null},Ds)},children:a===`copied`?`Copied`:a===`failed`?Os:t})},js=({code:e,label:t=`Copy code`})=>(0,x.jsx)(As,{value:e,idleText:t,idleAriaLabel:t,copiedAriaLabel:`Code copied to clipboard`,className:`console-copy-code-button`}),Ms=`https://cdn.jsdelivr.net/npm/mermaid@10.9.6/dist/mermaid.min.js`,Ns=null,Ps=0,Fs=e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`dark`,themeVariables:{background:`#0d1117`,primaryColor:`#161b22`,primaryTextColor:`#e6edf3`,primaryBorderColor:`#30363d`,lineColor:`#8b949e`,fontSize:`14px`}}),e),Is=()=>Ns===null?window.mermaid===void 0?(Ns=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=Ms,n.async=!0,n.onload=()=>{if(window.mermaid===void 0){t(Error(`mermaid failed to load`));return}e(Fs(window.mermaid))},n.onerror=()=>t(Error(`mermaid script failed to load`)),document.head.appendChild(n)}),Ns):(Ns=Promise.resolve(Fs(window.mermaid)),Ns):Ns,Ls=async e=>{let t=await Is();Ps+=1;let n=`console-mermaid-${Ps}`,{svg:r}=await t.render(n,e);return Tr.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`foreignObject`]})},Rs=({code:e})=>{let[t,n]=(0,_.useState)({status:`loading`}),r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=!1;return n({status:`loading`}),Ls(e).then(e=>{t||n({status:`ready`,svg:e})}).catch(e=>{t||n({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},[e]),(0,_.useEffect)(()=>{let e=r.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.jsx)(`div`,{ref:r,className:`console-mermaid-rendered`})},zs=e=>{let t=e.querySelectorAll(`a[href]`),n=[];return t.forEach((e,t)=>{let r=e.getAttribute(`href`)??``;if(Yt(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},Bs=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},Vs=({source:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,_.useMemo)(()=>{let n=xa(e,r);return t===void 0?n:nn(n,t)},[e,t,r]),a=(0,_.useRef)(null),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)([]);return(0,_.useEffect)(()=>{let e=a.current;e!==null&&(e.innerHTML=i,l(Bs(e)),s(n===void 0?[]:zs(e)))},[i,n]),(0,x.jsxs)(`div`,{ref:a,className:`console-markdown`,children:[c.map(e=>(0,Qt.createPortal)((0,x.jsx)(js,{code:e.code}),e.host,e.key)),n!==void 0&&o.map(e=>(0,Qt.createPortal)(n(e.href,e.fallbackText),e.host,e.key))]})},Hs=({body:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,_.useMemo)(()=>Ta(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)(Rs,{code:e.code},e.key):(0,x.jsx)(Vs,{source:e.source,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r},e.key))})},Us=({title:e,count:t=null,defaultCollapsed:n=!1,headerAction:r,children:i})=>{let[a,o]=(0,_.useState)(n),s=t===null?e:`${e} (${t})`;return(0,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})]})},Ws=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`}}},Gs=()=>({directories:new Map,files:[]}),Ks=e=>e.split(`/`).filter(e=>e!==``),qs=(e,t)=>e.name.localeCompare(t.name),Js=(e,t)=>{let n=[];e.directories.forEach((e,r)=>{let i=t===``?r:`${t}/${r}`;n.push({kind:`directory`,name:r,path:i,children:Js(e,i)})}),n.sort(qs);let r=e.files.map(e=>({kind:`file`,name:Ks(e.path).at(-1)??e.path,path:e.path,file:e}));return r.sort(qs),[...n,...r]},Ys=e=>{let t=Gs();for(let n of e){let e=Ks(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=Gs();i.directories.set(e,t),i=t;continue}i=t}i.files.push(n)}return Js(t,``)},Xs=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,Zs=e=>{let t=[],n=0,r=0;for(let i of e.split(`
82
82
  `)){if(i.startsWith(`@@`)){let e=i.match(Xs);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},Qs=[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.svg`,`.avif`,`.bmp`,`.ico`],$s=e=>{let t=e.toLowerCase();return Qs.some(e=>t.endsWith(e))},ec=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,tc=e=>`${e.kind}:${e.oldLineNumber??`x`}:${e.newLineNumber??`x`}:${e.content}`,nc=({target:e,onSubmit:t,onClose:n})=>{let[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)({kind:`idle`}),s=async()=>{let n=r.trim();if(!(n.length===0||a.kind===`posting`)){o({kind:`posting`});try{await t(e.path,e.line,e.side,n),i(``),o({kind:`posted`})}catch(e){o({kind:`error`,message:e instanceof Error?e.message:`failed to post`})}}};return(0,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]})]})]})]})},rc=({patch:e,path:t,rawUrl:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,_.useState)(null);if(e===null||e===``)return t!==void 0&&$s(t)&&n!=null&&r!==void 0?(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})}):(0,x.jsx)(`p`,{className:`console-file-diff-empty`,children:`(no diff / binary or too large)`});let s=Zs(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=tc(e),r=c?ec(e):null,s=a!==null&&r!==null&&a.line===r.line&&a.side===r.side;return(0,x.jsxs)(_.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)(nc,{target:a,onSubmit:i,onClose:()=>o(null)})})})]},n)})})})},ic=e=>({paddingLeft:`${e*16}px`}),ac=({file:e,depth:t,name:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,_.useState)(!1),s=Ws(e.status);return(0,x.jsxs)(`li`,{className:`console-file`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-file-row`,style:ic(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)(rc,{patch:e.patch,path:e.path,rawUrl:e.rawUrl,buildImageProxyUrl:r,onAddInlineComment:i})]})},oc=({node:e,depth:t,buildImageProxyUrl:n,onAddInlineComment:r})=>e.kind===`file`?(0,x.jsx)(ac,{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:ic(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)(oc,{node:e,depth:t+1,buildImageProxyUrl:n,onAddInlineComment:r},e.path))})]}),sc=({files:e,isLoading:t,error:n,buildImageProxyUrl:r,onAddInlineComment:i})=>n===null?t?(0,x.jsx)(`p`,{className:`console-files-loading`,children:`Loading changed files...`}):e.length===0?(0,x.jsx)(`p`,{className:`console-files-empty`,children:`No changed files.`}):(0,x.jsx)(`ul`,{className:`console-files console-file-tree`,children:Ys(e).map(e=>(0,x.jsx)(oc,{node:e,depth:0,buildImageProxyUrl:r,onAddInlineComment:i},e.path))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-files-error`,children:[`Failed to load changed files: `,n]}),cc=({comments:e,isLoading:t,error:n,now:r,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})=>{let[s,c]=(0,_.useState)(!1);if(n!==null)return(0,x.jsxs)(`p`,{role:`alert`,className:`console-comment-error`,children:[`Failed to load comments: `,n]});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 l=s?e:e.slice(-1);return(0,x.jsxs)(`div`,{className:`console-comment-list`,children:[!s&&e.length>1&&(0,x.jsxs)(`button`,{type:`button`,className:`console-comment-show-all`,onClick:()=>c(!0),children:[`Show all `,e.length]}),l.map(e=>(0,x.jsxs)(`article`,{className:`console-comment`,children:[(0,x.jsxs)(`header`,{className:`console-comment-header`,children:[(0,x.jsx)(`span`,{className:`console-comment-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-comment-time`,children:ie(e.createdAt,r)})]}),(0,x.jsx)(Hs,{body:e.body,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})]},`${e.author}:${e.createdAt}:${e.body}`))]})},lc=e=>e.slice(0,7),uc=e=>e.split(`
83
- `)[0],dc=({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:uc(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:lc(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:ie(e.authoredAt,r)})]},e.sha))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-commits-error`,children:[`Failed to load commits: `,n]}),fc=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(As,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),pc={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`}},mc=({mergeableStatus:e})=>{let t=pc[e],n=le(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})},hc=e=>{let t=le(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},gc=({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:hc(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:hc(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},_c=({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=Yt(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)(mc,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(gc,{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)(fc,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[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)(Us,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Hs,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Us,{title:`Changed files`,count:g,children:(0,x.jsx)(sc,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Us,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(dc,{commits:o,isLoading:s,error:c,now:l})})]})},vc=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,state:i,body:a,bodyIsLoading:o,bodyError:s,comments:c,hasPostedComment:l=!1,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:ne})=>{let re=i?.state??`open`,oe=i?.merged??!1,se=!e.isPr&&re===`closed`?`Closed`:null,D=Xt(e.nameWithOwner)??void 0,O=le(n),ue=r?le(r.color):null,de=p||m!==null?null:f.length,k=u||d!==null?null:c.length,A=g||_!==null?null:h.length,j=e.isPr&&y?.found?[{url:e.url,mergeableStatus:y.mergeableStatus}]:S.map(e=>({url:e.pullRequest.url,mergeableStatus:e.pullRequest.mergeableStatus}));return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:O.dot}}),t]}),e.isPr&&y?.found&&(0,x.jsx)(gc,{isPassedAllCiJob:y.isPassedAllCiJob,isCiStateSuccess:y.isCiStateSuccess,isBranchOutOfDate:y.isBranchOutOfDate,missingRequiredCheckNames:y.missingRequiredCheckNames}),j.map(e=>(0,x.jsx)(mc,{mergeableStatus:e.mergeableStatus},e.url))]}),(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[r!==null&&ue!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:ue.fg,borderColor:ue.border,backgroundColor:ue.bg},children:r.name}),(0,x.jsx)(ce,{isPr:e.isPr,state:re,merged:oe,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}`}),se!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:se})]}),v!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load item state: `,v]}),e.isPr&&b!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load pull request status: `,b]}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:e.isPr?`PR #${e.number}`:`Issue #${e.number}`}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsx)(`span`,{className:`console-detail-pill`,children:e.isPr?`PR`:`Issue`}),(0,x.jsx)(fc,{url:e.url})]}),e.labels.length>0&&(0,x.jsx)(`div`,{className:`console-detail-labels`,children:e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))}),(0,x.jsxs)(`div`,{className:`console-detail-createdat`,title:ae(e.createdAt),children:[`opened `,ie(e.createdAt,w)]}),(0,x.jsx)(Us,{title:`Description`,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:s===null?o?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(Hs,{body:a,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:D}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-body-error`,children:[`Failed to load description: `,s]})}),e.isPr&&(0,x.jsx)(Us,{title:`Changed files`,count:de,children:(0,x.jsx)(sc,{files:f,isLoading:p,error:m,onAddInlineComment:ne})}),(0,x.jsx)(Us,{title:`Comments`,count:k,defaultCollapsed:e.isPr&&!l,children:(0,x.jsx)(cc,{comments:c,isLoading:u,error:d,now:w,buildImageProxyUrl:te,renderReferenceLink:E,repoContext:D})},l?`comments-with-posted`:`comments`),e.isPr&&(0,x.jsx)(Us,{title:`Commits`,count:A,defaultCollapsed:!0,children:(0,x.jsx)(dc,{commits:h,isLoading:g,error:_,now:w})}),!e.isPr&&C!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load related pull requests: `,C]}),!e.isPr&&S.map(e=>(0,x.jsx)(_c,{pullRequest:e.pullRequest,body:e.pullRequest.summary?.body??``,bodyIsLoading:!1,files:e.files,filesAreLoading:e.filesAreLoading,filesError:e.filesError,commits:e.commits,commitsAreLoading:e.commitsAreLoading,commitsError:e.commitsError,now:w,buildImageProxyUrl:te,renderReferenceLink:E,onAddInlineComment:ne},e.pullRequest.url)),(0,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})]})]})},yc=({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`})]}),bc=({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_1day`),children:`+1 day`}),(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`})]}),xc=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve`,label:`Approve`,variant:`approve`}],Sc=`Reject needs an inline comment on the diff.`,Cc=({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:Sc}),xc.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)})]}),wc=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},Tc=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=M.map(t=>({name:t,option:wc(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=le(r.color),a=e===he;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)})})},Ec=e=>e.name.toLowerCase().includes(`no story`),Dc=({storyOptions:e,onSetStory:t})=>{let n=e.filter(e=>!Ec(e));return n.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group console-op-group-stories`,children:n.map(e=>{let n=le(e.color);return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},onClick:()=>t(e),children:e.name},e.id)})})},Oc=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,handlers:a})=>{let o=e===`triage`;return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(Cc,{onReview:a.onReview,rejectEnabled:n}),(0,x.jsx)(bc,{isManualTriage:N(e),onSetNextActionDate:a.onSetNextActionDate}),o&&(0,x.jsx)(Dc,{storyOptions:i,onSetStory:a.onSetStory}),(0,x.jsx)(Tc,{statusOptions:r,onSetStatus:a.onSetStatus,onSetInTmuxByHuman:a.onSetInTmuxByHuman}),(0,x.jsx)(yc,{onClose:a.onClose})]})},kc=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,_.useState)(i??r),[s,c]=(0,_.useState)(t!==null&&i===void 0),[l,u]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},Ac=[],jc=[],Mc=[],Nc=[],Pc={state:`open`,merged:!1,isPullRequest:!1,title:``},Fc={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Ic=(e,t)=>{let n=t===null?null:`${t.repo}#${t.number}`,r=t===null?null:t.url,i=t?.isPr??!1,a=kc(e.body,n,r,``),o=kc(e.state,n,r,Pc),s=kc(e.comments,n,r,Ac),c=kc(e.files,i?n:null,i?r:null,jc),l=kc(e.commits,i?n:null,i?r:null,Mc),u=kc(e.prStatus,i?n:null,i?r:null,Fc),d=kc(e.relatedPrs,i?null:n,i?null:r,Nc),[f,p]=(0,_.useState)([]);return(0,_.useEffect)(()=>{if(i||d.data.length===0){p([]);return}let t=!1,n=d.data.map(e=>({pullRequest:e,files:jc,filesAreLoading:!0,filesError:null,commits:Mc,commitsAreLoading:!0,commitsError:null}));p(n);let r=(e,n)=>{t||p(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of d.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,i,d.data]),{state:o.data,body:a.data,bodyIsLoading:a.isLoading,bodyError:a.error,comments:s.data,commentsAreLoading:s.isLoading,commentsError:s.error,files:c.data,filesAreLoading:c.isLoading,filesError:c.error,commits:l.data,commitsAreLoading:l.isLoading,commitsError:l.error,stateError:o.error,pullRequestStatus:i?u.data:null,pullRequestStatusError:i?u.error:null,relatedPullRequests:f,relatedPullRequestsError:i?null:d.error}},Lc=e=>JSON.stringify([e.author,e.createdAt,e.body]),Rc=(e,t)=>{let n=new Set(e.map(Lc));return[...e,...t.filter(e=>!n.has(Lc(e)))]},zc=({href:e,fallbackText:t,state:n})=>n===null||n.title.trim()===``?(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t}):(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(ce,{...Zt(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title})]}),Bc=(e,t)=>{let[n,r]=(0,_.useState)(()=>e.peek(t)??null);return(0,_.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},Vc=({cache:e,href:t,fallbackText:n})=>(0,x.jsx)(zc,{href:t,fallbackText:n,state:Bc(e,t)}),Hc=({tab:e,item:t,caches:n,operations:r,statusOptions:i,storyOptions:a,storyColors:o,storyName:s,overlayStatus:c,now:l,onQueueAction:u})=>{let d=Ic(n,t),f=(0,_.useCallback)(e=>tn(e),[]),p=(0,_.useCallback)((e,t)=>(0,x.jsx)(Vc,{cache:n.state,href:e,fallbackText:t}),[n.state]),m=t.isPr||t.relatedOpenPullRequestUrls.length>0||d.relatedPullRequests.length>0,[h,g]=(0,_.useState)([]),v=(0,_.useCallback)(async(e,t,n,r)=>{g(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[y,b]=(0,_.useState)([]),S=(0,_.useCallback)(async e=>{let n=await r.addComment(t,e);return b(e=>[...e,n]),n},[t,r]),C={onReview:e=>{let n=t.isPr?t.url:d.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,i=e===`request_changes`?h:[];u({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,i)})},onSetNextActionDate:e=>{u({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e)})},onSetStory:e=>{u({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e)})},onSetStatus:e=>{u({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e)})},onSetInTmuxByHuman:e=>{u({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e)})},onClose:e=>{u({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e)})}},T=s??(t.story.trim()===``?null:t.story);return(0,x.jsx)(vc,{item:t,storyName:T,storyColorEnum:T===null?null:w(o,T),overlayStatus:c,state:d.state,stateError:d.stateError,body:d.body,bodyIsLoading:d.bodyIsLoading,bodyError:d.bodyError,comments:Rc(d.comments,y),hasPostedComment:y.length>0,commentsAreLoading:d.commentsAreLoading,commentsError:d.commentsError,files:d.files,filesAreLoading:d.filesAreLoading,filesError:d.filesError,commits:d.commits,commitsAreLoading:d.commitsAreLoading,commitsError:d.commitsError,pullRequestStatus:d.pullRequestStatus,pullRequestStatusError:d.pullRequestStatusError,relatedPullRequests:d.relatedPullRequests,relatedPullRequestsError:d.relatedPullRequestsError,now:l,buildImageProxyUrl:f,renderReferenceLink:p,onAddInlineComment:v,commentComposer:(0,x.jsx)(qt,{initiallyOpen:!0,onSubmit:S,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Oc,{tab:e,item:t,hasPullRequest:m,rejectEnabled:h.length>0,statusOptions:i,storyOptions:a,handlers:C})})},Uc=()=>{let e={};for(let t of y)e[t.name]=0;return e},Wc=`console`,Gc=()=>{let e=Ot(),{snapshots:t,isLoading:n,error:r}=Ht(e),i=Et(e??Wc),a=(0,_.useMemo)(()=>{let e=Uc();for(let n of y){let r=t[n.name];r!==null&&(e[n.name]=pt(r.items,ht(i.overlay,r.generatedAt)))}return e},[t,i.overlay]),o=lt(e,a),{activeTab:s,selectedItemKey:c,openItem:l,closeItem:u,selectTab:d}=o,f=Qe(),p=St(e,s,i,f),m=Ee(),h=Date.now(),g=t[s],v=(0,_.useMemo)(()=>g===null?[]:mt(g.items,ht(i.overlay,g.generatedAt)),[g,i.overlay]),b=(0,_.useMemo)(()=>v.map(e=>dt(e)),[v]),C=(0,_.useMemo)(()=>ee(v,i.overlay),[v,i.overlay]),w=g?.storyColors??{},te=g?.statusOptions??[],E=g?.storyOptions??[],ne=g?.generatedAt??null,re=(0,_.useMemo)(()=>c===null||g===null?null:g.items.find(e=>e.projectItemId===c)??null,[c,g]);it(f,re,v),(0,_.useEffect)(()=>{c!==null&&window.scrollTo({top:0})},[c]);let ie=a[s],ae=(0,_.useRef)({tab:s,count:ie});(0,_.useEffect)(()=>{let e=ae.current;if(ae.current={tab:s,count:ie},e.tab===s&&e.count>0&&ie===0){let e=at(s,a);e!==null&&(d(e),u())}},[s,ie,a,d,u]);let oe=re===null?null:gt(i.overlay,re,t[s]?.generatedAt??null),se=re===null?null:T(re,i.overlay),ce=(0,_.useCallback)(e=>{let t=Ut(b,e);t===null?u():l(t)},[b,l,u]),D=(0,_.useCallback)(e=>{let t=dt(e.item);m.enqueue({message:xe(e.kind,e.item,s),color:ye(e.kind),commit:e.commit,advance:()=>{be(e.kind,s)&&ce(t)}})},[m,s,ce]),O=Mt((0,_.useCallback)(e=>{if(c===null||e===null)return;let t=e===`next`?Wt(b,c):Gt(b,c);t!==null&&l(t)},[c,b,l]));return(0,x.jsxs)(`main`,{className:`console-app`,children:[m.pending!==null&&(0,x.jsx)(k,{message:m.pending.message,color:m.pending.color,remainingSeconds:m.pending.remainingSeconds,progress:m.pending.progress,onUndo:m.undo}),m.error!==null&&(0,x.jsx)(A,{message:`Operation failed: ${m.error.reason}`,onDismiss:m.dismissError}),(0,x.jsx)(S,{activeTab:s,counts:a,pjcode:e,generatedAt:ne,tabHref:o.tabHref,onSelectTab:o.selectTab}),re===null?(0,x.jsx)(de,{rows:C,storyColors:w,activeItemId:null,now:h,isLoading:n,error:r,onSelectItem:e=>o.openItem(e.projectItemId)}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:O,children:(0,x.jsx)(Hc,{tab:s,item:re,caches:f,operations:p,statusOptions:te,storyOptions:E,storyColors:w,storyName:se,overlayStatus:oe,now:h,onQueueAction:D},re.projectItemId)})]})},Kc=document.getElementById(`root`);if(Kc===null)throw Error(`Root container #root not found`);(0,v.createRoot)(Kc).render((0,x.jsx)(_.StrictMode,{children:(0,x.jsx)(Gc,{})}));
83
+ `)[0],dc=({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:uc(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:lc(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:ie(e.authoredAt,r)})]},e.sha))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-commits-error`,children:[`Failed to load commits: `,n]}),fc=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(As,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),pc={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`}},mc=({mergeableStatus:e})=>{let t=pc[e],n=le(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})},hc=e=>{let t=le(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},gc=({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:hc(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:hc(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},_c=({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=Yt(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)(mc,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(gc,{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)(fc,{url:e.url,label:`Copy PR URL`}),(0,x.jsxs)(`div`,{className:`console-pr-statbar`,children:[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)(Us,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Hs,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Us,{title:`Changed files`,count:g,children:(0,x.jsx)(sc,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Us,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(dc,{commits:o,isLoading:s,error:c,now:l})})]})},vc=({item:e,storyName:t,storyColorEnum:n,overlayStatus:r,state:i,body:a,bodyIsLoading:o,bodyError:s,comments:c,commentsAreLoading:l,commentsError:u,files:d,filesAreLoading:f,filesError:p,commits:m,commitsAreLoading:h,commitsError:g,stateError:_,pullRequestStatus:v,pullRequestStatusError:y,relatedPullRequests:b,relatedPullRequestsError:S,now:C,commentComposer:w,operationBar:T,buildImageProxyUrl:ee,renderReferenceLink:te,onAddInlineComment:E})=>{let ne=i?.state??`open`,re=i?.merged??!1,oe=!e.isPr&&ne===`closed`?`Closed`:null,se=Xt(e.nameWithOwner)??void 0,D=le(n),O=r?le(r.color):null,ue=f||p!==null?null:d.length,de=l||u!==null?null:c.length,k=h||g!==null?null:m.length,A=e.isPr&&v?.found?[{url:e.url,mergeableStatus:v.mergeableStatus}]:b.map(e=>({url:e.pullRequest.url,mergeableStatus:e.pullRequest.mergeableStatus}));return(0,x.jsxs)(`article`,{className:`console-detail`,children:[(0,x.jsxs)(`div`,{className:`console-detail-topline`,children:[t!==null&&(0,x.jsxs)(`span`,{className:`console-storytag`,children:[(0,x.jsx)(`span`,{className:`console-story-dot`,style:{backgroundColor:D.dot}}),t]}),e.isPr&&v?.found&&(0,x.jsx)(gc,{isPassedAllCiJob:v.isPassedAllCiJob,isCiStateSuccess:v.isCiStateSuccess,isBranchOutOfDate:v.isBranchOutOfDate,missingRequiredCheckNames:v.missingRequiredCheckNames}),A.map(e=>(0,x.jsx)(mc,{mergeableStatus:e.mergeableStatus},e.url))]}),(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[r!==null&&O!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:O.fg,borderColor:O.border,backgroundColor:O.bg},children:r.name}),(0,x.jsx)(ce,{isPr:e.isPr,state:ne,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}`}),oe!==null&&(0,x.jsx)(`span`,{className:`console-detail-closed-label`,children:oe})]}),_!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load item state: `,_]}),e.isPr&&y!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load pull request status: `,y]}),(0,x.jsxs)(`div`,{className:`console-detail-subbar`,children:[(0,x.jsx)(`a`,{href:e.url,className:`console-detail-link`,target:`_blank`,rel:`noopener noreferrer`,children:e.isPr?`PR #${e.number}`:`Issue #${e.number}`}),(0,x.jsx)(`span`,{className:`console-detail-repo`,children:e.repo}),(0,x.jsx)(`span`,{className:`console-detail-pill`,children:e.isPr?`PR`:`Issue`}),(0,x.jsx)(fc,{url:e.url})]}),e.labels.length>0&&(0,x.jsx)(`div`,{className:`console-detail-labels`,children:e.labels.map(e=>(0,x.jsx)(`span`,{className:`console-label-chip`,children:e},e))}),(0,x.jsxs)(`div`,{className:`console-detail-createdat`,title:ae(e.createdAt),children:[`opened `,ie(e.createdAt,C)]}),(0,x.jsx)(Us,{title:`Description`,headerAction:(0,x.jsx)(`a`,{href:e.url,className:`console-panel-open-link`,target:`_blank`,rel:`noopener noreferrer`,children:`open`}),children:s===null?o?(0,x.jsx)(`p`,{className:`console-detail-body-loading`,children:`Loading description...`}):(0,x.jsx)(Hs,{body:a,buildImageProxyUrl:ee,renderReferenceLink:te,repoContext:se}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-body-error`,children:[`Failed to load description: `,s]})}),e.isPr&&(0,x.jsx)(Us,{title:`Changed files`,count:ue,children:(0,x.jsx)(sc,{files:d,isLoading:f,error:p,onAddInlineComment:E})}),(0,x.jsx)(Us,{title:`Comments`,count:de,defaultCollapsed:e.isPr,children:(0,x.jsx)(cc,{comments:c,isLoading:l,error:u,now:C,buildImageProxyUrl:ee,renderReferenceLink:te,repoContext:se})}),e.isPr&&(0,x.jsx)(Us,{title:`Commits`,count:k,defaultCollapsed:!0,children:(0,x.jsx)(dc,{commits:m,isLoading:h,error:g,now:C})}),!e.isPr&&S!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load related pull requests: `,S]}),!e.isPr&&b.map(e=>(0,x.jsx)(_c,{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:C,buildImageProxyUrl:ee,renderReferenceLink:te,onAddInlineComment:E},e.pullRequest.url)),(0,x.jsxs)(`div`,{className:`console-detail-dock`,children:[(0,x.jsx)(`div`,{className:`console-detail-dock-composer`,children:w}),(0,x.jsx)(`div`,{className:`console-actionbar`,children:T})]})]})},yc=({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`})]}),bc=({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_1day`),children:`+1 day`}),(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`})]}),xc=[{action:`unnecessary`,label:`Unnecessary`,variant:`unneeded`},{action:`totally_wrong`,label:`Totally wrong`,variant:`wrong`},{action:`request_changes`,label:`Reject`,variant:`reject`},{action:`approve`,label:`Approve`,variant:`approve`}],Sc=`Reject needs an inline comment on the diff.`,Cc=({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:Sc}),xc.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)})]}),wc=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},Tc=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=M.map(t=>({name:t,option:wc(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=le(r.color),a=e===he;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)})})},Ec=e=>e.name.toLowerCase().includes(`no story`),Dc=({storyOptions:e,onSetStory:t})=>{let n=e.filter(e=>!Ec(e));return n.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group console-op-group-stories`,children:n.map(e=>{let n=le(e.color);return(0,x.jsx)(`button`,{type:`button`,className:`console-op-button`,style:{color:n.fg,borderColor:n.border,backgroundColor:n.bg},onClick:()=>t(e),children:e.name},e.id)})})},Oc=({tab:e,hasPullRequest:t,rejectEnabled:n,statusOptions:r,storyOptions:i,handlers:a})=>{let o=e===`triage`;return(0,x.jsxs)(`div`,{className:`console-operation-bar`,children:[t&&(0,x.jsx)(Cc,{onReview:a.onReview,rejectEnabled:n}),(0,x.jsx)(bc,{isManualTriage:N(e),onSetNextActionDate:a.onSetNextActionDate}),o&&(0,x.jsx)(Dc,{storyOptions:i,onSetStory:a.onSetStory}),(0,x.jsx)(Tc,{statusOptions:r,onSetStatus:a.onSetStatus,onSetInTmuxByHuman:a.onSetInTmuxByHuman}),(0,x.jsx)(yc,{onClose:a.onClose})]})},kc=(e,t,n,r)=>{let i=t===null?void 0:e.peek(t),[a,o]=(0,_.useState)(i??r),[s,c]=(0,_.useState)(t!==null&&i===void 0),[l,u]=(0,_.useState)(null);return(0,_.useEffect)(()=>{if(t===null||n===null)return;let r=e.peek(t);if(r!==void 0){o(r),c(!1),u(null);return}let i=!1;return c(!0),u(null),e.load(t,n).then(e=>{i||(o(e),c(!1))}).catch(e=>{i||(u(e instanceof Error?e.message:String(e)),c(!1))}),()=>{i=!0}},[e,t,n]),{data:a,isLoading:s,error:l}},Ac=[],jc=[],Mc=[],Nc=[],Pc={state:`open`,merged:!1,isPullRequest:!1,title:``},Fc={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},Ic=(e,t)=>{let n=t===null?null:`${t.repo}#${t.number}`,r=t===null?null:t.url,i=t?.isPr??!1,a=kc(e.body,n,r,``),o=kc(e.state,n,r,Pc),s=kc(e.comments,n,r,Ac),c=kc(e.files,i?n:null,i?r:null,jc),l=kc(e.commits,i?n:null,i?r:null,Mc),u=kc(e.prStatus,i?n:null,i?r:null,Fc),d=kc(e.relatedPrs,i?null:n,i?null:r,Nc),[f,p]=(0,_.useState)([]);return(0,_.useEffect)(()=>{if(i||d.data.length===0){p([]);return}let t=!1,n=d.data.map(e=>({pullRequest:e,files:jc,filesAreLoading:!0,filesError:null,commits:Mc,commitsAreLoading:!0,commitsError:null}));p(n);let r=(e,n)=>{t||p(t=>t.map(t=>t.pullRequest.url===e?{...t,...n}:t))};for(let t of d.data){let n=t.url;e.files.load(n,t.url).then(e=>r(t.url,{files:e,filesAreLoading:!1})).catch(e=>r(t.url,{filesAreLoading:!1,filesError:e instanceof Error?e.message:String(e)})),e.commits.load(n,t.url).then(e=>r(t.url,{commits:e,commitsAreLoading:!1})).catch(e=>r(t.url,{commitsAreLoading:!1,commitsError:e instanceof Error?e.message:String(e)}))}return()=>{t=!0}},[e,i,d.data]),{state:o.data,body:a.data,bodyIsLoading:a.isLoading,bodyError:a.error,comments:s.data,commentsAreLoading:s.isLoading,commentsError:s.error,files:c.data,filesAreLoading:c.isLoading,filesError:c.error,commits:l.data,commitsAreLoading:l.isLoading,commitsError:l.error,stateError:o.error,pullRequestStatus:i?u.data:null,pullRequestStatusError:i?u.error:null,relatedPullRequests:f,relatedPullRequestsError:i?null:d.error}},Lc=e=>JSON.stringify([e.author,e.createdAt,e.body]),Rc=(e,t)=>{let n=new Set(e.map(Lc));return[...e,...t.filter(e=>!n.has(Lc(e)))]},zc=({href:e,fallbackText:t,state:n})=>n===null||n.title.trim()===``?(0,x.jsx)(`a`,{className:`console-markdown-reference console-markdown-reference-plain`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:t}):(0,x.jsxs)(`a`,{className:`console-markdown-reference`,href:e,target:`_blank`,rel:`noopener noreferrer`,children:[(0,x.jsx)(ce,{...Zt(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title})]}),Bc=(e,t)=>{let[n,r]=(0,_.useState)(()=>e.peek(t)??null);return(0,_.useEffect)(()=>{let n=e.peek(t);if(n!==void 0){r(n);return}let i=!1;return r(null),e.load(t,t).then(e=>{i||r(e)}).catch(()=>{i||r(null)}),()=>{i=!0}},[e,t]),n},Vc=({cache:e,href:t,fallbackText:n})=>(0,x.jsx)(zc,{href:t,fallbackText:n,state:Bc(e,t)}),Hc=({tab:e,item:t,caches:n,operations:r,statusOptions:i,storyOptions:a,storyColors:o,storyName:s,overlayStatus:c,now:l,onQueueAction:u})=>{let d=Ic(n,t),f=(0,_.useCallback)(e=>tn(e),[]),p=(0,_.useCallback)((e,t)=>(0,x.jsx)(Vc,{cache:n.state,href:e,fallbackText:t}),[n.state]),m=t.isPr||t.relatedOpenPullRequestUrls.length>0||d.relatedPullRequests.length>0,[h,g]=(0,_.useState)([]),v=(0,_.useCallback)(async(e,t,n,r)=>{g(i=>[...i,{path:e,line:t,side:n,body:r}])},[]),[y,b]=(0,_.useState)([]),S=(0,_.useCallback)(async e=>{let n=await r.addComment(t,e);return b(e=>[...e,n]),n},[t,r]),C={onReview:e=>{let n=t.isPr?t.url:d.relatedPullRequests[0]?.pullRequest.url??t.relatedOpenPullRequestUrls[0]??t.url,i=e===`request_changes`?h:[];u({kind:{type:`review`,action:e},item:t,commit:()=>r.reviewPullRequest(t,n,e,i)})},onSetNextActionDate:e=>{u({kind:{type:`next_action_date`,action:e},item:t,commit:()=>r.setNextActionDate(t,e)})},onSetStory:e=>{u({kind:{type:`set_story`,optionName:e.name},item:t,commit:()=>r.setStory(t,e)})},onSetStatus:e=>{u({kind:{type:`set_status`,optionName:e.name},item:t,commit:()=>r.setStatus(t,e)})},onSetInTmuxByHuman:e=>{u({kind:{type:`set_in_tmux_by_human`,optionName:e.name},item:t,commit:()=>r.setInTmuxByHuman(t,e)})},onClose:e=>{u({kind:{type:`close`,action:e},item:t,commit:()=>r.closeIssue(t,e)})}},T=s??(t.story.trim()===``?null:t.story);return(0,x.jsx)(vc,{item:t,storyName:T,storyColorEnum:T===null?null:w(o,T),overlayStatus:c,state:d.state,stateError:d.stateError,body:d.body,bodyIsLoading:d.bodyIsLoading,bodyError:d.bodyError,comments:Rc(d.comments,y),commentsAreLoading:d.commentsAreLoading,commentsError:d.commentsError,files:d.files,filesAreLoading:d.filesAreLoading,filesError:d.filesError,commits:d.commits,commitsAreLoading:d.commitsAreLoading,commitsError:d.commitsError,pullRequestStatus:d.pullRequestStatus,pullRequestStatusError:d.pullRequestStatusError,relatedPullRequests:d.relatedPullRequests,relatedPullRequestsError:d.relatedPullRequestsError,now:l,buildImageProxyUrl:f,renderReferenceLink:p,onAddInlineComment:v,commentComposer:(0,x.jsx)(qt,{initiallyOpen:!0,onSubmit:S,onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Oc,{tab:e,item:t,hasPullRequest:m,rejectEnabled:h.length>0,statusOptions:i,storyOptions:a,handlers:C})})},Uc=()=>{let e={};for(let t of y)e[t.name]=0;return e},Wc=`console`,Gc=()=>{let e=Ot(),{snapshots:t,isLoading:n,error:r}=Ht(e),i=Et(e??Wc),a=(0,_.useMemo)(()=>{let e=Uc();for(let n of y){let r=t[n.name];r!==null&&(e[n.name]=pt(r.items,ht(i.overlay,r.generatedAt)))}return e},[t,i.overlay]),o=lt(e,a),{activeTab:s,selectedItemKey:c,openItem:l,closeItem:u,selectTab:d}=o,f=Qe(),p=St(e,s,i,f),m=Ee(),h=Date.now(),g=t[s],v=(0,_.useMemo)(()=>g===null?[]:mt(g.items,ht(i.overlay,g.generatedAt)),[g,i.overlay]),b=(0,_.useMemo)(()=>v.map(e=>dt(e)),[v]),C=(0,_.useMemo)(()=>ee(v,i.overlay),[v,i.overlay]),w=g?.storyColors??{},te=g?.statusOptions??[],E=g?.storyOptions??[],ne=g?.generatedAt??null,re=(0,_.useMemo)(()=>c===null||g===null?null:g.items.find(e=>e.projectItemId===c)??null,[c,g]);it(f,re,v),(0,_.useEffect)(()=>{c!==null&&window.scrollTo({top:0})},[c]);let ie=a[s],ae=(0,_.useRef)({tab:s,count:ie});(0,_.useEffect)(()=>{let e=ae.current;if(ae.current={tab:s,count:ie},e.tab===s&&e.count>0&&ie===0){let e=at(s,a);e!==null&&(d(e),u())}},[s,ie,a,d,u]);let oe=re===null?null:gt(i.overlay,re,t[s]?.generatedAt??null),se=re===null?null:T(re,i.overlay),ce=(0,_.useCallback)(e=>{let t=Ut(b,e);t===null?u():l(t)},[b,l,u]),D=(0,_.useCallback)(e=>{let t=dt(e.item);m.enqueue({message:xe(e.kind,e.item,s),color:ye(e.kind),commit:e.commit,advance:()=>{be(e.kind,s)&&ce(t)}})},[m,s,ce]),O=Mt((0,_.useCallback)(e=>{if(c===null||e===null)return;let t=e===`next`?Wt(b,c):Gt(b,c);t!==null&&l(t)},[c,b,l]));return(0,x.jsxs)(`main`,{className:`console-app`,children:[m.pending!==null&&(0,x.jsx)(k,{message:m.pending.message,color:m.pending.color,remainingSeconds:m.pending.remainingSeconds,progress:m.pending.progress,onUndo:m.undo}),m.error!==null&&(0,x.jsx)(A,{message:`Operation failed: ${m.error.reason}`,onDismiss:m.dismissError}),(0,x.jsx)(S,{activeTab:s,counts:a,pjcode:e,generatedAt:ne,tabHref:o.tabHref,onSelectTab:o.selectTab}),re===null?(0,x.jsx)(de,{rows:C,storyColors:w,activeItemId:null,now:h,isLoading:n,error:r,onSelectItem:e=>o.openItem(e.projectItemId)}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:O,children:(0,x.jsx)(Hc,{tab:s,item:re,caches:f,operations:p,statusOptions:te,storyOptions:E,storyColors:w,storyName:se,overlayStatus:oe,now:h,onQueueAction:D},re.projectItemId)})]})},Kc=document.getElementById(`root`);if(Kc===null)throw Error(`Root container #root not found`);(0,v.createRoot)(Kc).render((0,x.jsx)(_.StrictMode,{children:(0,x.jsx)(Gc,{})}));
@@ -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-DR_LIP9n.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-BooMHl5Y.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-lemrqYKZ.css">
9
9
  </head>
10
10
  <body>