@wjarka/cezarion 0.14.2 → 0.14.3-pr425.663
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/README.md +26 -2
- package/dist/contract/delegation.d.ts +9 -0
- package/dist/contract/index.js +4 -2
- package/dist/contract/runs.d.ts +18 -0
- package/dist/core/cursor-acp-runner.js +13 -0
- package/dist/core/cursor-acp-runner.js.map +1 -1
- package/dist/runs/agent-tmpdir.d.ts +44 -4
- package/dist/runs/agent-tmpdir.js +209 -31
- package/dist/runs/agent-tmpdir.js.map +1 -1
- package/dist/server/server.d.ts +5 -0
- package/dist/workflows/run.d.ts +4 -0
- package/dist/workflows/run.js +8 -1
- package/dist/workflows/run.js.map +1 -1
- package/package.json +3 -3
- package/scripts/mock-cursor-acp.mjs +15 -3
- package/web/dist/assets/agent-accounts-BxBsIXGa.js +1 -0
- package/web/dist/assets/alert-dialog-BOp2HnnL.js +43 -0
- package/web/dist/assets/{collapsible-D7QXWXZq.js → collapsible-bb0csfMs.js} +1 -1
- package/web/dist/assets/{commit-list-AwLNQE91.js → commit-list-CEVhJoCF.js} +1 -1
- package/web/dist/assets/{compare-variants-CBggabVc.js → compare-variants-CZqdiqvW.js} +1 -1
- package/web/dist/assets/{diff-C4aSZfrQ2.js → diff-BjLZHKfD2.js} +2 -2
- package/web/dist/assets/{diff-controls-74Z0C3ay.js → diff-controls-DaO836o4.js} +1 -1
- package/web/dist/assets/{diff-stat-B7f-F8cC.js → diff-stat-DpHwISUB.js} +1 -1
- package/web/dist/assets/{diff-view-BPKHTL85.js → diff-view-BaYxuP8L.js} +1 -1
- package/web/dist/assets/dropdown-menu-DAmCVaLJ.js +1 -0
- package/web/dist/assets/{git-toolbar-Dntzprrr.js → git-toolbar-rk3doc2w.js} +1 -1
- package/web/dist/assets/github-BPfdr6aa.js +1 -0
- package/web/dist/assets/{image-preview-BhuwWeyP.js → image-preview-CFHgISfb.js} +1 -1
- package/web/dist/assets/index-C4iEPAUV.js +7 -0
- package/web/dist/assets/index-DPOGn7D5.css +1 -0
- package/web/dist/assets/{markdown-BssEOroY.js → markdown-Ir62-VMS.js} +1 -1
- package/web/dist/assets/pill-Dvvq0Otw.js +1 -0
- package/web/dist/assets/{project-router-a1gx3dfP.js → project-router-CvFAMDcP.js} +1 -1
- package/web/dist/assets/{prompt-templates-B4eJ8kQZ.js → prompt-templates-BGGpAIzb.js} +1 -1
- package/web/dist/assets/repo-git-C1Qv1JmM.js +1 -0
- package/web/dist/assets/{run-diff-CHDwMBEQ.js → run-diff-DrQsmf3-.js} +1 -1
- package/web/dist/assets/run-header-C9Aeh27u.js +1 -0
- package/web/dist/assets/skills-_ZVZxmKz.js +1 -0
- package/web/dist/assets/{tab-link-DRP4FV8D.js → tab-link-CkIV8ixq.js} +1 -1
- package/web/dist/assets/task-changes-BU9upwUw.js +1 -0
- package/web/dist/assets/{task-commits-DTdRtZur.js → task-commits-CbJutMBx.js} +1 -1
- package/web/dist/assets/{task-files-Cr2qKUk2.js → task-files-_hQyxAc7.js} +2 -2
- package/web/dist/assets/task-thread-Yo52ML6l.js +9 -0
- package/web/dist/assets/{textarea-DAHMUyAp.js → textarea-DfvlPIgO.js} +1 -1
- package/web/dist/assets/thread-loading-B9uTF0dX.js +1 -0
- package/web/dist/assets/{token-metrics-Q0paVq5n.js → token-metrics-BLzFUb8F.js} +1 -1
- package/web/dist/assets/{utils-CG8vWc5K.js → utils-GZNjgma4.js} +1 -1
- package/web/dist/assets/workflows-B6Er16t0.js +11 -0
- package/web/dist/assets/{zoomable-image-BXioMWqb.js → zoomable-image-COhBxkky.js} +1 -1
- package/web/dist/index.html +14 -14
- package/web/dist/assets/agent-accounts-BP0XBzQP.js +0 -1
- package/web/dist/assets/alert-dialog-Bv9zV9w1.js +0 -43
- package/web/dist/assets/dropdown-menu-DkzcT6aO.js +0 -1
- package/web/dist/assets/github-CBYawanT.js +0 -1
- package/web/dist/assets/index-BpI26cbM.js +0 -7
- package/web/dist/assets/index-CG0CPeOx.css +0 -1
- package/web/dist/assets/pill-C7gWe96Z.js +0 -1
- package/web/dist/assets/repo-git-D8GN9ork.js +0 -1
- package/web/dist/assets/run-header-BlqnTQeP.js +0 -1
- package/web/dist/assets/skills-CkWBfIfQ.js +0 -1
- package/web/dist/assets/task-changes-CEyHhiK1.js +0 -1
- package/web/dist/assets/task-thread-C8XeQXO4.js +0 -9
- package/web/dist/assets/thread-loading-OtvWGq9Y.js +0 -1
- package/web/dist/assets/workflows-uDL1z3Qp.js +0 -11
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{$ as i,A as a,C as o,D as s,E as c,I as l,J as u,M as d,N as f,O as p,P as m,S as h,T as g,b as _,j as v,k as y,w as b,x,z as S}from"./alert-dialog-Bv9zV9w1.js";import{t as C}from"./utils-CG8vWc5K.js";var w=e(t(),1),T=r();function E(e){let t=e+`CollectionProvider`,[n,r]=d(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=w.useRef(null),a=w.useRef(new Map).current;return(0,T.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=l(s),u=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=S(t,a(s,n).collectionRef);return(0,T.jsx)(c,{ref:i,children:r})});u.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=l(f),h=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=w.useRef(null),s=S(t,o),c=a(f,n);return w.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,T.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:u,ItemSlot:h},g,r]}var D=w.createContext(void 0);function O(e){let t=w.useContext(D);return e||t||`ltr`}var k=e(n(),1);function A(e){let[t,n]=w.useState(void 0);return a(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var j=[`top`,`right`,`bottom`,`left`],M=Math.min,N=Math.max,P=Math.round,F=Math.floor,I=e=>({x:e,y:e}),ee={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function te(e,t,n){return N(e,M(t,n))}function L(e,t){return typeof e==`function`?e(t):e}function R(e){return e.split(`-`)[0]}function z(e){return e.split(`-`)[1]}function B(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}function V(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function re(e){return B(V(e))}function ie(e,t,n){n===void 0&&(n=!1);let r=z(e),i=re(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pe(o)),[o,pe(o)]}function ae(e){let t=pe(e);return[oe(e),t,oe(t)]}function oe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var se=[`left`,`right`],ce=[`right`,`left`],le=[`top`,`bottom`],ue=[`bottom`,`top`];function de(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ce:se:t?se:ce;case`left`:case`right`:return t?le:ue;default:return[]}}function fe(e,t,n,r){let i=z(e),a=de(R(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oe)))),a}function pe(e){let t=R(e);return ee[t]+e.slice(t.length)}function me(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function he(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:me(e)}function ge(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _e(e,t,n){let{reference:r,floating:i}=e,a=V(t),o=re(t),s=ne(o),c=R(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=z(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ve(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=L(t,e),p=he(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ge(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ge(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ye=50,be=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_e(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ye&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_e(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=L(e,t)||{};if(l==null)return{};let d=he(u),f={x:n,y:r},p=re(i),m=ne(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=M(d[_],T),D=M(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=te(E,k,O),j=!c.arrow&&z(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,N=j?k<E?k-E:k-O:0;return{[p]:f[p]+N,data:{[p]:A,centerOffset:k-A-N,...j&&{alignmentOffset:N}},reset:j}}}),Se=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=L(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=R(r),_=V(o),v=R(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pe(o)]:ae(o)),x=p!==`none`;!d&&x&&b.push(...fe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ie(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==V(t))||T.every(e=>V(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=V(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function we(e){return j.some(t=>e[t]>=0)}var Te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=L(e,t);switch(i){case`referenceHidden`:{let e=Ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:we(e)}}}case`escaped`:{let e=Ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:we(e)}}}default:return{}}}}},Ee=new Set([`left`,`top`]);async function De(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=R(n),s=z(n),c=V(n)===`y`,l=Ee.has(o)?-1:1,u=a&&c?-1:1,d=L(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Oe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await De(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ke=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=L(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=V(i),p=B(f),m=u[p],h=u[f],g=(e,t)=>te(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ae=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=L(e,t),u={x:n,y:r},d=V(i),f=B(d),p=u[f],m=u[d],h=L(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ee.has(R(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},je=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=L(e,t),c=await i.detectOverflow(t,s),l=R(n),u=z(n),d=V(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=M(p-c[m],g),y=M(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*N(c.left,c.right):S=p-2*N(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Me(){return typeof window<`u`}function Ne(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Me()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return Me()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return Me()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Fe(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ne(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,Ve;function He(e){let t=W(e)?q(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!We()&&(K(t.backdropFilter)||K(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function Ue(e){let t=J(e);for(;G(t)&&!Ge(t);){if(He(t))return t;if(Re(t))return null;t=J(t)}return null}function We(){return Ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ve}function Ge(e){return/^(html|body|#document)$/.test(Ne(e))}function q(e){return H(e).getComputedStyle(e)}function Ke(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||U(e);return Fe(t)?t.host:t}function qe(e){let t=J(e);return Ge(t)?(e.ownerDocument||e).body:G(t)&&Ie(t)?t:qe(t)}function Je(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qe(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Ye(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Je(e):[])}else return t.concat(r,Je(r,[],n))}function Ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xe(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=P(n)!==a||P(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ze(e){return W(e)?e:e.contextElement}function Qe(e){let t=Ze(e);if(!G(t))return I(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xe(t),o=(a?P(n.width):n.width)/r,s=(a?P(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $e=I(0);function et(e){let t=H(e);return!We()||!t.visualViewport?$e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function Y(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ze(e),o=I(1);t&&(r?W(r)&&(o=Qe(r)):o=Qe(e));let s=tt(a,n,r)?et(a):I(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=H(a),t=W(r)?H(r):r,n=e,i=Ye(n);for(;i&&t!==n;){let e=Qe(i),t=i.getBoundingClientRect(),r=q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=H(i),i=Ye(n)}}return ge({width:u,height:d,x:c,y:l})}function nt(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:Y(U(e)).left+n}function rt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nt(e,n),y:n.top+t.scrollTop}}function it(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=I(1),u=I(0),d=G(r);if((d||!a)&&((Ne(r)!==`body`||Ie(o))&&(c=Ke(r)),d)){let e=Y(r);l=Qe(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rt(o,c):I(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function at(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ot(e){let t=Ke(e),n=e.ownerDocument.body,r=N(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=N(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+nt(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=N(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var st=25;function ct(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=U(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!We()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(nt(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=st&&(s-=o)}return{width:s,height:c,x:l,y:u}}function lt(e,t){let n=Y(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qe(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ut(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ct(e,n,t);else if(t===`document`)r=ot(U(e));else if(W(t))r=lt(t,n);else{let n=et(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ge(r)}function dt(e,t){let n=t.get(e);if(n)return n;let r=Je(e,[],!1).filter(e=>W(e)&&Ne(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;W(o)&&!Ge(o);){let e=q(o),t=He(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function ft(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:dt(t,this._c):[].concat(n),r],o=ut(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ut(t,a[e],i);s=N(n.top,s),c=M(n.right,c),l=M(n.bottom,l),u=N(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function pt(e){let{width:t,height:n}=Xe(e);return{width:t,height:n}}function mt(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Y(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=I(0);if((r||!a)&&((Ne(t)!==`body`||Ie(i))&&(s=Ke(t)),r)){let e=Y(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=nt(i));let l=i&&!r&&!a?rt(i,s):I(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function ht(e){return q(e).position===`static`}function gt(e,t){if(!G(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function _t(e,t){let n=H(e);if(Re(e))return n;if(!G(e)){let t=J(e);for(;t&&!Ge(t);){if(W(t)&&!ht(t))return t;t=J(t)}return n}let r=gt(e,t);for(;r&&Le(r)&&ht(r);)r=gt(r,t);return r&&Ge(r)&&ht(r)&&!He(r)?n:r||Ue(e)||n}var vt=async function(e){let t=this.getOffsetParent||_t,n=this.getDimensions,r=await n(e.floating);return{reference:mt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yt(e){return q(e).direction===`rtl`}var bt={convertOffsetParentRelativeRectToViewportRelativeRect:it,getDocumentElement:U,getClippingRect:ft,getOffsetParent:_t,getElementRects:vt,getClientRects:at,getDimensions:pt,getScale:Qe,isElement:W,isRTL:yt};function xt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function St(e,t,n){let r=null,i,a=U(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=F(d),h=F(a.clientWidth-(u+f)),g=F(a.clientHeight-(d+p)),_=F(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:N(0,M(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!xt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ct(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ze(e),u=i||a?[...l?Je(l):[],...t?Je(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?St(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Y(e):null;c&&g();function g(){let t=Y(e);h&&!xt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var wt=Oe,Tt=ke,Et=Se,Dt=je,Ot=Te,kt=xe,At=Ae,jt=(e,t,n)=>{let r=new Map,i=n??{},a={...bt,...i.platform,_c:r};return be(e,t,{...i,platform:a})},Mt=typeof document<`u`?w.useLayoutEffect:function(){};function Nt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Nt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Nt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Pt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ft(e,t){let n=Pt(e);return Math.round(t*n)/n}function It(e){let t=w.useRef(e);return Mt(()=>{t.current=e}),t}function Lt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(r);Nt(f,r)||p(r);let[m,h]=w.useState(null),[g,_]=w.useState(null),v=w.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=w.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=w.useRef(null),C=w.useRef(null),T=w.useRef(u),E=c!=null,D=It(c),O=It(i),A=It(l),j=w.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),jt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Nt(T.current,t)&&(T.current=t,k.flushSync(()=>{d(t)}))})},[f,t,n,O,A]);Mt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=w.useRef(!1);Mt(()=>(M.current=!0,()=>{M.current=!1}),[]),Mt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,j);j()}},[b,x,j,D,E]);let N=w.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=w.useMemo(()=>({reference:b,floating:x}),[b,x]),F=w.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ft(P.floating,u.x),r=Ft(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Pt(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Rt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:kt({element:r.current,padding:i}).fn(n):r?kt({element:r,padding:i}).fn(n):{}}}},zt=(e,t)=>{let n=wt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bt=(e,t)=>{let n=Tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vt=(e,t)=>({fn:At(e).fn,options:[e,t]}),Ht=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ut=(e,t)=>{let n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=Rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=`Arrow`,qt=w.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,T.jsx)(f.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,T.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});qt.displayName=Kt;var Jt=qt,Yt=`Popper`,[Xt,Zt]=d(Yt),[Qt,$t]=Xt(Yt),en=e=>{let{__scopePopper:t,children:n}=e,[r,i]=w.useState(null),[a,o]=w.useState(void 0);return(0,T.jsx)(Qt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};en.displayName=Yt;var tn=`PopperAnchor`,nn=w.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=$t(tn,n),o=w.useRef(null),s=a.onAnchorChange,c=S(t,w.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=w.useRef(null);w.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&pn(a.placementState),d=u?.[0],p=u?.[1];return r?null:(0,T.jsx)(f.div,{"data-radix-popper-side":d,"data-radix-popper-align":p,...i,ref:c})});nn.displayName=tn;var rn=`PopperContent`,[an,on]=Xt(rn),sn=w.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:o=`center`,alignOffset:s=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=$t(rn,n),[b,x]=w.useState(null),C=S(t,x),[E,D]=w.useState(null),O=A(E),k=O?.width??0,j=O?.height??0,M=r+(o===`center`?``:`-`+o),N=typeof p==`number`?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(d)?d:[d],F=P.length>0,I={padding:N,boundary:P.filter(dn),altBoundary:F},{refs:ee,floatingStyles:te,placement:L,isPositioned:R,middlewareData:z}=Lt({strategy:`fixed`,placement:M,whileElementsMounted:(...e)=>Ct(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[zt({mainAxis:i+j,alignmentAxis:s}),u&&Bt({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?Vt():void 0,...I}),u&&Ht({...I}),Ut({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),E&&Gt({element:E,padding:l}),fn({arrowWidth:k,arrowHeight:j}),h&&Wt({strategy:`referenceHidden`,...I,boundary:F?I.boundary:void 0})]}),B=y.setPlacementState;a(()=>(B(L),()=>{B(void 0)}),[L,B]);let[ne,V]=pn(L),re=c(_);a(()=>{R&&re?.()},[R,re]);let ie=z.arrow?.x,ae=z.arrow?.y,oe=z.arrow?.centerOffset!==0,[se,ce]=w.useState();return a(()=>{b&&ce(window.getComputedStyle(b).zIndex)},[b]),(0,T.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:R?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,T.jsx)(an,{scope:n,placedSide:ne,placedAlign:V,onArrowChange:D,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,T.jsx)(f.div,{"data-side":ne,"data-align":V,...v,ref:C,style:{...v.style,animation:R?void 0:`none`}})})})});sn.displayName=rn;var cn=`PopperArrow`,ln={top:`bottom`,right:`left`,bottom:`top`,left:`right`},un=w.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=on(cn,n),a=ln[i.placedSide];return(0,T.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,T.jsx)(Jt,{...r,ref:t,style:{...r.style,display:`block`}})})});un.displayName=cn;function dn(e){return e!==null}var fn=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=pn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function pn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var mn=en,hn=nn,gn=sn,_n=un,vn=!1;function yn(){let[e,t]=w.useState(vn);return w.useEffect(()=>{vn||(vn=!0,t(!0))},[]),e}var bn=w.useSyncExternalStore;function xn(){return()=>{}}function Sn(){return bn(xn,()=>!0,()=>!1)}var Cn=typeof bn==`function`?Sn:yn,wn=`rovingFocusGroup.onEntryFocus`,Tn={bubbles:!1,cancelable:!0},En=`RovingFocusGroup`,[Dn,On,kn]=E(En),[An,jn]=d(En,[kn]),[Mn,Nn]=An(En),Pn=w.forwardRef((e,t)=>(0,T.jsx)(Dn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Dn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Fn,{...e,ref:t})})}));Pn.displayName=En;var Fn=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...p}=e,m=w.useRef(null),h=S(t,m),g=O(a),[_,b]=y({prop:o,defaultProp:s??null,onChange:l,caller:En}),[x,C]=w.useState(!1),E=c(u),D=On(n),k=w.useRef(!1),[A,j]=w.useState(0);return w.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(wn,E),()=>e.removeEventListener(wn,E)},[E]),(0,T.jsx)(Mn,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:w.useCallback(e=>b(e),[b]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:w.useCallback(()=>j(e=>e-1),[]),children:(0,T.jsx)(f.div,{tabIndex:x||A===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:v(e.onMouseDown,()=>{k.current=!0}),onFocus:v(e.onFocus,e=>{let t=!k.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(wn,Tn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);Vn([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),d)}}k.current=!1}),onBlur:v(e.onBlur,()=>C(!1))})})}),In=`RovingFocusGroupItem`,Ln=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:c,...l}=e,u=s(),d=o||u,p=Nn(In,n),m=p.currentTabStopId===d,h=On(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:y}=p,b=Cn();return a(()=>{if(!(!b||!r))return g(),()=>_()},[b,r,g,_]),w.useEffect(()=>{if(!(b||!r))return g(),()=>_()},[b,r,g,_]),(0,T.jsx)(Dn.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:(0,T.jsx)(f.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:t,onMouseDown:v(e.onMouseDown,e=>{r?p.onItemFocus(d):e.preventDefault()}),onFocus:v(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:v(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Bn(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?Hn(n,r+1):n.slice(r+1)}setTimeout(()=>Vn(n))}}),children:typeof c==`function`?c({isCurrentTabStop:m,hasTabStop:y!=null}):c})})});Ln.displayName=In;var Rn={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function zn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Bn(e,t,n){let r=zn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Rn[r]}function Vn(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Hn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Un=Pn,Wn=Ln,Gn=[`Enter`,` `],Kn=[`ArrowDown`,`PageUp`,`Home`],qn=[`ArrowUp`,`PageDown`,`End`],Jn=[...Kn,...qn],Yn={ltr:[...Gn,`ArrowRight`],rtl:[...Gn,`ArrowLeft`]},Xn={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Zn=`Menu`,[Qn,$n,er]=E(Zn),[X,tr]=d(Zn,[er,Zt,jn]),nr=Zt(),rr=jn(),[ir,Z]=X(Zn),[ar,or]=X(Zn),sr=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=nr(t),[l,u]=w.useState(null),d=w.useRef(!1),f=c(a),p=O(i);return w.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),w.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,T.jsx)(mn,{...s,children:(0,T.jsx)(ir,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,T.jsx)(ar,{scope:t,onClose:w.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:o,children:r})})})};sr.displayName=Zn;var cr=`MenuAnchor`,lr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(hn,{...i,...r,ref:t})});lr.displayName=cr;var ur=`MenuPortal`,[dr,fr]=X(ur,{forceMount:void 0}),pr=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Z(ur,t);return(0,T.jsx)(dr,{scope:t,forceMount:n,children:(0,T.jsx)(p,{present:n||a.open,children:(0,T.jsx)(o,{asChild:!0,container:i,children:r})})})};pr.displayName=ur;var Q=`MenuContent`,[mr,hr]=X(Q),gr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeMenu),o=or(Q,e.__scopeMenu);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(p,{present:r||a.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:o.modal?(0,T.jsx)(_r,{...i,ref:t}):(0,T.jsx)(vr,{...i,ref:t})})})})}),_r=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu),r=w.useRef(null),i=S(t,r);return w.useEffect(()=>{let e=r.current;if(e)return _(e)},[]),(0,T.jsx)(br,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:v(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vr=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu);return(0,T.jsx)(br,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yr=l(`MenuContent.ScrollLock`),br=w.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,..._}=e,y=Z(Q,n),C=or(Q,n),E=nr(n),D=rr(n),O=$n(n),[k,A]=w.useState(null),j=w.useRef(null),M=S(t,j,y.onContentChange),N=w.useRef(0),P=w.useRef(``),F=w.useRef(0),I=w.useRef(null),ee=w.useRef(`right`),te=w.useRef(0),L=m?x:w.Fragment,R=m?{as:yr,allowPinchZoom:!0}:void 0,z=e=>{let t=P.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ii(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){P.current=t,window.clearTimeout(N.current),t!==``&&(N.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};w.useEffect(()=>()=>window.clearTimeout(N.current),[]),h();let B=w.useCallback(e=>ee.current===I.current?.side&&oi(e,I.current?.area),[]);return(0,T.jsx)(mr,{scope:n,searchRef:P,onItemEnter:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),onItemLeave:w.useCallback(e=>{B(e)||(j.current?.focus(),A(null))},[B]),onTriggerLeave:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),pointerGraceTimerRef:F,onPointerGraceIntentChange:w.useCallback(e=>{I.current=e},[]),children:(0,T.jsx)(L,{...R,children:(0,T.jsx)(b,{asChild:!0,trapped:i,onMountAutoFocus:v(a,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,T.jsx)(g,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,T.jsx)(Un,{asChild:!0,...D,dir:C.dir,orientation:`vertical`,loop:r,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:v(c,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,T.jsx)(gn,{role:`menu`,"aria-orientation":`vertical`,"data-state":$r(y.open),"data-radix-menu-content":``,dir:C.dir,...E,..._,ref:M,style:{outline:`none`,..._.style},onKeyDown:v(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&z(e.key));let i=j.current;if(e.target!==i||!Jn.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);qn.includes(e.key)&&a.reverse(),ni(a)}),onBlur:v(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),P.current=``)}),onPointerMove:v(e.onPointerMove,si(e=>{let t=e.target,n=te.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>te.current?`right`:`left`;ee.current=t,te.current=e.clientX}}))})})})})})})});gr.displayName=Q;var xr=`MenuGroup`,Sr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(f.div,{role:`group`,...r,ref:t})});Sr.displayName=xr;var Cr=`MenuLabel`,wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(f.div,{...r,ref:t})});wr.displayName=Cr;var Tr=`MenuItem`,Er=`menu.itemSelect`,Dr=w.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=w.useRef(null),o=or(Tr,e.__scopeMenu),s=hr(Tr,e.__scopeMenu),c=S(t,a),l=w.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Er,{bubbles:!0,cancelable:!0});e.addEventListener(Er,e=>r?.(e),{once:!0}),m(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,T.jsx)(Or,{...i,ref:c,disabled:n,onClick:v(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:v(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:v(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||Gn.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Dr.displayName=Tr;var Or=w.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=hr(Tr,n),s=rr(n),c=w.useRef(null),l=S(t,c),[u,d]=w.useState(!1),[p,m]=w.useState(``);return w.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,T.jsx)(Qn.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,T.jsx)(Wn,{asChild:!0,...s,focusable:!r,children:(0,T.jsx)(f.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:v(e.onPointerMove,si(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:v(e.onPointerLeave,si(e=>o.onItemLeave(e))),onFocus:v(e.onFocus,()=>d(!0)),onBlur:v(e.onBlur,()=>d(!1))})})})}),kr=`MenuCheckboxItem`,Ar=w.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:n,children:(0,T.jsx)(Dr,{role:`menuitemcheckbox`,"aria-checked":ei(n)?`mixed`:n,...i,ref:t,"data-state":ti(n),onSelect:v(i.onSelect,()=>r?.(ei(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ar.displayName=kr;var jr=`MenuRadioGroup`,[Mr,Nr]=X(jr,{value:void 0,onValueChange:()=>{}}),Pr=w.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=c(r);return(0,T.jsx)(Mr,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,T.jsx)(Sr,{...i,ref:t})})});Pr.displayName=jr;var Fr=`MenuRadioItem`,Ir=w.forwardRef((e,t)=>{let{value:n,...r}=e,i=Nr(Fr,e.__scopeMenu),a=n===i.value;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:a,children:(0,T.jsx)(Dr,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ti(a),onSelect:v(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ir.displayName=Fr;var Lr=`MenuItemIndicator`,[Rr,zr]=X(Lr,{checked:!1}),Br=w.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=zr(Lr,n);return(0,T.jsx)(p,{present:r||ei(a.checked)||a.checked===!0,children:(0,T.jsx)(f.span,{...i,ref:t,"data-state":ti(a.checked)})})});Br.displayName=Lr;var Vr=`MenuSeparator`,Hr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(f.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Hr.displayName=Vr;var Ur=`MenuArrow`,Wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(_n,{...i,...r,ref:t})});Wr.displayName=Ur;var Gr=`MenuSub`,[Kr,qr]=X(Gr),Jr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Z(Gr,t),o=nr(t),[l,u]=w.useState(null),[d,f]=w.useState(null),p=c(i);return w.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),(0,T.jsx)(mn,{...o,children:(0,T.jsx)(ir,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:f,children:(0,T.jsx)(Kr,{scope:t,contentId:s(),triggerId:s(),trigger:l,onTriggerChange:u,children:n})})})};Jr.displayName=Gr;var Yr=`MenuSubTrigger`,Xr=w.forwardRef((e,t)=>{let n=Z(Yr,e.__scopeMenu),r=or(Yr,e.__scopeMenu),i=qr(Yr,e.__scopeMenu),a=hr(Yr,e.__scopeMenu),o=w.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=w.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);w.useEffect(()=>u,[u]),w.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=S(t,i.onTriggerChange);return(0,T.jsx)(lr,{asChild:!0,...l,children:(0,T.jsx)(Or,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":$r(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:v(e.onPointerMove,si(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:v(e.onPointerLeave,si(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:v(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||Yn[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Xr.displayName=Yr;var Zr=`MenuSubContent`,Qr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Z(Q,e.__scopeMenu),s=or(Q,e.__scopeMenu),c=qr(Zr,e.__scopeMenu),l=w.useRef(null),u=S(t,l);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(p,{present:r||o.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:(0,T.jsx)(br,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:v(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:v(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:v(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Xn[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});Qr.displayName=Zr;function $r(e){return e?`open`:`closed`}function ei(e){return e===`indeterminate`}function ti(e){return ei(e)?`indeterminate`:e?`checked`:`unchecked`}function ni(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ri(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ii(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ri(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function ai(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function oi(e,t){return t?ai({x:e.clientX,y:e.clientY},t):!1}function si(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ci=sr,li=lr,ui=pr,di=gr,fi=Sr,pi=wr,mi=Dr,hi=Ar,gi=Pr,_i=Ir,vi=Br,yi=Hr,bi=Wr,xi=Xr,Si=Qr,Ci=`DropdownMenu`,[wi,Ti]=d(Ci,[tr]),$=tr(),[Ei,Di]=wi(Ci),Oi=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:c=!0}=e,l=$(t),u=w.useRef(null),[d,f]=y({prop:i,defaultProp:a??!1,onChange:o,caller:Ci});return(0,T.jsx)(Ei,{scope:t,triggerId:s(),triggerRef:u,contentId:s(),open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(e=>!e),[f]),modal:c,children:(0,T.jsx)(ci,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})};Oi.displayName=Ci;var ki=`DropdownMenuTrigger`,Ai=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Di(ki,n),o=$(n),s=S(t,a.triggerRef);return(0,T.jsx)(li,{asChild:!0,...o,children:(0,T.jsx)(f.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:v(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:v(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Ai.displayName=ki;var ji=`DropdownMenuPortal`,Mi=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,T.jsx)(ui,{...r,...n})};Mi.displayName=ji;var Ni=`DropdownMenuContent`,Pi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Di(Ni,n),a=$(n),o=w.useRef(!1);return(0,T.jsx)(di,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:v(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:v(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Pi.displayName=Ni;var Fi=`DropdownMenuGroup`,Ii=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(fi,{...i,...r,ref:t})});Ii.displayName=Fi;var Li=`DropdownMenuLabel`,Ri=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(pi,{...i,...r,ref:t})});Ri.displayName=Li;var zi=`DropdownMenuItem`,Bi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(mi,{...i,...r,ref:t})});Bi.displayName=zi;var Vi=`DropdownMenuCheckboxItem`,Hi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(hi,{...i,...r,ref:t})});Hi.displayName=Vi;var Ui=`DropdownMenuRadioGroup`,Wi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(gi,{...i,...r,ref:t})});Wi.displayName=Ui;var Gi=`DropdownMenuRadioItem`,Ki=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(_i,{...i,...r,ref:t})});Ki.displayName=Gi;var qi=`DropdownMenuItemIndicator`,Ji=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(vi,{...i,...r,ref:t})});Ji.displayName=qi;var Yi=`DropdownMenuSeparator`,Xi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(yi,{...i,...r,ref:t})});Xi.displayName=Yi;var Zi=`DropdownMenuArrow`,Qi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(bi,{...i,...r,ref:t})});Qi.displayName=Zi;var $i=`DropdownMenuSubTrigger`,ea=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(xi,{...i,...r,ref:t})});ea.displayName=$i;var ta=`DropdownMenuSubContent`,na=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(Si,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});na.displayName=ta;var ra=Oi,ia=Ai,aa=Mi,oa=Pi,sa=Ri,ca=Bi,la=Hi,ua=Wi,da=Ki,fa=Ji,pa=Xi;function ma({...e}){return(0,T.jsx)(ra,{"data-slot":`dropdown-menu`,...e})}function ha({...e}){return(0,T.jsx)(ia,{"data-slot":`dropdown-menu-trigger`,...e})}function ga({className:e,sideOffset:t=4,...n}){return(0,T.jsx)(aa,{children:(0,T.jsx)(oa,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:C(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function _a({className:e,inset:t,variant:n=`default`,...r}){return(0,T.jsx)(ca,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:C(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function va({className:e,children:t,checked:n,...r}){return(0,T.jsxs)(la,{"data-slot":`dropdown-menu-checkbox-item`,className:C(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...r,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(fa,{children:(0,T.jsx)(u,{className:`size-4`})})}),t]})}function ya({...e}){return(0,T.jsx)(ua,{"data-slot":`dropdown-menu-radio-group`,...e})}function ba({className:e,children:t,...n}){return(0,T.jsxs)(da,{"data-slot":`dropdown-menu-radio-item`,className:C(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(fa,{children:(0,T.jsx)(i,{className:`size-2 fill-current`})})}),t]})}function xa({className:e,inset:t,...n}){return(0,T.jsx)(sa,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:C(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function Sa({className:e,...t}){return(0,T.jsx)(pa,{"data-slot":`dropdown-menu-separator`,className:C(`-mx-1 my-1 h-px bg-border`,e),...t})}export{Zt as _,xa as a,Sa as c,Un as d,jn as f,mn as g,gn as h,_a as i,ha as l,_n as m,va as n,ya as o,hn as p,ga as r,ba as s,ma as t,Wn as u,A as v,O as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{$ as r,Ca as i,Ci as a,Cn as o,Ei as s,Gi as c,Ht as l,It as u,J as d,Jt as f,La as p,Lt as m,Ni as h,Oa as g,Q as _,Qt as v,Ti as y,U as b,X as x,Xt as S,Y as C,_n as ee,_r as te,aa as w,bn as T,bt as ne,d as E,dr as re,en as ie,l as D,mi as ae,mr as oe,rn as O,tt as k,vn as se,wa as ce,wi as le,xa as ue,xn as de,xt as fe,yn as pe}from"./alert-dialog-Bv9zV9w1.js";import{d as me,n as he,t as A}from"./utils-CG8vWc5K.js";import{a as j,o as ge,r as _e}from"./agent-accounts-BP0XBzQP.js";import{a as ve,i as ye,n as be,o as xe,r as Se,s as Ce,t as M}from"./textarea-DAHMUyAp.js";import{t as we}from"./createLucideIcon-BHp8sXmF.js";import{t as N}from"./external-link-BE6y205O.js";import{A as P,E as F,F as Te,I,M as L,O as R,a as Ee,c as z,d as B,j as De,k as V,n as H,o as U,r as Oe,s as W}from"./prompt-templates-B4eJ8kQZ.js";import{r as ke,t as Ae,u as je}from"./project-router-a1gx3dfP.js";import{t as Me}from"./message-square-B-MD-8rD.js";import{r as G,t as Ne}from"./markdown-BssEOroY.js";import{d as K,f as Pe,i as Fe,s as Ie,t as q,u as Le}from"./skills-DFBiAuJG.js";import{n as J,t as Re}from"./use-submit-shortcut-KWJsC906.js";import{d as Y,f as ze,l as Be,p as Ve,s as He,u as Ue}from"./index-BpI26cbM.js";import{t as We}from"./diff-C4aSZfrQ2.js";import{t as Ge}from"./tab-link-DRP4FV8D.js";var Ke=we(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),qe=we(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),X=e(t(),1),Z=n();function Je({className:e,...t}){return(0,Z.jsx)(`div`,{"data-slot":`skeleton`,className:A(`animate-pulse rounded-md bg-accent`,e),...t})}var Q=`cez-github-list-width`;function Ye(e){if(e==null||e===``||typeof e==`string`&&e.trim()===``)return 360;let t=typeof e==`number`?e:Number(e);return Number.isFinite(t)?Math.min(520,Math.max(280,Math.round(t))):360}function Xe(){try{let e=localStorage.getItem(Q);return e===null?360:Ye(e)}catch{return 360}}function Ze(e){try{localStorage.setItem(Q,String(Ye(e)))}catch{}}function $(e){return`${e.kind===`pr`?`Address GitHub pull request`:`Fix GitHub issue`} #${e.number}: ${e.title}\n\n${e.url}`}function Qe(e,t=[]){let n=$(e);return e.body?.trim()&&(n+=`\n\n---\n\n${e.body.trim()}`),t.length&&(n+=$e(t)),n}function $e(e){return`\n\nUse these skills where relevant: ${e.join(`, `)}.`}function et(e,t){return e.replace(/\{\{\s*number\s*\}\}/gi,()=>`#${t.number}`).replace(/\{\{\s*title\s*\}\}/gi,()=>t.title).replace(/\{\{\s*url\s*\}\}/gi,()=>t.url)}function tt(e,t){if(e.includes(t.url))return!0;let n=t.kind===`pr`?String.raw`(?:pull\s+request|pr)`:String.raw`issue`;return new RegExp(String.raw`\b${n}\s*#?\s*${t.number}\b`,`i`).test(e)}function nt(e,t,n){let r=(n??``).trim();if(!r)return Qe(e,t);let i=$(e),a=r.startsWith(i)?i+et(r.slice(i.length),e):et(r,e),o=tt(a,e)?a:`${i}\n\n${a}`;return t.length?o+$e(t):o}function rt(e){let t=[];for(let n of e.slice(0,8)){let e=new Set(t.map(e=>e.id)),r=n;for(let t=2;e.has(r);t++)r=`${n}-${t}`;t.push({id:r,name:n,skill:n,prompt:`{{task}}`})}return t}function it(e,t,n,r,i={}){return t?{...i,workflow:t,task:nt(e,n,r)}:n.length?{...i,steps:rt(n),task:nt(e,[],r)}:{...i,workflow:`quick-task`,task:nt(e,[],r)}}var at=`min-h-11 min-w-11 rounded-md border border-input bg-card px-3 text-sm text-foreground focus-visible:outline-ring disabled:opacity-50`;function ot({data:e,assignees:t,projectId:n,onAssigneesChange:r,onProjectChange:i}){let a=new Map;for(let t of e.issues)for(let e of t.assignees??[])a.set(e.toLowerCase(),e);for(let e of t)a.set(e.toLowerCase(),e);let o=[...a.values()].sort((e,t)=>e.localeCompare(t)),s=!!e.viewerLogin&&t.length===1&&t[0]?.toLowerCase()===e.viewerLogin.toLowerCase();return(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,"data-slot":`gh-issue-filters`,children:[(0,Z.jsxs)(_e,{children:[(0,Z.jsx)(ge,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:at,disabled:o.length===0,children:[`Assignees`,t.length?` · ${t.length}`:``]})}),(0,Z.jsx)(j,{align:`start`,className:`w-64 max-w-[calc(100vw-2rem)] p-2`,children:(0,Z.jsxs)(`fieldset`,{className:`max-h-[min(16rem,var(--radix-popover-content-available-height))] overflow-y-auto`,children:[(0,Z.jsx)(`legend`,{className:`px-2 text-xs text-muted-foreground`,children:`Match any selected assignee`}),o.map(e=>{let n=t.some(t=>t.toLowerCase()===e.toLowerCase());return(0,Z.jsxs)(`label`,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded px-2 hover:bg-muted`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:n,onChange:()=>r(n?t.filter(t=>t.toLowerCase()!==e.toLowerCase()):[...t,e])}),(0,Z.jsx)(`span`,{className:`break-all text-sm`,children:e})]},e.toLowerCase())})]})})]}),(0,Z.jsx)(`button`,{type:`button`,className:`${at} aria-pressed:border-foreground aria-pressed:bg-foreground aria-pressed:text-background`,disabled:!e.viewerLogin,"aria-pressed":s,onClick:()=>r(s?[]:[e.viewerLogin]),children:`Assigned to me`}),e.viewerLogin?null:(0,Z.jsx)(`p`,{className:`w-full text-xs text-muted-foreground`,children:`GitHub login unavailable.`}),e.projects?.length?(0,Z.jsxs)(`select`,{"aria-label":`Project board`,className:at,value:n,onChange:e=>i(e.target.value),children:[(0,Z.jsx)(`option`,{value:``,children:`All boards`}),e.projects.map(e=>(0,Z.jsx)(`option`,{value:e.id,children:e.title},e.id))]}):e.projects?(0,Z.jsx)(`select`,{"aria-label":`Project board`,className:at,disabled:!0,value:``,children:(0,Z.jsx)(`option`,{value:``,children:`No boards`})}):(0,Z.jsx)(`p`,{className:`w-full text-xs text-muted-foreground`,children:e.projectsReason??`Project boards unavailable.`})]})}function st(e){let t=new Set;for(let n of e)for(let e of n.labels)t.add(e);return[...t].sort((e,t)=>e.toLowerCase().localeCompare(t.toLowerCase()))}function ct(e,t={}){let n=(t.query??``).trim().toLowerCase(),r=t.labels??[],i=n.replace(/^#/,``),a=i!==``&&/^\d+$/.test(i);return e.filter(e=>r.length>0&&!r.every(t=>e.labels.includes(t))||t.assignees?.length&&!e.assignees?.some(e=>t.assignees.some(t=>t.toLowerCase()===e.toLowerCase()))||t.projectId&&!e.projectIds?.includes(t.projectId)?!1:n===``?!0:a?String(e.number).includes(i):`#${e.number} ${e.title} ${e.author} ${e.body}`.toLowerCase().includes(n))}function lt(e,t){let n=e.trim();if(n===``)return!1;let r=n.replace(/^#/,``);return/^\d+$/.test(r)?!t.some(e=>e.number===Number(r)):t.length===0}function ut(e){if(!e||!/^[0-9a-fA-F]{6}$/.test(e))return{borderColor:`var(--border)`,color:`var(--muted-foreground)`};let t=`#${e}`;return{backgroundColor:`${t}22`,borderColor:`${t}66`,color:`color-mix(in srgb, ${t} 50%, var(--foreground))`}}var dt={workflow:null,skills:[]},ft=`cez-followup-selection`;function pt(e){let t=e&&typeof e==`object`?e:{};return{workflow:typeof t.workflow==`string`?t.workflow:null,skills:Array.isArray(t.skills)?t.skills.filter(e=>typeof e==`string`):[]}}function mt(){try{let e=localStorage.getItem(ft);return e?pt(JSON.parse(e)):{...dt}}catch{return{...dt}}}function ht(e){try{localStorage.setItem(ft,JSON.stringify(e))}catch{}}var gt=`cez-followup-prompt:`;function _t(e){try{return localStorage.getItem(gt+e)??``}catch{return``}}function vt(e,t){try{t===``?localStorage.removeItem(gt+e):localStorage.setItem(gt+e,t)}catch{}}function yt({item:e,workflows:t,skills:n,workflow:r,onWorkflowChange:a,selectedSkills:o,onSkillsChange:s,engine:l,onEngineChange:u,queuedRunId:f,onQueued:p}){let m=g(),h=oe(),_=e.kind===`pr`?`PR`:`issue`,v=o.filter(e=>n.some(t=>t.name===e)),[y]=(0,X.useState)(()=>$(e)),[b,x]=(0,X.useState)(()=>_t(e.url)||y),S=ze(l),C=(0,X.useRef)(null),ee=(0,X.useRef)(null);(0,X.useEffect)(()=>{vt(e.url,b===y?``:b)},[e.url,b,y]);let te=(0,X.useMemo)(()=>Ee(h.data?.promptTemplates),[h.data?.promptTemplates]),T=e=>{let t=C.current,n=W({prompt:b,base:y,selectionStart:t?.selectionStart??null,focused:document.activeElement===t,remembered:ee.current}),r=Oe(b,n,e);x(r.text),ee.current=r.caret,requestAnimationFrame(()=>{C.current?.focus(),C.current?.setSelectionRange(r.caret,r.caret)})},ne=H(te,v),re=(0,X.useRef)(b);re.current=b;let D=(0,X.useRef)(``);(0,X.useEffect)(()=>{let e=U(re.current,D.current,ne,y);D.current=e.applied,e.text!==re.current&&x(e.text)},[ne,y]);let k=i({mutationFn:async()=>S.canRun?ae(it(e,r,v,b,Y(S))):null,onSuccess:t=>{if(t===null)return;let n=`runs`in t?t.runs[0]:t;n&&p(e.url,n.id),w(`Added to the queue — ${_} #${e.number}`),v.length>0&&h.data!==void 0&&c({skillUsage:v.reduce((e,t)=>q(e,t),h.data.skillUsage)}).then(()=>m.invalidateQueries({queryKey:O.uiState})).catch(()=>{}),vt(e.url,``),x(y),D.current=``,m.invalidateQueries({queryKey:O.runs.all})},onError:e=>w(e.message,{tone:`danger`})}),se=e=>{Re({key:e.key,shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,repeat:e.repeat,isComposing:e.nativeEvent.isComposing})&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),!k.isPending&&S.canRun&&k.mutate())},ce=e=>s(o.includes(e)?o.filter(t=>t!==e):[...o,e]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`section`,{"data-slot":`gh-hand`,className:`mt-7 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsx)(`h3`,{className:`text-xl font-normal text-foreground`,children:`Hand this to the agent`}),(0,Z.jsxs)(`label`,{className:`gh-field gh-prompt-field`,children:[(0,Z.jsx)(`span`,{children:`Instructions for the agent`}),(0,Z.jsx)(M,{ref:C,"data-slot":`gh-custom-prompt`,"aria-label":`Custom prompt`,"aria-keyshortcuts":`Control+Enter Meta+Enter`,value:b,onChange:e=>x(e.target.value),onSelect:e=>{ee.current=e.currentTarget.selectionStart},onKeyDown:se,placeholder:`Instructions for the agent… (#${e.number} and its link are always sent)`,className:`mt-3 min-h-20 text-[13px]`})]}),(0,Z.jsx)(Be,{templates:te,onInsert:T}),(0,Z.jsxs)(`div`,{className:`gh-handoff-settings`,children:[(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Workflow`}),(0,Z.jsx)(bt,{workflows:t,value:r,onChange:a})]}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Skills · select one or more`}),(0,Z.jsx)(St,{skills:n,skillUsage:h.data?.skillUsage,selected:v,onToggle:ce})]}),v.length>0?(0,Z.jsx)(`div`,{"data-slot":`gh-skill-chips`,className:`mt-2.5 flex flex-wrap gap-1.5`,children:v.map(e=>(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skill-chip`,"data-skill":e,onClick:()=>ce(e),title:`Remove this skill`,className:`inline-flex min-h-11 items-center gap-2 rounded-lg border border-border bg-card px-3 text-xs font-medium text-foreground transition-colors hover:bg-danger/10 hover:text-danger`,children:[e,(0,Z.jsx)(ie,{size:16,"aria-hidden":`true`,className:`size-3`})]},e))}):null,(0,Z.jsxs)(`div`,{className:`gh-engine-fields`,children:[(0,Z.jsx)(Ue,{pick:l,onChange:u,disabled:k.isPending||!S.canRun,accounts:!0}),S.runners.length<=1&&!S.accounts.some(e=>e.provider===S.runner&&e.id!=="default")?(0,Z.jsxs)(`div`,{className:`gh-fixed-runner`,children:[(0,Z.jsx)(`span`,{children:`Runner`}),S.runner]}):null]}),(0,Z.jsxs)(`div`,{className:`gh-field`,children:[(0,Z.jsx)(`span`,{children:`Account`}),(0,Z.jsx)(xt,{resolved:S,disabled:k.isPending||!S.canRun,onPick:e=>u({...l,account:e})})]}),!S.providerPending&&!S.canRun?(0,Z.jsxs)(`span`,{"data-slot":`gh-provider-gate`,className:`inline-flex flex-wrap items-center gap-1 text-xs text-muted-foreground`,children:[S.providerError?`Provider authentication could not be verified.`:`Connect an agent provider to run this item.`,(0,Z.jsx)(Ae,{to:`/settings/agents#providers`,className:`font-medium text-foreground underline underline-offset-4`,children:`Configure providers`})]}):null]}),(0,Z.jsxs)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:[e.kind===`pr`?`PR`:`Issue`,` number and link remain attached to the task. Edit the prompt before starting. Cmd/Ctrl+Enter submits; Enter adds a new line.`]})]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-handoff-actions`,className:`mt-[22px] flex flex-wrap items-center gap-2.5`,children:[he(e.url)?(0,Z.jsx)(E,{asChild:!0,variant:`outline`,children:(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open in GitHub`})}):null,(0,Z.jsxs)(E,{variant:`primary`,"data-action":`gh-run`,disabled:k.isPending||!S.canRun,onClick:()=>k.mutate(),children:[(0,Z.jsx)(Te,{"aria-hidden":`true`,className:`size-3.5`}),`Run agent on this `,_]}),(0,Z.jsx)(`kbd`,{"aria-hidden":`true`,className:`rounded-[5px] border border-b-2 border-border bg-card px-[5px] py-px font-mono text-[10.5px] font-medium text-muted-foreground`,children:J()}),f?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-slot":`gh-queued`,className:`flex items-center gap-1 text-xs font-medium text-success`,children:[(0,Z.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`queued`]}),(0,Z.jsx)(Ae,{to:`/tasks/${f}`,"data-slot":`gh-view-run`,className:`text-xs font-semibold text-accent-text hover:underline`,children:`View task →`})]}):null]})]})}function bt({workflows:e,value:t,onChange:n}){let[r,i]=(0,X.useState)(!1),[a,o]=(0,X.useState)(``),s=(0,X.useRef)(null),c=K(e,a);return(0,Z.jsxs)(_e,{open:r,onOpenChange:e=>{i(e),e||o(``)},children:[(0,Z.jsx)(ge,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-workflow-trigger`,"aria-label":`Choose a workflow`,className:A(B,t&&`border-foreground/60 font-mono text-[11.5px] font-semibold text-foreground`),children:[(0,Z.jsx)(v,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),(0,Z.jsx)(`span`,{className:`min-w-0 max-w-44 truncate`,children:t??`workflow`}),(0,Z.jsx)(C,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(j,{align:`start`,sideOffset:8,className:`w-[320px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(F,{shouldFilter:!1,children:[(0,Z.jsx)(P,{placeholder:`search workflows…`,value:a,onValueChange:o,onInput:()=>s.current?.scrollTo(0,0)}),(0,Z.jsxs)(L,{ref:s,"data-slot":`gh-workflow-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[c.length===0?(0,Z.jsx)(R,{children:`Nothing matches.`}):null,(0,Z.jsx)(V,{children:c.map(e=>{let r=t===e.name;return(0,Z.jsxs)(De,{value:`workflow ${e.name}`,keywords:Pe(e.name,e.description),"data-slot":`gh-workflow-option`,"data-workflow":e.name,onSelect:()=>{n(r?null:e.name),i(!1)},children:[(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-xs`,children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,r?(0,Z.jsx)(d,{size:16,"aria-hidden":`true`,className:`ml-auto size-3.5 shrink-0 text-link-foreground`}):null]},e.name)})})]})]})})]})}function xt({resolved:e,disabled:t,onPick:n}){let r=e.accounts.filter(t=>t.provider===e.runner),i=[...r.some(e=>e.id==="default")?[]:[{value:me,label:`Default`}],...r.map(e=>({value:e.id,label:e.label,desc:e.configDir}))],a=e.account??e.repoAccount?.[e.runner]??`default`;return(0,Z.jsx)(z,{icon:(0,Z.jsx)(S,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-accent-text`}),slot:`account-pill`,ariaLabel:`Account`,label:i.find(e=>e.value===a)?.label??`Default`,value:a,options:i,disabled:t,onPick:n})}function St({skills:e,skillUsage:t,selected:n,onToggle:r}){let[i,a]=(0,X.useState)(!1),[o,s]=(0,X.useState)(``),[c,u]=(0,X.useState)(null),f=(0,X.useRef)(null),{mostUsed:p,project:m,global:h,ranked:g}=Le(e,o,t),_=(e,t)=>{let i=n.includes(e.name);return(0,Z.jsxs)(De,{value:`skill ${e.name} ${e.path}`,keywords:Pe(e.name,e.description),"data-slot":`gh-skill-option`,"data-skill":e.name,"data-selected":i?`true`:void 0,onSelect:()=>r(e.name),children:[(0,Z.jsx)(`span`,{className:A(`shrink-0 font-mono text-xs`,t&&`font-semibold`),children:e.name}),e.description?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-soft-foreground`,children:e.description}):null,(0,Z.jsx)(`button`,{type:`button`,"data-slot":`gh-skill-view`,"aria-label":`View skill ${e.name}`,title:`View skill`,onClick:t=>{t.preventDefault(),t.stopPropagation(),u(e)},className:`ml-auto shrink-0 rounded-sm p-0.5 text-soft-foreground transition-colors hover:text-foreground`,children:(0,Z.jsx)(I,{"aria-hidden":`true`,className:`size-3.5`})}),i?(0,Z.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e.path)};return e.length===0?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(He,{skill:c,onClose:()=>u(null)}),(0,Z.jsxs)(_e,{open:i,onOpenChange:e=>{a(e),e||s(``)},children:[(0,Z.jsx)(ge,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-skills-trigger`,"aria-label":`Choose skills`,className:A(B,n.length>0&&`border-foreground/60 font-semibold text-foreground`),children:[(0,Z.jsx)(l,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0 text-accent-icon`}),`skills`,n.length>0?` · ${n.length}`:``,(0,Z.jsx)(C,{size:16,"aria-hidden":`true`,className:`size-2.5 shrink-0 text-soft-foreground`})]})}),(0,Z.jsx)(j,{align:`start`,sideOffset:8,className:`w-[336px] max-w-[calc(100vw-2rem)] p-0`,children:(0,Z.jsxs)(F,{shouldFilter:!1,children:[(0,Z.jsx)(P,{placeholder:`search skills…`,value:o,onValueChange:s,onInput:()=>f.current?.scrollTo(0,0)}),(0,Z.jsxs)(L,{ref:f,"data-slot":`gh-skill-menu`,className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(g?g.length===0:p.length===0&&m.length===0&&h.length===0)?(0,Z.jsx)(R,{children:`Nothing matches.`}):null,g?g.length>0?(0,Z.jsx)(V,{children:g.map(e=>_(e,Fe(e)))}):null:(0,Z.jsxs)(Z.Fragment,{children:[p.length>0?(0,Z.jsx)(V,{heading:`Most used`,children:p.map(e=>_(e,Fe(e)))}):null,m.length>0?(0,Z.jsx)(V,{heading:`Project skills`,children:m.map(e=>_(e,!0))}):null,h.length>0?(0,Z.jsx)(V,{heading:`Global`,children:h.map(e=>_(e,!1))}):null]})]})]})})]})]})}var Ct=1e3,wt=100,Tt=350;function Et({width:e,onWidthChange:t}){let n=(0,X.useRef)(null),r=t=>{t.button===0&&(n.current={x:t.clientX,width:e},t.currentTarget.setPointerCapture(t.pointerId),t.preventDefault(),t.currentTarget.focus())},i=e=>{let r=n.current;r&&t(Ye(r.width+(e.clientX-r.x)))},a=e=>{n.current&&(n.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return(0,Z.jsx)(`div`,{"data-slot":`gh-list-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the GitHub list`,"aria-valuenow":e,"aria-valuemin":280,"aria-valuemax":520,tabIndex:0,onPointerDown:r,onPointerMove:i,onPointerUp:a,onPointerCancel:a,onKeyDown:n=>{let r=n.key===`ArrowLeft`?e-16:n.key===`ArrowRight`?e+16:n.key===`Home`?280:n.key===`End`?520:null;r!==null&&(n.preventDefault(),t(Ye(r)))},onDoubleClick:()=>t(360),title:`Drag to resize the GitHub list — double-click to reset`,className:`absolute inset-y-0 -right-[2px] z-20 hidden w-[5px] cursor-col-resize touch-none bg-transparent transition-colors hover:bg-accent-strong/40 focus-visible:bg-accent-strong/60 focus-visible:outline-none md:block`})}function Dt(e,t){let[n,r]=(0,X.useState)(e);return(0,X.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function Ot({view:e,changes:t=!1,index:n=!1}){let{n:r}=ue(),s=ee({limit:Ct}),l=o().data?.capabilities?.automations===!0,d=s.data,h=g(),v=e=>{h.setQueryData(O.uiState,t=>({...t,githubView:e})),c({githubView:e}).then(e=>h.setQueryData(O.uiState,e)).catch(e=>{w(e instanceof Error?e.message:String(e),{tone:`danger`}),h.invalidateQueries({queryKey:O.uiState})})},y=(0,X.useRef)(null),b=i({mutationFn:()=>a({refresh:!0,limit:Ct}),onSuccess:t=>{h.setQueryData(O.github({limit:Ct}),t),h.invalidateQueries({queryKey:O.githubChecks(He)}),h.invalidateQueries({queryKey:O.githubSearch(e===`issues`?`issue`:`pr`,z)});let n=y.current;if(!n){h.removeQueries({queryKey:[`github`,`comments`]});return}let r=O.githubComments(n.kind,n.number);le(n.kind,n.number,{refresh:!0}).then(e=>h.setQueryData(r,e)).catch(()=>{}),h.removeQueries({queryKey:[`github`,`comments`],predicate:e=>e.queryHash!==p(r)})},onError:e=>w(e.message,{tone:`danger`})}),x=te(),S=re(),C=oe(),[T,ie]=(0,X.useState)(()=>mt().workflow),[ae,k]=(0,X.useState)(()=>mt().skills),[ce,pe]=(0,X.useState)({runner:null,model:null,effort:null,account:null}),[me,he]=(0,X.useState)(Xe),[j,ge]=(0,X.useState)(!1),_e=e=>{let t=Ye(e);he(t),Ze(t)};(0,X.useEffect)(()=>{ht({workflow:T,skills:[...ae]})},[T,ae]);let ve=x.data?.workflows;(0,X.useEffect)(()=>{ve&&T!==null&&!ve.some(e=>e.name===T)&&ie(null)},[ve,T]);let ye=S.data,be=C.data?.skillUsage,xe=(0,X.useMemo)(()=>Ie(ye??[],be),[ye,be]),[Se,Ce]=(0,X.useState)(new Map),[M,we]=(0,X.useState)(``),[N,P]=(0,X.useState)([]),[F,Te]=(0,X.useState)([]),[I,L]=(0,X.useState)(``),R=d?.projects?.some(e=>e.id===I)?I:``;(0,X.useEffect)(()=>{d&&I&&!R&&L(``)},[d,I,R]);let Ee=()=>{we(``),P([]),Te([]),L(``)},z=Dt(M,Tt),B=(0,X.useMemo)(()=>d?.available?e===`issues`?d.issues:d.prs:[],[d,e]),De=(0,X.useMemo)(()=>ct(B,{query:z,labels:N,...e===`issues`?{assignees:F,projectId:R}:{}}),[B,z,N,e,F,R]),V=M.trim()===z.trim(),H=d?.available===!0&&V&<(z,De),U=de(e===`issues`?`issue`:`pr`,z,H),Oe=B,W=ct(Oe,{query:M,labels:N,...e===`issues`?{assignees:F,projectId:R}:{}}),Me=e===`issues`&&r!==void 0&&!j,Ne=M.trim()!==``||N.length>0||e===`issues`&&(F.length>0||R!==``),K=H&&U.data?.available?U.data:null,Pe=new Set(W.map(e=>e.number)),Fe=e===`issues`&&K?R&&K.items.some(e=>e.projectIds===void 0)?K.projectsReason??`Project board data is incomplete. Refresh to try again.`:F.length&&K.items.some(e=>e.assignees===void 0)?`Assignee data is incomplete. Refresh to try again.`:null:null,q=K&&!Fe?ct(K.items,{labels:N,...e===`issues`?{assignees:F,projectId:R}:{}}).filter(e=>!Pe.has(e.number)):[],Le=O.github()[0],J=r===void 0?null:Number.parseInt(r,10),Re=U.data?.available?U.data.items.find(e=>e.number===J):void 0,[Y,ze]=(0,X.useState)(null);(0,X.useEffect)(()=>{Re&&ze({scope:Le,view:e,item:Re})},[Le,e,Re]);let Be=Re??(Y?.scope===Le&&Y.view===e&&Y.item.number===J?Y.item:null),He=(()=>{if(!d?.available||e!==`prs`)return[];let t=new Set;J!==null&&Number.isInteger(J)&&t.add(J);for(let e of[...q,...d.prs]){if(t.size>=wt)break;t.add(e.number)}return[...t]})(),Ue=se(He,e===`prs`),We=Ue.data?.available?Ue.data.checks:void 0;if(n&&C.data?.githubView===`prs`)return(0,Z.jsx)(ke,{to:`/github/prs`,replace:!0});if(!d)return s.isError?(0,Z.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Z.jsx)(D,{icon:(0,Z.jsx)(f,{size:16}),tone:`danger`,title:`Could not load GitHub`,subtitle:s.error.message})}):(0,Z.jsx)(Ve,{});if(y.current=null,!d.available)return(0,Z.jsx)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col`,children:(0,Z.jsx)(D,{icon:(0,Z.jsx)(fe,{}),tone:`neutral`,title:`GitHub is unavailable here`,subtitle:d.reason??`unknown reason`,actions:(0,Z.jsx)(E,{variant:`outline`,"data-action":`gh-retry`,disabled:b.isPending,onClick:()=>b.mutate(),children:`Try again`}),children:(0,Z.jsxs)(`p`,{className:`text-xs leading-relaxed text-soft-foreground`,children:[`The tab needs the `,(0,Z.jsx)(`span`,{className:`font-mono`,children:`gh`}),` CLI, logged in (`,(0,Z.jsx)(`span`,{className:`font-mono`,children:`gh auth login`}),`), and a repo with a GitHub remote. Everything else in cezar works without it.`]})})});let Ke=M.trim()!==``&&!V||H&&U.isPending,qe={...K?.labelColors??{},...d.labelColors??{}},Je=st([...Oe,...K?.items??[]]),Q=r===void 0?null:Number.parseInt(r,10),$=Q===null?W[0]??q[0]??null:Oe.find(e=>e.number===Q)??Be??null;y.current=$?{kind:$.kind,number:$.number}:null;let Qe=e===`issues`?`/github`:`/github/prs`,$e=H&&(U.data?.available===!1||U.isError),et=U.data?.available===!1?U.data.reason??`unknown reason`:U.error instanceof Error?U.error.message:`the search request failed`,tt=Ne?Ke?(0,Z.jsxs)(`p`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(je,{"aria-hidden":`true`,className:`size-3.5 motion-safe:animate-spin`}),`Searching GitHub for “`,M.trim(),`”…`]}):$e?q.length>0?(0,Z.jsxs)(`p`,{role:`status`,children:[`Showing previous results. GitHub could not be refreshed: `,et,`. Use Refresh to try again.`]}):W.length>0?(0,Z.jsxs)(`p`,{children:[`GitHub could not be searched: `,et,`.`]}):(0,Z.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter, and GitHub could not be searched: `,et,`.`]}):Fe?(0,Z.jsxs)(`p`,{role:`status`,children:[`Cannot apply the selected filters to GitHub results: `,Fe]}):q.length>0?null:K?.truncated?(0,Z.jsx)(`p`,{children:`No matches within GitHub’s first matches. Narrow your search to check more specific results.`}):K&&W.length>0?(0,Z.jsxs)(`p`,{children:[`No additional `,e===`issues`?`issues`:`pull requests`,` match your filter on GitHub.`]}):K?(0,Z.jsxs)(`p`,{children:[`No `,e===`issues`?`issues`:`pull requests`,` match your filter — open, closed or merged.`]}):(0,Z.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,` match your filter.`]}):(0,Z.jsxs)(`p`,{children:[`No open `,e===`issues`?`issues`:`pull requests`,`.`]});return(0,Z.jsxs)(`div`,{"data-route":`github`,className:`flex min-h-full flex-col gap-3 px-[18px] pt-[18px] pb-[calc(90px+env(safe-area-inset-bottom))] md:gap-[22px] md:p-9`,children:[(0,Z.jsxs)(`header`,{"data-slot":`gh-header`,className:`flex shrink-0 flex-col gap-3 md:gap-[22px]`,children:[(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight md:text-[30px]`,children:`GitHub`}),d.repo?(0,Z.jsxs)(`span`,{className:`min-w-0 truncate text-[13px] text-muted-foreground`,children:[(0,Z.jsx)(`span`,{"data-slot":`gh-repo`,children:d.repo}),(0,Z.jsxs)(`span`,{"data-slot":`gh-synced`,children:[` · `,d.syncedAt?`Synced ${G(d.syncedAt)} ago`:`Not synced yet`]})]}):null]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-tabs`,className:`flex min-h-11 flex-wrap items-center gap-3`,children:[(0,Z.jsxs)(Ge,{to:`/github`,active:e===`issues`,onClick:()=>v(`issues`),children:[`Issues · `,kt(d.issues.length)]}),(0,Z.jsxs)(Ge,{to:`/github/prs`,active:e===`prs`,onClick:()=>v(`prs`),children:[`Pull requests · `,kt(d.prs.length)]}),l?(0,Z.jsx)(Ae,{to:`/automations/new`,className:`gh-utility`,children:`Set up automations`}):null,(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-refresh`,title:`Refresh from GitHub`,disabled:b.isPending,onClick:()=>b.mutate(),className:`gh-utility`,children:[(0,Z.jsx)(u,{size:16,"aria-hidden":`true`,className:A(`size-3.5`,b.isPending&&`motion-safe:animate-spin`)}),`Refresh`]})]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-filter-toolbar`,className:`flex flex-wrap items-center gap-2.5`,children:[(0,Z.jsxs)(`div`,{className:`relative min-w-0 basis-full md:flex-1 md:basis-auto`,children:[(0,Z.jsx)(m,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-soft-foreground`}),(0,Z.jsx)(`input`,{type:`search`,"data-slot":`gh-search`,"aria-label":`Search ${e}`,placeholder:`Search #id, title, author…`,value:M,onChange:e=>we(e.target.value),className:`min-h-11 w-full rounded-md border border-input bg-card py-1 pr-2 pl-7 text-[13px] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`})]}),(0,Z.jsx)(jt,{options:Je,colors:qe,selected:N,onChange:P}),e===`issues`?(0,Z.jsx)(ot,{data:{...d,issues:[...d.issues,...K?.items??[]]},assignees:F,projectId:R,onAssigneesChange:Te,onProjectChange:L}):null,(0,Z.jsx)(`button`,{type:`button`,disabled:!Ne,className:`min-h-11 min-w-11 rounded-md border border-border bg-card px-4 text-xs disabled:opacity-50`,onClick:Ee,children:`Clear filters`})]})]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-panes`,className:`flex min-h-0 min-w-0 flex-1 flex-col items-start gap-[22px] md:flex-row`,children:[(0,Z.jsxs)(`section`,{"data-slot":`gh-list`,"data-mobile-preview":Me||void 0,style:{"--github-list-width":`${me}px`},className:`relative flex w-full min-h-0 flex-col rounded-lg border border-border bg-card p-3 md:w-[var(--github-list-width)] md:shrink-0`,children:[W.length===0?tt&&(0,Z.jsx)(`div`,{"data-slot":`gh-empty`,className:`px-4 py-4 text-sm text-soft-foreground`,children:tt}):(0,Z.jsx)(`ul`,{"data-slot":`gh-rows`,className:`flex flex-col gap-1`,children:W.map((t,n)=>(0,Z.jsx)(At,{item:t,view:e,colors:qe,active:$?.url===t.url,compactHidden:Me&&n>=2&&$?.url!==t.url,queued:Se.has(t.url),checks:t.kind===`pr`?We?.[t.number]??t.checks:t.checks},t.url))}),e===`issues`&&r!==void 0&&W.length>2?(0,Z.jsx)(E,{variant:`outline`,className:`mt-2 self-start md:hidden`,"data-slot":`gh-expand-list`,"aria-expanded":j,onClick:()=>ge(e=>!e),children:j?`Show fewer issues`:`View all ${W.length} issues`}):null,W.length>0&&H&&tt?(0,Z.jsx)(`div`,{"data-slot":`gh-search-status`,role:`status`,className:`px-4 py-4 text-sm text-soft-foreground`,children:tt}):null,q.length>0?(0,Z.jsxs)(`div`,{"data-slot":`gh-search-hits`,children:[(0,Z.jsxs)(`p`,{className:`px-4 pt-2 pb-1 text-[11px] font-medium tracking-wide text-soft-foreground uppercase`,children:[`Found on GitHub`,K?.truncated?` (first matches)`:``]}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:q.map(t=>(0,Z.jsx)(At,{item:t,view:e,colors:qe,active:$?.url===t.url,queued:Se.has(t.url),checks:t.kind===`pr`?We?.[t.number]??t.checks:t.checks},t.url))})]}):null,(0,Z.jsx)(Et,{width:me,onWidthChange:_e})]}),(0,Z.jsx)(`section`,{"data-slot":`gh-detail`,className:A(`w-full min-w-0 min-h-0 flex-1 flex-col rounded-lg border border-border bg-card`,r===void 0?`hidden md:flex`:`flex`),children:$?(0,Z.jsx)(Nt,{item:$,listPath:Qe,colors:qe,changes:t,checks:$.kind===`pr`?We?.[$.number]??$.checks:$.checks,children:(0,Z.jsx)(yt,{item:$,workflows:x.data?.workflows??[],skills:xe,workflow:T,onWorkflowChange:ie,selectedSkills:ae,onSkillsChange:k,engine:ce,onEngineChange:pe,queuedRunId:Se.get($.url)??null,onQueued:(e,t)=>Ce(n=>new Map(n).set(e,t))},$.url)}):(0,Z.jsx)(D,{icon:e===`issues`?(0,Z.jsx)(_,{size:16}):(0,Z.jsx)(ne,{size:16}),tone:`neutral`,heading:`h2`,title:Q===null?`Nothing selected`:`Not found`,subtitle:Q===null?`No open ${e===`issues`?`issues`:`pull requests`} to show.`:`#${Q} is not among the open ${e===`issues`?`issues`:`pull requests`}. Search for ${Q} above to look it up on GitHub, closed and merged included.`})})]})]})}function kt(e){return`${e}${e>=Ct?`+`:``}`}function At({item:e,view:t,colors:n,active:r,compactHidden:i,queued:a,checks:o}){let s=e.kind===`issue`?_:ne,c=g(),l=()=>{c.prefetchQuery({queryKey:O.githubComments(e.kind,e.number),queryFn:({signal:t})=>le(e.kind,e.number,{},{signal:t}),staleTime:6e4})};return(0,Z.jsx)(`li`,{"data-compact-hidden":i||void 0,children:(0,Z.jsxs)(Ae,{to:`${t===`issues`?`/github/issues`:`/github/prs`}/${e.number}`,draggable:!0,onDragStart:t=>{try{t.dataTransfer.setData(`text/plain`,Qe(e)),t.dataTransfer.effectAllowed=`copy`}catch{}},onMouseEnter:l,onFocus:l,"data-slot":`gh-row`,"data-number":e.number,"data-kind":e.kind,"aria-current":r?`page`:void 0,title:`Drag into the composer to prefill a task`,className:A(`flex flex-col gap-2 rounded-md px-3 py-4 transition-colors hover:bg-muted`,r&&`bg-accent-strong/10 text-accent-text`),children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-start gap-2 md:items-center`,children:[(0,Z.jsx)(s,{"aria-hidden":`true`,className:A(`mt-0.5 size-3.5 shrink-0 md:mt-0`,e.kind===`issue`?`text-success`:`text-accent-icon`)}),(0,Z.jsx)(`span`,{className:A(`line-clamp-2 min-w-0 text-[13px] font-medium md:block md:truncate`,r&&`font-semibold`),children:e.title})]}),(0,Z.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 pl-[22px] font-mono text-[10.5px] text-muted-foreground md:flex-nowrap md:gap-y-0`,children:[(0,Z.jsxs)(`span`,{children:[`#`,e.number]}),(0,Z.jsx)(`span`,{className:`max-w-full shrink-0 truncate md:min-w-0 md:shrink`,children:e.author}),(0,Z.jsx)(`span`,{children:G(e.createdAt)}),(0,Z.jsx)(Zt,{count:e.comments}),o?(0,Z.jsx)($t,{checks:o}):null,a?(0,Z.jsx)(`span`,{"data-slot":`gh-queued-flag`,className:`font-sans font-medium text-accent-text`,children:`↗ run queued`}):null]}),e.labels.length>0?(0,Z.jsx)(`span`,{"data-slot":`gh-row-labels`,className:`flex flex-wrap gap-1 pl-[22px]`,children:e.labels.map(e=>(0,Z.jsx)(Mt,{label:e,color:n[e],plain:!0},e))}):null]})})}function jt({options:e,colors:t,selected:n,onChange:r}){let[i,a]=(0,X.useState)(!1),o=e=>r(n.includes(e)?n.filter(t=>t!==e):[...n,e]);return(0,Z.jsxs)(_e,{open:i,onOpenChange:a,children:[(0,Z.jsx)(ge,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`gh-label-filter`,disabled:e.length===0,className:A(`flex min-h-11 min-w-11 shrink-0 items-center gap-1 rounded-md border border-input bg-card px-2 py-1 text-[12px] font-medium text-muted-foreground transition-colors hover:text-foreground disabled:opacity-50`,n.length>0&&`border-accent-strong/60 text-foreground`),children:[(0,Z.jsx)(qe,{"aria-hidden":`true`,className:`size-3.5`}),n.length>0?`Labels · ${n.length}`:`Labels`]})}),(0,Z.jsx)(j,{align:`end`,sideOffset:6,className:`w-60 p-0`,children:(0,Z.jsxs)(F,{children:[(0,Z.jsx)(P,{placeholder:`Filter labels…`}),(0,Z.jsxs)(L,{className:`max-h-[min(16rem,calc(var(--radix-popover-content-available-height)-3rem))]`,children:[(0,Z.jsx)(R,{children:`No labels.`}),n.length>0?(0,Z.jsxs)(De,{value:`__clear__`,onSelect:()=>r([]),className:`min-h-11 text-soft-foreground`,children:[`Clear `,n.length,` filter`,n.length>1?`s`:``]}):null,e.map(e=>{let r=n.includes(e);return(0,Z.jsxs)(De,{value:e,onSelect:()=>o(e),className:`min-h-11`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 shrink-0 rounded-full border`,style:ut(t[e])}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e}),r?(0,Z.jsx)(d,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-link-foreground`}):null]},e)})]})]})})]})}function Mt({label:e,color:t,plain:n=!1}){return(0,Z.jsx)(`span`,{"data-slot":`gh-label`,"data-label":e,style:n?void 0:ut(t),className:n?`text-[11px] font-normal text-muted-foreground`:`rounded-full border px-1.5 py-px text-[10px] font-medium`,children:e})}function Nt({item:e,listPath:t,colors:n,children:r,changes:i,checks:a}){let o=e.kind===`pr`?`pull request`:`issue`,s=e.kind===`pr`&&!!(e.additions||e.deletions);return(0,Z.jsxs)(`article`,{"data-slot":`gh-detail-inner`,className:`min-w-0 px-4 py-4 md:px-7 md:py-5`,children:[(0,Z.jsxs)(Ae,{to:t,"data-slot":`gh-back`,className:`mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground md:hidden`,children:[(0,Z.jsx)(b,{size:16,"aria-hidden":`true`,className:`size-3.5`}),`Back to the list`]}),(0,Z.jsxs)(`div`,{"data-slot":`gh-description-card`,className:e.kind===`pr`?`rounded-xl border border-border bg-card p-6`:void 0,children:[e.kind===`pr`?(0,Z.jsxs)(`h2`,{className:`mb-4 text-[22px] leading-snug font-normal`,children:[`#`,e.number,` `,e.title]}):null,(0,Z.jsxs)(`p`,{"data-slot":`gh-meta`,className:`flex flex-wrap items-center gap-x-1.5 font-mono text-[10.5px] text-soft-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`#`,e.number]}),`·`,(0,Z.jsx)(`span`,{children:o}),`·`,(0,Z.jsxs)(`span`,{children:[`opened by `,e.author]}),`·`,(0,Z.jsxs)(`span`,{children:[G(e.createdAt),` ago`]}),e.comments?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsx)(Zt,{count:e.comments})]}):null,s?(0,Z.jsxs)(Z.Fragment,{children:[`·`,(0,Z.jsxs)(`span`,{"data-slot":`gh-diffstat`,children:[(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions??0]}),` `,(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions??0]})]})]}):null,`·`,he(e.url)?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-open-link`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(N,{"aria-hidden":`true`,className:`size-2.5`})]}):(0,Z.jsx)(`span`,{"data-slot":`gh-open-link`,className:`text-muted-foreground`,children:`open on GitHub`})]}),e.kind===`pr`?null:(0,Z.jsx)(`h2`,{className:`mt-2 text-[22px] leading-snug font-normal`,children:e.title}),e.kind===`pr`?(0,Z.jsxs)(`nav`,{"aria-label":`Pull request detail`,className:`mt-4 flex border-b border-border`,children:[(0,Z.jsx)(Ge,{to:`/github/prs/${e.number}`,active:!i,children:`Conversation`}),(0,Z.jsx)(Ge,{to:`/github/prs/${e.number}/changes`,active:i,children:`Changes`})]}):null,e.labels.length>0||a?(0,Z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-1.5`,children:[e.labels.map(e=>(0,Z.jsx)(Mt,{label:e,color:n[e]},e)),a?(0,Z.jsx)(Qt,{checks:a,url:e.url}):null]}):null,i&&e.kind===`pr`?(0,Z.jsx)(Lt,{item:e}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{"data-slot":`gh-body`,className:`mt-5 text-sm`,children:e.body?(0,Z.jsx)(Ne,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-soft-foreground`,children:`(no description)`})}),(0,Z.jsx)(Rt,{item:e,colors:n})]})]}),e.kind===`pr`?(0,Z.jsx)(It,{number:e.number}):null,r]})}var Pt={squash:`Squash and merge`,merge:`Create a merge commit`,rebase:`Rebase and merge`};function Ft({state:e}){let t=`size-4 shrink-0`;return e===`passing`?(0,Z.jsx)(d,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-passing`,className:A(t,`text-success`)}):e===`failing`?(0,Z.jsx)(k,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-failing`,className:A(t,`text-danger`)}):e===`pending`?(0,Z.jsx)(je,{"aria-hidden":`true`,"data-slot":`gh-merge-status-pending`,className:A(t,`animate-spin text-warning`)}):(0,Z.jsx)(r,{size:16,"aria-hidden":`true`,"data-slot":`gh-merge-status-unknown`,className:A(t,`text-soft-foreground`)})}function It({number:e}){let t=g(),n=ce({queryKey:O.githubMergeState(e),queryFn:({signal:t})=>s(e,{},{signal:t}),retry:!1}),r=n.data?.available?n.data.mergeState:null,[a,o]=(0,X.useState)(null),[c,l]=(0,X.useState)(!1),[p,m]=(0,X.useState)(!1),_=i({mutationFn:()=>s(e,{refresh:!0}),onSuccess:n=>t.setQueryData(O.githubMergeState(e),n),onError:e=>w(e instanceof Error?e.message:String(e),{tone:`danger`})}),v=a&&r?.methods.includes(a)?a:r?.defaultMethod??r?.methods[0]??null,y=i({mutationFn:()=>{if(!r||!v)throw Error(`No merge method is available.`);return h(e,{method:v,expectedHeadSha:r.headSha,...p&&r.canOverride?{overrideRules:!0}:{}})},onSuccess:()=>{l(!1),w(`Pull request #${e} merged`),t.invalidateQueries({queryKey:O.githubMergeState(e)}),t.invalidateQueries({queryKey:O.github({limit:Ct})}),t.invalidateQueries({queryKey:O.githubComments(`pr`,e)})},onError:n=>{w(n instanceof Error?n.message:String(n),{tone:`danger`}),t.invalidateQueries({queryKey:O.githubMergeState(e)})}});if(n.isPending)return(0,Z.jsx)(Je,{"data-slot":`gh-merge-loading`,className:`mt-6 h-32 w-full`});if(!r)return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-unavailable`,className:`mt-6 rounded-lg border border-border bg-card p-4 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`Merge status unavailable`}),(0,Z.jsx)(`p`,{className:`mt-1 text-xs text-soft-foreground`,children:n.data?.available===!1?n.data.reason:`GitHub could not load merge requirements.`})]});let b=r.state===`merged`?`Merged`:r.state===`closed`?`Closed`:r.isDraft?`Draft`:r.mergeable===`conflicting`?`Conflicts must be resolved`:r.canMerge?`Ready to merge`:r.eligibility===`unknown`?`Merge blocked · Requirements unknown`:`Merge blocked`,x=r.reviewDecision===`approved`?`passing`:r.reviewDecision===`unknown`?`unknown`:`failing`,S=r.mergeable===`mergeable`?`passing`:r.mergeable===`conflicting`?`failing`:`unknown`,C=!!(v&&(r.canMerge||r.canOverride&&p));return(0,Z.jsxs)(`section`,{"data-slot":`gh-merge-box`,"data-eligibility":r.eligibility,"data-conflicting":r.mergeable===`conflicting`?`true`:void 0,"aria-live":`polite`,className:`mt-6 rounded-lg border border-border bg-card p-4`,children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-3`,children:[r.canMerge?(0,Z.jsx)(d,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-success`}):(0,Z.jsx)(f,{size:16,"aria-hidden":`true`,className:`mt-0.5 size-5 shrink-0 text-warning`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Z.jsx)(`h3`,{className:`font-semibold`,children:b}),(0,Z.jsxs)(E,{type:`button`,variant:`ghost`,size:`sm`,disabled:_.isPending,onClick:()=>_.mutate(),children:[(0,Z.jsx)(u,{size:16,"aria-hidden":`true`,className:A(`size-3.5`,_.isPending&&`animate-spin`)}),`Refresh`]})]}),(0,Z.jsxs)(`p`,{className:`mt-1 font-mono text-[11px] text-soft-foreground`,children:[r.headRef,` (`,r.headSha.slice(0,7),`) → `,r.baseRef]}),(0,Z.jsxs)(`ul`,{className:`mt-3 space-y-2 text-xs`,children:[(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Ft,{state:x}),(0,Z.jsxs)(`span`,{children:[`Reviews: `,r.reviewDecision.replaceAll(`-`,` `)]})]}),(0,Z.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Ft,{state:S}),(0,Z.jsxs)(`span`,{children:[`Conflicts: `,r.mergeable===`conflicting`?`present`:r.mergeable===`mergeable`?`none`:`unknown`]})]}),r.checks.length===0?(0,Z.jsx)(`li`,{children:`No checks configured`}):r.checks.map(e=>(0,Z.jsxs)(`li`,{className:`flex items-center justify-between gap-3`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(Ft,{state:e.state}),(0,Z.jsxs)(`span`,{children:[e.name,` · `,e.state,e.required===!0?` · required`:e.required===null?` · requiredness unknown`:``]})]}),e.url&&he(e.url)?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`text-muted-foreground underline`,children:`details`}):null]},e.name)),r.blockers.map(e=>(0,Z.jsx)(`li`,{className:`text-soft-foreground`,children:e.message},e.code))]}),r.mergeable===`conflicting`?(0,Z.jsx)(E,{className:`mt-4`,onClick:e=>{let t=e.currentTarget.closest(`article`)?.querySelector(`[data-slot="gh-custom-prompt"]`);t?.scrollIntoView({block:`center`}),t?.focus({preventScroll:!0})},children:`Run agent on this PR`}):null,r.canOverride?(0,Z.jsxs)(`label`,{className:`mt-4 flex cursor-pointer items-start gap-2 rounded-md border border-warning/40 bg-warning/5 p-3 text-xs`,children:[(0,Z.jsx)(`input`,{type:`checkbox`,checked:p,onChange:e=>m(e.target.checked),className:`mt-0.5 size-4 accent-accent-strong`}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`block font-medium`,children:`Merge without waiting for requirements`}),(0,Z.jsx)(`span`,{className:`mt-0.5 block text-soft-foreground`,children:`GitHub will allow this only if your permissions can bypass the repository rules.`})]})]}):null,r.eligibility===`unknown`?(0,Z.jsx)(`p`,{className:`mt-4 text-xs text-muted-foreground`,children:`GitHub could not confirm review and branch-protection requirements. Passing checks do not establish merge readiness.`}):null,r.state===`open`&&r.methods.length>0?(0,Z.jsxs)(`div`,{className:`mt-4 flex flex-col gap-2 sm:flex-row`,children:[(0,Z.jsx)(`select`,{"aria-label":`Merge method`,value:v??``,onChange:e=>o(e.target.value),className:`h-9 min-w-0 flex-1 rounded-md border border-input bg-background px-3 text-sm`,children:r.methods.map(e=>(0,Z.jsx)(`option`,{value:e,children:Pt[e]},e))}),(0,Z.jsx)(E,{disabled:!C,onClick:()=>l(!0),children:v?Pt[v]:`Merge`})]}):null]})]}),(0,Z.jsx)(be,{open:c,onOpenChange:l,children:(0,Z.jsxs)(Se,{"data-slot":`gh-merge-confirm`,showCloseButton:!1,children:[(0,Z.jsxs)(xe,{children:[(0,Z.jsxs)(Ce,{children:[v?Pt[v]:`Merge`,` pull request #`,e,`?`]}),(0,Z.jsx)(ye,{asChild:!0,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsxs)(`p`,{children:[`This will merge “`,r.title,`” into `,r.baseRef,`. GitHub will re-check the exact reviewed head before changing the repository.`]}),p&&r.canOverride?(0,Z.jsx)(`p`,{"data-slot":`gh-bypass-warning`,className:`mt-4 text-sm text-warning`,children:`You are asking GitHub to bypass unmet repository requirements; GitHub may refuse if your permissions do not allow it.`}):null]})})]}),y.error?(0,Z.jsx)(`p`,{className:`text-sm text-danger`,children:y.error.message}):null,(0,Z.jsxs)(ve,{children:[(0,Z.jsx)(E,{variant:`outline`,disabled:y.isPending,onClick:()=>l(!1),children:`Cancel`}),(0,Z.jsx)(E,{disabled:y.isPending,onClick:()=>y.mutate(),children:y.isPending?`Merging…`:v?Pt[v]:`Merge`})]})]})})]})}function Lt({item:e}){let t=g(),n=T(e.number),[r,i]=(0,X.useState)(``),[a,o]=(0,X.useState)(null),s=n.data,c=s?.available?s.files.filter(e=>e.path.toLowerCase().includes(r.toLowerCase())):[],l=c.findIndex(e=>e.path===a);(0,X.useEffect)(()=>{c.length>0&&!c.some(e=>e.path===a)&&o(c[0].path)},[s?.available?s.headSha:``,r]);let u=async()=>{let n=s?.available?s.headSha:null,r=await y(e.number,{refresh:!0});t.setQueryData([`github`,`pr-changes`,e.number],r),r.available&&n&&n!==r.headSha&&(o(r.files[0]?.path??null),w(`The reviewed revision changed.`))};if(n.isPending)return(0,Z.jsx)(`p`,{"aria-live":`polite`,className:`mt-6 text-sm text-muted-foreground`,children:`Loading changed files…`});if(n.isError||!s)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-danger`,children:`Changed files could not be loaded.`});if(!s.available)return(0,Z.jsx)(`p`,{className:`mt-6 text-sm text-muted-foreground`,children:s.reason});let d=c.map(e=>({path:e.path,...e.previousPath?{oldPath:e.previousPath}:{},status:e.status===`removed`?`deleted`:e.status===`changed`?`modified`:e.status,adds:e.additions,dels:e.deletions,binary:e.patchUnavailableReason===`binary`,patch:e.patch??``})),f=he(e.url)?`${e.url}/files`:null,p=c.find(e=>e.path===a);return(0,Z.jsxs)(`section`,{"data-slot":`gh-pr-changes`,className:`mt-5 min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,Z.jsxs)(`strong`,{children:[s.files.length,` changed files`]}),(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,s.additions]}),(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,s.deletions]}),(0,Z.jsxs)(`span`,{className:`font-mono text-muted-foreground`,title:s.headSha,children:[`head `,s.headSha.slice(0,8)]}),(0,Z.jsx)(E,{type:`button`,variant:`outline`,size:`sm`,className:`ml-auto min-h-11`,onClick:()=>void u(),children:`Refresh`})]}),s.truncated?(0,Z.jsxs)(`p`,{role:`status`,className:`mt-3 rounded-md border border-warning/40 bg-warning/10 p-3 text-xs`,children:[s.reason??`This response is incomplete.`,` `,f?(0,Z.jsx)(`a`,{href:f,target:`_blank`,rel:`noopener noreferrer`,className:`underline`,children:`Open all files on GitHub`}):null]}):null,(0,Z.jsxs)(`div`,{className:`mt-4 grid min-w-0 gap-4 lg:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,Z.jsxs)(`aside`,{className:`min-w-0`,children:[(0,Z.jsx)(`input`,{"aria-label":`Filter changed files`,value:r,onChange:e=>i(e.target.value),placeholder:`Filter files…`,className:`min-h-11 w-full rounded-md border border-input bg-background px-3 text-sm`}),(0,Z.jsx)(`select`,{"aria-label":`Select changed file`,value:a??``,onChange:e=>o(e.target.value),className:`mt-2 min-h-11 w-full rounded-md border border-input bg-background px-2 text-sm lg:hidden`,children:c.map(e=>(0,Z.jsx)(`option`,{children:e.path},e.path))}),(0,Z.jsx)(`ul`,{className:`mt-2 hidden max-h-[60vh] overflow-auto lg:block`,children:c.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>o(e.path),className:A(`min-h-11 w-full truncate rounded px-2 text-left text-xs`,a===e.path&&`bg-muted font-medium`),title:e.path,children:[e.status,` · `,e.path,` `,(0,Z.jsxs)(`span`,{className:`text-success`,children:[`+`,e.additions]}),` `,(0,Z.jsxs)(`span`,{className:`text-danger`,children:[`−`,e.deletions]})]})},e.path))})]}),(0,Z.jsxs)(`div`,{className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-2 flex justify-end gap-1`,children:[(0,Z.jsx)(E,{"aria-label":`Previous file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:l<=0,onClick:()=>o(c[l-1]?.path??null),children:(0,Z.jsx)(Ke,{})}),(0,Z.jsx)(E,{"aria-label":`Next file`,variant:`outline`,size:`icon`,className:`min-h-11 min-w-11`,disabled:l<0||l>=c.length-1,onClick:()=>o(c[l+1]?.path??null),children:(0,Z.jsx)(x,{size:16})})]}),c.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No changed files match this filter.`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(We,{files:d.filter(e=>e.path===a),wrap:!0,className:`min-w-0`}),p&&!p.patch?(0,Z.jsxs)(`p`,{className:`rounded-b border border-border p-3 text-xs text-muted-foreground`,children:[`Patch unavailable: `,p.patchUnavailableReason??`not-provided`,`.`]}):null]})]})]})]})}function Rt({item:e,colors:t}){let n=pe(e.kind,e.number),r=n.data,i=(0,X.useMemo)(()=>{let e=[...(r?.comments??[]).map(e=>({row:`comment`,comment:e})),...(r?.events??[]).map(e=>({row:`event`,event:e}))],t=e=>{let t=Date.parse(zt(e));return Number.isNaN(t)?-1/0:t};return e.sort((e,n)=>t(e)-t(n))},[r?.comments,r?.events]);return n.isPending?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-loading`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsx)(Je,{className:`mb-3 h-3 w-24`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Z.jsx)(Je,{className:`h-14 w-full`}),(0,Z.jsx)(Je,{className:`h-14 w-full`})]})]}):!r||!r.available?(0,Z.jsxs)(`section`,{"data-slot":`gh-thread-error`,className:`mt-6 border-t border-border pt-5 text-xs text-soft-foreground`,children:[(0,Z.jsxs)(`span`,{children:[`Couldn’t load comments — `,r?.reason??(n.error instanceof Error?n.error.message:`could not load comments`),`. `]}),(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-0.5 text-muted-foreground hover:text-foreground hover:underline`,children:[`open on GitHub`,(0,Z.jsx)(N,{"aria-hidden":`true`,className:`size-2.5`})]})]}):i.length===0?null:(0,Z.jsxs)(`section`,{"data-slot":`gh-thread`,className:`mt-6 border-t border-border pt-5`,children:[(0,Z.jsxs)(`h3`,{"data-slot":`gh-thread-header`,className:`mb-4 text-[11px] font-semibold tracking-wide text-soft-foreground uppercase`,children:[`Activity · `,r.comments.length,` comment`,r.comments.length===1?``:`s`]}),(0,Z.jsx)(`ul`,{className:`flex flex-col gap-5`,children:Bt(i).map(e=>e.group===`commits`?(0,Z.jsx)(Vt,{commits:e.commits,colors:t},e.commits[0].id):e.entry.row===`comment`?(0,Z.jsx)(qt,{comment:e.entry.comment},`${e.entry.comment.kind}-${e.entry.comment.id}`):(0,Z.jsx)(Ut,{event:e.entry.event,colors:t},e.entry.event.id))}),r.truncated?(0,Z.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-thread-truncated`,className:`mt-4 inline-flex items-center gap-0.5 text-xs text-soft-foreground hover:text-foreground hover:underline`,children:[`thread truncated — open on GitHub`,(0,Z.jsx)(N,{"aria-hidden":`true`,className:`size-2.5`})]}):null]})}var zt=e=>e.row===`comment`?e.comment.createdAt:e.event.createdAt;function Bt(e){let t=[],n=[],r=()=>{n.length!==0&&(n.length===1?t.push({group:`single`,entry:{row:`event`,event:n[0]}}):t.push({group:`commits`,commits:n}),n=[])};for(let i of e){if(i.row===`event`&&i.event.kind===`committed`&&i.row===`event`){let e=n[n.length-1];e&&e.actor!==i.event.actor&&r(),n.push(i.event);continue}r(),t.push({group:`single`,entry:i})}return r(),t}function Vt({commits:e,colors:t}){let[n,r]=(0,X.useState)(!1),i=e[0]?.actor??`?`;return n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`true`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!0,onClick:()=>r(!1),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Ht.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]})]})}),e.map(e=>(0,Z.jsx)(Ut,{event:e,colors:t},e.id))]}):(0,Z.jsx)(`li`,{"data-slot":`gh-commit-group`,"data-open":`false`,className:`min-w-0`,children:(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":!1,onClick:()=>r(!0),className:`flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground hover:text-foreground`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:Ht.committed}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:i}),(0,Z.jsxs)(`span`,{children:[`added `,e.length,` commits`]}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:G(e[e.length-1].createdAt)})]})})}var Ht={committed:`⚙`,labeled:`◆`,unlabeled:`◇`,assigned:`◍`,unassigned:`◌`,merged:`⑃`,closed:`⊘`,reopened:`⊙`,head_ref_force_pushed:`↻`,"cross-referenced":`↗`,renamed:`✎`};function Ut({event:e,colors:t}){return(0,Z.jsxs)(`li`,{"data-slot":`gh-event-row`,"data-kind":e.kind,className:A(`flex min-w-0 items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,e.kind===`merged`&&`text-accent-foreground`),children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`shrink-0`,children:Ht[e.kind]}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.actor}),(0,Z.jsx)(Wt,{event:e,colors:t}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:G(e.createdAt)}),e.url?(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open ${e.kind} on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(N,{"aria-hidden":`true`,className:`size-2.5`})}):null]})}function Wt({event:e,colors:t}){switch(e.kind){case`committed`:return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:`committed`}),e.sha?(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.sha.slice(0,7)}):null,e.message?(0,Z.jsx)(`span`,{className:`truncate font-sans text-foreground`,children:e.message}):null,(0,Z.jsx)(Gt,{checks:e.checks})]});case`labeled`:case`unlabeled`:return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`shrink-0`,children:e.kind===`labeled`?`added the`:`removed the`}),e.label?(0,Z.jsx)(`span`,{"data-slot":`gh-event-label`,style:ut(e.label.color??t[e.label.name]),className:`max-w-[12rem] truncate rounded-full border px-1.5 py-px font-sans text-[10px]`,children:e.label.name}):null,(0,Z.jsx)(`span`,{className:`shrink-0`,children:`label`})]});case`assigned`:case`unassigned`:return(0,Z.jsxs)(`span`,{className:`truncate`,children:[e.kind===`assigned`?`assigned`:`unassigned`,` `,e.subject??`someone`]});case`merged`:return(0,Z.jsx)(`span`,{children:`merged this`});case`closed`:return(0,Z.jsx)(`span`,{children:`closed this`});case`reopened`:return(0,Z.jsx)(`span`,{children:`reopened this`});case`head_ref_force_pushed`:return(0,Z.jsx)(`span`,{children:`force-pushed`});case`renamed`:return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`renamed this to `,e.subject??`—`]});case`cross-referenced`:return(0,Z.jsxs)(`span`,{className:`truncate`,children:[`referenced this in `,e.refNumber?`#${e.refNumber}`:`another thread`,e.refTitle?` ${e.refTitle}`:``]})}}function Gt({checks:e}){return e?(0,Z.jsx)(`span`,{"data-slot":`gh-commit-checks`,"data-checks":e,"aria-label":`checks ${e}`,className:A(`shrink-0`,Xt[e]),children:Yt[e]}):null}var Kt={approved:{label:`approved`,tone:`border-success/40 text-success`},changes_requested:{label:`changes requested`,tone:`border-danger/40 text-danger`},commented:{label:`commented`,tone:`border-border text-muted-foreground`},dismissed:{label:`dismissed`,tone:`border-border text-muted-foreground`}};function qt({comment:e}){let t=e.reviewState?Kt[e.reviewState]:null;return(0,Z.jsxs)(`li`,{"data-slot":`gh-thread-entry`,"data-kind":e.kind,className:`min-w-0`,children:[(0,Z.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 font-mono text-[11px] text-soft-foreground`,children:[(0,Z.jsx)(Jt,{url:e.avatarUrl,login:e.author}),(0,Z.jsx)(`span`,{className:`font-sans font-medium text-foreground`,children:e.author}),(0,Z.jsx)(`span`,{children:G(e.createdAt)}),t?(0,Z.jsx)(`span`,{"data-slot":`gh-review-chip`,"data-review-state":e.reviewState,className:A(`rounded-full border px-1.5 py-px font-sans text-[10px] font-medium`,t.tone),children:t.label}):null,(0,Z.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`open comment on GitHub`,className:`ml-auto shrink-0 text-muted-foreground hover:text-foreground`,children:(0,Z.jsx)(N,{"aria-hidden":`true`,className:`size-2.5`})})]}),(0,Z.jsx)(`div`,{"data-slot":`gh-thread-body`,className:`text-sm`,children:e.body?(0,Z.jsx)(Ne,{children:e.body}):(0,Z.jsx)(`p`,{className:`text-soft-foreground`,children:`(no body)`})})]})}function Jt({url:e,login:t}){let[n,r]=(0,X.useState)(!1);return e&&!n?(0,Z.jsx)(`img`,{src:e,alt:``,width:16,height:16,loading:`lazy`,onError:()=>r(!0),"data-slot":`gh-avatar`,className:`size-4 shrink-0 rounded-full`}):(0,Z.jsx)(`span`,{"data-slot":`gh-avatar-fallback`,"aria-hidden":`true`,className:`flex size-4 shrink-0 items-center justify-center rounded-full bg-muted text-[8px] font-semibold text-muted-foreground uppercase`,children:t.slice(0,1)||`?`})}var Yt={passing:`✓`,failing:`✗`,pending:`○`},Xt={passing:`text-success`,failing:`text-danger`,pending:`text-muted-foreground`};function Zt({count:e}){return e?(0,Z.jsxs)(`span`,{"data-slot":`gh-comment-count`,"data-count":e,"aria-label":`${e} comment${e===1?``:`s`}`,className:`inline-flex shrink-0 items-center gap-0.5`,children:[(0,Z.jsx)(Me,{"aria-hidden":`true`,className:`size-3`}),e]}):null}function Qt({checks:e,url:t}){let n=A(`text-[11px] font-medium`,Xt[e],t&&`hover:underline`),r=`${Yt[e]} checks ${e}`;return t?(0,Z.jsx)(`a`,{href:`${t}/checks`,target:`_blank`,rel:`noopener noreferrer`,"data-slot":`gh-checks`,"data-checks":e,className:n,children:r}):(0,Z.jsx)(`span`,{"data-slot":`gh-checks`,"data-checks":e,className:n,children:r})}function $t({checks:e}){return(0,Z.jsx)(`span`,{"data-slot":`gh-row-checks`,"data-checks":e,title:`checks ${e}`,"aria-label":`checks ${e}`,className:A(`shrink-0 font-sans text-[11px] font-semibold`,Xt[e]),children:Yt[e]})}export{Ot as GithubRoute};
|