1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a1235e-153c-7911-bfa2-f61db957e924")}catch(e){}}();import{cz as f}from"./App-CQqKVdRi.js";import"./main-CuxdyMiW.js";import"./vendor-react-5EL95cED.js";import"./oauthScopeStore-tUyMl6WJ.js";function u(n){const t=n.match(/^(.+?)\/(\d+)([-/].+)?$/);if(t){const o=t[1],r=parseInt(t[2],10);if(o.includes("/"))return{type:"graphite",prefix:o,orderIndex:r}}const a=n.match(/^(gh\/[^/]+)\/(\d+)\/(head|base)$/);return a?{type:"ghstack",prefix:a[1],orderIndex:parseInt(a[2],10)}:null}function l(n){const t=u(n);return(t==null?void 0:t.prefix)??null}const h=` 2query GetStackedPRs($owner: String!, $repo: String!) { 3 repository(owner: $owner, name: $repo) { 4 pullRequests(first: 100, states: [OPEN, MERGED], orderBy: {field: CREATED_AT, direction: ASC}) { 5 nodes { 6 number 7 title 8 url 9 state 10 headRefName 11 baseRefName 12 author { 13 login 14 avatarUrl 15 } 16 } 17 } 18 } 19} 20`;async function m(n,t,a,o){var s,d;const r=await f(h,{owner:n,repo:t});if(r.errors||!r.data)throw new Error(((d=(s=r.errors)==null?void 0:s[0])==null?void 0:d.message)||"Failed to fetch PRs");return r.data.repository.pullRequests.nodes.filter(e=>{const i=u(e.headRefName);return i&&i.prefix===a}).map(e=>{const i=u(e.headRefName);return{number:e.number,title:e.title,url:e.url,state:e.state.toLowerCase(),headBranch:e.headRefName,baseBranch:e.baseRefName,orderIndex:i.orderIndex,isCurrent:e.number===o,author:{login:e.author.login,avatarUrl:e.author.avatarUrl}}}).sort((e,i)=>e.orderIndex-i.orderIndex)}async function y(n,t,a,o){const r=l(o);if(!r)return null;const c=await m(n,t,r,a);if(c.length<=1)return null;const s=u(o);return{prefix:r,type:(s==null?void 0:s.type)??"generic",prs:c,totalCount:c.length}}export{u as detectStackPattern,l as extractStackPrefix,y as fetchStackInfo,m as fetchStackedPRs}; 21 22//# chunkId=01a1235e-153c-7911-bfa2-f61db957e924
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.