azdiffs 1.0.1 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +6 -0
  2. package/dist/cli.js +88 -31
  3. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId-BfEZAJVI.js +1 -0
  4. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits._commitId-DvqTmFzX.js +1 -0
  5. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits.index-Bd3xdIex.js +1 -0
  6. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.conflicts-DV0pCnK1.js +1 -0
  7. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.files-Mr-AIHvi.js +1 -0
  8. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.index-DoV2Gs7F.js +1 -0
  9. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId-ChLX3uCr.js +1 -0
  10. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits._commitId-DXZcIPBR.js +1 -0
  11. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits.index-Bd3xdIex.js +1 -0
  12. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.conflicts-DkEZ314x.js +1 -0
  13. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.files-N3xJdxPo.js +1 -0
  14. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.index-Dt7ItZCC.js +1 -0
  15. package/dist/web/assets/_organization.index-DVTzM87W.js +1 -0
  16. package/dist/web/assets/commit-diff-view-BNA-1iz5.js +1 -0
  17. package/dist/web/assets/commits-view-Cq3oHLFX.js +13 -0
  18. package/dist/web/assets/conflicts-view-Bca0Tnmk.js +8 -0
  19. package/dist/web/assets/dev.diff-jb6X8hTd.js +1 -0
  20. package/dist/web/assets/file-header-B2S9b0sl.js +49 -0
  21. package/dist/web/assets/files-view-C2YnVYtG.js +1460 -0
  22. package/dist/web/assets/grammars-B3laSCck.js +2 -0
  23. package/dist/web/assets/{highlights-BJb1-tzP.js → highlights-C-SBVYal.js} +1 -1
  24. package/dist/web/assets/home-page-BUnNaCN6.js +1 -0
  25. package/dist/web/assets/inbox-D8-BBgQT.js +1 -0
  26. package/dist/web/assets/index-DsrXp1aY.js +11 -0
  27. package/dist/web/assets/overview-view-B9qPTEMk.js +2 -0
  28. package/dist/web/assets/pull-request-layout-R9F6zMxd.js +35 -0
  29. package/dist/web/assets/routes-D2t0cGUy.js +1 -0
  30. package/dist/web/assets/shiki-mTy6Inae.js +1 -0
  31. package/dist/web/assets/shortcut-help-D99FihA2.js +1 -0
  32. package/dist/web/assets/{stream-tokenizer-B5Ok5N3S.js → stream-tokenizer-CKeNSKPz.js} +2 -2
  33. package/dist/web/index.html +1 -1
  34. package/package.json +1 -1
  35. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId-D7saE-jO.js +0 -1
  36. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits._commitId-DOwGbBTQ.js +0 -1
  37. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits.index-DzGjUdAz.js +0 -1
  38. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.conflicts-Cjr34xFt.js +0 -1
  39. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.files-BjjJ4Yb8.js +0 -1
  40. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.index-iY62N_zR.js +0 -1
  41. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId-CrHRklAE.js +0 -1
  42. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits._commitId-WC7fEryq.js +0 -1
  43. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits.index-DzGjUdAz.js +0 -1
  44. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.conflicts-BhUkafpV.js +0 -1
  45. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.files-_RVmv4sD.js +0 -1
  46. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.index-BJrgfbSD.js +0 -1
  47. package/dist/web/assets/_organization.index-hKcWlBrk.js +0 -1
  48. package/dist/web/assets/commit-diff-view-CQeZylif.js +0 -1
  49. package/dist/web/assets/commits-view-B_TQ6AnD.js +0 -13
  50. package/dist/web/assets/conflicts-view-CnGEkjaP.js +0 -8
  51. package/dist/web/assets/dev.diff-DH1qvnWe.js +0 -1
  52. package/dist/web/assets/file-header-keBlejWu.js +0 -49
  53. package/dist/web/assets/files-view-Bu3bjrNf.js +0 -1460
  54. package/dist/web/assets/grammars-DmFYBwmS.js +0 -2
  55. package/dist/web/assets/home-page-Y5jGxOav.js +0 -1
  56. package/dist/web/assets/inbox-jP8QPtzZ.js +0 -1
  57. package/dist/web/assets/index-B297yCgq.js +0 -11
  58. package/dist/web/assets/overview-view-cEOsI9TY.js +0 -2
  59. package/dist/web/assets/pull-request-layout-DsDKURcq.js +0 -35
  60. package/dist/web/assets/routes-BruvNNp9.js +0 -1
  61. package/dist/web/assets/shiki-DueA5xDi.js +0 -1
  62. package/dist/web/assets/shortcut-help-Cb0be4f3.js +0 -1
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Bn as t,Q as n,j as r,pn as i,vn as a,zn as o}from"./index-B297yCgq.js";import{n as s}from"./files-view-Bu3bjrNf.js";import{E as c,M as l,T as u,k as d,w as f}from"./pull-request-layout-DsDKURcq.js";import{n as p}from"./commits-view-B_TQ6AnD.js";var m=e(t(),1),h=o();function g({location:e,commitId:t,shortForm:r}){let i=l(e);return i.data===void 0?(0,h.jsx)(n,{}):(0,h.jsx)(_,{location:e,commitId:t,shortForm:r,pullRequest:i.data},t)}function _({location:e,commitId:t,shortForm:n,pullRequest:r}){let i=(0,m.useMemo)(()=>({organization:e.organization,project:e.project,repositoryId:r.repository.id,pullRequestId:e.pullRequestId}),[e.organization,e.project,e.pullRequestId,r.repository.id]),a=c(i,t);return(0,h.jsx)(s,{location:e,pullRequest:r,source:{kind:`commit`,commitId:t,changeSet:a.data?.changeSet,error:a.error,retry:()=>void a.refetch(),banner:(0,h.jsx)(v,{commitId:t,diff:a.data,location:e,shortForm:n})}})}function v({commitId:e,diff:t,location:n,shortForm:o}){let s=t===void 0?``:f(t.commit.comment),c=t?.commit.parents[0];return(0,h.jsxs)(`div`,{role:`note`,"aria-label":`Commit shown`,className:`mx-5 mt-4 flex min-h-11 shrink-0 flex-wrap items-center gap-x-3 gap-y-1 rounded-[10px] border border-border bg-surface px-3.5 py-2 text-[13px]`,"data-testid":`commit-banner`,children:[(0,h.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,h.jsx)(r,{className:`size-4 text-muted`}),(0,h.jsx)(`span`,{className:`text-muted`,children:`Commit`}),(0,h.jsx)(p,{commitId:e}),(0,h.jsx)(`span`,{className:`min-w-0 truncate font-medium text-fg`,title:s,children:s})]}),(0,h.jsx)(`span`,{className:`text-xs text-muted`,children:t===void 0?`Loading…`:c===void 0?`Root commit: every file is added`:`Compared with its parent ${u(c)} · read-only`}),(0,h.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,h.jsx)(d,{location:n,shortForm:o,page:{tab:`commits`},className:i,children:`All commits`}),(0,h.jsx)(d,{location:n,shortForm:o,page:{tab:`files`},className:a.replace(`h-8`,`h-7`),testId:`back-to-all-changes`,children:`Back to all changes`})]})]})}export{g as t};
@@ -1,13 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{Bn as t,zn as n}from"./index-B297yCgq.js";import{D as r,T as i,k as a,w as o}from"./pull-request-layout-DsDKURcq.js";import{_ as s,g as c,p as l,u,v as d}from"./inbox-jP8QPtzZ.js";var f=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r)setTimeout(function(){r(e)},0);else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h)d[r]=void 0;else{if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},p=new class extends f{};function m(e,t,n){return p.diff(e,t,n)}function h(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function g(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function _(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function v(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function y(e,t){return _(e,t,``)}function b(e,t){return v(e,t,``)}function x(e,t){return t.slice(0,S(e,t))}function S(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function C(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function w(e,t){if(t)return E(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function T(e,t){if(t)return E(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function E(e,t){if(!t)return[T(e),w(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=C(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var D=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,O=RegExp(`[${D}]+|\\s+|[^${D}]`,`ug`);new class extends f{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=C(e,r)}else n=e.match(O)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&k(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&k(n,i,r,null,t.intlSegmenter),e}};function k(e,t,n,r,i){if(t&&n){let[a,o]=E(t.value,i),[s,c]=E(n.value,i);if(e){let r=h(a,s);e.value=v(e.value,s,r),t.value=y(t.value,r),n.value=y(n.value,r)}if(r){let e=g(o,c);r.value=_(r.value,c,e),t.value=b(t.value,e),n.value=b(n.value,e)}}else if(n){if(e){let e=T(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=T(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=T(r.value,i),[a,o]=E(t.value,i),s=h(n,a);t.value=y(t.value,s);let c=g(y(n,s),o);t.value=b(t.value,c),r.value=_(r.value,n,c),e.value=v(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=T(r.value,i),n=x(w(t.value,i),e);t.value=b(t.value,n)}else if(e){let n=x(w(e.value,i),T(t.value,i));t.value=y(t.value,n)}}var A=new class extends f{tokenize(e){let t=RegExp(`(\\r?\\n)|[${D}]+|[^\\S\\n\\r]+|[^${D}]`,`ug`);return e.match(t)||[]}};function j(e,t,n){return A.diff(e,t,n)}var M=new class extends f{constructor(){super(...arguments),this.tokenize=P}equals(e,t,n){return n.ignoreWhitespace?(n.newlineIsToken&&e.includes(`
2
- `)||(e=e.trim()),n.newlineIsToken&&t.includes(`
3
- `)||(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
4
- `)&&(e=e.slice(0,-1)),t.endsWith(`
5
- `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function N(e,t,n){return M.diff(e,t,n)}function P(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
6
- `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function F(e){return e==`.`||e==`!`||e==`?`}new class extends f{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(F(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends f{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends f{constructor(){super(...arguments),this.tokenize=P}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(I(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function I(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=I(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=I(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}var L=new class extends f{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function R(e,t,n){return L.diff(e,t,n)}function z(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function B(e){if(!z(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];t+=e===7?`\\a`:e===8?`\\b`:e===9?`\\t`:e===10?`\\n`:e===11?`\\v`:e===12?`\\f`:e===13?`\\r`:e===34?`\\"`:e===92?`\\\\`:e>=32&&e<=126?String.fromCharCode(e):`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var V={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0},H={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0};function U(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;N(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(N(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||K(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s){if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
7
- `)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function W(e,t){if(t||=V,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>W(e,t)).join(`
8
- `)}let n=[];if(e.isGit){if(t=V,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+B(r)+` `+B(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+B((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+B((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+B((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+B((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+B(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+B(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
9
- `)+`
10
- `}function G(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;U(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?W(e,o.headerOptions):void 0)}}))}else{let s=U(e,t,n,r,i,a,o);return s?W(s,o?.headerOptions):void 0}}function K(e){let t=e.endsWith(`
11
- `),n=e.split(`
12
- `).map(e=>e+`
13
- `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var q=e(t(),1),J=n();function Y({location:e,shortForm:t,scope:n,variant:i=`page`,currentCommit:a=null}){let o=r(n),s=(0,q.useMemo)(()=>o.data?.pages.flatMap(e=>e.commits)??[],[o.data]),c=i===`sidebar`,d;return d=o.isPending?(0,J.jsx)(u,{label:`Loading commits`,lines:4}):o.data===void 0?(0,J.jsx)(l,{what:`The commits could not be loaded.`,error:o.error,onRetry:()=>void o.refetch()}):s.length===0?(0,J.jsx)(`p`,{className:`text-[13px] text-muted`,children:`This pull request has no commits.`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`ol`,{"aria-label":`Commits`,className:c?`space-y-px`:`overflow-hidden rounded-[10px] border border-border bg-surface`,"data-testid":`commit-list`,children:s.map(n=>c?(0,J.jsx)(Z,{commit:n,location:e,shortForm:t,current:n.commitId===a},n.commitId):(0,J.jsx)(X,{commit:n,location:e,shortForm:t},n.commitId))}),o.isFetchNextPageError&&(0,J.jsxs)(`p`,{role:`alert`,className:`mt-2 text-xs text-danger`,children:[`The next commits could not be loaded. `,o.error?.message]}),o.hasNextPage&&(0,J.jsx)(`button`,{type:`button`,onClick:()=>void o.fetchNextPage(),disabled:o.isFetchingNextPage,className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-8 px-3 border border-border bg-raised text-fg hover:border-border-strong hover:bg-hover mt-3 ${c?`mx-2 h-7 text-xs`:``}`,"data-testid":`load-more-commits`,children:o.isFetchingNextPage?`Loading…`:`Load more commits`})]}),(0,J.jsx)(`section`,{"aria-label":`Commits`,"data-testid":`commits`,className:c?`px-2`:``,children:d})}function X({commit:e,location:t,shortForm:n}){let r=o(e.comment),i=e.author??e.committer,l=i?.date??null;return(0,J.jsxs)(`li`,{className:`flex min-w-0 items-center gap-3 border-t border-border px-3.5 py-2.5 first:border-t-0`,"data-testid":`commit`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(a,{location:t,shortForm:n,page:{tab:`commit`,commitId:e.commitId},className:`block truncate text-[14px] font-medium text-fg hover:underline`,children:r.length>0?r:`(no message)`}),(0,J.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-muted`,children:[i?.name??`Unknown author`,l!==null&&(0,J.jsxs)(J.Fragment,{children:[` · `,(0,J.jsx)(`time`,{dateTime:l,title:c(l),children:s(l)})]})]})]}),(0,J.jsx)(Q,{commitId:e.commitId})]})}function Z({commit:e,location:t,shortForm:n,current:r}){let s=o(e.comment),l=e.author??e.committer,u=l?.date??null;return(0,J.jsx)(`li`,{"data-testid":`commit`,children:(0,J.jsxs)(a,{location:t,shortForm:n,page:{tab:`commit`,commitId:e.commitId},current:r,title:s,className:`block rounded-[7px] px-2 py-1.5 hover:bg-hover aria-[current=page]:bg-[var(--azd-selected)]`,children:[(0,J.jsx)(`span`,{className:`block truncate text-[13px] text-fg`,children:s.length>0?s:`(no message)`}),(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted`,children:[(0,J.jsx)(`span`,{className:`font-mono`,children:i(e.commitId)}),(0,J.jsxs)(`span`,{className:`min-w-0 truncate`,children:[`· `,l?.name??`Unknown author`]}),u!==null&&(0,J.jsx)(`time`,{className:`ml-auto shrink-0`,dateTime:u,title:c(u),children:d(u)})]})]})})}function Q({commitId:e}){let[t,n]=(0,q.useState)(!1);return(0,J.jsx)(`button`,{type:`button`,title:`Copy the full commit id`,"aria-label":`Copy commit id ${i(e)}`,onClick:()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),window.setTimeout(()=>n(!1),1200)},()=>n(!1))},className:`inline-flex h-6 shrink-0 items-center rounded-md border border-border bg-raised px-1.5 font-mono text-xs text-fg hover:border-border-strong`,"data-testid":`commit-hash`,children:t?`Copied`:i(e)})}export{R as a,G as i,Q as n,j as o,H as r,m as s,Y as t};
@@ -1,8 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-BLXQ4ufn.js";import{$ as t,Bn as n,E as r,Ht as i,J as a,Lt as o,Nn as s,R as c,Rt as l,S as u,T as d,U as f,Ut as p,X as m,Y as h,_n as g,ft as _,lt as v,mt as y,nt as b,pn as x,rt as S,un as C,vn as w,w as T,yn as E,zn as D}from"./index-B297yCgq.js";import{r as ee,t as O}from"./shortcut-help-Cb0be4f3.js";import{A as te,B as ne,C as re,H as k,N as A,O as j,S as M,U as N,V as P,W as ie,_ as F,b as ae,g as I,j as L,k as R,nt as oe,r as se,s as z,v as ce}from"./pull-request-layout-DsDKURcq.js";import{n as B}from"./inbox-jP8QPtzZ.js";import{a as V,o as le}from"./commits-view-B_TQ6AnD.js";var H=e(n(),1);function U(e){let t=[e.base,e.source,e.target].map(e=>e.join(`
2
- `)).join(`\0`),n=0x811c9dc5;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619)>>>0;return`${n.toString(16)}:${t.length}`}function ue(e,t,n){let r={},i={};for(let e of t){let t=n.decisions[e.index];if(t===void 0)continue;let a=U(e);r[a]=t;let o=n.auto?.[e.index];o!==void 0&&(i[a]=o)}return Object.keys(r).length===0&&n.wholeFile===null&&n.fileEdit===null?null:{fileKey:e,regions:r,...Object.keys(i).length===0?{}:{auto:i},wholeFile:n.wholeFile,fileEdit:n.fileEdit}}function de(e,t,n){let r={},i={},a=new Set;for(let t of n){let n=U(t),o=e.regions[n];if(o!==void 0){r[t.index]=o,a.add(n);let s=e.auto?.[n];s!==void 0&&(i[t.index]=s)}}let o=e.fileKey===t,s=Object.keys(e.regions).filter(e=>!a.has(e)).length+ +(!o&&(e.wholeFile!==null||e.fileEdit!==null));return{choices:{decisions:r,wholeFile:o?e.wholeFile:null,fileEdit:o?e.fileEdit:null,...Object.keys(i).length===0?{}:{auto:i}},dropped:s}}function fe(e){return`azdiffs:conflicts:${e.organization.toLowerCase()}:${e.repositoryId.toLowerCase()}:${e.pullRequestId}`}function pe(e,t){let n=fe(t),r=null,i=()=>{if(r!==null)return r;r={};try{let t=e?.getItem(n)??null,i=t===null?null:JSON.parse(t);if(W(i))for(let[e,t]of Object.entries(i)){let n=be(t);n!==null&&(r[e]=n)}}catch{}return r},a=()=>{let t=i();try{Object.keys(t).length===0?e?.removeItem(n):e?.setItem(n,JSON.stringify(t))}catch{}};return{read:e=>i()[e]??null,write(e,t){let n=i();if(t===null){if(!(e in n))return;delete n[e]}else n[e]=t;a()}}}function me(){try{return globalThis.localStorage??null}catch{return null}}var he=new Set([`different-lines`,`same-change`,`formatting-only`]);function W(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ge=e=>e===`source`||e===`target`,_e=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),ve=e=>Array.isArray(e)&&e.every(e=>Number.isSafeInteger(e)&&e>=0);function ye(e){if(!W(e))return null;switch(e.kind){case`combine`:case`source`:case`target`:return{kind:e.kind};case`both`:return ge(e.first)?{kind:`both`,first:e.first}:null;case`lines`:return ve(e.source)&&ve(e.target)?{kind:`lines`,source:e.source,target:e.target}:null;case`edited`:return _e(e.lines)?{kind:`edited`,lines:e.lines}:null;default:return null}}function be(e){if(!W(e)||typeof e.fileKey!=`string`||!W(e.regions))return null;let t={};for(let[n,r]of Object.entries(e.regions)){let e=ye(r);e!==null&&(t[n]=e)}let n={};if(W(e.auto))for(let[t,r]of Object.entries(e.auto))W(r)&&he.has(String(r.reason))&&(n[t]={reason:r.reason,dropped:ge(r.dropped)?r.dropped:null});return{fileKey:e.fileKey,regions:t,...Object.keys(n).length===0?{}:{auto:n},wholeFile:ge(e.wholeFile)?e.wholeFile:null,fileEdit:_e(e.fileEdit)?e.fileEdit:null}}function xe(e,t){let n=Array(e.length).fill(-1),r=0,i=0;for(let a of V(e,t)){let e=a.count??a.value.length;if(a.added)i+=e;else if(a.removed)r+=e;else{for(let t=0;t<e;t++)n[r+t]=i+t;r+=e,i+=e}}return n}function Se(e,t){let n=[],r=0,i=null;for(let a of V(e,t)){let e=a.count??a.value.length;!a.added&&!a.removed?(i!==null&&n.push(i),i=null,r+=e):(i??={start:r,end:r,lines:[]},a.removed?(r+=e,i.end=r):i.lines.push(...a.value))}return i!==null&&n.push(i),n}function Ce(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function we(e,t,n){let r=xe(e,t),i=xe(e,n),a=[],o=0,s=[],c=1,l=()=>{s.length>0&&a.push({kind:`clean`,origin:`unchanged`,lines:s,baseLine:c}),s=[]},u=0,d=0,f=0;for(;u<=e.length;){let p=u;for(;p<e.length&&((r[p]??-1)<0||(i[p]??-1)<0);)p++;let m=p<e.length?r[p]??t.length:t.length,h=p<e.length?i[p]??n.length:n.length,g=e.slice(u,p),_=t.slice(d,m),v=n.slice(f,h);if(g.length>0||_.length>0||v.length>0){let e=Ce(_,g),t=Ce(v,g);if(e&&t)s.length===0&&(c=u+1),s.push(...g);else if(e||t||Ce(_,v)){l();let n=e?`target`:t?`source`:`both`;a.push({kind:`clean`,origin:n,lines:e?v:_,baseLine:u+1})}else l(),a.push({kind:`conflict`,index:o++,base:g,source:_,target:v,baseLine:u+1,sourceHunks:Se(g,_),targetHunks:Se(g,v),hasBase:!0})}if(p>=e.length)break;s.length===0&&(c=p+1),s.push(e[p]??``),u=p+1,d=m+1,f=h+1}return l(),a}function Te(e,t){let n=[],r=0,i=[],a=[],o=1,s=1,c=()=>{(i.length!==0||a.length!==0)&&(n.push({kind:`conflict`,index:r++,base:[],source:i,target:a,baseLine:s,sourceHunks:i.length>0?[{start:0,end:0,lines:i}]:[],targetHunks:a.length>0?[{start:0,end:0,lines:a}]:[],hasBase:!1}),i=[],a=[])};for(let r of V(e,t)){let e=r.value;r.removed||r.added?(i.length===0&&a.length===0&&(s=o),r.removed?i.push(...e):(a.push(...e),o+=e.length)):(c(),n.push({kind:`clean`,origin:`both`,lines:e,baseLine:0}),o+=e.length)}return c(),n}function Ee(e,t,n){return e===null?Te(t,n):we(e,t,n)}function De(e){return e.filter(e=>e.kind===`conflict`)}function Oe(e,t){let n=t===`source`?e.source:e.target,r=t===`source`?e.sourceHunks:e.targetHunks,i=[],a=0,o=0,s=e=>{for(;a<e;)i.push({index:o,text:n[o]??``,changed:!1,baseText:null}),a++,o++};for(let t of r)s(t.start),t.lines.forEach((n,r)=>{let a=t.start+r<t.end?e.base[t.start+r]??null:null;i.push({index:o,text:n,changed:!0,baseText:a}),o++}),a=t.end;return s(e.base.length),i}function ke(e,t){return e.start===e.end||t.start===t.end?e.start<=t.end&&t.start<=e.end:e.start<t.end&&t.start<e.end}function Ae(e){if(!e.hasBase)return{ok:!1,reason:`No common version to combine from`};for(let t of e.sourceHunks)for(let n of e.targetHunks)if(ke(t,n))return{ok:!1,reason:`Both changed line ${e.baseLine+Math.max(t.start,n.start)}`};let t=[...e.sourceHunks.map(e=>({hunk:e,origin:`source`})),...e.targetHunks.map(e=>({hunk:e,origin:`target`}))].sort((e,t)=>e.hunk.start-t.hunk.start||(e.origin===`source`?-1:1)),n=[],r=0;for(let{hunk:i,origin:a}of t){for(;r<i.start;)n.push({text:e.base[r++]??``,origin:`base`});for(let e of i.lines)n.push({text:e,origin:a});r=Math.max(r,i.end)}for(;r<e.base.length;)n.push({text:e.base[r++]??``,origin:`base`});return{ok:!0,lines:n}}function je(e,t){let n=[],r=r=>{let i=r===`source`?e.sourceHunks:e.targetHunks,a=new Set(r===`source`?t.source:t.target),o=0,s=0;for(let e of i)o+=e.start-s,e.lines.forEach((t,i)=>{if(a.has(o)){let a=e.start===e.end?e.start-.5:e.start+Math.min(i,e.end-e.start-1);n.push({position:a,order:(r===`source`?0:1)*1e6+o,line:{text:t,origin:r}})}o++}),s=e.end};if(r(`source`),r(`target`),!e.hasBase)return n.sort((e,t)=>e.order-t.order).map(e=>e.line);n.sort((e,t)=>e.position-t.position||e.order-t.order);let i=[],a=0,o=e=>{let t=[];for(;a<n.length;){let r=n[a];if(r===void 0||!e(r.position))break;t.push(r.line),a++}return t};for(let t=0;t<=e.base.length&&(i.push(...o(e=>e<t)),t!==e.base.length);t++){let n=o(e=>e===t);n.length>0?i.push(...n):i.push({text:e.base[t]??``,origin:`base`})}return i}function Me(e,t){if(e===null)return[{text:t,changed:!0}];let n=[];for(let r of le(e,t)){if(r.removed)continue;let e=n.at(-1),t=r.added===!0;e!==void 0&&e.changed===t?e.text+=r.value:n.push({text:r.value,changed:t})}return n}var Ne=/^\s*["']?([A-Za-z_][\w.-]*)["']?\s*[:=]/,Pe=/\b(?:function|def|class|const|let|var|fn|func|type|interface)\s+([A-Za-z_$][\w$]*)/;function Fe(e){return Ne.exec(e)?.[1]??Pe.exec(e)?.[1]??null}function Ie(e){let t=t=>Oe(e,t).find(e=>e.changed)?.text??null,n=t(`source`),r=t(`target`);if(n===null||r===null)return null;let i=Fe(n);return i!==null&&i===Fe(r)?i:null}var Le={decisions:{},wholeFile:null,fileEdit:null};function Re(e=Le){return{current:e,history:[]}}function G(e,t){let{auto:n,...r}=t;return{current:n!==void 0&&Object.keys(n).length>0?t:r,history:[...e.history,e.current].slice(-100)}}function ze(e,t){let{current:n}=e;switch(t.type){case`decide`:return G(e,{decisions:{...n.decisions,[t.region]:t.decision},wholeFile:null,fileEdit:null,auto:Be(n.auto,t.region)});case`fill`:{if(t.fills.length===0)return e;let r={...n.decisions},i={...n.auto};for(let e of t.fills)r[e.region]=e.decision,i[e.region]={reason:e.reason,dropped:e.dropped};return G(e,{decisions:r,wholeFile:null,fileEdit:null,auto:i})}case`toggle-line`:{let r=n.decisions[t.region],i=r?.kind===`lines`?{source:r.source,target:r.target}:{source:[],target:[]},a=i[t.side],o=a.includes(t.index)?a.filter(e=>e!==t.index):[...a,t.index].sort((e,t)=>e-t),s={...i,[t.side]:o},c={...n.decisions};return s.source.length===0&&s.target.length===0?delete c[t.region]:c[t.region]={kind:`lines`,...s},G(e,{decisions:c,wholeFile:null,fileEdit:null,auto:Be(n.auto,t.region)})}case`whole-file`:return G(e,{...n,wholeFile:t.side,fileEdit:null,auto:{}});case`edit-file`:return G(e,{...n,wholeFile:null,fileEdit:t.lines,auto:{}});case`reset`:return G(e,Le);case`undo`:{let t=e.history.at(-1);return t===void 0?e:{current:t,history:e.history.slice(0,-1)}}}}function Be(e,t){let n={...e};return delete n[t],n}function Ve(e,t){let n=new Set([...Object.keys(e.decisions).map(Number),...Object.keys(t.decisions).map(Number)]);for(let r of[...n].sort((e,t)=>e-t))if(JSON.stringify(e.decisions[r])!==JSON.stringify(t.decisions[r]))return r;return null}function K(e,t){switch(t.kind){case`combine`:{let t=Ae(e);return t.ok?t.lines:null}case`source`:return e.source.map(e=>({text:e,origin:`source`}));case`target`:return e.target.map(e=>({text:e,origin:`target`}));case`both`:{let n=e.source.map(e=>({text:e,origin:`source`})),r=e.target.map(e=>({text:e,origin:`target`}));return t.first===`source`?[...n,...r]:[...r,...n]}case`lines`:return je(e,t);case`edited`:return t.lines.map(e=>({text:e,origin:`edited`}))}}function He(e,t,n){if(t.wholeFile!==null){let e=t.wholeFile;return{lines:n[e].map(t=>({text:t,origin:e})),undecided:[]}}if(t.fileEdit!==null)return{lines:t.fileEdit.map(e=>({text:e,origin:`edited`})),undecided:[]};let r=[],i=[];for(let a of e){if(a.kind===`clean`){let e=a.origin===`source`||a.origin===`target`?a.origin:`base`;r.push(...a.lines.map(t=>({text:t,origin:e})));continue}let e=t.decisions[a.index],o=e===void 0?null:K(a,e);o===null?(i.push(a.index),r.push(...Ue(a,n.labels))):r.push(...o)}return{lines:r,undecided:i}}function Ue(e,t){return[{text:`<<<<<<< ${t.source}`,origin:`edited`},...e.source.map(e=>({text:e,origin:`source`})),{text:`=======`,origin:`edited`},...e.target.map(e=>({text:e,origin:`target`})),{text:`>>>>>>> ${t.target}`,origin:`edited`}]}var We=/^(<{7} |={7}$|>{7} )/;function Ge(e){let t=e.findIndex(e=>We.test(e));return t<0?null:t+1}function q(e,t,n){if(t.wholeFile!==null||t.fileEdit!==null)return null;let r=e.filter(e=>{let n=t.decisions[e.index];return n===void 0||K(e,n)===null}).map(e=>e.index);return r.find(e=>e>n)??r[0]??null}function Ke(e,t){return q(e,t,-1)===null}function qe(e,t){switch(e.kind){case`combine`:return`Combined both changes`;case`source`:return`Used ${t.source}`;case`target`:return`Used ${t.target}`;case`both`:return`Used both, ${t[e.first]} first`;case`lines`:{let t=e.source.length+e.target.length;return`Picked ${t} ${t===1?`line`:`lines`}`}case`edited`:return`Edited by hand`}}var Je=e=>e.map(e=>e.replace(/\s+/g,``)),Ye=(e,t)=>{let n=Je(e),r=Je(t);return n.length===r.length&&n.every((e,t)=>e===r[t])};function Xe(e){if(Ae(e).ok)return{decision:{kind:`combine`},reason:`different-lines`,dropped:null};if(Ye(e.source,e.target))return{decision:{kind:`target`},reason:`same-change`,dropped:null};if(!e.hasBase)return null;let t=Ye(e.source,e.base),n=Ye(e.target,e.base);return t&&!n?{decision:{kind:`target`},reason:`formatting-only`,dropped:`source`}:n&&!t?{decision:{kind:`source`},reason:`formatting-only`,dropped:`target`}:null}function Ze(e,t){if(t.wholeFile!==null||t.fileEdit!==null)return[];let n=[];for(let r of e){let e=t.decisions[r.index];if(e!==void 0&&K(r,e)!==null)continue;let i=Xe(r);i!==null&&n.push({...i,region:r.index})}return n}function Qe(e){return`${e.baseBlob??``}:${e.sourceBlob}:${e.targetBlob}`}async function $e(e,t,n){let r={filled:0,files:0,left:0};for(let i of e){if(i.kind!==`content`||i.resolutionStatus===`resolved`)continue;let[e,a,o]=await Promise.all([i.baseBlob===null?null:t(i.baseBlob),t(i.sourceBlob),t(i.targetBlob)]);if(a.kind!==`text`||o.kind!==`text`||e!==null&&e.kind!==`text`)continue;let s=De(Ee(e?.file.lines??null,a.file.lines,o.file.lines)),c=Qe(i),l=n.read(i.path),u=l===null?Le:de(l,c,s).choices,d=Ze(s,u),f=ze(Re(u),{type:`fill`,fills:d}).current,p=s.filter(e=>f.decisions[e.index]===void 0);r.left+=f.wholeFile===null&&f.fileEdit===null?p.length:0,d.length!==0&&(n.write(i.path,ue(c,s,f)),r.filled+=d.length,r.files+=1)}return r}var et=(e,t)=>e!==null&&t!==null&&e.toLowerCase()===t.toLowerCase();async function tt(e,t){let{conflict:n}=t,r,i;try{[r,i]=await Promise.all([e.pullRequest(),e.conflicts()])}catch(e){return{kind:`failed`,error:e,sent:!1,saved:!1}}if(!et(r.lastMergeSourceCommit,n.mergeSourceCommit))return{kind:`stale`,pullRequest:r,branch:r.sourceBranch};if(!et(r.lastMergeTargetCommit,n.mergeTargetCommit))return{kind:`stale`,pullRequest:r,branch:r.targetBranch};let a=i.find(e=>e.conflictId===n.conflictId);if(a===void 0)return{kind:`gone`};let o=a.resolvedBy;if(a.resolutionStatus===`resolved`&&n.resolutionStatus!==`resolved`&&o!==null&&!et(o.id,t.currentUserId)&&!t.replaceConfirmed)return{kind:`confirm-replace`,by:o,date:a.resolvedDate};try{return{kind:`saved`,conflict:await e.resolve(t.resolution)}}catch(t){try{let r=(await e.conflicts()).find(e=>e.conflictId===n.conflictId);return r===void 0?{kind:`failed`,error:t,sent:!0,saved:null}:a.resolutionStatus!==`resolved`&&r.resolutionStatus===`resolved`?{kind:`saved`,conflict:r}:{kind:`failed`,error:t,sent:!0,saved:r.resolutionStatus!==a.resolutionStatus&&null}}catch{return{kind:`failed`,error:t,sent:!0,saved:null}}}}function nt(e,t){let n=`Your choices are kept.`,r=C(e.error,`unauthorized`);return r||C(e.error,`network`)?e.sent?e.saved===!1||r?t.method===`pat`?`Azure DevOps refused the save without saying why, and nothing was saved. Your token can read this pull request but probably cannot write: a Personal Access Token needs Code (Read & write). ${n}`:`Azure DevOps refused the save without saying why, and nothing was saved. Your account may not be allowed to contribute to this pull request. ${n}`:`Could not reach Azure DevOps. The resolution may have been saved; the list was reloaded. ${n}`:`Could not reach Azure DevOps; nothing was saved. ${n}`:t.describe(e.error).replace(`Your text is kept`,`Your choices are kept`)}function rt(e){return e.split(`/`).filter(e=>e.length>0).at(-1)??e}function it(e){return(Array.from(e).find(e=>/\p{L}|\p{N}/u.test(e))??`?`).toUpperCase()}function at(e,t){let n=rt(e),r=rt(t);r===n&&(r=t);let i=it(n),a=it(rt(t)),o=i===a;return{source:e,target:t,letters:{source:o?`S`:i,target:o?`T`:a},short:{source:n,target:r}}}function ot(e,t){let{source:n,target:r}=t.short;switch(e.type){case`editEdit`:return`Both changed`;case`addAdd`:return`Added on both`;case`editDelete`:return`Changed in ${n}, deleted in ${r}`;case`deleteEdit`:return`Deleted in ${n}, changed in ${r}`;case`rename1to2`:return`Renamed differently on each side`;case`rename2to1`:return`Two files renamed to the same name`;case`renameRename`:return`Renamed on both sides`;case`renameAdd`:return`Renamed in ${n}, added in ${r}`;case`addRename`:return`Added in ${n}, renamed in ${r}`;case`renameDelete`:return`Renamed in ${n}, deleted in ${r}`;case`deleteRename`:return`Deleted in ${n}, renamed in ${r}`;case`directoryFile`:case`fileDirectory`:case`directoryChild`:return`A file and a folder share this name`;case`none`:return`A conflict azdiffs cannot read`}}function st(e,t){if(e.kind!==`unsupported`)return``;let n=e=>e===null?null:e.split(`/`).at(-1)??e,r=n(e.sourceNewPath),i=n(e.targetNewPath);return e.type===`rename1to2`&&r!==null&&i!==null?`${t.short.source} renamed it to ${r}, ${t.short.target} to ${i}.`:ot(e,t)}function ct(e,t){let{source:n,target:r}=t.short;if(e.kind===`content`)switch(e.mergeType){case`takeSourceContent`:return`Used ${n}'s file`;case`takeTargetContent`:return`Used ${r}'s file`;case`userMerged`:case`autoMerged`:return`Merged content`;case`undecided`:return null}return e.kind===`pickOne`?e.action===`undecided`?null:e.type===`editDelete`==(e.action===`pickSourceAction`)?`Kept the file, ${e.type===`editDelete`?n:r}'s version`:`Deleted the file`:null}function lt(e,t){switch(e.reason){case`different-lines`:return`The branches changed different lines: combined`;case`same-change`:return`Same change on both; kept ${t.short.target}'s formatting`;case`formatting-only`:{let n=e.dropped??`source`,r=n===`source`?`target`:`source`;return`${t.short[n]} only changed whitespace here; used ${t.short[r]}`}}}function ut(e,t=Date.now()){if(e===null)return``;let n=Date.parse(e);if(Number.isNaN(n))return``;let r=Math.max(0,Math.round((t-n)/6e4));if(r<1)return`just now`;if(r<60)return`${r} min ago`;let i=Math.round(r/60);return i<24?`${i} h ago`:new Date(n).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}var J=D(),dt={source:`azd-chip-source`,target:`azd-chip-target`},ft={source:`bg-side-source`,target:`bg-side-target`},pt={source:`azd-row-source`,target:`azd-row-target`},mt={source:`azd-mark-source`,target:`azd-mark-target`};function ht({side:e,names:t,short:n=!1}){let r=n?t.short[e]:t[e];return(0,J.jsxs)(`span`,{className:`inline-flex max-w-full min-w-0 items-center gap-1.5 rounded-full py-px pr-2 pl-1 font-mono text-xs ${dt[e]}`,title:t[e],children:[(0,J.jsx)(gt,{side:e,names:t}),(0,J.jsx)(`span`,{className:`truncate`,children:r})]})}function gt({side:e,names:t}){return(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`inline-grid size-4 shrink-0 place-items-center rounded-full font-sans text-[10px] leading-none font-semibold text-[var(--azd-canvas)] ${ft[e]}`,children:t.letters[e]})}function _t({origin:e,names:t}){return e===`source`||e===`target`?(0,J.jsxs)(`span`,{className:`inline-flex w-4 justify-center font-sans text-[11px] font-semibold ${e===`source`?`text-side-source`:`text-side-target`}`,title:`From ${t[e]}`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,children:t.letters[e]}),(0,J.jsxs)(`span`,{className:`sr-only`,children:[`from `,t[e],`: `]})]}):e===`edited`?(0,J.jsxs)(`span`,{className:`inline-flex text-muted`,title:`Edited by hand`,children:[(0,J.jsx)(f,{className:`size-3.5`}),(0,J.jsx)(`span`,{className:`sr-only`,children:`edited: `})]}):(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block size-4`})}function Y({children:e}){return(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`rounded border border-border-strong px-1 font-mono text-[10px] leading-4 font-normal text-muted`,children:e})}function X({number:e,tag:t,tone:n,children:r,dim:i=!1,struck:a=!1,tagless:o=!1}){return(0,J.jsxs)(`div`,{className:`grid min-h-6 ${o?`grid-cols-[2.75rem_minmax(0,1fr)]`:`grid-cols-[2.75rem_1.5rem_minmax(0,1fr)]`} items-start font-mono text-xs leading-6 ${n??``} ${i?`text-muted`:`text-fg`}`,children:[(0,J.jsx)(`span`,{className:`pr-2.5 text-right text-[11px] text-muted tabular-nums select-none`,children:e}),!o&&(0,J.jsx)(`span`,{className:`flex h-6 items-center`,children:t}),(0,J.jsx)(`span`,{className:`pr-3 break-words whitespace-pre-wrap ${a?`line-through decoration-[var(--azd-muted)] opacity-70`:``}`,children:r})]})}function vt({segments:e,side:t}){return(0,J.jsx)(J.Fragment,{children:e.map((e,n)=>e.changed&&e.text.trim().length>0?(0,J.jsxs)(`mark`,{className:`text-inherit ${mt[t]}`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`changed: `}),e.text]},n):(0,J.jsx)(`span`,{children:e.text},n))})}function Z(e){return e.length===0?` `:e}function yt(e){let t=e.lastIndexOf(`/`);return{name:e.slice(t+1),folder:t>0?e.slice(1,t+1):``}}function Q({conflict:e,names:t,progress:n,tools:r,save:i,markRef:a,blockedReason:o,onMarkResolved:s,showMark:c=!0,footer:l,children:u}){let{name:d,folder:f}=yt(e.path);return(0,J.jsxs)(`article`,{"aria-label":e.path,className:`overflow-hidden rounded-[10px] bg-surface shadow-[0_0_0_1px_var(--azd-border)]`,"data-testid":`conflict-file`,"data-path":e.path,children:[(0,J.jsxs)(`header`,{className:`flex min-h-11 flex-wrap items-center gap-x-2.5 gap-y-1 border-b border-border bg-header py-1.5 pr-2.5 pl-3.5`,children:[(0,J.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-1.5 text-[13px]`,title:e.path,children:[f.length>0&&(0,J.jsx)(`span`,{className:`truncate text-muted`,children:f}),(0,J.jsx)(`span`,{className:`font-semibold text-fg-strong`,children:d})]}),(0,J.jsx)(`span`,{className:`rounded-full border border-border bg-raised px-2 py-px text-xs text-warning`,children:ot(e,t)}),n!==void 0&&(0,J.jsx)(`span`,{className:`text-xs text-muted tabular-nums`,"data-testid":`conflict-file-progress`,children:n}),(0,J.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center justify-end gap-1`,children:[r,c&&o!==null&&(0,J.jsx)(`span`,{className:`px-1.5 text-xs text-muted`,"data-testid":`mark-resolved-reason`,children:o}),c&&(0,J.jsxs)(`button`,{ref:a,type:`button`,onClick:s,disabled:o!==null||i.busy,"aria-describedby":o===null?void 0:`azd-mark-reason`,className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-8 px-3 bg-primary text-primary-fg hover:opacity-90 h-7 px-2.5`,"data-testid":`mark-resolved`,children:[i.busy?`Saving…`:`Mark resolved`,!i.busy&&(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`rounded border border-[color-mix(in_srgb,var(--azd-primary-fg)_30%,transparent)] px-1 font-mono text-[10px] leading-4 font-normal opacity-70`,children:`⌘↵`})]}),c&&o!==null&&(0,J.jsx)(`span`,{id:`azd-mark-reason`,className:`sr-only`,children:o})]})]}),i.problem!==null&&(0,J.jsx)(`p`,{role:`alert`,className:`border-b border-border px-3.5 py-2 text-[13px] text-danger`,"data-testid":`save-problem`,children:i.problem}),u,(0,J.jsx)(bt,{...l})]})}function bt({next:e,regionKeys:t}){return(0,J.jsxs)(`footer`,{className:`flex flex-wrap items-center gap-x-3.5 gap-y-1 bg-header px-3.5 py-2 text-xs text-muted`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-x-3.5 gap-y-1`,children:[t&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`span`,{children:[(0,J.jsx)(Y,{children:`n`}),` `,(0,J.jsx)(Y,{children:`p`}),` next / previous conflict`]}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(Y,{children:`1`}),` `,(0,J.jsx)(Y,{children:`2`}),` `,(0,J.jsx)(Y,{children:`3`}),` use one side / both`]}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(Y,{children:`space`}),` pick line`]})]}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(Y,{children:`j`}),` `,(0,J.jsx)(Y,{children:`k`}),` files`]}),(0,J.jsxs)(`span`,{children:[(0,J.jsx)(Y,{children:`?`}),` all keys`]})]}),e!==null&&(0,J.jsxs)(`button`,{type:`button`,onClick:e.onSelect,className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-7 px-2 text-muted hover:bg-hover hover:text-fg ml-auto h-6`,"data-testid":`next-file`,children:[`Next: `,yt(e.path).name,(0,J.jsx)(r,{className:`size-3.5`})]})]})}function xt(e){return e===void 0||e.kind===`edited`?null:e.kind}function St({region:e,count:t,decision:n,names:r,active:i,expanded:a,showOriginal:o,editing:s,canUndo:c,headerRef:l,intents:u,onToggleOriginal:d,onExpand:f,onEdit:p,onEditDone:h,auto:g}){let _=(0,H.useId)(),v=n===void 0?null:K(e,n),y=v!==null,b=Ae(e),S=Ie(e),C=Ct(e),w=y?qe(n,r.short):null;return y&&!a&&!s?(0,J.jsxs)(`fieldset`,{"aria-labelledby":_,className:`min-w-0 border-b border-border`,"data-testid":`conflict-region-${e.index}`,"data-state":`decided`,children:[(0,J.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1 px-3.5 py-2`,children:[(0,J.jsx)(T,{className:`size-3.5 text-added`}),(0,J.jsxs)(`h3`,{id:_,ref:l,tabIndex:-1,className:`text-[13px] font-medium text-fg outline-none`,children:[C,(0,J.jsxs)(`span`,{className:`sr-only`,children:[`, conflict `,e.index+1,` of `,t,`, resolved`]})]}),(0,J.jsx)(`span`,{className:`text-xs text-muted`,children:w}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>{f(),u.focus()},className:`${x} ml-auto`,children:`Change`})]}),(0,J.jsx)(Dt,{lines:v,names:r,startLine:e.baseLine})]}):(0,J.jsxs)(`fieldset`,{"aria-labelledby":_,className:`min-w-0 border-b border-border ${i&&t>1?`outline-2 -outline-offset-2 outline-[var(--azd-accent)]`:``}`,"data-testid":`conflict-region-${e.index}`,"data-state":y?`decided`:`open`,onFocusCapture:u.focus,children:[(0,J.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1 px-3.5 py-2`,children:[y?(0,J.jsx)(T,{className:`size-3.5 text-added`}):(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-warning`}),(0,J.jsxs)(`h3`,{id:_,ref:l,tabIndex:-1,className:`text-[13px] font-medium text-fg outline-none`,children:[C,(0,J.jsxs)(`span`,{className:`sr-only`,children:[`, conflict `,e.index+1,` of `,t,y?`, resolved`:``]})]}),g!==void 0&&(0,J.jsxs)(`span`,{className:`rounded-full border border-border bg-raised px-2 py-px text-xs text-fg`,"data-testid":`auto-filled`,children:[`Auto-filled`,(0,J.jsxs)(`span`,{className:`text-muted`,children:[` · `,g]})]}),(0,J.jsx)(`span`,{className:`text-xs text-muted ${g===void 0?``:`sr-only`}`,children:e.hasBase?S===null?`Both branches changed these lines`:(0,J.jsxs)(J.Fragment,{children:[`Both branches changed `,(0,J.jsx)(`span`,{className:`font-mono text-fg`,children:S})]}):`The two versions differ here`}),e.hasBase&&(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":o,onClick:d,className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-7 px-2 text-muted hover:bg-hover hover:text-fg ml-auto aria-pressed:text-fg`,children:[o?`Hide original`:`Show original`,` `,(0,J.jsx)(Y,{children:`o`})]})]}),o&&e.hasBase&&(0,J.jsxs)(`div`,{className:`border-t border-border bg-canvas`,"data-testid":`conflict-original`,children:[(0,J.jsx)(`p`,{className:`px-3.5 pt-1.5 text-xs text-muted`,children:`Original (before either branch)`}),(0,J.jsx)(`div`,{className:`pb-1`,children:e.base.length===0?(0,J.jsx)(`p`,{className:`px-3.5 pb-1 text-xs text-muted`,children:`No lines (both branches added here)`}):e.base.map((t,n)=>(0,J.jsx)(X,{number:e.baseLine+n,dim:!0,struck:!0,children:Z(t)},n))})]}),(0,J.jsxs)(`div`,{className:`grid grid-cols-1 border-t border-border @3xl:grid-cols-2`,children:[(0,J.jsx)(Tt,{side:`source`,caption:`this pull request`,region:e,decision:n,names:r,onToggle:e=>u.toggleLine(`source`,e)}),(0,J.jsx)(Tt,{side:`target`,caption:`target`,region:e,decision:n,names:r,onToggle:e=>u.toggleLine(`target`,e)})]}),(0,J.jsx)(Et,{region:e,decision:n,names:r,combineReason:b.ok?null:e.hasBase?b.reason:null,canCombine:b.ok,onDecide:u.decide,onEdit:p}),(0,J.jsxs)(`div`,{className:`mx-3.5 mb-3.5 overflow-hidden rounded-[8px] shadow-[0_0_0_1px_var(--azd-border-strong)]`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 bg-header px-3 py-1.5 text-xs text-muted`,children:[(0,J.jsx)(`span`,{className:`font-semibold text-fg`,children:`Result`}),(0,J.jsxs)(`span`,{children:[`what `,(0,J.jsx)(`span`,{className:`font-mono`,children:r.target}),` gets`]}),(0,J.jsxs)(`button`,{type:`button`,onClick:u.undo,disabled:!c,className:`${x} ml-auto h-6`,children:[(0,J.jsx)(m,{className:`size-3.5`}),`Undo `,(0,J.jsx)(Y,{children:`⌘Z`})]})]}),s?(0,J.jsx)(Ot,{initial:(v??wt(e)).map(e=>e.text),onSave:e=>{u.decide({kind:`edited`,lines:e}),h()},onCancel:h}):v===null?(0,J.jsx)(`p`,{className:`bg-code px-3 py-2.5 text-xs text-muted`,"data-testid":`conflict-result-empty`,children:`Choose above, pick lines, or edit. The result shows here.`}):(0,J.jsx)(Dt,{lines:v,names:r,startLine:e.baseLine})]})]})}function Ct(e){let t=e.hasBase?e.base.length:e.target.length,n=e.baseLine;return t<=1?`Line ${Math.max(n,1)}`:`Lines ${n}–${n+t-1}`}function wt(e){return[...e.source.map(e=>({text:e,origin:`source`})),...e.target.map(e=>({text:e,origin:`target`}))]}function Tt({side:e,caption:t,region:n,decision:r,names:i,onToggle:a}){let o=Oe(n,e),s=r?.kind===`lines`?new Set(e===`source`?r.source:r.target):r?.kind===e||r?.kind===`both`||r?.kind===`combine`?new Set(o.filter(e=>e.changed).map(e=>e.index)):new Set;return(0,J.jsxs)(`div`,{className:`min-w-0 border-border @3xl:[&+&]:border-l [&+&]:border-t @3xl:[&+&]:border-t-0`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border bg-surface px-3 py-1.5 text-xs text-muted`,children:[(0,J.jsx)(ht,{side:e,names:i}),(0,J.jsx)(`span`,{children:t})]}),(0,J.jsx)(`div`,{className:`bg-code py-0.5`,children:o.length===0?(0,J.jsx)(`p`,{className:`px-3 py-1.5 text-xs text-muted`,children:`Removed these lines`}):o.map(t=>t.changed?(0,J.jsxs)(`label`,{className:`grid min-h-6 cursor-pointer grid-cols-[2.75rem_minmax(0,1fr)] items-start font-mono text-xs leading-6 text-fg ${pt[e]}`,children:[(0,J.jsx)(`span`,{className:`flex h-6 items-center justify-end pr-2.5`,children:(0,J.jsx)(`input`,{type:`checkbox`,checked:s.has(t.index),onChange:()=>a(t.index),"aria-label":`Pick from ${i[e]}: ${t.text.trim()||`empty line`}`,className:`size-3.5 ${e===`source`?`accent-[var(--azd-side-source)]`:`accent-[var(--azd-side-target)]`}`})}),(0,J.jsx)(`span`,{className:`pr-3 break-words whitespace-pre-wrap`,children:t.text.length===0?(0,J.jsx)(`span`,{className:`text-muted`,children:`(empty line)`}):(0,J.jsx)(vt,{segments:Me(t.baseText,t.text),side:e})})]},t.index):(0,J.jsxs)(X,{dim:!0,tagless:!0,children:[Z(t.text),(0,J.jsx)(`span`,{className:`ml-2 font-sans text-[11px]`,children:`unchanged`})]},t.index))})]})}function Et({region:e,decision:t,names:n,canCombine:r,combineReason:i,onDecide:a,onEdit:o}){let s=xt(t),c=t?.kind===`both`?t.first:`source`,l=t?.kind===`lines`?t.source.length+t.target.length:0,u=[...r?[{key:`combine`,label:(0,J.jsxs)(J.Fragment,{children:[`Combine changes`,(0,J.jsx)(`span`,{className:`rounded-full bg-[var(--azd-selected)] px-1.5 text-[11px] font-normal text-muted`,children:`recommended`})]}),name:`Combine changes (recommended)`,hint:`c`,decision:{kind:`combine`}}]:[],{key:`source`,label:`Use ${n.short.source}`,name:`Use ${n.short.source} (${n.source})`,hint:`1`,decision:{kind:`source`}},{key:`target`,label:`Use ${n.short.target}`,name:`Use ${n.short.target} (${n.target})`,hint:`2`,decision:{kind:`target`}},{key:`both`,label:`Use both`,name:`Use both, ${n[c]} first`,hint:`3`,decision:{kind:`both`,first:c}},...s===`lines`&&t!==void 0?[{key:`lines`,label:`Picked lines · ${l}`,name:`Picked lines · ${l}`,decision:t}]:[]],d=(0,H.useRef)([]),p=Math.max(0,u.findIndex(e=>e.key===s));return(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3.5 py-2.5`,children:[(0,J.jsx)(`div`,{role:`radiogroup`,"aria-label":`Resolve ${Ct(e).toLowerCase()}`,onKeyDown:e=>{let t=d.current.indexOf(document.activeElement);if(t<0)return;let n=null;e.key===`ArrowRight`||e.key===`ArrowDown`?n=(t+1)%u.length:(e.key===`ArrowLeft`||e.key===`ArrowUp`)&&(n=(t-1+u.length)%u.length),n!==null&&(e.preventDefault(),d.current[n]?.focus())},className:`flex flex-wrap items-center gap-2`,children:u.map((e,t)=>(0,J.jsxs)(`button`,{ref:e=>{d.current[t]=e},type:`button`,role:`radio`,"aria-checked":s===e.key,"aria-label":e.name,tabIndex:t===p?0:-1,onClick:()=>{e.key!==`lines`&&a(e.decision)},className:`${E} h-7 gap-1.5 bg-surface px-2.5 text-[12.5px] aria-checked:border-border-strong aria-checked:bg-[var(--azd-selected)] aria-checked:text-fg-strong`,"data-testid":`choice-${e.key}`,children:[s===e.key&&(0,J.jsx)(T,{className:`size-3`}),e.label,e.hint!==void 0&&(0,J.jsx)(Y,{children:e.hint})]},e.key))}),t?.kind===`both`&&(0,J.jsxs)(`button`,{type:`button`,onClick:()=>a({kind:`both`,first:t.first===`source`?`target`:`source`}),className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-7 px-2 text-muted hover:bg-hover hover:text-fg h-7`,"data-testid":`swap-order`,children:[(0,J.jsx)(h,{className:`size-3.5`}),n.short[t.first===`source`?`target`:`source`],` first`]}),(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1 h-5 w-px bg-border`}),(0,J.jsxs)(`button`,{type:`button`,onClick:o,className:`${x} h-7`,children:[(0,J.jsx)(f,{className:`size-3.5`}),`Edit result `,(0,J.jsx)(Y,{children:`e`})]}),i!==null&&(0,J.jsxs)(`span`,{className:`ml-auto text-xs text-muted`,"data-testid":`combine-reason`,children:[`Can't combine: `,i.charAt(0).toLowerCase(),i.slice(1)]})]})}function Dt({lines:e,names:t,startLine:n}){return e.length===0?(0,J.jsx)(`p`,{className:`bg-code px-3 py-2 text-xs text-muted`,"data-testid":`conflict-result`,children:`No lines: these lines are removed.`}):(0,J.jsx)(`div`,{className:`bg-code py-0.5`,"data-testid":`conflict-result`,children:e.map((e,r)=>(0,J.jsx)(X,{number:n>0?n+r:void 0,tone:e.origin===`source`||e.origin===`target`?pt[e.origin]:``,tag:(0,J.jsx)(_t,{origin:e.origin,names:t}),children:Z(e.text)},r))})}function Ot({initial:e,onSave:t,onCancel:n}){let[r,i]=(0,H.useState)(()=>e.join(`
3
- `)),[a,o]=(0,H.useState)(null),s=(0,H.useId)(),c=()=>{let e=r.length===0?[]:r.replace(/\r\n/g,`
4
- `).split(`
5
- `),n=Ge(e);n===null?t(e):o(`Line ${n} is a conflict marker. Remove it to save.`)};return(0,J.jsxs)(`div`,{className:`space-y-2 bg-code p-2.5`,children:[(0,J.jsx)(`label`,{htmlFor:s,className:`sr-only`,children:`Result of this conflict`}),(0,J.jsx)(`textarea`,{id:s,value:r,onChange:e=>{i(e.target.value),o(null)},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),c()):e.key===`Escape`&&(e.preventDefault(),n())},autoFocus:!0,spellCheck:!1,rows:Math.min(16,Math.max(3,e.length+1)),"aria-describedby":a===null?void 0:`${s}-problem`,className:`w-full resize-y rounded-[7px] border border-border bg-canvas px-2.5 py-2 font-mono text-xs leading-6 text-fg focus:border-[var(--azd-focus)] focus:outline-none`,"data-testid":`region-editor`}),a!==null&&(0,J.jsx)(`p`,{id:`${s}-problem`,role:`alert`,className:`text-xs text-danger`,children:a}),(0,J.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,J.jsxs)(`span`,{className:`mr-auto text-xs text-muted`,children:[(0,J.jsx)(Y,{children:`⌘↵`}),` save · `,(0,J.jsx)(Y,{children:`esc`}),` cancel`]}),(0,J.jsx)(`button`,{type:`button`,onClick:n,className:x,children:`Cancel`}),(0,J.jsx)(`button`,{type:`button`,onClick:c,className:E,children:`Use this result`})]})]})}function kt(e,t,n,r){if(n===void 0||r===void 0||e.baseBlob!==null&&t===void 0)return`loading`;for(let e of[t,n,r])if(e!==void 0&&e.kind!==`text`)return{reason:e.kind===`too-large`?`This file is larger than 8 MB, so it can only be taken whole.`:`This file is not UTF-8 text, so it can only be taken whole.`};return n.kind!==`text`||r.kind!==`text`?`loading`:{base:t?.kind===`text`?t.file:null,source:n.file,target:r.file}}function At({conflict:e,sides:t,names:n,store:r,save:i,footer:o}){let s=(0,H.useMemo)(()=>Ee(t.base?.lines??null,t.source.lines,t.target.lines),[t]),c=(0,H.useMemo)(()=>De(s),[s]),l=`${e.baseBlob??``}:${e.sourceBlob}:${e.targetBlob}`,[u]=(0,H.useState)(()=>{let t=r.read(e.path);return t===null?null:de(t,l,c)}),[p,m]=(0,H.useReducer)(ze,u?.choices,e=>Re(e)),h=p.current;(0,H.useEffect)(()=>{r.write(e.path,ue(l,c,h))},[r,e.path,l,c,h]);let[g,_]=(0,H.useState)(()=>q(c,h,-1)??0),[v,y]=(0,H.useState)(new Set),[b,S]=(0,H.useState)(new Set),[C,w]=(0,H.useState)(null),[T,E]=(0,H.useState)(!1),[D,ee]=(0,H.useState)(!1),O=(0,H.useRef)(new Map),te=e=>{let t=O.current.get(e);return t===void 0&&(t=(0,H.createRef)(),O.current.set(e,t)),t},ne=(0,H.useRef)(null),k=e=>{_(e),window.setTimeout(()=>{let t=O.current.get(e)?.current;t?.focus({preventScroll:!0}),t?.scrollIntoView({block:`nearest`,behavior:`auto`})},0)},A=He(s,h,{source:t.source.lines,target:t.target.lines,labels:{source:n.source,target:n.target}}),j=Ke(c,h),N=h.fileEdit===null?null:Ge(h.fileEdit),P=j?0:A.undecided.length,ie=c.length-A.undecided.length,F=Ze(c,h),ae=()=>{if(F.length===0)return;let e=ze(p,{type:`fill`,fills:F});m({type:`fill`,fills:F});let t=q(c,e.current,-1);t===null?window.setTimeout(()=>ne.current?.focus(),0):k(t)},I=(e,t)=>{let n=c.find(t=>t.index===e);if(n===void 0||K(n,t)===null)return;let r=ze(p,{type:`decide`,region:e,decision:t});m({type:`decide`,region:e,decision:t}),y(t=>{let n=new Set(t);return n.delete(e),n});let i=q(c,r.current,e);i===null?window.setTimeout(()=>ne.current?.focus(),0):k(i)},L=()=>h.wholeFile===`source`?{kind:`takeSource`}:h.wholeFile===`target`?{kind:`takeTarget`}:!j||N!==null?null:{kind:`userMerged`,content:oe({...t.target,lines:A.lines.map(e=>e.text)})},R=()=>{let e=L();e===null||i.busy||i.run(e)},se=j?N===null?null:`Line ${N} is a conflict marker`:`${P} ${P===1?`conflict`:`conflicts`} left`;re({n:()=>{c.length>0&&k((g+1)%c.length)},p:()=>{c.length>0&&k((g-1+c.length)%c.length)},c:()=>I(g,{kind:`combine`}),1:()=>I(g,{kind:`source`}),2:()=>I(g,{kind:`target`}),3:()=>I(g,{kind:`both`,first:`source`}),e:()=>w(g),o:()=>S(e=>{let t=new Set(e);return t.has(g)?t.delete(g):t.add(g),t})},C===null&&!T&&h.wholeFile===null&&h.fileEdit===null);let z=()=>{let e=p.history.at(-1);if(e===void 0)return;let t=Ve(e,h);m({type:`undo`}),t!==null&&(y(e=>new Set(e).add(t)),k(t))},B=(0,H.useRef)({markResolved:R,undo:z,canUndo:p.history.length>0});B.current={markResolved:R,undo:z,canUndo:p.history.length>0},(0,H.useEffect)(()=>{let e=e=>{if(!(!(e.metaKey||e.ctrlKey)||e.altKey||e.defaultPrevented)){if(e.key===`Enter`&&!M(e))e.preventDefault(),B.current.markResolved();else if(e.key.toLowerCase()===`z`&&!e.shiftKey&&!M(e)){if(!B.current.canUndo)return;e.preventDefault(),B.current.undo()}}};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let V=(0,J.jsx)(ce,{label:`Take whole file`,entries:[{kind:`heading`,label:`Drops the other side’s changes to this file`},...[`source`,`target`].map(e=>({kind:`radio`,label:`Use ${n.short[e]}'s file`,checked:h.wholeFile===e,onSelect:()=>m({type:`whole-file`,side:e}),testId:`whole-file-${e}`}))],trigger:e=>(0,J.jsxs)(`button`,{type:`button`,...e,ref:e.ref,className:x,children:[`Take whole file`,(0,J.jsx)(d,{className:`size-3.5`})]})}),le=c.length===0?`Merges cleanly`:`${c.length} ${c.length===1?`conflict`:`conflicts`} · ${ie} decided`;return(0,J.jsxs)(Q,{conflict:e,names:n,progress:le,tools:(0,J.jsxs)(J.Fragment,{children:[F.length>0&&(0,J.jsxs)(`button`,{type:`button`,onClick:ae,className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-7 px-2 text-muted hover:bg-hover hover:text-fg`,title:`Pre-fill the blocks one rule can decide; review them, then Mark resolved`,"data-testid":`fill-safe`,children:[(0,J.jsx)(a,{className:`size-3.5`}),`Fill safe choices (`,F.length,`)`]}),V,(0,J.jsxs)(`button`,{type:`button`,onClick:()=>E(!0),className:x,disabled:T,children:[(0,J.jsx)(f,{className:`size-3.5`}),`Edit file`]}),(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":D,onClick:()=>ee(!D),className:`${x} aria-pressed:text-fg`,disabled:!j||N!==null,title:j?void 0:`Decide every conflict first`,children:[`Review what `,n.short.target,` gets`]})]}),save:i,markRef:ne,blockedReason:se,onMarkResolved:R,footer:o,children:[u!==null&&u.dropped>0&&(0,J.jsxs)(`p`,{className:`border-b border-border px-3.5 py-2 text-xs text-muted`,role:`status`,children:[u.dropped,` earlier`,` `,u.dropped===1?`choice no longer fits`:`choices no longer fit`,` after new commits and `,u.dropped===1?`was`:`were`,` set aside.`]}),D&&j&&N===null?(0,J.jsx)(Lt,{target:t.target.lines,result:A.lines.map(e=>e.text),names:n}):h.wholeFile===null?T?(0,J.jsx)(Ft,{initial:A.lines.map(e=>e.text),onSave:e=>{m({type:`edit-file`,lines:e}),E(!1)},onCancel:()=>E(!1)}):h.fileEdit===null?(0,J.jsx)(jt,{regions:s,conflicts:c,choices:p,names:n,active:g,expanded:v,original:b,editing:C,headerRef:te,onFocus:_,onDecide:I,onToggleLine:(e,t,n)=>m({type:`toggle-line`,region:e,side:t,index:n}),onUndo:z,onToggleOriginal:e=>S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onExpand:e=>y(t=>new Set(t).add(e)),onEdit:e=>w(e),onEditDone:()=>w(null),autoMark:e=>{let t=h.auto?.[e];return t===void 0?void 0:lt(t,n)}}):(0,J.jsx)(It,{lines:h.fileEdit,names:n,markerLine:N,onEdit:()=>E(!0),onDiscard:()=>m({type:`edit-file`,lines:null})}):(0,J.jsx)(Pt,{side:h.wholeFile,names:n,onUndo:()=>m({type:`whole-file`,side:null})})]})}function jt({regions:e,conflicts:t,choices:n,names:r,active:i,expanded:a,original:o,editing:s,headerRef:c,onFocus:l,onDecide:u,onToggleLine:d,onUndo:f,onToggleOriginal:p,onExpand:m,onEdit:h,onEditDone:g,autoMark:_}){return(0,J.jsx)(`div`,{className:`@container`,children:e.map((e,v)=>e.kind===`clean`?(0,J.jsx)(Nt,{region:e,names:r},`clean-${v}`):(0,J.jsx)(St,{region:e,count:t.length,decision:n.current.decisions[e.index],names:r,active:i===e.index,expanded:a.has(e.index)||i===e.index||n.current.auto?.[e.index]!==void 0,auto:_(e.index),showOriginal:o.has(e.index),editing:s===e.index,canUndo:n.history.length>0,headerRef:c(e.index),intents:{decide:t=>u(e.index,t),toggleLine:(t,n)=>d(e.index,t,n),focus:()=>l(e.index),undo:f},onToggleOriginal:()=>p(e.index),onExpand:()=>m(e.index),onEdit:()=>h(e.index),onEditDone:g},`conflict-${e.index}`))})}var Mt=3;function Nt({region:e,names:t}){let[n,r]=(0,H.useState)(!1);if(e.origin===`source`||e.origin===`target`){let n=e.origin,r=e.baseLine,i=e.lines.length<=1?`Line ${r}`:`Lines ${r}–${r+e.lines.length-1}`;return(0,J.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`clean-change`,children:[(0,J.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 px-3.5 pt-1.5 pb-1 text-xs text-muted`,children:[(0,J.jsx)(`span`,{className:`text-added`,"aria-hidden":`true`,children:`✓`}),e.lines.length===0?`${i} removed cleanly by ${t.short[n]}`:`${i} merged cleanly from ${t.short[n]}`]}),(0,J.jsx)(`div`,{className:`bg-code pb-0.5`,children:e.lines.map((e,t)=>(0,J.jsx)(X,{tone:pt[n],children:Z(e)},t))})]})}let i=e.lines;return i.length<=Mt||n?(0,J.jsx)(`div`,{className:`border-b border-border bg-code py-0.5`,children:i.map((t,n)=>(0,J.jsx)(X,{number:e.baseLine>0?e.baseLine+n:void 0,dim:!0,children:Z(t)},n))}):(0,J.jsxs)(`button`,{type:`button`,onClick:()=>r(!0),className:`flex w-full items-center gap-2 border-b border-border bg-canvas px-3.5 py-1.5 text-left text-xs text-muted hover:text-fg`,children:[(0,J.jsx)(`span`,{"aria-hidden":`true`,children:`⋯`}),i.length,` `,e.origin===`both`?`identical`:`unchanged`,` lines`,(0,J.jsx)(`span`,{className:`sr-only`,children:`, show them`})]})}function Pt({side:e,names:t,onUndo:n}){let r=e===`source`?`target`:`source`;return(0,J.jsxs)(`div`,{className:`space-y-2 px-3.5 py-3 text-[13px]`,"data-testid":`whole-file-note`,children:[(0,J.jsxs)(`p`,{className:`text-fg`,children:[`Using `,(0,J.jsx)(`span`,{className:`font-mono`,children:t[e]}),`'s whole file.`]}),(0,J.jsxs)(`p`,{className:`text-muted`,children:[`This drops `,t.short[r],`'s changes to this file, including the ones that merged cleanly.`]}),(0,J.jsx)(`button`,{type:`button`,onClick:n,className:E,children:`Choose per conflict instead`})]})}function Ft({initial:e,onSave:t,onCancel:n}){let[r,i]=(0,H.useState)(()=>e.join(`
6
- `)),[a,o]=(0,H.useState)(null),s=(0,H.useId)(),c=()=>{let e=r.length===0?[]:r.replace(/\r\n/g,`
7
- `).split(`
8
- `),n=Ge(e);n===null?t(e):o(`Line ${n} is a conflict marker. Remove the markers to keep the edit.`)};return(0,J.jsxs)(`div`,{className:`space-y-2 p-3.5`,children:[(0,J.jsxs)(`label`,{htmlFor:s,className:`block text-xs text-muted`,children:[`The whole merged file. Undecided conflicts show Git markers (`,(0,J.jsx)(`span`,{className:`font-mono`,children:`<<<<<<<`}),`); remove them before saving.`]}),(0,J.jsx)(`textarea`,{id:s,value:r,onChange:e=>{i(e.target.value),o(null)},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),c()):e.key===`Escape`&&(e.preventDefault(),n())},autoFocus:!0,spellCheck:!1,rows:Math.min(28,Math.max(8,e.length+1)),className:`w-full resize-y rounded-[7px] border border-border bg-canvas px-2.5 py-2 font-mono text-xs leading-6 text-fg focus:border-[var(--azd-focus)] focus:outline-none`,"data-testid":`file-editor`}),a!==null&&(0,J.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:a}),(0,J.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,J.jsxs)(`span`,{className:`mr-auto text-xs text-muted`,children:[(0,J.jsx)(Y,{children:`⌘↵`}),` keep · `,(0,J.jsx)(Y,{children:`esc`}),` cancel`]}),(0,J.jsx)(`button`,{type:`button`,onClick:n,className:x,children:`Cancel`}),(0,J.jsx)(`button`,{type:`button`,onClick:c,className:E,children:`Keep this file`})]})]})}function It({lines:e,names:t,markerLine:n,onEdit:r,onDiscard:i}){return(0,J.jsxs)(`div`,{"data-testid":`edited-file`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-3.5 py-2 text-xs text-muted`,children:[(0,J.jsx)(f,{className:`size-3.5`}),`Edited by hand`,n!==null&&(0,J.jsxs)(`span`,{className:`text-danger`,children:[`· line `,n,` is a conflict marker`]}),(0,J.jsx)(`button`,{type:`button`,onClick:r,className:`${x} ml-auto`,children:`Edit`}),(0,J.jsx)(`button`,{type:`button`,onClick:i,className:x,children:`Discard edit`})]}),(0,J.jsx)(Dt,{lines:e.map(e=>({text:e,origin:`edited`})),names:t,startLine:1})]})}function Lt({target:e,result:t,names:n}){let r=[];for(let n of V(e,t)){let e=n.added?`added`:n.removed?`removed`:`same`;for(let t of n.value)r.push({kind:e,text:t})}let i=r.some(e=>e.kind!==`same`);return(0,J.jsxs)(`div`,{"data-testid":`review-diff`,children:[(0,J.jsxs)(`p`,{className:`px-3.5 py-2 text-xs text-muted`,children:[`Changes to `,(0,J.jsx)(`span`,{className:`font-mono`,children:n.target}),`'s version of this file.`]}),i?(0,J.jsx)(`div`,{className:`bg-code py-0.5`,children:r.map((e,t)=>(0,J.jsx)(X,{tone:e.kind===`added`?`bg-[color-mix(in_srgb,var(--azd-added)_12%,transparent)]`:e.kind===`removed`?`bg-[color-mix(in_srgb,var(--azd-deleted)_12%,transparent)]`:``,tag:(0,J.jsxs)(`span`,{className:e.kind===`added`?`text-added`:e.kind===`removed`?`text-deleted`:``,children:[e.kind===`added`?`+`:e.kind===`removed`?`−`:``,(0,J.jsx)(`span`,{className:`sr-only`,children:e.kind===`added`?`Added: `:e.kind===`removed`?`Removed: `:``})]}),dim:e.kind===`same`,children:Z(e.text)},t))}):(0,J.jsxs)(`p`,{className:`px-3.5 pb-3 text-[13px] text-fg`,children:[`The file stays as it is in `,n.short.target,`.`]})]})}function Rt({conflict:e,scope:t,location:n,names:r,store:i,save:a,footer:o}){let[s,c]=(0,H.useState)(!1);if(e.resolutionStatus===`resolved`&&!s&&e.kind!==`unsupported`)return(0,J.jsx)(Yt,{conflict:e,names:r,footer:o,onChange:()=>c(!0)});switch(e.kind){case`content`:return(0,J.jsx)(Bt,{conflict:e,scope:t,names:r,store:i,save:a,footer:o});case`pickOne`:return(0,J.jsx)(Kt,{conflict:e,scope:t,names:r,save:a,footer:o});case`unsupported`:return(0,J.jsx)(Q,{conflict:e,names:r,save:{...a,problem:null},blockedReason:null,onMarkResolved:()=>{},showMark:!1,footer:o,children:(0,J.jsxs)(`div`,{className:`space-y-2 px-3.5 py-3 text-[13px]`,"data-testid":`unsupported-conflict`,children:[(0,J.jsx)(`p`,{className:`text-fg`,children:st(e,r)}),(0,J.jsx)(`p`,{className:`text-muted`,children:`azdiffs can't resolve this kind of conflict yet. Resolve it in Azure DevOps; the other files can still be resolved here.`}),(0,J.jsx)(j,{href:l(n),children:`Open in Azure DevOps`})]})})}}function zt(e,t){return[N(e,t[0]??null),N(e,t[1]??null),N(e,t[2]??null)]}function Bt({conflict:e,scope:t,names:n,store:r,save:i,footer:a}){let[o,s,c]=zt(t,[e.baseBlob,e.sourceBlob,e.targetBlob]),l=[o,s,c].find(e=>e.isError),u=kt(e,o.data,s.data,c.data);return l===void 0?u===`loading`?(0,J.jsx)(Q,{conflict:e,names:n,save:i,blockedReason:`Loading`,onMarkResolved:()=>{},footer:{...a,regionKeys:!1},children:(0,J.jsxs)(`div`,{className:`space-y-2 px-3.5 py-4`,"aria-busy":`true`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Loading the file's versions`}),[70,52,64].map(e=>(0,J.jsx)(`div`,{className:`azd-pulse h-3 rounded bg-raised`,style:{width:`${e}%`}},e))]})}):`reason`in u?(0,J.jsx)(qt,{conflict:e,names:n,save:i,footer:a,reason:u.reason,sizes:{source:Vt(s.data),target:Vt(c.data)}}):(0,J.jsx)(At,{conflict:e,sides:u,names:n,store:r,save:i,footer:{...a,regionKeys:!0}}):(0,J.jsx)(Q,{conflict:e,names:n,save:i,blockedReason:`File versions did not load`,onMarkResolved:()=>{},footer:{...a,regionKeys:!1},children:(0,J.jsxs)(`p`,{role:`alert`,className:`flex items-center gap-2 px-3.5 py-3 text-[13px] text-muted`,children:[`The file's versions could not be loaded.`,(0,J.jsx)(`button`,{type:`button`,onClick:()=>{for(let e of[o,s,c])e.isError&&e.refetch()},className:`font-medium text-fg hover:underline`,children:`Try again`})]})})}function Vt(e){return e===void 0?null:e.kind===`text`?e.bytes.byteLength:e.size}function Ht(e){return e===null?``:e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Ut({label:e,cards:t,value:n,onChange:r}){let i=(0,H.useId)();return(0,J.jsxs)(`fieldset`,{className:`space-y-2 p-3.5`,children:[(0,J.jsx)(`legend`,{className:`sr-only`,children:e}),t.map(e=>(0,J.jsxs)(`label`,{className:`grid cursor-pointer grid-cols-[1.125rem_minmax(0,1fr)] gap-x-2.5 rounded-[8px] border border-border bg-canvas p-3 hover:border-border-strong has-[:checked]:border-border-strong has-[:checked]:bg-[var(--azd-selected)] has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-[var(--azd-focus)]`,"data-testid":`choice-card-${e.value}`,children:[(0,J.jsx)(`input`,{type:`radio`,name:i,checked:n===e.value,onChange:()=>r(e.value),className:`mt-1 size-3.5 focus-visible:outline-none`}),(0,J.jsxs)(`span`,{className:`min-w-0 space-y-0.5`,children:[(0,J.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-[13px] font-medium text-fg`,children:[e.title,e.chip]}),(0,J.jsx)(`span`,{className:`block text-xs text-muted`,children:e.detail}),e.preview]})]},e.value))]})}function Wt({lines:e}){let[t,n]=(0,H.useState)(!1);return e===null?null:(0,J.jsxs)(`span`,{className:`block pt-1.5`,children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:e=>{e.preventDefault(),n(!t)},className:`${x} -ml-2 h-6`,children:[t?(0,J.jsx)(d,{className:`size-3.5`}):(0,J.jsx)(r,{className:`size-3.5`}),t?`Hide the file`:`Show the file`]}),t&&(0,J.jsx)(`span`,{className:`mt-1 block max-h-72 overflow-auto rounded-[6px] bg-code py-0.5`,children:e.map((e,t)=>(0,J.jsx)(X,{number:t+1,children:Z(e)},t))})]})}function Gt(e){return e?.kind===`text`?e.file.lines:null}function Kt({conflict:e,scope:t,names:n,save:r,footer:i}){let[a,o]=(0,H.useState)(null),s=e.type===`editDelete`?`source`:`target`,c=s===`source`?`target`:`source`,[l]=zt(t,[s===`source`?e.sourceBlob:e.targetBlob]),u=Gt(l.data),d=[{value:s,title:`Keep the file`,chip:(0,J.jsx)(ht,{side:s,names:n,short:!0}),detail:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`font-mono`,children:n.target}),` keeps the file with`,` `,n.short[s],`'s changes.`]}),preview:(0,J.jsx)(Wt,{lines:u})},{value:c,title:`Delete the file`,chip:(0,J.jsx)(ht,{side:c,names:n,short:!0}),detail:(0,J.jsxs)(J.Fragment,{children:[`As `,n.short[c],` did. `,n.short[s],`'s changes to it are lost.`]})}],f=()=>{a!==null&&r.run({kind:a===`source`?`pickSource`:`pickTarget`})};return Jt(f),(0,J.jsx)(Q,{conflict:e,names:n,save:r,blockedReason:a===null?`Choose one`:null,onMarkResolved:f,footer:{...i,regionKeys:!1},children:(0,J.jsx)(Ut,{label:`Keep or delete the file`,cards:d,value:a,onChange:o})})}function qt({conflict:e,names:t,save:n,footer:r,reason:i,sizes:a}){let[o,s]=(0,H.useState)(null),c=[`source`,`target`].map(e=>({value:e,title:`Use ${t.short[e]}'s file`,chip:(0,J.jsx)(ht,{side:e,names:t,short:!0}),detail:Ht(a[e])})),l=()=>{if(o===null)return;let e=o===`source`?{kind:`takeSource`}:{kind:`takeTarget`};n.run(e)};return Jt(l),(0,J.jsxs)(Q,{conflict:e,names:t,save:n,blockedReason:o===null?`Choose one`:null,onMarkResolved:l,footer:{...r,regionKeys:!1},children:[(0,J.jsx)(`p`,{className:`px-3.5 pt-3 text-xs text-muted`,children:i}),(0,J.jsx)(Ut,{label:`Which version to keep`,cards:c,value:o,onChange:s})]})}function Jt(e){let[t]=(0,H.useState)(()=>({current:e}));t.current=e,(0,H.useEffect)(()=>{let e=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!e.altKey&&(e.preventDefault(),t.current())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t])}function Yt({conflict:e,names:t,footer:n,onChange:r}){let i=ct(e,t),a=e.resolvedBy?.displayName,o=ut(e.resolvedDate);return(0,J.jsx)(Q,{conflict:e,names:t,save:{busy:!1,problem:null,run:()=>{}},blockedReason:null,onMarkResolved:()=>{},showMark:!1,footer:{...n,regionKeys:!1},tools:(0,J.jsx)(`button`,{type:`button`,onClick:r,className:`${w} h-7 px-2.5`,children:`Change`}),children:(0,J.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2 px-3.5 py-3 text-[13px]`,"data-testid":`resolved-file`,children:[(0,J.jsx)(T,{className:`size-4 text-added`}),(0,J.jsx)(`span`,{className:`font-medium text-fg`,children:i??`Resolved`}),(a!==void 0||o.length>0)&&(0,J.jsxs)(`span`,{className:`text-muted`,children:[a===void 0?``:`by ${a}`,a!==void 0&&o.length>0?` · `:``,o]})]})})}var Xt=2e3,Zt=12e4;function $(e){return e.resolutionStatus===`resolved`?`resolved`:e.kind===`unsupported`?`elsewhere`:`open`}var Qt={open:`To resolve`,resolved:`Resolved`,elsewhere:`Resolve in Azure DevOps`};function $t(e){let t={open:0,resolved:1,elsewhere:2};return[...e].sort((e,n)=>t[$(e)]-t[$(n)]||e.path.localeCompare(n.path))}function en({file:e,onFileChange:n}){let{location:r,shortForm:i,pullRequest:o,scope:l}=z(),d=(0,H.useMemo)(()=>({organization:l.organization,project:l.project,repositoryId:l.repositoryId,pullRequestId:l.pullRequestId}),[l]),f=(0,H.useMemo)(()=>at(o.sourceBranch,o.targetBranch),[o.sourceBranch,o.targetBranch]),p=ie(d,o),m=(0,H.useMemo)(()=>$t(p.data??[]),[p.data]),h=m.find(t=>t.path===e)??m.find(e=>$(e)===`open`)??m[0]??null,g=k(m),_=te(r,i),[v,y]=(0,H.useState)(!1),[x,C]=(0,H.useState)(null),[T,E]=(0,H.useState)(``),D=h===null?-1:m.indexOf(h),A=e=>{e!==void 0&&n(e.path)};re({j:()=>A(m[D+1]),k:()=>A(m[D-1]),"?":()=>y(!0)});let j=s(),[M,N]=(0,H.useState)(!1),[P,F]=(0,H.useState)(null),[I,L]=(0,H.useState)(0),oe=m.filter(e=>e.kind===`content`&&e.resolutionStatus!==`resolved`).length,ce=async()=>{if(!M){N(!0);try{let e=await $e(m,e=>j.fetchQuery(ne(d,e)),V.store);F(e.filled===0?`Nothing safe to fill: every remaining conflict needs your choice.`:`Filled ${e.filled} ${e.filled===1?`block`:`blocks`} in ${e.files} ${e.files===1?`file`:`files`}. ${e.left===0?`Review them, then Mark resolved.`:`${e.left} ${e.left===1?`block is`:`blocks are`} left to you.`}`),L(e=>e+1)}catch{F(`Some file versions could not be loaded; nothing was filled for them.`)}finally{N(!1)}}},V=ln(d,o,f,{onSaved:e=>{let t=(p.data??[]).filter(t=>t.conflictId!==e.conflictId&&t.resolutionStatus!==`resolved`);E(t.length===0?`File resolved. No conflicts left.`:`File resolved. ${t.length} ${t.length===1?`file`:`files`} left.`);let r=$t(t).find(e=>e.kind!==`unsupported`);r!==void 0&&n(r.path)},onStale:e=>C(`New commits were pushed to ${e}. The conflicts were recalculated.`)}),le=(0,J.jsxs)(S,{top:(0,J.jsxs)(R,{location:r,shortForm:i,page:{tab:`overview`},className:`flex h-8 items-center gap-1.5 rounded-[7px] px-2 text-[13px] text-muted hover:bg-hover hover:text-fg`,testId:`back-to-overview`,children:[(0,J.jsx)(u,{className:`size-3.5`}),`Back`]}),children:[(0,J.jsx)(`div`,{className:`shrink-0 px-3 pb-2`,children:(0,J.jsx)(ee,{value:`conflicts`,filesCount:null,onChange:e=>_(e===`files`?{tab:`files`}:{tab:`files-commits`})})}),(0,J.jsx)(`nav`,{"aria-label":`Conflicted files`,className:`azd-scrollbar min-h-0 flex-1 overflow-y-auto pb-3`,children:(0,J.jsx)(nn,{conflicts:m,current:h,names:f,onSelect:A})})]}),U;return U=o.status===`active`?p.isPending?(0,J.jsx)(sn,{}):p.data===void 0?(0,J.jsx)(B,{error:p.error,organization:r.organization,onRetry:()=>void p.refetch()}):m.length===0?o.mergeStatus===`conflicts`?(0,J.jsxs)(b,{title:`Azure DevOps lists no conflicts yet`,children:[(0,J.jsxs)(`p`,{children:[`It reports conflicts with `,o.targetBranch,` but has not listed them. This can take a moment after a push.`]}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>void p.refetch(),className:w,children:`Check again`})]}):(0,J.jsx)(b,{title:`No conflicts`,children:(0,J.jsxs)(`p`,{children:[o.sourceBranch,` merges into `,o.targetBranch,` without conflicts.`]})}):(0,J.jsxs)(`div`,{className:`mx-auto w-full max-w-[1100px] space-y-3 px-5 pt-4 pb-10`,children:[(0,J.jsxs)(`p`,{className:`flex items-start gap-2.5 rounded-[10px] border border-border bg-surface px-3 py-2.5 text-[13px] leading-snug text-fg`,"data-testid":`conflicts-banner`,children:[(0,J.jsx)(c,{className:`mt-0.5 size-4 text-accent`}),(0,J.jsxs)(`span`,{children:[`Your resolutions go into the merge into`,` `,(0,J.jsx)(`span`,{className:`font-mono font-medium`,children:o.targetBranch}),` when this pull request completes. `,(0,J.jsx)(`span`,{className:`font-mono`,children:o.sourceBranch}),` isn't changed, so the same conflict can come back if it merges anywhere else.`]})]}),!g.done&&oe>0&&(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1 text-[13px]`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>void ce(),disabled:M,className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-8 px-3 border border-border bg-raised text-fg hover:border-border-strong hover:bg-hover`,"data-testid":`fill-safe-all`,children:[(0,J.jsx)(a,{className:`size-3.5`}),M?`Filling…`:`Fill safe choices in all files`]}),(0,J.jsx)(`span`,{className:`text-xs text-muted`,"data-testid":`fill-safe-all-result`,role:`status`,children:P??`Pre-fills only blocks one rule can decide. You review each file before saving.`})]}),x!==null&&(0,J.jsx)(`p`,{role:`status`,className:`rounded-[10px] border border-border bg-raised px-3 py-2 text-[13px] text-fg`,"data-testid":`conflicts-notice`,children:x}),g.done?(0,J.jsx)(cn,{pullRequest:o,total:m.length,names:f}):h!==null&&(0,J.jsx)(Rt,{conflict:h,scope:d,location:r,names:f,store:V.store,save:V.control(h),footer:{regionKeys:!1,next:tn(m,h,A)}},`${h.conflictId}:${h.mergeSourceCommit}:${h.mergeTargetCommit}:${I}`)]}):(0,J.jsx)(b,{title:`Nothing to resolve`,children:(0,J.jsxs)(`p`,{children:[`This pull request is `,o.status,`. Conflicts are resolved on active pull requests.`]})}),(0,J.jsxs)(t,{sidebar:le,sidebarLabel:`Conflicts`,sidebarWidth:280,topBar:(0,J.jsx)(se,{mode:`review`,merge:!1,tools:m.length>0?(0,J.jsx)(on,{resolved:g.resolved,total:m.length}):void 0}),children:[(0,J.jsx)(`div`,{className:`azd-scrollbar min-h-0 flex-1 overflow-y-auto`,children:U}),(0,J.jsx)(`p`,{"aria-live":`polite`,className:`sr-only`,"data-testid":`conflicts-announcer`,children:T}),(0,J.jsx)(O,{open:v,onClose:()=>y(!1),shortcuts:ae}),V.dialog]})}function tn(e,t,n){let r=e.indexOf(t),i=[...e.slice(r+1),...e.slice(0,r)].find(e=>$(e)===`open`);return i===void 0?null:{path:i.path,onSelect:()=>n(i)}}function nn({conflicts:e,current:t,names:n,onSelect:r}){let i=[`open`,`resolved`,`elsewhere`].map(t=>({group:t,items:e.filter(e=>$(e)===t)})).filter(e=>e.items.length>0);return(0,J.jsx)(`div`,{className:`space-y-1`,children:i.map(({group:e,items:i})=>(0,J.jsxs)(`section`,{"aria-label":Qt[e],"data-testid":`conflict-group-${e}`,children:[(0,J.jsxs)(`h2`,{className:`flex items-center justify-between px-4 pt-2.5 pb-1 text-xs text-muted`,children:[Qt[e],(0,J.jsx)(`span`,{className:`tabular-nums`,children:i.length})]}),(0,J.jsx)(`ul`,{children:i.map(i=>{let{name:a,folder:o}=yt(i.path);return(0,J.jsx)(`li`,{children:(0,J.jsxs)(`button`,{type:`button`,onClick:()=>r(i),"aria-current":i===t?`true`:void 0,className:`grid w-full grid-cols-[1rem_minmax(0,1fr)] items-start gap-2.5 px-4 py-1.5 text-left hover:bg-hover aria-[current]:bg-[var(--azd-selected)]`,"data-testid":`conflict-row`,"data-path":i.path,children:[(0,J.jsx)(an,{group:e}),(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5 text-[13px]`,children:[(0,J.jsx)(`span`,{className:`truncate font-medium text-fg`,children:a}),o.length>0&&(0,J.jsx)(`span`,{className:`truncate text-xs text-muted`,children:o})]}),(0,J.jsx)(`span`,{className:`line-clamp-2 text-xs text-muted`,children:e===`resolved`?rn(i):ot(i,n)})]})]})},i.conflictId)})})]},e))})}function rn(e){let t=e.resolvedBy?.displayName,n=ut(e.resolvedDate);return[`Resolved`,t===void 0?null:`by ${t}`,n.length>0?n:null].filter(e=>e!==null).join(` · `)}function an({group:e}){return e===`resolved`?(0,J.jsxs)(`span`,{className:`mt-0.5 grid size-3.5 place-items-center rounded-full bg-added`,title:`Resolved`,children:[(0,J.jsx)(T,{className:`size-2.5 text-[var(--azd-canvas)]`}),(0,J.jsx)(`span`,{className:`sr-only`,children:`Resolved: `})]}):e===`elsewhere`?(0,J.jsx)(`span`,{className:`mt-0.5 size-3.5 rounded-full border-[1.5px] border-dashed border-muted`,title:`Resolve in Azure DevOps`,children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Resolve in Azure DevOps: `})}):(0,J.jsx)(`span`,{className:`mt-0.5 size-3.5 rounded-full border-[1.5px] border-warning`,title:`To resolve`,children:(0,J.jsx)(`span`,{className:`sr-only`,children:`To resolve: `})})}function on({resolved:e,total:t}){let n=2*Math.PI*6,r=t===0?0:e/t,i=t>0&&e===t;return(0,J.jsxs)(`span`,{className:`ml-1 flex h-8 shrink-0 items-center gap-2 rounded-[7px] px-2 text-[13px] text-muted`,"data-testid":`resolved-count`,title:`${e} of ${t} conflicted files resolved`,children:[(0,J.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,className:`size-4 -rotate-90`,children:[(0,J.jsx)(`circle`,{cx:`8`,cy:`8`,r:6,fill:`none`,stroke:`var(--azd-border-strong)`,strokeWidth:`2`}),e>0&&(0,J.jsx)(`circle`,{cx:`8`,cy:`8`,r:6,fill:`none`,stroke:i?`var(--azd-added)`:`var(--azd-fg)`,strokeWidth:`2`,strokeLinecap:i?`butt`:`round`,...i?{}:{strokeDasharray:`${r*n} ${n}`},className:`transition-[stroke-dasharray] duration-300 motion-reduce:transition-none`})]}),(0,J.jsxs)(`span`,{className:`tabular-nums`,children:[(0,J.jsx)(`span`,{className:`font-medium text-fg`,children:e}),` / `,t,(0,J.jsx)(`span`,{className:`ml-1`,children:`resolved`})]})]})}function sn(){return(0,J.jsxs)(`div`,{className:`mx-auto w-full max-w-[1100px] space-y-3 px-5 pt-4`,"aria-busy":`true`,children:[(0,J.jsx)(`span`,{className:`sr-only`,children:`Loading the conflicts`}),(0,J.jsx)(`div`,{className:`azd-pulse h-11 rounded-[10px] bg-raised`}),(0,J.jsx)(`div`,{className:`azd-pulse h-64 rounded-[10px] bg-raised`})]})}function cn({pullRequest:e,total:t,names:n}){let{location:r,shortForm:i}=z(),a=s(),o=I(),c=(0,H.useRef)(Date.now()),[l,u]=(0,H.useState)(!1),d=e.mergeStatus,f=d===`succeeded`?`ready`:d===`failure`||d===`rejectedByPolicy`?`failed`:l?`timed-out`:`waiting`;(0,H.useEffect)(()=>{if(f!==`waiting`)return;let e=window.setInterval(()=>{Date.now()-c.current>Zt?u(!0):a.invalidateQueries({queryKey:L.detail(r),exact:!0})},Xt);return()=>window.clearInterval(e)},[f,a,r]);let p=(0,H.useRef)(null);return(0,J.jsxs)(`section`,{"aria-labelledby":`azd-finish-title`,className:`flex flex-col items-start gap-2.5 rounded-[10px] bg-surface p-5 shadow-[0_0_0_1px_var(--azd-border)]`,"data-testid":`conflicts-finish`,"data-state":f,children:[f===`ready`?(0,J.jsx)(`span`,{className:`grid size-7 place-items-center rounded-full border-2 border-added`,children:(0,J.jsx)(T,{className:`size-4 text-added`})}):(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`size-2.5 rounded-full ${f===`waiting`?`azd-pulse bg-accent`:`bg-warning`}`}),(0,J.jsx)(`h2`,{id:`azd-finish-title`,className:`text-[16px] font-semibold text-fg-strong`,children:t===1?`The conflict is resolved`:`All ${t} conflicts resolved`}),(0,J.jsxs)(`p`,{role:`status`,className:`text-[13px] text-muted`,children:[f===`ready`&&(0,J.jsxs)(J.Fragment,{children:[`Azure DevOps merged again with your resolutions. No conflicts with`,` `,(0,J.jsx)(`span`,{className:`font-mono`,children:n.target}),`.`]}),f===`waiting`&&`Azure DevOps is merging again with your resolutions…`,f===`timed-out`&&`Azure DevOps has not finished merging again after two minutes. Check again in a moment.`,f===`failed`&&(e.mergeFailureMessage??`Azure DevOps could not merge with these resolutions.`)]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[f===`ready`&&o?.actions?.primary===`complete`&&(0,J.jsx)(`button`,{ref:p,type:`button`,onClick:e=>o.run(`complete`,e.currentTarget),className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-8 px-3 bg-primary text-primary-fg hover:opacity-90`,"data-testid":`finish-complete`,children:`Complete`}),f===`ready`&&o?.actions?.primary===`set-auto-complete`&&(0,J.jsx)(`button`,{type:`button`,onClick:e=>o.run(`set-auto-complete`,e.currentTarget),className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-8 px-3 bg-primary text-primary-fg hover:opacity-90`,children:`Set auto-complete`}),(f===`timed-out`||f===`failed`)&&(0,J.jsx)(`button`,{type:`button`,onClick:()=>{c.current=Date.now(),u(!1),a.invalidateQueries({queryKey:L.detail(r),exact:!0})},className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-8 px-3 border border-border bg-raised text-fg hover:border-border-strong hover:bg-hover`,children:`Check again`}),(0,J.jsx)(R,{location:r,shortForm:i,page:{tab:`overview`},className:w,children:`Back to the Overview`})]}),f===`ready`&&(0,J.jsx)(`p`,{className:`text-xs text-muted`,children:`Merge commit or squash only: rebase can't keep conflict resolutions.`})]})}function ln(e,t,n,r){let a=s(),{location:c}=z(),l=v(e.organization),u=(0,H.useRef)(!1),[d,f]=(0,H.useState)(!1),[m,h]=(0,H.useState)(null),[b,x]=(0,H.useState)(null),S=(0,H.useMemo)(()=>pe(me(),{organization:e.organization,repositoryId:e.repositoryId,pullRequestId:e.pullRequestId}),[e.organization,e.repositoryId,e.pullRequestId]),C=P.list(e,t.lastMergeSourceCommit,t.lastMergeTargetCommit),T=n=>{let r=A(n,{repository:t.repository.name,method:y(e.organization)});return r.kind===`sign-in`?`Azure DevOps did not accept the sign-in. Reload to sign in again; your choices are kept.`:r.message},E=async(t,n,s)=>{if(u.current)return;u.current=!0,f(!0),h(null);let d=_(e.organization),m;try{m=await tt({pullRequest:()=>o(d,{project:e.project,pullRequestId:e.pullRequestId}),conflicts:()=>i(d,{project:e.project,repositoryId:e.repositoryId,pullRequestId:e.pullRequestId}),resolve:n=>p(_(e.organization,{keepSessionOnUnauthorized:!0}),{project:e.project,repositoryId:e.repositoryId,pullRequestId:e.pullRequestId,conflictId:t.conflictId,conflictType:t.type,resolution:n})},{conflict:t,resolution:n,currentUserId:l.data?.id??null,replaceConfirmed:s})}finally{u.current=!1,f(!1)}switch(m.kind){case`saved`:S.write(t.path,null),a.setQueryData(C,e=>e?.map(e=>e.conflictId===t.conflictId?m.conflict:e)),a.invalidateQueries({queryKey:L.detail(c),exact:!0}),r.onSaved(m.conflict);return;case`stale`:a.setQueryData(L.detail(c),m.pullRequest),r.onStale(m.branch);return;case`confirm-replace`:x({conflict:t,resolution:n,by:m.by.displayName,date:m.date});return;case`gone`:h({conflictId:t.conflictId,text:`Azure DevOps no longer lists this conflict. The list was reloaded.`}),a.invalidateQueries({queryKey:P.all(e)});return;case`failed`:h({conflictId:t.conflictId,text:nt(m,{method:y(e.organization),describe:T})}),m.sent&&a.invalidateQueries({queryKey:P.all(e)});return}},D=(0,H.useId)();return{store:S,dialog:b===null?null:(0,J.jsx)(F,{titleId:D,busy:d,onClose:()=>x(null),testId:`replace-dialog`,children:(0,J.jsxs)(`div`,{className:`space-y-3`,children:[(0,J.jsxs)(`h2`,{id:D,className:`text-[16px] font-semibold text-fg-strong`,children:[`Replace `,b.by,`'s resolution?`]}),(0,J.jsxs)(`p`,{className:`text-[13px] text-muted`,children:[b.by,` resolved `,yt(b.conflict.path).name,b.date===null?``:` ${ut(b.date)}`,` while you were working on it. Yours replaces theirs in the merge into`,` `,(0,J.jsx)(`span`,{className:`font-mono`,children:n.target}),`.`]}),(0,J.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>x(null),className:w,children:`Keep theirs`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>{let e=b;x(null),E(e.conflict,e.resolution,!0)},className:g,"data-testid":`replace-confirm`,children:`Replace with mine`})]})]})}),control:e=>({busy:d,problem:m?.conflictId===e.conflictId?m.text:null,run:t=>void E(e,t,!1)})}}export{en as t};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-BLXQ4ufn.js";import{Bn as e,zn as t}from"./index-B297yCgq.js";e(),t();function n(){return null}export{n as component};