@thxgg/steward 0.1.25 → 0.1.26

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 (187) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{Bc2V3wPK.js → B2ow85x_.js} +2 -2
  3. package/.output/public/_nuxt/{U78rMDmo.js → B6CbIr08.js} +1 -1
  4. package/.output/public/_nuxt/{BknRrWsw.js → BLQAF8wp.js} +1 -1
  5. package/.output/public/_nuxt/BXuwtOqb.js +1 -0
  6. package/.output/public/_nuxt/CAMiEhze.js +1 -0
  7. package/.output/public/_nuxt/{BRQ9Cxaw.js → CIBCqZF5.js} +1 -1
  8. package/.output/public/_nuxt/Ce0-nlm9.js +1 -0
  9. package/.output/public/_nuxt/{T11EuTtn.js → ConzneVY.js} +1 -1
  10. package/.output/public/_nuxt/D0qxz_Pn.js +1310 -0
  11. package/.output/public/_nuxt/D3PDtLSF.js +3 -0
  12. package/.output/public/_nuxt/{C73kduX-.js → DdKC0UAK.js} +1 -1
  13. package/.output/public/_nuxt/Detail.BGdvrJGh.css +1 -0
  14. package/.output/public/_nuxt/{C53_p0K1.js → Dkh9ic1y.js} +1 -1
  15. package/.output/public/_nuxt/LEjJTR7-.js +1 -0
  16. package/.output/public/_nuxt/{BTmXUZ_s.js → UqZfMfrZ.js} +1 -1
  17. package/.output/public/_nuxt/builds/latest.json +1 -1
  18. package/.output/public/_nuxt/builds/meta/25438e34-19a2-421d-aede-53fd18f1ccd4.json +1 -0
  19. package/.output/public/_nuxt/dckrK0oj.js +1 -0
  20. package/.output/public/_nuxt/entry.DT4p6_uW.css +1 -0
  21. package/.output/public/_nuxt/pIWeVmPw.js +1 -0
  22. package/.output/public/_nuxt/xrHaPo1U.js +60 -0
  23. package/.output/server/chunks/build/{Detail-DMMUwTWr.mjs → Detail-rpcemNXe.mjs} +674 -481
  24. package/.output/server/chunks/build/Detail-rpcemNXe.mjs.map +1 -0
  25. package/.output/server/chunks/build/DiffViewer-styles.B1FB5NJj.mjs +8 -0
  26. package/.output/server/chunks/build/DiffViewer-styles.B1FB5NJj.mjs.map +1 -0
  27. package/.output/server/chunks/build/{_prd_-ByugK4Yi.mjs → _prd_-CeibvZOH.mjs} +67 -233
  28. package/.output/server/chunks/build/_prd_-CeibvZOH.mjs.map +1 -0
  29. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  30. package/.output/server/chunks/build/{default-BKKgG7HJ.mjs → default-iq8SaDDN.mjs} +3 -3
  31. package/.output/server/chunks/build/default-iq8SaDDN.mjs.map +1 -0
  32. package/.output/server/chunks/build/{error-404-Bf6kdO80.mjs → error-404-DFale9A5.mjs} +2 -2
  33. package/.output/server/chunks/build/error-404-DFale9A5.mjs.map +1 -0
  34. package/.output/server/chunks/build/{index-DE1tjHAd.mjs → index-Po00RvHm.mjs} +2 -2
  35. package/.output/server/chunks/build/index-Po00RvHm.mjs.map +1 -0
  36. package/.output/server/chunks/build/{nuxt-link-SvT1nf8Z.mjs → nuxt-link-B4oWFn7n.mjs} +2 -2
  37. package/.output/server/chunks/build/nuxt-link-B4oWFn7n.mjs.map +1 -0
  38. package/.output/server/chunks/build/{repo-graph-DzT45gSB.mjs → repo-graph-BQVFpA-w.mjs} +5 -4
  39. package/.output/server/chunks/build/repo-graph-BQVFpA-w.mjs.map +1 -0
  40. package/.output/server/chunks/build/server.mjs +7 -7
  41. package/.output/server/chunks/build/styles.mjs +4 -5
  42. package/.output/server/chunks/build/{usePrd-hXZOmvAv.mjs → usePrd-Bb6jlnNZ.mjs} +2 -2
  43. package/.output/server/chunks/build/usePrd-Bb6jlnNZ.mjs.map +1 -0
  44. package/.output/server/chunks/nitro/nitro.mjs +663 -660
  45. package/.output/server/node_modules/@pierre/diffs/dist/components/File.js +324 -0
  46. package/.output/server/node_modules/@pierre/diffs/dist/components/FileDiff.js +395 -0
  47. package/.output/server/node_modules/@pierre/diffs/dist/components/FileStream.js +161 -0
  48. package/.output/server/node_modules/@pierre/diffs/dist/components/web-components.js +25 -0
  49. package/.output/server/node_modules/@pierre/diffs/dist/constants.js +23 -0
  50. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/areLanguagesAttached.js +11 -0
  51. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/attachResolvedLanguages.js +20 -0
  52. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/cleanUpResolvedLanguages.js +11 -0
  53. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/constants.js +8 -0
  54. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedLanguages.js +16 -0
  55. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/getResolvedOrResolveLanguage.js +11 -0
  56. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/hasResolvedLanguages.js +11 -0
  57. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguage.js +30 -0
  58. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/languages/resolveLanguages.js +25 -0
  59. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/shared_highlighter.js +71 -0
  60. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/areThemesAttached.js +12 -0
  61. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/attachResolvedThemes.js +24 -0
  62. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/cleanUpResolvedThemes.js +11 -0
  63. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/constants.js +9 -0
  64. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedOrResolveTheme.js +11 -0
  65. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/getResolvedThemes.js +16 -0
  66. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/hasResolvedThemes.js +11 -0
  67. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomCSSVariableTheme.js +18 -0
  68. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/registerCustomTheme.js +14 -0
  69. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/resolveTheme.js +35 -0
  70. package/.output/server/node_modules/@pierre/diffs/dist/highlighter/themes/resolveThemes.js +21 -0
  71. package/.output/server/node_modules/@pierre/diffs/dist/index.js +84 -0
  72. package/.output/server/node_modules/@pierre/diffs/dist/managers/LineSelectionManager.js +282 -0
  73. package/.output/server/node_modules/@pierre/diffs/dist/managers/MouseEventManager.js +244 -0
  74. package/.output/server/node_modules/@pierre/diffs/dist/managers/ResizeManager.js +132 -0
  75. package/.output/server/node_modules/@pierre/diffs/dist/managers/ScrollSyncManager.js +62 -0
  76. package/.output/server/node_modules/@pierre/diffs/dist/managers/UniversalRenderingManager.js +32 -0
  77. package/.output/server/node_modules/@pierre/diffs/dist/renderers/DiffHunksRenderer.js +655 -0
  78. package/.output/server/node_modules/@pierre/diffs/dist/renderers/FileRenderer.js +243 -0
  79. package/.output/server/node_modules/@pierre/diffs/dist/shiki-stream/stream.js +32 -0
  80. package/.output/server/node_modules/@pierre/diffs/dist/shiki-stream/tokenizer.js +71 -0
  81. package/.output/server/node_modules/@pierre/diffs/dist/sprite.js +55 -0
  82. package/.output/server/node_modules/@pierre/diffs/dist/style.js +6 -0
  83. package/.output/server/node_modules/@pierre/diffs/dist/themes/pierre-dark.js +1328 -0
  84. package/.output/server/node_modules/@pierre/diffs/dist/themes/pierre-light.js +1328 -0
  85. package/.output/server/node_modules/@pierre/diffs/dist/utils/areFilesEqual.js +8 -0
  86. package/.output/server/node_modules/@pierre/diffs/dist/utils/areObjectsEqual.js +18 -0
  87. package/.output/server/node_modules/@pierre/diffs/dist/utils/areOptionsEqual.js +12 -0
  88. package/.output/server/node_modules/@pierre/diffs/dist/utils/areSelectionsEqual.js +8 -0
  89. package/.output/server/node_modules/@pierre/diffs/dist/utils/areThemesEqual.js +9 -0
  90. package/.output/server/node_modules/@pierre/diffs/dist/utils/cleanLastNewline.js +8 -0
  91. package/.output/server/node_modules/@pierre/diffs/dist/utils/createAnnotationElement.js +21 -0
  92. package/.output/server/node_modules/@pierre/diffs/dist/utils/createAnnotationWrapperNode.js +12 -0
  93. package/.output/server/node_modules/@pierre/diffs/dist/utils/createCodeNode.js +12 -0
  94. package/.output/server/node_modules/@pierre/diffs/dist/utils/createEmptyRowBuffer.js +16 -0
  95. package/.output/server/node_modules/@pierre/diffs/dist/utils/createFileHeaderElement.js +84 -0
  96. package/.output/server/node_modules/@pierre/diffs/dist/utils/createHoverContentNode.js +15 -0
  97. package/.output/server/node_modules/@pierre/diffs/dist/utils/createNoNewlineElement.js +24 -0
  98. package/.output/server/node_modules/@pierre/diffs/dist/utils/createPreElement.js +28 -0
  99. package/.output/server/node_modules/@pierre/diffs/dist/utils/createRowNodes.js +20 -0
  100. package/.output/server/node_modules/@pierre/diffs/dist/utils/createSeparator.js +69 -0
  101. package/.output/server/node_modules/@pierre/diffs/dist/utils/createSpanNodeFromToken.js +13 -0
  102. package/.output/server/node_modules/@pierre/diffs/dist/utils/createStyleElement.js +19 -0
  103. package/.output/server/node_modules/@pierre/diffs/dist/utils/createTransformerWithState.js +56 -0
  104. package/.output/server/node_modules/@pierre/diffs/dist/utils/createUnsafeCSSStyleNode.js +12 -0
  105. package/.output/server/node_modules/@pierre/diffs/dist/utils/cssWrappers.js +21 -0
  106. package/.output/server/node_modules/@pierre/diffs/dist/utils/diffAcceptRejectHunk.js +82 -0
  107. package/.output/server/node_modules/@pierre/diffs/dist/utils/formatCSSVariablePrefix.js +8 -0
  108. package/.output/server/node_modules/@pierre/diffs/dist/utils/getFiletypeFromFileName.js +343 -0
  109. package/.output/server/node_modules/@pierre/diffs/dist/utils/getHighlighterOptions.js +13 -0
  110. package/.output/server/node_modules/@pierre/diffs/dist/utils/getHighlighterThemeStyles.js +40 -0
  111. package/.output/server/node_modules/@pierre/diffs/dist/utils/getHunkSeparatorSlotName.js +8 -0
  112. package/.output/server/node_modules/@pierre/diffs/dist/utils/getIconForType.js +15 -0
  113. package/.output/server/node_modules/@pierre/diffs/dist/utils/getLineAnnotationName.js +8 -0
  114. package/.output/server/node_modules/@pierre/diffs/dist/utils/getLineEndingType.js +11 -0
  115. package/.output/server/node_modules/@pierre/diffs/dist/utils/getLineNodes.js +15 -0
  116. package/.output/server/node_modules/@pierre/diffs/dist/utils/getSingularPatch.js +20 -0
  117. package/.output/server/node_modules/@pierre/diffs/dist/utils/getThemes.js +16 -0
  118. package/.output/server/node_modules/@pierre/diffs/dist/utils/getTotalLineCountFromHunks.js +10 -0
  119. package/.output/server/node_modules/@pierre/diffs/dist/utils/hast_utils.js +42 -0
  120. package/.output/server/node_modules/@pierre/diffs/dist/utils/isWorkerContext.js +8 -0
  121. package/.output/server/node_modules/@pierre/diffs/dist/utils/parseDiffDecorations.js +34 -0
  122. package/.output/server/node_modules/@pierre/diffs/dist/utils/parseDiffFromFile.js +23 -0
  123. package/.output/server/node_modules/@pierre/diffs/dist/utils/parseLineType.js +17 -0
  124. package/.output/server/node_modules/@pierre/diffs/dist/utils/parsePatchFiles.js +211 -0
  125. package/.output/server/node_modules/@pierre/diffs/dist/utils/prerenderHTMLIfNecessary.js +10 -0
  126. package/.output/server/node_modules/@pierre/diffs/dist/utils/processLine.js +42 -0
  127. package/.output/server/node_modules/@pierre/diffs/dist/utils/renderDiffWithHighlighter.js +339 -0
  128. package/.output/server/node_modules/@pierre/diffs/dist/utils/renderFileWithHighlighter.js +52 -0
  129. package/.output/server/node_modules/@pierre/diffs/dist/utils/setLanguageOverride.js +11 -0
  130. package/.output/server/node_modules/@pierre/diffs/dist/utils/setWrapperNodeProps.js +29 -0
  131. package/.output/server/node_modules/@pierre/diffs/package.json +89 -0
  132. package/.output/server/node_modules/@shikijs/transformers/dist/index.mjs +831 -0
  133. package/.output/server/node_modules/@shikijs/transformers/package.json +37 -0
  134. package/.output/server/node_modules/diff/libesm/convert/dmp.js +21 -0
  135. package/.output/server/node_modules/diff/libesm/convert/xml.js +31 -0
  136. package/.output/server/node_modules/diff/libesm/diff/array.js +16 -0
  137. package/.output/server/node_modules/diff/libesm/diff/base.js +253 -0
  138. package/.output/server/node_modules/diff/libesm/diff/character.js +7 -0
  139. package/.output/server/node_modules/diff/libesm/diff/css.js +10 -0
  140. package/.output/server/node_modules/diff/libesm/diff/json.js +78 -0
  141. package/.output/server/node_modules/diff/libesm/diff/line.js +65 -0
  142. package/.output/server/node_modules/diff/libesm/diff/sentence.js +43 -0
  143. package/.output/server/node_modules/diff/libesm/diff/word.js +296 -0
  144. package/.output/server/node_modules/diff/libesm/index.js +30 -0
  145. package/.output/server/node_modules/diff/libesm/package.json +1 -0
  146. package/.output/server/node_modules/diff/libesm/patch/apply.js +257 -0
  147. package/.output/server/node_modules/diff/libesm/patch/create.js +228 -0
  148. package/.output/server/node_modules/diff/libesm/patch/line-endings.js +44 -0
  149. package/.output/server/node_modules/diff/libesm/patch/parse.js +147 -0
  150. package/.output/server/node_modules/diff/libesm/patch/reverse.js +23 -0
  151. package/.output/server/node_modules/diff/libesm/util/distance-iterator.js +37 -0
  152. package/.output/server/node_modules/diff/libesm/util/params.js +14 -0
  153. package/.output/server/node_modules/diff/libesm/util/string.js +128 -0
  154. package/.output/server/node_modules/diff/package.json +132 -0
  155. package/.output/server/package.json +4 -1
  156. package/dist/server/utils/git.js +8 -6
  157. package/package.json +2 -1
  158. package/.output/public/_nuxt/6tINjQEd.js +0 -141
  159. package/.output/public/_nuxt/B2mIQf5X.js +0 -3
  160. package/.output/public/_nuxt/C0BBSDJ7.js +0 -1
  161. package/.output/public/_nuxt/CN46Bgts.js +0 -1
  162. package/.output/public/_nuxt/CTJgb0zb.js +0 -1
  163. package/.output/public/_nuxt/Cce168lk.js +0 -30
  164. package/.output/public/_nuxt/CyVSeLw5.js +0 -1
  165. package/.output/public/_nuxt/Detail.CYc96mGf.css +0 -1
  166. package/.output/public/_nuxt/ZNypZshD.js +0 -13
  167. package/.output/public/_nuxt/builds/meta/9ce7f1bc-d5e2-47bf-8026-f4910c257b2e.json +0 -1
  168. package/.output/public/_nuxt/entry.Bw0CE6Iz.css +0 -1
  169. package/.output/public/_nuxt/pYJYAY-W.js +0 -60
  170. package/.output/server/chunks/build/Detail-DMMUwTWr.mjs.map +0 -1
  171. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-d2dQvARr.mjs +0 -4
  172. package/.output/server/chunks/build/DiffViewer-styles-1.mjs-d2dQvARr.mjs.map +0 -1
  173. package/.output/server/chunks/build/DiffViewer-styles-2.mjs-X6QKNjM0.mjs +0 -4
  174. package/.output/server/chunks/build/DiffViewer-styles-2.mjs-X6QKNjM0.mjs.map +0 -1
  175. package/.output/server/chunks/build/DiffViewer-styles.0AbHFl6N.mjs +0 -8
  176. package/.output/server/chunks/build/DiffViewer-styles.0AbHFl6N.mjs.map +0 -1
  177. package/.output/server/chunks/build/DiffViewer-styles.BDwAqkTk.mjs +0 -8
  178. package/.output/server/chunks/build/DiffViewer-styles.BDwAqkTk.mjs.map +0 -1
  179. package/.output/server/chunks/build/DiffViewer-styles.DRJh5Ui4.mjs +0 -10
  180. package/.output/server/chunks/build/DiffViewer-styles.DRJh5Ui4.mjs.map +0 -1
  181. package/.output/server/chunks/build/_prd_-ByugK4Yi.mjs.map +0 -1
  182. package/.output/server/chunks/build/default-BKKgG7HJ.mjs.map +0 -1
  183. package/.output/server/chunks/build/error-404-Bf6kdO80.mjs.map +0 -1
  184. package/.output/server/chunks/build/index-DE1tjHAd.mjs.map +0 -1
  185. package/.output/server/chunks/build/nuxt-link-SvT1nf8Z.mjs.map +0 -1
  186. package/.output/server/chunks/build/repo-graph-DzT45gSB.mjs.map +0 -1
  187. package/.output/server/chunks/build/usePrd-hXZOmvAv.mjs.map +0 -1
@@ -1,20 +1,22 @@
1
- import { defineComponent, unref, mergeProps, withCtx, renderSlot, markRaw, ref, watch, computed, createVNode, useModel, createTextVNode, toDisplayString, openBlock, createBlock, createCommentVNode, resolveDynamicComponent, Fragment, renderList, mergeModels, useSSRContext } from 'vue';
1
+ import { defineComponent, unref, mergeProps, withCtx, renderSlot, markRaw, ref, watch, computed, createVNode, useModel, createTextVNode, toDisplayString, openBlock, createBlock, createCommentVNode, resolveDynamicComponent, Fragment, renderList, mergeModels, nextTick, useSSRContext } from 'vue';
2
2
  import { ssrRenderComponent, ssrRenderSlot, ssrRenderAttrs, ssrInterpolate, ssrRenderVNode, ssrRenderList, ssrRenderClass, ssrRenderAttr, ssrRenderStyle } from 'vue/server-renderer';
3
3
  import { reactiveOmit, useMediaQuery } from '@vueuse/core';
4
4
  import { Background } from '@vue-flow/background';
5
5
  import { Controls } from '@vue-flow/controls';
6
6
  import { MarkerType, VueFlow, Position, Handle } from '@vue-flow/core';
7
- import { Loader2, AlertCircle, GitBranch, Circle, Clock3, CheckCircle2, AlertTriangle, Clock, ArrowLeft, Tag, ListOrdered, CheckSquare, Check, Link2, Diff, Calendar, ExternalLink, X, RefreshCw, Keyboard, FileDiff, FileCode, GitCommit, FileText, Plus, Minus, FolderGit2, ArrowRight, FileWarning, ChevronDown, Link, Link2Off, FileEdit, FileX, FilePlus } from 'lucide-vue-next';
8
- import { c as cn, B as Button, b as useToast } from './usePrd-hXZOmvAv.mjs';
7
+ import { Loader2, AlertCircle, GitBranch, Circle, Clock3, CheckCircle2, AlertTriangle, Clock, ArrowLeft, Tag, ListOrdered, CheckSquare, Check, Link2, Diff, Calendar, ExternalLink, X, RefreshCw, Keyboard, GitCommit, FileText, Plus, Minus, FolderGit2, ArrowRight, FileWarning, ChevronDown, FileEdit, FileX, FilePlus } from 'lucide-vue-next';
8
+ import { parsePatchFiles, parseDiffFromFile, FileDiff, File } from '@pierre/diffs';
9
+ import { c as cn, B as Button, b as useToast } from './usePrd-Bb6jlnNZ.mjs';
10
+ import { c as useThemeMode } from './server.mjs';
9
11
  import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs';
10
- import { Primitive, useForwardPropsEmits, DialogRoot, DialogPortal, DialogContent, DialogClose, DialogTitle, DialogDescription, Separator as Separator$1, DialogOverlay, TooltipProvider as TooltipProvider$1, TooltipRoot, TooltipTrigger as TooltipTrigger$1, TooltipPortal, TooltipContent as TooltipContent$1, TooltipArrow, ScrollAreaRoot, ScrollAreaViewport, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, DialogTrigger } from 'reka-ui';
12
+ import { Primitive, useForwardPropsEmits, TabsRoot, TabsList as TabsList$1, useForwardProps, TabsTrigger as TabsTrigger$1, TabsContent as TabsContent$1, DialogRoot, DialogPortal, DialogContent, DialogClose, DialogTitle, DialogDescription, Separator as Separator$1, DialogOverlay, TooltipProvider as TooltipProvider$1, TooltipRoot, TooltipTrigger as TooltipTrigger$1, TooltipPortal, TooltipContent as TooltipContent$1, TooltipArrow, ScrollAreaRoot, ScrollAreaViewport, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, DialogTrigger } from 'reka-ui';
11
13
  import { cva } from 'class-variance-authority';
12
- import { _ as __nuxt_component_0$3 } from './nuxt-link-SvT1nf8Z.mjs';
14
+ import { _ as __nuxt_component_0$3 } from './nuxt-link-B4oWFn7n.mjs';
13
15
 
14
16
  var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var y=v((Fi,ee)=>{var Vt=Object.defineProperty,At=(e,t,r)=>t in e?Vt(e,t,{enumerable:true,configurable:true,writable:true,value:r}):e[t]=r,E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),k=(e,t,r)=>At(e,typeof t!="symbol"?t+"":t,r),R=E((e,t)=>{var r="\0",n="\0",i="",o=class{constructor(d){k(this,"_isDirected",true),k(this,"_isMultigraph",false),k(this,"_isCompound",false),k(this,"_label"),k(this,"_defaultNodeLabelFn",()=>{}),k(this,"_defaultEdgeLabelFn",()=>{}),k(this,"_nodes",{}),k(this,"_in",{}),k(this,"_preds",{}),k(this,"_out",{}),k(this,"_sucs",{}),k(this,"_edgeObjs",{}),k(this,"_edgeLabels",{}),k(this,"_nodeCount",0),k(this,"_edgeCount",0),k(this,"_parent"),k(this,"_children"),d&&(this._isDirected=Object.hasOwn(d,"directed")?d.directed:true,this._isMultigraph=Object.hasOwn(d,"multigraph")?d.multigraph:false,this._isCompound=Object.hasOwn(d,"compound")?d.compound:false),this._isCompound&&(this._parent={},this._children={},this._children[n]={});}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(d){return this._label=d,this}graph(){return this._label}setDefaultNodeLabel(d){return this._defaultNodeLabelFn=d,typeof d!="function"&&(this._defaultNodeLabelFn=()=>d),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var d=this;return this.nodes().filter(h=>Object.keys(d._in[h]).length===0)}sinks(){var d=this;return this.nodes().filter(h=>Object.keys(d._out[h]).length===0)}setNodes(d,h){var f=arguments,m=this;return d.forEach(function(p){f.length>1?m.setNode(p,h):m.setNode(p);}),this}setNode(d,h){return Object.hasOwn(this._nodes,d)?(arguments.length>1&&(this._nodes[d]=h),this):(this._nodes[d]=arguments.length>1?h:this._defaultNodeLabelFn(d),this._isCompound&&(this._parent[d]=n,this._children[d]={},this._children[n][d]=true),this._in[d]={},this._preds[d]={},this._out[d]={},this._sucs[d]={},++this._nodeCount,this)}node(d){return this._nodes[d]}hasNode(d){return Object.hasOwn(this._nodes,d)}removeNode(d){var h=this;if(Object.hasOwn(this._nodes,d)){var f=m=>h.removeEdge(h._edgeObjs[m]);delete this._nodes[d],this._isCompound&&(this._removeFromParentsChildList(d),delete this._parent[d],this.children(d).forEach(function(m){h.setParent(m);}),delete this._children[d]),Object.keys(this._in[d]).forEach(f),delete this._in[d],delete this._preds[d],Object.keys(this._out[d]).forEach(f),delete this._out[d],delete this._sucs[d],--this._nodeCount;}return this}setParent(d,h){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(h===void 0)h=n;else {h+="";for(var f=h;f!==void 0;f=this.parent(f))if(f===d)throw new Error("Setting "+h+" as parent of "+d+" would create a cycle");this.setNode(h);}return this.setNode(d),this._removeFromParentsChildList(d),this._parent[d]=h,this._children[h][d]=true,this}_removeFromParentsChildList(d){delete this._children[this._parent[d]][d];}parent(d){if(this._isCompound){var h=this._parent[d];if(h!==n)return h}}children(d=n){if(this._isCompound){var h=this._children[d];if(h)return Object.keys(h)}else {if(d===n)return this.nodes();if(this.hasNode(d))return []}}predecessors(d){var h=this._preds[d];if(h)return Object.keys(h)}successors(d){var h=this._sucs[d];if(h)return Object.keys(h)}neighbors(d){var h=this.predecessors(d);if(h){let m=new Set(h);for(var f of this.successors(d))m.add(f);return Array.from(m.values())}}isLeaf(d){var h;return this.isDirected()?h=this.successors(d):h=this.neighbors(d),h.length===0}filterNodes(d){var h=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});h.setGraph(this.graph());var f=this;Object.entries(this._nodes).forEach(function([w,b]){d(w)&&h.setNode(w,b);}),Object.values(this._edgeObjs).forEach(function(w){h.hasNode(w.v)&&h.hasNode(w.w)&&h.setEdge(w,f.edge(w));});var m={};function p(w){var b=f.parent(w);return b===void 0||h.hasNode(b)?(m[w]=b,b):b in m?m[b]:p(b)}return this._isCompound&&h.nodes().forEach(w=>h.setParent(w,p(w))),h}setDefaultEdgeLabel(d){return this._defaultEdgeLabelFn=d,typeof d!="function"&&(this._defaultEdgeLabelFn=()=>d),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(d,h){var f=this,m=arguments;return d.reduce(function(p,w){return m.length>1?f.setEdge(p,w,h):f.setEdge(p,w),w}),this}setEdge(){var d,h,f,m,p=false,w=arguments[0];typeof w=="object"&&w!==null&&"v"in w?(d=w.v,h=w.w,f=w.name,arguments.length===2&&(m=arguments[1],p=true)):(d=w,h=arguments[1],f=arguments[3],arguments.length>2&&(m=arguments[2],p=true)),d=""+d,h=""+h,f!==void 0&&(f=""+f);var b=l(this._isDirected,d,h,f);if(Object.hasOwn(this._edgeLabels,b))return p&&(this._edgeLabels[b]=m),this;if(f!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(d),this.setNode(h),this._edgeLabels[b]=p?m:this._defaultEdgeLabelFn(d,h,f);var g=u(this._isDirected,d,h,f);return d=g.v,h=g.w,Object.freeze(g),this._edgeObjs[b]=g,s(this._preds[h],d),s(this._sucs[d],h),this._in[h][b]=g,this._out[d][b]=g,this._edgeCount++,this}edge(d,h,f){var m=arguments.length===1?c(this._isDirected,arguments[0]):l(this._isDirected,d,h,f);return this._edgeLabels[m]}edgeAsObj(){let d=this.edge(...arguments);return typeof d!="object"?{label:d}:d}hasEdge(d,h,f){var m=arguments.length===1?c(this._isDirected,arguments[0]):l(this._isDirected,d,h,f);return Object.hasOwn(this._edgeLabels,m)}removeEdge(d,h,f){var m=arguments.length===1?c(this._isDirected,arguments[0]):l(this._isDirected,d,h,f),p=this._edgeObjs[m];return p&&(d=p.v,h=p.w,delete this._edgeLabels[m],delete this._edgeObjs[m],a(this._preds[h],d),a(this._sucs[d],h),delete this._in[h][m],delete this._out[d][m],this._edgeCount--),this}inEdges(d,h){return this.isDirected()?this.filterEdges(this._in[d],d,h):this.nodeEdges(d,h)}outEdges(d,h){return this.isDirected()?this.filterEdges(this._out[d],d,h):this.nodeEdges(d,h)}nodeEdges(d,h){if(d in this._nodes)return this.filterEdges({...this._in[d],...this._out[d]},d,h)}filterEdges(d,h,f){if(d){var m=Object.values(d);return f?m.filter(function(p){return p.v===h&&p.w===f||p.v===f&&p.w===h}):m}}};function s(d,h){d[h]?d[h]++:d[h]=1;}function a(d,h){--d[h]||delete d[h];}function l(d,h,f,m){var p=""+h,w=""+f;if(!d&&p>w){var b=p;p=w,w=b;}return p+i+w+i+(m===void 0?r:m)}function u(d,h,f,m){var p=""+h,w=""+f;if(!d&&p>w){var b=p;p=w,w=b;}var g={v:p,w};return m&&(g.name=m),g}function c(d,h){return l(d,h.v,h.w,h.name)}t.exports=o;}),Yt=E((e,t)=>{t.exports="3.0.2";}),Bt=E((e,t)=>{t.exports={Graph:R(),version:Yt()};}),Wt=E((e,t)=>{var r=R();t.exports={write:n,read:s};function n(a){var l={options:{directed:a.isDirected(),multigraph:a.isMultigraph(),compound:a.isCompound()},nodes:i(a),edges:o(a)};return a.graph()!==void 0&&(l.value=structuredClone(a.graph())),l}function i(a){return a.nodes().map(function(l){var u=a.node(l),c=a.parent(l),d={v:l};return u!==void 0&&(d.value=u),c!==void 0&&(d.parent=c),d})}function o(a){return a.edges().map(function(l){var u=a.edge(l),c={v:l.v,w:l.w};return l.name!==void 0&&(c.name=l.name),u!==void 0&&(c.value=u),c})}function s(a){var l=new r(a.options).setGraph(a.value);return a.nodes.forEach(function(u){l.setNode(u.v,u.value),u.parent&&l.setParent(u.v,u.parent);}),a.edges.forEach(function(u){l.setEdge({v:u.v,w:u.w,name:u.name},u.value);}),l}}),U=E((e,t)=>{t.exports=n;var r=()=>1;function n(o,s,a,l){return i(o,String(s),a||r,l||function(u){return o.outEdges(u)})}function i(o,s,a,l){var u={},c=true,d=0,h=o.nodes(),f=function(b){var g=a(b);u[b.v].distance+g<u[b.w].distance&&(u[b.w]={distance:u[b.v].distance+g,predecessor:b.v},c=true);},m=function(){h.forEach(function(b){l(b).forEach(function(g){var I=g.v===b?g.v:g.w,Gt=I===g.v?g.w:g.v;f({v:I,w:Gt});});});};h.forEach(function(b){var g=b===s?0:Number.POSITIVE_INFINITY;u[b]={distance:g};});for(var p=h.length,w=1;w<p&&(c=false,d++,m(),!!c);w++);if(d===p-1&&(c=false,m(),c))throw new Error("The graph contains a negative weight cycle");return u}}),zt=E((e,t)=>{t.exports=r;function r(n){var i={},o=[],s;function a(l){Object.hasOwn(i,l)||(i[l]=true,s.push(l),n.successors(l).forEach(a),n.predecessors(l).forEach(a));}return n.nodes().forEach(function(l){s=[],a(l),s.length&&o.push(s);}),o}}),K=E((e,t)=>{var r=class{constructor(){k(this,"_arr",[]),k(this,"_keyIndices",{});}size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var i=this._keyIndices[n];if(i!==void 0)return this._arr[i].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,i){var o=this._keyIndices;if(n=String(n),!Object.hasOwn(o,n)){var s=this._arr,a=s.length;return o[n]=a,s.push({key:n,priority:i}),this._decrease(a),true}return false}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,i){var o=this._keyIndices[n];if(i>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[o].priority+" New: "+i);this._arr[o].priority=i,this._decrease(o);}_heapify(n){var i=this._arr,o=2*n,s=o+1,a=n;o<i.length&&(a=i[o].priority<i[a].priority?o:a,s<i.length&&(a=i[s].priority<i[a].priority?s:a),a!==n&&(this._swap(n,a),this._heapify(a)));}_decrease(n){for(var i=this._arr,o=i[n].priority,s;n!==0&&(s=n>>1,!(i[s].priority<o));)this._swap(n,s),n=s;}_swap(n,i){var o=this._arr,s=this._keyIndices,a=o[n],l=o[i];o[n]=l,o[i]=a,s[l.key]=n,s[a.key]=i;}};t.exports=r;}),T=E((e,t)=>{var r=K();t.exports=i;var n=()=>1;function i(s,a,l,u){var c=function(d){return s.outEdges(d)};return o(s,String(a),l||n,u||c)}function o(s,a,l,u){var c={},d=new r,h,f,m=function(p){var w=p.v!==h?p.v:p.w,b=c[w],g=l(p),I=f.distance+g;if(g<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+p+" Weight: "+g);I<b.distance&&(b.distance=I,b.predecessor=h,d.decrease(w,I));};for(s.nodes().forEach(function(p){var w=p===a?0:Number.POSITIVE_INFINITY;c[p]={distance:w},d.add(p,w);});d.size()>0&&(h=d.removeMin(),f=c[h],f.distance!==Number.POSITIVE_INFINITY);)u(h).forEach(m);return c}}),Xt=E((e,t)=>{var r=T();t.exports=n;function n(i,o,s){return i.nodes().reduce(function(a,l){return a[l]=r(i,l,o,s),a},{})}}),Ht=E((e,t)=>{t.exports=r;function r(i,o,s){if(i[o].predecessor!==void 0)throw new Error("Invalid source vertex");if(i[s].predecessor===void 0&&s!==o)throw new Error("Invalid destination vertex");return {weight:i[s].distance,path:n(i,o,s)}}function n(i,o,s){for(var a=[],l=s;l!==o;)a.push(l),l=i[l].predecessor;return a.push(o),a.reverse()}}),Q=E((e,t)=>{t.exports=r;function r(n){var i=0,o=[],s={},a=[];function l(u){var c=s[u]={onStack:true,lowlink:i,index:i++};if(o.push(u),n.successors(u).forEach(function(f){Object.hasOwn(s,f)?s[f].onStack&&(c.lowlink=Math.min(c.lowlink,s[f].index)):(l(f),c.lowlink=Math.min(c.lowlink,s[f].lowlink));}),c.lowlink===c.index){var d=[],h;do h=o.pop(),s[h].onStack=false,d.push(h);while(u!==h);a.push(d);}}return n.nodes().forEach(function(u){Object.hasOwn(s,u)||l(u);}),a}}),Ut=E((e,t)=>{var r=Q();t.exports=n;function n(i){return r(i).filter(function(o){return o.length>1||o.length===1&&i.hasEdge(o[0],o[0])})}}),Kt=E((e,t)=>{t.exports=n;var r=()=>1;function n(o,s,a){return i(o,s||r,a||function(l){return o.outEdges(l)})}function i(o,s,a){var l={},u=o.nodes();return u.forEach(function(c){l[c]={},l[c][c]={distance:0},u.forEach(function(d){c!==d&&(l[c][d]={distance:Number.POSITIVE_INFINITY});}),a(c).forEach(function(d){var h=d.v===c?d.w:d.v,f=s(d);l[c][h]={distance:f,predecessor:c};});}),u.forEach(function(c){var d=l[c];u.forEach(function(h){var f=l[h];u.forEach(function(m){var p=f[c],w=d[m],b=f[m],g=p.distance+w.distance;g<b.distance&&(b.distance=g,b.predecessor=w.predecessor);});});}),l}}),J=E((e,t)=>{function r(i){var o={},s={},a=[];function l(u){if(Object.hasOwn(s,u))throw new n;Object.hasOwn(o,u)||(s[u]=true,o[u]=true,i.predecessors(u).forEach(l),delete s[u],a.push(u));}if(i.sinks().forEach(l),Object.keys(o).length!==i.nodeCount())throw new n;return a}var n=class extends Error{constructor(){super(...arguments);}};t.exports=r,r.CycleException=n;}),Qt=E((e,t)=>{var r=J();t.exports=n;function n(i){try{r(i);}catch(o){if(o instanceof r.CycleException)return false;throw o}return true}}),Z=E((e,t)=>{t.exports=r;function r(i,o,s,a,l){Array.isArray(o)||(o=[o]);var u=(i.isDirected()?i.successors:i.neighbors).bind(i),c={};return o.forEach(function(d){if(!i.hasNode(d))throw new Error("Graph does not have node: "+d);l=n(i,d,s==="post",c,u,a,l);}),l}function n(i,o,s,a,l,u,c){return Object.hasOwn(a,o)||(a[o]=true,s||(c=u(c,o)),l(o).forEach(function(d){c=n(i,d,s,a,l,u,c);}),s&&(c=u(c,o))),c}}),$=E((e,t)=>{var r=Z();t.exports=n;function n(i,o,s){return r(i,o,s,function(a,l){return a.push(l),a},[])}}),Jt=E((e,t)=>{var r=$();t.exports=n;function n(i,o){return r(i,o,"post")}}),Zt=E((e,t)=>{var r=$();t.exports=n;function n(i,o){return r(i,o,"pre")}}),$t=E((e,t)=>{var r=R(),n=K();t.exports=i;function i(o,s){var a=new r,l={},u=new n,c;function d(f){var m=f.v===c?f.w:f.v,p=u.priority(m);if(p!==void 0){var w=s(f);w<p&&(l[m]=c,u.decrease(m,w));}}if(o.nodeCount()===0)return a;o.nodes().forEach(function(f){u.add(f,Number.POSITIVE_INFINITY),a.setNode(f);}),u.decrease(o.nodes()[0],0);for(var h=false;u.size()>0;){if(c=u.removeMin(),Object.hasOwn(l,c))a.setEdge(c,l[c]);else {if(h)throw new Error("Input graph is not connected: "+o);h=true;}o.nodeEdges(c).forEach(d);}return a}}),er=E((e,t)=>{var r=T(),n=U();t.exports=i;function i(s,a,l,u){return o(s,a,l,u||function(c){return s.outEdges(c)})}function o(s,a,l,u){if(l===void 0)return r(s,a,l,u);for(var c=false,d=s.nodes(),h=0;h<d.length;h++){for(var f=u(d[h]),m=0;m<f.length;m++){var p=f[m],w=p.v===d[h]?p.v:p.w,b=w===p.v?p.w:p.v;l({v:w,w:b})<0&&(c=true);}if(c)return n(s,a,l,u)}return r(s,a,l,u)}}),tr=E((e,t)=>{t.exports={bellmanFord:U(),components:zt(),dijkstra:T(),dijkstraAll:Xt(),extractPath:Ht(),findCycles:Ut(),floydWarshall:Kt(),isAcyclic:Qt(),postorder:Jt(),preorder:Zt(),prim:$t(),shortestPaths:er(),reduce:Z(),tarjan:Q(),topsort:J()};}),H=Bt();ee.exports={Graph:H.Graph,json:Wt(),alg:tr(),version:H.version};});var ne=v((Ai,re)=>{var S=class{constructor(){let t={};t._next=t._prev=t,this._sentinel=t;}dequeue(){let t=this._sentinel,r=t._prev;if(r!==t)return te(r),r}enqueue(t){let r=this._sentinel;t._prev&&t._next&&te(t),t._next=r._next,r._next._prev=t,r._next=t,t._prev=r;}toString(){let t=[],r=this._sentinel,n=r._prev;for(;n!==r;)t.push(JSON.stringify(n,rr)),n=n._prev;return "["+t.join(", ")+"]"}};function te(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev;}function rr(e,t){if(e!=="_next"&&e!=="_prev")return t}re.exports=S;});var oe=v((Yi,ie)=>{var nr=y().Graph,ir=ne();ie.exports=sr;var or=()=>1;function sr(e,t){if(e.nodeCount()<=1)return [];let r=dr(e,t||or);return ar(r.graph,r.buckets,r.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w))}function ar(e,t,r){let n=[],i=t[t.length-1],o=t[0],s;for(;e.nodeCount();){for(;s=o.dequeue();)P(e,t,r,s);for(;s=i.dequeue();)P(e,t,r,s);if(e.nodeCount()){for(let a=t.length-2;a>0;--a)if(s=t[a].dequeue(),s){n=n.concat(P(e,t,r,s,true));break}}}return n}function P(e,t,r,n,i){let o=i?[]:void 0;return e.inEdges(n.v).forEach(s=>{let a=e.edge(s),l=e.node(s.v);i&&o.push({v:s.v,w:s.w}),l.out-=a,F(t,r,l);}),e.outEdges(n.v).forEach(s=>{let a=e.edge(s),l=s.w,u=e.node(l);u.in-=a,F(t,r,u);}),e.removeNode(n.v),o}function dr(e,t){let r=new nr,n=0,i=0;e.nodes().forEach(a=>{r.setNode(a,{v:a,in:0,out:0});}),e.edges().forEach(a=>{let l=r.edge(a.v,a.w)||0,u=t(a),c=l+u;r.setEdge(a.v,a.w,c),i=Math.max(i,r.node(a.v).out+=u),n=Math.max(n,r.node(a.w).in+=u);});let o=lr(i+n+3).map(()=>new ir),s=n+1;return r.nodes().forEach(a=>{F(o,s,r.node(a));}),{graph:r,buckets:o,zeroIdx:s}}function F(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r);}function lr(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t}});var _=v((Bi,ce)=>{var se=y().Graph;ce.exports={addBorderNode:vr,addDummyNode:ae,applyWithChunking:C,asNonCompoundGraph:hr,buildLayerMatrix:mr,intersectRect:pr,mapValues:Or,maxRank:le,normalizeRanks:wr,notime:kr,partition:Er,pick:xr,predecessorWeights:fr,range:he,removeEmptyRanks:br,simplify:ur,successorWeights:cr,time:_r,uniqueId:ue,zipObject:D};function ae(e,t,r,n){for(var i=n;e.hasNode(i);)i=ue(n);return r.dummy=t,e.setNode(i,r),i}function ur(e){let t=new se().setGraph(e.graph());return e.nodes().forEach(r=>t.setNode(r,e.node(r))),e.edges().forEach(r=>{let n=t.edge(r.v,r.w)||{weight:0,minlen:1},i=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)});}),t}function hr(e){let t=new se({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r));}),e.edges().forEach(r=>{t.setEdge(r,e.edge(r));}),t}function cr(e){let t=e.nodes().map(r=>{let n={};return e.outEdges(r).forEach(i=>{n[i.w]=(n[i.w]||0)+e.edge(i).weight;}),n});return D(e.nodes(),t)}function fr(e){let t=e.nodes().map(r=>{let n={};return e.inEdges(r).forEach(i=>{n[i.v]=(n[i.v]||0)+e.edge(i).weight;}),n});return D(e.nodes(),t)}function pr(e,t){let r=e.x,n=e.y,i=t.x-r,o=t.y-n,s=e.width/2,a=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");let l,u;return Math.abs(o)*s>Math.abs(i)*a?(o<0&&(a=-a),l=a*i/o,u=a):(i<0&&(s=-s),l=s,u=s*o/i),{x:r+l,y:n+u}}function mr(e){let t=he(le(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),i=n.rank;i!==void 0&&(t[i][n.order]=r);}),t}function wr(e){let t=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MAX_VALUE:i}),r=C(Math.min,t);e.nodes().forEach(n=>{let i=e.node(n);Object.hasOwn(i,"rank")&&(i.rank-=r);});}function br(e){let t=e.nodes().map(s=>e.node(s).rank).filter(s=>s!==void 0),r=C(Math.min,t),n=[];e.nodes().forEach(s=>{let a=e.node(s).rank-r;n[a]||(n[a]=[]),n[a].push(s);});let i=0,o=e.graph().nodeRankFactor;Array.from(n).forEach((s,a)=>{s===void 0&&a%o!==0?--i:s!==void 0&&i&&s.forEach(l=>e.node(l).rank+=i);});}function vr(e,t,r,n){let i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),ae(e,"border",i,t)}function gr(e,t=de){let r=[];for(let n=0;n<e.length;n+=t){let i=e.slice(n,n+t);r.push(i);}return r}var de=65535;function C(e,t){if(t.length>de){let r=gr(t);return e.apply(null,r.map(n=>e.apply(null,n)))}else return e.apply(null,t)}function le(e){let r=e.nodes().map(n=>{let i=e.node(n).rank;return i===void 0?Number.MIN_VALUE:i});return C(Math.max,r)}function Er(e,t){let r={lhs:[],rhs:[]};return e.forEach(n=>{t(n)?r.lhs.push(n):r.rhs.push(n);}),r}function _r(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms");}}function kr(e,t){return t()}var yr=0;function ue(e){var t=++yr;return e+(""+t)}function he(e,t,r=1){t==null&&(t=e,e=0);let n=o=>o<t;r<0&&(n=o=>t<o);let i=[];for(let o=e;n(o);o+=r)i.push(o);return i}function xr(e,t){let r={};for(let n of t)e[n]!==void 0&&(r[n]=e[n]);return r}function Or(e,t){let r=t;return typeof t=="string"&&(r=n=>n[t]),Object.entries(e).reduce((n,[i,o])=>(n[i]=r(o,i),n),{})}function D(e,t){return e.reduce((r,n,i)=>(r[n]=t[i],r),{})}});var pe=v((Wi,fe)=>{var Nr=oe(),Ir=_().uniqueId;fe.exports={run:jr,undo:Lr};function jr(e){(e.graph().acyclicer==="greedy"?Nr(e,r(e)):Cr(e)).forEach(n=>{let i=e.edge(n);e.removeEdge(n),i.forwardName=n.name,i.reversed=true,e.setEdge(n.w,n.v,i,Ir("rev"));});function r(n){return i=>n.edge(i).weight}}function Cr(e){let t=[],r={},n={};function i(o){Object.hasOwn(n,o)||(n[o]=true,r[o]=true,e.outEdges(o).forEach(s=>{Object.hasOwn(r,s.w)?t.push(s):i(s.w);}),delete r[o]);}return e.nodes().forEach(i),t}function Lr(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n);}});}});var we=v((zi,me)=>{var qr=_();me.exports={run:Mr,undo:Tr};function Mr(e){e.graph().dummyChains=[],e.edges().forEach(t=>Rr(e,t));}function Rr(e,t){let r=t.v,n=e.node(r).rank,i=t.w,o=e.node(i).rank,s=t.name,a=e.edge(t),l=a.labelRank;if(o===n+1)return;e.removeEdge(t);let u,c,d;for(d=0,++n;n<o;++d,++n)a.points=[],c={width:0,height:0,edgeLabel:a,edgeObj:t,rank:n},u=qr.addDummyNode(e,"edge",c,"_d"),n===l&&(c.width=a.width,c.height=a.height,c.dummy="edge-label",c.labelpos=a.labelpos),e.setEdge(r,u,{weight:a.weight},s),d===0&&e.graph().dummyChains.push(u),r=u;e.setEdge(r,i,{weight:a.weight},s);}function Tr(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,i;for(e.setEdge(r.edgeObj,n);r.dummy;)i=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=i,r=e.node(t);});}});var j=v((Xi,be)=>{var{applyWithChunking:Sr}=_();be.exports={longestPath:Pr,slack:Fr};function Pr(e){var t={};function r(n){var i=e.node(n);if(Object.hasOwn(t,n))return i.rank;t[n]=true;let o=e.outEdges(n).map(a=>a==null?Number.POSITIVE_INFINITY:r(a.w)-e.edge(a).minlen);var s=Sr(Math.min,o);return s===Number.POSITIVE_INFINITY&&(s=0),i.rank=s}e.sources().forEach(r);}function Fr(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}});var G=v((Hi,ve)=>{var Dr=y().Graph,L=j().slack;ve.exports=Gr;function Gr(e){var t=new Dr({directed:false}),r=e.nodes()[0],n=e.nodeCount();t.setNode(r,{});for(var i,o;Vr(t,e)<n;)i=Ar(t,e),o=t.hasNode(i.v)?L(e,i):-L(e,i),Yr(t,e,o);return t}function Vr(e,t){function r(n){t.nodeEdges(n).forEach(i=>{var o=i.v,s=n===o?i.w:o;!e.hasNode(s)&&!L(t,i)&&(e.setNode(s,{}),e.setEdge(n,s,{}),r(s));});}return e.nodes().forEach(r),e.nodeCount()}function Ar(e,t){return t.edges().reduce((n,i)=>{let o=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(o=L(t,i)),o<n[0]?[o,i]:n},[Number.POSITIVE_INFINITY,null])[1]}function Yr(e,t,r){e.nodes().forEach(n=>t.node(n).rank+=r);}});var Ie=v((Ui,Ne)=>{var Br=G(),ge=j().slack,Wr=j().longestPath,zr=y().alg.preorder,Xr=y().alg.postorder,Hr=_().simplify;Ne.exports=N;N.initLowLimValues=A;N.initCutValues=V;N.calcCutValue=_e;N.leaveEdge=ye;N.enterEdge=xe;N.exchangeEdges=Oe;function N(e){e=Hr(e),Wr(e);var t=Br(e);A(t),V(t,e);for(var r,n;r=ye(t);)n=xe(t,e,r),Oe(t,e,r,n);}function V(e,t){var r=Xr(e,e.nodes());r=r.slice(0,r.length-1),r.forEach(n=>Ur(e,t,n));}function Ur(e,t,r){var n=e.node(r),i=n.parent;e.edge(r,i).cutvalue=_e(e,t,r);}function _e(e,t,r){var n=e.node(r),i=n.parent,o=true,s=t.edge(r,i),a=0;return s||(o=false,s=t.edge(i,r)),a=s.weight,t.nodeEdges(r).forEach(l=>{var u=l.v===r,c=u?l.w:l.v;if(c!==i){var d=u===o,h=t.edge(l).weight;if(a+=d?h:-h,Qr(e,r,c)){var f=e.edge(r,c).cutvalue;a+=d?-f:f;}}}),a}function A(e,t){arguments.length<2&&(t=e.nodes()[0]),ke(e,{},1,t);}function ke(e,t,r,n,i){var o=r,s=e.node(n);return t[n]=true,e.neighbors(n).forEach(a=>{Object.hasOwn(t,a)||(r=ke(e,t,r,a,n));}),s.low=o,s.lim=r++,i?s.parent=i:delete s.parent,r}function ye(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function xe(e,t,r){var n=r.v,i=r.w;t.hasEdge(n,i)||(n=r.w,i=r.v);var o=e.node(n),s=e.node(i),a=o,l=false;o.lim>s.lim&&(a=s,l=true);var u=t.edges().filter(c=>l===Ee(e,e.node(c.v),a)&&l!==Ee(e,e.node(c.w),a));return u.reduce((c,d)=>ge(t,d)<ge(t,c)?d:c)}function Oe(e,t,r,n){var i=r.v,o=r.w;e.removeEdge(i,o),e.setEdge(n.v,n.w,{}),A(e),V(e,t),Kr(e,t);}function Kr(e,t){var r=e.nodes().find(i=>!t.node(i).parent),n=zr(e,r);n=n.slice(1),n.forEach(i=>{var o=e.node(i).parent,s=t.edge(i,o),a=false;s||(s=t.edge(o,i),a=true),t.node(i).rank=t.node(o).rank+(a?s.minlen:-s.minlen);});}function Qr(e,t,r){return e.hasEdge(t,r)}function Ee(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}});var qe=v((Ki,Le)=>{var Jr=j(),Ce=Jr.longestPath,Zr=G(),$r=Ie();Le.exports=en;function en(e){var t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case "network-simplex":je(e);break;case "tight-tree":rn(e);break;case "longest-path":tn(e);break;case "none":break;default:je(e);}}var tn=Ce;function rn(e){Ce(e),Zr(e);}function je(e){$r(e);}});var Re=v((Qi,Me)=>{Me.exports=nn;function nn(e){let t=sn(e);e.graph().dummyChains.forEach(r=>{let n=e.node(r),i=n.edgeObj,o=on(e,t,i.v,i.w),s=o.path,a=o.lca,l=0,u=s[l],c=true;for(;r!==i.w;){if(n=e.node(r),c){for(;(u=s[l])!==a&&e.node(u).maxRank<n.rank;)l++;u===a&&(c=false);}if(!c){for(;l<s.length-1&&e.node(u=s[l+1]).minRank<=n.rank;)l++;u=s[l];}e.setParent(r,u),r=e.successors(r)[0];}});}function on(e,t,r,n){let i=[],o=[],s=Math.min(t[r].low,t[n].low),a=Math.max(t[r].lim,t[n].lim),l,u;l=r;do l=e.parent(l),i.push(l);while(l&&(t[l].low>s||a>t[l].lim));for(u=l,l=n;(l=e.parent(l))!==u;)o.push(l);return {path:i.concat(o.reverse()),lca:u}}function sn(e){let t={},r=0;function n(i){let o=r;e.children(i).forEach(n),t[i]={low:o,lim:r++};}return e.children().forEach(n),t}});var Pe=v((Ji,Se)=>{var q=_();Se.exports={run:an,cleanup:un};function an(e){let t=q.addDummyNode(e,"root",{},"_root"),r=dn(e),n=Object.values(r),i=q.applyWithChunking(Math.max,n)-1,o=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(a=>e.edge(a).minlen*=o);let s=ln(e)+1;e.children().forEach(a=>Te(e,t,o,s,i,r,a)),e.graph().nodeRankFactor=o;}function Te(e,t,r,n,i,o,s){let a=e.children(s);if(!a.length){s!==t&&e.setEdge(t,s,{weight:0,minlen:r});return}let l=q.addBorderNode(e,"_bt"),u=q.addBorderNode(e,"_bb"),c=e.node(s);e.setParent(l,s),c.borderTop=l,e.setParent(u,s),c.borderBottom=u,a.forEach(d=>{Te(e,t,r,n,i,o,d);let h=e.node(d),f=h.borderTop?h.borderTop:d,m=h.borderBottom?h.borderBottom:d,p=h.borderTop?n:2*n,w=f!==m?1:i-o[s]+1;e.setEdge(l,f,{weight:p,minlen:w,nestingEdge:true}),e.setEdge(m,u,{weight:p,minlen:w,nestingEdge:true});}),e.parent(s)||e.setEdge(t,l,{weight:0,minlen:i+o[s]});}function dn(e){var t={};function r(n,i){var o=e.children(n);o&&o.length&&o.forEach(s=>r(s,i+1)),t[n]=i;}return e.children().forEach(n=>r(n,1)),t}function ln(e){return e.edges().reduce((t,r)=>t+e.edge(r).weight,0)}function un(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(r=>{var n=e.edge(r);n.nestingEdge&&e.removeEdge(r);});}});var Ge=v((Zi,De)=>{var hn=_();De.exports=cn;function cn(e){function t(r){let n=e.children(r),i=e.node(r);if(n.length&&n.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let o=i.minRank,s=i.maxRank+1;o<s;++o)Fe(e,"borderLeft","_bl",r,i,o),Fe(e,"borderRight","_br",r,i,o);}}e.children().forEach(t);}function Fe(e,t,r,n,i,o){let s={width:0,height:0,rank:o,borderType:t},a=i[t][o-1],l=hn.addDummyNode(e,"border",s,r);i[t][o]=l,e.setParent(l,n),a&&e.setEdge(a,l,{weight:1});}});var Be=v(($i,Ye)=>{Ye.exports={adjust:fn,undo:pn};function fn(e){let t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&Ae(e);}function pn(e){let t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&mn(e),(t==="lr"||t==="rl")&&(wn(e),Ae(e));}function Ae(e){e.nodes().forEach(t=>Ve(e.node(t))),e.edges().forEach(t=>Ve(e.edge(t)));}function Ve(e){let t=e.width;e.width=e.height,e.height=t;}function mn(e){e.nodes().forEach(t=>Y(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);r.points.forEach(Y),Object.hasOwn(r,"y")&&Y(r);});}function Y(e){e.y=-e.y;}function wn(e){e.nodes().forEach(t=>B(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);r.points.forEach(B),Object.hasOwn(r,"x")&&B(r);});}function B(e){let t=e.x;e.x=e.y,e.y=t;}});var Xe=v((eo,ze)=>{var We=_();ze.exports=bn;function bn(e){let t={},r=e.nodes().filter(l=>!e.children(l).length),n=r.map(l=>e.node(l).rank),i=We.applyWithChunking(Math.max,n),o=We.range(i+1).map(()=>[]);function s(l){if(t[l])return;t[l]=true;let u=e.node(l);o[u.rank].push(l),e.successors(l).forEach(s);}return r.sort((l,u)=>e.node(l).rank-e.node(u).rank).forEach(s),o}});var Ue=v((to,He)=>{var vn=_().zipObject;He.exports=gn;function gn(e,t){let r=0;for(let n=1;n<t.length;++n)r+=En(e,t[n-1],t[n]);return r}function En(e,t,r){let n=vn(r,r.map((u,c)=>c)),i=t.flatMap(u=>e.outEdges(u).map(c=>({pos:n[c.w],weight:e.edge(c).weight})).sort((c,d)=>c.pos-d.pos)),o=1;for(;o<r.length;)o<<=1;let s=2*o-1;o-=1;let a=new Array(s).fill(0),l=0;return i.forEach(u=>{let c=u.pos+o;a[c]+=u.weight;let d=0;for(;c>0;)c%2&&(d+=a[c+1]),c=c-1>>1,a[c]+=u.weight;l+=u.weight*d;}),l}});var Qe=v((ro,Ke)=>{Ke.exports=_n;function _n(e,t=[]){return t.map(r=>{let n=e.inEdges(r);if(n.length){let i=n.reduce((o,s)=>{let a=e.edge(s),l=e.node(s.v);return {sum:o.sum+a.weight*l.order,weight:o.weight+a.weight}},{sum:0,weight:0});return {v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return {v:r}})}});var Ze=v((no,Je)=>{var kn=_();Je.exports=yn;function yn(e,t){let r={};e.forEach((i,o)=>{let s=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};i.barycenter!==void 0&&(s.barycenter=i.barycenter,s.weight=i.weight);}),t.edges().forEach(i=>{let o=r[i.v],s=r[i.w];o!==void 0&&s!==void 0&&(s.indegree++,o.out.push(r[i.w]));});let n=Object.values(r).filter(i=>!i.indegree);return xn(n)}function xn(e){let t=[];function r(i){return o=>{o.merged||(o.barycenter===void 0||i.barycenter===void 0||o.barycenter>=i.barycenter)&&On(i,o);}}function n(i){return o=>{o.in.push(i),--o.indegree===0&&e.push(o);}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(r(i)),i.out.forEach(n(i));}return t.filter(i=>!i.merged).map(i=>kn.pick(i,["vs","i","barycenter","weight"]))}function On(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=true;}});var tt=v((io,et)=>{var Nn=_();et.exports=In;function In(e,t){let r=Nn.partition(e,c=>Object.hasOwn(c,"barycenter")),n=r.lhs,i=r.rhs.sort((c,d)=>d.i-c.i),o=[],s=0,a=0,l=0;n.sort(jn(!!t)),l=$e(o,i,l),n.forEach(c=>{l+=c.vs.length,o.push(c.vs),s+=c.barycenter*c.weight,a+=c.weight,l=$e(o,i,l);});let u={vs:o.flat(true)};return a&&(u.barycenter=s/a,u.weight=a),u}function $e(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}function jn(e){return (t,r)=>t.barycenter<r.barycenter?-1:t.barycenter>r.barycenter?1:e?r.i-t.i:t.i-r.i}});var it=v((oo,nt)=>{var Cn=Qe(),Ln=Ze(),qn=tt();nt.exports=rt;function rt(e,t,r,n){let i=e.children(t),o=e.node(t),s=o?o.borderLeft:void 0,a=o?o.borderRight:void 0,l={};s&&(i=i.filter(h=>h!==s&&h!==a));let u=Cn(e,i);u.forEach(h=>{if(e.children(h.v).length){let f=rt(e,h.v,r,n);l[h.v]=f,Object.hasOwn(f,"barycenter")&&Rn(h,f);}});let c=Ln(u,r);Mn(c,l);let d=qn(c,n);if(s&&(d.vs=[s,d.vs,a].flat(true),e.predecessors(s).length)){let h=e.node(e.predecessors(s)[0]),f=e.node(e.predecessors(a)[0]);Object.hasOwn(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+h.order+f.order)/(d.weight+2),d.weight+=2;}return d}function Mn(e,t){e.forEach(r=>{r.vs=r.vs.flatMap(n=>t[n]?t[n].vs:n);});}function Rn(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight);}});var st=v((so,ot)=>{var Tn=y().Graph,Sn=_();ot.exports=Pn;function Pn(e,t,r,n){n||(n=e.nodes());let i=Fn(e),o=new Tn({compound:true}).setGraph({root:i}).setDefaultNodeLabel(s=>e.node(s));return n.forEach(s=>{let a=e.node(s),l=e.parent(s);(a.rank===t||a.minRank<=t&&t<=a.maxRank)&&(o.setNode(s),o.setParent(s,l||i),e[r](s).forEach(u=>{let c=u.v===s?u.w:u.v,d=o.edge(c,s),h=d!==void 0?d.weight:0;o.setEdge(c,s,{weight:e.edge(u).weight+h});}),Object.hasOwn(a,"minRank")&&o.setNode(s,{borderLeft:a.borderLeft[t],borderRight:a.borderRight[t]}));}),o}function Fn(e){for(var t;e.hasNode(t=Sn.uniqueId("_root")););return t}});var dt=v((ao,at)=>{at.exports=Dn;function Dn(e,t,r){let n={},i;r.forEach(o=>{let s=e.parent(o),a,l;for(;s;){if(a=e.parent(s),a?(l=n[a],n[a]=s):(l=i,i=s),l&&l!==s){t.setEdge(l,s);return}s=a;}});}});var ft=v((lo,ct)=>{var Gn=Xe(),Vn=Ue(),An=it(),Yn=st(),Bn=dt(),Wn=y().Graph,M=_();ct.exports=ht;function ht(e,t={}){if(typeof t.customOrder=="function"){t.customOrder(e,ht);return}let r=M.maxRank(e),n=lt(e,M.range(1,r+1),"inEdges"),i=lt(e,M.range(r-1,-1,-1),"outEdges"),o=Gn(e);if(ut(e,o),t.disableOptimalOrderHeuristic)return;let s=Number.POSITIVE_INFINITY,a,l=t.constraints||[];for(let u=0,c=0;c<4;++u,++c){zn(u%2?n:i,u%4>=2,l),o=M.buildLayerMatrix(e);let d=Vn(e,o);d<s?(c=0,a=Object.assign({},o),s=d):d===s&&(a=structuredClone(o));}ut(e,a);}function lt(e,t,r){let n=new Map,i=(o,s)=>{n.has(o)||n.set(o,[]),n.get(o).push(s);};for(let o of e.nodes()){let s=e.node(o);if(typeof s.rank=="number"&&i(s.rank,o),typeof s.minRank=="number"&&typeof s.maxRank=="number")for(let a=s.minRank;a<=s.maxRank;a++)a!==s.rank&&i(a,o);}return t.map(function(o){return Yn(e,o,r,n.get(o)||[])})}function zn(e,t,r){let n=new Wn;e.forEach(function(i){r.forEach(a=>n.setEdge(a.left,a.right));let o=i.graph().root,s=An(i,o,n,t);s.vs.forEach((a,l)=>i.node(a).order=l),Bn(i,n,s.vs);});}function ut(e,t){Object.values(t).forEach(r=>r.forEach((n,i)=>e.node(n).order=i));}});var yt=v((uo,kt)=>{var Xn=y().Graph,O=_();kt.exports={positionX:Kn,findType1Conflicts:pt,findType2Conflicts:mt,addConflict:W,hasConflict:wt,verticalAlignment:bt,horizontalCompaction:vt,alignCoordinates:Et,findSmallestWidthAlignment:gt,balance:_t};function pt(e,t){let r={};function n(i,o){let s=0,a=0,l=i.length,u=o[o.length-1];return o.forEach((c,d)=>{let h=Hn(e,c),f=h?e.node(h).order:l;(h||c===u)&&(o.slice(a,d+1).forEach(m=>{e.predecessors(m).forEach(p=>{let w=e.node(p),b=w.order;(b<s||f<b)&&!(w.dummy&&e.node(m).dummy)&&W(r,p,m);});}),a=d+1,s=f);}),o}return t.length&&t.reduce(n),r}function mt(e,t){let r={};function n(o,s,a,l,u){let c;O.range(s,a).forEach(d=>{c=o[d],e.node(c).dummy&&e.predecessors(c).forEach(h=>{let f=e.node(h);f.dummy&&(f.order<l||f.order>u)&&W(r,h,c);});});}function i(o,s){let a=-1,l,u=0;return s.forEach((c,d)=>{if(e.node(c).dummy==="border"){let h=e.predecessors(c);h.length&&(l=e.node(h[0]).order,n(s,u,d,a,l),u=d,a=l);}n(s,u,s.length,l,o.length);}),s}return t.length&&t.reduce(i),r}function Hn(e,t){if(e.node(t).dummy)return e.predecessors(t).find(r=>e.node(r).dummy)}function W(e,t,r){if(t>r){let i=t;t=r,r=i;}let n=e[t];n||(e[t]=n={}),n[r]=true;}function wt(e,t,r){if(t>r){let n=t;t=r,r=n;}return !!e[t]&&Object.hasOwn(e[t],r)}function bt(e,t,r,n){let i={},o={},s={};return t.forEach(a=>{a.forEach((l,u)=>{i[l]=l,o[l]=l,s[l]=u;});}),t.forEach(a=>{let l=-1;a.forEach(u=>{let c=n(u);if(c.length){c=c.sort((h,f)=>s[h]-s[f]);let d=(c.length-1)/2;for(let h=Math.floor(d),f=Math.ceil(d);h<=f;++h){let m=c[h];o[u]===u&&l<s[m]&&!wt(r,u,m)&&(o[m]=u,o[u]=i[u]=i[m],l=s[m]);}}});}),{root:i,align:o}}function vt(e,t,r,n,i){let o={},s=Un(e,t,r,i),a=i?"borderLeft":"borderRight";function l(d,h){let f=s.nodes().slice(),m={},p=f.pop();for(;p;){if(m[p])d(p);else {m[p]=true,f.push(p);for(let w of h(p))f.push(w);}p=f.pop();}}function u(d){o[d]=s.inEdges(d).reduce((h,f)=>Math.max(h,o[f.v]+s.edge(f)),0);}function c(d){let h=s.outEdges(d).reduce((m,p)=>Math.min(m,o[p.w]-s.edge(p)),Number.POSITIVE_INFINITY),f=e.node(d);h!==Number.POSITIVE_INFINITY&&f.borderType!==a&&(o[d]=Math.max(o[d],h));}return l(u,s.predecessors.bind(s)),l(c,s.successors.bind(s)),Object.keys(n).forEach(d=>o[d]=o[r[d]]),o}function Un(e,t,r,n){let i=new Xn,o=e.graph(),s=Qn(o.nodesep,o.edgesep,n);return t.forEach(a=>{let l;a.forEach(u=>{let c=r[u];if(i.setNode(c),l){var d=r[l],h=i.edge(d,c);i.setEdge(d,c,Math.max(s(e,u,l),h||0));}l=u;});}),i}function gt(e,t){return Object.values(t).reduce((r,n)=>{let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;Object.entries(n).forEach(([a,l])=>{let u=Jn(e,a)/2;i=Math.max(l+u,i),o=Math.min(l-u,o);});let s=i-o;return s<r[0]&&(r=[s,n]),r},[Number.POSITIVE_INFINITY,null])[1]}function Et(e,t){let r=Object.values(t),n=O.applyWithChunking(Math.min,r),i=O.applyWithChunking(Math.max,r);["u","d"].forEach(o=>{["l","r"].forEach(s=>{let a=o+s,l=e[a];if(l===t)return;let u=Object.values(l),c=n-O.applyWithChunking(Math.min,u);s!=="l"&&(c=i-O.applyWithChunking(Math.max,u)),c&&(e[a]=O.mapValues(l,d=>d+c));});});}function _t(e,t){return O.mapValues(e.ul,(r,n)=>{if(t)return e[t.toLowerCase()][n];{let i=Object.values(e).map(o=>o[n]).sort((o,s)=>o-s);return (i[1]+i[2])/2}})}function Kn(e){let t=O.buildLayerMatrix(e),r=Object.assign(pt(e,t),mt(e,t)),n={},i;["u","d"].forEach(s=>{i=s==="u"?t:Object.values(t).reverse(),["l","r"].forEach(a=>{a==="r"&&(i=i.map(d=>Object.values(d).reverse()));let l=(s==="u"?e.predecessors:e.successors).bind(e),u=bt(e,i,r,l),c=vt(e,i,u.root,u.align,a==="r");a==="r"&&(c=O.mapValues(c,d=>-d)),n[s+a]=c;});});let o=gt(e,n);return Et(n,o),_t(n,e.graph().align)}function Qn(e,t,r){return (n,i,o)=>{let s=n.node(i),a=n.node(o),l=0,u;if(l+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case "l":u=-s.width/2;break;case "r":u=s.width/2;break}if(u&&(l+=r?u:-u),u=0,l+=(s.dummy?t:e)/2,l+=(a.dummy?t:e)/2,l+=a.width/2,Object.hasOwn(a,"labelpos"))switch(a.labelpos.toLowerCase()){case "l":u=a.width/2;break;case "r":u=-a.width/2;break}return u&&(l+=r?u:-u),u=0,l}}function Jn(e,t){return e.node(t).width}});var Nt=v((ho,Ot)=>{var xt=_(),Zn=yt().positionX;Ot.exports=$n;function $n(e){e=xt.asNonCompoundGraph(e),ei(e),Object.entries(Zn(e)).forEach(([t,r])=>e.node(t).x=r);}function ei(e){let t=xt.buildLayerMatrix(e),r=e.graph().ranksep,n=e.graph().rankalign,i=0;t.forEach(o=>{let s=o.reduce((a,l)=>{let u=e.node(l).height;return a>u?a:u},0);o.forEach(a=>{let l=e.node(a);n==="top"?l.y=i+l.height/2:n==="bottom"?l.y=i+s-l.height/2:l.y=i+s/2;}),i+=s+r;});}});var Rt=v((co,Mt)=>{var It=pe(),jt=we(),ti=qe(),ri=_().normalizeRanks,ni=Re(),ii=_().removeEmptyRanks,Ct=Pe(),oi=Ge(),Lt=Be(),si=ft(),ai=Nt(),x=_(),di=y().Graph;Mt.exports=li;function li(e,t={}){let r=t.debugTiming?x.time:x.notime;return r("layout",()=>{let n=r(" buildLayoutGraph",()=>gi(e));return r(" runLayout",()=>ui(n,r,t)),r(" updateInputGraph",()=>hi(e,n)),n})}function ui(e,t,r){t(" makeSpaceForEdgeLabels",()=>Ei(e)),t(" removeSelfEdges",()=>Ci(e)),t(" acyclic",()=>It.run(e)),t(" nestingGraph.run",()=>Ct.run(e)),t(" rank",()=>ti(x.asNonCompoundGraph(e))),t(" injectEdgeLabelProxies",()=>_i(e)),t(" removeEmptyRanks",()=>ii(e)),t(" nestingGraph.cleanup",()=>Ct.cleanup(e)),t(" normalizeRanks",()=>ri(e)),t(" assignRankMinMax",()=>ki(e)),t(" removeEdgeLabelProxies",()=>yi(e)),t(" normalize.run",()=>jt.run(e)),t(" parentDummyChains",()=>ni(e)),t(" addBorderSegments",()=>oi(e)),t(" order",()=>si(e,r)),t(" insertSelfEdges",()=>Li(e)),t(" adjustCoordinateSystem",()=>Lt.adjust(e)),t(" position",()=>ai(e)),t(" positionSelfEdges",()=>qi(e)),t(" removeBorderNodes",()=>ji(e)),t(" normalize.undo",()=>jt.undo(e)),t(" fixupEdgeLabelCoords",()=>Ni(e)),t(" undoCoordinateSystem",()=>Lt.undo(e)),t(" translateGraph",()=>xi(e)),t(" assignNodeIntersects",()=>Oi(e)),t(" reversePoints",()=>Ii(e)),t(" acyclic.undo",()=>It.undo(e));}function hi(e,t){e.nodes().forEach(r=>{let n=e.node(r),i=t.node(r);n&&(n.x=i.x,n.y=i.y,n.order=i.order,n.rank=i.rank,t.children(r).length&&(n.width=i.width,n.height=i.height));}),e.edges().forEach(r=>{let n=e.edge(r),i=t.edge(r);n.points=i.points,Object.hasOwn(i,"x")&&(n.x=i.x,n.y=i.y);}),e.graph().width=t.graph().width,e.graph().height=t.graph().height;}var ci=["nodesep","edgesep","ranksep","marginx","marginy"],fi={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},pi=["acyclicer","ranker","rankdir","align","rankalign"],mi=["width","height","rank"],qt={width:0,height:0},wi=["minlen","weight","width","height","labeloffset"],bi={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},vi=["labelpos"];function gi(e){let t=new di({multigraph:true,compound:true}),r=X(e.graph());return t.setGraph(Object.assign({},fi,z(r,ci),x.pick(r,pi))),e.nodes().forEach(n=>{let i=X(e.node(n)),o=z(i,mi);Object.keys(qt).forEach(s=>{o[s]===void 0&&(o[s]=qt[s]);}),t.setNode(n,o),t.setParent(n,e.parent(n));}),e.edges().forEach(n=>{let i=X(e.edge(n));t.setEdge(n,Object.assign({},bi,z(i,wi),x.pick(i,vi)));}),t}function Ei(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(r=>{let n=e.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset);});}function _i(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.width&&r.height){let n=e.node(t.v),o={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};x.addDummyNode(e,"edge-proxy",o,"_ep");}});}function ki(e){let t=0;e.nodes().forEach(r=>{let n=e.node(r);n.borderTop&&(n.minRank=e.node(n.borderTop).rank,n.maxRank=e.node(n.borderBottom).rank,t=Math.max(t,n.maxRank));}),e.graph().maxRank=t;}function yi(e){e.nodes().forEach(t=>{let r=e.node(t);r.dummy==="edge-proxy"&&(e.edge(r.e).labelRank=r.rank,e.removeNode(t));});}function xi(e){let t=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,o=e.graph(),s=o.marginx||0,a=o.marginy||0;function l(u){let c=u.x,d=u.y,h=u.width,f=u.height;t=Math.min(t,c-h/2),r=Math.max(r,c+h/2),n=Math.min(n,d-f/2),i=Math.max(i,d+f/2);}e.nodes().forEach(u=>l(e.node(u))),e.edges().forEach(u=>{let c=e.edge(u);Object.hasOwn(c,"x")&&l(c);}),t-=s,n-=a,e.nodes().forEach(u=>{let c=e.node(u);c.x-=t,c.y-=n;}),e.edges().forEach(u=>{let c=e.edge(u);c.points.forEach(d=>{d.x-=t,d.y-=n;}),Object.hasOwn(c,"x")&&(c.x-=t),Object.hasOwn(c,"y")&&(c.y-=n);}),o.width=r-t+s,o.height=i-n+a;}function Oi(e){e.edges().forEach(t=>{let r=e.edge(t),n=e.node(t.v),i=e.node(t.w),o,s;r.points?(o=r.points[0],s=r.points[r.points.length-1]):(r.points=[],o=i,s=n),r.points.unshift(x.intersectRect(n,o)),r.points.push(x.intersectRect(i,s));});}function Ni(e){e.edges().forEach(t=>{let r=e.edge(t);if(Object.hasOwn(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case "l":r.x-=r.width/2+r.labeloffset;break;case "r":r.x+=r.width/2+r.labeloffset;break}});}function Ii(e){e.edges().forEach(t=>{let r=e.edge(t);r.reversed&&r.points.reverse();});}function ji(e){e.nodes().forEach(t=>{if(e.children(t).length){let r=e.node(t),n=e.node(r.borderTop),i=e.node(r.borderBottom),o=e.node(r.borderLeft[r.borderLeft.length-1]),s=e.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-o.x),r.height=Math.abs(i.y-n.y),r.x=o.x+r.width/2,r.y=n.y+r.height/2;}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t);});}function Ci(e){e.edges().forEach(t=>{if(t.v===t.w){var r=e.node(t.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t);}});}function Li(e){var t=x.buildLayerMatrix(e);t.forEach(r=>{var n=0;r.forEach((i,o)=>{var s=e.node(i);s.order=o+n,(s.selfEdges||[]).forEach(a=>{x.addDummyNode(e,"selfedge",{width:a.label.width,height:a.label.height,rank:s.rank,order:o+ ++n,e:a.e,label:a.label},"_se");}),delete s.selfEdges;});});}function qi(e){e.nodes().forEach(t=>{var r=e.node(t);if(r.dummy==="selfedge"){var n=e.node(r.e.v),i=n.x+n.width/2,o=n.y,s=r.x-i,a=n.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:i+2*s/3,y:o-a},{x:i+5*s/6,y:o-a},{x:i+s,y:o},{x:i+5*s/6,y:o+a},{x:i+2*s/3,y:o+a}],r.label.x=r.x,r.label.y=r.y;}});}function z(e,t){return x.mapValues(x.pick(e,t),Number)}function X(e){var t={};return e&&Object.entries(e).forEach(([r,n])=>{typeof r=="string"&&(r=r.toLowerCase()),t[r]=n;}),t}});var St=v((fo,Tt)=>{var Mi=_(),Ri=y().Graph;Tt.exports={debugOrdering:Ti};function Ti(e){let t=Mi.buildLayerMatrix(e),r=new Ri({compound:true,multigraph:true}).setGraph({});return e.nodes().forEach(n=>{r.setNode(n,{label:n}),r.setParent(n,"layer"+e.node(n).rank);}),e.edges().forEach(n=>r.setEdge(n.v,n.w,{},n.name)),t.forEach((n,i)=>{let o="layer"+i;r.setNode(o,{rank:"same"}),n.reduce((s,a)=>(r.setEdge(s,a,{style:"invis"}),a));}),r}});var Ft=v((po,Pt)=>{Pt.exports="2.0.4";});var Si=v((mo,Dt)=>{Dt.exports={graphlib:y(),layout:Rt(),debug:St(),util:{time:_().time,notime:_().notime},version:Ft()};});const dagre = Si();
15
17
  /*! For license information please see dagre.esm.js.LEGAL.txt */
16
18
 
17
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
19
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
18
20
  __name: "Badge",
19
21
  __ssrInlineRender: true,
20
22
  props: {
@@ -45,13 +47,13 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
45
47
  };
46
48
  }
47
49
  });
48
- const _sfc_setup$n = _sfc_main$n.setup;
49
- _sfc_main$n.setup = (props, ctx) => {
50
+ const _sfc_setup$r = _sfc_main$r.setup;
51
+ _sfc_main$r.setup = (props, ctx) => {
50
52
  const ssrContext = useSSRContext();
51
53
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ui/badge/Badge.vue");
52
- return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0;
54
+ return _sfc_setup$r ? _sfc_setup$r(props, ctx) : void 0;
53
55
  };
54
- const Badge = Object.assign(_sfc_main$n, { __name: "UiBadge" });
56
+ const Badge = Object.assign(_sfc_main$r, { __name: "UiBadge" });
55
57
  const badgeVariants = cva(
56
58
  "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
57
59
  {
@@ -68,7 +70,7 @@ const badgeVariants = cva(
68
70
  }
69
71
  }
70
72
  );
71
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
73
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
72
74
  __name: "Node",
73
75
  __ssrInlineRender: true,
74
76
  props: {
@@ -207,14 +209,14 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
207
209
  };
208
210
  }
209
211
  });
210
- const _sfc_setup$m = _sfc_main$m.setup;
211
- _sfc_main$m.setup = (props, ctx) => {
212
+ const _sfc_setup$q = _sfc_main$q.setup;
213
+ _sfc_main$q.setup = (props, ctx) => {
212
214
  const ssrContext = useSSRContext();
213
215
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/graph/Node.vue");
214
- return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0;
216
+ return _sfc_setup$q ? _sfc_setup$q(props, ctx) : void 0;
215
217
  };
216
- const GraphNodeComponent = Object.assign(_sfc_main$m, { __name: "GraphNode" });
217
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
218
+ const GraphNodeComponent = Object.assign(_sfc_main$q, { __name: "GraphNode" });
219
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
218
220
  __name: "Explorer",
219
221
  __ssrInlineRender: true,
220
222
  props: {
@@ -445,14 +447,14 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
445
447
  };
446
448
  }
447
449
  });
448
- const _sfc_setup$l = _sfc_main$l.setup;
449
- _sfc_main$l.setup = (props, ctx) => {
450
+ const _sfc_setup$p = _sfc_main$p.setup;
451
+ _sfc_main$p.setup = (props, ctx) => {
450
452
  const ssrContext = useSSRContext();
451
453
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/graph/Explorer.vue");
452
- return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0;
454
+ return _sfc_setup$p ? _sfc_setup$p(props, ctx) : void 0;
453
455
  };
454
- const __nuxt_component_0$2 = Object.assign(_sfc_main$l, { __name: "GraphExplorer" });
455
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
456
+ const __nuxt_component_0$2 = Object.assign(_sfc_main$p, { __name: "GraphExplorer" });
457
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
456
458
  __name: "ChangesMinimap",
457
459
  __ssrInlineRender: true,
458
460
  props: {
@@ -553,17 +555,15 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
553
555
  };
554
556
  }
555
557
  });
556
- const _sfc_setup$k = _sfc_main$k.setup;
557
- _sfc_main$k.setup = (props, ctx) => {
558
+ const _sfc_setup$o = _sfc_main$o.setup;
559
+ _sfc_main$o.setup = (props, ctx) => {
558
560
  const ssrContext = useSSRContext();
559
561
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/git/ChangesMinimap.vue");
560
- return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0;
562
+ return _sfc_setup$o ? _sfc_setup$o(props, ctx) : void 0;
561
563
  };
562
- const __nuxt_component_0$1 = Object.assign(_sfc_main$k, { __name: "GitChangesMinimap" });
564
+ const __nuxt_component_0$1 = Object.assign(_sfc_main$o, { __name: "GitChangesMinimap" });
563
565
  const LINE_LIMIT = 1e4;
564
- const MAX_DIFF_HIGHLIGHT_LINES = 1500;
565
- const MAX_FULL_FILE_HIGHLIGHT_LINES = 4e3;
566
- const _sfc_main$j = /* @__PURE__ */ defineComponent({
566
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
567
567
  __name: "DiffViewer",
568
568
  __ssrInlineRender: true,
569
569
  props: {
@@ -571,19 +571,24 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
571
571
  filePath: {},
572
572
  binary: { type: Boolean },
573
573
  oldPath: {},
574
+ fileStatus: {},
574
575
  fileContent: {},
576
+ oldFileContent: {},
575
577
  showFullFile: { type: Boolean },
576
578
  isLoadingContent: { type: Boolean }
577
579
  },
578
580
  setup(__props) {
579
581
  const props = __props;
582
+ const { resolvedTheme } = useThemeMode();
580
583
  const showAll = ref(false);
581
- const syncScrollEnabled = ref(true);
582
- ref(null);
583
- ref(null);
584
- ref(false);
585
- let fullFileHighlightRunVersion = 0;
586
- let diffHighlightRunVersion = 0;
584
+ const diffLayout = ref("split");
585
+ const diffMountRef = ref(null);
586
+ const parseError = ref(null);
587
+ const parsedDiff = ref(null);
588
+ const fullDiffParseError = ref(null);
589
+ const parsedFullDiff = ref(null);
590
+ let pierreDiffInstance = null;
591
+ let pierreFileInstance = null;
587
592
  watch(
588
593
  () => props.filePath,
589
594
  () => {
@@ -599,24 +604,14 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
599
604
  });
600
605
  const isLargeFile = computed(() => totalLines.value > LINE_LIMIT);
601
606
  const isEmpty = computed(() => props.hunks.length === 0 && !props.binary);
602
- const changedLines = computed(() => {
603
- const added = /* @__PURE__ */ new Set();
604
- const removed = /* @__PURE__ */ new Set();
605
- for (const hunk of props.hunks) {
606
- for (const line of hunk.lines) {
607
- if (line.type === "add" && line.newNumber !== void 0) {
608
- added.add(line.newNumber);
609
- }
610
- if (line.type === "remove" && line.oldNumber !== void 0) {
611
- removed.add(line.oldNumber);
612
- }
613
- }
614
- }
615
- return { added, removed };
607
+ const hasFullFileContent = computed(() => {
608
+ return props.fileContent !== null && props.fileContent !== void 0;
609
+ });
610
+ const isWaitingForFullFile = computed(() => {
611
+ return Boolean(props.showFullFile && !hasFullFileContent.value);
616
612
  });
617
- const fullFileLines = computed(() => {
618
- if (!props.fileContent) return [];
619
- return props.fileContent.split("\n");
613
+ const shouldShowFullFile = computed(() => {
614
+ return Boolean(props.showFullFile && hasFullFileContent.value);
620
615
  });
621
616
  function detectLanguage(path) {
622
617
  const ext = path.split(".").pop()?.toLowerCase() || "";
@@ -667,290 +662,310 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
667
662
  return langMap[ext] || "text";
668
663
  }
669
664
  const language = computed(() => detectLanguage(props.filePath));
670
- const highlightedLines = ref(/* @__PURE__ */ new Map());
671
- const isLoading = ref(true);
672
- const lineHighlightCache = /* @__PURE__ */ new Map();
673
- let codeToHtmlLoader = null;
674
- async function getCodeToHtml() {
675
- if (!codeToHtmlLoader) {
676
- codeToHtmlLoader = import('shiki').then((module) => module.codeToHtml);
677
- }
678
- return codeToHtmlLoader;
679
- }
680
- const displayItems = computed(() => {
681
- const items = [];
682
- const idPrefix = props.filePath;
683
- for (let hunkIndex = 0; hunkIndex < props.hunks.length; hunkIndex++) {
684
- const hunk = props.hunks[hunkIndex];
685
- if (hunkIndex > 0) {
686
- items.push({ type: "separator", hunkIndex });
687
- }
688
- const hunkLines = hunk.lines;
689
- let i = 0;
690
- while (i < hunkLines.length) {
691
- const line = hunkLines[i];
692
- if (line.type === "context") {
693
- items.push({
694
- type: "line",
695
- pair: {
696
- id: `${idPrefix}:${hunkIndex}-${i}`,
697
- left: {
698
- lineNum: line.oldNumber,
699
- content: line.content,
700
- type: "context"
701
- },
702
- right: {
703
- lineNum: line.newNumber,
704
- content: line.content,
705
- type: "context"
706
- }
707
- }
708
- });
709
- i++;
710
- } else if (line.type === "remove") {
711
- const removeLines = [];
712
- const addLines = [];
713
- while (i < hunkLines.length && hunkLines[i].type === "remove") {
714
- removeLines.push(hunkLines[i]);
715
- i++;
716
- }
717
- while (i < hunkLines.length && hunkLines[i].type === "add") {
718
- addLines.push(hunkLines[i]);
719
- i++;
720
- }
721
- const maxLen = Math.max(removeLines.length, addLines.length);
722
- for (let j = 0; j < maxLen; j++) {
723
- const removeLine = removeLines[j];
724
- const addLine = addLines[j];
725
- items.push({
726
- type: "line",
727
- pair: {
728
- id: `${idPrefix}:${hunkIndex}-${i - maxLen + j}`,
729
- left: removeLine ? {
730
- lineNum: removeLine.oldNumber,
731
- content: removeLine.content,
732
- type: "remove"
733
- } : { content: "", type: "empty" },
734
- right: addLine ? {
735
- lineNum: addLine.newNumber,
736
- content: addLine.content,
737
- type: "add"
738
- } : { content: "", type: "empty" }
739
- }
740
- });
741
- }
742
- } else if (line.type === "add") {
743
- items.push({
744
- type: "line",
745
- pair: {
746
- id: `${idPrefix}:${hunkIndex}-${i}`,
747
- left: { content: "", type: "empty" },
748
- right: {
749
- lineNum: line.newNumber,
750
- content: line.content,
751
- type: "add"
752
- }
753
- }
754
- });
755
- i++;
756
- } else {
757
- i++;
758
- }
759
- }
760
- }
761
- return items;
762
- });
763
- async function highlightLine(content, lang) {
764
- if (!content.trim()) {
765
- return "";
665
+ function cleanupPierreDiff() {
666
+ if (pierreDiffInstance) {
667
+ pierreDiffInstance.cleanUp();
668
+ pierreDiffInstance = null;
766
669
  }
767
- const cacheKey = `${lang}:${content}`;
768
- const cached = lineHighlightCache.get(cacheKey);
769
- if (cached !== void 0) {
770
- return cached;
771
- }
772
- try {
773
- const codeToHtml = await getCodeToHtml();
774
- const html = await codeToHtml(content, {
775
- lang,
776
- themes: {
777
- light: "catppuccin-latte",
778
- dark: "catppuccin-mocha"
779
- }
780
- });
781
- const codeMatch = html.match(/<code[^>]*>([\s\S]*?)<\/code>/);
782
- const highlighted = codeMatch ? codeMatch[1] || "" : escapeHtml(content);
783
- lineHighlightCache.set(cacheKey, highlighted);
784
- return highlighted;
785
- } catch {
786
- const fallback = escapeHtml(content);
787
- lineHighlightCache.set(cacheKey, fallback);
788
- return fallback;
670
+ }
671
+ function cleanupPierreFile() {
672
+ if (pierreFileInstance) {
673
+ pierreFileInstance.cleanUp();
674
+ pierreFileInstance = null;
789
675
  }
790
676
  }
791
- async function highlightFullContent(content, lang) {
792
- if (!content) {
793
- return [];
677
+ function cleanupPierreInstances() {
678
+ cleanupPierreDiff();
679
+ cleanupPierreFile();
680
+ }
681
+ function setDiffLayout(layout) {
682
+ diffLayout.value = layout;
683
+ }
684
+ function normalizePatchPath(path) {
685
+ if (!path) {
686
+ return "/dev/null";
794
687
  }
795
- const lines = content.split("\n");
796
- if (lines.length > MAX_FULL_FILE_HIGHLIGHT_LINES) {
797
- return lines.map(escapeHtml);
688
+ return path.replace(/\r?\n/g, "");
689
+ }
690
+ function resolvePatchEndpoints(filePath, oldPath, status) {
691
+ switch (status) {
692
+ case "added":
693
+ return {
694
+ oldPath: "/dev/null",
695
+ newPath: filePath
696
+ };
697
+ case "deleted":
698
+ return {
699
+ oldPath: oldPath || filePath,
700
+ newPath: "/dev/null"
701
+ };
702
+ default:
703
+ return {
704
+ oldPath: oldPath || filePath,
705
+ newPath: filePath
706
+ };
798
707
  }
799
- try {
800
- const codeToHtml = await getCodeToHtml();
801
- const html = await codeToHtml(content, {
802
- lang,
803
- themes: {
804
- light: "catppuccin-latte",
805
- dark: "catppuccin-mocha"
708
+ }
709
+ function createUnifiedPatchFromHunks(hunks, filePath, oldPath, status) {
710
+ const endpoints = resolvePatchEndpoints(filePath, oldPath, status);
711
+ const patchLines = [
712
+ `--- ${normalizePatchPath(endpoints.oldPath)}`,
713
+ `+++ ${normalizePatchPath(endpoints.newPath)}`
714
+ ];
715
+ for (const hunk of hunks) {
716
+ patchLines.push(`@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`);
717
+ for (const line of hunk.lines) {
718
+ if (line.type === "add") {
719
+ patchLines.push(`+${line.content}`);
720
+ } else if (line.type === "remove") {
721
+ patchLines.push(`-${line.content}`);
722
+ } else {
723
+ patchLines.push(` ${line.content}`);
806
724
  }
807
- });
808
- const codeMatch = html.match(/<code[^>]*>([\s\S]*?)<\/code>/);
809
- if (!codeMatch || !codeMatch[1]) {
810
- return lines.map(escapeHtml);
811
725
  }
812
- const highlightedContent = codeMatch[1];
813
- return highlightedContent.split("\n");
814
- } catch {
815
- return lines.map(escapeHtml);
816
726
  }
727
+ return `${patchLines.join("\n")}
728
+ `;
817
729
  }
818
- function escapeHtml(text) {
819
- return text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
730
+ function getErrorMessage(error) {
731
+ if (error instanceof Error && error.message) {
732
+ return error.message;
733
+ }
734
+ return "Could not parse diff data.";
820
735
  }
821
- const highlightedFullFile = ref([]);
822
- const isLoadingFullFile = ref(false);
823
736
  watch(
824
- () => [props.fileContent, props.filePath],
825
- async ([content], _, onCleanup) => {
826
- const runVersion = ++fullFileHighlightRunVersion;
827
- let invalidated = false;
828
- onCleanup(() => {
829
- invalidated = true;
830
- });
831
- highlightedFullFile.value = [];
832
- if (!content) {
833
- isLoadingFullFile.value = false;
737
+ () => [props.hunks, props.filePath, props.oldPath, props.fileStatus],
738
+ ([hunks, filePath, oldPath, fileStatus]) => {
739
+ parseError.value = null;
740
+ if (hunks.length === 0) {
741
+ parsedDiff.value = null;
834
742
  return;
835
743
  }
836
- isLoadingFullFile.value = true;
837
744
  try {
838
- const highlighted = await highlightFullContent(content, language.value);
839
- if (invalidated || runVersion !== fullFileHighlightRunVersion) {
745
+ const patch = createUnifiedPatchFromHunks(hunks, filePath, oldPath, fileStatus);
746
+ const parsedPatches = parsePatchFiles(patch, `steward-${filePath}`);
747
+ const fileDiff = parsedPatches[0]?.files[0] || null;
748
+ if (!fileDiff) {
749
+ parsedDiff.value = null;
750
+ parseError.value = "Could not parse patch into a renderable diff.";
840
751
  return;
841
752
  }
842
- highlightedFullFile.value = highlighted;
843
- } finally {
844
- if (!invalidated && runVersion === fullFileHighlightRunVersion) {
845
- isLoadingFullFile.value = false;
846
- }
753
+ parsedDiff.value = fileDiff;
754
+ } catch (error) {
755
+ parsedDiff.value = null;
756
+ parseError.value = getErrorMessage(error);
847
757
  }
848
758
  },
849
759
  { immediate: true }
850
760
  );
761
+ const fullFileNewData = computed(() => {
762
+ if (!shouldShowFullFile.value || props.fileContent === null || props.fileContent === void 0) {
763
+ return null;
764
+ }
765
+ return {
766
+ name: props.filePath,
767
+ contents: props.fileContent,
768
+ lang: language.value
769
+ };
770
+ });
771
+ const fullFileOldData = computed(() => {
772
+ if (!shouldShowFullFile.value) {
773
+ return null;
774
+ }
775
+ if (props.fileStatus === "added") {
776
+ return {
777
+ name: props.oldPath || props.filePath,
778
+ contents: "",
779
+ lang: language.value
780
+ };
781
+ }
782
+ if (props.oldFileContent === null || props.oldFileContent === void 0) {
783
+ return null;
784
+ }
785
+ return {
786
+ name: props.oldPath || props.filePath,
787
+ contents: props.oldFileContent,
788
+ lang: language.value
789
+ };
790
+ });
851
791
  watch(
852
- () => [props.hunks, props.filePath, highlightedFullFile.value],
853
- async (_, __, onCleanup) => {
854
- const runVersion = ++diffHighlightRunVersion;
855
- let invalidated = false;
856
- onCleanup(() => {
857
- invalidated = true;
858
- });
859
- isLoading.value = true;
860
- highlightedLines.value = /* @__PURE__ */ new Map();
861
- const lang = language.value;
862
- const newHighlighted = /* @__PURE__ */ new Map();
863
- const fullFileLines2 = highlightedFullFile.value;
864
- const linesToHighlight = [];
792
+ () => [fullFileOldData.value, fullFileNewData.value],
793
+ ([oldFile, newFile]) => {
794
+ fullDiffParseError.value = null;
795
+ parsedFullDiff.value = null;
796
+ if (!oldFile || !newFile) {
797
+ return;
798
+ }
865
799
  try {
866
- for (const item of displayItems.value) {
867
- if (invalidated || runVersion !== diffHighlightRunVersion) {
868
- return;
869
- }
870
- if (item.type === "line" && item.pair) {
871
- if (item.pair.left.content && item.pair.left.type !== "empty") {
872
- const key = `${item.pair.id}-old`;
873
- if (item.pair.left.type === "context" && item.pair.left.lineNum && fullFileLines2.length > 0) {
874
- const lineIndex = item.pair.right.lineNum ? item.pair.right.lineNum - 1 : -1;
875
- if (lineIndex >= 0 && lineIndex < fullFileLines2.length) {
876
- newHighlighted.set(key, fullFileLines2[lineIndex] || "");
877
- } else {
878
- linesToHighlight.push({ key, content: item.pair.left.content });
879
- }
880
- } else {
881
- linesToHighlight.push({ key, content: item.pair.left.content });
882
- }
883
- }
884
- if (item.pair.right.content && item.pair.right.type !== "empty") {
885
- const key = `${item.pair.id}-new`;
886
- const lineNum = item.pair.right.lineNum;
887
- if (lineNum && fullFileLines2.length > 0 && lineNum <= fullFileLines2.length) {
888
- newHighlighted.set(key, fullFileLines2[lineNum - 1] || "");
889
- } else {
890
- linesToHighlight.push({ key, content: item.pair.right.content });
891
- }
892
- }
893
- }
894
- }
895
- const limitedLines = linesToHighlight.slice(0, MAX_DIFF_HIGHLIGHT_LINES);
896
- const overflowLines = linesToHighlight.slice(MAX_DIFF_HIGHLIGHT_LINES);
897
- for (const { key, content } of overflowLines) {
898
- newHighlighted.set(key, escapeHtml(content));
899
- }
900
- const batchSize = 50;
901
- for (let i = 0; i < limitedLines.length; i += batchSize) {
902
- if (invalidated || runVersion !== diffHighlightRunVersion) {
903
- return;
904
- }
905
- const batch = limitedLines.slice(i, i + batchSize);
906
- const results = await Promise.all(
907
- batch.map(async ({ key, content }) => {
908
- const result = await highlightLine(content, lang);
909
- return { key, result };
910
- })
911
- );
912
- if (invalidated || runVersion !== diffHighlightRunVersion) {
913
- return;
914
- }
915
- for (const { key, result } of results) {
916
- newHighlighted.set(key, result);
917
- }
918
- }
919
- if (invalidated || runVersion !== diffHighlightRunVersion) {
920
- return;
921
- }
922
- highlightedLines.value = newHighlighted;
923
- } finally {
924
- if (!invalidated && runVersion === diffHighlightRunVersion) {
925
- isLoading.value = false;
926
- }
800
+ parsedFullDiff.value = parseDiffFromFile(oldFile, newFile, {
801
+ context: Number.MAX_SAFE_INTEGER
802
+ });
803
+ } catch (error) {
804
+ fullDiffParseError.value = getErrorMessage(error);
805
+ parsedFullDiff.value = null;
927
806
  }
928
807
  },
929
808
  { immediate: true }
930
809
  );
931
- function getHighlightedContent(pairId, side) {
932
- return highlightedLines.value.get(`${pairId}-${side}`) || "";
810
+ const shouldRenderPierreDiff = computed(() => {
811
+ if (shouldShowFullFile.value) {
812
+ return false;
813
+ }
814
+ if (props.binary || isEmpty.value) {
815
+ return false;
816
+ }
817
+ if (isLargeFile.value && !showAll.value) {
818
+ return false;
819
+ }
820
+ return parsedDiff.value !== null;
821
+ });
822
+ const shouldRenderPierreFullDiff = computed(() => {
823
+ return Boolean(shouldShowFullFile.value && !props.binary && parsedFullDiff.value);
824
+ });
825
+ const shouldRenderPierreFileFallback = computed(() => {
826
+ return Boolean(shouldShowFullFile.value && !props.binary && fullFileNewData.value && !parsedFullDiff.value);
827
+ });
828
+ const diffOptions = computed(() => {
829
+ const themeType = resolvedTheme.value;
830
+ return {
831
+ diffStyle: diffLayout.value,
832
+ hunkSeparators: "line-info",
833
+ diffIndicators: "bars",
834
+ lineDiffType: "word-alt",
835
+ overflow: "scroll",
836
+ themeType,
837
+ disableFileHeader: true
838
+ };
839
+ });
840
+ const fullDiffOptions = computed(() => {
841
+ const themeType = resolvedTheme.value;
842
+ return {
843
+ diffStyle: "unified",
844
+ hunkSeparators: "line-info",
845
+ diffIndicators: "bars",
846
+ lineDiffType: "word-alt",
847
+ overflow: "scroll",
848
+ themeType,
849
+ disableFileHeader: true
850
+ };
851
+ });
852
+ const fileOptions = computed(() => {
853
+ const themeType = resolvedTheme.value;
854
+ return {
855
+ overflow: "scroll",
856
+ themeType,
857
+ disableFileHeader: true
858
+ };
859
+ });
860
+ function renderPierreDiff() {
861
+ const mountNode = diffMountRef.value;
862
+ const fileDiff = parsedDiff.value;
863
+ if (!mountNode || !shouldRenderPierreDiff.value || !fileDiff) {
864
+ cleanupPierreDiff();
865
+ return;
866
+ }
867
+ cleanupPierreFile();
868
+ if (!pierreDiffInstance) {
869
+ pierreDiffInstance = new FileDiff(diffOptions.value);
870
+ } else {
871
+ pierreDiffInstance.setOptions(diffOptions.value);
872
+ }
873
+ pierreDiffInstance.render({
874
+ fileDiff,
875
+ containerWrapper: mountNode,
876
+ forceRender: true
877
+ });
878
+ }
879
+ function renderPierreFullDiff() {
880
+ const mountNode = diffMountRef.value;
881
+ const fileDiff = parsedFullDiff.value;
882
+ if (!mountNode || !shouldRenderPierreFullDiff.value || !fileDiff) {
883
+ cleanupPierreDiff();
884
+ return;
885
+ }
886
+ cleanupPierreFile();
887
+ if (!pierreDiffInstance) {
888
+ pierreDiffInstance = new FileDiff(fullDiffOptions.value);
889
+ } else {
890
+ pierreDiffInstance.setOptions(fullDiffOptions.value);
891
+ }
892
+ pierreDiffInstance.render({
893
+ fileDiff,
894
+ containerWrapper: mountNode,
895
+ forceRender: true
896
+ });
933
897
  }
934
- function getFullFileLineType(lineNum) {
935
- if (changedLines.value.added.has(lineNum)) return "add";
936
- return "context";
898
+ function renderPierreFileFallback() {
899
+ const mountNode = diffMountRef.value;
900
+ const file = fullFileNewData.value;
901
+ if (!mountNode || !shouldRenderPierreFileFallback.value || !file) {
902
+ cleanupPierreFile();
903
+ return;
904
+ }
905
+ cleanupPierreDiff();
906
+ if (!pierreFileInstance) {
907
+ pierreFileInstance = new File(fileOptions.value);
908
+ } else {
909
+ pierreFileInstance.setOptions(fileOptions.value);
910
+ }
911
+ pierreFileInstance.render({
912
+ file,
913
+ containerWrapper: mountNode,
914
+ forceRender: true
915
+ });
937
916
  }
917
+ watch(
918
+ () => [
919
+ shouldRenderPierreDiff.value,
920
+ shouldRenderPierreFullDiff.value,
921
+ shouldRenderPierreFileFallback.value,
922
+ parsedDiff.value,
923
+ parsedFullDiff.value,
924
+ fullFileNewData.value,
925
+ diffLayout.value,
926
+ resolvedTheme.value,
927
+ fullDiffParseError.value,
928
+ diffMountRef.value
929
+ ],
930
+ async () => {
931
+ await nextTick();
932
+ if (shouldRenderPierreFullDiff.value) {
933
+ renderPierreFullDiff();
934
+ return;
935
+ }
936
+ if (shouldRenderPierreFileFallback.value) {
937
+ renderPierreFileFallback();
938
+ return;
939
+ }
940
+ if (shouldRenderPierreDiff.value) {
941
+ renderPierreDiff();
942
+ return;
943
+ }
944
+ cleanupPierreInstances();
945
+ },
946
+ { immediate: true }
947
+ );
948
+ watch(diffLayout, (layout) => {
949
+ {
950
+ return;
951
+ }
952
+ });
938
953
  return (_ctx, _push, _parent, _attrs) => {
939
- _push(`<div${ssrRenderAttrs(mergeProps({ class: "diff-viewer" }, _attrs))} data-v-9eb8ced7>`);
940
- if ((unref(isLoading) || __props.isLoadingContent || unref(isLoadingFullFile)) && !__props.binary) {
941
- _push(`<div class="flex items-center justify-center py-8" data-v-9eb8ced7><div class="size-6 animate-spin rounded-full border-2 border-primary border-t-transparent" data-v-9eb8ced7></div></div>`);
954
+ _push(`<div${ssrRenderAttrs(mergeProps({ class: "diff-viewer" }, _attrs))} data-v-1520f40e>`);
955
+ if (unref(isWaitingForFullFile) && !__props.binary) {
956
+ _push(`<div class="flex items-center justify-center py-8" data-v-1520f40e><div class="size-6 animate-spin rounded-full border-2 border-primary border-t-transparent" data-v-1520f40e></div></div>`);
942
957
  } else if (__props.binary) {
943
- _push(`<div class="flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground" data-v-9eb8ced7>`);
958
+ _push(`<div class="flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground" data-v-1520f40e>`);
944
959
  _push(ssrRenderComponent(unref(FileWarning), { class: "size-10 opacity-50" }, null, _parent));
945
- _push(`<div class="text-center" data-v-9eb8ced7><p class="font-medium" data-v-9eb8ced7>Binary file</p><p class="text-sm" data-v-9eb8ced7>This file cannot be displayed as a diff</p></div></div>`);
960
+ _push(`<div class="text-center" data-v-1520f40e><p class="font-medium" data-v-1520f40e>Binary file</p><p class="text-sm" data-v-1520f40e>This file cannot be displayed as a diff</p></div></div>`);
946
961
  } else if (unref(isEmpty) && !__props.showFullFile) {
947
- _push(`<div class="flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground" data-v-9eb8ced7>`);
962
+ _push(`<div class="flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground" data-v-1520f40e>`);
948
963
  _push(ssrRenderComponent(unref(AlertTriangle), { class: "size-10 opacity-50" }, null, _parent));
949
- _push(`<div class="text-center" data-v-9eb8ced7><p class="font-medium" data-v-9eb8ced7>No changes</p><p class="text-sm" data-v-9eb8ced7>This file was touched but has no content changes</p></div></div>`);
964
+ _push(`<div class="text-center" data-v-1520f40e><p class="font-medium" data-v-1520f40e>No changes</p><p class="text-sm" data-v-1520f40e>This file was touched but has no content changes</p></div></div>`);
950
965
  } else if (unref(isLargeFile) && !unref(showAll) && !__props.showFullFile) {
951
- _push(`<div class="diff-container" data-v-9eb8ced7><div class="flex flex-col items-center justify-center gap-3 border-b border-border bg-muted/30 py-6" data-v-9eb8ced7>`);
966
+ _push(`<div class="diff-container" data-v-1520f40e><div class="flex flex-col items-center justify-center gap-3 border-b border-border bg-muted/30 py-6" data-v-1520f40e>`);
952
967
  _push(ssrRenderComponent(unref(AlertTriangle), { class: "size-8 text-yellow-500" }, null, _parent));
953
- _push(`<div class="text-center" data-v-9eb8ced7><p class="font-medium" data-v-9eb8ced7>Large file</p><p class="text-sm text-muted-foreground" data-v-9eb8ced7> This file has ${ssrInterpolate(unref(totalLines).toLocaleString())} lines (threshold: ${ssrInterpolate(LINE_LIMIT.toLocaleString())}) </p></div>`);
968
+ _push(`<div class="text-center" data-v-1520f40e><p class="font-medium" data-v-1520f40e>Large file</p><p class="text-sm text-muted-foreground" data-v-1520f40e> This file has ${ssrInterpolate(unref(totalLines).toLocaleString())} lines (threshold: ${ssrInterpolate(LINE_LIMIT.toLocaleString())}) </p></div>`);
954
969
  _push(ssrRenderComponent(unref(Button), {
955
970
  variant: "outline",
956
971
  size: "sm",
@@ -970,105 +985,66 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
970
985
  _: 1
971
986
  }, _parent));
972
987
  _push(`</div></div>`);
973
- } else if (__props.showFullFile && __props.fileContent) {
974
- _push(`<div class="diff-container" data-v-9eb8ced7><div class="full-file-view" data-v-9eb8ced7><!--[-->`);
975
- ssrRenderList(unref(fullFileLines), (line, index) => {
976
- _push(`<div class="${ssrRenderClass([{
977
- "diff-add": getFullFileLineType(index + 1) === "add"
978
- }, "full-file-line"])}" data-v-9eb8ced7><div class="diff-gutter" data-v-9eb8ced7><span class="line-number" data-v-9eb8ced7>${ssrInterpolate(index + 1)}</span></div><div class="diff-content" data-v-9eb8ced7><span class="diff-code" data-v-9eb8ced7>${(unref(highlightedFullFile)[index] || escapeHtml(line)) ?? ""}</span></div></div>`);
979
- });
980
- _push(`<!--]--></div></div>`);
988
+ } else if (unref(parseError) && !__props.showFullFile) {
989
+ _push(`<div class="flex flex-col items-center justify-center gap-3 py-12 text-muted-foreground" data-v-1520f40e>`);
990
+ _push(ssrRenderComponent(unref(AlertTriangle), { class: "size-10 opacity-50" }, null, _parent));
991
+ _push(`<div class="text-center" data-v-1520f40e><p class="font-medium" data-v-1520f40e>Failed to render diff</p><p class="text-sm" data-v-1520f40e>${ssrInterpolate(unref(parseError))}</p></div></div>`);
981
992
  } else {
982
- _push(`<div class="diff-container" data-v-9eb8ced7><div class="diff-toolbar" data-v-9eb8ced7>`);
983
- _push(ssrRenderComponent(unref(Button), {
984
- variant: "ghost",
985
- size: "sm",
986
- class: ["h-7 gap-1.5 text-xs", { "text-primary": unref(syncScrollEnabled) }],
987
- onClick: ($event) => syncScrollEnabled.value = !unref(syncScrollEnabled)
988
- }, {
989
- default: withCtx((_, _push2, _parent2, _scopeId) => {
990
- if (_push2) {
991
- ssrRenderVNode(_push2, createVNode(resolveDynamicComponent(unref(syncScrollEnabled) ? unref(Link) : unref(Link2Off)), { class: "size-3.5" }, null), _parent2, _scopeId);
992
- _push2(` ${ssrInterpolate(unref(syncScrollEnabled) ? "Sync scroll" : "Scroll unlocked")}`);
993
- } else {
994
- return [
995
- (openBlock(), createBlock(resolveDynamicComponent(unref(syncScrollEnabled) ? unref(Link) : unref(Link2Off)), { class: "size-3.5" })),
996
- createTextVNode(" " + toDisplayString(unref(syncScrollEnabled) ? "Sync scroll" : "Scroll unlocked"), 1)
997
- ];
998
- }
999
- }),
1000
- _: 1
1001
- }, _parent));
1002
- _push(`</div><div class="diff-split" data-v-9eb8ced7><div class="diff-column diff-column-left" data-v-9eb8ced7><div class="diff-column-content" data-v-9eb8ced7><!--[-->`);
1003
- ssrRenderList(unref(displayItems), (item) => {
1004
- _push(`<!--[-->`);
1005
- if (item.type === "separator") {
1006
- _push(`<div class="diff-separator-half" data-v-9eb8ced7><div class="separator-line" data-v-9eb8ced7></div><span class="separator-text" data-v-9eb8ced7>···</span></div>`);
1007
- } else if (item.pair) {
1008
- _push(`<div class="${ssrRenderClass([{
1009
- "diff-remove": item.pair.left.type === "remove",
1010
- "diff-empty": item.pair.left.type === "empty",
1011
- "diff-context": item.pair.left.type === "context"
1012
- }, "diff-line"])}" data-v-9eb8ced7><div class="diff-gutter" data-v-9eb8ced7>`);
1013
- if (item.pair.left.lineNum) {
1014
- _push(`<span class="line-number" data-v-9eb8ced7>${ssrInterpolate(item.pair.left.lineNum)}</span>`);
1015
- } else {
1016
- _push(`<!---->`);
1017
- }
1018
- _push(`</div><div class="diff-content" data-v-9eb8ced7>`);
1019
- if (item.pair.left.type !== "empty") {
1020
- _push(`<span class="diff-code" data-v-9eb8ced7>${(getHighlightedContent(item.pair.id, "old") || escapeHtml(item.pair.left.content)) ?? ""}</span>`);
1021
- } else {
1022
- _push(`<!---->`);
1023
- }
1024
- _push(`</div></div>`);
1025
- } else {
1026
- _push(`<!---->`);
1027
- }
1028
- _push(`<!--]-->`);
1029
- });
1030
- _push(`<!--]--></div></div><div class="diff-column diff-column-right" data-v-9eb8ced7><div class="diff-column-content" data-v-9eb8ced7><!--[-->`);
1031
- ssrRenderList(unref(displayItems), (item) => {
1032
- _push(`<!--[-->`);
1033
- if (item.type === "separator") {
1034
- _push(`<div class="diff-separator-half" data-v-9eb8ced7><span class="separator-text" data-v-9eb8ced7>···</span><div class="separator-line" data-v-9eb8ced7></div></div>`);
1035
- } else if (item.pair) {
1036
- _push(`<div class="${ssrRenderClass([{
1037
- "diff-add": item.pair.right.type === "add",
1038
- "diff-empty": item.pair.right.type === "empty",
1039
- "diff-context": item.pair.right.type === "context"
1040
- }, "diff-line"])}" data-v-9eb8ced7><div class="diff-gutter" data-v-9eb8ced7>`);
1041
- if (item.pair.right.lineNum) {
1042
- _push(`<span class="line-number" data-v-9eb8ced7>${ssrInterpolate(item.pair.right.lineNum)}</span>`);
1043
- } else {
1044
- _push(`<!---->`);
1045
- }
1046
- _push(`</div><div class="diff-content" data-v-9eb8ced7>`);
1047
- if (item.pair.right.type !== "empty") {
1048
- _push(`<span class="diff-code" data-v-9eb8ced7>${(getHighlightedContent(item.pair.id, "new") || escapeHtml(item.pair.right.content)) ?? ""}</span>`);
1049
- } else {
1050
- _push(`<!---->`);
1051
- }
1052
- _push(`</div></div>`);
1053
- } else {
1054
- _push(`<!---->`);
1055
- }
1056
- _push(`<!--]-->`);
1057
- });
1058
- _push(`<!--]--></div></div></div></div>`);
993
+ _push(`<div class="diff-container" data-v-1520f40e>`);
994
+ if (!__props.showFullFile) {
995
+ _push(`<div class="diff-toolbar" data-v-1520f40e>`);
996
+ _push(ssrRenderComponent(unref(Button), {
997
+ size: "sm",
998
+ variant: unref(diffLayout) === "split" ? "secondary" : "ghost",
999
+ class: "h-7 px-2.5 text-xs",
1000
+ onClick: ($event) => setDiffLayout("split")
1001
+ }, {
1002
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
1003
+ if (_push2) {
1004
+ _push2(` Split `);
1005
+ } else {
1006
+ return [
1007
+ createTextVNode(" Split ")
1008
+ ];
1009
+ }
1010
+ }),
1011
+ _: 1
1012
+ }, _parent));
1013
+ _push(ssrRenderComponent(unref(Button), {
1014
+ size: "sm",
1015
+ variant: unref(diffLayout) === "unified" ? "secondary" : "ghost",
1016
+ class: "h-7 px-2.5 text-xs",
1017
+ onClick: ($event) => setDiffLayout("unified")
1018
+ }, {
1019
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
1020
+ if (_push2) {
1021
+ _push2(` Unified `);
1022
+ } else {
1023
+ return [
1024
+ createTextVNode(" Unified ")
1025
+ ];
1026
+ }
1027
+ }),
1028
+ _: 1
1029
+ }, _parent));
1030
+ _push(`</div>`);
1031
+ } else {
1032
+ _push(`<!---->`);
1033
+ }
1034
+ _push(`<div class="pierre-diff-host" data-v-1520f40e></div></div>`);
1059
1035
  }
1060
1036
  _push(`</div>`);
1061
1037
  };
1062
1038
  }
1063
1039
  });
1064
- const _sfc_setup$j = _sfc_main$j.setup;
1065
- _sfc_main$j.setup = (props, ctx) => {
1040
+ const _sfc_setup$n = _sfc_main$n.setup;
1041
+ _sfc_main$n.setup = (props, ctx) => {
1066
1042
  const ssrContext = useSSRContext();
1067
1043
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/git/DiffViewer.vue");
1068
- return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
1044
+ return _sfc_setup$n ? _sfc_setup$n(props, ctx) : void 0;
1069
1045
  };
1070
- const __nuxt_component_1$2 = /* @__PURE__ */ Object.assign(_export_sfc(_sfc_main$j, [["__scopeId", "data-v-9eb8ced7"]]), { __name: "GitDiffViewer" });
1071
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
1046
+ const __nuxt_component_1$2 = /* @__PURE__ */ Object.assign(_export_sfc(_sfc_main$n, [["__scopeId", "data-v-1520f40e"]]), { __name: "GitDiffViewer" });
1047
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
1072
1048
  __name: "ScrollBar",
1073
1049
  __ssrInlineRender: true,
1074
1050
  props: {
@@ -1110,14 +1086,14 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1110
1086
  };
1111
1087
  }
1112
1088
  });
1113
- const _sfc_setup$i = _sfc_main$i.setup;
1114
- _sfc_main$i.setup = (props, ctx) => {
1089
+ const _sfc_setup$m = _sfc_main$m.setup;
1090
+ _sfc_main$m.setup = (props, ctx) => {
1115
1091
  const ssrContext = useSSRContext();
1116
1092
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ui/scroll-area/ScrollBar.vue");
1117
- return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
1093
+ return _sfc_setup$m ? _sfc_setup$m(props, ctx) : void 0;
1118
1094
  };
1119
- const ScrollBar = Object.assign(_sfc_main$i, { __name: "UiScrollAreaScrollBar" });
1120
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
1095
+ const ScrollBar = Object.assign(_sfc_main$m, { __name: "UiScrollAreaScrollBar" });
1096
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
1121
1097
  __name: "ScrollArea",
1122
1098
  __ssrInlineRender: true,
1123
1099
  props: {
@@ -1175,13 +1151,180 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1175
1151
  };
1176
1152
  }
1177
1153
  });
1154
+ const _sfc_setup$l = _sfc_main$l.setup;
1155
+ _sfc_main$l.setup = (props, ctx) => {
1156
+ const ssrContext = useSSRContext();
1157
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ui/scroll-area/ScrollArea.vue");
1158
+ return _sfc_setup$l ? _sfc_setup$l(props, ctx) : void 0;
1159
+ };
1160
+ const ScrollArea = Object.assign(_sfc_main$l, { __name: "UiScrollArea" });
1161
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
1162
+ __name: "Tabs",
1163
+ __ssrInlineRender: true,
1164
+ props: {
1165
+ defaultValue: {},
1166
+ orientation: {},
1167
+ dir: {},
1168
+ activationMode: {},
1169
+ modelValue: {},
1170
+ unmountOnHide: { type: Boolean },
1171
+ asChild: { type: Boolean },
1172
+ as: {},
1173
+ class: {}
1174
+ },
1175
+ emits: ["update:modelValue"],
1176
+ setup(__props, { emit: __emit }) {
1177
+ const props = __props;
1178
+ const emits = __emit;
1179
+ const delegatedProps = reactiveOmit(props, "class");
1180
+ const forwarded = useForwardPropsEmits(delegatedProps, emits);
1181
+ return (_ctx, _push, _parent, _attrs) => {
1182
+ _push(ssrRenderComponent(unref(TabsRoot), mergeProps({ "data-slot": "tabs" }, unref(forwarded), {
1183
+ class: unref(cn)("flex flex-col gap-2", props.class)
1184
+ }, _attrs), {
1185
+ default: withCtx((slotProps, _push2, _parent2, _scopeId) => {
1186
+ if (_push2) {
1187
+ ssrRenderSlot(_ctx.$slots, "default", slotProps, null, _push2, _parent2, _scopeId);
1188
+ } else {
1189
+ return [
1190
+ renderSlot(_ctx.$slots, "default", slotProps)
1191
+ ];
1192
+ }
1193
+ }),
1194
+ _: 3
1195
+ }, _parent));
1196
+ };
1197
+ }
1198
+ });
1199
+ const _sfc_setup$k = _sfc_main$k.setup;
1200
+ _sfc_main$k.setup = (props, ctx) => {
1201
+ const ssrContext = useSSRContext();
1202
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ui/tabs/Tabs.vue");
1203
+ return _sfc_setup$k ? _sfc_setup$k(props, ctx) : void 0;
1204
+ };
1205
+ const Tabs = Object.assign(_sfc_main$k, { __name: "UiTabs" });
1206
+ const _sfc_main$j = /* @__PURE__ */ defineComponent({
1207
+ __name: "TabsContent",
1208
+ __ssrInlineRender: true,
1209
+ props: {
1210
+ value: {},
1211
+ forceMount: { type: Boolean },
1212
+ asChild: { type: Boolean },
1213
+ as: {},
1214
+ class: {}
1215
+ },
1216
+ setup(__props) {
1217
+ const props = __props;
1218
+ const delegatedProps = reactiveOmit(props, "class");
1219
+ return (_ctx, _push, _parent, _attrs) => {
1220
+ _push(ssrRenderComponent(unref(TabsContent$1), mergeProps({
1221
+ "data-slot": "tabs-content",
1222
+ class: unref(cn)("flex-1 outline-none", props.class)
1223
+ }, unref(delegatedProps), _attrs), {
1224
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
1225
+ if (_push2) {
1226
+ ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
1227
+ } else {
1228
+ return [
1229
+ renderSlot(_ctx.$slots, "default")
1230
+ ];
1231
+ }
1232
+ }),
1233
+ _: 3
1234
+ }, _parent));
1235
+ };
1236
+ }
1237
+ });
1238
+ const _sfc_setup$j = _sfc_main$j.setup;
1239
+ _sfc_main$j.setup = (props, ctx) => {
1240
+ const ssrContext = useSSRContext();
1241
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ui/tabs/TabsContent.vue");
1242
+ return _sfc_setup$j ? _sfc_setup$j(props, ctx) : void 0;
1243
+ };
1244
+ const TabsContent = Object.assign(_sfc_main$j, { __name: "UiTabsContent" });
1245
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
1246
+ __name: "TabsList",
1247
+ __ssrInlineRender: true,
1248
+ props: {
1249
+ loop: { type: Boolean },
1250
+ asChild: { type: Boolean },
1251
+ as: {},
1252
+ class: {}
1253
+ },
1254
+ setup(__props) {
1255
+ const props = __props;
1256
+ const delegatedProps = reactiveOmit(props, "class");
1257
+ return (_ctx, _push, _parent, _attrs) => {
1258
+ _push(ssrRenderComponent(unref(TabsList$1), mergeProps({ "data-slot": "tabs-list" }, unref(delegatedProps), {
1259
+ class: unref(cn)(
1260
+ "bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",
1261
+ props.class
1262
+ )
1263
+ }, _attrs), {
1264
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
1265
+ if (_push2) {
1266
+ ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
1267
+ } else {
1268
+ return [
1269
+ renderSlot(_ctx.$slots, "default")
1270
+ ];
1271
+ }
1272
+ }),
1273
+ _: 3
1274
+ }, _parent));
1275
+ };
1276
+ }
1277
+ });
1278
+ const _sfc_setup$i = _sfc_main$i.setup;
1279
+ _sfc_main$i.setup = (props, ctx) => {
1280
+ const ssrContext = useSSRContext();
1281
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ui/tabs/TabsList.vue");
1282
+ return _sfc_setup$i ? _sfc_setup$i(props, ctx) : void 0;
1283
+ };
1284
+ const TabsList = Object.assign(_sfc_main$i, { __name: "UiTabsList" });
1285
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
1286
+ __name: "TabsTrigger",
1287
+ __ssrInlineRender: true,
1288
+ props: {
1289
+ value: {},
1290
+ disabled: { type: Boolean },
1291
+ asChild: { type: Boolean },
1292
+ as: {},
1293
+ class: {}
1294
+ },
1295
+ setup(__props) {
1296
+ const props = __props;
1297
+ const delegatedProps = reactiveOmit(props, "class");
1298
+ const forwardedProps = useForwardProps(delegatedProps);
1299
+ return (_ctx, _push, _parent, _attrs) => {
1300
+ _push(ssrRenderComponent(unref(TabsTrigger$1), mergeProps({
1301
+ "data-slot": "tabs-trigger",
1302
+ class: unref(cn)(
1303
+ "data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1304
+ props.class
1305
+ )
1306
+ }, unref(forwardedProps), _attrs), {
1307
+ default: withCtx((_, _push2, _parent2, _scopeId) => {
1308
+ if (_push2) {
1309
+ ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
1310
+ } else {
1311
+ return [
1312
+ renderSlot(_ctx.$slots, "default")
1313
+ ];
1314
+ }
1315
+ }),
1316
+ _: 3
1317
+ }, _parent));
1318
+ };
1319
+ }
1320
+ });
1178
1321
  const _sfc_setup$h = _sfc_main$h.setup;
1179
1322
  _sfc_main$h.setup = (props, ctx) => {
1180
1323
  const ssrContext = useSSRContext();
1181
- (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ui/scroll-area/ScrollArea.vue");
1324
+ (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/ui/tabs/TabsTrigger.vue");
1182
1325
  return _sfc_setup$h ? _sfc_setup$h(props, ctx) : void 0;
1183
1326
  };
1184
- const ScrollArea = Object.assign(_sfc_main$h, { __name: "UiScrollArea" });
1327
+ const TabsTrigger = Object.assign(_sfc_main$h, { __name: "UiTabsTrigger" });
1185
1328
  const _sfc_main$g = /* @__PURE__ */ defineComponent({
1186
1329
  __name: "Tooltip",
1187
1330
  __ssrInlineRender: true,
@@ -1569,11 +1712,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1569
1712
  emits: ["close"],
1570
1713
  setup(__props, { emit: __emit }) {
1571
1714
  const props = __props;
1572
- const { fetchDiff, fetchFileDiff, fetchFileContent, isLoadingDiff, isLoadingFileDiff, isLoadingFileContent } = useGit();
1715
+ const { fetchCommits, fetchDiff, fetchFileDiff, fetchFileContent, isLoadingDiff, isLoadingFileDiff, isLoadingFileContent } = useGit();
1573
1716
  const files = ref([]);
1574
1717
  const selectedFile = ref();
1575
1718
  const hunks = ref([]);
1576
1719
  const fileContent = ref(null);
1720
+ const oldFileContent = ref(null);
1721
+ const parentCommitSha = ref(null);
1577
1722
  const error = ref(null);
1578
1723
  const fileDiffError = ref(null);
1579
1724
  const viewMode = ref("changes");
@@ -1587,6 +1732,16 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1587
1732
  return fallback;
1588
1733
  }
1589
1734
  const selectedFileDiff = computed(() => files.value.find((f) => f.path === selectedFile.value));
1735
+ const canUseFullFileMode = computed(() => {
1736
+ const file = selectedFileDiff.value;
1737
+ if (!file) {
1738
+ return true;
1739
+ }
1740
+ if (file.binary) {
1741
+ return false;
1742
+ }
1743
+ return file.status !== "deleted";
1744
+ });
1590
1745
  const diffViewerKey = computed(() => `${props.repoPath || ""}:${props.commitSha}:${selectedFile.value || ""}`);
1591
1746
  function resetDiffState() {
1592
1747
  error.value = null;
@@ -1594,6 +1749,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1594
1749
  selectedFile.value = void 0;
1595
1750
  hunks.value = [];
1596
1751
  fileContent.value = null;
1752
+ oldFileContent.value = null;
1753
+ parentCommitSha.value = null;
1597
1754
  fileDiffError.value = null;
1598
1755
  }
1599
1756
  async function loadDiff() {
@@ -1604,16 +1761,24 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1604
1761
  fileRequestManager.cancel();
1605
1762
  resetDiffState();
1606
1763
  try {
1607
- const result = await fetchDiff(requestRepoId, requestCommitSha, {
1608
- repoPath: requestRepoPath,
1609
- signal: ticket.signal,
1610
- suppressError: true
1611
- });
1764
+ const [result, commitsResult] = await Promise.all([
1765
+ fetchDiff(requestRepoId, requestCommitSha, {
1766
+ repoPath: requestRepoPath,
1767
+ signal: ticket.signal,
1768
+ suppressError: true
1769
+ }),
1770
+ fetchCommits(requestRepoId, [requestCommitSha], {
1771
+ repoPath: requestRepoPath,
1772
+ signal: ticket.signal,
1773
+ suppressError: true
1774
+ })
1775
+ ]);
1612
1776
  const isCurrentRequest = ticket.isCurrent() && props.repoId === requestRepoId && props.commitSha === requestCommitSha && props.repoPath === requestRepoPath;
1613
1777
  if (!isCurrentRequest) {
1614
1778
  return;
1615
1779
  }
1616
1780
  files.value = result;
1781
+ parentCommitSha.value = commitsResult.commits[0]?.parentSha || null;
1617
1782
  if (result.length > 0) {
1618
1783
  selectedFile.value = result[0].path;
1619
1784
  }
@@ -1639,12 +1804,16 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1639
1804
  const requestRepoPath = props.repoPath;
1640
1805
  const requestMode = viewMode.value;
1641
1806
  const requestPath = selectedPath;
1807
+ const requestParentCommitSha = parentCommitSha.value;
1808
+ const requestFileStatus = selectedFileDiff.value?.status;
1809
+ const requestOldPath = selectedFileDiff.value?.oldPath;
1642
1810
  const ticket = fileRequestManager.begin();
1643
1811
  fileDiffError.value = null;
1644
1812
  hunks.value = [];
1645
1813
  fileContent.value = null;
1814
+ oldFileContent.value = null;
1646
1815
  const isCurrentRequest = () => {
1647
- return ticket.isCurrent() && props.repoId === requestRepoId && props.commitSha === requestCommitSha && props.repoPath === requestRepoPath && viewMode.value === requestMode && selectedFile.value === requestPath;
1816
+ return ticket.isCurrent() && props.repoId === requestRepoId && props.commitSha === requestCommitSha && props.repoPath === requestRepoPath && viewMode.value === requestMode && selectedFile.value === requestPath && parentCommitSha.value === requestParentCommitSha;
1648
1817
  };
1649
1818
  try {
1650
1819
  const diffPromise = fetchFileDiff(requestRepoId, requestCommitSha, requestPath, {
@@ -1653,19 +1822,40 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1653
1822
  suppressError: true
1654
1823
  });
1655
1824
  if (requestMode === "full") {
1656
- const [result, content] = await Promise.all([
1825
+ const oldContentPromise = (() => {
1826
+ if (requestFileStatus === "added") {
1827
+ return Promise.resolve("");
1828
+ }
1829
+ if (!requestParentCommitSha) {
1830
+ return Promise.resolve(null);
1831
+ }
1832
+ const oldFilePath = requestOldPath || requestPath;
1833
+ return fetchFileContent(requestRepoId, requestParentCommitSha, oldFilePath, {
1834
+ repoPath: requestRepoPath,
1835
+ signal: ticket.signal,
1836
+ suppressError: true
1837
+ }).catch((fetchError) => {
1838
+ if (isAbortError(fetchError)) {
1839
+ throw fetchError;
1840
+ }
1841
+ return null;
1842
+ });
1843
+ })();
1844
+ const [result, content, oldContent] = await Promise.all([
1657
1845
  diffPromise,
1658
1846
  fetchFileContent(requestRepoId, requestCommitSha, requestPath, {
1659
1847
  repoPath: requestRepoPath,
1660
1848
  signal: ticket.signal,
1661
1849
  suppressError: true
1662
- })
1850
+ }),
1851
+ oldContentPromise
1663
1852
  ]);
1664
1853
  if (!isCurrentRequest()) {
1665
1854
  return;
1666
1855
  }
1667
1856
  hunks.value = result;
1668
1857
  fileContent.value = content;
1858
+ oldFileContent.value = oldContent;
1669
1859
  } else {
1670
1860
  const result = await diffPromise;
1671
1861
  if (!isCurrentRequest()) {
@@ -1673,6 +1863,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1673
1863
  }
1674
1864
  hunks.value = result;
1675
1865
  fileContent.value = null;
1866
+ oldFileContent.value = null;
1676
1867
  }
1677
1868
  } catch (loadError) {
1678
1869
  if (!isCurrentRequest() || isAbortError(loadError)) {
@@ -1683,8 +1874,15 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1683
1874
  fileRequestManager.clear(ticket);
1684
1875
  }
1685
1876
  }
1686
- function toggleViewMode() {
1687
- viewMode.value = viewMode.value === "changes" ? "full" : "changes";
1877
+ function setViewMode(nextMode) {
1878
+ if (nextMode !== "changes" && nextMode !== "full") {
1879
+ return;
1880
+ }
1881
+ if (nextMode === "full" && !canUseFullFileMode.value) {
1882
+ viewMode.value = "changes";
1883
+ return;
1884
+ }
1885
+ viewMode.value = nextMode;
1688
1886
  }
1689
1887
  function handleFileSelect(path) {
1690
1888
  selectedFile.value = path;
@@ -1701,6 +1899,15 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1701
1899
  void loadFileDiff();
1702
1900
  }
1703
1901
  );
1902
+ watch(
1903
+ () => canUseFullFileMode.value,
1904
+ (canUseFullView) => {
1905
+ if (!canUseFullView && viewMode.value === "full") {
1906
+ viewMode.value = "changes";
1907
+ }
1908
+ },
1909
+ { immediate: true }
1910
+ );
1704
1911
  watch(
1705
1912
  () => [props.repoId, props.commitSha, props.repoPath],
1706
1913
  () => {
@@ -1710,6 +1917,11 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1710
1917
  );
1711
1918
  const panelRef = ref(null);
1712
1919
  const diffViewerRef = ref(null);
1920
+ watch(viewMode, (mode) => {
1921
+ {
1922
+ return;
1923
+ }
1924
+ });
1713
1925
  return (_ctx, _push, _parent, _attrs) => {
1714
1926
  const _component_GitChangesMinimap = __nuxt_component_0$1;
1715
1927
  const _component_GitDiffViewer = __nuxt_component_1$2;
@@ -1902,60 +2114,43 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1902
2114
  _push(`<!---->`);
1903
2115
  }
1904
2116
  if (!unref(selectedFileDiff)?.binary) {
1905
- _push(ssrRenderComponent(unref(TooltipProvider), null, {
2117
+ _push(ssrRenderComponent(unref(Tabs), {
2118
+ "model-value": unref(viewMode),
2119
+ class: "shrink-0 gap-0",
2120
+ "onUpdate:modelValue": setViewMode
2121
+ }, {
1906
2122
  default: withCtx((_, _push2, _parent2, _scopeId) => {
1907
2123
  if (_push2) {
1908
- _push2(ssrRenderComponent(unref(Tooltip), null, {
2124
+ _push2(ssrRenderComponent(unref(TabsList), { class: "h-7 p-[2px]" }, {
1909
2125
  default: withCtx((_2, _push3, _parent3, _scopeId2) => {
1910
2126
  if (_push3) {
1911
- _push3(ssrRenderComponent(unref(TooltipTrigger), { "as-child": "" }, {
2127
+ _push3(ssrRenderComponent(unref(TabsTrigger), {
2128
+ value: "changes",
2129
+ class: "h-[calc(100%-1px)] px-2 text-xs"
2130
+ }, {
1912
2131
  default: withCtx((_3, _push4, _parent4, _scopeId3) => {
1913
2132
  if (_push4) {
1914
- _push4(ssrRenderComponent(unref(Button), {
1915
- variant: "ghost",
1916
- size: "sm",
1917
- class: "h-7 shrink-0 gap-1.5 text-xs",
1918
- onClick: toggleViewMode
1919
- }, {
1920
- default: withCtx((_4, _push5, _parent5, _scopeId4) => {
1921
- if (_push5) {
1922
- ssrRenderVNode(_push5, createVNode(resolveDynamicComponent(unref(viewMode) === "changes" ? unref(FileDiff) : unref(FileCode)), { class: "size-3.5" }, null), _parent5, _scopeId4);
1923
- _push5(` ${ssrInterpolate(unref(viewMode) === "changes" ? "Changes" : "Full file")}`);
1924
- } else {
1925
- return [
1926
- (openBlock(), createBlock(resolveDynamicComponent(unref(viewMode) === "changes" ? unref(FileDiff) : unref(FileCode)), { class: "size-3.5" })),
1927
- createTextVNode(" " + toDisplayString(unref(viewMode) === "changes" ? "Changes" : "Full file"), 1)
1928
- ];
1929
- }
1930
- }),
1931
- _: 1
1932
- }, _parent4, _scopeId3));
2133
+ _push4(` Changes `);
1933
2134
  } else {
1934
2135
  return [
1935
- createVNode(unref(Button), {
1936
- variant: "ghost",
1937
- size: "sm",
1938
- class: "h-7 shrink-0 gap-1.5 text-xs",
1939
- onClick: toggleViewMode
1940
- }, {
1941
- default: withCtx(() => [
1942
- (openBlock(), createBlock(resolveDynamicComponent(unref(viewMode) === "changes" ? unref(FileDiff) : unref(FileCode)), { class: "size-3.5" })),
1943
- createTextVNode(" " + toDisplayString(unref(viewMode) === "changes" ? "Changes" : "Full file"), 1)
1944
- ]),
1945
- _: 1
1946
- })
2136
+ createTextVNode(" Changes ")
1947
2137
  ];
1948
2138
  }
1949
2139
  }),
1950
2140
  _: 1
1951
2141
  }, _parent3, _scopeId2));
1952
- _push3(ssrRenderComponent(unref(TooltipContent), null, {
2142
+ _push3(ssrRenderComponent(unref(TabsTrigger), {
2143
+ value: "full",
2144
+ class: "h-[calc(100%-1px)] px-2 text-xs",
2145
+ disabled: !unref(canUseFullFileMode),
2146
+ title: unref(selectedFileDiff)?.status === "deleted" ? "Full file view is unavailable for deleted files." : void 0
2147
+ }, {
1953
2148
  default: withCtx((_3, _push4, _parent4, _scopeId3) => {
1954
2149
  if (_push4) {
1955
- _push4(`${ssrInterpolate(unref(viewMode) === "changes" ? "Show full file with changes" : "Show changes only")}`);
2150
+ _push4(` Full file `);
1956
2151
  } else {
1957
2152
  return [
1958
- createTextVNode(toDisplayString(unref(viewMode) === "changes" ? "Show full file with changes" : "Show changes only"), 1)
2153
+ createTextVNode(" Full file ")
1959
2154
  ];
1960
2155
  }
1961
2156
  }),
@@ -1963,29 +2158,26 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1963
2158
  }, _parent3, _scopeId2));
1964
2159
  } else {
1965
2160
  return [
1966
- createVNode(unref(TooltipTrigger), { "as-child": "" }, {
2161
+ createVNode(unref(TabsTrigger), {
2162
+ value: "changes",
2163
+ class: "h-[calc(100%-1px)] px-2 text-xs"
2164
+ }, {
1967
2165
  default: withCtx(() => [
1968
- createVNode(unref(Button), {
1969
- variant: "ghost",
1970
- size: "sm",
1971
- class: "h-7 shrink-0 gap-1.5 text-xs",
1972
- onClick: toggleViewMode
1973
- }, {
1974
- default: withCtx(() => [
1975
- (openBlock(), createBlock(resolveDynamicComponent(unref(viewMode) === "changes" ? unref(FileDiff) : unref(FileCode)), { class: "size-3.5" })),
1976
- createTextVNode(" " + toDisplayString(unref(viewMode) === "changes" ? "Changes" : "Full file"), 1)
1977
- ]),
1978
- _: 1
1979
- })
2166
+ createTextVNode(" Changes ")
1980
2167
  ]),
1981
2168
  _: 1
1982
2169
  }),
1983
- createVNode(unref(TooltipContent), null, {
2170
+ createVNode(unref(TabsTrigger), {
2171
+ value: "full",
2172
+ class: "h-[calc(100%-1px)] px-2 text-xs",
2173
+ disabled: !unref(canUseFullFileMode),
2174
+ title: unref(selectedFileDiff)?.status === "deleted" ? "Full file view is unavailable for deleted files." : void 0
2175
+ }, {
1984
2176
  default: withCtx(() => [
1985
- createTextVNode(toDisplayString(unref(viewMode) === "changes" ? "Show full file with changes" : "Show changes only"), 1)
2177
+ createTextVNode(" Full file ")
1986
2178
  ]),
1987
2179
  _: 1
1988
- })
2180
+ }, 8, ["disabled", "title"])
1989
2181
  ];
1990
2182
  }
1991
2183
  }),
@@ -1993,31 +2185,28 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
1993
2185
  }, _parent2, _scopeId));
1994
2186
  } else {
1995
2187
  return [
1996
- createVNode(unref(Tooltip), null, {
2188
+ createVNode(unref(TabsList), { class: "h-7 p-[2px]" }, {
1997
2189
  default: withCtx(() => [
1998
- createVNode(unref(TooltipTrigger), { "as-child": "" }, {
2190
+ createVNode(unref(TabsTrigger), {
2191
+ value: "changes",
2192
+ class: "h-[calc(100%-1px)] px-2 text-xs"
2193
+ }, {
1999
2194
  default: withCtx(() => [
2000
- createVNode(unref(Button), {
2001
- variant: "ghost",
2002
- size: "sm",
2003
- class: "h-7 shrink-0 gap-1.5 text-xs",
2004
- onClick: toggleViewMode
2005
- }, {
2006
- default: withCtx(() => [
2007
- (openBlock(), createBlock(resolveDynamicComponent(unref(viewMode) === "changes" ? unref(FileDiff) : unref(FileCode)), { class: "size-3.5" })),
2008
- createTextVNode(" " + toDisplayString(unref(viewMode) === "changes" ? "Changes" : "Full file"), 1)
2009
- ]),
2010
- _: 1
2011
- })
2195
+ createTextVNode(" Changes ")
2012
2196
  ]),
2013
2197
  _: 1
2014
2198
  }),
2015
- createVNode(unref(TooltipContent), null, {
2199
+ createVNode(unref(TabsTrigger), {
2200
+ value: "full",
2201
+ class: "h-[calc(100%-1px)] px-2 text-xs",
2202
+ disabled: !unref(canUseFullFileMode),
2203
+ title: unref(selectedFileDiff)?.status === "deleted" ? "Full file view is unavailable for deleted files." : void 0
2204
+ }, {
2016
2205
  default: withCtx(() => [
2017
- createTextVNode(toDisplayString(unref(viewMode) === "changes" ? "Show full file with changes" : "Show changes only"), 1)
2206
+ createTextVNode(" Full file ")
2018
2207
  ]),
2019
2208
  _: 1
2020
- })
2209
+ }, 8, ["disabled", "title"])
2021
2210
  ]),
2022
2211
  _: 1
2023
2212
  })
@@ -2070,8 +2259,10 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2070
2259
  hunks: unref(hunks),
2071
2260
  "file-path": unref(selectedFile),
2072
2261
  binary: unref(selectedFileDiff)?.binary,
2262
+ "file-status": unref(selectedFileDiff)?.status,
2073
2263
  "old-path": unref(selectedFileDiff)?.oldPath,
2074
2264
  "file-content": unref(fileContent),
2265
+ "old-file-content": unref(oldFileContent),
2075
2266
  "show-full-file": unref(viewMode) === "full",
2076
2267
  "is-loading-content": unref(isLoadingFileContent)
2077
2268
  }, null, _parent2, _scopeId));
@@ -2087,11 +2278,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
2087
2278
  hunks: unref(hunks),
2088
2279
  "file-path": unref(selectedFile),
2089
2280
  binary: unref(selectedFileDiff)?.binary,
2281
+ "file-status": unref(selectedFileDiff)?.status,
2090
2282
  "old-path": unref(selectedFileDiff)?.oldPath,
2091
2283
  "file-content": unref(fileContent),
2284
+ "old-file-content": unref(oldFileContent),
2092
2285
  "show-full-file": unref(viewMode) === "full",
2093
2286
  "is-loading-content": unref(isLoadingFileContent)
2094
- }, null, 8, ["hunks", "file-path", "binary", "old-path", "file-content", "show-full-file", "is-loading-content"]))
2287
+ }, null, 8, ["hunks", "file-path", "binary", "file-status", "old-path", "file-content", "old-file-content", "show-full-file", "is-loading-content"]))
2095
2288
  ], 512)
2096
2289
  ];
2097
2290
  }
@@ -3724,5 +3917,5 @@ _sfc_main.setup = (props, ctx) => {
3724
3917
  };
3725
3918
  const __nuxt_component_1 = Object.assign(_sfc_main, { __name: "TasksDetail" });
3726
3919
 
3727
- export { Badge as B, __nuxt_component_0$2 as _, __nuxt_component_1 as a };
3728
- //# sourceMappingURL=Detail-DMMUwTWr.mjs.map
3920
+ export { Badge as B, Tabs as T, __nuxt_component_0$2 as _, TabsList as a, TabsTrigger as b, TabsContent as c, __nuxt_component_1 as d };
3921
+ //# sourceMappingURL=Detail-rpcemNXe.mjs.map