azdiffs 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +67 -2
  3. package/THIRD_PARTY_NOTICES.md +4514 -0
  4. package/dist/cli.js +4768 -0
  5. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId-D7saE-jO.js +1 -0
  6. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits._commitId-DOwGbBTQ.js +1 -0
  7. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.commits.index-DzGjUdAz.js +1 -0
  8. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.conflicts-Cjr34xFt.js +1 -0
  9. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.files-BjjJ4Yb8.js +1 -0
  10. package/dist/web/assets/_organization.___git._repository.pullrequest._pullRequestId.index-iY62N_zR.js +1 -0
  11. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId-CrHRklAE.js +1 -0
  12. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits._commitId-WC7fEryq.js +1 -0
  13. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.commits.index-DzGjUdAz.js +1 -0
  14. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.conflicts-BhUkafpV.js +1 -0
  15. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.files-_RVmv4sD.js +1 -0
  16. package/dist/web/assets/_organization._project.___git._repository.pullrequest._pullRequestId.index-BJrgfbSD.js +1 -0
  17. package/dist/web/assets/_organization.index-hKcWlBrk.js +1 -0
  18. package/dist/web/assets/bat-qdxAdBWQ.js +1 -0
  19. package/dist/web/assets/bicep-CUHmPFLl.js +1 -0
  20. package/dist/web/assets/c-B0t_Dlza.js +1 -0
  21. package/dist/web/assets/cmake-Bj61d0ZC.js +1 -0
  22. package/dist/web/assets/commit-diff-view-CQeZylif.js +1 -0
  23. package/dist/web/assets/commits-view-B_TQ6AnD.js +13 -0
  24. package/dist/web/assets/conflicts-view-CnGEkjaP.js +8 -0
  25. package/dist/web/assets/core-D5Wev6DN.js +12 -0
  26. package/dist/web/assets/core-DfsS1UI1.js +12 -0
  27. package/dist/web/assets/cpp-DGR_3gb-.js +1 -0
  28. package/dist/web/assets/csharp-dmMxLVLW.js +1 -0
  29. package/dist/web/assets/css-CBDjU9xM.js +1 -0
  30. package/dist/web/assets/dart-CHZY9Xhz.js +1 -0
  31. package/dist/web/assets/dev.diff-DH1qvnWe.js +1 -0
  32. package/dist/web/assets/diff-woXpYk--.js +1 -0
  33. package/dist/web/assets/docker-IyjqRm3v.js +1 -0
  34. package/dist/web/assets/dotenv-CuH5my32.js +1 -0
  35. package/dist/web/assets/engine-javascript-C4Jk_eU2.js +141 -0
  36. package/dist/web/assets/engine-javascript-DpLLfDIa.js +141 -0
  37. package/dist/web/assets/engine-oniguruma-BfcA8yDp.js +1 -0
  38. package/dist/web/assets/engine-oniguruma-D--T0LcV.js +1 -0
  39. package/dist/web/assets/file-header-keBlejWu.js +49 -0
  40. package/dist/web/assets/files-view-Bu3bjrNf.js +1460 -0
  41. package/dist/web/assets/fsharp-D13ZGOAj.js +1 -0
  42. package/dist/web/assets/go-rLFTqkRN.js +1 -0
  43. package/dist/web/assets/grammars-DmFYBwmS.js +2 -0
  44. package/dist/web/assets/graphql-Br4JsJsw.js +1 -0
  45. package/dist/web/assets/groovy-CacY0gHj.js +1 -0
  46. package/dist/web/assets/hcl-Dh228itO.js +1 -0
  47. package/dist/web/assets/highlights-BJb1-tzP.js +1 -0
  48. package/dist/web/assets/highlights-CIgHM7EF-ByjlShdO.js +1 -0
  49. package/dist/web/assets/home-page-Y5jGxOav.js +1 -0
  50. package/dist/web/assets/html-Cyo-BRss.js +1 -0
  51. package/dist/web/assets/inbox-jP8QPtzZ.js +1 -0
  52. package/dist/web/assets/index-B297yCgq.js +11 -0
  53. package/dist/web/assets/index-CjZUV4-4.css +1 -0
  54. package/dist/web/assets/ini-B5eOa1yu.js +1 -0
  55. package/dist/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  56. package/dist/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  57. package/dist/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  58. package/dist/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  59. package/dist/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  60. package/dist/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  61. package/dist/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  62. package/dist/web/assets/java-r7y4bhRH.js +1 -0
  63. package/dist/web/assets/javascript-anBMbNY-.js +1 -0
  64. package/dist/web/assets/json-qhed-kSA.js +1 -0
  65. package/dist/web/assets/json5-BR5RXkoi.js +1 -0
  66. package/dist/web/assets/jsonc-CYpm1nAK.js +1 -0
  67. package/dist/web/assets/jsx-Bz0zcwM4.js +1 -0
  68. package/dist/web/assets/kotlin-DhhofPvG.js +1 -0
  69. package/dist/web/assets/langs_worker-Dyqdnub0.js +1 -0
  70. package/dist/web/assets/less-DVTAwKKz.js +1 -0
  71. package/dist/web/assets/lib-C2gVWm_O.js +1 -0
  72. package/dist/web/assets/lib-rf_jxHx0.js +1 -0
  73. package/dist/web/assets/lineChanges-Dw4ZXwVU.js +9 -0
  74. package/dist/web/assets/loader-BljfpPoZ.js +1 -0
  75. package/dist/web/assets/loader-C-ieOA_A.js +1 -0
  76. package/dist/web/assets/lua-mGgFNKt2.js +1 -0
  77. package/dist/web/assets/makefile-Dixweg8N.js +1 -0
  78. package/dist/web/assets/markdown-BYOwaDjH.js +1 -0
  79. package/dist/web/assets/overview-view-cEOsI9TY.js +2 -0
  80. package/dist/web/assets/php-DTciGFRO.js +1 -0
  81. package/dist/web/assets/pierre-dark-DMS-zpcK.js +1 -0
  82. package/dist/web/assets/pierre-light-BHq6aQNU.js +1 -0
  83. package/dist/web/assets/powershell-QtSnmXcu.js +1 -0
  84. package/dist/web/assets/properties-CHTuaqAW.js +1 -0
  85. package/dist/web/assets/proto-DB4EqR-F.js +1 -0
  86. package/dist/web/assets/pull-request-layout-DsDKURcq.js +35 -0
  87. package/dist/web/assets/python-gzcpVVnB.js +1 -0
  88. package/dist/web/assets/razor-3kKIP6Di.js +1 -0
  89. package/dist/web/assets/rolldown-runtime-BLXQ4ufn.js +1 -0
  90. package/dist/web/assets/routes-BruvNNp9.js +1 -0
  91. package/dist/web/assets/rust-DpiIf5JO.js +1 -0
  92. package/dist/web/assets/scala-BiFt_7mu.js +1 -0
  93. package/dist/web/assets/scss-DC8XIxmG.js +1 -0
  94. package/dist/web/assets/shellscript-CLZ0U2zV.js +1 -0
  95. package/dist/web/assets/shiki-DueA5xDi.js +1 -0
  96. package/dist/web/assets/shiki-DxP4sN1Z-caEk3oPG.js +1 -0
  97. package/dist/web/assets/shortcut-help-Cb0be4f3.js +1 -0
  98. package/dist/web/assets/sql-CEbI0hMM.js +1 -0
  99. package/dist/web/assets/stream-tokenizer-7LLwu37w-C37tUWGx.js +12 -0
  100. package/dist/web/assets/stream-tokenizer-B5Ok5N3S.js +4 -0
  101. package/dist/web/assets/svelte-iJTmbwM3.js +1 -0
  102. package/dist/web/assets/swift-CyEgAFGc.js +1 -0
  103. package/dist/web/assets/terraform-DswuEJGm.js +1 -0
  104. package/dist/web/assets/themes-BKc5vU6v.js +1 -0
  105. package/dist/web/assets/themes-SQq_asFq.js +1 -0
  106. package/dist/web/assets/toml-CcmNWLt0.js +1 -0
  107. package/dist/web/assets/tsx-udAQXfEw.js +1 -0
  108. package/dist/web/assets/typescript-bsJCZSQ-.js +1 -0
  109. package/dist/web/assets/utils-Tkdy0sOA.js +1 -0
  110. package/dist/web/assets/vb-DOwzaHZ0.js +1 -0
  111. package/dist/web/assets/vue-Dz_q6gML.js +1 -0
  112. package/dist/web/assets/wasm-C7N7kd8H.js +1 -0
  113. package/dist/web/assets/worker-B--T_fs_.js +7 -0
  114. package/dist/web/assets/xml-Bz5Z3pZJ.js +1 -0
  115. package/dist/web/assets/yaml-rwi0_p6S.js +1 -0
  116. package/dist/web/favicon.svg +5 -0
  117. package/dist/web/index.html +16 -0
  118. package/package.json +41 -4
@@ -0,0 +1 @@
1
+ var e=[Object.freeze(JSON.parse('{"displayName":"PowerShell","name":"powershell","patterns":[{"begin":"<#","beginCaptures":{"0":{"name":"punctuation.definition.comment.block.begin.powershell"}},"end":"#>","endCaptures":{"0":{"name":"punctuation.definition.comment.block.end.powershell"}},"name":"comment.block.powershell","patterns":[{"include":"#commentEmbeddedDocs"}]},{"match":"[2-6]>&1|>>?|<<|[<>]|>\\\\||[1-6]>|[1-6]>>","name":"keyword.operator.redirection.powershell"},{"include":"#commands"},{"include":"#commentLine"},{"include":"#variable"},{"include":"#subexpression"},{"include":"#function"},{"include":"#attribute"},{"include":"#UsingDirective"},{"include":"#type"},{"include":"#hashtable"},{"include":"#doubleQuotedString"},{"include":"#scriptblock"},{"include":"#doubleQuotedStringEscapes"},{"applyEndPatternLast":true,"begin":"[\'‘-‛]","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.powershell"}},"end":"[\'‘-‛]","endCaptures":{"0":{"name":"punctuation.definition.string.end.powershell"}},"name":"string.quoted.single.powershell","patterns":[{"match":"[\'‘-‛]{2}","name":"constant.character.escape.powershell"}]},{"begin":"(@[\\"“”„])\\\\s*$","beginCaptures":{"1":{"name":"punctuation.definition.string.begin.powershell"}},"end":"^[\\"“”„]@","endCaptures":{"0":{"name":"punctuation.definition.string.end.powershell"}},"name":"string.quoted.double.heredoc.powershell","patterns":[{"include":"#variableNoProperty"},{"include":"#doubleQuotedStringEscapes"},{"include":"#interpolation"}]},{"begin":"(@[\'‘-‛])\\\\s*$","beginCaptures":{"1":{"name":"punctuation.definition.string.begin.powershell"}},"end":"^[\'‘-‛]@","endCaptures":{"0":{"name":"punctuation.definition.string.end.powershell"}},"name":"string.quoted.single.heredoc.powershell"},{"include":"#numericConstant"},{"begin":"(@)(\\\\()","beginCaptures":{"1":{"name":"keyword.other.array.begin.powershell"},"2":{"name":"punctuation.section.group.begin.powershell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.group.end.powershell"}},"name":"meta.group.array-expression.powershell","patterns":[{"include":"$self"}]},{"begin":"((\\\\$))(\\\\()","beginCaptures":{"1":{"name":"keyword.other.substatement.powershell"},"2":{"name":"punctuation.definition.subexpression.powershell"},"3":{"name":"punctuation.section.group.begin.powershell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.group.end.powershell"}},"name":"meta.group.complex.subexpression.powershell","patterns":[{"include":"$self"}]},{"match":"\\\\b((([-.0-9A-Z_a-z]+)\\\\.(?i:exe|com|cmd|bat)))\\\\b","name":"support.function.powershell"},{"match":"(?<![-.\\\\w])((?i:begin|break|catch|clean|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|from|if|in|inlinescript|parallel|param|process|return|sequence|switch|throw|trap|try|until|var|while)|[%?])(?!\\\\w)","name":"keyword.control.powershell"},{"match":"(?<![-\\\\w]|[^)]\\\\.)((?i:(foreach|where)(?!-object))|[%?])(?!\\\\w)","name":"keyword.control.powershell"},{"begin":"(?<!\\\\w)(--%)(?!\\\\w)","beginCaptures":{"1":{"name":"keyword.control.powershell"}},"end":"$","patterns":[{"match":".+","name":"string.unquoted.powershell"}]},{"match":"(?<!\\\\w)((?i:hidden|static))(?!\\\\w)","name":"storage.modifier.powershell"},{"captures":{"1":{"name":"storage.type.powershell"},"2":{"name":"entity.name.function"}},"match":"(?<![-\\\\w])((?i:class)|[%?])\\\\s+([-_\\\\p{L}\\\\d]?{1,})\\\\b"},{"match":"(?<!\\\\w)-(?i:is(?:not)?|as)\\\\b","name":"keyword.operator.comparison.powershell"},{"match":"(?<!\\\\w)-(?i:[ci]?(?:eq|ne|[gl][et]|(?:not)?(?:like|match|contains|in)|replace))(?!\\\\p{L})","name":"keyword.operator.comparison.powershell"},{"match":"(?<!\\\\w)-(?i:join|split)(?!\\\\p{L})|!","name":"keyword.operator.unary.powershell"},{"match":"(?<!\\\\w)-(?i:and|or|not|xor)(?!\\\\p{L})|!","name":"keyword.operator.logical.powershell"},{"match":"(?<!\\\\w)-(?i:band|bor|bnot|bxor|shl|shr)(?!\\\\p{L})","name":"keyword.operator.bitwise.powershell"},{"match":"(?<!\\\\w)-(?i:f)(?!\\\\p{L})","name":"keyword.operator.string-format.powershell"},{"match":"[-%*+/]?=|[-%*+/]","name":"keyword.operator.assignment.powershell"},{"match":"\\\\|{2}|&{2}|;","name":"punctuation.terminator.statement.powershell"},{"match":"&|(?<!\\\\w)\\\\.(?= )|[,`|]","name":"keyword.operator.other.powershell"},{"match":"(?<!\\\\s|^)\\\\.\\\\.(?=-?\\\\d|[$(])","name":"keyword.operator.range.powershell"}],"repository":{"RequiresDirective":{"begin":"(?<=#)(?i:(requires))\\\\s","beginCaptures":{"0":{"name":"keyword.control.requires.powershell"}},"end":"$","name":"meta.requires.powershell","patterns":[{"match":"-(?i:Modules|PSSnapin|RunAsAdministrator|ShellId|Version|Assembly|PSEdition)","name":"keyword.other.powershell"},{"match":"(?<!-)\\\\b\\\\p{L}+|\\\\d+(?:\\\\.\\\\d+)*","name":"variable.parameter.powershell"},{"include":"#hashtable"}]},"UsingDirective":{"captures":{"1":{"name":"keyword.control.using.powershell"},"2":{"name":"keyword.other.powershell"},"3":{"name":"variable.parameter.powershell"}},"match":"(?<!\\\\w)(?i:(using))\\\\s+(?i:(namespace|module))\\\\s+(?i:((?:\\\\w+\\\\.?)+))"},"attribute":{"begin":"(\\\\[)\\\\s*\\\\b(?i)(cmdletbinding|alias|outputtype|parameter|validatenotnull|validatenotnullorempty|validatecount|validateset|allownull|allowemptycollection|allowemptystring|validatescript|validaterange|validatepattern|validatelength|supportswildcards)\\\\b","beginCaptures":{"1":{"name":"punctuation.section.bracket.begin.powershell"},"2":{"name":"support.function.attribute.powershell"}},"end":"(])","endCaptures":{"1":{"name":"punctuation.section.bracket.end.powershell"}},"name":"meta.attribute.powershell","patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.group.begin.powershell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.group.end.powershell"}},"patterns":[{"include":"$self"},{"captures":{"1":{"name":"variable.parameter.attribute.powershell"},"2":{"name":"keyword.operator.assignment.powershell"}},"match":"(?i)\\\\b(mandatory|valuefrompipeline|valuefrompipelinebypropertyname|valuefromremainingarguments|position|parametersetname|defaultparametersetname|supportsshouldprocess|supportspaging|positionalbinding|helpuri|confirmimpact|helpmessage)\\\\b\\\\s+{0,1}(=)?"}]}]},"commands":{"patterns":[{"match":"(?:([-:\\\\\\\\_\\\\p{L}\\\\d])*\\\\\\\\)?\\\\b(?i:Add|Approve|Assert|Backup|Block|Build|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Deploy|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Mount|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Write)-.+?(?:\\\\.(?i:exe|cmd|bat|ps1))?\\\\b","name":"support.function.powershell"},{"match":"(?<!\\\\w)(?i:foreach-object)(?!\\\\w)","name":"support.function.powershell"},{"match":"(?<!\\\\w)(?i:where-object)(?!\\\\w)","name":"support.function.powershell"},{"match":"(?<!\\\\w)(?i:sort-object)(?!\\\\w)","name":"support.function.powershell"},{"match":"(?<!\\\\w)(?i:tee-object)(?!\\\\w)","name":"support.function.powershell"}]},"commentEmbeddedDocs":{"patterns":[{"captures":{"1":{"name":"constant.string.documentation.powershell"},"2":{"name":"keyword.operator.documentation.powershell"}},"match":"(?:^|\\\\G)(?i:\\\\s*(\\\\.)(COMPONENT|DESCRIPTION|EXAMPLE|FUNCTIONALITY|INPUTS|LINK|NOTES|OUTPUTS|ROLE|SYNOPSIS))\\\\s*$","name":"comment.documentation.embedded.powershell"},{"captures":{"1":{"name":"constant.string.documentation.powershell"},"2":{"name":"keyword.operator.documentation.powershell"},"3":{"name":"keyword.operator.documentation.powershell"}},"match":"(?:^|\\\\G)(?i:\\\\s*(\\\\.)(EXTERNALHELP|FORWARDHELP(?:CATEGORY|TARGETNAME)|PARAMETER|REMOTEHELPRUNSPACE))\\\\s+(.+?)\\\\s*$","name":"comment.documentation.embedded.powershell"}]},"commentLine":{"begin":"(?<![-\\\\\\\\`])(#)#*","captures":{"1":{"name":"punctuation.definition.comment.powershell"}},"end":"$\\\\n?","name":"comment.line.powershell","patterns":[{"include":"#commentEmbeddedDocs"},{"include":"#RequiresDirective"}]},"doubleQuotedString":{"applyEndPatternLast":true,"begin":"[\\"“”„]","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.powershell"}},"end":"[\\"“”„]","endCaptures":{"0":{"name":"punctuation.definition.string.end.powershell"}},"name":"string.quoted.double.powershell","patterns":[{"match":"(?i)\\\\b[-%+.0-9A-Z_]+@[-.0-9A-Z]+\\\\.[A-Z]{2,64}\\\\b"},{"include":"#variableNoProperty"},{"include":"#doubleQuotedStringEscapes"},{"match":"[\\"“”„]{2}","name":"constant.character.escape.powershell"},{"include":"#interpolation"},{"match":"`\\\\s*$","name":"keyword.other.powershell"}]},"doubleQuotedStringEscapes":{"patterns":[{"match":"`[\\"$\'0`abefnrtv‘-„]","name":"constant.character.escape.powershell"},{"include":"#unicodeEscape"}]},"function":{"begin":"^\\\\s*+(?i)(function|filter|configuration|workflow)\\\\s+(?:(global|local|script|private):)?([-._\\\\p{L}\\\\d]+)","beginCaptures":{"0":{"name":"meta.function.powershell"},"1":{"name":"storage.type.powershell"},"2":{"name":"storage.modifier.scope.powershell"},"3":{"name":"entity.name.function.powershell"}},"end":"(?=[({])","patterns":[{"include":"#commentLine"}]},"hashtable":{"begin":"(@)(\\\\{)","beginCaptures":{"1":{"name":"keyword.other.hashtable.begin.powershell"},"2":{"name":"punctuation.section.braces.begin.powershell"}},"end":"(})","endCaptures":{"1":{"name":"punctuation.section.braces.end.powershell"}},"name":"meta.hashtable.powershell","patterns":[{"captures":{"1":{"name":"punctuation.definition.string.begin.powershell"},"2":{"name":"variable.other.readwrite.powershell"},"3":{"name":"punctuation.definition.string.end.powershell"},"4":{"name":"keyword.operator.assignment.powershell"}},"match":"\\\\b([\\"\']?)(\\\\w+)([\\"\']?)\\\\s+{0,1}(=)\\\\s+{0,1}","name":"meta.hashtable.assignment.powershell"},{"include":"#scriptblock"},{"include":"$self"}]},"interpolation":{"begin":"(((\\\\$)))((\\\\())","beginCaptures":{"1":{"name":"keyword.other.substatement.powershell"},"2":{"name":"punctuation.definition.substatement.powershell"},"3":{"name":"punctuation.section.embedded.substatement.begin.powershell"},"4":{"name":"punctuation.section.group.begin.powershell"},"5":{"name":"punctuation.section.embedded.substatement.begin.powershell"}},"contentName":"interpolated.complex.source.powershell","end":"(\\\\))","endCaptures":{"0":{"name":"punctuation.section.group.end.powershell"},"1":{"name":"punctuation.section.embedded.substatement.end.powershell"}},"name":"meta.embedded.substatement.powershell","patterns":[{"include":"$self"}]},"numericConstant":{"patterns":[{"captures":{"1":{"name":"constant.numeric.hex.powershell"},"2":{"name":"keyword.other.powershell"}},"match":"(?<!\\\\w)([-+]?0[Xx][_\\\\h]+(?:[LUlu]|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[gkmpt]b)?)\\\\b"},{"captures":{"1":{"name":"constant.numeric.integer.powershell"},"2":{"name":"keyword.other.powershell"}},"match":"(?<!\\\\w)([-+]?[0-9_]+{0,1}\\\\.[0-9_]+(?:[Ee][0-9]+)?[DFMdfm]?)((?i:[gkmpt]b)?)\\\\b"},{"captures":{"1":{"name":"constant.numeric.octal.powershell"},"2":{"name":"keyword.other.powershell"}},"match":"(?<!\\\\w)([-+]?0[Bb][01_]+(?:[LUlu]|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[gkmpt]b)?)\\\\b"},{"captures":{"1":{"name":"constant.numeric.integer.powershell"},"2":{"name":"keyword.other.powershell"}},"match":"(?<!\\\\w)([-+]?[0-9_]+[Ee][0-9_]?+[DFMdfm]?)((?i:[gkmpt]b)?)\\\\b"},{"captures":{"1":{"name":"constant.numeric.integer.powershell"},"2":{"name":"keyword.other.powershell"}},"match":"(?<!\\\\w)([-+]?[0-9_]+\\\\.[Ee][0-9_]?+[DFMdfm]?)((?i:[gkmpt]b)?)\\\\b"},{"captures":{"1":{"name":"constant.numeric.integer.powershell"},"2":{"name":"keyword.other.powershell"}},"match":"(?<!\\\\w)([-+]?[0-9_]+\\\\.?[DFMdfm])((?i:[gkmpt]b)?)\\\\b"},{"captures":{"1":{"name":"constant.numeric.integer.powershell"},"2":{"name":"keyword.other.powershell"}},"match":"(?<!\\\\w)([-+]?[0-9_]+\\\\.?(?:[LUlu]|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[gkmpt]b)?)\\\\b"}]},"scriptblock":{"begin":"\\\\{","beginCaptures":{"0":{"name":"punctuation.section.braces.begin.powershell"}},"end":"}","endCaptures":{"0":{"name":"punctuation.section.braces.end.powershell"}},"name":"meta.scriptblock.powershell","patterns":[{"include":"$self"}]},"subexpression":{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.group.begin.powershell"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.group.end.powershell"}},"name":"meta.group.simple.subexpression.powershell","patterns":[{"include":"$self"}]},"type":{"begin":"\\\\[","beginCaptures":{"0":{"name":"punctuation.section.bracket.begin.powershell"}},"end":"]","endCaptures":{"0":{"name":"punctuation.section.bracket.end.powershell"}},"patterns":[{"match":"(?!\\\\d+|\\\\.)[.\\\\p{L}\\\\p{N}]+","name":"storage.type.powershell"},{"include":"$self"}]},"unicodeEscape":{"patterns":[{"match":"`u\\\\{(?:(?:10)?(\\\\h){1,4}|0?\\\\g<1>{1,5})}","name":"constant.character.escape.powershell"},{"match":"`u(?:\\\\{\\\\h{0,6}.)?","name":"invalid.character.escape.powershell"}]},"variable":{"patterns":[{"captures":{"0":{"name":"constant.language.powershell"},"1":{"name":"punctuation.definition.variable.powershell"}},"match":"(\\\\$)(?i:(False|Null|True))\\\\b"},{"captures":{"0":{"name":"variable.other.constant.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"3":{"name":"variable.other.member.powershell"}},"match":"(\\\\$)(?i:(Error|ExecutionContext|Host|Home|PID|PsHome|PsVersionTable|ShellID))((?:\\\\.[_\\\\p{L}\\\\d]+)*\\\\b)?\\\\b"},{"captures":{"0":{"name":"support.variable.automatic.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"3":{"name":"variable.other.member.powershell"}},"match":"(\\\\$)([$?^]|(?i:_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This)\\\\b)((?:\\\\.[_\\\\p{L}\\\\d]+)*\\\\b)?"},{"captures":{"0":{"name":"variable.language.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"3":{"name":"variable.other.member.powershell"}},"match":"(\\\\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|InformationPreference|LogCommandHealthEvent|LogCommandLifecycleEvent|LogEngineHealthEvent|LogEngineLifecycleEvent|LogProviderHealthEvent|LogProviderLifecycleEvent|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|PSCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoLoadingPreference|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|ProgressPreference|VerbosePreference|WarningPreference|WhatIfPreference))((?:\\\\.[_\\\\p{L}\\\\d]+)*\\\\b)?\\\\b"},{"captures":{"0":{"name":"variable.other.readwrite.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"2":{"name":"storage.modifier.scope.powershell"},"4":{"name":"variable.other.member.powershell"}},"match":"(?i:([$@])(global|local|private|script|using|workflow):([_\\\\p{L}\\\\d]+))((?:\\\\.[_\\\\p{L}\\\\d]+)*\\\\b)?"},{"captures":{"0":{"name":"variable.other.readwrite.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"2":{"name":"punctuation.section.braces.begin.powershell"},"3":{"name":"storage.modifier.scope.powershell"},"5":{"name":"punctuation.section.braces.end.powershell"},"6":{"name":"variable.other.member.powershell"}},"match":"(?i:(\\\\$)(\\\\{)(global|local|private|script|using|workflow):([^}]*[^`}])(}))((?:\\\\.[_\\\\p{L}\\\\d]+)*\\\\b)?"},{"captures":{"0":{"name":"variable.other.readwrite.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"2":{"name":"support.variable.drive.powershell"},"4":{"name":"variable.other.member.powershell"}},"match":"(?i:([$@])([_\\\\p{L}\\\\d]+:)?([_\\\\p{L}\\\\d]+))((?:\\\\.[_\\\\p{L}\\\\d]+)*\\\\b)?"},{"captures":{"0":{"name":"variable.other.readwrite.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"2":{"name":"punctuation.section.braces.begin.powershell"},"3":{"name":"support.variable.drive.powershell"},"5":{"name":"punctuation.section.braces.end.powershell"},"6":{"name":"variable.other.member.powershell"}},"match":"(?i:(\\\\$)(\\\\{)([_\\\\p{L}\\\\d]+:)?([^}]*[^`}])(}))((?:\\\\.[_\\\\p{L}\\\\d]+)*\\\\b)?"}]},"variableNoProperty":{"patterns":[{"captures":{"0":{"name":"constant.language.powershell"},"1":{"name":"punctuation.definition.variable.powershell"}},"match":"(\\\\$)(?i:(False|Null|True))\\\\b"},{"captures":{"0":{"name":"variable.other.constant.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"3":{"name":"variable.other.member.powershell"}},"match":"(\\\\$)(?i:(Error|ExecutionContext|Host|Home|PID|PsHome|PsVersionTable|ShellID))\\\\b"},{"captures":{"0":{"name":"support.variable.automatic.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"3":{"name":"variable.other.member.powershell"}},"match":"(\\\\$)([$?^]|(?i:_|Args|ConsoleFileName|Event|EventArgs|EventSubscriber|ForEach|Input|LastExitCode|Matches|MyInvocation|NestedPromptLevel|Profile|PSBoundParameters|PsCmdlet|PsCulture|PSDebugContext|PSItem|PSCommandPath|PSScriptRoot|PsUICulture|Pwd|Sender|SourceArgs|SourceEventArgs|StackTrace|Switch|This)\\\\b)"},{"captures":{"0":{"name":"variable.language.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"3":{"name":"variable.other.member.powershell"}},"match":"(\\\\$)(?i:(ConfirmPreference|DebugPreference|ErrorActionPreference|ErrorView|FormatEnumerationLimit|InformationPreference|LogCommandHealthEvent|LogCommandLifecycleEvent|LogEngineHealthEvent|LogEngineLifecycleEvent|LogProviderHealthEvent|LogProviderLifecycleEvent|MaximumAliasCount|MaximumDriveCount|MaximumErrorCount|MaximumFunctionCount|MaximumHistoryCount|MaximumVariableCount|OFS|OutputEncoding|PSCulture|PSDebugContext|PSDefaultParameterValues|PSEmailServer|PSItem|PSModuleAutoLoadingPreference|PSModuleAutoloadingPreference|PSSenderInfo|PSSessionApplicationName|PSSessionConfigurationName|PSSessionOption|ProgressPreference|VerbosePreference|WarningPreference|WhatIfPreference))\\\\b"},{"captures":{"0":{"name":"variable.other.readwrite.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"2":{"name":"storage.modifier.scope.powershell"},"4":{"name":"variable.other.member.powershell"}},"match":"(?i:(\\\\$)(global|local|private|script|using|workflow):([_\\\\p{L}\\\\d]+))"},{"captures":{"0":{"name":"variable.other.readwrite.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"2":{"name":"storage.modifier.scope.powershell"},"4":{"name":"keyword.other.powershell"},"5":{"name":"variable.other.member.powershell"}},"match":"(?i:(\\\\$)(\\\\{)(global|local|private|script|using|workflow):([^}]*[^`}])(}))"},{"captures":{"0":{"name":"variable.other.readwrite.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"2":{"name":"support.variable.drive.powershell"},"4":{"name":"variable.other.member.powershell"}},"match":"(?i:(\\\\$)([_\\\\p{L}\\\\d]+:)?([_\\\\p{L}\\\\d]+))"},{"captures":{"0":{"name":"variable.other.readwrite.powershell"},"1":{"name":"punctuation.definition.variable.powershell"},"2":{"name":"punctuation.section.braces.begin"},"3":{"name":"support.variable.drive.powershell"},"5":{"name":"punctuation.section.braces.end"}},"match":"(?i:(\\\\$)(\\\\{)([_\\\\p{L}\\\\d]+:)?([^}]*[^`}])(}))"}]}},"scopeName":"source.powershell","aliases":["ps","ps1","pwsh"]}'))];export{e as default};
@@ -0,0 +1 @@
1
+ export{default}from"./ini-B5eOa1yu.js";
@@ -0,0 +1 @@
1
+ var e=[Object.freeze(JSON.parse(`{"displayName":"Protocol Buffer 3","fileTypes":["proto"],"name":"proto","patterns":[{"include":"#comments"},{"include":"#syntax"},{"include":"#package"},{"include":"#import"},{"include":"#optionStmt"},{"include":"#message"},{"include":"#enum"},{"include":"#service"}],"repository":{"comments":{"patterns":[{"begin":"/\\\\*","end":"\\\\*/","name":"comment.block.proto"},{"begin":"//","end":"$\\\\n?","name":"comment.line.double-slash.proto"}]},"constants":{"match":"\\\\b(true|false|max|[A-Z_]+)\\\\b","name":"constant.language.proto"},"enum":{"begin":"(enum)(\\\\s+)([A-Za-z][0-9A-Z_a-z]*)(\\\\s*)(\\\\{)?","beginCaptures":{"1":{"name":"keyword.other.proto"},"3":{"name":"entity.name.class.proto"}},"end":"}","patterns":[{"include":"#reserved"},{"include":"#optionStmt"},{"include":"#comments"},{"begin":"([A-Za-z][0-9A-Z_a-z]*)\\\\s*(=)\\\\s*(-?0[Xx]\\\\h+|-?[0-9]+)","beginCaptures":{"1":{"name":"variable.other.proto"},"2":{"name":"keyword.operator.assignment.proto"},"3":{"name":"constant.numeric.proto"}},"end":"(;)","endCaptures":{"1":{"name":"punctuation.terminator.proto"}},"patterns":[{"include":"#fieldOptions"}]}]},"field":{"begin":"\\\\s*(optional|repeated|required)?\\\\s*(\\\\.?[.\\\\w]+)\\\\s+(\\\\w+)\\\\s*(=)\\\\s*(0[Xx]\\\\h+|[0-9]+)","beginCaptures":{"1":{"name":"storage.modifier.proto"},"2":{"name":"storage.type.proto"},"3":{"name":"variable.other.proto"},"4":{"name":"keyword.operator.assignment.proto"},"5":{"name":"constant.numeric.proto"}},"end":"(;)","endCaptures":{"1":{"name":"punctuation.terminator.proto"}},"patterns":[{"include":"#fieldOptions"}]},"fieldOptions":{"begin":"\\\\[","end":"]","patterns":[{"include":"#constants"},{"include":"#number"},{"include":"#string"},{"include":"#subMsgOption"},{"include":"#optionName"}]},"ident":{"match":"\\\\.?[A-Za-z][.0-9A-Z_a-z]*","name":"entity.name.class.proto"},"import":{"captures":{"1":{"name":"keyword.other.proto"},"2":{"name":"keyword.other.proto"},"3":{"name":"string.quoted.double.proto.import"},"4":{"name":"punctuation.terminator.proto"}},"match":"\\\\s*(import)\\\\s+(weak|public)?\\\\s*(\\"[^\\"]+\\")\\\\s*(;)"},"kv":{"begin":"(\\\\w+)\\\\s*(:)","beginCaptures":{"1":{"name":"keyword.other.proto"},"2":{"name":"punctuation.separator.key-value.proto"}},"end":"(;)|,|(?=[/A-Z_a-z}])","endCaptures":{"1":{"name":"punctuation.terminator.proto"}},"patterns":[{"include":"#constants"},{"include":"#number"},{"include":"#string"},{"include":"#subMsgOption"}]},"mapfield":{"begin":"\\\\s*(map)\\\\s*(<)\\\\s*(\\\\.?[.\\\\w]+)\\\\s*,\\\\s*(\\\\.?[.\\\\w]+)\\\\s*(>)\\\\s+(\\\\w+)\\\\s*(=)\\\\s*(\\\\d+)","beginCaptures":{"1":{"name":"storage.type.proto"},"2":{"name":"punctuation.definition.typeparameters.begin.proto"},"3":{"name":"storage.type.proto"},"4":{"name":"storage.type.proto"},"5":{"name":"punctuation.definition.typeparameters.end.proto"},"6":{"name":"variable.other.proto"},"7":{"name":"keyword.operator.assignment.proto"},"8":{"name":"constant.numeric.proto"}},"end":"(;)","endCaptures":{"1":{"name":"punctuation.terminator.proto"}},"patterns":[{"include":"#fieldOptions"}]},"message":{"begin":"(message|extend)(\\\\s+)([A-Z_a-z][.0-9A-Z_a-z]*)(\\\\s*)(\\\\{)?","beginCaptures":{"1":{"name":"keyword.other.proto"},"3":{"name":"entity.name.class.message.proto"}},"end":"}","patterns":[{"include":"#reserved"},{"include":"$self"},{"include":"#enum"},{"include":"#optionStmt"},{"include":"#comments"},{"include":"#oneof"},{"include":"#field"},{"include":"#mapfield"}]},"method":{"begin":"(rpc)\\\\s+([A-Za-z][0-9A-Z_a-z]*)","beginCaptures":{"1":{"name":"keyword.other.proto"},"2":{"name":"entity.name.function"}},"end":"}|(;)","endCaptures":{"1":{"name":"punctuation.terminator.proto"}},"patterns":[{"include":"#comments"},{"include":"#optionStmt"},{"include":"#rpcKeywords"},{"include":"#ident"}]},"number":{"match":"\\\\b((0([Xx])\\\\h*)|(([0-9]+\\\\.?[0-9]*)|(\\\\.[0-9]+))(([Ee])([-+])?[0-9]+)?)\\\\b","name":"constant.numeric.proto"},"oneof":{"begin":"(oneof)\\\\s+([A-Za-z][0-9A-Z_a-z]*)\\\\s*\\\\{?","beginCaptures":{"1":{"name":"keyword.other.proto"},"2":{"name":"variable.other.proto"}},"end":"}","patterns":[{"include":"#optionStmt"},{"include":"#comments"},{"include":"#field"}]},"optionName":{"captures":{"1":{"name":"support.other.proto"},"2":{"name":"support.other.proto"},"3":{"name":"support.other.proto"}},"match":"(\\\\w+|\\\\(\\\\w+(\\\\.\\\\w+)*\\\\))(\\\\.\\\\w+)*"},"optionStmt":{"begin":"(option)\\\\s+(\\\\w+|\\\\(\\\\w+(\\\\.\\\\w+)*\\\\))(\\\\.\\\\w+)*\\\\s*(=)","beginCaptures":{"1":{"name":"keyword.other.proto"},"2":{"name":"support.other.proto"},"3":{"name":"support.other.proto"},"4":{"name":"support.other.proto"},"5":{"name":"keyword.operator.assignment.proto"}},"end":"(;)","endCaptures":{"1":{"name":"punctuation.terminator.proto"}},"patterns":[{"include":"#constants"},{"include":"#number"},{"include":"#string"},{"include":"#subMsgOption"}]},"package":{"captures":{"1":{"name":"keyword.other.proto"},"2":{"name":"string.unquoted.proto.package"},"3":{"name":"punctuation.terminator.proto"}},"match":"\\\\s*(package)\\\\s+([.\\\\w]+)\\\\s*(;)"},"reserved":{"begin":"(reserved)\\\\s+","beginCaptures":{"1":{"name":"keyword.other.proto"}},"end":"(;)","endCaptures":{"1":{"name":"punctuation.terminator.proto"}},"patterns":[{"captures":{"1":{"name":"constant.numeric.proto"},"3":{"name":"keyword.other.proto"},"4":{"name":"constant.numeric.proto"}},"match":"(\\\\d+)(\\\\s+(to)\\\\s+(\\\\d+))?"},{"include":"#string"}]},"rpcKeywords":{"match":"\\\\b(stream|returns)\\\\b","name":"keyword.other.proto"},"service":{"begin":"(service)\\\\s+([A-Za-z][.0-9A-Z_a-z]*)\\\\s*\\\\{?","beginCaptures":{"1":{"name":"keyword.other.proto"},"2":{"name":"entity.name.class.message.proto"}},"end":"}","patterns":[{"include":"#comments"},{"include":"#optionStmt"},{"include":"#method"}]},"storagetypes":{"match":"\\\\b(double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\\\\b","name":"storage.type.proto"},"string":{"match":"([\\"'])(?:\\\\\\\\.|[^\\\\\\\\])*?\\\\1","name":"string.quoted.double.proto"},"subMsgOption":{"begin":"\\\\{","end":"}","patterns":[{"include":"#kv"},{"include":"#comments"}]},"syntax":{"captures":{"1":{"name":"keyword.other.proto"},"2":{"name":"keyword.operator.assignment.proto"},"3":{"name":"string.quoted.double.proto.syntax"},"4":{"name":"punctuation.terminator.proto"}},"match":"\\\\s*(syntax)\\\\s*(=)\\\\s*(\\"proto[23]\\")\\\\s*(;)"}},"scopeName":"source.proto","aliases":["protobuf"]}`))];export{e as default};
@@ -0,0 +1,35 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-DfsS1UI1.js","assets/rolldown-runtime-BLXQ4ufn.js","assets/lib-C2gVWm_O.js","assets/lib-rf_jxHx0.js","assets/highlights-BJb1-tzP.js","assets/stream-tokenizer-B5Ok5N3S.js","assets/lineChanges-Dw4ZXwVU.js","assets/shiki-DueA5xDi.js","assets/utils-Tkdy0sOA.js","assets/index-B297yCgq.js","assets/index-CjZUV4-4.css","assets/grammars-DmFYBwmS.js"])))=>i.map(i=>d[i]);
2
+ import{r as e,t}from"./rolldown-runtime-BLXQ4ufn.js";import{$ as n,An as r,At as i,Bn as a,Bt as o,Cn as s,Dn as c,En as l,F as u,Ft as d,Gt as f,Ht as p,It as m,Jt as h,Kt as g,Ln as _,Lt as v,M as y,Mn as b,Nn as x,O as S,On as C,Ot as w,P as T,Pt as ee,Q as E,Rn as te,Rt as D,Sn as ne,T as re,Tn as ie,V as ae,Vt as oe,W as se,Wt as ce,Xt as le,Yt as ue,Z as de,Zt as fe,_n as pe,_t as me,at as he,ct as ge,et as _e,fn as ve,ft as O,gt as ye,hn as be,ht as xe,jn as Se,kn as Ce,kt as k,lt as we,m as Te,mt as Ee,nt as De,p as A,pt as j,qt as Oe,tt as ke,un as M,vn as Ae,w as je,wn as Me,wt as Ne,xn as N,yt as Pe,zn as Fe,zt as Ie}from"./index-B297yCgq.js";import{n as Le,t as Re}from"./inbox-jP8QPtzZ.js";var ze=class extends Me{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,u=n.fetchMeta?.fetchMore?.direction,d=o&&u===`forward`,f=i&&u===`forward`,p=o&&u===`backward`,m=i&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:l(t,n.data),hasPreviousPage:c(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:s&&!d&&!p,isRefetching:a&&!f&&!m}}},Be=class extends b{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),r(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&C(t.mutationKey)!==C(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??s();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ie.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},P=e(a(),1);function Ve(e,t){let n=x(t),[r]=P.useState(()=>new Be(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(ie.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Ce)},[r]);if(i.error&&Se(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function He(e,t){return ne(e,ze,t)}async function Ue(e,{objectId:t,...n}){let r=await e.binary({path:[n.project,`_apis`,`git`,`repositories`,n.repositoryId,`blobs`,t],query:{$format:`octetstream`},accept:`application/octet-stream`,...n.signal===void 0?{}:{signal:n.signal}});return{bytes:r.data,contentType:r.headers.get(`content-type`)}}async function We(e,{path:t,commitId:n,...r}){let i=await e.binary({path:[r.project,`_apis`,`git`,`repositories`,r.repositoryId,`items`],query:{path:t,"versionDescriptor.version":n,"versionDescriptor.versionType":`commit`,$format:`octetStream`,download:!1},accept:`application/octet-stream`,...r.signal===void 0?{}:{signal:r.signal}});return{bytes:i.data,contentType:i.headers.get(`content-type`)}}var Ge=`diffs-container`,Ke=/(?=^diff --git)/gm,qe=/(?<=\n)/,Je=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Ye=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Xe=`header-prefix`,Ze=`header-filename-suffix`,Qe=`header-metadata`,$e=`header-custom`,et={dark:`pierre-dark`,light:`pierre-light`},tt=`data-theme-css`,nt=`data-unsafe-css`,rt=`data-diffs-scrollbar-measure`,it=`data-diffs-code-view-header`,at=`data-diffs-code-view-footer`,ot=`--diffs-scrollbar-gutter-measured`,st=1e5,ct={unmodifiedLines:`{count, plural, one {# unmodified line} other {# unmodified lines}}`,unknownUnmodifiedLines:`More unchanged context may be available`,expandAll:`Expand all`,expandLine:`Show full line`,noNewlineAtEndOfFile:`No newline at end of file`,acceptCurrentChange:`Accept current change`,acceptIncomingChange:`Accept incoming change`,acceptBoth:`Accept both`,searchPlaceholder:`Search`,replacePlaceholder:`Replace`,noSearchResults:`0/0`,searching:`Searching…`,searchResultCount:`{count, plural, one {# result} other {# results}}`,searchResultPosition:`{index}/{count}`,matchCase:`Match Case`,wholeWord:`Whole Word`,regularExpression:`Regexp`,replaceMatch:`Replace`,replaceAllMatches:`Replace All`,previousMatch:`Previous`,nextMatch:`Next`,closeSearch:`Close`,toggleReplace:`Toggle Replace`},lt={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},ut={...lt,hunkLineCount:1},dt={paddingTop:8,paddingBottom:8,gap:8},ft={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},pt=Object.freeze({fromStart:0,fromEnd:0}),mt={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},ht=Object.freeze([]);function gt(e,t){return e-(t===0?0:1)}function _t(e,t){return gt(e,t)+t}var F,vt=0,yt=class extends Error{constructor(){super(`Highlighter is disposed`),this.name=`HighlighterDisposedError`}};function bt(){return F}function I(e){return e??F??`shiki-js`}function xt(e){if(F!=null&&F!==e)throw Error(`Cannot load the "${e}" highlighter while "${F}" is in use. Only one highlighter type can be active at a time; dispose every "${F}" instance (disposeHighlighter() disposes the shared one) before switching.`)}function St(e){xt(e),F=e,vt++}function Ct(){vt--,vt===0&&(F=void 0)}var wt=new Map,Tt=new Map,Et=new Map,Dt=new Map,Ot=new Map,kt=new Set;function L(e=et){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function At(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}function jt(e){let t;return()=>t??=e().then(e=>(t=e,e),e=>{throw t=void 0,e})}function Mt(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var Nt=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},Pt=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},Ft=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function It(e={}){let t=new Map,n=new Map,r=new Map,i=0;function a(e,n){if(t.has(e))throw new Nt(e);t.set(e,n)}function o(e,n){return!t.has(e)&&(t.set(e,n),!0)}function s(e){return t.has(e)}function c(a){let o=n.get(a);if(o!==void 0)return Promise.resolve(o);let s=r.get(a);if(s!==void 0)return s;let c=t.get(a);if(c===void 0&&e.fallbackLoader===void 0)return Promise.reject(new Pt(a));let l=i,u=Promise.resolve().then(()=>c===void 0?e.fallbackLoader?.(a):c()).then(async t=>{if(t===void 0)throw new Pt(a);let o=Mt(t),s=e.normalizeTheme===void 0?o:await e.normalizeTheme(o,a);return l===i&&n.set(a,s),r.get(a)===u&&r.delete(a),s}).catch(e=>{throw r.get(a)===u&&r.delete(a),e});return r.set(a,u),u}function l(e){return Promise.all(e.map(e=>c(e)))}function u(e,t){n.set(e,t)}function d(e){for(let[t,n]of e)u(t,n)}function f(e){return n.get(e)}function p(e){let t=[];for(let r of e){let e=n.get(r);if(e===void 0)throw new Ft(r);t.push(e)}return t}function m(e){return n.has(e)}function h(e){for(let t of e)if(!n.has(t))return!1;return!0}function g(e){let t=n.get(e);return t===void 0?c(e):t}function _(){i++,n.clear(),r.clear()}return{clearResolvedThemes:_,getResolvedOrResolveTheme:g,getResolvedTheme:f,getResolvedThemes:p,hasRegisteredTheme:s,hasResolvedTheme:m,hasResolvedThemes:h,registerTheme:a,registerThemeIfAbsent:o,resolveTheme:c,resolveThemes:l,seedResolvedTheme:u,seedResolvedThemes:d}}var Lt=new Map,Rt=new Map,zt=jt(()=>A(()=>import(`./loader-BljfpPoZ.js`),[])),Bt=jt(()=>A(()=>import(`./themes-SQq_asFq.js`),[])),Vt=jt(()=>A(()=>import(`./core-DfsS1UI1.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3]))),Ht=[[`editor.lineHighlightBackground`,`editor.active_line.background`],[`editor.selectionBackground`,`element.selected`],[`editor.findMatchHighlightBackground`,`search.match_background`],[`editorBracketMatch.background`,`editor.document_highlight.bracket_background`],[`editorError.foreground`,`error`],[`editorWarning.foreground`,`warning`],[`editorInfo.foreground`,`info`],[`editorHint.foreground`,`hint`],[`gitDecoration.addedResourceForeground`,`created`,`terminal.ansi.green`],[`gitDecoration.deletedResourceForeground`,`deleted`,`terminal.ansi.red`],[`gitDecoration.modifiedResourceForeground`,`modified`,`terminal.ansi.blue`]];function Ut(e,t){let n=`themes`in t?t.themes[0]:t;if(n==null)throw Error(`Theme "${e}" is an empty Zed theme family.`);let r={...n,name:e},i={};for(let[e,t]of Object.entries(r.style))typeof t==`string`&&(i[e]=t);let a=r.style.players?.[0];a?.cursor!=null&&(i[`editorCursor.foreground`]??=a.cursor),a?.selection!=null&&(i[`editor.selectionBackground`]??=a.selection);for(let[e,...t]of Ht){if(i[e]!=null)continue;let n=t.find(e=>i[e]!=null);n!=null&&(i[e]=i[n])}if(r.cssVariables===!0)i[`editor.foreground`]=`var(--hls-foreground)`,i[`editor.background`]=`var(--hls-background)`;else if(typeof r.cssVariables==`object`){i[`editor.foreground`]??=i.text??i.foreground??`foreground`,i[`editor.background`]??=i.background??`background`;let{prefix:e=`--hls-`,defaults:t}=r.cssVariables;for(let[n,r]of Object.entries(i)){let a=t?.[r];i[n]=`var(${e}${r}${a?`, ${a}`:``})`}}let o=r.appearance===`light`?`light`:`dark`;return{name:e,type:o,colors:i,zed:r,fg:i[`editor.foreground`]??i.text??i.foreground??(o===`light`?`#333333`:`#bbbbbb`),bg:i[`editor.background`]??i.background??(o===`light`?`#ffffff`:`#1e1e1e`)}}function Wt(e){let t=Rt.get(e);return t??(t=It({fallbackLoader:async t=>{if(typeof __DIFFS_WORKER__<`u`?__DIFFS_WORKER__:At())throw Error(`Theme "${t}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedThemes parameter.`);let n=Lt.get(t);if(e===`highlights`){let e=n?.zed??n?.diffs;if(e!=null){let n=await e(),r=`default`in n?n.default:n;if(`zed`in r&&r.zed!=null)return r;if(`style`in r||`themes`in r)return Ut(t,r);throw Error(`Theme "${t}" is a TextMate theme; register a Zed theme with registerCustomTheme(name, loader, 'zed') for Highlights.`)}let r=zt(),{themes:i}=r instanceof Promise?await r:r,a=i[t];if(a!=null)return Ut(t,(await a()).default);if(n?.textmate!=null)throw Error(`Theme "${t}" is only registered for TextMate; use registerCustomTheme(name, loader, 'zed') for Highlights.`)}else{let e=n?.textmate??n?.diffs,r;if(e!=null){let t=await e();r=`default`in t?t.default:t}else{let e=Bt(),{themes:i}=e instanceof Promise?await e:e,a=i.getTheme(t);if(a==null&&n?.zed!=null)throw Error(`Theme "${t}" is only registered for Zed; use registerCustomTheme(name, loader, 'textmate') for Shiki.`);if(a==null)throw Error(`No valid theme loader registered for "${t}"`);let o=await a.load();r=`default`in o?o.default:o}if(`style`in r||`themes`in r)throw Error(`Theme "${t}" is a Zed theme; use preferredHighlighter: 'highlights' or register a TextMate theme for Shiki.`);let i=Vt(),{normalizeTheme:a,createCssVariablesTheme:o}=i instanceof Promise?await i:i;if(`cssVariables`in r&&r.cssVariables!=null)return{...r,textmate:a(o(r.cssVariables))};if(`textmate`in r&&r.textmate!=null)return{...r,textmate:a(r.textmate)};let s=a(r);return{name:s.name,type:s.type,fg:s.fg,bg:s.bg,colors:s.colors,textmate:s}}throw Error(`No valid theme loader registered for "${t}"`)},normalizeTheme:(e,t)=>{if(e.name!==t)throw Error(`resolvedTheme: themeName: ${t} does not match theme.name: ${e.name}`);return e}}),Rt.set(e,t)),t}function Gt(e,t=I()){return typeof t!=`string`&&t.isDisposed?!1:(typeof t==`string`?Wt(t):t.themeResolver).hasResolvedThemes(L(e))}var R;async function Kt(e){let t=I(e);St(t);try{if(t===`highlights`){let{HighlightsHighlighter:e}=await A(async()=>{let{HighlightsHighlighter:e}=await import(`./highlights-BJb1-tzP.js`);return{HighlightsHighlighter:e}},__vite__mapDeps([4,5,6,2,3,1]));return new e}let{ShikiHighlighter:e}=await A(async()=>{let{ShikiHighlighter:e}=await import(`./shiki-DueA5xDi.js`);return{ShikiHighlighter:e}},__vite__mapDeps([7,5,6,2,3,1,8,0,9,10]));return await e.create(t)}finally{Ct()}}async function qt({themes:e,langs:t,preferredHighlighter:n}){Jt();let r=R??=Kt(bt()??n),i;try{i=await r}catch(e){throw R===r&&(R=void 0),e}if(R===r&&(R=i),await Promise.all([i.themeResolver.resolveThemes(e),i.loadLanguages(t)]),i.isDisposed)throw new yt;return i}function Jt(){R!=null&&!(`then`in R)&&R.isDisposed&&(R=void 0)}function z({theme:e,lang:t,langs:n}={}){Jt();let r=R;if(!(r==null||`then`in r||e!=null&&!Gt(e,r)||(t!=null||n!=null)&&!r.hasLoadedLanguages([...t==null?[]:[t],...n??[]])))return r}async function Yt(e){await qt(e)}function Xt(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function Zt(e,t){let n=Array.isArray(e)?e:[e];return t==null?n.every(e=>e===`text`||e===`ansi`||kt.has(e)):t.hasLoadedLanguages(n)}function Qt(e,t){return Xt(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}var B=new Map,$t=0,V={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,cppm:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,odin:`odin`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,BUCK:`python`,BUILD:`python`,PACKAGE:`python`,WORKSPACE:`python`,Tiltfile:`python`,bazel:`python`,bxl:`python`,bzl:`python`,bzlmod:`python`,star:`python`,sky:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function H(e){let t=en(e);if(t!=null)return t;let n=e.split(/[/\\]/).pop()??e;return n===e?`text`:en(n)??`text`}function en(e){if(B.has(e))return B.get(e)??`text`;if(Object.hasOwn(V,e))return V[e]??null;let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(B.has(t[1]))return B.get(t[1])??`text`;if(Object.hasOwn(V,t[1]))return V[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return B.has(n)?B.get(n)??`text`:Object.hasOwn(V,n)?V[n]??`text`:null}function tn(){return $t}function nn(){return Object.fromEntries(B)}function rn(e){return(e.lang??H(e.name))===`text`}function U(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var an=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,on=/^0(?:\.0+)?%?$/;function sn(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function cn(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function ln(e){if(e==null)return null;let t=cn(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function un(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||an.test(t))return!0;let n=sn(t);return n!=null&&on.test(n)}function dn(e,t,n){if(t==null||n==null)return!1;let r=ln(e),i=ln(t),a=ln(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var fn=new WeakMap;function pn(e){let t=fn.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;W(r,`editor.background`,i),W(r,`editor.foreground`,a),W(r,`sideBar.background`,o),W(r,`sideBar.foreground`,s),W(r,`input.background`,n[`input.background`]??o),W(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),W(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),W(r,`gitDecoration.addedResourceForeground`,mn(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),W(r,`gitDecoration.modifiedResourceForeground`,mn(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),W(r,`gitDecoration.deletedResourceForeground`,mn(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(un(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(un(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(hn(l,o)||dn(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return fn.set(e,u),u}function W(e,t,n){n!=null&&n!==``&&(e[t]=n)}function mn(...e){for(let t of e)if(t!=null&&t!==``)return t}function hn(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function gn({theme:e=et,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=_n(i,t);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${U(`global`)}fg:${a.fg};`,r+=`${U(`global`)}bg:${a.bg};`,r+=vn(i,n),r+=yn(i)}else{let n=t.getTheme(e.dark),i=_n(n,t);r+=`${U(`global`)}dark:${i.fg};`,r+=`${U(`global`)}dark-bg:${i.bg};`,r+=vn(n,`dark`),r+=yn(n,`dark`),n=t.getTheme(e.light),i=_n(n,t),r+=`${U(`global`)}light:${i.fg};`,r+=`${U(`global`)}light-bg:${i.bg};`,r+=vn(n,`light`),r+=yn(n,`light`)}return r}function _n(e,t){if(t.name===`highlights`&&e.zed?.cssVariables===!0){let e=U(`token`);return{fg:`var(${e}foreground)`,bg:`var(${e}background)`}}return pn(e)}function vn(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${U(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${U(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${U(`global`)}${t}modified-color:${a};`),n}function yn(e,t){t=t==null?``:`${t}-`;let n=U(`global`),r=e.colors,i=``,a=r?.[`editor.findMatchHighlightBackground`],o=r?.[`editor.findMatchHighlightForeground`];a!=null&&o!=null&&(i+=`${n}${t}bg-search-match-theme:${a};`,i+=`${n}${t}fg-search-match-theme:${o};`);let s=r?.[`editor.findMatchBackground`],c=r?.[`editor.findMatchForeground`];return s!=null&&c!=null&&(i+=`${n}${t}bg-search-match-current-theme:${s};`,i+=`${n}${t}fg-search-match-current-theme:${c};`),i}var bn=10,xn=13,Sn=4,Cn=40;function wn(e){let t=[0],n=e.indexOf(`\r`),r=e.indexOf(`
3
+ `),i=0,a=0;for(;n!==-1||r!==-1;){let o;if(n!==-1&&(r===-1||n<r)?r===n+1?(o=r+1,n=e.indexOf(`\r`,o),r=e.indexOf(`
4
+ `,o)):(o=n+1,n=e.indexOf(`\r`,o)):(o=r+1,r=e.indexOf(`
5
+ `,o)),t.push(o),++a===Sn){if(o-i<=Cn){for(let n=o;n<e.length;n++){let r=e.charCodeAt(n);(r===bn||r===xn)&&(r===xn&&n+1<e.length&&e.charCodeAt(n+1)===bn&&n++,t.push(n+1))}return t}i=o,a=0}}return t}function Tn(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);(r===bn||r===xn)&&(r===xn&&n+1<e.length&&e.charCodeAt(n+1)===bn&&n++,t++)}return t}function En(e){let t=wn(e),n=t.length,r=Array(n);for(let i=0;i<n;i++){let a=i+1<n?t[i+1]:e.length;r[i]=e.slice(t[i],a)}return r}function Dn(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}function On(e,t){for(let n of t)e.push(n)}function kn(e,t,n){return{lang:e,...typeof t==`string`?{theme:t}:{themes:t},defaultColor:!1,cssVariablePrefix:U(`token`),tokenizeMaxLineLength:n,tokenizeTimeLimit:0}}var An=class{parent;nextEdge;#e;#t;#n=[];#r=0;#i=[];#a=[];constructor(e,t,n,r){this.parent=this.#e=e,this.#t=r,t.length>1&&t.sort((e,t)=>e.start.line===t.start.line?e.start.character===t.start.character?e.end.line===t.end.line?t.end.character-e.end.character:t.end.line-e.end.line:e.start.character-t.start.character:e.start.line-t.start.line);let i=this.#n;for(let e=0;e<t.length;e++){let a=t[e],o={decoration:a,order:e,from:a.start.line===n?a.start.character:0,to:a.end.line===n?a.end.character:r};i.push({position:Math.max(0,Math.min(o.from,r)),range:o,start:!0},{position:Math.max(0,Math.min(o.to,r)),range:o,start:!1})}i.sort((e,t)=>e.position-t.position),this.nextEdge=i[0]?.position??r}moveTo(e){this.nextEdge===e&&this.#r<this.#n.length&&this.#o(e)}#o(e){let t=this.#n,n=this.#t,r=this.#r,i=r;for(;t[i]?.position===e;)i++;this.#r=i,this.nextEdge=t[i]?.position??this.#t;let a=!1;for(let a=r;a<i;a++){let{range:r,start:i}=t[a];!i&&r.from!==r.to&&e<n&&this.#s(r,!1)}for(let o=r;o<i;o++){let{range:r,start:i}=t[o];i&&r.from<=e&&r.to>=e&&(r.to>e||r.from===e||e===n)&&(this.#s(r,!0),r.from===r.to&&(a=!0))}if(a){this.#c();for(let e=r;e<i;e++){let{range:n,start:r}=t[e];r&&n.from===n.to&&this.#s(n,!1)}}e<n&&(this.parent=this.#c())}#s(e,t){let n=this.#i,r=0,i=n.length;for(;r<i;){let t=r+i>>>1;n[t].order<e.order?r=t+1:i=t}t?n.splice(r,0,e):n[r]===e&&n.splice(r,1)}#c(){let e=this.#a,t=this.#e,n=0;for(let r of this.#i){if(e[n]?.range!==r){e.length=n;let i={type:`element`,tagName:`span`,properties:{...r.decoration.properties},children:[]};t.children.push(i),e.push({range:r,node:i})}t=e[n++].node}return e.length=n,t}};function G(e){return{type:`text`,value:e}}function K({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function jn({name:e,width:t=16,height:n=16,properties:r}){return K({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[K({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function Mn(e){return K({tagName:`div`,properties:{"data-gutter":``},children:e})}function Nn(e,t,n,r={}){return K({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[K({tagName:`span`,properties:{"data-line-number-content":``},children:[G(`${t}`)]})]})}function Pn(e,t,n){return K({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Fn(e){return K({tagName:`div`,children:e.map(([e,t,n])=>e===0&&t===``?n===``?K({tagName:`br`}):G(n):K({tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[G(n)]}))})}function In(e){return K({tagName:`div`,children:e===``?[K({tagName:`br`})]:[K({tagName:`span`,properties:{"data-char":0},children:[G(e)]})]})}function Ln(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(G(`
6
+ `)),e}function Rn(e,t,n,{retain:r=!0}={}){let i=!1,a;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){if(i)return a;let o=n();return r?(a=o,i=!0,Object.getOwnPropertyDescriptor(e,t)?.configurable===!0&&Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:a}),a):o},set(n){if(Object.getOwnPropertyDescriptor(e,t)?.configurable===!0)Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n});else if(Object.isFrozen(e))throw TypeError(`Cannot assign to read only array index '${t}'`);else a=n,i=!0}})}var zn=new WeakMap;function Bn(e,t=!1){let{htmlStyle:n}=e;if(n!=null){let e=t?zn.get(n):void 0;if(e==null){e=``;for(let t in n)e+=`${e===``?``:`;`}${t}:${n[t]}`;t&&zn.set(n,e)}return e}let r=e.color==null?``:`color:${e.color}`;if(e.bgColor!=null&&(r+=`;background-color:${e.bgColor}`),e.fontStyle!=null){e.fontStyle&1&&(r+=`;font-style:italic`),e.fontStyle&2&&(r+=`;font-weight:bold`);let t=!!(e.fontStyle&4),n=!!(e.fontStyle&8);(t||n)&&(r+=`;text-decoration:${t?`underline`:``}${t&&n?` `:``}${n?`line-through`:``}`)}return r.replace(/^;/,``)}var Vn=Symbol(`no-token`),Hn=Symbol(`multiple-tokens`);function Un(e){let t=Wn(e);if(t!=null)return t;let n=Vn,r=[],i=[],a,o=()=>{if(i.length===0||a==null)i=[],a=void 0;else if(i.length===1){let e=i[0];if(e?.type===`element`){Kn(e,a);for(let t of e.children)Gn(t)}else Gn(e);r.push(e),i=[],a=void 0}else{for(let e of i)Gn(e);r.push(K({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0}},s=e=>{e!==Vn&&(e===Hn?n=Hn:n===Vn?n=e:n!==e&&(n=Hn))};for(let t of e.children){let e=t.type===`element`?Un(t):Vn;s(e),typeof e==`number`?(a!=null&&a!==e&&o(),a??=e,i.push(t)):(o(),r.push(t))}return o(),e.children=r,n}function Wn(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function Gn(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Gn(t)}}function Kn(e,t){e.properties[`data-char`]=t}function qn(e,{state:t,lazyLineAST:n=!1,cacheHtmlStyles:r=!1,useTokenTransformer:i=!1,mergeWhitespaces:a=`always`,decorations:o=[],lineOffsets:s=[]}){let c;for(let t of o){let n=c??=new Map,r={...t,start:Zn(t.start,s),end:Zn(t.end,s)},i=Math.min(r.end.line,e.length-1);for(let e=r.start.line;e<=i;e++){let t=n.get(e);t??n.set(e,t=[]),t.push(r)}}let l=(e,n)=>{let o;if(i||a!==`never`){let t=``,n=0;for(let r=0;r<e.length;r++){let a=e[r];if(i){let t=a.content.trim();if(t!==``&&t!==a.content){o??=e.slice(0,r);let n=a.content.indexOf(t);n>0&&o.push({content:a.content.slice(0,n),offset:a.offset}),o.push({...a,content:t,offset:a.offset+n});let i=n+t.length;i<a.content.length&&o.push({content:a.content.slice(i),offset:a.offset+i});continue}}else{let i=!!((a.fontStyle??0)&12);if(!i&&/^\s+$/.test(a.content)&&r<e.length-1){o??=e.slice(0,r),t===``&&(n=a.offset),t+=a.content;continue}t!==``&&o!=null&&(i?o.push({content:t,offset:n}):a={...a,content:t+a.content,offset:n},t=``)}o?.push(a)}}o??=e;let s={type:`element`,tagName:t==null?`span`:`div`,properties:t==null?{class:`line`}:{},children:[]},l=c?.get(n),u=l==null?Jn(s,o,i,r):Yn(s,o,l,n,i,r);return i&&u===0&&s.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),i&&l!=null&&Un(s),t==null?s:Ln(s,n+1,t)};if(!n)return e.map(l);let u=Array(e.length);for(let t=0;t<e.length;t++){let n=e[t];Rn(u,t,()=>l(n,t))}return u}function Jn(e,t,n,r){let i=0;for(let a of t)a.content!==``&&(e.children.push(Xn(a,Bn(a,r),a.content,i,n)),i+=a.content.length);return i}function Yn(e,t,n,r,i,a){let o=0;for(let e of t)o+=e.content.length;let s=new An(e,n,r,o),c=0;for(let e of t){let{content:t}=e;if(t===``)continue;let n=c,r=n+t.length,o=Bn(e,a);for(;c<r;){s.moveTo(c);let a=Math.min(r,s.nextEdge);s.parent.children.push(Xn(e,o,c===n&&a===r?t:t.slice(c-n,a-n),n,i)),c=a}}return s.moveTo(c),c}function Xn(e,t,n,r,i){let a=e.htmlAttrs==null?{}:{...e.htmlAttrs};return t!==``&&(a.style=t),i&&(a[`data-char`]=r),{type:`element`,tagName:`span`,properties:a,children:[{type:`text`,value:n}]}}function Zn(e,t){if(typeof e!=`number`)return e;let n=0,r=t.length;for(;n+1<r;){let i=n+r>>>1;t[i]<=e?n=i:r=i}return{line:n,character:e-(t[n]??0)}}var Qn={forcePlainText:!1};function $n(e,t,{theme:n,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,lazyLineAST:o=!1,startingLine:s,totalLines:c,lines:l}=Qn){a?(s??=0,c??=1/0):(s=0,c=1/0);let u=s>0||c<1/0,d=u?l??En(e.contents):void 0,f={lineInfo:[]},p=a?`text`:e.lang??H(e.name),m=typeof n==`string`?t.getTheme(n).type:void 0,h=gn({theme:n,highlighter:t});if(d!=null&&Math.min(s+c,d.length)<=s)return{code:Array(s),themeStyles:h,baseThemeType:m};f.lineInfo=e=>({type:`context`,lineIndex:e-1+s,lineNumber:e+s});let g=qn(t.codeToTokens(er(d==null?e.contents:tr(d,s,c)),kn(p,n,r)).tokens,{state:f,useTokenTransformer:i,lazyLineAST:o&&!a&&!i,cacheHtmlStyles:t.name===`highlights`}),_=u?Array(s):g;return u&&On(_,g),{code:_,themeStyles:h,baseThemeType:m}}function er(e){return e.replace(/\r(?!\n)/g,`
7
+ `)}function tr(e,t,n){if(e.length===0)return``;let r=Math.min(t+n,e.length),i=e.slice(t,r).join(``);return r<e.length?Dn(i):i}var nr=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled because the pool terminated`),this.name=`WorkerPoolTerminatedError`}},rr=class extends Error{constructor(){super(`WorkerPoolManager: operation canceled before the task completed`),this.name=`WorkerPoolTaskCanceledError`}},q=class extends Error{constructor(e,t){super(e,t),this.name=`WorkerPoolWorkerError`}},ir=new WeakSet;function ar(e){ir.add(e)}function or(e){return e instanceof nr||e instanceof rr}function sr(e){return or(e)||e instanceof q&&ir.has(e)}function cr(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e===t}function lr(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function ur(e,t){return Xt(e.theme,t.theme)&&(e.preferredDiffLib??`jsdiff`)===(t.preferredDiffLib??`jsdiff`)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function dr(e){let t=e.lang??H(e.name),n=e.lang??(e.prevName==null?`text`:H(e.prevName));return t===`text`&&n===`text`}function fr(e,t){let n=t===`additions`?e.additionLines:e.deletionLines;if(n.length===0)return!1;if(e.isPartial){let n=e.hunks.at(-1);return n!=null&&!(t===`additions`?n.noEOFCRAdditions:n.noEOFCRDeletions)}return n.at(-1)?.endsWith(`
8
+ `)===!0}function pr(e){return{...lt,...e}}function mr(e,t){return hr(e,t)+gr(e,t)}function hr(e,t){return t?0:e.diffHeaderHeight}function gr(e,t){return e.paddingTop??(t?e.spacing:0)}function _r(e){return e.paddingBottom??e.spacing}function vr(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function yr(e){return[gt(e.additionStart,e.additionCount)+1,_t(e.additionStart,e.additionCount)+1]}function br(e){return[gt(e.deletionStart,e.deletionCount)+1,_t(e.deletionStart,e.deletionCount)+1]}function xr(e,t){return t===`additions`?yr(e):br(e)}function Sr(e,t,n){let r={fromStart:e?.fromStart??0,fromEnd:e?.fromEnd??0};return(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),r}function Cr({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function wr({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-_t(n.additionStart,n.additionCount),i=e.deletionLines.length-_t(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function Tr({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=wr({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function Er({fileDiff:e,lineNumber:t,side:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return!1;for(let[a,o]of e.hunks.entries()){let[s,c]=xr(o,n);if(t<s){let n=Cr({isPartial:e.isPartial,rangeSize:o.collapsedBefore,expandedHunks:r,hunkIndex:a,collapsedContextThreshold:i}),c=s-n.rangeSize;return!n.renderAll&&t>=c+n.fromStart&&t<s-n.fromEnd}if(t<c)return!1}let a=Tr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`isDiffLineInCollapsedContext`});if(a==null||a.renderAll)return!1;let[,o]=xr(e.hunks[e.hunks.length-1],n);return t>=o+a.fromStart&&t<o+a.rangeSize}function Dr({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=yr(n),l=Cr({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=Tr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t)}else for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function Or({type:e,metrics:t}){return t.hunkSeparatorHeight??vr(e)}function kr({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function Ar({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case`simple`:return t>0;case`metadata`:return n!=null;case`line-info`:case`line-info-basic`:case`custom`:return!0}}function jr(e){return e!==`simple`&&e!==`metadata`}function Mr({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!Ar({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=Or({type:e,metrics:t}),a=kr({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function Nr({type:e,metrics:t}){if(!jr(e))return;let n=Or({type:e,metrics:t}),r=kr({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function J(e){throw Error(`DiffRowCursor: row has no ${e} line`)}var Pr=0,Fr=1,Ir=2,Lr=3,Rr=4,zr=5,Br=6,Vr=7,Hr=class{diff;diffStyle;expandedHunks;collapsedContextThreshold;includeTrailingNewline;startingLine;windowEnd;unifiedCount=0;splitCount=0;rowType=`context`;rowHunkIndex=0;rowHunk=void 0;rowHasDeletion=!1;rowHasAddition=!1;index=-1;end=0;secondStretchFirst=0;secondStretchEnd=0;deletionIndexStart=0;deletionNumberStart=0;deletionUnifiedStart=0;additionIndexStart=0;additionNumberStart=0;additionUnifiedStart=0;splitStart=0;firstRowCollapsedBefore=0;collapsedAfterValue=0;collapsedAfterRow=-1;deletionNoEOFCRRow=-1;additionNoEOFCRRow=-1;part=Pr;walkHunkIndex=0;walkHunk=void 0;contentIndex=0;pendingCollapsed=0;leadingStartRows=0;leadingEndRows=0;leadingRangeSize=0;trailingRows=-1;trailingCollapsed=0;unifiedAt=0;splitAt=0;deletionIndexAt=0;additionIndexAt=0;deletionNumberAt=0;additionNumberAt=0;collapsedAfterAt=-1;constructor({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,includeTrailingNewline:o=!1}){this.diff=e,this.diffStyle=t,this.startingLine=n,this.windowEnd=n+r,this.expandedHunks=i,this.collapsedContextThreshold=a,this.includeTrailingNewline=o,r===0?this.part=Vr:n>0&&this.findStartingHunk()}next(){let{index:e,end:t}=this,n=e+1;return n<t?(this.index=n,!0):this.nextRun()}get type(){return this.rowType}get hunkIndex(){return this.rowHunkIndex}get hunk(){return this.rowHunk}get hasDeletion(){return this.rowHasDeletion}get hasAddition(){return this.rowHasAddition}get deletionLineIndex(){let{rowHasDeletion:e,deletionIndexStart:t,index:n}=this;return e||J(`deletion`),t+n}get deletionLineNumber(){let{rowHasDeletion:e,deletionNumberStart:t,index:n}=this;return e||J(`deletion`),t+n}get deletionUnifiedLineIndex(){let{rowHasDeletion:e,deletionUnifiedStart:t,index:n}=this;return e||J(`deletion`),t+n}get deletionNoEOFCR(){let{rowHasDeletion:e,deletionNoEOFCRRow:t,index:n}=this;return e||J(`deletion`),n===t}get additionLineIndex(){let{rowHasAddition:e,additionIndexStart:t,index:n}=this;return e||J(`addition`),t+n}get additionLineNumber(){let{rowHasAddition:e,additionNumberStart:t,index:n}=this;return e||J(`addition`),t+n}get additionUnifiedLineIndex(){let{rowHasAddition:e,additionUnifiedStart:t,index:n}=this;return e||J(`addition`),t+n}get additionNoEOFCR(){let{rowHasAddition:e,additionNoEOFCRRow:t,index:n}=this;return e||J(`addition`),n===t}get unifiedLineIndex(){let{rowHasAddition:e,additionUnifiedStart:t,deletionUnifiedStart:n,index:r}=this;return(e?t:n)+r}get splitLineIndex(){let{splitStart:e,index:t}=this;return e+t}get collapsedBefore(){let{index:e,firstRowCollapsedBefore:t}=this;return e===0?t:0}get collapsedAfter(){let{index:e,collapsedAfterRow:t,collapsedAfterValue:n}=this;return e===t?n:0}findStartingHunk(){let{diff:e,diffStyle:t,startingLine:n}=this,r=e.hunks.length-1,i=0;for(let a of e.hunks){let e=this.getLeadingRegion(a,i),o=e.fromStart+e.fromEnd;if(i===r){let e=this.getTrailingRegion();o+=(e?.fromStart??0)+(e?.fromEnd??0),this.hasTrailingNewlineRow(e?.collapsedLines??0)&&o++}let s=o+a.unifiedLineCount,c=o+a.splitLineCount,{unifiedCount:l,splitCount:u}=this;if((t===`split`?u+c:l+s)>n)break;this.unifiedCount+=s,this.splitCount+=c,i++}this.walkHunkIndex=i}getLeadingRegion(e,t){let{diff:n,expandedHunks:r,collapsedContextThreshold:i}=this;return Cr({isPartial:n.isPartial,rangeSize:e.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i})}getTrailingRegion(){let{diff:e,expandedHunks:t,collapsedContextThreshold:n}=this;return Tr({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`DiffRowCursor`})}hasTrailingNewlineRow(e){let{diff:t,includeTrailingNewline:n}=this;return n&&e===0&&fr(t,`additions`)}clipRun(e,t,n,r){let{diffStyle:i,startingLine:a,windowEnd:o}=this;if(a===0&&o===1/0)return this.index=0,this.end=e,e>0;if(i!==`both`){let r=i===`unified`?t:n;return this.index=Math.max(0,a-r),this.end=Math.min(e,o-r),this.index<this.end}let s=Math.max(0,a-t),c=Math.min(e,o-t),l=Math.max(0,a-n),u=Math.min(e,o-n),d=0,f=0;if(l<u&&(s<c?l<=c?c=Math.max(c,u):(d=l,f=u):(s=l,c=u)),r!=null){let t=Math.max(0,a-r),n=Math.min(e,o-r);t<n&&(s<c?n>=s?s=t:(d=s,f=c,s=t,c=n):(s=t,c=n))}return s>=c?!1:(this.index=s,this.end=c,d<f&&(this.secondStretchFirst=d,this.secondStretchEnd=f),!0)}isPastWindow(){let{diffStyle:e,unifiedCount:t,splitCount:n,windowEnd:r}=this;return e===`unified`?t>=r:(e===`split`||t>=r)&&n>=r}nextRun(){let{diff:e,secondStretchFirst:t,secondStretchEnd:n}=this;if(t<n)return this.index=t,this.end=n,this.secondStretchFirst=0,this.secondStretchEnd=0,!0;for(;;){if(this.part===Vr||this.isPastWindow())return this.part=Vr,!1;switch(this.part){case Pr:{let t=e.hunks[this.walkHunkIndex];if(t==null)return this.part=Vr,!1;this.enterHunk(t),this.part=Fr;break}case Fr:if(this.part=Ir,this.leadingStartRows>0&&this.startExpandedRun(this.leadingStartRows,this.leadingRangeSize,0))return!0;break;case Ir:if(this.part=Lr,this.leadingEndRows>0&&this.startExpandedRun(this.leadingEndRows,this.leadingEndRows,this.takePendingCollapsed()))return!0;this.startingLine>0&&this.skipBlocksBeforeWindow();break;case Lr:{let{walkHunk:e}=this;if(e==null)throw Error(`DiffRowCursor: missing hunk`);let t=e.hunkContent[this.contentIndex];if(t==null){this.part=zr;break}let n=this.contentIndex===e.hunkContent.length-1;if(t.type===`context`){if(this.contentIndex++,this.startContextRun(e,t,n))return!0;break}if(this.part=Rr,this.startChangeRun(e,t,n,!1))return!0;break}case Rr:{let{walkHunk:e}=this;if(e==null)throw Error(`DiffRowCursor: missing hunk`);let t=e.hunkContent[this.contentIndex];if(t==null||t.type!==`change`)throw Error(`DiffRowCursor: missing change content`);let n=this.contentIndex===e.hunkContent.length-1;this.part=Lr,this.contentIndex++;let r=this.startChangeRun(e,t,n,!0),{deletions:i,additions:a}=t;if(this.unifiedCount+=i+a,this.splitCount+=Math.max(i,a),this.unifiedAt+=i+a,this.splitAt+=Math.max(i,a),this.deletionIndexAt+=i,this.additionIndexAt+=a,this.deletionNumberAt+=i,this.additionNumberAt+=a,r)return!0;break}case zr:if(this.part=Br,this.trailingRows>0&&this.startTrailingRun())return!0;break;case Br:{let t=this.walkHunkIndex===e.hunks.length-1;if(this.walkHunkIndex++,this.part=Pr,t&&this.hasTrailingNewlineRow(this.trailingCollapsed)&&this.startTrailingNewlineRun())return!0;break}}}}skipBlocksBeforeWindow(){let{walkHunk:e,diffStyle:t,startingLine:n,unifiedCount:r}=this;if(e==null)throw Error(`DiffRowCursor: missing hunk`);for(;this.contentIndex<e.hunkContent.length;){let r=e.hunkContent[this.contentIndex],i=r.type===`context`?r.lines:r.deletions,a=r.type===`context`?r.lines:r.additions,o=r.type===`context`?r.lines:i+a,s=Math.max(i,a),{unifiedCount:c,splitCount:l}=this;if((t===`split`?l+s:c+o)>n)break;this.unifiedCount+=o,this.splitCount+=s,this.unifiedAt+=o,this.splitAt+=s,this.deletionIndexAt+=i,this.additionIndexAt+=a,this.deletionNumberAt+=i,this.additionNumberAt+=a,this.contentIndex++}this.unifiedCount>r&&(this.pendingCollapsed=0)}enterHunk(e){let{diff:t,diffStyle:n,walkHunkIndex:r}=this,i=gt(e.deletionStart,e.deletionCount),a=gt(e.additionStart,e.additionCount),o=this.getLeadingRegion(e,r),s=r===t.hunks.length-1?this.getTrailingRegion():void 0;this.walkHunk=e,this.contentIndex=0,this.leadingStartRows=o.fromStart,this.leadingEndRows=o.fromEnd,this.leadingRangeSize=o.rangeSize,this.pendingCollapsed=o.collapsedLines,this.trailingRows=s==null?-1:s.fromStart+s.fromEnd,this.trailingCollapsed=s?.collapsedLines??0,this.unifiedAt=e.unifiedLineStart,this.splitAt=e.splitLineStart,this.deletionIndexAt=!t.isPartial&&e.deletionCount===0?i:e.deletionLineIndex,this.additionIndexAt=!t.isPartial&&e.additionCount===0?a:e.additionLineIndex,this.deletionNumberAt=i+1,this.additionNumberAt=a+1,this.collapsedAfterAt=s!=null&&s.collapsedLines>0&&s.fromStart+s.fromEnd===0?n===`unified`?e.unifiedLineStart+e.unifiedLineCount-1:e.splitLineStart+e.splitLineCount-1:-1}takePendingCollapsed(){let{pendingCollapsed:e}=this;return this.pendingCollapsed=0,e}startExpandedRun(e,t,n){let{unifiedCount:r,splitCount:i,walkHunkIndex:a,walkHunk:o,deletionIndexAt:s,deletionNumberAt:c,additionIndexAt:l,additionNumberAt:u,unifiedAt:d,splitAt:f}=this;return this.rowType=`context-expanded`,this.rowHunkIndex=a,this.rowHunk=o,this.rowHasDeletion=!0,this.rowHasAddition=!0,this.deletionIndexStart=s-t,this.deletionNumberStart=c-t,this.deletionUnifiedStart=d-t,this.additionIndexStart=l-t,this.additionNumberStart=u-t,this.additionUnifiedStart=d-t,this.splitStart=f-t,this.firstRowCollapsedBefore=n,this.collapsedAfterRow=-1,this.deletionNoEOFCRRow=-1,this.additionNoEOFCRRow=-1,this.unifiedCount+=e,this.splitCount+=e,this.clipRun(e,r,i)}startContextRun(e,t,n){let{lines:r}=t,{diffStyle:i,unifiedCount:a,splitCount:o,walkHunkIndex:s,deletionIndexAt:c,deletionNumberAt:l,additionIndexAt:u,additionNumberAt:d,unifiedAt:f,splitAt:p}=this,m=r>0;return m&&(this.rowType=`context`,this.rowHunkIndex=s,this.rowHunk=e,this.rowHasDeletion=!0,this.rowHasAddition=!0,this.deletionIndexStart=c,this.deletionNumberStart=l,this.deletionUnifiedStart=f,this.additionIndexStart=u,this.additionNumberStart=d,this.additionUnifiedStart=f,this.splitStart=p,this.firstRowCollapsedBefore=this.takePendingCollapsed(),this.setCollapsedAfterRow(i===`unified`?f:p),this.deletionNoEOFCRRow=n&&e.noEOFCRDeletions?r-1:-1,this.additionNoEOFCRRow=n&&e.noEOFCRAdditions?r-1:-1),this.unifiedCount+=r,this.splitCount+=r,this.unifiedAt+=r,this.splitAt+=r,this.deletionIndexAt+=r,this.additionIndexAt+=r,this.deletionNumberAt+=r,this.additionNumberAt+=r,m&&this.clipRun(r,a,o)}startChangeRun(e,t,n,r){let{deletions:i,additions:a}=t,{diffStyle:o,unifiedCount:s,splitCount:c,walkHunkIndex:l,deletionIndexAt:u,deletionNumberAt:d,additionIndexAt:f,additionNumberAt:p,unifiedAt:m,splitAt:h}=this,g=o===`unified`,_=Math.min(i,a),v=g?r?i:0:r?_:0,y=g?r?a:i:r?Math.max(i,a)-_:_;if(y<=0)return!1;let b=g?!r:!r||i>a,x=g?r:!r||a>i;this.rowType=`change`,this.rowHunkIndex=l,this.rowHunk=e,this.rowHasDeletion=b,this.rowHasAddition=x;let S=g?0:v;this.deletionIndexStart=u+S,this.deletionNumberStart=d+S,this.deletionUnifiedStart=m+S,this.additionIndexStart=f+S,this.additionNumberStart=p+S,this.additionUnifiedStart=m+i+S,this.splitStart=h+S,this.firstRowCollapsedBefore=this.takePendingCollapsed(),this.setCollapsedAfterRow(g?m+v:h+v);let C=g||r||i===a;this.deletionNoEOFCRRow=n&&b&&C&&e.noEOFCRDeletions?y-1:-1,this.additionNoEOFCRRow=n&&x&&C&&e.noEOFCRAdditions?y-1:-1;let w=s+v,T=s+i+S;return this.clipRun(y,b?w:T,c+v,b&&x?T:void 0)}startTrailingRun(){let{diff:e,trailingRows:t,trailingCollapsed:n,unifiedCount:r,splitCount:i,deletionIndexAt:a,deletionNumberAt:o,additionIndexAt:s,additionNumberAt:c,unifiedAt:l,splitAt:u}=this;return this.rowType=`context-expanded`,this.rowHunkIndex=e.hunks.length,this.rowHunk=void 0,this.rowHasDeletion=!0,this.rowHasAddition=!0,this.deletionIndexStart=a,this.deletionNumberStart=o,this.deletionUnifiedStart=l,this.additionIndexStart=s,this.additionNumberStart=c,this.additionUnifiedStart=l,this.splitStart=u,this.firstRowCollapsedBefore=0,this.collapsedAfterValue=n,this.collapsedAfterRow=t-1,this.deletionNoEOFCRRow=-1,this.additionNoEOFCRRow=-1,this.unifiedCount+=t,this.splitCount+=t,this.clipRun(t,r,i)}startTrailingNewlineRun(){let{diff:e,trailingRows:t,unifiedCount:n,splitCount:r,deletionIndexAt:i,deletionNumberAt:a,additionIndexAt:o,additionNumberAt:s,unifiedAt:c,splitAt:l}=this,u=Math.max(t,0),d=fr(e,`deletions`),f=o+u,p=i+u;return this.rowType=d?`context`:`change`,this.rowHunkIndex=e.hunks.length,this.rowHunk=void 0,this.rowHasDeletion=d,this.rowHasAddition=!0,this.deletionIndexStart=p,this.deletionNumberStart=a+u,this.deletionUnifiedStart=c+u,this.additionIndexStart=f,this.additionNumberStart=s+u,this.additionUnifiedStart=c+u,this.splitStart=l+u,this.firstRowCollapsedBefore=0,this.collapsedAfterRow=-1,this.deletionNoEOFCRRow=-1,this.additionNoEOFCRRow=-1,this.unifiedCount++,this.splitCount++,this.clipRun(1,n,r)}setCollapsedAfterRow(e){let{collapsedAfterAt:t,trailingCollapsed:n}=this;t===-1?this.collapsedAfterRow=-1:(this.collapsedAfterValue=n,this.collapsedAfterRow=t-e)}},Ur={forcePlainText:!1};function Wr(e,t,n,{forcePlainText:r,lazyLineAST:i=!1,startingLine:a,totalLines:o,expandedHunks:s,collapsedContextThreshold:c=1}=Ur){r?(a??=0,o??=1/0):(a=0,o=1/0);let l=a>0||o<1/0;i&&=!r&&!n.useTokenTransformer;let u=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,d=gn({theme:n.theme,highlighter:t}),f={deletionLines:[],additionLines:[]},p=!r&&!e.isPartial,m=r?s:void 0,h=new Map;function g(e){let t=p?0:e,n=h.get(t)??Gr();return h.set(t,n),n}function _(e,t,n,r){if(l){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}let v=new Hr({diff:e,diffStyle:`both`,startingLine:a,totalLines:o,expandedHunks:!l||m,collapsedContextThreshold:c});for(;v.next();){let{hunkIndex:t,type:n,splitLineIndex:r}=v,i=g(t);if(v.hasDeletion){let{deletionLineIndex:t,deletionLineNumber:a,deletionUnifiedLineIndex:o}=v;_(e.deletionLines[t],t,i.deletionSegments,i.deletionContent),i.deletionInfo.push({type:n===`change`?`change-deletion`:n,lineNumber:a,altLineNumber:n===`change`?void 0:v.additionLineNumber,lineIndex:`${o},${r}`})}if(v.hasAddition){let{additionLineIndex:t,additionLineNumber:a,additionUnifiedLineIndex:o}=v;_(e.additionLines[t],t,i.additionSegments,i.additionContent),i.additionInfo.push({type:n===`change`?`change-addition`:n,lineNumber:a,altLineNumber:n===`change`?void 0:v.deletionLineNumber,lineIndex:`${o},${r}`})}}for(let a of h.values()){if(a.deletionContent.length===0&&a.additionContent.length===0)continue;let o={name:e.prevName??e.name,contents:a.deletionContent.value},s={name:e.name,contents:a.additionContent.value},{deletionLines:c,additionLines:l}=Kr({deletionFile:o,deletionInfo:a.deletionInfo,additionFile:s,additionInfo:a.additionInfo,highlighter:t,options:n,languageOverride:r?`text`:e.lang,lazyLineAST:i});if(p)f.deletionLines=c,f.additionLines=l;else for(let[e,t,n]of[[f.deletionLines,c,a.deletionSegments],[f.additionLines,l,a.additionSegments]])if(n.length>0)for(let r of n)for(let n=0;n<r.count;n++)e[r.targetIndex+n]=t[r.originalOffset+n];else if(i){let n=e.length;for(let r=0;r<t.length;r++)Rn(e,n+r,()=>t[r])}else On(e,t)}return{code:f,themeStyles:d,baseThemeType:u}}function Gr(){return{deletionContent:{push(e){this.value+=e,this.length++},value:``,length:0},additionContent:{push(e){this.value+=e,this.length++},value:``,length:0},deletionInfo:[],additionInfo:[],deletionSegments:[],additionSegments:[]}}function Kr({lazyLineAST:e,deletionFile:t,additionFile:n,deletionInfo:r,additionInfo:i,highlighter:a,languageOverride:o,options:{theme:s,useTokenTransformer:c,tokenizeMaxLineLength:l}}){let u=(t,n)=>t.contents===``?[]:qn(a.codeToTokens(Dn(t.contents),kn(o??H(t.name),s,l)).tokens,{state:{lineInfo:n},useTokenTransformer:c,lazyLineAST:e,cacheHtmlStyles:a.name===`highlights`});return{deletionLines:u(t,r),additionLines:u(n,i)}}function qr(e){let t=[];for(let n of e){let e=wt.get(n);if(e==null)throw Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(e)}return t}function Jr(e){for(let t of Array.isArray(e)?e:[e])if(!wt.has(t))return!1;return!0}async function Yr(e){if(typeof __DIFFS_WORKER__<`u`?__DIFFS_WORKER__:At())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=Tt.get(e);if(t!=null)return t;let n=(async()=>{let t=Et.get(e);if(t==null){let{bundledLanguages:n}=await A(async()=>{let{bundledLanguages:e}=await import(`./grammars-DmFYBwmS.js`).then(e=>e.n);return{bundledLanguages:e}},__vite__mapDeps([11,1,9,10]));Object.prototype.hasOwnProperty.call(n,e)&&(t=n[e])}if(t==null&&!Dt.has(e))throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n={name:e,data:t==null?[{name:e,scopeName:`text.${e}`,patterns:[],repository:{}}]:(await t()).default};return wt.has(e)||wt.set(e,n),n})();Tt.set(e,n);try{return await n}finally{Tt.get(e)===n&&Tt.delete(e)}}function Xr(e){return wt.get(e)??Yr(e)}async function Zr(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=Xr(r)??Yr(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}function Qr(e,t=I()){return Wt(t).getResolvedThemes(e)}function $r(e,t=I()){return Wt(t).hasResolvedThemes(e)}function ei(e,t=I()){return Wt(t).resolveThemes(e)}function ti(){let e=globalThis.navigator?.hardwareConcurrency??1;return Math.min(3,Math.max(1,e-1))}function ni(e){let t=[],n=[];for(let r of e){let e=Dt.get(r);if(e==null)continue;let i=Ot.get(r);if(i!=null){t.push(i);continue}let a=t.push({name:r,data:[]})-1;n.push(e().then(({default:e})=>{let n=Ot.get(r);n??(n={name:r,data:[],highlights:e},Ot.set(r,n)),t[a]=n}))}return n.length===0?t:Promise.all(n).then(()=>t)}var ri=0,ii=1,ai=2,oi=4,si=5,ci=6,li=[void 0,null,!0,!1];function ui(e){if(Array.isArray(e))return e;let{ops:t,offsets:n,strings:r,text:i,extras:a}=e,o=Array(n.length/2),s=0,c=0;function l(e){let n=Array(e);for(let o=0;o<e;o++){let e=t[s++];if(e!==ri){if(e===ii){let e=c+t[s++];n[o]={type:`text`,value:i.slice(c,e)},c=e}else if(e===ai){let e=r[t[s++]],i={};for(let e=t[s++];e>0;e--){let e=r[t[s++]],n=t[s++],o=n===oi?r[t[s++]]:n===si?t[s++]:n===ci?a[t[s++]]:li[n];e===`__proto__`?Object.defineProperty(i,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[e]=o}n[o]={type:`element`,tagName:e,properties:i,children:l(t[s++])}}else n[o]=a[t[s++]]}}return n}for(let e=0;e<o.length;e++)t[n[e*2]]!==ri&&Rn(o,e,()=>(s=n[e*2],c=n[e*2+1],l(1)[0]),{retain:!1});return o}var di=e(t(((e,t,n)=>{var r;(function(n,i){typeof e==`object`&&t!==void 0?i(e):typeof r==`function`&&r.amd?r([`exports`],i):i((n||=self).lru_map=n.lru_map||{})})(n,function(e){let t=Symbol(`newer`),n=Symbol(`older`);class r{constructor(e,t){typeof e!=`number`&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[t]&&(e===this.oldest&&(this.oldest=e[t]),e[t][n]=e[n]),e[n]&&(e[n][t]=e[t]),e[t]=void 0,e[n]=this.newest,this.newest&&(this.newest[t]=e),this.newest=e)}assign(e){let r,a=this.limit||Number.MAX_VALUE;this._keymap.clear();let o=e[Symbol.iterator]();for(let e=o.next();!e.done;e=o.next()){let o=new i(e.value[0],e.value[1]);if(this._keymap.set(o.key,o),r?(r[t]=o,o[n]=r):this.oldest=o,r=o,a--==0)throw Error(`overflow`)}this.newest=r,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);return t?(this._markEntryAsUsed(t),t.value):void 0}set(e,r){var a=this._keymap.get(e);return a?(a.value=r,this._markEntryAsUsed(a),this):(this._keymap.set(e,a=new i(e,r)),this.newest?(this.newest[t]=a,a[n]=this.newest):this.oldest=a,this.newest=a,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var e=this.oldest;if(e)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),e[t]=e[n]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var r=this._keymap.get(e);return r?(this._keymap.delete(r.key),r[t]&&r[n]?(r[n][t]=r[t],r[t][n]=r[n]):r[t]?(r[t][n]=void 0,this.oldest=r[t]):r[n]?(r[n][t]=void 0,this.newest=r[n]):this.oldest=this.newest=void 0,this.size--,r.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new o(this.oldest)}values(){return new s(this.oldest)}entries(){return this}[Symbol.iterator](){return new a(this.oldest)}forEach(e,n){typeof n!=`object`&&(n=this);let r=this.oldest;for(;r;)e.call(n,r.value,r.key,this),r=r[t]}toJSON(){for(var e=Array(this.size),n=0,r=this.oldest;r;)e[n++]={key:r.key,value:r.value},r=r[t];return e}toString(){for(var e=``,n=this.oldest;n;)e+=String(n.key)+`:`+n.value,n=n[t],n&&(e+=` < `);return e}}e.LRUMap=r;function i(e,r){this.key=e,this.value=r,this[t]=void 0,this[n]=void 0}function a(e){this.entry=e}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}};function o(e){this.entry=e}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}};function s(e){this.entry=e}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}}})}))(),1),fi=Symbol(`IGNORE_RESPONSE`),pi=5e3,mi=class{options;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialization;configuredWorkers;workerSlots=[];readyWorkerCount=0;workerSlotsExhausted=!1;resolvedWorkerThemes=[];resolvedWorkerLanguages=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;failedHighlightKeys;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;pendingThemeRenders=new Map;terminated=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=et,useTokenTransformer:r=!1,lineDiffType:i=`word-alt`,preferredDiffLib:a,maxLineDiffLength:o=1e3,tokenizeMaxLineLength:s=1e3,preferredHighlighter:c}){this.options=e,this.configuredWorkers=e.poolSize??ti(),this.preferredHighlighter=I(c),this.renderOptions={theme:n,useTokenTransformer:r,lineDiffType:i,preferredDiffLib:a,maxLineDiffLength:o,tokenizeMaxLineLength:s},this.fileCache=new di.default.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new di.default.LRUMap(e.totalASTLRUCacheSize??100),this.failedHighlightKeys=new di.default.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.terminated&&!this.shouldUseLocalFallback()}shouldUseLocalFallback(){let{initialization:e}=this;return e?.state===`failed`||e?.state===`succeeded`&&this.readyWorkerCount===0}renderWhenLocalThemeLoads(e,t,n=[]){return z({theme:this.renderOptions.theme})==null?(this.pendingThemeRenders.set(e,t),this.loadLocalThemeForRender(this.isWorkingPool()?void 0:e),n.length>0&&this.loadSharedHighlighter([],n).catch(()=>{}),!0):(this.pendingThemeRenders.delete(e),!1)}cancelLocalThemeRender(e){this.pendingThemeRenders.delete(e)}loadLocalThemeForRender(e){let{theme:t}=this.renderOptions,{lifecycleGeneration:n}=this;this.loadSharedHighlighter(L(t),[`text`]).then(()=>{(this.terminated||this.isCurrentLifecycle(n))&&Xt(t,this.renderOptions.theme)&&this.renderPendingThemeViews()},t=>e?.onHighlightError(t))}renderPendingThemeViews(){if(z({theme:this.renderOptions.theme})!=null)for(let e of[...this.pendingThemeRenders.keys()]){let t=this.pendingThemeRenders.get(e);if(t!=null){this.pendingThemeRenders.delete(e);try{t()}catch(e){console.error(e)}}}}shouldHighlightOnMainThread(e){let{mainThreadMaxCharacters:t=-1}=this.options;return(`contents`in e?e.contents.length:e.deletionCharacterCount+e.additionCharacterCount)<=t}didHighlightFail(e){let t=`contents`in e?this.getFileHighlightKey(e):this.getDiffHighlightKey(e);return t!=null&&this.failedHighlightKeys.has(t)}getFileResultCache(e){return e.cacheKey==null?void 0:this.fileCache.get(e.cacheKey)}getDiffResultCache(e){return e.cacheKey==null?void 0:this.diffCache.get(e.cacheKey)}setFileResultCache(e,{result:t,options:n}){return e==null||!Qt(n,this.getFileRenderOptions())?!1:(this.fileCache.set(e,{result:t,options:n}),this.queueBroadcastStateChanges(),!0)}setDiffResultCache(e,{result:t,options:n}){return e==null||!ur(n,this.getDiffRenderOptions())?!1:(this.diffCache.set(e,{result:t,options:n}),this.queueBroadcastStateChanges(),!0)}inspectCaches(){let{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??et,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??`word-alt`,preferredDiffLib:r=this.renderOptions.preferredDiffLib,maxLineDiffLength:i=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:a=this.renderOptions.tokenizeMaxLineLength??1e3}){let{lifecycleGeneration:o}=this,s=++this.renderOptionsRequestVersion,c=()=>this.isCurrentLifecycle(o)&&this.renderOptionsRequestVersion===s;try{let o={theme:e,useTokenTransformer:t,lineDiffType:n,preferredDiffLib:r,maxLineDiffLength:i,tokenizeMaxLineLength:a};if(this.terminated&&this.queueInitialization(),!c()||ur(o,this.renderOptions))return;let s=L(e),l=!Xt(e,this.renderOptions.theme),u=!l&&this.resolvedWorkerThemes.length>0?this.resolvedWorkerThemes:$r(s,this.preferredHighlighter)?Qr(s,this.preferredHighlighter):await ei(s,this.preferredHighlighter);if(!c()||z({theme:e})==null&&(await this.loadSharedHighlighter(s,[`text`]),!c()))return;if(this.renderOptions=o,this.resolvedWorkerThemes=u,this.renderOptionsVersion++,this.initialization?.state===`pending`&&this.initialization.stopThemeWait?.(),this.diffCache.clear(),this.fileCache.clear(),this.failedHighlightKeys.clear(),this.invalidateRenderTasks(),l&&this.initialization?.state===`failed`&&this.initialization.reason===`preparation`){let{languages:e}=this.initialization;this.initialization=void 0,this.queueInitialization(e)}let d=this.setRenderOptionsOnWorkers(l);for(let e of this.themeSubscribers)e.onThemeChange();l&&this.renderPendingThemeViews(),await d}catch(e){if(e instanceof nr||!c())return;throw e}}getPreferredHighlighter(){return this.preferredHighlighter}getFileRenderOptions(){let{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e){let{renderOptionsVersion:t}=this,n=[];for(let r of this.workerSlots){let{worker:i}=r;if(r.state===`ready`&&i!=null){let a=e||i.pendingSetupRequestId!=null?this.resolvedWorkerThemes:[];n.push(this.setRenderOptionsOnWorker(i,a).catch(e=>{throw r.worker===i&&this.renderOptionsVersion===t&&this.failWorkerSlot(r,yi(e)),e}))}}await Promise.all(n)}setRenderOptionsOnWorker(e,t){let{renderOptionsVersion:n}=this;return new Promise((r,i)=>{let a=this.generateRequestId(),o={type:`set-render-options`,id:a,request:{type:`set-render-options`,id:a,renderOptions:this.renderOptions,resolvedThemes:t},resolve(){e.renderOptionsVersion=n,r()},reject:i,requestStart:Date.now()};this.postWorkerSetup(e,o)})}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast??=requestAnimationFrame(this._broadcastStateChanges)}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);let e=this.getStats();for(let t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);let t=this.activeRequestByInstance.get(e);if(t!=null){let n=this.activeTaskById.get(t);Y(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialization?.state===`succeeded`}async initialize(e){let{initialization:t}=this;if(t?.state===`succeeded`){z({theme:this.renderOptions.theme})??await this.preloadLocalHighlighter(e??[]);return}if(t?.state===`pending`)return t.promise;if(t?.state===`failed`){if(t.reason===`workers`)throw t.error;e??=t.languages}this.terminated=!1;let n=this.initialization={state:`pending`,promise:Promise.resolve(),resolve(){},reject(){}};return n.promise=new Promise((e,t)=>{n.resolve=e,n.reject=t}),this.workerSlots=Array.from({length:this.configuredWorkers},()=>({state:`starting`})),this.startPool(n,e??[]),this.queueBroadcastStateChanges(),n.promise}async startPool(e,t){let{lifecycleGeneration:n,renderOptionsVersion:r}=this,i=L(this.renderOptions.theme);this.preloadLocalHighlighter(t).catch(e=>{this.isCurrentLifecycle(n)&&console.error(e)});try{try{let t=$r(i,this.preferredHighlighter)?Qr(i,this.preferredHighlighter):await this.waitForWorkerThemes(e,i);this.initialization===e&&this.renderOptionsVersion===r&&(this.resolvedWorkerThemes=t)}catch(e){if(this.renderOptionsVersion===r)throw e}if(this.initialization!==e)return;let n=this.resolveWorkerLanguages(t),a=Array.isArray(n)?n:await n;if(this.initialization!==e)return;if(this.resolvedWorkerLanguages=a,this.workerSlots.length===0){let t=new q(`WorkerPoolManager: no workers configured`);this.workerSlotsExhausted=!0,this.rejectInitialization(e,{reason:`workers`,error:t}),this.rejectAllQueuedRenderTasks(t);return}this.startWorkerAttempts(this.workerSlots,`starting`)}catch(n){if(this.initialization!==e)return;this.workerSlots=[];let r=vi(n);this.rejectInitialization(e,{reason:`preparation`,error:r,languages:[...t]}),this.rejectAllQueuedRenderTasks(r)}}waitForWorkerThemes(e,t){let n=new Promise(t=>{e.stopThemeWait=()=>t(this.resolvedWorkerThemes)});return Promise.race([ei(t,this.preferredHighlighter),n])}preloadLocalHighlighter(e){return this.pendingThemeRenders.size>0&&this.loadLocalThemeForRender(),this.loadSharedHighlighter(L(this.renderOptions.theme),[`text`,...e])}async loadSharedHighlighter(e,t){try{await qt({themes:e,langs:t,preferredHighlighter:this.preferredHighlighter})}catch(e){if(!(e instanceof yt))throw e}}async retryFailedWorkers(){let e=this.workerSlots.filter(e=>e.state===`failed`);return e.length>0&&await Promise.all(this.startWorkerAttempts(e,`retrying`)),this.getStats()}startWorkerAttempts(e,t){let n=e.map(e=>new Promise(n=>{let r={resolve:n};e.startup=r,e.state=t,e.error=void 0,this.startWorkerAttempt(e,r)}));return this.queueBroadcastStateChanges(),n}async startWorkerAttempt(e,t){let n=this.options.workerInitializationTimeout??pi;t.timeout=setTimeout(()=>{this.failWorkerAttempt(e,t,new q(`WorkerPoolManager: worker initialization timed out after ${n}ms`))},n);try{let n=this.options.workerFactory(),r={worker:n,requestId:void 0,pendingSetupRequestId:void 0,renderOptionsVersion:this.renderOptionsVersion,langs:new Set([`text`,...this.resolvedWorkerLanguages.map(({name:e})=>e)]),customExtensionsVersion:0};for(e.worker=r,n.addEventListener(`message`,t=>{e.worker===r&&this.handleWorkerMessage(r,t.data)}),n.addEventListener(`error`,t=>{e.worker===r&&this.handleWorkerError(e,r,t)}),await new Promise((e,t)=>{let n=this.generateRequestId(),i={type:`initialize`,id:n,request:{type:`initialize`,resultFormat:`hast-ops-v1`,id:n,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:this.resolvedWorkerThemes,resolvedLanguages:this.resolvedWorkerLanguages},resolve:e,reject:t,requestStart:Date.now()};this.postWorkerSetup(r,i)});e.startup===t&&r.renderOptionsVersion!==this.renderOptionsVersion;)await this.setRenderOptionsOnWorker(r,this.resolvedWorkerThemes);if(e.startup!==t)return;e.state=`ready`,this.settleWorkerStartup(e),this.readyWorkerCount++,this.workerSlotsExhausted=!1;let{initialization:i}=this;i?.state!==`succeeded`&&(this.initialization={state:`succeeded`},i?.state===`pending`&&i.resolve()),this.queueDrain(),this.queueBroadcastStateChanges()}catch(n){this.failWorkerAttempt(e,t,n)}}postWorkerSetup(e,t){this.cancelWorkerSetup(e),this.activeTaskById.set(t.id,t),e.pendingSetupRequestId=t.id,this.executeTask(e,t)}cancelWorkerSetup(e,t){let{pendingSetupRequestId:n}=e;if(n!=null){let r=this.activeTaskById.get(n);(r?.type===`initialize`||r?.type===`set-render-options`)&&r.reject(t??new rr),this.cleanWorkerAndTask(e,r,n)}}retireWorker(e,t){let{worker:n}=e;n!=null&&(e.worker=void 0,this.cancelWorkerSetup(n,t),n.worker.terminate())}failWorkerAttempt(e,t,n){if(e.startup!==t)return;let r=yi(n);if(e.state!==`starting`){this.failWorkerSlot(e,r);return}clearTimeout(t.timeout);let i={resolve:t.resolve};e.startup=i,e.state=`retrying`,this.retireWorker(e,r),this.queueBroadcastStateChanges(),this.startWorkerAttempt(e,i)}failWorkerSlot(e,t){let n=e.state===`ready`;if(this.retireWorker(e,t),e.state=`failed`,e.error=t,this.settleWorkerStartup(e),n&&this.readyWorkerCount--,this.queueBroadcastStateChanges(),this.readyWorkerCount>0||this.workerSlotsExhausted)return;let r=this.workerSlots.map(({error:e})=>e);if(!r.every(e=>e!=null)){n&&this.rejectAllQueuedRenderTasks(e.error);return}this.workerSlotsExhausted=!0;let i=r.length===1?e.error:new q(`WorkerPoolManager: all ${r.length} worker slots failed`,{cause:AggregateError(r,`Worker slot failures`)});r.length>1&&r.every(sr)&&ar(i);let{initialization:a}=this;a?.state===`pending`&&this.rejectInitialization(a,{reason:`workers`,error:i}),this.rejectAllQueuedRenderTasks(i)}settleWorkerStartup(e){let{startup:t}=e;t!=null&&(e.startup=void 0,clearTimeout(t.timeout),t.resolve())}rejectInitialization(e,t){this.initialization={state:`failed`,...t},e.reject(t.error)}rejectAllQueuedRenderTasks(e){let t=new Set;for(let n of this.removeAllQueuedRenderTasks()){this.rejectRenderTaskCallbacks(n,e);for(let e of _i(n))t.add(e)}this.queueBroadcastStateChanges();for(let e of t)try{e.onLocalFallback()}catch(e){console.error(e)}}handleWorkerError(e,t,n){let{onWorkerError:r}=this.options;if(r!=null)try{r(n,t.worker)}catch(e){console.error(`WorkerPoolManager: onWorkerError threw:`,e)}else console.error(`Worker error:`,n,t);let{pendingSetupRequestId:i}=t;if(e.startup==null||i==null)return;let a=this.activeTaskById.get(i);if(a==null||!(`reject`in a))return;let o=bi(n);r!=null&&ar(o),this.cleanWorkerAndTask(t,a),a.reject(o)}drainQueue=()=>{if(this._queuedDrain=void 0,this.readyWorkerCount!==0&&this.queuedTasks.length!==0){for(let e=0;e<this.queuedTasks.length;){let t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}let n=gi(t.request),r=this.getAvailableWorker(n);if(r==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){let n=this.getFileResultCache(t);rn(t)||n!=null&&Qt(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:`file`,file:t})}primeFileHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(Error(`WorkerPoolManager.primeFileHighlightCache: worker pool is not working`));if(!this.shouldPrimeFileHighlightCache(e))return Promise.resolve();if(this.shouldHighlightOnMainThread(e)){let t=this.getFileRenderOptions();return this.primeHighlightCacheOnMainThread(gi({type:`file`,file:e}),t.theme,n=>this.setFileResultCache(e.cacheKey,{result:$n(e,n,t),options:t}))}let t=this.getOrCreateFileHighlightCacheTask(e);return t==null?Promise.resolve():this.createRenderTaskCallbacks(t)}shouldPrimeFileHighlightCache(e){if(e.cacheKey==null)return console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`),!1;let t=this.getFileResultCache(e);return!rn(e)&&(t==null||!Qt(t.options,this.getFileRenderOptions()))}getOrCreateFileHighlightCacheTask(e){let t=this.getFileHighlightKey(e);if(t==null)return;let n=this.getTaskByHighlightKey(t);if(n!=null){if(n.type!==`file`)throw Error(`WorkerPoolManager.getOrCreateFileHighlightCacheTask: Invalid task type`);return n.primeCache=!0,n}{let n=this.submitCacheTask({type:`file`,file:e},t);if(n.type!==`file`)throw Error(`WorkerPoolManager.getOrCreateFileHighlightCacheTask: Invalid task created`);return n}}getPlainFileAST(e,t,n,r){let i=z({theme:this.renderOptions.theme});if(i==null)this.queueInitialization();else return $n(e,i,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){let n=this.getDiffResultCache(t);dr(t)||n!=null&&ur(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:`diff`,diff:t})}primeDiffHighlightCache(e){if(!this.isWorkingPool())return Promise.reject(Error(`WorkerPoolManager.primeDiffHighlightCache: worker pool is not working`));if(!this.shouldPrimeDiffHighlightCache(e))return Promise.resolve();if(this.shouldHighlightOnMainThread(e)){let t=this.getDiffRenderOptions();return this.primeHighlightCacheOnMainThread(gi({type:`diff`,diff:e}),t.theme,n=>this.setDiffResultCache(e.cacheKey,{result:Wr(e,n,t),options:t}))}let t=this.getOrCreateDiffHighlightCacheTask(e);return t==null?Promise.resolve():this.createRenderTaskCallbacks(t)}shouldPrimeDiffHighlightCache(e){if(e.cacheKey==null)return console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`),!1;let t=this.getDiffResultCache(e);return!dr(e)&&(t==null||!ur(t.options,this.getDiffRenderOptions()))}primeHighlightCacheOnMainThread(e,t,n){function r(){let r=z({theme:t,langs:e});return r!=null&&n(r)}if(r())return Promise.resolve();let{lifecycleGeneration:i}=this;return this.loadSharedHighlighter(L(t),[`text`,...e]).then(()=>{if(!this.isCurrentLifecycle(i))throw new nr;if(!r())throw new rr})}getOrCreateDiffHighlightCacheTask(e){let t=this.getDiffHighlightKey(e);if(t==null)return;let n=this.getTaskByHighlightKey(t);if(n!=null){if(n.type!==`diff`)throw Error(`WorkerPoolManager.getOrCreateDiffHighlightCacheTask: Invalid task type`);return n.primeCache=!0,n}{let n=this.submitCacheTask({type:`diff`,diff:e},t);if(n.type!==`diff`)throw Error(`WorkerPoolManager.getOrCreateDiffHighlightCacheTask: Invalid task created`);return n}}getPlainDiffAST(e,t,n,r,i){let a=z({theme:this.renderOptions.theme});if(a==null)this.queueInitialization();else return Wr(e,a,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i})}terminate(){this.lifecycleGeneration++;let e=new nr;this.terminated=!0,this.readyWorkerCount=0,this.workerSlotsExhausted=!1,this.initialization?.state===`pending`&&(this.initialization.stopThemeWait?.(),this.initialization.resolve()),this.initialization=void 0;for(let t of this.workerSlots)this.settleWorkerStartup(t),this.retireWorker(t,e);this.workerSlots.length=0,this.resolvedWorkerThemes.length=0,this.resolvedWorkerLanguages.length=0;for(let t of this.removeAllQueuedRenderTasks())this.rejectRenderTaskCallbacks(t,e);for(let t of this.activeTaskById.values())`reject`in t?t.reject(e):Y(t)&&this.rejectRenderTaskCallbacks(t,e);this.fileCache.clear(),this.diffCache.clear(),this.failedHighlightKeys.clear(),this.activeRequestByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}initializeIfNeeded(){this.initialization??this.queueInitialization()}queueInitialization(e){this.initialization?.state!==`failed`&&this.initialize(e).catch(e=>{sr(e)||console.error(e)})}removeAllQueuedRenderTasks(){let{queuedTasks:e}=this;this.queuedTasks=[],this.queuedTaskByInstance.clear();for(let t of e)this.clearHighlightKey(t);return e}getStats(){let e=this.initialization?.state,t=0,n=0,r=0,i=0;for(let{state:e,worker:a}of this.workerSlots)switch(a!=null&&(t++,(a.requestId!=null||a.pendingSetupRequestId!=null)&&n++),e){case`retrying`:r++;break;case`failed`:i++}return{managerState:e===`succeeded`?`initialized`:e===`pending`?`initializing`:`waiting`,configuredWorkers:this.configuredWorkers,totalWorkers:t,readyWorkers:this.readyWorkerCount,retryingWorkerSlots:r,failedWorkerSlots:i,workersFailed:this.workerSlotsExhausted,busyWorkers:n,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){if(this.shouldUseLocalFallback())return;this.initializeIfNeeded();let n=this.getHighlightKeyForRequest(t),r=n==null?void 0:this.getTaskByHighlightKey(n);if(r!=null){this.detachInstanceFromQueuedTasks(e,r),this.addInstanceToTask(r,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);let i=this.generateRequestId(),a=Date.now(),{renderOptionsVersion:o}=this,s=(()=>{switch(t.type){case`file`:return{type:`file`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:o,requestStart:a};case`diff`:return{type:`diff`,id:i,request:{...t,id:i},instances:new Set([e]),primeCache:!1,highlightKey:n,callbacks:new Set,renderOptionsVersion:o,requestStart:a}}})();this.enqueueRenderTask(s,e)}submitCacheTask(e,t){this.initializeIfNeeded();let n=this.generateRequestId(),r=Date.now(),{renderOptionsVersion:i}=this,a=(()=>{switch(e.type){case`file`:return{type:`file`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:r};case`diff`:return{type:`diff`,id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,callbacks:new Set,renderOptionsVersion:i,requestStart:r}}})();return this.enqueueRenderTask(a),a}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}resolveWorkerLanguages(e){return this.preferredHighlighter===`highlights`?ni(e):Jr(e)?qr(e):Zr(e)}async resolveLanguagesAndExecuteTask(e,t,n){try{let r=z(),i=n.filter(e=>r==null||!Zt(e,r));i.length>0&&this.loadSharedHighlighter(L(this.renderOptions.theme),[`text`,...i]).catch(e=>{console.error(e)});let a=n.filter(t=>!e.langs.has(t)&&(this.preferredHighlighter!==`highlights`||Dt.has(t)));if(a.length>0){let e=this.resolveWorkerLanguages(a);t.request.resolvedLanguages=Array.isArray(e)?e:await e}if(!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch(n){this.notifyHighlightError(t,n),this.rejectRenderTaskCallbacks(t,vi(n)),this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){let n=this.activeTaskById.get(t.id);try{if(n==null)throw fi;if(t.type===`error`){let e=Error(t.error);if(t.stack&&(e.stack=t.stack),`reject`in n)n.reject(e);else if(Y(n))this.notifyHighlightError(n,e),this.rejectRenderTaskCallbacks(n,e);else throw Error(`handleWorkerMessage: unknown task type`);throw e}if(Y(n))for(let{name:t}of n.request.resolvedLanguages??[])e.langs.add(t);switch(t.requestType){case`initialize`:if(n.type!==`initialize`)throw Error(`handleWorkerMessage: task/response dont match`);this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case`set-render-options`:if(n.type!==`set-render-options`)throw Error(`handleWorkerMessage: task/response dont match`);n.resolve();break;case`file`:{if(n.type!==`file`)throw Error(`handleWorkerMessage: task/response dont match`);let{options:r}=t;if(!this.isCurrentRenderTask(n)||!Qt(r,this.getFileRenderOptions()))throw fi;let{request:i}=n,a={...t.result,code:ui(t.result.code)};this.syncCustomExtensionVersion(e,i),n.cacheKeyAtDispatch!=null&&this.fileCache.set(n.cacheKeyAtDispatch,{result:a,options:r}),this.resolveRenderTaskCallbacks(n),this.notifyFileInstances(n,a,r);break}case`diff`:{if(n.type!==`diff`)throw Error(`handleWorkerMessage: task/response dont match`);let{options:r}=t;if(!this.isCurrentRenderTask(n)||!ur(r,this.getDiffRenderOptions()))throw fi;let{request:i}=n,a={...t.result,code:{deletionLines:ui(t.result.code.deletionLines),additionLines:ui(t.result.code.additionLines)}};this.syncCustomExtensionVersion(e,i),n.cacheKeyAtDispatch!=null&&this.diffCache.set(n.cacheKeyAtDispatch,{result:a,options:r}),this.resolveRenderTaskCallbacks(n),this.notifyDiffInstances(n,a,r);break}}}catch(e){e!==fi&&console.error(e,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain??(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(Y(t)&&(this.rejectRenderTaskCallbacks(t,new rr),this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){hi(t.request)&&this.maybeAttachCustomExtensions(e,t.request);try{t.type===`file`?t.cacheKeyAtDispatch=t.request.file.cacheKey:t.type===`diff`&&(t.cacheKeyAtDispatch=t.request.diff.cacheKey),e.worker.postMessage(t.request)}catch(n){console.error(`Failed to post message to worker:`,n),Y(t)?(this.notifyHighlightError(t,n),this.rejectRenderTaskCallbacks(t,vi(n))):`reject`in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;let n=tn();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=nn())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(let{state:n,worker:r}of this.workerSlots){if(n!==`ready`||r==null||r.requestId!=null||r.pendingSetupRequestId!=null||r.renderOptionsVersion!==this.renderOptionsVersion)continue;if(t=r,e.length===0)break;let i=!0;for(let t of e)if(!r.langs.has(t)&&(this.preferredHighlighter!==`highlights`||Dt.has(t))){i=!1;break}if(i)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case`file`:return this.getFileHighlightKey(e.file);case`diff`:return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(let t of _i(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){let n=this.queuedTaskByInstance.get(e);n!=null&&n!==t&&(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){let t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.rejectRenderTaskCallbacks(e,new rr),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.rejectRenderTaskCallbacks(e,new rr),this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}createRenderTaskCallbacks(e){return new Promise((t,n)=>{e.callbacks.add({resolve:t,reject:n})})}resolveRenderTaskCallbacks(e){e.highlightKey!=null&&this.failedHighlightKeys.delete(e.highlightKey);for(let t of e.callbacks)t.resolve();e.callbacks.clear()}rejectRenderTaskCallbacks(e,t){for(let n of e.callbacks)n.reject(t);e.callbacks.clear()}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){let t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(let e of Array.from(this.activeTaskById.values()))Y(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(let t of _i(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(let t of _i(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(let t of _i(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(let r of e.instances)this.activeRequestByInstance.get(r)===e.id&&r.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){e.highlightKey!=null&&this.failedHighlightKeys.set(e.highlightKey,!0);for(let n of _i(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`file`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&lr(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(let n of this.iterateRenderTasks())if(n.type===`diff`&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&cr(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){let t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(let e of this.queuedTasks)yield e;for(let e of this.activeTaskById.values())Y(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function hi(e){return e.type===`initialize`||e.type===`file`||e.type===`diff`}function gi(e){let t=new Set;switch(e.type){case`file`:t.add(e.file.lang??H(e.file.name));break;case`diff`:t.add(e.diff.lang??H(e.diff.name)),t.add(e.diff.lang??H(e.diff.prevName??`-`))}return t.delete(`text`),Array.from(t)}function Y(e){return e?.type===`file`||e?.type===`diff`}function _i(e){return e.instances}function vi(e){if(e instanceof Error)return e;if(typeof e==`object`&&e){if(`error`in e&&e.error instanceof Error)return e.error;if(`message`in e&&typeof e.message==`string`)return Error(e.message)}return Error(String(e))}function yi(e){return e instanceof q?e:new q(vi(e).message,{cause:e})}function bi(e){let t=`error`in e?e.error:void 0;return new q(`WorkerPoolManager: worker failed: ${`message`in e&&typeof e.message==`string`&&e.message!==``?e.message:t instanceof Error?t.message:`the worker script failed to load (the error event carries no message)`}`,t instanceof Error?{cause:t}:void 0)}var xi;function Si({poolOptions:e,highlighterOptions:t}){return xi??=new mi(e,t),xi}function Ci(){xi!=null&&(xi.terminate(),xi=void 0)}var X=Fe(),wi=(0,P.createContext)(void 0),Ti=0;function Ei({children:e,poolOptions:t,highlighterOptions:n}){let[r]=(0,P.useState)(()=>{if(typeof window<`u`)return Si({poolOptions:t,highlighterOptions:n})});return(0,P.useInsertionEffect)(()=>{if(r!=null)return Ti++,()=>{Ti--}},[r]),(0,P.useEffect)(()=>()=>{Ti===0&&Ci()},[]),(0,X.jsx)(wi.Provider,{value:r,children:e})}function Di(e,t,n=`textmate`){let r=Lt.get(e)??{};r[n]==null?(r[n]=t,Lt.set(e,r)):console.error(`SharedHighlight.registerCustomTheme: theme name and type already registered`,e,n)}function Oi(e){return new Worker(`/assets/worker-B--T_fs_.js`,{type:`module`,name:e?.name})}var ki={dark:`pierre-dark`,light:`pierre-light`},Ai=`
9
+ :host {
10
+ --diffs-dark-bg: #131313;
11
+ --diffs-light-bg: #ffffff;
12
+ --diffs-header-font-family: var(--font-sans, system-ui, sans-serif);
13
+ --diffs-bg-separator-override: light-dark(#f6f6f7, #191919);
14
+ --diffs-addition-color-override: light-dark(#13784f, #7ee2b8);
15
+ --diffs-deletion-color-override: light-dark(#c23434, #ff8a8a);
16
+ }
17
+ [data-separator-content],
18
+ [data-expand-button] {
19
+ font-size: 12px;
20
+ }
21
+ /* The comment \`+\` sits just past the line numbers (over the code's first columns, as on
22
+ GitHub), so the whole number column stays a target for selecting lines. */
23
+ [data-gutter-utility-slot] {
24
+ right: -22px;
25
+ }
26
+ `;Di(ki.dark,(()=>A(()=>import(`./pierre-dark-DMS-zpcK.js`),[])),`textmate`),Di(ki.light,(()=>A(()=>import(`./pierre-light-BHq6aQNU.js`),[])),`textmate`);var ji={workerFactory:()=>new Oi({name:`azdiffs-highlighter`})},Mi={theme:ki,preferredHighlighter:`shiki-js`};function Ni({children:e}){return(0,X.jsx)(Ei,{poolOptions:ji,highlighterOptions:Mi,children:e})}var Pi=/^( {0,3})(`{3,}|~{3,})(.*)$/;function Fi(e){let t=e.replace(/\r\n?/g,`
27
+ `).split(`
28
+ `),n=[],r=0;for(;r<t.length;){let e=Pi.exec(t[r]??``);if(r++,e===null)continue;let i=(e[1]??``).length,a=e[2]??"```",o=(e[3]??``).trim();if(a.startsWith("`")&&o.includes("`"))continue;let s=RegExp(`^ {0,3}${a[0]==="`"?"`":`~`}{${a.length},}\\s*$`),c=[];for(;r<t.length&&!s.test(t[r]??``);)c.push(Ii(t[r]??``,i)),r++;r++,o.split(/\s+/)[0]?.toLowerCase()===`suggestion`&&n.push({lines:c})}return n}function Ii(e,t){let n=0;for(;n<t&&e[n]===` `;)n++;return e.slice(n)}function Li(e){let t=e.replace(/\r\n?/g,`
29
+ `);return t.length===0?[]:t.replace(/\n$/,``).split(`
30
+ `)}function Ri(e){return e.map(e=>`${e}\n`).join(``)}function zi(e){let t=0;for(let n of e){let e=/^ {0,3}(`{3,})/.exec(n)?.[1]?.length??0;t=Math.max(t,e)}let n="`".repeat(Math.max(3,t+1)),r=`${n}suggestion\n`,i=e.join(`
31
+ `);return{text:`${r}${i}\n${n}`,innerStart:r.length,innerEnd:r.length+i.length}}function Bi(e,t){return[...e.map(e=>({kind:`removed`,text:e})),...t.map(e=>({kind:`added`,text:e}))]}var Vi=[239,187,191];function Hi(e){if(e.includes(0))return{ok:!1,reason:`not-text`};let t=Vi.every((t,n)=>e[n]===t),n;try{n=new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}).decode(t?e.subarray(3):e)}catch{return{ok:!1,reason:`not-text`}}let r=n.match(/\r\n/g)?.length??0,i=(n.match(/\n/g)?.length??0)-r,a=r>0&&r>=i?`\r
32
+ `:`
33
+ `,o=n.endsWith(`
34
+ `),s=o?n.replace(/\r?\n$/,``):n;return{ok:!0,file:{lines:n.length===0?[]:s.split(/\r?\n/),bom:t,eol:a,finalNewline:o}}}function Ui(e){let t=e.lines.length===0?``:`${e.lines.join(e.eol)}${e.finalNewline?e.eol:``}`,n=new TextEncoder().encode(t);if(!e.bom)return n;let r=new Uint8Array(n.length+3);return r.set(Vi,0),r.set(n,3),r}function Wi(e,t,n,r){let i=Hi(e);if(!i.ok)return i;let{file:a}=i;if(!Number.isInteger(t)||!Number.isInteger(n)||t<1||n<t||n>a.lines.length)return{ok:!1,reason:`out-of-range`};let o=Li(r),s=[...a.lines.slice(0,t-1),...o,...a.lines.slice(n)];return{ok:!0,bytes:Ui({...a,lines:s})}}function Gi(e,t,n){return t<1||n<t||n>e.lines.length?null:e.lines.slice(t-1,n)}function Ki(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function qi(e){let t=``,n=32768;for(let r=0;r<e.length;r+=n)t+=String.fromCharCode(...e.subarray(r,r+n));return btoa(t)}function Ji(e){return`Apply suggestion from ${e.reviewer}\n\nPull request #${e.pullRequestId}, thread ${e.threadId}`}var Yi={all:e=>[`pr-conflicts`,`list`,e.organization.toLowerCase(),e.repositoryId,e.pullRequestId],list:(e,t,n)=>[...Yi.all(e),t,n],blob:(e,t)=>[`pr-conflicts`,`blob`,e.organization.toLowerCase(),e.repositoryId,t]};function Xi(e,t,n=!0){return N({queryKey:Yi.list(e,t.lastMergeSourceCommit,t.lastMergeTargetCommit),queryFn:({signal:t})=>p(O(e.organization),{project:e.project,repositoryId:e.repositoryId,pullRequestId:e.pullRequestId,signal:t}),enabled:n&&t.status===`active`,retry:j})}function Zi(e){if(e.byteLength>8388608)return{kind:`too-large`,size:e.byteLength};let t=Hi(e);return t.ok?{kind:`text`,file:t.file,bytes:e}:{kind:`not-text`,size:e.byteLength}}function Qi(e,t){return{queryKey:Yi.blob(e,t),queryFn:async({signal:n})=>{let{bytes:r}=await Ue(O(e.organization),{project:e.project,repositoryId:e.repositoryId,objectId:t,signal:n});return Zi(new Uint8Array(r))},staleTime:1/0}}function $i(e,t){return N({...Qi(e,t??``),enabled:t!==null,gcTime:18e5,retry:j})}function ea(e){let t=e.filter(e=>e.kind!==`unsupported`),n=t.filter(e=>e.resolutionStatus===`resolved`),r=e.filter(e=>e.kind===`unsupported`&&e.resolutionStatus!==`resolved`);return{total:e.length,resolved:n.length+(e.length-t.length-r.length),unresolved:e.filter(e=>e.resolutionStatus!==`resolved`).length,unsupported:r.length,done:e.every(e=>e.resolutionStatus===`resolved`),anyResolved:e.some(e=>e.resolutionStatus===`resolved`)}}function ta(e){let t=new Set(e.split(`,`).map(e=>e.trim().toLowerCase()).filter(e=>e.length>0));return t.has(`delete`)&&!t.has(`undelete`)?`deleted`:t.has(`add`)||t.has(`undelete`)?`added`:t.has(`rename`)||t.has(`sourcerename`)||t.has(`targetrename`)?`renamed`:`modified`}function na(e){return e.replace(/^\/+/,``)}function ra(e){return e.startsWith(`/`)?e:`/${e}`}function ia(e){let t=na(e.path);if(t.length===0)return null;let n=ta(e.changeType),r=e.originalPath===null?null:na(e.originalPath);n===`renamed`&&(r===null||r===t)&&(n=`modified`);let i={path:t,change:n,changeTrackingId:e.changeTrackingId};if(n===`renamed`&&r!==null&&(i.originalPath=r),n===`deleted`){let t=e.originalObjectId??e.objectId;return t!==null&&(i.originalObjectId=t),i}if(e.objectId!==null)i.objectId=e.objectId;else return null;return n!==`added`&&e.originalObjectId!==null&&(i.originalObjectId=e.originalObjectId),i}function aa({baseCommit:e,targetCommit:t,entries:n}){let r=new Map;for(let e of n){let t=ia(e);t!==null&&!r.has(t.path)&&r.set(t.path,t)}return{baseCommit:e,targetCommit:t,files:[...r.values()].sort((e,t)=>la(e.path,t.path))}}function oa(e){return e.match(/\d+|\D+/g)?.map(e=>/^\d/.test(e)?Number(e):e)??[``]}function sa(e,t){let n=oa(e.toLowerCase()),r=oa(t.toLowerCase());for(let e=0;e<Math.min(n.length,r.length);e++){let t=n[e],i=r[e];if(t!==i)return typeof t==`number`&&typeof i==`number`?t<i?-1:1:String(t)<String(i)?-1:1}if(n.length!==r.length)return n.length<r.length?-1:1;let i=e.toLowerCase(),a=t.toLowerCase();return i===a?e===t?0:e<t?-1:1:i<a?-1:1}function ca(e,t){return e.isDirectory===t.isDirectory?sa(e.name,t.name):e.isDirectory?-1:1}function la(e,t){let n=e.split(`/`),r=t.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=n[e]??``,i=r[e]??``;if(t!==i)return ca({name:t,isDirectory:e<n.length-1},{name:i,isDirectory:e<r.length-1})}return n.length-r.length}var ua=e=>[e.organization.toLowerCase(),e.repositoryId,e.pullRequestId],da={iterations:e=>[`pr-files`,`iterations`,...ua(e)],changes:(e,t,n)=>[`pr-files`,`changes`,...ua(e),t,n],threads:(e,t,n)=>[`pr-files`,`threads`,...ua(e),t,n],allThreads:e=>[`pr-files`,`threads`,...ua(e)],content:(e,t)=>[`pr-files`,`content`,e.organization.toLowerCase(),e.repositoryId,t]};function fa(e,t){return{project:e.project,repositoryId:e.repositoryId,pullRequestId:e.pullRequestId,signal:t}}function pa(e){return N({queryKey:e===null?[`pr-files`,`iterations`,`none`]:da.iterations(e),queryFn:({signal:t})=>fe(O(e?.organization??null),fa(e,t)),enabled:e!==null,retry:j})}function ma(e){return e.since===null?e.iteration.commonCommit:e.since.sourceCommit}function ha(e,t){let n=t?.since?.id??0,r=t?.iteration.id??0;return N({queryKey:e===null||t===null?[`pr-files`,`changes`,`none`]:da.changes(e,r,n),queryFn:async({signal:i})=>{let a=t,o=await le(O(e.organization),{...fa(e,i),iterationId:r,compareTo:n});return aa({baseCommit:ma(a),targetCommit:a.iteration.sourceCommit,entries:o})},enabled:e!==null&&t!==null,staleTime:1/0,retry:j})}var ga=6e4;function _a(e,t){let n=t?.since?.id??0,r=t?.iteration.id??0;return N({queryKey:e===null||t===null?[`pr-files`,`threads`,`none`]:da.threads(e,r,n),queryFn:({signal:t})=>Ne(O(e.organization),{...fa(e,t),iteration:r,...n>0?{baseIteration:n}:{}}),enabled:e!==null&&t!==null,refetchOnWindowFocus:`always`,refetchInterval:ga,refetchIntervalInBackground:!1,retry:j})}var va=`Your token may be missing Code: Read & write.`;function ya(e,t){if(xe(e)||M(e,`unauthorized`))return{kind:`sign-in`};if(M(e,`forbidden`)){let e=`Your account does not have permission to do this in ${t.repository}.`;return{kind:`message`,message:t.method===`pat`?`${e} ${va}`:e}}return M(e,`rate-limited`)?{kind:`message`,message:`Azure DevOps is throttling requests. Your text is kept; try again in a moment.`}:M(e,`network`)?{kind:`message`,message:`Could not reach Azure DevOps. Your text is kept; try again.`}:M(e,`not-found`)?{kind:`message`,message:`Azure DevOps no longer has this (it may have been deleted). Reload to see the latest.`}:{kind:`message`,message:`Azure DevOps refused this: ${e instanceof Error?e.message:`Unknown error`}`}}var ba={detail:e=>[`pull-request`,e.organization.toLowerCase(),e.project,e.pullRequestId]},xa=6e4;function Sa(e){return N({queryKey:ba.detail(e),queryFn:({signal:t})=>v(O(e.organization),{project:e.project,pullRequestId:e.pullRequestId,signal:t}),refetchOnWindowFocus:`always`,refetchInterval:xa,refetchIntervalInBackground:!1,retry:j})}var Z=`/$organization/$project/_git/$repository/pullrequest/$pullRequestId`,Q=`/$organization/_git/$repository/pullrequest/$pullRequestId`,Ca={long:{overview:Z,discussion:Z,files:`${Z}/files`,commits:`${Z}/commits`,commit:`${Z}/commits/$commitId`,conflicts:`${Z}/conflicts`,"files-commits":`${Z}/files`},short:{overview:Q,discussion:Q,files:`${Q}/files`,commits:`${Q}/commits`,commit:`${Q}/commits/$commitId`,conflicts:`${Q}/conflicts`,"files-commits":`${Q}/files`}};function wa(e){return e.tab===`discussion`?{section:`discussion`}:e.tab===`files-commits`?{panel:`commits`}:e.tab===`conflicts`&&e.file!==void 0?{file:e.file}:{}}function Ta(e,t,n){let r=t?Ca.short:Ca.long,i={organization:e.organization,project:e.project,repository:e.repository,pullRequestId:e.pullRequestId,...n.tab===`commit`?{commitId:n.commitId}:{}};return{to:r[n.tab],params:i,search:wa(n)}}function Ea({location:e,shortForm:t,page:n,className:r,children:i,activeExact:a=!1,keepSearch:o=!1,onClick:s,testId:c,current:l,title:u}){let{to:d,params:f,search:p}=Ta(e,t,n);return(0,X.jsx)(_,{to:d,params:f,search:o?e=>e:p,...r===void 0?{}:{className:r},...s===void 0?{}:{onClick:s},...c===void 0?{}:{"data-testid":c},...u===void 0?{}:{title:u},...l===void 0?{activeOptions:{exact:a,includeSearch:!1},activeProps:{"aria-current":`page`}}:{activeOptions:{exact:!0},...l?{"aria-current":`page`}:{}},children:i})}function Da(e,t){let n=te(),{organization:r,project:i,repository:a,pullRequestId:o}=e;return(0,P.useCallback)(e=>{let{to:s,params:c,search:l}=Ta({organization:r,project:i,repository:a,pullRequestId:o},t,e);n({to:s,params:c,search:l})},[n,r,i,a,o,t])}function Oa({href:e,children:t,className:n=`text-accent hover:underline`}){return(0,X.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,className:n,children:t})}var ka=e=>[e.organization.toLowerCase(),e.repositoryId,e.pullRequestId],Aa={list:e=>[`pr-commits`,`list`,...ka(e)],diff:(e,t)=>[`pr-commits`,`diff`,e.organization.toLowerCase(),e.repositoryId,t]};function ja(e){return He({queryKey:e===null?[`pr-commits`,`list`,`none`]:Aa.list(e),queryFn:({signal:t,pageParam:n})=>{let r=e;return ue(O(r.organization),{project:r.project,repositoryId:r.repositoryId,pullRequestId:r.pullRequestId,top:50,continuationToken:n,signal:t})},initialPageParam:null,getNextPageParam:e=>e.continuationToken??void 0,enabled:e!==null,retry:j})}function Ma(e,t){return N({queryKey:Aa.diff(e,t),queryFn:async({signal:n})=>{let r=O(e.organization),i={project:e.project,repositoryId:e.repositoryId,signal:n},[a,o]=await Promise.all([Oe(r,{...i,commitId:t}),h(r,{...i,commitId:t})]),s=a.parents[0]??null;return{commit:a,changeSet:aa({baseCommit:s,targetCommit:a.commitId,entries:s===null?o.map(e=>/delete/i.test(e.changeType)?e:{...e,changeType:`add`}):o})}},staleTime:1/0,retry:j})}function Na(e){return e.split(`
35
+ `).find(e=>e.trim().length>0)?.trim()??``}function Pa(e){return e.slice(0,7)}var Fa=[{keys:`j / k`,description:`Next / previous file`},{keys:`n / p`,description:`Next / previous comment thread`},{keys:`c`,description:`Comment on the selected lines (or the first change of the current file)`},{keys:`v`,description:`Mark the current file viewed (collapses it), or not`},{keys:`x`,description:`Collapse / expand the current file`},{keys:`s`,description:`Split / unified layout`},{keys:`w`,description:`Wrap / scroll long lines`},{keys:`t`,description:`Filter files`},{keys:`⌘F / Ctrl+F`,description:`Search in the diff`},{keys:`⌘K / Ctrl+K`,description:`Go to another pull request`},{keys:`g o / g f / g c`,description:`Overview / review changes / commits`},{keys:`g x`,description:`Conflicts (when the pull request has any)`},{keys:`?`,description:`Show these shortcuts`}],Ia=[{keys:`j / k`,description:`Next / previous file`},{keys:`n / p`,description:`Next / previous conflict`},{keys:`c`,description:`Combine both changes (when they touch different lines)`},{keys:`1 / 2 / 3`,description:`Use this pull request / the target / both`},{keys:`space`,description:`Pick the focused line`},{keys:`e`,description:`Edit the result of the conflict`},{keys:`o`,description:`Show / hide the original lines`},{keys:`⌘↵ / Ctrl+↵`,description:`Mark the file resolved`},{keys:`⌘Z / Ctrl+Z`,description:`Undo the last choice`},{keys:`g o / g f / g x`,description:`Overview / review changes / conflicts`},{keys:`?`,description:`Show these shortcuts`}];function La(e){let t=e.composedPath()[0]??e.target;if(!(t instanceof HTMLElement))return!1;if(t.isContentEditable)return!0;let n=t.tagName;if(n===`TEXTAREA`||n===`SELECT`)return!0;if(n!==`INPUT`)return!1;let r=t.type;return![`checkbox`,`radio`,`button`,`submit`,`reset`,`range`,`color`].includes(r)}function Ra(e,t=!0){let n=(0,P.useRef)(e);n.current=e,(0,P.useEffect)(()=>{if(!t)return;let e=e=>{if(e.defaultPrevented||e.repeat&&e.key===`?`||e.ctrlKey||e.metaKey||e.altKey||La(e))return;let t=n.current[e.key];t!==void 0&&(e.preventDefault(),t())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t])}function za(e){return Array.from(e?.querySelectorAll(`[data-menu-item]`)??[])}function Ba(e,t,n){let r=(0,P.useRef)(n);r.current=n,(0,P.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target;t.some(e=>e.current?.contains(n))||r.current()};return document.addEventListener(`pointerdown`,n),()=>document.removeEventListener(`pointerdown`,n)},[e,t])}var Va=`flex w-full items-center gap-2 rounded-[6px] px-2 py-1.5 text-left text-[13px] text-fg outline-none hover:bg-hover focus:bg-hover focus-visible:outline-none aria-disabled:cursor-not-allowed aria-disabled:text-muted aria-disabled:hover:bg-transparent`;function Ha({label:e,entries:t,align:n=`end`,trigger:r,onOpenChange:i}){let[a,o]=(0,P.useState)(!1),s=(0,P.useRef)(null),c=(0,P.useRef)(null),l=(0,P.useId)(),u=e=>{o(e),i?.(e)};Ba(a,[s,c],()=>u(!1));let d=()=>za(c.current);(0,P.useEffect)(()=>{if(!a)return;let e=za(c.current),t=e.find(e=>e.getAttribute(`aria-checked`)===`true`),n=e.find(e=>e.getAttribute(`aria-disabled`)!==`true`);(t??n??e[0])?.focus()},[a]);let f=e=>{u(!1),e&&s.current?.focus()};return(0,X.jsxs)(`div`,{className:`relative inline-flex`,children:[r({ref:s,"aria-haspopup":`menu`,"aria-expanded":a,"aria-controls":a?l:void 0,onClick:()=>u(!a),onKeyDown:e=>{e.key!==`ArrowDown`&&e.key!==`ArrowUp`||a||(e.preventDefault(),u(!0))}}),a&&(0,X.jsx)(`div`,{ref:c,id:l,role:`menu`,"aria-label":e,tabIndex:-1,onKeyDown:e=>{let t=d(),n=t.indexOf(document.activeElement),r=null;if(e.key===`ArrowDown`)r=(n+1)%t.length;else if(e.key===`ArrowUp`)r=(n-1+t.length)%t.length;else if(e.key===`Home`)r=0;else if(e.key===`End`)r=t.length-1;else if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),f(!0);return}else if(e.key===`Tab`){f(!1);return}r!==null&&(e.preventDefault(),t[r]?.focus())},className:`absolute top-[calc(100%+6px)] ${n===`end`?`right-0`:`left-0`} z-50 min-w-48 rounded-[10px] border border-border bg-surface p-1 shadow-[var(--azd-shadow)]`,children:t.map((e,t)=>{let n=`${t}`;if(e.kind===`separator`)return(0,X.jsx)(`hr`,{className:`my-1 border-border`},n);if(e.kind===`heading`)return(0,X.jsx)(`p`,{className:`px-2 pt-1.5 pb-1 text-xs text-muted`,"aria-hidden":`true`,children:e.label},n);let r=e.disabled===!0,i=()=>{r||(f(!0),e.onSelect())};return e.kind===`radio`?(0,X.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.checked,"aria-disabled":r,tabIndex:-1,"data-menu-item":``,onClick:i,className:Va,...e.testId===void 0?{}:{"data-testid":e.testId},children:[(0,X.jsx)(`span`,{className:`flex w-4 justify-center text-fg`,children:e.checked&&(0,X.jsx)(je,{className:`size-3.5`})}),e.label]},n):(0,X.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-disabled":r,tabIndex:-1,"data-menu-item":``,onClick:i,className:`${Va} ${e.danger===!0?`text-danger`:``}`,...e.testId===void 0?{}:{"data-testid":e.testId},children:[e.icon!==void 0&&(0,X.jsx)(`span`,{className:`flex w-4 justify-center text-muted`,children:e.icon}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label}),e.hint!==void 0&&(0,X.jsx)(`span`,{className:`text-xs text-muted`,children:e.hint})]},n)})})]})}function Ua({label:e,trigger:t,children:n,align:r=`end`,testId:i}){let[a,o]=(0,P.useState)(!1),s=(0,P.useRef)(null),c=(0,P.useRef)(null),l=(0,P.useId)();return Ba(a,[s,c],()=>o(!1)),(0,P.useEffect)(()=>{a&&(c.current?.querySelector(`input:not([disabled]), select:not([disabled]), button:not([disabled])[tabindex="0"], button:not([disabled]):not([tabindex])`))?.focus()},[a]),(0,X.jsxs)(`div`,{className:`relative inline-flex`,children:[t({ref:s,"aria-expanded":a,"aria-controls":a?l:void 0,"aria-haspopup":`dialog`,onClick:()=>o(e=>!e)}),a&&(0,X.jsx)(`div`,{ref:c,id:l,role:`dialog`,"aria-label":e,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),o(!1),s.current?.focus())},className:`absolute top-[calc(100%+6px)] ${r===`end`?`right-0`:`left-0`} z-50 w-72 rounded-[10px] border border-border bg-surface p-3 shadow-[var(--azd-shadow)]`,...i===void 0?{}:{"data-testid":i},children:n})]})}var Wa=2e3,Ga={conflicts:`The merge has conflicts with the target branch.`,failure:`Azure DevOps could not merge the pull request.`,rejectedByPolicy:`A branch policy rejected the merge.`};function Ka(e){if(e.status===`completed`)return{kind:`merged`};if(e.status===`abandoned`)return{kind:`failed`,reason:`The pull request was abandoned.`};let t=Ga[e.mergeStatus];return t===void 0?{kind:`pending`}:{kind:`failed`,reason:e.mergeFailureMessage===null?t:`${t} ${e.mergeFailureMessage}`}}var qa=`New changes were pushed. Review them, then complete.`;function Ja(e){return e.slice(0,7)}var Ya={"resolve-conflicts":`Resolve conflicts`,complete:`Complete`,"set-auto-complete":`Set auto-complete`,"cancel-auto-complete":`Cancel auto-complete`,abandon:`Abandon`,reactivate:`Reactivate`},Xa=(e,t)=>t!==null&&e.toLowerCase()===t.toLowerCase();function Za(e){return e.filter(e=>e.blocking&&e.state!==`passed`)}function Qa({pullRequest:e,checks:t,currentUserId:n,conflictCount:r=null}){if(e.status===`completed`)return{primary:null,secondary:[]};if(e.status===`abandoned`)return{primary:`reactivate`,secondary:[]};if(e.isDraft)return{primary:null,secondary:[`abandon`],explanation:`This is a draft. Publish it in Azure DevOps before completing it.`};let i=e.autoCompleteSetBy;if(i!==null)return{primary:`cancel-auto-complete`,secondary:[`abandon`],explanation:`Auto-complete set by ${Xa(i.id,n)?`you`:i.displayName.length>0?i.displayName:`someone else`}. It completes once every required check passes.`};if(e.mergeStatus===`conflicts`){let t=e.targetBranch;return{primary:`resolve-conflicts`,secondary:[`abandon`],explanation:r===null||r===0?`This pull request conflicts with ${t}.`:`${r} ${r===1?`file conflicts`:`files conflict`} with ${t}.`}}let a=Za(t);if(a.length>0){let e=a.filter(e=>e.state===`failed`).length,t=a.length-e;return{primary:`set-auto-complete`,secondary:[`abandon`],explanation:`Required checks: ${[e>0?`${e} failing`:null,t>0?`${t} not finished`:null].filter(e=>e!==null).join(`, `)}. Auto-complete merges once they pass.`}}return{primary:`complete`,secondary:[`set-auto-complete`,`abandon`]}}var $a=`require a merge strategy`,eo={noFastForward:`Merge (no fast-forward)`,squash:`Squash commit`,rebase:`Rebase and fast-forward`,rebaseMerge:`Semi-linear merge`},to={noFastForward:`a merge commit (no fast-forward)`,squash:`a squash commit`,rebase:`rebase and fast-forward`,rebaseMerge:`a semi-linear merge`},no={noFastForward:`allowNoFastForward`,squash:`allowSquash`,rebase:`allowRebase`,rebaseMerge:`allowRebaseMerge`};function ro(e){let{type:t,isEnabled:n,isDeleted:r}=e.configuration;return!n||r?!1:t.id.toLowerCase()===`fa4e907d-c16b-4a4c-9dfa-4916e5d171ab`||t.displayName.trim().toLowerCase()===$a}function io(e){let t=ce.map(t=>e[no[t]]);if(t.some(e=>typeof e==`boolean`)){if(t.some(e=>e!==void 0&&typeof e!=`boolean`))return null;let e=ce.filter((e,n)=>t[n]===!0);return e.length>0?e:null}return e.useSquashMerge===!0?[`squash`]:null}function ao(e){let t=[...ce];if(e==null)return t;let n=null;for(let r of e){if(!ro(r))continue;let e=io(r.configuration.settings);if(e===null)return t;n=n===null?e:n.filter(t=>e.includes(t))}return n===null||n.length===0?t:n}function oo(e,t){return t!==null&&e.includes(t)?t:e.includes(`noFastForward`)?`noFastForward`:e[0]??`noFastForward`}var so=[`noFastForward`,`squash`];function co(e,t){return t?e.filter(e=>so.includes(e)):[...e]}function lo({titleId:e,busy:t,onClose:n,testId:r,children:i}){let a=(0,P.useRef)(null);return(0,P.useEffect)(()=>{let e=a.current;return e!==null&&!e.open&&e.showModal(),()=>{e?.open&&e.close()}},[]),(0,X.jsx)(`dialog`,{ref:a,"aria-labelledby":e,onKeyDown:de,onCancel:e=>{e.preventDefault(),t||n()},className:`m-auto w-[min(30rem,calc(100vw-2rem))] rounded-[12px] border border-border bg-surface p-5 text-[14px] text-fg shadow-[var(--azd-shadow)] backdrop:bg-black/50 backdrop:backdrop-blur-[2px]`,"data-testid":r,children:i})}var uo=`azdiffs.merge.deleteSourceBranch:`;function fo(e){try{return window.localStorage.getItem(`${uo}${e}`)===`1`}catch{return!1}}function po(e,t){try{window.localStorage.setItem(`${uo}${e}`,t?`1`:`0`)}catch{}}function mo({mode:e,pullRequest:t,commitId:n,allowed:r,policyRestricts:i,resolutionsRestrict:a=!1,hasWorkItems:o,busy:s,onConfirm:c,onClose:l}){let u=(0,P.useId)(),d=(0,P.useId)(),[p,m]=(0,P.useState)(()=>oo(r,t.completionOptions?.mergeStrategy??null)),[h,_]=(0,P.useState)(()=>fo(t.repository.id)),[v,y]=(0,P.useState)(!1),[b,x]=(0,P.useState)(()=>f(t.pullRequestId,t.title)),S=e===`complete`,C=S&&n===null,w=S&&n!==null&&t.lastMergeSourceCommit!==n,T=r.length===0,ee=t.sourceBranch,E=t.targetBranch,te=e=>{e.preventDefault(),s||w||C||T||(po(t.repository.id,h),c({mergeStrategy:p,deleteSourceBranch:h,transitionWorkItems:o&&v,mergeCommitMessage:g(p)?b:null}))},D=`Merge ${ee} into ${E} with ${to[p]}.`;return(0,X.jsx)(lo,{titleId:u,busy:s,onClose:l,testId:S?`complete-dialog`:`auto-complete-dialog`,children:(0,X.jsxs)(`form`,{onSubmit:te,className:`space-y-4`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{id:u,className:`text-[16px] font-semibold text-fg-strong`,children:S?`Complete pull request`:`Set auto-complete`}),(0,X.jsx)(`p`,{className:`mt-1 text-[13px] text-muted`,children:S?`Merging cannot be undone.`:`Azure DevOps completes the pull request once every required check passes.`})]}),(0,X.jsxs)(`fieldset`,{className:`space-y-1.5`,children:[(0,X.jsx)(`legend`,{className:`mb-1.5 text-xs font-medium text-muted`,children:`Merge type`}),r.map(e=>(0,X.jsxs)(`label`,{className:`flex h-9 items-center gap-2.5 rounded-[8px] border border-border px-3 text-[13px] text-fg hover:bg-hover has-[:checked]:border-border-strong has-[:checked]:bg-[var(--azd-selected)]`,children:[(0,X.jsx)(`input`,{type:`radio`,name:`merge-strategy`,value:e,checked:p===e,onChange:()=>m(e),className:`accent-[var(--azd-accent)]`}),eo[e]]},e)),a&&!T&&(0,X.jsx)(`p`,{className:`pt-0.5 text-xs text-muted`,"data-testid":`strategy-resolutions-note`,children:`Rebase can't keep conflict resolutions, so it isn't offered.`}),T&&(0,X.jsxs)(`p`,{role:`alert`,className:`text-[13px] text-danger`,"data-testid":`strategy-none`,children:[`The branch policy for `,E,` allows only rebase, which can't keep conflict resolutions. Complete this pull request in Azure DevOps or resolve the conflicts in a branch instead.`]}),i&&!T&&(0,X.jsxs)(`p`,{className:`pt-0.5 text-xs text-muted`,"data-testid":`strategy-policy-note`,children:[`The branch policy for `,E,` allows`,` `,r.length===1?`only this merge type`:`only these merge types`,`.`]})]}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(`label`,{className:`flex items-start gap-2.5 text-[13px] text-fg`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:h,onChange:e=>_(e.target.checked),className:`mt-0.5 accent-[var(--azd-accent)]`}),(0,X.jsxs)(`span`,{children:[`Delete `,(0,X.jsx)(`span`,{className:`font-mono`,children:ee}),` after merging`]})]}),o&&(0,X.jsxs)(`label`,{className:`flex items-start gap-2.5 text-[13px] text-fg`,children:[(0,X.jsx)(`input`,{type:`checkbox`,checked:v,onChange:e=>y(e.target.checked),className:`mt-0.5 accent-[var(--azd-accent)]`}),`Complete linked work items after merging`]})]}),g(p)&&(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`label`,{htmlFor:d,className:`block text-xs font-medium text-muted`,children:`Commit message`}),(0,X.jsx)(`textarea`,{id:d,value:b,onChange:e=>x(e.target.value),rows:3,className:`w-full resize-y rounded-[8px] border border-border bg-canvas px-2.5 py-2 font-mono text-xs text-fg focus:border-[var(--azd-focus)] focus:outline-none`})]}),(0,X.jsx)(`p`,{className:`rounded-[8px] bg-raised px-3 py-2 text-[13px] text-fg`,"data-testid":`completion-summary`,children:D}),S&&n!==null&&(0,X.jsxs)(`p`,{className:`text-xs text-muted`,children:[`Source commit`,` `,(0,X.jsx)(`span`,{className:`font-mono text-fg`,"data-testid":`completion-commit`,children:Ja(n)})]}),C&&(0,X.jsx)(`p`,{role:`alert`,className:`text-[13px] text-danger`,children:`Azure DevOps has not reported the source commit yet. Close this, wait a moment, and try again.`}),w&&(0,X.jsx)(`p`,{role:`alert`,className:`text-[13px] text-danger`,"data-testid":`completion-stale`,children:`New changes were pushed. Review them, then complete.`}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:l,disabled:s,className:Ae,children:`Cancel`}),(0,X.jsx)(`button`,{type:`submit`,disabled:s||w||C||T,className:pe,"data-testid":`completion-confirm`,children:s?S?`Completing…`:`Setting…`:S?`Complete merge`:`Set auto-complete`})]})]})})}var ho=(0,P.createContext)(null);function go(){return(0,P.useContext)(ho)}function _o({location:e,scope:t,pullRequest:n,checks:r,checksPending:i,evaluations:a,hasWorkItems:s,conflicts:c=null,onResolveConflicts:l=()=>{},children:u}){let f=x(),p=we(e.organization),h=ba.detail(e),[g,_]=(0,P.useState)(null),[y,b]=(0,P.useState)({kind:`idle`}),[S,C]=(0,P.useState)(null),w=(0,P.useRef)(null),T=(0,P.useRef)(!1),E={project:t.project,repositoryId:t.repositoryId,pullRequestId:t.pullRequestId},te=(0,P.useCallback)(e=>{e!==null&&f.setQueryData(h,e),f.invalidateQueries({queryKey:h})},[f,h]),D=(0,P.useCallback)(()=>{_(null);let e=w.current;window.setTimeout(()=>{e?.isConnected&&e.focus()},0)},[]),ne=Ve({retry:!1,mutationFn:t=>{let n=O(e.organization);switch(t.action){case`complete`:return m(n,{...E,lastMergeSourceCommit:t.commitId,options:t.choices});case`set-auto-complete`:return o(n,{...E,userId:t.userId,options:t.choices});case`cancel-auto-complete`:return d(n,E);case`abandon`:return ee(n,E);case`reactivate`:return Ie(n,E)}},onSettled:()=>{T.current=!1}}),re=t=>{let r=ya(t,{repository:n.repository.name,method:Ee(e.organization)});return r.kind===`sign-in`?`Azure DevOps did not accept the sign-in; nothing was changed. Reload to sign in again.`:r.message},ie=(e,t)=>{T.current||(T.current=!0,C(null),ne.mutate(e,t))},ae=(e,t,n)=>{if(e===`complete`){if(t===null)return;ie({action:`complete`,commitId:t,choices:n},{onSuccess:e=>{D(),e!==null&&f.setQueryData(h,e),e?.status===`completed`?b({kind:`merged`}):b({kind:`completing`,since:Date.now()})},onError:e=>{D(),oe(e,t)}});return}let r=p.data?.id;r!==void 0&&ie({action:`set-auto-complete`,userId:r,choices:n},{onSuccess:e=>{D(),te(e)},onError:e=>{D(),C({tone:`error`,text:re(e)})}})},oe=async(t,n)=>{let r=null;try{r=await v(O(e.organization),{project:e.project,pullRequestId:e.pullRequestId}),f.setQueryData(h,r)}catch{}r!==null&&r.lastMergeSourceCommit!==n?C({tone:`error`,text:qa}):C({tone:`error`,text:re(t)})},se=e=>{ie({action:e},{onSuccess:t=>{e===`abandon`&&D(),b({kind:`idle`}),te(t)},onError:t=>{e===`abandon`&&D(),C({tone:`error`,text:re(t)})}})};xo(y,e,h,b,C);let ce=i&&n.status===`active`?null:Qa({pullRequest:n,checks:r,currentUserId:p.data?.id??null,conflictCount:c?.unresolved??null}),le=ne.isPending,ue=ao(a),de=c?.anyResolved===!0,fe=co(ue,de),pe=ue.length<4,me={actions:ce,busy:le,phase:y,notice:S,run:(e,t)=>{if(!(le||T.current))switch(w.current=t,C(null),e){case`resolve-conflicts`:l();return;case`complete`:_({kind:`complete`,commitId:n.lastMergeSourceCommit});return;case`set-auto-complete`:_({kind:`auto-complete`,commitId:n.lastMergeSourceCommit});return;case`abandon`:_({kind:`abandon`});return;case`cancel-auto-complete`:case`reactivate`:se(e);return}},targetBranch:n.targetBranch};return(0,X.jsxs)(ho.Provider,{value:me,children:[u,g!==null&&g.kind!==`abandon`&&(0,X.jsx)(mo,{mode:g.kind,pullRequest:n,commitId:g.commitId,allowed:fe,policyRestricts:pe,resolutionsRestrict:de&&fe.length<ue.length,hasWorkItems:s,busy:le,onConfirm:e=>ae(g.kind,g.commitId,e),onClose:D}),g?.kind===`abandon`&&(0,X.jsx)(bo,{pullRequestId:n.pullRequestId,busy:le,onConfirm:()=>se(`abandon`),onClose:D})]})}function vo(){let e=go();if(e===null||e.actions===null)return null;let{actions:t,phase:n,notice:r}=e,i=n.kind===`idle`;return(0,X.jsxs)(`div`,{className:`space-y-1.5`,"data-testid":`merge-controls`,children:[n.kind===`completing`&&(0,X.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1.5 text-[13px] text-fg`,"data-testid":`merge-progress`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`azd-pulse size-2 rounded-full bg-accent`}),`Completing…`]}),n.kind===`merged`&&(0,X.jsxs)(`p`,{role:`status`,className:`text-[13px] font-medium text-added`,"data-testid":`merge-progress`,children:[`Merged into `,e.targetBranch]}),n.kind===`timed-out`&&(0,X.jsx)(`p`,{role:`status`,className:`text-[13px] text-muted`,"data-testid":`merge-progress`,children:`Still completing — refresh to check.`}),i&&t.explanation!==void 0&&(0,X.jsx)(`p`,{className:`text-[13px] leading-snug text-muted`,"data-testid":`merge-explanation`,children:t.explanation}),r!==null&&(0,X.jsx)(`p`,{role:`alert`,className:`text-[13px] leading-snug ${r.tone===`error`?`text-danger`:`text-muted`}`,"data-testid":`merge-notice`,children:r.text})]})}function yo({showNotice:e=!1}){let t=go();if(t===null||t.actions===null)return null;let{actions:n,busy:r,phase:i,notice:a,run:o}=t;if(i.kind===`completing`)return(0,X.jsxs)(`span`,{className:`${Ae} pointer-events-none gap-2`,"data-testid":`merge-button-progress`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`azd-pulse size-2 rounded-full bg-accent`}),`Completing…`]});if(i.kind===`merged`||i.kind===`timed-out`)return null;let{primary:s,secondary:c}=n;if(s===null&&c.length===0)return null;let l=c.map(e=>({label:Ya[e],onSelect:()=>{let t=document.querySelector(`[data-testid="merge-menu-button"]`);t!==null&&o(e,t)},disabled:r,danger:e===`abandon`,testId:`merge-action-${e}`}));return(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e&&a!==null&&(0,X.jsx)(`p`,{role:`alert`,className:`max-w-xs truncate text-xs text-danger`,title:a.text,"data-testid":`merge-notice`,children:a.text}),(0,X.jsxs)(`div`,{className:`flex items-center`,"data-testid":`merge-button`,children:[s!==null&&(0,X.jsxs)(`button`,{type:`button`,disabled:r,onClick:e=>o(s,e.currentTarget),className:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-8 px-3 bg-primary text-primary-fg hover:opacity-90 ${c.length>0?`rounded-r-none`:``}`,"data-testid":`merge-action-${s}`,"data-kind":`primary`,children:[s===`resolve-conflicts`?(0,X.jsx)(y,{className:`size-3.5`}):(0,X.jsx)(ae,{className:`size-3.5`}),Ya[s]]}),c.length>0&&(0,X.jsx)(Ha,{label:`Merge actions`,entries:l,trigger:e=>(0,X.jsxs)(`button`,{type:`button`,...e,ref:e.ref,"aria-label":s===null?void 0:`More merge actions`,title:s===null?n.explanation:`More merge actions`,className:s===null?`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-8 px-3 border border-border bg-raised text-fg hover:border-border-strong hover:bg-hover gap-1.5`:`inline-flex shrink-0 items-center justify-center gap-1.5 rounded-[7px] text-[13px] font-medium whitespace-nowrap transition-colors disabled:cursor-not-allowed disabled:opacity-50 h-8 px-3 bg-primary text-primary-fg hover:opacity-90 rounded-l-none border-l border-[color-mix(in_srgb,var(--azd-primary-fg)_18%,transparent)] px-2`,"data-testid":`merge-menu-button`,children:[s===null&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ae,{className:`size-3.5`}),`Merge`]}),(0,X.jsx)(re,{className:`size-3.5`})]})})]})]})}function bo({pullRequestId:e,busy:t,onConfirm:n,onClose:r}){let i=(0,P.useId)();return(0,X.jsx)(lo,{titleId:i,busy:t,onClose:r,testId:`abandon-dialog`,children:(0,X.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),t||n()},className:`space-y-3`,children:[(0,X.jsxs)(`h2`,{id:i,className:`text-[16px] font-semibold text-fg-strong`,children:[`Abandon pull request #`,e,`?`]}),(0,X.jsx)(`p`,{className:`text-[13px] text-muted`,children:`It closes without merging. You can reactivate it later.`}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(`button`,{type:`button`,onClick:r,disabled:t,className:Ae,children:`Cancel`}),(0,X.jsx)(`button`,{type:`submit`,disabled:t,className:ve,"data-testid":`abandon-confirm`,children:t?`Abandoning…`:`Abandon`})]})]})})}function xo(e,t,n,r,i){let a=x(),o=e.kind===`completing`?e.since:null,{organization:s,project:c,pullRequestId:l}=t;(0,P.useEffect)(()=>{if(o===null)return;let e=new AbortController,t,u=async()=>{if(Date.now()-o>=12e4)r({kind:`timed-out`});else{try{let t=await v(O(s),{project:c,pullRequestId:l,signal:e.signal});if(e.signal.aborted)return;a.setQueryData(n,t);let o=Ka(t);if(o.kind===`merged`){r({kind:`merged`});return}if(o.kind===`failed`){r({kind:`idle`}),i({tone:`error`,text:o.reason});return}}catch{if(e.signal.aborted)return}t=window.setTimeout(()=>void u(),Wa)}};return t=window.setTimeout(()=>void u(),Wa),()=>{e.abort(),window.clearTimeout(t)}},[o,s,c,l,a])}var So={rejected:`failed`,broken:`failed`,running:`running`,queued:`pending`,approved:`passed`},Co={failed:`failed`,error:`failed`,pending:`pending`,notSet:`pending`,succeeded:`passed`};function wo(e){let t=e.configuration.settings.displayName;if(typeof t==`string`&&t.trim().length>0)return t.trim();let n=e.configuration.type.displayName.trim();return n.length>0?n:`Policy`}function To(e){let{genre:t,name:n}=e.context,r=n.trim().length>0?n.trim():`Status`;return t.trim().length>0?`${t.trim()}/${r}`:r}function Eo(e){if(e!=null)try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`http:`?t.href:void 0}catch{return}}function Do(e,t){let n=e.context?.buildId;if(!(typeof n!=`number`||!Number.isSafeInteger(n)||n<=0))return`https://dev.azure.com/${encodeURIComponent(t.organization)}/${encodeURIComponent(t.project)}/_build/results?buildId=${n}`}function Oo(e,t){let n=[];for(let r of e){let e=r.configuration;if(!e.isEnabled||e.isDeleted)continue;let i=So[r.status];if(i===void 0)continue;let a={id:`policy:${r.evaluationId||e.id}`,name:wo(r),state:i,blocking:e.isBlocking,source:`policy`},o=Do(r,t);o!==void 0&&(a.url=o),r.context?.isExpired===!0&&(a.detail=`Expired`),n.push(a)}return n}function ko(e){let t=new Map;for(let n of e){let e=`${n.context.genre.toLowerCase()}/${n.context.name.toLowerCase()}`,r=t.get(e);(r===void 0||Ao(n,r))&&t.set(e,n)}let n=[];for(let e of t.values()){let t=Co[e.state];if(t===void 0)continue;let r={id:`status:${e.context.genre}/${e.context.name}`,name:To(e),state:t,blocking:!1,source:`status`},i=Eo(e.targetUrl);i!==void 0&&(r.url=i),e.description.trim().length>0&&(r.detail=e.description.trim()),n.push(r)}return n}function Ao(e,t){let n=e=>Date.parse(e.updatedDate??e.creationDate??``)||0;return n(e)===n(t)?e.id>t.id:n(e)>n(t)}var jo={failed:0,running:1,pending:2,passed:3};function Mo(e,t){return jo[e.state]-jo[t.state]||Number(t.blocking)-Number(e.blocking)||e.name.localeCompare(t.name)}function No(e){return[...e].sort(Mo)}function Po(e){let t=e.filter(e=>e.blocking),n=t.filter(e=>e.state!==`passed`).length,r=e.filter(e=>e.state===`failed`).length,i;return i=e.length===0?`No checks`:t.length===0?`No required checks`:n===0?`All required checks passed`:`${n} of ${t.length} required ${t.length===1?`check`:`checks`} not passed`,{required:t.length,requiredNotPassed:n,failed:r,text:i}}function Fo(e){return e.some(e=>e.state===`running`||e.state===`pending`)}var Io={failed:`Failed`,running:`Running`,pending:`Waiting`,passed:`Passed`},Lo=e=>[e.organization.toLowerCase(),e.repositoryId,e.pullRequestId],$={threads:e=>[...da.allThreads(e),`overview`],evaluations:e=>[`pr-overview`,`evaluations`,...Lo(e)],statuses:e=>[`pr-overview`,`statuses`,...Lo(e)],workItems:e=>[`pr-overview`,`work-items`,...Lo(e)]},Ro=6e4,zo=15e3,Bo=(e,t)=>({project:e.project,repositoryId:e.repositoryId,pullRequestId:e.pullRequestId,signal:t});function Vo(e){return N({queryKey:$.threads(e),queryFn:({signal:t})=>Ne(O(e.organization),Bo(e,t)),refetchOnWindowFocus:`always`,refetchInterval:ga,refetchIntervalInBackground:!1,retry:j})}function Ho(e,t,n){return No([...Oo(e??[],n),...ko(t??[])])}function Uo(e){let t=x(),n={refetchOnWindowFocus:`always`,refetchInterval:Fo(Ho(t.getQueryData($.evaluations(e)),t.getQueryData($.statuses(e)),e))?zo:Ro,refetchIntervalInBackground:!1,retry:j},r=N({queryKey:$.evaluations(e),queryFn:({signal:t})=>oe(O(e.organization),{project:e.project,projectId:e.projectId,pullRequestId:e.pullRequestId,signal:t}),...n}),i=N({queryKey:$.statuses(e),queryFn:({signal:t})=>w(O(e.organization),Bo(e,t)),...n}),{organization:a,project:o}=e;return{checks:(0,P.useMemo)(()=>Ho(r.data,i.data,{organization:a,project:o}),[r.data,i.data,a,o]),pending:r.isPending&&i.isPending,evaluationsError:r.error,statusesError:i.error,evaluations:r.data,retry:()=>{r.isError&&r.refetch(),i.isError&&i.refetch()}}}function Wo(e){return M(e,`forbidden`)||M(e,`unauthorized`)||M(e,`network`)}function Go(e){return N({queryKey:$.workItems(e),queryFn:async({signal:t})=>{let n=O(e.organization),r=(await me(n,Bo(e,t))).map(e=>e.id);if(r.length===0)return{ids:r,details:new Map,detailsProblem:null};try{let n=await ye(O(e.organization,{keepSessionOnUnauthorized:!0}),{ids:r,signal:t});return{ids:r,details:new Map(n.map(e=>[e.id,e])),detailsProblem:null}}catch(e){if(t.aborted)throw e;return{ids:r,details:null,detailsProblem:Wo(e)?`access`:`failed`}}},staleTime:3e5,retry:j})}var Ko=[{vote:k.approved,action:`Approve`,state:`Approved`,tone:`text-[var(--azd-added)]`},{vote:k.approvedWithSuggestions,action:`Approve with suggestions`,state:`Approved with suggestions`,tone:`text-[var(--azd-added)]`},{vote:k.waitingForAuthor,action:`Wait for author`,state:`Waiting for author`,tone:`text-[var(--azd-modified)]`},{vote:k.rejected,action:`Reject`,state:`Rejected`,tone:`text-danger`},{vote:k.none,action:`Reset feedback`,state:`No vote`,tone:`text-muted`}];function qo(e){return Ko.find(t=>t.vote===e)}var Jo=(e,t)=>e.toLowerCase()===t.toLowerCase();function Yo(e,t,n){let r=e.reviewers.find(e=>Jo(e.id,t.id)),i=r?e.reviewers.map(e=>e===r?{...e,vote:n}:e):[...e.reviewers,{isRequired:!1,hasDeclined:!1,...t,vote:n}];return{...e,reviewers:i}}var Xo=Ko.filter(e=>e.vote!==k.none),Zo=`flex w-full items-center gap-2 rounded-[6px] px-2 py-1.5 text-left text-[13px] text-fg outline-none hover:bg-hover focus:bg-hover aria-disabled:cursor-not-allowed aria-disabled:text-muted`,Qo=`flex h-8 items-center border border-border bg-raised px-2.5 text-[13px] font-medium text-fg hover:border-border-strong hover:bg-hover focus-visible:z-10 disabled:cursor-not-allowed disabled:opacity-50`;function $o({location:e,pullRequest:t}){let n=we(e.organization),r=x(),[a,o]=(0,P.useState)(!1),[s,c]=(0,P.useState)(null),l=(0,P.useRef)(null),u=(0,P.useRef)(null),d=(0,P.useRef)([]),f=(0,P.useId)(),p=ba.detail(e),m=Ve({retry:!1,mutationFn:({vote:r})=>i(O(e.organization),{project:e.project,repositoryId:t.repository.id,pullRequestId:t.pullRequestId,reviewerId:n.data.id,vote:r}),onMutate:async({vote:e,previous:t})=>{c(null),await r.cancelQueries({queryKey:p});let i=n.data;return i!==void 0&&r.setQueryData(p,t=>t===void 0?t:Yo(t,i,e)),{previous:t}},onSuccess:e=>{r.setQueryData(p,t=>t===void 0?t:Yo(t,e,e.vote))},onError:(i,a,o)=>{let s=n.data;s!==void 0&&o!==void 0&&r.setQueryData(p,e=>e===void 0?e:Yo(e,s,o.previous));let l=ya(i,{repository:t.repository.name,method:Ee(e.organization)});c(l.kind===`sign-in`?`Azure DevOps did not accept the sign-in; your vote was not saved. Reload to sign in again.`:l.message)}}),h=n.data,g=h===void 0?0:t.reviewers.find(e=>Jo(e.id,h.id))?.vote??0,_=qo(g),v=h===void 0,y=m.isPending,b=e=>{o(!1),l.current?.focus(),v||y||e===g||m.mutate({vote:e,previous:g})};(0,P.useEffect)(()=>{if(!a)return;let e=Math.max(0,Xo.findIndex(e=>e.vote===g));d.current[e]?.focus();let t=e=>{let t=e.target;!u.current?.contains(t)&&!l.current?.contains(t)&&o(!1)};return document.addEventListener(`pointerdown`,t),()=>document.removeEventListener(`pointerdown`,t)},[a,g]);let S=e=>{let t=d.current.filter(e=>e!==null),n=t.indexOf(document.activeElement),r=null;if(e.key===`ArrowDown`)r=(n+1)%t.length;else if(e.key===`ArrowUp`)r=(n-1+t.length)%t.length;else if(e.key===`Home`)r=0;else if(e.key===`End`)r=t.length-1;else if(e.key===`Escape`){e.preventDefault(),o(!1),l.current?.focus();return}else if(e.key===`Tab`){o(!1);return}r!==null&&(e.preventDefault(),t[r]?.focus())},C=g===k.approved,w=g!==k.none&&!C;return(0,X.jsxs)(`div`,{className:`relative flex items-center gap-2`,"data-testid":`vote-control`,children:[s!==null&&(0,X.jsx)(`p`,{role:`alert`,className:`max-w-[16rem] truncate text-xs text-danger`,title:s,children:s}),(0,X.jsxs)(`div`,{className:`flex items-center`,children:[(0,X.jsxs)(`button`,{type:`button`,className:`${Qo} gap-1.5 rounded-l-[7px] ${C?`text-added`:``}`,"aria-pressed":C,"aria-disabled":y,disabled:v,onClick:()=>b(k.approved),"data-testid":`vote-approve`,children:[(0,X.jsx)(je,{className:`size-3.5`}),C?`Approved`:`Approve`]}),(0,X.jsxs)(`button`,{ref:l,type:`button`,className:`${Qo} -ml-px gap-1 rounded-r-[7px] px-1.5`,"aria-haspopup":`menu`,"aria-expanded":a,"aria-controls":a?f:void 0,"aria-label":w&&_!==void 0?`Your vote: ${_.state}. Other votes`:`Other votes`,disabled:v,onClick:()=>o(e=>!e),onKeyDown:e=>{e.key===`ArrowDown`&&!a&&(e.preventDefault(),o(!0))},"data-testid":`vote-menu-button`,children:[w&&_!==void 0&&(0,X.jsx)(`span`,{className:_.tone,"data-testid":`vote-state`,children:_.state}),(0,X.jsx)(re,{className:`size-3.5 text-muted`})]})]}),a&&(0,X.jsxs)(`div`,{ref:u,id:f,role:`menu`,"aria-label":`Vote`,tabIndex:-1,onKeyDown:S,className:`absolute top-[calc(100%+6px)] right-0 w-60 z-50 min-w-48 rounded-[10px] border border-border bg-surface p-1 shadow-[var(--azd-shadow)]`,children:[Xo.map((e,t)=>(0,X.jsxs)(`button`,{ref:e=>{d.current[t]=e},type:`button`,role:`menuitemradio`,"aria-checked":e.vote===g,tabIndex:-1,onClick:()=>b(e.vote),className:Zo,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`flex w-4 justify-center text-fg`,children:e.vote===g&&(0,X.jsx)(je,{className:`size-3.5`})}),e.action]},e.vote)),(0,X.jsx)(`hr`,{className:`my-1 border-border`}),(0,X.jsxs)(`button`,{ref:e=>{d.current[Xo.length]=e},type:`button`,role:`menuitem`,"aria-disabled":g===k.none,tabIndex:-1,onClick:()=>b(k.none),className:Zo,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`w-4`}),`Reset feedback`]})]})]})}function es({status:e,className:t=`size-4`}){switch(e){case`draft`:return(0,X.jsx)(T,{className:t});case`completed`:return(0,X.jsx)(ae,{className:t});case`abandoned`:return(0,X.jsx)(S,{className:t});default:return(0,X.jsx)(se,{className:t})}}var ts=(0,P.createContext)(null);function ns(){let e=(0,P.useContext)(ts);if(e===null)throw Error(`usePullRequestPage outside a pull request page`);return e}function rs({location:e,shortForm:t,children:n}){return(0,X.jsx)(Ni,{children:(0,X.jsx)(os,{location:e,shortForm:t,children:n})})}function is({location:e,children:t}){return(0,X.jsx)(n,{sidebarLabel:`Inbox`,sidebar:(0,X.jsx)(as,{location:e,quietProblems:!0}),topBar:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(ke,{children:[(0,X.jsx)(`span`,{className:`truncate text-muted`,children:e.repository}),(0,X.jsx)(_e,{}),(0,X.jsxs)(`span`,{className:`text-fg tabular-nums`,children:[`#`,e.pullRequestId]})]}),(0,X.jsx)(`div`,{className:`ml-auto flex items-center gap-2`,children:(0,X.jsx)(Te,{})})]}),children:(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:t})})}function as({location:e,quietProblems:t=!1}){let n=N(he()),r=ge(n.data,e.organization),i=n.isPending?[]:[{name:r?.name??e.organization,project:r?.project??null}];return(0,X.jsx)(Re,{organizations:i,linkOrganizations:!0,current:{organization:e.organization,pullRequestId:e.pullRequestId},quietProblems:t})}function os({location:e,shortForm:t,children:n}){let r=we(e.organization);return r.isPending?(0,X.jsx)(is,{location:e,children:(0,X.jsx)(E,{})}):r.isError?(0,X.jsx)(is,{location:e,children:(0,X.jsx)(Le,{error:r.error,organization:e.organization,onRetry:()=>void r.refetch()})}):(0,X.jsx)(ss,{location:e,shortForm:t,children:n})}function ss({location:e,shortForm:t,children:n}){let r=Sa(e);return r.isPending?(0,X.jsx)(is,{location:e,children:(0,X.jsx)(E,{})}):r.data===void 0?M(r.error,`not-found`)?(0,X.jsx)(is,{location:e,children:(0,X.jsxs)(De,{title:`Pull request not found`,children:[(0,X.jsxs)(`p`,{children:[e.organization,` / `,e.project,` has no pull request !`,e.pullRequestId,`, or this account cannot see it. Azure DevOps does not say which.`]}),(0,X.jsx)(Oa,{href:Pe(D(e)),children:`Open in Azure DevOps`})]})}):(0,X.jsx)(is,{location:e,children:(0,X.jsx)(Le,{error:r.error,organization:e.organization,onRetry:()=>void r.refetch()})}):(0,X.jsx)(cs,{location:e,shortForm:t,pullRequest:r.data,children:n})}function cs({location:e,shortForm:t,pullRequest:n,children:r}){let i=(0,P.useMemo)(()=>({organization:e.organization,project:e.project,projectId:n.repository.projectId,repositoryId:n.repository.id,pullRequestId:e.pullRequestId}),[e.organization,e.project,e.pullRequestId,n.repository.id,n.repository.projectId]),a=hs(i,n),o=Da(e,t),s=Uo(i),c=Go(i);vs(e,t);let l=(0,P.useMemo)(()=>({location:e,shortForm:t,pullRequest:n,scope:i,counts:a}),[e,t,n,i,a]);return(0,X.jsx)(ts.Provider,{value:l,children:(0,X.jsx)(_o,{location:e,scope:i,pullRequest:n,checks:s.checks,checksPending:s.pending,evaluations:s.evaluations,hasWorkItems:(c.data?.ids.length??0)>0,conflicts:a.conflicts,onResolveConflicts:()=>o({tab:`conflicts`}),children:r},`${n.repository.id}:${n.pullRequestId}`)})}function ls(e){let{projectName:t,name:n}=e.repository;return t===n?n:`${t}/${n}`}function us({mode:e,lead:t,title:n,tools:r,merge:i=!0}){let{location:a,shortForm:o,pullRequest:s}=ns();return(0,X.jsxs)(X.Fragment,{children:[t,(0,X.jsxs)(ke,{children:[(0,X.jsx)(`span`,{className:`truncate text-muted ${e===`review`?`max-w-[11rem] shrink-0 max-[1100px]:hidden`:``}`,title:`${a.organization} / ${ls(s)}`,children:ls(s)}),(0,X.jsx)(`span`,{className:e===`review`?`max-[1100px]:hidden`:``,children:(0,X.jsx)(_e,{})}),e===`overview`?(0,X.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-fg`,children:[(0,X.jsx)(ds,{pullRequest:s}),(0,X.jsxs)(`span`,{className:`tabular-nums`,children:[`#`,s.pullRequestId]})]}):(0,X.jsxs)(`span`,{className:`flex min-w-[8rem] items-center gap-1.5`,children:[(0,X.jsx)(ds,{pullRequest:s}),(0,X.jsx)(Ea,{location:a,shortForm:o,page:{tab:`overview`},className:`min-w-0 truncate font-medium text-fg hover:underline`,children:(0,X.jsxs)(`h1`,{className:`inline`,title:s.title,children:[s.title,` `,(0,X.jsxs)(`span`,{className:`font-normal text-muted tabular-nums`,children:[`#`,s.pullRequestId]})]})}),n]})]}),(0,X.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[r,(0,X.jsx)(Te,{}),(0,X.jsx)(be,{href:Pe(D(a)),label:`Open in Azure DevOps`,framed:!0,children:(0,X.jsx)(u,{})}),s.status===`active`&&(0,X.jsx)($o,{location:a,pullRequest:s}),i&&(0,X.jsx)(yo,{showNotice:e===`review`})]})]})}function ds({pullRequest:e}){let t=fs(e);return(0,X.jsxs)(`span`,{title:ps[t],className:ms[t],children:[(0,X.jsx)(es,{status:t}),(0,X.jsx)(`span`,{className:`sr-only`,children:ps[t]})]})}function fs(e){return e.status===`active`?e.isDraft?`draft`:`active`:e.status===`completed`?`completed`:e.status===`abandoned`?`abandoned`:`active`}var ps={active:`Active`,draft:`Draft`,completed:`Completed`,abandoned:`Abandoned`},ms={active:`text-added`,draft:`text-muted`,completed:`text-renamed`,abandoned:`text-deleted`};function hs(e,t){let n=pa(t.supportsIterations?e:null),r=n.data?.at(-1),i=(0,P.useMemo)(()=>r===void 0?null:{iteration:r,since:null},[r]),a=ha(t.supportsIterations?e:null,i),o=ja(e),s=Xi(e,t).data,c=s===void 0||s.length===0||t.status!==`active`?null:ea(s),l=c?.total??null,u=c?.unresolved??null,d=c?.anyResolved??!1,f=(0,P.useMemo)(()=>l===null||u===null?null:{total:l,unresolved:u,anyResolved:d},[l,u,d]),p=o.data?.pages.reduce((e,t)=>e+t.commits.length,0),m=a.data===void 0?n.data?.length===0?`0`:null:String(a.data.files.length),h=p===void 0?null:`${p}${o.hasNextPage?`+`:``}`;return(0,P.useMemo)(()=>({files:m,commits:h,conflicts:f}),[m,h,f])}var gs=1500,_s={o:{tab:`overview`},f:{tab:`files`},c:{tab:`commits`},x:{tab:`conflicts`}};function vs(e,t){let n=Da(e,t);(0,P.useEffect)(()=>{let e=null,t=()=>{e!==null&&window.clearTimeout(e),e=null},r=r=>{if(r.ctrlKey||r.metaKey||r.altKey||La(r))t();else if(e!==null){let e=_s[r.key];if(t(),e===void 0)return;r.preventDefault(),r.stopPropagation(),n(e)}else r.key===`g`&&!r.repeat&&(r.preventDefault(),e=window.setTimeout(t,gs))};return window.addEventListener(`keydown`,r,!0),()=>{t(),window.removeEventListener(`keydown`,r,!0)}},[n])}export{Bi as $,qt as $t,Da as A,ht as An,qn as At,Qi as B,Ue as Bn,An as Bt,Ra as C,ft as Cn,fr as Ct,ja as D,ot as Dn,cr as Dt,Ma as E,lt as En,lr as Et,ha as F,Xe as Fn,K as Ft,Wi as G,gn as Gt,ea as H,Ve as Hn,Dn as Ht,pa as I,Ye as In,jn as It,Hi as J,H as Jt,Fi as K,U as Kt,_a as L,qe as Ln,In as Lt,Sa as M,Ke as Mn,Pn as Mt,ya as N,Ze as Nn,Nn as Nt,Oa as O,rt as On,sr as Ot,da as P,Qe as Pn,Mn as Pt,Li as Q,z as Qt,na as R,tt as Rn,G as Rt,La as S,mt as Sn,_r as St,Pa as T,st as Tn,ur as Tt,$i as U,Tn as Ut,Yi as V,We as Vn,On as Vt,Xi as W,En as Wt,Ji as X,Zt as Xt,Ki as Y,Qt as Yt,zi as Z,Xt as Zt,lo as _,$e as _n,Sr as _t,ms as a,Et as an,wi as at,Ia as b,pt as bn,hr as bt,es as c,wt as cn,Wr as ct,Vo as d,Ct as dn,xr as dt,Yt as en,Ri as et,Go as f,I as fn,Mr as ft,go as g,it as gn,Nr as gt,vo as h,at as hn,Tr as ht,ps as i,kt as in,Ai as it,ba as j,Je as jn,Un as jt,Ea as k,Ge as kn,$n as kt,$ as l,yt as ln,Hr as lt,Po as m,gt as mn,wr as mt,rs as n,Wt as nn,Ui as nt,fs as o,Dt as on,ni as ot,Io as p,_t as pn,Dr as pt,Gi as q,rn as qt,us as r,L as rn,ki as rt,ns as s,Ot as sn,Zr as st,as as t,Gt as tn,qi as tt,Uo as u,St as un,Cr as ut,Ha as v,ut as vn,Er as vt,Na as w,et as wn,dr as wt,Fa as x,ct as xn,mr as xt,Ua as y,dt as yn,pr as yt,ra as z,nt as zn,Fn as zt};