@meirblachman/azure-pipelines-visualizer 0.1.3 → 0.1.4

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./yaml-t4YZ9nNk.js","./reactflow-N78VftLX.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./yaml-DsrTNd4U.js","./reactflow-N78VftLX.js"])))=>i.map(i=>d[i]);
2
2
  var _re=Object.defineProperty;var bre=(s,e,t)=>e in s?_re(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var Mi=(s,e,t)=>bre(s,typeof e!="symbol"?e+"":e,t);import{r as je,R as Eu,a as vre,c as Cre,u as wre,j as ue,H as uV,P as fV,g as Sre,B as yre,E as xre,M as NY,b as Lre,d as kre,i as Ire,e as Dre,f as Ere,C as Nre}from"./reactflow-N78VftLX.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(n){if(n.ep)return;n.ep=!0;const o=t(n);fetch(n.href,o)}})();function gV(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,i=Array(e);t<e;t++)i[t]=s[t];return i}function Tre(s){if(Array.isArray(s))return s}function Rre(s,e,t){return(e=Bre(e))in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function Mre(s,e){var t=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(t!=null){var i,n,o,r,a=[],l=!0,c=!1;try{if(o=(t=t.call(s)).next,e!==0)for(;!(l=(i=o.call(t)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(d){c=!0,n=d}finally{try{if(!l&&t.return!=null&&(r=t.return(),Object(r)!==r))return}finally{if(c)throw n}}return a}}function Are(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pV(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function mV(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pV(Object(t),!0).forEach(function(i){Rre(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):pV(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function Pre(s,e){if(s==null)return{};var t,i,n=Ore(s,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(s);for(i=0;i<o.length;i++)t=o[i],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(s,t)&&(n[t]=s[t])}return n}function Ore(s,e){if(s==null)return{};var t={};for(var i in s)if({}.hasOwnProperty.call(s,i)){if(e.indexOf(i)!==-1)continue;t[i]=s[i]}return t}function Fre(s,e){return Tre(s)||Mre(s,e)||Hre(s,e)||Are()}function Wre(s,e){if(typeof s!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function Bre(s){var e=Wre(s,"string");return typeof e=="symbol"?e:e+""}function Hre(s,e){if(s){if(typeof s=="string")return gV(s,e);var t={}.toString.call(s).slice(8,-1);return t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set"?Array.from(s):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?gV(s,e):void 0}}function Vre(s,e,t){return e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function _V(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function bV(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_V(Object(t),!0).forEach(function(i){Vre(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):_V(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function zre(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return function(i){return e.reduceRight(function(n,o){return o(n)},i)}}function Tw(s){return function e(){for(var t=this,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return n.length>=s.length?s.apply(this,n):function(){for(var r=arguments.length,a=new Array(r),l=0;l<r;l++)a[l]=arguments[l];return e.apply(t,[].concat(n,a))}}}function bk(s){return{}.toString.call(s).includes("Object")}function Ure(s){return!Object.keys(s).length}function h0(s){return typeof s=="function"}function $re(s,e){return Object.prototype.hasOwnProperty.call(s,e)}function jre(s,e){return bk(e)||Nu("changeType"),Object.keys(e).some(function(t){return!$re(s,t)})&&Nu("changeField"),e}function qre(s){h0(s)||Nu("selectorType")}function Kre(s){h0(s)||bk(s)||Nu("handlerType"),bk(s)&&Object.values(s).some(function(e){return!h0(e)})&&Nu("handlersType")}function Gre(s){s||Nu("initialIsRequired"),bk(s)||Nu("initialType"),Ure(s)&&Nu("initialContent")}function Yre(s,e){throw new Error(s[e]||s.default)}var Zre={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Nu=Tw(Yre)(Zre),sx={changes:jre,selector:qre,handler:Kre,initial:Gre};function Xre(s){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};sx.initial(s),sx.handler(e);var t={current:s},i=Tw(eae)(t,e),n=Tw(Jre)(t),o=Tw(sx.changes)(s),r=Tw(Qre)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return sx.selector(c),c(t.current)}function l(c){zre(i,n,o,r)(c)}return[a,l]}function Qre(s,e){return h0(e)?e(s.current):e}function Jre(s,e){return s.current=bV(bV({},s.current),e),e}function eae(s,e,t){return h0(e)?e(s.current):Object.keys(t).forEach(function(i){var n;return(n=e[i])===null||n===void 0?void 0:n.call(e,s.current[i])}),t}var tae={create:Xre},iae={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function nae(s){return function e(){for(var t=this,i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return n.length>=s.length?s.apply(this,n):function(){for(var r=arguments.length,a=new Array(r),l=0;l<r;l++)a[l]=arguments[l];return e.apply(t,[].concat(n,a))}}}function sae(s){return{}.toString.call(s).includes("Object")}function oae(s){return s||vV("configIsRequired"),sae(s)||vV("configType"),s.urls?(rae(),{paths:{vs:s.urls.monacoBase}}):s}function rae(){console.warn(TY.deprecation)}function aae(s,e){throw new Error(s[e]||s.default)}var TY={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
4
4
  You are using deprecated way of configuration.
@@ -911,7 +911,7 @@ ${l}
911
911
  `):void 0}:{range:I.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(`
912
912
  `):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,n){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(`
913
913
  `)};const r=await o.provideRenameEdits(this.model,this.position,e,n);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),n)}else return this._provideRenameEdits(e,t+1,i.concat(m(1380,"No result.")),n);return r}}async function q7e(s,e,t,i){const n=new mH(e,t,s),o=await n.resolveRenameLocation(Je.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:n.provideRenameEdits(i,Je.None)}var cm;let Sf=(cm=class{static get(e){return e.getContribution(K7.ID)}constructor(e,t,i,n,o,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new X,this._cts=new ii,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(q7,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var g,p;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new ii,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new mH(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const n=new wh(this.editor,5,void 0,this._cts.token);let o;try{e("resolving rename location");const _=i.resolveRenameLocation(n.token);this._progressService.showWhile(_,250),o=await _,e("resolved rename location")}catch(_){_ instanceof ra?e("resolve rename location cancelled",JSON.stringify(_,null," ")):(e("resolve rename location failed",_ instanceof Error?_:JSON.stringify(_,null," ")),(typeof _=="string"||ih(_))&&((g=jo.get(this.editor))==null||g.showMessage(_||m(1381,"An unknown error occurred while resolving rename location"),t)));return}finally{n.dispose()}if(!o){e("returning early - no loc");return}if(o.rejectReason){e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),(p=jo.get(this.editor))==null||p.showMessage(o.rejectReason,t);return}if(n.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new wh(this.editor,5,o.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async _=>[_,await _.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(_,v)=>{let b=c.slice();return _===b0.Automatic&&(b=b.filter(([w,C])=>C)),b.map(([w])=>w.provideNewSymbolNames(a,o.range,_,v))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(o.range,o.text,h,l.length>0?d:void 0,r);if(e("received response from rename input field"),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const f=Bv(i.provideRenameEdits(u.newName,r.token),r.token).then(async _=>{if(!_){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(_.rejectReason){e(`returning early - rejected with reason: ${_.rejectReason}`),this._notificationService.info(_.rejectReason);return}this.editor.setSelection(I.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(_,{editor:this.editor,showPreview:u.wantsPreview,label:m(1382,"Renaming '{0}' to '{1}'",o==null?void 0:o.text,u.newName),code:"undoredo.rename",quotableLabel:m(1383,"Renaming {0} to {1}",o==null?void 0:o.text,u.newName),respectAutoSaveConfig:!0,reason:ss.rename()}).then(v=>{e("edits applied"),v.ariaSummary&&Qs(m(1384,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,u.newName,v.ariaSummary))}).catch(v=>{e(`error when applying edits ${JSON.stringify(v,null," ")}`),this._notificationService.error(m(1385,"Rename failed to apply edits")),this._logService.error(v)})},_=>{e("error when providing rename edits",JSON.stringify(_,null," ")),this._notificationService.error(m(1386,"Rename failed to compute edits")),this._logService.error(_)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(f,250),f}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}},K7=cm,cm.ID="editor.contrib.renameController",cm);Sf=K7=j7e([Xf(1,ke),Xf(2,ki),Xf(3,Ay),Xf(4,vh),Xf(5,jt),Xf(6,lR),Xf(7,Se)],Sf);class K7e extends we{constructor(){super({id:"editor.action.rename",label:G(1388,"Rename Symbol"),precondition:ne.and(F.writable,F.hasRenameProvider),kbOpts:{kbExpr:F.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1},canTriggerInlineEdits:!0})}runCommand(e,t){const i=e.get(ft),[n,o]=Array.isArray(t)&&t||[void 0,void 0];return Ee.isUri(n)&&B.isIPosition(o)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},He):super.runCommand(e,t)}run(e,t){const i=e.get(jt),n=Sf.get(t);return n?(i.trace("[RenameAction] got controller, running..."),n.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}dt(Sf.ID,Sf,4);me(K7e);const _H=cn.bindToContribution(Sf.get);_e(new _H({id:"acceptRenameInput",precondition:KC,handler:s=>s.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:ne.and(F.focus,ne.not("isComposing")),primary:3}}));_e(new _H({id:"acceptRenameInputWithPreview",precondition:ne.and(KC,ne.has("config.editor.rename.enablePreview")),handler:s=>s.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:ne.and(F.focus,ne.not("isComposing")),primary:2051}}));_e(new _H({id:"cancelRenameInput",precondition:KC,handler:s=>s.cancelRenameInput(),kbOpts:{weight:199,kbExpr:F.focus,primary:9,secondary:[1033]}}));Dt(class extends In{constructor(){super({id:"focusNextRenameSuggestion",title:{...G(1389,"Focus Next Rename Suggestion")},precondition:KC,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(ft).getFocusedCodeEditor();if(!t)return;const i=Sf.get(t);i&&i.focusNextRenameSuggestion()}});Dt(class extends In{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...G(1390,"Focus Previous Rename Suggestion")},precondition:KC,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(ft).getFocusedCodeEditor();if(!t)return;const i=Sf.get(t);i&&i.focusPreviousRenameSuggestion()}});Lo("_executeDocumentRenameProvider",function(s,e,t,...i){const[n]=i;ut(typeof n=="string");const{renameProvider:o}=s.get(Se);return q7e(o,e,t,n)});Lo("_executePrepareRename",async function(s,e,t){const{renameProvider:i}=s.get(Se),o=await new mH(e,t,i).resolveRenameLocation(Je.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o});pi.as(Pl.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:6,description:m(1387,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var G7e=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},FG=function(s,e){return function(t,i){e(t,i,s)}},Nv;let DE=(Nv=class extends U{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(n=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(n=>{var r;const o=(r=this.editor.getModel())==null?void 0:r.getLanguageId();o&&n.affects(o)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(n=>{this.options&&!n.hasChanged(81)||(this.options=this.createOptions(e.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(n=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(n=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new Rt(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,n=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(n!=null&&n.markers)))return{foldingRules:n,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,n;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((n=this.options)!=null&&n.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(o=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(o)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(o=>{if(!o.shouldBeInComments)return!0;const r=t.validateRange(o.range),a=t.tokenization.getLineTokens(r.startLineNumber),l=a.findTokenIndexAtOffset(r.startColumn-1),c=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&c===1}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),n=e.map(o=>Y7e(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,n);this.currentOccurrences={};for(let a=0,l=r.length;a<l;a++){const c={sectionHeader:e[a],decorationId:r[a]};this.currentOccurrences[c.decorationId]=c}})}stop(){this.computeSectionHeaders.cancel(),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop(),this.decorations.clear()}},Nv.ID="editor.sectionHeaderDetector",Nv);DE=G7e([FG(1,ci),FG(2,ko)],DE);function Y7e(s){return{range:s.range,options:ze.createDynamic({description:"section-header",stickiness:3,collapseOnReplaceEdit:!0,minimap:{color:void 0,position:1,sectionHeaderStyle:s.hasSeparatorLine?2:1,sectionHeaderText:s.text}})}}dt(DE.ID,DE,1);function Z7e(s){for(let e=0,t=s.length;e<t;e+=4){const i=s[e+0],n=s[e+1],o=s[e+2],r=s[e+3];s[e+0]=r,s[e+1]=o,s[e+2]=n,s[e+3]=i}}function X7e(s){const e=new Uint8Array(s.buffer,s.byteOffset,s.length*4);return ZY()||Z7e(e),Ru.wrap(e)}function Hse(s){const e=new Uint32Array(Q7e(s));let t=0;if(e[t++]=s.id,s.type==="full")e[t++]=1,e[t++]=s.data.length,e.set(s.data,t),t+=s.data.length;else{e[t++]=2,e[t++]=s.deltas.length;for(const i of s.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return X7e(e)}function Q7e(s){let e=0;if(e+=2,s.type==="full")e+=1+s.data.length;else{e+=1,e+=3*s.deltas.length;for(const t of s.deltas)t.data&&(e+=t.data.length)}return e}function u2(s){return s&&!!s.data}function Vse(s){return s&&Array.isArray(s.edits)}class J7e{constructor(e,t,i){this.provider=e,this.tokens=t,this.error=i}}function zse(s,e){return s.has(e)}function eWe(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function Use(s,e,t,i,n){const o=eWe(s,e),r=await Promise.all(o.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,n)}catch(d){c=d,l=null}return(!l||!u2(l)&&!Vse(l))&&(l=null),new J7e(a,l,c)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function tWe(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:null}class iWe{constructor(e,t){this.provider=e,this.tokens=t}}function nWe(s,e){return s.has(e)}function $se(s,e){const t=s.orderedGroups(e);return t.length>0?t[0]:[]}async function bH(s,e,t,i){const n=$se(s,e),o=await Promise.all(n.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){qi(l),a=null}return(!a||!u2(a))&&(a=null),new iWe(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}ct.registerCommand("_provideDocumentSemanticTokensLegend",async(s,...e)=>{const[t]=e;ut(t instanceof Ee);const i=s.get(li).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(Se),o=tWe(n,i);return o?o[0].getLegend():s.get(qt).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});ct.registerCommand("_provideDocumentSemanticTokens",async(s,...e)=>{const[t]=e;ut(t instanceof Ee);const i=s.get(li).getModel(t);if(!i)return;const{documentSemanticTokensProvider:n}=s.get(Se);if(!zse(n,i))return s.get(qt).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await Use(n,i,null,null,Je.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!u2(a))return;const l=Hse({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l});ct.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(s,...e)=>{const[t,i]=e;ut(t instanceof Ee);const n=s.get(li).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(Se),r=$se(o,n);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!I.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await bH(o,n,I.lift(i),Je.None);if(a)return a.provider.getLegend()});ct.registerCommand("_provideDocumentRangeSemanticTokens",async(s,...e)=>{const[t,i]=e;ut(t instanceof Ee),ut(I.isIRange(i));const n=s.get(li).getModel(t);if(!n)return;const{documentRangeSemanticTokensProvider:o}=s.get(Se),r=await bH(o,n,I.lift(i),Je.None);if(!(!r||!r.tokens))return Hse({id:0,type:"full",data:r.tokens.data})});const vH="editor.semanticHighlighting";function mk(s,e,t){var n;const i=(n=t.getValue(vH,{overrideIdentifier:s.getLanguageId(),resource:s.uri}))==null?void 0:n.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var jse=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},hc=function(s,e){return function(t,i){e(t,i,s)}},qh;let G7=class extends U{constructor(e,t,i,n,o,r){super(),this._watchers=new Wi;const a=d=>{var h;(h=this._watchers.get(d.uri))==null||h.dispose(),this._watchers.set(d.uri,new Y7(d,e,i,o,r))},l=(d,h)=>{h.dispose(),this._watchers.delete(d.uri)},c=()=>{for(const d of t.getModels()){const h=this._watchers.get(d.uri);mk(d,i,n)?h||a(d):h&&l(d,h)}};t.getModels().forEach(d=>{mk(d,i,n)&&a(d)}),this._register(t.onModelAdded(d=>{mk(d,i,n)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers.get(d.uri);h&&l(d,h)})),this._register(n.onDidChangeConfiguration(d=>{d.affectsConfiguration(vH)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){Lt(this._watchers.values()),this._watchers.clear(),super.dispose()}};G7=jse([hc(0,DR),hc(1,li),hc(2,mi),hc(3,qe),hc(4,_a),hc(5,Se)],G7);var of;let Y7=(of=class extends U{constructor(e,t,i,n,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:qh.REQUEST_MIN_DELAY,max:qh.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new Rt(()=>this._fetchDocumentSemanticTokensNow(),qh.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{Lt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),Lt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!zse(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new ii,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=Use(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(l=>{o.push(l)}),a=new bn(!1);n.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:d}=l,h=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,h,o)}},l=>{l&&(Mr(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||He(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,n,o){o=Math.min(o,i.length-n,e.length-t);for(let r=0;r<o;r++)i[n+r]=e[t+r]}_setDocumentSemanticTokens(e,t,i,n){const o=this._currentDocumentResponse,r=()=>{(n.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(Vse(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let d=l.length,h=c.length;for(let u=t.edits.length-1;u>=0;u--){const f=t.edits[u];if(f.start>l.length){i.warnInvalidEditStart(o.resultId,t.resultId,u,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=d-(f.start+f.deleteCount);g>0&&(qh._copy(l,d-g,c,h-g,g),h-=g),f.data&&(qh._copy(f.data,0,c,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&qh._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(u2(t)){this._currentDocumentResponse=new sWe(e,t.resultId,t.data);const a=WJ(t,i,this._model.getLanguageId());if(n.length>0)for(const l of n)for(const c of a)for(const d of l.changes)c.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}},qh=of,of.REQUEST_MIN_DELAY=300,of.REQUEST_MAX_DELAY=2e3,of);Y7=qh=jse([hc(1,DR),hc(2,mi),hc(3,_a),hc(4,Se)],Y7);class sWe{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}zC(G7);var oWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Nw=function(s,e){return function(t,i){e(t,i,s)}},Tv;let EE=(Tv=class extends U{constructor(e,t,i,n,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new Rt(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},l=()=>{var c;if(this._cleanupProviderListeners(),this._editor.hasModel()){const d=this._editor.getModel();for(const h of this._provider.all(d)){const u=(c=h.onDidChange)==null?void 0:c.call(h,()=>{this._cancelAll(),a()});u&&this._rangeProvidersChangeListeners.push(u)}}};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelLanguage(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),a()})),l(),this._register(this._provider.onDidChange(()=>{l(),this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(vH)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){Lt(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;t<i;t++)if(this._outstandingRequests[t]===e){this._outstandingRequests.splice(t,1);return}}_tokenizeViewportNow(){if(!this._editor.hasModel())return;const e=this._editor.getModel();if(e.tokenization.hasCompleteSemanticTokens())return;if(!mk(e,this._themeService,this._configurationService)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}if(!nWe(this._provider,e)){e.tokenization.hasSomeSemanticTokens()&&e.tokenization.setSemanticTokens(null,!1);return}const t=this._editor.getVisibleRangesPlusViewportAboveBelow();this._outstandingRequests=this._outstandingRequests.concat(t.map(i=>this._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),n=on(r=>Promise.resolve(bH(this._provider,e,t,r))),o=new bn(!1);return n.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,WJ(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(n),()=>this._removeOutstandingRequest(n)),n}},Tv.ID="editor.contrib.viewportSemanticTokens",Tv);EE=oWe([Nw(1,DR),Nw(2,mi),Nw(3,qe),Nw(4,_a),Nw(5,Se)],EE);dt(EE.ID,EE,1);class rWe{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,n),this._addWordRanges(o,e,n),this._addWhitespaceLine(o,e,n),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:o,startColumn:r}=n,a=i.column-r;let l=a,c=a,d=0;for(;l>=0;l--){const h=o.charCodeAt(l);if(l!==a&&(h===95||h===45))break;if(uu(h)&&lc(d))break;d=h}for(l+=1;c<o.length;c++){const h=o.charCodeAt(c);if(lc(h)&&uu(d))break;if(h===95||h===45)break;d=h}l<c&&e.push({range:new I(i.lineNumber,r+l,i.lineNumber,r+c)})}_addWordRanges(e,t,i){const n=t.getWordAtPosition(i);n&&e.push({range:new I(i.lineNumber,n.startColumn,i.lineNumber,n.endColumn)})}_addWhitespaceLine(e,t,i){t.getLineLength(i.lineNumber)>0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new I(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var aWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},lWe=function(s,e){return function(t,i){e(t,i,s)}},Z7;class CH{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new CH(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var dm;let ZS=(dm=class{static get(e){return e.getContribution(Z7.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await Kse(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(129),Je.None).then(o=>{var r;if(!(!Ns(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!ti(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;a<o.length;a++)o[a]=o[a].filter(l=>l.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new CH(0,a)),(r=this._selectionListener)==null||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const n=this._state.map(o=>Ce.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}},Z7=dm,dm.ID="editor.contrib.smartSelectController",dm);ZS=Z7=aWe([lWe(1,Se)],ZS);class qse extends we{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=ZS.get(t);i&&await i.run(this._forward)}}class cWe extends qse{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:G(1400,"Expand Selection"),precondition:void 0,kbOpts:{kbExpr:F.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:ye.MenubarSelectionMenu,group:"1_basic",title:m(1398,"&&Expand Selection"),order:2}})}}ct.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class dWe extends qse{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:G(1401,"Shrink Selection"),precondition:void 0,kbOpts:{kbExpr:F.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:ye.MenubarSelectionMenu,group:"1_basic",title:m(1399,"&&Shrink Selection"),order:3}})}}dt(ZS.ID,ZS,4);me(cWe);me(dWe);async function Kse(s,e,t,i,n){const o=s.all(e).concat(new rWe(i.selectSubwords));o.length===1&&o.unshift(new fE);const r=[],a=[];for(const l of o)r.push(Promise.resolve(l.provideSelectionRanges(e,t,n)).then(c=>{if(Ns(c)&&c.length===t.length)for(let d=0;d<t.length;d++){a[d]||(a[d]=[]);for(const h of c[d])I.isIRange(h.range)&&I.containsPosition(h.range,t[d])&&a[d].push(I.lift(h.range))}},qi));return await Promise.all(r),a.map(l=>{if(l.length===0)return[];l.sort((u,f)=>B.isBefore(u.getStartPosition(),f.getStartPosition())?1:B.isBefore(f.getStartPosition(),u.getStartPosition())||B.isBefore(u.getEndPosition(),f.getEndPosition())?-1:B.isBefore(f.getEndPosition(),u.getEndPosition())?1:0);const c=[];let d;for(const u of l)(!d||I.containsRange(u,d)&&!I.equalsRange(u,d))&&(c.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return c;const h=[c[0]];for(let u=1;u<c.length;u++){const f=c[u-1],g=c[u];if(g.startLineNumber!==f.startLineNumber||g.endLineNumber!==f.endLineNumber){const p=new I(f.startLineNumber,e.getLineFirstNonWhitespaceColumn(f.startLineNumber),f.endLineNumber,e.getLineLastNonWhitespaceColumn(f.endLineNumber));p.containsRange(f)&&!p.equalsRange(f)&&g.containsRange(p)&&!g.equalsRange(p)&&h.push(p);const _=new I(f.startLineNumber,1,f.endLineNumber,e.getLineMaxColumn(f.endLineNumber));_.containsRange(f)&&!_.equalsRange(p)&&g.containsRange(_)&&!g.equalsRange(_)&&h.push(_)}h.push(g)}return h})}ct.registerCommand("_executeSelectionRangeProvider",async function(s,...e){const[t,i]=e;ut(Ee.isUri(t)),ut(Zae(i,r=>B.isIPosition(r)));const n=s.get(Se).selectionRangeProvider,o=await s.get(Ms).createModelReference(t);try{return Kse(n,o.object.textEditorModel,i.map(B.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},Je.None)}finally{o.dispose()}});const X7=Object.freeze({View:G(1638,"View"),Help:G(1639,"Help"),Test:G(1640,"Test"),File:G(1641,"File"),Preferences:G(1642,"Preferences"),Developer:G(1643,"Developer")});class hWe extends $a{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...G(1448,"Toggle Editor Sticky Scroll"),mnemonicTitle:m(1444,"&&Toggle Editor Sticky Scroll")},metadata:{description:G(1449,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:X7.View,toggled:{condition:ne.equals("config.editor.stickyScroll.enabled",!0),title:m(1445,"Sticky Scroll"),mnemonicTitle:m(1446,"&&Sticky Scroll")},menu:[{id:ye.CommandPalette},{id:ye.MenubarAppearanceMenu,group:"4_editor",order:3},{id:ye.StickyScrollContext}]})}async runEditorCommand(e,t){var r;const i=e.get(qe),n=!i.getValue("editor.stickyScroll.enabled"),o=(r=za.get(t))==null?void 0:r.isFocused();i.updateValue("editor.stickyScroll.enabled",n),o&&t.focus()}}const f2=100;class uWe extends $a{constructor(){super({id:"editor.action.focusStickyScroll",title:{...G(1450,"Focus Editor Sticky Scroll"),mnemonicTitle:m(1447,"&&Focus Editor Sticky Scroll")},precondition:ne.and(ne.has("config.editor.stickyScroll.enabled"),F.stickyScrollVisible),menu:[{id:ye.CommandPalette}]})}runEditorCommand(e,t){var i;(i=za.get(t))==null||i.focus()}}class fWe extends $a{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:G(1451,"Select the next editor sticky scroll line"),precondition:F.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f2,primary:18}})}runEditorCommand(e,t){var i;(i=za.get(t))==null||i.focusNext()}}class gWe extends $a{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:G(1452,"Select the previous sticky scroll line"),precondition:F.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f2,primary:16}})}runEditorCommand(e,t){var i;(i=za.get(t))==null||i.focusPrevious()}}class pWe extends $a{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:G(1453,"Go to the focused sticky scroll line"),precondition:F.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f2,primary:3}})}runEditorCommand(e,t){var i;(i=za.get(t))==null||i.goToFocused()}}class mWe extends $a{constructor(){super({id:"editor.action.selectEditor",title:G(1454,"Select Editor"),precondition:F.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:f2,primary:9}})}runEditorCommand(e,t){var i;(i=za.get(t))==null||i.selectEditor()}}dt(za.ID,za,1);Dt(hWe);Dt(uWe);Dt(gWe);Dt(fWe);Dt(pWe);Dt(mWe);var Gse=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},Yw=function(s,e){return function(t,i){e(t,i,s)}};class _We{constructor(e,t,i,n,o,r,a){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=o,this.gutterMenuLinkAction=r,this.completion=a}}let Q7=class extends fle{constructor(e,t,i,n,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn<i.endColumn&&this.completionModel.getIncompleteProvider().size===0}get items(){const e=[],{items:t}=this.completionModel,i=this._suggestMemoryService.select(this.model,{lineNumber:this.line,column:this.word.endColumn+this.completionModel.lineContext.characterCountDelta},t),n=at.slice(t,i),o=at.slice(t,0,i);let r=5;for(const a of at.concat(n,o)){if(a.score===Fa.Default)continue;const l=new I(a.editStart.lineNumber,a.editStart.column,a.editInsertEnd.lineNumber,a.editInsertEnd.column+this.completionModel.lineContext.characterCountDelta),c=a.completion.insertTextRules&&a.completion.insertTextRules&4?{snippet:a.completion.insertText}:a.completion.insertText;e.push(new _We(l,c,a.filterTextLow??a.labelLow,a.completion.additionalTextEdits,a.completion.command,a.completion.action,a)),r-->=0&&a.resolve(Je.None)}return e}};Q7=Gse([Yw(5,c2)],Q7);let J7=class extends U{constructor(e,t,i,n){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=n,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,n){var f;if(i.selectedSuggestionInfo)return;let o;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){o=g;break}if(!o)return;const r=o.getOption(102);if(yb.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(yb.valueFor(r,l)!=="inline")return;let c=e.getWordAtPosition(t),d;if(c!=null&&c.word||(d=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!d||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let h;const u=e.getValueInRange(new I(t.lineNumber,1,t.lineNumber,t.column));if(!d&&((f=this._lastResult)!=null&&f.canBeReused(e,t.lineNumber,c))){const g=new lG(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await sH(this._languageFeatureService.completionProvider,e,t,new WS(void 0,pE.createSuggestFilter(o).itemKind,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},n);let p;g.needsClipboard&&(p=await this._clipboardService.readText());const _=new cu(g.items,t.column,new lG(u,0),gE.None,o.getOption(134),o.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new Q7(e,t.lineNumber,c,_,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(Je.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var o;const i=e.getValueInRange(I.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),n=new Set;for(const r of this._languageFeatureService.completionProvider.all(e))(o=r.triggerCharacters)!=null&&o.includes(i)&&n.add(r);if(n.size!==0)return{providers:n,ch:i}}};J7=Gse([Yw(0,Se),Yw(1,Qo),Yw(2,c2),Yw(3,ft)],J7);zC(J7);class bWe extends we{constructor(){super({id:"editor.action.forceRetokenize",label:G(1532,"Developer: Force Retokenize"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new bn;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}}me(bWe);const ST=class ST extends In{constructor(){super({id:ST.ID,title:G(1530,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:G(1531,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!Kv.getTabFocusMode();Kv.setTabFocusMode(t),Qs(t?m(1528,"Pressing Tab will now move focus to the next focusable element"):m(1529,"Pressing Tab will now insert the tab character"))}};ST.ID="editor.action.toggleTabFocusMode";let eW=ST;Dt(eW);var vWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},WG=function(s,e){return function(t,i){e(t,i,s)}};let tW=class extends U{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},n,o){super(),this._link=t,this._hoverService=n,this._enabled=!0,this.el=ae(e,he("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??qc("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new kt(this.el,"click")),a=this._register(new kt(this.el,"keypress")),l=ge.chain(a.event,h=>h.map(u=>new Ot(u)).filter(u=>u.keyCode===3)),c=this._register(new kt(this.el,$t.Tap)).event;this._register(fs.addTarget(this.el));const d=ge.any(r.event,l,c);this._register(d(h=>{this.enabled&&(pt.stop(h,!0),i!=null&&i.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};tW=vWe([WG(3,io),WG(4,Nh)],tW);var Yse=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},iW=function(s,e){return function(t,i){e(t,i,s)}};const CWe=26;let nW=class extends U{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(sW))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,CWe)}};nW=Yse([iW(1,ke)],nW);let sW=class extends U{constructor(e,t){super(),this.instantiationService=e,this.markdownRendererService=t,this.element=he("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=he("span");return t.innerText=e,t}return this.markdownRendererService.render(e).element}clear(){Mn(this.element)}show(e){Mn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ae(this.element,he("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(he(`div${Te.asCSSSelector(e.icon)}`));const n=ae(this.element,he("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ae(this.element,he("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(tW,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=ae(this.element,he("div.action-container"));this.actionBar=this._register(new bo(o)),this.actionBar.push(this._register(new Lr("banner.close",m(1533,"Close Banner"),Te.asClassName(Bte),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};sW=Yse([iW(0,ke),iW(1,ja)],sW);var wH=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$1=function(s,e){return function(t,i){e(t,i,s)}};const wWe=Xt("extensions-warning-message",oe.warning,m(1534,"Icon shown with a warning message in the extensions editor."));var Rv;let XS=(Rv=class extends U{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:m(1535,"This document contains many non-basic ASCII unicode characters"),command:new JS};else if(o.ambiguousCharacterCount>=r)a={message:m(1536,"This document contains many ambiguous unicode characters"),command:new Zm};else if(o.invisibleCharacterCount>=r)a={message:m(1537,"This document contains many invisible unicode characters"),command:new QS};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:wWe,actions:[{label:a.command.shortLabel,href:`command:${a.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(nW,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(142),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(142)&&(this._options=e.getOption(142),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=SWe(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?i_.NumberFormat().value.resolvedOptions().locale:i==="_vscode"?ale:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new oW(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new yWe(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},Rv.ID="editor.contrib.unicodeHighlighter",Rv);XS=wH([$1(1,ko),$1(2,Pee),$1(3,ke)],XS);function SWe(s,e){return{nonBasicASCII:e.nonBasicASCII===hr?!s:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===hr?!s:e.includeComments,includeStrings:e.includeStrings===hr?!s:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let oW=class extends U{constructor(e,t,i,n){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=n,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Rt(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const n of t.ranges)i.push({range:n,options:NE.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!t8(t,e))return null;const i=t.getValueInRange(e.range);return{reason:Xse(i,this._options),inComment:i8(t,e),inString:n8(t,e)}}};oW=wH([$1(3,ko)],oW);class yWe extends U{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new Rt(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const o=vB.computeUnicodeHighlights(this._model,this._options,n);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:NE.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return t8(t,e)?{reason:Xse(i,this._options),inComment:i8(t,e),inString:n8(t,e)}:null}}const Zse=m(1538,"Configure Unicode Highlight Options");let rW=class{constructor(e,t){this._editor=e,this._markdownRendererService=t,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),n=this._editor.getContribution(XS.ID);if(!n)return[];const o=[],r=new Set;let a=300;for(const l of t){const c=n.getDecorationInfo(l);if(!c)continue;const h=i.getValueInRange(l.range).codePointAt(0),u=$A(h);let f;switch(c.reason.kind){case 0:{fy(c.reason.confusableWith)?f=m(1539,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,$A(c.reason.confusableWith.codePointAt(0))):f=m(1540,"The character {0} could be confused with the character {1}, which is more common in source code.",u,$A(c.reason.confusableWith.codePointAt(0)));break}case 1:f=m(1541,"The character {0} is invisible.",u);break;case 2:f=m(1542,"The character {0} is not a basic ASCII character.",u);break}if(r.has(f))continue;r.add(f);const g={codePoint:h,reason:c.reason,inComment:c.inComment,inString:c.inString},p=m(1543,"Adjust settings"),_=see(TE.ID,g),v=new rs("",!0).appendMarkdown(f).appendText(" ").appendLink(_,p,Zse);o.push(new Ma(this,l.range,[v],!1,a++))}return o}renderHoverParts(e,t){return HAe(e,t,this._editor,this._markdownRendererService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(`
914
- `)}};rW=wH([$1(1,ja)],rW);function aW(s){return`U+${s.toString(16).padStart(4,"0")}`}function $A(s){let e=`\`${aW(s)}\``;return np.isInvisibleCharacter(s)||(e+=` "${`${xWe(s)}`}"`),e}function xWe(s){return s===96?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function Xse(s,e){return vB.computeUnicodeHighlightReason(s,e)}const yT=class yT{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=ze.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};yT.instance=new yT;let NE=yT;class LWe extends we{constructor(){super({id:Zm.ID,label:G(1552,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=m(1544,"Disable Highlight In Comments")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(fo.includeComments,!1,2)}}class kWe extends we{constructor(){super({id:Zm.ID,label:G(1553,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=m(1545,"Disable Highlight In Strings")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(fo.includeStrings,!1,2)}}const xT=class xT extends In{constructor(){super({id:xT.ID,title:G(1554,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1546,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(fo.ambiguousCharacters,!1,2)}};xT.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let Zm=xT;const LT=class LT extends In{constructor(){super({id:LT.ID,title:G(1555,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1547,"Disable Invisible Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(fo.invisibleCharacters,!1,2)}};LT.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let QS=LT;const kT=class kT extends In{constructor(){super({id:kT.ID,title:G(1556,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1548,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(fo.nonBasicASCII,!1,2)}};kT.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let JS=kT;const IT=class IT extends In{constructor(){super({id:IT.ID,title:G(1557,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:n,inString:o,inComment:r}=t,a=String.fromCodePoint(i),l=e.get(gs),c=e.get(qe);function d(g){return np.isInvisibleCharacter(g)?m(1549,"Exclude {0} (invisible character) from being highlighted",aW(g)):m(1550,"Exclude {0} from being highlighted",`${aW(g)} "${a}"`)}const h=[];if(n.kind===0)for(const g of n.notAmbiguousInLocales)h.push({label:m(1551,'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{DWe(c,[g])}});if(h.push({label:d(i),run:()=>IWe(c,[i])}),r){const g=new LWe;h.push({label:g.label,run:async()=>g.runAction(c)})}else if(o){const g=new kWe;h.push({label:g.label,run:async()=>g.runAction(c)})}function u(g){return typeof g.desc.title=="string"?g.desc.title:g.desc.title.value}if(n.kind===0){const g=new Zm;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(n.kind===1){const g=new QS;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(n.kind===2){const g=new JS;h.push({label:u(g),run:async()=>g.runAction(c)})}else EWe(n);const f=await l.pick(h,{title:Zse});f&&await f.run()}};IT.ID="editor.action.unicodeHighlight.showExcludeOptions";let TE=IT;async function IWe(s,e){const t=s.getValue(fo.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(fo.allowedCharacters,i,2)}async function DWe(s,e){var n;const t=(n=s.inspect(fo.allowedLocales).user)==null?void 0:n.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const o of e)i[o]=!0;await s.updateValue(fo.allowedLocales,i,2)}function EWe(s){throw new Error(`Unexpected value: ${s}`)}Dt(Zm);Dt(QS);Dt(JS);Dt(TE);dt(XS.ID,XS,1);f_.register(rW);var NWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},BG=function(s,e){return function(t,i){e(t,i,s)}};const Qse="ignoreUnusualLineTerminators";function TWe(s,e,t){s.setModelProperty(e.uri,Qse,t)}function RWe(s,e){return s.getModelProperty(e.uri,Qse)}var Mv;let RE=(Mv=class extends U{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||RWe(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:m(1558,"Unusual Line Terminators"),message:m(1559,"Detected unusual line terminators"),detail:m(1560,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",da(e.uri)),primaryButton:m(1561,"&&Remove Unusual Line Terminators"),cancelButton:m(1562,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){TWe(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},Mv.ID="editor.contrib.unusualLineTerminatorsDetector",Mv);RE=NWe([BG(1,Ey),BG(2,ft)],RE);dt(RE.ID,RE,1);var MWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},AWe=function(s,e){return function(t,i){e(t,i,s)}};class HG{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return o?e.isDisposed()?void 0:e.findMatches(o.word,!0,!1,!0,Dk,!1).map(a=>({range:a.range,kind:Fv.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const o=new Wi,r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!r)return Promise.resolve(o);for(const a of[e,...i]){if(a.isDisposed())continue;const c=a.findMatches(r.word,!0,!1,!0,Dk,!1).map(d=>({range:d.range,kind:Fv.Text}));c&&o.set(a.uri,c)}return o}}let lW=class extends U{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new HG)),this._register(e.multiDocumentHighlightProvider.register("*",new HG))}};lW=MWe([AWe(0,Se)],lW);var Jse=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},uc=function(s,e){return function(t,i){e(t,i,s)}},_i,cW;const SH=new be("hasWordHighlights",!1);function eoe(s,e,t,i){const n=s.ordered(e);return eB(n.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,qi)),o=>o!=null).then(o=>{if(o){const r=new Wi;return r.set(e.uri,o),r}return new Wi})}function PWe(s,e,t,i,n){const o=s.ordered(e);return eB(o.map(r=>()=>{const a=n.filter(l=>LX(l)).filter(l=>x8(r.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(r.provideMultiDocumentHighlights(e,t,a,i)).then(void 0,qi)}),r=>r!=null)}class toe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=on(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new I(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}}class OWe extends toe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return eoe(this._providers,e,t.getPosition(),n).then(o=>o||new Wi)}}class FWe extends toe{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return PWe(this._providers,e,t.getPosition(),n,this._otherModels).then(o=>o||new Wi)}}function WWe(s,e,t,i){return new OWe(e,t,i,s)}function BWe(s,e,t,i,n){return new FWe(e,t,i,s,n)}Lo("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(Se),n=await eoe(i.documentHighlightProvider,e,t,Je.None);return n==null?void 0:n.get(e.uri)});var rf;let dW=(rf=class{constructor(e,t,i,n,o,r,a,l){this.toUnhook=new X,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Wi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new la(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this.textModelService=o,this.configurationService=a,this.logService=l,this._hasWordHighlights=SH.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(c=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(c)})})),this.toUnhook.add(e.onDidFocusEditorText(c=>{this.occurrencesHighlightEnablement!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(c=>{HT(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(c=>{!c.newModelUrl&&c.oldModelUrl?this._stopSingular():_i.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(c=>{var h,u;const d=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==d)switch(this.occurrencesHighlightEnablement=d,d){case"off":this._stopAll();break;case"singleFile":this._stopAll((u=(h=_i.query)==null?void 0:h.modelInfo)==null?void 0:u.modelURI);break;case"multiFile":_i.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",d);break}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(c=>{if(c.affectsConfiguration("editor.occurrencesHighlightDelay")){const d=a.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==d&&(this.occurrencesHighlightDelay=d)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{var d,h;const c=this.codeEditorService.getFocusedCodeEditor();c?((d=c.getModel())==null?void 0:d.uri.scheme)===Ae.vscodeNotebookCell&&((h=this.editor.getModel())==null?void 0:h.uri.scheme)!==Ae.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,_i.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!=="off"&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}))}stop(){this.occurrencesHighlightEnablement!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(I.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);Qs(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);Qs(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=_i.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),_i.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||hf(n.getModel().uri,e))continue;const o=_i.storedDecorationIDs.get(n.getModel().uri);if(!o)continue;n.removeDecorations(o),i.push(n.getModel().uri);const r=yf.get(n);r!=null&&r.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)_i.storedDecorationIDs.delete(n)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Ae.vscodeNotebookCell&&((i=(t=_i.query)==null?void 0:t.modelInfo)==null?void 0:i.modelURI.scheme)!==Ae.vscodeNotebookCell?(_i.query=null,this._run()):(n=_i.query)!=null&&n.modelInfo&&(_i.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlightEnablement==="off"){this._stopAll();return}if(e.source!=="api"&&e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Ae.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Ae.vscodeNotebookCell&&o.push(l)}return o}const i=[],n=this.codeEditorService.listCodeEditors();for(const o of n){if(!x6(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlightEnablement==="singleFile")return[];for(const o of n){const r=o.getModel();r&&r!==e&&i.push(r)}return i}async _run(e,t){var n,o,r;if(this.editor.hasTextFocus()){const a=this.editor.getSelection();if(!a||a.startLineNumber!==a.endLineNumber){_i.query=null,this._stopAll();return}const l=a.startColumn,c=a.endColumn,d=this._getWord();if(!d||d.startColumn>l||d.endColumn<c){_i.query=null,this._stopAll();return}_i.query={modelInfo:{modelURI:this.model.uri,selection:a}}}else if(!_i.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),hf(this.editor.getModel().uri,(n=_i.query.modelInfo)==null?void 0:n.modelURI)){if(!e){const d=this.decorations.getRanges();for(const h of d)if(h.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);const a=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const l=this.getOtherModelsToHighlight(this.editor.getModel());if(!_i.query||!_i.query.modelInfo)return;const c=await this.textModelService.createModelReference(_i.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(c.object.textEditorModel,_i.query.modelInfo.selection,l),(o=this.workerRequest)==null||o.result.then(d=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=d||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},He)}catch(d){this.logService.error("Unexpected error during occurrence request. Log: ",d)}finally{c.dispose()}}else if(this.model.uri.scheme===Ae.vscodeNotebookCell){const a=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!_i.query||!_i.query.modelInfo)return;const l=await this.textModelService.createModelReference(_i.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(l.object.textEditorModel,_i.query.modelInfo.selection,[this.model]),(r=this.workerRequest)==null||r.result.then(c=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=c||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},He)}catch(c){this.logService.error("Unexpected error during occurrence request. Log: ",c)}finally{l.dispose()}}}computeWithModel(e,t,i){return i.length?BWe(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):WWe(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=new Date().getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},i-t)}renderDecorations(){var t,i,n;this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const o of e){const r=yf.get(o);if(!r)continue;const a=[],l=(t=o.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const c=_i.storedDecorationIDs.get(l),d=this.workerRequestValue.get(l);if(d)for(const u of d)u.range&&a.push({range:u.range,options:g7e(u.kind)});let h=[];o.changeDecorations(u=>{h=u.deltaDecorations(c??[],a)}),_i.storedDecorationIDs=_i.storedDecorationIDs.set(l,h),a.length>0&&((i=r.wordHighlighter)==null||i.decorations.set(a),(n=r.wordHighlighter)==null||n._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}},_i=rf,rf.storedDecorationIDs=new Wi,rf.query=null,rf);dW=_i=Jse([uc(4,Ms),uc(5,ft),uc(6,qe),uc(7,jt)],dW);var hm;let yf=(hm=class extends U{static get(e){return e.getContribution(cW.ID)}constructor(e,t,i,n,o,r,a){super(),this._wordHighlighter=null;const l=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==Ae.accessibleView&&(this._wordHighlighter=new dW(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,o,n,r,a))};this._register(e.onDidChangeModel(c=>{var d,h;this._wordHighlighter&&(!c.newModelUrl&&((d=c.oldModelUrl)==null?void 0:d.scheme)!==Ae.vscodeNotebookCell&&((h=this.wordHighlighter)==null||h.stop()),this._wordHighlighter.dispose(),this._wordHighlighter=null),l()})),l()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},cW=hm,hm.ID="editor.contrib.wordHighlighter",hm);yf=cW=Jse([uc(1,Fe),uc(2,Se),uc(3,ft),uc(4,Ms),uc(5,qe),uc(6,jt)],yf);class ioe extends we{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=yf.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class HWe extends ioe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:G(1572,"Go to Next Symbol Highlight"),precondition:SH,kbOpts:{kbExpr:F.editorTextFocus,primary:65,weight:100}})}}class VWe extends ioe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:G(1573,"Go to Previous Symbol Highlight"),precondition:SH,kbOpts:{kbExpr:F.editorTextFocus,primary:1089,weight:100}})}}class zWe extends we{constructor(){super({id:"editor.action.wordHighlight.trigger",label:G(1574,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:F.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=yf.get(t);n&&n.restoreViewState(!0)}}dt(yf.ID,yf,0);me(HWe);me(VWe);me(zWe);zC(lW);class g2 extends cn{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=ha(t.getOption(148),t.getOption(147)),o=t.getModel(),r=t.getSelections(),a=r.length>1,l=r.map(c=>{const d=new B(c.positionLineNumber,c.positionColumn),h=this._move(n,o,d,this._wordNavigationType,a);return this._moveTo(c,h,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>gt.fromModelSelection(c))),l.length===1){const c=new B(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new Ce(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Ce(t.lineNumber,t.column,t.lineNumber,t.column)}}class Mf extends g2{_move(e,t,i,n,o){return yt.moveWordLeft(e,t,i,n,o)}}class Af extends g2{_move(e,t,i,n,o){return yt.moveWordRight(e,t,i,n)}}class UWe extends Mf{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class $We extends Mf{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class jWe extends Mf{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ne.and(F.textInputFocus,(e=ne.and(TC,BR))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class qWe extends Mf{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class KWe extends Mf{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class GWe extends Mf{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ne.and(F.textInputFocus,(e=ne.and(TC,BR))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class YWe extends Mf{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,o){return super._move(ha(Ls.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class ZWe extends Mf{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(ha(Ls.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class XWe extends Af{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class QWe extends Af{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ne.and(F.textInputFocus,(e=ne.and(TC,BR))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class JWe extends Af{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class eBe extends Af{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class tBe extends Af{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ne.and(F.textInputFocus,(e=ne.and(TC,BR))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class iBe extends Af{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class nBe extends Af{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,o){return super._move(ha(Ls.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class sBe extends Af{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(ha(Ls.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class p2 extends cn{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e==null?void 0:e.get(ci);if(!t.hasModel()||!n)return;const o=ha(t.getOption(148),t.getOption(147)),r=t.getModel(),a=t.getSelections(),l=t.getOption(10),c=t.getOption(15),d=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const g=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Gn(g,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class yH extends p2{_delete(e,t){const i=yt.deleteWordLeft(e,t);return i||new I(1,1,1,1)}}class xH extends p2{_delete(e,t){const i=yt.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new I(n,o,n,o)}}class oBe extends yH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:F.writable})}}class rBe extends yH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:F.writable})}}class aBe extends yH{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:F.writable,kbOpts:{kbExpr:F.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class lBe extends xH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:F.writable})}}class cBe extends xH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:F.writable})}}class dBe extends xH{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:F.writable,kbOpts:{kbExpr:F.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class hBe extends we{constructor(){super({id:"deleteInsideWord",precondition:F.writable,label:G(1575,"Delete Word")})}run(e,t,i){if(!t.hasModel())return;const n=ha(t.getOption(148),t.getOption(147)),o=t.getModel(),a=t.getSelections().map(l=>{const c=yt.deleteInsideWord(n,o,l);return new Gn(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}_e(new UWe);_e(new $We);_e(new jWe);_e(new qWe);_e(new KWe);_e(new GWe);_e(new XWe);_e(new QWe);_e(new JWe);_e(new eBe);_e(new tBe);_e(new iBe);_e(new YWe);_e(new ZWe);_e(new nBe);_e(new sBe);_e(new oBe);_e(new rBe);_e(new aBe);_e(new lBe);_e(new cBe);_e(new dBe);me(hBe);class uBe extends p2{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:F.writable,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=wR.deleteWordPartLeft(e);return i||new I(1,1,1,1)}}class fBe extends p2{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:F.writable,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=wR.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new I(n,o,n,o)}}class noe extends g2{_move(e,t,i,n,o){return wR.moveWordPartLeft(e,t,i,o)}}class gBe extends noe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}ct.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class pBe extends noe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}ct.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class soe extends g2{_move(e,t,i,n,o){return wR.moveWordPartRight(e,t,i)}}class mBe extends soe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class _Be extends soe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}_e(new uBe);_e(new fBe);_e(new gBe);_e(new pBe);_e(new mBe);_e(new _Be);const GH=class GH extends U{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=jo.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(this.editor.isSimpleWidget?t=new rs(m(1378,"Cannot edit in read-only input")):t=new rs(m(1379,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};GH.ID="editor.contrib.readOnlyMessageController";let ME=GH;dt(ME.ID,ME,2);var bBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},VG=function(s,e){return function(t,i){e(t,i,s)}};let hW=class extends U{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Oe(this,void 0);const n=Wo("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Wo("_textModel.onDidChangeContent",ge.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(hs(async(r,a)=>{n.read(r),o.read(r);const l=a.add(new mNe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return n.sort(zY(Xn(o=>o.range.endLineNumber-o.range.startLineNumber,Uo))),n.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};hW=bBe([VG(1,Se),VG(2,Yy)],hW);SD.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(hW,s));var vBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},jA=function(s,e){return function(t,i){e(t,i,s)}},Av;let AE=(Av=class extends U{constructor(e,t,i,n){super();const o=this._register(ai(e)),r=this._register(n.createMenu(ye.EditorContent,e.contextKeyService)),a=vt(this,r.onDidChange,()=>r.getActions().length===0);this._register(Me(l=>{if(a.read(l))return;const d=ht("div.floating-menu-overlay-widget");d.root.style.height="28px";const h=t.createInstance(yS,d.root,ye.EditorContent,{actionViewItemProvider:(u,f)=>{if(!(u instanceof kr))return;const g=i.lookupKeybinding(u.id);if(g)return t.createInstance(class extends bf{updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${g.getLabel()})`)}},u,{...f,keybindingNotRenderedWithLabel:!0})},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});l.store.add(h),l.store.add(Me(u=>{const f=o.model.read(u);h.context=f==null?void 0:f.uri})),l.store.add(o.createOverlayWidget({allowEditorOverflow:!1,domNode:d.root,minContentWidthInPx:zt(0),position:zt({preference:1})}))}))}},Av.ID="editor.contrib.floatingToolbar",Av);AE=vBe([jA(1,ke),jA(2,mt),jA(3,ga)],AE);dt(AE.ID,AE,1);const YH=class YH extends U{constructor(e){super(),this.editor=e,this.widget=null,aa&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new uW(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};YH.ID="editor.contrib.iPadShowKeyboard";let PE=YH;const DT=class DT extends U{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(j(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(j(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return DT.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};DT.ID="editor.contrib.ShowKeyboardWidget";let uW=DT;dt(PE.ID,PE,3);var CBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},zG=function(s,e){return function(t,i){e(t,i,s)}},fW,um;let ey=(um=class extends U{static get(e){return e.getContribution(fW.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(vi.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new gW(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},fW=um,um.ID="editor.contrib.inspectTokens",um);ey=fW=CBe([zG(1,Or),zG(2,Li)],ey);class wBe extends we{constructor(){super({id:"editor.action.inspectTokens",label:HF.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=ey.get(t);i==null||i.launch()}}function SBe(s){let e="";for(let t=0,i=s.length;t<i;t++){const n=s.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function yBe(s,e){const t=vi.get(e);if(t)return t;const i=s.encodeLanguageId(e);return{getInitialState:()=>qv,tokenize:(n,o,r)=>LB(e,r),tokenizeEncoded:(n,o,r)=>cR(i,r)}}const ET=class ET extends U{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=yBe(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return ET._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const o=this._model.getLineContent(e.lineNumber);let r="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,c=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;r=o.substring(l,c)}_n(this._domNode,he("h2.tm-token",void 0,SBe(r),he("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),ae(this._domNode,he("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;ae(this._domNode,he("table.tm-metadata-table",void 0,he("tbody",void 0,he("tr",void 0,he("td.tm-metadata-key",void 0,"language"),he("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"token type"),he("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"font style"),he("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"foreground"),he("td.tm-metadata-value",void 0,`${a?J.Format.CSS.formatHex(a.foreground):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"background"),he("td.tm-metadata-value",void 0,`${a?J.Format.CSS.formatHex(a.background):"-?-"}`))))),ae(this._domNode,he("hr.tokens-inspect-separator")),i<t.tokens1.length&&ae(this._domNode,he("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=vi.getColorMap(),i=os.getLanguageId(e),n=os.getTokenType(e),o=os.getFontStyle(e),r=os.getForeground(e),a=os.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:o,foreground:t[r],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};ET._ID="editor.contrib.inspectTokensWidget";let gW=ET;dt(ey.ID,ey,4);me(wBe);var xBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},UG=function(s,e){return function(t,i){e(t,i,s)}},Zw,fm;let pW=(fm=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=pi.as(l_.Quickaccess)}provide(e){const t=new X;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(Zw.PREFIX.length));n&&n.prefix&&n.prefix!==Zw.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==Zw.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:m(1747,"{0}, {1}",n,t.description),description:t.description}})}},Zw=fm,fm.PREFIX="?",fm);pW=Zw=xBe([UG(0,gs),UG(1,mt)],pW);pi.as(l_.Quickaccess).registerQuickAccessProvider({ctor:pW,prefix:"",helpEntries:[{description:VF.helpQuickAccessActionLabel}]});class ooe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var r;const n=new X;e.canAcceptInBackground=!!((r=this.options)!=null&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new wt);return o.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new X,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=nie(o);if(a){let l=o.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=o.saveViewState()??void 0})),r.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},n.add(mm(t.onCancellationRequested)(()=>{var c;return(c=r.restoreViewState)==null?void 0:c.call(r)}))}n.add(xe(()=>this.clearDecorations(o))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Ll(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return x6(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Ci(AQ),position:Dr.Full}}}],[r,a]=i.deltaDecorations(n,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const Fg=class Fg extends ooe{constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(Fg.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(e){this.storageService.store(Fg.ZERO_BASED_OFFSET_STORAGE_KEY,e,-1,0)}provideWithoutTextEditor(e){const t=m(1335,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,U.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new X;o.add(t.onDidAccept(c=>{const[d]=t.selectedItems;if(d){if(!d.lineNumber)return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=t.value.trim().substring(Fg.PREFIX.length),{inOffsetMode:d,lineNumber:h,column:u,label:f}=this.parsePosition(n,c);if(a.visible=!!d,t.items=[{lineNumber:h,column:u,label:f}],t.ariaLabel=f,!h){this.clearDecorations(n);return}const g=this.toRange(h,u);n.revealRangeInCenter(g,0),this.addDecorations(n,g)},a=new Rh({title:m(1336,"Use Zero-Based Offset"),icon:oe.indexZero,isChecked:this.useZeroBasedOffset,inputActiveOptionBorder:de(Sy),inputActiveOptionForeground:de(yy),inputActiveOptionBackground:de(AC)});o.add(a.onChange(()=>{this.useZeroBasedOffset=!this.useZeroBasedOffset,r()})),t.toggles=[a],r(),o.add(t.onDidChangeValue(()=>r()));const l=nie(n);return l&&l.getOptions().get(76).renderType===2&&(l.updateOptions({lineNumbers:"on"}),o.add(xe(()=>l.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){var n,o;const i=this.getModel(e);if(!i)return{label:m(1337,"Open a text editor first to go to a line.")};if(t.startsWith(":")){let r=parseInt(t.substring(1),10);const a=i.getValueLength();if(isNaN(r))return{inOffsetMode:!0,label:this.useZeroBasedOffset?m(1338,"Type a character position to go to (from 0 to {0}).",a-1):m(1339,"Type a character position to go to (from 1 to {0}).",a)};{const l=r<0;this.useZeroBasedOffset||(r-=Math.sign(r)),l&&(r+=a);const c=i.getPositionAt(r);return{...c,inOffsetMode:!0,label:m(1340,"Press 'Enter' to go to line {0} at column {1}.",c.lineNumber,c.column)}}}else{const r=t.split(/,|:|#/),a=i.getLineCount();let l=parseInt((n=r[0])==null?void 0:n.trim(),10);if(r.length<1||isNaN(l))return{label:m(1341,"Type a line number to go to (from 1 to {0}).",a)};l=l>=0?l:a+1+l,l=Math.min(Math.max(1,l),a);const c=i.getLineMaxColumn(l);let d=parseInt((o=r[1])==null?void 0:o.trim(),10);return r.length<2||isNaN(d)?{lineNumber:l,column:1,label:r.length<2?m(1342,"Press 'Enter' to go to line {0} or enter : to add a column number.",l):m(1343,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",l,c)}:(d=d>=0?d:c+d,d=Math.min(Math.max(1,d),c),{lineNumber:l,column:d,label:m(1344,"Press 'Enter' to go to line {0} at column {1}.",l,d)})}}};Fg.PREFIX=":",Fg.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset";let mW=Fg;var LBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$G=function(s,e){return function(t,i){e(t,i,s)}};let ty=class extends mW{constructor(e,t){super(),this.editorService=e,this.storageService=t,this.onDidActiveTextEditorControlChange=ge.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};ty=LBe([$G(0,ft),$G(1,As)],ty);var gm;let roe=(gm=class extends we{constructor(){super({id:gm.ID,label:UI.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:F.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(gs).quickAccess.show(ty.PREFIX)}},gm.ID="editor.action.gotoLine",gm);me(roe);pi.as(l_.Quickaccess).registerQuickAccessProvider({ctor:ty,prefix:ty.PREFIX,helpEntries:[{description:UI.gotoLineActionLabel,commandId:roe.ID}]});const aoe=[void 0,[]];function qA(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?kBe(s,n.values,t,i):loe(s,e,t,i)}function kBe(s,e,t,i){let n=0;const o=[];for(const r of e){const[a,l]=loe(s,r,t,i);if(typeof a!="number")return aoe;n+=a,o.push(...l)}return[n,IBe(o)]}function loe(s,e,t,i){const n=Nm(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],Ny(n)]:aoe}function IBe(s){const e=s.sort((n,o)=>n.start-o.start),t=[];let i;for(const n of e)!i||!DBe(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function DBe(s,e){return!(s.end<e.start||e.end<s.start)}function jG(s){return s.startsWith('"')&&s.endsWith('"')}const coe=" ";function _W(s){typeof s!="string"&&(s="");const e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=qG(s),o=t.indexOf(bl)>=0,r=jG(s);let a;const l=s.split(coe);if(l.length>1)for(const c of l){const d=jG(c),{pathNormalized:h,normalized:u,normalizedLowercase:f}=qG(c);u&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function qG(s){let e;An?e=s.replace(/\//g,bl):e=s.replace(/\\/g,bl);const t=e.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function KG(s){return Array.isArray(s)?_W(s.map(e=>e.original).join(coe)):_W(s.original)}var EBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},GG=function(s,e){return function(t,i){e(t,i,s)}},_k,ul;let mp=(ul=class extends ooe{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,m(1345,"To go to a symbol, first open a text editor with symbol information.")),U.None}provideWithTextEditor(e,t,i,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):U.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new X;return this.provideLabelPick(i,m(1346,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||n.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new Qm,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(xe(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,o){var h;const r=e.editor,a=new X;a.add(i.onDidAccept(u=>{var g;const[f]=i.selectedItems;f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:i.keyMods,preserveFocus:u.inBackground}),(g=o==null?void 0:o.handleAccept)==null||g.call(o,f,u.inBackground),u.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n),c=a.add(new wt),d=async u=>{var f;(f=c==null?void 0:c.value)==null||f.cancel(),i.busy=!1,c.value=new ii,i.busy=!0;try{const g=_W(i.value.substr(_k.PREFIX.length).trim()),p=await this.doGetSymbolPicks(l,g,void 0,c.value.token,t);if(n.isCancellationRequested)return;if(p.length>0){if(i.items=p,u&&g.original.length===0){const _=T0(p,v=>!!(v.type!=="separator"&&v.range&&I.containsPosition(v.range.decoration,u)));_&&(i.activeItems=[_])}}else g.original.length>0?this.provideLabelPick(i,m(1347,"No matching editor symbols")):this.provideLabelPick(i,m(1348,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d((h=r.getSelection())==null?void 0:h.getPosition()),a.add(i.onDidChangeActive(()=>{const[u]=i.activeItems;u&&u.range&&(r.revealRangeInCenter(u.range.selection,0),this.addDecorations(r,u.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,o){var _,v;const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(_k.SCOPE_PREFIX)===0,l=a?1:0;let c,d;t.values&&t.values.length>1?(c=KG(t.values[0]),d=KG(t.values.slice(1))):c=t;let h;const u=(v=(_=this.options)==null?void 0:_.openSideBySideDirection)==null?void 0:v.call(_);u&&(h=[{iconClass:u==="right"?Te.asClassName(oe.splitHorizontal):Te.asClassName(oe.splitVertical),tooltip:u==="right"?m(1349,"Open to the Side"):m(1350,"Open to the Bottom")}]);const f=[];for(let b=0;b<r.length;b++){const w=r[b],C=ede(w.name),S=`$(${Pk.toIcon(w.kind).id}) ${C}`,x=S.length-C.length;let y=w.containerName;i!=null&&i.extraContainerLabel&&(y?y=`${i.extraContainerLabel} • ${y}`:y=i.extraContainerLabel);let L,D,E,T;if(t.original.length>l){let M=!1;if(c!==t&&([L,D]=qA(S,{...t,values:void 0},l,x),typeof L=="number"&&(M=!0)),typeof L!="number"&&([L,D]=qA(S,c,l,x),typeof L!="number"))continue;if(!M&&d){if(y&&d.original.length>0&&([E,T]=qA(y,d)),typeof E!="number")continue;typeof L=="number"&&(L+=E)}}const N=w.tags&&w.tags.indexOf(1)>=0;f.push({index:b,kind:w.kind,score:L,label:S,ariaLabel:Kce(w.name,w.kind),description:y,highlights:N?void 0:{label:D,description:T},range:{selection:I.collapseToStart(w.selectionRange),decoration:w.range},uri:o.uri,symbolName:C,strikethrough:N,buttons:h})}const g=f.sort((b,w)=>a?this.compareByKindAndScore(b,w):this.compareByScore(b,w));let p=[];if(a){let S=function(){w&&typeof b=="number"&&C>0&&(w.label=Cm(GA[b]||KA,C))},b,w,C=0;for(const x of g)b!==x.kind?(S(),b=x.kind,C=1,w={type:"separator"},p.push(w)):C++,p.push(x);S()}else g.length>0&&(p=[{label:m(1351,"symbols ({0})",f.length),type:"separator"},...g]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=GA[e.kind]||KA,n=GA[t.kind]||KA,o=i.localeCompare(n);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},_k=ul,ul.PREFIX="@",ul.SCOPE_PREFIX=":",ul.PREFIX_BY_CATEGORY=`${ul.PREFIX}${ul.SCOPE_PREFIX}`,ul);mp=_k=EBe([GG(0,Se),GG(1,Yy)],mp);const KA=m(1352,"properties ({0})"),GA={5:m(1353,"methods ({0})"),11:m(1354,"functions ({0})"),8:m(1355,"constructors ({0})"),12:m(1356,"variables ({0})"),4:m(1357,"classes ({0})"),22:m(1358,"structs ({0})"),23:m(1359,"events ({0})"),24:m(1360,"operators ({0})"),10:m(1361,"interfaces ({0})"),2:m(1362,"namespaces ({0})"),3:m(1363,"packages ({0})"),25:m(1364,"type parameters ({0})"),1:m(1365,"modules ({0})"),6:m(1366,"properties ({0})"),9:m(1367,"enumerations ({0})"),21:m(1368,"enumeration members ({0})"),14:m(1369,"strings ({0})"),0:m(1370,"files ({0})"),17:m(1371,"arrays ({0})"),15:m(1372,"numbers ({0})"),16:m(1373,"booleans ({0})"),18:m(1374,"objects ({0})"),19:m(1375,"keys ({0})"),7:m(1376,"fields ({0})"),13:m(1377,"constants ({0})")};var NBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},YA=function(s,e){return function(t,i){e(t,i,s)}};let bW=class extends mp{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=ge.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};bW=NBe([YA(0,ft),YA(1,Se),YA(2,Yy)],bW);const NT=class NT extends we{constructor(){super({id:NT.ID,label:dS.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:F.hasDocumentSymbolProvider,kbOpts:{kbExpr:F.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(gs).quickAccess.show(mp.PREFIX,{itemActivation:sl.NONE})}};NT.ID="editor.action.quickOutline";let OE=NT;me(OE);pi.as(l_.Quickaccess).registerQuickAccessProvider({ctor:bW,prefix:mp.PREFIX,helpEntries:[{description:dS.quickOutlineActionLabel,prefix:mp.PREFIX,commandId:OE.ID},{description:dS.quickOutlineByCategoryActionLabel,prefix:mp.PREFIX_BY_CATEGORY}]});function TBe(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class j1{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,n);c>0&&o.push({key:r,score:c})}}return o}static termFrequencies(e){return TBe(j1.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const o of n)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield t(o))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const o=j1.termFrequencies(n);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,tf:o})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const o=this.chunkOccurrences.get(n);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=i.get(o);typeof l!="number"&&(l=this.computeIdf(o),i.set(o,l));const c=a*l;n+=c*r}return n}computeEmbedding(e){const t=j1.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const o=this.computeIdf(i);o>0&&(t[i]=n*o)}return t}}function RBe(s){var i;const e=s.slice(0);e.sort((n,o)=>o.score-n.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const n of e)n.score/=t;return e}var kb;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(kb||(kb={}));function ZA(s){const e=s;return Array.isArray(e.items)}function YG(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class MBe extends U{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var c;const n=new X;e.canAcceptInBackground=!!((c=this.options)!=null&&c.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=n.add(new wt),a=async()=>{var _;o==null||o.dispose(!0),e.busy=!1;const d=r.value=new X;o=d.add(new ii(t));const h=o.token;let u=e.value.substring(this.prefix.length);(_=this.options)!=null&&_.shouldSkipTrimPickFilter||(u=u.trim());const f=this._getPicks(u,d,h,i),g=(v,b)=>{var S;let w,C;if(ZA(v)?(w=v.items,C=v.active):w=v,w.length===0){if(b)return!1;(u.length>0||e.hideInput)&&((S=this.options)!=null&&S.noResultsPick)&&(pm(this.options.noResultsPick)?w=[this.options.noResultsPick(u)]:w=[this.options.noResultsPick])}return e.items=w,C&&(e.activeItems=[C]),!0},p=async v=>{let b=!1,w=!1;await Promise.all([(async()=>{typeof v.mergeDelay=="number"&&(await Rc(v.mergeDelay),h.isCancellationRequested)||w||(b=g(v.picks,!0))})(),(async()=>{e.busy=!0;try{const C=await v.additionalPicks;if(h.isCancellationRequested)return;let S,x;ZA(v.picks)?(S=v.picks.items,x=v.picks.active):S=v.picks;let y,L;if(ZA(C)?(y=C.items,L=C.active):y=C,y.length>0||!b){let D;if(!x&&!L){const E=e.activeItems[0];E&&S.indexOf(E)!==-1&&(D=E)}g({items:[...S,...y],active:x||L||D})}}finally{h.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(f!==null)if(YG(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const v=await f;if(h.isCancellationRequested)return;YG(v)?await p(v):g(v)}finally{h.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(d=>{var u;if(i!=null&&i.handleAccept){d.inBackground||e.hide(),(u=i.handleAccept)==null||u.call(i,e.activeItems[0],d.inBackground);return}const[h]=e.selectedItems;typeof(h==null?void 0:h.accept)=="function"&&(d.inBackground||e.hide(),h.accept(e.keyMods,d))}));const l=async(d,h)=>{var f;if(typeof h.trigger!="function")return;const u=((f=h.buttons)==null?void 0:f.indexOf(d))??-1;if(u>=0){const g=h.trigger(u,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case kb.NO_ACTION:break;case kb.CLOSE_PICKER:e.hide();break;case kb.REFRESH_PICKER:a();break;case kb.REMOVE_ITEM:{const _=e.items.indexOf(h);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),w=e.activeItems.filter(S=>S!==b[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,w&&(e.activeItems=w),e.keepScrollPosition=C}break}}}};return n.add(e.onDidTriggerItemButton(({button:d,item:h})=>l(d,h))),n.add(e.onDidTriggerSeparatorButton(({button:d,separator:h})=>l(d,h))),n}}new Ua(1e4);const ABe=new Ua(1e4);function PBe(s){return FBe(s,"NFD",ABe)}const OBe=/[^\u0000-\u0080]/;function FBe(s,e,t){if(!s)return s;const i=t.get(s);if(i)return i;let n;return OBe.test(s)?n=s.normalize(e):n=s,t.set(s,n),n}const WBe=function(){const s=/[\u0300-\u036f]/g;return function(e){return PBe(e).replace(s,"")}}();var doe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},du=function(s,e){return function(t,i){e(t,i,s)}},cg,Qi,Cc;let vW=(Cc=class extends MBe{constructor(e,t,i,n,o,r){super(cg.PREFIX,e),this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(t.createInstance(CW)),this.options=e}async _getPicks(e,t,i,n){var g,p;const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=mm(()=>{const _=new j1;_.updateDocuments(o.map(b=>({key:b.commandId,textChunks:[this.getTfIdfChunk(b)]})));const v=_.calculateScores(e,i);return RBe(v).filter(b=>b.score>cg.TFIDF_THRESHOLD).slice(0,cg.TFIDF_MAX_RESULTS)}),a=this.normalizeForFiltering(e),l=[];for(const _ of o){_.labelNoAccents??(_.labelNoAccents=this.normalizeForFiltering(_.label));const v=cg.WORD_FILTER(a,_.labelNoAccents)??void 0;let b;if(_.commandAlias&&(_.aliasNoAccents??(_.aliasNoAccents=this.normalizeForFiltering(_.commandAlias)),b=cg.WORD_FILTER(a,_.aliasNoAccents)??void 0),v||b)_.highlights={label:v,detail:this.options.showAlias?b:void 0},l.push(_);else if(e===_.commandId)l.push(_);else if(e.length>=3){const w=r();if(i.isCancellationRequested)return[];const C=w.find(S=>S.key===_.commandId);C&&(_.tfIdfScore=C.score,l.push(_))}}const c=new Map;for(const _ of l){const v=c.get(_.label);v?(_.description=_.commandId,v.description=v.commandId):c.set(_.label,_)}l.sort((_,v)=>{if(_.tfIdfScore&&v.tfIdfScore)return _.tfIdfScore===v.tfIdfScore?_.label.localeCompare(v.label):v.tfIdfScore-_.tfIdfScore;if(_.tfIdfScore)return 1;if(v.tfIdfScore)return-1;const b=this.commandsHistory.peek(_.commandId),w=this.commandsHistory.peek(v.commandId);if(b&&w)return b>w?-1:1;if(b)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const x=this.options.suggestedCommandIds.has(_.commandId),y=this.options.suggestedCommandIds.has(v.commandId);if(x&&y)return 0;if(x)return-1;if(y)return 1}const C=_.commandCategory===X7.Developer.value,S=v.commandCategory===X7.Developer.value;return C&&!S?1:!C&&S?-1:_.label.localeCompare(v.label)});const d=[];let h=!1,u=!0,f=!!this.options.suggestedCommandIds;for(let _=0;_<l.length;_++){const v=l[_];_===0&&this.commandsHistory.peek(v.commandId)&&(d.push({type:"separator",label:m(1740,"recently used")}),h=!0),u&&v.tfIdfScore!==void 0&&(d.push({type:"separator",label:m(1741,"similar commands")}),u=!1),f&&v.tfIdfScore===void 0&&!this.commandsHistory.peek(v.commandId)&&((g=this.options.suggestedCommandIds)!=null&&g.has(v.commandId))&&(d.push({type:"separator",label:m(1742,"commonly used")}),h=!0,f=!1),h&&v.tfIdfScore===void 0&&!this.commandsHistory.peek(v.commandId)&&!((p=this.options.suggestedCommandIds)!=null&&p.has(v.commandId))&&(d.push({type:"separator",label:m(1743,"other commands")}),h=!1),d.push(this.toCommandPick(v,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:d,additionalPicks:(async()=>{var b;const _=await this.getAdditionalCommandPicks(o,l,e,i);if(i.isCancellationRequested)return[];const v=_.map(w=>this.toCommandPick(w,n));return u&&((b=v[0])==null?void 0:b.type)!=="separator"&&v.unshift({type:"separator",label:m(1744,"similar commands")}),v})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?m(1745,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var o;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(o=e.args)!=null&&o.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(r){Mr(r)||this.dialogService.error(m(1746,"Command '{0}' resulted in an error",e.label),ED(r))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}normalizeForFiltering(e){const t=WBe(e);return t.length!==e.length?(this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch",{originalLength:e.length,normalizedLength:t.length}),e):t}},cg=Cc,Cc.PREFIX=">",Cc.TFIDF_THRESHOLD=.5,Cc.TFIDF_MAX_RESULTS=5,Cc.WORD_FILTER=k8(nS,GSe,KJ),Cc);vW=cg=doe([du(1,ke),du(2,mt),du(3,qt),du(4,ms),du(5,Ey)],vW);var fl;let CW=(fl=class extends U{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===Ou.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Qi.getConfiguredCommandHistoryLength(this.configurationService),Qi.cache&&Qi.cache.limit!==this.configuredCommandsHistoryLength&&(Qi.cache.limit=this.configuredCommandsHistoryLength,Qi.hasChanges=!0))}load(){const e=this.storageService.get(Qi.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=Qi.cache=new Ua(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((o,r)=>o.value-r.value),n.forEach(o=>i.set(o.key,o.value))}Qi.counter=this.storageService.getNumber(Qi.PREF_KEY_COUNTER,0,Qi.counter)}push(e){Qi.cache&&(Qi.cache.set(e,Qi.counter++),Qi.hasChanges=!0)}peek(e){var t;return(t=Qi.cache)==null?void 0:t.peek(e)}saveState(){if(!Qi.cache||!Qi.hasChanges)return;const e={usesLRU:!0,entries:[]};Qi.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Qi.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Qi.PREF_KEY_COUNTER,Qi.counter,0,0),Qi.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var n,o;const i=(o=(n=e.getValue().workbench)==null?void 0:n.commandPalette)==null?void 0:o.history;return typeof i=="number"?i:Qi.DEFAULT_COMMANDS_HISTORY_LENGTH}},Qi=fl,fl.DEFAULT_COMMANDS_HISTORY_LENGTH=50,fl.PREF_KEY_CACHE="commandPalette.mru.cache",fl.PREF_KEY_COUNTER="commandPalette.mru.counter",fl.counter=1,fl.hasChanges=!1,fl);CW=Qi=doe([du(0,As),du(1,qe),du(2,jt)],CW);class BBe extends vW{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let o;(i=n.metadata)!=null&&i.description&&(Oke(n.metadata.description)?o=n.metadata.description:o={original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:o,label:R8(n.label)||n.id})}return t}}var HBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$_=function(s,e){return function(t,i){e(t,i,s)}};let iy=class extends BBe{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,o,r){super({showAlias:!1},e,i,n,o,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};iy=HBe([$_(0,ke),$_(1,ft),$_(2,mt),$_(3,qt),$_(4,ms),$_(5,Ey)],iy);const TT=class TT extends we{constructor(){super({id:TT.ID,label:$I.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:F.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(gs).quickAccess.show(iy.PREFIX)}};TT.ID="editor.action.quickCommand";let FE=TT;me(FE);pi.as(l_.Quickaccess).registerQuickAccessProvider({ctor:iy,prefix:iy.PREFIX,helpEntries:[{description:$I.quickCommandHelp,commandId:FE.ID}]});var VBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},j_=function(s,e){return function(t,i){e(t,i,s)}};let wW=class extends qm{constructor(e,t,i,n,o,r,a){super(!0,e,t,i,n,o,r,a)}};wW=VBe([j_(1,Fe),j_(2,ft),j_(3,ki),j_(4,ke),j_(5,As),j_(6,qe)],wW);dt(qm.ID,wW,4);class zBe extends we{constructor(){super({id:"editor.action.toggleHighContrast",label:UF.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Or),n=i.getColorTheme();wl(n.type)?(i.setTheme(this._originalThemeName||(_h(n.type)?uv:Ad)),this._originalThemeName=null):(i.setTheme(_h(n.type)?fp:gp),this._originalThemeName=n.themeName)}}me(zBe);const hoe={},XA={};class LH{static getOrCreate(e){return XA[e]||(XA[e]=new LH(e)),XA[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,hoe[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}}function UBe(s){const e=s.id;hoe[e]=s,Cb.register(s);const t=LH.getOrCreate(e);Cb.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Cb.onLanguageEncountered(e,async()=>{const i=await t.load();Cb.setLanguageConfiguration(e,i.conf)})}UBe({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>s2e(()=>import("./yaml-t4YZ9nNk.js"),__vite__mapDeps([0,1]),import.meta.url)});globalThis.MonacoEnvironment={getWorker:()=>new Worker(new URL(""+new URL("editor.worker-CKy7Pnvo.js",import.meta.url).href,import.meta.url),{type:"module"})};TW.config({monaco:t2e});var SW={},ZG=vre;SW.createRoot=ZG.createRoot,SW.hydrateRoot=ZG.hydrateRoot;function $Be(s,e){return e.find(t=>t.repository===s)}function uoe(s,e){const t=$Be(s,e);if(!t)return;const i=t.name.indexOf("/");return i>0?{project:t.name.slice(0,i),repoName:t.name.slice(i+1),ref:t.ref}:{repoName:t.name,ref:t.ref}}function jBe(s){let e=s,t;const i=e.lastIndexOf("@");return i>0&&(t=e.slice(i+1),e=e.slice(0,i),t==="self"&&(t=void 0)),e=e.replace(/\\/g,"/"),e=e.replace(/^\.\//,""),{normalizedPath:e,repoAlias:t}}function vv(s,e,t,i=!1,n={},o){const{normalizedPath:r,repoAlias:a}=jBe(s);return{rawPath:s,normalizedPath:r,repoAlias:a,contextRepoAlias:a??n.contextRepoAlias,sourcePath:n.sourcePath,parameters:t,location:e,conditional:i,conditionExpression:o}}function Cv(s){return s.repoAlias??s.contextRepoAlias}function qBe(s){if(s.normalizedPath.startsWith("/"))return{primary:s.normalizedPath};if(s.repoAlias||!s.sourcePath)return{primary:s.normalizedPath};const e=KBe(s.sourcePath);if(!e)return{primary:s.normalizedPath};const t=foe(`${e}/${s.normalizedPath}`);return t===s.normalizedPath?{primary:t}:{primary:t,fallback:s.normalizedPath}}function KBe(s){const e=s.replace(/\\/g,"/"),t=e.lastIndexOf("/");return t<0?"":t===0?"/":e.slice(0,t)}function foe(s){const e=s.startsWith("/"),t=s.split("/").filter(o=>o!==""&&o!=="."),i=[];for(const o of t)o===".."?i.length>0&&i[i.length-1]!==".."?i.pop():e||i.push(o):i.push(o);const n=i.join("/");return e?`/${n}`:n}function GBe(s){try{const e=new URL(s);if(!e.hostname.endsWith("dev.azure.com"))return null;const t=e.pathname.split("/").filter(Boolean);if(t.length<4||t[2]!=="_git")return null;const i=decodeURIComponent(t[0]),n=decodeURIComponent(t[1]),o=decodeURIComponent(t[3]),r=e.searchParams.get("path")||"",a=e.searchParams.get("version");let l,c;return a!=null&&a.startsWith("GB")?(l=a.slice(2),c=`refs/heads/${l}`):a!=null&&a.startsWith("GT")&&(c=`refs/tags/${a.slice(2)}`),r?{org:i,project:n,repoName:o,filePath:r,branch:l,ref:c}:null}catch{return null}}function goe(s){var i,n;const e=`https://dev.azure.com/${encodeURIComponent(s.org)}/${encodeURIComponent(s.project)}/_git/${encodeURIComponent(s.repoName)}`,t=new URLSearchParams({path:s.filePath});return(i=s.ref)!=null&&i.startsWith("refs/tags/")?t.set("version",`GT${s.ref.replace("refs/tags/","")}`):(n=s.ref)!=null&&n.startsWith("refs/heads/")?t.set("version",`GB${s.ref.replace("refs/heads/","")}`):s.branch&&t.set("version",`GB${s.branch}`),`${e}?${t}`}function YBe(s){const e=[];let t=0;for(;t<s.length;){if(/\s/.test(s[t])){t++;continue}if(s[t]==="'"){let i="";for(t++;t<s.length&&s[t]!=="'";)s[t]==="\\"&&t+1<s.length&&t++,i+=s[t],t++;t++,e.push({type:"STRING",value:i});continue}if(s[t]==="("){e.push({type:"LPAREN",value:"("}),t++;continue}if(s[t]===")"){e.push({type:"RPAREN",value:")"}),t++;continue}if(s[t]===","){e.push({type:"COMMA",value:","}),t++;continue}if(s[t]==="."){e.push({type:"DOT",value:"."}),t++;continue}if(s[t]==="["){e.push({type:"LBRACKET",value:"["}),t++;continue}if(s[t]==="]"){e.push({type:"RBRACKET",value:"]"}),t++;continue}if(/\d/.test(s[t])||s[t]==="-"&&t+1<s.length&&/\d/.test(s[t+1])){let i="";for(s[t]==="-"&&(i+="-",t++);t<s.length&&/[\d.]/.test(s[t]);)i+=s[t],t++;e.push({type:"NUMBER",value:i});continue}if(/[a-zA-Z_]/.test(s[t])){let i="";for(;t<s.length&&/[a-zA-Z0-9_]/.test(s[t]);)i+=s[t],t++;i==="true"||i==="false"?e.push({type:"BOOL",value:i}):i==="null"?e.push({type:"NULL",value:"null"}):e.push({type:"IDENT",value:i});continue}t++}return e}class ZBe{constructor(e){Mi(this,"tokens");Mi(this,"pos",0);this.tokens=e}parse(){return this.parseExpression()}peek(){return this.tokens[this.pos]}advance(){return this.tokens[this.pos++]}expect(e){const t=this.advance();if(!t||t.type!==e)throw new Error(`Expected ${e} but got ${(t==null?void 0:t.type)??"EOF"} (${t==null?void 0:t.value})`);return t}parseExpression(){const e=this.peek();if(!e)throw new Error("Unexpected end of expression");switch(e.type){case"STRING":return this.advance(),{kind:"string",value:e.value};case"NUMBER":return this.advance(),{kind:"number",value:Number(e.value)};case"BOOL":return this.advance(),{kind:"boolean",value:e.value==="true"};case"NULL":return this.advance(),{kind:"null"};case"IDENT":return this.parseIdentifierOrCall();default:throw new Error(`Unexpected token: ${e.type} (${e.value})`)}}parseIdentifierOrCall(){var t,i,n,o,r,a,l,c;const e=this.advance();if(((t=this.peek())==null?void 0:t.type)==="LPAREN"){this.advance();const d=[];if(((i=this.peek())==null?void 0:i.type)!=="RPAREN")for(d.push(this.parseExpression());((n=this.peek())==null?void 0:n.type)==="COMMA";)this.advance(),d.push(this.parseExpression());return this.expect("RPAREN"),{kind:"functionCall",name:e.value,args:d}}if(((o=this.peek())==null?void 0:o.type)==="DOT"){const d=[e.value];for(;((r=this.peek())==null?void 0:r.type)==="DOT";){this.advance();const h=this.peek();if((h==null?void 0:h.type)==="IDENT")d.push(this.advance().value);else if((h==null?void 0:h.type)==="BOOL")d.push(this.advance().value);else break}for(;((a=this.peek())==null?void 0:a.type)==="LBRACKET";){this.advance();const h=this.expect("STRING");d.push(h.value),this.expect("RBRACKET")}return d[0]==="parameters"?{kind:"parameterAccess",path:d.slice(1)}:d[0]==="variables"?{kind:"variableAccess",path:d.slice(1)}:{kind:"identifier",name:d.join(".")}}if(((l=this.peek())==null?void 0:l.type)==="LBRACKET"){const d=[e.value];for(;((c=this.peek())==null?void 0:c.type)==="LBRACKET";){this.advance();const h=this.expect("STRING");d.push(h.value),this.expect("RBRACKET")}return d[0]==="parameters"?{kind:"parameterAccess",path:d.slice(1)}:d[0]==="variables"?{kind:"variableAccess",path:d.slice(1)}:{kind:"identifier",name:d.join(".")}}return{kind:"identifier",name:e.value}}}function XG(s,e){let t=s;for(const i of e){if(t==null||typeof t!="object")return;t=t[i]}return t}function zi(s){return s==null?"":typeof s=="boolean"?s?"True":"False":typeof s=="object"?JSON.stringify(s):String(s)}function QA(s){return typeof s=="boolean"?s:typeof s=="string"?s!==""&&s.toLowerCase()!=="false":typeof s=="number"?s!==0:s!=null}function NL(s,e){return s==null&&e==null?!0:s==null||e==null?!1:typeof s=="boolean"&&typeof e=="string"?s===(e.toLowerCase()==="true"):typeof e=="boolean"&&typeof s=="string"?e===(s.toLowerCase()==="true"):typeof s=="string"&&typeof e=="string"?s.toLowerCase()===e.toLowerCase():s===e}const XBe={coalesce:s=>{for(const e of s)if(e!=null&&e!=="")return e;return null},eq:s=>NL(s[0],s[1]),ne:s=>!NL(s[0],s[1]),and:s=>s.every(QA),or:s=>s.some(QA),not:s=>!QA(s[0]),gt:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e>t:zi(e)>zi(t)},ge:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e>=t:zi(e)>=zi(t)},lt:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e<t:zi(e)<zi(t)},le:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e<=t:zi(e)<=zi(t)},replace:s=>{const e=zi(s[0]),t=zi(s[1]),i=zi(s[2]);return e.split(t).join(i)},in:s=>{const e=s[0];return s.slice(1).some(i=>NL(e,i))},startswith:s=>zi(s[0]).toLowerCase().startsWith(zi(s[1]).toLowerCase()),endswith:s=>zi(s[0]).toLowerCase().endsWith(zi(s[1]).toLowerCase()),contains:s=>{const e=s[0],t=zi(s[1]);return Array.isArray(e)?e.some(i=>NL(i,t)):zi(e).toLowerCase().includes(t.toLowerCase())},join:s=>{const e=zi(s[0]),t=s.slice(1);return t.length===1&&Array.isArray(t[0])?t[0].map(zi).join(e):t.map(zi).join(e)},lower:s=>zi(s[0]).toLowerCase(),upper:s=>zi(s[0]).toUpperCase(),length:s=>{const e=s[0];return typeof e=="string"||Array.isArray(e)?e.length:e&&typeof e=="object"?Object.keys(e).length:0},format:s=>{let e=zi(s[0]);for(let t=1;t<s.length;t++)e=e.split(`{${t-1}}`).join(zi(s[t]));return e},converttojson:s=>{const e=s[0];return e==null?"null":JSON.stringify(e)},counter:s=>zi(s[0])};function yW(s,e){switch(s.kind){case"string":return s.value;case"number":return s.value;case"boolean":return s.value;case"null":return null;case"parameterAccess":return XG(e.parameters??{},s.path);case"variableAccess":return XG(e.variables??{},s.path);case"identifier":return s.name;case"functionCall":{const t=XBe[s.name.toLowerCase()];if(!t){const n=s.args.map(o=>yW(o,e));return`${s.name}(${n.map(zi).join(", ")})`}const i=s.args.map(n=>yW(n,e));return t(i,e)}}}function poe(s,e={}){const t=s.trim();if(!t)return"";try{const i=YBe(t);if(i.length===0)return"";const o=new ZBe(i).parse();return yW(o,e)}catch{return s}}function moe(s,e={}){const t=/\$\{\{\s*(.*?)\s*\}\}/g,i=[],n=[];let o=!1;return{result:s.replace(t,(a,l)=>{o=!0;const c=poe(l,e),d=zi(c);return/\$\{\{/.test(d)||c===l||c===void 0?(n.push(l),a):(i.push(l),d)}),hadExpressions:o,isFullyResolved:o&&n.length===0,substituted:i,unresolved:n}}function WE(s){return/\$\{\{.*?\}\}/.test(s)}function QG(s,e,t,i){if(!WE(s))return{resolvedPath:s,isFullyResolved:!0,hadExpressions:!1,substituted:[],unresolved:[]};const o={parameters:{...e??{}},variables:i},{result:r,hadExpressions:a,isFullyResolved:l,substituted:c,unresolved:d}=moe(s,o);return{resolvedPath:r,isFullyResolved:a?l:!0,hadExpressions:a,substituted:c,unresolved:d}}function JA(s){const e=s.parameters;if(!Array.isArray(e))return{};const t={};for(const i of e)if(i&&typeof i=="object"&&"name"in i&&"default"in i){const n=i;t[n.name]=n.default}return t}function JG(s){const e=s.parameters;return Array.isArray(e)?e.filter(t=>t!=null&&typeof t=="object"&&"name"in t&&typeof t.name=="string").map(t=>t.name):[]}function eP(s){const e=s.variables;if(!e)return{};if(Array.isArray(e)){const t={};for(const i of e)if(i&&typeof i=="object"&&"name"in i&&"value"in i){const n=i;t[n.name]=String(n.value)}return t}if(typeof e=="object"){const t={};for(const[i,n]of Object.entries(e))t[i]=String(n);return t}return{}}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function _oe(s){return typeof s>"u"||s===null}function QBe(s){return typeof s=="object"&&s!==null}function JBe(s){return Array.isArray(s)?s:_oe(s)?[]:[s]}function e8e(s,e){var t,i,n,o;if(e)for(o=Object.keys(e),t=0,i=o.length;t<i;t+=1)n=o[t],s[n]=e[n];return s}function t8e(s,e){var t="",i;for(i=0;i<e;i+=1)t+=s;return t}function i8e(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}var n8e=_oe,s8e=QBe,o8e=JBe,r8e=t8e,a8e=i8e,l8e=e8e,cs={isNothing:n8e,isObject:s8e,toArray:o8e,repeat:r8e,isNegativeZero:a8e,extend:l8e};function boe(s,e){var t="",i=s.reason||"(unknown reason)";return s.mark?(s.mark.name&&(t+='in "'+s.mark.name+'" '),t+="("+(s.mark.line+1)+":"+(s.mark.column+1)+")",!e&&s.mark.snippet&&(t+=`
914
+ `)}};rW=wH([$1(1,ja)],rW);function aW(s){return`U+${s.toString(16).padStart(4,"0")}`}function $A(s){let e=`\`${aW(s)}\``;return np.isInvisibleCharacter(s)||(e+=` "${`${xWe(s)}`}"`),e}function xWe(s){return s===96?"`` ` ``":"`"+String.fromCodePoint(s)+"`"}function Xse(s,e){return vB.computeUnicodeHighlightReason(s,e)}const yT=class yT{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let n=this.map.get(i);return n||(n=ze.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}};yT.instance=new yT;let NE=yT;class LWe extends we{constructor(){super({id:Zm.ID,label:G(1552,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=m(1544,"Disable Highlight In Comments")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(fo.includeComments,!1,2)}}class kWe extends we{constructor(){super({id:Zm.ID,label:G(1553,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=m(1545,"Disable Highlight In Strings")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(fo.includeStrings,!1,2)}}const xT=class xT extends In{constructor(){super({id:xT.ID,title:G(1554,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1546,"Disable Ambiguous Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(fo.ambiguousCharacters,!1,2)}};xT.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let Zm=xT;const LT=class LT extends In{constructor(){super({id:LT.ID,title:G(1555,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1547,"Disable Invisible Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(fo.invisibleCharacters,!1,2)}};LT.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let QS=LT;const kT=class kT extends In{constructor(){super({id:kT.ID,title:G(1556,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=m(1548,"Disable Non ASCII Highlight")}async run(e,t,i){const n=e.get(qe);n&&this.runAction(n)}async runAction(e){await e.updateValue(fo.nonBasicASCII,!1,2)}};kT.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let JS=kT;const IT=class IT extends In{constructor(){super({id:IT.ID,title:G(1557,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:n,inString:o,inComment:r}=t,a=String.fromCodePoint(i),l=e.get(gs),c=e.get(qe);function d(g){return np.isInvisibleCharacter(g)?m(1549,"Exclude {0} (invisible character) from being highlighted",aW(g)):m(1550,"Exclude {0} from being highlighted",`${aW(g)} "${a}"`)}const h=[];if(n.kind===0)for(const g of n.notAmbiguousInLocales)h.push({label:m(1551,'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{DWe(c,[g])}});if(h.push({label:d(i),run:()=>IWe(c,[i])}),r){const g=new LWe;h.push({label:g.label,run:async()=>g.runAction(c)})}else if(o){const g=new kWe;h.push({label:g.label,run:async()=>g.runAction(c)})}function u(g){return typeof g.desc.title=="string"?g.desc.title:g.desc.title.value}if(n.kind===0){const g=new Zm;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(n.kind===1){const g=new QS;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(n.kind===2){const g=new JS;h.push({label:u(g),run:async()=>g.runAction(c)})}else EWe(n);const f=await l.pick(h,{title:Zse});f&&await f.run()}};IT.ID="editor.action.unicodeHighlight.showExcludeOptions";let TE=IT;async function IWe(s,e){const t=s.getValue(fo.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const n of e)i[String.fromCodePoint(n)]=!0;await s.updateValue(fo.allowedCharacters,i,2)}async function DWe(s,e){var n;const t=(n=s.inspect(fo.allowedLocales).user)==null?void 0:n.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const o of e)i[o]=!0;await s.updateValue(fo.allowedLocales,i,2)}function EWe(s){throw new Error(`Unexpected value: ${s}`)}Dt(Zm);Dt(QS);Dt(JS);Dt(TE);dt(XS.ID,XS,1);f_.register(rW);var NWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},BG=function(s,e){return function(t,i){e(t,i,s)}};const Qse="ignoreUnusualLineTerminators";function TWe(s,e,t){s.setModelProperty(e.uri,Qse,t)}function RWe(s,e){return s.getModelProperty(e.uri,Qse)}var Mv;let RE=(Mv=class extends U{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(n=>{n.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(n=>{n.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||RWe(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:m(1558,"Unusual Line Terminators"),message:m(1559,"Detected unusual line terminators"),detail:m(1560,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",da(e.uri)),primaryButton:m(1561,"&&Remove Unusual Line Terminators"),cancelButton:m(1562,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){TWe(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},Mv.ID="editor.contrib.unusualLineTerminatorsDetector",Mv);RE=NWe([BG(1,Ey),BG(2,ft)],RE);dt(RE.ID,RE,1);var MWe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},AWe=function(s,e){return function(t,i){e(t,i,s)}};class HG{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const n=[],o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return o?e.isDisposed()?void 0:e.findMatches(o.word,!0,!1,!0,Dk,!1).map(a=>({range:a.range,kind:Fv.Text})):Promise.resolve(n)}provideMultiDocumentHighlights(e,t,i,n){const o=new Wi,r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!r)return Promise.resolve(o);for(const a of[e,...i]){if(a.isDisposed())continue;const c=a.findMatches(r.word,!0,!1,!0,Dk,!1).map(d=>({range:d.range,kind:Fv.Text}));c&&o.set(a.uri,c)}return o}}let lW=class extends U{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new HG)),this._register(e.multiDocumentHighlightProvider.register("*",new HG))}};lW=MWe([AWe(0,Se)],lW);var Jse=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},uc=function(s,e){return function(t,i){e(t,i,s)}},_i,cW;const SH=new be("hasWordHighlights",!1);function eoe(s,e,t,i){const n=s.ordered(e);return eB(n.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,qi)),o=>o!=null).then(o=>{if(o){const r=new Wi;return r.set(e.uri,o),r}return new Wi})}function PWe(s,e,t,i,n){const o=s.ordered(e);return eB(o.map(r=>()=>{const a=n.filter(l=>LX(l)).filter(l=>x8(r.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(r.provideMultiDocumentHighlights(e,t,a,i)).then(void 0,qi)}),r=>r!=null)}class toe{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=on(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new I(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}}class OWe extends toe{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return eoe(this._providers,e,t.getPosition(),n).then(o=>o||new Wi)}}class FWe extends toe{constructor(e,t,i,n,o){super(e,t,i),this._providers=n,this._otherModels=o}_compute(e,t,i,n){return PWe(this._providers,e,t.getPosition(),n,this._otherModels).then(o=>o||new Wi)}}function WWe(s,e,t,i){return new OWe(e,t,i,s)}function BWe(s,e,t,i,n){return new FWe(e,t,i,s,n)}Lo("_executeDocumentHighlights",async(s,e,t)=>{const i=s.get(Se),n=await eoe(i.documentHighlightProvider,e,t,Je.None);return n==null?void 0:n.get(e.uri)});var rf;let dW=(rf=class{constructor(e,t,i,n,o,r,a,l){this.toUnhook=new X,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new Wi,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new la(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this.textModelService=o,this.configurationService=a,this.logService=l,this._hasWordHighlights=SH.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(c=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(c)})})),this.toUnhook.add(e.onDidFocusEditorText(c=>{this.occurrencesHighlightEnablement!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(c=>{HT(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(c=>{!c.newModelUrl&&c.oldModelUrl?this._stopSingular():_i.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(c=>{var h,u;const d=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==d)switch(this.occurrencesHighlightEnablement=d,d){case"off":this._stopAll();break;case"singleFile":this._stopAll((u=(h=_i.query)==null?void 0:h.modelInfo)==null?void 0:u.modelURI);break;case"multiFile":_i.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",d);break}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(c=>{if(c.affectsConfiguration("editor.occurrencesHighlightDelay")){const d=a.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==d&&(this.occurrencesHighlightDelay=d)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{var d,h;const c=this.codeEditorService.getFocusedCodeEditor();c?((d=c.getModel())==null?void 0:d.uri.scheme)===Ae.vscodeNotebookCell&&((h=this.editor.getModel())==null?void 0:h.uri.scheme)!==Ae.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,_i.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!=="off"&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}))}stop(){this.occurrencesHighlightEnablement!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(I.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);Qs(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(n.startLineNumber);Qs(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=_i.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),_i.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const n of t){if(!n.hasModel()||hf(n.getModel().uri,e))continue;const o=_i.storedDecorationIDs.get(n.getModel().uri);if(!o)continue;n.removeDecorations(o),i.push(n.getModel().uri);const r=yf.get(n);r!=null&&r.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const n of i)_i.storedDecorationIDs.delete(n)}_stopSingular(){var e,t,i,n;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Ae.vscodeNotebookCell&&((i=(t=_i.query)==null?void 0:t.modelInfo)==null?void 0:i.modelURI.scheme)!==Ae.vscodeNotebookCell?(_i.query=null,this._run()):(n=_i.query)!=null&&n.modelInfo&&(_i.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlightEnablement==="off"){this._stopAll();return}if(e.source!=="api"&&e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Ae.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Ae.vscodeNotebookCell&&o.push(l)}return o}const i=[],n=this.codeEditorService.listCodeEditors();for(const o of n){if(!x6(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlightEnablement==="singleFile")return[];for(const o of n){const r=o.getModel();r&&r!==e&&i.push(r)}return i}async _run(e,t){var n,o,r;if(this.editor.hasTextFocus()){const a=this.editor.getSelection();if(!a||a.startLineNumber!==a.endLineNumber){_i.query=null,this._stopAll();return}const l=a.startColumn,c=a.endColumn,d=this._getWord();if(!d||d.startColumn>l||d.endColumn<c){_i.query=null,this._stopAll();return}_i.query={modelInfo:{modelURI:this.model.uri,selection:a}}}else if(!_i.query){this._stopAll();return}if(this.lastCursorPositionChangeTime=new Date().getTime(),hf(this.editor.getModel().uri,(n=_i.query.modelInfo)==null?void 0:n.modelURI)){if(!e){const d=this.decorations.getRanges();for(const h of d)if(h.containsPosition(this.editor.getPosition()))return}this._stopAll(e?this.model.uri:void 0);const a=++this.workerRequestTokenId;this.workerRequestCompleted=!1;const l=this.getOtherModelsToHighlight(this.editor.getModel());if(!_i.query||!_i.query.modelInfo)return;const c=await this.textModelService.createModelReference(_i.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(c.object.textEditorModel,_i.query.modelInfo.selection,l),(o=this.workerRequest)==null||o.result.then(d=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=d||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},He)}catch(d){this.logService.error("Unexpected error during occurrence request. Log: ",d)}finally{c.dispose()}}else if(this.model.uri.scheme===Ae.vscodeNotebookCell){const a=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!_i.query||!_i.query.modelInfo)return;const l=await this.textModelService.createModelReference(_i.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(l.object.textEditorModel,_i.query.modelInfo.selection,[this.model]),(r=this.workerRequest)==null||r.result.then(c=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=c||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},He)}catch(c){this.logService.error("Unexpected error during occurrence request. Log: ",c)}finally{l.dispose()}}}computeWithModel(e,t,i){return i.length?BWe(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):WWe(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=new Date().getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},i-t)}renderDecorations(){var t,i,n;this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const o of e){const r=yf.get(o);if(!r)continue;const a=[],l=(t=o.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const c=_i.storedDecorationIDs.get(l),d=this.workerRequestValue.get(l);if(d)for(const u of d)u.range&&a.push({range:u.range,options:g7e(u.kind)});let h=[];o.changeDecorations(u=>{h=u.deltaDecorations(c??[],a)}),_i.storedDecorationIDs=_i.storedDecorationIDs.set(l,h),a.length>0&&((i=r.wordHighlighter)==null||i.decorations.set(a),(n=r.wordHighlighter)==null||n._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}},_i=rf,rf.storedDecorationIDs=new Wi,rf.query=null,rf);dW=_i=Jse([uc(4,Ms),uc(5,ft),uc(6,qe),uc(7,jt)],dW);var hm;let yf=(hm=class extends U{static get(e){return e.getContribution(cW.ID)}constructor(e,t,i,n,o,r,a){super(),this._wordHighlighter=null;const l=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==Ae.accessibleView&&(this._wordHighlighter=new dW(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,o,n,r,a))};this._register(e.onDidChangeModel(c=>{var d,h;this._wordHighlighter&&(!c.newModelUrl&&((d=c.oldModelUrl)==null?void 0:d.scheme)!==Ae.vscodeNotebookCell&&((h=this.wordHighlighter)==null||h.stop()),this._wordHighlighter.dispose(),this._wordHighlighter=null),l()})),l()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},cW=hm,hm.ID="editor.contrib.wordHighlighter",hm);yf=cW=Jse([uc(1,Fe),uc(2,Se),uc(3,ft),uc(4,Ms),uc(5,qe),uc(6,jt)],yf);class ioe extends we{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=yf.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class HWe extends ioe{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:G(1572,"Go to Next Symbol Highlight"),precondition:SH,kbOpts:{kbExpr:F.editorTextFocus,primary:65,weight:100}})}}class VWe extends ioe{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:G(1573,"Go to Previous Symbol Highlight"),precondition:SH,kbOpts:{kbExpr:F.editorTextFocus,primary:1089,weight:100}})}}class zWe extends we{constructor(){super({id:"editor.action.wordHighlight.trigger",label:G(1574,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:F.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=yf.get(t);n&&n.restoreViewState(!0)}}dt(yf.ID,yf,0);me(HWe);me(VWe);me(zWe);zC(lW);class g2 extends cn{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=ha(t.getOption(148),t.getOption(147)),o=t.getModel(),r=t.getSelections(),a=r.length>1,l=r.map(c=>{const d=new B(c.positionLineNumber,c.positionColumn),h=this._move(n,o,d,this._wordNavigationType,a);return this._moveTo(c,h,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>gt.fromModelSelection(c))),l.length===1){const c=new B(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new Ce(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Ce(t.lineNumber,t.column,t.lineNumber,t.column)}}class Mf extends g2{_move(e,t,i,n,o){return yt.moveWordLeft(e,t,i,n,o)}}class Af extends g2{_move(e,t,i,n,o){return yt.moveWordRight(e,t,i,n)}}class UWe extends Mf{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class $We extends Mf{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class jWe extends Mf{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:ne.and(F.textInputFocus,(e=ne.and(TC,BR))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class qWe extends Mf{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class KWe extends Mf{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class GWe extends Mf{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:ne.and(F.textInputFocus,(e=ne.and(TC,BR))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class YWe extends Mf{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n,o){return super._move(ha(Ls.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class ZWe extends Mf{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(ha(Ls.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class XWe extends Af{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class QWe extends Af{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:ne.and(F.textInputFocus,(e=ne.and(TC,BR))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class JWe extends Af{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class eBe extends Af{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class tBe extends Af{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:ne.and(F.textInputFocus,(e=ne.and(TC,BR))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class iBe extends Af{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class nBe extends Af{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n,o){return super._move(ha(Ls.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class sBe extends Af{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n,o){return super._move(ha(Ls.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,n,o)}}class p2 extends cn{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e==null?void 0:e.get(ci);if(!t.hasModel()||!n)return;const o=ha(t.getOption(148),t.getOption(147)),r=t.getModel(),a=t.getSelections(),l=t.getOption(10),c=t.getOption(15),d=n.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const g=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Gn(g,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class yH extends p2{_delete(e,t){const i=yt.deleteWordLeft(e,t);return i||new I(1,1,1,1)}}class xH extends p2{_delete(e,t){const i=yt.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new I(n,o,n,o)}}class oBe extends yH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:F.writable})}}class rBe extends yH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:F.writable})}}class aBe extends yH{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:F.writable,kbOpts:{kbExpr:F.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class lBe extends xH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:F.writable})}}class cBe extends xH{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:F.writable})}}class dBe extends xH{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:F.writable,kbOpts:{kbExpr:F.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class hBe extends we{constructor(){super({id:"deleteInsideWord",precondition:F.writable,label:G(1575,"Delete Word")})}run(e,t,i){if(!t.hasModel())return;const n=ha(t.getOption(148),t.getOption(147)),o=t.getModel(),a=t.getSelections().map(l=>{const c=yt.deleteInsideWord(n,o,l);return new Gn(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}_e(new UWe);_e(new $We);_e(new jWe);_e(new qWe);_e(new KWe);_e(new GWe);_e(new XWe);_e(new QWe);_e(new JWe);_e(new eBe);_e(new tBe);_e(new iBe);_e(new YWe);_e(new ZWe);_e(new nBe);_e(new sBe);_e(new oBe);_e(new rBe);_e(new aBe);_e(new lBe);_e(new cBe);_e(new dBe);me(hBe);class uBe extends p2{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:F.writable,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=wR.deleteWordPartLeft(e);return i||new I(1,1,1,1)}}class fBe extends p2{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:F.writable,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=wR.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),o=e.model.getLineMaxColumn(n);return new I(n,o,n,o)}}class noe extends g2{_move(e,t,i,n,o){return wR.moveWordPartLeft(e,t,i,o)}}class gBe extends noe{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}ct.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class pBe extends noe{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}ct.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class soe extends g2{_move(e,t,i,n,o){return wR.moveWordPartRight(e,t,i)}}class mBe extends soe{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class _Be extends soe{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:F.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}_e(new uBe);_e(new fBe);_e(new gBe);_e(new pBe);_e(new mBe);_e(new _Be);const GH=class GH extends U{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=jo.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(this.editor.isSimpleWidget?t=new rs(m(1378,"Cannot edit in read-only input")):t=new rs(m(1379,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};GH.ID="editor.contrib.readOnlyMessageController";let ME=GH;dt(ME.ID,ME,2);var bBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},VG=function(s,e){return function(t,i){e(t,i,s)}};let hW=class extends U{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Oe(this,void 0);const n=Wo("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=Wo("_textModel.onDidChangeContent",ge.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(hs(async(r,a)=>{n.read(r),o.read(r);const l=a.add(new mNe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return n.sort(zY(Xn(o=>o.range.endLineNumber-o.range.startLineNumber,Uo))),n.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};hW=bBe([VG(1,Se),VG(2,Yy)],hW);SD.setBreadcrumbsSourceFactory((s,e)=>e.createInstance(hW,s));var vBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},jA=function(s,e){return function(t,i){e(t,i,s)}},Av;let AE=(Av=class extends U{constructor(e,t,i,n){super();const o=this._register(ai(e)),r=this._register(n.createMenu(ye.EditorContent,e.contextKeyService)),a=vt(this,r.onDidChange,()=>r.getActions().length===0);this._register(Me(l=>{if(a.read(l))return;const d=ht("div.floating-menu-overlay-widget");d.root.style.height="28px";const h=t.createInstance(yS,d.root,ye.EditorContent,{actionViewItemProvider:(u,f)=>{if(!(u instanceof kr))return;const g=i.lookupKeybinding(u.id);if(g)return t.createInstance(class extends bf{updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${g.getLabel()})`)}},u,{...f,keybindingNotRenderedWithLabel:!0})},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});l.store.add(h),l.store.add(Me(u=>{const f=o.model.read(u);h.context=f==null?void 0:f.uri})),l.store.add(o.createOverlayWidget({allowEditorOverflow:!1,domNode:d.root,minContentWidthInPx:zt(0),position:zt({preference:1})}))}))}},Av.ID="editor.contrib.floatingToolbar",Av);AE=vBe([jA(1,ke),jA(2,mt),jA(3,ga)],AE);dt(AE.ID,AE,1);const YH=class YH extends U{constructor(e){super(),this.editor=e,this.widget=null,aa&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new uW(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};YH.ID="editor.contrib.iPadShowKeyboard";let PE=YH;const DT=class DT extends U{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(j(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(j(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return DT.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};DT.ID="editor.contrib.ShowKeyboardWidget";let uW=DT;dt(PE.ID,PE,3);var CBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},zG=function(s,e){return function(t,i){e(t,i,s)}},fW,um;let ey=(um=class extends U{static get(e){return e.getContribution(fW.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(n=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(n=>this.stop())),this._register(vi.onDidChange(n=>this.stop())),this._register(this._editor.onKeyUp(n=>n.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new gW(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},fW=um,um.ID="editor.contrib.inspectTokens",um);ey=fW=CBe([zG(1,Or),zG(2,Li)],ey);class wBe extends we{constructor(){super({id:"editor.action.inspectTokens",label:HF.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=ey.get(t);i==null||i.launch()}}function SBe(s){let e="";for(let t=0,i=s.length;t<i;t++){const n=s.charCodeAt(t);switch(n){case 9:e+="→";break;case 32:e+="·";break;default:e+=String.fromCharCode(n)}}return e}function yBe(s,e){const t=vi.get(e);if(t)return t;const i=s.encodeLanguageId(e);return{getInitialState:()=>qv,tokenize:(n,o,r)=>LB(e,r),tokenizeEncoded:(n,o,r)=>cR(i,r)}}const ET=class ET extends U{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=yBe(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return ET._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let n=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){n=l;break}const o=this._model.getLineContent(e.lineNumber);let r="";if(i<t.tokens1.length){const l=t.tokens1[i].offset,c=i+1<t.tokens1.length?t.tokens1[i+1].offset:o.length;r=o.substring(l,c)}_n(this._domNode,he("h2.tm-token",void 0,SBe(r),he("span.tm-token-length",void 0,`${r.length} ${r.length===1?"char":"chars"}`))),ae(this._domNode,he("hr.tokens-inspect-separator",{style:"clear:both"}));const a=(n<<1)+1<t.tokens2.length?this._decodeMetadata(t.tokens2[(n<<1)+1]):null;ae(this._domNode,he("table.tm-metadata-table",void 0,he("tbody",void 0,he("tr",void 0,he("td.tm-metadata-key",void 0,"language"),he("td.tm-metadata-value",void 0,`${a?a.languageId:"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"token type"),he("td.tm-metadata-value",void 0,`${a?this._tokenTypeToString(a.tokenType):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"font style"),he("td.tm-metadata-value",void 0,`${a?this._fontStyleToString(a.fontStyle):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"foreground"),he("td.tm-metadata-value",void 0,`${a?J.Format.CSS.formatHex(a.foreground):"-?-"}`)),he("tr",void 0,he("td.tm-metadata-key",void 0,"background"),he("td.tm-metadata-value",void 0,`${a?J.Format.CSS.formatHex(a.background):"-?-"}`))))),ae(this._domNode,he("hr.tokens-inspect-separator")),i<t.tokens1.length&&ae(this._domNode,he("span.tm-token-type",void 0,t.tokens1[i].type)),this._editor.layoutContentWidget(this)}_decodeMetadata(e){const t=vi.getColorMap(),i=os.getLanguageId(e),n=os.getTokenType(e),o=os.getFontStyle(e),r=os.getForeground(e),a=os.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(i),tokenType:n,fontStyle:o,foreground:t[r],background:t[a]}}_tokenTypeToString(e){switch(e){case 0:return"Other";case 1:return"Comment";case 2:return"String";case 3:return"RegEx";default:return"??"}}_fontStyleToString(e){let t="";return e&1&&(t+="italic "),e&2&&(t+="bold "),e&4&&(t+="underline "),e&8&&(t+="strikethrough "),t.length===0&&(t="---"),t}_getTokensAtLine(e){const t=this._getStateBeforeLine(e),i=this._tokenizationSupport.tokenize(this._model.getLineContent(e),!0,t),n=this._tokenizationSupport.tokenizeEncoded(this._model.getLineContent(e),!0,t);return{startState:t,tokens1:i.tokens,tokens2:n.tokens,endState:i.endState}}_getStateBeforeLine(e){let t=this._tokenizationSupport.getInitialState();for(let i=1;i<e;i++)t=this._tokenizationSupport.tokenize(this._model.getLineContent(i),!0,t).endState;return t}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[2,1]}}};ET._ID="editor.contrib.inspectTokensWidget";let gW=ET;dt(ey.ID,ey,4);me(wBe);var xBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},UG=function(s,e){return function(t,i){e(t,i,s)}},Zw,fm;let pW=(fm=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=pi.as(l_.Quickaccess)}provide(e){const t=new X;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const n=this.registry.getQuickAccessProvider(i.substr(Zw.PREFIX.length));n&&n.prefix&&n.prefix!==Zw.PREFIX&&this.quickInputService.quickAccess.show(n.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==Zw.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,n=i||"…";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:m(1747,"{0}, {1}",n,t.description),description:t.description}})}},Zw=fm,fm.PREFIX="?",fm);pW=Zw=xBe([UG(0,gs),UG(1,mt)],pW);pi.as(l_.Quickaccess).registerQuickAccessProvider({ctor:pW,prefix:"",helpEntries:[{description:VF.helpQuickAccessActionLabel}]});class ooe{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var r;const n=new X;e.canAcceptInBackground=!!((r=this.options)!=null&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=n.add(new wt);return o.value=this.doProvide(e,t,i),n.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),n}doProvide(e,t,i){const n=new X,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=nie(o);if(a){let l=o.saveViewState()??void 0;n.add(a.onDidChangeCursorPosition(()=>{l=o.saveViewState()??void 0})),r.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},n.add(mm(t.onCancellationRequested)(()=>{var c;return(c=r.restoreViewState)==null?void 0:c.call(r)}))}n.add(xe(()=>this.clearDecorations(o))),n.add(this.provideWithTextEditor(r,e,t,i))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Ll(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return x6(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const n=[];this.rangeHighlightDecorationId&&(n.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),n.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:Ci(AQ),position:Dr.Full}}}],[r,a]=i.deltaDecorations(n,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const Fg=class Fg extends ooe{constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(Fg.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(e){this.storageService.store(Fg.ZERO_BASED_OFFSET_STORAGE_KEY,e,-1,0)}provideWithoutTextEditor(e){const t=m(1335,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,U.None}provideWithTextEditor(e,t,i){const n=e.editor,o=new X;o.add(t.onDidAccept(c=>{const[d]=t.selectedItems;if(d){if(!d.lineNumber)return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=t.value.trim().substring(Fg.PREFIX.length),{inOffsetMode:d,lineNumber:h,column:u,label:f}=this.parsePosition(n,c);if(a.visible=!!d,t.items=[{lineNumber:h,column:u,label:f}],t.ariaLabel=f,!h){this.clearDecorations(n);return}const g=this.toRange(h,u);n.revealRangeInCenter(g,0),this.addDecorations(n,g)},a=new Rh({title:m(1336,"Use Zero-Based Offset"),icon:oe.indexZero,isChecked:this.useZeroBasedOffset,inputActiveOptionBorder:de(Sy),inputActiveOptionForeground:de(yy),inputActiveOptionBackground:de(AC)});o.add(a.onChange(()=>{this.useZeroBasedOffset=!this.useZeroBasedOffset,r()})),t.toggles=[a],r(),o.add(t.onDidChangeValue(()=>r()));const l=nie(n);return l&&l.getOptions().get(76).renderType===2&&(l.updateOptions({lineNumbers:"on"}),o.add(xe(()=>l.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){var n,o;const i=this.getModel(e);if(!i)return{label:m(1337,"Open a text editor first to go to a line.")};if(t.startsWith(":")){let r=parseInt(t.substring(1),10);const a=i.getValueLength();if(isNaN(r))return{inOffsetMode:!0,label:this.useZeroBasedOffset?m(1338,"Type a character position to go to (from 0 to {0}).",a-1):m(1339,"Type a character position to go to (from 1 to {0}).",a)};{const l=r<0;this.useZeroBasedOffset||(r-=Math.sign(r)),l&&(r+=a);const c=i.getPositionAt(r);return{...c,inOffsetMode:!0,label:m(1340,"Press 'Enter' to go to line {0} at column {1}.",c.lineNumber,c.column)}}}else{const r=t.split(/,|:|#/),a=i.getLineCount();let l=parseInt((n=r[0])==null?void 0:n.trim(),10);if(r.length<1||isNaN(l))return{label:m(1341,"Type a line number to go to (from 1 to {0}).",a)};l=l>=0?l:a+1+l,l=Math.min(Math.max(1,l),a);const c=i.getLineMaxColumn(l);let d=parseInt((o=r[1])==null?void 0:o.trim(),10);return r.length<2||isNaN(d)?{lineNumber:l,column:1,label:r.length<2?m(1342,"Press 'Enter' to go to line {0} or enter : to add a column number.",l):m(1343,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",l,c)}:(d=d>=0?d:c+d,d=Math.min(Math.max(1,d),c),{lineNumber:l,column:d,label:m(1344,"Press 'Enter' to go to line {0} at column {1}.",l,d)})}}};Fg.PREFIX=":",Fg.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset";let mW=Fg;var LBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$G=function(s,e){return function(t,i){e(t,i,s)}};let ty=class extends mW{constructor(e,t){super(),this.editorService=e,this.storageService=t,this.onDidActiveTextEditorControlChange=ge.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};ty=LBe([$G(0,ft),$G(1,As)],ty);var gm;let roe=(gm=class extends we{constructor(){super({id:gm.ID,label:UI.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:F.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(gs).quickAccess.show(ty.PREFIX)}},gm.ID="editor.action.gotoLine",gm);me(roe);pi.as(l_.Quickaccess).registerQuickAccessProvider({ctor:ty,prefix:ty.PREFIX,helpEntries:[{description:UI.gotoLineActionLabel,commandId:roe.ID}]});const aoe=[void 0,[]];function qA(s,e,t=0,i=0){const n=e;return n.values&&n.values.length>1?kBe(s,n.values,t,i):loe(s,e,t,i)}function kBe(s,e,t,i){let n=0;const o=[];for(const r of e){const[a,l]=loe(s,r,t,i);if(typeof a!="number")return aoe;n+=a,o.push(...l)}return[n,IBe(o)]}function loe(s,e,t,i){const n=Nm(e.original,e.originalLowercase,t,s,s.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return n?[n[0],Ny(n)]:aoe}function IBe(s){const e=s.sort((n,o)=>n.start-o.start),t=[];let i;for(const n of e)!i||!DBe(i,n)?(i=n,t.push(n)):(i.start=Math.min(i.start,n.start),i.end=Math.max(i.end,n.end));return t}function DBe(s,e){return!(s.end<e.start||e.end<s.start)}function jG(s){return s.startsWith('"')&&s.endsWith('"')}const coe=" ";function _W(s){typeof s!="string"&&(s="");const e=s.toLowerCase(),{pathNormalized:t,normalized:i,normalizedLowercase:n}=qG(s),o=t.indexOf(bl)>=0,r=jG(s);let a;const l=s.split(coe);if(l.length>1)for(const c of l){const d=jG(c),{pathNormalized:h,normalized:u,normalizedLowercase:f}=qG(c);u&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:s,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:n,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function qG(s){let e;An?e=s.replace(/\//g,bl):e=s.replace(/\\/g,bl);const t=e.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function KG(s){return Array.isArray(s)?_W(s.map(e=>e.original).join(coe)):_W(s.original)}var EBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},GG=function(s,e){return function(t,i){e(t,i,s)}},_k,ul;let mp=(ul=class extends ooe{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,m(1345,"To go to a symbol, first open a text editor with symbol information.")),U.None}provideWithTextEditor(e,t,i,n){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,n):this.doProvideWithoutEditorSymbols(e,r,t,i):U.None}doProvideWithoutEditorSymbols(e,t,i,n){const o=new X;return this.provideLabelPick(i,m(1346,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||n.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,n)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new Qm,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))}));return t.add(xe(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,n,o){var h;const r=e.editor,a=new X;a.add(i.onDidAccept(u=>{var g;const[f]=i.selectedItems;f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:i.keyMods,preserveFocus:u.inBackground}),(g=o==null?void 0:o.handleAccept)==null||g.call(o,f,u.inBackground),u.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,n),c=a.add(new wt),d=async u=>{var f;(f=c==null?void 0:c.value)==null||f.cancel(),i.busy=!1,c.value=new ii,i.busy=!0;try{const g=_W(i.value.substr(_k.PREFIX.length).trim()),p=await this.doGetSymbolPicks(l,g,void 0,c.value.token,t);if(n.isCancellationRequested)return;if(p.length>0){if(i.items=p,u&&g.original.length===0){const _=T0(p,v=>!!(v.type!=="separator"&&v.range&&I.containsPosition(v.range.decoration,u)));_&&(i.activeItems=[_])}}else g.original.length>0?this.provideLabelPick(i,m(1347,"No matching editor symbols")):this.provideLabelPick(i,m(1348,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d((h=r.getSelection())==null?void 0:h.getPosition()),a.add(i.onDidChangeActive(()=>{const[u]=i.activeItems;u&&u.range&&(r.revealRangeInCenter(u.range.selection,0),this.addDecorations(r,u.range.decoration))})),a}async doGetSymbolPicks(e,t,i,n,o){var _,v;const r=await e;if(n.isCancellationRequested)return[];const a=t.original.indexOf(_k.SCOPE_PREFIX)===0,l=a?1:0;let c,d;t.values&&t.values.length>1?(c=KG(t.values[0]),d=KG(t.values.slice(1))):c=t;let h;const u=(v=(_=this.options)==null?void 0:_.openSideBySideDirection)==null?void 0:v.call(_);u&&(h=[{iconClass:u==="right"?Te.asClassName(oe.splitHorizontal):Te.asClassName(oe.splitVertical),tooltip:u==="right"?m(1349,"Open to the Side"):m(1350,"Open to the Bottom")}]);const f=[];for(let b=0;b<r.length;b++){const w=r[b],C=ede(w.name),S=`$(${Pk.toIcon(w.kind).id}) ${C}`,x=S.length-C.length;let y=w.containerName;i!=null&&i.extraContainerLabel&&(y?y=`${i.extraContainerLabel} • ${y}`:y=i.extraContainerLabel);let L,D,E,T;if(t.original.length>l){let M=!1;if(c!==t&&([L,D]=qA(S,{...t,values:void 0},l,x),typeof L=="number"&&(M=!0)),typeof L!="number"&&([L,D]=qA(S,c,l,x),typeof L!="number"))continue;if(!M&&d){if(y&&d.original.length>0&&([E,T]=qA(y,d)),typeof E!="number")continue;typeof L=="number"&&(L+=E)}}const N=w.tags&&w.tags.indexOf(1)>=0;f.push({index:b,kind:w.kind,score:L,label:S,ariaLabel:Kce(w.name,w.kind),description:y,highlights:N?void 0:{label:D,description:T},range:{selection:I.collapseToStart(w.selectionRange),decoration:w.range},uri:o.uri,symbolName:C,strikethrough:N,buttons:h})}const g=f.sort((b,w)=>a?this.compareByKindAndScore(b,w):this.compareByScore(b,w));let p=[];if(a){let S=function(){w&&typeof b=="number"&&C>0&&(w.label=Cm(GA[b]||KA,C))},b,w,C=0;for(const x of g)b!==x.kind?(S(),b=x.kind,C=1,w={type:"separator"},p.push(w)):C++,p.push(x);S()}else g.length>0&&(p=[{label:m(1351,"symbols ({0})",f.length),type:"separator"},...g]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.score<t.score)return 1}return e.index<t.index?-1:e.index>t.index?1:0}compareByKindAndScore(e,t){const i=GA[e.kind]||KA,n=GA[t.kind]||KA,o=i.localeCompare(n);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},_k=ul,ul.PREFIX="@",ul.SCOPE_PREFIX=":",ul.PREFIX_BY_CATEGORY=`${ul.PREFIX}${ul.SCOPE_PREFIX}`,ul);mp=_k=EBe([GG(0,Se),GG(1,Yy)],mp);const KA=m(1352,"properties ({0})"),GA={5:m(1353,"methods ({0})"),11:m(1354,"functions ({0})"),8:m(1355,"constructors ({0})"),12:m(1356,"variables ({0})"),4:m(1357,"classes ({0})"),22:m(1358,"structs ({0})"),23:m(1359,"events ({0})"),24:m(1360,"operators ({0})"),10:m(1361,"interfaces ({0})"),2:m(1362,"namespaces ({0})"),3:m(1363,"packages ({0})"),25:m(1364,"type parameters ({0})"),1:m(1365,"modules ({0})"),6:m(1366,"properties ({0})"),9:m(1367,"enumerations ({0})"),21:m(1368,"enumeration members ({0})"),14:m(1369,"strings ({0})"),0:m(1370,"files ({0})"),17:m(1371,"arrays ({0})"),15:m(1372,"numbers ({0})"),16:m(1373,"booleans ({0})"),18:m(1374,"objects ({0})"),19:m(1375,"keys ({0})"),7:m(1376,"fields ({0})"),13:m(1377,"constants ({0})")};var NBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},YA=function(s,e){return function(t,i){e(t,i,s)}};let bW=class extends mp{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=ge.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};bW=NBe([YA(0,ft),YA(1,Se),YA(2,Yy)],bW);const NT=class NT extends we{constructor(){super({id:NT.ID,label:dS.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:F.hasDocumentSymbolProvider,kbOpts:{kbExpr:F.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(gs).quickAccess.show(mp.PREFIX,{itemActivation:sl.NONE})}};NT.ID="editor.action.quickOutline";let OE=NT;me(OE);pi.as(l_.Quickaccess).registerQuickAccessProvider({ctor:bW,prefix:mp.PREFIX,helpEntries:[{description:dS.quickOutlineActionLabel,prefix:mp.PREFIX,commandId:OE.ID},{description:dS.quickOutlineByCategoryActionLabel,prefix:mp.PREFIX_BY_CATEGORY}]});function TBe(s){const e=new Map;for(const t of s)e.set(t,(e.get(t)??0)+1);return e}class j1{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,n);c>0&&o.push({key:r,score:c})}}return o}static termFrequencies(e){return TBe(j1.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const n=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(n.length>1)for(const o of n)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield t(o))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const n of t.textChunks){const o=j1.termFrequencies(n);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:n,tf:o})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const n of i.tf.keys()){const o=this.chunkOccurrences.get(n);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(n):this.chunkOccurrences.set(n,r)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=i.get(o);typeof l!="number"&&(l=this.computeIdf(o),i.set(o,l));const c=a*l;n+=c*r}return n}computeEmbedding(e){const t=j1.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const o=this.computeIdf(i);o>0&&(t[i]=n*o)}return t}}function RBe(s){var i;const e=s.slice(0);e.sort((n,o)=>o.score-n.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const n of e)n.score/=t;return e}var kb;(function(s){s[s.NO_ACTION=0]="NO_ACTION",s[s.CLOSE_PICKER=1]="CLOSE_PICKER",s[s.REFRESH_PICKER=2]="REFRESH_PICKER",s[s.REMOVE_ITEM=3]="REMOVE_ITEM"})(kb||(kb={}));function ZA(s){const e=s;return Array.isArray(e.items)}function YG(s){const e=s;return!!e.picks&&e.additionalPicks instanceof Promise}class MBe extends U{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var c;const n=new X;e.canAcceptInBackground=!!((c=this.options)!=null&&c.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=n.add(new wt),a=async()=>{var _;o==null||o.dispose(!0),e.busy=!1;const d=r.value=new X;o=d.add(new ii(t));const h=o.token;let u=e.value.substring(this.prefix.length);(_=this.options)!=null&&_.shouldSkipTrimPickFilter||(u=u.trim());const f=this._getPicks(u,d,h,i),g=(v,b)=>{var S;let w,C;if(ZA(v)?(w=v.items,C=v.active):w=v,w.length===0){if(b)return!1;(u.length>0||e.hideInput)&&((S=this.options)!=null&&S.noResultsPick)&&(pm(this.options.noResultsPick)?w=[this.options.noResultsPick(u)]:w=[this.options.noResultsPick])}return e.items=w,C&&(e.activeItems=[C]),!0},p=async v=>{let b=!1,w=!1;await Promise.all([(async()=>{typeof v.mergeDelay=="number"&&(await Rc(v.mergeDelay),h.isCancellationRequested)||w||(b=g(v.picks,!0))})(),(async()=>{e.busy=!0;try{const C=await v.additionalPicks;if(h.isCancellationRequested)return;let S,x;ZA(v.picks)?(S=v.picks.items,x=v.picks.active):S=v.picks;let y,L;if(ZA(C)?(y=C.items,L=C.active):y=C,y.length>0||!b){let D;if(!x&&!L){const E=e.activeItems[0];E&&S.indexOf(E)!==-1&&(D=E)}g({items:[...S,...y],active:x||L||D})}}finally{h.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(f!==null)if(YG(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const v=await f;if(h.isCancellationRequested)return;YG(v)?await p(v):g(v)}finally{h.isCancellationRequested||(e.busy=!1)}}};n.add(e.onDidChangeValue(()=>a())),a(),n.add(e.onDidAccept(d=>{var u;if(i!=null&&i.handleAccept){d.inBackground||e.hide(),(u=i.handleAccept)==null||u.call(i,e.activeItems[0],d.inBackground);return}const[h]=e.selectedItems;typeof(h==null?void 0:h.accept)=="function"&&(d.inBackground||e.hide(),h.accept(e.keyMods,d))}));const l=async(d,h)=>{var f;if(typeof h.trigger!="function")return;const u=((f=h.buttons)==null?void 0:f.indexOf(d))??-1;if(u>=0){const g=h.trigger(u,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case kb.NO_ACTION:break;case kb.CLOSE_PICKER:e.hide();break;case kb.REFRESH_PICKER:a();break;case kb.REMOVE_ITEM:{const _=e.items.indexOf(h);if(_!==-1){const v=e.items.slice(),b=v.splice(_,1),w=e.activeItems.filter(S=>S!==b[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=v,w&&(e.activeItems=w),e.keepScrollPosition=C}break}}}};return n.add(e.onDidTriggerItemButton(({button:d,item:h})=>l(d,h))),n.add(e.onDidTriggerSeparatorButton(({button:d,separator:h})=>l(d,h))),n}}new Ua(1e4);const ABe=new Ua(1e4);function PBe(s){return FBe(s,"NFD",ABe)}const OBe=/[^\u0000-\u0080]/;function FBe(s,e,t){if(!s)return s;const i=t.get(s);if(i)return i;let n;return OBe.test(s)?n=s.normalize(e):n=s,t.set(s,n),n}const WBe=function(){const s=/[\u0300-\u036f]/g;return function(e){return PBe(e).replace(s,"")}}();var doe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},du=function(s,e){return function(t,i){e(t,i,s)}},cg,Qi,Cc;let vW=(Cc=class extends MBe{constructor(e,t,i,n,o,r){super(cg.PREFIX,e),this.keybindingService=i,this.commandService=n,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(t.createInstance(CW)),this.options=e}async _getPicks(e,t,i,n){var g,p;const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=mm(()=>{const _=new j1;_.updateDocuments(o.map(b=>({key:b.commandId,textChunks:[this.getTfIdfChunk(b)]})));const v=_.calculateScores(e,i);return RBe(v).filter(b=>b.score>cg.TFIDF_THRESHOLD).slice(0,cg.TFIDF_MAX_RESULTS)}),a=this.normalizeForFiltering(e),l=[];for(const _ of o){_.labelNoAccents??(_.labelNoAccents=this.normalizeForFiltering(_.label));const v=cg.WORD_FILTER(a,_.labelNoAccents)??void 0;let b;if(_.commandAlias&&(_.aliasNoAccents??(_.aliasNoAccents=this.normalizeForFiltering(_.commandAlias)),b=cg.WORD_FILTER(a,_.aliasNoAccents)??void 0),v||b)_.highlights={label:v,detail:this.options.showAlias?b:void 0},l.push(_);else if(e===_.commandId)l.push(_);else if(e.length>=3){const w=r();if(i.isCancellationRequested)return[];const C=w.find(S=>S.key===_.commandId);C&&(_.tfIdfScore=C.score,l.push(_))}}const c=new Map;for(const _ of l){const v=c.get(_.label);v?(_.description=_.commandId,v.description=v.commandId):c.set(_.label,_)}l.sort((_,v)=>{if(_.tfIdfScore&&v.tfIdfScore)return _.tfIdfScore===v.tfIdfScore?_.label.localeCompare(v.label):v.tfIdfScore-_.tfIdfScore;if(_.tfIdfScore)return 1;if(v.tfIdfScore)return-1;const b=this.commandsHistory.peek(_.commandId),w=this.commandsHistory.peek(v.commandId);if(b&&w)return b>w?-1:1;if(b)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const x=this.options.suggestedCommandIds.has(_.commandId),y=this.options.suggestedCommandIds.has(v.commandId);if(x&&y)return 0;if(x)return-1;if(y)return 1}const C=_.commandCategory===X7.Developer.value,S=v.commandCategory===X7.Developer.value;return C&&!S?1:!C&&S?-1:_.label.localeCompare(v.label)});const d=[];let h=!1,u=!0,f=!!this.options.suggestedCommandIds;for(let _=0;_<l.length;_++){const v=l[_];_===0&&this.commandsHistory.peek(v.commandId)&&(d.push({type:"separator",label:m(1740,"recently used")}),h=!0),u&&v.tfIdfScore!==void 0&&(d.push({type:"separator",label:m(1741,"similar commands")}),u=!1),f&&v.tfIdfScore===void 0&&!this.commandsHistory.peek(v.commandId)&&((g=this.options.suggestedCommandIds)!=null&&g.has(v.commandId))&&(d.push({type:"separator",label:m(1742,"commonly used")}),h=!0,f=!1),h&&v.tfIdfScore===void 0&&!this.commandsHistory.peek(v.commandId)&&!((p=this.options.suggestedCommandIds)!=null&&p.has(v.commandId))&&(d.push({type:"separator",label:m(1743,"other commands")}),h=!1),d.push(this.toCommandPick(v,n))}return this.hasAdditionalCommandPicks(e,i)?{picks:d,additionalPicks:(async()=>{var b;const _=await this.getAdditionalCommandPicks(o,l,e,i);if(i.isCancellationRequested)return[];const v=_.map(w=>this.toCommandPick(w,n));return u&&((b=v[0])==null?void 0:b.type)!=="separator"&&v.unshift({type:"separator",label:m(1744,"similar commands")}),v})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?m(1745,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var o;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(o=e.args)!=null&&o.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(r){Mr(r)||this.dialogService.error(m(1746,"Command '{0}' resulted in an error",e.label),ED(r))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let n=e;return t&&t!==e&&(n+=` - ${t}`),i&&i.value!==e&&(n+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),n}normalizeForFiltering(e){const t=WBe(e);return t.length!==e.length?(this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch",{originalLength:e.length,normalizedLength:t.length}),e):t}},cg=Cc,Cc.PREFIX=">",Cc.TFIDF_THRESHOLD=.5,Cc.TFIDF_MAX_RESULTS=5,Cc.WORD_FILTER=k8(nS,GSe,KJ),Cc);vW=cg=doe([du(1,ke),du(2,mt),du(3,qt),du(4,ms),du(5,Ey)],vW);var fl;let CW=(fl=class extends U{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===Ou.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Qi.getConfiguredCommandHistoryLength(this.configurationService),Qi.cache&&Qi.cache.limit!==this.configuredCommandsHistoryLength&&(Qi.cache.limit=this.configuredCommandsHistoryLength,Qi.hasChanges=!0))}load(){const e=this.storageService.get(Qi.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){this.logService.error(`[CommandsHistory] invalid data: ${n}`)}const i=Qi.cache=new Ua(this.configuredCommandsHistoryLength,1);if(t){let n;t.usesLRU?n=t.entries:n=t.entries.sort((o,r)=>o.value-r.value),n.forEach(o=>i.set(o.key,o.value))}Qi.counter=this.storageService.getNumber(Qi.PREF_KEY_COUNTER,0,Qi.counter)}push(e){Qi.cache&&(Qi.cache.set(e,Qi.counter++),Qi.hasChanges=!0)}peek(e){var t;return(t=Qi.cache)==null?void 0:t.peek(e)}saveState(){if(!Qi.cache||!Qi.hasChanges)return;const e={usesLRU:!0,entries:[]};Qi.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Qi.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Qi.PREF_KEY_COUNTER,Qi.counter,0,0),Qi.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var n,o;const i=(o=(n=e.getValue().workbench)==null?void 0:n.commandPalette)==null?void 0:o.history;return typeof i=="number"?i:Qi.DEFAULT_COMMANDS_HISTORY_LENGTH}},Qi=fl,fl.DEFAULT_COMMANDS_HISTORY_LENGTH=50,fl.PREF_KEY_CACHE="commandPalette.mru.cache",fl.PREF_KEY_COUNTER="commandPalette.mru.counter",fl.counter=1,fl.hasChanges=!1,fl);CW=Qi=doe([du(0,As),du(1,qe),du(2,jt)],CW);class BBe extends vW{constructor(e,t,i,n,o,r){super(e,t,i,n,o,r)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const n of e.getSupportedActions()){let o;(i=n.metadata)!=null&&i.description&&(Oke(n.metadata.description)?o=n.metadata.description:o={original:n.metadata.description,value:n.metadata.description}),t.push({commandId:n.id,commandAlias:n.alias,commandDescription:o,label:R8(n.label)||n.id})}return t}}var HBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},$_=function(s,e){return function(t,i){e(t,i,s)}};let iy=class extends BBe{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,n,o,r){super({showAlias:!1},e,i,n,o,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};iy=HBe([$_(0,ke),$_(1,ft),$_(2,mt),$_(3,qt),$_(4,ms),$_(5,Ey)],iy);const TT=class TT extends we{constructor(){super({id:TT.ID,label:$I.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:F.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(gs).quickAccess.show(iy.PREFIX)}};TT.ID="editor.action.quickCommand";let FE=TT;me(FE);pi.as(l_.Quickaccess).registerQuickAccessProvider({ctor:iy,prefix:iy.PREFIX,helpEntries:[{description:$I.quickCommandHelp,commandId:FE.ID}]});var VBe=function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},j_=function(s,e){return function(t,i){e(t,i,s)}};let wW=class extends qm{constructor(e,t,i,n,o,r,a){super(!0,e,t,i,n,o,r,a)}};wW=VBe([j_(1,Fe),j_(2,ft),j_(3,ki),j_(4,ke),j_(5,As),j_(6,qe)],wW);dt(qm.ID,wW,4);class zBe extends we{constructor(){super({id:"editor.action.toggleHighContrast",label:UF.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(Or),n=i.getColorTheme();wl(n.type)?(i.setTheme(this._originalThemeName||(_h(n.type)?uv:Ad)),this._originalThemeName=null):(i.setTheme(_h(n.type)?fp:gp),this._originalThemeName=n.themeName)}}me(zBe);const hoe={},XA={};class LH{static getOrCreate(e){return XA[e]||(XA[e]=new LH(e)),XA[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,hoe[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}}function UBe(s){const e=s.id;hoe[e]=s,Cb.register(s);const t=LH.getOrCreate(e);Cb.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),Cb.onLanguageEncountered(e,async()=>{const i=await t.load();Cb.setLanguageConfiguration(e,i.conf)})}UBe({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>s2e(()=>import("./yaml-DsrTNd4U.js"),__vite__mapDeps([0,1]),import.meta.url)});globalThis.MonacoEnvironment={getWorker:()=>new Worker(new URL(""+new URL("editor.worker-CKy7Pnvo.js",import.meta.url).href,import.meta.url),{type:"module"})};TW.config({monaco:t2e});var SW={},ZG=vre;SW.createRoot=ZG.createRoot,SW.hydrateRoot=ZG.hydrateRoot;function $Be(s,e){return e.find(t=>t.repository===s)}function uoe(s,e){const t=$Be(s,e);if(!t)return;const i=t.name.indexOf("/");return i>0?{project:t.name.slice(0,i),repoName:t.name.slice(i+1),ref:t.ref}:{repoName:t.name,ref:t.ref}}function jBe(s){let e=s,t;const i=e.lastIndexOf("@");return i>0&&(t=e.slice(i+1),e=e.slice(0,i),t==="self"&&(t=void 0)),e=e.replace(/\\/g,"/"),e=e.replace(/^\.\//,""),{normalizedPath:e,repoAlias:t}}function vv(s,e,t,i=!1,n={},o){const{normalizedPath:r,repoAlias:a}=jBe(s);return{rawPath:s,normalizedPath:r,repoAlias:a,contextRepoAlias:a??n.contextRepoAlias,sourcePath:n.sourcePath,parameters:t,location:e,conditional:i,conditionExpression:o}}function Cv(s){return s.repoAlias??s.contextRepoAlias}function qBe(s){if(s.normalizedPath.startsWith("/"))return{primary:s.normalizedPath};if(s.repoAlias||!s.sourcePath)return{primary:s.normalizedPath};const e=KBe(s.sourcePath);if(!e)return{primary:s.normalizedPath};const t=foe(`${e}/${s.normalizedPath}`);return t===s.normalizedPath?{primary:t}:{primary:t,fallback:s.normalizedPath}}function KBe(s){const e=s.replace(/\\/g,"/"),t=e.lastIndexOf("/");return t<0?"":t===0?"/":e.slice(0,t)}function foe(s){const e=s.startsWith("/"),t=s.split("/").filter(o=>o!==""&&o!=="."),i=[];for(const o of t)o===".."?i.length>0&&i[i.length-1]!==".."?i.pop():e||i.push(o):i.push(o);const n=i.join("/");return e?`/${n}`:n}function GBe(s){try{const e=new URL(s);if(!e.hostname.endsWith("dev.azure.com"))return null;const t=e.pathname.split("/").filter(Boolean);if(t.length<4||t[2]!=="_git")return null;const i=decodeURIComponent(t[0]),n=decodeURIComponent(t[1]),o=decodeURIComponent(t[3]),r=e.searchParams.get("path")||"",a=e.searchParams.get("version");let l,c;return a!=null&&a.startsWith("GB")?(l=a.slice(2),c=`refs/heads/${l}`):a!=null&&a.startsWith("GT")&&(c=`refs/tags/${a.slice(2)}`),r?{org:i,project:n,repoName:o,filePath:r,branch:l,ref:c}:null}catch{return null}}function goe(s){var i,n;const e=`https://dev.azure.com/${encodeURIComponent(s.org)}/${encodeURIComponent(s.project)}/_git/${encodeURIComponent(s.repoName)}`,t=new URLSearchParams({path:s.filePath});return(i=s.ref)!=null&&i.startsWith("refs/tags/")?t.set("version",`GT${s.ref.replace("refs/tags/","")}`):(n=s.ref)!=null&&n.startsWith("refs/heads/")?t.set("version",`GB${s.ref.replace("refs/heads/","")}`):s.branch&&t.set("version",`GB${s.branch}`),`${e}?${t}`}function YBe(s){const e=[];let t=0;for(;t<s.length;){if(/\s/.test(s[t])){t++;continue}if(s[t]==="'"){let i="";for(t++;t<s.length&&s[t]!=="'";)s[t]==="\\"&&t+1<s.length&&t++,i+=s[t],t++;t++,e.push({type:"STRING",value:i});continue}if(s[t]==="("){e.push({type:"LPAREN",value:"("}),t++;continue}if(s[t]===")"){e.push({type:"RPAREN",value:")"}),t++;continue}if(s[t]===","){e.push({type:"COMMA",value:","}),t++;continue}if(s[t]==="."){e.push({type:"DOT",value:"."}),t++;continue}if(s[t]==="["){e.push({type:"LBRACKET",value:"["}),t++;continue}if(s[t]==="]"){e.push({type:"RBRACKET",value:"]"}),t++;continue}if(/\d/.test(s[t])||s[t]==="-"&&t+1<s.length&&/\d/.test(s[t+1])){let i="";for(s[t]==="-"&&(i+="-",t++);t<s.length&&/[\d.]/.test(s[t]);)i+=s[t],t++;e.push({type:"NUMBER",value:i});continue}if(/[a-zA-Z_]/.test(s[t])){let i="";for(;t<s.length&&/[a-zA-Z0-9_]/.test(s[t]);)i+=s[t],t++;i==="true"||i==="false"?e.push({type:"BOOL",value:i}):i==="null"?e.push({type:"NULL",value:"null"}):e.push({type:"IDENT",value:i});continue}t++}return e}class ZBe{constructor(e){Mi(this,"tokens");Mi(this,"pos",0);this.tokens=e}parse(){return this.parseExpression()}peek(){return this.tokens[this.pos]}advance(){return this.tokens[this.pos++]}expect(e){const t=this.advance();if(!t||t.type!==e)throw new Error(`Expected ${e} but got ${(t==null?void 0:t.type)??"EOF"} (${t==null?void 0:t.value})`);return t}parseExpression(){const e=this.peek();if(!e)throw new Error("Unexpected end of expression");switch(e.type){case"STRING":return this.advance(),{kind:"string",value:e.value};case"NUMBER":return this.advance(),{kind:"number",value:Number(e.value)};case"BOOL":return this.advance(),{kind:"boolean",value:e.value==="true"};case"NULL":return this.advance(),{kind:"null"};case"IDENT":return this.parseIdentifierOrCall();default:throw new Error(`Unexpected token: ${e.type} (${e.value})`)}}parseIdentifierOrCall(){var t,i,n,o,r,a,l,c;const e=this.advance();if(((t=this.peek())==null?void 0:t.type)==="LPAREN"){this.advance();const d=[];if(((i=this.peek())==null?void 0:i.type)!=="RPAREN")for(d.push(this.parseExpression());((n=this.peek())==null?void 0:n.type)==="COMMA";)this.advance(),d.push(this.parseExpression());return this.expect("RPAREN"),{kind:"functionCall",name:e.value,args:d}}if(((o=this.peek())==null?void 0:o.type)==="DOT"){const d=[e.value];for(;((r=this.peek())==null?void 0:r.type)==="DOT";){this.advance();const h=this.peek();if((h==null?void 0:h.type)==="IDENT")d.push(this.advance().value);else if((h==null?void 0:h.type)==="BOOL")d.push(this.advance().value);else break}for(;((a=this.peek())==null?void 0:a.type)==="LBRACKET";){this.advance();const h=this.expect("STRING");d.push(h.value),this.expect("RBRACKET")}return d[0]==="parameters"?{kind:"parameterAccess",path:d.slice(1)}:d[0]==="variables"?{kind:"variableAccess",path:d.slice(1)}:{kind:"identifier",name:d.join(".")}}if(((l=this.peek())==null?void 0:l.type)==="LBRACKET"){const d=[e.value];for(;((c=this.peek())==null?void 0:c.type)==="LBRACKET";){this.advance();const h=this.expect("STRING");d.push(h.value),this.expect("RBRACKET")}return d[0]==="parameters"?{kind:"parameterAccess",path:d.slice(1)}:d[0]==="variables"?{kind:"variableAccess",path:d.slice(1)}:{kind:"identifier",name:d.join(".")}}return{kind:"identifier",name:e.value}}}function XG(s,e){let t=s;for(const i of e){if(t==null||typeof t!="object")return;t=t[i]}return t}function zi(s){return s==null?"":typeof s=="boolean"?s?"True":"False":typeof s=="object"?JSON.stringify(s):String(s)}function QA(s){return typeof s=="boolean"?s:typeof s=="string"?s!==""&&s.toLowerCase()!=="false":typeof s=="number"?s!==0:s!=null}function NL(s,e){return s==null&&e==null?!0:s==null||e==null?!1:typeof s=="boolean"&&typeof e=="string"?s===(e.toLowerCase()==="true"):typeof e=="boolean"&&typeof s=="string"?e===(s.toLowerCase()==="true"):typeof s=="string"&&typeof e=="string"?s.toLowerCase()===e.toLowerCase():s===e}const XBe={coalesce:s=>{for(const e of s)if(e!=null&&e!=="")return e;return null},eq:s=>NL(s[0],s[1]),ne:s=>!NL(s[0],s[1]),and:s=>s.every(QA),or:s=>s.some(QA),not:s=>!QA(s[0]),gt:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e>t:zi(e)>zi(t)},ge:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e>=t:zi(e)>=zi(t)},lt:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e<t:zi(e)<zi(t)},le:s=>{const[e,t]=s;return typeof e=="number"&&typeof t=="number"?e<=t:zi(e)<=zi(t)},replace:s=>{const e=zi(s[0]),t=zi(s[1]),i=zi(s[2]);return e.split(t).join(i)},in:s=>{const e=s[0];return s.slice(1).some(i=>NL(e,i))},startswith:s=>zi(s[0]).toLowerCase().startsWith(zi(s[1]).toLowerCase()),endswith:s=>zi(s[0]).toLowerCase().endsWith(zi(s[1]).toLowerCase()),contains:s=>{const e=s[0],t=zi(s[1]);return Array.isArray(e)?e.some(i=>NL(i,t)):zi(e).toLowerCase().includes(t.toLowerCase())},join:s=>{const e=zi(s[0]),t=s.slice(1);return t.length===1&&Array.isArray(t[0])?t[0].map(zi).join(e):t.map(zi).join(e)},lower:s=>zi(s[0]).toLowerCase(),upper:s=>zi(s[0]).toUpperCase(),length:s=>{const e=s[0];return typeof e=="string"||Array.isArray(e)?e.length:e&&typeof e=="object"?Object.keys(e).length:0},format:s=>{let e=zi(s[0]);for(let t=1;t<s.length;t++)e=e.split(`{${t-1}}`).join(zi(s[t]));return e},converttojson:s=>{const e=s[0];return e==null?"null":JSON.stringify(e)},counter:s=>zi(s[0])};function yW(s,e){switch(s.kind){case"string":return s.value;case"number":return s.value;case"boolean":return s.value;case"null":return null;case"parameterAccess":return XG(e.parameters??{},s.path);case"variableAccess":return XG(e.variables??{},s.path);case"identifier":return s.name;case"functionCall":{const t=XBe[s.name.toLowerCase()];if(!t){const n=s.args.map(o=>yW(o,e));return`${s.name}(${n.map(zi).join(", ")})`}const i=s.args.map(n=>yW(n,e));return t(i,e)}}}function poe(s,e={}){const t=s.trim();if(!t)return"";try{const i=YBe(t);if(i.length===0)return"";const o=new ZBe(i).parse();return yW(o,e)}catch{return s}}function moe(s,e={}){const t=/\$\{\{\s*(.*?)\s*\}\}/g,i=[],n=[];let o=!1;return{result:s.replace(t,(a,l)=>{o=!0;const c=poe(l,e),d=zi(c);return/\$\{\{/.test(d)||c===l||c===void 0?(n.push(l),a):(i.push(l),d)}),hadExpressions:o,isFullyResolved:o&&n.length===0,substituted:i,unresolved:n}}function WE(s){return/\$\{\{.*?\}\}/.test(s)}function QG(s,e,t,i){if(!WE(s))return{resolvedPath:s,isFullyResolved:!0,hadExpressions:!1,substituted:[],unresolved:[]};const o={parameters:{...e??{}},variables:i},{result:r,hadExpressions:a,isFullyResolved:l,substituted:c,unresolved:d}=moe(s,o);return{resolvedPath:r,isFullyResolved:a?l:!0,hadExpressions:a,substituted:c,unresolved:d}}function JA(s){const e=s.parameters;if(!Array.isArray(e))return{};const t={};for(const i of e)if(i&&typeof i=="object"&&"name"in i&&"default"in i){const n=i;t[n.name]=n.default}return t}function JG(s){const e=s.parameters;return Array.isArray(e)?e.filter(t=>t!=null&&typeof t=="object"&&"name"in t&&typeof t.name=="string").map(t=>t.name):[]}function eP(s){const e=s.variables;if(!e)return{};if(Array.isArray(e)){const t={};for(const i of e)if(i&&typeof i=="object"&&"name"in i&&"value"in i){const n=i;t[n.name]=String(n.value)}return t}if(typeof e=="object"){const t={};for(const[i,n]of Object.entries(e))t[i]=String(n);return t}return{}}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function _oe(s){return typeof s>"u"||s===null}function QBe(s){return typeof s=="object"&&s!==null}function JBe(s){return Array.isArray(s)?s:_oe(s)?[]:[s]}function e8e(s,e){var t,i,n,o;if(e)for(o=Object.keys(e),t=0,i=o.length;t<i;t+=1)n=o[t],s[n]=e[n];return s}function t8e(s,e){var t="",i;for(i=0;i<e;i+=1)t+=s;return t}function i8e(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}var n8e=_oe,s8e=QBe,o8e=JBe,r8e=t8e,a8e=i8e,l8e=e8e,cs={isNothing:n8e,isObject:s8e,toArray:o8e,repeat:r8e,isNegativeZero:a8e,extend:l8e};function boe(s,e){var t="",i=s.reason||"(unknown reason)";return s.mark?(s.mark.name&&(t+='in "'+s.mark.name+'" '),t+="("+(s.mark.line+1)+":"+(s.mark.column+1)+")",!e&&s.mark.snippet&&(t+=`
915
915
 
916
916
  `+s.mark.snippet),i+" "+t):i}function ny(s,e){Error.call(this),this.name="YAMLException",this.reason=s,this.mark=e,this.message=boe(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ny.prototype=Object.create(Error.prototype);ny.prototype.constructor=ny;ny.prototype.toString=function(e){return this.name+": "+boe(this,e)};var Bo=ny;function tP(s,e,t,i,n){var o="",r="",a=Math.floor(n/2)-1;return i-e>a&&(o=" ... ",e=i-a+o.length),t-i>a&&(r=" ...",t=i+a-r.length),{str:o+s.slice(e,t).replace(/\t/g,"→")+r,pos:i-e+o.length}}function iP(s,e){return cs.repeat(" ",e-s.length)+s}function c8e(s,e){if(e=Object.create(e||null),!s.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,i=[0],n=[],o,r=-1;o=t.exec(s.buffer);)n.push(o.index),i.push(o.index+o[0].length),s.position<=o.index&&r<0&&(r=i.length-2);r<0&&(r=i.length-1);var a="",l,c,d=Math.min(s.line+e.linesAfter,n.length).toString().length,h=e.maxLength-(e.indent+d+3);for(l=1;l<=e.linesBefore&&!(r-l<0);l++)c=tP(s.buffer,i[r-l],n[r-l],s.position-(i[r]-i[r-l]),h),a=cs.repeat(" ",e.indent)+iP((s.line-l+1).toString(),d)+" | "+c.str+`
917
917
  `+a;for(c=tP(s.buffer,i[r],n[r],s.position,h),a+=cs.repeat(" ",e.indent)+iP((s.line+1).toString(),d)+" | "+c.str+`
@@ -943,4 +943,4 @@ ${l}
943
943
  `,s.length-n>e&&r>n?l+=s.slice(n,r)+`
944
944
  `+s.slice(r+1):l+=s.slice(n),l.slice(1)}function Y6e(s){for(var e="",t=0,i,n=0;n<s.length;t>=65536?n+=2:n++)t=Xw(s,n),i=Io[t],!i&&ry(t)?(e+=s[n],t>=65536&&(e+=s[n+1])):e+=i||H6e(t);return e}function Z6e(s,e,t){var i="",n=s.tag,o,r,a;for(o=0,r=t.length;o<r;o+=1)a=t[o],s.replacer&&(a=s.replacer.call(t,String(o),a)),(kh(s,e,a,!1,!1)||typeof a>"u"&&kh(s,e,null,!1,!1))&&(i!==""&&(i+=","+(s.condenseFlow?"":" ")),i+=s.dump);s.tag=n,s.dump="["+i+"]"}function fY(s,e,t,i){var n="",o=s.tag,r,a,l;for(r=0,a=t.length;r<a;r+=1)l=t[r],s.replacer&&(l=s.replacer.call(t,String(r),l)),(kh(s,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&kh(s,e+1,null,!0,!0,!1,!0))&&((!i||n!=="")&&(n+=kW(s,e)),s.dump&&sy===s.dump.charCodeAt(0)?n+="-":n+="- ",n+=s.dump);s.tag=o,s.dump=n||"[]"}function X6e(s,e,t){var i="",n=s.tag,o=Object.keys(t),r,a,l,c,d;for(r=0,a=o.length;r<a;r+=1)d="",i!==""&&(d+=", "),s.condenseFlow&&(d+='"'),l=o[r],c=t[l],s.replacer&&(c=s.replacer.call(t,l,c)),kh(s,e,l,!1,!1)&&(s.dump.length>1024&&(d+="? "),d+=s.dump+(s.condenseFlow?'"':"")+":"+(s.condenseFlow?"":" "),kh(s,e,c,!1,!1)&&(d+=s.dump,i+=d));s.tag=n,s.dump="{"+i+"}"}function Q6e(s,e,t,i){var n="",o=s.tag,r=Object.keys(t),a,l,c,d,h,u;if(s.sortKeys===!0)r.sort();else if(typeof s.sortKeys=="function")r.sort(s.sortKeys);else if(s.sortKeys)throw new Bo("sortKeys must be a boolean or a function");for(a=0,l=r.length;a<l;a+=1)u="",(!i||n!=="")&&(u+=kW(s,e)),c=r[a],d=t[c],s.replacer&&(d=s.replacer.call(t,c,d)),kh(s,e+1,c,!0,!0,!0)&&(h=s.tag!==null&&s.tag!=="?"||s.dump&&s.dump.length>1024,h&&(s.dump&&sy===s.dump.charCodeAt(0)?u+="?":u+="? "),u+=s.dump,h&&(u+=kW(s,e)),kh(s,e+1,d,!0,h)&&(s.dump&&sy===s.dump.charCodeAt(0)?u+=":":u+=": ",u+=s.dump,n+=u));s.tag=o,s.dump=n||"{}"}function gY(s,e,t){var i,n,o,r,a,l;for(n=t?s.explicitTypes:s.implicitTypes,o=0,r=n.length;o<r;o+=1)if(a=n[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(t?a.multi&&a.representName?s.tag=a.representName(e):s.tag=a.tag:s.tag="?",a.represent){if(l=s.styleMap[a.tag]||a.defaultStyle,Goe.call(a.represent)==="[object Function]")i=a.represent(e,l);else if(Yoe.call(a.represent,l))i=a.represent[l](e,l);else throw new Bo("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');s.dump=i}return!0}return!1}function kh(s,e,t,i,n,o,r){s.tag=null,s.dump=t,gY(s,t,!1)||gY(s,t,!0);var a=Goe.call(s.dump),l=i,c;i&&(i=s.flowLevel<0||s.flowLevel>e);var d=a==="[object Object]"||a==="[object Array]",h,u;if(d&&(h=s.duplicates.indexOf(t),u=h!==-1),(s.tag!==null&&s.tag!=="?"||u||s.indent!==2&&e>0)&&(n=!1),u&&s.usedDuplicates[h])s.dump="*ref_"+h;else{if(d&&u&&!s.usedDuplicates[h]&&(s.usedDuplicates[h]=!0),a==="[object Object]")i&&Object.keys(s.dump).length!==0?(Q6e(s,e,s.dump,n),u&&(s.dump="&ref_"+h+s.dump)):(X6e(s,e,s.dump),u&&(s.dump="&ref_"+h+" "+s.dump));else if(a==="[object Array]")i&&s.dump.length!==0?(s.noArrayIndent&&!r&&e>0?fY(s,e-1,s.dump,n):fY(s,e,s.dump,n),u&&(s.dump="&ref_"+h+s.dump)):(Z6e(s,e,s.dump),u&&(s.dump="&ref_"+h+" "+s.dump));else if(a==="[object String]")s.tag!=="?"&&K6e(s,s.dump,e,o,l);else{if(a==="[object Undefined]")return!1;if(s.skipInvalid)return!1;throw new Bo("unacceptable kind of an object to dump "+a)}s.tag!==null&&s.tag!=="?"&&(c=encodeURI(s.tag[0]==="!"?s.tag.slice(1):s.tag).replace(/!/g,"%21"),s.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",s.dump=c+" "+s.dump)}return!0}function J6e(s,e){var t=[],i=[],n,o;for(DW(s,t,i),n=0,o=i.length;n<o;n+=1)e.duplicates.push(t[i[n]]);e.usedDuplicates=new Array(o)}function DW(s,e,t){var i,n,o;if(s!==null&&typeof s=="object")if(n=e.indexOf(s),n!==-1)t.indexOf(n)===-1&&t.push(n);else if(e.push(s),Array.isArray(s))for(n=0,o=s.length;n<o;n+=1)DW(s[n],e,t);else for(i=Object.keys(s),n=0,o=i.length;n<o;n+=1)DW(s[i[n]],e,t)}function eHe(s,e){e=e||{};var t=new z6e(e);t.noRefs||J6e(s,t);var i=s;return t.replacer&&(i=t.replacer.call({"":i},"",i)),kh(t,0,i,!0,!0)?t.dump+`
945
945
  `:""}var tHe=eHe,iHe={dump:tHe};function TH(s,e){return function(){throw new Error("Function yaml."+s+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var nHe=Zs,sHe=voe,oHe=yoe,rHe=Doe,aHe=Eoe,lHe=IH,cHe=Koe.load,dHe=Koe.loadAll,hHe=iHe.dump,uHe=Bo,fHe={binary:Aoe,float:Ioe,map:Soe,null:xoe,pairs:Ooe,set:Foe,timestamp:Roe,bool:Loe,int:koe,merge:Moe,omap:Poe,seq:woe,str:Coe},gHe=TH("safeLoad","load"),pHe=TH("safeLoadAll","loadAll"),mHe=TH("safeDump","dump"),_He={Type:nHe,Schema:sHe,FAILSAFE_SCHEMA:oHe,JSON_SCHEMA:rHe,CORE_SCHEMA:aHe,DEFAULT_SCHEMA:lHe,load:cHe,loadAll:dHe,dump:hHe,YAMLException:uHe,types:fHe,safeLoad:gHe,safeLoadAll:pHe,safeDump:mHe};const bHe=/^(\s*-\s*|\s*)(\$\{\{.+?\}\})(\s*:\s*(?:#.*)?)$/;function ib(s){return _He.load(vHe(s))}function vHe(s){let e=0;return s.split(/\r?\n/).map(t=>t.replace(bHe,(i,n,o,r)=>{const a=`${o}__apv_${e++}`;return`${n}${JSON.stringify(a)}${r}`})).join(`
946
- `)}const CHe={DotNetCoreCLI:"dotnet-core-cli","AdvancedSecurity-Codeql-Init":"advanced-security-codeql-init","AdvancedSecurity-Codeql-Analyze":"advanced-security-codeql-analyze","AdvancedSecurity-Publish":"advanced-security-publish",AndroidBuild:"android-build",AndroidSigning:"android-signing",Ant:"ant",AzureIoTEdge:"azure-iot-edge",CMake:"cmake",ContainerBuild:"container-build",Docker:"docker",DockerCompose:"docker-compose",DownloadGitHubNugetPackage:"download-github-nuget-package",Go:"go",Gradle:"gradle",Grunt:"grunt",gulp:"gulp",PublishSymbols:"publish-symbols",JenkinsQueueJob:"jenkins-queue-job",Maven:"maven",MSBuild:"msbuild",SonarQubePrepare:"sonar-qube-prepare",SonarQubePublish:"sonar-qube-publish",SonarQubeAnalyze:"sonar-qube-analyze",VSBuild:"vsbuild",Xcode:"xcode",XcodePackageiOS:"xcode-package-ios",AppCenterDistribute:"app-center-distribute",AzureResourceManagerTemplateDeployment:"azure-resource-manager-template-deployment",AzureAppConfigurationExport:"azure-app-configuration-export",AzureAppConfigurationImport:"azure-app-configuration-import",AzureAppConfigurationSnapshot:"azure-app-configuration-snapshot",AzureWebPowerShellDeployment:"azure-web-powershell-deployment",AzureRmWebAppDeployment:"azure-rm-web-app-deployment",AzureAppServiceManage:"azure-app-service-manage",AzureAppServiceSettings:"azure-app-service-settings",AzureCLI:"azure-cli",AzureCloudPowerShellDeployment:"azure-cloud-powershell-deployment",AzureContainerApps:"azure-container-apps",AzureMysqlDeployment:"azure-mysql-deployment",AzureFileCopy:"azure-file-copy",AzureFunctionOnKubernetes:"azure-function-on-kubernetes",AzureFunctionApp:"azure-function-app",AzureFunctionAppContainer:"azure-function-app-container",AzureKeyVault:"azure-key-vault",AzureMonitorAlerts:"azure-monitor-alerts",AzurePowerShell:"azure-powershell",AzureResourceGroupDeployment:"azure-resource-group-deployment",AzureSpringCloud:"azure-spring-cloud",SqlAzureDacpacDeployment:"sql-azure-dacpac-deployment",AzureVmssDeployment:"azure-vmss-deployment",AzureWebApp:"azure-web-app",AzureWebAppContainer:"azure-web-app-container",PackerBuild:"packer-build",AzurePolicyCheckGate:"azure-policy-check-gate",Chef:"chef",ChefKnife:"chef-knife",CopyFilesOverSSH:"copy-files-over-ssh",KubernetesManifest:"kubernetes-manifest",IISWebAppDeploymentOnMachineGroup:"iisweb-app-deployment-on-machine-group",IISWebAppDeployment:"iisweb-app-deployment",IISWebAppManagementOnMachineGroup:"iisweb-app-management-on-machine-group",InvokeRESTAPI:"invoke-rest-api",Kubernetes:"kubernetes",ManualIntervention:"manual-intervention",ManualValidation:"manual-validation",MysqlDeploymentOnMachineGroup:"mysql-deployment-on-machine-group",HelmDeploy:"helm-deploy",PowerShellOnTargetMachines:"powershell-on-target-machines",ServiceFabricDeploy:"service-fabric-deploy",ServiceFabricComposeDeploy:"service-fabric-compose-deploy",SqlDacpacDeploymentOnMachineGroup:"sql-dacpac-deployment-on-machine-group",SqlServerDacpacDeployment:"sql-server-dacpac-deployment",SSH:"ssh",WindowsMachineFileCopy:"windows-machine-file-copy",CargoAuthenticate:"cargo-authenticate",CocoaPods:"cocoa-pods",CondaEnvironment:"conda-environment",DownloadGithubNpmPackage:"download-github-npm-package",MavenAuthenticate:"maven-authenticate",Npm:"npm",npmAuthenticate:"npm-authenticate",NuGetCommand:"nuget-command",NuGet:"nuget",NuGetAuthenticate:"nuget-authenticate",NuGetInstaller:"nuget-installer",NuGetPackager:"nuget-packager",NuGetPublisher:"nuget-publisher",NuGetRestore:"nuget-restore",PyPIPublisher:"py-pi-publisher",PipAuthenticate:"pip-authenticate",TwineAuthenticate:"twine-authenticate",UniversalPackages:"universal-packages",AppCenterTest:"app-center-test",AzureLoadTest:"azure-load-test",AzureTestPlan:"azure-test-plan",ContainerStructureTest:"container-structure-test",VSMobileCenterTest:"vsmobile-center-test",PublishCodeCoverageResults:"publish-code-coverage-results",PublishTestResults:"publish-test-results",RunVisualStudioTestsusingTestAgent:"run-visual-studio-testsusing-test-agent",VSTest:"vstest",DeployVisualStudioTestAgent:"deploy-visual-studio-test-agent",DotNetCoreInstaller:"dotnet-core-installer",DockerInstaller:"docker-installer",DuffleInstaller:"duffle-installer",GoTool:"go-tool",HelmInstaller:"helm-installer",FuncToolsInstaller:"func-tools-installer",JavaToolInstaller:"java-tool-installer",KubectlInstaller:"kubectl-installer",KubeloginInstaller:"kubelogin-installer",NuGetToolInstaller:"nuget-tool-installer",UseDotNet:"use-dotnet",UseNode:"use-node",NodeTool:"node-tool",UsePythonVersion:"use-python-version",UseRubyVersion:"use-ruby-version",VisualStudioTestPlatformInstaller:"visual-studio-test-platform-installer","AdvancedSecurity-Dependency-Scanning":"advanced-security-dependency-scanning",ArchiveFiles:"archive-files",AzureNLBManagement:"azure-nlb-management",Bash:"bash",BatchScript:"batch-script",Cache:"cache",CacheBeta:"cache-beta",CmdLine:"cmd-line",CopyPublishBuildArtifacts:"copy-publish-build-artifacts",CopyFiles:"copy-files",cURLUploader:"curl-uploader",DecryptFile:"decrypt-file",Delay:"delay",DeleteFiles:"delete-files",AzureStaticWebApp:"azure-static-web-app",DownloadFileshareArtifacts:"download-fileshare-artifacts",DownloadBuildArtifacts:"download-build-artifacts",DownloadGitHubRelease:"download-github-release",DownloadPackage:"download-package",DownloadPipelineArtifact:"download-pipeline-artifact",DownloadSecureFile:"download-secure-file",ExtractFiles:"extract-files",FileTransform:"file-transform",FtpUpload:"ftp-upload",GitHubComment:"github-comment",GitHubRelease:"github-release",InstallAppleCertificate:"install-apple-certificate",InstallAppleProvisioningProfile:"install-apple-provisioning-profile",InstallSSHKey:"install-ssh-key",AzureFunction:"azure-function",JenkinsDownloadArtifacts:"jenkins-download-artifacts",NodeTaskRunnerInstaller:"node-task-runner-installer",Notation:"notation",PowerShell:"powershell",PublishBuildArtifacts:"publish-build-artifacts",PublishPipelineArtifact:"publish-pipeline-artifact",PublishPipelineMetadata:"publish-pipeline-metadata",PublishToAzureServiceBus:"publish-to-azure-service-bus",PythonScript:"python-script",AzureMonitor:"azure-monitor",queryWorkItems:"query-work-items",ReviewApp:"review-app",ServiceFabricPowerShell:"service-fabric-powershell",ShellScript:"shell-script",ServiceFabricUpdateAppVersions:"service-fabric-update-app-versions",ServiceFabricUpdateManifests:"service-fabric-update-manifests"};function wHe(s){const e=s.trim(),t=e.lastIndexOf("@");if(t>0){const i=e.slice(0,t),n=Number.parseInt(e.slice(t+1),10);return{raw:e,name:i,version:Number.isNaN(n)?0:n}}return{raw:e,name:e,version:0}}function SHe(s){return s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}const pY="https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference";function yHe(s,e){if(e){const n=`${s.name}@${s.version}`;if(e[n])return e[n];if(e[s.name])return e[s.name]}if(s.name.includes("."))return null;const t=CHe[s.name];if(t)return`${pY}/${t}-v${s.version}`;const i=SHe(s.name);return`${pY}/${i}-v${s.version}`}function xHe(s){const e=[],t=new Set;function i(l){typeof l=="string"&&!t.has(l)&&(t.add(l),e.push(wHe(l)))}function n(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;"task"in d&&i(d.task);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}function o(l){if(Array.isArray(l))for(const c of l){if(!c||typeof c!="object")continue;const d=c;"task"in d&&i(d.task),Array.isArray(d.steps)&&n(d.steps),Array.isArray(d.jobs)&&r(d.jobs),Array.isArray(d.stages)&&a(d.stages);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}else if(l&&typeof l=="object"){const c=l;"task"in c&&i(c.task);for(const d of Object.keys(c))d.startsWith("${{")&&o(c[d]);Array.isArray(c.steps)&&n(c.steps),Array.isArray(c.jobs)&&r(c.jobs),Array.isArray(c.stages)&&a(c.stages)}}function r(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;Array.isArray(d.steps)&&n(d.steps);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}function a(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;Array.isArray(d.jobs)&&r(d.jobs);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}Array.isArray(s.steps)&&n(s.steps),Array.isArray(s.jobs)&&r(s.jobs),Array.isArray(s.stages)&&a(s.stages);for(const l of Object.keys(s))l.startsWith("${{")&&o(s[l]);return e}function sP(s,e={}){const t=[];if(s.extends&&typeof s.extends=="object"){const i=s.extends;typeof i.template=="string"&&t.push(vv(i.template,"extends",i.parameters,!1,e));for(const n of Object.keys(i))if(RH(n)){const o=i[n];if(o&&typeof o=="object"&&!Array.isArray(o)){const r=o;typeof r.template=="string"&&t.push(vv(r.template,"extends",r.parameters??i.parameters,!0,e,MH(n)))}}i.parameters&&typeof i.parameters=="object"&&LHe(i.parameters,t,e)}if(Array.isArray(s.variables))for(const i of s.variables)i&&typeof i=="object"&&typeof i.template=="string"&&t.push(vv(i.template,"variables",i.parameters,!1,e));return Array.isArray(s.stages)&&Cr(s.stages,"stages",t,e),Array.isArray(s.jobs)&&Cr(s.jobs,"jobs",t,e),Array.isArray(s.steps)&&Cr(s.steps,"steps",t,e),t}function Cr(s,e,t,i){for(const n of s){if(!n||typeof n!="object")continue;const o=n;if(typeof o.template=="string"){t.push(vv(o.template,e,o.parameters,!1,i));continue}for(const r of Object.keys(o))if(RH(r)){const a=o[r];ore(a,e,t,i,MH(r))}Array.isArray(o.jobs)&&Cr(o.jobs,e==="extends-parameters"?"extends-parameters":"jobs",t,i),Array.isArray(o.steps)&&Cr(o.steps,e==="extends-parameters"?"extends-parameters":"steps",t,i),Array.isArray(o.stages)&&Cr(o.stages,e==="extends-parameters"?"extends-parameters":"stages",t,i)}}function ore(s,e,t,i,n){if(Array.isArray(s)){mY(s,e,t,i,n);return}s&&typeof s=="object"&&mY([s],e,t,i,n)}function mY(s,e,t,i,n){for(const o of s){if(!o||typeof o!="object")continue;const r=o;typeof r.template=="string"&&t.push(vv(r.template,e,r.parameters,!0,i,n));for(const a of Object.keys(r))RH(a)&&ore(r[a],e,t,i,MH(a));Array.isArray(r.jobs)&&Cr(r.jobs,e==="extends-parameters"?"extends-parameters":"jobs",t,i),Array.isArray(r.steps)&&Cr(r.steps,e==="extends-parameters"?"extends-parameters":"steps",t,i),Array.isArray(r.stages)&&Cr(r.stages,e==="extends-parameters"?"extends-parameters":"stages",t,i)}}function LHe(s,e,t){Array.isArray(s.stages)&&Cr(s.stages,"extends-parameters",e,t),Array.isArray(s.jobs)&&Cr(s.jobs,"extends-parameters",e,t),Array.isArray(s.steps)&&Cr(s.steps,"extends-parameters",e,t);for(const[,i]of Object.entries(s))if(Array.isArray(i))for(const n of i){if(n&&typeof n=="object"&&typeof n.template=="string"){const o=n;e.push(vv(o.template,"extends-parameters",o.parameters,!1,t))}if(n&&typeof n=="object"){const o=n;Array.isArray(o.jobs)&&Cr(o.jobs,"extends-parameters",e,t),Array.isArray(o.steps)&&Cr(o.steps,"extends-parameters",e,t)}}}function RH(s){return s.startsWith("${{")}function MH(s){const e=s.match(/\$\{\{\s*(?:else\s*)?if\s+(.*?)\s*\}\}/);return(e==null?void 0:e[1])||void 0}const rre={},{useDebugValue:kHe}=Eu,{useSyncExternalStoreWithSelector:IHe}=wre;let _Y=!1;const DHe=s=>s;function EHe(s,e=DHe,t){(rre?"production":void 0)!=="production"&&t&&!_Y&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),_Y=!0);const i=IHe(s.subscribe,s.getState,s.getServerState||s.getInitialState,e,t);return kHe(i),i}const bY=s=>{(rre?"production":void 0)!=="production"&&typeof s!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof s=="function"?Cre(s):s,t=(i,n)=>EHe(e,i,n);return Object.assign(t,e),t},NHe=s=>s?bY(s):bY,_2=NHe(s=>({org:"",project:"",setConnection:(e,t)=>s({org:e,project:t}),pipelines:[],pipelinesLoading:!1,pipelinesError:null,setPipelines:e=>s({pipelines:e,pipelinesError:null}),setPipelinesLoading:e=>s({pipelinesLoading:e}),setPipelinesError:e=>s({pipelinesError:e}),selectedPipeline:null,selectedPipelineLoading:!1,selectedPipelineError:null,setSelectedPipeline:e=>s({selectedPipeline:e,selectedPipelineError:null,expandedNodes:new Set}),setSelectedPipelineLoading:e=>s({selectedPipelineLoading:e}),setSelectedPipelineError:e=>s({selectedPipelineError:e}),expandedTemplates:new Map(THe()),setExpandedTemplate:(e,t)=>s(i=>{const n=new Map(i.expandedTemplates);return n.set(e,t),RHe(n),{expandedTemplates:n}}),expandedNodes:new Set,toggleNode:e=>s(t=>{const i=new Set(t.expandedNodes);return i.has(e)?i.delete(e):i.add(e),{expandedNodes:i}}),selectedNodeDetail:null,setSelectedNodeDetail:e=>s({selectedNodeDetail:e}),customTaskDocs:{},setCustomTaskDocs:e=>s({customTaskDocs:e}),taskSchema:new Map,setTaskSchema:e=>s(()=>{const t=new Map;for(const i of e)t.set(`${i.name}@${i.version}`,i);return{taskSchema:t}})})),are="apv-template-cache";function THe(){try{const s=localStorage.getItem(are);if(s)return JSON.parse(s)}catch{}return[]}function RHe(s){try{const t=Array.from(s.entries()).slice(-100);localStorage.setItem(are,JSON.stringify(t))}catch{}}function MHe(){const{selectedNodeDetail:s,customTaskDocs:e,taskSchema:t,setSelectedNodeDetail:i}=_2(),n=je.useMemo(()=>{if(!(s!=null&&s.yaml))return[];try{const o=ib(s.yaml);return xHe(o??{})}catch{return[]}},[s==null?void 0:s.yaml]);return s?ue.jsxs("div",{className:"detail-panel",children:[ue.jsxs("div",{className:"detail-panel__header",children:[ue.jsxs("div",{className:"detail-panel__header-row",children:[ue.jsx("h3",{className:"detail-panel__title",children:s.label}),ue.jsx("button",{className:"detail-panel__close",onClick:()=>i(null),"aria-label":"Close detail panel",title:"Close",children:"✕"})]}),ue.jsxs("div",{className:"detail-panel__path",children:[s.filePath,s.repoAlias&&ue.jsxs("span",{className:"detail-panel__repo",children:[" ","@",s.repoAlias]})]})]}),n.length>0&&ue.jsxs("div",{className:"detail-panel__tasks",children:[ue.jsxs("h4",{className:"detail-panel__section-title",children:["Tasks (",n.length,")"]}),ue.jsx("ul",{className:"task-list",children:n.map(o=>ue.jsx(AHe,{ref_:o,customDocs:e,schemaEntry:t.get(o.raw)??t.get(`${o.name}@${o.version}`)},o.raw))})]}),ue.jsx("div",{className:"detail-panel__editor",children:ue.jsx(Bae,{height:"100%",language:"yaml",value:s.yaml,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,lineNumbers:"on",renderLineHighlight:"none",wordWrap:"on",padding:{top:8}}})})]}):ue.jsx("div",{className:"detail-panel detail-panel--empty",children:ue.jsx("p",{children:"Click a node to view its contents"})})}function AHe({ref_:s,customDocs:e,schemaEntry:t}){const i=yHe(s,e);return ue.jsxs("li",{className:"task-item",children:[ue.jsx("span",{className:"task-item__icon",children:"⚙️"}),ue.jsxs("div",{className:"task-item__content",children:[i?ue.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"task-item__link",title:(t==null?void 0:t.description)||`Open docs for ${s.name}`,children:[s.name,ue.jsxs("span",{className:"task-item__version",children:["@",s.version]}),ue.jsx("span",{className:"task-item__external",children:"↗"})]}):ue.jsxs("span",{className:"task-item__name",children:[s.name,ue.jsxs("span",{className:"task-item__version",children:["@",s.version]})]}),(t==null?void 0:t.description)&&ue.jsx("div",{className:"task-item__description",children:t.description})]})]})}class oP extends je.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught:",e,t)}render(){var e;return this.state.hasError?this.props.fallback||ue.jsxs("div",{className:"error",children:[ue.jsx("h3",{children:"Something went wrong"}),ue.jsx("p",{children:(e=this.state.error)==null?void 0:e.message}),ue.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),style:{marginTop:8,cursor:"pointer"},children:"Try again"})]}):this.props.children}}const AH="7.1";function PH(s,e){return`https://dev.azure.com/${encodeURIComponent(s)}/${encodeURIComponent(e)}/_apis`}function PHe(s){return s.startsWith("refs/heads/")?{version:s.slice(11),versionType:"branch"}:s.startsWith("refs/tags/")?{version:s.slice(10),versionType:"tag"}:/^[0-9a-f]{40}$/i.test(s)?{version:s,versionType:"commit"}:{version:s,versionType:"branch"}}async function OH(s){const e=await fetch(s,{credentials:"include"});if(!e.ok){const t=await e.text();throw new Error(`ADO API error (${e.status}): ${t}`)}return e}async function lre(s,e,t,i,n){const o=i.startsWith("/")?i:`/${i}`,r=foe(o);let a=`${PH(s,e)}/git/repositories/${encodeURIComponent(t)}/items?path=${encodeURIComponent(r)}&api-version=${AH}&includeContent=true&$format=text`;if(n){const c=PHe(n);a+=`&versionDescriptor.version=${encodeURIComponent(c.version)}&versionDescriptor.versionType=${c.versionType}`}return(await OH(a)).text()}async function OHe(s,e){const t=`${PH(s,e)}/pipelines?api-version=${AH}`;return(await(await OH(t)).json()).value}async function FHe(s,e,t){var l,c,d,h,u;const i=`${PH(s,e)}/build/definitions/${t}?api-version=${AH}`,o=await(await OH(i)).json(),r={id:o.id,name:o.name,path:((l=o.process)==null?void 0:l.yamlFilename)??o.path,repository:{id:(c=o.repository)==null?void 0:c.id,name:(d=o.repository)==null?void 0:d.name,type:(h=o.repository)==null?void 0:h.type,defaultBranch:(u=o.repository)==null?void 0:u.defaultBranch}},a=await lre(s,e,r.repository.id,r.path,r.repository.defaultBranch);return{definition:r,yaml:a}}async function WHe(s,e,t,i,n){return{content:await lre(s,e,t,i,n),path:i,repoId:t,repoName:t,branch:n||""}}async function BHe(){return{customTaskDocs:{}}}async function HHe(s){return{tasks:[],cached:!1}}const VHe="/api";var EY;const Xy=typeof window<"u"&&((EY=window.location)==null?void 0:EY.protocol)==="chrome-extension:";async function Qy(s){const e=await fetch(`${VHe}${s}`);if(!e.ok){const t=await e.text();throw new Error(`API error (${e.status}): ${t}`)}return e.json()}function zHe(s,e){return Xy?OHe(s,e):Qy(`/${s}/${e}/pipelines`)}function vY(s,e,t){return Xy?FHe(s,e,t):Qy(`/${s}/${e}/pipelines/${t}/yaml`)}function EW(s,e,t,i,n){if(Xy)return WHe(s,e,t,i,n);const o=new URLSearchParams({repo:t,path:i});return n&&o.set("branch",n),Qy(`/${s}/${e}/file-by-repo-name?${o}`)}function UHe(){return Xy?BHe():Qy("/config/task-docs")}function $He(s){return Xy?HHe():Qy(`/${s}/schema/tasks`)}var Ri=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Ml=Ri((s,e)=>{var t=Object.defineProperty,i=(M,A,O)=>A in M?t(M,A,{enumerable:!0,configurable:!0,writable:!0,value:O}):M[A]=O,n=(M,A)=>()=>(A||M((A={exports:{}}).exports,A),A.exports),o=(M,A,O)=>i(M,typeof A!="symbol"?A+"":A,O),r=n((M,A)=>{var O="\0",W="\0",V="",$=class{constructor(K){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),K&&(this._isDirected=Object.hasOwn(K,"directed")?K.directed:!0,this._isMultigraph=Object.hasOwn(K,"multigraph")?K.multigraph:!1,this._isCompound=Object.hasOwn(K,"compound")?K.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[W]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(K){return this._label=K,this}graph(){return this._label}setDefaultNodeLabel(K){return this._defaultNodeLabelFn=K,typeof K!="function"&&(this._defaultNodeLabelFn=()=>K),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var K=this;return this.nodes().filter(z=>Object.keys(K._in[z]).length===0)}sinks(){var K=this;return this.nodes().filter(z=>Object.keys(K._out[z]).length===0)}setNodes(K,z){var te=arguments,le=this;return K.forEach(function(pe){te.length>1?le.setNode(pe,z):le.setNode(pe)}),this}setNode(K,z){return Object.hasOwn(this._nodes,K)?(arguments.length>1&&(this._nodes[K]=z),this):(this._nodes[K]=arguments.length>1?z:this._defaultNodeLabelFn(K),this._isCompound&&(this._parent[K]=W,this._children[K]={},this._children[W][K]=!0),this._in[K]={},this._preds[K]={},this._out[K]={},this._sucs[K]={},++this._nodeCount,this)}node(K){return this._nodes[K]}hasNode(K){return Object.hasOwn(this._nodes,K)}removeNode(K){var z=this;if(Object.hasOwn(this._nodes,K)){var te=le=>z.removeEdge(z._edgeObjs[le]);delete this._nodes[K],this._isCompound&&(this._removeFromParentsChildList(K),delete this._parent[K],this.children(K).forEach(function(le){z.setParent(le)}),delete this._children[K]),Object.keys(this._in[K]).forEach(te),delete this._in[K],delete this._preds[K],Object.keys(this._out[K]).forEach(te),delete this._out[K],delete this._sucs[K],--this._nodeCount}return this}setParent(K,z){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(z===void 0)z=W;else{z+="";for(var te=z;te!==void 0;te=this.parent(te))if(te===K)throw new Error("Setting "+z+" as parent of "+K+" would create a cycle");this.setNode(z)}return this.setNode(K),this._removeFromParentsChildList(K),this._parent[K]=z,this._children[z][K]=!0,this}_removeFromParentsChildList(K){delete this._children[this._parent[K]][K]}parent(K){if(this._isCompound){var z=this._parent[K];if(z!==W)return z}}children(K=W){if(this._isCompound){var z=this._children[K];if(z)return Object.keys(z)}else{if(K===W)return this.nodes();if(this.hasNode(K))return[]}}predecessors(K){var z=this._preds[K];if(z)return Object.keys(z)}successors(K){var z=this._sucs[K];if(z)return Object.keys(z)}neighbors(K){var z=this.predecessors(K);if(z){let le=new Set(z);for(var te of this.successors(K))le.add(te);return Array.from(le.values())}}isLeaf(K){var z;return this.isDirected()?z=this.successors(K):z=this.neighbors(K),z.length===0}filterNodes(K){var z=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});z.setGraph(this.graph());var te=this;Object.entries(this._nodes).forEach(function([ve,We]){K(ve)&&z.setNode(ve,We)}),Object.values(this._edgeObjs).forEach(function(ve){z.hasNode(ve.v)&&z.hasNode(ve.w)&&z.setEdge(ve,te.edge(ve))});var le={};function pe(ve){var We=te.parent(ve);return We===void 0||z.hasNode(We)?(le[ve]=We,We):We in le?le[We]:pe(We)}return this._isCompound&&z.nodes().forEach(ve=>z.setParent(ve,pe(ve))),z}setDefaultEdgeLabel(K){return this._defaultEdgeLabelFn=K,typeof K!="function"&&(this._defaultEdgeLabelFn=()=>K),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(K,z){var te=this,le=arguments;return K.reduce(function(pe,ve){return le.length>1?te.setEdge(pe,ve,z):te.setEdge(pe,ve),ve}),this}setEdge(){var K,z,te,le,pe=!1,ve=arguments[0];typeof ve=="object"&&ve!==null&&"v"in ve?(K=ve.v,z=ve.w,te=ve.name,arguments.length===2&&(le=arguments[1],pe=!0)):(K=ve,z=arguments[1],te=arguments[3],arguments.length>2&&(le=arguments[2],pe=!0)),K=""+K,z=""+z,te!==void 0&&(te=""+te);var We=Y(this._isDirected,K,z,te);if(Object.hasOwn(this._edgeLabels,We))return pe&&(this._edgeLabels[We]=le),this;if(te!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(K),this.setNode(z),this._edgeLabels[We]=pe?le:this._defaultEdgeLabelFn(K,z,te);var Be=Q(this._isDirected,K,z,te);return K=Be.v,z=Be.w,Object.freeze(Be),this._edgeObjs[We]=Be,q(this._preds[z],K),q(this._sucs[K],z),this._in[z][We]=Be,this._out[K][We]=Be,this._edgeCount++,this}edge(K,z,te){var le=arguments.length===1?re(this._isDirected,arguments[0]):Y(this._isDirected,K,z,te);return this._edgeLabels[le]}edgeAsObj(){let K=this.edge(...arguments);return typeof K!="object"?{label:K}:K}hasEdge(K,z,te){var le=arguments.length===1?re(this._isDirected,arguments[0]):Y(this._isDirected,K,z,te);return Object.hasOwn(this._edgeLabels,le)}removeEdge(K,z,te){var le=arguments.length===1?re(this._isDirected,arguments[0]):Y(this._isDirected,K,z,te),pe=this._edgeObjs[le];return pe&&(K=pe.v,z=pe.w,delete this._edgeLabels[le],delete this._edgeObjs[le],Z(this._preds[z],K),Z(this._sucs[K],z),delete this._in[z][le],delete this._out[K][le],this._edgeCount--),this}inEdges(K,z){return this.isDirected()?this.filterEdges(this._in[K],K,z):this.nodeEdges(K,z)}outEdges(K,z){return this.isDirected()?this.filterEdges(this._out[K],K,z):this.nodeEdges(K,z)}nodeEdges(K,z){if(K in this._nodes)return this.filterEdges({...this._in[K],...this._out[K]},K,z)}filterEdges(K,z,te){if(K){var le=Object.values(K);return te?le.filter(function(pe){return pe.v===z&&pe.w===te||pe.v===te&&pe.w===z}):le}}};function q(K,z){K[z]?K[z]++:K[z]=1}function Z(K,z){--K[z]||delete K[z]}function Y(K,z,te,le){var pe=""+z,ve=""+te;if(!K&&pe>ve){var We=pe;pe=ve,ve=We}return pe+V+ve+V+(le===void 0?O:le)}function Q(K,z,te,le){var pe=""+z,ve=""+te;if(!K&&pe>ve){var We=pe;pe=ve,ve=We}var Be={v:pe,w:ve};return le&&(Be.name=le),Be}function re(K,z){return Y(K,z.v,z.w,z.name)}A.exports=$}),a=n((M,A)=>{A.exports="3.0.2"}),l=n((M,A)=>{A.exports={Graph:r(),version:a()}}),c=n((M,A)=>{var O=r();A.exports={write:W,read:q};function W(Z){var Y={options:{directed:Z.isDirected(),multigraph:Z.isMultigraph(),compound:Z.isCompound()},nodes:V(Z),edges:$(Z)};return Z.graph()!==void 0&&(Y.value=structuredClone(Z.graph())),Y}function V(Z){return Z.nodes().map(function(Y){var Q=Z.node(Y),re=Z.parent(Y),K={v:Y};return Q!==void 0&&(K.value=Q),re!==void 0&&(K.parent=re),K})}function $(Z){return Z.edges().map(function(Y){var Q=Z.edge(Y),re={v:Y.v,w:Y.w};return Y.name!==void 0&&(re.name=Y.name),Q!==void 0&&(re.value=Q),re})}function q(Z){var Y=new O(Z.options).setGraph(Z.value);return Z.nodes.forEach(function(Q){Y.setNode(Q.v,Q.value),Q.parent&&Y.setParent(Q.v,Q.parent)}),Z.edges.forEach(function(Q){Y.setEdge({v:Q.v,w:Q.w,name:Q.name},Q.value)}),Y}}),d=n((M,A)=>{A.exports=W;var O=()=>1;function W($,q,Z,Y){return V($,String(q),Z||O,Y||function(Q){return $.outEdges(Q)})}function V($,q,Z,Y){var Q={},re=!0,K=0,z=$.nodes(),te=function(We){var Be=Z(We);Q[We.v].distance+Be<Q[We.w].distance&&(Q[We.w]={distance:Q[We.v].distance+Be,predecessor:We.v},re=!0)},le=function(){z.forEach(function(We){Y(We).forEach(function(Be){var Mt=Be.v===We?Be.v:Be.w,oo=Mt===Be.v?Be.w:Be.v;te({v:Mt,w:oo})})})};z.forEach(function(We){var Be=We===q?0:Number.POSITIVE_INFINITY;Q[We]={distance:Be}});for(var pe=z.length,ve=1;ve<pe&&(re=!1,K++,le(),!!re);ve++);if(K===pe-1&&(re=!1,le(),re))throw new Error("The graph contains a negative weight cycle");return Q}}),h=n((M,A)=>{A.exports=O;function O(W){var V={},$=[],q;function Z(Y){Object.hasOwn(V,Y)||(V[Y]=!0,q.push(Y),W.successors(Y).forEach(Z),W.predecessors(Y).forEach(Z))}return W.nodes().forEach(function(Y){q=[],Z(Y),q.length&&$.push(q)}),$}}),u=n((M,A)=>{var O=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(W){return W.key})}has(W){return Object.hasOwn(this._keyIndices,W)}priority(W){var V=this._keyIndices[W];if(V!==void 0)return this._arr[V].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(W,V){var $=this._keyIndices;if(W=String(W),!Object.hasOwn($,W)){var q=this._arr,Z=q.length;return $[W]=Z,q.push({key:W,priority:V}),this._decrease(Z),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var W=this._arr.pop();return delete this._keyIndices[W.key],this._heapify(0),W.key}decrease(W,V){var $=this._keyIndices[W];if(V>this._arr[$].priority)throw new Error("New priority is greater than current priority. Key: "+W+" Old: "+this._arr[$].priority+" New: "+V);this._arr[$].priority=V,this._decrease($)}_heapify(W){var V=this._arr,$=2*W,q=$+1,Z=W;$<V.length&&(Z=V[$].priority<V[Z].priority?$:Z,q<V.length&&(Z=V[q].priority<V[Z].priority?q:Z),Z!==W&&(this._swap(W,Z),this._heapify(Z)))}_decrease(W){for(var V=this._arr,$=V[W].priority,q;W!==0&&(q=W>>1,!(V[q].priority<$));)this._swap(W,q),W=q}_swap(W,V){var $=this._arr,q=this._keyIndices,Z=$[W],Y=$[V];$[W]=Y,$[V]=Z,q[Y.key]=W,q[Z.key]=V}};A.exports=O}),f=n((M,A)=>{var O=u();A.exports=V;var W=()=>1;function V(q,Z,Y,Q){var re=function(K){return q.outEdges(K)};return $(q,String(Z),Y||W,Q||re)}function $(q,Z,Y,Q){var re={},K=new O,z,te,le=function(pe){var ve=pe.v!==z?pe.v:pe.w,We=re[ve],Be=Y(pe),Mt=te.distance+Be;if(Be<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+pe+" Weight: "+Be);Mt<We.distance&&(We.distance=Mt,We.predecessor=z,K.decrease(ve,Mt))};for(q.nodes().forEach(function(pe){var ve=pe===Z?0:Number.POSITIVE_INFINITY;re[pe]={distance:ve},K.add(pe,ve)});K.size()>0&&(z=K.removeMin(),te=re[z],te.distance!==Number.POSITIVE_INFINITY);)Q(z).forEach(le);return re}}),g=n((M,A)=>{var O=f();A.exports=W;function W(V,$,q){return V.nodes().reduce(function(Z,Y){return Z[Y]=O(V,Y,$,q),Z},{})}}),p=n((M,A)=>{A.exports=O;function O(V,$,q){if(V[$].predecessor!==void 0)throw new Error("Invalid source vertex");if(V[q].predecessor===void 0&&q!==$)throw new Error("Invalid destination vertex");return{weight:V[q].distance,path:W(V,$,q)}}function W(V,$,q){for(var Z=[],Y=q;Y!==$;)Z.push(Y),Y=V[Y].predecessor;return Z.push($),Z.reverse()}}),_=n((M,A)=>{A.exports=O;function O(W){var V=0,$=[],q={},Z=[];function Y(Q){var re=q[Q]={onStack:!0,lowlink:V,index:V++};if($.push(Q),W.successors(Q).forEach(function(te){Object.hasOwn(q,te)?q[te].onStack&&(re.lowlink=Math.min(re.lowlink,q[te].index)):(Y(te),re.lowlink=Math.min(re.lowlink,q[te].lowlink))}),re.lowlink===re.index){var K=[],z;do z=$.pop(),q[z].onStack=!1,K.push(z);while(Q!==z);Z.push(K)}}return W.nodes().forEach(function(Q){Object.hasOwn(q,Q)||Y(Q)}),Z}}),v=n((M,A)=>{var O=_();A.exports=W;function W(V){return O(V).filter(function($){return $.length>1||$.length===1&&V.hasEdge($[0],$[0])})}}),b=n((M,A)=>{A.exports=W;var O=()=>1;function W($,q,Z){return V($,q||O,Z||function(Y){return $.outEdges(Y)})}function V($,q,Z){var Y={},Q=$.nodes();return Q.forEach(function(re){Y[re]={},Y[re][re]={distance:0},Q.forEach(function(K){re!==K&&(Y[re][K]={distance:Number.POSITIVE_INFINITY})}),Z(re).forEach(function(K){var z=K.v===re?K.w:K.v,te=q(K);Y[re][z]={distance:te,predecessor:re}})}),Q.forEach(function(re){var K=Y[re];Q.forEach(function(z){var te=Y[z];Q.forEach(function(le){var pe=te[re],ve=K[le],We=te[le],Be=pe.distance+ve.distance;Be<We.distance&&(We.distance=Be,We.predecessor=ve.predecessor)})})}),Y}}),w=n((M,A)=>{function O(V){var $={},q={},Z=[];function Y(Q){if(Object.hasOwn(q,Q))throw new W;Object.hasOwn($,Q)||(q[Q]=!0,$[Q]=!0,V.predecessors(Q).forEach(Y),delete q[Q],Z.push(Q))}if(V.sinks().forEach(Y),Object.keys($).length!==V.nodeCount())throw new W;return Z}var W=class extends Error{constructor(){super(...arguments)}};A.exports=O,O.CycleException=W}),C=n((M,A)=>{var O=w();A.exports=W;function W(V){try{O(V)}catch($){if($ instanceof O.CycleException)return!1;throw $}return!0}}),S=n((M,A)=>{A.exports=O;function O(V,$,q,Z,Y){Array.isArray($)||($=[$]);var Q=(V.isDirected()?V.successors:V.neighbors).bind(V),re={};return $.forEach(function(K){if(!V.hasNode(K))throw new Error("Graph does not have node: "+K);Y=W(V,K,q==="post",re,Q,Z,Y)}),Y}function W(V,$,q,Z,Y,Q,re){return Object.hasOwn(Z,$)||(Z[$]=!0,q||(re=Q(re,$)),Y($).forEach(function(K){re=W(V,K,q,Z,Y,Q,re)}),q&&(re=Q(re,$))),re}}),x=n((M,A)=>{var O=S();A.exports=W;function W(V,$,q){return O(V,$,q,function(Z,Y){return Z.push(Y),Z},[])}}),y=n((M,A)=>{var O=x();A.exports=W;function W(V,$){return O(V,$,"post")}}),L=n((M,A)=>{var O=x();A.exports=W;function W(V,$){return O(V,$,"pre")}}),D=n((M,A)=>{var O=r(),W=u();A.exports=V;function V($,q){var Z=new O,Y={},Q=new W,re;function K(te){var le=te.v===re?te.w:te.v,pe=Q.priority(le);if(pe!==void 0){var ve=q(te);ve<pe&&(Y[le]=re,Q.decrease(le,ve))}}if($.nodeCount()===0)return Z;$.nodes().forEach(function(te){Q.add(te,Number.POSITIVE_INFINITY),Z.setNode(te)}),Q.decrease($.nodes()[0],0);for(var z=!1;Q.size()>0;){if(re=Q.removeMin(),Object.hasOwn(Y,re))Z.setEdge(re,Y[re]);else{if(z)throw new Error("Input graph is not connected: "+$);z=!0}$.nodeEdges(re).forEach(K)}return Z}}),E=n((M,A)=>{var O=f(),W=d();A.exports=V;function V(q,Z,Y,Q){return $(q,Z,Y,Q||function(re){return q.outEdges(re)})}function $(q,Z,Y,Q){if(Y===void 0)return O(q,Z,Y,Q);for(var re=!1,K=q.nodes(),z=0;z<K.length;z++){for(var te=Q(K[z]),le=0;le<te.length;le++){var pe=te[le],ve=pe.v===K[z]?pe.v:pe.w,We=ve===pe.v?pe.w:pe.v;Y({v:ve,w:We})<0&&(re=!0)}if(re)return W(q,Z,Y,Q)}return O(q,Z,Y,Q)}}),T=n((M,A)=>{A.exports={bellmanFord:d(),components:h(),dijkstra:f(),dijkstraAll:g(),extractPath:p(),findCycles:v(),floydWarshall:b(),isAcyclic:C(),postorder:y(),preorder:L(),prim:D(),shortestPaths:E(),reduce:S(),tarjan:_(),topsort:w()}}),N=l();e.exports={Graph:N.Graph,json:c(),alg:T(),version:N.version}}),jHe=Ri((s,e)=>{var t=class{constructor(){let o={};o._next=o._prev=o,this._sentinel=o}dequeue(){let o=this._sentinel,r=o._prev;if(r!==o)return i(r),r}enqueue(o){let r=this._sentinel;o._prev&&o._next&&i(o),o._next=r._next,r._next._prev=o,r._next=o,o._prev=r}toString(){let o=[],r=this._sentinel,a=r._prev;for(;a!==r;)o.push(JSON.stringify(a,n)),a=a._prev;return"["+o.join(", ")+"]"}};function i(o){o._prev._next=o._next,o._next._prev=o._prev,delete o._next,delete o._prev}function n(o,r){if(o!=="_next"&&o!=="_prev")return r}e.exports=t}),qHe=Ri((s,e)=>{var t=Ml().Graph,i=jHe();e.exports=o;var n=()=>1;function o(h,u){if(h.nodeCount()<=1)return[];let f=l(h,u||n);return r(f.graph,f.buckets,f.zeroIdx).flatMap(g=>h.outEdges(g.v,g.w))}function r(h,u,f){let g=[],p=u[u.length-1],_=u[0],v;for(;h.nodeCount();){for(;v=_.dequeue();)a(h,u,f,v);for(;v=p.dequeue();)a(h,u,f,v);if(h.nodeCount()){for(let b=u.length-2;b>0;--b)if(v=u[b].dequeue(),v){g=g.concat(a(h,u,f,v,!0));break}}}return g}function a(h,u,f,g,p){let _=p?[]:void 0;return h.inEdges(g.v).forEach(v=>{let b=h.edge(v),w=h.node(v.v);p&&_.push({v:v.v,w:v.w}),w.out-=b,c(u,f,w)}),h.outEdges(g.v).forEach(v=>{let b=h.edge(v),w=v.w,C=h.node(w);C.in-=b,c(u,f,C)}),h.removeNode(g.v),_}function l(h,u){let f=new t,g=0,p=0;h.nodes().forEach(b=>{f.setNode(b,{v:b,in:0,out:0})}),h.edges().forEach(b=>{let w=f.edge(b.v,b.w)||0,C=u(b),S=w+C;f.setEdge(b.v,b.w,S),p=Math.max(p,f.node(b.v).out+=C),g=Math.max(g,f.node(b.w).in+=C)});let _=d(p+g+3).map(()=>new i),v=g+1;return f.nodes().forEach(b=>{c(_,v,f.node(b))}),{graph:f,buckets:_,zeroIdx:v}}function c(h,u,f){f.out?f.in?h[f.out-f.in+u].enqueue(f):h[h.length-1].enqueue(f):h[0].enqueue(f)}function d(h){let u=[];for(let f=0;f<h;f++)u.push(f);return u}}),Jn=Ri((s,e)=>{var t=Ml().Graph;e.exports={addBorderNode:u,addDummyNode:i,applyWithChunking:p,asNonCompoundGraph:o,buildLayerMatrix:c,intersectRect:l,mapValues:L,maxRank:_,normalizeRanks:d,notime:w,partition:v,pick:y,predecessorWeights:a,range:x,removeEmptyRanks:h,simplify:n,successorWeights:r,time:b,uniqueId:S,zipObject:D};function i(E,T,N,M){for(var A=M;E.hasNode(A);)A=S(M);return N.dummy=T,E.setNode(A,N),A}function n(E){let T=new t().setGraph(E.graph());return E.nodes().forEach(N=>T.setNode(N,E.node(N))),E.edges().forEach(N=>{let M=T.edge(N.v,N.w)||{weight:0,minlen:1},A=E.edge(N);T.setEdge(N.v,N.w,{weight:M.weight+A.weight,minlen:Math.max(M.minlen,A.minlen)})}),T}function o(E){let T=new t({multigraph:E.isMultigraph()}).setGraph(E.graph());return E.nodes().forEach(N=>{E.children(N).length||T.setNode(N,E.node(N))}),E.edges().forEach(N=>{T.setEdge(N,E.edge(N))}),T}function r(E){let T=E.nodes().map(N=>{let M={};return E.outEdges(N).forEach(A=>{M[A.w]=(M[A.w]||0)+E.edge(A).weight}),M});return D(E.nodes(),T)}function a(E){let T=E.nodes().map(N=>{let M={};return E.inEdges(N).forEach(A=>{M[A.v]=(M[A.v]||0)+E.edge(A).weight}),M});return D(E.nodes(),T)}function l(E,T){let N=E.x,M=E.y,A=T.x-N,O=T.y-M,W=E.width/2,V=E.height/2;if(!A&&!O)throw new Error("Not possible to find intersection inside of the rectangle");let $,q;return Math.abs(O)*W>Math.abs(A)*V?(O<0&&(V=-V),$=V*A/O,q=V):(A<0&&(W=-W),$=W,q=W*O/A),{x:N+$,y:M+q}}function c(E){let T=x(_(E)+1).map(()=>[]);return E.nodes().forEach(N=>{let M=E.node(N),A=M.rank;A!==void 0&&(T[A][M.order]=N)}),T}function d(E){let T=E.nodes().map(M=>{let A=E.node(M).rank;return A===void 0?Number.MAX_VALUE:A}),N=p(Math.min,T);E.nodes().forEach(M=>{let A=E.node(M);Object.hasOwn(A,"rank")&&(A.rank-=N)})}function h(E){let T=E.nodes().map(W=>E.node(W).rank).filter(W=>W!==void 0),N=p(Math.min,T),M=[];E.nodes().forEach(W=>{let V=E.node(W).rank-N;M[V]||(M[V]=[]),M[V].push(W)});let A=0,O=E.graph().nodeRankFactor;Array.from(M).forEach((W,V)=>{W===void 0&&V%O!==0?--A:W!==void 0&&A&&W.forEach($=>E.node($).rank+=A)})}function u(E,T,N,M){let A={width:0,height:0};return arguments.length>=4&&(A.rank=N,A.order=M),i(E,"border",A,T)}function f(E,T=g){let N=[];for(let M=0;M<E.length;M+=T){let A=E.slice(M,M+T);N.push(A)}return N}var g=65535;function p(E,T){if(T.length>g){let N=f(T);return E.apply(null,N.map(M=>E.apply(null,M)))}else return E.apply(null,T)}function _(E){let T=E.nodes().map(N=>{let M=E.node(N).rank;return M===void 0?Number.MIN_VALUE:M});return p(Math.max,T)}function v(E,T){let N={lhs:[],rhs:[]};return E.forEach(M=>{T(M)?N.lhs.push(M):N.rhs.push(M)}),N}function b(E,T){let N=Date.now();try{return T()}finally{console.log(E+" time: "+(Date.now()-N)+"ms")}}function w(E,T){return T()}var C=0;function S(E){var T=++C;return E+(""+T)}function x(E,T,N=1){T==null&&(T=E,E=0);let M=O=>O<T;N<0&&(M=O=>T<O);let A=[];for(let O=E;M(O);O+=N)A.push(O);return A}function y(E,T){let N={};for(let M of T)E[M]!==void 0&&(N[M]=E[M]);return N}function L(E,T){let N=T;return typeof T=="string"&&(N=M=>M[T]),Object.entries(E).reduce((M,[A,O])=>(M[A]=N(O,A),M),{})}function D(E,T){return E.reduce((N,M,A)=>(N[M]=T[A],N),{})}}),KHe=Ri((s,e)=>{var t=qHe(),i=Jn().uniqueId;e.exports={run:n,undo:r};function n(a){(a.graph().acyclicer==="greedy"?t(a,l(a)):o(a)).forEach(c=>{let d=a.edge(c);a.removeEdge(c),d.forwardName=c.name,d.reversed=!0,a.setEdge(c.w,c.v,d,i("rev"))});function l(c){return d=>c.edge(d).weight}}function o(a){let l=[],c={},d={};function h(u){Object.hasOwn(d,u)||(d[u]=!0,c[u]=!0,a.outEdges(u).forEach(f=>{Object.hasOwn(c,f.w)?l.push(f):h(f.w)}),delete c[u])}return a.nodes().forEach(h),l}function r(a){a.edges().forEach(l=>{let c=a.edge(l);if(c.reversed){a.removeEdge(l);let d=c.forwardName;delete c.reversed,delete c.forwardName,a.setEdge(l.w,l.v,c,d)}})}}),GHe=Ri((s,e)=>{var t=Jn();e.exports={run:i,undo:o};function i(r){r.graph().dummyChains=[],r.edges().forEach(a=>n(r,a))}function n(r,a){let l=a.v,c=r.node(l).rank,d=a.w,h=r.node(d).rank,u=a.name,f=r.edge(a),g=f.labelRank;if(h===c+1)return;r.removeEdge(a);let p,_,v;for(v=0,++c;c<h;++v,++c)f.points=[],_={width:0,height:0,edgeLabel:f,edgeObj:a,rank:c},p=t.addDummyNode(r,"edge",_,"_d"),c===g&&(_.width=f.width,_.height=f.height,_.dummy="edge-label",_.labelpos=f.labelpos),r.setEdge(l,p,{weight:f.weight},u),v===0&&r.graph().dummyChains.push(p),l=p;r.setEdge(l,d,{weight:f.weight},u)}function o(r){r.graph().dummyChains.forEach(a=>{let l=r.node(a),c=l.edgeLabel,d;for(r.setEdge(l.edgeObj,c);l.dummy;)d=r.successors(a)[0],r.removeNode(a),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),a=d,l=r.node(a)})}}),$E=Ri((s,e)=>{var{applyWithChunking:t}=Jn();e.exports={longestPath:i,slack:n};function i(o){var r={};function a(l){var c=o.node(l);if(Object.hasOwn(r,l))return c.rank;r[l]=!0;let d=o.outEdges(l).map(u=>u==null?Number.POSITIVE_INFINITY:a(u.w)-o.edge(u).minlen);var h=t(Math.min,d);return h===Number.POSITIVE_INFINITY&&(h=0),c.rank=h}o.sources().forEach(a)}function n(o,r){return o.node(r.w).rank-o.node(r.v).rank-o.edge(r).minlen}}),cre=Ri((s,e)=>{var t=Ml().Graph,i=$E().slack;e.exports=n;function n(l){var c=new t({directed:!1}),d=l.nodes()[0],h=l.nodeCount();c.setNode(d,{});for(var u,f;o(c,l)<h;)u=r(c,l),f=c.hasNode(u.v)?i(l,u):-i(l,u),a(c,l,f);return c}function o(l,c){function d(h){c.nodeEdges(h).forEach(u=>{var f=u.v,g=h===f?u.w:f;!l.hasNode(g)&&!i(c,u)&&(l.setNode(g,{}),l.setEdge(h,g,{}),d(g))})}return l.nodes().forEach(d),l.nodeCount()}function r(l,c){return c.edges().reduce((d,h)=>{let u=Number.POSITIVE_INFINITY;return l.hasNode(h.v)!==l.hasNode(h.w)&&(u=i(c,h)),u<d[0]?[u,h]:d},[Number.POSITIVE_INFINITY,null])[1]}function a(l,c,d){l.nodes().forEach(h=>c.node(h).rank+=d)}}),YHe=Ri((s,e)=>{var t=cre(),i=$E().slack,n=$E().longestPath,o=Ml().alg.preorder,r=Ml().alg.postorder,a=Jn().simplify;e.exports=l,l.initLowLimValues=u,l.initCutValues=c,l.calcCutValue=h,l.leaveEdge=g,l.enterEdge=p,l.exchangeEdges=_;function l(C){C=a(C),n(C);var S=t(C);u(S),c(S,C);for(var x,y;x=g(S);)y=p(S,C,x),_(S,C,x,y)}function c(C,S){var x=r(C,C.nodes());x=x.slice(0,x.length-1),x.forEach(y=>d(C,S,y))}function d(C,S,x){var y=C.node(x),L=y.parent;C.edge(x,L).cutvalue=h(C,S,x)}function h(C,S,x){var y=C.node(x),L=y.parent,D=!0,E=S.edge(x,L),T=0;return E||(D=!1,E=S.edge(L,x)),T=E.weight,S.nodeEdges(x).forEach(N=>{var M=N.v===x,A=M?N.w:N.v;if(A!==L){var O=M===D,W=S.edge(N).weight;if(T+=O?W:-W,b(C,x,A)){var V=C.edge(x,A).cutvalue;T+=O?-V:V}}}),T}function u(C,S){arguments.length<2&&(S=C.nodes()[0]),f(C,{},1,S)}function f(C,S,x,y,L){var D=x,E=C.node(y);return S[y]=!0,C.neighbors(y).forEach(T=>{Object.hasOwn(S,T)||(x=f(C,S,x,T,y))}),E.low=D,E.lim=x++,L?E.parent=L:delete E.parent,x}function g(C){return C.edges().find(S=>C.edge(S).cutvalue<0)}function p(C,S,x){var y=x.v,L=x.w;S.hasEdge(y,L)||(y=x.w,L=x.v);var D=C.node(y),E=C.node(L),T=D,N=!1;D.lim>E.lim&&(T=E,N=!0);var M=S.edges().filter(A=>N===w(C,C.node(A.v),T)&&N!==w(C,C.node(A.w),T));return M.reduce((A,O)=>i(S,O)<i(S,A)?O:A)}function _(C,S,x,y){var L=x.v,D=x.w;C.removeEdge(L,D),C.setEdge(y.v,y.w,{}),u(C),c(C,S),v(C,S)}function v(C,S){var x=C.nodes().find(L=>!S.node(L).parent),y=o(C,x);y=y.slice(1),y.forEach(L=>{var D=C.node(L).parent,E=S.edge(L,D),T=!1;E||(E=S.edge(D,L),T=!0),S.node(L).rank=S.node(D).rank+(T?E.minlen:-E.minlen)})}function b(C,S,x){return C.hasEdge(S,x)}function w(C,S,x){return x.low<=S.lim&&S.lim<=x.lim}}),ZHe=Ri((s,e)=>{var t=$E(),i=t.longestPath,n=cre(),o=YHe();e.exports=r;function r(d){var h=d.graph().ranker;if(h instanceof Function)return h(d);switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":l(d);break;case"longest-path":a(d);break;case"none":break;default:c(d)}}var a=i;function l(d){i(d),n(d)}function c(d){o(d)}}),XHe=Ri((s,e)=>{e.exports=t;function t(o){let r=n(o);o.graph().dummyChains.forEach(a=>{let l=o.node(a),c=l.edgeObj,d=i(o,r,c.v,c.w),h=d.path,u=d.lca,f=0,g=h[f],p=!0;for(;a!==c.w;){if(l=o.node(a),p){for(;(g=h[f])!==u&&o.node(g).maxRank<l.rank;)f++;g===u&&(p=!1)}if(!p){for(;f<h.length-1&&o.node(g=h[f+1]).minRank<=l.rank;)f++;g=h[f]}o.setParent(a,g),a=o.successors(a)[0]}})}function i(o,r,a,l){let c=[],d=[],h=Math.min(r[a].low,r[l].low),u=Math.max(r[a].lim,r[l].lim),f,g;f=a;do f=o.parent(f),c.push(f);while(f&&(r[f].low>h||u>r[f].lim));for(g=f,f=l;(f=o.parent(f))!==g;)d.push(f);return{path:c.concat(d.reverse()),lca:g}}function n(o){let r={},a=0;function l(c){let d=a;o.children(c).forEach(l),r[c]={low:d,lim:a++}}return o.children().forEach(l),r}}),QHe=Ri((s,e)=>{var t=Jn();e.exports={run:i,cleanup:a};function i(l){let c=t.addDummyNode(l,"root",{},"_root"),d=o(l),h=Object.values(d),u=t.applyWithChunking(Math.max,h)-1,f=2*u+1;l.graph().nestingRoot=c,l.edges().forEach(p=>l.edge(p).minlen*=f);let g=r(l)+1;l.children().forEach(p=>n(l,c,f,g,u,d,p)),l.graph().nodeRankFactor=f}function n(l,c,d,h,u,f,g){let p=l.children(g);if(!p.length){g!==c&&l.setEdge(c,g,{weight:0,minlen:d});return}let _=t.addBorderNode(l,"_bt"),v=t.addBorderNode(l,"_bb"),b=l.node(g);l.setParent(_,g),b.borderTop=_,l.setParent(v,g),b.borderBottom=v,p.forEach(w=>{n(l,c,d,h,u,f,w);let C=l.node(w),S=C.borderTop?C.borderTop:w,x=C.borderBottom?C.borderBottom:w,y=C.borderTop?h:2*h,L=S!==x?1:u-f[g]+1;l.setEdge(_,S,{weight:y,minlen:L,nestingEdge:!0}),l.setEdge(x,v,{weight:y,minlen:L,nestingEdge:!0})}),l.parent(g)||l.setEdge(c,_,{weight:0,minlen:u+f[g]})}function o(l){var c={};function d(h,u){var f=l.children(h);f&&f.length&&f.forEach(g=>d(g,u+1)),c[h]=u}return l.children().forEach(h=>d(h,1)),c}function r(l){return l.edges().reduce((c,d)=>c+l.edge(d).weight,0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,l.edges().forEach(d=>{var h=l.edge(d);h.nestingEdge&&l.removeEdge(d)})}}),JHe=Ri((s,e)=>{var t=Jn();e.exports=i;function i(o){function r(a){let l=o.children(a),c=o.node(a);if(l.length&&l.forEach(r),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let d=c.minRank,h=c.maxRank+1;d<h;++d)n(o,"borderLeft","_bl",a,c,d),n(o,"borderRight","_br",a,c,d)}}o.children().forEach(r)}function n(o,r,a,l,c,d){let h={width:0,height:0,rank:d,borderType:r},u=c[r][d-1],f=t.addDummyNode(o,"border",h,a);c[r][d]=f,o.setParent(f,l),u&&o.setEdge(u,f,{weight:1})}}),eVe=Ri((s,e)=>{e.exports={adjust:t,undo:i};function t(d){let h=d.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&n(d)}function i(d){let h=d.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&r(d),(h==="lr"||h==="rl")&&(l(d),n(d))}function n(d){d.nodes().forEach(h=>o(d.node(h))),d.edges().forEach(h=>o(d.edge(h)))}function o(d){let h=d.width;d.width=d.height,d.height=h}function r(d){d.nodes().forEach(h=>a(d.node(h))),d.edges().forEach(h=>{let u=d.edge(h);u.points.forEach(a),Object.hasOwn(u,"y")&&a(u)})}function a(d){d.y=-d.y}function l(d){d.nodes().forEach(h=>c(d.node(h))),d.edges().forEach(h=>{let u=d.edge(h);u.points.forEach(c),Object.hasOwn(u,"x")&&c(u)})}function c(d){let h=d.x;d.x=d.y,d.y=h}}),tVe=Ri((s,e)=>{var t=Jn();e.exports=i;function i(n){let o={},r=n.nodes().filter(h=>!n.children(h).length),a=r.map(h=>n.node(h).rank),l=t.applyWithChunking(Math.max,a),c=t.range(l+1).map(()=>[]);function d(h){if(o[h])return;o[h]=!0;let u=n.node(h);c[u.rank].push(h),n.successors(h).forEach(d)}return r.sort((h,u)=>n.node(h).rank-n.node(u).rank).forEach(d),c}}),iVe=Ri((s,e)=>{var t=Jn().zipObject;e.exports=i;function i(o,r){let a=0;for(let l=1;l<r.length;++l)a+=n(o,r[l-1],r[l]);return a}function n(o,r,a){let l=t(a,a.map((g,p)=>p)),c=r.flatMap(g=>o.outEdges(g).map(p=>({pos:l[p.w],weight:o.edge(p).weight})).sort((p,_)=>p.pos-_.pos)),d=1;for(;d<a.length;)d<<=1;let h=2*d-1;d-=1;let u=new Array(h).fill(0),f=0;return c.forEach(g=>{let p=g.pos+d;u[p]+=g.weight;let _=0;for(;p>0;)p%2&&(_+=u[p+1]),p=p-1>>1,u[p]+=g.weight;f+=g.weight*_}),f}}),nVe=Ri((s,e)=>{e.exports=t;function t(i,n=[]){return n.map(o=>{let r=i.inEdges(o);if(r.length){let a=r.reduce((l,c)=>{let d=i.edge(c),h=i.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:o,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:o}})}}),sVe=Ri((s,e)=>{var t=Jn();e.exports=i;function i(r,a){let l={};r.forEach((d,h)=>{let u=l[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:h};d.barycenter!==void 0&&(u.barycenter=d.barycenter,u.weight=d.weight)}),a.edges().forEach(d=>{let h=l[d.v],u=l[d.w];h!==void 0&&u!==void 0&&(u.indegree++,h.out.push(l[d.w]))});let c=Object.values(l).filter(d=>!d.indegree);return n(c)}function n(r){let a=[];function l(d){return h=>{h.merged||(h.barycenter===void 0||d.barycenter===void 0||h.barycenter>=d.barycenter)&&o(d,h)}}function c(d){return h=>{h.in.push(d),--h.indegree===0&&r.push(h)}}for(;r.length;){let d=r.pop();a.push(d),d.in.reverse().forEach(l(d)),d.out.forEach(c(d))}return a.filter(d=>!d.merged).map(d=>t.pick(d,["vs","i","barycenter","weight"]))}function o(r,a){let l=0,c=0;r.weight&&(l+=r.barycenter*r.weight,c+=r.weight),a.weight&&(l+=a.barycenter*a.weight,c+=a.weight),r.vs=a.vs.concat(r.vs),r.barycenter=l/c,r.weight=c,r.i=Math.min(a.i,r.i),a.merged=!0}}),oVe=Ri((s,e)=>{var t=Jn();e.exports=i;function i(r,a){let l=t.partition(r,_=>Object.hasOwn(_,"barycenter")),c=l.lhs,d=l.rhs.sort((_,v)=>v.i-_.i),h=[],u=0,f=0,g=0;c.sort(o(!!a)),g=n(h,d,g),c.forEach(_=>{g+=_.vs.length,h.push(_.vs),u+=_.barycenter*_.weight,f+=_.weight,g=n(h,d,g)});let p={vs:h.flat(!0)};return f&&(p.barycenter=u/f,p.weight=f),p}function n(r,a,l){let c;for(;a.length&&(c=a[a.length-1]).i<=l;)a.pop(),r.push(c.vs),l++;return l}function o(r){return(a,l)=>a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:r?l.i-a.i:a.i-l.i}}),rVe=Ri((s,e)=>{var t=nVe(),i=sVe(),n=oVe();e.exports=o;function o(l,c,d,h){let u=l.children(c),f=l.node(c),g=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,_={};g&&(u=u.filter(C=>C!==g&&C!==p));let v=t(l,u);v.forEach(C=>{if(l.children(C.v).length){let S=o(l,C.v,d,h);_[C.v]=S,Object.hasOwn(S,"barycenter")&&a(C,S)}});let b=i(v,d);r(b,_);let w=n(b,h);if(g&&(w.vs=[g,w.vs,p].flat(!0),l.predecessors(g).length)){let C=l.node(l.predecessors(g)[0]),S=l.node(l.predecessors(p)[0]);Object.hasOwn(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+C.order+S.order)/(w.weight+2),w.weight+=2}return w}function r(l,c){l.forEach(d=>{d.vs=d.vs.flatMap(h=>c[h]?c[h].vs:h)})}function a(l,c){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight):(l.barycenter=c.barycenter,l.weight=c.weight)}}),aVe=Ri((s,e)=>{var t=Ml().Graph,i=Jn();e.exports=n;function n(r,a,l,c){c||(c=r.nodes());let d=o(r),h=new t({compound:!0}).setGraph({root:d}).setDefaultNodeLabel(u=>r.node(u));return c.forEach(u=>{let f=r.node(u),g=r.parent(u);(f.rank===a||f.minRank<=a&&a<=f.maxRank)&&(h.setNode(u),h.setParent(u,g||d),r[l](u).forEach(p=>{let _=p.v===u?p.w:p.v,v=h.edge(_,u),b=v!==void 0?v.weight:0;h.setEdge(_,u,{weight:r.edge(p).weight+b})}),Object.hasOwn(f,"minRank")&&h.setNode(u,{borderLeft:f.borderLeft[a],borderRight:f.borderRight[a]}))}),h}function o(r){for(var a;r.hasNode(a=i.uniqueId("_root")););return a}}),lVe=Ri((s,e)=>{e.exports=t;function t(i,n,o){let r={},a;o.forEach(l=>{let c=i.parent(l),d,h;for(;c;){if(d=i.parent(c),d?(h=r[d],r[d]=c):(h=a,a=c),h&&h!==c){n.setEdge(h,c);return}c=d}})}}),cVe=Ri((s,e)=>{var t=tVe(),i=iVe(),n=rVe(),o=aVe(),r=lVe(),a=Ml().Graph,l=Jn();e.exports=c;function c(f,g={}){if(typeof g.customOrder=="function"){g.customOrder(f,c);return}let p=l.maxRank(f),_=d(f,l.range(1,p+1),"inEdges"),v=d(f,l.range(p-1,-1,-1),"outEdges"),b=t(f);if(u(f,b),g.disableOptimalOrderHeuristic)return;let w=Number.POSITIVE_INFINITY,C,S=g.constraints||[];for(let x=0,y=0;y<4;++x,++y){h(x%2?_:v,x%4>=2,S),b=l.buildLayerMatrix(f);let L=i(f,b);L<w?(y=0,C=Object.assign({},b),w=L):L===w&&(C=structuredClone(b))}u(f,C)}function d(f,g,p){let _=new Map,v=(b,w)=>{_.has(b)||_.set(b,[]),_.get(b).push(w)};for(let b of f.nodes()){let w=f.node(b);if(typeof w.rank=="number"&&v(w.rank,b),typeof w.minRank=="number"&&typeof w.maxRank=="number")for(let C=w.minRank;C<=w.maxRank;C++)C!==w.rank&&v(C,b)}return g.map(function(b){return o(f,b,p,_.get(b)||[])})}function h(f,g,p){let _=new a;f.forEach(function(v){p.forEach(C=>_.setEdge(C.left,C.right));let b=v.graph().root,w=n(v,b,_,g);w.vs.forEach((C,S)=>v.node(C).order=S),r(v,_,w.vs)})}function u(f,g){Object.values(g).forEach(p=>p.forEach((_,v)=>f.node(_).order=v))}}),dVe=Ri((s,e)=>{var t=Ml().Graph,i=Jn();e.exports={positionX:p,findType1Conflicts:n,findType2Conflicts:o,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:f,findSmallestWidthAlignment:u,balance:g};function n(b,w){let C={};function S(x,y){let L=0,D=0,E=x.length,T=y[y.length-1];return y.forEach((N,M)=>{let A=r(b,N),O=A?b.node(A).order:E;(A||N===T)&&(y.slice(D,M+1).forEach(W=>{b.predecessors(W).forEach(V=>{let $=b.node(V),q=$.order;(q<L||O<q)&&!($.dummy&&b.node(W).dummy)&&a(C,V,W)})}),D=M+1,L=O)}),y}return w.length&&w.reduce(S),C}function o(b,w){let C={};function S(y,L,D,E,T){let N;i.range(L,D).forEach(M=>{N=y[M],b.node(N).dummy&&b.predecessors(N).forEach(A=>{let O=b.node(A);O.dummy&&(O.order<E||O.order>T)&&a(C,A,N)})})}function x(y,L){let D=-1,E,T=0;return L.forEach((N,M)=>{if(b.node(N).dummy==="border"){let A=b.predecessors(N);A.length&&(E=b.node(A[0]).order,S(L,T,M,D,E),T=M,D=E)}S(L,T,L.length,E,y.length)}),L}return w.length&&w.reduce(x),C}function r(b,w){if(b.node(w).dummy)return b.predecessors(w).find(C=>b.node(C).dummy)}function a(b,w,C){if(w>C){let x=w;w=C,C=x}let S=b[w];S||(b[w]=S={}),S[C]=!0}function l(b,w,C){if(w>C){let S=w;w=C,C=S}return!!b[w]&&Object.hasOwn(b[w],C)}function c(b,w,C,S){let x={},y={},L={};return w.forEach(D=>{D.forEach((E,T)=>{x[E]=E,y[E]=E,L[E]=T})}),w.forEach(D=>{let E=-1;D.forEach(T=>{let N=S(T);if(N.length){N=N.sort((A,O)=>L[A]-L[O]);let M=(N.length-1)/2;for(let A=Math.floor(M),O=Math.ceil(M);A<=O;++A){let W=N[A];y[T]===T&&E<L[W]&&!l(C,T,W)&&(y[W]=T,y[T]=x[T]=x[W],E=L[W])}}})}),{root:x,align:y}}function d(b,w,C,S,x){let y={},L=h(b,w,C,x),D=x?"borderLeft":"borderRight";function E(M,A){let O=L.nodes().slice(),W={},V=O.pop();for(;V;){if(W[V])M(V);else{W[V]=!0,O.push(V);for(let $ of A(V))O.push($)}V=O.pop()}}function T(M){y[M]=L.inEdges(M).reduce((A,O)=>Math.max(A,y[O.v]+L.edge(O)),0)}function N(M){let A=L.outEdges(M).reduce((W,V)=>Math.min(W,y[V.w]-L.edge(V)),Number.POSITIVE_INFINITY),O=b.node(M);A!==Number.POSITIVE_INFINITY&&O.borderType!==D&&(y[M]=Math.max(y[M],A))}return E(T,L.predecessors.bind(L)),E(N,L.successors.bind(L)),Object.keys(S).forEach(M=>y[M]=y[C[M]]),y}function h(b,w,C,S){let x=new t,y=b.graph(),L=_(y.nodesep,y.edgesep,S);return w.forEach(D=>{let E;D.forEach(T=>{let N=C[T];if(x.setNode(N),E){var M=C[E],A=x.edge(M,N);x.setEdge(M,N,Math.max(L(b,T,E),A||0))}E=T})}),x}function u(b,w){return Object.values(w).reduce((C,S)=>{let x=Number.NEGATIVE_INFINITY,y=Number.POSITIVE_INFINITY;Object.entries(S).forEach(([D,E])=>{let T=v(b,D)/2;x=Math.max(E+T,x),y=Math.min(E-T,y)});let L=x-y;return L<C[0]&&(C=[L,S]),C},[Number.POSITIVE_INFINITY,null])[1]}function f(b,w){let C=Object.values(w),S=i.applyWithChunking(Math.min,C),x=i.applyWithChunking(Math.max,C);["u","d"].forEach(y=>{["l","r"].forEach(L=>{let D=y+L,E=b[D];if(E===w)return;let T=Object.values(E),N=S-i.applyWithChunking(Math.min,T);L!=="l"&&(N=x-i.applyWithChunking(Math.max,T)),N&&(b[D]=i.mapValues(E,M=>M+N))})})}function g(b,w){return i.mapValues(b.ul,(C,S)=>{if(w)return b[w.toLowerCase()][S];{let x=Object.values(b).map(y=>y[S]).sort((y,L)=>y-L);return(x[1]+x[2])/2}})}function p(b){let w=i.buildLayerMatrix(b),C=Object.assign(n(b,w),o(b,w)),S={},x;["u","d"].forEach(L=>{x=L==="u"?w:Object.values(w).reverse(),["l","r"].forEach(D=>{D==="r"&&(x=x.map(M=>Object.values(M).reverse()));let E=(L==="u"?b.predecessors:b.successors).bind(b),T=c(b,x,C,E),N=d(b,x,T.root,T.align,D==="r");D==="r"&&(N=i.mapValues(N,M=>-M)),S[L+D]=N})});let y=u(b,S);return f(S,y),g(S,b.graph().align)}function _(b,w,C){return(S,x,y)=>{let L=S.node(x),D=S.node(y),E=0,T;if(E+=L.width/2,Object.hasOwn(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":T=-L.width/2;break;case"r":T=L.width/2;break}if(T&&(E+=C?T:-T),T=0,E+=(L.dummy?w:b)/2,E+=(D.dummy?w:b)/2,E+=D.width/2,Object.hasOwn(D,"labelpos"))switch(D.labelpos.toLowerCase()){case"l":T=D.width/2;break;case"r":T=-D.width/2;break}return T&&(E+=C?T:-T),T=0,E}}function v(b,w){return b.node(w).width}}),hVe=Ri((s,e)=>{var t=Jn(),i=dVe().positionX;e.exports=n;function n(r){r=t.asNonCompoundGraph(r),o(r),Object.entries(i(r)).forEach(([a,l])=>r.node(a).x=l)}function o(r){let a=t.buildLayerMatrix(r),l=r.graph().ranksep,c=r.graph().rankalign,d=0;a.forEach(h=>{let u=h.reduce((f,g)=>{let p=r.node(g).height;return f>p?f:p},0);h.forEach(f=>{let g=r.node(f);c==="top"?g.y=d+g.height/2:c==="bottom"?g.y=d+u-g.height/2:g.y=d+u/2}),d+=u+l})}}),uVe=Ri((s,e)=>{var t=KHe(),i=GHe(),n=ZHe(),o=Jn().normalizeRanks,r=XHe(),a=Jn().removeEmptyRanks,l=QHe(),c=JHe(),d=eVe(),h=cVe(),u=hVe(),f=Jn(),g=Ml().Graph;e.exports=p;function p(z,te={}){let le=te.debugTiming?f.time:f.notime;return le("layout",()=>{let pe=le(" buildLayoutGraph",()=>E(z));return le(" runLayout",()=>_(pe,le,te)),le(" updateInputGraph",()=>v(z,pe)),pe})}function _(z,te,le){te(" makeSpaceForEdgeLabels",()=>T(z)),te(" removeSelfEdges",()=>Z(z)),te(" acyclic",()=>t.run(z)),te(" nestingGraph.run",()=>l.run(z)),te(" rank",()=>n(f.asNonCompoundGraph(z))),te(" injectEdgeLabelProxies",()=>N(z)),te(" removeEmptyRanks",()=>a(z)),te(" nestingGraph.cleanup",()=>l.cleanup(z)),te(" normalizeRanks",()=>o(z)),te(" assignRankMinMax",()=>M(z)),te(" removeEdgeLabelProxies",()=>A(z)),te(" normalize.run",()=>i.run(z)),te(" parentDummyChains",()=>r(z)),te(" addBorderSegments",()=>c(z)),te(" order",()=>h(z,le)),te(" insertSelfEdges",()=>Y(z)),te(" adjustCoordinateSystem",()=>d.adjust(z)),te(" position",()=>u(z)),te(" positionSelfEdges",()=>Q(z)),te(" removeBorderNodes",()=>q(z)),te(" normalize.undo",()=>i.undo(z)),te(" fixupEdgeLabelCoords",()=>V(z)),te(" undoCoordinateSystem",()=>d.undo(z)),te(" translateGraph",()=>O(z)),te(" assignNodeIntersects",()=>W(z)),te(" reversePoints",()=>$(z)),te(" acyclic.undo",()=>t.undo(z))}function v(z,te){z.nodes().forEach(le=>{let pe=z.node(le),ve=te.node(le);pe&&(pe.x=ve.x,pe.y=ve.y,pe.order=ve.order,pe.rank=ve.rank,te.children(le).length&&(pe.width=ve.width,pe.height=ve.height))}),z.edges().forEach(le=>{let pe=z.edge(le),ve=te.edge(le);pe.points=ve.points,Object.hasOwn(ve,"x")&&(pe.x=ve.x,pe.y=ve.y)}),z.graph().width=te.graph().width,z.graph().height=te.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},C=["acyclicer","ranker","rankdir","align","rankalign"],S=["width","height","rank"],x={width:0,height:0},y=["minlen","weight","width","height","labeloffset"],L={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},D=["labelpos"];function E(z){let te=new g({multigraph:!0,compound:!0}),le=K(z.graph());return te.setGraph(Object.assign({},w,re(le,b),f.pick(le,C))),z.nodes().forEach(pe=>{let ve=K(z.node(pe)),We=re(ve,S);Object.keys(x).forEach(Be=>{We[Be]===void 0&&(We[Be]=x[Be])}),te.setNode(pe,We),te.setParent(pe,z.parent(pe))}),z.edges().forEach(pe=>{let ve=K(z.edge(pe));te.setEdge(pe,Object.assign({},L,re(ve,y),f.pick(ve,D)))}),te}function T(z){let te=z.graph();te.ranksep/=2,z.edges().forEach(le=>{let pe=z.edge(le);pe.minlen*=2,pe.labelpos.toLowerCase()!=="c"&&(te.rankdir==="TB"||te.rankdir==="BT"?pe.width+=pe.labeloffset:pe.height+=pe.labeloffset)})}function N(z){z.edges().forEach(te=>{let le=z.edge(te);if(le.width&&le.height){let pe=z.node(te.v),ve={rank:(z.node(te.w).rank-pe.rank)/2+pe.rank,e:te};f.addDummyNode(z,"edge-proxy",ve,"_ep")}})}function M(z){let te=0;z.nodes().forEach(le=>{let pe=z.node(le);pe.borderTop&&(pe.minRank=z.node(pe.borderTop).rank,pe.maxRank=z.node(pe.borderBottom).rank,te=Math.max(te,pe.maxRank))}),z.graph().maxRank=te}function A(z){z.nodes().forEach(te=>{let le=z.node(te);le.dummy==="edge-proxy"&&(z.edge(le.e).labelRank=le.rank,z.removeNode(te))})}function O(z){let te=Number.POSITIVE_INFINITY,le=0,pe=Number.POSITIVE_INFINITY,ve=0,We=z.graph(),Be=We.marginx||0,Mt=We.marginy||0;function oo(Hi){let Xi=Hi.x,ro=Hi.y,Ps=Hi.width,vn=Hi.height;te=Math.min(te,Xi-Ps/2),le=Math.max(le,Xi+Ps/2),pe=Math.min(pe,ro-vn/2),ve=Math.max(ve,ro+vn/2)}z.nodes().forEach(Hi=>oo(z.node(Hi))),z.edges().forEach(Hi=>{let Xi=z.edge(Hi);Object.hasOwn(Xi,"x")&&oo(Xi)}),te-=Be,pe-=Mt,z.nodes().forEach(Hi=>{let Xi=z.node(Hi);Xi.x-=te,Xi.y-=pe}),z.edges().forEach(Hi=>{let Xi=z.edge(Hi);Xi.points.forEach(ro=>{ro.x-=te,ro.y-=pe}),Object.hasOwn(Xi,"x")&&(Xi.x-=te),Object.hasOwn(Xi,"y")&&(Xi.y-=pe)}),We.width=le-te+Be,We.height=ve-pe+Mt}function W(z){z.edges().forEach(te=>{let le=z.edge(te),pe=z.node(te.v),ve=z.node(te.w),We,Be;le.points?(We=le.points[0],Be=le.points[le.points.length-1]):(le.points=[],We=ve,Be=pe),le.points.unshift(f.intersectRect(pe,We)),le.points.push(f.intersectRect(ve,Be))})}function V(z){z.edges().forEach(te=>{let le=z.edge(te);if(Object.hasOwn(le,"x"))switch((le.labelpos==="l"||le.labelpos==="r")&&(le.width-=le.labeloffset),le.labelpos){case"l":le.x-=le.width/2+le.labeloffset;break;case"r":le.x+=le.width/2+le.labeloffset;break}})}function $(z){z.edges().forEach(te=>{let le=z.edge(te);le.reversed&&le.points.reverse()})}function q(z){z.nodes().forEach(te=>{if(z.children(te).length){let le=z.node(te),pe=z.node(le.borderTop),ve=z.node(le.borderBottom),We=z.node(le.borderLeft[le.borderLeft.length-1]),Be=z.node(le.borderRight[le.borderRight.length-1]);le.width=Math.abs(Be.x-We.x),le.height=Math.abs(ve.y-pe.y),le.x=We.x+le.width/2,le.y=pe.y+le.height/2}}),z.nodes().forEach(te=>{z.node(te).dummy==="border"&&z.removeNode(te)})}function Z(z){z.edges().forEach(te=>{if(te.v===te.w){var le=z.node(te.v);le.selfEdges||(le.selfEdges=[]),le.selfEdges.push({e:te,label:z.edge(te)}),z.removeEdge(te)}})}function Y(z){var te=f.buildLayerMatrix(z);te.forEach(le=>{var pe=0;le.forEach((ve,We)=>{var Be=z.node(ve);Be.order=We+pe,(Be.selfEdges||[]).forEach(Mt=>{f.addDummyNode(z,"selfedge",{width:Mt.label.width,height:Mt.label.height,rank:Be.rank,order:We+ ++pe,e:Mt.e,label:Mt.label},"_se")}),delete Be.selfEdges})})}function Q(z){z.nodes().forEach(te=>{var le=z.node(te);if(le.dummy==="selfedge"){var pe=z.node(le.e.v),ve=pe.x+pe.width/2,We=pe.y,Be=le.x-ve,Mt=pe.height/2;z.setEdge(le.e,le.label),z.removeNode(te),le.label.points=[{x:ve+2*Be/3,y:We-Mt},{x:ve+5*Be/6,y:We-Mt},{x:ve+Be,y:We},{x:ve+5*Be/6,y:We+Mt},{x:ve+2*Be/3,y:We+Mt}],le.label.x=le.x,le.label.y=le.y}})}function re(z,te){return f.mapValues(f.pick(z,te),Number)}function K(z){var te={};return z&&Object.entries(z).forEach(([le,pe])=>{typeof le=="string"&&(le=le.toLowerCase()),te[le]=pe}),te}}),fVe=Ri((s,e)=>{var t=Jn(),i=Ml().Graph;e.exports={debugOrdering:n};function n(o){let r=t.buildLayerMatrix(o),a=new i({compound:!0,multigraph:!0}).setGraph({});return o.nodes().forEach(l=>{a.setNode(l,{label:l}),a.setParent(l,"layer"+o.node(l).rank)}),o.edges().forEach(l=>a.setEdge(l.v,l.w,{},l.name)),r.forEach((l,c)=>{let d="layer"+c;a.setNode(d,{rank:"same"}),l.reduce((h,u)=>(a.setEdge(h,u,{style:"invis"}),u))}),a}}),gVe=Ri((s,e)=>{e.exports="2.0.4"}),pVe=Ri((s,e)=>{e.exports={graphlib:Ml(),layout:uVe(),debug:fVe(),util:{time:Jn().time,notime:Jn().notime},version:gVe()}});const CY=pVe();/*! For license information please see dagre.esm.js.LEGAL.txt */const wY=300,SY=100;function rP(s,e,t="TB"){const i=new CY.graphlib.Graph;i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:t,ranksep:80,nodesep:40});for(const o of s)i.setNode(o.id,{width:wY,height:SY});for(const o of e)i.setEdge(o.source,o.target);return CY.layout(i),{nodes:s.map(o=>{const r=i.node(o.id);return{...o,position:{x:r.x-wY/2,y:r.y-SY/2}}}),edges:e}}function mVe({data:s}){var r;const e=s,[t,i]=je.useState(!1),n=e.status==="root"?"file-node--root":e.status==="expanded"?"file-node--expanded":e.status==="loading"?"file-node--loading":e.status==="error"?"file-node--error":"file-node--collapsed",o=e.repoAlias?"file-node--cross-repo":"";return ue.jsxs("div",{className:`file-node ${n} ${o}`,children:[!e.isRoot&&ue.jsx(uV,{type:"target",position:fV.Top}),ue.jsxs("div",{className:"file-node__header",children:[ue.jsx("span",{className:"file-node__icon",children:e.isRoot?"📄":e.status==="expanded"?"📋":e.repoAlias?"🔗":"📁"}),ue.jsx("span",{className:"file-node__label",title:e.filePath,children:e.label}),ue.jsx("span",{className:"file-node__actions",children:e.adoUrl&&ue.jsx("a",{href:e.adoUrl,target:"_blank",rel:"noopener noreferrer",className:"file-node__action-btn",title:"Open in Azure DevOps",onClick:a=>a.stopPropagation(),children:ue.jsx(_Ve,{})})})]}),e.repoAlias&&ue.jsxs("div",{className:"file-node__repo-row",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[ue.jsxs("span",{className:"file-node__repo",children:["@",e.repoAlias]}),e.repoInfo&&t&&ue.jsxs("div",{className:"file-node__repo-tooltip",children:[ue.jsxs("div",{className:"file-node__repo-tooltip-row",children:[ue.jsx("span",{className:"file-node__repo-tooltip-label",children:"Repo"}),ue.jsx("span",{children:e.repoInfo.fullName})]}),ue.jsxs("div",{className:"file-node__repo-tooltip-row",children:[ue.jsx("span",{className:"file-node__repo-tooltip-label",children:"Type"}),ue.jsx("span",{children:e.repoInfo.type})]}),e.repoInfo.ref&&ue.jsxs("div",{className:"file-node__repo-tooltip-row",children:[ue.jsx("span",{className:"file-node__repo-tooltip-label",children:"Ref"}),ue.jsx("span",{children:e.repoInfo.ref})]}),e.repoInfo.project&&ue.jsxs("div",{className:"file-node__repo-tooltip-row",children:[ue.jsx("span",{className:"file-node__repo-tooltip-label",children:"Project"}),ue.jsx("span",{children:e.repoInfo.project})]})]})]}),ue.jsxs("div",{className:"file-node__meta",children:[e.status==="loading"&&ue.jsx("span",{className:"file-node__spinner",children:"⏳ Loading..."}),e.status==="error"&&ue.jsxs("span",{className:"file-node__error",title:e.errorMessage,children:["❌ ",(r=e.errorMessage)==null?void 0:r.slice(0,80)]}),e.status==="collapsed"&&ue.jsx("span",{className:"file-node__hint",children:"Click to expand"}),e.status==="expanded"&&e.templateCount===0&&!e.isRoot&&ue.jsx("span",{className:"file-node__leaf",children:"✓ no nested templates"}),(e.status==="root"||e.status==="expanded")&&e.templateCount>0&&ue.jsxs("span",{className:"file-node__count",children:[e.templateCount," template ref(s)"]})]}),ue.jsx(uV,{type:"source",position:fV.Bottom})]})}function _Ve(){return ue.jsx("svg",{width:"14",height:"14",viewBox:"0 0 18 18",className:"file-node__ado-icon","aria-label":"Azure DevOps",children:ue.jsx("path",{d:"M17 4v9.74l-4 3.28-6.2-2.26V17l-3.51-4.59 10.23.8V4.44zm-3.41.49L7.85 1v2.29L2.58 4.84 1 6.87v4.61l2.26 1V6.57z",fill:"#3c91e5"})})}const bVe=je.memo(mVe);function aP({className:s,label:e,children:t}){const[i,n]=je.useState(!1);return ue.jsxs("span",{className:s,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[e,i&&ue.jsx("div",{className:"template-edge__badge-tooltip",children:t})]})}function vVe({id:s,sourceX:e,sourceY:t,targetX:i,targetY:n,sourcePosition:o,targetPosition:r,data:a,markerEnd:l,style:c}){var w;const d=a,[h,u]=je.useState(!1),[f,g,p]=Sre({sourceX:e,sourceY:t,sourcePosition:o,targetX:i,targetY:n,targetPosition:r}),_=je.useCallback(()=>u(!0),[]),v=je.useCallback(()=>u(!1),[]),b=((w=d==null?void 0:d.parameterNames)==null?void 0:w.length)??0;return ue.jsxs(ue.Fragment,{children:[ue.jsx(yre,{id:s,path:f,markerEnd:l,style:c}),ue.jsx(xre,{children:ue.jsxs("div",{className:"template-edge__label-container",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${g}px,${p}px)`,pointerEvents:"all"},children:[ue.jsxs("div",{className:"template-edge__top-row",children:[ue.jsx("span",{className:"template-edge__category",children:d==null?void 0:d.edgeLabel}),(d==null?void 0:d.conditional)&&ue.jsxs(aP,{className:`template-edge__badge template-edge__badge--conditional${d.conditionResult===!1?" template-edge__badge--condition-false":d.conditionResult===!0?" template-edge__badge--condition-true":""}`,label:d.conditionResult===!1?"⊘ false":d.conditionResult===!0?"✓ conditional":"conditional",children:[ue.jsx("div",{className:"template-edge__badge-tooltip-title",children:"⚡ Conditional Reference"}),ue.jsx("p",{children:d.conditionResult===!0?"Condition evaluated to true — this template will be included.":d.conditionResult===!1?"Condition evaluated to false — this template will NOT be included in this pipeline run.":"This template is inside a conditional block. The condition could not be fully evaluated."}),d.conditionExpression&&ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Condition"}),ue.jsx("code",{children:d.conditionExpression})]}),d.conditionResult!=null&&ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Result"}),ue.jsx("code",{children:String(d.conditionResult)})]})]}),(d==null?void 0:d.dynamicPath)&&d.expressionResolved&&ue.jsxs(aP,{className:"template-edge__badge template-edge__badge--resolved",label:"🔮 resolved",children:[ue.jsx("div",{className:"template-edge__badge-tooltip-title",children:"🔮 Expression Resolved"}),ue.jsx("p",{children:"The template path contained expressions that were successfully evaluated."}),ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Original"}),ue.jsx("code",{children:d.originalPath})]}),d.resolvedPath&&ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Resolved"}),ue.jsx("code",{children:d.resolvedPath})]})]}),(d==null?void 0:d.dynamicPath)&&!d.expressionResolved&&ue.jsxs(aP,{className:"template-edge__badge template-edge__badge--unresolved",label:"⚠️ dynamic",children:[ue.jsx("div",{className:"template-edge__badge-tooltip-title",children:"⚠️ Unresolved Expressions"}),ue.jsx("p",{children:"The template path contains expressions that could not be evaluated at analysis time."}),ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Original"}),ue.jsx("code",{children:d.originalPath})]}),d.resolvedPath&&d.resolvedPath!==d.originalPath&&ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Partial"}),ue.jsx("code",{children:d.resolvedPath})]}),d.unresolvedExpressions&&d.unresolvedExpressions.length>0&&ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Unresolved"}),ue.jsx("span",{children:d.unresolvedExpressions.join(", ")})]})]})]}),b>0&&ue.jsxs("span",{className:"template-edge__params-badge",onMouseEnter:_,onMouseLeave:v,children:[CVe(d),h&&ue.jsx(wVe,{data:d})]})]})})]})}function CVe(s){var t;const e=((t=s.parameterNames)==null?void 0:t.length)??0;return s.totalParameterCount!=null?`${e}/${s.totalParameterCount} params`:`${e} params`}function wVe({data:s}){var t,i;const e=(t=s.declaredParameterNames)==null?void 0:t.filter(n=>{var o;return!((o=s.parameterNames)!=null&&o.includes(n))});return ue.jsxs("div",{className:"template-edge__params-tooltip",children:[s.parameterNames&&s.parameterNames.length>0&&ue.jsxs("div",{className:"template-edge__params-section",children:[ue.jsxs("div",{className:"template-edge__params-heading",children:["✓ Passed (",s.parameterNames.length,")"]}),ue.jsx("ul",{className:"template-edge__params-list",children:s.parameterNames.map(n=>ue.jsx("li",{className:"template-edge__params-item template-edge__params-item--passed",children:n},n))})]}),e&&e.length>0&&ue.jsxs("div",{className:"template-edge__params-section",children:[ue.jsxs("div",{className:"template-edge__params-heading",children:["○ Not passed (",e.length,")"]}),ue.jsx("ul",{className:"template-edge__params-list",children:e.map(n=>ue.jsx("li",{className:"template-edge__params-item template-edge__params-item--missing",children:n},n))})]}),s.totalParameterCount==null&&!((i=s.declaredParameterNames)!=null&&i.length)&&ue.jsx("div",{className:"template-edge__params-hint",children:"Expand node to see all declared params"})]})}const SVe=je.memo(vVe),yVe={fileNode:bVe},xVe={templateEdge:SVe},LVe={animated:!0,style:{stroke:"var(--accent)",strokeWidth:2},markerEnd:{type:NY.ArrowClosed,color:"var(--accent)"}};function kVe(){var M,A;const{org:s,project:e,selectedPipeline:t,selectedPipelineLoading:i,selectedPipelineError:n,expandedTemplates:o,setExpandedTemplate:r,setSelectedNodeDetail:a}=_2(),[l,c,d]=Lre([]),[h,u,f]=kre([]),g=je.useRef(null),p=je.useRef(null),_=je.useRef(""),v=je.useRef([]);je.useEffect(()=>{v.current=h},[h]);const[b,w]=je.useState(new Set),C=je.useRef(new Set),[S,x]=je.useState(!1),y=((A=(M=t==null?void 0:t.definition)==null?void 0:M.repository)==null?void 0:A.name)??"",L=je.useMemo(()=>{if(!(t!=null&&t.yaml))return[];try{const O=ib(t.yaml),W=O==null?void 0:O.resources;return(W==null?void 0:W.repositories)??[]}catch{return[]}},[t==null?void 0:t.yaml]),D=je.useMemo(()=>{if(!(t!=null&&t.yaml))return{};try{const O=ib(t.yaml);return eP(O??{})}catch{return{}}},[t==null?void 0:t.yaml]);je.useEffect(()=>{var Be,Mt,oo,Hi,Xi,ro,Ps;if(!(t!=null&&t.yaml)){c([]),u([]);return}const O=ib(t.yaml),W=((Be=t.definition)==null?void 0:Be.path)??"",V=sP(O??{},{sourcePath:W}),$=((Mt=t.definition)==null?void 0:Mt.name)??W.split("/").pop()??"Pipeline",q=NW(W),Z=JA(O??{}),Y=((Hi=(oo=t.definition)==null?void 0:oo.repository)==null?void 0:Hi.name)??"",Q=(Ps=(ro=(Xi=t.definition)==null?void 0:Xi.repository)==null?void 0:ro.defaultBranch)==null?void 0:Ps.replace(/^refs\/heads\//,""),re=s&&e&&Y?goe({org:s,project:e,repoName:Y,filePath:W,branch:Q}):void 0,K={id:"root",type:"fileNode",position:{x:0,y:0},data:{label:$,filePath:W,templateCount:V.length,status:"root",isRoot:!0,baseDir:q,adoUrl:re}},{templateNodes:z,templateEdges:te}=lP("root",V,s,e,y,L,Z,void 0,D),le=[K,...z],pe=[...te],{nodes:ve,edges:We}=rP(le,pe);c(ve),u(We),C.current=new Set},[t,c,u]);const E=je.useRef(!1);je.useEffect(()=>{if(!S||!g.current||l.length===0)return;const O=`${l.length}:${h.length}`;if(O!==_.current)return _.current=O,p.current!=null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{var W;(W=g.current)==null||W.fitView({padding:.2,duration:300}),p.current=null}),()=>{p.current!=null&&(cancelAnimationFrame(p.current),p.current=null)}},[S,l.length,h.length]),je.useEffect(()=>{if(E.current)return;const O=l.filter(W=>{const V=W.data;if(V.status!=="collapsed"||C.current.has(W.id)||b.has(W.id))return!1;const $=V._conditionResult;return!($===!1||$==="unknown")});if(O.length!==0){for(const W of O)C.current.add(W.id);E.current=!0,(async()=>{for(const W of O){const V=W.data;if(!(V.dynamicPath&&!V.expressionResolved))try{const{content:$,actualPath:q}=await cP(s,e,y,V,L,o,r),Z=ib($)??{},Y=V._ref,Q=sP(Z,{contextRepoAlias:Cv(Y??{}),sourcePath:q}),re=JG(Z);if(Q.length===0)c(K=>K.map(z=>z.id===W.id?{...z,data:{...z.data,status:"expanded",templateCount:0,totalParameterCount:re.length||void 0,declaredParameterNames:re.length?re:void 0}}:z));else if(S){const K=JA(Z),z=V._parentParamContext,te=V._accumulatedVariables,le=Y==null?void 0:Y.parameters,pe=jE(le,z,te),ve={...K,...pe},We=eP(Z),Be={...te??D,...We},Mt=V._accumulatedResources,oo=yY(Z),Hi=xY([...Mt??L,...oo]);await new Promise(vn=>setTimeout(vn,0));const Xi=new Set(l.map(vn=>vn.id)),{templateNodes:ro,templateEdges:Ps}=lP(W.id,Q,s,e,y,Hi,ve,Xi,Be);c(vn=>{const Do=new Set(vn.map(Os=>Os.id)),Pf=ro.filter(Os=>!Do.has(Os.id)),Jy=[...vn.map(Os=>Os.id===W.id?{...Os,data:{...Os.data,status:"expanded",templateCount:Q.length,totalParameterCount:re.length||void 0,declaredParameterNames:re.length?re:void 0}}:Os),...Pf],Oh=[...re.length?TL(v.current,W.id,re):v.current,...Ps];return rP(Jy,Oh).nodes}),u(vn=>[...re.length?TL(vn,W.id,re):vn,...Ps]),await new Promise(vn=>setTimeout(vn,50))}}catch{}}E.current=!1,S&&c(W=>[...W])})()}},[l,s,e,y,L,o,r,b,c,u,S]);const T=je.useCallback(async(O,W)=>{const V=W.data;if(V.status==="root"&&(t!=null&&t.yaml)){a({nodeId:W.id,label:V.label,filePath:V.filePath,yaml:t.yaml});return}if(V.status==="expanded"){const $=V._ref,q=Cv($??{})||"",Z=`${q}:${V.filePath}`,Y=V._fallbackPath,Q=Y?`${q}:${Y}`:void 0,re=o.get(Z)??(Q?o.get(Q):void 0);if(re){a({nodeId:W.id,label:V.label,filePath:V.filePath,yaml:re,repoAlias:V.repoAlias});return}try{const{content:K}=await cP(s,e,y,V,L,o,r);a({nodeId:W.id,label:V.label,filePath:V.filePath,yaml:K,repoAlias:V.repoAlias})}catch{}return}if(V.status==="collapsed"&&!b.has(W.id)){w($=>new Set($).add(W.id)),c($=>$.map(q=>q.id===W.id?{...q,data:{...q.data,status:"loading"}}:q));try{const{content:$,actualPath:q}=await cP(s,e,y,V,L,o,r),Z=ib($)??{},Y=V._ref,Q=sP(Z,{contextRepoAlias:Cv(Y??{}),sourcePath:q}),re=JA(Z),K=V._parentParamContext,z=V._accumulatedVariables,te=Y==null?void 0:Y.parameters,le=jE(te,K,z),pe={...re,...le},ve=JG(Z),We=NW(q),Be=eP(Z),Mt={...z??D,...Be},oo=V._accumulatedResources,Hi=yY(Z),Xi=xY([...oo??L,...Hi]),ro=new Set(l.map(Do=>Do.id)),{templateNodes:Ps,templateEdges:vn}=lP(W.id,Q,s,e,y,Xi,pe,ro,Mt);c(Do=>{const Pf=new Set(Do.map(Eo=>Eo.id)),GC=Ps.filter(Eo=>!Pf.has(Eo.id)),__=[...Do.map(Eo=>Eo.id===W.id?{...Eo,data:{...Eo.data,status:"expanded",templateCount:Q.length,totalParameterCount:ve.length||void 0,declaredParameterNames:ve.length?ve:void 0}}:Eo),...GC],Os=[...ve.length?TL(v.current,W.id,ve):v.current,...vn];return rP(__,Os).nodes}),u(Do=>[...ve.length?TL(Do,W.id,ve):Do,...vn]),a({nodeId:W.id,label:V.label,filePath:V.filePath,yaml:$,repoAlias:V.repoAlias})}catch($){const q=$ instanceof Error?$.message:String($);c(Z=>Z.map(Y=>Y.id===W.id?{...Y,data:{...Y.data,status:"error",errorMessage:q}}:Y))}finally{w($=>{const q=new Set($);return q.delete(W.id),q})}}},[s,e,y,t,L,o,r,a,b,c,u]),N=je.useCallback(()=>{x(O=>(O||(C.current=new Set,_.current=""),!O))},[]);return i?ue.jsx("div",{className:"pipeline-tree__empty",children:ue.jsxs("div",{className:"loading-indicator",children:[ue.jsx("span",{className:"loading-indicator__spinner",children:"⏳"}),ue.jsx("span",{children:"Loading pipeline..."})]})}):n?ue.jsx("div",{className:"error",children:n}):t?ue.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[ue.jsxs(Ire,{nodes:l,edges:h,onInit:O=>{g.current=O},onNodesChange:d,onEdgesChange:f,onNodeClick:T,nodeTypes:yVe,edgeTypes:xVe,defaultEdgeOptions:LVe,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},children:[ue.jsx(Dre,{variant:Ere.Dots,color:"var(--border)",gap:20}),ue.jsx(Nre,{})]}),ue.jsxs("label",{className:"auto-expand-toggle",children:[ue.jsx("input",{type:"checkbox",checked:S,onChange:N}),ue.jsx("span",{children:"Auto-expand all"})]})]}):ue.jsx("div",{className:"pipeline-tree__empty",children:"Select a pipeline to visualize"})}function TL(s,e,t){return s.map(i=>{if(i.target!==e)return i;const n=i.data??{};return{...i,data:{...n,totalParameterCount:t.length,declaredParameterNames:t}}})}function jE(s,e,t){if(!s||!e&&!t)return s;const i={};for(const[n,o]of Object.entries(s))if(typeof o=="string"&&WE(o)){const{result:r,isFullyResolved:a}=moe(o,{parameters:e,variables:t});i[n]=a?IVe(r):o}else o&&typeof o=="object"&&!Array.isArray(o)?i[n]=jE(o,e,t)??o:i[n]=o;return i}function IVe(s){if(s==="True"||s==="true")return!0;if(s==="False"||s==="false")return!1;if(s==="null")return null;if(s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]"))try{return JSON.parse(s)}catch{}return s}function yY(s){const e=s.resources;if(!e)return[];const t=e.repositories;return Array.isArray(t)?t.filter(i=>i!=null&&typeof i=="object"&&"repository"in i&&"name"in i&&typeof i.repository=="string"&&typeof i.name=="string"):[]}function xY(s){const e=new Map;for(const t of s)e.set(t.repository,t);return Array.from(e.values())}function DVe(s,e){return`tpl::${s||"self"}::${e}`}function lP(s,e,t,i,n,o,r,a,l){const c=new Set,d=[],h=[];for(let u=0;u<e.length;u++){const f=e[u];let g=f.normalizedPath,p=!1,_=!0,v,b;if(WE(f.normalizedPath)){p=!0,v=f.normalizedPath;const W=QG(f.normalizedPath,r,void 0,l);g=W.resolvedPath,_=W.isFullyResolved,b=W.unresolved.length?W.unresolved:void 0}let w=Cv(f),C=!1,S=!0;if(w&&WE(w)){C=!0;const W=QG(w,r,void 0,l);W.isFullyResolved?w=W.resolvedPath:(S=!1,b=[...b??[],...W.unresolved])}const x=p||C,y=_&&S,{primary:L,fallback:D}=qBe({...f,normalizedPath:g,repoAlias:f.repoAlias,sourcePath:f.sourcePath}),E=DVe(w,L);if(c.has(E))continue;c.add(E);const T=a==null?void 0:a.has(E);let N;if(f.conditional&&f.conditionExpression)try{const W=poe(f.conditionExpression,{parameters:r,variables:l});typeof W=="boolean"?N=W:W===void 0||W===f.conditionExpression?N="unknown":N=!!W}catch{N="unknown"}else f.conditional&&(N="unknown");if(N===!1)continue;if(!T){const W=g.length>40?`...${g.slice(-37)}`:g,{repoInfo:V,adoUrl:$}=EVe(f,w,L,t,i,n,o),q=jE(f.parameters,r,l),Z=w!==Cv(f)||q!==f.parameters?{...f,repoAlias:w||f.repoAlias,contextRepoAlias:w||f.contextRepoAlias,parameters:q}:f;d.push({id:E,type:"fileNode",position:{x:0,y:0},data:{label:W,filePath:L,repoAlias:w,templateCount:0,status:"collapsed",isRoot:!1,baseDir:NW(L),adoUrl:$,repoInfo:V,templateLocation:f.location,_ref:Z,_fallbackPath:D,_parentParamContext:r,_accumulatedResources:o,_accumulatedVariables:l,_conditionResult:N}})}const M=f.location==="extends"?"extends":f.location==="extends-parameters"?"extends param":f.location,A=!!w,O=f.parameters?Object.keys(f.parameters):void 0;h.push({id:`${s}->${E}`,source:s,target:E,type:"templateEdge",data:{edgeLabel:M,parameterNames:O,isExternal:A||void 0,conditional:f.conditional||void 0,conditionExpression:f.conditionExpression,conditionResult:N,dynamicPath:x||void 0,expressionResolved:x?y:void 0,originalPath:v||(C?f.rawPath:void 0),resolvedPath:x?L:void 0,unresolvedExpressions:b},style:A?{stroke:"var(--badge-resources)",strokeWidth:2,strokeDasharray:"6 3"}:void 0,markerEnd:A?{type:NY.ArrowClosed,color:"var(--badge-resources)"}:void 0})}return{templateNodes:d,templateEdges:h}}async function cP(s,e,t,i,n,o,r){const a=i._ref;if(!a)throw new Error("No template reference on this node");const l=i.filePath,c=i._fallbackPath,d=Cv(a),h=`${d||""}:${l}`,u=o.get(h);if(u)return{content:u,actualPath:l};if(c){const C=`${d||""}:${c}`,S=o.get(C);if(S)return{content:S,actualPath:c}}const g=i._accumulatedResources??n;let p=e,_=t,v;if(d&&g.length){const C=uoe(d,g);C?(p=C.project||e,_=C.repoName,v=C.ref):_=d}else d&&(_=d);let b,w=l;try{b=await EW(s,p,_,l,v)}catch(C){if(c)b=await EW(s,p,_,c,v),w=c;else throw C}return r(`${d||""}:${w}`,b.content),{content:b.content,actualPath:w}}function NW(s){const e=s.replace(/\\/g,"/"),t=e.lastIndexOf("/");return t>0?e.slice(0,t):""}function EVe(s,e,t,i,n,o,r){let a=n,l=o,c,d;if(e&&r.length){const u=uoe(e,r),f=r.find(g=>g.repository===e);u?(a=u.project||n,l=u.repoName,c=u.ref):l=e,f&&(d={alias:e,fullName:f.name,type:f.type,ref:f.ref,project:u==null?void 0:u.project})}else e&&(l=e);const h=i&&a&&l?goe({org:i,project:a,repoName:l,filePath:t,ref:c}):void 0;return{repoInfo:d,adoUrl:h}}function NVe(){const{org:s,project:e,setConnection:t,pipelines:i,pipelinesLoading:n,pipelinesError:o,setPipelines:r,setPipelinesLoading:a,setPipelinesError:l,setSelectedPipeline:c,setSelectedPipelineLoading:d,setSelectedPipelineError:h}=_2(),[u,f]=je.useState(""),[g,p]=je.useState(null),[_,v]=je.useState(s),[b,w]=je.useState(e),[C,S]=je.useState("url"),[x,y]=je.useState(!1),L=je.useRef(!1);je.useEffect(()=>{if(L.current)return;L.current=!0;const A=new URLSearchParams(window.location.search),O=A.get("url"),W=A.get("org"),V=A.get("project"),$=A.get("repo"),q=A.get("path"),Z=A.get("branch")??void 0,Y=A.get("pipelineId");if(O)f(O),D(O);else if(W&&V&&$&&q){const Q=`https://dev.azure.com/${W}/${V}/_git/${$}?path=${q}${Z?`&version=GB${Z}`:""}`;f(Q),D(Q)}else W&&V&&Y&&E(W,V,Number(Y))},[]);const D=async A=>{const O=GBe(A);if(!O){p("Invalid Azure DevOps URL");return}t(O.org,O.project),d(!0),h(null),y(!0);try{const W=await EW(O.org,O.project,O.repoName,O.filePath,O.branch);c({definition:{id:0,name:O.filePath.split("/").pop()||O.filePath,path:O.filePath,repository:{id:W.repoId,name:W.repoName,type:"git",defaultBranch:W.branch||""}},yaml:W.content})}catch(W){h(W instanceof Error?W.message:String(W))}finally{d(!1),y(!1)}},E=async(A,O,W)=>{t(A,O),d(!0),h(null);try{const V=await vY(A,O,W);c(V)}catch(V){h(V instanceof Error?V.message:String(V))}finally{d(!1)}},T=async()=>{u.trim()&&(p(null),await D(u.trim()))},N=async()=>{if(!(!_||!b)){t(_,b),a(!0),l(null);try{const A=await zHe(_,b);r(A)}catch(A){l(A instanceof Error?A.message:String(A))}finally{a(!1)}}},M=async A=>{d(!0),h(null);try{const O=await vY(s,e,A);c(O)}catch(O){h(O instanceof Error?O.message:String(O))}finally{d(!1)}};return ue.jsxs("div",{className:"pipeline-selector",children:[ue.jsxs("div",{className:"mode-tabs",children:[ue.jsx("button",{className:`mode-tab ${C==="url"?"mode-tab--active":""}`,onClick:()=>S("url"),children:"Paste URL"}),ue.jsx("button",{className:`mode-tab ${C==="browse"?"mode-tab--active":""}`,onClick:()=>S("browse"),children:"Browse"})]}),C==="url"&&ue.jsxs("div",{className:"connection-form",children:[ue.jsx("label",{className:"form-label",children:"Azure DevOps file URL"}),ue.jsx("textarea",{placeholder:"https://dev.azure.com/{org}/{project}/_git/{repo}?path=/{pipeline}.yml",value:u,onChange:A=>f(A.target.value),rows:3}),ue.jsx("button",{onClick:T,disabled:!u.trim()||x,children:x?"⏳ Loading...":"Load Pipeline"}),g&&ue.jsx("div",{className:"error",children:g})]}),C==="browse"&&ue.jsxs(ue.Fragment,{children:[ue.jsxs("div",{className:"connection-form",children:[ue.jsx("input",{type:"text",placeholder:"Organization",value:_,onChange:A=>v(A.target.value)}),ue.jsx("input",{type:"text",placeholder:"Project",value:b,onChange:A=>w(A.target.value)}),ue.jsx("button",{onClick:N,disabled:n,children:n?"Loading...":"Load Pipelines"})]}),o&&ue.jsx("div",{className:"error",children:o}),i.length>0&&ue.jsxs("div",{className:"pipeline-list",children:[ue.jsx("h3",{children:"Pipelines"}),ue.jsx("ul",{children:i.map(A=>ue.jsx("li",{children:ue.jsxs("button",{onClick:()=>M(A.id),children:[A.folder!=="\\"?`${A.folder}\\`:"",A.name]})},A.id))})]})]})]})}const TVe=280,RVe=900,MVe=420;function AVe(){const{setCustomTaskDocs:s,setTaskSchema:e,selectedNodeDetail:t,org:i}=_2(),[n,o]=je.useState(MVe),r=je.useRef(!1);je.useEffect(()=>{UHe().then(l=>s(l.customTaskDocs)).catch(()=>{})},[s]),je.useEffect(()=>{i&&$He(i).then(l=>e(l.tasks)).catch(()=>{})},[i,e]);const a=je.useCallback(l=>{l.preventDefault(),r.current=!0;const c=l.clientX,d=n;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const h=f=>{const g=c-f.clientX,p=Math.min(RVe,Math.max(TVe,d+g));o(p)},u=()=>{r.current=!1,document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",h),window.addEventListener("mouseup",u)},[n]);return ue.jsxs("div",{className:"app",children:[ue.jsx("header",{className:"app__header",children:ue.jsx("h1",{children:"🔧 Azure Pipelines Visualizer"})}),ue.jsxs("main",{className:"app__main",children:[ue.jsx("aside",{className:"app__sidebar",children:ue.jsx(oP,{children:ue.jsx(NVe,{})})}),ue.jsx("section",{className:"app__content",children:ue.jsx(oP,{children:ue.jsx(kVe,{})})}),t&&ue.jsxs(ue.Fragment,{children:[ue.jsx("div",{className:"app__detail-resize-handle",onMouseDown:a,title:"Drag to resize"}),ue.jsx("aside",{className:"app__detail",style:{width:n},children:ue.jsx(oP,{children:ue.jsx(MHe,{})})})]})]})]})}SW.createRoot(document.getElementById("root")).render(ue.jsx(Eu.StrictMode,{children:ue.jsx(AVe,{})}));export{Cb as l};
946
+ `)}const CHe={DotNetCoreCLI:"dotnet-core-cli","AdvancedSecurity-Codeql-Init":"advanced-security-codeql-init","AdvancedSecurity-Codeql-Analyze":"advanced-security-codeql-analyze","AdvancedSecurity-Publish":"advanced-security-publish",AndroidBuild:"android-build",AndroidSigning:"android-signing",Ant:"ant",AzureIoTEdge:"azure-iot-edge",CMake:"cmake",ContainerBuild:"container-build",Docker:"docker",DockerCompose:"docker-compose",DownloadGitHubNugetPackage:"download-github-nuget-package",Go:"go",Gradle:"gradle",Grunt:"grunt",gulp:"gulp",PublishSymbols:"publish-symbols",JenkinsQueueJob:"jenkins-queue-job",Maven:"maven",MSBuild:"msbuild",SonarQubePrepare:"sonar-qube-prepare",SonarQubePublish:"sonar-qube-publish",SonarQubeAnalyze:"sonar-qube-analyze",VSBuild:"vsbuild",Xcode:"xcode",XcodePackageiOS:"xcode-package-ios",AppCenterDistribute:"app-center-distribute",AzureResourceManagerTemplateDeployment:"azure-resource-manager-template-deployment",AzureAppConfigurationExport:"azure-app-configuration-export",AzureAppConfigurationImport:"azure-app-configuration-import",AzureAppConfigurationSnapshot:"azure-app-configuration-snapshot",AzureWebPowerShellDeployment:"azure-web-powershell-deployment",AzureRmWebAppDeployment:"azure-rm-web-app-deployment",AzureAppServiceManage:"azure-app-service-manage",AzureAppServiceSettings:"azure-app-service-settings",AzureCLI:"azure-cli",AzureCloudPowerShellDeployment:"azure-cloud-powershell-deployment",AzureContainerApps:"azure-container-apps",AzureMysqlDeployment:"azure-mysql-deployment",AzureFileCopy:"azure-file-copy",AzureFunctionOnKubernetes:"azure-function-on-kubernetes",AzureFunctionApp:"azure-function-app",AzureFunctionAppContainer:"azure-function-app-container",AzureKeyVault:"azure-key-vault",AzureMonitorAlerts:"azure-monitor-alerts",AzurePowerShell:"azure-powershell",AzureResourceGroupDeployment:"azure-resource-group-deployment",AzureSpringCloud:"azure-spring-cloud",SqlAzureDacpacDeployment:"sql-azure-dacpac-deployment",AzureVmssDeployment:"azure-vmss-deployment",AzureWebApp:"azure-web-app",AzureWebAppContainer:"azure-web-app-container",PackerBuild:"packer-build",AzurePolicyCheckGate:"azure-policy-check-gate",Chef:"chef",ChefKnife:"chef-knife",CopyFilesOverSSH:"copy-files-over-ssh",KubernetesManifest:"kubernetes-manifest",IISWebAppDeploymentOnMachineGroup:"iisweb-app-deployment-on-machine-group",IISWebAppDeployment:"iisweb-app-deployment",IISWebAppManagementOnMachineGroup:"iisweb-app-management-on-machine-group",InvokeRESTAPI:"invoke-rest-api",Kubernetes:"kubernetes",ManualIntervention:"manual-intervention",ManualValidation:"manual-validation",MysqlDeploymentOnMachineGroup:"mysql-deployment-on-machine-group",HelmDeploy:"helm-deploy",PowerShellOnTargetMachines:"powershell-on-target-machines",ServiceFabricDeploy:"service-fabric-deploy",ServiceFabricComposeDeploy:"service-fabric-compose-deploy",SqlDacpacDeploymentOnMachineGroup:"sql-dacpac-deployment-on-machine-group",SqlServerDacpacDeployment:"sql-server-dacpac-deployment",SSH:"ssh",WindowsMachineFileCopy:"windows-machine-file-copy",CargoAuthenticate:"cargo-authenticate",CocoaPods:"cocoa-pods",CondaEnvironment:"conda-environment",DownloadGithubNpmPackage:"download-github-npm-package",MavenAuthenticate:"maven-authenticate",Npm:"npm",npmAuthenticate:"npm-authenticate",NuGetCommand:"nuget-command",NuGet:"nuget",NuGetAuthenticate:"nuget-authenticate",NuGetInstaller:"nuget-installer",NuGetPackager:"nuget-packager",NuGetPublisher:"nuget-publisher",NuGetRestore:"nuget-restore",PyPIPublisher:"py-pi-publisher",PipAuthenticate:"pip-authenticate",TwineAuthenticate:"twine-authenticate",UniversalPackages:"universal-packages",AppCenterTest:"app-center-test",AzureLoadTest:"azure-load-test",AzureTestPlan:"azure-test-plan",ContainerStructureTest:"container-structure-test",VSMobileCenterTest:"vsmobile-center-test",PublishCodeCoverageResults:"publish-code-coverage-results",PublishTestResults:"publish-test-results",RunVisualStudioTestsusingTestAgent:"run-visual-studio-testsusing-test-agent",VSTest:"vstest",DeployVisualStudioTestAgent:"deploy-visual-studio-test-agent",DotNetCoreInstaller:"dotnet-core-installer",DockerInstaller:"docker-installer",DuffleInstaller:"duffle-installer",GoTool:"go-tool",HelmInstaller:"helm-installer",FuncToolsInstaller:"func-tools-installer",JavaToolInstaller:"java-tool-installer",KubectlInstaller:"kubectl-installer",KubeloginInstaller:"kubelogin-installer",NuGetToolInstaller:"nuget-tool-installer",UseDotNet:"use-dotnet",UseNode:"use-node",NodeTool:"node-tool",UsePythonVersion:"use-python-version",UseRubyVersion:"use-ruby-version",VisualStudioTestPlatformInstaller:"visual-studio-test-platform-installer","AdvancedSecurity-Dependency-Scanning":"advanced-security-dependency-scanning",ArchiveFiles:"archive-files",AzureNLBManagement:"azure-nlb-management",Bash:"bash",BatchScript:"batch-script",Cache:"cache",CacheBeta:"cache-beta",CmdLine:"cmd-line",CopyPublishBuildArtifacts:"copy-publish-build-artifacts",CopyFiles:"copy-files",cURLUploader:"curl-uploader",DecryptFile:"decrypt-file",Delay:"delay",DeleteFiles:"delete-files",AzureStaticWebApp:"azure-static-web-app",DownloadFileshareArtifacts:"download-fileshare-artifacts",DownloadBuildArtifacts:"download-build-artifacts",DownloadGitHubRelease:"download-github-release",DownloadPackage:"download-package",DownloadPipelineArtifact:"download-pipeline-artifact",DownloadSecureFile:"download-secure-file",ExtractFiles:"extract-files",FileTransform:"file-transform",FtpUpload:"ftp-upload",GitHubComment:"github-comment",GitHubRelease:"github-release",InstallAppleCertificate:"install-apple-certificate",InstallAppleProvisioningProfile:"install-apple-provisioning-profile",InstallSSHKey:"install-ssh-key",AzureFunction:"azure-function",JenkinsDownloadArtifacts:"jenkins-download-artifacts",NodeTaskRunnerInstaller:"node-task-runner-installer",Notation:"notation",PowerShell:"powershell",PublishBuildArtifacts:"publish-build-artifacts",PublishPipelineArtifact:"publish-pipeline-artifact",PublishPipelineMetadata:"publish-pipeline-metadata",PublishToAzureServiceBus:"publish-to-azure-service-bus",PythonScript:"python-script",AzureMonitor:"azure-monitor",queryWorkItems:"query-work-items",ReviewApp:"review-app",ServiceFabricPowerShell:"service-fabric-powershell",ShellScript:"shell-script",ServiceFabricUpdateAppVersions:"service-fabric-update-app-versions",ServiceFabricUpdateManifests:"service-fabric-update-manifests"};function wHe(s){const e=s.trim(),t=e.lastIndexOf("@");if(t>0){const i=e.slice(0,t),n=Number.parseInt(e.slice(t+1),10);return{raw:e,name:i,version:Number.isNaN(n)?0:n}}return{raw:e,name:e,version:0}}function SHe(s){return s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}const pY="https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference";function yHe(s,e){if(e){const n=`${s.name}@${s.version}`;if(e[n])return e[n];if(e[s.name])return e[s.name]}if(s.name.includes("."))return null;const t=CHe[s.name];if(t)return`${pY}/${t}-v${s.version}`;const i=SHe(s.name);return`${pY}/${i}-v${s.version}`}function xHe(s){const e=[],t=new Set;function i(l){typeof l=="string"&&!t.has(l)&&(t.add(l),e.push(wHe(l)))}function n(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;"task"in d&&i(d.task);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}function o(l){if(Array.isArray(l))for(const c of l){if(!c||typeof c!="object")continue;const d=c;"task"in d&&i(d.task),Array.isArray(d.steps)&&n(d.steps),Array.isArray(d.jobs)&&r(d.jobs),Array.isArray(d.stages)&&a(d.stages);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}else if(l&&typeof l=="object"){const c=l;"task"in c&&i(c.task);for(const d of Object.keys(c))d.startsWith("${{")&&o(c[d]);Array.isArray(c.steps)&&n(c.steps),Array.isArray(c.jobs)&&r(c.jobs),Array.isArray(c.stages)&&a(c.stages)}}function r(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;Array.isArray(d.steps)&&n(d.steps);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}function a(l){for(const c of l){if(!c||typeof c!="object")continue;const d=c;Array.isArray(d.jobs)&&r(d.jobs);for(const h of Object.keys(d))h.startsWith("${{")&&o(d[h])}}Array.isArray(s.steps)&&n(s.steps),Array.isArray(s.jobs)&&r(s.jobs),Array.isArray(s.stages)&&a(s.stages);for(const l of Object.keys(s))l.startsWith("${{")&&o(s[l]);return e}function sP(s,e={}){const t=[];if(s.extends&&typeof s.extends=="object"){const i=s.extends;typeof i.template=="string"&&t.push(vv(i.template,"extends",i.parameters,!1,e));for(const n of Object.keys(i))if(RH(n)){const o=i[n];if(o&&typeof o=="object"&&!Array.isArray(o)){const r=o;typeof r.template=="string"&&t.push(vv(r.template,"extends",r.parameters??i.parameters,!0,e,MH(n)))}}i.parameters&&typeof i.parameters=="object"&&LHe(i.parameters,t,e)}if(Array.isArray(s.variables))for(const i of s.variables)i&&typeof i=="object"&&typeof i.template=="string"&&t.push(vv(i.template,"variables",i.parameters,!1,e));return Array.isArray(s.stages)&&Cr(s.stages,"stages",t,e),Array.isArray(s.jobs)&&Cr(s.jobs,"jobs",t,e),Array.isArray(s.steps)&&Cr(s.steps,"steps",t,e),t}function Cr(s,e,t,i){for(const n of s){if(!n||typeof n!="object")continue;const o=n;if(typeof o.template=="string"){t.push(vv(o.template,e,o.parameters,!1,i));continue}for(const r of Object.keys(o))if(RH(r)){const a=o[r];ore(a,e,t,i,MH(r))}Array.isArray(o.jobs)&&Cr(o.jobs,e==="extends-parameters"?"extends-parameters":"jobs",t,i),Array.isArray(o.steps)&&Cr(o.steps,e==="extends-parameters"?"extends-parameters":"steps",t,i),Array.isArray(o.stages)&&Cr(o.stages,e==="extends-parameters"?"extends-parameters":"stages",t,i)}}function ore(s,e,t,i,n){if(Array.isArray(s)){mY(s,e,t,i,n);return}s&&typeof s=="object"&&mY([s],e,t,i,n)}function mY(s,e,t,i,n){for(const o of s){if(!o||typeof o!="object")continue;const r=o;typeof r.template=="string"&&t.push(vv(r.template,e,r.parameters,!0,i,n));for(const a of Object.keys(r))RH(a)&&ore(r[a],e,t,i,MH(a));Array.isArray(r.jobs)&&Cr(r.jobs,e==="extends-parameters"?"extends-parameters":"jobs",t,i),Array.isArray(r.steps)&&Cr(r.steps,e==="extends-parameters"?"extends-parameters":"steps",t,i),Array.isArray(r.stages)&&Cr(r.stages,e==="extends-parameters"?"extends-parameters":"stages",t,i)}}function LHe(s,e,t){Array.isArray(s.stages)&&Cr(s.stages,"extends-parameters",e,t),Array.isArray(s.jobs)&&Cr(s.jobs,"extends-parameters",e,t),Array.isArray(s.steps)&&Cr(s.steps,"extends-parameters",e,t);for(const[,i]of Object.entries(s))if(Array.isArray(i))for(const n of i){if(n&&typeof n=="object"&&typeof n.template=="string"){const o=n;e.push(vv(o.template,"extends-parameters",o.parameters,!1,t))}if(n&&typeof n=="object"){const o=n;Array.isArray(o.jobs)&&Cr(o.jobs,"extends-parameters",e,t),Array.isArray(o.steps)&&Cr(o.steps,"extends-parameters",e,t)}}}function RH(s){return s.startsWith("${{")}function MH(s){const e=s.match(/\$\{\{\s*(?:else\s*)?if\s+(.*?)\s*\}\}/);return(e==null?void 0:e[1])||void 0}const rre={},{useDebugValue:kHe}=Eu,{useSyncExternalStoreWithSelector:IHe}=wre;let _Y=!1;const DHe=s=>s;function EHe(s,e=DHe,t){(rre?"production":void 0)!=="production"&&t&&!_Y&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),_Y=!0);const i=IHe(s.subscribe,s.getState,s.getServerState||s.getInitialState,e,t);return kHe(i),i}const bY=s=>{(rre?"production":void 0)!=="production"&&typeof s!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof s=="function"?Cre(s):s,t=(i,n)=>EHe(e,i,n);return Object.assign(t,e),t},NHe=s=>s?bY(s):bY,_2=NHe(s=>({org:"",project:"",setConnection:(e,t)=>s({org:e,project:t}),pipelines:[],pipelinesLoading:!1,pipelinesError:null,setPipelines:e=>s({pipelines:e,pipelinesError:null}),setPipelinesLoading:e=>s({pipelinesLoading:e}),setPipelinesError:e=>s({pipelinesError:e}),selectedPipeline:null,selectedPipelineLoading:!1,selectedPipelineError:null,setSelectedPipeline:e=>s({selectedPipeline:e,selectedPipelineError:null,expandedNodes:new Set}),setSelectedPipelineLoading:e=>s({selectedPipelineLoading:e}),setSelectedPipelineError:e=>s({selectedPipelineError:e}),expandedTemplates:new Map(THe()),setExpandedTemplate:(e,t)=>s(i=>{const n=new Map(i.expandedTemplates);return n.set(e,t),RHe(n),{expandedTemplates:n}}),expandedNodes:new Set,toggleNode:e=>s(t=>{const i=new Set(t.expandedNodes);return i.has(e)?i.delete(e):i.add(e),{expandedNodes:i}}),selectedNodeDetail:null,setSelectedNodeDetail:e=>s({selectedNodeDetail:e}),customTaskDocs:{},setCustomTaskDocs:e=>s({customTaskDocs:e}),taskSchema:new Map,setTaskSchema:e=>s(()=>{const t=new Map;for(const i of e)t.set(`${i.name}@${i.version}`,i);return{taskSchema:t}})})),are="apv-template-cache";function THe(){try{const s=localStorage.getItem(are);if(s)return JSON.parse(s)}catch{}return[]}function RHe(s){try{const t=Array.from(s.entries()).slice(-100);localStorage.setItem(are,JSON.stringify(t))}catch{}}function MHe(){const{selectedNodeDetail:s,customTaskDocs:e,taskSchema:t,setSelectedNodeDetail:i}=_2(),n=je.useMemo(()=>{if(!(s!=null&&s.yaml))return[];try{const o=ib(s.yaml);return xHe(o??{})}catch{return[]}},[s==null?void 0:s.yaml]);return s?ue.jsxs("div",{className:"detail-panel",children:[ue.jsxs("div",{className:"detail-panel__header",children:[ue.jsxs("div",{className:"detail-panel__header-row",children:[ue.jsx("h3",{className:"detail-panel__title",children:s.label}),ue.jsx("button",{className:"detail-panel__close",onClick:()=>i(null),"aria-label":"Close detail panel",title:"Close",children:"✕"})]}),ue.jsxs("div",{className:"detail-panel__path",children:[s.filePath,s.repoAlias&&ue.jsxs("span",{className:"detail-panel__repo",children:[" ","@",s.repoAlias]})]})]}),n.length>0&&ue.jsxs("div",{className:"detail-panel__tasks",children:[ue.jsxs("h4",{className:"detail-panel__section-title",children:["Tasks (",n.length,")"]}),ue.jsx("ul",{className:"task-list",children:n.map(o=>ue.jsx(AHe,{ref_:o,customDocs:e,schemaEntry:t.get(o.raw)??t.get(`${o.name}@${o.version}`)},o.raw))})]}),ue.jsx("div",{className:"detail-panel__editor",children:ue.jsx(Bae,{height:"100%",language:"yaml",value:s.yaml,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,lineNumbers:"on",renderLineHighlight:"none",wordWrap:"on",padding:{top:8}}})})]}):ue.jsx("div",{className:"detail-panel detail-panel--empty",children:ue.jsx("p",{children:"Click a node to view its contents"})})}function AHe({ref_:s,customDocs:e,schemaEntry:t}){const i=yHe(s,e);return ue.jsxs("li",{className:"task-item",children:[ue.jsx("span",{className:"task-item__icon",children:"⚙️"}),ue.jsxs("div",{className:"task-item__content",children:[i?ue.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"task-item__link",title:(t==null?void 0:t.description)||`Open docs for ${s.name}`,children:[s.name,ue.jsxs("span",{className:"task-item__version",children:["@",s.version]}),ue.jsx("span",{className:"task-item__external",children:"↗"})]}):ue.jsxs("span",{className:"task-item__name",children:[s.name,ue.jsxs("span",{className:"task-item__version",children:["@",s.version]})]}),(t==null?void 0:t.description)&&ue.jsx("div",{className:"task-item__description",children:t.description})]})]})}class oP extends je.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("ErrorBoundary caught:",e,t)}render(){var e;return this.state.hasError?this.props.fallback||ue.jsxs("div",{className:"error",children:[ue.jsx("h3",{children:"Something went wrong"}),ue.jsx("p",{children:(e=this.state.error)==null?void 0:e.message}),ue.jsx("button",{onClick:()=>this.setState({hasError:!1,error:null}),style:{marginTop:8,cursor:"pointer"},children:"Try again"})]}):this.props.children}}const AH="7.1";function PH(s,e){return`https://dev.azure.com/${encodeURIComponent(s)}/${encodeURIComponent(e)}/_apis`}function PHe(s){return s.startsWith("refs/heads/")?{version:s.slice(11),versionType:"branch"}:s.startsWith("refs/tags/")?{version:s.slice(10),versionType:"tag"}:/^[0-9a-f]{40}$/i.test(s)?{version:s,versionType:"commit"}:{version:s,versionType:"branch"}}async function OH(s){const e=await fetch(s,{credentials:"include"});if(!e.ok){const t=await e.text();throw new Error(`ADO API error (${e.status}): ${t}`)}return e}async function lre(s,e,t,i,n){const o=i.startsWith("/")?i:`/${i}`,r=foe(o);let a=`${PH(s,e)}/git/repositories/${encodeURIComponent(t)}/items?path=${encodeURIComponent(r)}&api-version=${AH}&includeContent=true&$format=text`;if(n){const c=PHe(n);a+=`&versionDescriptor.version=${encodeURIComponent(c.version)}&versionDescriptor.versionType=${c.versionType}`}return(await OH(a)).text()}async function OHe(s,e){const t=`${PH(s,e)}/pipelines?api-version=${AH}`;return(await(await OH(t)).json()).value}async function FHe(s,e,t){var l,c,d,h,u;const i=`${PH(s,e)}/build/definitions/${t}?api-version=${AH}`,o=await(await OH(i)).json(),r={id:o.id,name:o.name,path:((l=o.process)==null?void 0:l.yamlFilename)??o.path,repository:{id:(c=o.repository)==null?void 0:c.id,name:(d=o.repository)==null?void 0:d.name,type:(h=o.repository)==null?void 0:h.type,defaultBranch:(u=o.repository)==null?void 0:u.defaultBranch}},a=await lre(s,e,r.repository.id,r.path,r.repository.defaultBranch);return{definition:r,yaml:a}}async function WHe(s,e,t,i,n){return{content:await lre(s,e,t,i,n),path:i,repoId:t,repoName:t,branch:n||""}}async function BHe(){return{customTaskDocs:{}}}async function HHe(s){return{tasks:[],cached:!1}}const VHe="/api";var EY;const Xy=typeof window<"u"&&((EY=window.location)==null?void 0:EY.protocol)==="chrome-extension:";async function Qy(s){const e=await fetch(`${VHe}${s}`);if(!e.ok){const t=await e.text();throw new Error(`API error (${e.status}): ${t}`)}return e.json()}function zHe(s,e){return Xy?OHe(s,e):Qy(`/${s}/${e}/pipelines`)}function vY(s,e,t){return Xy?FHe(s,e,t):Qy(`/${s}/${e}/pipelines/${t}/yaml`)}function EW(s,e,t,i,n){if(Xy)return WHe(s,e,t,i,n);const o=new URLSearchParams({repo:t,path:i});return n&&o.set("branch",n),Qy(`/${s}/${e}/file-by-repo-name?${o}`)}function UHe(){return Xy?BHe():Qy("/config/task-docs")}function $He(s){return Xy?HHe():Qy(`/${s}/schema/tasks`)}var Ri=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),Ml=Ri((s,e)=>{var t=Object.defineProperty,i=(M,A,O)=>A in M?t(M,A,{enumerable:!0,configurable:!0,writable:!0,value:O}):M[A]=O,n=(M,A)=>()=>(A||M((A={exports:{}}).exports,A),A.exports),o=(M,A,O)=>i(M,typeof A!="symbol"?A+"":A,O),r=n((M,A)=>{var O="\0",W="\0",V="",$=class{constructor(K){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),K&&(this._isDirected=Object.hasOwn(K,"directed")?K.directed:!0,this._isMultigraph=Object.hasOwn(K,"multigraph")?K.multigraph:!1,this._isCompound=Object.hasOwn(K,"compound")?K.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[W]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(K){return this._label=K,this}graph(){return this._label}setDefaultNodeLabel(K){return this._defaultNodeLabelFn=K,typeof K!="function"&&(this._defaultNodeLabelFn=()=>K),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var K=this;return this.nodes().filter(z=>Object.keys(K._in[z]).length===0)}sinks(){var K=this;return this.nodes().filter(z=>Object.keys(K._out[z]).length===0)}setNodes(K,z){var te=arguments,le=this;return K.forEach(function(pe){te.length>1?le.setNode(pe,z):le.setNode(pe)}),this}setNode(K,z){return Object.hasOwn(this._nodes,K)?(arguments.length>1&&(this._nodes[K]=z),this):(this._nodes[K]=arguments.length>1?z:this._defaultNodeLabelFn(K),this._isCompound&&(this._parent[K]=W,this._children[K]={},this._children[W][K]=!0),this._in[K]={},this._preds[K]={},this._out[K]={},this._sucs[K]={},++this._nodeCount,this)}node(K){return this._nodes[K]}hasNode(K){return Object.hasOwn(this._nodes,K)}removeNode(K){var z=this;if(Object.hasOwn(this._nodes,K)){var te=le=>z.removeEdge(z._edgeObjs[le]);delete this._nodes[K],this._isCompound&&(this._removeFromParentsChildList(K),delete this._parent[K],this.children(K).forEach(function(le){z.setParent(le)}),delete this._children[K]),Object.keys(this._in[K]).forEach(te),delete this._in[K],delete this._preds[K],Object.keys(this._out[K]).forEach(te),delete this._out[K],delete this._sucs[K],--this._nodeCount}return this}setParent(K,z){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(z===void 0)z=W;else{z+="";for(var te=z;te!==void 0;te=this.parent(te))if(te===K)throw new Error("Setting "+z+" as parent of "+K+" would create a cycle");this.setNode(z)}return this.setNode(K),this._removeFromParentsChildList(K),this._parent[K]=z,this._children[z][K]=!0,this}_removeFromParentsChildList(K){delete this._children[this._parent[K]][K]}parent(K){if(this._isCompound){var z=this._parent[K];if(z!==W)return z}}children(K=W){if(this._isCompound){var z=this._children[K];if(z)return Object.keys(z)}else{if(K===W)return this.nodes();if(this.hasNode(K))return[]}}predecessors(K){var z=this._preds[K];if(z)return Object.keys(z)}successors(K){var z=this._sucs[K];if(z)return Object.keys(z)}neighbors(K){var z=this.predecessors(K);if(z){let le=new Set(z);for(var te of this.successors(K))le.add(te);return Array.from(le.values())}}isLeaf(K){var z;return this.isDirected()?z=this.successors(K):z=this.neighbors(K),z.length===0}filterNodes(K){var z=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});z.setGraph(this.graph());var te=this;Object.entries(this._nodes).forEach(function([ve,We]){K(ve)&&z.setNode(ve,We)}),Object.values(this._edgeObjs).forEach(function(ve){z.hasNode(ve.v)&&z.hasNode(ve.w)&&z.setEdge(ve,te.edge(ve))});var le={};function pe(ve){var We=te.parent(ve);return We===void 0||z.hasNode(We)?(le[ve]=We,We):We in le?le[We]:pe(We)}return this._isCompound&&z.nodes().forEach(ve=>z.setParent(ve,pe(ve))),z}setDefaultEdgeLabel(K){return this._defaultEdgeLabelFn=K,typeof K!="function"&&(this._defaultEdgeLabelFn=()=>K),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(K,z){var te=this,le=arguments;return K.reduce(function(pe,ve){return le.length>1?te.setEdge(pe,ve,z):te.setEdge(pe,ve),ve}),this}setEdge(){var K,z,te,le,pe=!1,ve=arguments[0];typeof ve=="object"&&ve!==null&&"v"in ve?(K=ve.v,z=ve.w,te=ve.name,arguments.length===2&&(le=arguments[1],pe=!0)):(K=ve,z=arguments[1],te=arguments[3],arguments.length>2&&(le=arguments[2],pe=!0)),K=""+K,z=""+z,te!==void 0&&(te=""+te);var We=Y(this._isDirected,K,z,te);if(Object.hasOwn(this._edgeLabels,We))return pe&&(this._edgeLabels[We]=le),this;if(te!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(K),this.setNode(z),this._edgeLabels[We]=pe?le:this._defaultEdgeLabelFn(K,z,te);var Be=Q(this._isDirected,K,z,te);return K=Be.v,z=Be.w,Object.freeze(Be),this._edgeObjs[We]=Be,q(this._preds[z],K),q(this._sucs[K],z),this._in[z][We]=Be,this._out[K][We]=Be,this._edgeCount++,this}edge(K,z,te){var le=arguments.length===1?re(this._isDirected,arguments[0]):Y(this._isDirected,K,z,te);return this._edgeLabels[le]}edgeAsObj(){let K=this.edge(...arguments);return typeof K!="object"?{label:K}:K}hasEdge(K,z,te){var le=arguments.length===1?re(this._isDirected,arguments[0]):Y(this._isDirected,K,z,te);return Object.hasOwn(this._edgeLabels,le)}removeEdge(K,z,te){var le=arguments.length===1?re(this._isDirected,arguments[0]):Y(this._isDirected,K,z,te),pe=this._edgeObjs[le];return pe&&(K=pe.v,z=pe.w,delete this._edgeLabels[le],delete this._edgeObjs[le],Z(this._preds[z],K),Z(this._sucs[K],z),delete this._in[z][le],delete this._out[K][le],this._edgeCount--),this}inEdges(K,z){return this.isDirected()?this.filterEdges(this._in[K],K,z):this.nodeEdges(K,z)}outEdges(K,z){return this.isDirected()?this.filterEdges(this._out[K],K,z):this.nodeEdges(K,z)}nodeEdges(K,z){if(K in this._nodes)return this.filterEdges({...this._in[K],...this._out[K]},K,z)}filterEdges(K,z,te){if(K){var le=Object.values(K);return te?le.filter(function(pe){return pe.v===z&&pe.w===te||pe.v===te&&pe.w===z}):le}}};function q(K,z){K[z]?K[z]++:K[z]=1}function Z(K,z){--K[z]||delete K[z]}function Y(K,z,te,le){var pe=""+z,ve=""+te;if(!K&&pe>ve){var We=pe;pe=ve,ve=We}return pe+V+ve+V+(le===void 0?O:le)}function Q(K,z,te,le){var pe=""+z,ve=""+te;if(!K&&pe>ve){var We=pe;pe=ve,ve=We}var Be={v:pe,w:ve};return le&&(Be.name=le),Be}function re(K,z){return Y(K,z.v,z.w,z.name)}A.exports=$}),a=n((M,A)=>{A.exports="3.0.2"}),l=n((M,A)=>{A.exports={Graph:r(),version:a()}}),c=n((M,A)=>{var O=r();A.exports={write:W,read:q};function W(Z){var Y={options:{directed:Z.isDirected(),multigraph:Z.isMultigraph(),compound:Z.isCompound()},nodes:V(Z),edges:$(Z)};return Z.graph()!==void 0&&(Y.value=structuredClone(Z.graph())),Y}function V(Z){return Z.nodes().map(function(Y){var Q=Z.node(Y),re=Z.parent(Y),K={v:Y};return Q!==void 0&&(K.value=Q),re!==void 0&&(K.parent=re),K})}function $(Z){return Z.edges().map(function(Y){var Q=Z.edge(Y),re={v:Y.v,w:Y.w};return Y.name!==void 0&&(re.name=Y.name),Q!==void 0&&(re.value=Q),re})}function q(Z){var Y=new O(Z.options).setGraph(Z.value);return Z.nodes.forEach(function(Q){Y.setNode(Q.v,Q.value),Q.parent&&Y.setParent(Q.v,Q.parent)}),Z.edges.forEach(function(Q){Y.setEdge({v:Q.v,w:Q.w,name:Q.name},Q.value)}),Y}}),d=n((M,A)=>{A.exports=W;var O=()=>1;function W($,q,Z,Y){return V($,String(q),Z||O,Y||function(Q){return $.outEdges(Q)})}function V($,q,Z,Y){var Q={},re=!0,K=0,z=$.nodes(),te=function(We){var Be=Z(We);Q[We.v].distance+Be<Q[We.w].distance&&(Q[We.w]={distance:Q[We.v].distance+Be,predecessor:We.v},re=!0)},le=function(){z.forEach(function(We){Y(We).forEach(function(Be){var Mt=Be.v===We?Be.v:Be.w,oo=Mt===Be.v?Be.w:Be.v;te({v:Mt,w:oo})})})};z.forEach(function(We){var Be=We===q?0:Number.POSITIVE_INFINITY;Q[We]={distance:Be}});for(var pe=z.length,ve=1;ve<pe&&(re=!1,K++,le(),!!re);ve++);if(K===pe-1&&(re=!1,le(),re))throw new Error("The graph contains a negative weight cycle");return Q}}),h=n((M,A)=>{A.exports=O;function O(W){var V={},$=[],q;function Z(Y){Object.hasOwn(V,Y)||(V[Y]=!0,q.push(Y),W.successors(Y).forEach(Z),W.predecessors(Y).forEach(Z))}return W.nodes().forEach(function(Y){q=[],Z(Y),q.length&&$.push(q)}),$}}),u=n((M,A)=>{var O=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(W){return W.key})}has(W){return Object.hasOwn(this._keyIndices,W)}priority(W){var V=this._keyIndices[W];if(V!==void 0)return this._arr[V].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(W,V){var $=this._keyIndices;if(W=String(W),!Object.hasOwn($,W)){var q=this._arr,Z=q.length;return $[W]=Z,q.push({key:W,priority:V}),this._decrease(Z),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var W=this._arr.pop();return delete this._keyIndices[W.key],this._heapify(0),W.key}decrease(W,V){var $=this._keyIndices[W];if(V>this._arr[$].priority)throw new Error("New priority is greater than current priority. Key: "+W+" Old: "+this._arr[$].priority+" New: "+V);this._arr[$].priority=V,this._decrease($)}_heapify(W){var V=this._arr,$=2*W,q=$+1,Z=W;$<V.length&&(Z=V[$].priority<V[Z].priority?$:Z,q<V.length&&(Z=V[q].priority<V[Z].priority?q:Z),Z!==W&&(this._swap(W,Z),this._heapify(Z)))}_decrease(W){for(var V=this._arr,$=V[W].priority,q;W!==0&&(q=W>>1,!(V[q].priority<$));)this._swap(W,q),W=q}_swap(W,V){var $=this._arr,q=this._keyIndices,Z=$[W],Y=$[V];$[W]=Y,$[V]=Z,q[Y.key]=W,q[Z.key]=V}};A.exports=O}),f=n((M,A)=>{var O=u();A.exports=V;var W=()=>1;function V(q,Z,Y,Q){var re=function(K){return q.outEdges(K)};return $(q,String(Z),Y||W,Q||re)}function $(q,Z,Y,Q){var re={},K=new O,z,te,le=function(pe){var ve=pe.v!==z?pe.v:pe.w,We=re[ve],Be=Y(pe),Mt=te.distance+Be;if(Be<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+pe+" Weight: "+Be);Mt<We.distance&&(We.distance=Mt,We.predecessor=z,K.decrease(ve,Mt))};for(q.nodes().forEach(function(pe){var ve=pe===Z?0:Number.POSITIVE_INFINITY;re[pe]={distance:ve},K.add(pe,ve)});K.size()>0&&(z=K.removeMin(),te=re[z],te.distance!==Number.POSITIVE_INFINITY);)Q(z).forEach(le);return re}}),g=n((M,A)=>{var O=f();A.exports=W;function W(V,$,q){return V.nodes().reduce(function(Z,Y){return Z[Y]=O(V,Y,$,q),Z},{})}}),p=n((M,A)=>{A.exports=O;function O(V,$,q){if(V[$].predecessor!==void 0)throw new Error("Invalid source vertex");if(V[q].predecessor===void 0&&q!==$)throw new Error("Invalid destination vertex");return{weight:V[q].distance,path:W(V,$,q)}}function W(V,$,q){for(var Z=[],Y=q;Y!==$;)Z.push(Y),Y=V[Y].predecessor;return Z.push($),Z.reverse()}}),_=n((M,A)=>{A.exports=O;function O(W){var V=0,$=[],q={},Z=[];function Y(Q){var re=q[Q]={onStack:!0,lowlink:V,index:V++};if($.push(Q),W.successors(Q).forEach(function(te){Object.hasOwn(q,te)?q[te].onStack&&(re.lowlink=Math.min(re.lowlink,q[te].index)):(Y(te),re.lowlink=Math.min(re.lowlink,q[te].lowlink))}),re.lowlink===re.index){var K=[],z;do z=$.pop(),q[z].onStack=!1,K.push(z);while(Q!==z);Z.push(K)}}return W.nodes().forEach(function(Q){Object.hasOwn(q,Q)||Y(Q)}),Z}}),v=n((M,A)=>{var O=_();A.exports=W;function W(V){return O(V).filter(function($){return $.length>1||$.length===1&&V.hasEdge($[0],$[0])})}}),b=n((M,A)=>{A.exports=W;var O=()=>1;function W($,q,Z){return V($,q||O,Z||function(Y){return $.outEdges(Y)})}function V($,q,Z){var Y={},Q=$.nodes();return Q.forEach(function(re){Y[re]={},Y[re][re]={distance:0},Q.forEach(function(K){re!==K&&(Y[re][K]={distance:Number.POSITIVE_INFINITY})}),Z(re).forEach(function(K){var z=K.v===re?K.w:K.v,te=q(K);Y[re][z]={distance:te,predecessor:re}})}),Q.forEach(function(re){var K=Y[re];Q.forEach(function(z){var te=Y[z];Q.forEach(function(le){var pe=te[re],ve=K[le],We=te[le],Be=pe.distance+ve.distance;Be<We.distance&&(We.distance=Be,We.predecessor=ve.predecessor)})})}),Y}}),w=n((M,A)=>{function O(V){var $={},q={},Z=[];function Y(Q){if(Object.hasOwn(q,Q))throw new W;Object.hasOwn($,Q)||(q[Q]=!0,$[Q]=!0,V.predecessors(Q).forEach(Y),delete q[Q],Z.push(Q))}if(V.sinks().forEach(Y),Object.keys($).length!==V.nodeCount())throw new W;return Z}var W=class extends Error{constructor(){super(...arguments)}};A.exports=O,O.CycleException=W}),C=n((M,A)=>{var O=w();A.exports=W;function W(V){try{O(V)}catch($){if($ instanceof O.CycleException)return!1;throw $}return!0}}),S=n((M,A)=>{A.exports=O;function O(V,$,q,Z,Y){Array.isArray($)||($=[$]);var Q=(V.isDirected()?V.successors:V.neighbors).bind(V),re={};return $.forEach(function(K){if(!V.hasNode(K))throw new Error("Graph does not have node: "+K);Y=W(V,K,q==="post",re,Q,Z,Y)}),Y}function W(V,$,q,Z,Y,Q,re){return Object.hasOwn(Z,$)||(Z[$]=!0,q||(re=Q(re,$)),Y($).forEach(function(K){re=W(V,K,q,Z,Y,Q,re)}),q&&(re=Q(re,$))),re}}),x=n((M,A)=>{var O=S();A.exports=W;function W(V,$,q){return O(V,$,q,function(Z,Y){return Z.push(Y),Z},[])}}),y=n((M,A)=>{var O=x();A.exports=W;function W(V,$){return O(V,$,"post")}}),L=n((M,A)=>{var O=x();A.exports=W;function W(V,$){return O(V,$,"pre")}}),D=n((M,A)=>{var O=r(),W=u();A.exports=V;function V($,q){var Z=new O,Y={},Q=new W,re;function K(te){var le=te.v===re?te.w:te.v,pe=Q.priority(le);if(pe!==void 0){var ve=q(te);ve<pe&&(Y[le]=re,Q.decrease(le,ve))}}if($.nodeCount()===0)return Z;$.nodes().forEach(function(te){Q.add(te,Number.POSITIVE_INFINITY),Z.setNode(te)}),Q.decrease($.nodes()[0],0);for(var z=!1;Q.size()>0;){if(re=Q.removeMin(),Object.hasOwn(Y,re))Z.setEdge(re,Y[re]);else{if(z)throw new Error("Input graph is not connected: "+$);z=!0}$.nodeEdges(re).forEach(K)}return Z}}),E=n((M,A)=>{var O=f(),W=d();A.exports=V;function V(q,Z,Y,Q){return $(q,Z,Y,Q||function(re){return q.outEdges(re)})}function $(q,Z,Y,Q){if(Y===void 0)return O(q,Z,Y,Q);for(var re=!1,K=q.nodes(),z=0;z<K.length;z++){for(var te=Q(K[z]),le=0;le<te.length;le++){var pe=te[le],ve=pe.v===K[z]?pe.v:pe.w,We=ve===pe.v?pe.w:pe.v;Y({v:ve,w:We})<0&&(re=!0)}if(re)return W(q,Z,Y,Q)}return O(q,Z,Y,Q)}}),T=n((M,A)=>{A.exports={bellmanFord:d(),components:h(),dijkstra:f(),dijkstraAll:g(),extractPath:p(),findCycles:v(),floydWarshall:b(),isAcyclic:C(),postorder:y(),preorder:L(),prim:D(),shortestPaths:E(),reduce:S(),tarjan:_(),topsort:w()}}),N=l();e.exports={Graph:N.Graph,json:c(),alg:T(),version:N.version}}),jHe=Ri((s,e)=>{var t=class{constructor(){let o={};o._next=o._prev=o,this._sentinel=o}dequeue(){let o=this._sentinel,r=o._prev;if(r!==o)return i(r),r}enqueue(o){let r=this._sentinel;o._prev&&o._next&&i(o),o._next=r._next,r._next._prev=o,r._next=o,o._prev=r}toString(){let o=[],r=this._sentinel,a=r._prev;for(;a!==r;)o.push(JSON.stringify(a,n)),a=a._prev;return"["+o.join(", ")+"]"}};function i(o){o._prev._next=o._next,o._next._prev=o._prev,delete o._next,delete o._prev}function n(o,r){if(o!=="_next"&&o!=="_prev")return r}e.exports=t}),qHe=Ri((s,e)=>{var t=Ml().Graph,i=jHe();e.exports=o;var n=()=>1;function o(h,u){if(h.nodeCount()<=1)return[];let f=l(h,u||n);return r(f.graph,f.buckets,f.zeroIdx).flatMap(g=>h.outEdges(g.v,g.w))}function r(h,u,f){let g=[],p=u[u.length-1],_=u[0],v;for(;h.nodeCount();){for(;v=_.dequeue();)a(h,u,f,v);for(;v=p.dequeue();)a(h,u,f,v);if(h.nodeCount()){for(let b=u.length-2;b>0;--b)if(v=u[b].dequeue(),v){g=g.concat(a(h,u,f,v,!0));break}}}return g}function a(h,u,f,g,p){let _=p?[]:void 0;return h.inEdges(g.v).forEach(v=>{let b=h.edge(v),w=h.node(v.v);p&&_.push({v:v.v,w:v.w}),w.out-=b,c(u,f,w)}),h.outEdges(g.v).forEach(v=>{let b=h.edge(v),w=v.w,C=h.node(w);C.in-=b,c(u,f,C)}),h.removeNode(g.v),_}function l(h,u){let f=new t,g=0,p=0;h.nodes().forEach(b=>{f.setNode(b,{v:b,in:0,out:0})}),h.edges().forEach(b=>{let w=f.edge(b.v,b.w)||0,C=u(b),S=w+C;f.setEdge(b.v,b.w,S),p=Math.max(p,f.node(b.v).out+=C),g=Math.max(g,f.node(b.w).in+=C)});let _=d(p+g+3).map(()=>new i),v=g+1;return f.nodes().forEach(b=>{c(_,v,f.node(b))}),{graph:f,buckets:_,zeroIdx:v}}function c(h,u,f){f.out?f.in?h[f.out-f.in+u].enqueue(f):h[h.length-1].enqueue(f):h[0].enqueue(f)}function d(h){let u=[];for(let f=0;f<h;f++)u.push(f);return u}}),Jn=Ri((s,e)=>{var t=Ml().Graph;e.exports={addBorderNode:u,addDummyNode:i,applyWithChunking:p,asNonCompoundGraph:o,buildLayerMatrix:c,intersectRect:l,mapValues:L,maxRank:_,normalizeRanks:d,notime:w,partition:v,pick:y,predecessorWeights:a,range:x,removeEmptyRanks:h,simplify:n,successorWeights:r,time:b,uniqueId:S,zipObject:D};function i(E,T,N,M){for(var A=M;E.hasNode(A);)A=S(M);return N.dummy=T,E.setNode(A,N),A}function n(E){let T=new t().setGraph(E.graph());return E.nodes().forEach(N=>T.setNode(N,E.node(N))),E.edges().forEach(N=>{let M=T.edge(N.v,N.w)||{weight:0,minlen:1},A=E.edge(N);T.setEdge(N.v,N.w,{weight:M.weight+A.weight,minlen:Math.max(M.minlen,A.minlen)})}),T}function o(E){let T=new t({multigraph:E.isMultigraph()}).setGraph(E.graph());return E.nodes().forEach(N=>{E.children(N).length||T.setNode(N,E.node(N))}),E.edges().forEach(N=>{T.setEdge(N,E.edge(N))}),T}function r(E){let T=E.nodes().map(N=>{let M={};return E.outEdges(N).forEach(A=>{M[A.w]=(M[A.w]||0)+E.edge(A).weight}),M});return D(E.nodes(),T)}function a(E){let T=E.nodes().map(N=>{let M={};return E.inEdges(N).forEach(A=>{M[A.v]=(M[A.v]||0)+E.edge(A).weight}),M});return D(E.nodes(),T)}function l(E,T){let N=E.x,M=E.y,A=T.x-N,O=T.y-M,W=E.width/2,V=E.height/2;if(!A&&!O)throw new Error("Not possible to find intersection inside of the rectangle");let $,q;return Math.abs(O)*W>Math.abs(A)*V?(O<0&&(V=-V),$=V*A/O,q=V):(A<0&&(W=-W),$=W,q=W*O/A),{x:N+$,y:M+q}}function c(E){let T=x(_(E)+1).map(()=>[]);return E.nodes().forEach(N=>{let M=E.node(N),A=M.rank;A!==void 0&&(T[A][M.order]=N)}),T}function d(E){let T=E.nodes().map(M=>{let A=E.node(M).rank;return A===void 0?Number.MAX_VALUE:A}),N=p(Math.min,T);E.nodes().forEach(M=>{let A=E.node(M);Object.hasOwn(A,"rank")&&(A.rank-=N)})}function h(E){let T=E.nodes().map(W=>E.node(W).rank).filter(W=>W!==void 0),N=p(Math.min,T),M=[];E.nodes().forEach(W=>{let V=E.node(W).rank-N;M[V]||(M[V]=[]),M[V].push(W)});let A=0,O=E.graph().nodeRankFactor;Array.from(M).forEach((W,V)=>{W===void 0&&V%O!==0?--A:W!==void 0&&A&&W.forEach($=>E.node($).rank+=A)})}function u(E,T,N,M){let A={width:0,height:0};return arguments.length>=4&&(A.rank=N,A.order=M),i(E,"border",A,T)}function f(E,T=g){let N=[];for(let M=0;M<E.length;M+=T){let A=E.slice(M,M+T);N.push(A)}return N}var g=65535;function p(E,T){if(T.length>g){let N=f(T);return E.apply(null,N.map(M=>E.apply(null,M)))}else return E.apply(null,T)}function _(E){let T=E.nodes().map(N=>{let M=E.node(N).rank;return M===void 0?Number.MIN_VALUE:M});return p(Math.max,T)}function v(E,T){let N={lhs:[],rhs:[]};return E.forEach(M=>{T(M)?N.lhs.push(M):N.rhs.push(M)}),N}function b(E,T){let N=Date.now();try{return T()}finally{console.log(E+" time: "+(Date.now()-N)+"ms")}}function w(E,T){return T()}var C=0;function S(E){var T=++C;return E+(""+T)}function x(E,T,N=1){T==null&&(T=E,E=0);let M=O=>O<T;N<0&&(M=O=>T<O);let A=[];for(let O=E;M(O);O+=N)A.push(O);return A}function y(E,T){let N={};for(let M of T)E[M]!==void 0&&(N[M]=E[M]);return N}function L(E,T){let N=T;return typeof T=="string"&&(N=M=>M[T]),Object.entries(E).reduce((M,[A,O])=>(M[A]=N(O,A),M),{})}function D(E,T){return E.reduce((N,M,A)=>(N[M]=T[A],N),{})}}),KHe=Ri((s,e)=>{var t=qHe(),i=Jn().uniqueId;e.exports={run:n,undo:r};function n(a){(a.graph().acyclicer==="greedy"?t(a,l(a)):o(a)).forEach(c=>{let d=a.edge(c);a.removeEdge(c),d.forwardName=c.name,d.reversed=!0,a.setEdge(c.w,c.v,d,i("rev"))});function l(c){return d=>c.edge(d).weight}}function o(a){let l=[],c={},d={};function h(u){Object.hasOwn(d,u)||(d[u]=!0,c[u]=!0,a.outEdges(u).forEach(f=>{Object.hasOwn(c,f.w)?l.push(f):h(f.w)}),delete c[u])}return a.nodes().forEach(h),l}function r(a){a.edges().forEach(l=>{let c=a.edge(l);if(c.reversed){a.removeEdge(l);let d=c.forwardName;delete c.reversed,delete c.forwardName,a.setEdge(l.w,l.v,c,d)}})}}),GHe=Ri((s,e)=>{var t=Jn();e.exports={run:i,undo:o};function i(r){r.graph().dummyChains=[],r.edges().forEach(a=>n(r,a))}function n(r,a){let l=a.v,c=r.node(l).rank,d=a.w,h=r.node(d).rank,u=a.name,f=r.edge(a),g=f.labelRank;if(h===c+1)return;r.removeEdge(a);let p,_,v;for(v=0,++c;c<h;++v,++c)f.points=[],_={width:0,height:0,edgeLabel:f,edgeObj:a,rank:c},p=t.addDummyNode(r,"edge",_,"_d"),c===g&&(_.width=f.width,_.height=f.height,_.dummy="edge-label",_.labelpos=f.labelpos),r.setEdge(l,p,{weight:f.weight},u),v===0&&r.graph().dummyChains.push(p),l=p;r.setEdge(l,d,{weight:f.weight},u)}function o(r){r.graph().dummyChains.forEach(a=>{let l=r.node(a),c=l.edgeLabel,d;for(r.setEdge(l.edgeObj,c);l.dummy;)d=r.successors(a)[0],r.removeNode(a),c.points.push({x:l.x,y:l.y}),l.dummy==="edge-label"&&(c.x=l.x,c.y=l.y,c.width=l.width,c.height=l.height),a=d,l=r.node(a)})}}),$E=Ri((s,e)=>{var{applyWithChunking:t}=Jn();e.exports={longestPath:i,slack:n};function i(o){var r={};function a(l){var c=o.node(l);if(Object.hasOwn(r,l))return c.rank;r[l]=!0;let d=o.outEdges(l).map(u=>u==null?Number.POSITIVE_INFINITY:a(u.w)-o.edge(u).minlen);var h=t(Math.min,d);return h===Number.POSITIVE_INFINITY&&(h=0),c.rank=h}o.sources().forEach(a)}function n(o,r){return o.node(r.w).rank-o.node(r.v).rank-o.edge(r).minlen}}),cre=Ri((s,e)=>{var t=Ml().Graph,i=$E().slack;e.exports=n;function n(l){var c=new t({directed:!1}),d=l.nodes()[0],h=l.nodeCount();c.setNode(d,{});for(var u,f;o(c,l)<h;)u=r(c,l),f=c.hasNode(u.v)?i(l,u):-i(l,u),a(c,l,f);return c}function o(l,c){function d(h){c.nodeEdges(h).forEach(u=>{var f=u.v,g=h===f?u.w:f;!l.hasNode(g)&&!i(c,u)&&(l.setNode(g,{}),l.setEdge(h,g,{}),d(g))})}return l.nodes().forEach(d),l.nodeCount()}function r(l,c){return c.edges().reduce((d,h)=>{let u=Number.POSITIVE_INFINITY;return l.hasNode(h.v)!==l.hasNode(h.w)&&(u=i(c,h)),u<d[0]?[u,h]:d},[Number.POSITIVE_INFINITY,null])[1]}function a(l,c,d){l.nodes().forEach(h=>c.node(h).rank+=d)}}),YHe=Ri((s,e)=>{var t=cre(),i=$E().slack,n=$E().longestPath,o=Ml().alg.preorder,r=Ml().alg.postorder,a=Jn().simplify;e.exports=l,l.initLowLimValues=u,l.initCutValues=c,l.calcCutValue=h,l.leaveEdge=g,l.enterEdge=p,l.exchangeEdges=_;function l(C){C=a(C),n(C);var S=t(C);u(S),c(S,C);for(var x,y;x=g(S);)y=p(S,C,x),_(S,C,x,y)}function c(C,S){var x=r(C,C.nodes());x=x.slice(0,x.length-1),x.forEach(y=>d(C,S,y))}function d(C,S,x){var y=C.node(x),L=y.parent;C.edge(x,L).cutvalue=h(C,S,x)}function h(C,S,x){var y=C.node(x),L=y.parent,D=!0,E=S.edge(x,L),T=0;return E||(D=!1,E=S.edge(L,x)),T=E.weight,S.nodeEdges(x).forEach(N=>{var M=N.v===x,A=M?N.w:N.v;if(A!==L){var O=M===D,W=S.edge(N).weight;if(T+=O?W:-W,b(C,x,A)){var V=C.edge(x,A).cutvalue;T+=O?-V:V}}}),T}function u(C,S){arguments.length<2&&(S=C.nodes()[0]),f(C,{},1,S)}function f(C,S,x,y,L){var D=x,E=C.node(y);return S[y]=!0,C.neighbors(y).forEach(T=>{Object.hasOwn(S,T)||(x=f(C,S,x,T,y))}),E.low=D,E.lim=x++,L?E.parent=L:delete E.parent,x}function g(C){return C.edges().find(S=>C.edge(S).cutvalue<0)}function p(C,S,x){var y=x.v,L=x.w;S.hasEdge(y,L)||(y=x.w,L=x.v);var D=C.node(y),E=C.node(L),T=D,N=!1;D.lim>E.lim&&(T=E,N=!0);var M=S.edges().filter(A=>N===w(C,C.node(A.v),T)&&N!==w(C,C.node(A.w),T));return M.reduce((A,O)=>i(S,O)<i(S,A)?O:A)}function _(C,S,x,y){var L=x.v,D=x.w;C.removeEdge(L,D),C.setEdge(y.v,y.w,{}),u(C),c(C,S),v(C,S)}function v(C,S){var x=C.nodes().find(L=>!S.node(L).parent),y=o(C,x);y=y.slice(1),y.forEach(L=>{var D=C.node(L).parent,E=S.edge(L,D),T=!1;E||(E=S.edge(D,L),T=!0),S.node(L).rank=S.node(D).rank+(T?E.minlen:-E.minlen)})}function b(C,S,x){return C.hasEdge(S,x)}function w(C,S,x){return x.low<=S.lim&&S.lim<=x.lim}}),ZHe=Ri((s,e)=>{var t=$E(),i=t.longestPath,n=cre(),o=YHe();e.exports=r;function r(d){var h=d.graph().ranker;if(h instanceof Function)return h(d);switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":l(d);break;case"longest-path":a(d);break;case"none":break;default:c(d)}}var a=i;function l(d){i(d),n(d)}function c(d){o(d)}}),XHe=Ri((s,e)=>{e.exports=t;function t(o){let r=n(o);o.graph().dummyChains.forEach(a=>{let l=o.node(a),c=l.edgeObj,d=i(o,r,c.v,c.w),h=d.path,u=d.lca,f=0,g=h[f],p=!0;for(;a!==c.w;){if(l=o.node(a),p){for(;(g=h[f])!==u&&o.node(g).maxRank<l.rank;)f++;g===u&&(p=!1)}if(!p){for(;f<h.length-1&&o.node(g=h[f+1]).minRank<=l.rank;)f++;g=h[f]}o.setParent(a,g),a=o.successors(a)[0]}})}function i(o,r,a,l){let c=[],d=[],h=Math.min(r[a].low,r[l].low),u=Math.max(r[a].lim,r[l].lim),f,g;f=a;do f=o.parent(f),c.push(f);while(f&&(r[f].low>h||u>r[f].lim));for(g=f,f=l;(f=o.parent(f))!==g;)d.push(f);return{path:c.concat(d.reverse()),lca:g}}function n(o){let r={},a=0;function l(c){let d=a;o.children(c).forEach(l),r[c]={low:d,lim:a++}}return o.children().forEach(l),r}}),QHe=Ri((s,e)=>{var t=Jn();e.exports={run:i,cleanup:a};function i(l){let c=t.addDummyNode(l,"root",{},"_root"),d=o(l),h=Object.values(d),u=t.applyWithChunking(Math.max,h)-1,f=2*u+1;l.graph().nestingRoot=c,l.edges().forEach(p=>l.edge(p).minlen*=f);let g=r(l)+1;l.children().forEach(p=>n(l,c,f,g,u,d,p)),l.graph().nodeRankFactor=f}function n(l,c,d,h,u,f,g){let p=l.children(g);if(!p.length){g!==c&&l.setEdge(c,g,{weight:0,minlen:d});return}let _=t.addBorderNode(l,"_bt"),v=t.addBorderNode(l,"_bb"),b=l.node(g);l.setParent(_,g),b.borderTop=_,l.setParent(v,g),b.borderBottom=v,p.forEach(w=>{n(l,c,d,h,u,f,w);let C=l.node(w),S=C.borderTop?C.borderTop:w,x=C.borderBottom?C.borderBottom:w,y=C.borderTop?h:2*h,L=S!==x?1:u-f[g]+1;l.setEdge(_,S,{weight:y,minlen:L,nestingEdge:!0}),l.setEdge(x,v,{weight:y,minlen:L,nestingEdge:!0})}),l.parent(g)||l.setEdge(c,_,{weight:0,minlen:u+f[g]})}function o(l){var c={};function d(h,u){var f=l.children(h);f&&f.length&&f.forEach(g=>d(g,u+1)),c[h]=u}return l.children().forEach(h=>d(h,1)),c}function r(l){return l.edges().reduce((c,d)=>c+l.edge(d).weight,0)}function a(l){var c=l.graph();l.removeNode(c.nestingRoot),delete c.nestingRoot,l.edges().forEach(d=>{var h=l.edge(d);h.nestingEdge&&l.removeEdge(d)})}}),JHe=Ri((s,e)=>{var t=Jn();e.exports=i;function i(o){function r(a){let l=o.children(a),c=o.node(a);if(l.length&&l.forEach(r),Object.hasOwn(c,"minRank")){c.borderLeft=[],c.borderRight=[];for(let d=c.minRank,h=c.maxRank+1;d<h;++d)n(o,"borderLeft","_bl",a,c,d),n(o,"borderRight","_br",a,c,d)}}o.children().forEach(r)}function n(o,r,a,l,c,d){let h={width:0,height:0,rank:d,borderType:r},u=c[r][d-1],f=t.addDummyNode(o,"border",h,a);c[r][d]=f,o.setParent(f,l),u&&o.setEdge(u,f,{weight:1})}}),eVe=Ri((s,e)=>{e.exports={adjust:t,undo:i};function t(d){let h=d.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&n(d)}function i(d){let h=d.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&r(d),(h==="lr"||h==="rl")&&(l(d),n(d))}function n(d){d.nodes().forEach(h=>o(d.node(h))),d.edges().forEach(h=>o(d.edge(h)))}function o(d){let h=d.width;d.width=d.height,d.height=h}function r(d){d.nodes().forEach(h=>a(d.node(h))),d.edges().forEach(h=>{let u=d.edge(h);u.points.forEach(a),Object.hasOwn(u,"y")&&a(u)})}function a(d){d.y=-d.y}function l(d){d.nodes().forEach(h=>c(d.node(h))),d.edges().forEach(h=>{let u=d.edge(h);u.points.forEach(c),Object.hasOwn(u,"x")&&c(u)})}function c(d){let h=d.x;d.x=d.y,d.y=h}}),tVe=Ri((s,e)=>{var t=Jn();e.exports=i;function i(n){let o={},r=n.nodes().filter(h=>!n.children(h).length),a=r.map(h=>n.node(h).rank),l=t.applyWithChunking(Math.max,a),c=t.range(l+1).map(()=>[]);function d(h){if(o[h])return;o[h]=!0;let u=n.node(h);c[u.rank].push(h),n.successors(h).forEach(d)}return r.sort((h,u)=>n.node(h).rank-n.node(u).rank).forEach(d),c}}),iVe=Ri((s,e)=>{var t=Jn().zipObject;e.exports=i;function i(o,r){let a=0;for(let l=1;l<r.length;++l)a+=n(o,r[l-1],r[l]);return a}function n(o,r,a){let l=t(a,a.map((g,p)=>p)),c=r.flatMap(g=>o.outEdges(g).map(p=>({pos:l[p.w],weight:o.edge(p).weight})).sort((p,_)=>p.pos-_.pos)),d=1;for(;d<a.length;)d<<=1;let h=2*d-1;d-=1;let u=new Array(h).fill(0),f=0;return c.forEach(g=>{let p=g.pos+d;u[p]+=g.weight;let _=0;for(;p>0;)p%2&&(_+=u[p+1]),p=p-1>>1,u[p]+=g.weight;f+=g.weight*_}),f}}),nVe=Ri((s,e)=>{e.exports=t;function t(i,n=[]){return n.map(o=>{let r=i.inEdges(o);if(r.length){let a=r.reduce((l,c)=>{let d=i.edge(c),h=i.node(c.v);return{sum:l.sum+d.weight*h.order,weight:l.weight+d.weight}},{sum:0,weight:0});return{v:o,barycenter:a.sum/a.weight,weight:a.weight}}else return{v:o}})}}),sVe=Ri((s,e)=>{var t=Jn();e.exports=i;function i(r,a){let l={};r.forEach((d,h)=>{let u=l[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:h};d.barycenter!==void 0&&(u.barycenter=d.barycenter,u.weight=d.weight)}),a.edges().forEach(d=>{let h=l[d.v],u=l[d.w];h!==void 0&&u!==void 0&&(u.indegree++,h.out.push(l[d.w]))});let c=Object.values(l).filter(d=>!d.indegree);return n(c)}function n(r){let a=[];function l(d){return h=>{h.merged||(h.barycenter===void 0||d.barycenter===void 0||h.barycenter>=d.barycenter)&&o(d,h)}}function c(d){return h=>{h.in.push(d),--h.indegree===0&&r.push(h)}}for(;r.length;){let d=r.pop();a.push(d),d.in.reverse().forEach(l(d)),d.out.forEach(c(d))}return a.filter(d=>!d.merged).map(d=>t.pick(d,["vs","i","barycenter","weight"]))}function o(r,a){let l=0,c=0;r.weight&&(l+=r.barycenter*r.weight,c+=r.weight),a.weight&&(l+=a.barycenter*a.weight,c+=a.weight),r.vs=a.vs.concat(r.vs),r.barycenter=l/c,r.weight=c,r.i=Math.min(a.i,r.i),a.merged=!0}}),oVe=Ri((s,e)=>{var t=Jn();e.exports=i;function i(r,a){let l=t.partition(r,_=>Object.hasOwn(_,"barycenter")),c=l.lhs,d=l.rhs.sort((_,v)=>v.i-_.i),h=[],u=0,f=0,g=0;c.sort(o(!!a)),g=n(h,d,g),c.forEach(_=>{g+=_.vs.length,h.push(_.vs),u+=_.barycenter*_.weight,f+=_.weight,g=n(h,d,g)});let p={vs:h.flat(!0)};return f&&(p.barycenter=u/f,p.weight=f),p}function n(r,a,l){let c;for(;a.length&&(c=a[a.length-1]).i<=l;)a.pop(),r.push(c.vs),l++;return l}function o(r){return(a,l)=>a.barycenter<l.barycenter?-1:a.barycenter>l.barycenter?1:r?l.i-a.i:a.i-l.i}}),rVe=Ri((s,e)=>{var t=nVe(),i=sVe(),n=oVe();e.exports=o;function o(l,c,d,h){let u=l.children(c),f=l.node(c),g=f?f.borderLeft:void 0,p=f?f.borderRight:void 0,_={};g&&(u=u.filter(C=>C!==g&&C!==p));let v=t(l,u);v.forEach(C=>{if(l.children(C.v).length){let S=o(l,C.v,d,h);_[C.v]=S,Object.hasOwn(S,"barycenter")&&a(C,S)}});let b=i(v,d);r(b,_);let w=n(b,h);if(g&&(w.vs=[g,w.vs,p].flat(!0),l.predecessors(g).length)){let C=l.node(l.predecessors(g)[0]),S=l.node(l.predecessors(p)[0]);Object.hasOwn(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+C.order+S.order)/(w.weight+2),w.weight+=2}return w}function r(l,c){l.forEach(d=>{d.vs=d.vs.flatMap(h=>c[h]?c[h].vs:h)})}function a(l,c){l.barycenter!==void 0?(l.barycenter=(l.barycenter*l.weight+c.barycenter*c.weight)/(l.weight+c.weight),l.weight+=c.weight):(l.barycenter=c.barycenter,l.weight=c.weight)}}),aVe=Ri((s,e)=>{var t=Ml().Graph,i=Jn();e.exports=n;function n(r,a,l,c){c||(c=r.nodes());let d=o(r),h=new t({compound:!0}).setGraph({root:d}).setDefaultNodeLabel(u=>r.node(u));return c.forEach(u=>{let f=r.node(u),g=r.parent(u);(f.rank===a||f.minRank<=a&&a<=f.maxRank)&&(h.setNode(u),h.setParent(u,g||d),r[l](u).forEach(p=>{let _=p.v===u?p.w:p.v,v=h.edge(_,u),b=v!==void 0?v.weight:0;h.setEdge(_,u,{weight:r.edge(p).weight+b})}),Object.hasOwn(f,"minRank")&&h.setNode(u,{borderLeft:f.borderLeft[a],borderRight:f.borderRight[a]}))}),h}function o(r){for(var a;r.hasNode(a=i.uniqueId("_root")););return a}}),lVe=Ri((s,e)=>{e.exports=t;function t(i,n,o){let r={},a;o.forEach(l=>{let c=i.parent(l),d,h;for(;c;){if(d=i.parent(c),d?(h=r[d],r[d]=c):(h=a,a=c),h&&h!==c){n.setEdge(h,c);return}c=d}})}}),cVe=Ri((s,e)=>{var t=tVe(),i=iVe(),n=rVe(),o=aVe(),r=lVe(),a=Ml().Graph,l=Jn();e.exports=c;function c(f,g={}){if(typeof g.customOrder=="function"){g.customOrder(f,c);return}let p=l.maxRank(f),_=d(f,l.range(1,p+1),"inEdges"),v=d(f,l.range(p-1,-1,-1),"outEdges"),b=t(f);if(u(f,b),g.disableOptimalOrderHeuristic)return;let w=Number.POSITIVE_INFINITY,C,S=g.constraints||[];for(let x=0,y=0;y<4;++x,++y){h(x%2?_:v,x%4>=2,S),b=l.buildLayerMatrix(f);let L=i(f,b);L<w?(y=0,C=Object.assign({},b),w=L):L===w&&(C=structuredClone(b))}u(f,C)}function d(f,g,p){let _=new Map,v=(b,w)=>{_.has(b)||_.set(b,[]),_.get(b).push(w)};for(let b of f.nodes()){let w=f.node(b);if(typeof w.rank=="number"&&v(w.rank,b),typeof w.minRank=="number"&&typeof w.maxRank=="number")for(let C=w.minRank;C<=w.maxRank;C++)C!==w.rank&&v(C,b)}return g.map(function(b){return o(f,b,p,_.get(b)||[])})}function h(f,g,p){let _=new a;f.forEach(function(v){p.forEach(C=>_.setEdge(C.left,C.right));let b=v.graph().root,w=n(v,b,_,g);w.vs.forEach((C,S)=>v.node(C).order=S),r(v,_,w.vs)})}function u(f,g){Object.values(g).forEach(p=>p.forEach((_,v)=>f.node(_).order=v))}}),dVe=Ri((s,e)=>{var t=Ml().Graph,i=Jn();e.exports={positionX:p,findType1Conflicts:n,findType2Conflicts:o,addConflict:a,hasConflict:l,verticalAlignment:c,horizontalCompaction:d,alignCoordinates:f,findSmallestWidthAlignment:u,balance:g};function n(b,w){let C={};function S(x,y){let L=0,D=0,E=x.length,T=y[y.length-1];return y.forEach((N,M)=>{let A=r(b,N),O=A?b.node(A).order:E;(A||N===T)&&(y.slice(D,M+1).forEach(W=>{b.predecessors(W).forEach(V=>{let $=b.node(V),q=$.order;(q<L||O<q)&&!($.dummy&&b.node(W).dummy)&&a(C,V,W)})}),D=M+1,L=O)}),y}return w.length&&w.reduce(S),C}function o(b,w){let C={};function S(y,L,D,E,T){let N;i.range(L,D).forEach(M=>{N=y[M],b.node(N).dummy&&b.predecessors(N).forEach(A=>{let O=b.node(A);O.dummy&&(O.order<E||O.order>T)&&a(C,A,N)})})}function x(y,L){let D=-1,E,T=0;return L.forEach((N,M)=>{if(b.node(N).dummy==="border"){let A=b.predecessors(N);A.length&&(E=b.node(A[0]).order,S(L,T,M,D,E),T=M,D=E)}S(L,T,L.length,E,y.length)}),L}return w.length&&w.reduce(x),C}function r(b,w){if(b.node(w).dummy)return b.predecessors(w).find(C=>b.node(C).dummy)}function a(b,w,C){if(w>C){let x=w;w=C,C=x}let S=b[w];S||(b[w]=S={}),S[C]=!0}function l(b,w,C){if(w>C){let S=w;w=C,C=S}return!!b[w]&&Object.hasOwn(b[w],C)}function c(b,w,C,S){let x={},y={},L={};return w.forEach(D=>{D.forEach((E,T)=>{x[E]=E,y[E]=E,L[E]=T})}),w.forEach(D=>{let E=-1;D.forEach(T=>{let N=S(T);if(N.length){N=N.sort((A,O)=>L[A]-L[O]);let M=(N.length-1)/2;for(let A=Math.floor(M),O=Math.ceil(M);A<=O;++A){let W=N[A];y[T]===T&&E<L[W]&&!l(C,T,W)&&(y[W]=T,y[T]=x[T]=x[W],E=L[W])}}})}),{root:x,align:y}}function d(b,w,C,S,x){let y={},L=h(b,w,C,x),D=x?"borderLeft":"borderRight";function E(M,A){let O=L.nodes().slice(),W={},V=O.pop();for(;V;){if(W[V])M(V);else{W[V]=!0,O.push(V);for(let $ of A(V))O.push($)}V=O.pop()}}function T(M){y[M]=L.inEdges(M).reduce((A,O)=>Math.max(A,y[O.v]+L.edge(O)),0)}function N(M){let A=L.outEdges(M).reduce((W,V)=>Math.min(W,y[V.w]-L.edge(V)),Number.POSITIVE_INFINITY),O=b.node(M);A!==Number.POSITIVE_INFINITY&&O.borderType!==D&&(y[M]=Math.max(y[M],A))}return E(T,L.predecessors.bind(L)),E(N,L.successors.bind(L)),Object.keys(S).forEach(M=>y[M]=y[C[M]]),y}function h(b,w,C,S){let x=new t,y=b.graph(),L=_(y.nodesep,y.edgesep,S);return w.forEach(D=>{let E;D.forEach(T=>{let N=C[T];if(x.setNode(N),E){var M=C[E],A=x.edge(M,N);x.setEdge(M,N,Math.max(L(b,T,E),A||0))}E=T})}),x}function u(b,w){return Object.values(w).reduce((C,S)=>{let x=Number.NEGATIVE_INFINITY,y=Number.POSITIVE_INFINITY;Object.entries(S).forEach(([D,E])=>{let T=v(b,D)/2;x=Math.max(E+T,x),y=Math.min(E-T,y)});let L=x-y;return L<C[0]&&(C=[L,S]),C},[Number.POSITIVE_INFINITY,null])[1]}function f(b,w){let C=Object.values(w),S=i.applyWithChunking(Math.min,C),x=i.applyWithChunking(Math.max,C);["u","d"].forEach(y=>{["l","r"].forEach(L=>{let D=y+L,E=b[D];if(E===w)return;let T=Object.values(E),N=S-i.applyWithChunking(Math.min,T);L!=="l"&&(N=x-i.applyWithChunking(Math.max,T)),N&&(b[D]=i.mapValues(E,M=>M+N))})})}function g(b,w){return i.mapValues(b.ul,(C,S)=>{if(w)return b[w.toLowerCase()][S];{let x=Object.values(b).map(y=>y[S]).sort((y,L)=>y-L);return(x[1]+x[2])/2}})}function p(b){let w=i.buildLayerMatrix(b),C=Object.assign(n(b,w),o(b,w)),S={},x;["u","d"].forEach(L=>{x=L==="u"?w:Object.values(w).reverse(),["l","r"].forEach(D=>{D==="r"&&(x=x.map(M=>Object.values(M).reverse()));let E=(L==="u"?b.predecessors:b.successors).bind(b),T=c(b,x,C,E),N=d(b,x,T.root,T.align,D==="r");D==="r"&&(N=i.mapValues(N,M=>-M)),S[L+D]=N})});let y=u(b,S);return f(S,y),g(S,b.graph().align)}function _(b,w,C){return(S,x,y)=>{let L=S.node(x),D=S.node(y),E=0,T;if(E+=L.width/2,Object.hasOwn(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":T=-L.width/2;break;case"r":T=L.width/2;break}if(T&&(E+=C?T:-T),T=0,E+=(L.dummy?w:b)/2,E+=(D.dummy?w:b)/2,E+=D.width/2,Object.hasOwn(D,"labelpos"))switch(D.labelpos.toLowerCase()){case"l":T=D.width/2;break;case"r":T=-D.width/2;break}return T&&(E+=C?T:-T),T=0,E}}function v(b,w){return b.node(w).width}}),hVe=Ri((s,e)=>{var t=Jn(),i=dVe().positionX;e.exports=n;function n(r){r=t.asNonCompoundGraph(r),o(r),Object.entries(i(r)).forEach(([a,l])=>r.node(a).x=l)}function o(r){let a=t.buildLayerMatrix(r),l=r.graph().ranksep,c=r.graph().rankalign,d=0;a.forEach(h=>{let u=h.reduce((f,g)=>{let p=r.node(g).height;return f>p?f:p},0);h.forEach(f=>{let g=r.node(f);c==="top"?g.y=d+g.height/2:c==="bottom"?g.y=d+u-g.height/2:g.y=d+u/2}),d+=u+l})}}),uVe=Ri((s,e)=>{var t=KHe(),i=GHe(),n=ZHe(),o=Jn().normalizeRanks,r=XHe(),a=Jn().removeEmptyRanks,l=QHe(),c=JHe(),d=eVe(),h=cVe(),u=hVe(),f=Jn(),g=Ml().Graph;e.exports=p;function p(z,te={}){let le=te.debugTiming?f.time:f.notime;return le("layout",()=>{let pe=le(" buildLayoutGraph",()=>E(z));return le(" runLayout",()=>_(pe,le,te)),le(" updateInputGraph",()=>v(z,pe)),pe})}function _(z,te,le){te(" makeSpaceForEdgeLabels",()=>T(z)),te(" removeSelfEdges",()=>Z(z)),te(" acyclic",()=>t.run(z)),te(" nestingGraph.run",()=>l.run(z)),te(" rank",()=>n(f.asNonCompoundGraph(z))),te(" injectEdgeLabelProxies",()=>N(z)),te(" removeEmptyRanks",()=>a(z)),te(" nestingGraph.cleanup",()=>l.cleanup(z)),te(" normalizeRanks",()=>o(z)),te(" assignRankMinMax",()=>M(z)),te(" removeEdgeLabelProxies",()=>A(z)),te(" normalize.run",()=>i.run(z)),te(" parentDummyChains",()=>r(z)),te(" addBorderSegments",()=>c(z)),te(" order",()=>h(z,le)),te(" insertSelfEdges",()=>Y(z)),te(" adjustCoordinateSystem",()=>d.adjust(z)),te(" position",()=>u(z)),te(" positionSelfEdges",()=>Q(z)),te(" removeBorderNodes",()=>q(z)),te(" normalize.undo",()=>i.undo(z)),te(" fixupEdgeLabelCoords",()=>V(z)),te(" undoCoordinateSystem",()=>d.undo(z)),te(" translateGraph",()=>O(z)),te(" assignNodeIntersects",()=>W(z)),te(" reversePoints",()=>$(z)),te(" acyclic.undo",()=>t.undo(z))}function v(z,te){z.nodes().forEach(le=>{let pe=z.node(le),ve=te.node(le);pe&&(pe.x=ve.x,pe.y=ve.y,pe.order=ve.order,pe.rank=ve.rank,te.children(le).length&&(pe.width=ve.width,pe.height=ve.height))}),z.edges().forEach(le=>{let pe=z.edge(le),ve=te.edge(le);pe.points=ve.points,Object.hasOwn(ve,"x")&&(pe.x=ve.x,pe.y=ve.y)}),z.graph().width=te.graph().width,z.graph().height=te.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},C=["acyclicer","ranker","rankdir","align","rankalign"],S=["width","height","rank"],x={width:0,height:0},y=["minlen","weight","width","height","labeloffset"],L={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},D=["labelpos"];function E(z){let te=new g({multigraph:!0,compound:!0}),le=K(z.graph());return te.setGraph(Object.assign({},w,re(le,b),f.pick(le,C))),z.nodes().forEach(pe=>{let ve=K(z.node(pe)),We=re(ve,S);Object.keys(x).forEach(Be=>{We[Be]===void 0&&(We[Be]=x[Be])}),te.setNode(pe,We),te.setParent(pe,z.parent(pe))}),z.edges().forEach(pe=>{let ve=K(z.edge(pe));te.setEdge(pe,Object.assign({},L,re(ve,y),f.pick(ve,D)))}),te}function T(z){let te=z.graph();te.ranksep/=2,z.edges().forEach(le=>{let pe=z.edge(le);pe.minlen*=2,pe.labelpos.toLowerCase()!=="c"&&(te.rankdir==="TB"||te.rankdir==="BT"?pe.width+=pe.labeloffset:pe.height+=pe.labeloffset)})}function N(z){z.edges().forEach(te=>{let le=z.edge(te);if(le.width&&le.height){let pe=z.node(te.v),ve={rank:(z.node(te.w).rank-pe.rank)/2+pe.rank,e:te};f.addDummyNode(z,"edge-proxy",ve,"_ep")}})}function M(z){let te=0;z.nodes().forEach(le=>{let pe=z.node(le);pe.borderTop&&(pe.minRank=z.node(pe.borderTop).rank,pe.maxRank=z.node(pe.borderBottom).rank,te=Math.max(te,pe.maxRank))}),z.graph().maxRank=te}function A(z){z.nodes().forEach(te=>{let le=z.node(te);le.dummy==="edge-proxy"&&(z.edge(le.e).labelRank=le.rank,z.removeNode(te))})}function O(z){let te=Number.POSITIVE_INFINITY,le=0,pe=Number.POSITIVE_INFINITY,ve=0,We=z.graph(),Be=We.marginx||0,Mt=We.marginy||0;function oo(Hi){let Xi=Hi.x,ro=Hi.y,Ps=Hi.width,vn=Hi.height;te=Math.min(te,Xi-Ps/2),le=Math.max(le,Xi+Ps/2),pe=Math.min(pe,ro-vn/2),ve=Math.max(ve,ro+vn/2)}z.nodes().forEach(Hi=>oo(z.node(Hi))),z.edges().forEach(Hi=>{let Xi=z.edge(Hi);Object.hasOwn(Xi,"x")&&oo(Xi)}),te-=Be,pe-=Mt,z.nodes().forEach(Hi=>{let Xi=z.node(Hi);Xi.x-=te,Xi.y-=pe}),z.edges().forEach(Hi=>{let Xi=z.edge(Hi);Xi.points.forEach(ro=>{ro.x-=te,ro.y-=pe}),Object.hasOwn(Xi,"x")&&(Xi.x-=te),Object.hasOwn(Xi,"y")&&(Xi.y-=pe)}),We.width=le-te+Be,We.height=ve-pe+Mt}function W(z){z.edges().forEach(te=>{let le=z.edge(te),pe=z.node(te.v),ve=z.node(te.w),We,Be;le.points?(We=le.points[0],Be=le.points[le.points.length-1]):(le.points=[],We=ve,Be=pe),le.points.unshift(f.intersectRect(pe,We)),le.points.push(f.intersectRect(ve,Be))})}function V(z){z.edges().forEach(te=>{let le=z.edge(te);if(Object.hasOwn(le,"x"))switch((le.labelpos==="l"||le.labelpos==="r")&&(le.width-=le.labeloffset),le.labelpos){case"l":le.x-=le.width/2+le.labeloffset;break;case"r":le.x+=le.width/2+le.labeloffset;break}})}function $(z){z.edges().forEach(te=>{let le=z.edge(te);le.reversed&&le.points.reverse()})}function q(z){z.nodes().forEach(te=>{if(z.children(te).length){let le=z.node(te),pe=z.node(le.borderTop),ve=z.node(le.borderBottom),We=z.node(le.borderLeft[le.borderLeft.length-1]),Be=z.node(le.borderRight[le.borderRight.length-1]);le.width=Math.abs(Be.x-We.x),le.height=Math.abs(ve.y-pe.y),le.x=We.x+le.width/2,le.y=pe.y+le.height/2}}),z.nodes().forEach(te=>{z.node(te).dummy==="border"&&z.removeNode(te)})}function Z(z){z.edges().forEach(te=>{if(te.v===te.w){var le=z.node(te.v);le.selfEdges||(le.selfEdges=[]),le.selfEdges.push({e:te,label:z.edge(te)}),z.removeEdge(te)}})}function Y(z){var te=f.buildLayerMatrix(z);te.forEach(le=>{var pe=0;le.forEach((ve,We)=>{var Be=z.node(ve);Be.order=We+pe,(Be.selfEdges||[]).forEach(Mt=>{f.addDummyNode(z,"selfedge",{width:Mt.label.width,height:Mt.label.height,rank:Be.rank,order:We+ ++pe,e:Mt.e,label:Mt.label},"_se")}),delete Be.selfEdges})})}function Q(z){z.nodes().forEach(te=>{var le=z.node(te);if(le.dummy==="selfedge"){var pe=z.node(le.e.v),ve=pe.x+pe.width/2,We=pe.y,Be=le.x-ve,Mt=pe.height/2;z.setEdge(le.e,le.label),z.removeNode(te),le.label.points=[{x:ve+2*Be/3,y:We-Mt},{x:ve+5*Be/6,y:We-Mt},{x:ve+Be,y:We},{x:ve+5*Be/6,y:We+Mt},{x:ve+2*Be/3,y:We+Mt}],le.label.x=le.x,le.label.y=le.y}})}function re(z,te){return f.mapValues(f.pick(z,te),Number)}function K(z){var te={};return z&&Object.entries(z).forEach(([le,pe])=>{typeof le=="string"&&(le=le.toLowerCase()),te[le]=pe}),te}}),fVe=Ri((s,e)=>{var t=Jn(),i=Ml().Graph;e.exports={debugOrdering:n};function n(o){let r=t.buildLayerMatrix(o),a=new i({compound:!0,multigraph:!0}).setGraph({});return o.nodes().forEach(l=>{a.setNode(l,{label:l}),a.setParent(l,"layer"+o.node(l).rank)}),o.edges().forEach(l=>a.setEdge(l.v,l.w,{},l.name)),r.forEach((l,c)=>{let d="layer"+c;a.setNode(d,{rank:"same"}),l.reduce((h,u)=>(a.setEdge(h,u,{style:"invis"}),u))}),a}}),gVe=Ri((s,e)=>{e.exports="2.0.4"}),pVe=Ri((s,e)=>{e.exports={graphlib:Ml(),layout:uVe(),debug:fVe(),util:{time:Jn().time,notime:Jn().notime},version:gVe()}});const CY=pVe();/*! For license information please see dagre.esm.js.LEGAL.txt */const wY=300,SY=100;function rP(s,e,t="TB"){const i=new CY.graphlib.Graph;i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:t,ranksep:80,nodesep:40});for(const o of s)i.setNode(o.id,{width:wY,height:SY});for(const o of e)i.setEdge(o.source,o.target);return CY.layout(i),{nodes:s.map(o=>{const r=i.node(o.id);return{...o,position:{x:r.x-wY/2,y:r.y-SY/2}}}),edges:e}}function mVe({data:s}){var r;const e=s,[t,i]=je.useState(!1),n=e.status==="root"?"file-node--root":e.status==="expanded"?"file-node--expanded":e.status==="loading"?"file-node--loading":e.status==="error"?"file-node--error":"file-node--collapsed",o=e.repoAlias?"file-node--cross-repo":"";return ue.jsxs("div",{className:`file-node ${n} ${o}`,children:[!e.isRoot&&ue.jsx(uV,{type:"target",position:fV.Top}),ue.jsxs("div",{className:"file-node__header",children:[ue.jsx("span",{className:"file-node__icon",children:e.isRoot?"📄":e.status==="expanded"?"📋":e.repoAlias?"🔗":"📁"}),ue.jsx("span",{className:"file-node__label",title:e.filePath,children:e.label}),ue.jsx("span",{className:"file-node__actions",children:e.adoUrl&&ue.jsx("a",{href:e.adoUrl,target:"_blank",rel:"noopener noreferrer",className:"file-node__action-btn",title:"Open in Azure DevOps",onClick:a=>a.stopPropagation(),children:ue.jsx(_Ve,{})})})]}),e.repoAlias&&ue.jsxs("div",{className:"file-node__repo-row",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[ue.jsxs("span",{className:"file-node__repo",children:["@",e.repoAlias]}),e.repoInfo&&t&&ue.jsxs("div",{className:"file-node__repo-tooltip",children:[ue.jsxs("div",{className:"file-node__repo-tooltip-row",children:[ue.jsx("span",{className:"file-node__repo-tooltip-label",children:"Repo"}),ue.jsx("span",{children:e.repoInfo.fullName})]}),ue.jsxs("div",{className:"file-node__repo-tooltip-row",children:[ue.jsx("span",{className:"file-node__repo-tooltip-label",children:"Type"}),ue.jsx("span",{children:e.repoInfo.type})]}),e.repoInfo.ref&&ue.jsxs("div",{className:"file-node__repo-tooltip-row",children:[ue.jsx("span",{className:"file-node__repo-tooltip-label",children:"Ref"}),ue.jsx("span",{children:e.repoInfo.ref})]}),e.repoInfo.project&&ue.jsxs("div",{className:"file-node__repo-tooltip-row",children:[ue.jsx("span",{className:"file-node__repo-tooltip-label",children:"Project"}),ue.jsx("span",{children:e.repoInfo.project})]})]})]}),ue.jsxs("div",{className:"file-node__meta",children:[e.status==="loading"&&ue.jsx("span",{className:"file-node__spinner",children:"⏳ Loading..."}),e.status==="error"&&ue.jsxs("span",{className:"file-node__error",title:e.errorMessage,children:["❌ ",(r=e.errorMessage)==null?void 0:r.slice(0,80)]}),e.status==="collapsed"&&ue.jsx("span",{className:"file-node__hint",children:"Click to expand"}),e.status==="expanded"&&e.templateCount===0&&!e.isRoot&&ue.jsx("span",{className:"file-node__leaf",children:"✓ no nested templates"}),(e.status==="root"||e.status==="expanded")&&e.templateCount>0&&ue.jsxs("span",{className:"file-node__count",children:[e.templateCount," template ref(s)"]})]}),ue.jsx(uV,{type:"source",position:fV.Bottom})]})}function _Ve(){return ue.jsx("svg",{width:"14",height:"14",viewBox:"0 0 18 18",className:"file-node__ado-icon","aria-label":"Azure DevOps",children:ue.jsx("path",{d:"M17 4v9.74l-4 3.28-6.2-2.26V17l-3.51-4.59 10.23.8V4.44zm-3.41.49L7.85 1v2.29L2.58 4.84 1 6.87v4.61l2.26 1V6.57z",fill:"#3c91e5"})})}const bVe=je.memo(mVe);function aP({className:s,label:e,children:t}){const[i,n]=je.useState(!1);return ue.jsxs("span",{className:s,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[e,i&&ue.jsx("div",{className:"template-edge__badge-tooltip",children:t})]})}function vVe({id:s,sourceX:e,sourceY:t,targetX:i,targetY:n,sourcePosition:o,targetPosition:r,data:a,markerEnd:l,style:c}){var w;const d=a,[h,u]=je.useState(!1),[f,g,p]=Sre({sourceX:e,sourceY:t,sourcePosition:o,targetX:i,targetY:n,targetPosition:r}),_=je.useCallback(()=>u(!0),[]),v=je.useCallback(()=>u(!1),[]),b=((w=d==null?void 0:d.parameterNames)==null?void 0:w.length)??0;return ue.jsxs(ue.Fragment,{children:[ue.jsx(yre,{id:s,path:f,markerEnd:l,style:c}),ue.jsx(xre,{children:ue.jsxs("div",{className:"template-edge__label-container",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${g}px,${p}px)`,pointerEvents:"all"},children:[ue.jsxs("div",{className:"template-edge__top-row",children:[ue.jsx("span",{className:"template-edge__category",children:d==null?void 0:d.edgeLabel}),(d==null?void 0:d.conditional)&&ue.jsxs(aP,{className:`template-edge__badge template-edge__badge--conditional${d.conditionResult===!1?" template-edge__badge--condition-false":d.conditionResult===!0?" template-edge__badge--condition-true":""}`,label:d.conditionResult===!1?"⊘ false":d.conditionResult===!0?"✓ conditional":"conditional",children:[ue.jsx("div",{className:"template-edge__badge-tooltip-title",children:"⚡ Conditional Reference"}),ue.jsx("p",{children:d.conditionResult===!0?"Condition evaluated to true — this template will be included.":d.conditionResult===!1?"Condition evaluated to false — this template will NOT be included in this pipeline run.":"This template is inside a conditional block. The condition could not be fully evaluated."}),d.conditionExpression&&ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Condition"}),ue.jsx("code",{children:d.conditionExpression})]}),d.conditionResult!=null&&ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Result"}),ue.jsx("code",{children:String(d.conditionResult)})]})]}),(d==null?void 0:d.dynamicPath)&&d.expressionResolved&&ue.jsxs(aP,{className:"template-edge__badge template-edge__badge--resolved",label:"🔮 resolved",children:[ue.jsx("div",{className:"template-edge__badge-tooltip-title",children:"🔮 Expression Resolved"}),ue.jsx("p",{children:"The template path contained expressions that were successfully evaluated."}),ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Original"}),ue.jsx("code",{children:d.originalPath})]}),d.resolvedPath&&ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Resolved"}),ue.jsx("code",{children:d.resolvedPath})]})]}),(d==null?void 0:d.dynamicPath)&&!d.expressionResolved&&ue.jsxs(aP,{className:"template-edge__badge template-edge__badge--unresolved",label:"⚠️ dynamic",children:[ue.jsx("div",{className:"template-edge__badge-tooltip-title",children:"⚠️ Unresolved Expressions"}),ue.jsx("p",{children:"The template path contains expressions that could not be evaluated at analysis time."}),ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Original"}),ue.jsx("code",{children:d.originalPath})]}),d.resolvedPath&&d.resolvedPath!==d.originalPath&&ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Partial"}),ue.jsx("code",{children:d.resolvedPath})]}),d.unresolvedExpressions&&d.unresolvedExpressions.length>0&&ue.jsxs("div",{className:"template-edge__badge-tooltip-row",children:[ue.jsx("span",{className:"template-edge__badge-tooltip-label",children:"Unresolved"}),ue.jsx("span",{children:d.unresolvedExpressions.join(", ")})]})]})]}),b>0&&ue.jsxs("span",{className:"template-edge__params-badge",onMouseEnter:_,onMouseLeave:v,children:[CVe(d),h&&ue.jsx(wVe,{data:d})]})]})})]})}function CVe(s){var t;const e=((t=s.parameterNames)==null?void 0:t.length)??0;return s.totalParameterCount!=null?`${e}/${s.totalParameterCount} params`:`${e} params`}function wVe({data:s}){var t,i;const e=(t=s.declaredParameterNames)==null?void 0:t.filter(n=>{var o;return!((o=s.parameterNames)!=null&&o.includes(n))});return ue.jsxs("div",{className:"template-edge__params-tooltip",children:[s.parameterNames&&s.parameterNames.length>0&&ue.jsxs("div",{className:"template-edge__params-section",children:[ue.jsxs("div",{className:"template-edge__params-heading",children:["✓ Passed (",s.parameterNames.length,")"]}),ue.jsx("ul",{className:"template-edge__params-list",children:s.parameterNames.map(n=>ue.jsx("li",{className:"template-edge__params-item template-edge__params-item--passed",children:n},n))})]}),e&&e.length>0&&ue.jsxs("div",{className:"template-edge__params-section",children:[ue.jsxs("div",{className:"template-edge__params-heading",children:["○ Not passed (",e.length,")"]}),ue.jsx("ul",{className:"template-edge__params-list",children:e.map(n=>ue.jsx("li",{className:"template-edge__params-item template-edge__params-item--missing",children:n},n))})]}),s.totalParameterCount==null&&!((i=s.declaredParameterNames)!=null&&i.length)&&ue.jsx("div",{className:"template-edge__params-hint",children:"Expand node to see all declared params"})]})}const SVe=je.memo(vVe),yVe={fileNode:bVe},xVe={templateEdge:SVe},LVe={animated:!0,style:{stroke:"var(--accent)",strokeWidth:2},markerEnd:{type:NY.ArrowClosed,color:"var(--accent)"}};function kVe(){var M,A;const{org:s,project:e,selectedPipeline:t,selectedPipelineLoading:i,selectedPipelineError:n,expandedTemplates:o,setExpandedTemplate:r,setSelectedNodeDetail:a}=_2(),[l,c,d]=Lre([]),[h,u,f]=kre([]),g=je.useRef(null),p=je.useRef(null),_=je.useRef(""),v=je.useRef([]);je.useEffect(()=>{v.current=h},[h]);const[b,w]=je.useState(new Set),C=je.useRef(new Set),[S,x]=je.useState(!1),y=((A=(M=t==null?void 0:t.definition)==null?void 0:M.repository)==null?void 0:A.name)??"",L=je.useMemo(()=>{if(!(t!=null&&t.yaml))return[];try{const O=ib(t.yaml),W=O==null?void 0:O.resources;return(W==null?void 0:W.repositories)??[]}catch{return[]}},[t==null?void 0:t.yaml]),D=je.useMemo(()=>{if(!(t!=null&&t.yaml))return{};try{const O=ib(t.yaml);return eP(O??{})}catch{return{}}},[t==null?void 0:t.yaml]);je.useEffect(()=>{var Be,Mt,oo,Hi,Xi,ro,Ps;if(!(t!=null&&t.yaml)){c([]),u([]);return}const O=ib(t.yaml),W=((Be=t.definition)==null?void 0:Be.path)??"",V=sP(O??{},{sourcePath:W}),$=((Mt=t.definition)==null?void 0:Mt.name)??W.split("/").pop()??"Pipeline",q=NW(W),Z=JA(O??{}),Y=((Hi=(oo=t.definition)==null?void 0:oo.repository)==null?void 0:Hi.name)??"",Q=(Ps=(ro=(Xi=t.definition)==null?void 0:Xi.repository)==null?void 0:ro.defaultBranch)==null?void 0:Ps.replace(/^refs\/heads\//,""),re=s&&e&&Y?goe({org:s,project:e,repoName:Y,filePath:W,branch:Q}):void 0,K={id:"root",type:"fileNode",position:{x:0,y:0},data:{label:$,filePath:W,templateCount:V.length,status:"root",isRoot:!0,baseDir:q,adoUrl:re}},{templateNodes:z,templateEdges:te}=lP("root",V,s,e,y,L,Z,void 0,D),le=[K,...z],pe=[...te],{nodes:ve,edges:We}=rP(le,pe);c(ve),u(We),C.current=new Set},[t,c,u]);const E=je.useRef(!1);je.useEffect(()=>{if(!S||!g.current||l.length===0)return;const O=`${l.length}:${h.length}`;if(O!==_.current)return _.current=O,p.current!=null&&cancelAnimationFrame(p.current),p.current=requestAnimationFrame(()=>{var W;(W=g.current)==null||W.fitView({padding:.2,duration:300}),p.current=null}),()=>{p.current!=null&&(cancelAnimationFrame(p.current),p.current=null)}},[S,l.length,h.length]),je.useEffect(()=>{if(E.current)return;const O=l.filter(W=>{const V=W.data;if(V.status!=="collapsed"||C.current.has(W.id)||b.has(W.id))return!1;const $=V._conditionResult;return!($===!1||$==="unknown"&&!S)});if(O.length!==0){for(const W of O)C.current.add(W.id);E.current=!0,(async()=>{for(const W of O){const V=W.data;if(!(V.dynamicPath&&!V.expressionResolved))try{const{content:$,actualPath:q}=await cP(s,e,y,V,L,o,r),Z=ib($)??{},Y=V._ref,Q=sP(Z,{contextRepoAlias:Cv(Y??{}),sourcePath:q}),re=JG(Z);if(Q.length===0)c(K=>K.map(z=>z.id===W.id?{...z,data:{...z.data,status:"expanded",templateCount:0,totalParameterCount:re.length||void 0,declaredParameterNames:re.length?re:void 0}}:z));else if(S){const K=JA(Z),z=V._parentParamContext,te=V._accumulatedVariables,le=Y==null?void 0:Y.parameters,pe=jE(le,z,te),ve={...K,...pe},We=eP(Z),Be={...te??D,...We},Mt=V._accumulatedResources,oo=yY(Z),Hi=xY([...Mt??L,...oo]);await new Promise(vn=>setTimeout(vn,0));const Xi=new Set(l.map(vn=>vn.id)),{templateNodes:ro,templateEdges:Ps}=lP(W.id,Q,s,e,y,Hi,ve,Xi,Be);c(vn=>{const Do=new Set(vn.map(Os=>Os.id)),Pf=ro.filter(Os=>!Do.has(Os.id)),Jy=[...vn.map(Os=>Os.id===W.id?{...Os,data:{...Os.data,status:"expanded",templateCount:Q.length,totalParameterCount:re.length||void 0,declaredParameterNames:re.length?re:void 0}}:Os),...Pf],Oh=[...re.length?TL(v.current,W.id,re):v.current,...Ps];return rP(Jy,Oh).nodes}),u(vn=>[...re.length?TL(vn,W.id,re):vn,...Ps]),await new Promise(vn=>setTimeout(vn,50))}}catch{}}E.current=!1,S&&c(W=>[...W])})()}},[l,s,e,y,L,o,r,b,c,u,S]);const T=je.useCallback(async(O,W)=>{const V=W.data;if(V.status==="root"&&(t!=null&&t.yaml)){a({nodeId:W.id,label:V.label,filePath:V.filePath,yaml:t.yaml});return}if(V.status==="expanded"){const $=V._ref,q=Cv($??{})||"",Z=`${q}:${V.filePath}`,Y=V._fallbackPath,Q=Y?`${q}:${Y}`:void 0,re=o.get(Z)??(Q?o.get(Q):void 0);if(re){a({nodeId:W.id,label:V.label,filePath:V.filePath,yaml:re,repoAlias:V.repoAlias});return}try{const{content:K}=await cP(s,e,y,V,L,o,r);a({nodeId:W.id,label:V.label,filePath:V.filePath,yaml:K,repoAlias:V.repoAlias})}catch{}return}if(V.status==="collapsed"&&!b.has(W.id)){w($=>new Set($).add(W.id)),c($=>$.map(q=>q.id===W.id?{...q,data:{...q.data,status:"loading"}}:q));try{const{content:$,actualPath:q}=await cP(s,e,y,V,L,o,r),Z=ib($)??{},Y=V._ref,Q=sP(Z,{contextRepoAlias:Cv(Y??{}),sourcePath:q}),re=JA(Z),K=V._parentParamContext,z=V._accumulatedVariables,te=Y==null?void 0:Y.parameters,le=jE(te,K,z),pe={...re,...le},ve=JG(Z),We=NW(q),Be=eP(Z),Mt={...z??D,...Be},oo=V._accumulatedResources,Hi=yY(Z),Xi=xY([...oo??L,...Hi]),ro=new Set(l.map(Do=>Do.id)),{templateNodes:Ps,templateEdges:vn}=lP(W.id,Q,s,e,y,Xi,pe,ro,Mt);c(Do=>{const Pf=new Set(Do.map(Eo=>Eo.id)),GC=Ps.filter(Eo=>!Pf.has(Eo.id)),__=[...Do.map(Eo=>Eo.id===W.id?{...Eo,data:{...Eo.data,status:"expanded",templateCount:Q.length,totalParameterCount:ve.length||void 0,declaredParameterNames:ve.length?ve:void 0}}:Eo),...GC],Os=[...ve.length?TL(v.current,W.id,ve):v.current,...vn];return rP(__,Os).nodes}),u(Do=>[...ve.length?TL(Do,W.id,ve):Do,...vn]),a({nodeId:W.id,label:V.label,filePath:V.filePath,yaml:$,repoAlias:V.repoAlias})}catch($){const q=$ instanceof Error?$.message:String($);c(Z=>Z.map(Y=>Y.id===W.id?{...Y,data:{...Y.data,status:"error",errorMessage:q}}:Y))}finally{w($=>{const q=new Set($);return q.delete(W.id),q})}}},[s,e,y,t,L,o,r,a,b,c,u]),N=je.useCallback(()=>{x(O=>(O||(C.current=new Set,_.current=""),!O))},[]);return i?ue.jsx("div",{className:"pipeline-tree__empty",children:ue.jsxs("div",{className:"loading-indicator",children:[ue.jsx("span",{className:"loading-indicator__spinner",children:"⏳"}),ue.jsx("span",{children:"Loading pipeline..."})]})}):n?ue.jsx("div",{className:"error",children:n}):t?ue.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[ue.jsxs(Ire,{nodes:l,edges:h,onInit:O=>{g.current=O},onNodesChange:d,onEdgesChange:f,onNodeClick:T,nodeTypes:yVe,edgeTypes:xVe,defaultEdgeOptions:LVe,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},children:[ue.jsx(Dre,{variant:Ere.Dots,color:"var(--border)",gap:20}),ue.jsx(Nre,{})]}),ue.jsxs("label",{className:"auto-expand-toggle",children:[ue.jsx("input",{type:"checkbox",checked:S,onChange:N}),ue.jsx("span",{children:"Auto-expand all"})]})]}):ue.jsx("div",{className:"pipeline-tree__empty",children:"Select a pipeline to visualize"})}function TL(s,e,t){return s.map(i=>{if(i.target!==e)return i;const n=i.data??{};return{...i,data:{...n,totalParameterCount:t.length,declaredParameterNames:t}}})}function jE(s,e,t){if(!s||!e&&!t)return s;const i={};for(const[n,o]of Object.entries(s))if(typeof o=="string"&&WE(o)){const{result:r,isFullyResolved:a}=moe(o,{parameters:e,variables:t});i[n]=a?IVe(r):o}else o&&typeof o=="object"&&!Array.isArray(o)?i[n]=jE(o,e,t)??o:i[n]=o;return i}function IVe(s){if(s==="True"||s==="true")return!0;if(s==="False"||s==="false")return!1;if(s==="null")return null;if(s.startsWith("{")&&s.endsWith("}")||s.startsWith("[")&&s.endsWith("]"))try{return JSON.parse(s)}catch{}return s}function yY(s){const e=s.resources;if(!e)return[];const t=e.repositories;return Array.isArray(t)?t.filter(i=>i!=null&&typeof i=="object"&&"repository"in i&&"name"in i&&typeof i.repository=="string"&&typeof i.name=="string"):[]}function xY(s){const e=new Map;for(const t of s)e.set(t.repository,t);return Array.from(e.values())}function DVe(s,e){return`tpl::${s||"self"}::${e}`}function lP(s,e,t,i,n,o,r,a,l){const c=new Set,d=[],h=[];for(let u=0;u<e.length;u++){const f=e[u];let g=f.normalizedPath,p=!1,_=!0,v,b;if(WE(f.normalizedPath)){p=!0,v=f.normalizedPath;const W=QG(f.normalizedPath,r,void 0,l);g=W.resolvedPath,_=W.isFullyResolved,b=W.unresolved.length?W.unresolved:void 0}let w=Cv(f),C=!1,S=!0;if(w&&WE(w)){C=!0;const W=QG(w,r,void 0,l);W.isFullyResolved?w=W.resolvedPath:(S=!1,b=[...b??[],...W.unresolved])}const x=p||C,y=_&&S,{primary:L,fallback:D}=qBe({...f,normalizedPath:g,repoAlias:f.repoAlias,sourcePath:f.sourcePath}),E=DVe(w,L);if(c.has(E))continue;c.add(E);const T=a==null?void 0:a.has(E);let N;if(f.conditional&&f.conditionExpression)try{const W=poe(f.conditionExpression,{parameters:r,variables:l});typeof W=="boolean"?N=W:W===void 0||W===f.conditionExpression?N="unknown":N=!!W}catch{N="unknown"}else f.conditional&&(N="unknown");if(N===!1)continue;if(!T){const W=g.length>40?`...${g.slice(-37)}`:g,{repoInfo:V,adoUrl:$}=EVe(f,w,L,t,i,n,o),q=jE(f.parameters,r,l),Z=w!==Cv(f)||q!==f.parameters?{...f,repoAlias:w||f.repoAlias,contextRepoAlias:w||f.contextRepoAlias,parameters:q}:f;d.push({id:E,type:"fileNode",position:{x:0,y:0},data:{label:W,filePath:L,repoAlias:w,templateCount:0,status:"collapsed",isRoot:!1,baseDir:NW(L),adoUrl:$,repoInfo:V,templateLocation:f.location,dynamicPath:x||void 0,expressionResolved:x?y:void 0,_ref:Z,_fallbackPath:D,_parentParamContext:r,_accumulatedResources:o,_accumulatedVariables:l,_conditionResult:N}})}const M=f.location==="extends"?"extends":f.location==="extends-parameters"?"extends param":f.location,A=!!w,O=f.parameters?Object.keys(f.parameters):void 0;h.push({id:`${s}->${E}`,source:s,target:E,type:"templateEdge",data:{edgeLabel:M,parameterNames:O,isExternal:A||void 0,conditional:f.conditional||void 0,conditionExpression:f.conditionExpression,conditionResult:N,dynamicPath:x||void 0,expressionResolved:x?y:void 0,originalPath:v||(C?f.rawPath:void 0),resolvedPath:x?L:void 0,unresolvedExpressions:b},style:A?{stroke:"var(--badge-resources)",strokeWidth:2,strokeDasharray:"6 3"}:void 0,markerEnd:A?{type:NY.ArrowClosed,color:"var(--badge-resources)"}:void 0})}return{templateNodes:d,templateEdges:h}}async function cP(s,e,t,i,n,o,r){const a=i._ref;if(!a)throw new Error("No template reference on this node");const l=i.filePath,c=i._fallbackPath,d=Cv(a),h=`${d||""}:${l}`,u=o.get(h);if(u)return{content:u,actualPath:l};if(c){const C=`${d||""}:${c}`,S=o.get(C);if(S)return{content:S,actualPath:c}}const g=i._accumulatedResources??n;let p=e,_=t,v;if(d&&g.length){const C=uoe(d,g);C?(p=C.project||e,_=C.repoName,v=C.ref):_=d}else d&&(_=d);let b,w=l;try{b=await EW(s,p,_,l,v)}catch(C){if(c)b=await EW(s,p,_,c,v),w=c;else throw C}return r(`${d||""}:${w}`,b.content),{content:b.content,actualPath:w}}function NW(s){const e=s.replace(/\\/g,"/"),t=e.lastIndexOf("/");return t>0?e.slice(0,t):""}function EVe(s,e,t,i,n,o,r){let a=n,l=o,c,d;if(e&&r.length){const u=uoe(e,r),f=r.find(g=>g.repository===e);u?(a=u.project||n,l=u.repoName,c=u.ref):l=e,f&&(d={alias:e,fullName:f.name,type:f.type,ref:f.ref,project:u==null?void 0:u.project})}else e&&(l=e);const h=i&&a&&l?goe({org:i,project:a,repoName:l,filePath:t,ref:c}):void 0;return{repoInfo:d,adoUrl:h}}function NVe(){const{org:s,project:e,setConnection:t,pipelines:i,pipelinesLoading:n,pipelinesError:o,setPipelines:r,setPipelinesLoading:a,setPipelinesError:l,setSelectedPipeline:c,setSelectedPipelineLoading:d,setSelectedPipelineError:h}=_2(),[u,f]=je.useState(""),[g,p]=je.useState(null),[_,v]=je.useState(s),[b,w]=je.useState(e),[C,S]=je.useState("url"),[x,y]=je.useState(!1),L=je.useRef(!1);je.useEffect(()=>{if(L.current)return;L.current=!0;const A=new URLSearchParams(window.location.search),O=A.get("url"),W=A.get("org"),V=A.get("project"),$=A.get("repo"),q=A.get("path"),Z=A.get("branch")??void 0,Y=A.get("pipelineId");if(O)f(O),D(O);else if(W&&V&&$&&q){const Q=`https://dev.azure.com/${W}/${V}/_git/${$}?path=${q}${Z?`&version=GB${Z}`:""}`;f(Q),D(Q)}else W&&V&&Y&&E(W,V,Number(Y))},[]);const D=async A=>{const O=GBe(A);if(!O){p("Invalid Azure DevOps URL");return}t(O.org,O.project),d(!0),h(null),y(!0);try{const W=await EW(O.org,O.project,O.repoName,O.filePath,O.branch);c({definition:{id:0,name:O.filePath.split("/").pop()||O.filePath,path:O.filePath,repository:{id:W.repoId,name:W.repoName,type:"git",defaultBranch:W.branch||""}},yaml:W.content})}catch(W){h(W instanceof Error?W.message:String(W))}finally{d(!1),y(!1)}},E=async(A,O,W)=>{t(A,O),d(!0),h(null);try{const V=await vY(A,O,W);c(V)}catch(V){h(V instanceof Error?V.message:String(V))}finally{d(!1)}},T=async()=>{u.trim()&&(p(null),await D(u.trim()))},N=async()=>{if(!(!_||!b)){t(_,b),a(!0),l(null);try{const A=await zHe(_,b);r(A)}catch(A){l(A instanceof Error?A.message:String(A))}finally{a(!1)}}},M=async A=>{d(!0),h(null);try{const O=await vY(s,e,A);c(O)}catch(O){h(O instanceof Error?O.message:String(O))}finally{d(!1)}};return ue.jsxs("div",{className:"pipeline-selector",children:[ue.jsxs("div",{className:"mode-tabs",children:[ue.jsx("button",{className:`mode-tab ${C==="url"?"mode-tab--active":""}`,onClick:()=>S("url"),children:"Paste URL"}),ue.jsx("button",{className:`mode-tab ${C==="browse"?"mode-tab--active":""}`,onClick:()=>S("browse"),children:"Browse"})]}),C==="url"&&ue.jsxs("div",{className:"connection-form",children:[ue.jsx("label",{className:"form-label",children:"Azure DevOps file URL"}),ue.jsx("textarea",{placeholder:"https://dev.azure.com/{org}/{project}/_git/{repo}?path=/{pipeline}.yml",value:u,onChange:A=>f(A.target.value),rows:3}),ue.jsx("button",{onClick:T,disabled:!u.trim()||x,children:x?"⏳ Loading...":"Load Pipeline"}),g&&ue.jsx("div",{className:"error",children:g})]}),C==="browse"&&ue.jsxs(ue.Fragment,{children:[ue.jsxs("div",{className:"connection-form",children:[ue.jsx("input",{type:"text",placeholder:"Organization",value:_,onChange:A=>v(A.target.value)}),ue.jsx("input",{type:"text",placeholder:"Project",value:b,onChange:A=>w(A.target.value)}),ue.jsx("button",{onClick:N,disabled:n,children:n?"Loading...":"Load Pipelines"})]}),o&&ue.jsx("div",{className:"error",children:o}),i.length>0&&ue.jsxs("div",{className:"pipeline-list",children:[ue.jsx("h3",{children:"Pipelines"}),ue.jsx("ul",{children:i.map(A=>ue.jsx("li",{children:ue.jsxs("button",{onClick:()=>M(A.id),children:[A.folder!=="\\"?`${A.folder}\\`:"",A.name]})},A.id))})]})]})]})}const TVe=280,RVe=900,MVe=420;function AVe(){const{setCustomTaskDocs:s,setTaskSchema:e,selectedNodeDetail:t,org:i}=_2(),[n,o]=je.useState(MVe),r=je.useRef(!1);je.useEffect(()=>{UHe().then(l=>s(l.customTaskDocs)).catch(()=>{})},[s]),je.useEffect(()=>{i&&$He(i).then(l=>e(l.tasks)).catch(()=>{})},[i,e]);const a=je.useCallback(l=>{l.preventDefault(),r.current=!0;const c=l.clientX,d=n;document.body.style.cursor="col-resize",document.body.style.userSelect="none";const h=f=>{const g=c-f.clientX,p=Math.min(RVe,Math.max(TVe,d+g));o(p)},u=()=>{r.current=!1,document.body.style.cursor="",document.body.style.userSelect="",window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",u)};window.addEventListener("mousemove",h),window.addEventListener("mouseup",u)},[n]);return ue.jsxs("div",{className:"app",children:[ue.jsx("header",{className:"app__header",children:ue.jsx("h1",{children:"🔧 Azure Pipelines Visualizer"})}),ue.jsxs("main",{className:"app__main",children:[ue.jsx("aside",{className:"app__sidebar",children:ue.jsx(oP,{children:ue.jsx(NVe,{})})}),ue.jsx("section",{className:"app__content",children:ue.jsx(oP,{children:ue.jsx(kVe,{})})}),t&&ue.jsxs(ue.Fragment,{children:[ue.jsx("div",{className:"app__detail-resize-handle",onMouseDown:a,title:"Drag to resize"}),ue.jsx("aside",{className:"app__detail",style:{width:n},children:ue.jsx(oP,{children:ue.jsx(MHe,{})})})]})]})]})}SW.createRoot(document.getElementById("root")).render(ue.jsx(Eu.StrictMode,{children:ue.jsx(AVe,{})}));export{Cb as l};
@@ -1 +1 @@
1
- import{l as e}from"./index-Dn8YzZGe.js";import"./reactflow-N78VftLX.js";const o={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},r={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}};export{o as conf,r as language};
1
+ import{l as e}from"./index-BjdcehmG.js";import"./reactflow-N78VftLX.js";const o={comments:{lineComment:"#"},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],folding:{offSide:!0},onEnterRules:[{beforeText:/:\s*$/,action:{indentAction:e.IndentAction.Indent}}]},r={tokenPostfix:".yaml",brackets:[{token:"delimiter.bracket",open:"{",close:"}"},{token:"delimiter.square",open:"[",close:"]"}],keywords:["true","True","TRUE","false","False","FALSE","null","Null","Null","~"],numberInteger:/(?:0|[+-]?[0-9]+)/,numberFloat:/(?:0|[+-]?[0-9]+)(?:\.[0-9]+)?(?:e[-+][1-9][0-9]*)?/,numberOctal:/0o[0-7]+/,numberHex:/0x[0-9a-fA-F]+/,numberInfinity:/[+-]?\.(?:inf|Inf|INF)/,numberNaN:/\.(?:nan|Nan|NAN)/,numberDate:/\d{4}-\d\d-\d\d([Tt ]\d\d:\d\d:\d\d(\.\d+)?(( ?[+-]\d\d?(:\d\d)?)|Z)?)?/,escapes:/\\(?:[btnfr\\"']|[0-7][0-7]?|[0-3][0-7]{2})/,tokenizer:{root:[{include:"@whitespace"},{include:"@comment"},[/%[^ ]+.*$/,"meta.directive"],[/---/,"operators.directivesEnd"],[/\.{3}/,"operators.documentEnd"],[/[-?:](?= )/,"operators"],{include:"@anchor"},{include:"@tagHandle"},{include:"@flowCollections"},{include:"@blockStyle"},[/@numberInteger(?![ \t]*\S+)/,"number"],[/@numberFloat(?![ \t]*\S+)/,"number.float"],[/@numberOctal(?![ \t]*\S+)/,"number.octal"],[/@numberHex(?![ \t]*\S+)/,"number.hex"],[/@numberInfinity(?![ \t]*\S+)/,"number.infinity"],[/@numberNaN(?![ \t]*\S+)/,"number.nan"],[/@numberDate(?![ \t]*\S+)/,"number.date"],[/(".*?"|'.*?'|[^#'"]*?)([ \t]*)(:)( |$)/,["type","white","operators","white"]],{include:"@flowScalars"},[/.+?(?=(\s+#|$))/,{cases:{"@keywords":"keyword","@default":"string"}}]],object:[{include:"@whitespace"},{include:"@comment"},[/\}/,"@brackets","@pop"],[/,/,"delimiter.comma"],[/:(?= )/,"operators"],[/(?:".*?"|'.*?'|[^,\{\[]+?)(?=: )/,"type"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\},]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],array:[{include:"@whitespace"},{include:"@comment"},[/\]/,"@brackets","@pop"],[/,/,"delimiter.comma"],{include:"@flowCollections"},{include:"@flowScalars"},{include:"@tagHandle"},{include:"@anchor"},{include:"@flowNumber"},[/[^\],]+/,{cases:{"@keywords":"keyword","@default":"string"}}]],multiString:[[/^( +).+$/,"string","@multiStringContinued.$1"]],multiStringContinued:[[/^( *).+$/,{cases:{"$1==$S2":"string","@default":{token:"@rematch",next:"@popall"}}}]],whitespace:[[/[ \t\r\n]+/,"white"]],comment:[[/#.*$/,"comment"]],flowCollections:[[/\[/,"@brackets","@array"],[/\{/,"@brackets","@object"]],flowScalars:[[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/'[^']*'/,"string"],[/"/,"string","@doubleQuotedString"]],doubleQuotedString:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,"string","@pop"]],blockStyle:[[/[>|][0-9]*[+-]?$/,"operators","@multiString"]],flowNumber:[[/@numberInteger(?=[ \t]*[,\]\}])/,"number"],[/@numberFloat(?=[ \t]*[,\]\}])/,"number.float"],[/@numberOctal(?=[ \t]*[,\]\}])/,"number.octal"],[/@numberHex(?=[ \t]*[,\]\}])/,"number.hex"],[/@numberInfinity(?=[ \t]*[,\]\}])/,"number.infinity"],[/@numberNaN(?=[ \t]*[,\]\}])/,"number.nan"],[/@numberDate(?=[ \t]*[,\]\}])/,"number.date"]],tagHandle:[[/\![^ ]*/,"tag"]],anchor:[[/[&*][^ ]+/,"namespace"]]}};export{o as conf,r as language};
@@ -8,7 +8,7 @@
8
8
  href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='12' fill='%230078d4'/%3E%3Cpath d='M18 20h28v6H18zm0 10h20v6H18zm0 10h28v6H18z' fill='white'/%3E%3C/svg%3E"
9
9
  />
10
10
  <title>Azure Pipelines Visualizer</title>
11
- <script type="module" crossorigin src="./assets/index-Dn8YzZGe.js"></script>
11
+ <script type="module" crossorigin src="./assets/index-BjdcehmG.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="./assets/reactflow-N78VftLX.js">
13
13
  <link rel="stylesheet" crossorigin href="./assets/index-C9Zf3xe0.css">
14
14
  </head>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meirblachman/azure-pipelines-visualizer",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Visualize Azure Pipelines template trees as interactive diagrams",
5
5
  "type": "module",
6
6
  "bin": {