github-issue-tower-defence-management 1.148.8 → 1.148.10

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,17 @@
1
+ ## [1.148.10](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.148.9...v1.148.10) (2026-08-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **console:** render issue and pull request references inside a related pull request description ([#1487](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/issues/1487)) ([56d4946](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/56d4946ecd4c1ff13c2abe283808739a32c86c3a))
7
+
8
+ ## [1.148.9](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.148.8...v1.148.9) (2026-08-10)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **command-runner:** keep command stdout past one mebibyte so security scans are not silently emptied ([#1485](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/issues/1485)) ([6a78747](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/6a787479c690e9727d153a5ee6195ebf9d10cb3f))
14
+
1
15
  ## [1.148.8](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.148.7...v1.148.8) (2026-08-09)
2
16
 
3
17
 
@@ -79,4 +79,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
79
79
  `)}),o+=1,i=null;continue}i.push(e);continue}if(fa(e)){r.push(e),a=!0;continue}r.push(e)}return i!==null&&r.push("```mermaid",...i),s(),n},ha=/^https:\/\/github\.com\/([^/\s]+)\/([^/\s]+)\/(issues|pull)\/(\d+)(?:[#?].*)?$/,ga=e=>{let t=ha.exec(e.trim());if(t===null)return null;let[,n,r,i,a]=t,o=Number.parseInt(a,10);return Number.isFinite(o)?{owner:n,repo:r,number:o,kind:i===`pull`?`pull`:`issue`}:null},_a=e=>{let t=e.indexOf(`/`);if(t<=0)return null;let n=e.slice(0,t),r=e.slice(t+1);return n===``||r===``||r.includes(`/`)?null:{owner:n,repo:r}},va=e=>({isPr:e.isPullRequest,state:e.state.toLowerCase(),merged:e.merged,isDraft:!1,stateReason:``}),ya=Object.defineProperty,ba=(e,t)=>ya(e,`name`,{value:t,configurable:!0});function xa(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ba(xa,`setRef`);function Sa(...e){return t=>{let n=!1,r=e.map(e=>{let r=xa(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():xa(e[t],null)}}}}ba(Sa,`composeRefs`);function Ca(...e){return _.useCallback(Sa(...e),e)}ba(Ca,`useComposedRefs`);var wa=Object.defineProperty,Ta=(e,t)=>wa(e,`name`,{value:t,configurable:!0});function Ea(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Fa(r)&&typeof za==`function`&&(r=za(r._payload)),_.Children.forEach(r,e=>{if(Na(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Fa(n)&&typeof za==`function`&&(n=za(n._payload)),a=Aa(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?Ma(a):void 0,l=Ca(n,c);if(!a){if(r||r===0)throw Error(o?Ra(e):La(e));return r}let u=ja(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Ta(Ea,`createSlot`);var Da=Ea(`Slot`),Oa=Symbol.for(`radix.slottable`);function ka(e){let t=Ta(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Oa,t}Ta(ka,`createSlottable`);var Aa=Ta((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 ja(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}}Ta(ja,`mergeProps`);function Ma(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)}Ta(Ma,`getElementRef`);function Na(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Oa}Ta(Na,`isSlottable`);var Pa=Symbol.for(`react.lazy`);function Fa(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Pa&&`_payload`in e&&Ia(e._payload)}Ta(Fa,`isLazyComponent`);function Ia(e){return typeof e==`object`&&!!e&&`then`in e}Ta(Ia,`isPromiseLike`);var La=Ta(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ra=Ta(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),za=_.use;function Ba(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=Ba(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Va(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ba(e))&&(r&&(r+=` `),r+=t);return r}var Ha=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ua=Va,Wa=(e,t)=>n=>{if(t?.variants==null)return Ua(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=Ha(t)||Ha(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 Ua(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)},Ga=(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},Ka=(e,t)=>({classGroupId:e,validator:t}),qa=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ja=`-`,Ya=[],Xa=`arbitrary..`,Za=e=>{let t=eo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return $a(e);let n=e.split(Ja);return Qa(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ga(i,t):t:i||Ya}return n[e]||Ya}}},Qa=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Qa(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ja):e.slice(t).join(Ja),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},$a=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?Xa+r:void 0})(),eo=e=>{let{theme:t,classGroups:n}=e;return to(n,t)},to=(e,t)=>{let n=qa();for(let r in e){let i=e[r];no(i,n,r,t)}return n},no=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ro(i,t,n,r)}},ro=(e,t,n,r)=>{if(typeof e==`string`){io(e,t,n);return}if(typeof e==`function`){ao(e,t,n,r);return}oo(e,t,n,r)},io=(e,t,n)=>{let r=e===``?t:so(t,e);r.classGroupId=n},ao=(e,t,n,r)=>{if(co(e)){no(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ka(n,e))},oo=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];no(o,so(t,a),n,r)}},so=(e,t)=>{let n=e,r=t.split(Ja),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=qa(),n.nextPart.set(t,i)),n=i}return n},co=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,lo=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)}}},uo=`!`,fo=`:`,po=[],B=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),V=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===fo){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(uo)?(c=s.slice(0,-1),l=!0):s.startsWith(uo)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return B(t,l,c,u)};if(t){let e=t+fo,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):B(po,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},mo=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}},ho=e=>({cache:lo(e.cacheSize),parseClassName:V(e),sortModifiers:mo(e),postfixLookupClassGroupIds:go(e),...Za(e)}),go=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},_o=/\s+/,vo=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(_o),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?_+uo:_,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},yo=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=bo(n))&&(i&&(i+=` `),i+=r);return i},bo=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=bo(e[r]))&&(n&&(n+=` `),n+=t);return n},xo=(e,...t)=>{let n,r,i,a,o=o=>(n=ho(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=vo(e,n);return i(e,a),a};return a=o,(...e)=>a(yo(...e))},So=[],Co=e=>{let t=t=>t[e]||So;return t.isThemeGetter=!0,t},wo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,To=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Eo=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Do=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oo=/\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$/,ko=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ao=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,H=e=>Eo.test(e),U=e=>!!e&&!Number.isNaN(Number(e)),Mo=e=>!!e&&Number.isInteger(Number(e)),No=e=>e.endsWith(`%`)&&U(e.slice(0,-1)),Po=e=>Do.test(e),Fo=()=>!0,Io=e=>Oo.test(e)&&!ko.test(e),Lo=()=>!1,Ro=e=>Ao.test(e),zo=e=>jo.test(e),Bo=e=>!W(e)&&!G(e),Vo=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)),Ho=e=>rs(e,ss,Lo),W=e=>wo.test(e),Uo=e=>rs(e,cs,Io),Wo=e=>rs(e,ls,U),Go=e=>rs(e,ds,Fo),Ko=e=>rs(e,us,Lo),qo=e=>rs(e,as,Lo),Jo=e=>rs(e,os,zo),Yo=e=>rs(e,fs,Ro),G=e=>To.test(e),Xo=e=>is(e,cs),Zo=e=>is(e,us),Qo=e=>is(e,as),$o=e=>is(e,ss),es=e=>is(e,os),ts=e=>is(e,fs,!0),ns=e=>is(e,ds,!0),rs=(e,t,n)=>{let r=wo.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},is=(e,t,n=!1)=>{let r=To.exec(e);return r?r[1]?t(r[1]):n:!1},as=e=>e===`position`||e===`percentage`,os=e=>e===`image`||e===`url`,ss=e=>e===`length`||e===`size`||e===`bg-size`,cs=e=>e===`length`,ls=e=>e===`number`,us=e=>e===`family-name`,ds=e=>e===`number`||e===`weight`,fs=e=>e===`shadow`,ps=xo(()=>{let e=Co(`color`),t=Co(`font`),n=Co(`text`),r=Co(`font-weight`),i=Co(`tracking`),a=Co(`leading`),o=Co(`breakpoint`),s=Co(`container`),c=Co(`spacing`),l=Co(`radius`),u=Co(`shadow`),d=Co(`inset-shadow`),f=Co(`text-shadow`),p=Co(`drop-shadow`),m=Co(`blur`),h=Co(`perspective`),g=Co(`aspect`),_=Co(`ease`),v=Co(`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(),G,W],ee=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[G,W,c],w=()=>[H,`full`,`auto`,...C()],te=()=>[Mo,`none`,`subgrid`,G,W],ne=()=>[`auto`,{span:[`full`,Mo,G,W]},Mo,G,W],T=()=>[Mo,`auto`,G,W],re=()=>[`auto`,`min`,`max`,`fr`,G,W],ie=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ae=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],oe=()=>[`auto`,...C()],se=()=>[H,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],ce=()=>[H,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],le=()=>[H,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],E=()=>[e,G,W],D=()=>[...b(),Qo,qo,{position:[G,W]}],ue=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],de=()=>[`auto`,`cover`,`contain`,$o,Ho,{size:[G,W]}],fe=()=>[No,Xo,Uo],O=()=>[``,`none`,`full`,l,G,W],k=()=>[``,U,Xo,Uo],A=()=>[`solid`,`dashed`,`dotted`,`double`],pe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],me=()=>[U,No,Qo,qo],j=()=>[``,`none`,m,G,W],he=()=>[`none`,U,G,W],M=()=>[`none`,U,G,W],ge=()=>[U,G,W],N=()=>[H,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Po],breakpoint:[Po],color:[Fo],container:[Po],"drop-shadow":[Po],ease:[`in`,`out`,`in-out`],font:[Bo],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Po],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Po],shadow:[Po],spacing:[`px`,U],text:[Po],"text-shadow":[Po],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,H,W,G,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,G,W]}],"container-named":[Vo],columns:[{columns:[U,W,G,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:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Mo,`auto`,G,W]}],basis:[{basis:[H,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[U,H,`auto`,`initial`,`none`,W]}],grow:[{grow:[``,U,G,W]}],shrink:[{shrink:[``,U,G,W]}],order:[{order:[Mo,`first`,`last`,`none`,G,W]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...ie(),`normal`]}],"justify-items":[{"justify-items":[...ae(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ae()]}],"align-content":[{content:[`normal`,...ie()]}],"align-items":[{items:[...ae(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ae(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ae(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ae()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mbs:[{mbs:oe()}],mbe:[{mbe:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:se()}],"inline-size":[{inline:[`auto`,...ce()]}],"min-inline-size":[{"min-inline":[`auto`,...ce()]}],"max-inline-size":[{"max-inline":[`none`,...ce()]}],"block-size":[{block:[`auto`,...le()]}],"min-block-size":[{"min-block":[`auto`,...le()]}],"max-block-size":[{"max-block":[`none`,...le()]}],w:[{w:[s,`screen`,...se()]}],"min-w":[{"min-w":[s,`screen`,`none`,...se()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...se()]}],h:[{h:[`screen`,`lh`,...se()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...se()]}],"max-h":[{"max-h":[`screen`,`lh`,...se()]}],"font-size":[{text:[`base`,n,Xo,Uo]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ns,Go]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,No,W]}],"font-family":[{font:[Zo,Ko,t]}],"font-features":[{"font-features":[W]}],"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,G,W]}],"line-clamp":[{"line-clamp":[U,`none`,G,Wo]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,G,W]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,G,W]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...A(),`wavy`]}],"text-decoration-thickness":[{decoration:[U,`from-font`,`auto`,G,Uo]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[U,`auto`,G,W]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[Mo,G,W]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,G,W]}],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`,G,W]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:ue()}],"bg-size":[{bg:de()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Mo,G,W],radial:[``,G,W],conic:[Mo,G,W]},es,Jo]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:k()}],"border-w-x":[{"border-x":k()}],"border-w-y":[{"border-y":k()}],"border-w-s":[{"border-s":k()}],"border-w-e":[{"border-e":k()}],"border-w-bs":[{"border-bs":k()}],"border-w-be":[{"border-be":k()}],"border-w-t":[{"border-t":k()}],"border-w-r":[{"border-r":k()}],"border-w-b":[{"border-b":k()}],"border-w-l":[{"border-l":k()}],"divide-x":[{"divide-x":k()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":k()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...A(),`hidden`,`none`]}],"divide-style":[{divide:[...A(),`hidden`,`none`]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...A(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[U,G,W]}],"outline-w":[{outline:[``,U,Xo,Uo]}],"outline-color":[{outline:E()}],shadow:[{shadow:[``,`none`,u,ts,Yo]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":[`none`,d,ts,Yo]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[U,Uo]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":k()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":[`none`,f,ts,Yo]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[U,G,W]}],"mix-blend":[{"mix-blend":[...pe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":pe()}],"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":[U]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"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":[U]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:ue()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,G,W]}],filter:[{filter:[``,`none`,G,W]}],blur:[{blur:j()}],brightness:[{brightness:[U,G,W]}],contrast:[{contrast:[U,G,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ts,Yo]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:[``,U,G,W]}],"hue-rotate":[{"hue-rotate":[U,G,W]}],invert:[{invert:[``,U,G,W]}],saturate:[{saturate:[U,G,W]}],sepia:[{sepia:[``,U,G,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,G,W]}],"backdrop-blur":[{"backdrop-blur":j()}],"backdrop-brightness":[{"backdrop-brightness":[U,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[U,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,U,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[U,G,W]}],"backdrop-invert":[{"backdrop-invert":[``,U,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[U,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[U,G,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,U,G,W]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,G,W]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[U,`initial`,G,W]}],ease:[{ease:[`linear`,`initial`,_,G,W]}],delay:[{delay:[U,G,W]}],animate:[{animate:[`none`,v,G,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,G,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:M()}],"scale-x":[{"scale-x":M()}],"scale-y":[{"scale-y":M()}],"scale-z":[{"scale-z":M()}],"scale-3d":[`scale-3d`],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[G,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:N()}],"translate-x":[{"translate-x":N()}],"translate-y":[{"translate-y":N()}],"translate-z":[{"translate-z":N()}],"translate-none":[`translate-none`],zoom:[{zoom:[Mo,G,W]}],accent:[{accent:E()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:E()}],"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`,G,W]}],"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":E()}],"scrollbar-track-color":[{"scrollbar-track":E()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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`,G,W]}],fill:[{fill:[`none`,...E()]}],"stroke-w":[{stroke:[U,Xo,Uo,Wo]}],stroke:[{stroke:[`none`,...E()]}],"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`]}}),ms=(...e)=>ps(Va(e)),hs=Wa(`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`}}),gs=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,x.jsx)(r?Da:`button`,{className:ms(hs({variant:t,size:n,className:e})),ref:a,...i}));gs.displayName=`Button`;var _s=`Copying to the clipboard is not available in this browser context.`,vs=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},ys=async e=>{let t=navigator.clipboard;if(t!==void 0&&typeof t.writeText==`function`)try{await t.writeText(e);return}catch{if(vs(e))return;throw Error(_s)}if(!vs(e))throw Error(_s)},bs=1500,xs=`Copy failed`,Ss=`Copying to the clipboard failed`,Cs=({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)(gs,{type:`button`,variant:`ghost`,size:`sm`,className:i,"aria-label":a===`copied`?r:a===`failed`?Ss:n,onClick:async()=>{try{await ys(e),o(`copied`)}catch(e){console.error(e),o(`failed`)}s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{o(`idle`),s.current=null},bs)},children:a===`copied`?`Copied`:a===`failed`?xs:t})},ws=({code:e,label:t=`Copy code`})=>(0,x.jsx)(Cs,{value:e,idleText:t,idleAriaLabel:t,copiedAriaLabel:`Code copied to clipboard`,className:`console-copy-code-button`}),Ts=`https://cdn.jsdelivr.net/npm/mermaid@10.9.6/dist/mermaid.min.js`,Es=null,Ds=0,Os=e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`dark`,themeVariables:{background:`#0d1117`,primaryColor:`#161b22`,primaryTextColor:`#e6edf3`,primaryBorderColor:`#30363d`,lineColor:`#8b949e`,fontSize:`14px`}}),e),ks=()=>Es===null?window.mermaid===void 0?(Es=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=Ts,n.async=!0,n.onload=()=>{if(window.mermaid===void 0){t(Error(`mermaid failed to load`));return}e(Os(window.mermaid))},n.onerror=()=>t(Error(`mermaid script failed to load`)),document.head.appendChild(n)}),Es):(Es=Promise.resolve(Os(window.mermaid)),Es):Es,As=async e=>{let t=await ks();Ds+=1;let n=`console-mermaid-${Ds}`,{svg:r}=await t.render(n,e);return yr.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`foreignObject`]})},js=({code:e})=>{let[t,n]=(0,_.useState)({status:`loading`}),r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=!1;return n({status:`loading`}),As(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`})},Ms=e=>{let t=e.querySelectorAll(`a[href]`),n=[];return t.forEach((e,t)=>{let r=e.getAttribute(`href`)??``;if(ga(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},Ns=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},Ps=({source:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,_.useMemo)(()=>{let n=ua(e,r);return t===void 0?n:Xt(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(Ns(e)),s(n===void 0?[]:Ms(e)))},[i,n]),(0,x.jsxs)(`div`,{ref:a,className:`console-markdown`,children:[c.map(e=>(0,Kt.createPortal)((0,x.jsx)(ws,{code:e.code}),e.host,e.key)),n!==void 0&&o.map(e=>(0,Kt.createPortal)(n(e.href,e.fallbackText),e.host,e.key))]})},Fs=({body:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,_.useMemo)(()=>ma(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)(js,{code:e.code},e.key):(0,x.jsx)(Ps,{source:e.source,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r},e.key))})},Is=(e,t)=>e.length===0?`${t}\n`:e.endsWith(`
80
80
  `)?`${e}${t}\n`:`${e}\n${t}\n`,Ls=({isPr:e,now:t,onSubmit:n,onUploadFile:r})=>{let[i,a]=(0,_.useState)(!e),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)({kind:`idle`}),[u,d]=(0,_.useState)({kind:`idle`}),[f,p]=(0,_.useState)([]),m=(0,_.useRef)(null),h=async()=>{let e=o.trim();if(!(e.length===0||c.kind===`posting`)){l({kind:`posting`});try{let t=await n(e);p(e=>[...e,t]),s(``),l({kind:`idle`})}catch(e){l({kind:`error`,message:e instanceof Error?e.message:`failed to post`})}}},g=async e=>{if(!(r===void 0||e.length===0))for(let t of e){d({kind:`uploading`,fileName:t.name});try{let e=await r(t);s(t=>Is(t,e)),d({kind:`idle`})}catch(e){d({kind:`error`,message:e instanceof Error?e.message:`failed to upload file`});return}}};return(0,x.jsxs)(`div`,{className:`console-composer`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-composer-toggle`,"aria-expanded":i,onClick:()=>a(e=>!e),children:i?`✕ Cancel`:`💬 Add a comment`}),f.length>0&&(0,x.jsx)(`div`,{className:`console-composer-posted`,children:f.map(e=>(0,x.jsxs)(`article`,{className:`console-comment`,children:[(0,x.jsxs)(`header`,{className:`console-comment-header`,title:oe(e.createdAt),children:[(0,x.jsx)(`span`,{className:`console-comment-author`,children:e.author===``?`you`:e.author}),(0,x.jsx)(`span`,{className:`console-comment-time`,children:ae(e.createdAt,t)})]}),(0,x.jsx)(Fs,{body:e.body})]},`${e.author}:${e.createdAt}:${e.body}`))}),i&&(0,x.jsxs)(`div`,{className:`console-composer-form`,children:[(0,x.jsx)(`textarea`,{className:`console-composer-input`,rows:3,placeholder:`Leave a comment…`,value:o,onChange:e=>s(e.target.value),onDragOver:e=>{r!==void 0&&e.preventDefault()},onDrop:e=>{r!==void 0&&(e.preventDefault(),g(Array.from(e.dataTransfer.files)))},onPaste:e=>{if(r===void 0)return;let t=Array.from(e.clipboardData.files);t.length!==0&&(e.preventDefault(),g(t))}}),r!==void 0&&(0,x.jsxs)(`div`,{className:`console-composer-attach`,children:[(0,x.jsx)(`input`,{ref:m,type:`file`,multiple:!0,className:`console-composer-file-input`,"aria-label":`Attach files`,onChange:e=>{let t=Array.from(e.target.files??[]);e.target.value=``,g(t)}}),(0,x.jsx)(`button`,{type:`button`,className:`console-composer-attach-button`,disabled:u.kind===`uploading`,onClick:()=>m.current?.click(),children:`📎 Attach files`}),u.kind===`uploading`&&(0,x.jsxs)(`span`,{className:`console-composer-status`,children:[`Uploading `,u.fileName,`…`]}),u.kind===`error`&&(0,x.jsxs)(`span`,{role:`alert`,className:`console-composer-status console-composer-error`,children:[`Upload failed: `,u.message]})]}),(0,x.jsxs)(`div`,{className:`console-composer-row`,children:[c.kind===`posting`&&(0,x.jsx)(`span`,{className:`console-composer-status`,children:`Posting…`}),c.kind===`error`&&(0,x.jsxs)(`span`,{role:`alert`,className:`console-composer-status console-composer-error`,children:[`Failed: `,c.message]}),(0,x.jsx)(`button`,{type:`button`,className:`console-composer-submit`,disabled:c.kind===`posting`,onClick:()=>{h()},children:`Comment`})]})]})]})},Rs=({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})]})},zs=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`}}},Bs=()=>({directories:new Map,files:[]}),Vs=e=>e.split(`/`).filter(e=>e!==``),Hs=(e,t)=>e.name.localeCompare(t.name),Us=(e,t)=>{let n=[];e.directories.forEach((e,r)=>{let i=t===``?r:`${t}/${r}`;n.push({kind:`directory`,name:r,path:i,children:Us(e,i)})}),n.sort(Hs);let r=e.files.map(e=>({kind:`file`,name:Vs(e.path).at(-1)??e.path,path:e.path,file:e}));return r.sort(Hs),[...n,...r]},Ws=e=>{let t=Bs();for(let n of e){let e=Vs(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=Bs();i.directories.set(e,t),i=t;continue}i=t}i.files.push(n)}return Us(t,``)},Gs=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,Ks=e=>{let t=[],n=0,r=0;for(let i of e.split(`
81
81
  `)){if(i.startsWith(`@@`)){let e=i.match(Gs);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`],Js=e=>{let t=e.toLowerCase();return qs.some(e=>t.endsWith(e))},Ys=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,Xs=e=>`${e.kind}:${e.oldLineNumber??`x`}:${e.newLineNumber??`x`}:${e.content}`,Zs=({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]})]})]})]})},Qs=({patch:e,path:t,rawUrl:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,_.useState)(null);if(e===null||e===``)return t!==void 0&&Js(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=Ks(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=Xs(e),r=c?Ys(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)(Zs,{target:a,onSubmit:i,onClose:()=>o(null)})})})]},n)})})})},$s=e=>({paddingLeft:`${e*16}px`}),ec=({file:e,depth:t,name:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,_.useState)(!1),s=zs(e.status);return(0,x.jsxs)(`li`,{className:`console-file`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-file-row`,style:$s(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)(Qs,{patch:e.patch,path:e.path,rawUrl:e.rawUrl,buildImageProxyUrl:r,onAddInlineComment:i})]})},tc=({node:e,depth:t,buildImageProxyUrl:n,onAddInlineComment:r})=>e.kind===`file`?(0,x.jsx)(ec,{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:$s(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)(tc,{node:e,depth:t+1,buildImageProxyUrl:n,onAddInlineComment:r},e.path))})]}),nc=({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:Ws(e).map(e=>(0,x.jsx)(tc,{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]}),rc=({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:ae(e.createdAt,r)})]}),(0,x.jsx)(Fs,{body:e.body,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})]},`${e.author}:${e.createdAt}:${e.body}`))]})},ic=e=>e.slice(0,7),ac=e=>e.split(`
82
- `)[0],oc=({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:ac(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:ic(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:ae(e.authoredAt,r)})]},e.sha))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-commits-error`,children:[`Failed to load commits: `,n]}),sc=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(Cs,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),cc={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`}},lc=({mergeableStatus:e})=>{let t=cc[e],n=ue(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})},uc=e=>{let t=ue(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},dc=({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:uc(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:uc(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},fc=({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=i||a!==null?null:r.length,h=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)(lc,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(dc,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(sc,{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)(Rs,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Fs,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d})}),(0,x.jsx)(Rs,{title:`Changed files`,count:m,children:(0,x.jsx)(nc,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Rs,{title:`Commits`,count:h,defaultCollapsed:!0,children:(0,x.jsx)(oc,{commits:o,isLoading:s,error:c,now:l})})]})},pc=({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:ee,now:S,commentComposer:C,operationBar:w,buildImageProxyUrl:te,renderReferenceLink:ne,onAddInlineComment:T})=>{let re=i?.state??`open`,ie=i?.merged??!1,se=!e.isPr&&re===`closed`?`Closed`:null,ce=_a(e.nameWithOwner)??void 0,E=ue(n),D=r?ue(r.color):null,de=f||p!==null?null:d.length,fe=l||u!==null?null:c.length,O=h||g!==null?null:m.length,k=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:E.dot}}),t]}),e.isPr&&v?.found&&(0,x.jsx)(dc,{isPassedAllCiJob:v.isPassedAllCiJob,isCiStateSuccess:v.isCiStateSuccess,isBranchOutOfDate:v.isBranchOutOfDate,missingRequiredCheckNames:v.missingRequiredCheckNames}),k.map(e=>(0,x.jsx)(lc,{mergeableStatus:e.mergeableStatus},e.url))]}),(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[r!==null&&D!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:D.fg,borderColor:D.border,backgroundColor:D.bg},children:r.name}),(0,x.jsx)(le,{isPr:e.isPr,state:re,merged:ie,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})]}),_!==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)(sc,{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:oe(e.createdAt),children:[`opened `,ae(e.createdAt,S)]}),(0,x.jsx)(Rs,{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)(Fs,{body:a,buildImageProxyUrl:te,renderReferenceLink:ne,repoContext:ce}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-body-error`,children:[`Failed to load description: `,s]})}),e.isPr&&(0,x.jsx)(Rs,{title:`Changed files`,count:de,children:(0,x.jsx)(nc,{files:d,isLoading:f,error:p,onAddInlineComment:T})}),(0,x.jsx)(Rs,{title:`Comments`,count:fe,defaultCollapsed:e.isPr,children:(0,x.jsx)(rc,{comments:c,isLoading:l,error:u,now:S,buildImageProxyUrl:te,renderReferenceLink:ne,repoContext:ce})}),e.isPr&&(0,x.jsx)(Rs,{title:`Commits`,count:O,defaultCollapsed:!0,children:(0,x.jsx)(oc,{commits:m,isLoading:h,error:g,now:S})}),!e.isPr&&ee!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load related pull requests: `,ee]}),!e.isPr&&b.map(e=>(0,x.jsx)(fc,{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:S,buildImageProxyUrl:te,renderReferenceLink:ne,onAddInlineComment:T},e.pullRequest.url)),C,(0,x.jsx)(`div`,{className:`console-actionbar`,children:w})]})},mc=({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`})]}),hc=({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`})]}),gc=[{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`}],_c=`Reject needs an inline comment on the diff.`,vc=({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:_c}),gc.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)})]}),yc=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},bc=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=he.map(t=>({name:t,option:yc(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=ue(r.color),a=e===M;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)})})},xc=e=>e.name.toLowerCase().includes(`no story`),Sc=({storyOptions:e,onSetStory:t})=>{let n=e.filter(e=>!xc(e));return n.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group console-op-group-stories`,children:n.map(e=>{let n=ue(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)})})},Cc=({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)(vc,{onReview:a.onReview,rejectEnabled:n}),(0,x.jsx)(hc,{isManualTriage:ge(e),onSetNextActionDate:a.onSetNextActionDate}),o&&(0,x.jsx)(Sc,{storyOptions:i,onSetStory:a.onSetStory}),(0,x.jsx)(bc,{statusOptions:r,onSetStatus:a.onSetStatus,onSetInTmuxByHuman:a.onSetInTmuxByHuman}),(0,x.jsx)(mc,{onClose:a.onClose})]})},wc=(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}},Tc=[],Ec=[],Dc=[],Oc=[],kc={state:`open`,merged:!1,isPullRequest:!1,title:``},Ac={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},jc=(e,t)=>{let n=t===null?null:`${t.repo}#${t.number}`,r=t===null?null:t.url,i=t?.isPr??!1,a=wc(e.body,n,r,``),o=wc(e.state,n,r,kc),s=wc(e.comments,n,r,Tc),c=wc(e.files,i?n:null,i?r:null,Ec),l=wc(e.commits,i?n:null,i?r:null,Dc),u=wc(e.prStatus,i?n:null,i?r:null,Ac),d=wc(e.relatedPrs,i?null:n,i?null:r,Oc),[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:Ec,filesAreLoading:!0,filesError:null,commits:Dc,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}},Mc=({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)(le,{...va(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title})]}),Nc=(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},Pc=({cache:e,href:t,fallbackText:n})=>(0,x.jsx)(Mc,{href:t,fallbackText:n,state:Nc(e,t)}),Fc=({tab:e,item:t,caches:n,operations:r,statusOptions:i,storyOptions:a,storyColors:o,storyName:s,overlayStatus:c,now:l,onQueueAction:u})=>{let d=jc(n,t),f=(0,_.useCallback)(e=>Yt(e),[]),p=(0,_.useCallback)((e,t)=>(0,x.jsx)(Pc,{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={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)})}},b=s??(t.story.trim()===``?null:t.story);return(0,x.jsx)(pc,{item:t,storyName:b,storyColorEnum:b===null?null:C(o,b),overlayStatus:c,state:d.state,stateError:d.stateError,body:d.body,bodyIsLoading:d.bodyIsLoading,bodyError:d.bodyError,comments:d.comments,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)(Ls,{isPr:t.isPr,now:l,onSubmit:e=>r.addComment(t,e),onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Cc,{tab:e,item:t,hasPullRequest:m,rejectEnabled:h.length>0,statusOptions:i,storyOptions:a,handlers:y})})},Ic=()=>{let e={};for(let t of y)e[t.name]=0;return e},Lc=`console`,Rc=()=>{let e=Ot(),{snapshots:t,isLoading:n,error:r}=Ht(e),i=Et(e??Lc),a=(0,_.useMemo)(()=>{let e=Ic();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]),S=(0,_.useMemo)(()=>te(v,i.overlay),[v,i.overlay]),C=g?.storyColors??{},ne=g?.statusOptions??[],T=g?.storyOptions??[],re=g?.generatedAt??null,ie=(0,_.useMemo)(()=>c===null||g===null?null:g.items.find(e=>e.projectItemId===c)??null,[c,g]);it(f,ie,v),(0,_.useEffect)(()=>{c!==null&&window.scrollTo({top:0})},[c]);let ae=a[s],oe=(0,_.useRef)({tab:s,count:ae});(0,_.useEffect)(()=>{let e=oe.current;if(oe.current={tab:s,count:ae},e.tab===s&&e.count>0&&ae===0){let e=F(s,a);e!==null&&(d(e),u())}},[s,ae,a,d,u]);let se=ie===null?null:i.overlay[dt(ie)]?.status??null,ce=ie===null?null:w(ie,i.overlay),le=(0,_.useCallback)(e=>{let t=Ut(b,e);t===null?u():l(t)},[b,l,u]),E=(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)&&le(t)}})},[m,s,le]),D=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)(O,{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)(k,{message:`Operation failed: ${m.error.reason}`,onDismiss:m.dismissError}),(0,x.jsx)(ee,{activeTab:s,counts:a,pjcode:e,generatedAt:re,tabHref:o.tabHref,onSelectTab:o.selectTab}),ie===null?(0,x.jsx)(fe,{rows:S,storyColors:C,activeItemId:null,now:h,isLoading:n,error:r,onSelectItem:e=>o.openItem(e.projectItemId)}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:D,children:(0,x.jsx)(Fc,{tab:s,item:ie,caches:f,operations:p,statusOptions:ne,storyOptions:T,storyColors:C,storyName:ce,overlayStatus:se,now:h,onQueueAction:E},ie.projectItemId)})]})},zc=document.getElementById(`root`);if(zc===null)throw Error(`Root container #root not found`);(0,v.createRoot)(zc).render((0,x.jsx)(_.StrictMode,{children:(0,x.jsx)(Rc,{})}));
82
+ `)[0],oc=({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:ac(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:ic(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:ae(e.authoredAt,r)})]},e.sha))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-commits-error`,children:[`Failed to load commits: `,n]}),sc=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(Cs,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),cc={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`}},lc=({mergeableStatus:e})=>{let t=cc[e],n=ue(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})},uc=e=>{let t=ue(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},dc=({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:uc(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:uc(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},fc=({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=ga(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)(lc,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(dc,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(sc,{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)(Rs,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Fs,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Rs,{title:`Changed files`,count:g,children:(0,x.jsx)(nc,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Rs,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(oc,{commits:o,isLoading:s,error:c,now:l})})]})},pc=({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:ee,now:S,commentComposer:C,operationBar:w,buildImageProxyUrl:te,renderReferenceLink:ne,onAddInlineComment:T})=>{let re=i?.state??`open`,ie=i?.merged??!1,se=!e.isPr&&re===`closed`?`Closed`:null,ce=_a(e.nameWithOwner)??void 0,E=ue(n),D=r?ue(r.color):null,de=f||p!==null?null:d.length,fe=l||u!==null?null:c.length,O=h||g!==null?null:m.length,k=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:E.dot}}),t]}),e.isPr&&v?.found&&(0,x.jsx)(dc,{isPassedAllCiJob:v.isPassedAllCiJob,isCiStateSuccess:v.isCiStateSuccess,isBranchOutOfDate:v.isBranchOutOfDate,missingRequiredCheckNames:v.missingRequiredCheckNames}),k.map(e=>(0,x.jsx)(lc,{mergeableStatus:e.mergeableStatus},e.url))]}),(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[r!==null&&D!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:D.fg,borderColor:D.border,backgroundColor:D.bg},children:r.name}),(0,x.jsx)(le,{isPr:e.isPr,state:re,merged:ie,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})]}),_!==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)(sc,{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:oe(e.createdAt),children:[`opened `,ae(e.createdAt,S)]}),(0,x.jsx)(Rs,{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)(Fs,{body:a,buildImageProxyUrl:te,renderReferenceLink:ne,repoContext:ce}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-body-error`,children:[`Failed to load description: `,s]})}),e.isPr&&(0,x.jsx)(Rs,{title:`Changed files`,count:de,children:(0,x.jsx)(nc,{files:d,isLoading:f,error:p,onAddInlineComment:T})}),(0,x.jsx)(Rs,{title:`Comments`,count:fe,defaultCollapsed:e.isPr,children:(0,x.jsx)(rc,{comments:c,isLoading:l,error:u,now:S,buildImageProxyUrl:te,renderReferenceLink:ne,repoContext:ce})}),e.isPr&&(0,x.jsx)(Rs,{title:`Commits`,count:O,defaultCollapsed:!0,children:(0,x.jsx)(oc,{commits:m,isLoading:h,error:g,now:S})}),!e.isPr&&ee!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load related pull requests: `,ee]}),!e.isPr&&b.map(e=>(0,x.jsx)(fc,{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:S,buildImageProxyUrl:te,renderReferenceLink:ne,onAddInlineComment:T},e.pullRequest.url)),C,(0,x.jsx)(`div`,{className:`console-actionbar`,children:w})]})},mc=({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`})]}),hc=({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`})]}),gc=[{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`}],_c=`Reject needs an inline comment on the diff.`,vc=({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:_c}),gc.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)})]}),yc=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},bc=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=he.map(t=>({name:t,option:yc(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=ue(r.color),a=e===M;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)})})},xc=e=>e.name.toLowerCase().includes(`no story`),Sc=({storyOptions:e,onSetStory:t})=>{let n=e.filter(e=>!xc(e));return n.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group console-op-group-stories`,children:n.map(e=>{let n=ue(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)})})},Cc=({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)(vc,{onReview:a.onReview,rejectEnabled:n}),(0,x.jsx)(hc,{isManualTriage:ge(e),onSetNextActionDate:a.onSetNextActionDate}),o&&(0,x.jsx)(Sc,{storyOptions:i,onSetStory:a.onSetStory}),(0,x.jsx)(bc,{statusOptions:r,onSetStatus:a.onSetStatus,onSetInTmuxByHuman:a.onSetInTmuxByHuman}),(0,x.jsx)(mc,{onClose:a.onClose})]})},wc=(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}},Tc=[],Ec=[],Dc=[],Oc=[],kc={state:`open`,merged:!1,isPullRequest:!1,title:``},Ac={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},jc=(e,t)=>{let n=t===null?null:`${t.repo}#${t.number}`,r=t===null?null:t.url,i=t?.isPr??!1,a=wc(e.body,n,r,``),o=wc(e.state,n,r,kc),s=wc(e.comments,n,r,Tc),c=wc(e.files,i?n:null,i?r:null,Ec),l=wc(e.commits,i?n:null,i?r:null,Dc),u=wc(e.prStatus,i?n:null,i?r:null,Ac),d=wc(e.relatedPrs,i?null:n,i?null:r,Oc),[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:Ec,filesAreLoading:!0,filesError:null,commits:Dc,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}},Mc=({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)(le,{...va(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title})]}),Nc=(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},Pc=({cache:e,href:t,fallbackText:n})=>(0,x.jsx)(Mc,{href:t,fallbackText:n,state:Nc(e,t)}),Fc=({tab:e,item:t,caches:n,operations:r,statusOptions:i,storyOptions:a,storyColors:o,storyName:s,overlayStatus:c,now:l,onQueueAction:u})=>{let d=jc(n,t),f=(0,_.useCallback)(e=>Yt(e),[]),p=(0,_.useCallback)((e,t)=>(0,x.jsx)(Pc,{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={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)})}},b=s??(t.story.trim()===``?null:t.story);return(0,x.jsx)(pc,{item:t,storyName:b,storyColorEnum:b===null?null:C(o,b),overlayStatus:c,state:d.state,stateError:d.stateError,body:d.body,bodyIsLoading:d.bodyIsLoading,bodyError:d.bodyError,comments:d.comments,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)(Ls,{isPr:t.isPr,now:l,onSubmit:e=>r.addComment(t,e),onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Cc,{tab:e,item:t,hasPullRequest:m,rejectEnabled:h.length>0,statusOptions:i,storyOptions:a,handlers:y})})},Ic=()=>{let e={};for(let t of y)e[t.name]=0;return e},Lc=`console`,Rc=()=>{let e=Ot(),{snapshots:t,isLoading:n,error:r}=Ht(e),i=Et(e??Lc),a=(0,_.useMemo)(()=>{let e=Ic();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]),S=(0,_.useMemo)(()=>te(v,i.overlay),[v,i.overlay]),C=g?.storyColors??{},ne=g?.statusOptions??[],T=g?.storyOptions??[],re=g?.generatedAt??null,ie=(0,_.useMemo)(()=>c===null||g===null?null:g.items.find(e=>e.projectItemId===c)??null,[c,g]);it(f,ie,v),(0,_.useEffect)(()=>{c!==null&&window.scrollTo({top:0})},[c]);let ae=a[s],oe=(0,_.useRef)({tab:s,count:ae});(0,_.useEffect)(()=>{let e=oe.current;if(oe.current={tab:s,count:ae},e.tab===s&&e.count>0&&ae===0){let e=F(s,a);e!==null&&(d(e),u())}},[s,ae,a,d,u]);let se=ie===null?null:i.overlay[dt(ie)]?.status??null,ce=ie===null?null:w(ie,i.overlay),le=(0,_.useCallback)(e=>{let t=Ut(b,e);t===null?u():l(t)},[b,l,u]),E=(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)&&le(t)}})},[m,s,le]),D=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)(O,{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)(k,{message:`Operation failed: ${m.error.reason}`,onDismiss:m.dismissError}),(0,x.jsx)(ee,{activeTab:s,counts:a,pjcode:e,generatedAt:re,tabHref:o.tabHref,onSelectTab:o.selectTab}),ie===null?(0,x.jsx)(fe,{rows:S,storyColors:C,activeItemId:null,now:h,isLoading:n,error:r,onSelectItem:e=>o.openItem(e.projectItemId)}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:D,children:(0,x.jsx)(Fc,{tab:s,item:ie,caches:f,operations:p,statusOptions:ne,storyOptions:T,storyColors:C,storyName:ce,overlayStatus:se,now:h,onQueueAction:E},ie.projectItemId)})]})},zc=document.getElementById(`root`);if(zc===null)throw Error(`Root container #root not found`);(0,v.createRoot)(zc).render((0,x.jsx)(_.StrictMode,{children:(0,x.jsx)(Rc,{})}));
@@ -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-Cp5oIKAG.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-J8xXGaD4.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-Dihcph6j.css">
9
9
  </head>
10
10
  <body>
@@ -4,10 +4,12 @@ exports.NodeLocalCommandRunner = void 0;
4
4
  const child_process_1 = require("child_process");
5
5
  const util_1 = require("util");
6
6
  const execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
7
+ const MAX_COMMAND_OUTPUT_BYTES = 1024 * 1024 * 256;
7
8
  class NodeLocalCommandRunner {
8
9
  async runCommand(program, args, options) {
9
10
  const execOptions = {
10
11
  encoding: 'utf8',
12
+ maxBuffer: MAX_COMMAND_OUTPUT_BYTES,
11
13
  };
12
14
  if (options?.env) {
13
15
  execOptions.env = { ...process.env, ...options.env };
@@ -26,6 +28,9 @@ class NodeLocalCommandRunner {
26
28
  'stdout' in error &&
27
29
  'stderr' in error &&
28
30
  'code' in error) {
31
+ if (typeof error.code !== 'number') {
32
+ console.error(`${program} did not exit with a numeric status: ${String(error.code)}`);
33
+ }
29
34
  return {
30
35
  stdout: String(error.stdout),
31
36
  stderr: String(error.stderr),
@@ -1 +1 @@
1
- {"version":3,"file":"NodeLocalCommandRunner.js","sourceRoot":"","sources":["../../../src/adapter/repositories/NodeLocalCommandRunner.ts"],"names":[],"mappings":";;;AAIA,iDAAyC;AACzC,+BAAiC;AAEjC,MAAM,aAAa,GAAG,IAAA,gBAAS,EAAC,wBAAQ,CAAC,CAAC;AAE1C,MAAa,sBAAsB;IACjC,KAAK,CAAC,UAAU,CACd,OAAe,EACf,IAAc,EACd,OAAmC;QAMnC,MAAM,WAAW,GAAwC;YACvD,QAAQ,EAAE,MAAM;SACjB,CAAC;QACF,IAAI,OAAO,EAAE,GAAG,EAAE,CAAC;YACjB,WAAW,CAAC,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACvD,CAAC;QACD,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAC5C,OAAO,EACP,IAAI,EACJ,WAAW,CACZ,CAAC;YACF,OAAO;gBACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;gBACtB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;gBACtB,QAAQ,EAAE,CAAC;aACZ,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IACE,KAAK;gBACL,OAAO,KAAK,KAAK,QAAQ;gBACzB,QAAQ,IAAI,KAAK;gBACjB,QAAQ,IAAI,KAAK;gBACjB,MAAM,IAAI,KAAK,EACf,CAAC;gBACD,OAAO;oBACL,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;oBAC5B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;oBAC5B,QAAQ,EAAE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBAC1D,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AA5CD,wDA4CC"}
1
+ {"version":3,"file":"NodeLocalCommandRunner.js","sourceRoot":"","sources":["../../../src/adapter/repositories/NodeLocalCommandRunner.ts"],"names":[],"mappings":";;;AAIA,iDAAyC;AACzC,+BAAiC;AAEjC,MAAM,aAAa,GAAG,IAAA,gBAAS,EAAC,wBAAQ,CAAC,CAAC;AAE1C,MAAM,wBAAwB,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAC;AAEnD,MAAa,sBAAsB;IACjC,KAAK,CAAC,UAAU,CACd,OAAe,EACf,IAAc,EACd,OAAmC;QAMnC,MAAM,WAAW,GAAwC;YACvD,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,wBAAwB;SACpC,CAAC;QACF,IAAI,OAAO,EAAE,GAAG,EAAE,CAAC;YACjB,WAAW,CAAC,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACvD,CAAC;QACD,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAC5C,OAAO,EACP,IAAI,EACJ,WAAW,CACZ,CAAC;YACF,OAAO;gBACL,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;gBACtB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;gBACtB,QAAQ,EAAE,CAAC;aACZ,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IACE,KAAK;gBACL,OAAO,KAAK,KAAK,QAAQ;gBACzB,QAAQ,IAAI,KAAK;gBACjB,QAAQ,IAAI,KAAK;gBACjB,MAAM,IAAI,KAAK,EACf,CAAC;gBACD,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;oBACnC,OAAO,CAAC,KAAK,CACX,GAAG,OAAO,wCAAwC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CACvE,CAAC;gBACJ,CAAC;gBACD,OAAO;oBACL,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;oBAC5B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;oBAC5B,QAAQ,EAAE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;iBAC1D,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAlDD,wDAkDC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-issue-tower-defence-management",
3
- "version": "1.148.8",
3
+ "version": "1.148.10",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
@@ -1,4 +1,5 @@
1
- import { render } from '@testing-library/react';
1
+ import { render, waitFor } from '@testing-library/react';
2
+ import { parseGitHubReferenceUrl } from '../../logic/references';
2
3
  import {
3
4
  consoleChangedFilesFixture,
4
5
  consoleCommitsFixture,
@@ -12,6 +13,11 @@ jest.mock('../../lib/mermaidLoader', () => ({
12
13
 
13
14
  const now = Date.parse('2026-06-19T12:00:00.000Z');
14
15
  const pullRequest = consoleRelatedPullRequestsFixture[0];
16
+ const pullRequestReference = parseGitHubReferenceUrl(pullRequest.url);
17
+
18
+ if (pullRequestReference === null) {
19
+ throw new Error('the fixture pull request url must be a GitHub url');
20
+ }
15
21
 
16
22
  describe('ConsolePullRequestDetail', () => {
17
23
  it('renders the title, stat bar and changed files', () => {
@@ -106,6 +112,84 @@ describe('ConsolePullRequestDetail', () => {
106
112
  );
107
113
  });
108
114
 
115
+ it('renders an issue reference in the description against the repository owning the pull request', async () => {
116
+ const referencedIssueNumber = 1234;
117
+ const renderReferenceLink = jest.fn((href: string) => (
118
+ <span className="decorated-reference" data-href={href}>
119
+ decorated
120
+ </span>
121
+ ));
122
+ const { container } = render(
123
+ <ConsolePullRequestDetail
124
+ pullRequest={{
125
+ ...pullRequest,
126
+ summary:
127
+ pullRequest.summary === null
128
+ ? null
129
+ : {
130
+ ...pullRequest.summary,
131
+ body: `- close #${referencedIssueNumber}`,
132
+ },
133
+ }}
134
+ body={`- close #${referencedIssueNumber}`}
135
+ bodyIsLoading={false}
136
+ files={consoleChangedFilesFixture}
137
+ filesAreLoading={false}
138
+ filesError={null}
139
+ commits={consoleCommitsFixture}
140
+ commitsAreLoading={false}
141
+ commitsError={null}
142
+ now={now}
143
+ renderReferenceLink={renderReferenceLink}
144
+ />,
145
+ );
146
+ await waitFor(() => {
147
+ expect(container.querySelectorAll('.decorated-reference').length).toBe(1);
148
+ });
149
+ expect(
150
+ container
151
+ .querySelector('.decorated-reference')
152
+ ?.getAttribute('data-href'),
153
+ ).toBe(
154
+ `https://github.com/${pullRequestReference.owner}/${pullRequestReference.repo}/issues/${referencedIssueNumber}`,
155
+ );
156
+ });
157
+
158
+ it('leaves an issue reference untouched when the pull request url names no repository', async () => {
159
+ const renderReferenceLink = jest.fn((href: string) => (
160
+ <span className="decorated-reference" data-href={href}>
161
+ decorated
162
+ </span>
163
+ ));
164
+ const { container } = render(
165
+ <ConsolePullRequestDetail
166
+ pullRequest={{
167
+ ...pullRequest,
168
+ url: 'https://example.com/not-a-github-pull-request',
169
+ summary:
170
+ pullRequest.summary === null
171
+ ? null
172
+ : { ...pullRequest.summary, body: '- close #1234' },
173
+ }}
174
+ body={'- close #1234'}
175
+ bodyIsLoading={false}
176
+ files={consoleChangedFilesFixture}
177
+ filesAreLoading={false}
178
+ filesError={null}
179
+ commits={consoleCommitsFixture}
180
+ commitsAreLoading={false}
181
+ commitsError={null}
182
+ now={now}
183
+ renderReferenceLink={renderReferenceLink}
184
+ />,
185
+ );
186
+ await waitFor(() => {
187
+ expect(container.querySelector('.console-markdown')).not.toBeNull();
188
+ });
189
+ expect(container.querySelector('.decorated-reference')).toBeNull();
190
+ expect(renderReferenceLink).not.toHaveBeenCalled();
191
+ });
192
+
109
193
  it('renders a copy URL button for the pull request url', () => {
110
194
  const { getByRole } = render(
111
195
  <ConsolePullRequestDetail
@@ -1,4 +1,5 @@
1
1
  import type { ImageProxyUrlBuilder } from '../../lib/imageProxy';
2
+ import { parseGitHubReferenceUrl } from '../../logic/references';
2
3
  import type {
3
4
  ConsoleChangedFile,
4
5
  ConsoleCommit,
@@ -46,6 +47,14 @@ export const ConsolePullRequestDetail = ({
46
47
  onAddInlineComment,
47
48
  }: ConsolePullRequestSectionProps) => {
48
49
  const summary = pullRequest.summary;
50
+ const pullRequestReference = parseGitHubReferenceUrl(pullRequest.url);
51
+ const repoContext =
52
+ pullRequestReference === null
53
+ ? undefined
54
+ : {
55
+ owner: pullRequestReference.owner,
56
+ repo: pullRequestReference.repo,
57
+ };
49
58
  const filesCount =
50
59
  filesAreLoading || filesError !== null ? null : files.length;
51
60
  const commitsCount =
@@ -97,6 +106,7 @@ export const ConsolePullRequestDetail = ({
97
106
  body={summary?.body ?? body}
98
107
  buildImageProxyUrl={buildImageProxyUrl}
99
108
  renderReferenceLink={renderReferenceLink}
109
+ repoContext={repoContext}
100
110
  />
101
111
  )}
102
112
  </ConsolePanel>
@@ -79,4 +79,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
79
79
  `)}),o+=1,i=null;continue}i.push(e);continue}if(fa(e)){r.push(e),a=!0;continue}r.push(e)}return i!==null&&r.push("```mermaid",...i),s(),n},ha=/^https:\/\/github\.com\/([^/\s]+)\/([^/\s]+)\/(issues|pull)\/(\d+)(?:[#?].*)?$/,ga=e=>{let t=ha.exec(e.trim());if(t===null)return null;let[,n,r,i,a]=t,o=Number.parseInt(a,10);return Number.isFinite(o)?{owner:n,repo:r,number:o,kind:i===`pull`?`pull`:`issue`}:null},_a=e=>{let t=e.indexOf(`/`);if(t<=0)return null;let n=e.slice(0,t),r=e.slice(t+1);return n===``||r===``||r.includes(`/`)?null:{owner:n,repo:r}},va=e=>({isPr:e.isPullRequest,state:e.state.toLowerCase(),merged:e.merged,isDraft:!1,stateReason:``}),ya=Object.defineProperty,ba=(e,t)=>ya(e,`name`,{value:t,configurable:!0});function xa(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ba(xa,`setRef`);function Sa(...e){return t=>{let n=!1,r=e.map(e=>{let r=xa(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():xa(e[t],null)}}}}ba(Sa,`composeRefs`);function Ca(...e){return _.useCallback(Sa(...e),e)}ba(Ca,`useComposedRefs`);var wa=Object.defineProperty,Ta=(e,t)=>wa(e,`name`,{value:t,configurable:!0});function Ea(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Fa(r)&&typeof za==`function`&&(r=za(r._payload)),_.Children.forEach(r,e=>{if(Na(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Fa(n)&&typeof za==`function`&&(n=za(n._payload)),a=Aa(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?Ma(a):void 0,l=Ca(n,c);if(!a){if(r||r===0)throw Error(o?Ra(e):La(e));return r}let u=ja(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Ta(Ea,`createSlot`);var Da=Ea(`Slot`),Oa=Symbol.for(`radix.slottable`);function ka(e){let t=Ta(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Oa,t}Ta(ka,`createSlottable`);var Aa=Ta((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 ja(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}}Ta(ja,`mergeProps`);function Ma(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)}Ta(Ma,`getElementRef`);function Na(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Oa}Ta(Na,`isSlottable`);var Pa=Symbol.for(`react.lazy`);function Fa(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Pa&&`_payload`in e&&Ia(e._payload)}Ta(Fa,`isLazyComponent`);function Ia(e){return typeof e==`object`&&!!e&&`then`in e}Ta(Ia,`isPromiseLike`);var La=Ta(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ra=Ta(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),za=_.use;function Ba(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=Ba(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Va(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ba(e))&&(r&&(r+=` `),r+=t);return r}var Ha=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ua=Va,Wa=(e,t)=>n=>{if(t?.variants==null)return Ua(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=Ha(t)||Ha(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 Ua(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)},Ga=(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},Ka=(e,t)=>({classGroupId:e,validator:t}),qa=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ja=`-`,Ya=[],Xa=`arbitrary..`,Za=e=>{let t=eo(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return $a(e);let n=e.split(Ja);return Qa(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ga(i,t):t:i||Ya}return n[e]||Ya}}},Qa=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Qa(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ja):e.slice(t).join(Ja),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},$a=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?Xa+r:void 0})(),eo=e=>{let{theme:t,classGroups:n}=e;return to(n,t)},to=(e,t)=>{let n=qa();for(let r in e){let i=e[r];no(i,n,r,t)}return n},no=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ro(i,t,n,r)}},ro=(e,t,n,r)=>{if(typeof e==`string`){io(e,t,n);return}if(typeof e==`function`){ao(e,t,n,r);return}oo(e,t,n,r)},io=(e,t,n)=>{let r=e===``?t:so(t,e);r.classGroupId=n},ao=(e,t,n,r)=>{if(co(e)){no(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ka(n,e))},oo=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];no(o,so(t,a),n,r)}},so=(e,t)=>{let n=e,r=t.split(Ja),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=qa(),n.nextPart.set(t,i)),n=i}return n},co=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,lo=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)}}},uo=`!`,fo=`:`,po=[],B=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),V=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===fo){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(uo)?(c=s.slice(0,-1),l=!0):s.startsWith(uo)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return B(t,l,c,u)};if(t){let e=t+fo,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):B(po,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},mo=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}},ho=e=>({cache:lo(e.cacheSize),parseClassName:V(e),sortModifiers:mo(e),postfixLookupClassGroupIds:go(e),...Za(e)}),go=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},_o=/\s+/,vo=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(_o),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?_+uo:_,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},yo=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=bo(n))&&(i&&(i+=` `),i+=r);return i},bo=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=bo(e[r]))&&(n&&(n+=` `),n+=t);return n},xo=(e,...t)=>{let n,r,i,a,o=o=>(n=ho(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=vo(e,n);return i(e,a),a};return a=o,(...e)=>a(yo(...e))},So=[],Co=e=>{let t=t=>t[e]||So;return t.isThemeGetter=!0,t},wo=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,To=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Eo=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Do=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oo=/\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$/,ko=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ao=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,H=e=>Eo.test(e),U=e=>!!e&&!Number.isNaN(Number(e)),Mo=e=>!!e&&Number.isInteger(Number(e)),No=e=>e.endsWith(`%`)&&U(e.slice(0,-1)),Po=e=>Do.test(e),Fo=()=>!0,Io=e=>Oo.test(e)&&!ko.test(e),Lo=()=>!1,Ro=e=>Ao.test(e),zo=e=>jo.test(e),Bo=e=>!W(e)&&!G(e),Vo=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)),Ho=e=>rs(e,ss,Lo),W=e=>wo.test(e),Uo=e=>rs(e,cs,Io),Wo=e=>rs(e,ls,U),Go=e=>rs(e,ds,Fo),Ko=e=>rs(e,us,Lo),qo=e=>rs(e,as,Lo),Jo=e=>rs(e,os,zo),Yo=e=>rs(e,fs,Ro),G=e=>To.test(e),Xo=e=>is(e,cs),Zo=e=>is(e,us),Qo=e=>is(e,as),$o=e=>is(e,ss),es=e=>is(e,os),ts=e=>is(e,fs,!0),ns=e=>is(e,ds,!0),rs=(e,t,n)=>{let r=wo.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},is=(e,t,n=!1)=>{let r=To.exec(e);return r?r[1]?t(r[1]):n:!1},as=e=>e===`position`||e===`percentage`,os=e=>e===`image`||e===`url`,ss=e=>e===`length`||e===`size`||e===`bg-size`,cs=e=>e===`length`,ls=e=>e===`number`,us=e=>e===`family-name`,ds=e=>e===`number`||e===`weight`,fs=e=>e===`shadow`,ps=xo(()=>{let e=Co(`color`),t=Co(`font`),n=Co(`text`),r=Co(`font-weight`),i=Co(`tracking`),a=Co(`leading`),o=Co(`breakpoint`),s=Co(`container`),c=Co(`spacing`),l=Co(`radius`),u=Co(`shadow`),d=Co(`inset-shadow`),f=Co(`text-shadow`),p=Co(`drop-shadow`),m=Co(`blur`),h=Co(`perspective`),g=Co(`aspect`),_=Co(`ease`),v=Co(`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(),G,W],ee=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],S=()=>[`auto`,`contain`,`none`],C=()=>[G,W,c],w=()=>[H,`full`,`auto`,...C()],te=()=>[Mo,`none`,`subgrid`,G,W],ne=()=>[`auto`,{span:[`full`,Mo,G,W]},Mo,G,W],T=()=>[Mo,`auto`,G,W],re=()=>[`auto`,`min`,`max`,`fr`,G,W],ie=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ae=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],oe=()=>[`auto`,...C()],se=()=>[H,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...C()],ce=()=>[H,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...C()],le=()=>[H,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...C()],E=()=>[e,G,W],D=()=>[...b(),Qo,qo,{position:[G,W]}],ue=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],de=()=>[`auto`,`cover`,`contain`,$o,Ho,{size:[G,W]}],fe=()=>[No,Xo,Uo],O=()=>[``,`none`,`full`,l,G,W],k=()=>[``,U,Xo,Uo],A=()=>[`solid`,`dashed`,`dotted`,`double`],pe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],me=()=>[U,No,Qo,qo],j=()=>[``,`none`,m,G,W],he=()=>[`none`,U,G,W],M=()=>[`none`,U,G,W],ge=()=>[U,G,W],N=()=>[H,`full`,...C()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Po],breakpoint:[Po],color:[Fo],container:[Po],"drop-shadow":[Po],ease:[`in`,`out`,`in-out`],font:[Bo],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Po],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Po],shadow:[Po],spacing:[`px`,U],text:[Po],"text-shadow":[Po],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,H,W,G,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,G,W]}],"container-named":[Vo],columns:[{columns:[U,W,G,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:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Mo,`auto`,G,W]}],basis:[{basis:[H,`full`,`auto`,s,...C()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[U,H,`auto`,`initial`,`none`,W]}],grow:[{grow:[``,U,G,W]}],shrink:[{shrink:[``,U,G,W]}],order:[{order:[Mo,`first`,`last`,`none`,G,W]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ne()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ne()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...ie(),`normal`]}],"justify-items":[{"justify-items":[...ae(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ae()]}],"align-content":[{content:[`normal`,...ie()]}],"align-items":[{items:[...ae(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ae(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ae(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ae()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mbs:[{mbs:oe()}],mbe:[{mbe:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":C()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":C()}],"space-y-reverse":[`space-y-reverse`],size:[{size:se()}],"inline-size":[{inline:[`auto`,...ce()]}],"min-inline-size":[{"min-inline":[`auto`,...ce()]}],"max-inline-size":[{"max-inline":[`none`,...ce()]}],"block-size":[{block:[`auto`,...le()]}],"min-block-size":[{"min-block":[`auto`,...le()]}],"max-block-size":[{"max-block":[`none`,...le()]}],w:[{w:[s,`screen`,...se()]}],"min-w":[{"min-w":[s,`screen`,`none`,...se()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...se()]}],h:[{h:[`screen`,`lh`,...se()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...se()]}],"max-h":[{"max-h":[`screen`,`lh`,...se()]}],"font-size":[{text:[`base`,n,Xo,Uo]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,ns,Go]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,No,W]}],"font-family":[{font:[Zo,Ko,t]}],"font-features":[{"font-features":[W]}],"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,G,W]}],"line-clamp":[{"line-clamp":[U,`none`,G,Wo]}],leading:[{leading:[a,...C()]}],"list-image":[{"list-image":[`none`,G,W]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,G,W]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...A(),`wavy`]}],"text-decoration-thickness":[{decoration:[U,`from-font`,`auto`,G,Uo]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[U,`auto`,G,W]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:C()}],"tab-size":[{tab:[Mo,G,W]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,G,W]}],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`,G,W]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:ue()}],"bg-size":[{bg:de()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Mo,G,W],radial:[``,G,W],conic:[Mo,G,W]},es,Jo]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:k()}],"border-w-x":[{"border-x":k()}],"border-w-y":[{"border-y":k()}],"border-w-s":[{"border-s":k()}],"border-w-e":[{"border-e":k()}],"border-w-bs":[{"border-bs":k()}],"border-w-be":[{"border-be":k()}],"border-w-t":[{"border-t":k()}],"border-w-r":[{"border-r":k()}],"border-w-b":[{"border-b":k()}],"border-w-l":[{"border-l":k()}],"divide-x":[{"divide-x":k()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":k()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...A(),`hidden`,`none`]}],"divide-style":[{divide:[...A(),`hidden`,`none`]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-bs":[{"border-bs":E()}],"border-color-be":[{"border-be":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...A(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[U,G,W]}],"outline-w":[{outline:[``,U,Xo,Uo]}],"outline-color":[{outline:E()}],shadow:[{shadow:[``,`none`,u,ts,Yo]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":[`none`,d,ts,Yo]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[U,Uo]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":k()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":[`none`,f,ts,Yo]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[U,G,W]}],"mix-blend":[{"mix-blend":[...pe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":pe()}],"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":[U]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[G,W]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"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":[U]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:ue()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,G,W]}],filter:[{filter:[``,`none`,G,W]}],blur:[{blur:j()}],brightness:[{brightness:[U,G,W]}],contrast:[{contrast:[U,G,W]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,ts,Yo]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:[``,U,G,W]}],"hue-rotate":[{"hue-rotate":[U,G,W]}],invert:[{invert:[``,U,G,W]}],saturate:[{saturate:[U,G,W]}],sepia:[{sepia:[``,U,G,W]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,G,W]}],"backdrop-blur":[{"backdrop-blur":j()}],"backdrop-brightness":[{"backdrop-brightness":[U,G,W]}],"backdrop-contrast":[{"backdrop-contrast":[U,G,W]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,U,G,W]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[U,G,W]}],"backdrop-invert":[{"backdrop-invert":[``,U,G,W]}],"backdrop-opacity":[{"backdrop-opacity":[U,G,W]}],"backdrop-saturate":[{"backdrop-saturate":[U,G,W]}],"backdrop-sepia":[{"backdrop-sepia":[``,U,G,W]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,G,W]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[U,`initial`,G,W]}],ease:[{ease:[`linear`,`initial`,_,G,W]}],delay:[{delay:[U,G,W]}],animate:[{animate:[`none`,v,G,W]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,G,W]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:he()}],"rotate-x":[{"rotate-x":he()}],"rotate-y":[{"rotate-y":he()}],"rotate-z":[{"rotate-z":he()}],scale:[{scale:M()}],"scale-x":[{"scale-x":M()}],"scale-y":[{"scale-y":M()}],"scale-z":[{"scale-z":M()}],"scale-3d":[`scale-3d`],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[G,W,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:N()}],"translate-x":[{"translate-x":N()}],"translate-y":[{"translate-y":N()}],"translate-z":[{"translate-z":N()}],"translate-none":[`translate-none`],zoom:[{zoom:[Mo,G,W]}],accent:[{accent:E()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:E()}],"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`,G,W]}],"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":E()}],"scrollbar-track-color":[{"scrollbar-track":E()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"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`,G,W]}],fill:[{fill:[`none`,...E()]}],"stroke-w":[{stroke:[U,Xo,Uo,Wo]}],stroke:[{stroke:[`none`,...E()]}],"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`]}}),ms=(...e)=>ps(Va(e)),hs=Wa(`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`}}),gs=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,x.jsx)(r?Da:`button`,{className:ms(hs({variant:t,size:n,className:e})),ref:a,...i}));gs.displayName=`Button`;var _s=`Copying to the clipboard is not available in this browser context.`,vs=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},ys=async e=>{let t=navigator.clipboard;if(t!==void 0&&typeof t.writeText==`function`)try{await t.writeText(e);return}catch{if(vs(e))return;throw Error(_s)}if(!vs(e))throw Error(_s)},bs=1500,xs=`Copy failed`,Ss=`Copying to the clipboard failed`,Cs=({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)(gs,{type:`button`,variant:`ghost`,size:`sm`,className:i,"aria-label":a===`copied`?r:a===`failed`?Ss:n,onClick:async()=>{try{await ys(e),o(`copied`)}catch(e){console.error(e),o(`failed`)}s.current!==null&&clearTimeout(s.current),s.current=setTimeout(()=>{o(`idle`),s.current=null},bs)},children:a===`copied`?`Copied`:a===`failed`?xs:t})},ws=({code:e,label:t=`Copy code`})=>(0,x.jsx)(Cs,{value:e,idleText:t,idleAriaLabel:t,copiedAriaLabel:`Code copied to clipboard`,className:`console-copy-code-button`}),Ts=`https://cdn.jsdelivr.net/npm/mermaid@10.9.6/dist/mermaid.min.js`,Es=null,Ds=0,Os=e=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`dark`,themeVariables:{background:`#0d1117`,primaryColor:`#161b22`,primaryTextColor:`#e6edf3`,primaryBorderColor:`#30363d`,lineColor:`#8b949e`,fontSize:`14px`}}),e),ks=()=>Es===null?window.mermaid===void 0?(Es=new Promise((e,t)=>{let n=document.createElement(`script`);n.src=Ts,n.async=!0,n.onload=()=>{if(window.mermaid===void 0){t(Error(`mermaid failed to load`));return}e(Os(window.mermaid))},n.onerror=()=>t(Error(`mermaid script failed to load`)),document.head.appendChild(n)}),Es):(Es=Promise.resolve(Os(window.mermaid)),Es):Es,As=async e=>{let t=await ks();Ds+=1;let n=`console-mermaid-${Ds}`,{svg:r}=await t.render(n,e);return yr.sanitize(r,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:[`foreignObject`]})},js=({code:e})=>{let[t,n]=(0,_.useState)({status:`loading`}),r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=!1;return n({status:`loading`}),As(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`})},Ms=e=>{let t=e.querySelectorAll(`a[href]`),n=[];return t.forEach((e,t)=>{let r=e.getAttribute(`href`)??``;if(ga(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},Ns=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},Ps=({source:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,_.useMemo)(()=>{let n=ua(e,r);return t===void 0?n:Xt(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(Ns(e)),s(n===void 0?[]:Ms(e)))},[i,n]),(0,x.jsxs)(`div`,{ref:a,className:`console-markdown`,children:[c.map(e=>(0,Kt.createPortal)((0,x.jsx)(ws,{code:e.code}),e.host,e.key)),n!==void 0&&o.map(e=>(0,Kt.createPortal)(n(e.href,e.fallbackText),e.host,e.key))]})},Fs=({body:e,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r})=>{let i=(0,_.useMemo)(()=>ma(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)(js,{code:e.code},e.key):(0,x.jsx)(Ps,{source:e.source,buildImageProxyUrl:t,renderReferenceLink:n,repoContext:r},e.key))})},Is=(e,t)=>e.length===0?`${t}\n`:e.endsWith(`
80
80
  `)?`${e}${t}\n`:`${e}\n${t}\n`,Ls=({isPr:e,now:t,onSubmit:n,onUploadFile:r})=>{let[i,a]=(0,_.useState)(!e),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)({kind:`idle`}),[u,d]=(0,_.useState)({kind:`idle`}),[f,p]=(0,_.useState)([]),m=(0,_.useRef)(null),h=async()=>{let e=o.trim();if(!(e.length===0||c.kind===`posting`)){l({kind:`posting`});try{let t=await n(e);p(e=>[...e,t]),s(``),l({kind:`idle`})}catch(e){l({kind:`error`,message:e instanceof Error?e.message:`failed to post`})}}},g=async e=>{if(!(r===void 0||e.length===0))for(let t of e){d({kind:`uploading`,fileName:t.name});try{let e=await r(t);s(t=>Is(t,e)),d({kind:`idle`})}catch(e){d({kind:`error`,message:e instanceof Error?e.message:`failed to upload file`});return}}};return(0,x.jsxs)(`div`,{className:`console-composer`,children:[(0,x.jsx)(`button`,{type:`button`,className:`console-composer-toggle`,"aria-expanded":i,onClick:()=>a(e=>!e),children:i?`✕ Cancel`:`💬 Add a comment`}),f.length>0&&(0,x.jsx)(`div`,{className:`console-composer-posted`,children:f.map(e=>(0,x.jsxs)(`article`,{className:`console-comment`,children:[(0,x.jsxs)(`header`,{className:`console-comment-header`,title:oe(e.createdAt),children:[(0,x.jsx)(`span`,{className:`console-comment-author`,children:e.author===``?`you`:e.author}),(0,x.jsx)(`span`,{className:`console-comment-time`,children:ae(e.createdAt,t)})]}),(0,x.jsx)(Fs,{body:e.body})]},`${e.author}:${e.createdAt}:${e.body}`))}),i&&(0,x.jsxs)(`div`,{className:`console-composer-form`,children:[(0,x.jsx)(`textarea`,{className:`console-composer-input`,rows:3,placeholder:`Leave a comment…`,value:o,onChange:e=>s(e.target.value),onDragOver:e=>{r!==void 0&&e.preventDefault()},onDrop:e=>{r!==void 0&&(e.preventDefault(),g(Array.from(e.dataTransfer.files)))},onPaste:e=>{if(r===void 0)return;let t=Array.from(e.clipboardData.files);t.length!==0&&(e.preventDefault(),g(t))}}),r!==void 0&&(0,x.jsxs)(`div`,{className:`console-composer-attach`,children:[(0,x.jsx)(`input`,{ref:m,type:`file`,multiple:!0,className:`console-composer-file-input`,"aria-label":`Attach files`,onChange:e=>{let t=Array.from(e.target.files??[]);e.target.value=``,g(t)}}),(0,x.jsx)(`button`,{type:`button`,className:`console-composer-attach-button`,disabled:u.kind===`uploading`,onClick:()=>m.current?.click(),children:`📎 Attach files`}),u.kind===`uploading`&&(0,x.jsxs)(`span`,{className:`console-composer-status`,children:[`Uploading `,u.fileName,`…`]}),u.kind===`error`&&(0,x.jsxs)(`span`,{role:`alert`,className:`console-composer-status console-composer-error`,children:[`Upload failed: `,u.message]})]}),(0,x.jsxs)(`div`,{className:`console-composer-row`,children:[c.kind===`posting`&&(0,x.jsx)(`span`,{className:`console-composer-status`,children:`Posting…`}),c.kind===`error`&&(0,x.jsxs)(`span`,{role:`alert`,className:`console-composer-status console-composer-error`,children:[`Failed: `,c.message]}),(0,x.jsx)(`button`,{type:`button`,className:`console-composer-submit`,disabled:c.kind===`posting`,onClick:()=>{h()},children:`Comment`})]})]})]})},Rs=({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})]})},zs=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`}}},Bs=()=>({directories:new Map,files:[]}),Vs=e=>e.split(`/`).filter(e=>e!==``),Hs=(e,t)=>e.name.localeCompare(t.name),Us=(e,t)=>{let n=[];e.directories.forEach((e,r)=>{let i=t===``?r:`${t}/${r}`;n.push({kind:`directory`,name:r,path:i,children:Us(e,i)})}),n.sort(Hs);let r=e.files.map(e=>({kind:`file`,name:Vs(e.path).at(-1)??e.path,path:e.path,file:e}));return r.sort(Hs),[...n,...r]},Ws=e=>{let t=Bs();for(let n of e){let e=Vs(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=Bs();i.directories.set(e,t),i=t;continue}i=t}i.files.push(n)}return Us(t,``)},Gs=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,Ks=e=>{let t=[],n=0,r=0;for(let i of e.split(`
81
81
  `)){if(i.startsWith(`@@`)){let e=i.match(Gs);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`],Js=e=>{let t=e.toLowerCase();return qs.some(e=>t.endsWith(e))},Ys=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,Xs=e=>`${e.kind}:${e.oldLineNumber??`x`}:${e.newLineNumber??`x`}:${e.content}`,Zs=({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]})]})]})]})},Qs=({patch:e,path:t,rawUrl:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,_.useState)(null);if(e===null||e===``)return t!==void 0&&Js(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=Ks(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=Xs(e),r=c?Ys(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)(Zs,{target:a,onSubmit:i,onClose:()=>o(null)})})})]},n)})})})},$s=e=>({paddingLeft:`${e*16}px`}),ec=({file:e,depth:t,name:n,buildImageProxyUrl:r,onAddInlineComment:i})=>{let[a,o]=(0,_.useState)(!1),s=zs(e.status);return(0,x.jsxs)(`li`,{className:`console-file`,children:[(0,x.jsxs)(`button`,{type:`button`,className:`console-file-row`,style:$s(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)(Qs,{patch:e.patch,path:e.path,rawUrl:e.rawUrl,buildImageProxyUrl:r,onAddInlineComment:i})]})},tc=({node:e,depth:t,buildImageProxyUrl:n,onAddInlineComment:r})=>e.kind===`file`?(0,x.jsx)(ec,{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:$s(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)(tc,{node:e,depth:t+1,buildImageProxyUrl:n,onAddInlineComment:r},e.path))})]}),nc=({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:Ws(e).map(e=>(0,x.jsx)(tc,{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]}),rc=({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:ae(e.createdAt,r)})]}),(0,x.jsx)(Fs,{body:e.body,buildImageProxyUrl:i,renderReferenceLink:a,repoContext:o})]},`${e.author}:${e.createdAt}:${e.body}`))]})},ic=e=>e.slice(0,7),ac=e=>e.split(`
82
- `)[0],oc=({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:ac(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:ic(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:ae(e.authoredAt,r)})]},e.sha))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-commits-error`,children:[`Failed to load commits: `,n]}),sc=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(Cs,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),cc={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`}},lc=({mergeableStatus:e})=>{let t=cc[e],n=ue(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})},uc=e=>{let t=ue(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},dc=({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:uc(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:uc(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},fc=({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=i||a!==null?null:r.length,h=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)(lc,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(dc,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(sc,{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)(Rs,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Fs,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d})}),(0,x.jsx)(Rs,{title:`Changed files`,count:m,children:(0,x.jsx)(nc,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Rs,{title:`Commits`,count:h,defaultCollapsed:!0,children:(0,x.jsx)(oc,{commits:o,isLoading:s,error:c,now:l})})]})},pc=({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:ee,now:S,commentComposer:C,operationBar:w,buildImageProxyUrl:te,renderReferenceLink:ne,onAddInlineComment:T})=>{let re=i?.state??`open`,ie=i?.merged??!1,se=!e.isPr&&re===`closed`?`Closed`:null,ce=_a(e.nameWithOwner)??void 0,E=ue(n),D=r?ue(r.color):null,de=f||p!==null?null:d.length,fe=l||u!==null?null:c.length,O=h||g!==null?null:m.length,k=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:E.dot}}),t]}),e.isPr&&v?.found&&(0,x.jsx)(dc,{isPassedAllCiJob:v.isPassedAllCiJob,isCiStateSuccess:v.isCiStateSuccess,isBranchOutOfDate:v.isBranchOutOfDate,missingRequiredCheckNames:v.missingRequiredCheckNames}),k.map(e=>(0,x.jsx)(lc,{mergeableStatus:e.mergeableStatus},e.url))]}),(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[r!==null&&D!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:D.fg,borderColor:D.border,backgroundColor:D.bg},children:r.name}),(0,x.jsx)(le,{isPr:e.isPr,state:re,merged:ie,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})]}),_!==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)(sc,{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:oe(e.createdAt),children:[`opened `,ae(e.createdAt,S)]}),(0,x.jsx)(Rs,{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)(Fs,{body:a,buildImageProxyUrl:te,renderReferenceLink:ne,repoContext:ce}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-body-error`,children:[`Failed to load description: `,s]})}),e.isPr&&(0,x.jsx)(Rs,{title:`Changed files`,count:de,children:(0,x.jsx)(nc,{files:d,isLoading:f,error:p,onAddInlineComment:T})}),(0,x.jsx)(Rs,{title:`Comments`,count:fe,defaultCollapsed:e.isPr,children:(0,x.jsx)(rc,{comments:c,isLoading:l,error:u,now:S,buildImageProxyUrl:te,renderReferenceLink:ne,repoContext:ce})}),e.isPr&&(0,x.jsx)(Rs,{title:`Commits`,count:O,defaultCollapsed:!0,children:(0,x.jsx)(oc,{commits:m,isLoading:h,error:g,now:S})}),!e.isPr&&ee!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load related pull requests: `,ee]}),!e.isPr&&b.map(e=>(0,x.jsx)(fc,{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:S,buildImageProxyUrl:te,renderReferenceLink:ne,onAddInlineComment:T},e.pullRequest.url)),C,(0,x.jsx)(`div`,{className:`console-actionbar`,children:w})]})},mc=({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`})]}),hc=({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`})]}),gc=[{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`}],_c=`Reject needs an inline comment on the diff.`,vc=({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:_c}),gc.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)})]}),yc=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},bc=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=he.map(t=>({name:t,option:yc(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=ue(r.color),a=e===M;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)})})},xc=e=>e.name.toLowerCase().includes(`no story`),Sc=({storyOptions:e,onSetStory:t})=>{let n=e.filter(e=>!xc(e));return n.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group console-op-group-stories`,children:n.map(e=>{let n=ue(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)})})},Cc=({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)(vc,{onReview:a.onReview,rejectEnabled:n}),(0,x.jsx)(hc,{isManualTriage:ge(e),onSetNextActionDate:a.onSetNextActionDate}),o&&(0,x.jsx)(Sc,{storyOptions:i,onSetStory:a.onSetStory}),(0,x.jsx)(bc,{statusOptions:r,onSetStatus:a.onSetStatus,onSetInTmuxByHuman:a.onSetInTmuxByHuman}),(0,x.jsx)(mc,{onClose:a.onClose})]})},wc=(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}},Tc=[],Ec=[],Dc=[],Oc=[],kc={state:`open`,merged:!1,isPullRequest:!1,title:``},Ac={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},jc=(e,t)=>{let n=t===null?null:`${t.repo}#${t.number}`,r=t===null?null:t.url,i=t?.isPr??!1,a=wc(e.body,n,r,``),o=wc(e.state,n,r,kc),s=wc(e.comments,n,r,Tc),c=wc(e.files,i?n:null,i?r:null,Ec),l=wc(e.commits,i?n:null,i?r:null,Dc),u=wc(e.prStatus,i?n:null,i?r:null,Ac),d=wc(e.relatedPrs,i?null:n,i?null:r,Oc),[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:Ec,filesAreLoading:!0,filesError:null,commits:Dc,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}},Mc=({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)(le,{...va(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title})]}),Nc=(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},Pc=({cache:e,href:t,fallbackText:n})=>(0,x.jsx)(Mc,{href:t,fallbackText:n,state:Nc(e,t)}),Fc=({tab:e,item:t,caches:n,operations:r,statusOptions:i,storyOptions:a,storyColors:o,storyName:s,overlayStatus:c,now:l,onQueueAction:u})=>{let d=jc(n,t),f=(0,_.useCallback)(e=>Yt(e),[]),p=(0,_.useCallback)((e,t)=>(0,x.jsx)(Pc,{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={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)})}},b=s??(t.story.trim()===``?null:t.story);return(0,x.jsx)(pc,{item:t,storyName:b,storyColorEnum:b===null?null:C(o,b),overlayStatus:c,state:d.state,stateError:d.stateError,body:d.body,bodyIsLoading:d.bodyIsLoading,bodyError:d.bodyError,comments:d.comments,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)(Ls,{isPr:t.isPr,now:l,onSubmit:e=>r.addComment(t,e),onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Cc,{tab:e,item:t,hasPullRequest:m,rejectEnabled:h.length>0,statusOptions:i,storyOptions:a,handlers:y})})},Ic=()=>{let e={};for(let t of y)e[t.name]=0;return e},Lc=`console`,Rc=()=>{let e=Ot(),{snapshots:t,isLoading:n,error:r}=Ht(e),i=Et(e??Lc),a=(0,_.useMemo)(()=>{let e=Ic();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]),S=(0,_.useMemo)(()=>te(v,i.overlay),[v,i.overlay]),C=g?.storyColors??{},ne=g?.statusOptions??[],T=g?.storyOptions??[],re=g?.generatedAt??null,ie=(0,_.useMemo)(()=>c===null||g===null?null:g.items.find(e=>e.projectItemId===c)??null,[c,g]);it(f,ie,v),(0,_.useEffect)(()=>{c!==null&&window.scrollTo({top:0})},[c]);let ae=a[s],oe=(0,_.useRef)({tab:s,count:ae});(0,_.useEffect)(()=>{let e=oe.current;if(oe.current={tab:s,count:ae},e.tab===s&&e.count>0&&ae===0){let e=F(s,a);e!==null&&(d(e),u())}},[s,ae,a,d,u]);let se=ie===null?null:i.overlay[dt(ie)]?.status??null,ce=ie===null?null:w(ie,i.overlay),le=(0,_.useCallback)(e=>{let t=Ut(b,e);t===null?u():l(t)},[b,l,u]),E=(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)&&le(t)}})},[m,s,le]),D=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)(O,{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)(k,{message:`Operation failed: ${m.error.reason}`,onDismiss:m.dismissError}),(0,x.jsx)(ee,{activeTab:s,counts:a,pjcode:e,generatedAt:re,tabHref:o.tabHref,onSelectTab:o.selectTab}),ie===null?(0,x.jsx)(fe,{rows:S,storyColors:C,activeItemId:null,now:h,isLoading:n,error:r,onSelectItem:e=>o.openItem(e.projectItemId)}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:D,children:(0,x.jsx)(Fc,{tab:s,item:ie,caches:f,operations:p,statusOptions:ne,storyOptions:T,storyColors:C,storyName:ce,overlayStatus:se,now:h,onQueueAction:E},ie.projectItemId)})]})},zc=document.getElementById(`root`);if(zc===null)throw Error(`Root container #root not found`);(0,v.createRoot)(zc).render((0,x.jsx)(_.StrictMode,{children:(0,x.jsx)(Rc,{})}));
82
+ `)[0],oc=({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:ac(e.message)}),(0,x.jsx)(`span`,{className:`console-commit-sha`,children:ic(e.sha)}),(0,x.jsx)(`span`,{className:`console-commit-author`,children:e.author}),(0,x.jsx)(`span`,{className:`console-commit-time`,children:ae(e.authoredAt,r)})]},e.sha))}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-commits-error`,children:[`Failed to load commits: `,n]}),sc=({url:e,label:t=`Copy URL`})=>(0,x.jsx)(Cs,{value:e,idleText:`Copy URL`,idleAriaLabel:t,copiedAriaLabel:`URL copied to clipboard`,className:`console-copy-url-button`}),cc={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`}},lc=({mergeableStatus:e})=>{let t=cc[e],n=ue(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})},uc=e=>{let t=ue(e);return{color:t.fg,borderColor:t.border,backgroundColor:t.bg}},dc=({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:uc(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:uc(`YELLOW`),title:`This branch is out of date with the base branch`,children:`Out of date`})]})},fc=({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=ga(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)(lc,{mergeableStatus:e.mergeableStatus}),(0,x.jsx)(dc,{isPassedAllCiJob:e.isPassedAllCiJob,isCiStateSuccess:e.isCiStateSuccess,isBranchOutOfDate:e.isBranchOutOfDate,missingRequiredCheckNames:e.missingRequiredCheckNames}),(0,x.jsx)(sc,{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)(Rs,{title:`Description`,children:n?(0,x.jsx)(`p`,{className:`console-pr-body-loading`,children:`Loading description...`}):(0,x.jsx)(Fs,{body:p?.body??t,buildImageProxyUrl:u,renderReferenceLink:d,repoContext:h})}),(0,x.jsx)(Rs,{title:`Changed files`,count:g,children:(0,x.jsx)(nc,{files:r,isLoading:i,error:a,buildImageProxyUrl:u,onAddInlineComment:f})}),(0,x.jsx)(Rs,{title:`Commits`,count:_,defaultCollapsed:!0,children:(0,x.jsx)(oc,{commits:o,isLoading:s,error:c,now:l})})]})},pc=({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:ee,now:S,commentComposer:C,operationBar:w,buildImageProxyUrl:te,renderReferenceLink:ne,onAddInlineComment:T})=>{let re=i?.state??`open`,ie=i?.merged??!1,se=!e.isPr&&re===`closed`?`Closed`:null,ce=_a(e.nameWithOwner)??void 0,E=ue(n),D=r?ue(r.color):null,de=f||p!==null?null:d.length,fe=l||u!==null?null:c.length,O=h||g!==null?null:m.length,k=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:E.dot}}),t]}),e.isPr&&v?.found&&(0,x.jsx)(dc,{isPassedAllCiJob:v.isPassedAllCiJob,isCiStateSuccess:v.isCiStateSuccess,isBranchOutOfDate:v.isBranchOutOfDate,missingRequiredCheckNames:v.missingRequiredCheckNames}),k.map(e=>(0,x.jsx)(lc,{mergeableStatus:e.mergeableStatus},e.url))]}),(0,x.jsxs)(`h2`,{className:`console-detail-title`,children:[r!==null&&D!==null&&(0,x.jsx)(`span`,{className:`console-detail-status-chip`,style:{color:D.fg,borderColor:D.border,backgroundColor:D.bg},children:r.name}),(0,x.jsx)(le,{isPr:e.isPr,state:re,merged:ie,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})]}),_!==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)(sc,{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:oe(e.createdAt),children:[`opened `,ae(e.createdAt,S)]}),(0,x.jsx)(Rs,{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)(Fs,{body:a,buildImageProxyUrl:te,renderReferenceLink:ne,repoContext:ce}):(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-body-error`,children:[`Failed to load description: `,s]})}),e.isPr&&(0,x.jsx)(Rs,{title:`Changed files`,count:de,children:(0,x.jsx)(nc,{files:d,isLoading:f,error:p,onAddInlineComment:T})}),(0,x.jsx)(Rs,{title:`Comments`,count:fe,defaultCollapsed:e.isPr,children:(0,x.jsx)(rc,{comments:c,isLoading:l,error:u,now:S,buildImageProxyUrl:te,renderReferenceLink:ne,repoContext:ce})}),e.isPr&&(0,x.jsx)(Rs,{title:`Commits`,count:O,defaultCollapsed:!0,children:(0,x.jsx)(oc,{commits:m,isLoading:h,error:g,now:S})}),!e.isPr&&ee!==null&&(0,x.jsxs)(`p`,{role:`alert`,className:`console-detail-fetch-error`,children:[`Failed to load related pull requests: `,ee]}),!e.isPr&&b.map(e=>(0,x.jsx)(fc,{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:S,buildImageProxyUrl:te,renderReferenceLink:ne,onAddInlineComment:T},e.pullRequest.url)),C,(0,x.jsx)(`div`,{className:`console-actionbar`,children:w})]})},mc=({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`})]}),hc=({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`})]}),gc=[{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`}],_c=`Reject needs an inline comment on the diff.`,vc=({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:_c}),gc.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)})]}),yc=(e,t)=>{let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)??null},bc=({statusOptions:e,onSetStatus:t,onSetInTmuxByHuman:n})=>{let r=he.map(t=>({name:t,option:yc(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=ue(r.color),a=e===M;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)})})},xc=e=>e.name.toLowerCase().includes(`no story`),Sc=({storyOptions:e,onSetStory:t})=>{let n=e.filter(e=>!xc(e));return n.length===0?null:(0,x.jsx)(`div`,{className:`console-op-group console-op-group-stories`,children:n.map(e=>{let n=ue(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)})})},Cc=({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)(vc,{onReview:a.onReview,rejectEnabled:n}),(0,x.jsx)(hc,{isManualTriage:ge(e),onSetNextActionDate:a.onSetNextActionDate}),o&&(0,x.jsx)(Sc,{storyOptions:i,onSetStory:a.onSetStory}),(0,x.jsx)(bc,{statusOptions:r,onSetStatus:a.onSetStatus,onSetInTmuxByHuman:a.onSetInTmuxByHuman}),(0,x.jsx)(mc,{onClose:a.onClose})]})},wc=(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}},Tc=[],Ec=[],Dc=[],Oc=[],kc={state:`open`,merged:!1,isPullRequest:!1,title:``},Ac={found:!1,isConflicted:!1,mergeableStatus:`UNKNOWN`,isPassedAllCiJob:!1,isCiStateSuccess:!1,isBranchOutOfDate:!1,missingRequiredCheckNames:[]},jc=(e,t)=>{let n=t===null?null:`${t.repo}#${t.number}`,r=t===null?null:t.url,i=t?.isPr??!1,a=wc(e.body,n,r,``),o=wc(e.state,n,r,kc),s=wc(e.comments,n,r,Tc),c=wc(e.files,i?n:null,i?r:null,Ec),l=wc(e.commits,i?n:null,i?r:null,Dc),u=wc(e.prStatus,i?n:null,i?r:null,Ac),d=wc(e.relatedPrs,i?null:n,i?null:r,Oc),[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:Ec,filesAreLoading:!0,filesError:null,commits:Dc,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}},Mc=({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)(le,{...va(n)}),(0,x.jsx)(`span`,{className:`console-markdown-reference-title`,children:n.title})]}),Nc=(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},Pc=({cache:e,href:t,fallbackText:n})=>(0,x.jsx)(Mc,{href:t,fallbackText:n,state:Nc(e,t)}),Fc=({tab:e,item:t,caches:n,operations:r,statusOptions:i,storyOptions:a,storyColors:o,storyName:s,overlayStatus:c,now:l,onQueueAction:u})=>{let d=jc(n,t),f=(0,_.useCallback)(e=>Yt(e),[]),p=(0,_.useCallback)((e,t)=>(0,x.jsx)(Pc,{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={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)})}},b=s??(t.story.trim()===``?null:t.story);return(0,x.jsx)(pc,{item:t,storyName:b,storyColorEnum:b===null?null:C(o,b),overlayStatus:c,state:d.state,stateError:d.stateError,body:d.body,bodyIsLoading:d.bodyIsLoading,bodyError:d.bodyError,comments:d.comments,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)(Ls,{isPr:t.isPr,now:l,onSubmit:e=>r.addComment(t,e),onUploadFile:e=>r.uploadAttachment(t,e)}),operationBar:(0,x.jsx)(Cc,{tab:e,item:t,hasPullRequest:m,rejectEnabled:h.length>0,statusOptions:i,storyOptions:a,handlers:y})})},Ic=()=>{let e={};for(let t of y)e[t.name]=0;return e},Lc=`console`,Rc=()=>{let e=Ot(),{snapshots:t,isLoading:n,error:r}=Ht(e),i=Et(e??Lc),a=(0,_.useMemo)(()=>{let e=Ic();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]),S=(0,_.useMemo)(()=>te(v,i.overlay),[v,i.overlay]),C=g?.storyColors??{},ne=g?.statusOptions??[],T=g?.storyOptions??[],re=g?.generatedAt??null,ie=(0,_.useMemo)(()=>c===null||g===null?null:g.items.find(e=>e.projectItemId===c)??null,[c,g]);it(f,ie,v),(0,_.useEffect)(()=>{c!==null&&window.scrollTo({top:0})},[c]);let ae=a[s],oe=(0,_.useRef)({tab:s,count:ae});(0,_.useEffect)(()=>{let e=oe.current;if(oe.current={tab:s,count:ae},e.tab===s&&e.count>0&&ae===0){let e=F(s,a);e!==null&&(d(e),u())}},[s,ae,a,d,u]);let se=ie===null?null:i.overlay[dt(ie)]?.status??null,ce=ie===null?null:w(ie,i.overlay),le=(0,_.useCallback)(e=>{let t=Ut(b,e);t===null?u():l(t)},[b,l,u]),E=(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)&&le(t)}})},[m,s,le]),D=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)(O,{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)(k,{message:`Operation failed: ${m.error.reason}`,onDismiss:m.dismissError}),(0,x.jsx)(ee,{activeTab:s,counts:a,pjcode:e,generatedAt:re,tabHref:o.tabHref,onSelectTab:o.selectTab}),ie===null?(0,x.jsx)(fe,{rows:S,storyColors:C,activeItemId:null,now:h,isLoading:n,error:r,onSelectItem:e=>o.openItem(e.projectItemId)}):(0,x.jsx)(`div`,{className:`console-detail-screen`,ref:D,children:(0,x.jsx)(Fc,{tab:s,item:ie,caches:f,operations:p,statusOptions:ne,storyOptions:T,storyColors:C,storyName:ce,overlayStatus:se,now:h,onQueueAction:E},ie.projectItemId)})]})},zc=document.getElementById(`root`);if(zc===null)throw Error(`Root container #root not found`);(0,v.createRoot)(zc).render((0,x.jsx)(_.StrictMode,{children:(0,x.jsx)(Rc,{})}));
@@ -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-Cp5oIKAG.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-J8xXGaD4.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-Dihcph6j.css">
9
9
  </head>
10
10
  <body>
@@ -0,0 +1,16 @@
1
+ import { NodeLocalCommandRunner } from './NodeLocalCommandRunner';
2
+
3
+ describe('NodeLocalCommandRunner large output', () => {
4
+ it('should keep the whole stdout when a command writes more than one mebibyte', async () => {
5
+ const runner = new NodeLocalCommandRunner();
6
+ const outputByteLength = 3 * 1024 * 1024;
7
+
8
+ const result = await runner.runCommand(process.execPath, [
9
+ '-e',
10
+ `process.stdout.write('x'.repeat(${outputByteLength}))`,
11
+ ]);
12
+
13
+ expect(result.exitCode).toBe(0);
14
+ expect(result.stdout.length).toBe(outputByteLength);
15
+ }, 30000);
16
+ });
@@ -34,6 +34,7 @@ describe('NodeLocalCommandRunner', () => {
34
34
  });
35
35
  expect(mockExecFileAsync).toHaveBeenCalledWith('echo', ['"test"'], {
36
36
  encoding: 'utf8',
37
+ maxBuffer: 1024 * 1024 * 256,
37
38
  });
38
39
  });
39
40
 
@@ -71,6 +72,25 @@ describe('NodeLocalCommandRunner', () => {
71
72
  });
72
73
  });
73
74
 
75
+ it('should report the reason when the command did not exit with a numeric status', async () => {
76
+ const consoleErrorSpy = jest
77
+ .spyOn(console, 'error')
78
+ .mockImplementation(() => undefined);
79
+ const error = Object.assign(new Error('Command failed'), {
80
+ code: 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER',
81
+ stdout: 'truncated output',
82
+ stderr: '',
83
+ });
84
+ mockExecFileAsync.mockRejectedValue(error);
85
+
86
+ await runner.runCommand('osv-scanner', []);
87
+
88
+ expect(consoleErrorSpy).toHaveBeenCalledWith(
89
+ 'osv-scanner did not exit with a numeric status: ERR_CHILD_PROCESS_STDIO_MAXBUFFER',
90
+ );
91
+ consoleErrorSpy.mockRestore();
92
+ });
93
+
74
94
  it('should throw error if error format is unexpected', async () => {
75
95
  mockExecFileAsync.mockRejectedValue(new Error('Unexpected error'));
76
96
 
@@ -7,6 +7,8 @@ import { promisify } from 'util';
7
7
 
8
8
  const execFileAsync = promisify(execFile);
9
9
 
10
+ const MAX_COMMAND_OUTPUT_BYTES = 1024 * 1024 * 256;
11
+
10
12
  export class NodeLocalCommandRunner implements LocalCommandRunner {
11
13
  async runCommand(
12
14
  program: string,
@@ -19,6 +21,7 @@ export class NodeLocalCommandRunner implements LocalCommandRunner {
19
21
  }> {
20
22
  const execOptions: Parameters<typeof execFileAsync>[2] = {
21
23
  encoding: 'utf8',
24
+ maxBuffer: MAX_COMMAND_OUTPUT_BYTES,
22
25
  };
23
26
  if (options?.env) {
24
27
  execOptions.env = { ...process.env, ...options.env };
@@ -42,6 +45,11 @@ export class NodeLocalCommandRunner implements LocalCommandRunner {
42
45
  'stderr' in error &&
43
46
  'code' in error
44
47
  ) {
48
+ if (typeof error.code !== 'number') {
49
+ console.error(
50
+ `${program} did not exit with a numeric status: ${String(error.code)}`,
51
+ );
52
+ }
45
53
  return {
46
54
  stdout: String(error.stdout),
47
55
  stderr: String(error.stderr),
@@ -1 +1 @@
1
- {"version":3,"file":"NodeLocalCommandRunner.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/NodeLocalCommandRunner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,6DAA6D,CAAC;AAMrE,qBAAa,sBAAuB,YAAW,kBAAkB;IACzD,UAAU,CACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC;QACT,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CAmCH"}
1
+ {"version":3,"file":"NodeLocalCommandRunner.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/NodeLocalCommandRunner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,6DAA6D,CAAC;AAQrE,qBAAa,sBAAuB,YAAW,kBAAkB;IACzD,UAAU,CACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE,yBAAyB,GAClC,OAAO,CAAC;QACT,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CAyCH"}